@thecb/components 6.0.0-beta.3 → 6.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1475 -118
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1475 -118
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.js +1 -0
- package/src/components/atoms/dropdown/Dropdown.js +196 -124
- package/src/components/atoms/form-select/FormSelect.js +4 -2
- package/src/components/atoms/layouts/Box.js +79 -73
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +1 -0
package/dist/index.cjs.js
CHANGED
|
@@ -6309,7 +6309,7 @@ var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxS
|
|
|
6309
6309
|
completely off screen (only for users of screen readers)
|
|
6310
6310
|
*/
|
|
6311
6311
|
|
|
6312
|
-
var Box = function
|
|
6312
|
+
var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
6313
6313
|
var _ref$padding = _ref.padding,
|
|
6314
6314
|
padding = _ref$padding === void 0 ? "16px" : _ref$padding,
|
|
6315
6315
|
_ref$borderSize = _ref.borderSize,
|
|
@@ -6379,9 +6379,10 @@ var Box = function Box(_ref) {
|
|
|
6379
6379
|
onMouseLeave: onMouseLeave,
|
|
6380
6380
|
onFocus: onFocus,
|
|
6381
6381
|
onBlur: onBlur,
|
|
6382
|
-
onTouchEnd: onTouchEnd
|
|
6383
|
-
|
|
6384
|
-
};
|
|
6382
|
+
onTouchEnd: onTouchEnd,
|
|
6383
|
+
ref: ref
|
|
6384
|
+
}, rest), children && safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
6385
|
+
});
|
|
6385
6386
|
|
|
6386
6387
|
var CenterWrapper = styled__default.div.withConfig({
|
|
6387
6388
|
displayName: "Centerstyled__CenterWrapper",
|
|
@@ -19398,6 +19399,1254 @@ var DropdownIcon = function DropdownIcon() {
|
|
|
19398
19399
|
})))));
|
|
19399
19400
|
};
|
|
19400
19401
|
|
|
19402
|
+
var check = function (it) {
|
|
19403
|
+
return it && it.Math == Math && it;
|
|
19404
|
+
};
|
|
19405
|
+
|
|
19406
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
19407
|
+
var global_1 =
|
|
19408
|
+
// eslint-disable-next-line es-x/no-global-this -- safe
|
|
19409
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
19410
|
+
check(typeof window == 'object' && window) ||
|
|
19411
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
19412
|
+
check(typeof self == 'object' && self) ||
|
|
19413
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
19414
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
19415
|
+
(function () { return this; })() || Function('return this')();
|
|
19416
|
+
|
|
19417
|
+
var fails = function (exec) {
|
|
19418
|
+
try {
|
|
19419
|
+
return !!exec();
|
|
19420
|
+
} catch (error) {
|
|
19421
|
+
return true;
|
|
19422
|
+
}
|
|
19423
|
+
};
|
|
19424
|
+
|
|
19425
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
19426
|
+
var descriptors = !fails(function () {
|
|
19427
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
19428
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
19429
|
+
});
|
|
19430
|
+
|
|
19431
|
+
var functionBindNative = !fails(function () {
|
|
19432
|
+
// eslint-disable-next-line es-x/no-function-prototype-bind -- safe
|
|
19433
|
+
var test = (function () { /* empty */ }).bind();
|
|
19434
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
19435
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
19436
|
+
});
|
|
19437
|
+
|
|
19438
|
+
var call = Function.prototype.call;
|
|
19439
|
+
|
|
19440
|
+
var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
19441
|
+
return call.apply(call, arguments);
|
|
19442
|
+
};
|
|
19443
|
+
|
|
19444
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
19445
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19446
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
19447
|
+
|
|
19448
|
+
// Nashorn ~ JDK8 bug
|
|
19449
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
19450
|
+
|
|
19451
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
19452
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
19453
|
+
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
19454
|
+
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
19455
|
+
return !!descriptor && descriptor.enumerable;
|
|
19456
|
+
} : $propertyIsEnumerable;
|
|
19457
|
+
|
|
19458
|
+
var objectPropertyIsEnumerable = {
|
|
19459
|
+
f: f
|
|
19460
|
+
};
|
|
19461
|
+
|
|
19462
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
|
19463
|
+
return {
|
|
19464
|
+
enumerable: !(bitmap & 1),
|
|
19465
|
+
configurable: !(bitmap & 2),
|
|
19466
|
+
writable: !(bitmap & 4),
|
|
19467
|
+
value: value
|
|
19468
|
+
};
|
|
19469
|
+
};
|
|
19470
|
+
|
|
19471
|
+
var FunctionPrototype = Function.prototype;
|
|
19472
|
+
var bind$1 = FunctionPrototype.bind;
|
|
19473
|
+
var call$1 = FunctionPrototype.call;
|
|
19474
|
+
var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
|
|
19475
|
+
|
|
19476
|
+
var functionUncurryThis = functionBindNative ? function (fn) {
|
|
19477
|
+
return fn && uncurryThis(fn);
|
|
19478
|
+
} : function (fn) {
|
|
19479
|
+
return fn && function () {
|
|
19480
|
+
return call$1.apply(fn, arguments);
|
|
19481
|
+
};
|
|
19482
|
+
};
|
|
19483
|
+
|
|
19484
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
19485
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
19486
|
+
|
|
19487
|
+
var classofRaw = function (it) {
|
|
19488
|
+
return stringSlice(toString$2(it), 8, -1);
|
|
19489
|
+
};
|
|
19490
|
+
|
|
19491
|
+
var Object$1 = global_1.Object;
|
|
19492
|
+
var split = functionUncurryThis(''.split);
|
|
19493
|
+
|
|
19494
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
19495
|
+
var indexedObject = fails(function () {
|
|
19496
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
19497
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
19498
|
+
return !Object$1('z').propertyIsEnumerable(0);
|
|
19499
|
+
}) ? function (it) {
|
|
19500
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$1(it);
|
|
19501
|
+
} : Object$1;
|
|
19502
|
+
|
|
19503
|
+
var TypeError$1 = global_1.TypeError;
|
|
19504
|
+
|
|
19505
|
+
// `RequireObjectCoercible` abstract operation
|
|
19506
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
19507
|
+
var requireObjectCoercible = function (it) {
|
|
19508
|
+
if (it == undefined) throw TypeError$1("Can't call method on " + it);
|
|
19509
|
+
return it;
|
|
19510
|
+
};
|
|
19511
|
+
|
|
19512
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
19513
|
+
|
|
19514
|
+
|
|
19515
|
+
|
|
19516
|
+
var toIndexedObject = function (it) {
|
|
19517
|
+
return indexedObject(requireObjectCoercible(it));
|
|
19518
|
+
};
|
|
19519
|
+
|
|
19520
|
+
// `IsCallable` abstract operation
|
|
19521
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
19522
|
+
var isCallable = function (argument) {
|
|
19523
|
+
return typeof argument == 'function';
|
|
19524
|
+
};
|
|
19525
|
+
|
|
19526
|
+
var isObject = function (it) {
|
|
19527
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
19528
|
+
};
|
|
19529
|
+
|
|
19530
|
+
var aFunction = function (argument) {
|
|
19531
|
+
return isCallable(argument) ? argument : undefined;
|
|
19532
|
+
};
|
|
19533
|
+
|
|
19534
|
+
var getBuiltIn = function (namespace, method) {
|
|
19535
|
+
return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
|
|
19536
|
+
};
|
|
19537
|
+
|
|
19538
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
19539
|
+
|
|
19540
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
19541
|
+
|
|
19542
|
+
var process$1 = global_1.process;
|
|
19543
|
+
var Deno = global_1.Deno;
|
|
19544
|
+
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
|
19545
|
+
var v8 = versions && versions.v8;
|
|
19546
|
+
var match, version;
|
|
19547
|
+
|
|
19548
|
+
if (v8) {
|
|
19549
|
+
match = v8.split('.');
|
|
19550
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
19551
|
+
// but their correct versions are not interesting for us
|
|
19552
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
19553
|
+
}
|
|
19554
|
+
|
|
19555
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
19556
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
19557
|
+
if (!version && engineUserAgent) {
|
|
19558
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
19559
|
+
if (!match || match[1] >= 74) {
|
|
19560
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
19561
|
+
if (match) version = +match[1];
|
|
19562
|
+
}
|
|
19563
|
+
}
|
|
19564
|
+
|
|
19565
|
+
var engineV8Version = version;
|
|
19566
|
+
|
|
19567
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
19568
|
+
|
|
19569
|
+
|
|
19570
|
+
|
|
19571
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
|
|
19572
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
19573
|
+
var symbol = Symbol();
|
|
19574
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
19575
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
19576
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
19577
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
19578
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
19579
|
+
});
|
|
19580
|
+
|
|
19581
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
19582
|
+
|
|
19583
|
+
|
|
19584
|
+
var useSymbolAsUid = nativeSymbol
|
|
19585
|
+
&& !Symbol.sham
|
|
19586
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
19587
|
+
|
|
19588
|
+
var Object$2 = global_1.Object;
|
|
19589
|
+
|
|
19590
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
|
19591
|
+
return typeof it == 'symbol';
|
|
19592
|
+
} : function (it) {
|
|
19593
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
19594
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$2(it));
|
|
19595
|
+
};
|
|
19596
|
+
|
|
19597
|
+
var String$1 = global_1.String;
|
|
19598
|
+
|
|
19599
|
+
var tryToString = function (argument) {
|
|
19600
|
+
try {
|
|
19601
|
+
return String$1(argument);
|
|
19602
|
+
} catch (error) {
|
|
19603
|
+
return 'Object';
|
|
19604
|
+
}
|
|
19605
|
+
};
|
|
19606
|
+
|
|
19607
|
+
var TypeError$2 = global_1.TypeError;
|
|
19608
|
+
|
|
19609
|
+
// `Assert: IsCallable(argument) is true`
|
|
19610
|
+
var aCallable = function (argument) {
|
|
19611
|
+
if (isCallable(argument)) return argument;
|
|
19612
|
+
throw TypeError$2(tryToString(argument) + ' is not a function');
|
|
19613
|
+
};
|
|
19614
|
+
|
|
19615
|
+
// `GetMethod` abstract operation
|
|
19616
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
19617
|
+
var getMethod = function (V, P) {
|
|
19618
|
+
var func = V[P];
|
|
19619
|
+
return func == null ? undefined : aCallable(func);
|
|
19620
|
+
};
|
|
19621
|
+
|
|
19622
|
+
var TypeError$3 = global_1.TypeError;
|
|
19623
|
+
|
|
19624
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
19625
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
19626
|
+
var ordinaryToPrimitive = function (input, pref) {
|
|
19627
|
+
var fn, val;
|
|
19628
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
19629
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
19630
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
19631
|
+
throw TypeError$3("Can't convert object to primitive value");
|
|
19632
|
+
};
|
|
19633
|
+
|
|
19634
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
19635
|
+
var defineProperty = Object.defineProperty;
|
|
19636
|
+
|
|
19637
|
+
var setGlobal = function (key, value) {
|
|
19638
|
+
try {
|
|
19639
|
+
defineProperty(global_1, key, { value: value, configurable: true, writable: true });
|
|
19640
|
+
} catch (error) {
|
|
19641
|
+
global_1[key] = value;
|
|
19642
|
+
} return value;
|
|
19643
|
+
};
|
|
19644
|
+
|
|
19645
|
+
var SHARED = '__core-js_shared__';
|
|
19646
|
+
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
|
19647
|
+
|
|
19648
|
+
var sharedStore = store;
|
|
19649
|
+
|
|
19650
|
+
var shared = createCommonjsModule(function (module) {
|
|
19651
|
+
(module.exports = function (key, value) {
|
|
19652
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
19653
|
+
})('versions', []).push({
|
|
19654
|
+
version: '3.22.5',
|
|
19655
|
+
mode: 'global',
|
|
19656
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
19657
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
|
|
19658
|
+
source: 'https://github.com/zloirock/core-js'
|
|
19659
|
+
});
|
|
19660
|
+
});
|
|
19661
|
+
|
|
19662
|
+
var Object$3 = global_1.Object;
|
|
19663
|
+
|
|
19664
|
+
// `ToObject` abstract operation
|
|
19665
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
19666
|
+
var toObject = function (argument) {
|
|
19667
|
+
return Object$3(requireObjectCoercible(argument));
|
|
19668
|
+
};
|
|
19669
|
+
|
|
19670
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
19671
|
+
|
|
19672
|
+
// `HasOwnProperty` abstract operation
|
|
19673
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
19674
|
+
// eslint-disable-next-line es-x/no-object-hasown -- safe
|
|
19675
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
19676
|
+
return hasOwnProperty(toObject(it), key);
|
|
19677
|
+
};
|
|
19678
|
+
|
|
19679
|
+
var id = 0;
|
|
19680
|
+
var postfix = Math.random();
|
|
19681
|
+
var toString$3 = functionUncurryThis(1.0.toString);
|
|
19682
|
+
|
|
19683
|
+
var uid = function (key) {
|
|
19684
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
19685
|
+
};
|
|
19686
|
+
|
|
19687
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
19688
|
+
var Symbol$1 = global_1.Symbol;
|
|
19689
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
19690
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
19691
|
+
|
|
19692
|
+
var wellKnownSymbol = function (name) {
|
|
19693
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
19694
|
+
var description = 'Symbol.' + name;
|
|
19695
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
19696
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
19697
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
19698
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
19699
|
+
} else {
|
|
19700
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
19701
|
+
}
|
|
19702
|
+
} return WellKnownSymbolsStore[name];
|
|
19703
|
+
};
|
|
19704
|
+
|
|
19705
|
+
var TypeError$4 = global_1.TypeError;
|
|
19706
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
19707
|
+
|
|
19708
|
+
// `ToPrimitive` abstract operation
|
|
19709
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
19710
|
+
var toPrimitive = function (input, pref) {
|
|
19711
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
|
19712
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
19713
|
+
var result;
|
|
19714
|
+
if (exoticToPrim) {
|
|
19715
|
+
if (pref === undefined) pref = 'default';
|
|
19716
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
19717
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
|
19718
|
+
throw TypeError$4("Can't convert object to primitive value");
|
|
19719
|
+
}
|
|
19720
|
+
if (pref === undefined) pref = 'number';
|
|
19721
|
+
return ordinaryToPrimitive(input, pref);
|
|
19722
|
+
};
|
|
19723
|
+
|
|
19724
|
+
// `ToPropertyKey` abstract operation
|
|
19725
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
19726
|
+
var toPropertyKey = function (argument) {
|
|
19727
|
+
var key = toPrimitive(argument, 'string');
|
|
19728
|
+
return isSymbol(key) ? key : key + '';
|
|
19729
|
+
};
|
|
19730
|
+
|
|
19731
|
+
var document$1 = global_1.document;
|
|
19732
|
+
// typeof document.createElement is 'object' in old IE
|
|
19733
|
+
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
|
19734
|
+
|
|
19735
|
+
var documentCreateElement = function (it) {
|
|
19736
|
+
return EXISTS ? document$1.createElement(it) : {};
|
|
19737
|
+
};
|
|
19738
|
+
|
|
19739
|
+
// Thanks to IE8 for its funny defineProperty
|
|
19740
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
|
19741
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
19742
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
19743
|
+
get: function () { return 7; }
|
|
19744
|
+
}).a != 7;
|
|
19745
|
+
});
|
|
19746
|
+
|
|
19747
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19748
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
19749
|
+
|
|
19750
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
19751
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
19752
|
+
var f$1 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
19753
|
+
O = toIndexedObject(O);
|
|
19754
|
+
P = toPropertyKey(P);
|
|
19755
|
+
if (ie8DomDefine) try {
|
|
19756
|
+
return $getOwnPropertyDescriptor(O, P);
|
|
19757
|
+
} catch (error) { /* empty */ }
|
|
19758
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
19759
|
+
};
|
|
19760
|
+
|
|
19761
|
+
var objectGetOwnPropertyDescriptor = {
|
|
19762
|
+
f: f$1
|
|
19763
|
+
};
|
|
19764
|
+
|
|
19765
|
+
// V8 ~ Chrome 36-
|
|
19766
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
19767
|
+
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
19768
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
19769
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
19770
|
+
value: 42,
|
|
19771
|
+
writable: false
|
|
19772
|
+
}).prototype != 42;
|
|
19773
|
+
});
|
|
19774
|
+
|
|
19775
|
+
var String$2 = global_1.String;
|
|
19776
|
+
var TypeError$5 = global_1.TypeError;
|
|
19777
|
+
|
|
19778
|
+
// `Assert: Type(argument) is Object`
|
|
19779
|
+
var anObject = function (argument) {
|
|
19780
|
+
if (isObject(argument)) return argument;
|
|
19781
|
+
throw TypeError$5(String$2(argument) + ' is not an object');
|
|
19782
|
+
};
|
|
19783
|
+
|
|
19784
|
+
var TypeError$6 = global_1.TypeError;
|
|
19785
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
19786
|
+
var $defineProperty = Object.defineProperty;
|
|
19787
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19788
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
19789
|
+
var ENUMERABLE = 'enumerable';
|
|
19790
|
+
var CONFIGURABLE = 'configurable';
|
|
19791
|
+
var WRITABLE = 'writable';
|
|
19792
|
+
|
|
19793
|
+
// `Object.defineProperty` method
|
|
19794
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
19795
|
+
var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
|
|
19796
|
+
anObject(O);
|
|
19797
|
+
P = toPropertyKey(P);
|
|
19798
|
+
anObject(Attributes);
|
|
19799
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
19800
|
+
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
19801
|
+
if (current && current[WRITABLE]) {
|
|
19802
|
+
O[P] = Attributes.value;
|
|
19803
|
+
Attributes = {
|
|
19804
|
+
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
|
19805
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
19806
|
+
writable: false
|
|
19807
|
+
};
|
|
19808
|
+
}
|
|
19809
|
+
} return $defineProperty(O, P, Attributes);
|
|
19810
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
19811
|
+
anObject(O);
|
|
19812
|
+
P = toPropertyKey(P);
|
|
19813
|
+
anObject(Attributes);
|
|
19814
|
+
if (ie8DomDefine) try {
|
|
19815
|
+
return $defineProperty(O, P, Attributes);
|
|
19816
|
+
} catch (error) { /* empty */ }
|
|
19817
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
|
|
19818
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
19819
|
+
return O;
|
|
19820
|
+
};
|
|
19821
|
+
|
|
19822
|
+
var objectDefineProperty = {
|
|
19823
|
+
f: f$2
|
|
19824
|
+
};
|
|
19825
|
+
|
|
19826
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
19827
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
19828
|
+
} : function (object, key, value) {
|
|
19829
|
+
object[key] = value;
|
|
19830
|
+
return object;
|
|
19831
|
+
};
|
|
19832
|
+
|
|
19833
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
19834
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19835
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
19836
|
+
|
|
19837
|
+
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
19838
|
+
// additional protection from minified / mangled / dropped function names
|
|
19839
|
+
var PROPER = EXISTS$1 && (function something() { /* empty */ }).name === 'something';
|
|
19840
|
+
var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
19841
|
+
|
|
19842
|
+
var functionName = {
|
|
19843
|
+
EXISTS: EXISTS$1,
|
|
19844
|
+
PROPER: PROPER,
|
|
19845
|
+
CONFIGURABLE: CONFIGURABLE$1
|
|
19846
|
+
};
|
|
19847
|
+
|
|
19848
|
+
var functionToString = functionUncurryThis(Function.toString);
|
|
19849
|
+
|
|
19850
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
19851
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
19852
|
+
sharedStore.inspectSource = function (it) {
|
|
19853
|
+
return functionToString(it);
|
|
19854
|
+
};
|
|
19855
|
+
}
|
|
19856
|
+
|
|
19857
|
+
var inspectSource = sharedStore.inspectSource;
|
|
19858
|
+
|
|
19859
|
+
var WeakMap$1 = global_1.WeakMap;
|
|
19860
|
+
|
|
19861
|
+
var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
|
|
19862
|
+
|
|
19863
|
+
var keys$1 = shared('keys');
|
|
19864
|
+
|
|
19865
|
+
var sharedKey = function (key) {
|
|
19866
|
+
return keys$1[key] || (keys$1[key] = uid(key));
|
|
19867
|
+
};
|
|
19868
|
+
|
|
19869
|
+
var hiddenKeys = {};
|
|
19870
|
+
|
|
19871
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
19872
|
+
var TypeError$7 = global_1.TypeError;
|
|
19873
|
+
var WeakMap$2 = global_1.WeakMap;
|
|
19874
|
+
var set, get, has;
|
|
19875
|
+
|
|
19876
|
+
var enforce = function (it) {
|
|
19877
|
+
return has(it) ? get(it) : set(it, {});
|
|
19878
|
+
};
|
|
19879
|
+
|
|
19880
|
+
var getterFor = function (TYPE) {
|
|
19881
|
+
return function (it) {
|
|
19882
|
+
var state;
|
|
19883
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
19884
|
+
throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
|
|
19885
|
+
} return state;
|
|
19886
|
+
};
|
|
19887
|
+
};
|
|
19888
|
+
|
|
19889
|
+
if (nativeWeakMap || sharedStore.state) {
|
|
19890
|
+
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
19891
|
+
var wmget = functionUncurryThis(store$1.get);
|
|
19892
|
+
var wmhas = functionUncurryThis(store$1.has);
|
|
19893
|
+
var wmset = functionUncurryThis(store$1.set);
|
|
19894
|
+
set = function (it, metadata) {
|
|
19895
|
+
if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
19896
|
+
metadata.facade = it;
|
|
19897
|
+
wmset(store$1, it, metadata);
|
|
19898
|
+
return metadata;
|
|
19899
|
+
};
|
|
19900
|
+
get = function (it) {
|
|
19901
|
+
return wmget(store$1, it) || {};
|
|
19902
|
+
};
|
|
19903
|
+
has = function (it) {
|
|
19904
|
+
return wmhas(store$1, it);
|
|
19905
|
+
};
|
|
19906
|
+
} else {
|
|
19907
|
+
var STATE = sharedKey('state');
|
|
19908
|
+
hiddenKeys[STATE] = true;
|
|
19909
|
+
set = function (it, metadata) {
|
|
19910
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
19911
|
+
metadata.facade = it;
|
|
19912
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
19913
|
+
return metadata;
|
|
19914
|
+
};
|
|
19915
|
+
get = function (it) {
|
|
19916
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
19917
|
+
};
|
|
19918
|
+
has = function (it) {
|
|
19919
|
+
return hasOwnProperty_1(it, STATE);
|
|
19920
|
+
};
|
|
19921
|
+
}
|
|
19922
|
+
|
|
19923
|
+
var internalState = {
|
|
19924
|
+
set: set,
|
|
19925
|
+
get: get,
|
|
19926
|
+
has: has,
|
|
19927
|
+
enforce: enforce,
|
|
19928
|
+
getterFor: getterFor
|
|
19929
|
+
};
|
|
19930
|
+
|
|
19931
|
+
var makeBuiltIn_1 = createCommonjsModule(function (module) {
|
|
19932
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
19933
|
+
|
|
19934
|
+
|
|
19935
|
+
|
|
19936
|
+
var enforceInternalState = internalState.enforce;
|
|
19937
|
+
var getInternalState = internalState.get;
|
|
19938
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
19939
|
+
var defineProperty = Object.defineProperty;
|
|
19940
|
+
|
|
19941
|
+
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
19942
|
+
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
19943
|
+
});
|
|
19944
|
+
|
|
19945
|
+
var TEMPLATE = String(String).split('String');
|
|
19946
|
+
|
|
19947
|
+
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
19948
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
19949
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
19950
|
+
}
|
|
19951
|
+
if (options && options.getter) name = 'get ' + name;
|
|
19952
|
+
if (options && options.setter) name = 'set ' + name;
|
|
19953
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
19954
|
+
defineProperty(value, 'name', { value: name, configurable: true });
|
|
19955
|
+
}
|
|
19956
|
+
if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
|
|
19957
|
+
defineProperty(value, 'length', { value: options.arity });
|
|
19958
|
+
}
|
|
19959
|
+
if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
|
|
19960
|
+
if (descriptors) try {
|
|
19961
|
+
defineProperty(value, 'prototype', { writable: false });
|
|
19962
|
+
} catch (error) { /* empty */ }
|
|
19963
|
+
} else value.prototype = undefined;
|
|
19964
|
+
var state = enforceInternalState(value);
|
|
19965
|
+
if (!hasOwnProperty_1(state, 'source')) {
|
|
19966
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
19967
|
+
} return value;
|
|
19968
|
+
};
|
|
19969
|
+
|
|
19970
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
19971
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
19972
|
+
Function.prototype.toString = makeBuiltIn(function toString() {
|
|
19973
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
19974
|
+
}, 'toString');
|
|
19975
|
+
});
|
|
19976
|
+
|
|
19977
|
+
var defineBuiltIn = function (O, key, value, options) {
|
|
19978
|
+
var unsafe = options ? !!options.unsafe : false;
|
|
19979
|
+
var simple = options ? !!options.enumerable : false;
|
|
19980
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
19981
|
+
var name = options && options.name !== undefined ? options.name : key;
|
|
19982
|
+
if (isCallable(value)) makeBuiltIn_1(value, name, options);
|
|
19983
|
+
if (O === global_1) {
|
|
19984
|
+
if (simple) O[key] = value;
|
|
19985
|
+
else setGlobal(key, value);
|
|
19986
|
+
return O;
|
|
19987
|
+
} else if (!unsafe) {
|
|
19988
|
+
delete O[key];
|
|
19989
|
+
} else if (!noTargetGet && O[key]) {
|
|
19990
|
+
simple = true;
|
|
19991
|
+
}
|
|
19992
|
+
if (simple) O[key] = value;
|
|
19993
|
+
else createNonEnumerableProperty(O, key, value);
|
|
19994
|
+
return O;
|
|
19995
|
+
};
|
|
19996
|
+
|
|
19997
|
+
var ceil = Math.ceil;
|
|
19998
|
+
var floor = Math.floor;
|
|
19999
|
+
|
|
20000
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
20001
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
20002
|
+
var toIntegerOrInfinity = function (argument) {
|
|
20003
|
+
var number = +argument;
|
|
20004
|
+
// eslint-disable-next-line no-self-compare -- safe
|
|
20005
|
+
return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
|
|
20006
|
+
};
|
|
20007
|
+
|
|
20008
|
+
var max = Math.max;
|
|
20009
|
+
var min = Math.min;
|
|
20010
|
+
|
|
20011
|
+
// Helper for a popular repeating case of the spec:
|
|
20012
|
+
// Let integer be ? ToInteger(index).
|
|
20013
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
20014
|
+
var toAbsoluteIndex = function (index, length) {
|
|
20015
|
+
var integer = toIntegerOrInfinity(index);
|
|
20016
|
+
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
20017
|
+
};
|
|
20018
|
+
|
|
20019
|
+
var min$1 = Math.min;
|
|
20020
|
+
|
|
20021
|
+
// `ToLength` abstract operation
|
|
20022
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
20023
|
+
var toLength = function (argument) {
|
|
20024
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
20025
|
+
};
|
|
20026
|
+
|
|
20027
|
+
// `LengthOfArrayLike` abstract operation
|
|
20028
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
20029
|
+
var lengthOfArrayLike = function (obj) {
|
|
20030
|
+
return toLength(obj.length);
|
|
20031
|
+
};
|
|
20032
|
+
|
|
20033
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
20034
|
+
var createMethod = function (IS_INCLUDES) {
|
|
20035
|
+
return function ($this, el, fromIndex) {
|
|
20036
|
+
var O = toIndexedObject($this);
|
|
20037
|
+
var length = lengthOfArrayLike(O);
|
|
20038
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
20039
|
+
var value;
|
|
20040
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
20041
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
20042
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
20043
|
+
value = O[index++];
|
|
20044
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
20045
|
+
if (value != value) return true;
|
|
20046
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
20047
|
+
} else for (;length > index; index++) {
|
|
20048
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
20049
|
+
} return !IS_INCLUDES && -1;
|
|
20050
|
+
};
|
|
20051
|
+
};
|
|
20052
|
+
|
|
20053
|
+
var arrayIncludes = {
|
|
20054
|
+
// `Array.prototype.includes` method
|
|
20055
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
20056
|
+
includes: createMethod(true),
|
|
20057
|
+
// `Array.prototype.indexOf` method
|
|
20058
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
20059
|
+
indexOf: createMethod(false)
|
|
20060
|
+
};
|
|
20061
|
+
|
|
20062
|
+
var indexOf = arrayIncludes.indexOf;
|
|
20063
|
+
|
|
20064
|
+
|
|
20065
|
+
var push = functionUncurryThis([].push);
|
|
20066
|
+
|
|
20067
|
+
var objectKeysInternal = function (object, names) {
|
|
20068
|
+
var O = toIndexedObject(object);
|
|
20069
|
+
var i = 0;
|
|
20070
|
+
var result = [];
|
|
20071
|
+
var key;
|
|
20072
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys, key) && hasOwnProperty_1(O, key) && push(result, key);
|
|
20073
|
+
// Don't enum bug & hidden keys
|
|
20074
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
20075
|
+
~indexOf(result, key) || push(result, key);
|
|
20076
|
+
}
|
|
20077
|
+
return result;
|
|
20078
|
+
};
|
|
20079
|
+
|
|
20080
|
+
// IE8- don't enum bug keys
|
|
20081
|
+
var enumBugKeys = [
|
|
20082
|
+
'constructor',
|
|
20083
|
+
'hasOwnProperty',
|
|
20084
|
+
'isPrototypeOf',
|
|
20085
|
+
'propertyIsEnumerable',
|
|
20086
|
+
'toLocaleString',
|
|
20087
|
+
'toString',
|
|
20088
|
+
'valueOf'
|
|
20089
|
+
];
|
|
20090
|
+
|
|
20091
|
+
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
20092
|
+
|
|
20093
|
+
// `Object.getOwnPropertyNames` method
|
|
20094
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
20095
|
+
// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
|
|
20096
|
+
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
20097
|
+
return objectKeysInternal(O, hiddenKeys$1);
|
|
20098
|
+
};
|
|
20099
|
+
|
|
20100
|
+
var objectGetOwnPropertyNames = {
|
|
20101
|
+
f: f$3
|
|
20102
|
+
};
|
|
20103
|
+
|
|
20104
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
|
|
20105
|
+
var f$4 = Object.getOwnPropertySymbols;
|
|
20106
|
+
|
|
20107
|
+
var objectGetOwnPropertySymbols = {
|
|
20108
|
+
f: f$4
|
|
20109
|
+
};
|
|
20110
|
+
|
|
20111
|
+
var concat = functionUncurryThis([].concat);
|
|
20112
|
+
|
|
20113
|
+
// all object keys, includes non-enumerable and symbols
|
|
20114
|
+
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
20115
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
20116
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
20117
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
20118
|
+
};
|
|
20119
|
+
|
|
20120
|
+
var copyConstructorProperties = function (target, source, exceptions) {
|
|
20121
|
+
var keys = ownKeys$1(source);
|
|
20122
|
+
var defineProperty = objectDefineProperty.f;
|
|
20123
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
20124
|
+
for (var i = 0; i < keys.length; i++) {
|
|
20125
|
+
var key = keys[i];
|
|
20126
|
+
if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
|
|
20127
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
20128
|
+
}
|
|
20129
|
+
}
|
|
20130
|
+
};
|
|
20131
|
+
|
|
20132
|
+
var replacement = /#|\.prototype\./;
|
|
20133
|
+
|
|
20134
|
+
var isForced = function (feature, detection) {
|
|
20135
|
+
var value = data[normalize(feature)];
|
|
20136
|
+
return value == POLYFILL ? true
|
|
20137
|
+
: value == NATIVE ? false
|
|
20138
|
+
: isCallable(detection) ? fails(detection)
|
|
20139
|
+
: !!detection;
|
|
20140
|
+
};
|
|
20141
|
+
|
|
20142
|
+
var normalize = isForced.normalize = function (string) {
|
|
20143
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
20144
|
+
};
|
|
20145
|
+
|
|
20146
|
+
var data = isForced.data = {};
|
|
20147
|
+
var NATIVE = isForced.NATIVE = 'N';
|
|
20148
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
|
20149
|
+
|
|
20150
|
+
var isForced_1 = isForced;
|
|
20151
|
+
|
|
20152
|
+
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
20153
|
+
|
|
20154
|
+
|
|
20155
|
+
|
|
20156
|
+
|
|
20157
|
+
|
|
20158
|
+
|
|
20159
|
+
/*
|
|
20160
|
+
options.target - name of the target object
|
|
20161
|
+
options.global - target is the global object
|
|
20162
|
+
options.stat - export as static methods of target
|
|
20163
|
+
options.proto - export as prototype methods of target
|
|
20164
|
+
options.real - real prototype method for the `pure` version
|
|
20165
|
+
options.forced - export even if the native feature is available
|
|
20166
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
20167
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
20168
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
20169
|
+
options.sham - add a flag to not completely full polyfills
|
|
20170
|
+
options.enumerable - export as enumerable property
|
|
20171
|
+
options.noTargetGet - prevent calling a getter on target
|
|
20172
|
+
options.name - the .name of the function if it does not match the key
|
|
20173
|
+
*/
|
|
20174
|
+
var _export = function (options, source) {
|
|
20175
|
+
var TARGET = options.target;
|
|
20176
|
+
var GLOBAL = options.global;
|
|
20177
|
+
var STATIC = options.stat;
|
|
20178
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
20179
|
+
if (GLOBAL) {
|
|
20180
|
+
target = global_1;
|
|
20181
|
+
} else if (STATIC) {
|
|
20182
|
+
target = global_1[TARGET] || setGlobal(TARGET, {});
|
|
20183
|
+
} else {
|
|
20184
|
+
target = (global_1[TARGET] || {}).prototype;
|
|
20185
|
+
}
|
|
20186
|
+
if (target) for (key in source) {
|
|
20187
|
+
sourceProperty = source[key];
|
|
20188
|
+
if (options.noTargetGet) {
|
|
20189
|
+
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
20190
|
+
targetProperty = descriptor && descriptor.value;
|
|
20191
|
+
} else targetProperty = target[key];
|
|
20192
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
20193
|
+
// contained in target
|
|
20194
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
20195
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
20196
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
20197
|
+
}
|
|
20198
|
+
// add a flag to not completely full polyfills
|
|
20199
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
20200
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
20201
|
+
}
|
|
20202
|
+
defineBuiltIn(target, key, sourceProperty, options);
|
|
20203
|
+
}
|
|
20204
|
+
};
|
|
20205
|
+
|
|
20206
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
20207
|
+
var test$1 = {};
|
|
20208
|
+
|
|
20209
|
+
test$1[TO_STRING_TAG] = 'z';
|
|
20210
|
+
|
|
20211
|
+
var toStringTagSupport = String(test$1) === '[object z]';
|
|
20212
|
+
|
|
20213
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
20214
|
+
var Object$4 = global_1.Object;
|
|
20215
|
+
|
|
20216
|
+
// ES3 wrong here
|
|
20217
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
20218
|
+
|
|
20219
|
+
// fallback for IE11 Script Access Denied error
|
|
20220
|
+
var tryGet = function (it, key) {
|
|
20221
|
+
try {
|
|
20222
|
+
return it[key];
|
|
20223
|
+
} catch (error) { /* empty */ }
|
|
20224
|
+
};
|
|
20225
|
+
|
|
20226
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
20227
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
20228
|
+
var O, tag, result;
|
|
20229
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
20230
|
+
// @@toStringTag case
|
|
20231
|
+
: typeof (tag = tryGet(O = Object$4(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
20232
|
+
// builtinTag case
|
|
20233
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
20234
|
+
// ES3 arguments fallback
|
|
20235
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
20236
|
+
};
|
|
20237
|
+
|
|
20238
|
+
var String$3 = global_1.String;
|
|
20239
|
+
|
|
20240
|
+
var toString_1 = function (argument) {
|
|
20241
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
20242
|
+
return String$3(argument);
|
|
20243
|
+
};
|
|
20244
|
+
|
|
20245
|
+
var charAt = functionUncurryThis(''.charAt);
|
|
20246
|
+
|
|
20247
|
+
var FORCED = fails(function () {
|
|
20248
|
+
// eslint-disable-next-line es-x/no-array-string-prototype-at -- safe
|
|
20249
|
+
return '𠮷'.at(-2) !== '\uD842';
|
|
20250
|
+
});
|
|
20251
|
+
|
|
20252
|
+
// `String.prototype.at` method
|
|
20253
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
20254
|
+
_export({ target: 'String', proto: true, forced: FORCED }, {
|
|
20255
|
+
at: function at(index) {
|
|
20256
|
+
var S = toString_1(requireObjectCoercible(this));
|
|
20257
|
+
var len = S.length;
|
|
20258
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
20259
|
+
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
|
20260
|
+
return (k < 0 || k >= len) ? undefined : charAt(S, k);
|
|
20261
|
+
}
|
|
20262
|
+
});
|
|
20263
|
+
|
|
20264
|
+
// `Object.keys` method
|
|
20265
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
20266
|
+
// eslint-disable-next-line es-x/no-object-keys -- safe
|
|
20267
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
20268
|
+
return objectKeysInternal(O, enumBugKeys);
|
|
20269
|
+
};
|
|
20270
|
+
|
|
20271
|
+
// `Object.defineProperties` method
|
|
20272
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
20273
|
+
// eslint-disable-next-line es-x/no-object-defineproperties -- safe
|
|
20274
|
+
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
20275
|
+
anObject(O);
|
|
20276
|
+
var props = toIndexedObject(Properties);
|
|
20277
|
+
var keys = objectKeys(Properties);
|
|
20278
|
+
var length = keys.length;
|
|
20279
|
+
var index = 0;
|
|
20280
|
+
var key;
|
|
20281
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
20282
|
+
return O;
|
|
20283
|
+
};
|
|
20284
|
+
|
|
20285
|
+
var objectDefineProperties = {
|
|
20286
|
+
f: f$5
|
|
20287
|
+
};
|
|
20288
|
+
|
|
20289
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
20290
|
+
|
|
20291
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
20292
|
+
|
|
20293
|
+
|
|
20294
|
+
|
|
20295
|
+
|
|
20296
|
+
|
|
20297
|
+
|
|
20298
|
+
|
|
20299
|
+
|
|
20300
|
+
var GT = '>';
|
|
20301
|
+
var LT = '<';
|
|
20302
|
+
var PROTOTYPE = 'prototype';
|
|
20303
|
+
var SCRIPT = 'script';
|
|
20304
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
20305
|
+
|
|
20306
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
20307
|
+
|
|
20308
|
+
var scriptTag = function (content) {
|
|
20309
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
20310
|
+
};
|
|
20311
|
+
|
|
20312
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
20313
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
20314
|
+
activeXDocument.write(scriptTag(''));
|
|
20315
|
+
activeXDocument.close();
|
|
20316
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
20317
|
+
activeXDocument = null; // avoid memory leak
|
|
20318
|
+
return temp;
|
|
20319
|
+
};
|
|
20320
|
+
|
|
20321
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
20322
|
+
var NullProtoObjectViaIFrame = function () {
|
|
20323
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
20324
|
+
var iframe = documentCreateElement('iframe');
|
|
20325
|
+
var JS = 'java' + SCRIPT + ':';
|
|
20326
|
+
var iframeDocument;
|
|
20327
|
+
iframe.style.display = 'none';
|
|
20328
|
+
html.appendChild(iframe);
|
|
20329
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
20330
|
+
iframe.src = String(JS);
|
|
20331
|
+
iframeDocument = iframe.contentWindow.document;
|
|
20332
|
+
iframeDocument.open();
|
|
20333
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
20334
|
+
iframeDocument.close();
|
|
20335
|
+
return iframeDocument.F;
|
|
20336
|
+
};
|
|
20337
|
+
|
|
20338
|
+
// Check for document.domain and active x support
|
|
20339
|
+
// No need to use active x approach when document.domain is not set
|
|
20340
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
20341
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
20342
|
+
// avoid IE GC bug
|
|
20343
|
+
var activeXDocument;
|
|
20344
|
+
var NullProtoObject = function () {
|
|
20345
|
+
try {
|
|
20346
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
20347
|
+
} catch (error) { /* ignore */ }
|
|
20348
|
+
NullProtoObject = typeof document != 'undefined'
|
|
20349
|
+
? document.domain && activeXDocument
|
|
20350
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
20351
|
+
: NullProtoObjectViaIFrame()
|
|
20352
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
20353
|
+
var length = enumBugKeys.length;
|
|
20354
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
20355
|
+
return NullProtoObject();
|
|
20356
|
+
};
|
|
20357
|
+
|
|
20358
|
+
hiddenKeys[IE_PROTO] = true;
|
|
20359
|
+
|
|
20360
|
+
// `Object.create` method
|
|
20361
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
20362
|
+
// eslint-disable-next-line es-x/no-object-create -- safe
|
|
20363
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
20364
|
+
var result;
|
|
20365
|
+
if (O !== null) {
|
|
20366
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
20367
|
+
result = new EmptyConstructor();
|
|
20368
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
20369
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
20370
|
+
result[IE_PROTO] = O;
|
|
20371
|
+
} else result = NullProtoObject();
|
|
20372
|
+
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
20373
|
+
};
|
|
20374
|
+
|
|
20375
|
+
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
20376
|
+
var ArrayPrototype = Array.prototype;
|
|
20377
|
+
|
|
20378
|
+
// Array.prototype[@@unscopables]
|
|
20379
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
20380
|
+
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
20381
|
+
objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
|
20382
|
+
configurable: true,
|
|
20383
|
+
value: objectCreate(null)
|
|
20384
|
+
});
|
|
20385
|
+
}
|
|
20386
|
+
|
|
20387
|
+
// add a key to Array.prototype[@@unscopables]
|
|
20388
|
+
var addToUnscopables = function (key) {
|
|
20389
|
+
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
20390
|
+
};
|
|
20391
|
+
|
|
20392
|
+
// `Array.prototype.at` method
|
|
20393
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
20394
|
+
_export({ target: 'Array', proto: true }, {
|
|
20395
|
+
at: function at(index) {
|
|
20396
|
+
var O = toObject(this);
|
|
20397
|
+
var len = lengthOfArrayLike(O);
|
|
20398
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
20399
|
+
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
|
20400
|
+
return (k < 0 || k >= len) ? undefined : O[k];
|
|
20401
|
+
}
|
|
20402
|
+
});
|
|
20403
|
+
|
|
20404
|
+
addToUnscopables('at');
|
|
20405
|
+
|
|
20406
|
+
// eslint-disable-next-line es-x/no-typed-arrays -- safe
|
|
20407
|
+
var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
20408
|
+
|
|
20409
|
+
var correctPrototypeGetter = !fails(function () {
|
|
20410
|
+
function F() { /* empty */ }
|
|
20411
|
+
F.prototype.constructor = null;
|
|
20412
|
+
// eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
|
|
20413
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
20414
|
+
});
|
|
20415
|
+
|
|
20416
|
+
var IE_PROTO$1 = sharedKey('IE_PROTO');
|
|
20417
|
+
var Object$5 = global_1.Object;
|
|
20418
|
+
var ObjectPrototype = Object$5.prototype;
|
|
20419
|
+
|
|
20420
|
+
// `Object.getPrototypeOf` method
|
|
20421
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
20422
|
+
var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
|
|
20423
|
+
var object = toObject(O);
|
|
20424
|
+
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
20425
|
+
var constructor = object.constructor;
|
|
20426
|
+
if (isCallable(constructor) && object instanceof constructor) {
|
|
20427
|
+
return constructor.prototype;
|
|
20428
|
+
} return object instanceof Object$5 ? ObjectPrototype : null;
|
|
20429
|
+
};
|
|
20430
|
+
|
|
20431
|
+
var String$4 = global_1.String;
|
|
20432
|
+
var TypeError$8 = global_1.TypeError;
|
|
20433
|
+
|
|
20434
|
+
var aPossiblePrototype = function (argument) {
|
|
20435
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
20436
|
+
throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
|
|
20437
|
+
};
|
|
20438
|
+
|
|
20439
|
+
/* eslint-disable no-proto -- safe */
|
|
20440
|
+
|
|
20441
|
+
|
|
20442
|
+
|
|
20443
|
+
|
|
20444
|
+
// `Object.setPrototypeOf` method
|
|
20445
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
20446
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
20447
|
+
// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
|
|
20448
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
20449
|
+
var CORRECT_SETTER = false;
|
|
20450
|
+
var test = {};
|
|
20451
|
+
var setter;
|
|
20452
|
+
try {
|
|
20453
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
20454
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
20455
|
+
setter(test, []);
|
|
20456
|
+
CORRECT_SETTER = test instanceof Array;
|
|
20457
|
+
} catch (error) { /* empty */ }
|
|
20458
|
+
return function setPrototypeOf(O, proto) {
|
|
20459
|
+
anObject(O);
|
|
20460
|
+
aPossiblePrototype(proto);
|
|
20461
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
20462
|
+
else O.__proto__ = proto;
|
|
20463
|
+
return O;
|
|
20464
|
+
};
|
|
20465
|
+
}() : undefined);
|
|
20466
|
+
|
|
20467
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
20468
|
+
|
|
20469
|
+
|
|
20470
|
+
|
|
20471
|
+
|
|
20472
|
+
|
|
20473
|
+
|
|
20474
|
+
var Int8Array = global_1.Int8Array;
|
|
20475
|
+
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
|
|
20476
|
+
var Uint8ClampedArray = global_1.Uint8ClampedArray;
|
|
20477
|
+
var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
|
|
20478
|
+
var TypedArray = Int8Array && objectGetPrototypeOf(Int8Array);
|
|
20479
|
+
var TypedArrayPrototype = Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype);
|
|
20480
|
+
var ObjectPrototype$1 = Object.prototype;
|
|
20481
|
+
var TypeError$9 = global_1.TypeError;
|
|
20482
|
+
|
|
20483
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
20484
|
+
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
20485
|
+
var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');
|
|
20486
|
+
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
20487
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferNative && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
20488
|
+
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
20489
|
+
var NAME, Constructor, Prototype;
|
|
20490
|
+
|
|
20491
|
+
var TypedArrayConstructorsList = {
|
|
20492
|
+
Int8Array: 1,
|
|
20493
|
+
Uint8Array: 1,
|
|
20494
|
+
Uint8ClampedArray: 1,
|
|
20495
|
+
Int16Array: 2,
|
|
20496
|
+
Uint16Array: 2,
|
|
20497
|
+
Int32Array: 4,
|
|
20498
|
+
Uint32Array: 4,
|
|
20499
|
+
Float32Array: 4,
|
|
20500
|
+
Float64Array: 8
|
|
20501
|
+
};
|
|
20502
|
+
|
|
20503
|
+
var BigIntArrayConstructorsList = {
|
|
20504
|
+
BigInt64Array: 8,
|
|
20505
|
+
BigUint64Array: 8
|
|
20506
|
+
};
|
|
20507
|
+
|
|
20508
|
+
var isView = function isView(it) {
|
|
20509
|
+
if (!isObject(it)) return false;
|
|
20510
|
+
var klass = classof(it);
|
|
20511
|
+
return klass === 'DataView'
|
|
20512
|
+
|| hasOwnProperty_1(TypedArrayConstructorsList, klass)
|
|
20513
|
+
|| hasOwnProperty_1(BigIntArrayConstructorsList, klass);
|
|
20514
|
+
};
|
|
20515
|
+
|
|
20516
|
+
var isTypedArray = function (it) {
|
|
20517
|
+
if (!isObject(it)) return false;
|
|
20518
|
+
var klass = classof(it);
|
|
20519
|
+
return hasOwnProperty_1(TypedArrayConstructorsList, klass)
|
|
20520
|
+
|| hasOwnProperty_1(BigIntArrayConstructorsList, klass);
|
|
20521
|
+
};
|
|
20522
|
+
|
|
20523
|
+
var aTypedArray = function (it) {
|
|
20524
|
+
if (isTypedArray(it)) return it;
|
|
20525
|
+
throw TypeError$9('Target is not a typed array');
|
|
20526
|
+
};
|
|
20527
|
+
|
|
20528
|
+
var aTypedArrayConstructor = function (C) {
|
|
20529
|
+
if (isCallable(C) && (!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))) return C;
|
|
20530
|
+
throw TypeError$9(tryToString(C) + ' is not a typed array constructor');
|
|
20531
|
+
};
|
|
20532
|
+
|
|
20533
|
+
var exportTypedArrayMethod = function (KEY, property, forced, options) {
|
|
20534
|
+
if (!descriptors) return;
|
|
20535
|
+
if (forced) for (var ARRAY in TypedArrayConstructorsList) {
|
|
20536
|
+
var TypedArrayConstructor = global_1[ARRAY];
|
|
20537
|
+
if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor.prototype, KEY)) try {
|
|
20538
|
+
delete TypedArrayConstructor.prototype[KEY];
|
|
20539
|
+
} catch (error) {
|
|
20540
|
+
// old WebKit bug - some methods are non-configurable
|
|
20541
|
+
try {
|
|
20542
|
+
TypedArrayConstructor.prototype[KEY] = property;
|
|
20543
|
+
} catch (error2) { /* empty */ }
|
|
20544
|
+
}
|
|
20545
|
+
}
|
|
20546
|
+
if (!TypedArrayPrototype[KEY] || forced) {
|
|
20547
|
+
defineBuiltIn(TypedArrayPrototype, KEY, forced ? property
|
|
20548
|
+
: NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
|
|
20549
|
+
}
|
|
20550
|
+
};
|
|
20551
|
+
|
|
20552
|
+
var exportTypedArrayStaticMethod = function (KEY, property, forced) {
|
|
20553
|
+
var ARRAY, TypedArrayConstructor;
|
|
20554
|
+
if (!descriptors) return;
|
|
20555
|
+
if (objectSetPrototypeOf) {
|
|
20556
|
+
if (forced) for (ARRAY in TypedArrayConstructorsList) {
|
|
20557
|
+
TypedArrayConstructor = global_1[ARRAY];
|
|
20558
|
+
if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor, KEY)) try {
|
|
20559
|
+
delete TypedArrayConstructor[KEY];
|
|
20560
|
+
} catch (error) { /* empty */ }
|
|
20561
|
+
}
|
|
20562
|
+
if (!TypedArray[KEY] || forced) {
|
|
20563
|
+
// V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
|
|
20564
|
+
try {
|
|
20565
|
+
return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
|
|
20566
|
+
} catch (error) { /* empty */ }
|
|
20567
|
+
} else return;
|
|
20568
|
+
}
|
|
20569
|
+
for (ARRAY in TypedArrayConstructorsList) {
|
|
20570
|
+
TypedArrayConstructor = global_1[ARRAY];
|
|
20571
|
+
if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
|
|
20572
|
+
defineBuiltIn(TypedArrayConstructor, KEY, property);
|
|
20573
|
+
}
|
|
20574
|
+
}
|
|
20575
|
+
};
|
|
20576
|
+
|
|
20577
|
+
for (NAME in TypedArrayConstructorsList) {
|
|
20578
|
+
Constructor = global_1[NAME];
|
|
20579
|
+
Prototype = Constructor && Constructor.prototype;
|
|
20580
|
+
if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
|
|
20581
|
+
else NATIVE_ARRAY_BUFFER_VIEWS = false;
|
|
20582
|
+
}
|
|
20583
|
+
|
|
20584
|
+
for (NAME in BigIntArrayConstructorsList) {
|
|
20585
|
+
Constructor = global_1[NAME];
|
|
20586
|
+
Prototype = Constructor && Constructor.prototype;
|
|
20587
|
+
if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
|
|
20588
|
+
}
|
|
20589
|
+
|
|
20590
|
+
// WebKit bug - typed arrays constructors prototype is Object.prototype
|
|
20591
|
+
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
|
|
20592
|
+
// eslint-disable-next-line no-shadow -- safe
|
|
20593
|
+
TypedArray = function TypedArray() {
|
|
20594
|
+
throw TypeError$9('Incorrect invocation');
|
|
20595
|
+
};
|
|
20596
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
|
20597
|
+
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
|
|
20598
|
+
}
|
|
20599
|
+
}
|
|
20600
|
+
|
|
20601
|
+
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype$1) {
|
|
20602
|
+
TypedArrayPrototype = TypedArray.prototype;
|
|
20603
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
|
20604
|
+
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME].prototype, TypedArrayPrototype);
|
|
20605
|
+
}
|
|
20606
|
+
}
|
|
20607
|
+
|
|
20608
|
+
// WebKit bug - one more object in Uint8ClampedArray prototype chain
|
|
20609
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
|
|
20610
|
+
objectSetPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
|
|
20611
|
+
}
|
|
20612
|
+
|
|
20613
|
+
if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$2)) {
|
|
20614
|
+
TYPED_ARRAY_TAG_REQUIRED = true;
|
|
20615
|
+
defineProperty$1(TypedArrayPrototype, TO_STRING_TAG$2, { get: function () {
|
|
20616
|
+
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
20617
|
+
} });
|
|
20618
|
+
for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
|
|
20619
|
+
createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
|
|
20620
|
+
}
|
|
20621
|
+
}
|
|
20622
|
+
|
|
20623
|
+
var arrayBufferViewCore = {
|
|
20624
|
+
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
|
|
20625
|
+
TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,
|
|
20626
|
+
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
|
|
20627
|
+
aTypedArray: aTypedArray,
|
|
20628
|
+
aTypedArrayConstructor: aTypedArrayConstructor,
|
|
20629
|
+
exportTypedArrayMethod: exportTypedArrayMethod,
|
|
20630
|
+
exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
|
|
20631
|
+
isView: isView,
|
|
20632
|
+
isTypedArray: isTypedArray,
|
|
20633
|
+
TypedArray: TypedArray,
|
|
20634
|
+
TypedArrayPrototype: TypedArrayPrototype
|
|
20635
|
+
};
|
|
20636
|
+
|
|
20637
|
+
var aTypedArray$1 = arrayBufferViewCore.aTypedArray;
|
|
20638
|
+
var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod;
|
|
20639
|
+
|
|
20640
|
+
// `%TypedArray%.prototype.at` method
|
|
20641
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
20642
|
+
exportTypedArrayMethod$1('at', function at(index) {
|
|
20643
|
+
var O = aTypedArray$1(this);
|
|
20644
|
+
var len = lengthOfArrayLike(O);
|
|
20645
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
20646
|
+
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
|
20647
|
+
return (k < 0 || k >= len) ? undefined : O[k];
|
|
20648
|
+
});
|
|
20649
|
+
|
|
19401
20650
|
var selectedColor = "".concat(MATISSE_BLUE);
|
|
19402
20651
|
var hoverColor$3 = "".concat(HOVER_LIGHT_BLUE);
|
|
19403
20652
|
var fallbackValues$e = {
|
|
@@ -19408,24 +20657,24 @@ var fallbackValues$e = {
|
|
|
19408
20657
|
var IconWrapper = styled__default.div.withConfig({
|
|
19409
20658
|
displayName: "Dropdown__IconWrapper",
|
|
19410
20659
|
componentId: "sc-pn6m0h-0"
|
|
19411
|
-
})(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ""], function (_ref) {
|
|
20660
|
+
})(["position:absolute;display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ";top:20px;right:12px;"], function (_ref) {
|
|
19412
20661
|
var open = _ref.open;
|
|
19413
20662
|
return open ? "transform: rotate(-180deg)" : "";
|
|
19414
20663
|
});
|
|
19415
20664
|
var DropdownContentWrapper = styled__default.div.withConfig({
|
|
19416
20665
|
displayName: "Dropdown__DropdownContentWrapper",
|
|
19417
20666
|
componentId: "sc-pn6m0h-1"
|
|
19418
|
-
})(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}"], GREY_CHATEAU, WHITE, function (_ref2) {
|
|
20667
|
+
})(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], GREY_CHATEAU, WHITE, function (_ref2) {
|
|
19419
20668
|
var widthFitOptions = _ref2.widthFitOptions;
|
|
19420
20669
|
return widthFitOptions ? "fit-content" : "100%";
|
|
19421
20670
|
}, function (_ref3) {
|
|
19422
20671
|
var maxHeight = _ref3.maxHeight;
|
|
19423
20672
|
return maxHeight || "400px";
|
|
19424
20673
|
});
|
|
19425
|
-
var DropdownItemWrapper = styled__default.
|
|
20674
|
+
var DropdownItemWrapper = styled__default.li.withConfig({
|
|
19426
20675
|
displayName: "Dropdown__DropdownItemWrapper",
|
|
19427
20676
|
componentId: "sc-pn6m0h-2"
|
|
19428
|
-
})(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
|
|
20677
|
+
})(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
|
|
19429
20678
|
var selected = _ref4.selected,
|
|
19430
20679
|
themeValues = _ref4.themeValues;
|
|
19431
20680
|
return selected ? themeValues.selectedColor : WHITE;
|
|
@@ -19443,34 +20692,30 @@ var DropdownItemWrapper = styled__default.div.withConfig({
|
|
|
19443
20692
|
themeValues = _ref7.themeValues;
|
|
19444
20693
|
return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
|
|
19445
20694
|
});
|
|
19446
|
-
var SearchInput = styled__default.input.withConfig({
|
|
19447
|
-
displayName: "Dropdown__SearchInput",
|
|
19448
|
-
componentId: "sc-pn6m0h-3"
|
|
19449
|
-
})(["border:none;background-color:", ";font-size:16px;height:24px;"], function (_ref8) {
|
|
19450
|
-
var themeValues = _ref8.themeValues;
|
|
19451
|
-
return themeValues.hoverColor && themeValues.hoverColor;
|
|
19452
|
-
});
|
|
19453
20695
|
|
|
19454
|
-
var Dropdown = function Dropdown(
|
|
19455
|
-
var placeholder =
|
|
19456
|
-
options =
|
|
19457
|
-
value =
|
|
19458
|
-
isOpen =
|
|
19459
|
-
isError =
|
|
19460
|
-
onSelect =
|
|
19461
|
-
|
|
19462
|
-
disabledValues =
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
themeValues =
|
|
19466
|
-
maxHeight =
|
|
19467
|
-
|
|
19468
|
-
widthFitOptions =
|
|
19469
|
-
disabled =
|
|
19470
|
-
|
|
19471
|
-
hasTitles =
|
|
19472
|
-
|
|
19473
|
-
autoEraseTypeAhead =
|
|
20696
|
+
var Dropdown = function Dropdown(_ref8) {
|
|
20697
|
+
var placeholder = _ref8.placeholder,
|
|
20698
|
+
options = _ref8.options,
|
|
20699
|
+
value = _ref8.value,
|
|
20700
|
+
isOpen = _ref8.isOpen,
|
|
20701
|
+
isError = _ref8.isError,
|
|
20702
|
+
onSelect = _ref8.onSelect,
|
|
20703
|
+
_ref8$disabledValues = _ref8.disabledValues,
|
|
20704
|
+
disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
|
|
20705
|
+
_ref8$onClick = _ref8.onClick,
|
|
20706
|
+
_onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
|
|
20707
|
+
themeValues = _ref8.themeValues,
|
|
20708
|
+
maxHeight = _ref8.maxHeight,
|
|
20709
|
+
_ref8$widthFitOptions = _ref8.widthFitOptions,
|
|
20710
|
+
widthFitOptions = _ref8$widthFitOptions === void 0 ? false : _ref8$widthFitOptions,
|
|
20711
|
+
disabled = _ref8.disabled,
|
|
20712
|
+
_ref8$hasTitles = _ref8.hasTitles,
|
|
20713
|
+
hasTitles = _ref8$hasTitles === void 0 ? false : _ref8$hasTitles,
|
|
20714
|
+
_ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
|
|
20715
|
+
autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
|
|
20716
|
+
ariaLabelledby = _ref8.ariaLabelledby,
|
|
20717
|
+
_ref8$autocompleteVal = _ref8.autocompleteValue,
|
|
20718
|
+
autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal;
|
|
19474
20719
|
|
|
19475
20720
|
var _useState = React.useState(""),
|
|
19476
20721
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19497,6 +20742,21 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19497
20742
|
selectedRef = _useState10[0],
|
|
19498
20743
|
setSelectedRef = _useState10[1];
|
|
19499
20744
|
|
|
20745
|
+
var _useState11 = React.useState(undefined),
|
|
20746
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
20747
|
+
focusedRef = _useState12[0],
|
|
20748
|
+
setFocusedRef = _useState12[1];
|
|
20749
|
+
|
|
20750
|
+
var _useState13 = React.useState(false),
|
|
20751
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
20752
|
+
inputChangedByAutofill = _useState14[0],
|
|
20753
|
+
setInputChangedByAutofill = _useState14[1];
|
|
20754
|
+
|
|
20755
|
+
var _useState15 = React.useState(false),
|
|
20756
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
20757
|
+
focusedByClick = _useState16[0],
|
|
20758
|
+
setFocusedByClick = _useState16[1];
|
|
20759
|
+
|
|
19500
20760
|
if (optionsState !== options) {
|
|
19501
20761
|
setOptionsState(options);
|
|
19502
20762
|
setOptionsChanged(true);
|
|
@@ -19507,15 +20767,16 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19507
20767
|
setOptionsChanged(false);
|
|
19508
20768
|
}
|
|
19509
20769
|
|
|
19510
|
-
var
|
|
19511
|
-
|
|
19512
|
-
timer =
|
|
19513
|
-
setTimer =
|
|
20770
|
+
var _useState17 = React.useState(null),
|
|
20771
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
20772
|
+
timer = _useState18[0],
|
|
20773
|
+
setTimer = _useState18[1];
|
|
19514
20774
|
|
|
19515
20775
|
var optionRefs = React.useRef(_toConsumableArray(Array(options.length)).map(function () {
|
|
19516
20776
|
return /*#__PURE__*/React.createRef();
|
|
19517
20777
|
}));
|
|
19518
20778
|
var dropdownRef = React.useRef(null);
|
|
20779
|
+
var inputRef = React.useRef(null);
|
|
19519
20780
|
|
|
19520
20781
|
var getSelection = function getSelection() {
|
|
19521
20782
|
var _options$find;
|
|
@@ -19526,21 +20787,23 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19526
20787
|
};
|
|
19527
20788
|
|
|
19528
20789
|
var onKeyDown = function onKeyDown(e) {
|
|
20790
|
+
console.log("current input value top of keyDown", inputValue);
|
|
19529
20791
|
var key = e.key,
|
|
19530
20792
|
keyCode = e.keyCode;
|
|
19531
20793
|
var focus = document.activeElement;
|
|
19532
20794
|
console.log("dropdown value is", value);
|
|
19533
|
-
console.log("focus is", focus);
|
|
19534
|
-
console.log("option refs are", optionRefs.current);
|
|
19535
20795
|
var optionEl = optionRefs.current.find(function (ref) {
|
|
19536
20796
|
return ref.current === focus;
|
|
19537
20797
|
});
|
|
19538
|
-
console.log("option el is", optionEl);
|
|
19539
20798
|
|
|
19540
20799
|
switch (key) {
|
|
19541
20800
|
case "ArrowDown":
|
|
19542
20801
|
e.preventDefault();
|
|
19543
20802
|
|
|
20803
|
+
if (!isOpen) {
|
|
20804
|
+
_onClick();
|
|
20805
|
+
}
|
|
20806
|
+
|
|
19544
20807
|
if (optionEl) {
|
|
19545
20808
|
if (optionEl.current.nextElementSibling) {
|
|
19546
20809
|
optionEl.current.nextElementSibling.focus();
|
|
@@ -19549,7 +20812,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19549
20812
|
break;
|
|
19550
20813
|
}
|
|
19551
20814
|
} else {
|
|
19552
|
-
|
|
20815
|
+
_onClick();
|
|
19553
20816
|
}
|
|
19554
20817
|
|
|
19555
20818
|
break;
|
|
@@ -19565,7 +20828,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19565
20828
|
break;
|
|
19566
20829
|
}
|
|
19567
20830
|
} else {
|
|
19568
|
-
|
|
20831
|
+
_onClick();
|
|
19569
20832
|
}
|
|
19570
20833
|
|
|
19571
20834
|
break;
|
|
@@ -19579,27 +20842,68 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19579
20842
|
|
|
19580
20843
|
case "Backspace" :
|
|
19581
20844
|
e.preventDefault();
|
|
19582
|
-
console.log("input value is", inputValue);
|
|
19583
|
-
console.log("new input value will be", inputValue.slice(0, -1));
|
|
19584
20845
|
setInputValue(inputValue.slice(0, -1));
|
|
19585
20846
|
break;
|
|
20847
|
+
|
|
20848
|
+
case "Home":
|
|
20849
|
+
e.preventDefault();
|
|
20850
|
+
optionRefs.current[0].current.focus();
|
|
20851
|
+
break;
|
|
20852
|
+
|
|
20853
|
+
case "End":
|
|
20854
|
+
e.preventDefault();
|
|
20855
|
+
console.log("option refs current", optionRefs.current);
|
|
20856
|
+
optionRefs.current.at(-1).current.focus();
|
|
20857
|
+
break;
|
|
20858
|
+
|
|
20859
|
+
case "Escape":
|
|
20860
|
+
if (isOpen) {
|
|
20861
|
+
_onClick();
|
|
20862
|
+
}
|
|
20863
|
+
|
|
20864
|
+
break;
|
|
19586
20865
|
}
|
|
19587
20866
|
|
|
19588
20867
|
if (keyCode > 64 && keyCode < 91 || keyCode == 32 || keyCode == 189) {
|
|
19589
20868
|
e.preventDefault();
|
|
20869
|
+
console.log("current input value inside keydown if", inputValue);
|
|
19590
20870
|
setInputValue(inputValue + key);
|
|
19591
20871
|
}
|
|
19592
20872
|
};
|
|
19593
20873
|
|
|
20874
|
+
var handleItemSelection = function handleItemSelection(evt, choice, i) {
|
|
20875
|
+
if (disabledValues.includes(choice.value)) {
|
|
20876
|
+
evt.preventDefault();
|
|
20877
|
+
} else {
|
|
20878
|
+
setSelectedRef(optionRefs.current[i]);
|
|
20879
|
+
onSelect(choice.value);
|
|
20880
|
+
|
|
20881
|
+
if (isOpen) {
|
|
20882
|
+
_onClick();
|
|
20883
|
+
}
|
|
20884
|
+
}
|
|
20885
|
+
};
|
|
20886
|
+
|
|
19594
20887
|
React.useEffect(function () {
|
|
19595
|
-
|
|
19596
|
-
console.log("selected refs in isopen useffect", selectedRef);
|
|
19597
|
-
console.log("value in isopen useffect", value);
|
|
20888
|
+
var selectedRefExists = selectedRef !== undefined && selectedRef.current !== null;
|
|
19598
20889
|
|
|
19599
|
-
if (isOpen &&
|
|
20890
|
+
if (isOpen && selectedRefExists && !focusedByClick) {
|
|
20891
|
+
// WAI-ARIA requires the selected option to receive focus
|
|
20892
|
+
selectedRef.current.focus();
|
|
20893
|
+
} else if (isOpen && optionRefs.current[0].current && !focusedByClick) {
|
|
20894
|
+
// If no selected option, first option receives focus
|
|
19600
20895
|
optionRefs.current[0].current.focus();
|
|
19601
20896
|
}
|
|
19602
20897
|
|
|
20898
|
+
if (isOpen && focusedByClick && selectedRefExists) {
|
|
20899
|
+
selectedRef.current.scrollIntoView({
|
|
20900
|
+
behavior: "smooth",
|
|
20901
|
+
block: "nearest",
|
|
20902
|
+
inline: "start"
|
|
20903
|
+
});
|
|
20904
|
+
setFocusedByClick(false);
|
|
20905
|
+
}
|
|
20906
|
+
|
|
19603
20907
|
clearTimeout(timer);
|
|
19604
20908
|
setInputValue("");
|
|
19605
20909
|
}, [isOpen]);
|
|
@@ -19608,7 +20912,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19608
20912
|
clearTimeout(timer);
|
|
19609
20913
|
setTimer(setTimeout(function () {
|
|
19610
20914
|
return setInputValue("");
|
|
19611
|
-
},
|
|
20915
|
+
}, 3000));
|
|
19612
20916
|
}
|
|
19613
20917
|
|
|
19614
20918
|
setFilteredOptions(options.filter(function (option) {
|
|
@@ -19616,8 +20920,21 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19616
20920
|
}));
|
|
19617
20921
|
}, [inputValue]);
|
|
19618
20922
|
React.useEffect(function () {
|
|
19619
|
-
if (
|
|
20923
|
+
if (
|
|
20924
|
+
/*
|
|
20925
|
+
Either user has typed a value into input that matches a non-disabled option
|
|
20926
|
+
or
|
|
20927
|
+
user has autofilled or pasted into input a string matching a valid option
|
|
20928
|
+
*/
|
|
20929
|
+
(!isOpen || inputChangedByAutofill) && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
20930
|
+
setInputChangedByAutofill(false);
|
|
19620
20931
|
onSelect(filteredOptions[0].value);
|
|
20932
|
+
|
|
20933
|
+
if (isOpen) {
|
|
20934
|
+
setTimeout(function () {
|
|
20935
|
+
return _onClick();
|
|
20936
|
+
}, 2000);
|
|
20937
|
+
}
|
|
19621
20938
|
}
|
|
19622
20939
|
|
|
19623
20940
|
if (optionRefs.current[0].current) {
|
|
@@ -19627,73 +20944,109 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19627
20944
|
}
|
|
19628
20945
|
}, [filteredOptions]);
|
|
19629
20946
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
19630
|
-
onKeyDown: onKeyDown,
|
|
19631
|
-
onClick: onClick,
|
|
19632
20947
|
padding: "0",
|
|
19633
|
-
|
|
19634
|
-
|
|
19635
|
-
"
|
|
19636
|
-
|
|
19637
|
-
|
|
20948
|
+
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
20949
|
+
extraStyles: "position: relative;",
|
|
20950
|
+
minWidth: "100%",
|
|
20951
|
+
onClick: function onClick() {
|
|
20952
|
+
if (!isOpen) {
|
|
20953
|
+
setFocusedByClick(true);
|
|
20954
|
+
|
|
20955
|
+
_onClick();
|
|
20956
|
+
}
|
|
20957
|
+
},
|
|
20958
|
+
onKeyDown: onKeyDown,
|
|
20959
|
+
width: "100%"
|
|
19638
20960
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
19639
|
-
as: "
|
|
20961
|
+
as: "input",
|
|
20962
|
+
"aria-multiline": "false",
|
|
20963
|
+
"aria-autocomplete": "list",
|
|
20964
|
+
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
20965
|
+
"aria-activedescendant": "focused_option",
|
|
20966
|
+
"aria-owns": "".concat(ariaLabelledby, "_listbox"),
|
|
20967
|
+
"aria-haspopup": "listbox",
|
|
20968
|
+
"aria-labelledby": ariaLabelledby,
|
|
20969
|
+
"aria-expanded": isOpen,
|
|
20970
|
+
autocomplete: autocompleteValue,
|
|
19640
20971
|
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
19641
|
-
|
|
19642
|
-
padding: "12px",
|
|
19643
|
-
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
20972
|
+
borderRadius: "2px",
|
|
19644
20973
|
borderSize: "1px",
|
|
19645
20974
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19646
|
-
|
|
20975
|
+
extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
|
|
20976
|
+
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
20977
|
+
isOpen: isOpen,
|
|
20978
|
+
minHeight: "48px",
|
|
20979
|
+
minWidth: "100%",
|
|
20980
|
+
name: autocompleteValue,
|
|
20981
|
+
onChange: function onChange(e) {
|
|
20982
|
+
console.log("current input value onChange", inputValue);
|
|
20983
|
+
console.log("input change event", e.target);
|
|
20984
|
+
console.log("input change event value", e.target.value); // support autofill and copy/paste
|
|
20985
|
+
|
|
20986
|
+
if (e.target.value !== inputValue) {
|
|
20987
|
+
setInputValue(e.target.value);
|
|
20988
|
+
setInputChangedByAutofill(true);
|
|
20989
|
+
}
|
|
20990
|
+
},
|
|
20991
|
+
padding: "12px",
|
|
20992
|
+
placeholder: getSelection(),
|
|
20993
|
+
ref: inputRef,
|
|
20994
|
+
role: "combobox",
|
|
20995
|
+
themeValues: themeValues,
|
|
20996
|
+
title: hasTitles ? getSelection() : null,
|
|
20997
|
+
type: "text",
|
|
19647
20998
|
tabIndex: 0,
|
|
19648
|
-
dataQa: placeholder,
|
|
19649
|
-
extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
|
|
19650
|
-
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19651
|
-
direction: "row",
|
|
19652
|
-
bottomItem: 2
|
|
19653
|
-
}, isOpen ? /*#__PURE__*/React__default.createElement(SearchInput, {
|
|
19654
|
-
"aria-label": inputValue || "Dropdown awaiting search value",
|
|
19655
20999
|
value: inputValue,
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
})
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
},
|
|
19662
|
-
open: isOpen
|
|
19663
|
-
}, /*#__PURE__*/React__default.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React__default.createElement(DropdownContentWrapper, {
|
|
21000
|
+
width: "100%",
|
|
21001
|
+
dataQa: placeholder
|
|
21002
|
+
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
21003
|
+
open: isOpen,
|
|
21004
|
+
onClick: _onClick
|
|
21005
|
+
}, /*#__PURE__*/React__default.createElement(DropdownIcon, null)), /*#__PURE__*/React__default.createElement(React.Fragment, null, isOpen ? /*#__PURE__*/React__default.createElement(DropdownContentWrapper, {
|
|
19664
21006
|
maxHeight: maxHeight,
|
|
19665
21007
|
open: isOpen,
|
|
19666
21008
|
ref: dropdownRef,
|
|
19667
21009
|
widthFitOptions: widthFitOptions,
|
|
19668
|
-
tabIndex: 0
|
|
21010
|
+
tabIndex: 0,
|
|
21011
|
+
role: "listbox",
|
|
21012
|
+
id: "".concat(ariaLabelledby, "_listbox")
|
|
19669
21013
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19670
|
-
childGap: "0"
|
|
21014
|
+
childGap: "0",
|
|
21015
|
+
as: "ul"
|
|
19671
21016
|
}, filteredOptions.map(function (choice, i) {
|
|
19672
|
-
if (
|
|
21017
|
+
if (choice.value === value && selectedRef !== optionRefs.current[i]) {
|
|
19673
21018
|
setSelectedRef(optionRefs.current[i]);
|
|
19674
21019
|
}
|
|
19675
21020
|
|
|
19676
21021
|
return /*#__PURE__*/React__default.createElement(DropdownItemWrapper, {
|
|
21022
|
+
id: focusedRef === optionRefs.current[i] ? "focused_option" : choice.value,
|
|
19677
21023
|
key: choice.value,
|
|
19678
21024
|
ref: optionRefs.current[i],
|
|
19679
|
-
as: "button",
|
|
19680
21025
|
tabIndex: -1,
|
|
19681
|
-
onClick:
|
|
19682
|
-
return
|
|
19683
|
-
}
|
|
19684
|
-
|
|
21026
|
+
onClick: function onClick(e) {
|
|
21027
|
+
return handleItemSelection(e, choice, i);
|
|
21028
|
+
},
|
|
21029
|
+
onKeyDown: function onKeyDown(e) {
|
|
21030
|
+
if (e.keyCode === 13) {
|
|
21031
|
+
handleItemSelection(e, choice, i);
|
|
21032
|
+
}
|
|
19685
21033
|
},
|
|
19686
21034
|
selected: choice.value === value,
|
|
21035
|
+
"aria-selected": choice.value === value,
|
|
19687
21036
|
disabled: disabledValues.includes(choice.value),
|
|
19688
21037
|
"data-qa": choice.text,
|
|
19689
21038
|
themeValues: themeValues,
|
|
19690
|
-
title: hasTitles ? choice.text : null
|
|
21039
|
+
title: hasTitles ? choice.text : null,
|
|
21040
|
+
role: "option",
|
|
21041
|
+
onFocus: function onFocus() {
|
|
21042
|
+
return setFocusedRef(optionRefs.current[i]);
|
|
21043
|
+
}
|
|
19691
21044
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
19692
21045
|
variant: "p",
|
|
19693
21046
|
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
19694
21047
|
extraStyles: "padding-left: 16px; \n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", "; \n white-space: nowrap; \n overflow: hidden; \n text-overflow: ellipsis;")
|
|
19695
21048
|
}, choice.text));
|
|
19696
|
-
}))) : /*#__PURE__*/React__default.createElement(React.Fragment, null));
|
|
21049
|
+
}))) : /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
19697
21050
|
};
|
|
19698
21051
|
|
|
19699
21052
|
var Dropdown$1 = themeComponent(Dropdown, "Dropdown", fallbackValues$e);
|
|
@@ -19794,7 +21147,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19794
21147
|
disabled = _ref.disabled,
|
|
19795
21148
|
themeValues = _ref.themeValues,
|
|
19796
21149
|
_ref$hasTitles = _ref.hasTitles,
|
|
19797
|
-
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles
|
|
21150
|
+
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
|
|
21151
|
+
autocompleteValue = _ref.autocompleteValue;
|
|
19798
21152
|
|
|
19799
21153
|
var _useState = React.useState(false),
|
|
19800
21154
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19832,7 +21186,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19832
21186
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
19833
21187
|
id: labelTextWhenNoError.replace(/\s+/g, "-")
|
|
19834
21188
|
}, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
19835
|
-
|
|
21189
|
+
ariaLabelledby: labelTextWhenNoError.replace(/\s+/g, "-"),
|
|
19836
21190
|
maxHeight: dropdownMaxHeight,
|
|
19837
21191
|
hasTitles: hasTitles,
|
|
19838
21192
|
placeholder: options[0] ? options[0].text : "",
|
|
@@ -19849,7 +21203,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19849
21203
|
onClick: function onClick() {
|
|
19850
21204
|
return setOpen(!open);
|
|
19851
21205
|
},
|
|
19852
|
-
disabled: disabled
|
|
21206
|
+
disabled: disabled,
|
|
21207
|
+
autocompleteValue: autocompleteValue
|
|
19853
21208
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
19854
21209
|
direction: "row",
|
|
19855
21210
|
justify: "space-between"
|
|
@@ -20622,7 +21977,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
20622
21977
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
20623
21978
|
errorMessages: errorMessages,
|
|
20624
21979
|
showErrors: showErrors,
|
|
20625
|
-
onChange: onChange
|
|
21980
|
+
onChange: onChange,
|
|
21981
|
+
autocompleteValue: "country-name"
|
|
20626
21982
|
});
|
|
20627
21983
|
};
|
|
20628
21984
|
|
|
@@ -33038,7 +34394,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
33038
34394
|
fieldActions: fieldActions,
|
|
33039
34395
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
33040
34396
|
errorMessages: errorMessages,
|
|
33041
|
-
showErrors: showErrors
|
|
34397
|
+
showErrors: showErrors,
|
|
34398
|
+
autocompleteValue: "address-level1"
|
|
33042
34399
|
});
|
|
33043
34400
|
};
|
|
33044
34401
|
|
|
@@ -33769,20 +35126,20 @@ function isPlainObject(value) {
|
|
|
33769
35126
|
}
|
|
33770
35127
|
var assign = Object.assign || function assign(target, value) {
|
|
33771
35128
|
for (var key in value) {
|
|
33772
|
-
if (has(value, key)) {
|
|
35129
|
+
if (has$1(value, key)) {
|
|
33773
35130
|
target[key] = value[key];
|
|
33774
35131
|
}
|
|
33775
35132
|
}
|
|
33776
35133
|
|
|
33777
35134
|
return target;
|
|
33778
35135
|
};
|
|
33779
|
-
var ownKeys$
|
|
35136
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames;
|
|
33780
35137
|
function shallowCopy(base, invokeGetters) {
|
|
33781
35138
|
if ( invokeGetters === void 0 ) invokeGetters = false;
|
|
33782
35139
|
|
|
33783
35140
|
if (Array.isArray(base)) { return base.slice(); }
|
|
33784
35141
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
33785
|
-
ownKeys$
|
|
35142
|
+
ownKeys$2(base).forEach(function (key) {
|
|
33786
35143
|
if (key === DRAFT_STATE) {
|
|
33787
35144
|
return; // Never copy over draft state.
|
|
33788
35145
|
}
|
|
@@ -33814,14 +35171,14 @@ function each(value, cb) {
|
|
|
33814
35171
|
if (Array.isArray(value)) {
|
|
33815
35172
|
for (var i = 0; i < value.length; i++) { cb(i, value[i], value); }
|
|
33816
35173
|
} else {
|
|
33817
|
-
ownKeys$
|
|
35174
|
+
ownKeys$2(value).forEach(function (key) { return cb(key, value[key], value); });
|
|
33818
35175
|
}
|
|
33819
35176
|
}
|
|
33820
35177
|
function isEnumerable(base, prop) {
|
|
33821
35178
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
33822
35179
|
return !!desc && desc.enumerable;
|
|
33823
35180
|
}
|
|
33824
|
-
function has(thing, prop) {
|
|
35181
|
+
function has$1(thing, prop) {
|
|
33825
35182
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
33826
35183
|
}
|
|
33827
35184
|
function is(x, y) {
|
|
@@ -33885,7 +35242,7 @@ function revoke(draft) {
|
|
|
33885
35242
|
|
|
33886
35243
|
// but share them all instead
|
|
33887
35244
|
|
|
33888
|
-
var descriptors = {};
|
|
35245
|
+
var descriptors$1 = {};
|
|
33889
35246
|
function willFinalize(scope, result, isReplaced) {
|
|
33890
35247
|
scope.drafts.forEach(function (draft) {
|
|
33891
35248
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -33953,7 +35310,7 @@ function peek(draft, prop) {
|
|
|
33953
35310
|
return draft[prop];
|
|
33954
35311
|
}
|
|
33955
35312
|
|
|
33956
|
-
function get(state, prop) {
|
|
35313
|
+
function get$1(state, prop) {
|
|
33957
35314
|
assertUnrevoked(state);
|
|
33958
35315
|
var value = peek(source(state), prop);
|
|
33959
35316
|
if (state.finalizing) { return value; } // Create a draft if the value is unmodified.
|
|
@@ -34004,17 +35361,17 @@ function clonePotentialDraft(base) {
|
|
|
34004
35361
|
}
|
|
34005
35362
|
|
|
34006
35363
|
function proxyProperty(draft, prop, enumerable) {
|
|
34007
|
-
var desc = descriptors[prop];
|
|
35364
|
+
var desc = descriptors$1[prop];
|
|
34008
35365
|
|
|
34009
35366
|
if (desc) {
|
|
34010
35367
|
desc.enumerable = enumerable;
|
|
34011
35368
|
} else {
|
|
34012
|
-
descriptors[prop] = desc = {
|
|
35369
|
+
descriptors$1[prop] = desc = {
|
|
34013
35370
|
configurable: true,
|
|
34014
35371
|
enumerable: enumerable,
|
|
34015
35372
|
|
|
34016
|
-
get: function get$1() {
|
|
34017
|
-
return get(this[DRAFT_STATE], prop);
|
|
35373
|
+
get: function get$1$1() {
|
|
35374
|
+
return get$1(this[DRAFT_STATE], prop);
|
|
34018
35375
|
},
|
|
34019
35376
|
|
|
34020
35377
|
set: function set$1$1(value) {
|
|
@@ -34060,7 +35417,7 @@ function markChangesRecursively(object) {
|
|
|
34060
35417
|
// Look for added keys.
|
|
34061
35418
|
Object.keys(draft).forEach(function (key) {
|
|
34062
35419
|
// The `undefined` check is a fast path for pre-existing keys.
|
|
34063
|
-
if (base[key] === undefined && !has(base, key)) {
|
|
35420
|
+
if (base[key] === undefined && !has$1(base, key)) {
|
|
34064
35421
|
assigned[key] = true;
|
|
34065
35422
|
markChanged(state);
|
|
34066
35423
|
} else if (!assigned[key]) {
|
|
@@ -34071,7 +35428,7 @@ function markChangesRecursively(object) {
|
|
|
34071
35428
|
|
|
34072
35429
|
Object.keys(base).forEach(function (key) {
|
|
34073
35430
|
// The `undefined` check is a fast path for pre-existing keys.
|
|
34074
|
-
if (draft[key] === undefined && !has(draft, key)) {
|
|
35431
|
+
if (draft[key] === undefined && !has$1(draft, key)) {
|
|
34075
35432
|
assigned[key] = false;
|
|
34076
35433
|
markChanged(state);
|
|
34077
35434
|
}
|
|
@@ -34104,7 +35461,7 @@ function hasObjectChanges(state) {
|
|
|
34104
35461
|
var key = keys[i];
|
|
34105
35462
|
var baseValue = base[key]; // The `undefined` check is a fast path for pre-existing keys.
|
|
34106
35463
|
|
|
34107
|
-
if (baseValue === undefined && !has(base, key)) {
|
|
35464
|
+
if (baseValue === undefined && !has$1(base, key)) {
|
|
34108
35465
|
return true;
|
|
34109
35466
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
34110
35467
|
// descriptor is erased. This branch detects any missed changes.
|
|
@@ -34189,7 +35546,7 @@ function createProxy$1(base, parent) {
|
|
|
34189
35546
|
return proxy;
|
|
34190
35547
|
}
|
|
34191
35548
|
var objectTraps = {
|
|
34192
|
-
get: get$1,
|
|
35549
|
+
get: get$1$1,
|
|
34193
35550
|
|
|
34194
35551
|
has: function has(target, prop) {
|
|
34195
35552
|
return prop in source$1(target);
|
|
@@ -34201,7 +35558,7 @@ var objectTraps = {
|
|
|
34201
35558
|
|
|
34202
35559
|
set: set$1$1,
|
|
34203
35560
|
deleteProperty: deleteProperty,
|
|
34204
|
-
getOwnPropertyDescriptor: getOwnPropertyDescriptor,
|
|
35561
|
+
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
34205
35562
|
|
|
34206
35563
|
defineProperty: function defineProperty() {
|
|
34207
35564
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
@@ -34252,11 +35609,11 @@ function peek$1(draft, prop) {
|
|
|
34252
35609
|
return desc && desc.value;
|
|
34253
35610
|
}
|
|
34254
35611
|
|
|
34255
|
-
function get$1(state, prop) {
|
|
35612
|
+
function get$1$1(state, prop) {
|
|
34256
35613
|
if (prop === DRAFT_STATE) { return state; }
|
|
34257
35614
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
34258
35615
|
|
|
34259
|
-
if (!state.modified && has(drafts, prop)) {
|
|
35616
|
+
if (!state.modified && has$1(drafts, prop)) {
|
|
34260
35617
|
return drafts[prop];
|
|
34261
35618
|
}
|
|
34262
35619
|
|
|
@@ -34309,7 +35666,7 @@ function deleteProperty(state, prop) {
|
|
|
34309
35666
|
// the same guarantee in ES5 mode.
|
|
34310
35667
|
|
|
34311
35668
|
|
|
34312
|
-
function getOwnPropertyDescriptor(state, prop) {
|
|
35669
|
+
function getOwnPropertyDescriptor$2(state, prop) {
|
|
34313
35670
|
var owner = source$1(state);
|
|
34314
35671
|
var desc = Reflect.getOwnPropertyDescriptor(owner, prop);
|
|
34315
35672
|
|
|
@@ -34728,7 +36085,7 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
34728
36085
|
var base = state.base;
|
|
34729
36086
|
var copy = state.copy;
|
|
34730
36087
|
each(base, function (prop) {
|
|
34731
|
-
if (!has(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
36088
|
+
if (!has$1(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
34732
36089
|
});
|
|
34733
36090
|
}
|
|
34734
36091
|
}
|
|
@@ -34907,7 +36264,7 @@ const createInitialState = formConfig => {
|
|
|
34907
36264
|
};
|
|
34908
36265
|
|
|
34909
36266
|
const SET = "field/SET";
|
|
34910
|
-
const set = fieldName => value => ({
|
|
36267
|
+
const set$2 = fieldName => value => ({
|
|
34911
36268
|
type: SET,
|
|
34912
36269
|
payload: { fieldName, value }
|
|
34913
36270
|
});
|
|
@@ -34987,7 +36344,7 @@ const createMapDispatchToProps = formConfig => {
|
|
|
34987
36344
|
const keys = Object.keys(formConfig);
|
|
34988
36345
|
for (let fieldName of keys) {
|
|
34989
36346
|
dispatchObj.fields[fieldName] = {
|
|
34990
|
-
set: value => dispatch(set(fieldName)(value)),
|
|
36347
|
+
set: value => dispatch(set$2(fieldName)(value)),
|
|
34991
36348
|
addValidator: validator => dispatch(addValidator(fieldName)(validator))
|
|
34992
36349
|
};
|
|
34993
36350
|
}
|
|
@@ -37923,7 +39280,7 @@ var tabbable_1 = tabbable;
|
|
|
37923
39280
|
|
|
37924
39281
|
var immutable = extend;
|
|
37925
39282
|
|
|
37926
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
39283
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
37927
39284
|
|
|
37928
39285
|
function extend() {
|
|
37929
39286
|
var target = {};
|
|
@@ -37932,7 +39289,7 @@ function extend() {
|
|
|
37932
39289
|
var source = arguments[i];
|
|
37933
39290
|
|
|
37934
39291
|
for (var key in source) {
|
|
37935
|
-
if (hasOwnProperty.call(source, key)) {
|
|
39292
|
+
if (hasOwnProperty$1.call(source, key)) {
|
|
37936
39293
|
target[key] = source[key];
|
|
37937
39294
|
}
|
|
37938
39295
|
}
|