quicksnack 3.35.1 → 3.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/UiProvider.d.ts +8 -0
  2. package/dist/UiStateProvider.d.ts +9 -0
  3. package/dist/UiWrapper.d.ts +7 -0
  4. package/dist/animation/SlideInFromTop/SlideInFromTop.d.ts +4 -0
  5. package/dist/animation/SlideOpen/SlideOpen.d.ts +9 -0
  6. package/dist/bundle.js +4741 -0
  7. package/dist/bundle.min.js +874 -0
  8. package/dist/components/Alert/Alert.d.ts +7 -0
  9. package/dist/components/AnimatedCheckmark/AnimatedCheckmark.d.ts +2 -0
  10. package/dist/components/Box/Box.d.ts +23 -0
  11. package/dist/components/BreadCrumbs/BreadCrumbs.d.ts +3 -0
  12. package/dist/components/CollapsiblePanel/CollapsiblePanel.d.ts +7 -0
  13. package/dist/components/ConfirmButton/ConfirmButton.d.ts +8 -0
  14. package/dist/components/ConfirmModal/ConfirmModal.d.ts +15 -0
  15. package/dist/components/ConfirmModal/hooks/useConfirmModal.d.ts +11 -0
  16. package/dist/components/Details/Details.d.ts +7 -0
  17. package/dist/components/Dropdown/Dropdown.d.ts +530 -0
  18. package/dist/components/Dropzone/Dropzone.d.ts +8 -0
  19. package/dist/components/Feedback/Feedback.d.ts +10 -0
  20. package/dist/components/Floater/Floater.d.ts +14 -0
  21. package/dist/components/Floater/FloaterItem.d.ts +8 -0
  22. package/dist/components/Footer/Footer.d.ts +2 -0
  23. package/dist/components/HorizontalScroller/HorizontalScroller.d.ts +2 -0
  24. package/dist/components/Menu/HamburgerButton.d.ts +276 -0
  25. package/dist/components/Menu/Menu.d.ts +268 -0
  26. package/dist/components/Menu/MenuCloseButton.d.ts +276 -0
  27. package/dist/components/Menu/MenuSlideOpenIndicator.d.ts +2 -0
  28. package/dist/components/Menu/SideBar.d.ts +271 -0
  29. package/dist/components/Menu/SideBarHeader.d.ts +6 -0
  30. package/dist/components/Menu/useCloseSidebarOnNavigate.d.ts +1 -0
  31. package/dist/components/Menu/useToggleMobileMenu.d.ts +10 -0
  32. package/dist/components/Modal/Modal.d.ts +8 -0
  33. package/dist/components/Overlay/Overlay.d.ts +261 -0
  34. package/dist/components/Paginator/Paginator.d.ts +8 -0
  35. package/dist/components/Panel/Panel.d.ts +13 -0
  36. package/dist/components/Section/Section.d.ts +3 -0
  37. package/dist/components/Statistic/Statistic.d.ts +11 -0
  38. package/dist/components/Table/Table.d.ts +27 -0
  39. package/dist/components/Tabs/Tab.d.ts +12 -0
  40. package/dist/components/Tabs/TabContent.d.ts +3 -0
  41. package/dist/components/Tabs/Tabs.d.ts +279 -0
  42. package/dist/components/Timeline/Timeline.d.ts +18 -0
  43. package/dist/components/TopBar/TopBar.d.ts +7 -0
  44. package/dist/fonts.d.ts +1 -0
  45. package/dist/form/Button/Button.d.ts +13 -0
  46. package/dist/form/Checkbox/Checkbox.d.ts +8 -0
  47. package/dist/form/FileField/FileField.d.ts +8 -0
  48. package/dist/form/PasswordStrengthField/PasswordStrenghField.d.ts +9 -0
  49. package/dist/form/ScaffoldForm/FormGrid/FormGrid.d.ts +7 -0
  50. package/dist/form/ScaffoldForm/FormGrid/FormGridCell.d.ts +14 -0
  51. package/dist/form/ScaffoldForm/FormGrid/FormGridWrapper.d.ts +10 -0
  52. package/dist/form/ScaffoldForm/ScaffoldField.d.ts +9 -0
  53. package/dist/form/ScaffoldForm/ScaffoldForm.d.ts +10 -0
  54. package/dist/form/ScaffoldForm/ScaffoldFormProvider.d.ts +7 -0
  55. package/dist/form/ScaffoldForm/hooks/useScaffoldFormContext.d.ts +1 -0
  56. package/dist/form/ScaffoldForm/scaffoldFormProps.d.ts +80 -0
  57. package/dist/form/ScaffoldForm/scaffoldPasswordProps.d.ts +19 -0
  58. package/dist/form/ScaffoldForm/types.d.ts +34 -0
  59. package/dist/form/ScaffoldForm/utils/FormPositioner.d.ts +36 -0
  60. package/dist/form/ScaffoldForm/utils/Grid.d.ts +38 -0
  61. package/dist/form/ScaffoldForm/utils/Grid.test.d.ts +1 -0
  62. package/dist/form/ScaffoldForm/utils/assertGridIsValid.d.ts +6 -0
  63. package/dist/form/ScaffoldForm/utils/assertGridIsValid.test.d.ts +1 -0
  64. package/dist/form/ScaffoldForm/utils/equalColumns.d.ts +1 -0
  65. package/dist/form/Select/Select.d.ts +6 -0
  66. package/dist/form/TextField/TextField.d.ts +9 -0
  67. package/dist/index.d.ts +58 -0
  68. package/dist/layouts/BasicLayout/BasicLayout.d.ts +13 -0
  69. package/dist/layouts/FloatingPanelLayout/FloatingPanelLayout.d.ts +12 -0
  70. package/dist/layouts/constants.d.ts +2 -0
  71. package/dist/responsiveness/responsiveProps.d.ts +17 -0
  72. package/dist/responsiveness/useResponsiveBreakpoints.d.ts +6 -0
  73. package/dist/theme.d.ts +2 -0
  74. package/dist/typography/Fonts.d.ts +2 -0
  75. package/dist/typography/Header/Header.d.ts +6 -0
  76. package/dist/typography/Paragraph/Paragraph.d.ts +261 -0
  77. package/package.json +10 -6
package/dist/bundle.js ADDED
@@ -0,0 +1,4741 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var styledComponents = require('styled-components');
5
+ var immer = require('immer');
6
+
7
+ function styleInject(css, ref) {
8
+ if ( ref === void 0 ) ref = {};
9
+ var insertAt = ref.insertAt;
10
+
11
+ if (!css || typeof document === 'undefined') { return; }
12
+
13
+ var head = document.head || document.getElementsByTagName('head')[0];
14
+ var style = document.createElement('style');
15
+ style.type = 'text/css';
16
+
17
+ if (insertAt === 'top') {
18
+ if (head.firstChild) {
19
+ head.insertBefore(style, head.firstChild);
20
+ } else {
21
+ head.appendChild(style);
22
+ }
23
+ } else {
24
+ head.appendChild(style);
25
+ }
26
+
27
+ if (style.styleSheet) {
28
+ style.styleSheet.cssText = css;
29
+ } else {
30
+ style.appendChild(document.createTextNode(css));
31
+ }
32
+ }
33
+
34
+ var css_248z$2 = ":root {\n --common-black: rgba(0,0,0,.87);\n --common-white: #fff;\n\n --colors-blue: #007bff;\n --colors-indigo: #6610f2;\n --colors-purple: #6f42c1;\n --colors-pink: #e83e8c;\n --colors-red: #e83e3e;\n --colors-orange: #fd7e14;\n --colors-yellow: #ffc107;\n --colors-green: #23B294;\n --colors-teal: #20c997;\n --colors-cyan: #17a2b8;\n --colors-gray: #6c757d;\n --colors-grayDark: #343a40;\n --colors-light: #f8f9fa;\n --colors-dark: #343a40;\n\n --form-hint: #C7C7C7;\n --form-error: #9f3a38\n;\n --button-basic-idle-background: #fff;\n --button-basic-idle-text: rgba(0,0,0,.87);\n --button-basic-hover-background: #e5e5e5;\n --button-basic-hover-text: rgba(0,0,0,0.883);\n --button-basic-active-background: #ccc;\n --button-basic-active-text: rgba(0,0,0,0.8960000000000001);\n\n --button-default-idle-background: #e0e1e2;\n --button-default-idle-text: rgba(0,0,0,.87);\n --button-default-hover-background: #c9cacb;\n --button-default-hover-text: rgba(0,0,0,0.883);\n --button-default-active-background: #b3b4b4;\n --button-default-active-text: rgba(0,0,0,0.8960000000000001);\n\n --button-text-idle-text: #999c9e;\n --button-text-idle-background: transparent;\n --button-text-active-text: rgba(0,0,0,.87);\n --button-text-active-background: transparent;\n --button-text-hover-text: rgba(0,0,0,.87);\n --button-text-hover-background: transparent;\n\n --button-danger-idle-background: #EC5969;\n --button-danger-idle-text: #fff;\n --button-danger-hover-background: #d4505e;\n --button-danger-hover-text: #fff;\n --button-danger-active-background: #bc4754;\n --button-danger-active-text: #fff;\n\n --button-primary-idle-background: #2284C4;\n --button-primary-idle-text: #fff;\n --button-primary-hover-background: #1e76b0;\n --button-primary-hover-text: #fff;\n --button-primary-active-background: #1b699c;\n --button-primary-active-text: #fff;\n\n --button-secondary-idle-background: #23B294;\n --button-secondary-idle-text: #fff;\n --button-secondary-hover-background: #1fa085;\n --button-secondary-hover-text: #fff;\n --button-secondary-active-background: #1c8e76;\n --button-secondary-active-text: #fff;\n\n --pane-basic-main-idle-text: rgba(0,0,0,.87);\n --pane-basic-main-idle-background: #fff;\n --pane-basic-main-idle-border: #ddd;\n --pane-basic-main-hover-text: rgba(0,0,0,.87);\n --pane-basic-main-hover-background: #f2f2f2;\n --pane-basic-main-hover-border: #ddd;\n --pane-basic-alternate-idle-text: rgba(0,0,0,.87);\n --pane-basic-alternate-idle-background: #f9f9f9;\n --pane-basic-alternate-idle-border: #ddd;\n --pane-basic-alternate-hover-text: rgba(0,0,0,.87);\n --pane-basic-alternate-hover-background: #f2f2f2;\n --pane-basic-alternate-hover-border: #ddd;\n\n --pane-emphasized-main-idle-text: rgba(0,0,0,.87);\n --pane-emphasized-main-idle-background: #f3f3f3;\n --pane-emphasized-main-idle-border: #ddd;\n --pane-emphasized-main-hover-text: rgba(0,0,0,.87);\n --pane-emphasized-main-hover-background: #e6e6e6;\n --pane-emphasized-main-hover-border: #ddd;\n --pane-emphasized-alternate-idle-text: rgba(0,0,0,.87);\n --pane-emphasized-alternate-idle-background: #eee;\n --pane-emphasized-alternate-idle-border: #ddd;\n --pane-emphasized-alternate-hover-text: rgba(0,0,0,.87);\n --pane-emphasized-alternate-hover-background: #e6e6e6;\n --pane-emphasized-alternate-hover-border: #ddd;\n\n --pane-info-main-idle-text: #0c5460;\n --pane-info-main-idle-background: #d1ecf1;\n --pane-info-main-idle-border: #bee5eb;\n --pane-info-main-hover-text: #0c5460;\n --pane-info-main-hover-background: #c6e0e4;\n --pane-info-main-hover-border: #bee5eb;\n --pane-info-alternate-idle-text: #0c5460;\n --pane-info-alternate-idle-background: #cce7ec;\n --pane-info-alternate-idle-border: #bee5eb;\n --pane-info-alternate-hover-text: #0c5460;\n --pane-info-alternate-hover-background: #c6e0e4;\n --pane-info-alternate-hover-border: #bee5eb;\n\n --pane-negative-main-idle-text: #721c24;\n --pane-negative-main-idle-background: #f8d7da;\n --pane-negative-main-idle-border: #f5c6cb;\n --pane-negative-main-hover-text: #721c24;\n --pane-negative-main-hover-background: #ebcccf;\n --pane-negative-main-hover-border: #f5c6cb;\n --pane-negative-alternate-idle-text: #721c24;\n --pane-negative-alternate-idle-background: #f3d2d5;\n --pane-negative-alternate-idle-border: #f5c6cb;\n --pane-negative-alternate-hover-text: #721c24;\n --pane-negative-alternate-hover-background: #ebcccf;\n --pane-negative-alternate-hover-border: #f5c6cb;\n\n --pane-positive-main-idle-text: #155724;\n --pane-positive-main-idle-background: #d4edda;\n --pane-positive-main-idle-border: #c3e6cb;\n --pane-positive-main-hover-text: #155724;\n --pane-positive-main-hover-background: #c9e1cf;\n --pane-positive-main-hover-border: #c3e6cb;\n --pane-positive-alternate-idle-text: #155724;\n --pane-positive-alternate-idle-background: #cfe8d5;\n --pane-positive-alternate-idle-border: #c3e6cb;\n --pane-positive-alternate-hover-text: #155724;\n --pane-positive-alternate-hover-background: #c9e1cf;\n --pane-positive-alternate-hover-border: #c3e6cb;\n\n --pane-warning-main-idle-text: #856404;\n --pane-warning-main-idle-background: #fff3cd;\n --pane-warning-main-idle-border: #ffeeba;\n --pane-warning-main-hover-text: #856404;\n --pane-warning-main-hover-background: #f2e6c2;\n --pane-warning-main-hover-border: #ffeeba;\n --pane-warning-alternate-idle-text: #856404;\n --pane-warning-alternate-idle-background: #f9eec8;\n --pane-warning-alternate-idle-border: #ffeeba;\n --pane-warning-alternate-hover-text: #856404;\n --pane-warning-alternate-hover-background: #f2e6c2;\n --pane-warning-alternate-hover-border: #ffeeba;\n\n\n --spacing: 4px;\n --spacing-2: calc(var(--spacing) * 2);\n --spacing-3: calc(var(--spacing) * 3);\n --spacing-4: calc(var(--spacing) * 4);\n --spacing-5: calc(var(--spacing) * 5);\n}";
35
+ styleInject(css_248z$2);
36
+
37
+ /******************************************************************************
38
+ Copyright (c) Microsoft Corporation.
39
+
40
+ Permission to use, copy, modify, and/or distribute this software for any
41
+ purpose with or without fee is hereby granted.
42
+
43
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
44
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
45
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
46
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
47
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
48
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
49
+ PERFORMANCE OF THIS SOFTWARE.
50
+ ***************************************************************************** */
51
+ /* global Reflect, Promise, SuppressedError, Symbol */
52
+
53
+
54
+ function __rest(s, e) {
55
+ var t = {};
56
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
57
+ t[p] = s[p];
58
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
59
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
60
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
61
+ t[p[i]] = s[p[i]];
62
+ }
63
+ return t;
64
+ }
65
+
66
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
67
+ var e = new Error(message);
68
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
69
+ };
70
+
71
+ function _extends() {
72
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
73
+ for (var i = 1; i < arguments.length; i++) {
74
+ var source = arguments[i];
75
+ for (var key in source) {
76
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
77
+ target[key] = source[key];
78
+ }
79
+ }
80
+ }
81
+ return target;
82
+ };
83
+ return _extends.apply(this, arguments);
84
+ }
85
+
86
+ function _assertThisInitialized(self) {
87
+ if (self === void 0) {
88
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
89
+ }
90
+ return self;
91
+ }
92
+
93
+ function _setPrototypeOf(o, p) {
94
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
95
+ o.__proto__ = p;
96
+ return o;
97
+ };
98
+ return _setPrototypeOf(o, p);
99
+ }
100
+
101
+ function _inheritsLoose(subClass, superClass) {
102
+ subClass.prototype = Object.create(superClass.prototype);
103
+ subClass.prototype.constructor = subClass;
104
+ _setPrototypeOf(subClass, superClass);
105
+ }
106
+
107
+ function _getPrototypeOf(o) {
108
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
109
+ return o.__proto__ || Object.getPrototypeOf(o);
110
+ };
111
+ return _getPrototypeOf(o);
112
+ }
113
+
114
+ function _isNativeFunction(fn) {
115
+ try {
116
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
117
+ } catch (e) {
118
+ return typeof fn === "function";
119
+ }
120
+ }
121
+
122
+ function _isNativeReflectConstruct() {
123
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
124
+ if (Reflect.construct.sham) return false;
125
+ if (typeof Proxy === "function") return true;
126
+ try {
127
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
128
+ return true;
129
+ } catch (e) {
130
+ return false;
131
+ }
132
+ }
133
+
134
+ function _construct(Parent, args, Class) {
135
+ if (_isNativeReflectConstruct()) {
136
+ _construct = Reflect.construct.bind();
137
+ } else {
138
+ _construct = function _construct(Parent, args, Class) {
139
+ var a = [null];
140
+ a.push.apply(a, args);
141
+ var Constructor = Function.bind.apply(Parent, a);
142
+ var instance = new Constructor();
143
+ if (Class) _setPrototypeOf(instance, Class.prototype);
144
+ return instance;
145
+ };
146
+ }
147
+ return _construct.apply(null, arguments);
148
+ }
149
+
150
+ function _wrapNativeSuper(Class) {
151
+ var _cache = typeof Map === "function" ? new Map() : undefined;
152
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
153
+ if (Class === null || !_isNativeFunction(Class)) return Class;
154
+ if (typeof Class !== "function") {
155
+ throw new TypeError("Super expression must either be null or a function");
156
+ }
157
+ if (typeof _cache !== "undefined") {
158
+ if (_cache.has(Class)) return _cache.get(Class);
159
+ _cache.set(Class, Wrapper);
160
+ }
161
+ function Wrapper() {
162
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
163
+ }
164
+ Wrapper.prototype = Object.create(Class.prototype, {
165
+ constructor: {
166
+ value: Wrapper,
167
+ enumerable: false,
168
+ writable: true,
169
+ configurable: true
170
+ }
171
+ });
172
+ return _setPrototypeOf(Wrapper, Class);
173
+ };
174
+ return _wrapNativeSuper(Class);
175
+ }
176
+
177
+ // based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
178
+
179
+ /**
180
+ * Parse errors.md and turn it into a simple hash of code: message
181
+ * @private
182
+ */
183
+ var ERRORS = {
184
+ "1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",
185
+ "2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
186
+ "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
187
+ "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
188
+ "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
189
+ "6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",
190
+ "7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",
191
+ "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
192
+ "9": "Please provide a number of steps to the modularScale helper.\n\n",
193
+ "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
194
+ "11": "Invalid value passed as base to modularScale, expected number or em string but got \"%s\"\n\n",
195
+ "12": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got \"%s\" instead.\n\n",
196
+ "13": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got \"%s\" instead.\n\n",
197
+ "14": "Passed invalid pixel value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
198
+ "15": "Passed invalid base value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
199
+ "16": "You must provide a template to this method.\n\n",
200
+ "17": "You passed an unsupported selector state to this method.\n\n",
201
+ "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
202
+ "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
203
+ "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
204
+ "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
205
+ "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
206
+ "23": "fontFace expects a name of a font-family.\n\n",
207
+ "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
208
+ "25": "fontFace expects localFonts to be an array.\n\n",
209
+ "26": "fontFace expects fileFormats to be an array.\n\n",
210
+ "27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
211
+ "28": "Please supply a filename to retinaImage() as the first argument.\n\n",
212
+ "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
213
+ "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
214
+ "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
215
+ "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
216
+ "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
217
+ "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
218
+ "35": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
219
+ "36": "Property must be a string value.\n\n",
220
+ "37": "Syntax Error at %s.\n\n",
221
+ "38": "Formula contains a function that needs parentheses at %s.\n\n",
222
+ "39": "Formula is missing closing parenthesis at %s.\n\n",
223
+ "40": "Formula has too many closing parentheses at %s.\n\n",
224
+ "41": "All values in a formula must have the same unit or be unitless.\n\n",
225
+ "42": "Please provide a number of steps to the modularScale helper.\n\n",
226
+ "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
227
+ "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
228
+ "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
229
+ "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
230
+ "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
231
+ "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
232
+ "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
233
+ "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
234
+ "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
235
+ "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
236
+ "53": "fontFace expects localFonts to be an array.\n\n",
237
+ "54": "fontFace expects fileFormats to be an array.\n\n",
238
+ "55": "fontFace expects a name of a font-family.\n\n",
239
+ "56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
240
+ "57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
241
+ "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
242
+ "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
243
+ "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
244
+ "61": "Property must be a string value.\n\n",
245
+ "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
246
+ "63": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
247
+ "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
248
+ "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
249
+ "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
250
+ "67": "You must provide a template to this method.\n\n",
251
+ "68": "You passed an unsupported selector state to this method.\n\n",
252
+ "69": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got %s instead.\n\n",
253
+ "70": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got %s instead.\n\n",
254
+ "71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
255
+ "72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
256
+ "73": "Please provide a valid CSS variable.\n\n",
257
+ "74": "CSS variable not found and no default was provided.\n\n",
258
+ "75": "important requires a valid style object, got a %s instead.\n\n",
259
+ "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
260
+ "77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
261
+ "78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
262
+ };
263
+ /**
264
+ * super basic version of sprintf
265
+ * @private
266
+ */
267
+
268
+ function format() {
269
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
270
+ args[_key] = arguments[_key];
271
+ }
272
+
273
+ var a = args[0];
274
+ var b = [];
275
+ var c;
276
+
277
+ for (c = 1; c < args.length; c += 1) {
278
+ b.push(args[c]);
279
+ }
280
+
281
+ b.forEach(function (d) {
282
+ a = a.replace(/%[a-z]/, d);
283
+ });
284
+ return a;
285
+ }
286
+ /**
287
+ * Create an error file out of errors.md for development and a simple web link to the full errors
288
+ * in production mode.
289
+ * @private
290
+ */
291
+
292
+
293
+ var PolishedError = /*#__PURE__*/function (_Error) {
294
+ _inheritsLoose(PolishedError, _Error);
295
+
296
+ function PolishedError(code) {
297
+ var _this;
298
+
299
+ if (process.env.NODE_ENV === 'production') {
300
+ _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
301
+ } else {
302
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
303
+ args[_key2 - 1] = arguments[_key2];
304
+ }
305
+
306
+ _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
307
+ }
308
+
309
+ return _assertThisInitialized(_this);
310
+ }
311
+
312
+ return PolishedError;
313
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
314
+
315
+ function colorToInt(color) {
316
+ return Math.round(color * 255);
317
+ }
318
+
319
+ function convertToInt(red, green, blue) {
320
+ return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
321
+ }
322
+
323
+ function hslToRgb(hue, saturation, lightness, convert) {
324
+ if (convert === void 0) {
325
+ convert = convertToInt;
326
+ }
327
+
328
+ if (saturation === 0) {
329
+ // achromatic
330
+ return convert(lightness, lightness, lightness);
331
+ } // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
332
+
333
+
334
+ var huePrime = (hue % 360 + 360) % 360 / 60;
335
+ var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
336
+ var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
337
+ var red = 0;
338
+ var green = 0;
339
+ var blue = 0;
340
+
341
+ if (huePrime >= 0 && huePrime < 1) {
342
+ red = chroma;
343
+ green = secondComponent;
344
+ } else if (huePrime >= 1 && huePrime < 2) {
345
+ red = secondComponent;
346
+ green = chroma;
347
+ } else if (huePrime >= 2 && huePrime < 3) {
348
+ green = chroma;
349
+ blue = secondComponent;
350
+ } else if (huePrime >= 3 && huePrime < 4) {
351
+ green = secondComponent;
352
+ blue = chroma;
353
+ } else if (huePrime >= 4 && huePrime < 5) {
354
+ red = secondComponent;
355
+ blue = chroma;
356
+ } else if (huePrime >= 5 && huePrime < 6) {
357
+ red = chroma;
358
+ blue = secondComponent;
359
+ }
360
+
361
+ var lightnessModification = lightness - chroma / 2;
362
+ var finalRed = red + lightnessModification;
363
+ var finalGreen = green + lightnessModification;
364
+ var finalBlue = blue + lightnessModification;
365
+ return convert(finalRed, finalGreen, finalBlue);
366
+ }
367
+
368
+ var namedColorMap = {
369
+ aliceblue: 'f0f8ff',
370
+ antiquewhite: 'faebd7',
371
+ aqua: '00ffff',
372
+ aquamarine: '7fffd4',
373
+ azure: 'f0ffff',
374
+ beige: 'f5f5dc',
375
+ bisque: 'ffe4c4',
376
+ black: '000',
377
+ blanchedalmond: 'ffebcd',
378
+ blue: '0000ff',
379
+ blueviolet: '8a2be2',
380
+ brown: 'a52a2a',
381
+ burlywood: 'deb887',
382
+ cadetblue: '5f9ea0',
383
+ chartreuse: '7fff00',
384
+ chocolate: 'd2691e',
385
+ coral: 'ff7f50',
386
+ cornflowerblue: '6495ed',
387
+ cornsilk: 'fff8dc',
388
+ crimson: 'dc143c',
389
+ cyan: '00ffff',
390
+ darkblue: '00008b',
391
+ darkcyan: '008b8b',
392
+ darkgoldenrod: 'b8860b',
393
+ darkgray: 'a9a9a9',
394
+ darkgreen: '006400',
395
+ darkgrey: 'a9a9a9',
396
+ darkkhaki: 'bdb76b',
397
+ darkmagenta: '8b008b',
398
+ darkolivegreen: '556b2f',
399
+ darkorange: 'ff8c00',
400
+ darkorchid: '9932cc',
401
+ darkred: '8b0000',
402
+ darksalmon: 'e9967a',
403
+ darkseagreen: '8fbc8f',
404
+ darkslateblue: '483d8b',
405
+ darkslategray: '2f4f4f',
406
+ darkslategrey: '2f4f4f',
407
+ darkturquoise: '00ced1',
408
+ darkviolet: '9400d3',
409
+ deeppink: 'ff1493',
410
+ deepskyblue: '00bfff',
411
+ dimgray: '696969',
412
+ dimgrey: '696969',
413
+ dodgerblue: '1e90ff',
414
+ firebrick: 'b22222',
415
+ floralwhite: 'fffaf0',
416
+ forestgreen: '228b22',
417
+ fuchsia: 'ff00ff',
418
+ gainsboro: 'dcdcdc',
419
+ ghostwhite: 'f8f8ff',
420
+ gold: 'ffd700',
421
+ goldenrod: 'daa520',
422
+ gray: '808080',
423
+ green: '008000',
424
+ greenyellow: 'adff2f',
425
+ grey: '808080',
426
+ honeydew: 'f0fff0',
427
+ hotpink: 'ff69b4',
428
+ indianred: 'cd5c5c',
429
+ indigo: '4b0082',
430
+ ivory: 'fffff0',
431
+ khaki: 'f0e68c',
432
+ lavender: 'e6e6fa',
433
+ lavenderblush: 'fff0f5',
434
+ lawngreen: '7cfc00',
435
+ lemonchiffon: 'fffacd',
436
+ lightblue: 'add8e6',
437
+ lightcoral: 'f08080',
438
+ lightcyan: 'e0ffff',
439
+ lightgoldenrodyellow: 'fafad2',
440
+ lightgray: 'd3d3d3',
441
+ lightgreen: '90ee90',
442
+ lightgrey: 'd3d3d3',
443
+ lightpink: 'ffb6c1',
444
+ lightsalmon: 'ffa07a',
445
+ lightseagreen: '20b2aa',
446
+ lightskyblue: '87cefa',
447
+ lightslategray: '789',
448
+ lightslategrey: '789',
449
+ lightsteelblue: 'b0c4de',
450
+ lightyellow: 'ffffe0',
451
+ lime: '0f0',
452
+ limegreen: '32cd32',
453
+ linen: 'faf0e6',
454
+ magenta: 'f0f',
455
+ maroon: '800000',
456
+ mediumaquamarine: '66cdaa',
457
+ mediumblue: '0000cd',
458
+ mediumorchid: 'ba55d3',
459
+ mediumpurple: '9370db',
460
+ mediumseagreen: '3cb371',
461
+ mediumslateblue: '7b68ee',
462
+ mediumspringgreen: '00fa9a',
463
+ mediumturquoise: '48d1cc',
464
+ mediumvioletred: 'c71585',
465
+ midnightblue: '191970',
466
+ mintcream: 'f5fffa',
467
+ mistyrose: 'ffe4e1',
468
+ moccasin: 'ffe4b5',
469
+ navajowhite: 'ffdead',
470
+ navy: '000080',
471
+ oldlace: 'fdf5e6',
472
+ olive: '808000',
473
+ olivedrab: '6b8e23',
474
+ orange: 'ffa500',
475
+ orangered: 'ff4500',
476
+ orchid: 'da70d6',
477
+ palegoldenrod: 'eee8aa',
478
+ palegreen: '98fb98',
479
+ paleturquoise: 'afeeee',
480
+ palevioletred: 'db7093',
481
+ papayawhip: 'ffefd5',
482
+ peachpuff: 'ffdab9',
483
+ peru: 'cd853f',
484
+ pink: 'ffc0cb',
485
+ plum: 'dda0dd',
486
+ powderblue: 'b0e0e6',
487
+ purple: '800080',
488
+ rebeccapurple: '639',
489
+ red: 'f00',
490
+ rosybrown: 'bc8f8f',
491
+ royalblue: '4169e1',
492
+ saddlebrown: '8b4513',
493
+ salmon: 'fa8072',
494
+ sandybrown: 'f4a460',
495
+ seagreen: '2e8b57',
496
+ seashell: 'fff5ee',
497
+ sienna: 'a0522d',
498
+ silver: 'c0c0c0',
499
+ skyblue: '87ceeb',
500
+ slateblue: '6a5acd',
501
+ slategray: '708090',
502
+ slategrey: '708090',
503
+ snow: 'fffafa',
504
+ springgreen: '00ff7f',
505
+ steelblue: '4682b4',
506
+ tan: 'd2b48c',
507
+ teal: '008080',
508
+ thistle: 'd8bfd8',
509
+ tomato: 'ff6347',
510
+ turquoise: '40e0d0',
511
+ violet: 'ee82ee',
512
+ wheat: 'f5deb3',
513
+ white: 'fff',
514
+ whitesmoke: 'f5f5f5',
515
+ yellow: 'ff0',
516
+ yellowgreen: '9acd32'
517
+ };
518
+ /**
519
+ * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
520
+ * @private
521
+ */
522
+
523
+ function nameToHex(color) {
524
+ if (typeof color !== 'string') return color;
525
+ var normalizedColorName = color.toLowerCase();
526
+ return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
527
+ }
528
+
529
+ var hexRegex = /^#[a-fA-F0-9]{6}$/;
530
+ var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
531
+ var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
532
+ var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
533
+ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
534
+ var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
535
+ var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
536
+ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
537
+ /**
538
+ * Returns an RgbColor or RgbaColor object. This utility function is only useful
539
+ * if want to extract a color component. With the color util `toColorString` you
540
+ * can convert a RgbColor or RgbaColor object back to a string.
541
+ *
542
+ * @example
543
+ * // Assigns `{ red: 255, green: 0, blue: 0 }` to color1
544
+ * const color1 = parseToRgb('rgb(255, 0, 0)');
545
+ * // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
546
+ * const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
547
+ */
548
+
549
+ function parseToRgb(color) {
550
+ if (typeof color !== 'string') {
551
+ throw new PolishedError(3);
552
+ }
553
+
554
+ var normalizedColor = nameToHex(color);
555
+
556
+ if (normalizedColor.match(hexRegex)) {
557
+ return {
558
+ red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
559
+ green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
560
+ blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
561
+ };
562
+ }
563
+
564
+ if (normalizedColor.match(hexRgbaRegex)) {
565
+ var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
566
+ return {
567
+ red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
568
+ green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
569
+ blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
570
+ alpha: alpha
571
+ };
572
+ }
573
+
574
+ if (normalizedColor.match(reducedHexRegex)) {
575
+ return {
576
+ red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
577
+ green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
578
+ blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
579
+ };
580
+ }
581
+
582
+ if (normalizedColor.match(reducedRgbaHexRegex)) {
583
+ var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
584
+
585
+ return {
586
+ red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
587
+ green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
588
+ blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
589
+ alpha: _alpha
590
+ };
591
+ }
592
+
593
+ var rgbMatched = rgbRegex.exec(normalizedColor);
594
+
595
+ if (rgbMatched) {
596
+ return {
597
+ red: parseInt("" + rgbMatched[1], 10),
598
+ green: parseInt("" + rgbMatched[2], 10),
599
+ blue: parseInt("" + rgbMatched[3], 10)
600
+ };
601
+ }
602
+
603
+ var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
604
+
605
+ if (rgbaMatched) {
606
+ return {
607
+ red: parseInt("" + rgbaMatched[1], 10),
608
+ green: parseInt("" + rgbaMatched[2], 10),
609
+ blue: parseInt("" + rgbaMatched[3], 10),
610
+ alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
611
+ };
612
+ }
613
+
614
+ var hslMatched = hslRegex.exec(normalizedColor);
615
+
616
+ if (hslMatched) {
617
+ var hue = parseInt("" + hslMatched[1], 10);
618
+ var saturation = parseInt("" + hslMatched[2], 10) / 100;
619
+ var lightness = parseInt("" + hslMatched[3], 10) / 100;
620
+ var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
621
+ var hslRgbMatched = rgbRegex.exec(rgbColorString);
622
+
623
+ if (!hslRgbMatched) {
624
+ throw new PolishedError(4, normalizedColor, rgbColorString);
625
+ }
626
+
627
+ return {
628
+ red: parseInt("" + hslRgbMatched[1], 10),
629
+ green: parseInt("" + hslRgbMatched[2], 10),
630
+ blue: parseInt("" + hslRgbMatched[3], 10)
631
+ };
632
+ }
633
+
634
+ var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
635
+
636
+ if (hslaMatched) {
637
+ var _hue = parseInt("" + hslaMatched[1], 10);
638
+
639
+ var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
640
+
641
+ var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
642
+
643
+ var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
644
+
645
+ var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
646
+
647
+ if (!_hslRgbMatched) {
648
+ throw new PolishedError(4, normalizedColor, _rgbColorString);
649
+ }
650
+
651
+ return {
652
+ red: parseInt("" + _hslRgbMatched[1], 10),
653
+ green: parseInt("" + _hslRgbMatched[2], 10),
654
+ blue: parseInt("" + _hslRgbMatched[3], 10),
655
+ alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
656
+ };
657
+ }
658
+
659
+ throw new PolishedError(5);
660
+ }
661
+
662
+ /**
663
+ * Reduces hex values if possible e.g. #ff8866 to #f86
664
+ * @private
665
+ */
666
+ var reduceHexValue = function reduceHexValue(value) {
667
+ if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
668
+ return "#" + value[1] + value[3] + value[5];
669
+ }
670
+
671
+ return value;
672
+ };
673
+
674
+ var reduceHexValue$1 = reduceHexValue;
675
+
676
+ function numberToHex(value) {
677
+ var hex = value.toString(16);
678
+ return hex.length === 1 ? "0" + hex : hex;
679
+ }
680
+
681
+ /**
682
+ * Returns a string value for the color. The returned result is the smallest possible hex notation.
683
+ *
684
+ * @example
685
+ * // Styles as object usage
686
+ * const styles = {
687
+ * background: rgb(255, 205, 100),
688
+ * background: rgb({ red: 255, green: 205, blue: 100 }),
689
+ * }
690
+ *
691
+ * // styled-components usage
692
+ * const div = styled.div`
693
+ * background: ${rgb(255, 205, 100)};
694
+ * background: ${rgb({ red: 255, green: 205, blue: 100 })};
695
+ * `
696
+ *
697
+ * // CSS in JS Output
698
+ *
699
+ * element {
700
+ * background: "#ffcd64";
701
+ * background: "#ffcd64";
702
+ * }
703
+ */
704
+ function rgb(value, green, blue) {
705
+ if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') {
706
+ return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
707
+ } else if (typeof value === 'object' && green === undefined && blue === undefined) {
708
+ return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
709
+ }
710
+
711
+ throw new PolishedError(6);
712
+ }
713
+
714
+ /**
715
+ * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
716
+ *
717
+ * Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value.
718
+ *
719
+ * @example
720
+ * // Styles as object usage
721
+ * const styles = {
722
+ * background: rgba(255, 205, 100, 0.7),
723
+ * background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }),
724
+ * background: rgba(255, 205, 100, 1),
725
+ * background: rgba('#ffffff', 0.4),
726
+ * background: rgba('black', 0.7),
727
+ * }
728
+ *
729
+ * // styled-components usage
730
+ * const div = styled.div`
731
+ * background: ${rgba(255, 205, 100, 0.7)};
732
+ * background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })};
733
+ * background: ${rgba(255, 205, 100, 1)};
734
+ * background: ${rgba('#ffffff', 0.4)};
735
+ * background: ${rgba('black', 0.7)};
736
+ * `
737
+ *
738
+ * // CSS in JS Output
739
+ *
740
+ * element {
741
+ * background: "rgba(255,205,100,0.7)";
742
+ * background: "rgba(255,205,100,0.7)";
743
+ * background: "#ffcd64";
744
+ * background: "rgba(255,255,255,0.4)";
745
+ * background: "rgba(0,0,0,0.7)";
746
+ * }
747
+ */
748
+ function rgba(firstValue, secondValue, thirdValue, fourthValue) {
749
+ if (typeof firstValue === 'string' && typeof secondValue === 'number') {
750
+ var rgbValue = parseToRgb(firstValue);
751
+ return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
752
+ } else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
753
+ return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
754
+ } else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
755
+ return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
756
+ }
757
+
758
+ throw new PolishedError(7);
759
+ }
760
+
761
+ // Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
762
+ // eslint-disable-next-line no-unused-vars
763
+ // eslint-disable-next-line no-unused-vars
764
+ // eslint-disable-next-line no-redeclare
765
+ function curried(f, length, acc) {
766
+ return function fn() {
767
+ // eslint-disable-next-line prefer-rest-params
768
+ var combined = acc.concat(Array.prototype.slice.call(arguments));
769
+ return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
770
+ };
771
+ } // eslint-disable-next-line no-redeclare
772
+
773
+
774
+ function curry(f) {
775
+ // eslint-disable-line no-redeclare
776
+ return curried(f, f.length, []);
777
+ }
778
+
779
+ /**
780
+ * Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight.
781
+ *
782
+ * @example
783
+ * // Styles as object usage
784
+ * const styles = {
785
+ * background: mix(0.5, '#f00', '#00f')
786
+ * background: mix(0.25, '#f00', '#00f')
787
+ * background: mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')
788
+ * }
789
+ *
790
+ * // styled-components usage
791
+ * const div = styled.div`
792
+ * background: ${mix(0.5, '#f00', '#00f')};
793
+ * background: ${mix(0.25, '#f00', '#00f')};
794
+ * background: ${mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')};
795
+ * `
796
+ *
797
+ * // CSS in JS Output
798
+ *
799
+ * element {
800
+ * background: "#7f007f";
801
+ * background: "#3f00bf";
802
+ * background: "rgba(63, 0, 191, 0.75)";
803
+ * }
804
+ */
805
+
806
+ function mix(weight, color, otherColor) {
807
+ if (color === 'transparent') return otherColor;
808
+ if (otherColor === 'transparent') return color;
809
+ if (weight === 0) return otherColor;
810
+ var parsedColor1 = parseToRgb(color);
811
+
812
+ var color1 = _extends({}, parsedColor1, {
813
+ alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
814
+ });
815
+
816
+ var parsedColor2 = parseToRgb(otherColor);
817
+
818
+ var color2 = _extends({}, parsedColor2, {
819
+ alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
820
+ }); // The formula is copied from the original Sass implementation:
821
+ // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
822
+
823
+
824
+ var alphaDelta = color1.alpha - color2.alpha;
825
+ var x = parseFloat(weight) * 2 - 1;
826
+ var y = x * alphaDelta === -1 ? x : x + alphaDelta;
827
+ var z = 1 + x * alphaDelta;
828
+ var weight1 = (y / z + 1) / 2.0;
829
+ var weight2 = 1 - weight1;
830
+ var mixedColor = {
831
+ red: Math.floor(color1.red * weight1 + color2.red * weight2),
832
+ green: Math.floor(color1.green * weight1 + color2.green * weight2),
833
+ blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
834
+ alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
835
+ };
836
+ return rgba(mixedColor);
837
+ } // prettier-ignore
838
+
839
+
840
+ var curriedMix = /*#__PURE__*/curry
841
+ /* ::<number | string, string, string, string> */
842
+ (mix);
843
+ var mix$1 = curriedMix;
844
+
845
+ /**
846
+ * Shades a color by mixing it with black. `shade` can produce
847
+ * hue shifts, where as `darken` manipulates the luminance channel and therefore
848
+ * doesn't produce hue shifts.
849
+ *
850
+ * @example
851
+ * // Styles as object usage
852
+ * const styles = {
853
+ * background: shade(0.25, '#00f')
854
+ * }
855
+ *
856
+ * // styled-components usage
857
+ * const div = styled.div`
858
+ * background: ${shade(0.25, '#00f')};
859
+ * `
860
+ *
861
+ * // CSS in JS Output
862
+ *
863
+ * element {
864
+ * background: "#00003f";
865
+ * }
866
+ */
867
+
868
+ function shade(percentage, color) {
869
+ if (color === 'transparent') return color;
870
+ return mix$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
871
+ } // prettier-ignore
872
+
873
+
874
+ var curriedShade = /*#__PURE__*/curry
875
+ /* ::<number | string, string, string> */
876
+ (shade);
877
+ var curriedShade$1 = curriedShade;
878
+
879
+ const SPACING = 4;
880
+ const BLACK = 'rgba(0,0,0,.87)';
881
+ const WHITE = '#fff';
882
+ const darkenPalette = (amount, palette, colorsToDarken) => Object
883
+ .entries(palette)
884
+ .reduce((acc, [key, val]) => (Object.assign(Object.assign({}, acc), { [key]: colorsToDarken.includes(key)
885
+ ? curriedShade$1(amount, val)
886
+ : val })), palette);
887
+ const createButtonPalette = (_a) => {
888
+ var { colorsToDarken } = _a, palette = __rest(_a, ["colorsToDarken"]);
889
+ return ({
890
+ idle: palette,
891
+ hover: darkenPalette(.1, palette, colorsToDarken),
892
+ active: darkenPalette(.2, palette, colorsToDarken),
893
+ });
894
+ };
895
+ const createPanePalette = (palette) => ({
896
+ main: {
897
+ idle: palette,
898
+ hover: darkenPalette(.05, palette, ['background'])
899
+ },
900
+ alternate: {
901
+ idle: darkenPalette(.02, palette, ['background']),
902
+ hover: darkenPalette(.05, palette, ['background']),
903
+ }
904
+ });
905
+ const theme = {
906
+ spacing: (...args) => args.map(arg => `${arg * SPACING}px`).join(' '),
907
+ palette: {
908
+ common: {
909
+ black: BLACK,
910
+ white: WHITE,
911
+ },
912
+ colors: {
913
+ blue: '#007bff',
914
+ indigo: '#6610f2',
915
+ purple: '#6f42c1',
916
+ pink: '#e83e8c',
917
+ red: '#e83e3e',
918
+ orange: '#fd7e14',
919
+ yellow: '#ffc107',
920
+ green: '#23B294',
921
+ teal: '#20c997',
922
+ cyan: '#17a2b8',
923
+ gray: '#6c757d',
924
+ grayDark: '#343a40',
925
+ light: '#f8f9fa',
926
+ dark: '#343a40',
927
+ },
928
+ form: {
929
+ hint: '#C7C7C7',
930
+ error: '#9f3a38',
931
+ },
932
+ button: {
933
+ basic: createButtonPalette({
934
+ colorsToDarken: ['background', 'text'],
935
+ background: WHITE,
936
+ text: BLACK,
937
+ }),
938
+ default: createButtonPalette({
939
+ colorsToDarken: ['background', 'text'],
940
+ background: '#e0e1e2',
941
+ text: BLACK,
942
+ }),
943
+ text: {
944
+ idle: {
945
+ text: '#999c9e',
946
+ background: 'transparent'
947
+ },
948
+ active: {
949
+ text: BLACK,
950
+ background: 'transparent'
951
+ },
952
+ hover: {
953
+ text: BLACK,
954
+ background: 'transparent'
955
+ }
956
+ },
957
+ danger: createButtonPalette({
958
+ colorsToDarken: ['background'],
959
+ background: '#EC5969',
960
+ text: WHITE,
961
+ }),
962
+ primary: createButtonPalette({
963
+ colorsToDarken: ['background'],
964
+ background: '#2284C4',
965
+ text: WHITE,
966
+ }),
967
+ secondary: createButtonPalette({
968
+ colorsToDarken: ['background'],
969
+ background: '#23B294',
970
+ text: WHITE
971
+ }),
972
+ },
973
+ pane: {
974
+ basic: createPanePalette({
975
+ text: BLACK,
976
+ background: WHITE,
977
+ border: '#ddd'
978
+ }),
979
+ emphasized: createPanePalette({
980
+ text: BLACK,
981
+ background: '#f3f3f3',
982
+ border: '#ddd'
983
+ }),
984
+ info: createPanePalette({
985
+ text: '#0c5460',
986
+ background: '#d1ecf1',
987
+ border: '#bee5eb'
988
+ }),
989
+ negative: createPanePalette({
990
+ text: '#721c24',
991
+ background: '#f8d7da',
992
+ border: '#f5c6cb'
993
+ }),
994
+ positive: createPanePalette({
995
+ text: '#155724',
996
+ background: '#d4edda',
997
+ border: '#c3e6cb',
998
+ }),
999
+ warning: createPanePalette({
1000
+ text: '#856404',
1001
+ background: '#fff3cd',
1002
+ border: '#ffeeba'
1003
+ })
1004
+ }
1005
+ }
1006
+ };
1007
+
1008
+ // Fix for styled-components with react-18.
1009
+ // Can be removed once this issue is resolved.
1010
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/59765#issuecomment-1092938253
1011
+ const ThemeProviderFixed = styledComponents.ThemeProvider;
1012
+ const UiProvider = ({ children, theme: themeOverride }) => (React.createElement(ThemeProviderFixed, { theme: themeOverride || theme }, children));
1013
+
1014
+ const noop$1 = () => { };
1015
+ const UiState = React.createContext({
1016
+ isSideMenuOpen: false,
1017
+ closeSideMenu: noop$1,
1018
+ openSideMenu: noop$1,
1019
+ });
1020
+ const useUiStateContext = () => React.useContext(UiState);
1021
+ const UiStateProvider = ({ children }) => {
1022
+ const [isSideMenuOpen, setIsSideMenuOpen] = React.useState(false);
1023
+ const handleCloseSideMenu = React.useCallback(() => setIsSideMenuOpen(false), []);
1024
+ const handleOpenSideMenu = React.useCallback(() => setIsSideMenuOpen(true), []);
1025
+ return (React.createElement(UiState.Provider, { value: {
1026
+ isSideMenuOpen,
1027
+ closeSideMenu: handleCloseSideMenu,
1028
+ openSideMenu: handleOpenSideMenu,
1029
+ } }, children));
1030
+ };
1031
+
1032
+ const Wrapper$c = styledComponents.styled.div `
1033
+ display: flex;
1034
+ flex-direction: column;
1035
+ height: 100%;
1036
+ font-family: Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
1037
+ color: ${props => props.theme.palette.common.black};
1038
+ font-size: 14px;
1039
+ `;
1040
+ const UiWrapper = ({ theme, children }) => (React.createElement(UiProvider, { theme: theme },
1041
+ React.createElement(UiStateProvider, null,
1042
+ React.createElement(Wrapper$c, null, children))));
1043
+
1044
+ function memoize(fn) {
1045
+ var cache = Object.create(null);
1046
+ return function (arg) {
1047
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
1048
+ return cache[arg];
1049
+ };
1050
+ }
1051
+
1052
+ var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
1053
+
1054
+ var isPropValid = /* #__PURE__ */memoize(function (prop) {
1055
+ return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
1056
+ /* o */
1057
+ && prop.charCodeAt(1) === 110
1058
+ /* n */
1059
+ && prop.charCodeAt(2) < 91;
1060
+ }
1061
+ /* Z+1 */
1062
+ );
1063
+
1064
+ const slideInFromTop = styledComponents.keyframes `
1065
+ 0% {
1066
+ opacity: 0;
1067
+ transform: translateY(-5px);
1068
+ }
1069
+ 100% {
1070
+ opacity: 1;
1071
+ transform: translateY(0);
1072
+ }
1073
+ `;
1074
+ const SlideInFromTop = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1075
+ animation: ${slideInFromTop} ${props => props.speed || '.3s'} ease-in 0s 1;
1076
+ `;
1077
+
1078
+ var css_248z$1 = ".Alert-module_wrapper__zP8eL {\n border-radius: 4px;\n}\n\n.Alert-module_variant-positive__Cqab0 {\n border: 1px solid var(--pane-positive-main-idle-border);\n background-color: var(--pane-positive-main-idle-background);\n color: var(--pane-positive-main-idle-text);\n }\n\n.Alert-module_variant-negative__mORCP {\n border: 1px solid var(--pane-negative-main-idle-border);\n background-color: var(--pane-negative-main-idle-background);\n color: var(--pane-negative-main-idle-text);\n }\n\n.Alert-module_variant-info__b3OY9 {\n border: 1px solid var(--pane-info-main-idle-border);\n background-color: var(--pane-info-main-idle-background);\n color: var(--pane-info-main-idle-text);\n }\n\n.Alert-module_variant-warning__gBX5- {\n border: 1px solid var(--pane-warning-main-idle-border);\n background-color: var(--pane-warning-main-idle-background);\n color: var(--pane-warning-main-idle-text);\n }\n\n.Alert-module_variant-basic__AQmn7 {\n border: 1px solid var(--pane-basic-main-idle-border);\n background-color: var(--pane-basic-main-idle-background);\n color: var(--pane-basic-main-idle-text);\n }\n\n.Alert-module_variant-emphasized__8GiYF {\n border: 1px solid var(--pane-emphasized-main-idle-border);\n background-color: var(--pane-emphasized-main-idle-background);\n color: var(--pane-emphasized-main-idle-text);\n }\n\n.Alert-module_variant-__raLwR {\n border: 1px solid var(--pane--main-idle-border);\n background-color: var(--pane--main-idle-background);\n color: var(--pane--main-idle-text);\n }";
1079
+ var classes$1 = {"wrapper":"Alert-module_wrapper__zP8eL","variant-positive":"Alert-module_variant-positive__Cqab0","variant-negative":"Alert-module_variant-negative__mORCP","variant-info":"Alert-module_variant-info__b3OY9","variant-warning":"Alert-module_variant-warning__gBX5-","variant-basic":"Alert-module_variant-basic__AQmn7","variant-emphasized":"Alert-module_variant-emphasized__8GiYF","variant-":"Alert-module_variant-__raLwR"};
1080
+ styleInject(css_248z$1);
1081
+
1082
+ const sharedStyles$1 = styledComponents.css `
1083
+ margin: 0 0;
1084
+ padding: 0 0;
1085
+ font-weight: 700;
1086
+ line-height: 1.28571429em;
1087
+ `;
1088
+ const H1 = styledComponents.styled.h1.withConfig({ shouldForwardProp: isPropValid }) `
1089
+ font-size: 2rem;
1090
+ min-height: 1rem;
1091
+ ${sharedStyles$1}
1092
+ `;
1093
+ const H2 = styledComponents.styled.h2.withConfig({ shouldForwardProp: isPropValid }) `
1094
+ font-size: 1.71428571rem;
1095
+ ${sharedStyles$1}
1096
+ `;
1097
+ const H3 = styledComponents.styled.h3.withConfig({ shouldForwardProp: isPropValid }) `
1098
+ font-size: 1.28571429rem;
1099
+ ${sharedStyles$1}
1100
+ `;
1101
+ const H4 = styledComponents.styled.h4.withConfig({ shouldForwardProp: isPropValid }) `
1102
+ font-size: 1.07142857rem;
1103
+ ${sharedStyles$1}
1104
+ `;
1105
+ const H5 = styledComponents.styled.h5.withConfig({ shouldForwardProp: isPropValid }) `
1106
+ font-size: 1rem;
1107
+ ${sharedStyles$1}
1108
+ `;
1109
+ const mapping = {
1110
+ 1: H1,
1111
+ 2: H2,
1112
+ 3: H3,
1113
+ 4: H4,
1114
+ 5: H5,
1115
+ };
1116
+ const Header = (_a) => {
1117
+ var { level = 1 } = _a, restProps = __rest(_a, ["level"]);
1118
+ const Component = mapping[level];
1119
+ // @ts-ignore
1120
+ return React.createElement(Component, Object.assign({}, restProps));
1121
+ };
1122
+
1123
+ const Paragraph = styledComponents.styled.p `
1124
+ font-size: 14px;
1125
+ line-height: 20px;
1126
+ // margin: 0 0 1em;
1127
+ margin: 0;
1128
+ `;
1129
+
1130
+ const breakPoints = [
1131
+ "mobile",
1132
+ "tablet",
1133
+ "laptop",
1134
+ "desktop",
1135
+ ];
1136
+ const BreakPointValues = {
1137
+ mobile: 0,
1138
+ tablet: 768,
1139
+ laptop: 1024,
1140
+ desktop: 1430,
1141
+ };
1142
+ /**
1143
+ * Wraps given cssRules in the corresponding media-query:
1144
+ */
1145
+ const mq = (bk, cssRules) => styledComponents.css `
1146
+ @media screen and (min-width: ${BreakPointValues[bk]}px) {
1147
+ ${cssRules}
1148
+ }
1149
+ `;
1150
+ const isResponsiveObject = (obj) => {
1151
+ if (typeof obj !== "object") {
1152
+ return false;
1153
+ }
1154
+ const keys = Object.keys(obj);
1155
+ for (const breakPoint of breakPoints) {
1156
+ if (keys.includes(breakPoint)) {
1157
+ return true;
1158
+ }
1159
+ }
1160
+ return false;
1161
+ };
1162
+ /**
1163
+ * Wraps 'responsive-props' in media-queries if necessary.
1164
+ */
1165
+ const responsiveProps = (props, map) => {
1166
+ const nonResponsiveRules = Object
1167
+ .entries(map)
1168
+ .filter(([key]) => props[key] !== undefined && !isResponsiveObject(props[key]))
1169
+ .map(([key, fun]) => fun(props[key]));
1170
+ const mediaQueries = breakPoints
1171
+ .map(bp => {
1172
+ // See if we can make css-rules for this breakpoint:
1173
+ const responsiveCssRules = Object
1174
+ .entries(map)
1175
+ .filter(([key]) => { var _a; return ((_a = props === null || props === void 0 ? void 0 : props[key]) === null || _a === void 0 ? void 0 : _a[bp]) !== undefined; })
1176
+ .map(([key, fun]) => fun(props[key][bp]));
1177
+ return (responsiveCssRules.length > 0)
1178
+ ? mq(bp, responsiveCssRules) // Wrap css-rules in a mediaQuery
1179
+ : undefined; // Undefined -> filter out later
1180
+ })
1181
+ .filter(_ => _ !== undefined);
1182
+ return [
1183
+ mediaQueries, ...nonResponsiveRules
1184
+ ];
1185
+ };
1186
+
1187
+ const Box = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1188
+ box-sizing: border-box;
1189
+
1190
+ ${(props) => responsiveProps(props, {
1191
+ "p": unit => styledComponents.css `padding: ${props.theme.spacing(unit)};`,
1192
+ "pt": unit => styledComponents.css `padding-top: ${props.theme.spacing(unit)};`,
1193
+ "pr": unit => styledComponents.css `padding-right: ${props.theme.spacing(unit)};`,
1194
+ "pb": unit => styledComponents.css `padding-bottom: ${props.theme.spacing(unit)};`,
1195
+ "pl": unit => styledComponents.css `padding-left: ${props.theme.spacing(unit)};`,
1196
+ "m": unit => styledComponents.css `margin: ${props.theme.spacing(unit)};`,
1197
+ "mt": unit => styledComponents.css `margin-top: ${props.theme.spacing(unit)};`,
1198
+ "mr": unit => styledComponents.css `margin-right: ${props.theme.spacing(unit)};`,
1199
+ "mb": unit => styledComponents.css `margin-bottom: ${props.theme.spacing(unit)};`,
1200
+ "ml": unit => styledComponents.css `margin-left: ${props.theme.spacing(unit)};`,
1201
+ "display": unit => styledComponents.css `display: ${unit};`,
1202
+ "flexGrow": unit => styledComponents.css `flex-grow: ${unit};`,
1203
+ "flexShrink": unit => styledComponents.css `flex-shrink: ${unit};`,
1204
+ "flexDirection": unit => styledComponents.css `flex-direction: ${unit};`,
1205
+ "alignItems": unit => styledComponents.css `align-items: ${unit};`,
1206
+ "textAlign": unit => styledComponents.css `text-align: ${unit};`,
1207
+ "justifyContent": unit => styledComponents.css `justify-content: ${unit};`,
1208
+ "width": unit => styledComponents.css `width: ${typeof unit === 'number' ? props.theme.spacing(unit) : unit};`,
1209
+ })}
1210
+ `;
1211
+
1212
+ function toVal(mix) {
1213
+ var k, y, str='';
1214
+
1215
+ if (typeof mix === 'string' || typeof mix === 'number') {
1216
+ str += mix;
1217
+ } else if (typeof mix === 'object') {
1218
+ if (Array.isArray(mix)) {
1219
+ for (k=0; k < mix.length; k++) {
1220
+ if (mix[k]) {
1221
+ if (y = toVal(mix[k])) {
1222
+ str && (str += ' ');
1223
+ str += y;
1224
+ }
1225
+ }
1226
+ }
1227
+ } else {
1228
+ for (k in mix) {
1229
+ if (mix[k]) {
1230
+ str && (str += ' ');
1231
+ str += k;
1232
+ }
1233
+ }
1234
+ }
1235
+ }
1236
+
1237
+ return str;
1238
+ }
1239
+
1240
+ function clsx () {
1241
+ var i=0, tmp, x, str='';
1242
+ while (i < arguments.length) {
1243
+ if (tmp = arguments[i++]) {
1244
+ if (x = toVal(tmp)) {
1245
+ str && (str += ' ');
1246
+ str += x;
1247
+ }
1248
+ }
1249
+ }
1250
+ return str;
1251
+ }
1252
+
1253
+ const Alert = ({ children, title, variant = "basic" }) => (React.createElement("div", { className: clsx(classes$1.wrapper, classes$1[`variant-${variant}`]) },
1254
+ React.createElement(Box, { p: 3 },
1255
+ title && (React.createElement(Box, { pb: children ? 1 : 0 },
1256
+ React.createElement(Header, { level: 4 }, title))),
1257
+ children && React.createElement(Paragraph, null, children))));
1258
+
1259
+ const green = '#20c997';
1260
+ const Mask = styledComponents.styled.g `
1261
+ fill: none;
1262
+ stroke: ${green};
1263
+ stroke-width: 10;
1264
+ `;
1265
+ const polyLineAnimation = styledComponents.keyframes `
1266
+ 0% {
1267
+ stroke-dashoffset: 100px
1268
+ }
1269
+ 100% {
1270
+ stroke-dashoffset: 0px
1271
+ }
1272
+ `;
1273
+ const Polyline = styledComponents.styled.polyline `
1274
+ stroke-dasharray: 100px, 100px;
1275
+ stroke-dashoffset: 200px;
1276
+ animation: ${polyLineAnimation} 0.42s ease-in-out 0.8s backwards;
1277
+ stroke: ${green};
1278
+ stroke-width: 10;
1279
+ `;
1280
+ const circleAnimation = styledComponents.keyframes `
1281
+ 0% {
1282
+ stroke-dashoffset: 480px
1283
+ }
1284
+ 100% {
1285
+ stroke-dashoffset: 960px
1286
+ }
1287
+ `;
1288
+ const Circle$1 = styledComponents.styled.circle `
1289
+ stroke-dasharray: 480px, 480px;
1290
+ stroke-dashoffset: 960px;
1291
+ animation: ${circleAnimation} 0.6s ease-in-out backwards;
1292
+ stroke: ${green};
1293
+ stroke-width: 10;
1294
+ `;
1295
+ const circleColoredAnimation = styledComponents.keyframes `
1296
+ 0% {
1297
+ opacity:0;
1298
+ }
1299
+ 100% {
1300
+ opacity:100;
1301
+ }
1302
+ `;
1303
+ const CircleColored = styledComponents.styled.circle `
1304
+ stroke-dasharray: 480px, 480px;
1305
+ stroke-dashoffset: 960px;
1306
+ animation: ${circleColoredAnimation} 1.2s ease-in-out 1.4s backwards;
1307
+ fill: #effaf8;
1308
+ `;
1309
+ const AnimatedCheckmark = () => (React.createElement("svg", { viewBox: "0 0 154 154" },
1310
+ React.createElement(Mask, null,
1311
+ React.createElement(Circle$1, { cx: '77', cy: '77', r: '72' }),
1312
+ React.createElement(CircleColored, { cx: '77', cy: '77', r: '72' }),
1313
+ React.createElement(Polyline, { points: "43.5,77.8 63.7,97.9 112.2,49.4" }))));
1314
+
1315
+ var css_248z = ".BreadCrumbs-module_breadcrumbs__-UMJj {\n list-style: none;\n padding: 0;\n margin: 0;\n display:flex;\n}\n\n.BreadCrumbs-module_crumb__SSW-t {\n display: flex;\n}\n\n.BreadCrumbs-module_crumb__SSW-t:not(:last-of-type):after {\n content: \"/\";\n color: var(--colors-gray);\n line-height: 1em;\n margin: auto auto;\n padding: 0 var(--spacing-2) 0 0;\n }";
1316
+ var classes = {"breadcrumbs":"BreadCrumbs-module_breadcrumbs__-UMJj","crumb":"BreadCrumbs-module_crumb__SSW-t"};
1317
+ styleInject(css_248z);
1318
+
1319
+ const BreadCrumbs = (props) => React.createElement("ul", Object.assign({ className: clsx(classes.breadcrumbs, props.className) }, props));
1320
+ const Crumb = (props) => React.createElement("li", Object.assign({ className: clsx(classes.breadcrumbs, props.className) }, props));
1321
+
1322
+ const Wrapper$b = styledComponents.styled.div `
1323
+ background-color: ${props => props.theme.palette.common.white};
1324
+ border-radius: 4px;
1325
+ border: 1px solid #DEDEDF;
1326
+ box-shadow: 0px 2px 3px rgb(0 0 0 / 6%);
1327
+ `;
1328
+ const Meta = styledComponents.styled(Box) `
1329
+ font-size: 12px;
1330
+ font-style: italic;
1331
+ `;
1332
+ const Title = styledComponents.styled(Box) `
1333
+ ${(props) => props.panelHasChildren && styledComponents.css `
1334
+ border-radius: 4px;
1335
+ border-bottom: 1px solid rgba(34,36,38,.15);
1336
+ `}
1337
+
1338
+ ${(props) => !!props.onClick && styledComponents.css `
1339
+ cursor: pointer;
1340
+ user-select: none;
1341
+ `}
1342
+ `;
1343
+ const Footer$1 = styledComponents.styled(Box) `
1344
+ border-radius: 4px;
1345
+ background-color: #FFF;
1346
+ border-top: 1px solid rgba(34,36,38,.15);
1347
+ `;
1348
+ const Panel = ({ children, className, title, titleAction, titleMeta, onClickTitle, footer, p = 3, titleLevel = 5 }) => (React.createElement(Wrapper$b, { className: className },
1349
+ title && (React.createElement(Title, { p: 3, panelHasChildren: !!children, display: "flex", alignItems: "center", onClick: onClickTitle },
1350
+ React.createElement(Box, { flexGrow: 1 },
1351
+ React.createElement(Header, { level: titleLevel }, title)),
1352
+ titleMeta && React.createElement(Meta, null, titleMeta),
1353
+ titleAction && React.createElement(Box, { pl: 5 }, titleAction))),
1354
+ children && (React.createElement(Box, { p: p }, children)),
1355
+ footer && (React.createElement(Footer$1, { p: 3 }, footer))));
1356
+
1357
+ const Animation = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1358
+ transform: ${props => props.isOpen ? `translate(0)` : `translateY(-101%)`};
1359
+ transition-duration: ${props => props.duration || 0.25}s;
1360
+ transition-property: transform;
1361
+ }
1362
+ `;
1363
+ const Wrapper$a = styledComponents.styled.div `
1364
+ overflow: hidden;
1365
+ `;
1366
+ const Hider = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1367
+ display: ${props => props.isHidden ? 'none' : 'block'};
1368
+ `;
1369
+ // Returns the boolean value in the next tick.
1370
+ // Allows for transition to start when DOM is updated, it prevents a flickers.
1371
+ const useOnNextTick = (val) => {
1372
+ const [delayedVal, setDelayedVal] = React.useState(val);
1373
+ React.useEffect(() => {
1374
+ const timeout = setTimeout(() => setDelayedVal(val), 0);
1375
+ return () => clearTimeout(timeout);
1376
+ }, [val, setDelayedVal]);
1377
+ return delayedVal;
1378
+ };
1379
+ const SlideOpen = ({ isOpen, children, duration, onChange }) => {
1380
+ const isDelayedOpen = useOnNextTick(isOpen);
1381
+ const [isHidden, setIsHidden] = React.useState(!isOpen);
1382
+ const handleTransitionEnd = React.useCallback(() => {
1383
+ if (!isOpen) {
1384
+ setIsHidden(true);
1385
+ onChange === null || onChange === void 0 ? void 0 : onChange(false);
1386
+ }
1387
+ }, [isOpen, onChange]);
1388
+ React.useEffect(() => {
1389
+ if (isOpen) {
1390
+ setIsHidden(false);
1391
+ onChange === null || onChange === void 0 ? void 0 : onChange(true);
1392
+ }
1393
+ }, [isOpen, onChange]);
1394
+ return (React.createElement(Wrapper$a, null,
1395
+ React.createElement(Animation, { isOpen: isDelayedOpen, onTransitionEndCapture: handleTransitionEnd, duration: duration },
1396
+ React.createElement(Hider, { isHidden: isHidden }, children))));
1397
+ };
1398
+
1399
+ const TitleActionWrapper = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1400
+ transform: scaleY( ${props => props.isOpen ? '-1' : '1'} );
1401
+ `;
1402
+ const StyledPanel$2 = styledComponents.styled(Panel) `
1403
+ ${props => !props.isOpen && styledComponents.css `border-bottom: 0;`}
1404
+ `;
1405
+ const CollapsiblePanel = (_a) => {
1406
+ var { isInitiallyOpen, children, titleAction } = _a, rest = __rest(_a, ["isInitiallyOpen", "children", "titleAction"]);
1407
+ const [isOpen, setIsOpen] = React.useState(isInitiallyOpen);
1408
+ const toggleOpen = React.useCallback(() => setIsOpen(!isOpen), [setIsOpen, isOpen]);
1409
+ return (React.createElement(StyledPanel$2, Object.assign({}, rest, { isOpen: isOpen, onClickTitle: toggleOpen, p: 0, titleAction: React.createElement(TitleActionWrapper, { isOpen: isOpen }, titleAction) }),
1410
+ React.createElement(SlideOpen, { isOpen: isOpen },
1411
+ React.createElement(Box, { p: 3 }, children))));
1412
+ };
1413
+
1414
+ const useConfirmModal = ({ onConfirm }) => {
1415
+ const [isOpen, setIsOpen] = React.useState(false);
1416
+ const onCancel = () => setIsOpen(false);
1417
+ const handleOpen = () => setIsOpen(true);
1418
+ const handleConfirm = () => {
1419
+ onConfirm();
1420
+ setIsOpen(false);
1421
+ };
1422
+ return [
1423
+ {
1424
+ onCancel,
1425
+ onConfirm: handleConfirm,
1426
+ isOpen,
1427
+ },
1428
+ handleOpen,
1429
+ ];
1430
+ };
1431
+
1432
+ const delay = styledComponents.keyframes `
1433
+ 0% {
1434
+ opacity: 0;
1435
+ }
1436
+ 100% {
1437
+ opacity: 1;
1438
+ }
1439
+ `;
1440
+ const Overlay = styledComponents.styled.div `
1441
+ position: fixed;
1442
+ top: 0;
1443
+ left: 0;
1444
+ right: 0;
1445
+ bottom: 0;
1446
+ z-index: 10;
1447
+ opacity: 0;
1448
+ background-color: rgba(0,0,0,0.6);
1449
+ animation: ${delay} 0.2s forwards;
1450
+ `;
1451
+
1452
+ const Wrapper$9 = styledComponents.styled.div `
1453
+ position: fixed;
1454
+ top: 0;
1455
+ left: 0;
1456
+ right: 0;
1457
+ bottom: 0;
1458
+
1459
+ display: flex;
1460
+ align-items: center;
1461
+ justify-content: center;
1462
+
1463
+ z-index: 50;
1464
+ `;
1465
+ const StyledPanel$1 = styledComponents.styled(Panel) `
1466
+ box-shadow: 0 8px 8px 0 rgba(34,36,38,.15);
1467
+ `;
1468
+ const Content = styledComponents.styled.div `
1469
+ line-height: ${props => props.theme.spacing(6)};
1470
+ font-size: 15px;
1471
+ `;
1472
+ const Modal = (_a) => {
1473
+ var { children, handleClickOverlay, buttons } = _a, panelProps = __rest(_a, ["children", "handleClickOverlay", "buttons"]);
1474
+ return (React.createElement(React.Fragment, null,
1475
+ React.createElement(Overlay, { onClick: handleClickOverlay }),
1476
+ React.createElement(Wrapper$9, null,
1477
+ React.createElement(SlideInFromTop, null,
1478
+ React.createElement(StyledPanel$1, Object.assign({ footer: buttons ? (React.createElement(Box, { display: "flex", justifyContent: "flex-end" }, buttons)) : undefined }, panelProps), children && (React.createElement(Content, null, children)))))));
1479
+ };
1480
+
1481
+ const Wrapper$8 = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1482
+ ${props => props.stretch && `width: 100%;`}
1483
+ ${props => props.actionButton || props.stretch
1484
+ ? styledComponents.css `margin: 0;`
1485
+ : styledComponents.css `margin: ${props => props.theme.spacing(0, 2, 0, 0)};`}
1486
+ `;
1487
+ const StyledButton$1 = styledComponents.styled.button.withConfig({ shouldForwardProp: isPropValid }) `
1488
+ font-size: 14px;
1489
+ font-weight: bold;
1490
+ letter-spacing: 1px;
1491
+ line-height: 1em;
1492
+ outline: 0;
1493
+ border: none;
1494
+ border-radius: 4px;
1495
+ cursor: pointer;
1496
+ text-decoration: none;
1497
+ font-family: "Open Sans", Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
1498
+ transition: background-color .1s ease, color .1s ease;
1499
+ display: flex;
1500
+ flex-direction: row;
1501
+ align-items: center;
1502
+ user-select: none;
1503
+ min-height: ${props => props.inline ? 'auto' : '38px'};
1504
+
1505
+ ${props => props.stretch && styledComponents.css `
1506
+ width: 100%;
1507
+ display: block;
1508
+ `}
1509
+
1510
+ ${props => props.actionButton && styledComponents.css `
1511
+ width: 100%;
1512
+ ${mq('laptop', `width: auto`)}
1513
+ `}
1514
+
1515
+
1516
+ ${props => props.variant !== 'text'
1517
+ ? !props.icon
1518
+ ? styledComponents.css `padding: ${props.theme.spacing(3, 5)}; min-width: ${props => props.theme.spacing(10)};`
1519
+ : props.hasChildren && styledComponents.css `position: relative; padding: ${props.theme.spacing(3, 5, 3, 13)};`
1520
+ : styledComponents.css `font-weight: 700; padding: 0;`}
1521
+
1522
+ &:disabled {
1523
+ opacity: .5;
1524
+ cursor: default;
1525
+ }
1526
+
1527
+ &:focus {
1528
+ background-blend-mode: darken;
1529
+ }
1530
+
1531
+ ${(props) => {
1532
+ if (props.variant === "basic") {
1533
+ return `
1534
+ border: 1px solid rgba(34,36,38,.15);
1535
+ `;
1536
+ }
1537
+ }}
1538
+
1539
+ ${(props) => {
1540
+ var _a;
1541
+ const { idle, hover, active } = theme.palette.button[(_a = props.variant) !== null && _a !== void 0 ? _a : 'default'];
1542
+ return `
1543
+ color: ${idle.text};
1544
+ background-color: ${idle.background};
1545
+
1546
+ &:not(:disabled) {
1547
+ &:hover, &:focus {
1548
+ color: ${hover.text};
1549
+ background-color: ${hover.background};
1550
+ }
1551
+
1552
+ &:active {
1553
+ color: ${active.text};
1554
+ background-color: ${active.background};
1555
+ }
1556
+ }
1557
+
1558
+ `;
1559
+ }}
1560
+ `;
1561
+ const IconWrapper$1 = styledComponents.styled.span.withConfig({ shouldForwardProp: isPropValid }) `
1562
+ ${props => props.variant !== "text" && styledComponents.css `
1563
+ min-width: ${props.theme.spacing(10)};
1564
+ `}
1565
+
1566
+ ${props => props.variant === "text"
1567
+ ? props.hasChildren && styledComponents.css `
1568
+ padding-right: ${props.theme.spacing(2)};
1569
+ `
1570
+ : props.hasChildren && styledComponents.css `
1571
+ position: absolute;
1572
+ left: 0;
1573
+ top: 0;
1574
+ width: ${props => props.theme.spacing(10)};
1575
+ height: 100%;
1576
+ background-color: rgba(0,0,0,.05);
1577
+
1578
+ & > svg {
1579
+ transform: translate(-50%, -50%);
1580
+ position: absolute;
1581
+ top: 50%;
1582
+ left: 50%;
1583
+ }
1584
+ `}
1585
+ `;
1586
+ const Button$1 = React.forwardRef((_a, ref) => {
1587
+ var { children, icon, stretch } = _a, props = __rest(_a, ["children", "icon", "stretch"]);
1588
+ return (React.createElement(Wrapper$8, { actionButton: props.actionButton, stretch: stretch },
1589
+ React.createElement(StyledButton$1, Object.assign({ ref: ref, icon: icon, hasChildren: !!children, stretch: stretch }, props),
1590
+ icon && (React.createElement(IconWrapper$1, { variant: props.variant, hasChildren: !!children }, icon)),
1591
+ children)));
1592
+ });
1593
+
1594
+ const ConfirmModal = ({ title, children, cancelLabel = "Nee, annuleren", confirmLabel = "Ja", confirmVariant = 'secondary', confirmIcon, cancelIcon, isOpen, onCancel, onConfirm, }) => {
1595
+ return isOpen ? (React.createElement(Modal, { title: title, handleClickOverlay: onCancel, buttons: React.createElement(React.Fragment, null,
1596
+ React.createElement(Button$1, { "data-testid": "btn-cancel", onClick: onCancel, variant: "basic", icon: cancelIcon }, cancelLabel),
1597
+ React.createElement(Button$1, { "data-testid": "btn-confirm", onClick: onConfirm, variant: confirmVariant, icon: confirmIcon }, confirmLabel)) }, children)) : null;
1598
+ };
1599
+
1600
+ const noop = () => { };
1601
+ const ConfirmButton = (_a) => {
1602
+ var _b;
1603
+ var { modalProps } = _a, buttonProps = __rest(_a, ["modalProps"]);
1604
+ const [modalHandlerProps, openModal] = useConfirmModal({
1605
+ onConfirm: (_b = modalProps.onConfirm) !== null && _b !== void 0 ? _b : noop
1606
+ });
1607
+ return React.createElement(React.Fragment, null,
1608
+ React.createElement(Button$1, Object.assign({}, buttonProps, { onClick: openModal })),
1609
+ React.createElement(ConfirmModal, Object.assign({ title: "Are you sure?" }, modalProps, modalHandlerProps)));
1610
+ };
1611
+
1612
+ const StyledTable = styledComponents.styled.table.withConfig({ shouldForwardProp: isPropValid }) `
1613
+ border-radius: 4px;
1614
+ width: 100%;
1615
+ border-collapse: separate;
1616
+ border-spacing: 0;
1617
+
1618
+ ${(props) => responsiveProps(props, {
1619
+ "tableLayout": unit => styledComponents.css `table-layout: ${unit};`,
1620
+ })}
1621
+ `;
1622
+ const StyledTableRow = styledComponents.styled.tr.withConfig({ shouldForwardProp: isPropValid }) `
1623
+ & > td {
1624
+ transition: background-color .1s ease, color .1s ease;
1625
+ }
1626
+
1627
+ ${props => Object.entries(props.theme.palette.pane).map(([variant, value]) => `
1628
+ &:nth-child(odd) > td.${variant} {
1629
+ color: ${value.main.idle.text};
1630
+ background-color: ${value.main.idle.background};
1631
+ }
1632
+ &:nth-child(even) > td.${variant} {
1633
+ color: ${value.alternate.idle.text};
1634
+ background-color: ${value.alternate.idle.background};
1635
+ }
1636
+
1637
+
1638
+ ${!props.disableHover && `
1639
+ &:nth-child(odd):hover > td.${variant} {
1640
+ color: ${value.main.hover.text};
1641
+ background-color: ${value.main.hover.background};
1642
+ }
1643
+ &:nth-child(even):hover > td.${variant} {
1644
+ color: ${value.alternate.hover.text};
1645
+ background-color: ${value.alternate.hover.background};
1646
+ }
1647
+ `}
1648
+ `)}
1649
+ `;
1650
+ const StyledTableCell = styledComponents.styled.td.withConfig({ shouldForwardProp: isPropValid }) `
1651
+ border-top: 1px solid rgba(34,36,38,.1);
1652
+ border-right: 1px solid rgba(34,36,38,.1);
1653
+ padding: ${props => props.theme.spacing(2, 3)};
1654
+
1655
+ &:last-of-type {
1656
+ border-right: 0;
1657
+ }
1658
+
1659
+ ${(props) => responsiveProps(props, {
1660
+ width: unit => styledComponents.css `width: ${unit};`,
1661
+ })}
1662
+ `;
1663
+ const StyledTableHeadCell = styledComponents.styled.th.withConfig({ shouldForwardProp: isPropValid }) `
1664
+ border-right: 1px solid rgba(34,36,38,.1);
1665
+ text-align: left;
1666
+ padding: ${props => props.theme.spacing(2, 3)};
1667
+ font-weight: 700;
1668
+ transition: background-color .1s ease, color .1s ease;
1669
+
1670
+ &:last-of-type {
1671
+ border-right: 0;
1672
+ }
1673
+
1674
+ ${props => !!props.variant && styledComponents.css `
1675
+ color: ${props.theme.palette.pane[props.variant].main.idle.text};
1676
+ background-color: ${props.theme.palette.pane[props.variant].main.idle.background};
1677
+
1678
+ &:hover {
1679
+ color: ${props.theme.palette.pane[props.variant].main.hover.text};
1680
+ background-color: ${props.theme.palette.pane[props.variant].main.hover.background};
1681
+ }
1682
+ `}
1683
+
1684
+ ${props => props.width ? `width: ${props.width};` : ''}
1685
+
1686
+ ${props => props.sortable && `
1687
+ cursor: pointer;
1688
+ user-select: none;
1689
+
1690
+ &:hover {
1691
+ background-color: ${props.theme.palette.pane.basic.main.hover.background};
1692
+ }
1693
+ `}
1694
+
1695
+ ${props => props.sortDirection && `
1696
+ position:relative;
1697
+
1698
+ &:after {
1699
+ content: " ";
1700
+ position: absolute;
1701
+ right: 15px;
1702
+ top: 50%;
1703
+
1704
+ height: 0;
1705
+ width: 0;
1706
+ border: 5px solid transparent;
1707
+
1708
+ ${props.sortDirection === 'asc' ? `
1709
+ border-top-color: #000;
1710
+ transform: translateY(-25%);
1711
+ ` : `
1712
+ border-bottom-color: #000;
1713
+ transform: translateY(-75%);
1714
+ `}
1715
+ }
1716
+ `}
1717
+ `;
1718
+ // Wrapper to allow for dot notated components:
1719
+ const Table = (props) => (React.createElement(StyledTable, Object.assign({}, props)));
1720
+ const TableCell = (_a) => {
1721
+ var { variant, className } = _a, rest = __rest(_a, ["variant", "className"]);
1722
+ return (React.createElement(StyledTableCell, Object.assign({ className: `${className || ''} ${variant || 'basic'}` }, rest)));
1723
+ };
1724
+ Table.Row = StyledTableRow;
1725
+ Table.HeadCell = StyledTableHeadCell;
1726
+ Table.Cell = TableCell;
1727
+
1728
+ const StyledCell = styledComponents.styled(Table.Cell) `
1729
+ ${(props) => props.firstRow && styledComponents.css ` border-top: 0px !important;`}
1730
+ ${(props) => props.width && styledComponents.css ` width: ${props.width};`}
1731
+ vertical-align: top;
1732
+ `;
1733
+ const Details = ({ details, firstColumnWidth }) => (React.createElement(Table, null,
1734
+ React.createElement("tbody", null, Object.entries(details).map(([key, val], index) => (React.createElement(Table.Row, { key: key, disableHover: true },
1735
+ React.createElement(StyledCell, { width: firstColumnWidth, firstRow: index === 0 }, key),
1736
+ React.createElement(StyledCell, { firstRow: index === 0 }, val)))))));
1737
+
1738
+ const Wrapper$7 = styledComponents.styled.div `
1739
+ position: relative;
1740
+ `;
1741
+ const Dropper = styledComponents.styled.span.withConfig({ shouldForwardProp: isPropValid }) `
1742
+ border-radius: 4px;
1743
+ border: 1px solid rgba(34,36,38,.15);
1744
+ position: absolute;
1745
+ box-shadow: 0 8px 8px 0 rgba(34,36,38,.15);
1746
+ background-color: ${props => props.theme.palette.common.white};
1747
+ z-index: 100;
1748
+
1749
+ ${props => props.align === 'right' ? styledComponents.css `right: 0;` : styledComponents.css `left: 0;`}
1750
+ `;
1751
+ const DropdownMenu = styledComponents.styled.ul `
1752
+ list-style: none;
1753
+ margin: 0;
1754
+ padding: ${props => props.theme.spacing(2, 0)};
1755
+ `;
1756
+ const DropdownMenuItem = styledComponents.styled.li `
1757
+ cursor: pointer;
1758
+ padding: ${props => props.theme.spacing(0, 3)};
1759
+ &:hover {
1760
+ background-color: #ddd;
1761
+ }
1762
+ `;
1763
+ const Dropdown = ({ buttonProps, align, children, stayOpenOnClick }) => {
1764
+ const dropper = React.useRef(null);
1765
+ const [isOpen, setIsOpen] = React.useState(false);
1766
+ const handleOpen = React.useCallback(() => setIsOpen(true), [setIsOpen]);
1767
+ const handleClose = React.useCallback((e) => {
1768
+ var _a;
1769
+ if (stayOpenOnClick && ((_a = dropper.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)))
1770
+ return;
1771
+ setIsOpen(false);
1772
+ }, [setIsOpen, stayOpenOnClick]);
1773
+ React.useEffect(() => {
1774
+ if (isOpen) {
1775
+ setTimeout(() => document.addEventListener('click', handleClose), 1);
1776
+ }
1777
+ return () => {
1778
+ document.removeEventListener('click', handleClose);
1779
+ };
1780
+ }, [isOpen, handleClose]);
1781
+ return (React.createElement(Wrapper$7, null,
1782
+ React.createElement(Button$1, Object.assign({}, buttonProps, { onClick: handleOpen })),
1783
+ isOpen && (React.createElement(SlideInFromTop, { speed: '.1s' },
1784
+ React.createElement(Dropper, { ref: dropper, align: align || 'left' }, children)))));
1785
+ };
1786
+
1787
+ const HiddenInput$1 = styledComponents.styled.input `
1788
+ display: none;
1789
+ `;
1790
+ const StyledDropZone = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
1791
+ display: flex;
1792
+ flex-direction: column;
1793
+ align-items: center;
1794
+ justify-content: center;
1795
+ border-radius: 4px;
1796
+ height: ${props => props.theme.spacing(25)};
1797
+
1798
+ border-radius: 4px;
1799
+ border: 1px solid rgba(34,36,38,.15);
1800
+
1801
+ & > * {
1802
+ pointerEvents: none;
1803
+ }
1804
+
1805
+ ${props => props.isReadyToDrop && styledComponents.css `
1806
+ background-color: #FAFAFA;
1807
+ `}
1808
+ `;
1809
+ const Dropzone = (_a) => {
1810
+ var { onChange, icon, label } = _a, rest = __rest(_a, ["onChange", "icon", "label"]);
1811
+ const fileInput = React.useRef(null);
1812
+ const dropzone = React.useRef(null);
1813
+ const [isReadyToDrop, setIsReadyToDrop] = React.useState(false);
1814
+ const handleChange = React.useCallback((fileList) => {
1815
+ if (fileList && onChange) {
1816
+ onChange(Array.from(fileList));
1817
+ }
1818
+ }, [onChange]);
1819
+ const handleDragOver = React.useCallback((e) => {
1820
+ e.preventDefault();
1821
+ setIsReadyToDrop(true);
1822
+ }, []);
1823
+ const handleDragLeave = React.useCallback((e) => {
1824
+ e.preventDefault();
1825
+ setIsReadyToDrop(false);
1826
+ }, []);
1827
+ const handleDrop = React.useCallback((e) => {
1828
+ var _a;
1829
+ e.preventDefault();
1830
+ setIsReadyToDrop(false);
1831
+ handleChange((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files);
1832
+ }, [handleChange]);
1833
+ const handleClick = React.useCallback(() => {
1834
+ var _a;
1835
+ // We trigger the 'file pick' dialog by delegating the click to a hidden file-input.
1836
+ (_a = fileInput.current) === null || _a === void 0 ? void 0 : _a.click();
1837
+ }, [fileInput]);
1838
+ const handleInputChange = React.useCallback(() => {
1839
+ var _a;
1840
+ handleChange((_a = fileInput === null || fileInput === void 0 ? void 0 : fileInput.current) === null || _a === void 0 ? void 0 : _a.files);
1841
+ }, [fileInput, handleChange]);
1842
+ return (React.createElement(StyledDropZone, Object.assign({ ref: dropzone, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, isReadyToDrop: isReadyToDrop }, rest),
1843
+ React.createElement(HiddenInput$1, { "data-testid": "dropzone-file-input", type: "file", ref: fileInput, onChange: handleInputChange, multiple: true }),
1844
+ React.createElement(Box, null,
1845
+ React.createElement(Button$1, { variant: "text", color: "secondary", type: "button", icon: icon }, label))));
1846
+ };
1847
+
1848
+ const StyledBox$6 = styledComponents.styled(Box) `
1849
+ width: 300px;
1850
+ `;
1851
+ const Feedback = ({ onConfirm, buttonLabel, buttonIcon, title, subtitle }) => (React.createElement(Modal, { handleClickOverlay: onConfirm, buttons: React.createElement(Button$1, { "data-testid": 'confirm', stretch: true, icon: buttonIcon, variant: 'secondary', onClick: onConfirm }, buttonLabel) },
1852
+ React.createElement(StyledBox$6, { pt: 3, pb: 3 },
1853
+ React.createElement(Box, { pb: 5, textAlign: "center" },
1854
+ React.createElement(Header, null, title),
1855
+ subtitle && React.createElement(Box, { pt: 5 },
1856
+ React.createElement(Header, { level: 5 }, subtitle))),
1857
+ React.createElement(Box, { pt: 5, pb: 5, pl: 7, pr: 7 },
1858
+ React.createElement(AnimatedCheckmark, null)))));
1859
+
1860
+ const horizontalPadding = { laptop: 1 };
1861
+ const verticalPadding = { mobile: 1, laptop: 0 };
1862
+ const flexGrow = { laptop: 1 };
1863
+ const FloaterItem = (_a) => {
1864
+ var { stretch, laptopWidth } = _a, props = __rest(_a, ["stretch", "laptopWidth"]);
1865
+ const width = React.useMemo(() => ({ laptop: laptopWidth }), [laptopWidth]);
1866
+ return React.createElement(Box, Object.assign({ flexGrow: stretch ? flexGrow : undefined, width: width, pt: verticalPadding, pb: verticalPadding, pl: horizontalPadding, pr: horizontalPadding }, props));
1867
+ };
1868
+
1869
+ const horizontalMargin = { laptop: -1 };
1870
+ const verticalMargin = { mobile: -1, laptop: 0 };
1871
+ const display = { mobile: "block", laptop: "flex" };
1872
+ const hasElement = (item) => !!item.element;
1873
+ const Floater = (_a) => {
1874
+ var { items, forceEqualWidth = false, stretch = false } = _a, props = __rest(_a, ["items", "forceEqualWidth", "stretch"]);
1875
+ return React.createElement(Box, Object.assign({ mb: verticalMargin, mt: verticalMargin, ml: horizontalMargin, mr: horizontalMargin, display: display }, props), items
1876
+ .filter(Boolean)
1877
+ .map((item, i) => hasElement(item)
1878
+ ? (React.createElement(FloaterItem, { key: i, laptopWidth: item.forceEqualWidth ? `${100 / items.length}%` : undefined, stretch: item.stretch || false }, item.element))
1879
+ : React.createElement(FloaterItem, { key: i, laptopWidth: forceEqualWidth ? `${100 / items.length}%` : undefined, stretch: stretch }, item)));
1880
+ };
1881
+
1882
+ const SIDEBAR_COLLAPSED_WIDTH = 15;
1883
+ const StyledSidebar = styledComponents.styled(Box) `
1884
+ float: left;
1885
+
1886
+ height: 100%;
1887
+ width: 100%;
1888
+
1889
+ background-color: #243646;
1890
+
1891
+ position: fixed;
1892
+ top: 0;
1893
+ left: 0;
1894
+ right: 0;
1895
+ bottom: 0;
1896
+
1897
+ z-index: 900;
1898
+
1899
+ display: ${props => props.isMobileMenuOpen ? 'block' : 'none'};
1900
+ pointer-events: auto;
1901
+
1902
+ ${mq("laptop", styledComponents.css `
1903
+ position: static;
1904
+ display: block;
1905
+ width: auto;
1906
+ min-width: ${props => { var _a; return props.theme.spacing((_a = props.minWidth) !== null && _a !== void 0 ? _a : 75); }};
1907
+ box-shadow: 2px 0px 6px -1px rgba(0,0,0,0.74);
1908
+
1909
+ transition: transform .1s ease-out;
1910
+ transform: ${props => props.isDesktopMenuOpen
1911
+ ? 'transform: translateX(0);'
1912
+ : styledComponents.css `translateX(calc(-100% + ${props => props.theme.spacing(SIDEBAR_COLLAPSED_WIDTH)}));`};
1913
+
1914
+ & ul {
1915
+ opacity: ${props => props.isDesktopMenuOpen ? '1' : '0'};
1916
+ }
1917
+ `)}
1918
+ `;
1919
+ const SideBar = (props) => {
1920
+ const { closeSideMenu, openSideMenu, isSideMenuOpen } = useUiStateContext();
1921
+ return React.createElement(StyledSidebar, Object.assign({ isDesktopMenuOpen: isSideMenuOpen }, props, { onMouseEnter: openSideMenu, onMouseLeave: closeSideMenu }));
1922
+ };
1923
+
1924
+ const StyledBox$5 = styledComponents.styled(Box) `
1925
+ background-color: ${props => props.theme.palette.common.white};
1926
+ border-top: 1px solid #DDDDDD;
1927
+ box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.04);
1928
+ box-sizing: border-box;
1929
+ `;
1930
+ const Footer = ({ children }) => (React.createElement(StyledBox$5, { pt: 2, pb: 2, pr: 5, pl: { mobile: 5, laptop: SIDEBAR_COLLAPSED_WIDTH + 5 } }, children));
1931
+
1932
+ const Scroller = styledComponents.styled(Box) `
1933
+ overflow-x: auto;
1934
+ overflow-y: hidden;
1935
+ `;
1936
+ const HorizontalScroller = ({ children }) => (React.createElement(Scroller, null, children));
1937
+
1938
+ const HamburgerButton = styledComponents.styled(Button$1) `
1939
+ margin-right: ${props => props.theme.spacing(3)};
1940
+ ${mq("laptop", `display: none;`)}
1941
+ `;
1942
+
1943
+ const Menu = styledComponents.styled.ul `
1944
+ padding: 0;
1945
+ margin: 0;
1946
+ list-style: none;
1947
+ `;
1948
+ const StyledMenuItem = styledComponents.styled.li.withConfig({ shouldForwardProp: isPropValid }) `
1949
+ padding: ${props => props.theme.spacing(.5, 5)};
1950
+
1951
+ ${props => props.isOpen && styledComponents.css `
1952
+ border-left: ${props.theme.spacing(1)} solid ${props.theme.palette.colors.blue};
1953
+ background: #293846;
1954
+
1955
+ & > * {
1956
+ margin-left: ${props.theme.spacing(-1)};
1957
+ }
1958
+ `}
1959
+
1960
+ & button:hover, & button:active, & button:focus {
1961
+ color: ${props => props.theme.palette.common.white} !important;
1962
+ }
1963
+
1964
+ & button {
1965
+ width: 100%;
1966
+ }
1967
+
1968
+ ${props => props.isActive && styledComponents.css `
1969
+ & button {
1970
+ color: ${props.theme.palette.common.white};
1971
+ }
1972
+ `}
1973
+ `;
1974
+ const MenuItem = ({ item, isOpen, isActive, children }) => {
1975
+ const [isDelayedOpen, setDelayedOpen] = React.useState(!!isOpen);
1976
+ return (React.createElement(StyledMenuItem, { isOpen: isDelayedOpen, isActive: !!isActive },
1977
+ item,
1978
+ children && (React.createElement(SlideOpen, { onChange: setDelayedOpen, isOpen: !!isOpen, duration: .25 }, children))));
1979
+ };
1980
+
1981
+ const MenuCloseButton = styledComponents.styled(Button$1) `
1982
+ ${mq("laptop", `display: none;`)}
1983
+ `;
1984
+
1985
+ const StyledBox$4 = styledComponents.styled(Box) `
1986
+ display: none;
1987
+ ${mq("laptop", `display: flex;`)}
1988
+
1989
+ height: 100%;
1990
+ flex-direction: row;
1991
+ align-items: center;
1992
+
1993
+ width: ${props => props.theme.spacing(SIDEBAR_COLLAPSED_WIDTH)};
1994
+
1995
+ & > svg {
1996
+ margin: 0 auto;
1997
+ }
1998
+
1999
+ ${StyledSidebar}:hover & {
2000
+ display:none;
2001
+ }
2002
+ `;
2003
+ const MenuSlideOpenIndicator = ({ children }) => (React.createElement(StyledBox$4, null, children));
2004
+
2005
+ const VerticalRhythmLaptop = 7;
2006
+ const VerticalRhythmMobile = 4;
2007
+
2008
+ const StyledBox$3 = styledComponents.styled(Box) `
2009
+ box-sizing: border-box;
2010
+ color: ${props => props.theme.palette.button.text.idle.text};
2011
+ font-weight: bold;
2012
+
2013
+ display: flex;
2014
+ text-align: center;
2015
+
2016
+ font-size: 14px;
2017
+ font-weight: bold;
2018
+ letter-spacing: 1px;
2019
+ line-height: 1em;
2020
+
2021
+ background-color: rgba(0,0,0,.2);
2022
+
2023
+ ${mq('laptop', styledComponents.css `
2024
+ min-height: ${props => props.theme.spacing(12)};
2025
+ `)}
2026
+ `;
2027
+ const SideBarHeader = ({ children, right }) => (React.createElement(StyledBox$3, { mb: VerticalRhythmLaptop },
2028
+ React.createElement(Box, { flexGrow: 1, display: "flex" },
2029
+ React.createElement(Box, { flexGrow: 1, display: "flex", flexDirection: "column", justifyContent: "center" }, children)),
2030
+ right && React.createElement(Box, null, right)));
2031
+
2032
+ const useCloseSidebarOnNavigate = (pathName) => {
2033
+ const { closeSideMenu } = useUiStateContext();
2034
+ React.useEffect(() => {
2035
+ closeSideMenu();
2036
+ }, [pathName, closeSideMenu]);
2037
+ };
2038
+
2039
+ const useToggleMobileMenu = ({ currentRoute }) => {
2040
+ const [isOpen, setIsOpen] = React.useState(false);
2041
+ const toggle = React.useCallback(() => {
2042
+ setIsOpen((val) => !val);
2043
+ }, []);
2044
+ const open = React.useCallback(() => {
2045
+ setIsOpen(true);
2046
+ }, []);
2047
+ const close = React.useCallback(() => {
2048
+ setIsOpen(false);
2049
+ }, []);
2050
+ React.useEffect(() => {
2051
+ close();
2052
+ }, [currentRoute, close]);
2053
+ return {
2054
+ isOpen,
2055
+ open,
2056
+ close,
2057
+ toggle
2058
+ };
2059
+ };
2060
+
2061
+ const useResponsiveBreakpoints = () => {
2062
+ const [windowWidth, setWindowWidth] = React.useState(window.innerWidth);
2063
+ React.useEffect(() => {
2064
+ const onResize = () => setWindowWidth(window.innerWidth);
2065
+ window.addEventListener('resize', onResize);
2066
+ return () => window.removeEventListener('resize', onResize);
2067
+ }, []);
2068
+ const responsiveMap = React.useMemo(() => ({
2069
+ isMobile: windowWidth >= BreakPointValues.mobile,
2070
+ isTablet: windowWidth >= BreakPointValues.tablet,
2071
+ isLaptop: windowWidth >= BreakPointValues.laptop,
2072
+ isDesktop: windowWidth >= BreakPointValues.desktop
2073
+ }), [windowWidth]);
2074
+ return responsiveMap;
2075
+ };
2076
+
2077
+ const Wrapper$6 = styledComponents.styled.div `
2078
+ display: flex;
2079
+ `;
2080
+ const Button = styledComponents.styled.button.withConfig({ shouldForwardProp: isPropValid }) `
2081
+ user-select:none;
2082
+ cursor: pointer;
2083
+
2084
+ min-height: ${props => props.theme.spacing(8)};
2085
+ padding: .2em 1.3em .2em;
2086
+ margin: 0;
2087
+ line-height: 1em;
2088
+ outline: 0;
2089
+ border: 1px solid rgba(34,36,38,.15);
2090
+
2091
+ font-family: Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
2092
+ background-color: ${props => props.active ? '#F2F2F2' : '#fff'};
2093
+
2094
+ &:not(:first-of-type) {
2095
+ border-left: 0;
2096
+ }
2097
+
2098
+ ${props => !props.disabled && (`
2099
+ &:hover {
2100
+ background-color: #E9E9E9;
2101
+ }
2102
+ `)}
2103
+ `;
2104
+ const range = (start, end) => {
2105
+ let nums = [];
2106
+ for (let i = start; i < end; i++) {
2107
+ nums.push(i);
2108
+ }
2109
+ return nums;
2110
+ };
2111
+ const Paginator = (props) => {
2112
+ const { isTablet } = useResponsiveBreakpoints();
2113
+ const { pageCount, onChange } = props;
2114
+ const currentPage = Math.min(Math.max(props.currentPage, 0), pageCount);
2115
+ const clamSize = isTablet ? 2 : 0;
2116
+ const clamLower = Math.max(1, currentPage - clamSize);
2117
+ const clamUpper = Math.min(pageCount, currentPage + clamSize);
2118
+ return (React.createElement(Wrapper$6, null,
2119
+ React.createElement(Button, { "data-testid": "paginate-prev", disabled: currentPage === 1, onClick: () => onChange(currentPage - 1) }, "\u27E8"),
2120
+ clamLower > 1 && (React.createElement(Button, { "data-testid": "paginate-page-1", active: currentPage === 1, onClick: () => onChange(1) }, "1")),
2121
+ clamLower > 2 && (React.createElement(Button, { disabled: true }, "...")),
2122
+ range(clamLower, clamUpper + 1).map((pageNumber) => (React.createElement(Button, { "data-testid": `paginate-page-${pageNumber}`, key: pageNumber, active: currentPage === pageNumber, onClick: () => onChange(pageNumber) }, pageNumber))),
2123
+ clamUpper < pageCount - 1 && (React.createElement(Button, { disabled: true }, "...")),
2124
+ clamUpper < pageCount && (React.createElement(Button, { "data-testid": `paginate-page-${pageCount}`, active: currentPage === pageCount, onClick: () => onChange(pageCount) }, pageCount)),
2125
+ React.createElement(Button, { "data-testid": "paginate-next", disabled: currentPage === pageCount, onClick: () => onChange(currentPage + 1) }, "\u27E9")));
2126
+ };
2127
+
2128
+ const Section = (props) => (React.createElement(Box, Object.assign({ pb: { laptop: VerticalRhythmLaptop, mobile: VerticalRhythmMobile } }, props)));
2129
+
2130
+ const Wrapper$5 = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2131
+ display: flex;
2132
+ border-radius: ${props => props.theme.spacing(1)};
2133
+ padding: ${props => props.theme.spacing(4)};
2134
+ background-color: ${props => props.theme.palette.colors[props.backgroundColor]};
2135
+ box-sizing: border-box;
2136
+ height: 100%;
2137
+ `;
2138
+ const Label$2 = styledComponents.styled.div `
2139
+ text-transform: uppercase;
2140
+ color: ${props => props.theme.palette.common.white};
2141
+ font-size: ${props => props.theme.spacing(3)};
2142
+ `;
2143
+ const Value = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2144
+ color: ${props => props.theme.palette.common.white};
2145
+ font-weight: bold;
2146
+ font-size: ${props => props.theme.spacing(props.smallerValue ? 5.5 : 7.5)};
2147
+ `;
2148
+ const IconWrapper = styledComponents.styled.div `
2149
+ margin: ${props => props.theme.spacing(1)} 0 auto 0;
2150
+ & svg {
2151
+ height: 100%;
2152
+ width: ${props => props.theme.spacing(10)};
2153
+ color: white;
2154
+ }
2155
+ `;
2156
+ const Statistic = ({ icon, value, label, backgroundColor, smallerValue }) => (React.createElement(Wrapper$5, { backgroundColor: backgroundColor },
2157
+ React.createElement(IconWrapper, null, icon),
2158
+ React.createElement(Box, { flexGrow: 1, textAlign: "right" },
2159
+ React.createElement(Label$2, null, label),
2160
+ React.createElement(Value, { smallerValue: smallerValue }, value))));
2161
+
2162
+ const StyledBox$2 = styledComponents.styled(Box) `
2163
+
2164
+ padding: ${props => props.theme.spacing(2.5, 5)};
2165
+
2166
+ ${props => !props.isActive && styledComponents.css `
2167
+ cursor: pointer;
2168
+ color: #337ab7;
2169
+ &:hover,
2170
+ &:focus {
2171
+ color: #23527c;
2172
+ text-decoration: underline;
2173
+ }
2174
+ `}
2175
+
2176
+ ${props => props.isActive && styledComponents.css `
2177
+ font-weight: bold;
2178
+ border: 1px solid rgba(34,36,38,.15);
2179
+ border-bottom: 0px;
2180
+ margin-bottom: -1px;
2181
+ border-top-left-radius: 4px;
2182
+ border-top-right-radius: 4px;
2183
+ background-color: ${props => props.theme.palette.common.white};
2184
+ `}
2185
+
2186
+ ${props => props.variant && `
2187
+ font-weight: bold;
2188
+ color: ${props.theme.palette.form[props.variant]};
2189
+ &:hover {
2190
+ color: ${props.theme.palette.form[props.variant]};
2191
+ }
2192
+ `}
2193
+
2194
+ `;
2195
+ const Tab = (_a) => {
2196
+ var { id, isActive, onClick } = _a, restProps = __rest(_a, ["id", "isActive", "onClick"]);
2197
+ const handleClick = React.useCallback(() => {
2198
+ if (!isActive) {
2199
+ onClick === null || onClick === void 0 ? void 0 : onClick(id);
2200
+ }
2201
+ }, [id, isActive, onClick]);
2202
+ return React.createElement(StyledBox$2, Object.assign({}, restProps, { onClick: handleClick, isActive: isActive }));
2203
+ };
2204
+
2205
+ const StyledBox$1 = styledComponents.styled(Box) `
2206
+ background-color: ${props => props.theme.palette.common.white};
2207
+ border: 1px solid rgba(34,36,38,.15);
2208
+ border-top: 0px;
2209
+ `;
2210
+ const TabContent = (props) => React.createElement(StyledBox$1, Object.assign({ p: 3 }, props));
2211
+
2212
+ const Tabs = styledComponents.styled(Box) `
2213
+ display: flex;
2214
+ border-bottom: 1px solid rgba(34,36,38,.15);
2215
+ `;
2216
+
2217
+ const FlatPanel = styledComponents.styled(Panel) `
2218
+ box-shadow: none;
2219
+ `;
2220
+ const Wrapper$4 = styledComponents.styled(Box) `
2221
+ display: flex;
2222
+
2223
+ &:last-of-type .line:before {
2224
+ background: none;
2225
+ }
2226
+ `;
2227
+ const Line = styledComponents.styled(Box) `
2228
+ position: relative;
2229
+ margin-right: ${props => props.theme.spacing(4)};
2230
+ top: 4px;
2231
+
2232
+ &:before {
2233
+ background: #e7eaec;
2234
+ content: '';
2235
+ position: absolute;
2236
+ top: 0;
2237
+ left: ${props => props.theme.spacing(4.5)};
2238
+ height: 100%;
2239
+ width: ${props => props.theme.spacing(1)};
2240
+ }
2241
+
2242
+ `;
2243
+ const Circle = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2244
+ position: relative;
2245
+ background-color: ${props => props.color};
2246
+ color: #fff;
2247
+
2248
+ left: 0;
2249
+ width: ${props => props.theme.spacing(10)};
2250
+ height: ${props => props.theme.spacing(10)};
2251
+ border-radius: 50%;
2252
+ font-size: ${props => props.theme.spacing(4)};
2253
+
2254
+ & > * {
2255
+ position: absolute;
2256
+ top: 50%;
2257
+ left: 50%;
2258
+ transform: translate(-50%, -50%);
2259
+ }
2260
+ `;
2261
+ const Timeline = ({ title, icon, color, isInitiallyOpen, titleMeta, chevron, children }) => (React.createElement(Wrapper$4, null,
2262
+ React.createElement(Line, null,
2263
+ React.createElement(Circle, { color: color }, icon)),
2264
+ React.createElement(Box, { pb: 4, flexGrow: 1 },
2265
+ React.createElement(CollapsiblePanel, { isInitiallyOpen: isInitiallyOpen, titleMeta: titleMeta, title: title, titleAction: chevron }, children))));
2266
+ const SimpleTimeline = ({ color, icon, title, titleMeta }) => (React.createElement(Wrapper$4, null,
2267
+ React.createElement(Line, { className: 'line' },
2268
+ React.createElement(Circle, { color: color }, icon)),
2269
+ React.createElement(Box, { pb: 4, flexGrow: 1 },
2270
+ React.createElement(FlatPanel, { titleMeta: titleMeta, title: title }))));
2271
+
2272
+ const StyledBox = styledComponents.styled(Box) `
2273
+ background-color: #FFFFFF;
2274
+ border-bottom: 1px solid #DDDDDD;
2275
+ box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.04);
2276
+ box-sizing: border-box;
2277
+ `;
2278
+ const TopBar = ({ left, right }) => (React.createElement(StyledBox, null,
2279
+ React.createElement(Box, { display: "flex", alignItems: "center", pb: 1, pt: 1, pr: 5, pl: { mobile: 5, laptop: 5 + SIDEBAR_COLLAPSED_WIDTH } },
2280
+ React.createElement(Box, { flexGrow: 1, display: "flex", pl: 2 }, left),
2281
+ React.createElement(Box, { flexGrow: 1, display: "flex", justifyContent: 'flex-end' }, right))));
2282
+
2283
+ const Label$1 = styledComponents.styled.label `
2284
+ position: relative;
2285
+ `;
2286
+ const Input$1 = styledComponents.styled.input.withConfig({ shouldForwardProp: isPropValid }) `
2287
+ position: absolute;
2288
+ top: 0;
2289
+ left: 0;
2290
+
2291
+ width: 17px;
2292
+ height: 17px;
2293
+
2294
+ z-index: 99;
2295
+ opacity: 0;
2296
+ margin-right: ${props => props.theme.spacing(2)};
2297
+ transform: translateY(1px);
2298
+
2299
+ &~span {
2300
+ user-select: none;
2301
+ padding-left: 1.85714em;
2302
+ cursor: pointer;
2303
+ font-size: .92857143em;
2304
+ }
2305
+
2306
+ &~span:before, &~span:after {
2307
+ position: absolute;
2308
+ top: 0;
2309
+ left: 0;
2310
+ width: 17px;
2311
+ height: 17px;
2312
+ line-height: 17px;
2313
+ content: '';
2314
+ border-radius: 4px;
2315
+ border: 1px solid rgba(34,36,38,.15);
2316
+ z-index:0;
2317
+ }
2318
+
2319
+ &:checked~span {
2320
+ font-style: italic;
2321
+ }
2322
+
2323
+ &:checked~span:before {
2324
+ background: #fff;
2325
+ border-color: rgba(34,36,38,.35);
2326
+ }
2327
+
2328
+ &:checked~span:after {
2329
+ font-style: normal;
2330
+ text-align: center;
2331
+ content: '\\2714';
2332
+ opacity: 1;
2333
+ color: ${props => props.theme.palette.common.black}
2334
+ }
2335
+
2336
+ &:focus~span:before, &:focus~span:after {
2337
+ border-color: #85b7d9;
2338
+ border-radius: 4px;
2339
+ background: #fff;
2340
+ box-shadow: 0 0 0 0 rgba(34,36,38,.35) inset;
2341
+ }
2342
+
2343
+ &.error~span {
2344
+ color: ${props => props.theme.palette.form.error};
2345
+ }
2346
+
2347
+ &.error~span:before, &.error~span:after {
2348
+ background: #fff6f6;
2349
+ border-color: #e0b4b4;
2350
+ color: #9f3a38;
2351
+ }
2352
+ `;
2353
+ const Span = styledComponents.styled.span.withConfig({ shouldForwardProp: isPropValid }) `
2354
+ ${props => props.dimmed ? styledComponents.css `color: #999c9e;` : ''}
2355
+ `;
2356
+ const Checkbox = React.forwardRef((_a, ref) => {
2357
+ var { options, spacing = 1, name, dimmed } = _a, restProps = __rest(_a, ["options", "spacing", "name", "dimmed"]);
2358
+ return (React.createElement(React.Fragment, null, Object.entries(options).map(([value, label]) => (React.createElement(Box, { key: value, mt: spacing, mb: spacing },
2359
+ React.createElement(Label$1, { key: value },
2360
+ React.createElement(Input$1, Object.assign({ type: "checkbox", value: value, name: name, ref: ref }, restProps)),
2361
+ React.createElement(Span, { dimmed: dimmed }, label)))))));
2362
+ });
2363
+
2364
+ const sharedStyles = styledComponents.css `
2365
+ padding: .67857143em 1em;
2366
+ line-height: 1.21428571em;
2367
+ border-radius: 4px;
2368
+ border: 1px solid rgba(34,36,38,.15);
2369
+
2370
+ color: ${props => props.theme.palette.common.black};
2371
+ font-family: Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
2372
+
2373
+ font-size: 1em;
2374
+ outline: none;
2375
+
2376
+ &:disabled, &:read-only {
2377
+ background-color: #FAFAFA;
2378
+ }
2379
+
2380
+ &:focus {
2381
+ color: rgba(0,0,0,.95);
2382
+ border-color: #85b7d9;
2383
+ background: #fff;
2384
+ box-shadow: 0 0 0 0 rgba(34,36,38,.35) inset;
2385
+ }
2386
+
2387
+ &.error {
2388
+ background: #fff6f6;
2389
+ border-color: #e0b4b4;
2390
+ color: #9f3a38;
2391
+ }
2392
+
2393
+ &.error:focus {
2394
+ background: #fff6f6;
2395
+ }
2396
+
2397
+ &:focus::placeholder {
2398
+ color:rgba(115,115,115,.87)
2399
+ }
2400
+
2401
+ &::placeholder {
2402
+ color:rgba(191,191,191,.87);
2403
+ }
2404
+
2405
+ &.error::placeholder {
2406
+ color: #e7bdbc;
2407
+ }
2408
+
2409
+ &.error:focus::placeholder {
2410
+ color: #da9796;
2411
+ }
2412
+ `;
2413
+ const Input = styledComponents.styled.input.withConfig({ shouldForwardProp: isPropValid }) `
2414
+ ${sharedStyles}
2415
+ `;
2416
+ const Textarea = styledComponents.styled.textarea.withConfig({ shouldForwardProp: isPropValid }) `
2417
+ ${sharedStyles}
2418
+ height: 100%;
2419
+ `;
2420
+ const TextField = React.forwardRef((_a, ref) => {
2421
+ var { multiline = false } = _a, restProps = __rest(_a, ["multiline"]);
2422
+ return multiline
2423
+ ? React.createElement(Textarea, Object.assign({ ref: ref }, restProps))
2424
+ : React.createElement(Input, Object.assign({ ref: ref, type: "text" }, restProps));
2425
+ });
2426
+
2427
+ const Wrapper$3 = styledComponents.styled.div `
2428
+ position: relative;
2429
+ display: flex;
2430
+ `;
2431
+ const HiddenInput = styledComponents.styled.input.withConfig({ shouldForwardProp: isPropValid }) `
2432
+ position: absolute;
2433
+ left: 0;
2434
+ right: 0;
2435
+ top: 0;
2436
+ bottom: 0;
2437
+ width: 100%;
2438
+ opacity:0;
2439
+ `;
2440
+ const StyledButton = styledComponents.styled(Button$1) `
2441
+ height: 40px;
2442
+
2443
+ .has-error & {
2444
+ background: #fff6f6;
2445
+ border-color: #e0b4b4;
2446
+ color: #9f3a38;
2447
+ }
2448
+ `;
2449
+ const StyledTextField = styledComponents.styled(TextField) `
2450
+ flex: 1;
2451
+ padding-right: ${props => props.theme.spacing(8)}
2452
+ `;
2453
+ const DeleteButton = styledComponents.styled.button `
2454
+ background-color: transparent;
2455
+ border: 0;
2456
+ outline: 0;
2457
+ padding: 0;
2458
+
2459
+ position: absolute;
2460
+ right: 0;
2461
+ height: 100%;
2462
+
2463
+ cursor: pointer;
2464
+
2465
+ &:after {
2466
+ box-sizing: border-box;
2467
+
2468
+ color: rgba(0, 0, 0, .3);
2469
+ content: "×";
2470
+
2471
+ text-align: center;
2472
+ vertical-align: middle;
2473
+ display: table-cell;
2474
+
2475
+ font-size: 20px;
2476
+ height: 38px;
2477
+ width: 38px;
2478
+ line-height: 38px;
2479
+ padding: 0 8px;
2480
+ }
2481
+ `;
2482
+ const FileField = React.forwardRef((_a, ref) => {
2483
+ var { className, placeholder, chooseFileLabel = "Choose file", changeFileLabel = "Change file", onClear } = _a, props = __rest(_a, ["className", "placeholder", "chooseFileLabel", "changeFileLabel", "onClear"]);
2484
+ const [originalRef, setOriginalRef] = React.useState();
2485
+ const [fileName, setFilename] = React.useState("");
2486
+ const handleChange = React.useCallback((e) => {
2487
+ var _a;
2488
+ const files = (e === null || e === void 0 ? void 0 : e.target).files;
2489
+ setFilename(((_a = files === null || files === void 0 ? void 0 : files[0]) === null || _a === void 0 ? void 0 : _a.name) || "");
2490
+ }, []);
2491
+ const handleRemove = React.useCallback(() => {
2492
+ if (originalRef) {
2493
+ originalRef.value = '';
2494
+ originalRef.files = null;
2495
+ originalRef.dispatchEvent(new Event('change', { bubbles: true }));
2496
+ if (onClear) {
2497
+ onClear();
2498
+ }
2499
+ }
2500
+ }, [originalRef, onClear]);
2501
+ const extendedRef = React.useMemo(() => (el) => {
2502
+ el === null || el === void 0 ? void 0 : el.addEventListener('change', handleChange);
2503
+ setOriginalRef(el);
2504
+ if (typeof ref === 'function') {
2505
+ ref === null || ref === void 0 ? void 0 : ref(el);
2506
+ }
2507
+ }, [ref, handleChange]);
2508
+ return (React.createElement(Wrapper$3, null,
2509
+ React.createElement(HiddenInput, Object.assign({ type: 'file', ref: extendedRef }, props)),
2510
+ React.createElement(StyledButton, { variant: 'basic' }, !!fileName ? changeFileLabel : chooseFileLabel),
2511
+ React.createElement(StyledTextField, { placeholder: placeholder, className: className, disabled: true, value: fileName }),
2512
+ !!fileName && onClear && React.createElement(DeleteButton, { "data-testid": 'file-clear', onClick: handleRemove })));
2513
+ });
2514
+
2515
+ const Wrapper$2 = styledComponents.styled.div `
2516
+ position: relative;
2517
+ `;
2518
+ const StyledSelect = styledComponents.styled.select.withConfig({ shouldForwardProp: isPropValid }) `
2519
+ width: 100%;
2520
+
2521
+ padding: .67857143em 1em;
2522
+ line-height: 1.21428571em;
2523
+ border-radius: 4px;
2524
+ border: 1px solid rgba(34,36,38,.15);
2525
+
2526
+ color: ${props => props.theme.palette.common.black};
2527
+ font-family: Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
2528
+
2529
+ font-size: 1em;
2530
+ outline: none;
2531
+
2532
+ appearance: none;
2533
+
2534
+ &.error {
2535
+ background: #fff6f6;
2536
+ border-color: #e0b4b4;
2537
+ color: #9f3a38;
2538
+ }
2539
+
2540
+ &.error~div {
2541
+ color: #9f3a38;
2542
+ }
2543
+ `;
2544
+ const PaddingOverlay = styledComponents.styled.div `
2545
+ pointer-events: none;
2546
+ padding: 0 1em;
2547
+ position:absolute;
2548
+ height: 100%;
2549
+ top: 0;
2550
+ right: 0;
2551
+ font-size: 17px;
2552
+ line-height: 40px;
2553
+ `;
2554
+ const Select = React.forwardRef((_a, ref) => {
2555
+ var { options } = _a, props = __rest(_a, ["options"]);
2556
+ const optionsArray = Array.isArray(options)
2557
+ ? options
2558
+ : Object.entries(options);
2559
+ return (React.createElement(Wrapper$2, null,
2560
+ React.createElement(StyledSelect, Object.assign({ ref: ref }, props), optionsArray.map(([value, label]) => (React.createElement("option", { key: value, value: value }, label)))),
2561
+ React.createElement(PaddingOverlay, null, "\u25BE")));
2562
+ });
2563
+
2564
+ const passwordMinLength = (val) => val.length >= 8;
2565
+ const passwordHasNumbers = (val) => /\d/.test(val);
2566
+ const passwordHasLowerAndUppercase = (val) => /[a-z]/.test(val) && /[A-Z]/.test(val);
2567
+ const passwordHasSpecialChars = (val) => /[-’/`~!#*$@_%+=.,^&(){}[\]|;:”<>?\\]/.test(val);
2568
+ const checks = [passwordMinLength, passwordHasNumbers, passwordHasLowerAndUppercase, passwordHasSpecialChars];
2569
+ const maxScore = checks.length + 1;
2570
+ const calculatePasswordScore = (val) => checks
2571
+ .map((check) => check(val))
2572
+ .reduce((acc, value) => value
2573
+ ? acc + 1
2574
+ : acc, 1);
2575
+ const Progress = styledComponents.styled.div `
2576
+ margin-top: ${props => props.theme.spacing(1)};
2577
+ height: 3px;
2578
+ background-color: #f5f5f5;
2579
+ border-radius: 4px;
2580
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
2581
+ `;
2582
+ const ProgressBar = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2583
+ width: ${props => props.score ? (props.score / maxScore) * 100 : 0}%;
2584
+ height: 100%;
2585
+ background-color: ${props => props.score <= 2 ? '#e90f10' : props.score <= 3 ? '#ffad00' : '#02b502'} ;
2586
+ transition: width .6s ease, background-color .6s ease;
2587
+ `;
2588
+ const PasswordStrengthField = React.forwardRef((props, ref) => {
2589
+ const [score, setScore] = React.useState(0);
2590
+ const handleChange = React.useCallback((e) => {
2591
+ const target = e.target;
2592
+ setScore(target.value ? calculatePasswordScore(target.value) : 0);
2593
+ }, []);
2594
+ const extendedRef = React.useMemo(() => (el) => {
2595
+ el === null || el === void 0 ? void 0 : el.addEventListener('keyup', handleChange);
2596
+ if (typeof ref === 'function') {
2597
+ ref === null || ref === void 0 ? void 0 : ref(el);
2598
+ }
2599
+ }, [ref, handleChange]);
2600
+ return React.createElement(React.Fragment, null,
2601
+ React.createElement(TextField, Object.assign({}, props, { type: "password", ref: extendedRef })),
2602
+ React.createElement(Progress, null,
2603
+ React.createElement(ProgressBar, { score: score })));
2604
+ });
2605
+
2606
+ const NUM_ROWS_PER_FIELD = 2;
2607
+ // NOTE:
2608
+ //
2609
+ // We have to implement our own version of -ms-grid.
2610
+ // Styled-components does not automatically prefix it, as the specs do not completely overlap.
2611
+ // https://github.com/thysultan/stylis.js/issues/51
2612
+ //
2613
+ // We can achieve our goals using both specs though.
2614
+ const generateDimensionsCss = (position, rowOffset) => {
2615
+ const parts = [];
2616
+ if (position === undefined) {
2617
+ return parts;
2618
+ }
2619
+ if (position.row !== undefined) {
2620
+ parts.push(styledComponents.css `
2621
+ grid-row-start: ${(position.row * NUM_ROWS_PER_FIELD) + 1 + rowOffset};
2622
+ -ms-grid-row: ${(position.row * NUM_ROWS_PER_FIELD) + 1 + rowOffset};
2623
+ `);
2624
+ }
2625
+ if (position.rowSpan && rowOffset) {
2626
+ parts.push(styledComponents.css `
2627
+ grid-row-end: span ${(position.rowSpan * NUM_ROWS_PER_FIELD) - 1};
2628
+ -ms-grid-row-span: ${(position.rowSpan * NUM_ROWS_PER_FIELD) - 1};
2629
+ `);
2630
+ }
2631
+ if (position.column !== undefined) {
2632
+ parts.push(styledComponents.css `
2633
+ grid-column-start: ${position.column + 1};
2634
+ -ms-grid-column: ${position.column + 1};
2635
+ `);
2636
+ }
2637
+ if (position.columnSpan !== undefined) {
2638
+ parts.push(styledComponents.css `
2639
+ grid-column-end: span ${position.columnSpan};
2640
+ -ms-grid-column-span: ${position.columnSpan};
2641
+ `);
2642
+ }
2643
+ return parts;
2644
+ };
2645
+ const FormGridCell = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2646
+ margin: 0px 8px;
2647
+
2648
+ ${props => props.rowOffset !== undefined && styledComponents.css `
2649
+ display: flex;
2650
+ flex-direction: column;
2651
+ margin-bottom: 16px;`}
2652
+
2653
+ align-self: ${props => props.rowOffset === undefined ? "end" : "initial"};
2654
+ -ms-grid-row-align: ${props => props.rowOffset === undefined ? "end" : "initial"};
2655
+
2656
+ ${(props) => responsiveProps(props, {
2657
+ "align": unit => styledComponents.css `text-align: ${unit};`,
2658
+ "position": unit => { var _a; return generateDimensionsCss(unit, (_a = props.rowOffset) !== null && _a !== void 0 ? _a : 0); }
2659
+ })}
2660
+ `;
2661
+ FormGridCell.displayName = "FormGridCell";
2662
+
2663
+ const Label = styledComponents.styled.label.withConfig({ shouldForwardProp: isPropValid }) `
2664
+ display: block;
2665
+ color: ${(props => !!props.error ? props.theme.palette.form.error : props.theme.palette.common.black)} ;
2666
+ font-weight: bold;
2667
+ margin: ${props => props.theme.spacing(0, 0, 1, 0)};
2668
+ line-height: 1.4em;
2669
+ font-size: .92857143em;
2670
+ `;
2671
+ const Hint = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2672
+ color: ${(props => !!props.error ? "#da9796;" : props.theme.palette.form.hint)};
2673
+ margin: ${props => props.theme.spacing(-1, 0, 1, 0)};
2674
+ line-height: 1.4em;
2675
+ font-size: .92857143em;
2676
+ `;
2677
+ const RequiredAsterisk = styledComponents.styled.span.withConfig({ shouldForwardProp: isPropValid }) `
2678
+ color: ${props => props.theme.palette.form.hint};
2679
+ `;
2680
+ const Error$1 = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2681
+ color: ${props => props.theme.palette.form.error};
2682
+ margin: ${props => props.theme.spacing(1, 0, 0, 0)};
2683
+ font-weight: bold;
2684
+ font-style: italic;
2685
+ line-height: 1.4em;
2686
+ font-size: .92857143em;
2687
+ `;
2688
+ const getFormGridWrapperProps = ({ position, align, label, hint, error, isRequired }) => ({ position, align, label, hint, error, isRequired });
2689
+ const FormGridWrapper = ({ position, align, label, hint, error, isRequired, children }) => (React.createElement(React.Fragment, null,
2690
+ React.createElement(FormGridCell, { position: position, align: align, className: 'form-grid-cell__label-hint' },
2691
+ label && (React.createElement(Label, { error: error },
2692
+ label,
2693
+ isRequired && React.createElement(RequiredAsterisk, null, " *"))),
2694
+ hint && (React.createElement(Hint, { error: error }, hint))),
2695
+ React.createElement(FormGridCell, { position: position, align: align, rowOffset: 1, className: clsx({ 'form-grid-cell__field-error': true, 'has-error': !!error }) },
2696
+ children,
2697
+ error && (React.createElement(Error$1, null, error)))));
2698
+
2699
+ const FormGrid = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2700
+ margin: 0 -8px -16px -8px;
2701
+
2702
+ display: -ms-grid;
2703
+ display: grid;
2704
+
2705
+ -ms-grid-columns: 1fr;
2706
+
2707
+ ${(props) => responsiveProps(props, {
2708
+ columns: (string) => styledComponents.css `
2709
+ -ms-grid-columns: ${string};
2710
+ grid-template-columns: ${string};
2711
+ `
2712
+ })}
2713
+ `;
2714
+ FormGrid.displayName = "FormGrid";
2715
+
2716
+ const Wrapper$1 = styledComponents.styled(Box) `
2717
+ background-color: #F3F3F4;
2718
+ `;
2719
+ const WrapperInner = styledComponents.styled(Box) `
2720
+ position: relative;
2721
+ `;
2722
+ const SidebarWrapper = styledComponents.styled(Box) `
2723
+ position: absolute;
2724
+ height: 100%;
2725
+ z-index: 50;
2726
+ pointer-events: none;
2727
+ `;
2728
+ const ContentBox = styledComponents.styled(Box) `
2729
+ height: 100%;
2730
+ `;
2731
+ const BasicLayout = ({ sideBarProps, topBarProps, footerProps, isLoading, loader, children }) => {
2732
+ return (React.createElement(Wrapper$1, { flexGrow: 1, display: "flex", flexDirection: "column" },
2733
+ React.createElement(WrapperInner, { flexGrow: 1, flexShrink: 0 },
2734
+ sideBarProps && (React.createElement(SidebarWrapper, null,
2735
+ React.createElement(SideBar, Object.assign({}, sideBarProps)))),
2736
+ React.createElement(ContentBox, { display: "flex", flexDirection: "column" },
2737
+ React.createElement(TopBar, Object.assign({}, topBarProps)),
2738
+ React.createElement(Box, { p: { laptop: VerticalRhythmLaptop, mobile: VerticalRhythmMobile }, pl: { laptop: VerticalRhythmLaptop + SIDEBAR_COLLAPSED_WIDTH }, flexGrow: 1 }, isLoading && loader
2739
+ ? loader
2740
+ : children),
2741
+ React.createElement(Footer, Object.assign({}, footerProps))))));
2742
+ };
2743
+
2744
+ const Wrapper = styledComponents.styled(Box) `
2745
+ background-color: ${props => props.baseColor || 'white'};
2746
+ position: absolute;
2747
+ min-width: 100%;
2748
+ min-height: 100%;
2749
+ `;
2750
+ const Background = styledComponents.styled.div.withConfig({ shouldForwardProp: isPropValid }) `
2751
+ position: absolute;
2752
+ top: 0;
2753
+ left: 0;
2754
+ width: 100%;
2755
+ height: 100%;
2756
+
2757
+ opacity: ${props => { var _a; return (_a = props.opacity) !== null && _a !== void 0 ? _a : 1; }} ;
2758
+ background: url("${props => props.imageUrl}");
2759
+ background-size: cover;
2760
+ `;
2761
+ const StyledAnimation = styledComponents.styled(SlideInFromTop) `
2762
+ z-index: 10;
2763
+ margin: auto auto;
2764
+ `;
2765
+ const StyledPanel = styledComponents.styled(Panel) `
2766
+ box-shadow: 0 8px 8px 0 rgba(34,36,38,.15);
2767
+ min-width: 280px;
2768
+ `;
2769
+ const Logo = styledComponents.styled.img `
2770
+ display:none;
2771
+ position: absolute;
2772
+ left: 0;
2773
+ top: ${props => props.theme.spacing(8)};
2774
+ ${mq("tablet", `display: block;`)}
2775
+ `;
2776
+ const FloatingPanelLayout = ({ panelProps, imageUrl, alert, logoUrl, backgroundBaseColor, backgroundOpacity }) => (React.createElement(Wrapper, { display: "flex", alignItems: "center", baseColor: backgroundBaseColor },
2777
+ React.createElement(Background, { imageUrl: imageUrl, opacity: backgroundOpacity }),
2778
+ logoUrl && (React.createElement(Logo, { src: logoUrl, alt: "Logo" })),
2779
+ React.createElement(StyledAnimation, null,
2780
+ alert && (React.createElement(Box, { pb: VerticalRhythmLaptop }, alert)),
2781
+ React.createElement(StyledPanel, Object.assign({}, panelProps)))));
2782
+
2783
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2784
+
2785
+ function getDefaultExportFromCjs (x) {
2786
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2787
+ }
2788
+
2789
+ /**
2790
+ * lodash (Custom Build) <https://lodash.com/>
2791
+ * Build: `lodash modularize exports="npm" -o ./`
2792
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
2793
+ * Released under MIT license <https://lodash.com/license>
2794
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2795
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2796
+ */
2797
+
2798
+ /** Used as references for various `Number` constants. */
2799
+ var INFINITY = 1 / 0,
2800
+ MAX_SAFE_INTEGER$1 = 9007199254740991,
2801
+ MAX_INTEGER = 1.7976931348623157e+308,
2802
+ NAN = 0 / 0;
2803
+
2804
+ /** `Object#toString` result references. */
2805
+ var funcTag$1 = '[object Function]',
2806
+ genTag$1 = '[object GeneratorFunction]',
2807
+ symbolTag = '[object Symbol]';
2808
+
2809
+ /** Used to match leading and trailing whitespace. */
2810
+ var reTrim = /^\s+|\s+$/g;
2811
+
2812
+ /** Used to detect bad signed hexadecimal string values. */
2813
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
2814
+
2815
+ /** Used to detect binary string values. */
2816
+ var reIsBinary = /^0b[01]+$/i;
2817
+
2818
+ /** Used to detect octal string values. */
2819
+ var reIsOctal = /^0o[0-7]+$/i;
2820
+
2821
+ /** Used to detect unsigned integer values. */
2822
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2823
+
2824
+ /** Built-in method references without a dependency on `root`. */
2825
+ var freeParseInt = parseInt;
2826
+
2827
+ /** Used for built-in method references. */
2828
+ var objectProto$1 = Object.prototype;
2829
+
2830
+ /**
2831
+ * Used to resolve the
2832
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2833
+ * of values.
2834
+ */
2835
+ var objectToString$1 = objectProto$1.toString;
2836
+
2837
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2838
+ var nativeCeil = Math.ceil,
2839
+ nativeMax$1 = Math.max;
2840
+
2841
+ /**
2842
+ * The base implementation of `_.slice` without an iteratee call guard.
2843
+ *
2844
+ * @private
2845
+ * @param {Array} array The array to slice.
2846
+ * @param {number} [start=0] The start position.
2847
+ * @param {number} [end=array.length] The end position.
2848
+ * @returns {Array} Returns the slice of `array`.
2849
+ */
2850
+ function baseSlice(array, start, end) {
2851
+ var index = -1,
2852
+ length = array.length;
2853
+
2854
+ if (start < 0) {
2855
+ start = -start > length ? 0 : (length + start);
2856
+ }
2857
+ end = end > length ? length : end;
2858
+ if (end < 0) {
2859
+ end += length;
2860
+ }
2861
+ length = start > end ? 0 : ((end - start) >>> 0);
2862
+ start >>>= 0;
2863
+
2864
+ var result = Array(length);
2865
+ while (++index < length) {
2866
+ result[index] = array[index + start];
2867
+ }
2868
+ return result;
2869
+ }
2870
+
2871
+ /**
2872
+ * Checks if `value` is a valid array-like index.
2873
+ *
2874
+ * @private
2875
+ * @param {*} value The value to check.
2876
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2877
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2878
+ */
2879
+ function isIndex(value, length) {
2880
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
2881
+ return !!length &&
2882
+ (typeof value == 'number' || reIsUint.test(value)) &&
2883
+ (value > -1 && value % 1 == 0 && value < length);
2884
+ }
2885
+
2886
+ /**
2887
+ * Checks if the given arguments are from an iteratee call.
2888
+ *
2889
+ * @private
2890
+ * @param {*} value The potential iteratee value argument.
2891
+ * @param {*} index The potential iteratee index or key argument.
2892
+ * @param {*} object The potential iteratee object argument.
2893
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
2894
+ * else `false`.
2895
+ */
2896
+ function isIterateeCall(value, index, object) {
2897
+ if (!isObject$1(object)) {
2898
+ return false;
2899
+ }
2900
+ var type = typeof index;
2901
+ if (type == 'number'
2902
+ ? (isArrayLike$1(object) && isIndex(index, object.length))
2903
+ : (type == 'string' && index in object)
2904
+ ) {
2905
+ return eq$1(object[index], value);
2906
+ }
2907
+ return false;
2908
+ }
2909
+
2910
+ /**
2911
+ * Creates an array of elements split into groups the length of `size`.
2912
+ * If `array` can't be split evenly, the final chunk will be the remaining
2913
+ * elements.
2914
+ *
2915
+ * @static
2916
+ * @memberOf _
2917
+ * @since 3.0.0
2918
+ * @category Array
2919
+ * @param {Array} array The array to process.
2920
+ * @param {number} [size=1] The length of each chunk
2921
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
2922
+ * @returns {Array} Returns the new array of chunks.
2923
+ * @example
2924
+ *
2925
+ * _.chunk(['a', 'b', 'c', 'd'], 2);
2926
+ * // => [['a', 'b'], ['c', 'd']]
2927
+ *
2928
+ * _.chunk(['a', 'b', 'c', 'd'], 3);
2929
+ * // => [['a', 'b', 'c'], ['d']]
2930
+ */
2931
+ function chunk(array, size, guard) {
2932
+ if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
2933
+ size = 1;
2934
+ } else {
2935
+ size = nativeMax$1(toInteger(size), 0);
2936
+ }
2937
+ var length = array ? array.length : 0;
2938
+ if (!length || size < 1) {
2939
+ return [];
2940
+ }
2941
+ var index = 0,
2942
+ resIndex = 0,
2943
+ result = Array(nativeCeil(length / size));
2944
+
2945
+ while (index < length) {
2946
+ result[resIndex++] = baseSlice(array, index, (index += size));
2947
+ }
2948
+ return result;
2949
+ }
2950
+
2951
+ /**
2952
+ * Performs a
2953
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2954
+ * comparison between two values to determine if they are equivalent.
2955
+ *
2956
+ * @static
2957
+ * @memberOf _
2958
+ * @since 4.0.0
2959
+ * @category Lang
2960
+ * @param {*} value The value to compare.
2961
+ * @param {*} other The other value to compare.
2962
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2963
+ * @example
2964
+ *
2965
+ * var object = { 'a': 1 };
2966
+ * var other = { 'a': 1 };
2967
+ *
2968
+ * _.eq(object, object);
2969
+ * // => true
2970
+ *
2971
+ * _.eq(object, other);
2972
+ * // => false
2973
+ *
2974
+ * _.eq('a', 'a');
2975
+ * // => true
2976
+ *
2977
+ * _.eq('a', Object('a'));
2978
+ * // => false
2979
+ *
2980
+ * _.eq(NaN, NaN);
2981
+ * // => true
2982
+ */
2983
+ function eq$1(value, other) {
2984
+ return value === other || (value !== value && other !== other);
2985
+ }
2986
+
2987
+ /**
2988
+ * Checks if `value` is array-like. A value is considered array-like if it's
2989
+ * not a function and has a `value.length` that's an integer greater than or
2990
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2991
+ *
2992
+ * @static
2993
+ * @memberOf _
2994
+ * @since 4.0.0
2995
+ * @category Lang
2996
+ * @param {*} value The value to check.
2997
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2998
+ * @example
2999
+ *
3000
+ * _.isArrayLike([1, 2, 3]);
3001
+ * // => true
3002
+ *
3003
+ * _.isArrayLike(document.body.children);
3004
+ * // => true
3005
+ *
3006
+ * _.isArrayLike('abc');
3007
+ * // => true
3008
+ *
3009
+ * _.isArrayLike(_.noop);
3010
+ * // => false
3011
+ */
3012
+ function isArrayLike$1(value) {
3013
+ return value != null && isLength$1(value.length) && !isFunction$1(value);
3014
+ }
3015
+
3016
+ /**
3017
+ * Checks if `value` is classified as a `Function` object.
3018
+ *
3019
+ * @static
3020
+ * @memberOf _
3021
+ * @since 0.1.0
3022
+ * @category Lang
3023
+ * @param {*} value The value to check.
3024
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
3025
+ * @example
3026
+ *
3027
+ * _.isFunction(_);
3028
+ * // => true
3029
+ *
3030
+ * _.isFunction(/abc/);
3031
+ * // => false
3032
+ */
3033
+ function isFunction$1(value) {
3034
+ // The use of `Object#toString` avoids issues with the `typeof` operator
3035
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
3036
+ var tag = isObject$1(value) ? objectToString$1.call(value) : '';
3037
+ return tag == funcTag$1 || tag == genTag$1;
3038
+ }
3039
+
3040
+ /**
3041
+ * Checks if `value` is a valid array-like length.
3042
+ *
3043
+ * **Note:** This method is loosely based on
3044
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
3045
+ *
3046
+ * @static
3047
+ * @memberOf _
3048
+ * @since 4.0.0
3049
+ * @category Lang
3050
+ * @param {*} value The value to check.
3051
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
3052
+ * @example
3053
+ *
3054
+ * _.isLength(3);
3055
+ * // => true
3056
+ *
3057
+ * _.isLength(Number.MIN_VALUE);
3058
+ * // => false
3059
+ *
3060
+ * _.isLength(Infinity);
3061
+ * // => false
3062
+ *
3063
+ * _.isLength('3');
3064
+ * // => false
3065
+ */
3066
+ function isLength$1(value) {
3067
+ return typeof value == 'number' &&
3068
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
3069
+ }
3070
+
3071
+ /**
3072
+ * Checks if `value` is the
3073
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
3074
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
3075
+ *
3076
+ * @static
3077
+ * @memberOf _
3078
+ * @since 0.1.0
3079
+ * @category Lang
3080
+ * @param {*} value The value to check.
3081
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
3082
+ * @example
3083
+ *
3084
+ * _.isObject({});
3085
+ * // => true
3086
+ *
3087
+ * _.isObject([1, 2, 3]);
3088
+ * // => true
3089
+ *
3090
+ * _.isObject(_.noop);
3091
+ * // => true
3092
+ *
3093
+ * _.isObject(null);
3094
+ * // => false
3095
+ */
3096
+ function isObject$1(value) {
3097
+ var type = typeof value;
3098
+ return !!value && (type == 'object' || type == 'function');
3099
+ }
3100
+
3101
+ /**
3102
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
3103
+ * and has a `typeof` result of "object".
3104
+ *
3105
+ * @static
3106
+ * @memberOf _
3107
+ * @since 4.0.0
3108
+ * @category Lang
3109
+ * @param {*} value The value to check.
3110
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
3111
+ * @example
3112
+ *
3113
+ * _.isObjectLike({});
3114
+ * // => true
3115
+ *
3116
+ * _.isObjectLike([1, 2, 3]);
3117
+ * // => true
3118
+ *
3119
+ * _.isObjectLike(_.noop);
3120
+ * // => false
3121
+ *
3122
+ * _.isObjectLike(null);
3123
+ * // => false
3124
+ */
3125
+ function isObjectLike$1(value) {
3126
+ return !!value && typeof value == 'object';
3127
+ }
3128
+
3129
+ /**
3130
+ * Checks if `value` is classified as a `Symbol` primitive or object.
3131
+ *
3132
+ * @static
3133
+ * @memberOf _
3134
+ * @since 4.0.0
3135
+ * @category Lang
3136
+ * @param {*} value The value to check.
3137
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
3138
+ * @example
3139
+ *
3140
+ * _.isSymbol(Symbol.iterator);
3141
+ * // => true
3142
+ *
3143
+ * _.isSymbol('abc');
3144
+ * // => false
3145
+ */
3146
+ function isSymbol(value) {
3147
+ return typeof value == 'symbol' ||
3148
+ (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag);
3149
+ }
3150
+
3151
+ /**
3152
+ * Converts `value` to a finite number.
3153
+ *
3154
+ * @static
3155
+ * @memberOf _
3156
+ * @since 4.12.0
3157
+ * @category Lang
3158
+ * @param {*} value The value to convert.
3159
+ * @returns {number} Returns the converted number.
3160
+ * @example
3161
+ *
3162
+ * _.toFinite(3.2);
3163
+ * // => 3.2
3164
+ *
3165
+ * _.toFinite(Number.MIN_VALUE);
3166
+ * // => 5e-324
3167
+ *
3168
+ * _.toFinite(Infinity);
3169
+ * // => 1.7976931348623157e+308
3170
+ *
3171
+ * _.toFinite('3.2');
3172
+ * // => 3.2
3173
+ */
3174
+ function toFinite(value) {
3175
+ if (!value) {
3176
+ return value === 0 ? value : 0;
3177
+ }
3178
+ value = toNumber(value);
3179
+ if (value === INFINITY || value === -INFINITY) {
3180
+ var sign = (value < 0 ? -1 : 1);
3181
+ return sign * MAX_INTEGER;
3182
+ }
3183
+ return value === value ? value : 0;
3184
+ }
3185
+
3186
+ /**
3187
+ * Converts `value` to an integer.
3188
+ *
3189
+ * **Note:** This method is loosely based on
3190
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
3191
+ *
3192
+ * @static
3193
+ * @memberOf _
3194
+ * @since 4.0.0
3195
+ * @category Lang
3196
+ * @param {*} value The value to convert.
3197
+ * @returns {number} Returns the converted integer.
3198
+ * @example
3199
+ *
3200
+ * _.toInteger(3.2);
3201
+ * // => 3
3202
+ *
3203
+ * _.toInteger(Number.MIN_VALUE);
3204
+ * // => 0
3205
+ *
3206
+ * _.toInteger(Infinity);
3207
+ * // => 1.7976931348623157e+308
3208
+ *
3209
+ * _.toInteger('3.2');
3210
+ * // => 3
3211
+ */
3212
+ function toInteger(value) {
3213
+ var result = toFinite(value),
3214
+ remainder = result % 1;
3215
+
3216
+ return result === result ? (remainder ? result - remainder : result) : 0;
3217
+ }
3218
+
3219
+ /**
3220
+ * Converts `value` to a number.
3221
+ *
3222
+ * @static
3223
+ * @memberOf _
3224
+ * @since 4.0.0
3225
+ * @category Lang
3226
+ * @param {*} value The value to process.
3227
+ * @returns {number} Returns the number.
3228
+ * @example
3229
+ *
3230
+ * _.toNumber(3.2);
3231
+ * // => 3.2
3232
+ *
3233
+ * _.toNumber(Number.MIN_VALUE);
3234
+ * // => 5e-324
3235
+ *
3236
+ * _.toNumber(Infinity);
3237
+ * // => Infinity
3238
+ *
3239
+ * _.toNumber('3.2');
3240
+ * // => 3.2
3241
+ */
3242
+ function toNumber(value) {
3243
+ if (typeof value == 'number') {
3244
+ return value;
3245
+ }
3246
+ if (isSymbol(value)) {
3247
+ return NAN;
3248
+ }
3249
+ if (isObject$1(value)) {
3250
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
3251
+ value = isObject$1(other) ? (other + '') : other;
3252
+ }
3253
+ if (typeof value != 'string') {
3254
+ return value === 0 ? value : +value;
3255
+ }
3256
+ value = value.replace(reTrim, '');
3257
+ var isBinary = reIsBinary.test(value);
3258
+ return (isBinary || reIsOctal.test(value))
3259
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
3260
+ : (reIsBadHex.test(value) ? NAN : +value);
3261
+ }
3262
+
3263
+ var lodash_chunk = chunk;
3264
+
3265
+ var _chunk = /*@__PURE__*/getDefaultExportFromCjs(lodash_chunk);
3266
+
3267
+ /**
3268
+ * Two dimensional array grid.
3269
+ * Useful to position elements with.
3270
+ *
3271
+ * Example:
3272
+ *
3273
+ * new Grid([
3274
+ * [1,2,3],
3275
+ * [4,5,6],
3276
+ * [7,8,9]
3277
+ * ])
3278
+ *
3279
+ */
3280
+ class Grid {
3281
+ constructor(grid) {
3282
+ this.grid = grid;
3283
+ }
3284
+ getValues() {
3285
+ return this.grid;
3286
+ }
3287
+ /**
3288
+ * Returns an array of distinct values in this grid
3289
+ */
3290
+ getDistinctValues() {
3291
+ const values = [];
3292
+ this.grid.forEach((row) => {
3293
+ row.forEach((item) => {
3294
+ if (!values.includes(item)) {
3295
+ values.push(item);
3296
+ }
3297
+ });
3298
+ });
3299
+ return values;
3300
+ }
3301
+ sliceArea(topLeft, bottomRight) {
3302
+ if (topLeft.x > bottomRight.x || topLeft.y > bottomRight.y) {
3303
+ throw new Error("Coordinates are mixed up. Please ensure topLeft is actually in the top-left corner. And bottomRight is actually in the bottom-right corner");
3304
+ }
3305
+ return new Grid(this.grid
3306
+ .slice(topLeft.y, bottomRight.y + 1)
3307
+ .map(row => row.slice(topLeft.x, bottomRight.x + 1)));
3308
+ }
3309
+ getCoordinatesForValue(value) {
3310
+ const x = [];
3311
+ const y = [];
3312
+ this.grid.forEach((row, yIndex) => {
3313
+ row.forEach((item, xIndex) => {
3314
+ if (item === value) {
3315
+ x.push(xIndex);
3316
+ y.push(yIndex);
3317
+ }
3318
+ });
3319
+ });
3320
+ return {
3321
+ topLeft: { x: Math.min(...x), y: Math.min(...y) },
3322
+ bottomRight: { x: Math.max(...x), y: Math.max(...y) }
3323
+ };
3324
+ }
3325
+ }
3326
+
3327
+ /**
3328
+ * lodash (Custom Build) <https://lodash.com/>
3329
+ * Build: `lodash modularize exports="npm" -o ./`
3330
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
3331
+ * Released under MIT license <https://lodash.com/license>
3332
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
3333
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3334
+ */
3335
+
3336
+ /** Used as the size to enable large array optimizations. */
3337
+ var LARGE_ARRAY_SIZE = 200;
3338
+
3339
+ /** Used to stand-in for `undefined` hash values. */
3340
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
3341
+
3342
+ /** Used as references for various `Number` constants. */
3343
+ var MAX_SAFE_INTEGER = 9007199254740991;
3344
+
3345
+ /** `Object#toString` result references. */
3346
+ var argsTag = '[object Arguments]',
3347
+ funcTag = '[object Function]',
3348
+ genTag = '[object GeneratorFunction]';
3349
+
3350
+ /**
3351
+ * Used to match `RegExp`
3352
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
3353
+ */
3354
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
3355
+
3356
+ /** Used to detect host constructors (Safari). */
3357
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
3358
+
3359
+ /** Detect free variable `global` from Node.js. */
3360
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
3361
+
3362
+ /** Detect free variable `self`. */
3363
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
3364
+
3365
+ /** Used as a reference to the global object. */
3366
+ var root = freeGlobal || freeSelf || Function('return this')();
3367
+
3368
+ /**
3369
+ * A faster alternative to `Function#apply`, this function invokes `func`
3370
+ * with the `this` binding of `thisArg` and the arguments of `args`.
3371
+ *
3372
+ * @private
3373
+ * @param {Function} func The function to invoke.
3374
+ * @param {*} thisArg The `this` binding of `func`.
3375
+ * @param {Array} args The arguments to invoke `func` with.
3376
+ * @returns {*} Returns the result of `func`.
3377
+ */
3378
+ function apply(func, thisArg, args) {
3379
+ switch (args.length) {
3380
+ case 0: return func.call(thisArg);
3381
+ case 1: return func.call(thisArg, args[0]);
3382
+ case 2: return func.call(thisArg, args[0], args[1]);
3383
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
3384
+ }
3385
+ return func.apply(thisArg, args);
3386
+ }
3387
+
3388
+ /**
3389
+ * A specialized version of `_.includes` for arrays without support for
3390
+ * specifying an index to search from.
3391
+ *
3392
+ * @private
3393
+ * @param {Array} [array] The array to inspect.
3394
+ * @param {*} target The value to search for.
3395
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
3396
+ */
3397
+ function arrayIncludes(array, value) {
3398
+ var length = array ? array.length : 0;
3399
+ return !!length && baseIndexOf(array, value, 0) > -1;
3400
+ }
3401
+
3402
+ /**
3403
+ * This function is like `arrayIncludes` except that it accepts a comparator.
3404
+ *
3405
+ * @private
3406
+ * @param {Array} [array] The array to inspect.
3407
+ * @param {*} target The value to search for.
3408
+ * @param {Function} comparator The comparator invoked per element.
3409
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
3410
+ */
3411
+ function arrayIncludesWith(array, value, comparator) {
3412
+ var index = -1,
3413
+ length = array ? array.length : 0;
3414
+
3415
+ while (++index < length) {
3416
+ if (comparator(value, array[index])) {
3417
+ return true;
3418
+ }
3419
+ }
3420
+ return false;
3421
+ }
3422
+
3423
+ /**
3424
+ * A specialized version of `_.map` for arrays without support for iteratee
3425
+ * shorthands.
3426
+ *
3427
+ * @private
3428
+ * @param {Array} [array] The array to iterate over.
3429
+ * @param {Function} iteratee The function invoked per iteration.
3430
+ * @returns {Array} Returns the new mapped array.
3431
+ */
3432
+ function arrayMap(array, iteratee) {
3433
+ var index = -1,
3434
+ length = array ? array.length : 0,
3435
+ result = Array(length);
3436
+
3437
+ while (++index < length) {
3438
+ result[index] = iteratee(array[index], index, array);
3439
+ }
3440
+ return result;
3441
+ }
3442
+
3443
+ /**
3444
+ * Appends the elements of `values` to `array`.
3445
+ *
3446
+ * @private
3447
+ * @param {Array} array The array to modify.
3448
+ * @param {Array} values The values to append.
3449
+ * @returns {Array} Returns `array`.
3450
+ */
3451
+ function arrayPush(array, values) {
3452
+ var index = -1,
3453
+ length = values.length,
3454
+ offset = array.length;
3455
+
3456
+ while (++index < length) {
3457
+ array[offset + index] = values[index];
3458
+ }
3459
+ return array;
3460
+ }
3461
+
3462
+ /**
3463
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
3464
+ * support for iteratee shorthands.
3465
+ *
3466
+ * @private
3467
+ * @param {Array} array The array to inspect.
3468
+ * @param {Function} predicate The function invoked per iteration.
3469
+ * @param {number} fromIndex The index to search from.
3470
+ * @param {boolean} [fromRight] Specify iterating from right to left.
3471
+ * @returns {number} Returns the index of the matched value, else `-1`.
3472
+ */
3473
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
3474
+ var length = array.length,
3475
+ index = fromIndex + (fromRight ? 1 : -1);
3476
+
3477
+ while ((fromRight ? index-- : ++index < length)) {
3478
+ if (predicate(array[index], index, array)) {
3479
+ return index;
3480
+ }
3481
+ }
3482
+ return -1;
3483
+ }
3484
+
3485
+ /**
3486
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
3487
+ *
3488
+ * @private
3489
+ * @param {Array} array The array to inspect.
3490
+ * @param {*} value The value to search for.
3491
+ * @param {number} fromIndex The index to search from.
3492
+ * @returns {number} Returns the index of the matched value, else `-1`.
3493
+ */
3494
+ function baseIndexOf(array, value, fromIndex) {
3495
+ if (value !== value) {
3496
+ return baseFindIndex(array, baseIsNaN, fromIndex);
3497
+ }
3498
+ var index = fromIndex - 1,
3499
+ length = array.length;
3500
+
3501
+ while (++index < length) {
3502
+ if (array[index] === value) {
3503
+ return index;
3504
+ }
3505
+ }
3506
+ return -1;
3507
+ }
3508
+
3509
+ /**
3510
+ * The base implementation of `_.isNaN` without support for number objects.
3511
+ *
3512
+ * @private
3513
+ * @param {*} value The value to check.
3514
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
3515
+ */
3516
+ function baseIsNaN(value) {
3517
+ return value !== value;
3518
+ }
3519
+
3520
+ /**
3521
+ * The base implementation of `_.unary` without support for storing metadata.
3522
+ *
3523
+ * @private
3524
+ * @param {Function} func The function to cap arguments for.
3525
+ * @returns {Function} Returns the new capped function.
3526
+ */
3527
+ function baseUnary(func) {
3528
+ return function(value) {
3529
+ return func(value);
3530
+ };
3531
+ }
3532
+
3533
+ /**
3534
+ * Checks if a cache value for `key` exists.
3535
+ *
3536
+ * @private
3537
+ * @param {Object} cache The cache to query.
3538
+ * @param {string} key The key of the entry to check.
3539
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3540
+ */
3541
+ function cacheHas(cache, key) {
3542
+ return cache.has(key);
3543
+ }
3544
+
3545
+ /**
3546
+ * Gets the value at `key` of `object`.
3547
+ *
3548
+ * @private
3549
+ * @param {Object} [object] The object to query.
3550
+ * @param {string} key The key of the property to get.
3551
+ * @returns {*} Returns the property value.
3552
+ */
3553
+ function getValue(object, key) {
3554
+ return object == null ? undefined : object[key];
3555
+ }
3556
+
3557
+ /**
3558
+ * Checks if `value` is a host object in IE < 9.
3559
+ *
3560
+ * @private
3561
+ * @param {*} value The value to check.
3562
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
3563
+ */
3564
+ function isHostObject(value) {
3565
+ // Many host objects are `Object` objects that can coerce to strings
3566
+ // despite having improperly defined `toString` methods.
3567
+ var result = false;
3568
+ if (value != null && typeof value.toString != 'function') {
3569
+ try {
3570
+ result = !!(value + '');
3571
+ } catch (e) {}
3572
+ }
3573
+ return result;
3574
+ }
3575
+
3576
+ /** Used for built-in method references. */
3577
+ var arrayProto = Array.prototype,
3578
+ funcProto = Function.prototype,
3579
+ objectProto = Object.prototype;
3580
+
3581
+ /** Used to detect overreaching core-js shims. */
3582
+ var coreJsData = root['__core-js_shared__'];
3583
+
3584
+ /** Used to detect methods masquerading as native. */
3585
+ var maskSrcKey = (function() {
3586
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
3587
+ return uid ? ('Symbol(src)_1.' + uid) : '';
3588
+ }());
3589
+
3590
+ /** Used to resolve the decompiled source of functions. */
3591
+ var funcToString = funcProto.toString;
3592
+
3593
+ /** Used to check objects for own properties. */
3594
+ var hasOwnProperty = objectProto.hasOwnProperty;
3595
+
3596
+ /**
3597
+ * Used to resolve the
3598
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3599
+ * of values.
3600
+ */
3601
+ var objectToString = objectProto.toString;
3602
+
3603
+ /** Used to detect if a method is native. */
3604
+ var reIsNative = RegExp('^' +
3605
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
3606
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
3607
+ );
3608
+
3609
+ /** Built-in value references. */
3610
+ var Symbol = root.Symbol,
3611
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
3612
+ splice = arrayProto.splice,
3613
+ spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
3614
+
3615
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3616
+ var nativeMax = Math.max;
3617
+
3618
+ /* Built-in method references that are verified to be native. */
3619
+ var Map$1 = getNative(root, 'Map'),
3620
+ nativeCreate = getNative(Object, 'create');
3621
+
3622
+ /**
3623
+ * Creates a hash object.
3624
+ *
3625
+ * @private
3626
+ * @constructor
3627
+ * @param {Array} [entries] The key-value pairs to cache.
3628
+ */
3629
+ function Hash(entries) {
3630
+ var index = -1,
3631
+ length = entries ? entries.length : 0;
3632
+
3633
+ this.clear();
3634
+ while (++index < length) {
3635
+ var entry = entries[index];
3636
+ this.set(entry[0], entry[1]);
3637
+ }
3638
+ }
3639
+
3640
+ /**
3641
+ * Removes all key-value entries from the hash.
3642
+ *
3643
+ * @private
3644
+ * @name clear
3645
+ * @memberOf Hash
3646
+ */
3647
+ function hashClear() {
3648
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
3649
+ }
3650
+
3651
+ /**
3652
+ * Removes `key` and its value from the hash.
3653
+ *
3654
+ * @private
3655
+ * @name delete
3656
+ * @memberOf Hash
3657
+ * @param {Object} hash The hash to modify.
3658
+ * @param {string} key The key of the value to remove.
3659
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3660
+ */
3661
+ function hashDelete(key) {
3662
+ return this.has(key) && delete this.__data__[key];
3663
+ }
3664
+
3665
+ /**
3666
+ * Gets the hash value for `key`.
3667
+ *
3668
+ * @private
3669
+ * @name get
3670
+ * @memberOf Hash
3671
+ * @param {string} key The key of the value to get.
3672
+ * @returns {*} Returns the entry value.
3673
+ */
3674
+ function hashGet(key) {
3675
+ var data = this.__data__;
3676
+ if (nativeCreate) {
3677
+ var result = data[key];
3678
+ return result === HASH_UNDEFINED ? undefined : result;
3679
+ }
3680
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
3681
+ }
3682
+
3683
+ /**
3684
+ * Checks if a hash value for `key` exists.
3685
+ *
3686
+ * @private
3687
+ * @name has
3688
+ * @memberOf Hash
3689
+ * @param {string} key The key of the entry to check.
3690
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3691
+ */
3692
+ function hashHas(key) {
3693
+ var data = this.__data__;
3694
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
3695
+ }
3696
+
3697
+ /**
3698
+ * Sets the hash `key` to `value`.
3699
+ *
3700
+ * @private
3701
+ * @name set
3702
+ * @memberOf Hash
3703
+ * @param {string} key The key of the value to set.
3704
+ * @param {*} value The value to set.
3705
+ * @returns {Object} Returns the hash instance.
3706
+ */
3707
+ function hashSet(key, value) {
3708
+ var data = this.__data__;
3709
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
3710
+ return this;
3711
+ }
3712
+
3713
+ // Add methods to `Hash`.
3714
+ Hash.prototype.clear = hashClear;
3715
+ Hash.prototype['delete'] = hashDelete;
3716
+ Hash.prototype.get = hashGet;
3717
+ Hash.prototype.has = hashHas;
3718
+ Hash.prototype.set = hashSet;
3719
+
3720
+ /**
3721
+ * Creates an list cache object.
3722
+ *
3723
+ * @private
3724
+ * @constructor
3725
+ * @param {Array} [entries] The key-value pairs to cache.
3726
+ */
3727
+ function ListCache(entries) {
3728
+ var index = -1,
3729
+ length = entries ? entries.length : 0;
3730
+
3731
+ this.clear();
3732
+ while (++index < length) {
3733
+ var entry = entries[index];
3734
+ this.set(entry[0], entry[1]);
3735
+ }
3736
+ }
3737
+
3738
+ /**
3739
+ * Removes all key-value entries from the list cache.
3740
+ *
3741
+ * @private
3742
+ * @name clear
3743
+ * @memberOf ListCache
3744
+ */
3745
+ function listCacheClear() {
3746
+ this.__data__ = [];
3747
+ }
3748
+
3749
+ /**
3750
+ * Removes `key` and its value from the list cache.
3751
+ *
3752
+ * @private
3753
+ * @name delete
3754
+ * @memberOf ListCache
3755
+ * @param {string} key The key of the value to remove.
3756
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3757
+ */
3758
+ function listCacheDelete(key) {
3759
+ var data = this.__data__,
3760
+ index = assocIndexOf(data, key);
3761
+
3762
+ if (index < 0) {
3763
+ return false;
3764
+ }
3765
+ var lastIndex = data.length - 1;
3766
+ if (index == lastIndex) {
3767
+ data.pop();
3768
+ } else {
3769
+ splice.call(data, index, 1);
3770
+ }
3771
+ return true;
3772
+ }
3773
+
3774
+ /**
3775
+ * Gets the list cache value for `key`.
3776
+ *
3777
+ * @private
3778
+ * @name get
3779
+ * @memberOf ListCache
3780
+ * @param {string} key The key of the value to get.
3781
+ * @returns {*} Returns the entry value.
3782
+ */
3783
+ function listCacheGet(key) {
3784
+ var data = this.__data__,
3785
+ index = assocIndexOf(data, key);
3786
+
3787
+ return index < 0 ? undefined : data[index][1];
3788
+ }
3789
+
3790
+ /**
3791
+ * Checks if a list cache value for `key` exists.
3792
+ *
3793
+ * @private
3794
+ * @name has
3795
+ * @memberOf ListCache
3796
+ * @param {string} key The key of the entry to check.
3797
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3798
+ */
3799
+ function listCacheHas(key) {
3800
+ return assocIndexOf(this.__data__, key) > -1;
3801
+ }
3802
+
3803
+ /**
3804
+ * Sets the list cache `key` to `value`.
3805
+ *
3806
+ * @private
3807
+ * @name set
3808
+ * @memberOf ListCache
3809
+ * @param {string} key The key of the value to set.
3810
+ * @param {*} value The value to set.
3811
+ * @returns {Object} Returns the list cache instance.
3812
+ */
3813
+ function listCacheSet(key, value) {
3814
+ var data = this.__data__,
3815
+ index = assocIndexOf(data, key);
3816
+
3817
+ if (index < 0) {
3818
+ data.push([key, value]);
3819
+ } else {
3820
+ data[index][1] = value;
3821
+ }
3822
+ return this;
3823
+ }
3824
+
3825
+ // Add methods to `ListCache`.
3826
+ ListCache.prototype.clear = listCacheClear;
3827
+ ListCache.prototype['delete'] = listCacheDelete;
3828
+ ListCache.prototype.get = listCacheGet;
3829
+ ListCache.prototype.has = listCacheHas;
3830
+ ListCache.prototype.set = listCacheSet;
3831
+
3832
+ /**
3833
+ * Creates a map cache object to store key-value pairs.
3834
+ *
3835
+ * @private
3836
+ * @constructor
3837
+ * @param {Array} [entries] The key-value pairs to cache.
3838
+ */
3839
+ function MapCache(entries) {
3840
+ var index = -1,
3841
+ length = entries ? entries.length : 0;
3842
+
3843
+ this.clear();
3844
+ while (++index < length) {
3845
+ var entry = entries[index];
3846
+ this.set(entry[0], entry[1]);
3847
+ }
3848
+ }
3849
+
3850
+ /**
3851
+ * Removes all key-value entries from the map.
3852
+ *
3853
+ * @private
3854
+ * @name clear
3855
+ * @memberOf MapCache
3856
+ */
3857
+ function mapCacheClear() {
3858
+ this.__data__ = {
3859
+ 'hash': new Hash,
3860
+ 'map': new (Map$1 || ListCache),
3861
+ 'string': new Hash
3862
+ };
3863
+ }
3864
+
3865
+ /**
3866
+ * Removes `key` and its value from the map.
3867
+ *
3868
+ * @private
3869
+ * @name delete
3870
+ * @memberOf MapCache
3871
+ * @param {string} key The key of the value to remove.
3872
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3873
+ */
3874
+ function mapCacheDelete(key) {
3875
+ return getMapData(this, key)['delete'](key);
3876
+ }
3877
+
3878
+ /**
3879
+ * Gets the map value for `key`.
3880
+ *
3881
+ * @private
3882
+ * @name get
3883
+ * @memberOf MapCache
3884
+ * @param {string} key The key of the value to get.
3885
+ * @returns {*} Returns the entry value.
3886
+ */
3887
+ function mapCacheGet(key) {
3888
+ return getMapData(this, key).get(key);
3889
+ }
3890
+
3891
+ /**
3892
+ * Checks if a map value for `key` exists.
3893
+ *
3894
+ * @private
3895
+ * @name has
3896
+ * @memberOf MapCache
3897
+ * @param {string} key The key of the entry to check.
3898
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3899
+ */
3900
+ function mapCacheHas(key) {
3901
+ return getMapData(this, key).has(key);
3902
+ }
3903
+
3904
+ /**
3905
+ * Sets the map `key` to `value`.
3906
+ *
3907
+ * @private
3908
+ * @name set
3909
+ * @memberOf MapCache
3910
+ * @param {string} key The key of the value to set.
3911
+ * @param {*} value The value to set.
3912
+ * @returns {Object} Returns the map cache instance.
3913
+ */
3914
+ function mapCacheSet(key, value) {
3915
+ getMapData(this, key).set(key, value);
3916
+ return this;
3917
+ }
3918
+
3919
+ // Add methods to `MapCache`.
3920
+ MapCache.prototype.clear = mapCacheClear;
3921
+ MapCache.prototype['delete'] = mapCacheDelete;
3922
+ MapCache.prototype.get = mapCacheGet;
3923
+ MapCache.prototype.has = mapCacheHas;
3924
+ MapCache.prototype.set = mapCacheSet;
3925
+
3926
+ /**
3927
+ *
3928
+ * Creates an array cache object to store unique values.
3929
+ *
3930
+ * @private
3931
+ * @constructor
3932
+ * @param {Array} [values] The values to cache.
3933
+ */
3934
+ function SetCache(values) {
3935
+ var index = -1,
3936
+ length = values ? values.length : 0;
3937
+
3938
+ this.__data__ = new MapCache;
3939
+ while (++index < length) {
3940
+ this.add(values[index]);
3941
+ }
3942
+ }
3943
+
3944
+ /**
3945
+ * Adds `value` to the array cache.
3946
+ *
3947
+ * @private
3948
+ * @name add
3949
+ * @memberOf SetCache
3950
+ * @alias push
3951
+ * @param {*} value The value to cache.
3952
+ * @returns {Object} Returns the cache instance.
3953
+ */
3954
+ function setCacheAdd(value) {
3955
+ this.__data__.set(value, HASH_UNDEFINED);
3956
+ return this;
3957
+ }
3958
+
3959
+ /**
3960
+ * Checks if `value` is in the array cache.
3961
+ *
3962
+ * @private
3963
+ * @name has
3964
+ * @memberOf SetCache
3965
+ * @param {*} value The value to search for.
3966
+ * @returns {number} Returns `true` if `value` is found, else `false`.
3967
+ */
3968
+ function setCacheHas(value) {
3969
+ return this.__data__.has(value);
3970
+ }
3971
+
3972
+ // Add methods to `SetCache`.
3973
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
3974
+ SetCache.prototype.has = setCacheHas;
3975
+
3976
+ /**
3977
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
3978
+ *
3979
+ * @private
3980
+ * @param {Array} array The array to inspect.
3981
+ * @param {*} key The key to search for.
3982
+ * @returns {number} Returns the index of the matched value, else `-1`.
3983
+ */
3984
+ function assocIndexOf(array, key) {
3985
+ var length = array.length;
3986
+ while (length--) {
3987
+ if (eq(array[length][0], key)) {
3988
+ return length;
3989
+ }
3990
+ }
3991
+ return -1;
3992
+ }
3993
+
3994
+ /**
3995
+ * The base implementation of methods like `_.difference` without support
3996
+ * for excluding multiple arrays or iteratee shorthands.
3997
+ *
3998
+ * @private
3999
+ * @param {Array} array The array to inspect.
4000
+ * @param {Array} values The values to exclude.
4001
+ * @param {Function} [iteratee] The iteratee invoked per element.
4002
+ * @param {Function} [comparator] The comparator invoked per element.
4003
+ * @returns {Array} Returns the new array of filtered values.
4004
+ */
4005
+ function baseDifference(array, values, iteratee, comparator) {
4006
+ var index = -1,
4007
+ includes = arrayIncludes,
4008
+ isCommon = true,
4009
+ length = array.length,
4010
+ result = [],
4011
+ valuesLength = values.length;
4012
+
4013
+ if (!length) {
4014
+ return result;
4015
+ }
4016
+ if (iteratee) {
4017
+ values = arrayMap(values, baseUnary(iteratee));
4018
+ }
4019
+ if (comparator) {
4020
+ includes = arrayIncludesWith;
4021
+ isCommon = false;
4022
+ }
4023
+ else if (values.length >= LARGE_ARRAY_SIZE) {
4024
+ includes = cacheHas;
4025
+ isCommon = false;
4026
+ values = new SetCache(values);
4027
+ }
4028
+ outer:
4029
+ while (++index < length) {
4030
+ var value = array[index],
4031
+ computed = iteratee ? iteratee(value) : value;
4032
+
4033
+ value = (comparator || value !== 0) ? value : 0;
4034
+ if (isCommon && computed === computed) {
4035
+ var valuesIndex = valuesLength;
4036
+ while (valuesIndex--) {
4037
+ if (values[valuesIndex] === computed) {
4038
+ continue outer;
4039
+ }
4040
+ }
4041
+ result.push(value);
4042
+ }
4043
+ else if (!includes(values, computed, comparator)) {
4044
+ result.push(value);
4045
+ }
4046
+ }
4047
+ return result;
4048
+ }
4049
+
4050
+ /**
4051
+ * The base implementation of `_.flatten` with support for restricting flattening.
4052
+ *
4053
+ * @private
4054
+ * @param {Array} array The array to flatten.
4055
+ * @param {number} depth The maximum recursion depth.
4056
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
4057
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
4058
+ * @param {Array} [result=[]] The initial result value.
4059
+ * @returns {Array} Returns the new flattened array.
4060
+ */
4061
+ function baseFlatten(array, depth, predicate, isStrict, result) {
4062
+ var index = -1,
4063
+ length = array.length;
4064
+
4065
+ predicate || (predicate = isFlattenable);
4066
+ result || (result = []);
4067
+
4068
+ while (++index < length) {
4069
+ var value = array[index];
4070
+ if (depth > 0 && predicate(value)) {
4071
+ if (depth > 1) {
4072
+ // Recursively flatten arrays (susceptible to call stack limits).
4073
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
4074
+ } else {
4075
+ arrayPush(result, value);
4076
+ }
4077
+ } else if (!isStrict) {
4078
+ result[result.length] = value;
4079
+ }
4080
+ }
4081
+ return result;
4082
+ }
4083
+
4084
+ /**
4085
+ * The base implementation of `_.isNative` without bad shim checks.
4086
+ *
4087
+ * @private
4088
+ * @param {*} value The value to check.
4089
+ * @returns {boolean} Returns `true` if `value` is a native function,
4090
+ * else `false`.
4091
+ */
4092
+ function baseIsNative(value) {
4093
+ if (!isObject(value) || isMasked(value)) {
4094
+ return false;
4095
+ }
4096
+ var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
4097
+ return pattern.test(toSource(value));
4098
+ }
4099
+
4100
+ /**
4101
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
4102
+ *
4103
+ * @private
4104
+ * @param {Function} func The function to apply a rest parameter to.
4105
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
4106
+ * @returns {Function} Returns the new function.
4107
+ */
4108
+ function baseRest(func, start) {
4109
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
4110
+ return function() {
4111
+ var args = arguments,
4112
+ index = -1,
4113
+ length = nativeMax(args.length - start, 0),
4114
+ array = Array(length);
4115
+
4116
+ while (++index < length) {
4117
+ array[index] = args[start + index];
4118
+ }
4119
+ index = -1;
4120
+ var otherArgs = Array(start + 1);
4121
+ while (++index < start) {
4122
+ otherArgs[index] = args[index];
4123
+ }
4124
+ otherArgs[start] = array;
4125
+ return apply(func, this, otherArgs);
4126
+ };
4127
+ }
4128
+
4129
+ /**
4130
+ * Gets the data for `map`.
4131
+ *
4132
+ * @private
4133
+ * @param {Object} map The map to query.
4134
+ * @param {string} key The reference key.
4135
+ * @returns {*} Returns the map data.
4136
+ */
4137
+ function getMapData(map, key) {
4138
+ var data = map.__data__;
4139
+ return isKeyable(key)
4140
+ ? data[typeof key == 'string' ? 'string' : 'hash']
4141
+ : data.map;
4142
+ }
4143
+
4144
+ /**
4145
+ * Gets the native function at `key` of `object`.
4146
+ *
4147
+ * @private
4148
+ * @param {Object} object The object to query.
4149
+ * @param {string} key The key of the method to get.
4150
+ * @returns {*} Returns the function if it's native, else `undefined`.
4151
+ */
4152
+ function getNative(object, key) {
4153
+ var value = getValue(object, key);
4154
+ return baseIsNative(value) ? value : undefined;
4155
+ }
4156
+
4157
+ /**
4158
+ * Checks if `value` is a flattenable `arguments` object or array.
4159
+ *
4160
+ * @private
4161
+ * @param {*} value The value to check.
4162
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
4163
+ */
4164
+ function isFlattenable(value) {
4165
+ return isArray(value) || isArguments(value) ||
4166
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
4167
+ }
4168
+
4169
+ /**
4170
+ * Checks if `value` is suitable for use as unique object key.
4171
+ *
4172
+ * @private
4173
+ * @param {*} value The value to check.
4174
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
4175
+ */
4176
+ function isKeyable(value) {
4177
+ var type = typeof value;
4178
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
4179
+ ? (value !== '__proto__')
4180
+ : (value === null);
4181
+ }
4182
+
4183
+ /**
4184
+ * Checks if `func` has its source masked.
4185
+ *
4186
+ * @private
4187
+ * @param {Function} func The function to check.
4188
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
4189
+ */
4190
+ function isMasked(func) {
4191
+ return !!maskSrcKey && (maskSrcKey in func);
4192
+ }
4193
+
4194
+ /**
4195
+ * Converts `func` to its source code.
4196
+ *
4197
+ * @private
4198
+ * @param {Function} func The function to process.
4199
+ * @returns {string} Returns the source code.
4200
+ */
4201
+ function toSource(func) {
4202
+ if (func != null) {
4203
+ try {
4204
+ return funcToString.call(func);
4205
+ } catch (e) {}
4206
+ try {
4207
+ return (func + '');
4208
+ } catch (e) {}
4209
+ }
4210
+ return '';
4211
+ }
4212
+
4213
+ /**
4214
+ * Creates an array of `array` values not included in the other given arrays
4215
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
4216
+ * for equality comparisons. The order of result values is determined by the
4217
+ * order they occur in the first array.
4218
+ *
4219
+ * **Note:** Unlike `_.pullAll`, this method returns a new array.
4220
+ *
4221
+ * @static
4222
+ * @memberOf _
4223
+ * @since 0.1.0
4224
+ * @category Array
4225
+ * @param {Array} array The array to inspect.
4226
+ * @param {...Array} [values] The values to exclude.
4227
+ * @returns {Array} Returns the new array of filtered values.
4228
+ * @see _.without, _.xor
4229
+ * @example
4230
+ *
4231
+ * _.difference([2, 1], [2, 3]);
4232
+ * // => [1]
4233
+ */
4234
+ var difference = baseRest(function(array, values) {
4235
+ return isArrayLikeObject(array)
4236
+ ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
4237
+ : [];
4238
+ });
4239
+
4240
+ /**
4241
+ * Performs a
4242
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
4243
+ * comparison between two values to determine if they are equivalent.
4244
+ *
4245
+ * @static
4246
+ * @memberOf _
4247
+ * @since 4.0.0
4248
+ * @category Lang
4249
+ * @param {*} value The value to compare.
4250
+ * @param {*} other The other value to compare.
4251
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
4252
+ * @example
4253
+ *
4254
+ * var object = { 'a': 1 };
4255
+ * var other = { 'a': 1 };
4256
+ *
4257
+ * _.eq(object, object);
4258
+ * // => true
4259
+ *
4260
+ * _.eq(object, other);
4261
+ * // => false
4262
+ *
4263
+ * _.eq('a', 'a');
4264
+ * // => true
4265
+ *
4266
+ * _.eq('a', Object('a'));
4267
+ * // => false
4268
+ *
4269
+ * _.eq(NaN, NaN);
4270
+ * // => true
4271
+ */
4272
+ function eq(value, other) {
4273
+ return value === other || (value !== value && other !== other);
4274
+ }
4275
+
4276
+ /**
4277
+ * Checks if `value` is likely an `arguments` object.
4278
+ *
4279
+ * @static
4280
+ * @memberOf _
4281
+ * @since 0.1.0
4282
+ * @category Lang
4283
+ * @param {*} value The value to check.
4284
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
4285
+ * else `false`.
4286
+ * @example
4287
+ *
4288
+ * _.isArguments(function() { return arguments; }());
4289
+ * // => true
4290
+ *
4291
+ * _.isArguments([1, 2, 3]);
4292
+ * // => false
4293
+ */
4294
+ function isArguments(value) {
4295
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
4296
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
4297
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
4298
+ }
4299
+
4300
+ /**
4301
+ * Checks if `value` is classified as an `Array` object.
4302
+ *
4303
+ * @static
4304
+ * @memberOf _
4305
+ * @since 0.1.0
4306
+ * @category Lang
4307
+ * @param {*} value The value to check.
4308
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
4309
+ * @example
4310
+ *
4311
+ * _.isArray([1, 2, 3]);
4312
+ * // => true
4313
+ *
4314
+ * _.isArray(document.body.children);
4315
+ * // => false
4316
+ *
4317
+ * _.isArray('abc');
4318
+ * // => false
4319
+ *
4320
+ * _.isArray(_.noop);
4321
+ * // => false
4322
+ */
4323
+ var isArray = Array.isArray;
4324
+
4325
+ /**
4326
+ * Checks if `value` is array-like. A value is considered array-like if it's
4327
+ * not a function and has a `value.length` that's an integer greater than or
4328
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
4329
+ *
4330
+ * @static
4331
+ * @memberOf _
4332
+ * @since 4.0.0
4333
+ * @category Lang
4334
+ * @param {*} value The value to check.
4335
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
4336
+ * @example
4337
+ *
4338
+ * _.isArrayLike([1, 2, 3]);
4339
+ * // => true
4340
+ *
4341
+ * _.isArrayLike(document.body.children);
4342
+ * // => true
4343
+ *
4344
+ * _.isArrayLike('abc');
4345
+ * // => true
4346
+ *
4347
+ * _.isArrayLike(_.noop);
4348
+ * // => false
4349
+ */
4350
+ function isArrayLike(value) {
4351
+ return value != null && isLength(value.length) && !isFunction(value);
4352
+ }
4353
+
4354
+ /**
4355
+ * This method is like `_.isArrayLike` except that it also checks if `value`
4356
+ * is an object.
4357
+ *
4358
+ * @static
4359
+ * @memberOf _
4360
+ * @since 4.0.0
4361
+ * @category Lang
4362
+ * @param {*} value The value to check.
4363
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
4364
+ * else `false`.
4365
+ * @example
4366
+ *
4367
+ * _.isArrayLikeObject([1, 2, 3]);
4368
+ * // => true
4369
+ *
4370
+ * _.isArrayLikeObject(document.body.children);
4371
+ * // => true
4372
+ *
4373
+ * _.isArrayLikeObject('abc');
4374
+ * // => false
4375
+ *
4376
+ * _.isArrayLikeObject(_.noop);
4377
+ * // => false
4378
+ */
4379
+ function isArrayLikeObject(value) {
4380
+ return isObjectLike(value) && isArrayLike(value);
4381
+ }
4382
+
4383
+ /**
4384
+ * Checks if `value` is classified as a `Function` object.
4385
+ *
4386
+ * @static
4387
+ * @memberOf _
4388
+ * @since 0.1.0
4389
+ * @category Lang
4390
+ * @param {*} value The value to check.
4391
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
4392
+ * @example
4393
+ *
4394
+ * _.isFunction(_);
4395
+ * // => true
4396
+ *
4397
+ * _.isFunction(/abc/);
4398
+ * // => false
4399
+ */
4400
+ function isFunction(value) {
4401
+ // The use of `Object#toString` avoids issues with the `typeof` operator
4402
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
4403
+ var tag = isObject(value) ? objectToString.call(value) : '';
4404
+ return tag == funcTag || tag == genTag;
4405
+ }
4406
+
4407
+ /**
4408
+ * Checks if `value` is a valid array-like length.
4409
+ *
4410
+ * **Note:** This method is loosely based on
4411
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
4412
+ *
4413
+ * @static
4414
+ * @memberOf _
4415
+ * @since 4.0.0
4416
+ * @category Lang
4417
+ * @param {*} value The value to check.
4418
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
4419
+ * @example
4420
+ *
4421
+ * _.isLength(3);
4422
+ * // => true
4423
+ *
4424
+ * _.isLength(Number.MIN_VALUE);
4425
+ * // => false
4426
+ *
4427
+ * _.isLength(Infinity);
4428
+ * // => false
4429
+ *
4430
+ * _.isLength('3');
4431
+ * // => false
4432
+ */
4433
+ function isLength(value) {
4434
+ return typeof value == 'number' &&
4435
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
4436
+ }
4437
+
4438
+ /**
4439
+ * Checks if `value` is the
4440
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4441
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4442
+ *
4443
+ * @static
4444
+ * @memberOf _
4445
+ * @since 0.1.0
4446
+ * @category Lang
4447
+ * @param {*} value The value to check.
4448
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4449
+ * @example
4450
+ *
4451
+ * _.isObject({});
4452
+ * // => true
4453
+ *
4454
+ * _.isObject([1, 2, 3]);
4455
+ * // => true
4456
+ *
4457
+ * _.isObject(_.noop);
4458
+ * // => true
4459
+ *
4460
+ * _.isObject(null);
4461
+ * // => false
4462
+ */
4463
+ function isObject(value) {
4464
+ var type = typeof value;
4465
+ return !!value && (type == 'object' || type == 'function');
4466
+ }
4467
+
4468
+ /**
4469
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
4470
+ * and has a `typeof` result of "object".
4471
+ *
4472
+ * @static
4473
+ * @memberOf _
4474
+ * @since 4.0.0
4475
+ * @category Lang
4476
+ * @param {*} value The value to check.
4477
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4478
+ * @example
4479
+ *
4480
+ * _.isObjectLike({});
4481
+ * // => true
4482
+ *
4483
+ * _.isObjectLike([1, 2, 3]);
4484
+ * // => true
4485
+ *
4486
+ * _.isObjectLike(_.noop);
4487
+ * // => false
4488
+ *
4489
+ * _.isObjectLike(null);
4490
+ * // => false
4491
+ */
4492
+ function isObjectLike(value) {
4493
+ return !!value && typeof value == 'object';
4494
+ }
4495
+
4496
+ var lodash_difference = difference;
4497
+
4498
+ var _difference = /*@__PURE__*/getDefaultExportFromCjs(lodash_difference);
4499
+
4500
+ /**
4501
+ * Makes sure all values in the grid have a rectangular shape.
4502
+ * We don't support Tetris types.
4503
+ */
4504
+ const assertGridIsValid = (availableKeys, grid) => {
4505
+ const distinctValues = grid.getDistinctValues();
4506
+ // Check if all `availableKeys` have a place in the given grid
4507
+ if (distinctValues.length < availableKeys.length) {
4508
+ throw new Error(`Not all given fields are present in the grid. Please add these fields ${_difference(distinctValues, availableKeys).map(_ => `"${_}"`).join(", ")}`);
4509
+ }
4510
+ // We don't support tetris-shaped values:
4511
+ // E.g:
4512
+ // [
4513
+ // [1,1,1],
4514
+ // [0,1,0]
4515
+ // ]
4516
+ distinctValues.forEach((value) => {
4517
+ if (!availableKeys.includes(value)) {
4518
+ throw new Error(`${value} is not an existing field. Existing fields are ${availableKeys.map(_ => `"${_}"`).join(", ")}.`);
4519
+ }
4520
+ const coordinates = grid.getCoordinatesForValue(value);
4521
+ const subGrid = grid.sliceArea(coordinates.topLeft, coordinates.bottomRight);
4522
+ const subGridDistinctValues = subGrid.getDistinctValues();
4523
+ if (subGridDistinctValues.length !== 1 || subGridDistinctValues[0] !== value) {
4524
+ throw new Error(`Grid contains an unsupported shape. Please make sure "${value}" has a rectangular shape.`);
4525
+ }
4526
+ });
4527
+ return true;
4528
+ };
4529
+
4530
+ const equalColumns = (num, buttonGutter) => {
4531
+ const fractions = [...Array(num)].map(_ => "1fr");
4532
+ if (buttonGutter) {
4533
+ fractions.push("auto");
4534
+ }
4535
+ return fractions.join(" ");
4536
+ };
4537
+
4538
+ class FormPositioner {
4539
+ constructor(fields, columns = {} // -> ignore property, its used to pass along internally.
4540
+ ) {
4541
+ this.fields = fields;
4542
+ this.columns = columns;
4543
+ }
4544
+ /**
4545
+ * Position form elements responsively in a grid.
4546
+ * Example usage:
4547
+ *
4548
+ *
4549
+ * .setGrid("laptop", [ // Breakpoint from laptop to bigger
4550
+ * ["title", "title", "title"], // NOTE: title has a colspan of 3
4551
+ * ["street", "number", "city"],
4552
+ * ["code", "description", "description"], // NOTE: description has a colspan of 2, and a rowspan of 2
4553
+ * ["status", "description", "description"]
4554
+ * ])
4555
+ * .setVertical("mobileS", 1) // NOTE: align everything in a single column for mobileS until laptop
4556
+ *
4557
+ */
4558
+ setGrid(breakPoint, columns, arrayGrid) {
4559
+ // We save the columns setting in a different prop.
4560
+ if (typeof this.columns === "object") {
4561
+ this.columns[breakPoint] = columns;
4562
+ }
4563
+ // Wrap array grid in a Grid object.
4564
+ // It has some nice utility functions to work with.
4565
+ const grid = new Grid(arrayGrid);
4566
+ // Make sure the given grid is a valid grid:
4567
+ assertGridIsValid(Object.keys(this.fields), grid);
4568
+ // Update position attributes for the given fields:
4569
+ const fields = immer.produce(this.fields, draftState => {
4570
+ Object
4571
+ .keys(this.fields)
4572
+ .forEach(key => {
4573
+ const fieldProps = draftState[key].props;
4574
+ const { topLeft, bottomRight } = grid.getCoordinatesForValue(key);
4575
+ if (fieldProps.position === undefined) {
4576
+ fieldProps.position = {};
4577
+ }
4578
+ if (!isResponsiveObject(fieldProps.position)) {
4579
+ // When there already was a position set, but it wasn't marked responsive,
4580
+ // We set that value to the lowest breakpoint:
4581
+ fieldProps.position = { mobile: fieldProps.position };
4582
+ }
4583
+ // Set values to breakpoint.
4584
+ // @ts-ignore
4585
+ fieldProps.position[breakPoint] = {
4586
+ column: topLeft.x,
4587
+ columnSpan: bottomRight.x - topLeft.x + 1,
4588
+ row: topLeft.y,
4589
+ rowSpan: bottomRight.y - topLeft.y + 1
4590
+ };
4591
+ });
4592
+ });
4593
+ // Return a new formPositioner.
4594
+ // It allows us to chain, while still being immutable.
4595
+ return new FormPositioner(fields, this.columns);
4596
+ }
4597
+ /**
4598
+ * Aligns all input-fields vertically.
4599
+ */
4600
+ setVertical(breakPoint, numColumns = 1, columns) {
4601
+ return this.setGrid(breakPoint, columns !== null && columns !== void 0 ? columns : equalColumns(numColumns, false), _chunk(Object.keys(this.fields), numColumns));
4602
+ }
4603
+ /**
4604
+ * Aligns all input-fields horizontally.
4605
+ */
4606
+ setHorizontal(breakPoint, columns) {
4607
+ const keys = Object.keys(this.fields);
4608
+ return this.setGrid(breakPoint, columns !== null && columns !== void 0 ? columns : equalColumns(keys.length, false), [keys]);
4609
+ }
4610
+ getColumns() {
4611
+ return this.columns;
4612
+ }
4613
+ getFields() {
4614
+ return this.fields;
4615
+ }
4616
+ getScaffoldProps() {
4617
+ return {
4618
+ fields: this.fields,
4619
+ columns: this.columns
4620
+ };
4621
+ }
4622
+ }
4623
+
4624
+ const ScaffoldFormContext = React.createContext({ factory: undefined });
4625
+ const ScaffoldFormProvider = ({ factory, children }) => (React.createElement(ScaffoldFormContext.Provider, { value: { factory: factory } }, children));
4626
+
4627
+ const useScaffoldFormContext = () => React.useContext(ScaffoldFormContext);
4628
+
4629
+ const getComponent = (field) => {
4630
+ switch (field.type) {
4631
+ case "Button":
4632
+ return Button$1;
4633
+ case "Checkbox":
4634
+ return Checkbox;
4635
+ case "Select":
4636
+ return Select;
4637
+ case "FileField":
4638
+ return FileField;
4639
+ case "PasswordStrengthField":
4640
+ return PasswordStrengthField;
4641
+ case "TextField":
4642
+ default:
4643
+ return TextField;
4644
+ }
4645
+ };
4646
+ const ScaffoldField = React.forwardRef((_a, ref) => {
4647
+ var { name, field } = _a, restProps = __rest(_a, ["name", "field"]);
4648
+ const { factory } = useScaffoldFormContext();
4649
+ const formGridWrapperProps = getFormGridWrapperProps(field.props);
4650
+ const Component = (factory === null || factory === void 0 ? void 0 : factory(field)) || getComponent(field);
4651
+ // @ts-ignore
4652
+ if (field.type === "TextField" && field.props.type === "hidden") {
4653
+ return React.createElement(Component, Object.assign({ ref: ref, name: name }, restProps, field.props));
4654
+ }
4655
+ return (React.createElement(FormGridWrapper, Object.assign({}, formGridWrapperProps),
4656
+ React.createElement(Component, Object.assign({ ref: ref, name: name, placeholder: field.props.placeholder || formGridWrapperProps.label, className: clsx(!!formGridWrapperProps.error && 'error', field.props.className) }, restProps, field.props))));
4657
+ });
4658
+
4659
+ const ScaffoldForm = React.forwardRef((_a, ref) => {
4660
+ var { children, columns, fields, prefixFieldNames } = _a, restProps = __rest(_a, ["children", "columns", "fields", "prefixFieldNames"]);
4661
+ return (React.createElement(FormGrid, { columns: columns },
4662
+ Object
4663
+ .entries(fields)
4664
+ .map(([key, fieldProps]) => (
4665
+ // @ts-ignore
4666
+ React.createElement(ScaffoldField, Object.assign({ name: `${prefixFieldNames !== null && prefixFieldNames !== void 0 ? prefixFieldNames : ''}${key}`, key: key, field: fieldProps, ref: ref }, restProps)))),
4667
+ children));
4668
+ });
4669
+
4670
+ exports.Alert = Alert;
4671
+ exports.AnimatedCheckmark = AnimatedCheckmark;
4672
+ exports.BasicLayout = BasicLayout;
4673
+ exports.Box = Box;
4674
+ exports.BreadCrumbs = BreadCrumbs;
4675
+ exports.BreakPointValues = BreakPointValues;
4676
+ exports.Button = Button$1;
4677
+ exports.Checkbox = Checkbox;
4678
+ exports.CollapsiblePanel = CollapsiblePanel;
4679
+ exports.ConfirmButton = ConfirmButton;
4680
+ exports.ConfirmModal = ConfirmModal;
4681
+ exports.Crumb = Crumb;
4682
+ exports.Details = Details;
4683
+ exports.Dropdown = Dropdown;
4684
+ exports.DropdownMenu = DropdownMenu;
4685
+ exports.DropdownMenuItem = DropdownMenuItem;
4686
+ exports.Dropzone = Dropzone;
4687
+ exports.Feedback = Feedback;
4688
+ exports.FileField = FileField;
4689
+ exports.Floater = Floater;
4690
+ exports.FloatingPanelLayout = FloatingPanelLayout;
4691
+ exports.Footer = Footer;
4692
+ exports.FormGrid = FormGrid;
4693
+ exports.FormGridWrapper = FormGridWrapper;
4694
+ exports.FormPositioner = FormPositioner;
4695
+ exports.HamburgerButton = HamburgerButton;
4696
+ exports.Header = Header;
4697
+ exports.HorizontalScroller = HorizontalScroller;
4698
+ exports.Menu = Menu;
4699
+ exports.MenuCloseButton = MenuCloseButton;
4700
+ exports.MenuItem = MenuItem;
4701
+ exports.MenuSlideOpenIndicator = MenuSlideOpenIndicator;
4702
+ exports.Modal = Modal;
4703
+ exports.Overlay = Overlay;
4704
+ exports.Paginator = Paginator;
4705
+ exports.Panel = Panel;
4706
+ exports.Paragraph = Paragraph;
4707
+ exports.PasswordStrengthField = PasswordStrengthField;
4708
+ exports.ScaffoldForm = ScaffoldForm;
4709
+ exports.ScaffoldFormContext = ScaffoldFormContext;
4710
+ exports.ScaffoldFormProvider = ScaffoldFormProvider;
4711
+ exports.Section = Section;
4712
+ exports.Select = Select;
4713
+ exports.SideBarHeader = SideBarHeader;
4714
+ exports.SimpleTimeline = SimpleTimeline;
4715
+ exports.SlideInFromTop = SlideInFromTop;
4716
+ exports.Statistic = Statistic;
4717
+ exports.StyledTable = StyledTable;
4718
+ exports.Tab = Tab;
4719
+ exports.TabContent = TabContent;
4720
+ exports.Table = Table;
4721
+ exports.Tabs = Tabs;
4722
+ exports.TextField = TextField;
4723
+ exports.Timeline = Timeline;
4724
+ exports.TopBar = TopBar;
4725
+ exports.UiProvider = UiProvider;
4726
+ exports.UiWrapper = UiWrapper;
4727
+ exports.VerticalRhythmLaptop = VerticalRhythmLaptop;
4728
+ exports.VerticalRhythmMobile = VerticalRhythmMobile;
4729
+ exports.calculatePasswordScore = calculatePasswordScore;
4730
+ exports.getFormGridWrapperProps = getFormGridWrapperProps;
4731
+ exports.isResponsiveObject = isResponsiveObject;
4732
+ exports.mq = mq;
4733
+ exports.passwordHasLowerAndUppercase = passwordHasLowerAndUppercase;
4734
+ exports.passwordHasNumbers = passwordHasNumbers;
4735
+ exports.passwordHasSpecialChars = passwordHasSpecialChars;
4736
+ exports.passwordMinLength = passwordMinLength;
4737
+ exports.responsiveProps = responsiveProps;
4738
+ exports.theme = theme;
4739
+ exports.useCloseSidebarOnNavigate = useCloseSidebarOnNavigate;
4740
+ exports.useResponsiveBreakpoints = useResponsiveBreakpoints;
4741
+ exports.useToggleMobileMenu = useToggleMobileMenu;