@alma/widgets 2.3.3 → 2.5.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.
Files changed (36) hide show
  1. package/dist/raw/widgets.js +878 -467
  2. package/dist/raw/widgets.js.map +1 -1
  3. package/dist/raw/widgets.m.js +878 -467
  4. package/dist/raw/widgets.m.js.map +1 -1
  5. package/dist/raw/widgets.modern.js +876 -464
  6. package/dist/raw/widgets.modern.js.map +1 -1
  7. package/dist/raw/widgets.umd.js +1308 -845
  8. package/dist/raw/widgets.umd.js.map +1 -1
  9. package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +3 -1
  10. package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +3 -1
  11. package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +18 -0
  12. package/dist/types/Widgets/EligibilityModal/components/Title/index.d.ts +3 -1
  13. package/dist/types/Widgets/PaymentPlans/classNames.const.d.ts +13 -0
  14. package/dist/types/test/fixtures.d.ts +41 -0
  15. package/dist/types/types.d.ts +7 -1
  16. package/dist/widgets.js +1 -1
  17. package/dist/widgets.js.map +1 -1
  18. package/dist/widgets.m.js +1 -1
  19. package/dist/widgets.m.js.map +1 -1
  20. package/dist/widgets.modern.js +1 -1
  21. package/dist/widgets.modern.js.map +1 -1
  22. package/dist/widgets.umd.js +1 -1
  23. package/dist/widgets.umd.js.map +1 -1
  24. package/package.json +7 -13
  25. package/CHANGELOG.md +0 -256
  26. package/dist/types/Widgets/EligibilityModal/ModalContainer.test.d.ts +0 -1
  27. package/dist/types/Widgets/EligibilityModal/modal.test.d.ts +0 -1
  28. package/dist/types/Widgets/PaymentPlans/__tests__/Basics.test.d.ts +0 -1
  29. package/dist/types/Widgets/PaymentPlans/__tests__/Credit.test.d.ts +0 -1
  30. package/dist/types/Widgets/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +0 -1
  31. package/dist/types/Widgets/PaymentPlans/__tests__/HideWidget.test.d.ts +0 -1
  32. package/dist/types/Widgets/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +0 -1
  33. package/dist/types/Widgets/PaymentPlans/__tests__/LanguageCheck.test.d.ts +0 -1
  34. package/dist/types/Widgets/PaymentPlans/__tests__/LaunchModal.test.d.ts +0 -1
  35. package/dist/types/Widgets/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +0 -1
  36. package/dist/types/Widgets/PaymentPlans/__tests__/WithoutPlans.test.d.ts +0 -1
@@ -10,40 +10,44 @@ var noScroll = _interopDefault(require('no-scroll'));
10
10
  var reactResponsive = require('react-responsive');
11
11
  var dateFns = require('date-fns');
12
12
 
13
- var ceil = Math.ceil;
14
- var floor = Math.floor; // `ToInteger` abstract operation
15
- // https://tc39.github.io/ecma262/#sec-tointeger
16
-
17
- var toInteger = function (argument) {
18
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
13
+ var fails = function (exec) {
14
+ try {
15
+ return !!exec();
16
+ } catch (error) {
17
+ return true;
18
+ }
19
19
  };
20
20
 
21
- // `RequireObjectCoercible` abstract operation
22
- // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
23
- var requireObjectCoercible = function (it) {
24
- if (it == undefined) throw TypeError("Can't call method on " + it);
25
- return it;
26
- };
21
+ var functionBindNative = !fails(function () {
22
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
23
+ var test = function () {
24
+ /* empty */
25
+ }.bind(); // eslint-disable-next-line no-prototype-builtins -- safe
27
26
 
28
- var createMethod = function (CONVERT_TO_STRING) {
29
- return function ($this, pos) {
30
- var S = String(requireObjectCoercible($this));
31
- var position = toInteger(pos);
32
- var size = S.length;
33
- var first, second;
34
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
35
- first = S.charCodeAt(position);
36
- return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
27
+
28
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
29
+ });
30
+
31
+ var FunctionPrototype = Function.prototype;
32
+ var bind = FunctionPrototype.bind;
33
+ var call = FunctionPrototype.call;
34
+ var uncurryThis = functionBindNative && bind.bind(call, call);
35
+ var functionUncurryThis = functionBindNative ? function (fn) {
36
+ return fn && uncurryThis(fn);
37
+ } : function (fn) {
38
+ return fn && function () {
39
+ return call.apply(fn, arguments);
37
40
  };
38
41
  };
39
42
 
40
- var stringMultibyte = {
41
- // `String.prototype.codePointAt` method
42
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
43
- codeAt: createMethod(false),
44
- // `String.prototype.at` method
45
- // https://github.com/mathiasbynens/String.prototype.at
46
- charAt: createMethod(true)
43
+ var ceil = Math.ceil;
44
+ var floor = Math.floor; // `ToIntegerOrInfinity` abstract operation
45
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
46
+
47
+ var toIntegerOrInfinity = function (argument) {
48
+ var number = +argument; // eslint-disable-next-line no-self-compare -- safe
49
+
50
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
47
51
  };
48
52
 
49
53
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -67,21 +71,241 @@ var check = function (it) {
67
71
  }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
68
72
 
69
73
 
70
- var global_1 = // eslint-disable-next-line no-undef
71
- check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func
74
+ var global_1 = // eslint-disable-next-line es-x/no-global-this -- safe
75
+ check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
76
+ check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
72
77
  function () {
73
78
  return this;
74
79
  }() || Function('return this')();
75
80
 
76
- var fails = function (exec) {
81
+ var defineProperty = Object.defineProperty;
82
+
83
+ var setGlobal = function (key, value) {
77
84
  try {
78
- return !!exec();
85
+ defineProperty(global_1, key, {
86
+ value: value,
87
+ configurable: true,
88
+ writable: true
89
+ });
79
90
  } catch (error) {
80
- return true;
91
+ global_1[key] = value;
92
+ }
93
+
94
+ return value;
95
+ };
96
+
97
+ var SHARED = '__core-js_shared__';
98
+ var store = global_1[SHARED] || setGlobal(SHARED, {});
99
+ var sharedStore = store;
100
+
101
+ var shared = createCommonjsModule(function (module) {
102
+ (module.exports = function (key, value) {
103
+ return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
104
+ })('versions', []).push({
105
+ version: '3.22.1',
106
+ mode: 'global',
107
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
108
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE',
109
+ source: 'https://github.com/zloirock/core-js'
110
+ });
111
+ });
112
+
113
+ var TypeError$1 = global_1.TypeError; // `RequireObjectCoercible` abstract operation
114
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
115
+
116
+ var requireObjectCoercible = function (it) {
117
+ if (it == undefined) throw TypeError$1("Can't call method on " + it);
118
+ return it;
119
+ };
120
+
121
+ var Object$1 = global_1.Object; // `ToObject` abstract operation
122
+ // https://tc39.es/ecma262/#sec-toobject
123
+
124
+ var toObject = function (argument) {
125
+ return Object$1(requireObjectCoercible(argument));
126
+ };
127
+
128
+ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation
129
+ // https://tc39.es/ecma262/#sec-hasownproperty
130
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
131
+
132
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
133
+ return hasOwnProperty(toObject(it), key);
134
+ };
135
+
136
+ var id = 0;
137
+ var postfix = Math.random();
138
+ var toString = functionUncurryThis(1.0.toString);
139
+
140
+ var uid = function (key) {
141
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
142
+ };
143
+
144
+ // `IsCallable` abstract operation
145
+ // https://tc39.es/ecma262/#sec-iscallable
146
+ var isCallable = function (argument) {
147
+ return typeof argument == 'function';
148
+ };
149
+
150
+ var aFunction = function (argument) {
151
+ return isCallable(argument) ? argument : undefined;
152
+ };
153
+
154
+ var getBuiltIn = function (namespace, method) {
155
+ return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
156
+ };
157
+
158
+ var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
159
+
160
+ var process = global_1.process;
161
+ var Deno = global_1.Deno;
162
+ var versions = process && process.versions || Deno && Deno.version;
163
+ var v8 = versions && versions.v8;
164
+ var match, version;
165
+
166
+ if (v8) {
167
+ match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10
168
+ // but their correct versions are not interesting for us
169
+
170
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
171
+ } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
172
+ // so check `userAgent` even if `.v8` exists, but 0
173
+
174
+
175
+ if (!version && engineUserAgent) {
176
+ match = engineUserAgent.match(/Edge\/(\d+)/);
177
+
178
+ if (!match || match[1] >= 74) {
179
+ match = engineUserAgent.match(/Chrome\/(\d+)/);
180
+ if (match) version = +match[1];
181
+ }
182
+ }
183
+
184
+ var engineV8Version = version;
185
+
186
+ /* eslint-disable es-x/no-symbol -- required for testing */
187
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
188
+
189
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
190
+ var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion
191
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
192
+
193
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
194
+ !Symbol.sham && engineV8Version && engineV8Version < 41;
195
+ });
196
+
197
+ /* eslint-disable es-x/no-symbol -- required for testing */
198
+
199
+ var useSymbolAsUid = nativeSymbol && !Symbol.sham && typeof Symbol.iterator == 'symbol';
200
+
201
+ var WellKnownSymbolsStore = shared('wks');
202
+ var Symbol$1 = global_1.Symbol;
203
+ var symbolFor = Symbol$1 && Symbol$1['for'];
204
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
205
+
206
+ var wellKnownSymbol = function (name) {
207
+ if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
208
+ var description = 'Symbol.' + name;
209
+
210
+ if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
211
+ WellKnownSymbolsStore[name] = Symbol$1[name];
212
+ } else if (useSymbolAsUid && symbolFor) {
213
+ WellKnownSymbolsStore[name] = symbolFor(description);
214
+ } else {
215
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
216
+ }
217
+ }
218
+
219
+ return WellKnownSymbolsStore[name];
220
+ };
221
+
222
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
223
+ var test = {};
224
+ test[TO_STRING_TAG] = 'z';
225
+ var toStringTagSupport = String(test) === '[object z]';
226
+
227
+ var toString$1 = functionUncurryThis({}.toString);
228
+ var stringSlice = functionUncurryThis(''.slice);
229
+
230
+ var classofRaw = function (it) {
231
+ return stringSlice(toString$1(it), 8, -1);
232
+ };
233
+
234
+ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
235
+ var Object$2 = global_1.Object; // ES3 wrong here
236
+
237
+ var CORRECT_ARGUMENTS = classofRaw(function () {
238
+ return arguments;
239
+ }()) == 'Arguments'; // fallback for IE11 Script Access Denied error
240
+
241
+ var tryGet = function (it, key) {
242
+ try {
243
+ return it[key];
244
+ } catch (error) {
245
+ /* empty */
81
246
  }
247
+ }; // getting tag from ES6+ `Object.prototype.toString`
248
+
249
+
250
+ var classof = toStringTagSupport ? classofRaw : function (it) {
251
+ var O, tag, result;
252
+ return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
253
+ : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$1)) == 'string' ? tag // builtinTag case
254
+ : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
255
+ : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
256
+ };
257
+
258
+ var String$1 = global_1.String;
259
+
260
+ var toString_1 = function (argument) {
261
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
262
+ return String$1(argument);
263
+ };
264
+
265
+ var charAt = functionUncurryThis(''.charAt);
266
+ var charCodeAt = functionUncurryThis(''.charCodeAt);
267
+ var stringSlice$1 = functionUncurryThis(''.slice);
268
+
269
+ var createMethod = function (CONVERT_TO_STRING) {
270
+ return function ($this, pos) {
271
+ var S = toString_1(requireObjectCoercible($this));
272
+ var position = toIntegerOrInfinity(pos);
273
+ var size = S.length;
274
+ var first, second;
275
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
276
+ first = charCodeAt(S, position);
277
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice$1(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
278
+ };
279
+ };
280
+
281
+ var stringMultibyte = {
282
+ // `String.prototype.codePointAt` method
283
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
284
+ codeAt: createMethod(false),
285
+ // `String.prototype.at` method
286
+ // https://github.com/mathiasbynens/String.prototype.at
287
+ charAt: createMethod(true)
288
+ };
289
+
290
+ var functionToString = functionUncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
291
+
292
+ if (!isCallable(sharedStore.inspectSource)) {
293
+ sharedStore.inspectSource = function (it) {
294
+ return functionToString(it);
295
+ };
296
+ }
297
+
298
+ var inspectSource = sharedStore.inspectSource;
299
+
300
+ var WeakMap = global_1.WeakMap;
301
+ var nativeWeakMap = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
302
+
303
+ var isObject = function (it) {
304
+ return typeof it == 'object' ? it !== null : isCallable(it);
82
305
  };
83
306
 
84
307
  var descriptors = !fails(function () {
308
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
85
309
  return Object.defineProperty({}, 1, {
86
310
  get: function () {
87
311
  return 7;
@@ -89,10 +313,6 @@ var descriptors = !fails(function () {
89
313
  })[1] != 7;
90
314
  });
91
315
 
92
- var isObject = function (it) {
93
- return typeof it === 'object' ? it !== null : typeof it === 'function';
94
- };
95
-
96
316
  var document$1 = global_1.document; // typeof document.createElement is 'object' in old IE
97
317
 
98
318
  var EXISTS = isObject(document$1) && isObject(document$1.createElement);
@@ -102,6 +322,7 @@ var documentCreateElement = function (it) {
102
322
  };
103
323
 
104
324
  var ie8DomDefine = !descriptors && !fails(function () {
325
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
105
326
  return Object.defineProperty(documentCreateElement('div'), 'a', {
106
327
  get: function () {
107
328
  return 7;
@@ -109,40 +330,142 @@ var ie8DomDefine = !descriptors && !fails(function () {
109
330
  }).a != 7;
110
331
  });
111
332
 
112
- var anObject = function (it) {
113
- if (!isObject(it)) {
114
- throw TypeError(String(it) + ' is not an object');
333
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
334
+
335
+ var v8PrototypeDefineBug = descriptors && fails(function () {
336
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
337
+ return Object.defineProperty(function () {
338
+ /* empty */
339
+ }, 'prototype', {
340
+ value: 42,
341
+ writable: false
342
+ }).prototype != 42;
343
+ });
344
+
345
+ var String$2 = global_1.String;
346
+ var TypeError$2 = global_1.TypeError; // `Assert: Type(argument) is Object`
347
+
348
+ var anObject = function (argument) {
349
+ if (isObject(argument)) return argument;
350
+ throw TypeError$2(String$2(argument) + ' is not an object');
351
+ };
352
+
353
+ var call$1 = Function.prototype.call;
354
+ var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
355
+ return call$1.apply(call$1, arguments);
356
+ };
357
+
358
+ var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
359
+
360
+ var Object$3 = global_1.Object;
361
+ var isSymbol = useSymbolAsUid ? function (it) {
362
+ return typeof it == 'symbol';
363
+ } : function (it) {
364
+ var $Symbol = getBuiltIn('Symbol');
365
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
366
+ };
367
+
368
+ var String$3 = global_1.String;
369
+
370
+ var tryToString = function (argument) {
371
+ try {
372
+ return String$3(argument);
373
+ } catch (error) {
374
+ return 'Object';
115
375
  }
376
+ };
116
377
 
117
- return it;
378
+ var TypeError$3 = global_1.TypeError; // `Assert: IsCallable(argument) is true`
379
+
380
+ var aCallable = function (argument) {
381
+ if (isCallable(argument)) return argument;
382
+ throw TypeError$3(tryToString(argument) + ' is not a function');
383
+ };
384
+
385
+ // https://tc39.es/ecma262/#sec-getmethod
386
+
387
+ var getMethod = function (V, P) {
388
+ var func = V[P];
389
+ return func == null ? undefined : aCallable(func);
118
390
  };
119
391
 
120
- // https://tc39.github.io/ecma262/#sec-toprimitive
121
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
122
- // and the second argument - flag - preferred type is a string
392
+ var TypeError$4 = global_1.TypeError; // `OrdinaryToPrimitive` abstract operation
393
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
123
394
 
124
- var toPrimitive = function (input, PREFERRED_STRING) {
125
- if (!isObject(input)) return input;
395
+ var ordinaryToPrimitive = function (input, pref) {
126
396
  var fn, val;
127
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
128
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
129
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
130
- throw TypeError("Can't convert object to primitive value");
397
+ if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
398
+ if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
399
+ if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
400
+ throw TypeError$4("Can't convert object to primitive value");
131
401
  };
132
402
 
133
- var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method
134
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
403
+ var TypeError$5 = global_1.TypeError;
404
+ var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation
405
+ // https://tc39.es/ecma262/#sec-toprimitive
135
406
 
136
- var f = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
407
+ var toPrimitive = function (input, pref) {
408
+ if (!isObject(input) || isSymbol(input)) return input;
409
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
410
+ var result;
411
+
412
+ if (exoticToPrim) {
413
+ if (pref === undefined) pref = 'default';
414
+ result = functionCall(exoticToPrim, input, pref);
415
+ if (!isObject(result) || isSymbol(result)) return result;
416
+ throw TypeError$5("Can't convert object to primitive value");
417
+ }
418
+
419
+ if (pref === undefined) pref = 'number';
420
+ return ordinaryToPrimitive(input, pref);
421
+ };
422
+
423
+ // https://tc39.es/ecma262/#sec-topropertykey
424
+
425
+ var toPropertyKey = function (argument) {
426
+ var key = toPrimitive(argument, 'string');
427
+ return isSymbol(key) ? key : key + '';
428
+ };
429
+
430
+ var TypeError$6 = global_1.TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
431
+
432
+ var $defineProperty = Object.defineProperty; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
433
+
434
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
435
+ var ENUMERABLE = 'enumerable';
436
+ var CONFIGURABLE = 'configurable';
437
+ var WRITABLE = 'writable'; // `Object.defineProperty` method
438
+ // https://tc39.es/ecma262/#sec-object.defineproperty
439
+
440
+ var f = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
441
+ anObject(O);
442
+ P = toPropertyKey(P);
443
+ anObject(Attributes);
444
+
445
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
446
+ var current = $getOwnPropertyDescriptor(O, P);
447
+
448
+ if (current && current[WRITABLE]) {
449
+ O[P] = Attributes.value;
450
+ Attributes = {
451
+ configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
452
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
453
+ writable: false
454
+ };
455
+ }
456
+ }
457
+
458
+ return $defineProperty(O, P, Attributes);
459
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
137
460
  anObject(O);
138
- P = toPrimitive(P, true);
461
+ P = toPropertyKey(P);
139
462
  anObject(Attributes);
140
463
  if (ie8DomDefine) try {
141
- return nativeDefineProperty(O, P, Attributes);
464
+ return $defineProperty(O, P, Attributes);
142
465
  } catch (error) {
143
466
  /* empty */
144
467
  }
145
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
468
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
146
469
  if ('value' in Attributes) O[P] = Attributes.value;
147
470
  return O;
148
471
  };
@@ -166,56 +489,6 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
166
489
  return object;
167
490
  };
168
491
 
169
- var setGlobal = function (key, value) {
170
- try {
171
- createNonEnumerableProperty(global_1, key, value);
172
- } catch (error) {
173
- global_1[key] = value;
174
- }
175
-
176
- return value;
177
- };
178
-
179
- var SHARED = '__core-js_shared__';
180
- var store = global_1[SHARED] || setGlobal(SHARED, {});
181
- var sharedStore = store;
182
-
183
- var functionToString = Function.toString; // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
184
-
185
- if (typeof sharedStore.inspectSource != 'function') {
186
- sharedStore.inspectSource = function (it) {
187
- return functionToString.call(it);
188
- };
189
- }
190
-
191
- var inspectSource = sharedStore.inspectSource;
192
-
193
- var WeakMap = global_1.WeakMap;
194
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
195
-
196
- var hasOwnProperty = {}.hasOwnProperty;
197
-
198
- var has = function (it, key) {
199
- return hasOwnProperty.call(it, key);
200
- };
201
-
202
- var shared = createCommonjsModule(function (module) {
203
- (module.exports = function (key, value) {
204
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
205
- })('versions', []).push({
206
- version: '3.8.1',
207
- mode: 'global',
208
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
209
- });
210
- });
211
-
212
- var id = 0;
213
- var postfix = Math.random();
214
-
215
- var uid = function (key) {
216
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
217
- };
218
-
219
492
  var keys = shared('keys');
220
493
 
221
494
  var sharedKey = function (key) {
@@ -224,11 +497,13 @@ var sharedKey = function (key) {
224
497
 
225
498
  var hiddenKeys = {};
226
499
 
500
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
501
+ var TypeError$7 = global_1.TypeError;
227
502
  var WeakMap$1 = global_1.WeakMap;
228
- var set, get, has$1;
503
+ var set, get, has;
229
504
 
230
505
  var enforce = function (it) {
231
- return has$1(it) ? get(it) : set(it, {});
506
+ return has(it) ? get(it) : set(it, {});
232
507
  };
233
508
 
234
509
  var getterFor = function (TYPE) {
@@ -236,113 +511,128 @@ var getterFor = function (TYPE) {
236
511
  var state;
237
512
 
238
513
  if (!isObject(it) || (state = get(it)).type !== TYPE) {
239
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
514
+ throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
240
515
  }
241
516
 
242
517
  return state;
243
518
  };
244
519
  };
245
520
 
246
- if (nativeWeakMap) {
521
+ if (nativeWeakMap || sharedStore.state) {
247
522
  var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
248
- var wmget = store$1.get;
249
- var wmhas = store$1.has;
250
- var wmset = store$1.set;
523
+ var wmget = functionUncurryThis(store$1.get);
524
+ var wmhas = functionUncurryThis(store$1.has);
525
+ var wmset = functionUncurryThis(store$1.set);
251
526
 
252
527
  set = function (it, metadata) {
528
+ if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
253
529
  metadata.facade = it;
254
- wmset.call(store$1, it, metadata);
530
+ wmset(store$1, it, metadata);
255
531
  return metadata;
256
532
  };
257
533
 
258
534
  get = function (it) {
259
- return wmget.call(store$1, it) || {};
535
+ return wmget(store$1, it) || {};
260
536
  };
261
537
 
262
- has$1 = function (it) {
263
- return wmhas.call(store$1, it);
538
+ has = function (it) {
539
+ return wmhas(store$1, it);
264
540
  };
265
541
  } else {
266
542
  var STATE = sharedKey('state');
267
543
  hiddenKeys[STATE] = true;
268
544
 
269
545
  set = function (it, metadata) {
546
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
270
547
  metadata.facade = it;
271
548
  createNonEnumerableProperty(it, STATE, metadata);
272
549
  return metadata;
273
550
  };
274
551
 
275
552
  get = function (it) {
276
- return has(it, STATE) ? it[STATE] : {};
553
+ return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
277
554
  };
278
555
 
279
- has$1 = function (it) {
280
- return has(it, STATE);
556
+ has = function (it) {
557
+ return hasOwnProperty_1(it, STATE);
281
558
  };
282
559
  }
283
560
 
284
561
  var internalState = {
285
562
  set: set,
286
563
  get: get,
287
- has: has$1,
564
+ has: has,
288
565
  enforce: enforce,
289
566
  getterFor: getterFor
290
567
  };
291
568
 
292
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
569
+ var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
570
+
293
571
  var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
294
572
 
295
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({
573
+ var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
296
574
  1: 2
297
575
  }, 1); // `Object.prototype.propertyIsEnumerable` method implementation
298
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
576
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
299
577
 
300
578
  var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) {
301
579
  var descriptor = getOwnPropertyDescriptor(this, V);
302
580
  return !!descriptor && descriptor.enumerable;
303
- } : nativePropertyIsEnumerable;
581
+ } : $propertyIsEnumerable;
304
582
  var objectPropertyIsEnumerable = {
305
583
  f: f$1
306
584
  };
307
585
 
308
- var toString = {}.toString;
309
-
310
- var classofRaw = function (it) {
311
- return toString.call(it).slice(8, -1);
312
- };
313
-
314
- var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings
586
+ var Object$4 = global_1.Object;
587
+ var split = functionUncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings
315
588
 
316
589
  var indexedObject = fails(function () {
317
590
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
318
- // eslint-disable-next-line no-prototype-builtins
319
- return !Object('z').propertyIsEnumerable(0);
591
+ // eslint-disable-next-line no-prototype-builtins -- safe
592
+ return !Object$4('z').propertyIsEnumerable(0);
320
593
  }) ? function (it) {
321
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
322
- } : Object;
594
+ return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
595
+ } : Object$4;
323
596
 
324
597
  var toIndexedObject = function (it) {
325
598
  return indexedObject(requireObjectCoercible(it));
326
599
  };
327
600
 
328
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
329
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
601
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
602
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
330
603
 
331
- var f$2 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
604
+ var f$2 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
332
605
  O = toIndexedObject(O);
333
- P = toPrimitive(P, true);
606
+ P = toPropertyKey(P);
334
607
  if (ie8DomDefine) try {
335
- return nativeGetOwnPropertyDescriptor(O, P);
608
+ return $getOwnPropertyDescriptor$1(O, P);
336
609
  } catch (error) {
337
610
  /* empty */
338
611
  }
339
- if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
612
+ if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
340
613
  };
341
614
  var objectGetOwnPropertyDescriptor = {
342
615
  f: f$2
343
616
  };
344
617
 
618
+ var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
619
+
620
+ var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
621
+ var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name'); // additional protection from minified / mangled / dropped function names
622
+
623
+ var PROPER = EXISTS$1 && function something() {
624
+ /* empty */
625
+ }.name === 'something';
626
+
627
+ var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable);
628
+ var functionName = {
629
+ EXISTS: EXISTS$1,
630
+ PROPER: PROPER,
631
+ CONFIGURABLE: CONFIGURABLE$1
632
+ };
633
+
345
634
  var redefine = createCommonjsModule(function (module) {
635
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
346
636
  var getInternalState = internalState.get;
347
637
  var enforceInternalState = internalState.enforce;
348
638
  var TEMPLATE = String(String).split('String');
@@ -350,17 +640,22 @@ var redefine = createCommonjsModule(function (module) {
350
640
  var unsafe = options ? !!options.unsafe : false;
351
641
  var simple = options ? !!options.enumerable : false;
352
642
  var noTargetGet = options ? !!options.noTargetGet : false;
643
+ var name = options && options.name !== undefined ? options.name : key;
353
644
  var state;
354
645
 
355
- if (typeof value == 'function') {
356
- if (typeof key == 'string' && !has(value, 'name')) {
357
- createNonEnumerableProperty(value, 'name', key);
646
+ if (isCallable(value)) {
647
+ if (String(name).slice(0, 7) === 'Symbol(') {
648
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
649
+ }
650
+
651
+ if (!hasOwnProperty_1(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
652
+ createNonEnumerableProperty(value, 'name', name);
358
653
  }
359
654
 
360
655
  state = enforceInternalState(value);
361
656
 
362
657
  if (!state.source) {
363
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
658
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
364
659
  }
365
660
  }
366
661
 
@@ -375,47 +670,43 @@ var redefine = createCommonjsModule(function (module) {
375
670
 
376
671
  if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
377
672
  })(Function.prototype, 'toString', function toString() {
378
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
673
+ return isCallable(this) && getInternalState(this).source || inspectSource(this);
379
674
  });
380
675
  });
381
676
 
382
- var path = global_1;
383
-
384
- var aFunction = function (variable) {
385
- return typeof variable == 'function' ? variable : undefined;
386
- };
677
+ var max = Math.max;
678
+ var min = Math.min; // Helper for a popular repeating case of the spec:
679
+ // Let integer be ? ToInteger(index).
680
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
387
681
 
388
- var getBuiltIn = function (namespace, method) {
389
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace]) : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
682
+ var toAbsoluteIndex = function (index, length) {
683
+ var integer = toIntegerOrInfinity(index);
684
+ return integer < 0 ? max(integer + length, 0) : min(integer, length);
390
685
  };
391
686
 
392
- var min = Math.min; // `ToLength` abstract operation
393
- // https://tc39.github.io/ecma262/#sec-tolength
687
+ var min$1 = Math.min; // `ToLength` abstract operation
688
+ // https://tc39.es/ecma262/#sec-tolength
394
689
 
395
690
  var toLength = function (argument) {
396
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
691
+ return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
397
692
  };
398
693
 
399
- var max = Math.max;
400
- var min$1 = Math.min; // Helper for a popular repeating case of the spec:
401
- // Let integer be ? ToInteger(index).
402
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
694
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
403
695
 
404
- var toAbsoluteIndex = function (index, length) {
405
- var integer = toInteger(index);
406
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
696
+ var lengthOfArrayLike = function (obj) {
697
+ return toLength(obj.length);
407
698
  };
408
699
 
409
700
  var createMethod$1 = function (IS_INCLUDES) {
410
701
  return function ($this, el, fromIndex) {
411
702
  var O = toIndexedObject($this);
412
- var length = toLength(O.length);
703
+ var length = lengthOfArrayLike(O);
413
704
  var index = toAbsoluteIndex(fromIndex, length);
414
705
  var value; // Array#includes uses SameValueZero equality algorithm
415
- // eslint-disable-next-line no-self-compare
706
+ // eslint-disable-next-line no-self-compare -- NaN check
416
707
 
417
708
  if (IS_INCLUDES && el != el) while (length > index) {
418
- value = O[index++]; // eslint-disable-next-line no-self-compare
709
+ value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check
419
710
 
420
711
  if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not
421
712
  } else for (; length > index; index++) {
@@ -427,14 +718,15 @@ var createMethod$1 = function (IS_INCLUDES) {
427
718
 
428
719
  var arrayIncludes = {
429
720
  // `Array.prototype.includes` method
430
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
721
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
431
722
  includes: createMethod$1(true),
432
723
  // `Array.prototype.indexOf` method
433
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
724
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
434
725
  indexOf: createMethod$1(false)
435
726
  };
436
727
 
437
728
  var indexOf = arrayIncludes.indexOf;
729
+ var push = functionUncurryThis([].push);
438
730
 
439
731
  var objectKeysInternal = function (object, names) {
440
732
  var O = toIndexedObject(object);
@@ -442,11 +734,11 @@ var objectKeysInternal = function (object, names) {
442
734
  var result = [];
443
735
  var key;
444
736
 
445
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys
737
+ for (key in O) !hasOwnProperty_1(hiddenKeys, key) && hasOwnProperty_1(O, key) && push(result, key); // Don't enum bug & hidden keys
446
738
 
447
739
 
448
- while (names.length > i) if (has(O, key = names[i++])) {
449
- ~indexOf(result, key) || result.push(key);
740
+ while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
741
+ ~indexOf(result, key) || push(result, key);
450
742
  }
451
743
 
452
744
  return result;
@@ -456,7 +748,8 @@ var objectKeysInternal = function (object, names) {
456
748
  var enumBugKeys = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
457
749
 
458
750
  var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
459
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
751
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
752
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
460
753
 
461
754
  var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
462
755
  return objectKeysInternal(O, hiddenKeys$1);
@@ -466,25 +759,31 @@ var objectGetOwnPropertyNames = {
466
759
  f: f$3
467
760
  };
468
761
 
762
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
469
763
  var f$4 = Object.getOwnPropertySymbols;
470
764
  var objectGetOwnPropertySymbols = {
471
765
  f: f$4
472
766
  };
473
767
 
768
+ var concat = functionUncurryThis([].concat); // all object keys, includes non-enumerable and symbols
769
+
474
770
  var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
475
771
  var keys = objectGetOwnPropertyNames.f(anObject(it));
476
772
  var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
477
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
773
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
478
774
  };
479
775
 
480
- var copyConstructorProperties = function (target, source) {
776
+ var copyConstructorProperties = function (target, source, exceptions) {
481
777
  var keys = ownKeys(source);
482
778
  var defineProperty = objectDefineProperty.f;
483
779
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
484
780
 
485
781
  for (var i = 0; i < keys.length; i++) {
486
782
  var key = keys[i];
487
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
783
+
784
+ if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
785
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
786
+ }
488
787
  }
489
788
  };
490
789
 
@@ -492,7 +791,7 @@ var replacement = /#|\.prototype\./;
492
791
 
493
792
  var isForced = function (feature, detection) {
494
793
  var value = data[normalize(feature)];
495
- return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection;
794
+ return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
496
795
  };
497
796
 
498
797
  var normalize = isForced.normalize = function (string) {
@@ -518,6 +817,7 @@ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
518
817
  options.sham - add a flag to not completely full polyfills
519
818
  options.enumerable - export as enumerable property
520
819
  options.noTargetGet - prevent calling a getter on target
820
+ options.name - the .name of the function if it does not match the key
521
821
  */
522
822
 
523
823
  var _export = function (options, source) {
@@ -545,7 +845,7 @@ var _export = function (options, source) {
545
845
  FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target
546
846
 
547
847
  if (!FORCED && targetProperty !== undefined) {
548
- if (typeof sourceProperty === typeof targetProperty) continue;
848
+ if (typeof sourceProperty == typeof targetProperty) continue;
549
849
  copyConstructorProperties(sourceProperty, targetProperty);
550
850
  } // add a flag to not completely full polyfills
551
851
 
@@ -559,116 +859,41 @@ var _export = function (options, source) {
559
859
  }
560
860
  };
561
861
 
562
- // https://tc39.github.io/ecma262/#sec-toobject
563
-
564
- var toObject = function (argument) {
565
- return Object(requireObjectCoercible(argument));
566
- };
567
-
568
- var correctPrototypeGetter = !fails(function () {
569
- function F() {
570
- /* empty */
571
- }
572
-
573
- F.prototype.constructor = null;
574
- return Object.getPrototypeOf(new F()) !== F.prototype;
575
- });
576
-
577
- var IE_PROTO = sharedKey('IE_PROTO');
578
- var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method
579
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
580
-
581
- var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
582
- O = toObject(O);
583
- if (has(O, IE_PROTO)) return O[IE_PROTO];
584
-
585
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
586
- return O.constructor.prototype;
587
- }
588
-
589
- return O instanceof Object ? ObjectPrototype : null;
590
- };
591
-
592
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
593
- // Chrome 38 Symbol has incorrect toString conversion
594
- // eslint-disable-next-line no-undef
595
- return !String(Symbol());
596
- });
597
-
598
- var useSymbolAsUid = nativeSymbol // eslint-disable-next-line no-undef
599
- && !Symbol.sham // eslint-disable-next-line no-undef
600
- && typeof Symbol.iterator == 'symbol';
601
-
602
- var WellKnownSymbolsStore = shared('wks');
603
- var Symbol$1 = global_1.Symbol;
604
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
605
-
606
- var wellKnownSymbol = function (name) {
607
- if (!has(WellKnownSymbolsStore, name)) {
608
- if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
609
- }
610
-
611
- return WellKnownSymbolsStore[name];
612
- };
613
-
614
- var ITERATOR = wellKnownSymbol('iterator');
615
- var BUGGY_SAFARI_ITERATORS = false;
616
-
617
- var returnThis = function () {
618
- return this;
619
- }; // `%IteratorPrototype%` object
620
- // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
621
-
622
-
623
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
624
-
625
- if ([].keys) {
626
- arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
627
-
628
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
629
- PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
630
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
631
- }
632
- }
633
-
634
- if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
635
-
636
- if ( !has(IteratorPrototype, ITERATOR)) {
637
- createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
638
- }
639
-
640
- var iteratorsCore = {
641
- IteratorPrototype: IteratorPrototype,
642
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
643
- };
644
-
645
- // https://tc39.github.io/ecma262/#sec-object.keys
862
+ // https://tc39.es/ecma262/#sec-object.keys
863
+ // eslint-disable-next-line es-x/no-object-keys -- safe
646
864
 
647
865
  var objectKeys = Object.keys || function keys(O) {
648
866
  return objectKeysInternal(O, enumBugKeys);
649
867
  };
650
868
 
651
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
869
+ // https://tc39.es/ecma262/#sec-object.defineproperties
870
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
652
871
 
653
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
872
+ var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
654
873
  anObject(O);
874
+ var props = toIndexedObject(Properties);
655
875
  var keys = objectKeys(Properties);
656
876
  var length = keys.length;
657
877
  var index = 0;
658
878
  var key;
659
879
 
660
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
880
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
661
881
 
662
882
  return O;
663
883
  };
884
+ var objectDefineProperties = {
885
+ f: f$5
886
+ };
664
887
 
665
888
  var html = getBuiltIn('document', 'documentElement');
666
889
 
890
+ /* global ActiveXObject -- old IE, WSH */
891
+
667
892
  var GT = '>';
668
893
  var LT = '<';
669
894
  var PROTOTYPE = 'prototype';
670
895
  var SCRIPT = 'script';
671
- var IE_PROTO$1 = sharedKey('IE_PROTO');
896
+ var IE_PROTO = sharedKey('IE_PROTO');
672
897
 
673
898
  var EmptyConstructor = function () {
674
899
  /* empty */
@@ -714,13 +939,14 @@ var activeXDocument;
714
939
 
715
940
  var NullProtoObject = function () {
716
941
  try {
717
- /* global ActiveXObject */
718
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
942
+ activeXDocument = new ActiveXObject('htmlfile');
719
943
  } catch (error) {
720
944
  /* ignore */
721
945
  }
722
946
 
723
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
947
+ NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE
948
+ : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH
949
+
724
950
  var length = enumBugKeys.length;
725
951
 
726
952
  while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
@@ -728,8 +954,9 @@ var NullProtoObject = function () {
728
954
  return NullProtoObject();
729
955
  };
730
956
 
731
- hiddenKeys[IE_PROTO$1] = true; // `Object.create` method
732
- // https://tc39.github.io/ecma262/#sec-object.create
957
+ hiddenKeys[IE_PROTO] = true; // `Object.create` method
958
+ // https://tc39.es/ecma262/#sec-object.create
959
+ // eslint-disable-next-line es-x/no-object-create -- safe
733
960
 
734
961
  var objectCreate = Object.create || function create(O, Properties) {
735
962
  var result;
@@ -739,18 +966,82 @@ var objectCreate = Object.create || function create(O, Properties) {
739
966
  result = new EmptyConstructor();
740
967
  EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill
741
968
 
742
- result[IE_PROTO$1] = O;
969
+ result[IE_PROTO] = O;
743
970
  } else result = NullProtoObject();
744
971
 
745
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
972
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
746
973
  };
747
974
 
748
- var defineProperty = objectDefineProperty.f;
749
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
975
+ var correctPrototypeGetter = !fails(function () {
976
+ function F() {
977
+ /* empty */
978
+ }
979
+
980
+ F.prototype.constructor = null; // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
981
+
982
+ return Object.getPrototypeOf(new F()) !== F.prototype;
983
+ });
984
+
985
+ var IE_PROTO$1 = sharedKey('IE_PROTO');
986
+ var Object$5 = global_1.Object;
987
+ var ObjectPrototype = Object$5.prototype; // `Object.getPrototypeOf` method
988
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
989
+
990
+ var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
991
+ var object = toObject(O);
992
+ if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
993
+ var constructor = object.constructor;
994
+
995
+ if (isCallable(constructor) && object instanceof constructor) {
996
+ return constructor.prototype;
997
+ }
998
+
999
+ return object instanceof Object$5 ? ObjectPrototype : null;
1000
+ };
1001
+
1002
+ var ITERATOR = wellKnownSymbol('iterator');
1003
+ var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object
1004
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1005
+
1006
+ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
1007
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1008
+
1009
+ if ([].keys) {
1010
+ arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
1011
+
1012
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
1013
+ PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
1014
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
1015
+ }
1016
+ }
1017
+
1018
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
1019
+ var test = {}; // FF44- legacy iterators case
1020
+
1021
+ return IteratorPrototype[ITERATOR].call(test) !== test;
1022
+ });
1023
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; // `%IteratorPrototype%[@@iterator]()` method
1024
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1025
+
1026
+ if (!isCallable(IteratorPrototype[ITERATOR])) {
1027
+ redefine(IteratorPrototype, ITERATOR, function () {
1028
+ return this;
1029
+ });
1030
+ }
1031
+
1032
+ var iteratorsCore = {
1033
+ IteratorPrototype: IteratorPrototype,
1034
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
1035
+ };
1036
+
1037
+ var defineProperty$1 = objectDefineProperty.f;
1038
+ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
750
1039
 
751
- var setToStringTag = function (it, TAG, STATIC) {
752
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
753
- defineProperty(it, TO_STRING_TAG, {
1040
+ var setToStringTag = function (target, TAG, STATIC) {
1041
+ if (target && !STATIC) target = target.prototype;
1042
+
1043
+ if (target && !hasOwnProperty_1(target, TO_STRING_TAG$2)) {
1044
+ defineProperty$1(target, TO_STRING_TAG$2, {
754
1045
  configurable: true,
755
1046
  value: TAG
756
1047
  });
@@ -761,32 +1052,33 @@ var iterators = {};
761
1052
 
762
1053
  var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
763
1054
 
764
- var returnThis$1 = function () {
1055
+ var returnThis = function () {
765
1056
  return this;
766
1057
  };
767
1058
 
768
- var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
1059
+ var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
769
1060
  var TO_STRING_TAG = NAME + ' Iterator';
770
1061
  IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, {
771
- next: createPropertyDescriptor(1, next)
1062
+ next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next)
772
1063
  });
773
1064
  setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
774
- iterators[TO_STRING_TAG] = returnThis$1;
1065
+ iterators[TO_STRING_TAG] = returnThis;
775
1066
  return IteratorConstructor;
776
1067
  };
777
1068
 
778
- var aPossiblePrototype = function (it) {
779
- if (!isObject(it) && it !== null) {
780
- throw TypeError("Can't set " + String(it) + ' as a prototype');
781
- }
1069
+ var String$4 = global_1.String;
1070
+ var TypeError$8 = global_1.TypeError;
782
1071
 
783
- return it;
1072
+ var aPossiblePrototype = function (argument) {
1073
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
1074
+ throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
784
1075
  };
785
1076
 
786
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
1077
+ /* eslint-disable no-proto -- safe */
1078
+ // `Object.setPrototypeOf` method
1079
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
787
1080
  // Works with __proto__ only. Old v8 can't work with null proto objects.
788
-
789
- /* eslint-disable no-proto */
1081
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
790
1082
 
791
1083
  var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
792
1084
  var CORRECT_SETTER = false;
@@ -794,8 +1086,9 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
794
1086
  var setter;
795
1087
 
796
1088
  try {
797
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
798
- setter.call(test, []);
1089
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1090
+ setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1091
+ setter(test, []);
799
1092
  CORRECT_SETTER = test instanceof Array;
800
1093
  } catch (error) {
801
1094
  /* empty */
@@ -804,11 +1097,13 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
804
1097
  return function setPrototypeOf(O, proto) {
805
1098
  anObject(O);
806
1099
  aPossiblePrototype(proto);
807
- if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
1100
+ if (CORRECT_SETTER) setter(O, proto);else O.__proto__ = proto;
808
1101
  return O;
809
1102
  };
810
1103
  }() : undefined);
811
1104
 
1105
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1106
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
812
1107
  var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
813
1108
  var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
814
1109
  var ITERATOR$1 = wellKnownSymbol('iterator');
@@ -816,7 +1111,7 @@ var KEYS = 'keys';
816
1111
  var VALUES = 'values';
817
1112
  var ENTRIES = 'entries';
818
1113
 
819
- var returnThis$2 = function () {
1114
+ var returnThis$1 = function () {
820
1115
  return this;
821
1116
  };
822
1117
 
@@ -860,35 +1155,33 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
860
1155
  if (anyNativeIterator) {
861
1156
  CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
862
1157
 
863
- if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
1158
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
864
1159
  if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
865
1160
  if (objectSetPrototypeOf) {
866
1161
  objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
867
- } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
868
- createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$2);
1162
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1163
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
869
1164
  }
870
1165
  } // Set @@toStringTag to native iterators
871
1166
 
872
1167
 
873
1168
  setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
874
1169
  }
875
- } // fix Array#{values, @@iterator}.name in V8 / FF
876
-
1170
+ } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
877
1171
 
878
- if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
879
- INCORRECT_VALUES_NAME = true;
880
-
881
- defaultIterator = function values() {
882
- return nativeIterator.call(this);
883
- };
884
- } // define iterator
885
1172
 
1173
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1174
+ if ( CONFIGURABLE_FUNCTION_NAME) {
1175
+ createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
1176
+ } else {
1177
+ INCORRECT_VALUES_NAME = true;
886
1178
 
887
- if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
888
- createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
889
- }
1179
+ defaultIterator = function values() {
1180
+ return functionCall(nativeIterator, this);
1181
+ };
1182
+ }
1183
+ } // export additional methods
890
1184
 
891
- iterators[NAME] = defaultIterator; // export additional methods
892
1185
 
893
1186
  if (DEFAULT) {
894
1187
  methods = {
@@ -905,24 +1198,32 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
905
1198
  proto: true,
906
1199
  forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME
907
1200
  }, methods);
1201
+ } // define iterator
1202
+
1203
+
1204
+ if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
1205
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, {
1206
+ name: DEFAULT
1207
+ });
908
1208
  }
909
1209
 
1210
+ iterators[NAME] = defaultIterator;
910
1211
  return methods;
911
1212
  };
912
1213
 
913
- var charAt = stringMultibyte.charAt;
1214
+ var charAt$1 = stringMultibyte.charAt;
914
1215
  var STRING_ITERATOR = 'String Iterator';
915
1216
  var setInternalState = internalState.set;
916
1217
  var getInternalState = internalState.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method
917
- // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
1218
+ // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
918
1219
 
919
1220
  defineIterator(String, 'String', function (iterated) {
920
1221
  setInternalState(this, {
921
1222
  type: STRING_ITERATOR,
922
- string: String(iterated),
1223
+ string: toString_1(iterated),
923
1224
  index: 0
924
1225
  }); // `%StringIteratorPrototype%.next` method
925
- // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
1226
+ // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
926
1227
  }, function next() {
927
1228
  var state = getInternalState(this);
928
1229
  var string = state.string;
@@ -932,7 +1233,7 @@ defineIterator(String, 'String', function (iterated) {
932
1233
  value: undefined,
933
1234
  done: true
934
1235
  };
935
- point = charAt(string, index);
1236
+ point = charAt$1(string, index);
936
1237
  state.index += point.length;
937
1238
  return {
938
1239
  value: point,
@@ -940,61 +1241,46 @@ defineIterator(String, 'String', function (iterated) {
940
1241
  };
941
1242
  });
942
1243
 
943
- var aFunction$1 = function (it) {
944
- if (typeof it != 'function') {
945
- throw TypeError(String(it) + ' is not a function');
946
- }
1244
+ var bind$1 = functionUncurryThis(functionUncurryThis.bind); // optional / simple context binding
947
1245
 
948
- return it;
1246
+ var functionBindContext = function (fn, that) {
1247
+ aCallable(fn);
1248
+ return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function
1249
+ /* ...args */
1250
+ () {
1251
+ return fn.apply(that, arguments);
1252
+ };
949
1253
  };
950
1254
 
951
- var functionBindContext = function (fn, that, length) {
952
- aFunction$1(fn);
953
- if (that === undefined) return fn;
954
-
955
- switch (length) {
956
- case 0:
957
- return function () {
958
- return fn.call(that);
959
- };
1255
+ var iteratorClose = function (iterator, kind, value) {
1256
+ var innerResult, innerError;
1257
+ anObject(iterator);
960
1258
 
961
- case 1:
962
- return function (a) {
963
- return fn.call(that, a);
964
- };
1259
+ try {
1260
+ innerResult = getMethod(iterator, 'return');
965
1261
 
966
- case 2:
967
- return function (a, b) {
968
- return fn.call(that, a, b);
969
- };
1262
+ if (!innerResult) {
1263
+ if (kind === 'throw') throw value;
1264
+ return value;
1265
+ }
970
1266
 
971
- case 3:
972
- return function (a, b, c) {
973
- return fn.call(that, a, b, c);
974
- };
1267
+ innerResult = functionCall(innerResult, iterator);
1268
+ } catch (error) {
1269
+ innerError = true;
1270
+ innerResult = error;
975
1271
  }
976
1272
 
977
- return function ()
978
- /* ...args */
979
- {
980
- return fn.apply(that, arguments);
981
- };
982
- };
983
-
984
- var iteratorClose = function (iterator) {
985
- var returnMethod = iterator['return'];
986
-
987
- if (returnMethod !== undefined) {
988
- return anObject(returnMethod.call(iterator)).value;
989
- }
1273
+ if (kind === 'throw') throw value;
1274
+ if (innerError) throw innerResult;
1275
+ anObject(innerResult);
1276
+ return value;
990
1277
  };
991
1278
 
992
1279
  var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
993
1280
  try {
994
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion)
1281
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
995
1282
  } catch (error) {
996
- iteratorClose(iterator);
997
- throw error;
1283
+ iteratorClose(iterator, 'throw', error);
998
1284
  }
999
1285
  };
1000
1286
 
@@ -1005,73 +1291,104 @@ var isArrayIteratorMethod = function (it) {
1005
1291
  return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$2] === it);
1006
1292
  };
1007
1293
 
1008
- var createProperty = function (object, key, value) {
1009
- var propertyKey = toPrimitive(key);
1010
- if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
1294
+ var noop = function () {
1295
+ /* empty */
1011
1296
  };
1012
1297
 
1013
- var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1014
- var test = {};
1015
- test[TO_STRING_TAG$1] = 'z';
1016
- var toStringTagSupport = String(test) === '[object z]';
1298
+ var empty = [];
1299
+ var construct = getBuiltIn('Reflect', 'construct');
1300
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1301
+ var exec = functionUncurryThis(constructorRegExp.exec);
1302
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1017
1303
 
1018
- var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); // ES3 wrong here
1304
+ var isConstructorModern = function isConstructor(argument) {
1305
+ if (!isCallable(argument)) return false;
1019
1306
 
1020
- var CORRECT_ARGUMENTS = classofRaw(function () {
1021
- return arguments;
1022
- }()) == 'Arguments'; // fallback for IE11 Script Access Denied error
1307
+ try {
1308
+ construct(noop, empty, argument);
1309
+ return true;
1310
+ } catch (error) {
1311
+ return false;
1312
+ }
1313
+ };
1314
+
1315
+ var isConstructorLegacy = function isConstructor(argument) {
1316
+ if (!isCallable(argument)) return false;
1317
+
1318
+ switch (classof(argument)) {
1319
+ case 'AsyncFunction':
1320
+ case 'GeneratorFunction':
1321
+ case 'AsyncGeneratorFunction':
1322
+ return false;
1323
+ }
1023
1324
 
1024
- var tryGet = function (it, key) {
1025
1325
  try {
1026
- return it[key];
1326
+ // we can't check .prototype since constructors produced by .bind haven't it
1327
+ // `Function#toString` throws on some built-it function in some legacy engines
1328
+ // (for example, `DOMQuad` and similar in FF41-)
1329
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1027
1330
  } catch (error) {
1028
- /* empty */
1331
+ return true;
1029
1332
  }
1030
- }; // getting tag from ES6+ `Object.prototype.toString`
1333
+ };
1031
1334
 
1335
+ isConstructorLegacy.sham = true; // `IsConstructor` abstract operation
1336
+ // https://tc39.es/ecma262/#sec-isconstructor
1032
1337
 
1033
- var classof = toStringTagSupport ? classofRaw : function (it) {
1034
- var O, tag, result;
1035
- return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
1036
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag // builtinTag case
1037
- : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
1038
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1338
+ var isConstructor = !construct || fails(function () {
1339
+ var called;
1340
+ return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {
1341
+ called = true;
1342
+ }) || called;
1343
+ }) ? isConstructorLegacy : isConstructorModern;
1344
+
1345
+ var createProperty = function (object, key, value) {
1346
+ var propertyKey = toPropertyKey(key);
1347
+ if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
1039
1348
  };
1040
1349
 
1041
1350
  var ITERATOR$3 = wellKnownSymbol('iterator');
1042
1351
 
1043
1352
  var getIteratorMethod = function (it) {
1044
- if (it != undefined) return it[ITERATOR$3] || it['@@iterator'] || iterators[classof(it)];
1353
+ if (it != undefined) return getMethod(it, ITERATOR$3) || getMethod(it, '@@iterator') || iterators[classof(it)];
1045
1354
  };
1046
1355
 
1047
- // https://tc39.github.io/ecma262/#sec-array.from
1356
+ var TypeError$9 = global_1.TypeError;
1357
+
1358
+ var getIterator = function (argument, usingIterator) {
1359
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1360
+ if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
1361
+ throw TypeError$9(tryToString(argument) + ' is not iterable');
1362
+ };
1048
1363
 
1364
+ var Array$1 = global_1.Array; // `Array.from` method implementation
1365
+ // https://tc39.es/ecma262/#sec-array.from
1049
1366
 
1050
1367
  var arrayFrom = function from(arrayLike
1051
1368
  /* , mapfn = undefined, thisArg = undefined */
1052
1369
  ) {
1053
1370
  var O = toObject(arrayLike);
1054
- var C = typeof this == 'function' ? this : Array;
1371
+ var IS_CONSTRUCTOR = isConstructor(this);
1055
1372
  var argumentsLength = arguments.length;
1056
1373
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
1057
1374
  var mapping = mapfn !== undefined;
1375
+ if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
1058
1376
  var iteratorMethod = getIteratorMethod(O);
1059
1377
  var index = 0;
1060
- var length, result, step, iterator, next, value;
1061
- if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case
1378
+ var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case
1062
1379
 
1063
- if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
1064
- iterator = iteratorMethod.call(O);
1380
+ if (iteratorMethod && !(this == Array$1 && isArrayIteratorMethod(iteratorMethod))) {
1381
+ iterator = getIterator(O, iteratorMethod);
1065
1382
  next = iterator.next;
1066
- result = new C();
1383
+ result = IS_CONSTRUCTOR ? new this() : [];
1067
1384
 
1068
- for (; !(step = next.call(iterator)).done; index++) {
1385
+ for (; !(step = functionCall(next, iterator)).done; index++) {
1069
1386
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
1070
1387
  createProperty(result, index, value);
1071
1388
  }
1072
1389
  } else {
1073
- length = toLength(O.length);
1074
- result = new C(length);
1390
+ length = lengthOfArrayLike(O);
1391
+ result = IS_CONSTRUCTOR ? new this(length) : Array$1(length);
1075
1392
 
1076
1393
  for (; length > index; index++) {
1077
1394
  value = mapping ? mapfn(O[index], index) : O[index];
@@ -1101,7 +1418,7 @@ try {
1101
1418
 
1102
1419
  iteratorWithReturn[ITERATOR$4] = function () {
1103
1420
  return this;
1104
- }; // eslint-disable-next-line no-throw-literal
1421
+ }; // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
1105
1422
 
1106
1423
 
1107
1424
  Array.from(iteratorWithReturn, function () {
@@ -1137,9 +1454,10 @@ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1137
1454
  };
1138
1455
 
1139
1456
  var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
1457
+ // eslint-disable-next-line es-x/no-array-from -- required for testing
1140
1458
  Array.from(iterable);
1141
1459
  }); // `Array.from` method
1142
- // https://tc39.github.io/ecma262/#sec-array.from
1460
+ // https://tc39.es/ecma262/#sec-array.from
1143
1461
 
1144
1462
  _export({
1145
1463
  target: 'Array',
@@ -1520,8 +1838,9 @@ var messagesDE = {
1520
1838
  "eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
1521
1839
  "eligibility-modal.credit-cost": "Davon Kreditkosten",
1522
1840
  "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1523
- "eligibility-modal.no-eligibility": "Ups, die Simulation scheint nicht funktioniert zu haben.",
1524
- "eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
1841
+ "eligibility-modal.no-eligibility": "Ups, die Simulation hat anscheinend nicht funktioniert.",
1842
+ "eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
1843
+ "eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
1525
1844
  "eligibility-modal.total": "Insgesamt",
1526
1845
  "installments.today": "Heutzutage",
1527
1846
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
@@ -1543,7 +1862,8 @@ var messagesEN = {
1543
1862
  "eligibility-modal.credit-cost": "Of which cost of credit",
1544
1863
  "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1545
1864
  "eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
1546
- "eligibility-modal.title": "<highlighted>Pay in installments</highlighted> or later by credit card with Alma.",
1865
+ "eligibility-modal.title": "<highlighted>Pay in installments</highlighted> by credit card with Alma.",
1866
+ "eligibility-modal.title-deferred": "<highlighted>Pay in installments</highlighted> or later by credit card with Alma.",
1547
1867
  "eligibility-modal.total": "Total",
1548
1868
  "installments.today": "Today",
1549
1869
  "payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
@@ -1565,7 +1885,8 @@ var messagesES = {
1565
1885
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
1566
1886
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
1567
1887
  "eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
1568
- "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
1888
+ "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta de crédito con Alma.",
1889
+ "eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
1569
1890
  "eligibility-modal.total": "Total",
1570
1891
  "installments.today": "Hoy",
1571
1892
  "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
@@ -1586,8 +1907,9 @@ var messagesFR = {
1586
1907
  "eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
1587
1908
  "eligibility-modal.credit-cost": "Dont coût du crédit",
1588
1909
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
1589
- "eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'aie pas fonctionné.",
1590
- "eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
1910
+ "eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
1911
+ "eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
1912
+ "eligibility-modal.title-deferred": "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
1591
1913
  "eligibility-modal.total": "Total",
1592
1914
  "installments.today": "Aujourd'hui",
1593
1915
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
@@ -1609,7 +1931,8 @@ var messagesIT = {
1609
1931
  "eligibility-modal.credit-cost": "Di cui commissioni",
1610
1932
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
1611
1933
  "eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
1612
- "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
1934
+ "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con carta di credito con Alma.",
1935
+ "eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
1613
1936
  "eligibility-modal.total": "Totale",
1614
1937
  "installments.today": "Oggi",
1615
1938
  "payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
@@ -1631,7 +1954,8 @@ var messagesNL = {
1631
1954
  "eligibility-modal.credit-cost": "Waarvan kosten van krediet",
1632
1955
  "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1633
1956
  "eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
1634
- "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
1957
+ "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
1958
+ "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
1635
1959
  "eligibility-modal.total": "Totaal",
1636
1960
  "installments.today": "Tegenwoordig",
1637
1961
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
@@ -1734,16 +2058,34 @@ var fetchFromApi = function fetchFromApi(url, data, headers) {
1734
2058
  }
1735
2059
  };
1736
2060
 
2061
+ var isPlanEligible = function isPlanEligible(plan, configPlan) {
2062
+ if (!plan.eligible) {
2063
+ return false;
2064
+ }
2065
+
2066
+ return configPlan ? plan.purchase_amount >= (configPlan == null ? void 0 : configPlan.minAmount) && plan.purchase_amount <= (configPlan == null ? void 0 : configPlan.maxAmount) : false;
2067
+ };
2068
+
2069
+ var getPaymentPlanBoundaries = function getPaymentPlanBoundaries(plan, configPlan) {
2070
+ var _plan$constraints;
2071
+
2072
+ // When the plan is not eligible, the purchase amount constraints is given from the merchant config
2073
+ var purchaseAmountConstraints = (_plan$constraints = plan.constraints) == null ? void 0 : _plan$constraints.purchase_amount;
2074
+
2075
+ if (purchaseAmountConstraints && configPlan) {
2076
+ return {
2077
+ minAmount: Math.max(configPlan.minAmount, purchaseAmountConstraints == null ? void 0 : purchaseAmountConstraints.minimum),
2078
+ maxAmount: Math.min(configPlan.maxAmount, purchaseAmountConstraints == null ? void 0 : purchaseAmountConstraints.maximum)
2079
+ };
2080
+ }
2081
+
2082
+ return configPlan != null ? configPlan : {};
2083
+ };
2084
+
1737
2085
  var filterELigibility = function filterELigibility(eligibilities, configPlans) {
1738
2086
  // Remove p1x
1739
2087
  var filteredEligibilityPlans = eligibilities.filter(function (plan) {
1740
2088
  return !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0);
1741
- }) // Keeps the plans that have a payment_plan property
1742
- .filter(function (plan) {
1743
- return plan.payment_plan;
1744
- }) // Remove plans that have a reasons property
1745
- .filter(function (plan) {
1746
- return !plan.reasons;
1747
2089
  }); // If no configPlans was provided, return eligibility response
1748
2090
 
1749
2091
  if (!configPlans) {
@@ -1759,10 +2101,8 @@ var filterELigibility = function filterELigibility(eligibilities, configPlans) {
1759
2101
  return plan.installments_count === configPlan.installmentsCount && eligibilityDeferredDays === configPlanDeferredDays;
1760
2102
  });
1761
2103
  return _extends({}, plan, {
1762
- eligible: relatedConfigPlan ? plan.purchase_amount >= (relatedConfigPlan == null ? void 0 : relatedConfigPlan.minAmount) && plan.purchase_amount <= (relatedConfigPlan == null ? void 0 : relatedConfigPlan.maxAmount) : false,
1763
- minAmount: relatedConfigPlan == null ? void 0 : relatedConfigPlan.minAmount,
1764
- maxAmount: relatedConfigPlan == null ? void 0 : relatedConfigPlan.maxAmount
1765
- });
2104
+ eligible: isPlanEligible(plan, relatedConfigPlan)
2105
+ }, getPaymentPlanBoundaries(plan, relatedConfigPlan));
1766
2106
  });
1767
2107
  };
1768
2108
 
@@ -1836,6 +2176,31 @@ function CrossIcon(_ref) {
1836
2176
  }));
1837
2177
  }
1838
2178
 
2179
+ /**
2180
+ * Prefix classes to avoid name collisions.
2181
+ */
2182
+ var prefix = 'alma-eligibility-modal';
2183
+ /**
2184
+ * Class names for the **eligibility modale** widget.
2185
+ * Those classes are intended to be used by the **merchant developer**.
2186
+ */
2187
+
2188
+ var STATIC_CUSTOMISATION_CLASSES = {
2189
+ leftSide: prefix + '-left-side',
2190
+ rightSide: prefix + '-right-side',
2191
+ title: prefix + '-title',
2192
+ info: prefix + '-info',
2193
+ infoMessage: prefix + '-info-message',
2194
+ eligibilityOptions: prefix + '-eligibility-options',
2195
+ activeOption: prefix + '-active-option',
2196
+ closeButton: prefix + '-close-button',
2197
+ scheduleDetails: prefix + '-schedule-details',
2198
+ scheduleTotal: prefix + '-schedule-total',
2199
+ scheduleCredit: prefix + '-schedule-credit'
2200
+ };
2201
+
2202
+ var _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
2203
+
1839
2204
  var ControlledModal = function ControlledModal(_ref) {
1840
2205
  var _cx;
1841
2206
 
@@ -1846,7 +2211,7 @@ var ControlledModal = function ControlledModal(_ref) {
1846
2211
  contentClassName = _ref.contentClassName,
1847
2212
  _ref$scrollable = _ref.scrollable,
1848
2213
  scrollable = _ref$scrollable === void 0 ? false : _ref$scrollable,
1849
- props = _objectWithoutPropertiesLoose(_ref, ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"]);
2214
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
1850
2215
 
1851
2216
  Modal.setAppElement('body');
1852
2217
  return /*#__PURE__*/React__default.createElement(Modal, Object.assign({
@@ -1866,7 +2231,7 @@ var ControlledModal = function ControlledModal(_ref) {
1866
2231
  className: s$1.header
1867
2232
  }, /*#__PURE__*/React__default.createElement("button", {
1868
2233
  onClick: onClose,
1869
- className: s$1.closeButton,
2234
+ className: cx(s$1.closeButton, STATIC_CUSTOMISATION_CLASSES.closeButton),
1870
2235
  "data-testid": "modal-close-button"
1871
2236
  }, /*#__PURE__*/React__default.createElement(CrossIcon, null))), /*#__PURE__*/React__default.createElement("div", {
1872
2237
  className: cx(s$1.content, contentClassName, (_cx = {}, _cx[s$1.contentScrollable] = scrollable, _cx))
@@ -1891,6 +2256,20 @@ var paymentPlanShorthandName = function paymentPlanShorthandName(payment) {
1891
2256
  return installmentsCount + "x";
1892
2257
  }
1893
2258
  };
2259
+
2260
+ var withNoFee = function withNoFee(payment) {
2261
+ var _payment$payment_plan;
2262
+
2263
+ if ((_payment$payment_plan = payment.payment_plan) != null && _payment$payment_plan.every(function (plan) {
2264
+ return plan.customer_fee === 0 && plan.customer_interest === 0;
2265
+ })) {
2266
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, ' ', /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2267
+ id: "payment-plan-strings.no-fee",
2268
+ defaultMessage: '(sans frais)'
2269
+ }));
2270
+ }
2271
+ };
2272
+
1894
2273
  var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1895
2274
  var deferred_days = payment.deferred_days,
1896
2275
  deferred_months = payment.deferred_months,
@@ -1900,20 +2279,10 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1900
2279
  _payment$minAmount = payment.minAmount,
1901
2280
  minAmount = _payment$minAmount === void 0 ? 0 : _payment$minAmount,
1902
2281
  _payment$maxAmount = payment.maxAmount,
1903
- maxAmount = _payment$maxAmount === void 0 ? 0 : _payment$maxAmount;
2282
+ maxAmount = _payment$maxAmount === void 0 ? 0 : _payment$maxAmount,
2283
+ payment_plan = payment.payment_plan;
1904
2284
  var deferredDaysCount = deferred_days + deferred_months * 30;
1905
2285
 
1906
- var withNoFee = function withNoFee() {
1907
- if (payment.payment_plan.every(function (plan) {
1908
- return plan.customer_fee === 0 && plan.customer_interest === 0;
1909
- })) {
1910
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, ' ', /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
1911
- id: "payment-plan-strings.no-fee",
1912
- defaultMessage: '(sans frais)'
1913
- }));
1914
- }
1915
- };
1916
-
1917
2286
  if (!eligible) {
1918
2287
  return purchaseAmount > maxAmount ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
1919
2288
  id: "payment-plan-strings.ineligible-greater-than-max",
@@ -1936,27 +2305,32 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1936
2305
  })
1937
2306
  }
1938
2307
  });
2308
+ } else if (!payment_plan) {
2309
+ /* This error should never happen. We added this condition to avoid a typescript warning on
2310
+ payment_plan possibly undefined. As far as we know, it only happens when the plan is not
2311
+ eligible, which is checked above. */
2312
+ throw Error("No payment plan provided for payment in " + installmentsCount + " installments. Please contact us if you see this error.");
1939
2313
  } else if (deferredDaysCount !== 0 && installmentsCount === 1) {
1940
2314
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
1941
2315
  id: "payment-plan-strings.deferred",
1942
2316
  defaultMessage: "{totalAmount} \xE0 payer le {dueDate}",
1943
2317
  values: {
1944
2318
  totalAmount: /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
1945
- value: priceFromCents(payment.payment_plan[0].total_amount),
2319
+ value: priceFromCents(payment_plan[0].total_amount),
1946
2320
  style: "currency",
1947
2321
  currency: "EUR"
1948
2322
  }),
1949
2323
  dueDate: /*#__PURE__*/React__default.createElement(reactIntl.FormattedDate, {
1950
- value: dateFns.secondsToMilliseconds(payment.payment_plan[0].due_date),
2324
+ value: dateFns.secondsToMilliseconds(payment_plan[0].due_date),
1951
2325
  day: "numeric",
1952
2326
  month: "long",
1953
2327
  year: "numeric"
1954
2328
  })
1955
2329
  }
1956
- }), withNoFee());
2330
+ }), withNoFee(payment));
1957
2331
  } else if (installmentsCount > 0) {
1958
- var areInstallmentsOfSameAmount = payment.payment_plan.every(function (installment, index) {
1959
- return index === 0 || installment.total_amount === payment.payment_plan[0].total_amount;
2332
+ var areInstallmentsOfSameAmount = payment_plan == null ? void 0 : payment_plan.every(function (installment, index) {
2333
+ return index === 0 || installment.total_amount === payment_plan[0].total_amount;
1960
2334
  });
1961
2335
 
1962
2336
  if (areInstallmentsOfSameAmount) {
@@ -1965,13 +2339,13 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1965
2339
  defaultMessage: "{installmentsCount} x {totalAmount}",
1966
2340
  values: {
1967
2341
  totalAmount: /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
1968
- value: priceFromCents(payment.payment_plan[0].total_amount),
2342
+ value: priceFromCents(payment_plan[0].total_amount),
1969
2343
  style: "currency",
1970
2344
  currency: "EUR"
1971
2345
  }),
1972
2346
  installmentsCount: installmentsCount
1973
2347
  }
1974
- }), withNoFee());
2348
+ }), withNoFee(payment));
1975
2349
  }
1976
2350
 
1977
2351
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
@@ -1979,18 +2353,18 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
1979
2353
  defaultMessage: "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1980
2354
  values: {
1981
2355
  firstInstallmentAmount: /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
1982
- value: priceFromCents(payment.payment_plan[0].total_amount),
2356
+ value: priceFromCents(payment_plan[0].total_amount),
1983
2357
  style: "currency",
1984
2358
  currency: "EUR"
1985
2359
  }),
1986
2360
  numberOfRemainingInstallments: installmentsCount - 1,
1987
2361
  othersInstallmentAmount: /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
1988
- value: priceFromCents(payment.payment_plan[1].total_amount),
2362
+ value: priceFromCents(payment_plan[1].total_amount),
1989
2363
  style: "currency",
1990
2364
  currency: "EUR"
1991
2365
  })
1992
2366
  }
1993
- }), withNoFee());
2367
+ }), withNoFee(payment));
1994
2368
  }
1995
2369
 
1996
2370
  return /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
@@ -2006,13 +2380,13 @@ var EligibilityPlansButtons = function EligibilityPlansButtons(_ref) {
2006
2380
  currentPlanIndex = _ref.currentPlanIndex,
2007
2381
  setCurrentPlanIndex = _ref.setCurrentPlanIndex;
2008
2382
  return /*#__PURE__*/React__default.createElement("div", {
2009
- className: s$2.buttons
2383
+ className: cx(s$2.buttons, STATIC_CUSTOMISATION_CLASSES.eligibilityOptions)
2010
2384
  }, eligibilityPlans.map(function (eligibilityPlan, index) {
2011
2385
  var _cx;
2012
2386
 
2013
2387
  return /*#__PURE__*/React__default.createElement("button", {
2014
2388
  key: index,
2015
- className: cx((_cx = {}, _cx[s$2.active] = index === currentPlanIndex, _cx)),
2389
+ className: cx((_cx = {}, _cx[cx(s$2.active, STATIC_CUSTOMISATION_CLASSES.activeOption)] = index === currentPlanIndex, _cx)),
2016
2390
  onClick: function onClick() {
2017
2391
  return setCurrentPlanIndex(index);
2018
2392
  }
@@ -2031,10 +2405,10 @@ var Schedule = function Schedule(_ref) {
2031
2405
  var isCredit = currentPlan && currentPlan.installments_count > 4;
2032
2406
  var intl = reactIntl.useIntl();
2033
2407
  return /*#__PURE__*/React__default.createElement("div", {
2034
- className: s$3.schedule,
2408
+ className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
2035
2409
  "data-testid": "modal-installments-element"
2036
2410
  }, /*#__PURE__*/React__default.createElement("div", {
2037
- className: cx(s$3.scheduleLine, s$3.total)
2411
+ className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
2038
2412
  }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2039
2413
  id: "eligibility-modal.total",
2040
2414
  defaultMessage: "Total"
@@ -2043,7 +2417,7 @@ var Schedule = function Schedule(_ref) {
2043
2417
  style: "currency",
2044
2418
  currency: "EUR"
2045
2419
  }))), /*#__PURE__*/React__default.createElement("div", {
2046
- className: cx(s$3.scheduleLine, s$3.creditCost)
2420
+ className: cx(s$3.scheduleLine, s$3.creditCost, STATIC_CUSTOMISATION_CLASSES.scheduleCredit)
2047
2421
  }, isCredit ? /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2048
2422
  id: "eligibility-modal.credit-cost",
2049
2423
  defaultMessage: "Dont co\xFBt du cr\xE9dit"
@@ -2096,13 +2470,15 @@ var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2096
2470
 
2097
2471
  var Info = function Info() {
2098
2472
  return /*#__PURE__*/React__default.createElement("div", {
2099
- className: s$4.list,
2473
+ className: cx(s$4.list, STATIC_CUSTOMISATION_CLASSES.info),
2100
2474
  "data-testid": "modal-info-element"
2101
2475
  }, /*#__PURE__*/React__default.createElement("div", {
2102
2476
  className: s$4.listItem
2103
2477
  }, /*#__PURE__*/React__default.createElement("div", {
2104
2478
  className: s$4.bullet
2105
- }, "1"), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2479
+ }, "1"), /*#__PURE__*/React__default.createElement("div", {
2480
+ className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2481
+ }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2106
2482
  id: "eligibility-modal.bullet-1",
2107
2483
  defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
2108
2484
  values: {
@@ -2114,7 +2490,9 @@ var Info = function Info() {
2114
2490
  className: s$4.listItem
2115
2491
  }, /*#__PURE__*/React__default.createElement("div", {
2116
2492
  className: s$4.bullet
2117
- }, "2"), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2493
+ }, "2"), /*#__PURE__*/React__default.createElement("div", {
2494
+ className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2495
+ }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2118
2496
  id: "eligibility-modal.bullet-2",
2119
2497
  defaultMessage: "Renseignez les <strong>informations</strong> demand\xE9es.",
2120
2498
  values: {
@@ -2126,7 +2504,9 @@ var Info = function Info() {
2126
2504
  className: s$4.listItem
2127
2505
  }, /*#__PURE__*/React__default.createElement("div", {
2128
2506
  className: s$4.bullet
2129
- }, "3"), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2507
+ }, "3"), /*#__PURE__*/React__default.createElement("div", {
2508
+ className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2509
+ }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2130
2510
  id: "eligibility-modal.bullet-3",
2131
2511
  defaultMessage: "La validation de votre paiement <strong>instantan\xE9e</strong> !",
2132
2512
  values: {
@@ -2182,32 +2562,44 @@ var Logo = function Logo() {
2182
2562
 
2183
2563
  var s$6 = {"title":"_3ERx-"};
2184
2564
 
2185
- var Title = function Title() {
2565
+ var Title = function Title(_ref) {
2566
+ var isSomePlanDeferred = _ref.isSomePlanDeferred;
2186
2567
  return /*#__PURE__*/React__default.createElement("div", {
2187
- className: s$6.title,
2568
+ className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
2188
2569
  "data-testid": "modal-title-element"
2189
- }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2190
- id: "eligibility-modal.title",
2570
+ }, isSomePlanDeferred ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2571
+ id: 'eligibility-modal.title-deferred',
2191
2572
  defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
2192
2573
  values: {
2193
2574
  highlighted: function highlighted() {
2194
2575
  return /*#__PURE__*/React__default.createElement("span", null, [].slice.call(arguments));
2195
2576
  }
2196
2577
  }
2578
+ }) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2579
+ id: 'eligibility-modal.title',
2580
+ defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
2581
+ values: {
2582
+ highlighted: function highlighted() {
2583
+ return /*#__PURE__*/React__default.createElement("span", null, [].slice.call(arguments));
2584
+ }
2585
+ }
2197
2586
  }));
2198
2587
  };
2199
2588
 
2200
2589
  var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2201
2590
 
2202
2591
  var DesktopModal = function DesktopModal(_ref) {
2203
- var children = _ref.children;
2592
+ var children = _ref.children,
2593
+ isSomePlanDeferred = _ref.isSomePlanDeferred;
2204
2594
  return /*#__PURE__*/React__default.createElement("div", {
2205
2595
  className: s$7.container,
2206
2596
  "data-testid": "modal-container"
2207
2597
  }, /*#__PURE__*/React__default.createElement("div", {
2208
- className: cx([s$7.block, s$7.left])
2209
- }, /*#__PURE__*/React__default.createElement(Title, null), /*#__PURE__*/React__default.createElement(Info, null), /*#__PURE__*/React__default.createElement(Logo, null)), /*#__PURE__*/React__default.createElement("div", {
2210
- className: s$7.block
2598
+ className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2599
+ }, /*#__PURE__*/React__default.createElement(Title, {
2600
+ isSomePlanDeferred: isSomePlanDeferred
2601
+ }), /*#__PURE__*/React__default.createElement(Info, null), /*#__PURE__*/React__default.createElement(Logo, null)), /*#__PURE__*/React__default.createElement("div", {
2602
+ className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2211
2603
  }, children));
2212
2604
  };
2213
2605
 
@@ -2216,11 +2608,14 @@ var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2216
2608
  var s$9 = {"container":"_2G7Ch"};
2217
2609
 
2218
2610
  var MobileModal = function MobileModal(_ref) {
2219
- var children = _ref.children;
2611
+ var children = _ref.children,
2612
+ isSomePlanDeferred = _ref.isSomePlanDeferred;
2220
2613
  return /*#__PURE__*/React__default.createElement("div", {
2221
2614
  className: s$9.container,
2222
2615
  "data-testid": "modal-container"
2223
- }, /*#__PURE__*/React__default.createElement(Title, null), children, /*#__PURE__*/React__default.createElement(Info, null), /*#__PURE__*/React__default.createElement(Logo, null));
2616
+ }, /*#__PURE__*/React__default.createElement(Title, {
2617
+ isSomePlanDeferred: isSomePlanDeferred
2618
+ }), children, /*#__PURE__*/React__default.createElement(Info, null), /*#__PURE__*/React__default.createElement(Logo, null));
2224
2619
  };
2225
2620
 
2226
2621
  var EligibilityModal = function EligibilityModal(_ref) {
@@ -2241,25 +2636,23 @@ var EligibilityModal = function EligibilityModal(_ref) {
2241
2636
  return plan.eligible;
2242
2637
  });
2243
2638
  var currentPlan = eligiblePlans[currentPlanIndex];
2244
- var modalProps = {
2245
- eligibilityPlans: eligiblePlans,
2246
- currentPlanIndex: currentPlanIndex,
2247
- setCurrentPlanIndex: setCurrentPlanIndex,
2248
- currentPlan: currentPlan,
2249
- status: status
2250
- };
2639
+ var isSomePlanDeferred = eligibilityPlans.some(function (plan) {
2640
+ return plan.deferred_days > 0 || plan.deferred_months > 0;
2641
+ });
2251
2642
  return /*#__PURE__*/React__default.createElement(ControlledModal, {
2252
2643
  onClose: onClose,
2253
2644
  ariaHideApp: false,
2254
2645
  scrollable: true,
2255
2646
  isOpen: true
2256
- }, /*#__PURE__*/React__default.createElement(ModalComponent, Object.assign({}, modalProps), status === apiStatus.PENDING && /*#__PURE__*/React__default.createElement("div", {
2647
+ }, /*#__PURE__*/React__default.createElement(ModalComponent, {
2648
+ isSomePlanDeferred: isSomePlanDeferred
2649
+ }, status === apiStatus.PENDING && /*#__PURE__*/React__default.createElement("div", {
2257
2650
  className: s$8.loader
2258
2651
  }, /*#__PURE__*/React__default.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React__default.createElement("div", {
2259
2652
  className: s$8.noEligibility
2260
2653
  }, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
2261
2654
  id: "eligibility-modal.no-eligibility",
2262
- defaultMessage: "Oups, il semblerait que la simulation n'aie pas fonctionn\xE9."
2655
+ defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\xE9."
2263
2656
  })), status === apiStatus.SUCCESS && eligiblePlans.length >= 1 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(EligibilityPlansButtons, {
2264
2657
  eligibilityPlans: eligiblePlans,
2265
2658
  currentPlanIndex: currentPlanIndex,
@@ -2376,6 +2769,24 @@ var getIndexOfActivePlan = function getIndexOfActivePlan(_ref) {
2376
2769
  return 0;
2377
2770
  };
2378
2771
 
2772
+ /**
2773
+ * Prefix classes to avoid name collisions.
2774
+ */
2775
+ var prefix$1 = 'alma-payment-plans';
2776
+ /**
2777
+ * Class names for the **payment plans** widget.
2778
+ * Those classes are intended to be used by the **merchant developer**.
2779
+ */
2780
+
2781
+ var STATIC_CUSTOMISATION_CLASSES$1 = {
2782
+ container: prefix$1 + '-container',
2783
+ eligibilityLine: prefix$1 + '-eligibility-line',
2784
+ eligibilityOptions: prefix$1 + '-eligibility-options',
2785
+ notEligibleOption: prefix$1 + '-not-eligible-option',
2786
+ paymentInfo: prefix$1 + '-payment-info',
2787
+ activeOption: prefix$1 + '-active-option'
2788
+ };
2789
+
2379
2790
  var s$b = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
2380
2791
 
2381
2792
  var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
@@ -2402,7 +2813,7 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2402
2813
  eligibilityPlans: eligibilityPlans,
2403
2814
  suggestedPaymentPlan: suggestedPaymentPlan != null ? suggestedPaymentPlan : 0
2404
2815
  });
2405
- var isSuggestedPaymentPlanSpecified = suggestedPaymentPlan !== undefined; // 👈 The merchant decided to focus a tab and remove animated transition.
2816
+ var isSuggestedPaymentPlanSpecified = suggestedPaymentPlan !== undefined; // 👈 The merchant decided to focus a tab
2406
2817
 
2407
2818
  var isTransitionSpecified = transitionDelay !== undefined; // 👈 The merchant has specified a transition time
2408
2819
 
@@ -2487,14 +2898,14 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2487
2898
 
2488
2899
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
2489
2900
  onClick: handleOpenModal,
2490
- className: cx(s$b.widgetButton, (_cx = {}, _cx[s$b.clickable] = eligiblePlans.length > 0, _cx[s$b.unClickable] = eligiblePlans.length === 0, _cx)),
2901
+ className: cx(s$b.widgetButton, (_cx = {}, _cx[s$b.clickable] = eligiblePlans.length > 0, _cx[s$b.unClickable] = eligiblePlans.length === 0, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
2491
2902
  "data-testid": "widget-button"
2492
2903
  }, /*#__PURE__*/React__default.createElement("div", {
2493
- className: s$b.primaryContainer
2904
+ className: cx(s$b.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2494
2905
  }, /*#__PURE__*/React__default.createElement(LogoIcon, {
2495
2906
  className: s$b.logo
2496
2907
  }), /*#__PURE__*/React__default.createElement("div", {
2497
- className: s$b.paymentPlans
2908
+ className: cx(s$b.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2498
2909
  }, eligibilityPlans.map(function (eligibilityPlan, key) {
2499
2910
  var _cx2;
2500
2911
 
@@ -2504,10 +2915,10 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2504
2915
  return onHover(key);
2505
2916
  },
2506
2917
  onMouseOut: onLeave,
2507
- className: cx(s$b.plan, (_cx2 = {}, _cx2[s$b.active] = current === key, _cx2[s$b.notEligible] = !eligibilityPlan.eligible, _cx2))
2918
+ className: cx(s$b.plan, (_cx2 = {}, _cx2[cx(s$b.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = current === key, _cx2[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
2508
2919
  }, paymentPlanShorthandName(eligibilityPlan));
2509
2920
  }))), /*#__PURE__*/React__default.createElement("div", {
2510
- className: cx(s$b.info, (_cx3 = {}, _cx3[s$b.notEligible] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3))
2921
+ className: cx(s$b.info, (_cx3 = {}, _cx3[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3), STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
2511
2922
  }, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React__default.createElement(EligibilityModal, {
2512
2923
  initialPlanIndex: getIndexWithinEligiblePlans(current),
2513
2924
  onClose: closeModal,