@thecb/components 9.1.5-beta.0 → 9.2.0-beta.1
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 +1563 -462
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1563 -463
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/line-item/LineItem.js +1 -1
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +5 -7
- package/src/components/molecules/radio-section/radio-button/RadioButton.theme.js +2 -2
- package/src/components/molecules/toast-notification/ToastNotification.js +90 -0
- package/src/components/molecules/toast-notification/ToastNotification.stories.js +36 -0
- package/src/components/molecules/toast-notification/index.d.ts +1 -0
- package/src/components/molecules/toast-notification/index.js +3 -0
package/dist/index.cjs.js
CHANGED
|
@@ -4961,7 +4961,7 @@ to the one generated by name-that-color.
|
|
|
4961
4961
|
var BLACK = "#000000";
|
|
4962
4962
|
var TRANSPARENT = "transparent";
|
|
4963
4963
|
var LINK_WATER = "#FEFEFE";
|
|
4964
|
-
var WHITE = "#FFFFFF";
|
|
4964
|
+
var WHITE$1 = "#FFFFFF";
|
|
4965
4965
|
var SOLITUDE_WHITE = "#EBEDF1";
|
|
4966
4966
|
var SEASHELL_WHITE = "#F1F1F1";
|
|
4967
4967
|
var ALABASTER_WHITE = "#F7F7F7";
|
|
@@ -5105,7 +5105,7 @@ var colors = /*#__PURE__*/Object.freeze({
|
|
|
5105
5105
|
__proto__: null,
|
|
5106
5106
|
BLACK: BLACK,
|
|
5107
5107
|
TRANSPARENT: TRANSPARENT,
|
|
5108
|
-
WHITE: WHITE,
|
|
5108
|
+
WHITE: WHITE$1,
|
|
5109
5109
|
LINK_WATER: LINK_WATER,
|
|
5110
5110
|
SOLITUDE_WHITE: SOLITUDE_WHITE,
|
|
5111
5111
|
SEASHELL_WHITE: SEASHELL_WHITE,
|
|
@@ -12606,18 +12606,18 @@ var padding = {
|
|
|
12606
12606
|
whitePrimary: "1.125rem 0.75rem"
|
|
12607
12607
|
};
|
|
12608
12608
|
var color$1 = {
|
|
12609
|
-
primary: WHITE,
|
|
12609
|
+
primary: WHITE$1,
|
|
12610
12610
|
secondary: MATISSE_BLUE,
|
|
12611
12611
|
back: MATISSE_BLUE,
|
|
12612
|
-
smallPrimary: WHITE,
|
|
12612
|
+
smallPrimary: WHITE$1,
|
|
12613
12613
|
smallSecondary: MATISSE_BLUE,
|
|
12614
12614
|
smallGhost: MATISSE_BLUE,
|
|
12615
12615
|
ghost: MATISSE_BLUE,
|
|
12616
12616
|
tertiary: MATISSE_BLUE,
|
|
12617
|
-
danger: WHITE,
|
|
12617
|
+
danger: WHITE$1,
|
|
12618
12618
|
dangerSecondary: ERROR_COLOR,
|
|
12619
|
-
whiteSecondary: WHITE,
|
|
12620
|
-
whitePrimary: WHITE
|
|
12619
|
+
whiteSecondary: WHITE$1,
|
|
12620
|
+
whitePrimary: WHITE$1
|
|
12621
12621
|
};
|
|
12622
12622
|
var fontSizeVariant = {
|
|
12623
12623
|
primary: "pS",
|
|
@@ -12700,7 +12700,7 @@ var border = {
|
|
|
12700
12700
|
tertiary: "none",
|
|
12701
12701
|
danger: "2px solid " + RASPBERRY,
|
|
12702
12702
|
dangerSecondary: "2px solid " + ERROR_COLOR,
|
|
12703
|
-
whiteSecondary: "2px solid " + WHITE,
|
|
12703
|
+
whiteSecondary: "2px solid " + WHITE$1,
|
|
12704
12704
|
whitePrimary: "2px solid " + TRANSPARENT
|
|
12705
12705
|
};
|
|
12706
12706
|
var hoverBackgroundColor = {
|
|
@@ -12732,18 +12732,18 @@ var hoverBorderColor = {
|
|
|
12732
12732
|
whitePrimary: "2px solid " + TRANSPARENT
|
|
12733
12733
|
};
|
|
12734
12734
|
var hoverColor = {
|
|
12735
|
-
primary: WHITE,
|
|
12735
|
+
primary: WHITE$1,
|
|
12736
12736
|
secondary: SAPPHIRE_BLUE,
|
|
12737
12737
|
back: SAPPHIRE_BLUE,
|
|
12738
|
-
smallPrimary: WHITE,
|
|
12738
|
+
smallPrimary: WHITE$1,
|
|
12739
12739
|
smallSecondary: SAPPHIRE_BLUE,
|
|
12740
12740
|
smallGhost: SAPPHIRE_BLUE,
|
|
12741
12741
|
ghost: SAPPHIRE_BLUE,
|
|
12742
12742
|
tertiary: SAPPHIRE_BLUE,
|
|
12743
|
-
danger: WHITE,
|
|
12743
|
+
danger: WHITE$1,
|
|
12744
12744
|
dangerSecondary: "#B10541",
|
|
12745
|
-
whiteSecondary: WHITE,
|
|
12746
|
-
whitePrimary: WHITE
|
|
12745
|
+
whiteSecondary: WHITE$1,
|
|
12746
|
+
whitePrimary: WHITE$1
|
|
12747
12747
|
};
|
|
12748
12748
|
var activeBackgroundColor = {
|
|
12749
12749
|
primary: PEACOCK_BLUE,
|
|
@@ -12774,18 +12774,18 @@ var activeBorderColor = {
|
|
|
12774
12774
|
whitePrimary: "2px solid " + TRANSPARENT
|
|
12775
12775
|
};
|
|
12776
12776
|
var activeColor = {
|
|
12777
|
-
primary: WHITE,
|
|
12777
|
+
primary: WHITE$1,
|
|
12778
12778
|
secondary: MATISSE_BLUE,
|
|
12779
12779
|
back: PEACOCK_BLUE,
|
|
12780
|
-
smallPrimary: WHITE,
|
|
12780
|
+
smallPrimary: WHITE$1,
|
|
12781
12781
|
smallSecondary: PEACOCK_BLUE,
|
|
12782
12782
|
smallGhost: PEACOCK_BLUE,
|
|
12783
12783
|
ghost: PEACOCK_BLUE,
|
|
12784
12784
|
tertiary: PEACOCK_BLUE,
|
|
12785
|
-
danger: WHITE,
|
|
12785
|
+
danger: WHITE$1,
|
|
12786
12786
|
dangerSecondary: "#910029",
|
|
12787
|
-
whiteSecondary: WHITE,
|
|
12788
|
-
whitePrimary: WHITE
|
|
12787
|
+
whiteSecondary: WHITE$1,
|
|
12788
|
+
whitePrimary: WHITE$1
|
|
12789
12789
|
};
|
|
12790
12790
|
var fallbackValues$1 = {
|
|
12791
12791
|
padding: padding,
|
|
@@ -12984,9 +12984,9 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
|
|
|
12984
12984
|
};
|
|
12985
12985
|
|
|
12986
12986
|
var primaryColor = {
|
|
12987
|
-
info: "".concat(WHITE),
|
|
12988
|
-
success: "".concat(WHITE),
|
|
12989
|
-
error: "".concat(WHITE)
|
|
12987
|
+
info: "".concat(WHITE$1),
|
|
12988
|
+
success: "".concat(WHITE$1),
|
|
12989
|
+
error: "".concat(WHITE$1)
|
|
12990
12990
|
};
|
|
12991
12991
|
var accentColor = {
|
|
12992
12992
|
info: "".concat(BRIGHT_GREY),
|
|
@@ -13001,7 +13001,7 @@ var subIconColor = {
|
|
|
13001
13001
|
var singleIconColor = {
|
|
13002
13002
|
primary: "".concat(MATISSE_BLUE),
|
|
13003
13003
|
secondary: "".concat(BRIGHT_GREY),
|
|
13004
|
-
darkMode: "".concat(WHITE)
|
|
13004
|
+
darkMode: "".concat(WHITE$1)
|
|
13005
13005
|
};
|
|
13006
13006
|
var fallbackValues$2 = {
|
|
13007
13007
|
primaryColor: primaryColor,
|
|
@@ -18309,7 +18309,7 @@ var IconChevron = function IconChevron(_ref) {
|
|
|
18309
18309
|
fillRule: "evenodd"
|
|
18310
18310
|
}, /*#__PURE__*/React__default.createElement("mask", {
|
|
18311
18311
|
id: "icon-chevron-mask-2",
|
|
18312
|
-
fill: WHITE
|
|
18312
|
+
fill: WHITE$1
|
|
18313
18313
|
}, /*#__PURE__*/React__default.createElement("use", {
|
|
18314
18314
|
xlinkHref: "#icon-chevron-path-1"
|
|
18315
18315
|
})), /*#__PURE__*/React__default.createElement("use", {
|
|
@@ -18362,7 +18362,7 @@ var IconValid = function IconValid(_ref) {
|
|
|
18362
18362
|
var _ref$bgFill = _ref.bgFill,
|
|
18363
18363
|
bgFill = _ref$bgFill === void 0 ? FOREST_GREEN : _ref$bgFill,
|
|
18364
18364
|
_ref$iconFill = _ref.iconFill,
|
|
18365
|
-
iconFill = _ref$iconFill === void 0 ? WHITE : _ref$iconFill,
|
|
18365
|
+
iconFill = _ref$iconFill === void 0 ? WHITE$1 : _ref$iconFill,
|
|
18366
18366
|
_ref$width = _ref.width,
|
|
18367
18367
|
width = _ref$width === void 0 ? "18" : _ref$width,
|
|
18368
18368
|
_ref$height = _ref.height,
|
|
@@ -18414,7 +18414,7 @@ var IconInvalid = function IconInvalid(_ref) {
|
|
|
18414
18414
|
var _ref$bgFill = _ref.bgFill,
|
|
18415
18415
|
bgFill = _ref$bgFill === void 0 ? RAZZMATAZZ_RED : _ref$bgFill,
|
|
18416
18416
|
_ref$iconFill = _ref.iconFill,
|
|
18417
|
-
iconFill = _ref$iconFill === void 0 ? WHITE : _ref$iconFill,
|
|
18417
|
+
iconFill = _ref$iconFill === void 0 ? WHITE$1 : _ref$iconFill,
|
|
18418
18418
|
_ref$width = _ref.width,
|
|
18419
18419
|
width = _ref$width === void 0 ? "18" : _ref$width,
|
|
18420
18420
|
_ref$height = _ref.height,
|
|
@@ -21837,7 +21837,7 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
21837
21837
|
|
|
21838
21838
|
var Paragraph$1 = themeComponent(Paragraph, "Paragraph", fallbackValues$b, "p");
|
|
21839
21839
|
|
|
21840
|
-
var backgroundColor$1 = WHITE;
|
|
21840
|
+
var backgroundColor$1 = WHITE$1;
|
|
21841
21841
|
var iconBackgroundColor = GRECIAN_GREY;
|
|
21842
21842
|
var fallbackValues$c = {
|
|
21843
21843
|
backgroundColor: backgroundColor$1,
|
|
@@ -22030,10 +22030,10 @@ var textColor = {
|
|
|
22030
22030
|
"default": "".concat(CHARADE_GREY)
|
|
22031
22031
|
};
|
|
22032
22032
|
var disabledCheckColor = {
|
|
22033
|
-
"default": "".concat(WHITE, ";")
|
|
22033
|
+
"default": "".concat(WHITE$1, ";")
|
|
22034
22034
|
};
|
|
22035
22035
|
var checkColor = {
|
|
22036
|
-
"default": "".concat(WHITE, ";")
|
|
22036
|
+
"default": "".concat(WHITE$1, ";")
|
|
22037
22037
|
};
|
|
22038
22038
|
var errorStyles = {
|
|
22039
22039
|
"default": "border: 1px solid ".concat(RED, ";")
|
|
@@ -22051,7 +22051,7 @@ var checkedStyles = {
|
|
|
22051
22051
|
"default": "\n background: ".concat(MATISSE_BLUE, "; \n border: 1px solid ").concat(MATISSE_BLUE, ";\n")
|
|
22052
22052
|
};
|
|
22053
22053
|
var defaultStyles = {
|
|
22054
|
-
"default": "\n background: ".concat(WHITE, "; \n border: 1px solid ").concat(STORM_GREY, ";\n")
|
|
22054
|
+
"default": "\n background: ".concat(WHITE$1, "; \n border: 1px solid ").concat(STORM_GREY, ";\n")
|
|
22055
22055
|
};
|
|
22056
22056
|
var fallbackValues$d = {
|
|
22057
22057
|
backgroundColor: backgroundColor$2,
|
|
@@ -22204,14 +22204,14 @@ var Checkbox$1 = themeComponent(Checkbox, "Checkbox", fallbackValues$d, "default
|
|
|
22204
22204
|
|
|
22205
22205
|
var listBackgroundColor = {
|
|
22206
22206
|
"default": "".concat(ATHENS_GREY),
|
|
22207
|
-
disabled: "".concat(WHITE)
|
|
22207
|
+
disabled: "".concat(WHITE$1)
|
|
22208
22208
|
};
|
|
22209
22209
|
var listItemColor = {
|
|
22210
22210
|
"default": "".concat(MINESHAFT_GREY),
|
|
22211
22211
|
disabled: "".concat(STORM_GREY)
|
|
22212
22212
|
};
|
|
22213
22213
|
var listItemBackgroundColor = {
|
|
22214
|
-
"default": "".concat(WHITE),
|
|
22214
|
+
"default": "".concat(WHITE$1),
|
|
22215
22215
|
disabled: "".concat(ATHENS_GREY)
|
|
22216
22216
|
};
|
|
22217
22217
|
var listItemBorderColor = {
|
|
@@ -22423,18 +22423,17 @@ var DropdownIcon = function DropdownIcon() {
|
|
|
22423
22423
|
};
|
|
22424
22424
|
|
|
22425
22425
|
var check = function (it) {
|
|
22426
|
-
return it && it.Math
|
|
22426
|
+
return it && it.Math == Math && it;
|
|
22427
22427
|
};
|
|
22428
22428
|
|
|
22429
22429
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
22430
22430
|
var global_1 =
|
|
22431
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
22431
|
+
// eslint-disable-next-line es-x/no-global-this -- safe
|
|
22432
22432
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
22433
22433
|
check(typeof window == 'object' && window) ||
|
|
22434
22434
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
22435
22435
|
check(typeof self == 'object' && self) ||
|
|
22436
22436
|
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
22437
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
22438
22437
|
// eslint-disable-next-line no-new-func -- fallback
|
|
22439
22438
|
(function () { return this; })() || Function('return this')();
|
|
22440
22439
|
|
|
@@ -22448,12 +22447,12 @@ var fails = function (exec) {
|
|
|
22448
22447
|
|
|
22449
22448
|
// Detect IE8's incomplete defineProperty implementation
|
|
22450
22449
|
var descriptors = !fails(function () {
|
|
22451
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22452
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1]
|
|
22450
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
22451
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
22453
22452
|
});
|
|
22454
22453
|
|
|
22455
22454
|
var functionBindNative = !fails(function () {
|
|
22456
|
-
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
22455
|
+
// eslint-disable-next-line es-x/no-function-prototype-bind -- safe
|
|
22457
22456
|
var test = (function () { /* empty */ }).bind();
|
|
22458
22457
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
22459
22458
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -22466,7 +22465,7 @@ var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
|
22466
22465
|
};
|
|
22467
22466
|
|
|
22468
22467
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
22469
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22468
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
22470
22469
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
22471
22470
|
|
|
22472
22471
|
// Nashorn ~ JDK8 bug
|
|
@@ -22493,11 +22492,14 @@ var createPropertyDescriptor = function (bitmap, value) {
|
|
|
22493
22492
|
};
|
|
22494
22493
|
|
|
22495
22494
|
var FunctionPrototype = Function.prototype;
|
|
22495
|
+
var bind$1 = FunctionPrototype.bind;
|
|
22496
22496
|
var call$1 = FunctionPrototype.call;
|
|
22497
|
-
var
|
|
22497
|
+
var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
|
|
22498
22498
|
|
|
22499
|
-
var functionUncurryThis = functionBindNative ?
|
|
22500
|
-
return
|
|
22499
|
+
var functionUncurryThis = functionBindNative ? function (fn) {
|
|
22500
|
+
return fn && uncurryThis(fn);
|
|
22501
|
+
} : function (fn) {
|
|
22502
|
+
return fn && function () {
|
|
22501
22503
|
return call$1.apply(fn, arguments);
|
|
22502
22504
|
};
|
|
22503
22505
|
};
|
|
@@ -22518,21 +22520,15 @@ var indexedObject = fails(function () {
|
|
|
22518
22520
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
22519
22521
|
return !$Object('z').propertyIsEnumerable(0);
|
|
22520
22522
|
}) ? function (it) {
|
|
22521
|
-
return classofRaw(it)
|
|
22523
|
+
return classofRaw(it) == 'String' ? split(it, '') : $Object(it);
|
|
22522
22524
|
} : $Object;
|
|
22523
22525
|
|
|
22524
|
-
// we can't use just `it == null` since of `document.all` special case
|
|
22525
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
22526
|
-
var isNullOrUndefined = function (it) {
|
|
22527
|
-
return it === null || it === undefined;
|
|
22528
|
-
};
|
|
22529
|
-
|
|
22530
22526
|
var $TypeError = TypeError;
|
|
22531
22527
|
|
|
22532
22528
|
// `RequireObjectCoercible` abstract operation
|
|
22533
22529
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
22534
22530
|
var requireObjectCoercible = function (it) {
|
|
22535
|
-
if (
|
|
22531
|
+
if (it == undefined) throw $TypeError("Can't call method on " + it);
|
|
22536
22532
|
return it;
|
|
22537
22533
|
};
|
|
22538
22534
|
|
|
@@ -22544,32 +22540,13 @@ var toIndexedObject = function (it) {
|
|
|
22544
22540
|
return indexedObject(requireObjectCoercible(it));
|
|
22545
22541
|
};
|
|
22546
22542
|
|
|
22547
|
-
var documentAll = typeof document == 'object' && document.all;
|
|
22548
|
-
|
|
22549
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
22550
|
-
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
22551
|
-
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
22552
|
-
|
|
22553
|
-
var documentAll_1 = {
|
|
22554
|
-
all: documentAll,
|
|
22555
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
22556
|
-
};
|
|
22557
|
-
|
|
22558
|
-
var documentAll$1 = documentAll_1.all;
|
|
22559
|
-
|
|
22560
22543
|
// `IsCallable` abstract operation
|
|
22561
22544
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
22562
|
-
var isCallable =
|
|
22563
|
-
return typeof argument == 'function' || argument === documentAll$1;
|
|
22564
|
-
} : function (argument) {
|
|
22545
|
+
var isCallable = function (argument) {
|
|
22565
22546
|
return typeof argument == 'function';
|
|
22566
22547
|
};
|
|
22567
22548
|
|
|
22568
|
-
var
|
|
22569
|
-
|
|
22570
|
-
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
22571
|
-
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
22572
|
-
} : function (it) {
|
|
22549
|
+
var isObject = function (it) {
|
|
22573
22550
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
22574
22551
|
};
|
|
22575
22552
|
|
|
@@ -22583,7 +22560,7 @@ var getBuiltIn = function (namespace, method) {
|
|
|
22583
22560
|
|
|
22584
22561
|
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
22585
22562
|
|
|
22586
|
-
var engineUserAgent =
|
|
22563
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
22587
22564
|
|
|
22588
22565
|
var process$1 = global_1.process;
|
|
22589
22566
|
var Deno = global_1.Deno;
|
|
@@ -22610,29 +22587,24 @@ if (!version && engineUserAgent) {
|
|
|
22610
22587
|
|
|
22611
22588
|
var engineV8Version = version;
|
|
22612
22589
|
|
|
22613
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
22614
|
-
|
|
22615
|
-
|
|
22590
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
22616
22591
|
|
|
22617
22592
|
|
|
22618
|
-
var $String = global_1.String;
|
|
22619
22593
|
|
|
22620
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
22621
|
-
var
|
|
22622
|
-
var symbol = Symbol(
|
|
22594
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
|
|
22595
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
22596
|
+
var symbol = Symbol();
|
|
22623
22597
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
22624
22598
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
22625
|
-
|
|
22626
|
-
// of course, fail.
|
|
22627
|
-
return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
22599
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
22628
22600
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
22629
22601
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
22630
22602
|
});
|
|
22631
22603
|
|
|
22632
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
22604
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
22633
22605
|
|
|
22634
22606
|
|
|
22635
|
-
var useSymbolAsUid =
|
|
22607
|
+
var useSymbolAsUid = nativeSymbol
|
|
22636
22608
|
&& !Symbol.sham
|
|
22637
22609
|
&& typeof Symbol.iterator == 'symbol';
|
|
22638
22610
|
|
|
@@ -22645,11 +22617,11 @@ var isSymbol = useSymbolAsUid ? function (it) {
|
|
|
22645
22617
|
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$1(it));
|
|
22646
22618
|
};
|
|
22647
22619
|
|
|
22648
|
-
var $String
|
|
22620
|
+
var $String = String;
|
|
22649
22621
|
|
|
22650
22622
|
var tryToString = function (argument) {
|
|
22651
22623
|
try {
|
|
22652
|
-
return $String
|
|
22624
|
+
return $String(argument);
|
|
22653
22625
|
} catch (error) {
|
|
22654
22626
|
return 'Object';
|
|
22655
22627
|
}
|
|
@@ -22660,14 +22632,14 @@ var $TypeError$1 = TypeError;
|
|
|
22660
22632
|
// `Assert: IsCallable(argument) is true`
|
|
22661
22633
|
var aCallable = function (argument) {
|
|
22662
22634
|
if (isCallable(argument)) return argument;
|
|
22663
|
-
throw
|
|
22635
|
+
throw $TypeError$1(tryToString(argument) + ' is not a function');
|
|
22664
22636
|
};
|
|
22665
22637
|
|
|
22666
22638
|
// `GetMethod` abstract operation
|
|
22667
22639
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
22668
22640
|
var getMethod = function (V, P) {
|
|
22669
22641
|
var func = V[P];
|
|
22670
|
-
return
|
|
22642
|
+
return func == null ? undefined : aCallable(func);
|
|
22671
22643
|
};
|
|
22672
22644
|
|
|
22673
22645
|
var $TypeError$2 = TypeError;
|
|
@@ -22679,10 +22651,10 @@ var ordinaryToPrimitive = function (input, pref) {
|
|
|
22679
22651
|
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
22680
22652
|
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
22681
22653
|
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
22682
|
-
throw
|
|
22654
|
+
throw $TypeError$2("Can't convert object to primitive value");
|
|
22683
22655
|
};
|
|
22684
22656
|
|
|
22685
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22657
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
22686
22658
|
var defineProperty = Object.defineProperty;
|
|
22687
22659
|
|
|
22688
22660
|
var defineGlobalProperty = function (key, value) {
|
|
@@ -22699,16 +22671,13 @@ var store = global_1[SHARED] || defineGlobalProperty(SHARED, {});
|
|
|
22699
22671
|
var sharedStore = store;
|
|
22700
22672
|
|
|
22701
22673
|
var shared = createCommonjsModule(function (module) {
|
|
22702
|
-
|
|
22703
|
-
|
|
22704
|
-
|
|
22705
22674
|
(module.exports = function (key, value) {
|
|
22706
22675
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
22707
22676
|
})('versions', []).push({
|
|
22708
|
-
version: '3.
|
|
22677
|
+
version: '3.24.1',
|
|
22709
22678
|
mode: 'global',
|
|
22710
|
-
copyright: '© 2014-
|
|
22711
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
22679
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
22680
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE',
|
|
22712
22681
|
source: 'https://github.com/zloirock/core-js'
|
|
22713
22682
|
});
|
|
22714
22683
|
});
|
|
@@ -22725,7 +22694,7 @@ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
|
22725
22694
|
|
|
22726
22695
|
// `HasOwnProperty` abstract operation
|
|
22727
22696
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
22728
|
-
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
22697
|
+
// eslint-disable-next-line es-x/no-object-hasown -- safe
|
|
22729
22698
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
22730
22699
|
return hasOwnProperty(toObject(it), key);
|
|
22731
22700
|
};
|
|
@@ -22738,15 +22707,21 @@ var uid = function (key) {
|
|
|
22738
22707
|
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
22739
22708
|
};
|
|
22740
22709
|
|
|
22741
|
-
var Symbol$1 = global_1.Symbol;
|
|
22742
22710
|
var WellKnownSymbolsStore = shared('wks');
|
|
22743
|
-
var
|
|
22711
|
+
var Symbol$1 = global_1.Symbol;
|
|
22712
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
22713
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22744
22714
|
|
|
22745
22715
|
var wellKnownSymbol = function (name) {
|
|
22746
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name)) {
|
|
22747
|
-
|
|
22748
|
-
|
|
22749
|
-
|
|
22716
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
22717
|
+
var description = 'Symbol.' + name;
|
|
22718
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
22719
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
22720
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
22721
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
22722
|
+
} else {
|
|
22723
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
22724
|
+
}
|
|
22750
22725
|
} return WellKnownSymbolsStore[name];
|
|
22751
22726
|
};
|
|
22752
22727
|
|
|
@@ -22763,7 +22738,7 @@ var toPrimitive = function (input, pref) {
|
|
|
22763
22738
|
if (pref === undefined) pref = 'default';
|
|
22764
22739
|
result = functionCall(exoticToPrim, input, pref);
|
|
22765
22740
|
if (!isObject(result) || isSymbol(result)) return result;
|
|
22766
|
-
throw
|
|
22741
|
+
throw $TypeError$3("Can't convert object to primitive value");
|
|
22767
22742
|
}
|
|
22768
22743
|
if (pref === undefined) pref = 'number';
|
|
22769
22744
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -22786,13 +22761,13 @@ var documentCreateElement = function (it) {
|
|
|
22786
22761
|
|
|
22787
22762
|
// Thanks to IE8 for its funny defineProperty
|
|
22788
22763
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
22789
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22764
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
22790
22765
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
22791
22766
|
get: function () { return 7; }
|
|
22792
|
-
}).a
|
|
22767
|
+
}).a != 7;
|
|
22793
22768
|
});
|
|
22794
22769
|
|
|
22795
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22770
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
22796
22771
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
22797
22772
|
|
|
22798
22773
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -22813,26 +22788,26 @@ var objectGetOwnPropertyDescriptor = {
|
|
|
22813
22788
|
// V8 ~ Chrome 36-
|
|
22814
22789
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
22815
22790
|
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
22816
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22791
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
22817
22792
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
22818
22793
|
value: 42,
|
|
22819
22794
|
writable: false
|
|
22820
|
-
}).prototype
|
|
22795
|
+
}).prototype != 42;
|
|
22821
22796
|
});
|
|
22822
22797
|
|
|
22823
|
-
var $String$
|
|
22798
|
+
var $String$1 = String;
|
|
22824
22799
|
var $TypeError$4 = TypeError;
|
|
22825
22800
|
|
|
22826
22801
|
// `Assert: Type(argument) is Object`
|
|
22827
22802
|
var anObject = function (argument) {
|
|
22828
22803
|
if (isObject(argument)) return argument;
|
|
22829
|
-
throw
|
|
22804
|
+
throw $TypeError$4($String$1(argument) + ' is not an object');
|
|
22830
22805
|
};
|
|
22831
22806
|
|
|
22832
22807
|
var $TypeError$5 = TypeError;
|
|
22833
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22808
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
22834
22809
|
var $defineProperty = Object.defineProperty;
|
|
22835
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22810
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
22836
22811
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
22837
22812
|
var ENUMERABLE = 'enumerable';
|
|
22838
22813
|
var CONFIGURABLE = 'configurable';
|
|
@@ -22862,7 +22837,7 @@ var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Att
|
|
|
22862
22837
|
if (ie8DomDefine) try {
|
|
22863
22838
|
return $defineProperty(O, P, Attributes);
|
|
22864
22839
|
} catch (error) { /* empty */ }
|
|
22865
|
-
if ('get' in Attributes || 'set' in Attributes) throw
|
|
22840
|
+
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$5('Accessors not supported');
|
|
22866
22841
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
22867
22842
|
return O;
|
|
22868
22843
|
};
|
|
@@ -22879,7 +22854,7 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
22879
22854
|
};
|
|
22880
22855
|
|
|
22881
22856
|
var FunctionPrototype$1 = Function.prototype;
|
|
22882
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22857
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
22883
22858
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
22884
22859
|
|
|
22885
22860
|
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
@@ -22906,7 +22881,7 @@ var inspectSource = sharedStore.inspectSource;
|
|
|
22906
22881
|
|
|
22907
22882
|
var WeakMap$1 = global_1.WeakMap;
|
|
22908
22883
|
|
|
22909
|
-
var
|
|
22884
|
+
var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
|
|
22910
22885
|
|
|
22911
22886
|
var keys$1 = shared('keys');
|
|
22912
22887
|
|
|
@@ -22929,29 +22904,27 @@ var getterFor = function (TYPE) {
|
|
|
22929
22904
|
return function (it) {
|
|
22930
22905
|
var state;
|
|
22931
22906
|
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
22932
|
-
throw
|
|
22907
|
+
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
22933
22908
|
} return state;
|
|
22934
22909
|
};
|
|
22935
22910
|
};
|
|
22936
22911
|
|
|
22937
|
-
if (
|
|
22912
|
+
if (nativeWeakMap || sharedStore.state) {
|
|
22938
22913
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
22939
|
-
|
|
22940
|
-
|
|
22941
|
-
|
|
22942
|
-
store$1.set = store$1.set;
|
|
22943
|
-
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
22914
|
+
var wmget = functionUncurryThis(store$1.get);
|
|
22915
|
+
var wmhas = functionUncurryThis(store$1.has);
|
|
22916
|
+
var wmset = functionUncurryThis(store$1.set);
|
|
22944
22917
|
set = function (it, metadata) {
|
|
22945
|
-
if (store$1
|
|
22918
|
+
if (wmhas(store$1, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
22946
22919
|
metadata.facade = it;
|
|
22947
|
-
store$1
|
|
22920
|
+
wmset(store$1, it, metadata);
|
|
22948
22921
|
return metadata;
|
|
22949
22922
|
};
|
|
22950
22923
|
get = function (it) {
|
|
22951
|
-
return store$1
|
|
22924
|
+
return wmget(store$1, it) || {};
|
|
22952
22925
|
};
|
|
22953
22926
|
has = function (it) {
|
|
22954
|
-
return store$1
|
|
22927
|
+
return wmhas(store$1, it);
|
|
22955
22928
|
};
|
|
22956
22929
|
} else {
|
|
22957
22930
|
var STATE = sharedKey('state');
|
|
@@ -22979,23 +22952,14 @@ var internalState = {
|
|
|
22979
22952
|
};
|
|
22980
22953
|
|
|
22981
22954
|
var makeBuiltIn_1 = createCommonjsModule(function (module) {
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
22955
|
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
22988
22956
|
|
|
22989
22957
|
|
|
22990
22958
|
|
|
22991
22959
|
var enforceInternalState = internalState.enforce;
|
|
22992
22960
|
var getInternalState = internalState.get;
|
|
22993
|
-
|
|
22994
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22961
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
22995
22962
|
var defineProperty = Object.defineProperty;
|
|
22996
|
-
var stringSlice = functionUncurryThis(''.slice);
|
|
22997
|
-
var replace = functionUncurryThis(''.replace);
|
|
22998
|
-
var join = functionUncurryThis([].join);
|
|
22999
22963
|
|
|
23000
22964
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
23001
22965
|
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
@@ -23004,8 +22968,8 @@ var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
|
23004
22968
|
var TEMPLATE = String(String).split('String');
|
|
23005
22969
|
|
|
23006
22970
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23007
|
-
if (
|
|
23008
|
-
name = '[' +
|
|
22971
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
22972
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
23009
22973
|
}
|
|
23010
22974
|
if (options && options.getter) name = 'get ' + name;
|
|
23011
22975
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -23024,7 +22988,7 @@ var makeBuiltIn = module.exports = function (value, name, options) {
|
|
|
23024
22988
|
} catch (error) { /* empty */ }
|
|
23025
22989
|
var state = enforceInternalState(value);
|
|
23026
22990
|
if (!hasOwnProperty_1(state, 'source')) {
|
|
23027
|
-
state.source = join(
|
|
22991
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
23028
22992
|
} return value;
|
|
23029
22993
|
};
|
|
23030
22994
|
|
|
@@ -23063,7 +23027,7 @@ var floor = Math.floor;
|
|
|
23063
23027
|
|
|
23064
23028
|
// `Math.trunc` method
|
|
23065
23029
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
23066
|
-
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
23030
|
+
// eslint-disable-next-line es-x/no-math-trunc -- safe
|
|
23067
23031
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
23068
23032
|
var n = +x;
|
|
23069
23033
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -23111,10 +23075,10 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
23111
23075
|
var value;
|
|
23112
23076
|
// Array#includes uses SameValueZero equality algorithm
|
|
23113
23077
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
23114
|
-
if (IS_INCLUDES && el
|
|
23078
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
23115
23079
|
value = O[index++];
|
|
23116
23080
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
23117
|
-
if (value
|
|
23081
|
+
if (value != value) return true;
|
|
23118
23082
|
// Array#indexOf ignores holes, Array#includes - not
|
|
23119
23083
|
} else for (;length > index; index++) {
|
|
23120
23084
|
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
@@ -23164,7 +23128,7 @@ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
|
23164
23128
|
|
|
23165
23129
|
// `Object.getOwnPropertyNames` method
|
|
23166
23130
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
23167
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
23131
|
+
// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
|
|
23168
23132
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
23169
23133
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
23170
23134
|
};
|
|
@@ -23173,7 +23137,7 @@ var objectGetOwnPropertyNames = {
|
|
|
23173
23137
|
f: f$3
|
|
23174
23138
|
};
|
|
23175
23139
|
|
|
23176
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
23140
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
|
|
23177
23141
|
var f$4 = Object.getOwnPropertySymbols;
|
|
23178
23142
|
|
|
23179
23143
|
var objectGetOwnPropertySymbols = {
|
|
@@ -23205,8 +23169,8 @@ var replacement = /#|\.prototype\./;
|
|
|
23205
23169
|
|
|
23206
23170
|
var isForced = function (feature, detection) {
|
|
23207
23171
|
var value = data[normalize(feature)];
|
|
23208
|
-
return value
|
|
23209
|
-
: value
|
|
23172
|
+
return value == POLYFILL ? true
|
|
23173
|
+
: value == NATIVE ? false
|
|
23210
23174
|
: isCallable(detection) ? fails(detection)
|
|
23211
23175
|
: !!detection;
|
|
23212
23176
|
};
|
|
@@ -23286,7 +23250,7 @@ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
|
23286
23250
|
var $Object$3 = Object;
|
|
23287
23251
|
|
|
23288
23252
|
// ES3 wrong here
|
|
23289
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }())
|
|
23253
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
23290
23254
|
|
|
23291
23255
|
// fallback for IE11 Script Access Denied error
|
|
23292
23256
|
var tryGet = function (it, key) {
|
|
@@ -23304,25 +23268,25 @@ var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
|
23304
23268
|
// builtinTag case
|
|
23305
23269
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
23306
23270
|
// ES3 arguments fallback
|
|
23307
|
-
: (result = classofRaw(O))
|
|
23271
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
23308
23272
|
};
|
|
23309
23273
|
|
|
23310
|
-
var $String$
|
|
23274
|
+
var $String$2 = String;
|
|
23311
23275
|
|
|
23312
23276
|
var toString_1 = function (argument) {
|
|
23313
|
-
if (classof(argument) === 'Symbol') throw
|
|
23314
|
-
return $String$
|
|
23277
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
23278
|
+
return $String$2(argument);
|
|
23315
23279
|
};
|
|
23316
23280
|
|
|
23317
23281
|
var charAt = functionUncurryThis(''.charAt);
|
|
23318
23282
|
|
|
23319
23283
|
var FORCED = fails(function () {
|
|
23320
|
-
// eslint-disable-next-line es/no-array-string-prototype-at -- safe
|
|
23284
|
+
// eslint-disable-next-line es-x/no-array-string-prototype-at -- safe
|
|
23321
23285
|
return '𠮷'.at(-2) !== '\uD842';
|
|
23322
23286
|
});
|
|
23323
23287
|
|
|
23324
23288
|
// `String.prototype.at` method
|
|
23325
|
-
// https://
|
|
23289
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
23326
23290
|
_export({ target: 'String', proto: true, forced: FORCED }, {
|
|
23327
23291
|
at: function at(index) {
|
|
23328
23292
|
var S = toString_1(requireObjectCoercible(this));
|
|
@@ -23335,14 +23299,14 @@ _export({ target: 'String', proto: true, forced: FORCED }, {
|
|
|
23335
23299
|
|
|
23336
23300
|
// `Object.keys` method
|
|
23337
23301
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
23338
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
23302
|
+
// eslint-disable-next-line es-x/no-object-keys -- safe
|
|
23339
23303
|
var objectKeys = Object.keys || function keys(O) {
|
|
23340
23304
|
return objectKeysInternal(O, enumBugKeys);
|
|
23341
23305
|
};
|
|
23342
23306
|
|
|
23343
23307
|
// `Object.defineProperties` method
|
|
23344
23308
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
23345
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
23309
|
+
// eslint-disable-next-line es-x/no-object-defineproperties -- safe
|
|
23346
23310
|
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
23347
23311
|
anObject(O);
|
|
23348
23312
|
var props = toIndexedObject(Properties);
|
|
@@ -23431,7 +23395,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
23431
23395
|
|
|
23432
23396
|
// `Object.create` method
|
|
23433
23397
|
// https://tc39.es/ecma262/#sec-object.create
|
|
23434
|
-
// eslint-disable-next-line es/no-object-create -- safe
|
|
23398
|
+
// eslint-disable-next-line es-x/no-object-create -- safe
|
|
23435
23399
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
23436
23400
|
var result;
|
|
23437
23401
|
if (O !== null) {
|
|
@@ -23451,7 +23415,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
23451
23415
|
|
|
23452
23416
|
// Array.prototype[@@unscopables]
|
|
23453
23417
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
23454
|
-
if (ArrayPrototype[UNSCOPABLES]
|
|
23418
|
+
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
23455
23419
|
defineProperty$1(ArrayPrototype, UNSCOPABLES, {
|
|
23456
23420
|
configurable: true,
|
|
23457
23421
|
value: objectCreate(null)
|
|
@@ -23464,7 +23428,7 @@ var addToUnscopables = function (key) {
|
|
|
23464
23428
|
};
|
|
23465
23429
|
|
|
23466
23430
|
// `Array.prototype.at` method
|
|
23467
|
-
// https://
|
|
23431
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
23468
23432
|
_export({ target: 'Array', proto: true }, {
|
|
23469
23433
|
at: function at(index) {
|
|
23470
23434
|
var O = toObject(this);
|
|
@@ -23477,19 +23441,13 @@ _export({ target: 'Array', proto: true }, {
|
|
|
23477
23441
|
|
|
23478
23442
|
addToUnscopables('at');
|
|
23479
23443
|
|
|
23480
|
-
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
23481
|
-
var
|
|
23482
|
-
|
|
23483
|
-
var defineBuiltInAccessor = function (target, name, descriptor) {
|
|
23484
|
-
if (descriptor.get) makeBuiltIn_1(descriptor.get, name, { getter: true });
|
|
23485
|
-
if (descriptor.set) makeBuiltIn_1(descriptor.set, name, { setter: true });
|
|
23486
|
-
return objectDefineProperty.f(target, name, descriptor);
|
|
23487
|
-
};
|
|
23444
|
+
// eslint-disable-next-line es-x/no-typed-arrays -- safe
|
|
23445
|
+
var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
23488
23446
|
|
|
23489
23447
|
var correctPrototypeGetter = !fails(function () {
|
|
23490
23448
|
function F() { /* empty */ }
|
|
23491
23449
|
F.prototype.constructor = null;
|
|
23492
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
23450
|
+
// eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
|
|
23493
23451
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
23494
23452
|
});
|
|
23495
23453
|
|
|
@@ -23499,7 +23457,7 @@ var ObjectPrototype = $Object$4.prototype;
|
|
|
23499
23457
|
|
|
23500
23458
|
// `Object.getPrototypeOf` method
|
|
23501
23459
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
23502
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
23460
|
+
// eslint-disable-next-line es-x/no-object-getprototypeof -- safe
|
|
23503
23461
|
var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
|
|
23504
23462
|
var object = toObject(O);
|
|
23505
23463
|
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
@@ -23509,19 +23467,12 @@ var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : f
|
|
|
23509
23467
|
} return object instanceof $Object$4 ? ObjectPrototype : null;
|
|
23510
23468
|
};
|
|
23511
23469
|
|
|
23512
|
-
var
|
|
23513
|
-
try {
|
|
23514
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
23515
|
-
return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
23516
|
-
} catch (error) { /* empty */ }
|
|
23517
|
-
};
|
|
23518
|
-
|
|
23519
|
-
var $String$4 = String;
|
|
23470
|
+
var $String$3 = String;
|
|
23520
23471
|
var $TypeError$6 = TypeError;
|
|
23521
23472
|
|
|
23522
23473
|
var aPossiblePrototype = function (argument) {
|
|
23523
23474
|
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
23524
|
-
throw
|
|
23475
|
+
throw $TypeError$6("Can't set " + $String$3(argument) + ' as a prototype');
|
|
23525
23476
|
};
|
|
23526
23477
|
|
|
23527
23478
|
/* eslint-disable no-proto -- safe */
|
|
@@ -23532,13 +23483,14 @@ var aPossiblePrototype = function (argument) {
|
|
|
23532
23483
|
// `Object.setPrototypeOf` method
|
|
23533
23484
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
23534
23485
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
23535
|
-
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
23486
|
+
// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
|
|
23536
23487
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
23537
23488
|
var CORRECT_SETTER = false;
|
|
23538
23489
|
var test = {};
|
|
23539
23490
|
var setter;
|
|
23540
23491
|
try {
|
|
23541
|
-
|
|
23492
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
23493
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
23542
23494
|
setter(test, []);
|
|
23543
23495
|
CORRECT_SETTER = test instanceof Array;
|
|
23544
23496
|
} catch (error) { /* empty */ }
|
|
@@ -23551,6 +23503,14 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
23551
23503
|
};
|
|
23552
23504
|
}() : undefined);
|
|
23553
23505
|
|
|
23506
|
+
var defineProperty$2 = objectDefineProperty.f;
|
|
23507
|
+
|
|
23508
|
+
|
|
23509
|
+
|
|
23510
|
+
|
|
23511
|
+
|
|
23512
|
+
|
|
23513
|
+
|
|
23554
23514
|
var enforceInternalState = internalState.enforce;
|
|
23555
23515
|
var getInternalState = internalState.get;
|
|
23556
23516
|
var Int8Array = global_1.Int8Array;
|
|
@@ -23566,7 +23526,7 @@ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
|
23566
23526
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
23567
23527
|
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
|
|
23568
23528
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
23569
|
-
var NATIVE_ARRAY_BUFFER_VIEWS =
|
|
23529
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferNative && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
23570
23530
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
23571
23531
|
var NAME, Constructor, Prototype;
|
|
23572
23532
|
|
|
@@ -23611,12 +23571,12 @@ var isTypedArray = function (it) {
|
|
|
23611
23571
|
|
|
23612
23572
|
var aTypedArray = function (it) {
|
|
23613
23573
|
if (isTypedArray(it)) return it;
|
|
23614
|
-
throw
|
|
23574
|
+
throw TypeError$2('Target is not a typed array');
|
|
23615
23575
|
};
|
|
23616
23576
|
|
|
23617
23577
|
var aTypedArrayConstructor = function (C) {
|
|
23618
23578
|
if (isCallable(C) && (!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))) return C;
|
|
23619
|
-
throw
|
|
23579
|
+
throw TypeError$2(tryToString(C) + ' is not a typed array constructor');
|
|
23620
23580
|
};
|
|
23621
23581
|
|
|
23622
23582
|
var exportTypedArrayMethod = function (KEY, property, forced, options) {
|
|
@@ -23680,7 +23640,7 @@ for (NAME in BigIntArrayConstructorsList) {
|
|
|
23680
23640
|
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
|
|
23681
23641
|
// eslint-disable-next-line no-shadow -- safe
|
|
23682
23642
|
TypedArray = function TypedArray() {
|
|
23683
|
-
throw
|
|
23643
|
+
throw TypeError$2('Incorrect invocation');
|
|
23684
23644
|
};
|
|
23685
23645
|
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
|
23686
23646
|
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
|
|
@@ -23701,12 +23661,9 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype
|
|
|
23701
23661
|
|
|
23702
23662
|
if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$2)) {
|
|
23703
23663
|
TYPED_ARRAY_TAG_REQUIRED = true;
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23707
|
-
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
23708
|
-
}
|
|
23709
|
-
});
|
|
23664
|
+
defineProperty$2(TypedArrayPrototype, TO_STRING_TAG$2, { get: function () {
|
|
23665
|
+
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
23666
|
+
} });
|
|
23710
23667
|
for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
|
|
23711
23668
|
createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
|
|
23712
23669
|
}
|
|
@@ -23730,7 +23687,7 @@ var aTypedArray$1 = arrayBufferViewCore.aTypedArray;
|
|
|
23730
23687
|
var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod;
|
|
23731
23688
|
|
|
23732
23689
|
// `%TypedArray%.prototype.at` method
|
|
23733
|
-
// https://
|
|
23690
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
23734
23691
|
exportTypedArrayMethod$1('at', function at(index) {
|
|
23735
23692
|
var O = aTypedArray$1(this);
|
|
23736
23693
|
var len = lengthOfArrayLike(O);
|
|
@@ -23756,7 +23713,7 @@ var IconWrapper = styled__default.div.withConfig({
|
|
|
23756
23713
|
var DropdownContentWrapper = styled__default.div.withConfig({
|
|
23757
23714
|
displayName: "Dropdown__DropdownContentWrapper",
|
|
23758
23715
|
componentId: "sc-pn6m0h-1"
|
|
23759
|
-
})(["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) {
|
|
23716
|
+
})(["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$1, function (_ref2) {
|
|
23760
23717
|
var widthFitOptions = _ref2.widthFitOptions;
|
|
23761
23718
|
return widthFitOptions ? "fit-content" : "100%";
|
|
23762
23719
|
}, function (_ref3) {
|
|
@@ -23769,7 +23726,7 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23769
23726
|
})(["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) {
|
|
23770
23727
|
var selected = _ref4.selected,
|
|
23771
23728
|
themeValues = _ref4.themeValues;
|
|
23772
|
-
return selected ? themeValues.selectedColor : WHITE;
|
|
23729
|
+
return selected ? themeValues.selectedColor : WHITE$1;
|
|
23773
23730
|
}, function (_ref5) {
|
|
23774
23731
|
var disabled = _ref5.disabled;
|
|
23775
23732
|
return disabled ? "default" : "pointer";
|
|
@@ -23777,12 +23734,12 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23777
23734
|
var selected = _ref6.selected,
|
|
23778
23735
|
disabled = _ref6.disabled,
|
|
23779
23736
|
themeValues = _ref6.themeValues;
|
|
23780
|
-
return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23737
|
+
return selected ? themeValues.selectedColor : disabled ? WHITE$1 : themeValues.hoverColor;
|
|
23781
23738
|
}, function (_ref7) {
|
|
23782
23739
|
var selected = _ref7.selected,
|
|
23783
23740
|
disabled = _ref7.disabled,
|
|
23784
23741
|
themeValues = _ref7.themeValues;
|
|
23785
|
-
return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23742
|
+
return selected ? themeValues.selectedColor : disabled ? WHITE$1 : themeValues.hoverColor;
|
|
23786
23743
|
});
|
|
23787
23744
|
|
|
23788
23745
|
var Dropdown = function Dropdown(_ref8) {
|
|
@@ -24036,7 +23993,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24036
23993
|
}, [filteredOptions]);
|
|
24037
23994
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
24038
23995
|
padding: "0",
|
|
24039
|
-
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
23996
|
+
background: isOpen ? themeValues.hoverColor : WHITE$1,
|
|
24040
23997
|
extraStyles: "position: relative;",
|
|
24041
23998
|
minWidth: "100%",
|
|
24042
23999
|
onClick: function onClick() {
|
|
@@ -24062,7 +24019,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24062
24019
|
"aria-expanded": isOpen,
|
|
24063
24020
|
"aria-required": options.required,
|
|
24064
24021
|
"aria-invalid": ariaInvalid,
|
|
24065
|
-
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
24022
|
+
background: isOpen ? themeValues.hoverColor : WHITE$1,
|
|
24066
24023
|
borderRadius: "2px",
|
|
24067
24024
|
borderSize: "1px",
|
|
24068
24025
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
@@ -24135,7 +24092,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24135
24092
|
}
|
|
24136
24093
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
24137
24094
|
variant: "p",
|
|
24138
|
-
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
24095
|
+
color: choice.value === value ? WHITE$1 : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
24139
24096
|
extraStyles: "padding-left: 16px;\n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;")
|
|
24140
24097
|
}, choice.text));
|
|
24141
24098
|
}))) : /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
@@ -24171,13 +24128,13 @@ var linkColor$1 = {
|
|
|
24171
24128
|
disabled: "".concat(MATISSE_BLUE)
|
|
24172
24129
|
};
|
|
24173
24130
|
var formBackgroundColor = {
|
|
24174
|
-
"default": "".concat(WHITE),
|
|
24175
|
-
disabled: "".concat(WHITE),
|
|
24131
|
+
"default": "".concat(WHITE$1),
|
|
24132
|
+
disabled: "".concat(WHITE$1),
|
|
24176
24133
|
checkout: "".concat(ATHENS_GREY),
|
|
24177
24134
|
collapsible: "".concat(ATHENS_GREY)
|
|
24178
24135
|
};
|
|
24179
24136
|
var inputBackgroundColor = {
|
|
24180
|
-
"default": "".concat(WHITE),
|
|
24137
|
+
"default": "".concat(WHITE$1),
|
|
24181
24138
|
disabled: "".concat(SEASHELL_WHITE)
|
|
24182
24139
|
};
|
|
24183
24140
|
var color$6 = {
|
|
@@ -25224,7 +25181,7 @@ var Detail = function Detail(_ref) {
|
|
|
25224
25181
|
|
|
25225
25182
|
var Detail$1 = themeComponent(Detail, "Detail", fallbacks$1, "regular");
|
|
25226
25183
|
|
|
25227
|
-
var backgroundColor$3 = WHITE;
|
|
25184
|
+
var backgroundColor$3 = WHITE$1;
|
|
25228
25185
|
var boxShadow = "0px 2px 14px 0px ".concat(ATHENS_GREY, ", 0px 3px 8px 0px ").concat(GHOST_GREY);
|
|
25229
25186
|
var fallbackValues$i = {
|
|
25230
25187
|
backgroundColor: backgroundColor$3,
|
|
@@ -25843,7 +25800,7 @@ var DisplayCard = function DisplayCard(_ref) {
|
|
|
25843
25800
|
padding: "24px",
|
|
25844
25801
|
borderSize: "1px",
|
|
25845
25802
|
borderRadius: "4px",
|
|
25846
|
-
background: WHITE,
|
|
25803
|
+
background: WHITE$1,
|
|
25847
25804
|
boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
|
|
25848
25805
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
25849
25806
|
justify: "space-between",
|
|
@@ -25873,13 +25830,13 @@ var linkColor$2 = {
|
|
|
25873
25830
|
disabled: "".concat(MATISSE_BLUE)
|
|
25874
25831
|
};
|
|
25875
25832
|
var formBackgroundColor$1 = {
|
|
25876
|
-
"default": "".concat(WHITE),
|
|
25877
|
-
disabled: "".concat(WHITE),
|
|
25833
|
+
"default": "".concat(WHITE$1),
|
|
25834
|
+
disabled: "".concat(WHITE$1),
|
|
25878
25835
|
checkout: "".concat(ATHENS_GREY),
|
|
25879
25836
|
collapsible: "".concat(ATHENS_GREY)
|
|
25880
25837
|
};
|
|
25881
25838
|
var inputBackgroundColor$1 = {
|
|
25882
|
-
"default": "".concat(WHITE),
|
|
25839
|
+
"default": "".concat(WHITE$1),
|
|
25883
25840
|
disabled: "".concat(SEASHELL_WHITE)
|
|
25884
25841
|
};
|
|
25885
25842
|
var color$7 = {
|
|
@@ -26682,7 +26639,7 @@ var LineItem = function LineItem(_ref) {
|
|
|
26682
26639
|
};
|
|
26683
26640
|
|
|
26684
26641
|
var visibleCustomAttrs = customAttributes === null || customAttributes === void 0 ? void 0 : (_customAttributes$fil = customAttributes.filter(function (attr) {
|
|
26685
|
-
return visibleFields.includes(attr.key) && attr.key !== "description";
|
|
26642
|
+
return (visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.includes(attr.key)) && attr.key !== "description";
|
|
26686
26643
|
})) === null || _customAttributes$fil === void 0 ? void 0 : _customAttributes$fil.map(function (attr) {
|
|
26687
26644
|
return /*#__PURE__*/React__default.createElement(Paragraph$1, {
|
|
26688
26645
|
variant: "pS",
|
|
@@ -27152,7 +27109,7 @@ var Placeholder = function Placeholder(_ref2) {
|
|
|
27152
27109
|
var Placeholder$1 = themeComponent(Placeholder, "Placeholder", fallbackValues$s, "default");
|
|
27153
27110
|
|
|
27154
27111
|
var backgroundColor$4 = {
|
|
27155
|
-
"default": "".concat(WHITE)
|
|
27112
|
+
"default": "".concat(WHITE$1)
|
|
27156
27113
|
};
|
|
27157
27114
|
var fallbackValues$t = {
|
|
27158
27115
|
backgroundColor: backgroundColor$4
|
|
@@ -27278,7 +27235,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27278
27235
|
var RadioButtonWithLabel$1 = themeComponent(RadioButtonWithLabel, "RadioButtonWithLabel", fallbackValues$u);
|
|
27279
27236
|
|
|
27280
27237
|
var activeColor$6 = "".concat(MATISSE_BLUE);
|
|
27281
|
-
var inactiveColor = "".concat(
|
|
27238
|
+
var inactiveColor = "".concat(GREY_CHATEAU);
|
|
27282
27239
|
var fallbackValues$v = {
|
|
27283
27240
|
activeColor: activeColor$6,
|
|
27284
27241
|
inactiveColor: inactiveColor
|
|
@@ -27311,21 +27268,19 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
27311
27268
|
var buttonBorder = {
|
|
27312
27269
|
onFocused: {
|
|
27313
27270
|
borderColor: themeValues.activeColor,
|
|
27314
|
-
|
|
27315
|
-
outlineOffset: "2px"
|
|
27271
|
+
boxShadow: "0px 0px 4px 0px ".concat(themeValues.activeColor)
|
|
27316
27272
|
},
|
|
27317
27273
|
offFocused: {
|
|
27318
27274
|
borderColor: themeValues.activeColor,
|
|
27319
|
-
|
|
27320
|
-
outlineOffset: "2px"
|
|
27275
|
+
boxShadow: "0px 0px 4px 0px ".concat(themeValues.activeColor)
|
|
27321
27276
|
},
|
|
27322
27277
|
on: {
|
|
27323
27278
|
borderColor: themeValues.activeColor,
|
|
27324
|
-
|
|
27279
|
+
boxShadow: "0px 0px 0px 0px #FFFFFF"
|
|
27325
27280
|
},
|
|
27326
27281
|
off: {
|
|
27327
27282
|
borderColor: themeValues.inactiveColor,
|
|
27328
|
-
|
|
27283
|
+
boxShadow: "0px 0px 0px 0px #FFFFFF"
|
|
27329
27284
|
}
|
|
27330
27285
|
};
|
|
27331
27286
|
var buttonCenter = {
|
|
@@ -27374,7 +27329,7 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
27374
27329
|
borderWidth: "1px",
|
|
27375
27330
|
borderStyle: "solid",
|
|
27376
27331
|
borderRadius: "12px",
|
|
27377
|
-
margin: "
|
|
27332
|
+
margin: "4px 14px 4px 4px",
|
|
27378
27333
|
height: "24px",
|
|
27379
27334
|
width: "24px",
|
|
27380
27335
|
variants: buttonBorder,
|
|
@@ -38075,7 +38030,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38075
38030
|
|
|
38076
38031
|
var onBackground = "".concat(MATISSE_BLUE);
|
|
38077
38032
|
var disabledBackground = "".concat(IRON_GREY);
|
|
38078
|
-
var white = "".concat(WHITE);
|
|
38033
|
+
var white = "".concat(WHITE$1);
|
|
38079
38034
|
var offBackground = "".concat(REGENT_GREY);
|
|
38080
38035
|
var labelStyles = "\n display: flex;\n justify-content: flex-start;\n align-items: center;\n";
|
|
38081
38036
|
var rightLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row;\n");
|
|
@@ -38259,7 +38214,7 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
38259
38214
|
var ToggleSwitch$1 = themeComponent(ToggleSwitch, "ToggleSwitch", fallbackValues$y);
|
|
38260
38215
|
|
|
38261
38216
|
var background$2 = "".concat(ATHENS_GREY);
|
|
38262
|
-
var white$1 = "".concat(WHITE);
|
|
38217
|
+
var white$1 = "".concat(WHITE$1);
|
|
38263
38218
|
var black = "#000";
|
|
38264
38219
|
var focusBorder = "".concat(MATISSE_BLUE);
|
|
38265
38220
|
var themeValues = {
|
|
@@ -38301,10 +38256,10 @@ var TypeaheadInput = function TypeaheadInput(_ref) {
|
|
|
38301
38256
|
}));
|
|
38302
38257
|
};
|
|
38303
38258
|
|
|
38304
|
-
var backgroundColor$5 = WHITE;
|
|
38259
|
+
var backgroundColor$5 = WHITE$1;
|
|
38305
38260
|
var imageBackgroundColor = INFO_BLUE;
|
|
38306
38261
|
var headerBackgroundColor = STORM_GREY;
|
|
38307
|
-
var headerColor = WHITE;
|
|
38262
|
+
var headerColor = WHITE$1;
|
|
38308
38263
|
var fallbackValues$z = {
|
|
38309
38264
|
backgroundColor: backgroundColor$5,
|
|
38310
38265
|
imageBackgroundColor: imageBackgroundColor,
|
|
@@ -38693,52 +38648,44 @@ var TableHeading_styled = styled__default.th.withConfig({
|
|
|
38693
38648
|
return extraStyles;
|
|
38694
38649
|
});
|
|
38695
38650
|
|
|
38696
|
-
const validatorToPredicate =
|
|
38697
|
-
|
|
38698
|
-
|
|
38699
|
-
|
|
38651
|
+
const validatorToPredicate = (validatorFn, emptyCase) => (
|
|
38652
|
+
value,
|
|
38653
|
+
...rest
|
|
38654
|
+
) => (value === "" ? emptyCase : validatorFn(value, ...rest));
|
|
38700
38655
|
|
|
38701
38656
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
38702
38657
|
|
|
38703
|
-
function getDefaultExportFromCjs (x) {
|
|
38704
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
38705
|
-
}
|
|
38706
|
-
|
|
38707
38658
|
var dayjs_min = {exports: {}};
|
|
38708
38659
|
|
|
38709
38660
|
(function (module, exports) {
|
|
38710
|
-
|
|
38711
|
-
}
|
|
38661
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
|
|
38662
|
+
}(dayjs_min));
|
|
38712
38663
|
|
|
38713
|
-
var
|
|
38714
|
-
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
38664
|
+
var dayjs = dayjs_min.exports;
|
|
38715
38665
|
|
|
38716
38666
|
var customParseFormat$1 = {exports: {}};
|
|
38717
38667
|
|
|
38718
38668
|
(function (module, exports) {
|
|
38719
|
-
|
|
38720
|
-
}
|
|
38669
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^\s\d-_:/()]+/,o={},s=function(t){return (t=+t)+(t>68?1900:2e3)};var a=function(t){return function(e){this[t]=+e;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t);}],u=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[i,function(t){this.afternoon=h(t,!1);}],a:[i,function(t){this.afternoon=h(t,!0);}],S:[/\d/,function(t){this.milliseconds=100*+t;}],SS:[n,function(t){this.milliseconds=10*+t;}],SSS:[/\d{3}/,function(t){this.milliseconds=+t;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.substr(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,f=0;f<a;f+=1){var u=s[f],h=d[u],c=h&&h[0],l=h&&h[1];s[f]=l?{regex:c,parser:l}:u.replace(/^\[|\]$/g,"");}return function(t){for(var e={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,u=t.substr(r),h=o.exec(u)[0];f.call(e,h),t=t.replace(h,"");}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon;}}(e),e}}return function(t,e,n){n.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(s=t.parseTwoDigitYear);var r=e.prototype,i=r.parse;r.parse=function(t){var e=t.date,r=t.utc,s=t.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],u=!0===s[3],h=f||u,d=s[2];u&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(t,e,n){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var r=c(e)(t),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,u=r.seconds,h=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=u||0,g=h||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(t){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),h&&e!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,t);};}}));
|
|
38670
|
+
}(customParseFormat$1));
|
|
38721
38671
|
|
|
38722
|
-
var
|
|
38723
|
-
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
38672
|
+
var customParseFormat = customParseFormat$1.exports;
|
|
38724
38673
|
|
|
38725
38674
|
var isSameOrBefore$1 = {exports: {}};
|
|
38726
38675
|
|
|
38727
38676
|
(function (module, exports) {
|
|
38728
|
-
|
|
38729
|
-
}
|
|
38677
|
+
!function(e,i){module.exports=i();}(commonjsGlobal$1,(function(){return function(e,i){i.prototype.isSameOrBefore=function(e,i){return this.isSame(e,i)||this.isBefore(e,i)};}}));
|
|
38678
|
+
}(isSameOrBefore$1));
|
|
38730
38679
|
|
|
38731
|
-
var
|
|
38732
|
-
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
38680
|
+
var isSameOrBefore = isSameOrBefore$1.exports;
|
|
38733
38681
|
|
|
38734
38682
|
var isSameOrAfter$1 = {exports: {}};
|
|
38735
38683
|
|
|
38736
38684
|
(function (module, exports) {
|
|
38737
|
-
|
|
38738
|
-
}
|
|
38685
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)};}}));
|
|
38686
|
+
}(isSameOrAfter$1));
|
|
38739
38687
|
|
|
38740
|
-
var
|
|
38741
|
-
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
38688
|
+
var isSameOrAfter = isSameOrAfter$1.exports;
|
|
38742
38689
|
|
|
38743
38690
|
/* eslint-disable no-unused-vars */
|
|
38744
38691
|
|
|
@@ -38754,24 +38701,24 @@ dayjs.extend(isSameOrAfter);
|
|
|
38754
38701
|
|
|
38755
38702
|
let validatorFns = {};
|
|
38756
38703
|
|
|
38757
|
-
const INCLUDED_IN =
|
|
38758
|
-
const INCLUDED_IN_ERROR =
|
|
38704
|
+
const INCLUDED_IN = "validator/INCLUDED_IN";
|
|
38705
|
+
const INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
38759
38706
|
const includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
38760
38707
|
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
38761
38708
|
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38762
38709
|
|
|
38763
|
-
const REQUIRED =
|
|
38764
|
-
const REQUIRED_ERROR =
|
|
38710
|
+
const REQUIRED = "validator/REQUIRED";
|
|
38711
|
+
const REQUIRED_ERROR = "error/REQUIRED";
|
|
38765
38712
|
const required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38766
|
-
validatorFns[REQUIRED] = (value, args, form) => value !==
|
|
38713
|
+
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
38767
38714
|
|
|
38768
|
-
const ONLY_INTEGERS =
|
|
38769
|
-
const ONLY_INTEGERS_ERROR =
|
|
38715
|
+
const ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
38716
|
+
const ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
38770
38717
|
const onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
38771
38718
|
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
38772
38719
|
|
|
38773
|
-
const ONLY_NATURALS =
|
|
38774
|
-
const ONLY_NATURALS_ERROR =
|
|
38720
|
+
const ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
38721
|
+
const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
38775
38722
|
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
38776
38723
|
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
38777
38724
|
|
|
@@ -38784,8 +38731,8 @@ not tested as validation function
|
|
|
38784
38731
|
to validate exp date instead use combo of:
|
|
38785
38732
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
38786
38733
|
*/
|
|
38787
|
-
const ONLY_EXPIRATION_DATE =
|
|
38788
|
-
const ONLY_EXPIRATION_DATE_ERROR =
|
|
38734
|
+
const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
38735
|
+
const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
38789
38736
|
const onlyExpirationDate = createValidator(
|
|
38790
38737
|
ONLY_EXPIRATION_DATE,
|
|
38791
38738
|
ONLY_EXPIRATION_DATE_ERROR
|
|
@@ -38793,63 +38740,64 @@ const onlyExpirationDate = createValidator(
|
|
|
38793
38740
|
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
|
|
38794
38741
|
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38795
38742
|
|
|
38796
|
-
const NUMBER_LESS_THAN =
|
|
38797
|
-
const NUMBER_LESS_THAN_ERROR =
|
|
38743
|
+
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
38744
|
+
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
38798
38745
|
const numberLessThan = createValidator(
|
|
38799
38746
|
NUMBER_LESS_THAN,
|
|
38800
38747
|
NUMBER_LESS_THAN_ERROR
|
|
38801
38748
|
);
|
|
38802
38749
|
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
38803
|
-
if (value ===
|
|
38750
|
+
if (value === "") {
|
|
38804
38751
|
return true;
|
|
38805
38752
|
}
|
|
38806
38753
|
return Number(value) < args[0];
|
|
38807
38754
|
};
|
|
38808
38755
|
|
|
38809
|
-
const NUMBER_LESS_THAN_OR_EQUAL_TO =
|
|
38756
|
+
const NUMBER_LESS_THAN_OR_EQUAL_TO =
|
|
38757
|
+
"validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38810
38758
|
const NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR =
|
|
38811
|
-
|
|
38759
|
+
"error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38812
38760
|
const numberLessThanOrEqualTo = createValidator(
|
|
38813
38761
|
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
38814
38762
|
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
38815
38763
|
);
|
|
38816
38764
|
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38817
|
-
if (value ===
|
|
38765
|
+
if (value === "") {
|
|
38818
38766
|
return true;
|
|
38819
38767
|
}
|
|
38820
38768
|
return Number(value) <= args[0];
|
|
38821
38769
|
};
|
|
38822
38770
|
|
|
38823
|
-
const NUMBER_GREATER_THAN =
|
|
38824
|
-
const NUMBER_GREATER_THAN_ERROR =
|
|
38771
|
+
const NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
38772
|
+
const NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
38825
38773
|
const numberGreaterThan = createValidator(
|
|
38826
38774
|
NUMBER_GREATER_THAN,
|
|
38827
38775
|
NUMBER_GREATER_THAN_ERROR
|
|
38828
38776
|
);
|
|
38829
38777
|
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
38830
|
-
if (value ===
|
|
38778
|
+
if (value === "") {
|
|
38831
38779
|
return true;
|
|
38832
38780
|
}
|
|
38833
38781
|
return Number(value) > args[0];
|
|
38834
38782
|
};
|
|
38835
38783
|
|
|
38836
38784
|
const NUMBER_GREATER_THAN_OR_EQUAL_TO =
|
|
38837
|
-
|
|
38785
|
+
"validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38838
38786
|
const NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR =
|
|
38839
|
-
|
|
38787
|
+
"error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38840
38788
|
const numberGreaterThanOrEqualTo = createValidator(
|
|
38841
38789
|
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
38842
38790
|
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
38843
38791
|
);
|
|
38844
38792
|
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38845
|
-
if (value ===
|
|
38793
|
+
if (value === "") {
|
|
38846
38794
|
return true;
|
|
38847
38795
|
}
|
|
38848
38796
|
return Number(value) >= args[0];
|
|
38849
38797
|
};
|
|
38850
38798
|
|
|
38851
|
-
const MATCHES_FIELD =
|
|
38852
|
-
const MATCHES_FIELD_ERROR$1 =
|
|
38799
|
+
const MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
38800
|
+
const MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
38853
38801
|
const matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
38854
38802
|
validatorFns[MATCHES_FIELD] = (value, args, form) => {
|
|
38855
38803
|
const dependentField = form[args[0]];
|
|
@@ -38862,7 +38810,7 @@ validatorFns[MATCHES_FIELD] = (value, args, form) => {
|
|
|
38862
38810
|
return value === dependentFieldValue;
|
|
38863
38811
|
};
|
|
38864
38812
|
|
|
38865
|
-
const validateWhenErrorMessage =
|
|
38813
|
+
const validateWhenErrorMessage = type =>
|
|
38866
38814
|
`${type} was passed to validateWhen, but that validator type does not exist.
|
|
38867
38815
|
Please check that you are only calling validator creator functions exported from
|
|
38868
38816
|
redux-freeform in your form config and that you didn't forget to
|
|
@@ -38870,21 +38818,25 @@ const validateWhenErrorMessage = (type) =>
|
|
|
38870
38818
|
createFormState). Also make sure you aren't passing validateWhen() to validateWhen
|
|
38871
38819
|
as the primary validator.`;
|
|
38872
38820
|
|
|
38873
|
-
const VALIDATE_WHEN =
|
|
38874
|
-
const VALIDATE_WHEN_ERROR =
|
|
38875
|
-
const validateWhen = (
|
|
38821
|
+
const VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
38822
|
+
const VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
38823
|
+
const validateWhen = (
|
|
38824
|
+
dependentValidator,
|
|
38825
|
+
primaryValidator,
|
|
38826
|
+
optionalFieldName
|
|
38827
|
+
) => ({
|
|
38876
38828
|
type: VALIDATE_WHEN,
|
|
38877
38829
|
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38878
|
-
error: dependentValidator.error
|
|
38830
|
+
error: dependentValidator.error
|
|
38879
38831
|
});
|
|
38880
38832
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
38881
38833
|
validatorFns[VALIDATE_WHEN] = (value, args, form) => {
|
|
38882
38834
|
const [dependentValidator, primaryValidator, optionalFieldName] = args;
|
|
38883
|
-
const dependsOnOtherField = typeof optionalFieldName ===
|
|
38835
|
+
const dependsOnOtherField = typeof optionalFieldName === "string";
|
|
38884
38836
|
|
|
38885
38837
|
if (
|
|
38886
38838
|
primaryValidator.type === undefined ||
|
|
38887
|
-
typeof validatorFns[primaryValidator.type] !==
|
|
38839
|
+
typeof validatorFns[primaryValidator.type] !== "function"
|
|
38888
38840
|
) {
|
|
38889
38841
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
38890
38842
|
}
|
|
@@ -38908,22 +38860,26 @@ validatorFns[VALIDATE_WHEN] = (value, args, form) => {
|
|
|
38908
38860
|
);
|
|
38909
38861
|
|
|
38910
38862
|
return primaryPredicatePassed
|
|
38911
|
-
? validatorFns[dependentValidator.type](
|
|
38863
|
+
? validatorFns[dependentValidator.type](
|
|
38864
|
+
value,
|
|
38865
|
+
dependentValidator.args,
|
|
38866
|
+
form
|
|
38867
|
+
)
|
|
38912
38868
|
: true;
|
|
38913
38869
|
};
|
|
38914
38870
|
|
|
38915
|
-
const validateSumErrorMessage =
|
|
38871
|
+
const validateSumErrorMessage = type =>
|
|
38916
38872
|
`${type} was passed to validateSum, but that validator type does not exist.
|
|
38917
38873
|
Please check that you are only calling validator creator functions exported from
|
|
38918
38874
|
redux-freeform in your form config and that you didn't forget to
|
|
38919
38875
|
invoke the validator creator (you cannot pass the functions themselves to
|
|
38920
38876
|
createFormState).`;
|
|
38921
|
-
const VALIDATE_SUM =
|
|
38922
|
-
const VALIDATE_SUM_ERROR =
|
|
38877
|
+
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38878
|
+
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38923
38879
|
const validateSum = (validator, fieldNamesArray) => ({
|
|
38924
38880
|
type: VALIDATE_SUM,
|
|
38925
38881
|
args: [validator, fieldNamesArray],
|
|
38926
|
-
error: validator.error
|
|
38882
|
+
error: validator.error
|
|
38927
38883
|
});
|
|
38928
38884
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
38929
38885
|
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
@@ -38931,7 +38887,7 @@ validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
|
38931
38887
|
|
|
38932
38888
|
if (
|
|
38933
38889
|
validator.type === undefined ||
|
|
38934
|
-
typeof validatorFns[validator.type] !==
|
|
38890
|
+
typeof validatorFns[validator.type] !== "function"
|
|
38935
38891
|
) {
|
|
38936
38892
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
38937
38893
|
}
|
|
@@ -38952,35 +38908,37 @@ validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
|
38952
38908
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
38953
38909
|
};
|
|
38954
38910
|
|
|
38955
|
-
const HAS_LENGTH =
|
|
38956
|
-
const HAS_LENGTH_ERROR =
|
|
38911
|
+
const HAS_LENGTH = "validator/HAS_LENGTH";
|
|
38912
|
+
const HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
38957
38913
|
const hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
38958
38914
|
validatorFns[HAS_LENGTH] = (value, args, form) => {
|
|
38959
|
-
if (value ===
|
|
38915
|
+
if (value === "") {
|
|
38960
38916
|
return true;
|
|
38961
38917
|
}
|
|
38962
38918
|
const min = args[0];
|
|
38963
38919
|
const max = args[1];
|
|
38964
38920
|
if (max == undefined || min == undefined) {
|
|
38965
38921
|
throw new Error(
|
|
38966
|
-
|
|
38922
|
+
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
38967
38923
|
);
|
|
38968
38924
|
}
|
|
38969
38925
|
if (max < min) {
|
|
38970
|
-
throw new Error(
|
|
38926
|
+
throw new Error(
|
|
38927
|
+
"hasLength validator was passed a min greater than the max"
|
|
38928
|
+
);
|
|
38971
38929
|
}
|
|
38972
38930
|
const valueLength = value.length;
|
|
38973
38931
|
return max >= valueLength && valueLength >= min;
|
|
38974
38932
|
};
|
|
38975
38933
|
|
|
38976
|
-
const DATE_BEFORE_TODAY =
|
|
38977
|
-
const DATE_BEFORE_TODAY_ERROR =
|
|
38934
|
+
const DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
38935
|
+
const DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
38978
38936
|
const dateBeforeToday = createValidator(
|
|
38979
38937
|
DATE_BEFORE_TODAY,
|
|
38980
38938
|
DATE_BEFORE_TODAY_ERROR
|
|
38981
38939
|
);
|
|
38982
38940
|
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
38983
|
-
if (value ===
|
|
38941
|
+
if (value === "") {
|
|
38984
38942
|
return true;
|
|
38985
38943
|
}
|
|
38986
38944
|
const dateFormat = args[0];
|
|
@@ -38989,7 +38947,7 @@ validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
|
38989
38947
|
|
|
38990
38948
|
if (dateFormat == undefined || unit == undefined) {
|
|
38991
38949
|
throw new Error(
|
|
38992
|
-
|
|
38950
|
+
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
38993
38951
|
);
|
|
38994
38952
|
}
|
|
38995
38953
|
const now = dayjs();
|
|
@@ -39001,14 +38959,14 @@ validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
|
39001
38959
|
return dateValue.isBefore(now, unit);
|
|
39002
38960
|
};
|
|
39003
38961
|
|
|
39004
|
-
const DATE_AFTER_TODAY =
|
|
39005
|
-
const DATE_AFTER_TODAY_ERROR =
|
|
38962
|
+
const DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
38963
|
+
const DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
39006
38964
|
const dateAfterToday = createValidator(
|
|
39007
38965
|
DATE_AFTER_TODAY,
|
|
39008
38966
|
DATE_AFTER_TODAY_ERROR
|
|
39009
38967
|
);
|
|
39010
38968
|
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
39011
|
-
if (value ===
|
|
38969
|
+
if (value === "") {
|
|
39012
38970
|
return true;
|
|
39013
38971
|
}
|
|
39014
38972
|
const dateFormat = args[0];
|
|
@@ -39017,7 +38975,7 @@ validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
|
39017
38975
|
|
|
39018
38976
|
if (dateFormat == undefined || unit == undefined) {
|
|
39019
38977
|
throw new Error(
|
|
39020
|
-
|
|
38978
|
+
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
39021
38979
|
);
|
|
39022
38980
|
}
|
|
39023
38981
|
const now = dayjs();
|
|
@@ -39029,11 +38987,14 @@ validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
|
39029
38987
|
return dateValue.isAfter(now, unit);
|
|
39030
38988
|
};
|
|
39031
38989
|
|
|
39032
|
-
const IS_VALID_MONTH =
|
|
39033
|
-
const IS_VALID_MONTH_ERROR =
|
|
39034
|
-
const isValidMonth = createValidator(
|
|
38990
|
+
const IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
38991
|
+
const IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
38992
|
+
const isValidMonth = createValidator(
|
|
38993
|
+
IS_VALID_MONTH,
|
|
38994
|
+
IS_VALID_MONTH_ERROR
|
|
38995
|
+
);
|
|
39035
38996
|
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
39036
|
-
if (value ===
|
|
38997
|
+
if (value === "") {
|
|
39037
38998
|
return true;
|
|
39038
38999
|
}
|
|
39039
39000
|
// Function takes one argument representing the character position
|
|
@@ -39043,43 +39004,43 @@ validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
|
39043
39004
|
// Only works with two digit months (01, 02, 03, etc)
|
|
39044
39005
|
const monthStartPosition = parseInt(args[0]);
|
|
39045
39006
|
const monthEndPosition = monthStartPosition + 2;
|
|
39046
|
-
if (
|
|
39047
|
-
throw new Error(
|
|
39007
|
+
if (monthStartPosition === NaN) {
|
|
39008
|
+
throw new Error("Month start position has to be a valid integer string");
|
|
39048
39009
|
}
|
|
39049
39010
|
const month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
39050
|
-
if (
|
|
39011
|
+
if (month === NaN) {
|
|
39051
39012
|
return false;
|
|
39052
39013
|
}
|
|
39053
39014
|
return month >= 1 && month <= 12;
|
|
39054
39015
|
};
|
|
39055
39016
|
|
|
39056
|
-
const MATCHES_REGEX =
|
|
39057
|
-
const MATCHES_REGEX_ERROR =
|
|
39017
|
+
const MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
39018
|
+
const MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
39058
39019
|
const matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
39059
39020
|
validatorFns[MATCHES_REGEX] = (value, args, form) => {
|
|
39060
|
-
if (value ===
|
|
39021
|
+
if (value === "") {
|
|
39061
39022
|
return true;
|
|
39062
39023
|
}
|
|
39063
39024
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
39064
39025
|
};
|
|
39065
39026
|
|
|
39066
39027
|
// based on http://www.brainjar.com/js/validation/
|
|
39067
|
-
const IS_ROUTING_NUMBER =
|
|
39068
|
-
const IS_ROUTING_NUMBER_ERROR =
|
|
39028
|
+
const IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
39029
|
+
const IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
39069
39030
|
const isRoutingNumber = createValidator(
|
|
39070
39031
|
IS_ROUTING_NUMBER,
|
|
39071
39032
|
IS_ROUTING_NUMBER_ERROR
|
|
39072
39033
|
);
|
|
39073
39034
|
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
39074
|
-
if (value ===
|
|
39035
|
+
if (value === "") {
|
|
39075
39036
|
return true;
|
|
39076
39037
|
}
|
|
39077
39038
|
if (value.length != 9) {
|
|
39078
39039
|
return false;
|
|
39079
39040
|
}
|
|
39080
39041
|
const sum = value
|
|
39081
|
-
.split(
|
|
39082
|
-
.map(
|
|
39042
|
+
.split("")
|
|
39043
|
+
.map(ch => parseInt(ch))
|
|
39083
39044
|
.reduce((acc, cur, idx) => {
|
|
39084
39045
|
switch (idx % 3) {
|
|
39085
39046
|
case 0:
|
|
@@ -39093,69 +39054,69 @@ validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
|
39093
39054
|
return sum != 0 && sum % 10 == 0;
|
|
39094
39055
|
};
|
|
39095
39056
|
|
|
39096
|
-
const HAS_NUMBER =
|
|
39097
|
-
const HAS_NUMBER_ERROR$1 =
|
|
39057
|
+
const HAS_NUMBER = "validator/HAS_NUMBER";
|
|
39058
|
+
const HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
39098
39059
|
const hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
39099
39060
|
validatorFns[HAS_NUMBER] = (value, args, form) => {
|
|
39100
|
-
if (value ===
|
|
39061
|
+
if (value === "") {
|
|
39101
39062
|
return true;
|
|
39102
39063
|
}
|
|
39103
39064
|
return new RegExp(/[0-9]/).test(value);
|
|
39104
39065
|
};
|
|
39105
39066
|
|
|
39106
|
-
const HAS_LOWERCASE_LETTER =
|
|
39107
|
-
const HAS_LOWERCASE_LETTER_ERROR$1 =
|
|
39067
|
+
const HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
39068
|
+
const HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
39108
39069
|
const hasLowercaseLetter = createValidator(
|
|
39109
39070
|
HAS_LOWERCASE_LETTER,
|
|
39110
39071
|
HAS_LOWERCASE_LETTER_ERROR$1
|
|
39111
39072
|
);
|
|
39112
39073
|
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
39113
|
-
if (value ===
|
|
39074
|
+
if (value === "") {
|
|
39114
39075
|
return true;
|
|
39115
39076
|
}
|
|
39116
39077
|
return new RegExp(/[a-z]/).test(value);
|
|
39117
39078
|
};
|
|
39118
39079
|
|
|
39119
|
-
const HAS_UPPERCASE_LETTER =
|
|
39120
|
-
const HAS_UPPERCASE_LETTER_ERROR$1 =
|
|
39080
|
+
const HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
39081
|
+
const HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
39121
39082
|
const hasUppercaseLetter = createValidator(
|
|
39122
39083
|
HAS_UPPERCASE_LETTER,
|
|
39123
39084
|
HAS_UPPERCASE_LETTER_ERROR$1
|
|
39124
39085
|
);
|
|
39125
39086
|
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
39126
|
-
if (value ===
|
|
39087
|
+
if (value === "") {
|
|
39127
39088
|
return true;
|
|
39128
39089
|
}
|
|
39129
39090
|
return new RegExp(/[A-Z]/).test(value);
|
|
39130
39091
|
};
|
|
39131
39092
|
|
|
39132
|
-
const HAS_SPECIAL_CHARACTER =
|
|
39133
|
-
const HAS_SPECIAL_CHARACTER_ERROR$1 =
|
|
39093
|
+
const HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
39094
|
+
const HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
39134
39095
|
const hasSpecialCharacter = createValidator(
|
|
39135
39096
|
HAS_SPECIAL_CHARACTER,
|
|
39136
39097
|
HAS_SPECIAL_CHARACTER_ERROR$1
|
|
39137
39098
|
);
|
|
39138
39099
|
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
39139
|
-
if (value ===
|
|
39100
|
+
if (value === "") {
|
|
39140
39101
|
return true;
|
|
39141
39102
|
}
|
|
39142
39103
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
39143
39104
|
};
|
|
39144
39105
|
|
|
39145
|
-
const IS_PROBABLY_EMAIL =
|
|
39146
|
-
const IS_PROBABLY_EMAIL_ERROR =
|
|
39106
|
+
const IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
39107
|
+
const IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
39147
39108
|
const isProbablyEmail = createValidator(
|
|
39148
39109
|
IS_PROBABLY_EMAIL,
|
|
39149
39110
|
IS_PROBABLY_EMAIL_ERROR
|
|
39150
39111
|
);
|
|
39151
39112
|
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
39152
|
-
if (value ===
|
|
39113
|
+
if (value === "") {
|
|
39153
39114
|
return true;
|
|
39154
39115
|
}
|
|
39155
39116
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
39156
39117
|
};
|
|
39157
39118
|
|
|
39158
|
-
const runValidatorErrorMessage =
|
|
39119
|
+
const runValidatorErrorMessage = type =>
|
|
39159
39120
|
`${type} was passed to runValidator, but that validator type does not exist.
|
|
39160
39121
|
Please check that you are only calling validator creator functions exported from
|
|
39161
39122
|
redux-freeform in your form config and that you didn't forget to
|
|
@@ -39170,53 +39131,1165 @@ const runValidator = (validator, value, form) => {
|
|
|
39170
39131
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
39171
39132
|
};
|
|
39172
39133
|
|
|
39173
|
-
const
|
|
39134
|
+
const _computeErrors = (fieldName, form, validators) => {
|
|
39174
39135
|
return validators
|
|
39175
|
-
.map(
|
|
39176
|
-
.filter(
|
|
39136
|
+
.map(v => runValidator(v, form[fieldName].rawValue, form))
|
|
39137
|
+
.filter(x => x !== null);
|
|
39177
39138
|
};
|
|
39178
39139
|
|
|
39179
39140
|
const computeConstraints = (fieldName, form) => {
|
|
39180
39141
|
const constraints = form[fieldName].constraints;
|
|
39181
|
-
return
|
|
39142
|
+
return _computeErrors(fieldName, form, constraints);
|
|
39182
39143
|
};
|
|
39183
39144
|
|
|
39184
39145
|
const computeErrors = (fieldName, form) => {
|
|
39185
39146
|
const validators = form[fieldName].validators;
|
|
39186
|
-
return
|
|
39147
|
+
return _computeErrors(fieldName, form, validators);
|
|
39148
|
+
};
|
|
39149
|
+
|
|
39150
|
+
var obj;
|
|
39151
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : ( obj = {}, obj["immer-nothing"] = true, obj );
|
|
39152
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol.for ? Symbol.for("immer-draftable") : "__$immer_draftable";
|
|
39153
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol.for ? Symbol.for("immer-state") : "__$immer_state";
|
|
39154
|
+
function isDraft(value) {
|
|
39155
|
+
return !!value && !!value[DRAFT_STATE];
|
|
39156
|
+
}
|
|
39157
|
+
function isDraftable(value) {
|
|
39158
|
+
if (!value) { return false; }
|
|
39159
|
+
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
39160
|
+
}
|
|
39161
|
+
function isPlainObject(value) {
|
|
39162
|
+
if (!value || typeof value !== "object") { return false; }
|
|
39163
|
+
if (Array.isArray(value)) { return true; }
|
|
39164
|
+
var proto = Object.getPrototypeOf(value);
|
|
39165
|
+
return !proto || proto === Object.prototype;
|
|
39166
|
+
}
|
|
39167
|
+
var assign = Object.assign || function assign(target, value) {
|
|
39168
|
+
for (var key in value) {
|
|
39169
|
+
if (has$1(value, key)) {
|
|
39170
|
+
target[key] = value[key];
|
|
39171
|
+
}
|
|
39172
|
+
}
|
|
39173
|
+
|
|
39174
|
+
return target;
|
|
39175
|
+
};
|
|
39176
|
+
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;
|
|
39177
|
+
function shallowCopy(base, invokeGetters) {
|
|
39178
|
+
if ( invokeGetters === void 0 ) invokeGetters = false;
|
|
39179
|
+
|
|
39180
|
+
if (Array.isArray(base)) { return base.slice(); }
|
|
39181
|
+
var clone = Object.create(Object.getPrototypeOf(base));
|
|
39182
|
+
ownKeys$2(base).forEach(function (key) {
|
|
39183
|
+
if (key === DRAFT_STATE) {
|
|
39184
|
+
return; // Never copy over draft state.
|
|
39185
|
+
}
|
|
39186
|
+
|
|
39187
|
+
var desc = Object.getOwnPropertyDescriptor(base, key);
|
|
39188
|
+
var value = desc.value;
|
|
39189
|
+
|
|
39190
|
+
if (desc.get) {
|
|
39191
|
+
if (!invokeGetters) {
|
|
39192
|
+
throw new Error("Immer drafts cannot have computed properties");
|
|
39193
|
+
}
|
|
39194
|
+
|
|
39195
|
+
value = desc.get.call(base);
|
|
39196
|
+
}
|
|
39197
|
+
|
|
39198
|
+
if (desc.enumerable) {
|
|
39199
|
+
clone[key] = value;
|
|
39200
|
+
} else {
|
|
39201
|
+
Object.defineProperty(clone, key, {
|
|
39202
|
+
value: value,
|
|
39203
|
+
writable: true,
|
|
39204
|
+
configurable: true
|
|
39205
|
+
});
|
|
39206
|
+
}
|
|
39207
|
+
});
|
|
39208
|
+
return clone;
|
|
39209
|
+
}
|
|
39210
|
+
function each(value, cb) {
|
|
39211
|
+
if (Array.isArray(value)) {
|
|
39212
|
+
for (var i = 0; i < value.length; i++) { cb(i, value[i], value); }
|
|
39213
|
+
} else {
|
|
39214
|
+
ownKeys$2(value).forEach(function (key) { return cb(key, value[key], value); });
|
|
39215
|
+
}
|
|
39216
|
+
}
|
|
39217
|
+
function isEnumerable(base, prop) {
|
|
39218
|
+
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
39219
|
+
return !!desc && desc.enumerable;
|
|
39220
|
+
}
|
|
39221
|
+
function has$1(thing, prop) {
|
|
39222
|
+
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
39223
|
+
}
|
|
39224
|
+
function is(x, y) {
|
|
39225
|
+
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
39226
|
+
if (x === y) {
|
|
39227
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
39228
|
+
} else {
|
|
39229
|
+
return x !== x && y !== y;
|
|
39230
|
+
}
|
|
39231
|
+
}
|
|
39232
|
+
function clone(obj) {
|
|
39233
|
+
if (!isDraftable(obj)) { return obj; }
|
|
39234
|
+
if (Array.isArray(obj)) { return obj.map(clone); }
|
|
39235
|
+
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
39236
|
+
|
|
39237
|
+
for (var key in obj) { cloned[key] = clone(obj[key]); }
|
|
39238
|
+
|
|
39239
|
+
return cloned;
|
|
39240
|
+
}
|
|
39241
|
+
|
|
39242
|
+
/** Each scope represents a `produce` call. */
|
|
39243
|
+
|
|
39244
|
+
var ImmerScope = function ImmerScope(parent) {
|
|
39245
|
+
this.drafts = [];
|
|
39246
|
+
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
39247
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
39248
|
+
|
|
39249
|
+
this.canAutoFreeze = true; // To avoid prototype lookups:
|
|
39250
|
+
|
|
39251
|
+
this.patches = null;
|
|
39252
|
+
};
|
|
39253
|
+
|
|
39254
|
+
ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
39255
|
+
if (patchListener) {
|
|
39256
|
+
this.patches = [];
|
|
39257
|
+
this.inversePatches = [];
|
|
39258
|
+
this.patchListener = patchListener;
|
|
39259
|
+
}
|
|
39260
|
+
};
|
|
39261
|
+
|
|
39262
|
+
ImmerScope.prototype.revoke = function revoke$1 () {
|
|
39263
|
+
this.leave();
|
|
39264
|
+
this.drafts.forEach(revoke);
|
|
39265
|
+
this.drafts = null; // Make draft-related methods throw.
|
|
39266
|
+
};
|
|
39267
|
+
|
|
39268
|
+
ImmerScope.prototype.leave = function leave () {
|
|
39269
|
+
if (this === ImmerScope.current) {
|
|
39270
|
+
ImmerScope.current = this.parent;
|
|
39271
|
+
}
|
|
39272
|
+
};
|
|
39273
|
+
ImmerScope.current = null;
|
|
39274
|
+
|
|
39275
|
+
ImmerScope.enter = function () {
|
|
39276
|
+
return this.current = new ImmerScope(this.current);
|
|
39277
|
+
};
|
|
39278
|
+
|
|
39279
|
+
function revoke(draft) {
|
|
39280
|
+
draft[DRAFT_STATE].revoke();
|
|
39281
|
+
}
|
|
39282
|
+
|
|
39283
|
+
// but share them all instead
|
|
39284
|
+
|
|
39285
|
+
var descriptors$1 = {};
|
|
39286
|
+
function willFinalize(scope, result, isReplaced) {
|
|
39287
|
+
scope.drafts.forEach(function (draft) {
|
|
39288
|
+
draft[DRAFT_STATE].finalizing = true;
|
|
39289
|
+
});
|
|
39290
|
+
|
|
39291
|
+
if (!isReplaced) {
|
|
39292
|
+
if (scope.patches) {
|
|
39293
|
+
markChangesRecursively(scope.drafts[0]);
|
|
39294
|
+
} // This is faster when we don't care about which attributes changed.
|
|
39295
|
+
|
|
39296
|
+
|
|
39297
|
+
markChangesSweep(scope.drafts);
|
|
39298
|
+
} // When a child draft is returned, look for changes.
|
|
39299
|
+
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
39300
|
+
markChangesSweep(scope.drafts);
|
|
39301
|
+
}
|
|
39302
|
+
}
|
|
39303
|
+
function createProxy(base, parent) {
|
|
39304
|
+
var isArray = Array.isArray(base);
|
|
39305
|
+
var draft = clonePotentialDraft(base);
|
|
39306
|
+
each(draft, function (prop) {
|
|
39307
|
+
proxyProperty(draft, prop, isArray || isEnumerable(base, prop));
|
|
39308
|
+
}); // See "proxy.js" for property documentation.
|
|
39309
|
+
|
|
39310
|
+
var scope = parent ? parent.scope : ImmerScope.current;
|
|
39311
|
+
var state = {
|
|
39312
|
+
scope: scope,
|
|
39313
|
+
modified: false,
|
|
39314
|
+
finalizing: false,
|
|
39315
|
+
// es5 only
|
|
39316
|
+
finalized: false,
|
|
39317
|
+
assigned: {},
|
|
39318
|
+
parent: parent,
|
|
39319
|
+
base: base,
|
|
39320
|
+
draft: draft,
|
|
39321
|
+
copy: null,
|
|
39322
|
+
revoke: revoke$1,
|
|
39323
|
+
revoked: false // es5 only
|
|
39324
|
+
|
|
39325
|
+
};
|
|
39326
|
+
createHiddenProperty(draft, DRAFT_STATE, state);
|
|
39327
|
+
scope.drafts.push(draft);
|
|
39328
|
+
return draft;
|
|
39329
|
+
}
|
|
39330
|
+
|
|
39331
|
+
function revoke$1() {
|
|
39332
|
+
this.revoked = true;
|
|
39333
|
+
}
|
|
39334
|
+
|
|
39335
|
+
function source(state) {
|
|
39336
|
+
return state.copy || state.base;
|
|
39337
|
+
} // Access a property without creating an Immer draft.
|
|
39338
|
+
|
|
39339
|
+
|
|
39340
|
+
function peek(draft, prop) {
|
|
39341
|
+
var state = draft[DRAFT_STATE];
|
|
39342
|
+
|
|
39343
|
+
if (state && !state.finalizing) {
|
|
39344
|
+
state.finalizing = true;
|
|
39345
|
+
var value = draft[prop];
|
|
39346
|
+
state.finalizing = false;
|
|
39347
|
+
return value;
|
|
39348
|
+
}
|
|
39349
|
+
|
|
39350
|
+
return draft[prop];
|
|
39351
|
+
}
|
|
39352
|
+
|
|
39353
|
+
function get$1(state, prop) {
|
|
39354
|
+
assertUnrevoked(state);
|
|
39355
|
+
var value = peek(source(state), prop);
|
|
39356
|
+
if (state.finalizing) { return value; } // Create a draft if the value is unmodified.
|
|
39357
|
+
|
|
39358
|
+
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
39359
|
+
prepareCopy(state);
|
|
39360
|
+
return state.copy[prop] = createProxy(value, state);
|
|
39361
|
+
}
|
|
39362
|
+
|
|
39363
|
+
return value;
|
|
39364
|
+
}
|
|
39365
|
+
|
|
39366
|
+
function set$1(state, prop, value) {
|
|
39367
|
+
assertUnrevoked(state);
|
|
39368
|
+
state.assigned[prop] = true;
|
|
39369
|
+
|
|
39370
|
+
if (!state.modified) {
|
|
39371
|
+
if (is(value, peek(source(state), prop))) { return; }
|
|
39372
|
+
markChanged(state);
|
|
39373
|
+
prepareCopy(state);
|
|
39374
|
+
}
|
|
39375
|
+
|
|
39376
|
+
state.copy[prop] = value;
|
|
39377
|
+
}
|
|
39378
|
+
|
|
39379
|
+
function markChanged(state) {
|
|
39380
|
+
if (!state.modified) {
|
|
39381
|
+
state.modified = true;
|
|
39382
|
+
if (state.parent) { markChanged(state.parent); }
|
|
39383
|
+
}
|
|
39384
|
+
}
|
|
39385
|
+
|
|
39386
|
+
function prepareCopy(state) {
|
|
39387
|
+
if (!state.copy) { state.copy = clonePotentialDraft(state.base); }
|
|
39388
|
+
}
|
|
39389
|
+
|
|
39390
|
+
function clonePotentialDraft(base) {
|
|
39391
|
+
var state = base && base[DRAFT_STATE];
|
|
39392
|
+
|
|
39393
|
+
if (state) {
|
|
39394
|
+
state.finalizing = true;
|
|
39395
|
+
var draft = shallowCopy(state.draft, true);
|
|
39396
|
+
state.finalizing = false;
|
|
39397
|
+
return draft;
|
|
39398
|
+
}
|
|
39399
|
+
|
|
39400
|
+
return shallowCopy(base);
|
|
39401
|
+
}
|
|
39402
|
+
|
|
39403
|
+
function proxyProperty(draft, prop, enumerable) {
|
|
39404
|
+
var desc = descriptors$1[prop];
|
|
39405
|
+
|
|
39406
|
+
if (desc) {
|
|
39407
|
+
desc.enumerable = enumerable;
|
|
39408
|
+
} else {
|
|
39409
|
+
descriptors$1[prop] = desc = {
|
|
39410
|
+
configurable: true,
|
|
39411
|
+
enumerable: enumerable,
|
|
39412
|
+
|
|
39413
|
+
get: function get$1$1() {
|
|
39414
|
+
return get$1(this[DRAFT_STATE], prop);
|
|
39415
|
+
},
|
|
39416
|
+
|
|
39417
|
+
set: function set$1$1(value) {
|
|
39418
|
+
set$1(this[DRAFT_STATE], prop, value);
|
|
39419
|
+
}
|
|
39420
|
+
|
|
39421
|
+
};
|
|
39422
|
+
}
|
|
39423
|
+
|
|
39424
|
+
Object.defineProperty(draft, prop, desc);
|
|
39425
|
+
}
|
|
39426
|
+
|
|
39427
|
+
function assertUnrevoked(state) {
|
|
39428
|
+
if (state.revoked === true) { throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state))); }
|
|
39429
|
+
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
39430
|
+
|
|
39431
|
+
|
|
39432
|
+
function markChangesSweep(drafts) {
|
|
39433
|
+
// The natural order of drafts in the `scope` array is based on when they
|
|
39434
|
+
// were accessed. By processing drafts in reverse natural order, we have a
|
|
39435
|
+
// better chance of processing leaf nodes first. When a leaf node is known to
|
|
39436
|
+
// have changed, we can avoid any traversal of its ancestor nodes.
|
|
39437
|
+
for (var i = drafts.length - 1; i >= 0; i--) {
|
|
39438
|
+
var state = drafts[i][DRAFT_STATE];
|
|
39439
|
+
|
|
39440
|
+
if (!state.modified) {
|
|
39441
|
+
if (Array.isArray(state.base)) {
|
|
39442
|
+
if (hasArrayChanges(state)) { markChanged(state); }
|
|
39443
|
+
} else if (hasObjectChanges(state)) { markChanged(state); }
|
|
39444
|
+
}
|
|
39445
|
+
}
|
|
39446
|
+
}
|
|
39447
|
+
|
|
39448
|
+
function markChangesRecursively(object) {
|
|
39449
|
+
if (!object || typeof object !== "object") { return; }
|
|
39450
|
+
var state = object[DRAFT_STATE];
|
|
39451
|
+
if (!state) { return; }
|
|
39452
|
+
var base = state.base;
|
|
39453
|
+
var draft = state.draft;
|
|
39454
|
+
var assigned = state.assigned;
|
|
39455
|
+
|
|
39456
|
+
if (!Array.isArray(object)) {
|
|
39457
|
+
// Look for added keys.
|
|
39458
|
+
Object.keys(draft).forEach(function (key) {
|
|
39459
|
+
// The `undefined` check is a fast path for pre-existing keys.
|
|
39460
|
+
if (base[key] === undefined && !has$1(base, key)) {
|
|
39461
|
+
assigned[key] = true;
|
|
39462
|
+
markChanged(state);
|
|
39463
|
+
} else if (!assigned[key]) {
|
|
39464
|
+
// Only untouched properties trigger recursion.
|
|
39465
|
+
markChangesRecursively(draft[key]);
|
|
39466
|
+
}
|
|
39467
|
+
}); // Look for removed keys.
|
|
39468
|
+
|
|
39469
|
+
Object.keys(base).forEach(function (key) {
|
|
39470
|
+
// The `undefined` check is a fast path for pre-existing keys.
|
|
39471
|
+
if (draft[key] === undefined && !has$1(draft, key)) {
|
|
39472
|
+
assigned[key] = false;
|
|
39473
|
+
markChanged(state);
|
|
39474
|
+
}
|
|
39475
|
+
});
|
|
39476
|
+
} else if (hasArrayChanges(state)) {
|
|
39477
|
+
markChanged(state);
|
|
39478
|
+
assigned.length = true;
|
|
39479
|
+
|
|
39480
|
+
if (draft.length < base.length) {
|
|
39481
|
+
for (var i = draft.length; i < base.length; i++) { assigned[i] = false; }
|
|
39482
|
+
} else {
|
|
39483
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) { assigned[i$1] = true; }
|
|
39484
|
+
}
|
|
39485
|
+
|
|
39486
|
+
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
39487
|
+
// Only untouched indices trigger recursion.
|
|
39488
|
+
if (assigned[i$2] === undefined) { markChangesRecursively(draft[i$2]); }
|
|
39489
|
+
}
|
|
39490
|
+
}
|
|
39491
|
+
}
|
|
39492
|
+
|
|
39493
|
+
function hasObjectChanges(state) {
|
|
39494
|
+
var base = state.base;
|
|
39495
|
+
var draft = state.draft; // Search for added keys and changed keys. Start at the back, because
|
|
39496
|
+
// non-numeric keys are ordered by time of definition on the object.
|
|
39497
|
+
|
|
39498
|
+
var keys = Object.keys(draft);
|
|
39499
|
+
|
|
39500
|
+
for (var i = keys.length - 1; i >= 0; i--) {
|
|
39501
|
+
var key = keys[i];
|
|
39502
|
+
var baseValue = base[key]; // The `undefined` check is a fast path for pre-existing keys.
|
|
39503
|
+
|
|
39504
|
+
if (baseValue === undefined && !has$1(base, key)) {
|
|
39505
|
+
return true;
|
|
39506
|
+
} // Once a base key is deleted, future changes go undetected, because its
|
|
39507
|
+
// descriptor is erased. This branch detects any missed changes.
|
|
39508
|
+
else {
|
|
39509
|
+
var value = draft[key];
|
|
39510
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
39511
|
+
|
|
39512
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
39513
|
+
return true;
|
|
39514
|
+
}
|
|
39515
|
+
}
|
|
39516
|
+
} // At this point, no keys were added or changed.
|
|
39517
|
+
// Compare key count to determine if keys were deleted.
|
|
39518
|
+
|
|
39519
|
+
|
|
39520
|
+
return keys.length !== Object.keys(base).length;
|
|
39521
|
+
}
|
|
39522
|
+
|
|
39523
|
+
function hasArrayChanges(state) {
|
|
39524
|
+
var draft = state.draft;
|
|
39525
|
+
if (draft.length !== state.base.length) { return true; } // See #116
|
|
39526
|
+
// If we first shorten the length, our array interceptors will be removed.
|
|
39527
|
+
// If after that new items are added, result in the same original length,
|
|
39528
|
+
// those last items will have no intercepting property.
|
|
39529
|
+
// So if there is no own descriptor on the last position, we know that items were removed and added
|
|
39530
|
+
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
39531
|
+
// the last one
|
|
39532
|
+
|
|
39533
|
+
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
39534
|
+
|
|
39535
|
+
if (descriptor && !descriptor.get) { return true; } // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
39536
|
+
|
|
39537
|
+
return false;
|
|
39538
|
+
}
|
|
39539
|
+
|
|
39540
|
+
function createHiddenProperty(target, prop, value) {
|
|
39541
|
+
Object.defineProperty(target, prop, {
|
|
39542
|
+
value: value,
|
|
39543
|
+
enumerable: false,
|
|
39544
|
+
writable: true
|
|
39545
|
+
});
|
|
39546
|
+
}
|
|
39547
|
+
|
|
39548
|
+
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
39549
|
+
willFinalize: willFinalize,
|
|
39550
|
+
createProxy: createProxy
|
|
39551
|
+
});
|
|
39552
|
+
|
|
39553
|
+
function willFinalize$1() {}
|
|
39554
|
+
function createProxy$1(base, parent) {
|
|
39555
|
+
var scope = parent ? parent.scope : ImmerScope.current;
|
|
39556
|
+
var state = {
|
|
39557
|
+
// Track which produce call this is associated with.
|
|
39558
|
+
scope: scope,
|
|
39559
|
+
// True for both shallow and deep changes.
|
|
39560
|
+
modified: false,
|
|
39561
|
+
// Used during finalization.
|
|
39562
|
+
finalized: false,
|
|
39563
|
+
// Track which properties have been assigned (true) or deleted (false).
|
|
39564
|
+
assigned: {},
|
|
39565
|
+
// The parent draft state.
|
|
39566
|
+
parent: parent,
|
|
39567
|
+
// The base state.
|
|
39568
|
+
base: base,
|
|
39569
|
+
// The base proxy.
|
|
39570
|
+
draft: null,
|
|
39571
|
+
// Any property proxies.
|
|
39572
|
+
drafts: {},
|
|
39573
|
+
// The base copy with any updated values.
|
|
39574
|
+
copy: null,
|
|
39575
|
+
// Called by the `produce` function.
|
|
39576
|
+
revoke: null
|
|
39577
|
+
};
|
|
39578
|
+
var ref = Array.isArray(base) ? // [state] is used for arrays, to make sure the proxy is array-ish and not violate invariants,
|
|
39579
|
+
// although state itself is an object
|
|
39580
|
+
Proxy.revocable([state], arrayTraps) : Proxy.revocable(state, objectTraps);
|
|
39581
|
+
var revoke = ref.revoke;
|
|
39582
|
+
var proxy = ref.proxy;
|
|
39583
|
+
state.draft = proxy;
|
|
39584
|
+
state.revoke = revoke;
|
|
39585
|
+
scope.drafts.push(proxy);
|
|
39586
|
+
return proxy;
|
|
39587
|
+
}
|
|
39588
|
+
var objectTraps = {
|
|
39589
|
+
get: get$1$1,
|
|
39590
|
+
|
|
39591
|
+
has: function has(target, prop) {
|
|
39592
|
+
return prop in source$1(target);
|
|
39593
|
+
},
|
|
39594
|
+
|
|
39595
|
+
ownKeys: function ownKeys(target) {
|
|
39596
|
+
return Reflect.ownKeys(source$1(target));
|
|
39597
|
+
},
|
|
39598
|
+
|
|
39599
|
+
set: set$1$1,
|
|
39600
|
+
deleteProperty: deleteProperty,
|
|
39601
|
+
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
39602
|
+
|
|
39603
|
+
defineProperty: function defineProperty() {
|
|
39604
|
+
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
39605
|
+
},
|
|
39606
|
+
|
|
39607
|
+
getPrototypeOf: function getPrototypeOf(target) {
|
|
39608
|
+
return Object.getPrototypeOf(target.base);
|
|
39609
|
+
},
|
|
39610
|
+
|
|
39611
|
+
setPrototypeOf: function setPrototypeOf() {
|
|
39612
|
+
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
39613
|
+
}
|
|
39614
|
+
|
|
39615
|
+
};
|
|
39616
|
+
var arrayTraps = {};
|
|
39617
|
+
each(objectTraps, function (key, fn) {
|
|
39618
|
+
arrayTraps[key] = function () {
|
|
39619
|
+
arguments[0] = arguments[0][0];
|
|
39620
|
+
return fn.apply(this, arguments);
|
|
39621
|
+
};
|
|
39622
|
+
});
|
|
39623
|
+
|
|
39624
|
+
arrayTraps.deleteProperty = function (state, prop) {
|
|
39625
|
+
if (isNaN(parseInt(prop))) {
|
|
39626
|
+
throw new Error("Immer only supports deleting array indices"); // prettier-ignore
|
|
39627
|
+
}
|
|
39628
|
+
|
|
39629
|
+
return objectTraps.deleteProperty.call(this, state[0], prop);
|
|
39630
|
+
};
|
|
39631
|
+
|
|
39632
|
+
arrayTraps.set = function (state, prop, value) {
|
|
39633
|
+
if (prop !== "length" && isNaN(parseInt(prop))) {
|
|
39634
|
+
throw new Error("Immer only supports setting array indices and the 'length' property"); // prettier-ignore
|
|
39635
|
+
}
|
|
39636
|
+
|
|
39637
|
+
return objectTraps.set.call(this, state[0], prop, value);
|
|
39638
|
+
}; // returns the object we should be reading the current value from, which is base, until some change has been made
|
|
39639
|
+
|
|
39640
|
+
|
|
39641
|
+
function source$1(state) {
|
|
39642
|
+
return state.copy || state.base;
|
|
39643
|
+
} // Access a property without creating an Immer draft.
|
|
39644
|
+
|
|
39645
|
+
|
|
39646
|
+
function peek$1(draft, prop) {
|
|
39647
|
+
var state = draft[DRAFT_STATE];
|
|
39648
|
+
var desc = Reflect.getOwnPropertyDescriptor(state ? source$1(state) : draft, prop);
|
|
39649
|
+
return desc && desc.value;
|
|
39650
|
+
}
|
|
39651
|
+
|
|
39652
|
+
function get$1$1(state, prop) {
|
|
39653
|
+
if (prop === DRAFT_STATE) { return state; }
|
|
39654
|
+
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
39655
|
+
|
|
39656
|
+
if (!state.modified && has$1(drafts, prop)) {
|
|
39657
|
+
return drafts[prop];
|
|
39658
|
+
}
|
|
39659
|
+
|
|
39660
|
+
var value = source$1(state)[prop];
|
|
39661
|
+
|
|
39662
|
+
if (state.finalized || !isDraftable(value)) {
|
|
39663
|
+
return value;
|
|
39664
|
+
} // Check for existing draft in modified state.
|
|
39665
|
+
|
|
39666
|
+
|
|
39667
|
+
if (state.modified) {
|
|
39668
|
+
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
39669
|
+
if (value !== peek$1(state.base, prop)) { return value; } // Store drafts on the copy (when one exists).
|
|
39670
|
+
|
|
39671
|
+
drafts = state.copy;
|
|
39672
|
+
}
|
|
39673
|
+
|
|
39674
|
+
return drafts[prop] = createProxy$1(value, state);
|
|
39675
|
+
}
|
|
39676
|
+
|
|
39677
|
+
function set$1$1(state, prop, value) {
|
|
39678
|
+
if (!state.modified) {
|
|
39679
|
+
var baseValue = peek$1(state.base, prop); // Optimize based on value's truthiness. Truthy values are guaranteed to
|
|
39680
|
+
// never be undefined, so we can avoid the `in` operator. Lastly, truthy
|
|
39681
|
+
// values may be drafts, but falsy values are never drafts.
|
|
39682
|
+
|
|
39683
|
+
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
39684
|
+
if (isUnchanged) { return true; }
|
|
39685
|
+
markChanged$1(state);
|
|
39686
|
+
}
|
|
39687
|
+
|
|
39688
|
+
state.assigned[prop] = true;
|
|
39689
|
+
state.copy[prop] = value;
|
|
39690
|
+
return true;
|
|
39691
|
+
}
|
|
39692
|
+
|
|
39693
|
+
function deleteProperty(state, prop) {
|
|
39694
|
+
// The `undefined` check is a fast path for pre-existing keys.
|
|
39695
|
+
if (peek$1(state.base, prop) !== undefined || prop in state.base) {
|
|
39696
|
+
state.assigned[prop] = false;
|
|
39697
|
+
markChanged$1(state);
|
|
39698
|
+
} else if (state.assigned[prop]) {
|
|
39699
|
+
// if an originally not assigned property was deleted
|
|
39700
|
+
delete state.assigned[prop];
|
|
39701
|
+
}
|
|
39702
|
+
|
|
39703
|
+
if (state.copy) { delete state.copy[prop]; }
|
|
39704
|
+
return true;
|
|
39705
|
+
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
39706
|
+
// the same guarantee in ES5 mode.
|
|
39707
|
+
|
|
39708
|
+
|
|
39709
|
+
function getOwnPropertyDescriptor$2(state, prop) {
|
|
39710
|
+
var owner = source$1(state);
|
|
39711
|
+
var desc = Reflect.getOwnPropertyDescriptor(owner, prop);
|
|
39712
|
+
|
|
39713
|
+
if (desc) {
|
|
39714
|
+
desc.writable = true;
|
|
39715
|
+
desc.configurable = !Array.isArray(owner) || prop !== "length";
|
|
39716
|
+
}
|
|
39717
|
+
|
|
39718
|
+
return desc;
|
|
39719
|
+
}
|
|
39720
|
+
|
|
39721
|
+
function markChanged$1(state) {
|
|
39722
|
+
if (!state.modified) {
|
|
39723
|
+
state.modified = true;
|
|
39724
|
+
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
39725
|
+
state.drafts = null;
|
|
39726
|
+
if (state.parent) { markChanged$1(state.parent); }
|
|
39727
|
+
}
|
|
39728
|
+
}
|
|
39729
|
+
|
|
39730
|
+
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
39731
|
+
willFinalize: willFinalize$1,
|
|
39732
|
+
createProxy: createProxy$1
|
|
39733
|
+
});
|
|
39734
|
+
|
|
39735
|
+
function generatePatches(state, basePath, patches, inversePatches) {
|
|
39736
|
+
Array.isArray(state.base) ? generateArrayPatches(state, basePath, patches, inversePatches) : generateObjectPatches(state, basePath, patches, inversePatches);
|
|
39737
|
+
}
|
|
39738
|
+
|
|
39739
|
+
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
39740
|
+
var assign, assign$1;
|
|
39741
|
+
|
|
39742
|
+
var base = state.base;
|
|
39743
|
+
var copy = state.copy;
|
|
39744
|
+
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
39745
|
+
|
|
39746
|
+
if (copy.length < base.length) {
|
|
39747
|
+
(assign = [copy, base], base = assign[0], copy = assign[1]);
|
|
39748
|
+
(assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1]);
|
|
39749
|
+
}
|
|
39750
|
+
|
|
39751
|
+
var delta = copy.length - base.length; // Find the first replaced index.
|
|
39752
|
+
|
|
39753
|
+
var start = 0;
|
|
39754
|
+
|
|
39755
|
+
while (base[start] === copy[start] && start < base.length) {
|
|
39756
|
+
++start;
|
|
39757
|
+
} // Find the last replaced index. Search from the end to optimize splice patches.
|
|
39758
|
+
|
|
39759
|
+
|
|
39760
|
+
var end = base.length;
|
|
39761
|
+
|
|
39762
|
+
while (end > start && base[end - 1] === copy[end + delta - 1]) {
|
|
39763
|
+
--end;
|
|
39764
|
+
} // Process replaced indices.
|
|
39765
|
+
|
|
39766
|
+
|
|
39767
|
+
for (var i = start; i < end; ++i) {
|
|
39768
|
+
if (assigned[i] && copy[i] !== base[i]) {
|
|
39769
|
+
var path = basePath.concat([i]);
|
|
39770
|
+
patches.push({
|
|
39771
|
+
op: "replace",
|
|
39772
|
+
path: path,
|
|
39773
|
+
value: copy[i]
|
|
39774
|
+
});
|
|
39775
|
+
inversePatches.push({
|
|
39776
|
+
op: "replace",
|
|
39777
|
+
path: path,
|
|
39778
|
+
value: base[i]
|
|
39779
|
+
});
|
|
39780
|
+
}
|
|
39781
|
+
}
|
|
39782
|
+
|
|
39783
|
+
var replaceCount = patches.length; // Process added indices.
|
|
39784
|
+
|
|
39785
|
+
for (var i$1 = end + delta - 1; i$1 >= end; --i$1) {
|
|
39786
|
+
var path$1 = basePath.concat([i$1]);
|
|
39787
|
+
patches[replaceCount + i$1 - end] = {
|
|
39788
|
+
op: "add",
|
|
39789
|
+
path: path$1,
|
|
39790
|
+
value: copy[i$1]
|
|
39791
|
+
};
|
|
39792
|
+
inversePatches.push({
|
|
39793
|
+
op: "remove",
|
|
39794
|
+
path: path$1
|
|
39795
|
+
});
|
|
39796
|
+
}
|
|
39797
|
+
}
|
|
39798
|
+
|
|
39799
|
+
function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
39800
|
+
var base = state.base;
|
|
39801
|
+
var copy = state.copy;
|
|
39802
|
+
each(state.assigned, function (key, assignedValue) {
|
|
39803
|
+
var origValue = base[key];
|
|
39804
|
+
var value = copy[key];
|
|
39805
|
+
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
39806
|
+
if (origValue === value && op === "replace") { return; }
|
|
39807
|
+
var path = basePath.concat(key);
|
|
39808
|
+
patches.push(op === "remove" ? {
|
|
39809
|
+
op: op,
|
|
39810
|
+
path: path
|
|
39811
|
+
} : {
|
|
39812
|
+
op: op,
|
|
39813
|
+
path: path,
|
|
39814
|
+
value: value
|
|
39815
|
+
});
|
|
39816
|
+
inversePatches.push(op === "add" ? {
|
|
39817
|
+
op: "remove",
|
|
39818
|
+
path: path
|
|
39819
|
+
} : op === "remove" ? {
|
|
39820
|
+
op: "add",
|
|
39821
|
+
path: path,
|
|
39822
|
+
value: origValue
|
|
39823
|
+
} : {
|
|
39824
|
+
op: "replace",
|
|
39825
|
+
path: path,
|
|
39826
|
+
value: origValue
|
|
39827
|
+
});
|
|
39828
|
+
});
|
|
39829
|
+
}
|
|
39830
|
+
|
|
39831
|
+
var applyPatches = function (draft, patches) {
|
|
39832
|
+
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
39833
|
+
var patch = list[i$1];
|
|
39834
|
+
|
|
39835
|
+
var path = patch.path;
|
|
39836
|
+
var op = patch.op;
|
|
39837
|
+
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
39838
|
+
|
|
39839
|
+
if (!path.length) { throw new Error("Illegal state"); }
|
|
39840
|
+
var base = draft;
|
|
39841
|
+
|
|
39842
|
+
for (var i = 0; i < path.length - 1; i++) {
|
|
39843
|
+
base = base[path[i]];
|
|
39844
|
+
if (!base || typeof base !== "object") { throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/")); } // prettier-ignore
|
|
39845
|
+
}
|
|
39846
|
+
|
|
39847
|
+
var key = path[path.length - 1];
|
|
39848
|
+
|
|
39849
|
+
switch (op) {
|
|
39850
|
+
case "replace":
|
|
39851
|
+
// if value is an object, then it's assigned by reference
|
|
39852
|
+
// in the following add or remove ops, the value field inside the patch will also be modifyed
|
|
39853
|
+
// so we use value from the cloned patch
|
|
39854
|
+
base[key] = value;
|
|
39855
|
+
break;
|
|
39856
|
+
|
|
39857
|
+
case "add":
|
|
39858
|
+
if (Array.isArray(base)) {
|
|
39859
|
+
// TODO: support "foo/-" paths for appending to an array
|
|
39860
|
+
base.splice(key, 0, value);
|
|
39861
|
+
} else {
|
|
39862
|
+
base[key] = value;
|
|
39863
|
+
}
|
|
39864
|
+
|
|
39865
|
+
break;
|
|
39866
|
+
|
|
39867
|
+
case "remove":
|
|
39868
|
+
if (Array.isArray(base)) {
|
|
39869
|
+
base.splice(key, 1);
|
|
39870
|
+
} else {
|
|
39871
|
+
delete base[key];
|
|
39872
|
+
}
|
|
39873
|
+
|
|
39874
|
+
break;
|
|
39875
|
+
|
|
39876
|
+
default:
|
|
39877
|
+
throw new Error("Unsupported patch operation: " + op);
|
|
39878
|
+
}
|
|
39879
|
+
}
|
|
39880
|
+
|
|
39881
|
+
return draft;
|
|
39882
|
+
};
|
|
39883
|
+
|
|
39884
|
+
function verifyMinified() {}
|
|
39885
|
+
|
|
39886
|
+
var configDefaults = {
|
|
39887
|
+
useProxies: typeof Proxy !== "undefined" && typeof Reflect !== "undefined",
|
|
39888
|
+
autoFreeze: typeof process !== "undefined" ? process.env.NODE_ENV !== "production" : verifyMinified.name === "verifyMinified",
|
|
39889
|
+
onAssign: null,
|
|
39890
|
+
onDelete: null,
|
|
39891
|
+
onCopy: null
|
|
39892
|
+
};
|
|
39893
|
+
var Immer = function Immer(config) {
|
|
39894
|
+
assign(this, configDefaults, config);
|
|
39895
|
+
this.setUseProxies(this.useProxies);
|
|
39896
|
+
this.produce = this.produce.bind(this);
|
|
39897
|
+
};
|
|
39898
|
+
|
|
39899
|
+
Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
39900
|
+
var this$1$1 = this;
|
|
39901
|
+
|
|
39902
|
+
// curried invocation
|
|
39903
|
+
if (typeof base === "function" && typeof recipe !== "function") {
|
|
39904
|
+
var defaultBase = recipe;
|
|
39905
|
+
recipe = base;
|
|
39906
|
+
var self = this;
|
|
39907
|
+
return function curriedProduce(base) {
|
|
39908
|
+
var this$1$1 = this;
|
|
39909
|
+
if ( base === void 0 ) base = defaultBase;
|
|
39910
|
+
var args = [], len = arguments.length - 1;
|
|
39911
|
+
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
|
|
39912
|
+
|
|
39913
|
+
return self.produce(base, function (draft) { return recipe.call.apply(recipe, [ this$1$1, draft ].concat( args )); }); // prettier-ignore
|
|
39914
|
+
};
|
|
39915
|
+
} // prettier-ignore
|
|
39916
|
+
|
|
39917
|
+
|
|
39918
|
+
{
|
|
39919
|
+
if (typeof recipe !== "function") {
|
|
39920
|
+
throw new Error("The first or second argument to `produce` must be a function");
|
|
39921
|
+
}
|
|
39922
|
+
|
|
39923
|
+
if (patchListener !== undefined && typeof patchListener !== "function") {
|
|
39924
|
+
throw new Error("The third argument to `produce` must be a function or undefined");
|
|
39925
|
+
}
|
|
39926
|
+
}
|
|
39927
|
+
var result; // Only plain objects, arrays, and "immerable classes" are drafted.
|
|
39928
|
+
|
|
39929
|
+
if (isDraftable(base)) {
|
|
39930
|
+
var scope = ImmerScope.enter();
|
|
39931
|
+
var proxy = this.createProxy(base);
|
|
39932
|
+
var hasError = true;
|
|
39933
|
+
|
|
39934
|
+
try {
|
|
39935
|
+
result = recipe(proxy);
|
|
39936
|
+
hasError = false;
|
|
39937
|
+
} finally {
|
|
39938
|
+
// finally instead of catch + rethrow better preserves original stack
|
|
39939
|
+
if (hasError) { scope.revoke(); }else { scope.leave(); }
|
|
39940
|
+
}
|
|
39941
|
+
|
|
39942
|
+
if (result instanceof Promise) {
|
|
39943
|
+
return result.then(function (result) {
|
|
39944
|
+
scope.usePatches(patchListener);
|
|
39945
|
+
return this$1$1.processResult(result, scope);
|
|
39946
|
+
}, function (error) {
|
|
39947
|
+
scope.revoke();
|
|
39948
|
+
throw error;
|
|
39949
|
+
});
|
|
39950
|
+
}
|
|
39951
|
+
|
|
39952
|
+
scope.usePatches(patchListener);
|
|
39953
|
+
return this.processResult(result, scope);
|
|
39954
|
+
} else {
|
|
39955
|
+
result = recipe(base);
|
|
39956
|
+
if (result === undefined) { return base; }
|
|
39957
|
+
return result !== NOTHING ? result : undefined;
|
|
39958
|
+
}
|
|
39959
|
+
};
|
|
39960
|
+
|
|
39961
|
+
Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, arg3) {
|
|
39962
|
+
var this$1$1 = this;
|
|
39963
|
+
|
|
39964
|
+
if (typeof arg1 === "function") {
|
|
39965
|
+
return function (state) {
|
|
39966
|
+
var args = [], len = arguments.length - 1;
|
|
39967
|
+
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
|
|
39968
|
+
|
|
39969
|
+
return this$1$1.produceWithPatches(state, function (draft) { return arg1.apply(void 0, [ draft ].concat( args )); });
|
|
39970
|
+
};
|
|
39971
|
+
} // non-curried form
|
|
39972
|
+
|
|
39973
|
+
|
|
39974
|
+
if (arg3) { throw new Error("A patch listener cannot be passed to produceWithPatches"); }
|
|
39975
|
+
var patches, inversePatches;
|
|
39976
|
+
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
39977
|
+
patches = p;
|
|
39978
|
+
inversePatches = ip;
|
|
39979
|
+
});
|
|
39980
|
+
return [nextState, patches, inversePatches];
|
|
39981
|
+
};
|
|
39982
|
+
|
|
39983
|
+
Immer.prototype.createDraft = function createDraft (base) {
|
|
39984
|
+
if (!isDraftable(base)) {
|
|
39985
|
+
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
39986
|
+
}
|
|
39987
|
+
|
|
39988
|
+
var scope = ImmerScope.enter();
|
|
39989
|
+
var proxy = this.createProxy(base);
|
|
39990
|
+
proxy[DRAFT_STATE].isManual = true;
|
|
39991
|
+
scope.leave();
|
|
39992
|
+
return proxy;
|
|
39993
|
+
};
|
|
39994
|
+
|
|
39995
|
+
Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
39996
|
+
var state = draft && draft[DRAFT_STATE];
|
|
39997
|
+
|
|
39998
|
+
if (!state || !state.isManual) {
|
|
39999
|
+
throw new Error("First argument to `finishDraft` must be a draft returned by `createDraft`"); // prettier-ignore
|
|
40000
|
+
}
|
|
40001
|
+
|
|
40002
|
+
if (state.finalized) {
|
|
40003
|
+
throw new Error("The given draft is already finalized"); // prettier-ignore
|
|
40004
|
+
}
|
|
40005
|
+
|
|
40006
|
+
var scope = state.scope;
|
|
40007
|
+
scope.usePatches(patchListener);
|
|
40008
|
+
return this.processResult(undefined, scope);
|
|
40009
|
+
};
|
|
40010
|
+
|
|
40011
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze (value) {
|
|
40012
|
+
this.autoFreeze = value;
|
|
40013
|
+
};
|
|
40014
|
+
|
|
40015
|
+
Immer.prototype.setUseProxies = function setUseProxies (value) {
|
|
40016
|
+
this.useProxies = value;
|
|
40017
|
+
assign(this, value ? modernProxy : legacyProxy);
|
|
40018
|
+
};
|
|
40019
|
+
|
|
40020
|
+
Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
40021
|
+
// If a patch replaces the entire state, take that replacement as base
|
|
40022
|
+
// before applying patches
|
|
40023
|
+
var i;
|
|
40024
|
+
|
|
40025
|
+
for (i = patches.length - 1; i >= 0; i--) {
|
|
40026
|
+
var patch = patches[i];
|
|
40027
|
+
|
|
40028
|
+
if (patch.path.length === 0 && patch.op === "replace") {
|
|
40029
|
+
base = patch.value;
|
|
40030
|
+
break;
|
|
40031
|
+
}
|
|
40032
|
+
}
|
|
40033
|
+
|
|
40034
|
+
if (isDraft(base)) {
|
|
40035
|
+
// N.B: never hits if some patch a replacement, patches are never drafts
|
|
40036
|
+
return applyPatches(base, patches);
|
|
40037
|
+
} // Otherwise, produce a copy of the base state.
|
|
40038
|
+
|
|
40039
|
+
|
|
40040
|
+
return this.produce(base, function (draft) { return applyPatches(draft, patches.slice(i + 1)); });
|
|
40041
|
+
};
|
|
40042
|
+
/** @internal */
|
|
40043
|
+
|
|
40044
|
+
|
|
40045
|
+
Immer.prototype.processResult = function processResult (result, scope) {
|
|
40046
|
+
var baseDraft = scope.drafts[0];
|
|
40047
|
+
var isReplaced = result !== undefined && result !== baseDraft;
|
|
40048
|
+
this.willFinalize(scope, result, isReplaced);
|
|
40049
|
+
|
|
40050
|
+
if (isReplaced) {
|
|
40051
|
+
if (baseDraft[DRAFT_STATE].modified) {
|
|
40052
|
+
scope.revoke();
|
|
40053
|
+
throw new Error("An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."); // prettier-ignore
|
|
40054
|
+
}
|
|
40055
|
+
|
|
40056
|
+
if (isDraftable(result)) {
|
|
40057
|
+
// Finalize the result in case it contains (or is) a subset of the draft.
|
|
40058
|
+
result = this.finalize(result, null, scope);
|
|
40059
|
+
}
|
|
40060
|
+
|
|
40061
|
+
if (scope.patches) {
|
|
40062
|
+
scope.patches.push({
|
|
40063
|
+
op: "replace",
|
|
40064
|
+
path: [],
|
|
40065
|
+
value: result
|
|
40066
|
+
});
|
|
40067
|
+
scope.inversePatches.push({
|
|
40068
|
+
op: "replace",
|
|
40069
|
+
path: [],
|
|
40070
|
+
value: baseDraft[DRAFT_STATE].base
|
|
40071
|
+
});
|
|
40072
|
+
}
|
|
40073
|
+
} else {
|
|
40074
|
+
// Finalize the base draft.
|
|
40075
|
+
result = this.finalize(baseDraft, [], scope);
|
|
40076
|
+
}
|
|
40077
|
+
|
|
40078
|
+
scope.revoke();
|
|
40079
|
+
|
|
40080
|
+
if (scope.patches) {
|
|
40081
|
+
scope.patchListener(scope.patches, scope.inversePatches);
|
|
40082
|
+
}
|
|
40083
|
+
|
|
40084
|
+
return result !== NOTHING ? result : undefined;
|
|
39187
40085
|
};
|
|
40086
|
+
/**
|
|
40087
|
+
* @internal
|
|
40088
|
+
* Finalize a draft, returning either the unmodified base state or a modified
|
|
40089
|
+
* copy of the base state.
|
|
40090
|
+
*/
|
|
40091
|
+
|
|
40092
|
+
|
|
40093
|
+
Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
40094
|
+
var this$1$1 = this;
|
|
39188
40095
|
|
|
39189
|
-
|
|
39190
|
-
|
|
39191
|
-
|
|
39192
|
-
|
|
39193
|
-
|
|
39194
|
-
|
|
39195
|
-
|
|
40096
|
+
var state = draft[DRAFT_STATE];
|
|
40097
|
+
|
|
40098
|
+
if (!state) {
|
|
40099
|
+
if (Object.isFrozen(draft)) { return draft; }
|
|
40100
|
+
return this.finalizeTree(draft, null, scope);
|
|
40101
|
+
} // Never finalize drafts owned by another scope.
|
|
40102
|
+
|
|
40103
|
+
|
|
40104
|
+
if (state.scope !== scope) {
|
|
40105
|
+
return draft;
|
|
40106
|
+
}
|
|
40107
|
+
|
|
40108
|
+
if (!state.modified) {
|
|
40109
|
+
return state.base;
|
|
39196
40110
|
}
|
|
40111
|
+
|
|
40112
|
+
if (!state.finalized) {
|
|
40113
|
+
state.finalized = true;
|
|
40114
|
+
this.finalizeTree(state.draft, path, scope);
|
|
40115
|
+
|
|
40116
|
+
if (this.onDelete) {
|
|
40117
|
+
// The `assigned` object is unreliable with ES5 drafts.
|
|
40118
|
+
if (this.useProxies) {
|
|
40119
|
+
var assigned = state.assigned;
|
|
40120
|
+
|
|
40121
|
+
for (var prop in assigned) {
|
|
40122
|
+
if (!assigned[prop]) { this.onDelete(state, prop); }
|
|
40123
|
+
}
|
|
40124
|
+
} else {
|
|
40125
|
+
var base = state.base;
|
|
40126
|
+
var copy = state.copy;
|
|
40127
|
+
each(base, function (prop) {
|
|
40128
|
+
if (!has$1(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
40129
|
+
});
|
|
40130
|
+
}
|
|
40131
|
+
}
|
|
40132
|
+
|
|
40133
|
+
if (this.onCopy) {
|
|
40134
|
+
this.onCopy(state);
|
|
40135
|
+
} // At this point, all descendants of `state.copy` have been finalized,
|
|
40136
|
+
// so we can be sure that `scope.canAutoFreeze` is accurate.
|
|
40137
|
+
|
|
40138
|
+
|
|
40139
|
+
if (this.autoFreeze && scope.canAutoFreeze) {
|
|
40140
|
+
Object.freeze(state.copy);
|
|
40141
|
+
}
|
|
40142
|
+
|
|
40143
|
+
if (path && scope.patches) {
|
|
40144
|
+
generatePatches(state, path, scope.patches, scope.inversePatches);
|
|
40145
|
+
}
|
|
40146
|
+
}
|
|
40147
|
+
|
|
40148
|
+
return state.copy;
|
|
39197
40149
|
};
|
|
40150
|
+
/**
|
|
40151
|
+
* @internal
|
|
40152
|
+
* Finalize all drafts in the given state tree.
|
|
40153
|
+
*/
|
|
40154
|
+
|
|
39198
40155
|
|
|
39199
|
-
|
|
39200
|
-
|
|
39201
|
-
|
|
39202
|
-
|
|
39203
|
-
|
|
39204
|
-
|
|
39205
|
-
|
|
40156
|
+
Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
40157
|
+
var this$1$1 = this;
|
|
40158
|
+
|
|
40159
|
+
var state = root[DRAFT_STATE];
|
|
40160
|
+
|
|
40161
|
+
if (state) {
|
|
40162
|
+
if (!this.useProxies) {
|
|
40163
|
+
// Create the final copy, with added keys and without deleted keys.
|
|
40164
|
+
state.copy = shallowCopy(state.draft, true);
|
|
40165
|
+
}
|
|
40166
|
+
|
|
40167
|
+
root = state.copy;
|
|
39206
40168
|
}
|
|
40169
|
+
|
|
40170
|
+
var needPatches = !!rootPath && !!scope.patches;
|
|
40171
|
+
|
|
40172
|
+
var finalizeProperty = function (prop, value, parent) {
|
|
40173
|
+
if (value === parent) {
|
|
40174
|
+
throw Error("Immer forbids circular references");
|
|
40175
|
+
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
40176
|
+
|
|
40177
|
+
|
|
40178
|
+
var isDraftProp = !!state && parent === root;
|
|
40179
|
+
|
|
40180
|
+
if (isDraft(value)) {
|
|
40181
|
+
var path = isDraftProp && needPatches && !state.assigned[prop] ? rootPath.concat(prop) : null; // Drafts owned by `scope` are finalized here.
|
|
40182
|
+
|
|
40183
|
+
value = this$1$1.finalize(value, path, scope); // Drafts from another scope must prevent auto-freezing.
|
|
40184
|
+
|
|
40185
|
+
if (isDraft(value)) {
|
|
40186
|
+
scope.canAutoFreeze = false;
|
|
40187
|
+
} // Preserve non-enumerable properties.
|
|
40188
|
+
|
|
40189
|
+
|
|
40190
|
+
if (Array.isArray(parent) || isEnumerable(parent, prop)) {
|
|
40191
|
+
parent[prop] = value;
|
|
40192
|
+
} else {
|
|
40193
|
+
Object.defineProperty(parent, prop, {
|
|
40194
|
+
value: value
|
|
40195
|
+
});
|
|
40196
|
+
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
40197
|
+
|
|
40198
|
+
|
|
40199
|
+
if (isDraftProp && value === state.base[prop]) { return; }
|
|
40200
|
+
} // Unchanged draft properties are ignored.
|
|
40201
|
+
else if (isDraftProp && is(value, state.base[prop])) {
|
|
40202
|
+
return;
|
|
40203
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
40204
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
40205
|
+
each(value, finalizeProperty);
|
|
40206
|
+
}
|
|
40207
|
+
|
|
40208
|
+
if (isDraftProp && this$1$1.onAssign) {
|
|
40209
|
+
this$1$1.onAssign(state, prop, value);
|
|
40210
|
+
}
|
|
40211
|
+
};
|
|
40212
|
+
|
|
40213
|
+
each(root, finalizeProperty);
|
|
40214
|
+
return root;
|
|
39207
40215
|
};
|
|
39208
40216
|
|
|
39209
|
-
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a$1(n,r){return 2===o(n)?n.get(r):n[r]}function f$6(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c$1(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b$1(r){var t=tn[r];return t||n(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b$1("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b$1("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b$1("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b$1("Patches").N(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f$6(o,a,p),!r(p))return;e.m=!1;}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function N(n,r,t){var e=s(r)?b$1("MapSet").F(r,t):v(r)?b$1("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b$1("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b$1("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}else e=D(r,c);return i(e,(function(r,t){u&&a$1(u.t,r)===t||f$6(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c$1(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b$1("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b$1("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var produce = fn;
|
|
40217
|
+
var immer = new Immer();
|
|
40218
|
+
/**
|
|
40219
|
+
* The `produce` function takes a value and a "recipe function" (whose
|
|
40220
|
+
* return value often depends on the base state). The recipe function is
|
|
40221
|
+
* free to mutate its first argument however it wants. All mutations are
|
|
40222
|
+
* only ever applied to a __copy__ of the base state.
|
|
40223
|
+
*
|
|
40224
|
+
* Pass only a function to create a "curried producer" which relieves you
|
|
40225
|
+
* from passing the recipe function every time.
|
|
40226
|
+
*
|
|
40227
|
+
* Only plain objects and arrays are made mutable. All other objects are
|
|
40228
|
+
* considered uncopyable.
|
|
40229
|
+
*
|
|
40230
|
+
* Note: This function is __bound__ to its `Immer` instance.
|
|
40231
|
+
*
|
|
40232
|
+
* @param {any} base - the initial state
|
|
40233
|
+
* @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified
|
|
40234
|
+
* @param {Function} patchListener - optional function that will be called with all the patches produced here
|
|
40235
|
+
* @returns {any} a new state, or the initial state if nothing was modified
|
|
40236
|
+
*/
|
|
40237
|
+
|
|
40238
|
+
var produce = immer.produce;
|
|
40239
|
+
/**
|
|
40240
|
+
* Like `produce`, but `produceWithPatches` always returns a tuple
|
|
40241
|
+
* [nextState, patches, inversePatches] (instead of just the next state)
|
|
40242
|
+
*/
|
|
40243
|
+
|
|
40244
|
+
immer.produceWithPatches.bind(immer);
|
|
40245
|
+
/**
|
|
40246
|
+
* Pass true to automatically freeze all copies created by Immer.
|
|
40247
|
+
*
|
|
40248
|
+
* By default, auto-freezing is disabled in production.
|
|
40249
|
+
*/
|
|
39210
40250
|
|
|
39211
|
-
|
|
40251
|
+
immer.setAutoFreeze.bind(immer);
|
|
40252
|
+
/**
|
|
40253
|
+
* Pass true to use the ES2015 `Proxy` class when creating drafts, which is
|
|
40254
|
+
* always faster than using ES5 proxies.
|
|
40255
|
+
*
|
|
40256
|
+
* By default, feature detection is used, so calling this is rarely necessary.
|
|
40257
|
+
*/
|
|
40258
|
+
|
|
40259
|
+
immer.setUseProxies.bind(immer);
|
|
40260
|
+
/**
|
|
40261
|
+
* Apply an array of Immer patches to the first argument.
|
|
40262
|
+
*
|
|
40263
|
+
* This function is a producer, which means copy-on-write is in effect.
|
|
40264
|
+
*/
|
|
40265
|
+
|
|
40266
|
+
immer.applyPatches.bind(immer);
|
|
40267
|
+
/**
|
|
40268
|
+
* Create an Immer draft from the given base state, which may be a draft itself.
|
|
40269
|
+
* The draft can be modified until you finalize it with the `finishDraft` function.
|
|
40270
|
+
*/
|
|
40271
|
+
|
|
40272
|
+
immer.createDraft.bind(immer);
|
|
40273
|
+
/**
|
|
40274
|
+
* Finalize an Immer draft from a `createDraft` call, returning the base state
|
|
40275
|
+
* (if no changes were made) or a modified copy. The draft must *not* be
|
|
40276
|
+
* mutated afterwards.
|
|
40277
|
+
*
|
|
40278
|
+
* Pass a function as the 2nd argument to generate Immer patches based on the
|
|
40279
|
+
* changes that were made.
|
|
40280
|
+
*/
|
|
40281
|
+
|
|
40282
|
+
immer.finishDraft.bind(immer);
|
|
40283
|
+
|
|
40284
|
+
const createInitialState = formConfig => {
|
|
39212
40285
|
let initialForm = {};
|
|
39213
40286
|
const formConfigKeys = Object.keys(formConfig);
|
|
39214
40287
|
for (let formKey of formConfigKeys) {
|
|
39215
40288
|
initialForm[formKey] = {
|
|
39216
40289
|
dirty: false,
|
|
39217
|
-
rawValue: formConfig[formKey].defaultValue ||
|
|
40290
|
+
rawValue: formConfig[formKey].defaultValue || "",
|
|
39218
40291
|
validators: formConfig[formKey].validators || [],
|
|
39219
|
-
constraints: formConfig[formKey].constraints || []
|
|
40292
|
+
constraints: formConfig[formKey].constraints || []
|
|
39220
40293
|
};
|
|
39221
40294
|
}
|
|
39222
40295
|
// Because validators require the entire form we have to do a
|
|
@@ -39227,99 +40300,82 @@ const createInitialState = (formConfig) => {
|
|
|
39227
40300
|
initialForm[formKey].errors = errors;
|
|
39228
40301
|
initialForm[formKey].hasErrors = errors.length > 0;
|
|
39229
40302
|
}
|
|
39230
|
-
|
|
39231
40303
|
return initialForm;
|
|
39232
40304
|
};
|
|
39233
40305
|
|
|
39234
|
-
const SET =
|
|
39235
|
-
const set$
|
|
40306
|
+
const SET = "field/SET";
|
|
40307
|
+
const set$2 = fieldName => value => ({
|
|
39236
40308
|
type: SET,
|
|
39237
|
-
payload: { fieldName, value }
|
|
40309
|
+
payload: { fieldName, value }
|
|
39238
40310
|
});
|
|
39239
40311
|
|
|
39240
|
-
const CLEAR =
|
|
40312
|
+
const CLEAR = "form/CLEAR";
|
|
39241
40313
|
const clear = () => ({ type: CLEAR });
|
|
39242
40314
|
|
|
39243
|
-
const ADD_VALIDATOR =
|
|
39244
|
-
const addValidator =
|
|
40315
|
+
const ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
40316
|
+
const addValidator = fieldName => validator => ({
|
|
39245
40317
|
type: ADD_VALIDATOR,
|
|
39246
|
-
payload: { fieldName, validator }
|
|
39247
|
-
});
|
|
39248
|
-
|
|
39249
|
-
const REMOVE_VALIDATOR = 'field/REMOVE_VALIDATOR';
|
|
39250
|
-
const removeValidator = (fieldName) => (validator) => ({
|
|
39251
|
-
type: REMOVE_VALIDATOR,
|
|
39252
|
-
payload: { fieldName, validator },
|
|
39253
|
-
});
|
|
39254
|
-
|
|
39255
|
-
const CLEAR_FIELD_VALIDATORS = 'field/CLEAR_FIELD_VALIDATORS';
|
|
39256
|
-
const clearFieldValidators = (fieldName) => () => ({
|
|
39257
|
-
type: CLEAR_FIELD_VALIDATORS,
|
|
39258
|
-
payload: { fieldName },
|
|
40318
|
+
payload: { fieldName, validator }
|
|
39259
40319
|
});
|
|
39260
40320
|
|
|
39261
|
-
const createFormReducer =
|
|
39262
|
-
(formConfig)
|
|
39263
|
-
|
|
39264
|
-
|
|
39265
|
-
|
|
39266
|
-
|
|
39267
|
-
|
|
39268
|
-
|
|
39269
|
-
|
|
39270
|
-
|
|
39271
|
-
|
|
39272
|
-
|
|
39273
|
-
|
|
39274
|
-
|
|
39275
|
-
|
|
39276
|
-
|
|
39277
|
-
|
|
39278
|
-
computeDirtyEntries(draftState, changedFieldName);
|
|
39279
|
-
computeErrorEntries(draftState);
|
|
39280
|
-
});
|
|
39281
|
-
}
|
|
39282
|
-
case CLEAR:
|
|
39283
|
-
return createInitialState(formConfig);
|
|
39284
|
-
case ADD_VALIDATOR: {
|
|
39285
|
-
const fieldWithOverride = action.payload.fieldName;
|
|
39286
|
-
const newValidator = action.payload.validator;
|
|
39287
|
-
|
|
39288
|
-
return produce(state, (draftState) => {
|
|
39289
|
-
draftState[fieldWithOverride].validators.push(newValidator);
|
|
39290
|
-
computeErrorEntries(draftState);
|
|
39291
|
-
});
|
|
39292
|
-
}
|
|
39293
|
-
case REMOVE_VALIDATOR: {
|
|
39294
|
-
const fieldToOverride = action.payload.fieldName;
|
|
39295
|
-
const targetValidator = action.payload.validator;
|
|
39296
|
-
|
|
39297
|
-
return produce(state, (draftState) => {
|
|
39298
|
-
let fieldValidators = draftState[fieldToOverride].validators;
|
|
39299
|
-
draftState[fieldToOverride].validators = fieldValidators.filter(
|
|
39300
|
-
(validator) => validator.type !== targetValidator.type
|
|
39301
|
-
);
|
|
39302
|
-
computeErrorEntries(draftState);
|
|
39303
|
-
});
|
|
39304
|
-
}
|
|
39305
|
-
case CLEAR_FIELD_VALIDATORS: {
|
|
39306
|
-
const fieldToClear = action.payload.fieldName;
|
|
40321
|
+
const createFormReducer = formConfig => (
|
|
40322
|
+
state = createInitialState(formConfig),
|
|
40323
|
+
action
|
|
40324
|
+
) => {
|
|
40325
|
+
switch (action.type) {
|
|
40326
|
+
case SET:
|
|
40327
|
+
const changedFieldName = action.payload.fieldName;
|
|
40328
|
+
const newRawValue = action.payload.value;
|
|
40329
|
+
|
|
40330
|
+
return produce(state, draftState => {
|
|
40331
|
+
let originalValue = draftState[changedFieldName].rawValue;
|
|
40332
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
40333
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
40334
|
+
// If the change violates constraints, revert the change
|
|
40335
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
40336
|
+
return draftState;
|
|
40337
|
+
}
|
|
39307
40338
|
|
|
39308
|
-
|
|
39309
|
-
|
|
39310
|
-
|
|
39311
|
-
|
|
39312
|
-
|
|
39313
|
-
|
|
39314
|
-
|
|
39315
|
-
|
|
39316
|
-
|
|
40339
|
+
const fields = Object.entries(draftState);
|
|
40340
|
+
for (let entry of fields) {
|
|
40341
|
+
let fieldName = entry[0];
|
|
40342
|
+
let field = entry[1];
|
|
40343
|
+
let errors = computeErrors(fieldName, draftState);
|
|
40344
|
+
let dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
40345
|
+
draftState[fieldName].errors = errors;
|
|
40346
|
+
draftState[fieldName].dirty = dirty;
|
|
40347
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
40348
|
+
}
|
|
40349
|
+
});
|
|
40350
|
+
case CLEAR:
|
|
40351
|
+
return createInitialState(formConfig);
|
|
40352
|
+
case ADD_VALIDATOR:
|
|
40353
|
+
const fieldWithOverride = action.payload.fieldName;
|
|
40354
|
+
const newValidator = action.payload.validator;
|
|
40355
|
+
|
|
40356
|
+
return produce(state, draftState => {
|
|
40357
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
40358
|
+
const fields = Object.entries(draftState);
|
|
40359
|
+
for (let entry of fields) {
|
|
40360
|
+
let fieldName = entry[0];
|
|
40361
|
+
let field = entry[1];
|
|
40362
|
+
let errors = computeErrors(fieldName, draftState);
|
|
40363
|
+
let dirty = field.dirty;
|
|
40364
|
+
draftState[fieldName].errors = errors;
|
|
40365
|
+
draftState[fieldName].dirty = dirty;
|
|
40366
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
40367
|
+
}
|
|
40368
|
+
});
|
|
40369
|
+
default:
|
|
40370
|
+
return state;
|
|
40371
|
+
}
|
|
40372
|
+
};
|
|
39317
40373
|
|
|
39318
|
-
const createMapDispatchToProps =
|
|
40374
|
+
const createMapDispatchToProps = formConfig => {
|
|
39319
40375
|
// Do memo-ization
|
|
39320
40376
|
let cachedDispatch;
|
|
39321
40377
|
let cacheValue;
|
|
39322
|
-
return
|
|
40378
|
+
return dispatch => {
|
|
39323
40379
|
if (dispatch == cachedDispatch) {
|
|
39324
40380
|
return cacheValue;
|
|
39325
40381
|
}
|
|
@@ -39328,11 +40384,8 @@ const createMapDispatchToProps = (formConfig) => {
|
|
|
39328
40384
|
const keys = Object.keys(formConfig);
|
|
39329
40385
|
for (let fieldName of keys) {
|
|
39330
40386
|
dispatchObj.fields[fieldName] = {
|
|
39331
|
-
set:
|
|
39332
|
-
addValidator:
|
|
39333
|
-
removeValidator: (validator) =>
|
|
39334
|
-
dispatch(removeValidator(fieldName)(validator)),
|
|
39335
|
-
clear: () => dispatch(clearFieldValidators(fieldName)()),
|
|
40387
|
+
set: value => dispatch(set$2(fieldName)(value)),
|
|
40388
|
+
addValidator: validator => dispatch(addValidator(fieldName)(validator))
|
|
39336
40389
|
};
|
|
39337
40390
|
}
|
|
39338
40391
|
dispatchObj.form = { clear: () => dispatch(clear()) };
|
|
@@ -39342,12 +40395,12 @@ const createMapDispatchToProps = (formConfig) => {
|
|
|
39342
40395
|
};
|
|
39343
40396
|
};
|
|
39344
40397
|
|
|
39345
|
-
const mapStateToProps =
|
|
40398
|
+
const mapStateToProps = state => ({ fields: state });
|
|
39346
40399
|
|
|
39347
|
-
const createFormState =
|
|
40400
|
+
const createFormState = formConfig => ({
|
|
39348
40401
|
reducer: createFormReducer(formConfig),
|
|
39349
40402
|
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
39350
|
-
mapStateToProps: mapStateToProps
|
|
40403
|
+
mapStateToProps: mapStateToProps
|
|
39351
40404
|
});
|
|
39352
40405
|
|
|
39353
40406
|
var AddressForm = function AddressForm(_ref) {
|
|
@@ -40082,7 +41135,7 @@ var EditableListItem = styled__default.div.withConfig({
|
|
|
40082
41135
|
componentId: "sc-10ehkz7-0"
|
|
40083
41136
|
})(["box-sizing:border-box;background:", ";border-color:", ";height:", ";display:flex;justify-content:space-between;align-items:center;padding:1.5rem;:not(:last-child),:not(:first-child){box-shadow:inset 0px -1px 0px 0px rgb(202,206,216);}:first-child{border-top-left-radius:3px;border-top-right-radius:3px;}:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px;box-shadow:none;}"], function (_ref) {
|
|
40084
41137
|
var disabled = _ref.disabled;
|
|
40085
|
-
return disabled ? "rgba(246, 246, 249, 0.7)" : WHITE;
|
|
41138
|
+
return disabled ? "rgba(246, 246, 249, 0.7)" : WHITE$1;
|
|
40086
41139
|
}, GHOST_GREY, function (_ref2) {
|
|
40087
41140
|
var listItemSize = _ref2.listItemSize;
|
|
40088
41141
|
return listItemSize === "big" ? "120px" : "72px";
|
|
@@ -42212,12 +43265,12 @@ LoginForm.mapDispatchToProps = mapDispatchToProps$5;
|
|
|
42212
43265
|
* This source code is licensed under the MIT license found in the
|
|
42213
43266
|
* LICENSE file in the root directory of this source tree.
|
|
42214
43267
|
*/
|
|
42215
|
-
var b$
|
|
42216
|
-
Symbol.for("react.suspense_list"):60120,r
|
|
42217
|
-
function z
|
|
42218
|
-
var Profiler=g
|
|
42219
|
-
var isMemo=function(a){return z
|
|
42220
|
-
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g
|
|
43268
|
+
var b$1="function"===typeof Symbol&&Symbol.for,c$1=b$1?Symbol.for("react.element"):60103,d=b$1?Symbol.for("react.portal"):60106,e=b$1?Symbol.for("react.fragment"):60107,f$6=b$1?Symbol.for("react.strict_mode"):60108,g=b$1?Symbol.for("react.profiler"):60114,h=b$1?Symbol.for("react.provider"):60109,k=b$1?Symbol.for("react.context"):60110,l=b$1?Symbol.for("react.async_mode"):60111,m=b$1?Symbol.for("react.concurrent_mode"):60111,n=b$1?Symbol.for("react.forward_ref"):60112,p=b$1?Symbol.for("react.suspense"):60113,q=b$1?
|
|
43269
|
+
Symbol.for("react.suspense_list"):60120,r=b$1?Symbol.for("react.memo"):60115,t=b$1?Symbol.for("react.lazy"):60116,v=b$1?Symbol.for("react.block"):60121,w=b$1?Symbol.for("react.fundamental"):60117,x=b$1?Symbol.for("react.responder"):60118,y=b$1?Symbol.for("react.scope"):60119;
|
|
43270
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l:case m:case e:case g:case f$6:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element$1=c$1;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
|
|
43271
|
+
var Profiler=g;var StrictMode=f$6;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$1};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
|
43272
|
+
var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f$6};var isSuspense=function(a){return z(a)===p};
|
|
43273
|
+
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f$6||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
|
42221
43274
|
|
|
42222
43275
|
var reactIs_production_min = {
|
|
42223
43276
|
AsyncMode: AsyncMode,
|
|
@@ -42588,14 +43641,14 @@ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
42588
43641
|
|
|
42589
43642
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
42590
43643
|
|
|
42591
|
-
var has$
|
|
43644
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
42592
43645
|
|
|
42593
43646
|
var printWarning = function() {};
|
|
42594
43647
|
|
|
42595
43648
|
if (process.env.NODE_ENV !== 'production') {
|
|
42596
43649
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
42597
43650
|
var loggedTypeFailures = {};
|
|
42598
|
-
var has$
|
|
43651
|
+
var has$3 = has$2;
|
|
42599
43652
|
|
|
42600
43653
|
printWarning = function(text) {
|
|
42601
43654
|
var message = 'Warning: ' + text;
|
|
@@ -42625,7 +43678,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
42625
43678
|
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
42626
43679
|
if (process.env.NODE_ENV !== 'production') {
|
|
42627
43680
|
for (var typeSpecName in typeSpecs) {
|
|
42628
|
-
if (has$
|
|
43681
|
+
if (has$3(typeSpecs, typeSpecName)) {
|
|
42629
43682
|
var error;
|
|
42630
43683
|
// Prop type validation may throw. In case they do, we don't want to
|
|
42631
43684
|
// fail the render phase where it didn't fail before. So we log it.
|
|
@@ -43024,7 +44077,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
43024
44077
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
43025
44078
|
}
|
|
43026
44079
|
for (var key in propValue) {
|
|
43027
|
-
if (has$
|
|
44080
|
+
if (has$2(propValue, key)) {
|
|
43028
44081
|
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
43029
44082
|
if (error instanceof Error) {
|
|
43030
44083
|
return error;
|
|
@@ -43061,7 +44114,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
43061
44114
|
if (checkerResult == null) {
|
|
43062
44115
|
return null;
|
|
43063
44116
|
}
|
|
43064
|
-
if (checkerResult.data && has$
|
|
44117
|
+
if (checkerResult.data && has$2(checkerResult.data, 'expectedType')) {
|
|
43065
44118
|
expectedTypes.push(checkerResult.data.expectedType);
|
|
43066
44119
|
}
|
|
43067
44120
|
}
|
|
@@ -43121,7 +44174,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
43121
44174
|
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
|
43122
44175
|
for (var key in allKeys) {
|
|
43123
44176
|
var checker = shapeTypes[key];
|
|
43124
|
-
if (has$
|
|
44177
|
+
if (has$2(shapeTypes, key) && typeof checker !== 'function') {
|
|
43125
44178
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
43126
44179
|
}
|
|
43127
44180
|
if (!checker) {
|
|
@@ -43859,7 +44912,7 @@ var index_esm = /*#__PURE__*/Object.freeze({
|
|
|
43859
44912
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
43860
44913
|
*/
|
|
43861
44914
|
|
|
43862
|
-
function ownKeys$
|
|
44915
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
43863
44916
|
var keys = Object.keys(object);
|
|
43864
44917
|
|
|
43865
44918
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -43875,9 +44928,9 @@ function ownKeys$2(object, enumerableOnly) {
|
|
|
43875
44928
|
function _objectSpread2$1(target) {
|
|
43876
44929
|
for (var i = 1; i < arguments.length; i++) {
|
|
43877
44930
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
43878
|
-
i % 2 ? ownKeys$
|
|
44931
|
+
i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) {
|
|
43879
44932
|
_defineProperty$1(target, key, source[key]);
|
|
43880
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
|
44933
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) {
|
|
43881
44934
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
43882
44935
|
});
|
|
43883
44936
|
}
|
|
@@ -45649,7 +46702,7 @@ var Modal$1 = function Modal(_ref) {
|
|
|
45649
46702
|
_ref$closeButtonText = _ref.closeButtonText,
|
|
45650
46703
|
closeButtonText = _ref$closeButtonText === void 0 ? "Close" : _ref$closeButtonText,
|
|
45651
46704
|
_ref$modalHeaderBg = _ref.modalHeaderBg,
|
|
45652
|
-
modalHeaderBg = _ref$modalHeaderBg === void 0 ? WHITE : _ref$modalHeaderBg,
|
|
46705
|
+
modalHeaderBg = _ref$modalHeaderBg === void 0 ? WHITE$1 : _ref$modalHeaderBg,
|
|
45653
46706
|
_ref$modalBodyBg = _ref.modalBodyBg,
|
|
45654
46707
|
modalBodyBg = _ref$modalBodyBg === void 0 ? ATHENS_GREY : _ref$modalBodyBg,
|
|
45655
46708
|
_ref$useDangerButton = _ref.useDangerButton,
|
|
@@ -45833,9 +46886,9 @@ var borderRadius = {
|
|
|
45833
46886
|
small: "0.25rem"
|
|
45834
46887
|
};
|
|
45835
46888
|
var backgroundColor$a = {
|
|
45836
|
-
"default": WHITE,
|
|
45837
|
-
largeTitle: WHITE,
|
|
45838
|
-
small: WHITE
|
|
46889
|
+
"default": WHITE$1,
|
|
46890
|
+
largeTitle: WHITE$1,
|
|
46891
|
+
small: WHITE$1
|
|
45839
46892
|
};
|
|
45840
46893
|
var fallbackValues$J = {
|
|
45841
46894
|
fontSize: fontSize$9,
|
|
@@ -46615,7 +47668,7 @@ var Obligation = function Obligation(_ref) {
|
|
|
46615
47668
|
border: "1px solid ".concat(GRECIAN_GREY),
|
|
46616
47669
|
borderWidthOverride: "1px 0 0 0"
|
|
46617
47670
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
46618
|
-
background: WHITE,
|
|
47671
|
+
background: WHITE$1,
|
|
46619
47672
|
padding: isMobile ? "16px" : "24px 16px"
|
|
46620
47673
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
46621
47674
|
childGap: "14px"
|
|
@@ -46891,10 +47944,10 @@ var createPartialAmountFormValidators = function createPartialAmountFormValidato
|
|
|
46891
47944
|
return validators;
|
|
46892
47945
|
};
|
|
46893
47946
|
|
|
46894
|
-
var arrowColor = WHITE;
|
|
47947
|
+
var arrowColor = WHITE$1;
|
|
46895
47948
|
var numberColor = MATISSE_BLUE;
|
|
46896
47949
|
var hoverBackgroundColor$2 = ALABASTER_WHITE;
|
|
46897
|
-
var activeBackgroundColor$2 = WHITE;
|
|
47950
|
+
var activeBackgroundColor$2 = WHITE$1;
|
|
46898
47951
|
var activeColor$9 = MATISSE_BLUE;
|
|
46899
47952
|
var fallbackValues$M = {
|
|
46900
47953
|
activeColor: activeColor$9,
|
|
@@ -48545,7 +49598,7 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
48545
49598
|
})));
|
|
48546
49599
|
};
|
|
48547
49600
|
|
|
48548
|
-
var headingBackgroundColor$1 = "".concat(WHITE);
|
|
49601
|
+
var headingBackgroundColor$1 = "".concat(WHITE$1);
|
|
48549
49602
|
var headingDisabledColor = "".concat(ATHENS_GREY);
|
|
48550
49603
|
var bodyBackgroundColor$1 = "#eeeeee";
|
|
48551
49604
|
var borderColor$6 = "".concat(GREY_CHATEAU);
|
|
@@ -48891,7 +49944,7 @@ var ResetConfirmationForm = function ResetConfirmationForm() {
|
|
|
48891
49944
|
padding: "0",
|
|
48892
49945
|
width: isMobile ? "auto" : "576px",
|
|
48893
49946
|
borderRadius: "4px",
|
|
48894
|
-
background: WHITE,
|
|
49947
|
+
background: WHITE$1,
|
|
48895
49948
|
boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
|
|
48896
49949
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
48897
49950
|
background: GRECIAN_GREY,
|
|
@@ -49014,7 +50067,7 @@ var ResetConfirmationForm$2 = function ResetConfirmationForm() {
|
|
|
49014
50067
|
padding: "0",
|
|
49015
50068
|
width: isMobile ? "auto" : "576px",
|
|
49016
50069
|
borderRadius: "4px",
|
|
49017
|
-
background: WHITE,
|
|
50070
|
+
background: WHITE$1,
|
|
49018
50071
|
boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
|
|
49019
50072
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
49020
50073
|
background: GRECIAN_GREY,
|
|
@@ -49084,7 +50137,7 @@ var Tab = function Tab(_ref) {
|
|
|
49084
50137
|
onClick: onClick,
|
|
49085
50138
|
margin: "0 0 -1px 0",
|
|
49086
50139
|
padding: "0.5rem 0.75rem",
|
|
49087
|
-
background: activeTab === label ? WHITE : GRECIAN_GREY,
|
|
50140
|
+
background: activeTab === label ? WHITE$1 : GRECIAN_GREY,
|
|
49088
50141
|
extraStyles: "cursor: pointer; flex-grow: 1; text-align: center; ".concat(activeTab === label ? "list-style: none;" : "")
|
|
49089
50142
|
}, /*#__PURE__*/React__default.createElement(Text$1, null, label));
|
|
49090
50143
|
};
|
|
@@ -49237,8 +50290,55 @@ var Timeout = function Timeout(_ref) {
|
|
|
49237
50290
|
|
|
49238
50291
|
var Timeout$1 = withWindowSize(Timeout);
|
|
49239
50292
|
|
|
50293
|
+
var CloseIconWrapper = styled__default.div.withConfig({
|
|
50294
|
+
displayName: "ToastNotification__CloseIconWrapper",
|
|
50295
|
+
componentId: "sc-116yflm-0"
|
|
50296
|
+
})(["min-height:24px;min-width:24px;display:flex;margin:16px;justify-content:center;align-items:center;cursor:pointer;"]);
|
|
50297
|
+
var VARIANTS = {
|
|
50298
|
+
SUCCESS: "success",
|
|
50299
|
+
ERROR: "error"
|
|
50300
|
+
};
|
|
50301
|
+
|
|
50302
|
+
var ToastNotification = function ToastNotification(_ref) {
|
|
50303
|
+
var _ref$message = _ref.message,
|
|
50304
|
+
message = _ref$message === void 0 ? "" : _ref$message,
|
|
50305
|
+
extraStyles = _ref.extraStyles,
|
|
50306
|
+
_ref$minWidth = _ref.minWidth,
|
|
50307
|
+
minWidth = _ref$minWidth === void 0 ? "112px" : _ref$minWidth,
|
|
50308
|
+
_ref$maxWidth = _ref.maxWidth,
|
|
50309
|
+
maxWidth = _ref$maxWidth === void 0 ? "350px" : _ref$maxWidth,
|
|
50310
|
+
_ref$height = _ref.height,
|
|
50311
|
+
height = _ref$height === void 0 ? "56px" : _ref$height,
|
|
50312
|
+
closeToastNotification = _ref.closeToastNotification,
|
|
50313
|
+
toastOpen = _ref.toastOpen,
|
|
50314
|
+
_ref$variant = _ref.variant,
|
|
50315
|
+
variant = _ref$variant === void 0 ? VARIANTS.SUCCESS : _ref$variant,
|
|
50316
|
+
backgroundColor = _ref.backgroundColor;
|
|
50317
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
50318
|
+
onClick: closeToastNotification,
|
|
50319
|
+
background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === "error" ? ERROR_COLOR : WHITE,
|
|
50320
|
+
minWidth: minWidth,
|
|
50321
|
+
minHeight: height && parseInt(height) < 100 ? height : "100px",
|
|
50322
|
+
height: height ? height : "auto",
|
|
50323
|
+
tabIndex: toastOpen ? "-1" : "0",
|
|
50324
|
+
padding: "0",
|
|
50325
|
+
borderRadius: "4px",
|
|
50326
|
+
boxShadow: "0px 4px 4px rgba(41, 42, 51, 0.15), 0px 1px 7px rgba(41, 42, 51, 0.2), 0px 7px 12px rgba(41, 42, 51, 0.15)",
|
|
50327
|
+
extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n ")
|
|
50328
|
+
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
50329
|
+
align: "center",
|
|
50330
|
+
childGap: "0"
|
|
50331
|
+
}, variant === "success" && /*#__PURE__*/React__default.createElement(SuccessfulIconSmall, null), variant === "error" && /*#__PURE__*/React__default.createElement(ErroredIcon, null), /*#__PURE__*/React__default.createElement(Box, {
|
|
50332
|
+
padding: "1rem 0",
|
|
50333
|
+
maxWidth: maxWidth
|
|
50334
|
+
}, /*#__PURE__*/React__default.createElement(Paragraph$1, {
|
|
50335
|
+
weight: FONT_WEIGHT_SEMIBOLD,
|
|
50336
|
+
extraStyles: "word-break: break-word;"
|
|
50337
|
+
}, message)), /*#__PURE__*/React__default.createElement(CloseIconWrapper, null, /*#__PURE__*/React__default.createElement(IconQuitLarge, null))));
|
|
50338
|
+
};
|
|
50339
|
+
|
|
49240
50340
|
var fontWeight$9 = "600";
|
|
49241
|
-
var fontColor$1 = WHITE;
|
|
50341
|
+
var fontColor$1 = WHITE$1;
|
|
49242
50342
|
var textAlign$1 = "left";
|
|
49243
50343
|
var headerBackgroundColor$1 = BRIGHT_GREY;
|
|
49244
50344
|
var imageBackgroundColor$1 = MATISSE_BLUE;
|
|
@@ -49302,7 +50402,7 @@ var WorkflowTile = function WorkflowTile(_ref) {
|
|
|
49302
50402
|
_ref$buttonVariant = _ref.buttonVariant,
|
|
49303
50403
|
buttonVariant = _ref$buttonVariant === void 0 ? "primary" : _ref$buttonVariant;
|
|
49304
50404
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
49305
|
-
background: WHITE,
|
|
50405
|
+
background: WHITE$1,
|
|
49306
50406
|
boxShadow: "0px 0px 5px 0px ".concat(GHOST_GREY),
|
|
49307
50407
|
padding: 0,
|
|
49308
50408
|
borderRadius: "4px"
|
|
@@ -49802,6 +50902,7 @@ exports.Text = Text$1;
|
|
|
49802
50902
|
exports.Timeout = Timeout$1;
|
|
49803
50903
|
exports.TimeoutImage = TimeoutImage;
|
|
49804
50904
|
exports.Title = Title$1;
|
|
50905
|
+
exports.ToastNotification = ToastNotification;
|
|
49805
50906
|
exports.ToggleSwitch = ToggleSwitch$1;
|
|
49806
50907
|
exports.TrashIcon = TrashIcon$1;
|
|
49807
50908
|
exports.TypeaheadInput = TypeaheadInput;
|