@moda/om 19.7.2 → 19.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1691 -1505
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1691 -1505
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/SearchInput/SearchInput.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/SearchInput/SearchInput.tsx +6 -1
package/dist/index.esm.js
CHANGED
|
@@ -3,1003 +3,1074 @@ import React__default, { useState, createContext, PureComponent, useRef, useEffe
|
|
|
3
3
|
import { Link, Prompt } from 'react-router-dom';
|
|
4
4
|
import require$$1, { createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
|
-
|
|
8
6
|
function getDefaultExportFromCjs (x) {
|
|
9
7
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
(function (global, factory) {
|
|
14
|
-
factory() ;
|
|
15
|
-
})(commonjsGlobal, function () {
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Applies the :focus-visible polyfill at the given scope.
|
|
19
|
-
* A scope in this case is either the top-level Document or a Shadow Root.
|
|
20
|
-
*
|
|
21
|
-
* @param {(Document|ShadowRoot)} scope
|
|
22
|
-
* @see https://github.com/WICG/focus-visible
|
|
23
|
-
*/
|
|
24
|
-
function applyFocusVisiblePolyfill(scope) {
|
|
25
|
-
var hadKeyboardEvent = true;
|
|
26
|
-
var hadFocusVisibleRecently = false;
|
|
27
|
-
var hadFocusVisibleRecentlyTimeout = null;
|
|
28
|
-
var inputTypesAllowlist = {
|
|
29
|
-
text: true,
|
|
30
|
-
search: true,
|
|
31
|
-
url: true,
|
|
32
|
-
tel: true,
|
|
33
|
-
email: true,
|
|
34
|
-
password: true,
|
|
35
|
-
number: true,
|
|
36
|
-
date: true,
|
|
37
|
-
month: true,
|
|
38
|
-
week: true,
|
|
39
|
-
time: true,
|
|
40
|
-
datetime: true,
|
|
41
|
-
'datetime-local': true
|
|
42
|
-
};
|
|
10
|
+
var focusVisible$1 = {exports: {}};
|
|
43
11
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
12
|
+
var focusVisible = focusVisible$1.exports;
|
|
13
|
+
var hasRequiredFocusVisible;
|
|
14
|
+
function requireFocusVisible() {
|
|
15
|
+
if (hasRequiredFocusVisible) return focusVisible$1.exports;
|
|
16
|
+
hasRequiredFocusVisible = 1;
|
|
17
|
+
(function (module, exports) {
|
|
18
|
+
(function (global, factory) {
|
|
19
|
+
factory() ;
|
|
20
|
+
})(focusVisible, function () {
|
|
55
21
|
|
|
56
22
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @param {
|
|
61
|
-
* @
|
|
23
|
+
* Applies the :focus-visible polyfill at the given scope.
|
|
24
|
+
* A scope in this case is either the top-level Document or a Shadow Root.
|
|
25
|
+
*
|
|
26
|
+
* @param {(Document|ShadowRoot)} scope
|
|
27
|
+
* @see https://github.com/WICG/focus-visible
|
|
62
28
|
*/
|
|
63
|
-
function
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
29
|
+
function applyFocusVisiblePolyfill(scope) {
|
|
30
|
+
var hadKeyboardEvent = true;
|
|
31
|
+
var hadFocusVisibleRecently = false;
|
|
32
|
+
var hadFocusVisibleRecentlyTimeout = null;
|
|
33
|
+
var inputTypesAllowlist = {
|
|
34
|
+
text: true,
|
|
35
|
+
search: true,
|
|
36
|
+
url: true,
|
|
37
|
+
tel: true,
|
|
38
|
+
email: true,
|
|
39
|
+
password: true,
|
|
40
|
+
number: true,
|
|
41
|
+
date: true,
|
|
42
|
+
month: true,
|
|
43
|
+
week: true,
|
|
44
|
+
time: true,
|
|
45
|
+
datetime: true,
|
|
46
|
+
'datetime-local': true
|
|
47
|
+
};
|
|
77
48
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Helper function for legacy browsers and iframes which sometimes focus
|
|
51
|
+
* elements like document, body, and non-interactive SVG.
|
|
52
|
+
* @param {Element} el
|
|
53
|
+
*/
|
|
54
|
+
function isValidFocusTarget(el) {
|
|
55
|
+
if (el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
86
59
|
}
|
|
87
|
-
el.classList.add('focus-visible');
|
|
88
|
-
el.setAttribute('data-focus-visible-added', '');
|
|
89
|
-
}
|
|
90
60
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Computes whether the given element should automatically trigger the
|
|
63
|
+
* `focus-visible` class being added, i.e. whether it should always match
|
|
64
|
+
* `:focus-visible` when focused.
|
|
65
|
+
* @param {Element} el
|
|
66
|
+
* @return {boolean}
|
|
67
|
+
*/
|
|
68
|
+
function focusTriggersKeyboardModality(el) {
|
|
69
|
+
var type = el.type;
|
|
70
|
+
var tagName = el.tagName;
|
|
71
|
+
if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (tagName === 'TEXTAREA' && !el.readOnly) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (el.isContentEditable) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
99
81
|
}
|
|
100
|
-
el.classList.remove('focus-visible');
|
|
101
|
-
el.removeAttribute('data-focus-visible-added');
|
|
102
|
-
}
|
|
103
82
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Add the `focus-visible` class to the given element if it was not added by
|
|
85
|
+
* the author.
|
|
86
|
+
* @param {Element} el
|
|
87
|
+
*/
|
|
88
|
+
function addFocusVisibleClass(el) {
|
|
89
|
+
if (el.classList.contains('focus-visible')) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
el.classList.add('focus-visible');
|
|
93
|
+
el.setAttribute('data-focus-visible-added', '');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Remove the `focus-visible` class from the given element if it was not
|
|
98
|
+
* originally added by the author.
|
|
99
|
+
* @param {Element} el
|
|
100
|
+
*/
|
|
101
|
+
function removeFocusVisibleClass(el) {
|
|
102
|
+
if (!el.hasAttribute('data-focus-visible-added')) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
el.classList.remove('focus-visible');
|
|
106
|
+
el.removeAttribute('data-focus-visible-added');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* If the most recent user interaction was via the keyboard;
|
|
111
|
+
* and the key press did not include a meta, alt/option, or control key;
|
|
112
|
+
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
113
|
+
* Apply `focus-visible` to any current active element and keep track
|
|
114
|
+
* of our keyboard modality state with `hadKeyboardEvent`.
|
|
115
|
+
* @param {KeyboardEvent} e
|
|
116
|
+
*/
|
|
117
|
+
function onKeyDown(e) {
|
|
118
|
+
if (e.metaKey || e.altKey || e.ctrlKey) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (isValidFocusTarget(scope.activeElement)) {
|
|
122
|
+
addFocusVisibleClass(scope.activeElement);
|
|
123
|
+
}
|
|
124
|
+
hadKeyboardEvent = true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* If at any point a user clicks with a pointing device, ensure that we change
|
|
129
|
+
* the modality away from keyboard.
|
|
130
|
+
* This avoids the situation where a user presses a key on an already focused
|
|
131
|
+
* element, and then clicks on a different element, focusing it with a
|
|
132
|
+
* pointing device, while we still think we're in keyboard modality.
|
|
133
|
+
* @param {Event} e
|
|
134
|
+
*/
|
|
135
|
+
function onPointerDown(e) {
|
|
136
|
+
hadKeyboardEvent = false;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* On `focus`, add the `focus-visible` class to the target if:
|
|
141
|
+
* - the target received focus as a result of keyboard navigation, or
|
|
142
|
+
* - the event target is an element that will likely require interaction
|
|
143
|
+
* via the keyboard (e.g. a text box)
|
|
144
|
+
* @param {Event} e
|
|
145
|
+
*/
|
|
146
|
+
function onFocus(e) {
|
|
147
|
+
// Prevent IE from focusing the document or HTML element.
|
|
148
|
+
if (!isValidFocusTarget(e.target)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {
|
|
152
|
+
addFocusVisibleClass(e.target);
|
|
153
|
+
}
|
|
118
154
|
}
|
|
119
|
-
hadKeyboardEvent = true;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* If at any point a user clicks with a pointing device, ensure that we change
|
|
124
|
-
* the modality away from keyboard.
|
|
125
|
-
* This avoids the situation where a user presses a key on an already focused
|
|
126
|
-
* element, and then clicks on a different element, focusing it with a
|
|
127
|
-
* pointing device, while we still think we're in keyboard modality.
|
|
128
|
-
* @param {Event} e
|
|
129
|
-
*/
|
|
130
|
-
function onPointerDown(e) {
|
|
131
|
-
hadKeyboardEvent = false;
|
|
132
|
-
}
|
|
133
155
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
/**
|
|
157
|
+
* On `blur`, remove the `focus-visible` class from the target.
|
|
158
|
+
* @param {Event} e
|
|
159
|
+
*/
|
|
160
|
+
function onBlur(e) {
|
|
161
|
+
if (!isValidFocusTarget(e.target)) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (e.target.classList.contains('focus-visible') || e.target.hasAttribute('data-focus-visible-added')) {
|
|
165
|
+
// To detect a tab/window switch, we look for a blur event followed
|
|
166
|
+
// rapidly by a visibility change.
|
|
167
|
+
// If we don't see a visibility change within 100ms, it's probably a
|
|
168
|
+
// regular focus change.
|
|
169
|
+
hadFocusVisibleRecently = true;
|
|
170
|
+
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
|
171
|
+
hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
|
|
172
|
+
hadFocusVisibleRecently = false;
|
|
173
|
+
}, 100);
|
|
174
|
+
removeFocusVisibleClass(e.target);
|
|
175
|
+
}
|
|
148
176
|
}
|
|
149
|
-
}
|
|
150
177
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
hadFocusVisibleRecently = false;
|
|
168
|
-
}, 100);
|
|
169
|
-
removeFocusVisibleClass(e.target);
|
|
178
|
+
/**
|
|
179
|
+
* If the user changes tabs, keep track of whether or not the previously
|
|
180
|
+
* focused element had .focus-visible.
|
|
181
|
+
* @param {Event} e
|
|
182
|
+
*/
|
|
183
|
+
function onVisibilityChange(e) {
|
|
184
|
+
if (document.visibilityState === 'hidden') {
|
|
185
|
+
// If the tab becomes active again, the browser will handle calling focus
|
|
186
|
+
// on the element (Safari actually calls it twice).
|
|
187
|
+
// If this tab change caused a blur on an element with focus-visible,
|
|
188
|
+
// re-apply the class when the user switches back to the tab.
|
|
189
|
+
if (hadFocusVisibleRecently) {
|
|
190
|
+
hadKeyboardEvent = true;
|
|
191
|
+
}
|
|
192
|
+
addInitialPointerMoveListeners();
|
|
193
|
+
}
|
|
170
194
|
}
|
|
171
|
-
}
|
|
172
195
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Add a group of listeners to detect usage of any pointing devices.
|
|
198
|
+
* These listeners will be added when the polyfill first loads, and anytime
|
|
199
|
+
* the window is blurred, so that they are active when the window regains
|
|
200
|
+
* focus.
|
|
201
|
+
*/
|
|
202
|
+
function addInitialPointerMoveListeners() {
|
|
203
|
+
document.addEventListener('mousemove', onInitialPointerMove);
|
|
204
|
+
document.addEventListener('mousedown', onInitialPointerMove);
|
|
205
|
+
document.addEventListener('mouseup', onInitialPointerMove);
|
|
206
|
+
document.addEventListener('pointermove', onInitialPointerMove);
|
|
207
|
+
document.addEventListener('pointerdown', onInitialPointerMove);
|
|
208
|
+
document.addEventListener('pointerup', onInitialPointerMove);
|
|
209
|
+
document.addEventListener('touchmove', onInitialPointerMove);
|
|
210
|
+
document.addEventListener('touchstart', onInitialPointerMove);
|
|
211
|
+
document.addEventListener('touchend', onInitialPointerMove);
|
|
212
|
+
}
|
|
213
|
+
function removeInitialPointerMoveListeners() {
|
|
214
|
+
document.removeEventListener('mousemove', onInitialPointerMove);
|
|
215
|
+
document.removeEventListener('mousedown', onInitialPointerMove);
|
|
216
|
+
document.removeEventListener('mouseup', onInitialPointerMove);
|
|
217
|
+
document.removeEventListener('pointermove', onInitialPointerMove);
|
|
218
|
+
document.removeEventListener('pointerdown', onInitialPointerMove);
|
|
219
|
+
document.removeEventListener('pointerup', onInitialPointerMove);
|
|
220
|
+
document.removeEventListener('touchmove', onInitialPointerMove);
|
|
221
|
+
document.removeEventListener('touchstart', onInitialPointerMove);
|
|
222
|
+
document.removeEventListener('touchend', onInitialPointerMove);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* When the polfyill first loads, assume the user is in keyboard modality.
|
|
227
|
+
* If any event is received from a pointing device (e.g. mouse, pointer,
|
|
228
|
+
* touch), turn off keyboard modality.
|
|
229
|
+
* This accounts for situations where focus enters the page from the URL bar.
|
|
230
|
+
* @param {Event} e
|
|
231
|
+
*/
|
|
232
|
+
function onInitialPointerMove(e) {
|
|
233
|
+
// Work around a Safari quirk that fires a mousemove on <html> whenever the
|
|
234
|
+
// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
|
|
235
|
+
if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {
|
|
236
|
+
return;
|
|
186
237
|
}
|
|
187
|
-
|
|
238
|
+
hadKeyboardEvent = false;
|
|
239
|
+
removeInitialPointerMoveListeners();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// For some kinds of state, we are interested in changes at the global scope
|
|
243
|
+
// only. For example, global pointer input, global key presses and global
|
|
244
|
+
// visibility change should affect the state at every scope:
|
|
245
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
246
|
+
document.addEventListener('mousedown', onPointerDown, true);
|
|
247
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
248
|
+
document.addEventListener('touchstart', onPointerDown, true);
|
|
249
|
+
document.addEventListener('visibilitychange', onVisibilityChange, true);
|
|
250
|
+
addInitialPointerMoveListeners();
|
|
251
|
+
|
|
252
|
+
// For focus and blur, we specifically care about state changes in the local
|
|
253
|
+
// scope. This is because focus / blur events that originate from within a
|
|
254
|
+
// shadow root are not re-dispatched from the host element if it was already
|
|
255
|
+
// the active element in its own scope:
|
|
256
|
+
scope.addEventListener('focus', onFocus, true);
|
|
257
|
+
scope.addEventListener('blur', onBlur, true);
|
|
258
|
+
|
|
259
|
+
// We detect that a node is a ShadowRoot by ensuring that it is a
|
|
260
|
+
// DocumentFragment and also has a host property. This check covers native
|
|
261
|
+
// implementation and polyfill implementation transparently. If we only cared
|
|
262
|
+
// about the native implementation, we could just check if the scope was
|
|
263
|
+
// an instance of a ShadowRoot.
|
|
264
|
+
if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {
|
|
265
|
+
// Since a ShadowRoot is a special kind of DocumentFragment, it does not
|
|
266
|
+
// have a root element to add a class to. So, we add this attribute to the
|
|
267
|
+
// host element instead:
|
|
268
|
+
scope.host.setAttribute('data-js-focus-visible', '');
|
|
269
|
+
} else if (scope.nodeType === Node.DOCUMENT_NODE) {
|
|
270
|
+
document.documentElement.classList.add('js-focus-visible');
|
|
271
|
+
document.documentElement.setAttribute('data-js-focus-visible', '');
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// It is important to wrap all references to global window and document in
|
|
276
|
+
// these checks to support server-side rendering use cases
|
|
277
|
+
// @see https://github.com/WICG/focus-visible/issues/199
|
|
278
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
279
|
+
// Make the polyfill helper globally available. This can be used as a signal
|
|
280
|
+
// to interested libraries that wish to coordinate with the polyfill for e.g.,
|
|
281
|
+
// applying the polyfill to a shadow root:
|
|
282
|
+
window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;
|
|
283
|
+
|
|
284
|
+
// Notify interested libraries of the polyfill's presence, in case the
|
|
285
|
+
// polyfill was loaded lazily:
|
|
286
|
+
var event;
|
|
287
|
+
try {
|
|
288
|
+
event = new CustomEvent('focus-visible-polyfill-ready');
|
|
289
|
+
} catch (error) {
|
|
290
|
+
// IE11 does not support using CustomEvent as a constructor directly:
|
|
291
|
+
event = document.createEvent('CustomEvent');
|
|
292
|
+
event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});
|
|
188
293
|
}
|
|
294
|
+
window.dispatchEvent(event);
|
|
189
295
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
* the window is blurred, so that they are active when the window regains
|
|
195
|
-
* focus.
|
|
196
|
-
*/
|
|
197
|
-
function addInitialPointerMoveListeners() {
|
|
198
|
-
document.addEventListener('mousemove', onInitialPointerMove);
|
|
199
|
-
document.addEventListener('mousedown', onInitialPointerMove);
|
|
200
|
-
document.addEventListener('mouseup', onInitialPointerMove);
|
|
201
|
-
document.addEventListener('pointermove', onInitialPointerMove);
|
|
202
|
-
document.addEventListener('pointerdown', onInitialPointerMove);
|
|
203
|
-
document.addEventListener('pointerup', onInitialPointerMove);
|
|
204
|
-
document.addEventListener('touchmove', onInitialPointerMove);
|
|
205
|
-
document.addEventListener('touchstart', onInitialPointerMove);
|
|
206
|
-
document.addEventListener('touchend', onInitialPointerMove);
|
|
207
|
-
}
|
|
208
|
-
function removeInitialPointerMoveListeners() {
|
|
209
|
-
document.removeEventListener('mousemove', onInitialPointerMove);
|
|
210
|
-
document.removeEventListener('mousedown', onInitialPointerMove);
|
|
211
|
-
document.removeEventListener('mouseup', onInitialPointerMove);
|
|
212
|
-
document.removeEventListener('pointermove', onInitialPointerMove);
|
|
213
|
-
document.removeEventListener('pointerdown', onInitialPointerMove);
|
|
214
|
-
document.removeEventListener('pointerup', onInitialPointerMove);
|
|
215
|
-
document.removeEventListener('touchmove', onInitialPointerMove);
|
|
216
|
-
document.removeEventListener('touchstart', onInitialPointerMove);
|
|
217
|
-
document.removeEventListener('touchend', onInitialPointerMove);
|
|
296
|
+
if (typeof document !== 'undefined') {
|
|
297
|
+
// Apply the polyfill to the global document, so that no JavaScript
|
|
298
|
+
// coordination is required to use the polyfill in the top-level document:
|
|
299
|
+
applyFocusVisiblePolyfill(document);
|
|
218
300
|
}
|
|
301
|
+
});
|
|
302
|
+
})();
|
|
303
|
+
return focusVisible$1.exports;
|
|
304
|
+
}
|
|
219
305
|
|
|
220
|
-
|
|
221
|
-
* When the polfyill first loads, assume the user is in keyboard modality.
|
|
222
|
-
* If any event is received from a pointing device (e.g. mouse, pointer,
|
|
223
|
-
* touch), turn off keyboard modality.
|
|
224
|
-
* This accounts for situations where focus enters the page from the URL bar.
|
|
225
|
-
* @param {Event} e
|
|
226
|
-
*/
|
|
227
|
-
function onInitialPointerMove(e) {
|
|
228
|
-
// Work around a Safari quirk that fires a mousemove on <html> whenever the
|
|
229
|
-
// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
|
|
230
|
-
if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
hadKeyboardEvent = false;
|
|
234
|
-
removeInitialPointerMoveListeners();
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// For some kinds of state, we are interested in changes at the global scope
|
|
238
|
-
// only. For example, global pointer input, global key presses and global
|
|
239
|
-
// visibility change should affect the state at every scope:
|
|
240
|
-
document.addEventListener('keydown', onKeyDown, true);
|
|
241
|
-
document.addEventListener('mousedown', onPointerDown, true);
|
|
242
|
-
document.addEventListener('pointerdown', onPointerDown, true);
|
|
243
|
-
document.addEventListener('touchstart', onPointerDown, true);
|
|
244
|
-
document.addEventListener('visibilitychange', onVisibilityChange, true);
|
|
245
|
-
addInitialPointerMoveListeners();
|
|
246
|
-
|
|
247
|
-
// For focus and blur, we specifically care about state changes in the local
|
|
248
|
-
// scope. This is because focus / blur events that originate from within a
|
|
249
|
-
// shadow root are not re-dispatched from the host element if it was already
|
|
250
|
-
// the active element in its own scope:
|
|
251
|
-
scope.addEventListener('focus', onFocus, true);
|
|
252
|
-
scope.addEventListener('blur', onBlur, true);
|
|
253
|
-
|
|
254
|
-
// We detect that a node is a ShadowRoot by ensuring that it is a
|
|
255
|
-
// DocumentFragment and also has a host property. This check covers native
|
|
256
|
-
// implementation and polyfill implementation transparently. If we only cared
|
|
257
|
-
// about the native implementation, we could just check if the scope was
|
|
258
|
-
// an instance of a ShadowRoot.
|
|
259
|
-
if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {
|
|
260
|
-
// Since a ShadowRoot is a special kind of DocumentFragment, it does not
|
|
261
|
-
// have a root element to add a class to. So, we add this attribute to the
|
|
262
|
-
// host element instead:
|
|
263
|
-
scope.host.setAttribute('data-js-focus-visible', '');
|
|
264
|
-
} else if (scope.nodeType === Node.DOCUMENT_NODE) {
|
|
265
|
-
document.documentElement.classList.add('js-focus-visible');
|
|
266
|
-
document.documentElement.setAttribute('data-js-focus-visible', '');
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// It is important to wrap all references to global window and document in
|
|
271
|
-
// these checks to support server-side rendering use cases
|
|
272
|
-
// @see https://github.com/WICG/focus-visible/issues/199
|
|
273
|
-
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
274
|
-
// Make the polyfill helper globally available. This can be used as a signal
|
|
275
|
-
// to interested libraries that wish to coordinate with the polyfill for e.g.,
|
|
276
|
-
// applying the polyfill to a shadow root:
|
|
277
|
-
window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;
|
|
278
|
-
|
|
279
|
-
// Notify interested libraries of the polyfill's presence, in case the
|
|
280
|
-
// polyfill was loaded lazily:
|
|
281
|
-
var event;
|
|
282
|
-
try {
|
|
283
|
-
event = new CustomEvent('focus-visible-polyfill-ready');
|
|
284
|
-
} catch (error) {
|
|
285
|
-
// IE11 does not support using CustomEvent as a constructor directly:
|
|
286
|
-
event = document.createEvent('CustomEvent');
|
|
287
|
-
event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});
|
|
288
|
-
}
|
|
289
|
-
window.dispatchEvent(event);
|
|
290
|
-
}
|
|
291
|
-
if (typeof document !== 'undefined') {
|
|
292
|
-
// Apply the polyfill to the global document, so that no JavaScript
|
|
293
|
-
// coordination is required to use the polyfill in the top-level document:
|
|
294
|
-
applyFocusVisiblePolyfill(document);
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
})();
|
|
306
|
+
requireFocusVisible();
|
|
298
307
|
|
|
299
308
|
var dist$4 = {};
|
|
300
309
|
|
|
301
310
|
var colors = {};
|
|
302
311
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
"
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
"mint": "rgb(227, 251, 226)",
|
|
344
|
-
"money-good": "rgb(4, 108, 0)",
|
|
345
|
-
"fuchsia": "rgb(196, 76, 176)",
|
|
346
|
-
"dark-fuchsia": "rgb(180, 60, 160)",
|
|
347
|
-
"teal": "rgb(0, 111, 98)",
|
|
348
|
-
"ivory": "rgb(242, 233, 219)"
|
|
349
|
-
},
|
|
350
|
-
"global": {
|
|
351
|
-
"klein-blue": "rgb(38, 48, 120)",
|
|
352
|
-
"persian-blue": "rgb(30, 34, 170)",
|
|
353
|
-
"brick": "rgb(147, 58, 32)",
|
|
354
|
-
"goldenrod": "rgb(186, 145, 46)",
|
|
355
|
-
"seafoam": "rgb(177, 191, 170)",
|
|
356
|
-
"coral": "rgb(255, 146, 121)"
|
|
357
|
-
},
|
|
358
|
-
"mens": {
|
|
359
|
-
"cornflower-blue": "rgb(127, 154, 207)",
|
|
360
|
-
"moss-green": "rgb(104, 104, 59)",
|
|
361
|
-
"blush": "rgb(243, 222, 217)",
|
|
362
|
-
"noise": "rgb(242, 243, 245)",
|
|
363
|
-
"canary": "rgb(240, 246, 89)"
|
|
364
|
-
},
|
|
365
|
-
"womens": {
|
|
366
|
-
"burnt-orange": "rgb(213, 107, 39)",
|
|
367
|
-
"lilac": "rgb(215, 179, 208)",
|
|
368
|
-
"forest-green": "rgb(0, 55, 40)",
|
|
369
|
-
"cream": "rgb(248, 245, 238)",
|
|
370
|
-
"fuchsia": "rgb(196, 76, 176)",
|
|
371
|
-
"dark-fuchsia": "rgb(180, 60, 160)"
|
|
372
|
-
},
|
|
373
|
-
"greyscale": {
|
|
374
|
-
"coal": "rgb(0, 0, 0)",
|
|
375
|
-
"ink": "rgb(25, 26, 27)",
|
|
376
|
-
"cement": "rgb(101, 101, 102)",
|
|
377
|
-
"fog": "rgb(151, 152, 153)",
|
|
378
|
-
"elephant": "rgb(202, 203, 204)",
|
|
379
|
-
"noise": "rgb(242, 243, 245)",
|
|
380
|
-
"snow": "rgb(255, 255, 255)"
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
var typography = {};
|
|
385
|
-
|
|
386
|
-
Object.defineProperty(typography, "__esModule", {
|
|
387
|
-
value: true
|
|
388
|
-
});
|
|
389
|
-
typography.typography = void 0;
|
|
390
|
-
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
391
|
-
typography.typography = {
|
|
392
|
-
"fonts": {
|
|
393
|
-
"sans": ["Moda Operandi Sans", "Arial", "sans-serif"],
|
|
394
|
-
"serif": ["Moda Operandi Serif", "Times New Roman", "Times", "serif"],
|
|
395
|
-
"code": ["Menlo", "Monaco", "Consolas", "Courier New", "monospace"]
|
|
396
|
-
},
|
|
397
|
-
"line-heights": [1.1, 1.2, 1.4, 1.6],
|
|
398
|
-
"letter-spacing": [0, "0.02em", "0.04em", "0.1em"],
|
|
399
|
-
"font-scale": ["0.75rem", "0.8125rem", "1rem", "1.25rem", "1.5rem", "2rem", "3rem", "3.75rem", "6rem"],
|
|
400
|
-
"root-font-size": "16px",
|
|
401
|
-
"text-treatments": {
|
|
402
|
-
"display": {
|
|
403
|
-
"font-size": "6rem",
|
|
404
|
-
"line-height": 1.1,
|
|
405
|
-
"letter-spacing": 0
|
|
406
|
-
},
|
|
407
|
-
"h1": {
|
|
408
|
-
"font-size": "3.75rem",
|
|
409
|
-
"line-height": 1.2,
|
|
410
|
-
"letter-spacing": 0
|
|
411
|
-
},
|
|
412
|
-
"h2": {
|
|
413
|
-
"font-size": "3rem",
|
|
414
|
-
"line-height": 1.1,
|
|
415
|
-
"letter-spacing": 0
|
|
416
|
-
},
|
|
417
|
-
"h3": {
|
|
418
|
-
"font-size": "2rem",
|
|
419
|
-
"line-height": 1.2,
|
|
420
|
-
"letter-spacing": 0
|
|
421
|
-
},
|
|
422
|
-
"h4": {
|
|
423
|
-
"font-size": "1.5rem",
|
|
424
|
-
"line-height": 1.4,
|
|
425
|
-
"letter-spacing": 0
|
|
312
|
+
var hasRequiredColors;
|
|
313
|
+
function requireColors() {
|
|
314
|
+
if (hasRequiredColors) return colors;
|
|
315
|
+
hasRequiredColors = 1;
|
|
316
|
+
Object.defineProperty(colors, "__esModule", {
|
|
317
|
+
value: true
|
|
318
|
+
});
|
|
319
|
+
colors.colors = void 0;
|
|
320
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
321
|
+
colors.colors = {
|
|
322
|
+
"all": {
|
|
323
|
+
"coal": "rgb(0, 0, 0)",
|
|
324
|
+
"ink": "rgb(25, 26, 27)",
|
|
325
|
+
"cement": "rgb(101, 101, 102)",
|
|
326
|
+
"fog": "rgb(151, 152, 153)",
|
|
327
|
+
"elephant": "rgb(202, 203, 204)",
|
|
328
|
+
"noise": "rgb(242, 243, 245)",
|
|
329
|
+
"snow": "rgb(255, 255, 255)",
|
|
330
|
+
"strawberry": "rgb(250, 222, 221)",
|
|
331
|
+
"code-red": "rgb(238, 7, 0)",
|
|
332
|
+
"mint": "rgb(227, 251, 226)",
|
|
333
|
+
"money-good": "rgb(4, 108, 0)",
|
|
334
|
+
"fuchsia": "rgb(196, 76, 176)",
|
|
335
|
+
"dark-fuchsia": "rgb(180, 60, 160)",
|
|
336
|
+
"teal": "rgb(0, 111, 98)",
|
|
337
|
+
"ivory": "rgb(242, 233, 219)",
|
|
338
|
+
"klein-blue": "rgb(38, 48, 120)",
|
|
339
|
+
"persian-blue": "rgb(30, 34, 170)",
|
|
340
|
+
"brick": "rgb(147, 58, 32)",
|
|
341
|
+
"goldenrod": "rgb(186, 145, 46)",
|
|
342
|
+
"seafoam": "rgb(177, 191, 170)",
|
|
343
|
+
"coral": "rgb(255, 146, 121)",
|
|
344
|
+
"burnt-orange": "rgb(213, 107, 39)",
|
|
345
|
+
"lilac": "rgb(215, 179, 208)",
|
|
346
|
+
"forest-green": "rgb(0, 55, 40)",
|
|
347
|
+
"cream": "rgb(248, 245, 238)",
|
|
348
|
+
"cornflower-blue": "rgb(127, 154, 207)",
|
|
349
|
+
"moss-green": "rgb(104, 104, 59)",
|
|
350
|
+
"blush": "rgb(243, 222, 217)",
|
|
351
|
+
"canary": "rgb(240, 246, 89)"
|
|
426
352
|
},
|
|
427
|
-
"
|
|
428
|
-
"
|
|
429
|
-
"
|
|
430
|
-
"
|
|
353
|
+
"ui": {
|
|
354
|
+
"strawberry": "rgb(250, 222, 221)",
|
|
355
|
+
"code-red": "rgb(238, 7, 0)",
|
|
356
|
+
"mint": "rgb(227, 251, 226)",
|
|
357
|
+
"money-good": "rgb(4, 108, 0)",
|
|
358
|
+
"fuchsia": "rgb(196, 76, 176)",
|
|
359
|
+
"dark-fuchsia": "rgb(180, 60, 160)",
|
|
360
|
+
"teal": "rgb(0, 111, 98)",
|
|
361
|
+
"ivory": "rgb(242, 233, 219)"
|
|
431
362
|
},
|
|
432
|
-
"
|
|
433
|
-
"
|
|
434
|
-
"
|
|
435
|
-
"
|
|
363
|
+
"global": {
|
|
364
|
+
"klein-blue": "rgb(38, 48, 120)",
|
|
365
|
+
"persian-blue": "rgb(30, 34, 170)",
|
|
366
|
+
"brick": "rgb(147, 58, 32)",
|
|
367
|
+
"goldenrod": "rgb(186, 145, 46)",
|
|
368
|
+
"seafoam": "rgb(177, 191, 170)",
|
|
369
|
+
"coral": "rgb(255, 146, 121)"
|
|
436
370
|
},
|
|
437
|
-
"
|
|
438
|
-
"
|
|
439
|
-
"
|
|
440
|
-
"
|
|
371
|
+
"mens": {
|
|
372
|
+
"cornflower-blue": "rgb(127, 154, 207)",
|
|
373
|
+
"moss-green": "rgb(104, 104, 59)",
|
|
374
|
+
"blush": "rgb(243, 222, 217)",
|
|
375
|
+
"noise": "rgb(242, 243, 245)",
|
|
376
|
+
"canary": "rgb(240, 246, 89)"
|
|
441
377
|
},
|
|
442
|
-
"
|
|
443
|
-
"
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
"
|
|
378
|
+
"womens": {
|
|
379
|
+
"burnt-orange": "rgb(213, 107, 39)",
|
|
380
|
+
"lilac": "rgb(215, 179, 208)",
|
|
381
|
+
"forest-green": "rgb(0, 55, 40)",
|
|
382
|
+
"cream": "rgb(248, 245, 238)",
|
|
383
|
+
"fuchsia": "rgb(196, 76, 176)",
|
|
384
|
+
"dark-fuchsia": "rgb(180, 60, 160)"
|
|
447
385
|
},
|
|
448
|
-
"
|
|
449
|
-
"
|
|
450
|
-
"
|
|
451
|
-
"
|
|
386
|
+
"greyscale": {
|
|
387
|
+
"coal": "rgb(0, 0, 0)",
|
|
388
|
+
"ink": "rgb(25, 26, 27)",
|
|
389
|
+
"cement": "rgb(101, 101, 102)",
|
|
390
|
+
"fog": "rgb(151, 152, 153)",
|
|
391
|
+
"elephant": "rgb(202, 203, 204)",
|
|
392
|
+
"noise": "rgb(242, 243, 245)",
|
|
393
|
+
"snow": "rgb(255, 255, 255)"
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
return colors;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
var typography = {};
|
|
400
|
+
|
|
401
|
+
var hasRequiredTypography;
|
|
402
|
+
function requireTypography() {
|
|
403
|
+
if (hasRequiredTypography) return typography;
|
|
404
|
+
hasRequiredTypography = 1;
|
|
405
|
+
Object.defineProperty(typography, "__esModule", {
|
|
406
|
+
value: true
|
|
407
|
+
});
|
|
408
|
+
typography.typography = void 0;
|
|
409
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
410
|
+
typography.typography = {
|
|
411
|
+
"fonts": {
|
|
412
|
+
"sans": ["Moda Operandi Sans", "Arial", "sans-serif"],
|
|
413
|
+
"serif": ["Moda Operandi Serif", "Times New Roman", "Times", "serif"],
|
|
414
|
+
"code": ["Menlo", "Monaco", "Consolas", "Courier New", "monospace"]
|
|
452
415
|
},
|
|
453
|
-
"
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
416
|
+
"line-heights": [1.1, 1.2, 1.4, 1.6],
|
|
417
|
+
"letter-spacing": [0, "0.02em", "0.04em", "0.1em"],
|
|
418
|
+
"font-scale": ["0.75rem", "0.8125rem", "1rem", "1.25rem", "1.5rem", "2rem", "3rem", "3.75rem", "6rem"],
|
|
419
|
+
"root-font-size": "16px",
|
|
420
|
+
"text-treatments": {
|
|
421
|
+
"display": {
|
|
422
|
+
"font-size": "6rem",
|
|
423
|
+
"line-height": 1.1,
|
|
424
|
+
"letter-spacing": 0
|
|
425
|
+
},
|
|
426
|
+
"h1": {
|
|
427
|
+
"font-size": "3.75rem",
|
|
428
|
+
"line-height": 1.2,
|
|
429
|
+
"letter-spacing": 0
|
|
430
|
+
},
|
|
431
|
+
"h2": {
|
|
432
|
+
"font-size": "3rem",
|
|
433
|
+
"line-height": 1.1,
|
|
434
|
+
"letter-spacing": 0
|
|
435
|
+
},
|
|
436
|
+
"h3": {
|
|
437
|
+
"font-size": "2rem",
|
|
438
|
+
"line-height": 1.2,
|
|
439
|
+
"letter-spacing": 0
|
|
440
|
+
},
|
|
441
|
+
"h4": {
|
|
442
|
+
"font-size": "1.5rem",
|
|
443
|
+
"line-height": 1.4,
|
|
444
|
+
"letter-spacing": 0
|
|
445
|
+
},
|
|
446
|
+
"h5": {
|
|
447
|
+
"font-size": "1.25rem",
|
|
448
|
+
"line-height": 1.4,
|
|
449
|
+
"letter-spacing": "0.02em"
|
|
450
|
+
},
|
|
451
|
+
"h6": {
|
|
452
|
+
"font-size": "1rem",
|
|
453
|
+
"line-height": 1.4,
|
|
454
|
+
"letter-spacing": "0.04em"
|
|
455
|
+
},
|
|
456
|
+
"body1": {
|
|
457
|
+
"font-size": "0.8125rem",
|
|
458
|
+
"line-height": 1.6,
|
|
459
|
+
"letter-spacing": "0.04em"
|
|
460
|
+
},
|
|
461
|
+
"bold1": {
|
|
462
|
+
"font-size": "0.8125rem",
|
|
463
|
+
"line-height": 1.6,
|
|
464
|
+
"letter-spacing": "0.1em",
|
|
465
|
+
"font-weight": "bold"
|
|
466
|
+
},
|
|
467
|
+
"body2": {
|
|
468
|
+
"font-size": "0.75rem",
|
|
469
|
+
"line-height": 1.4,
|
|
470
|
+
"letter-spacing": "0.04em"
|
|
471
|
+
},
|
|
472
|
+
"eyebrow": {
|
|
473
|
+
"font-size": "0.75rem",
|
|
474
|
+
"line-height": 1.4,
|
|
475
|
+
"letter-spacing": "0.1em",
|
|
476
|
+
"text-transform": "uppercase"
|
|
477
|
+
}
|
|
458
478
|
}
|
|
459
|
-
}
|
|
460
|
-
|
|
479
|
+
};
|
|
480
|
+
return typography;
|
|
481
|
+
}
|
|
461
482
|
|
|
462
483
|
var space = {};
|
|
463
484
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
"
|
|
475
|
-
"
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
var hasRequiredSpace;
|
|
486
|
+
function requireSpace() {
|
|
487
|
+
if (hasRequiredSpace) return space;
|
|
488
|
+
hasRequiredSpace = 1;
|
|
489
|
+
Object.defineProperty(space, "__esModule", {
|
|
490
|
+
value: true
|
|
491
|
+
});
|
|
492
|
+
space.space = void 0;
|
|
493
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
494
|
+
space.space = {
|
|
495
|
+
"scale": ["0rem", "0.25rem", "0.5rem", "0.75rem", "1rem", "1.5rem", "2rem", "3rem", "4rem", "6rem", "8rem", "12rem", "24rem"],
|
|
496
|
+
"map": {
|
|
497
|
+
"0x": "0rem",
|
|
498
|
+
"quarter-x": "0.25rem",
|
|
499
|
+
"half-x": "0.5rem",
|
|
500
|
+
"three-quarter-x": "0.75rem",
|
|
501
|
+
"1x": "1rem",
|
|
502
|
+
"one-and-a-half-x": "1.5rem",
|
|
503
|
+
"2x": "2rem",
|
|
504
|
+
"3x": "3rem",
|
|
505
|
+
"4x": "4rem",
|
|
506
|
+
"6x": "6rem",
|
|
507
|
+
"8x": "8rem",
|
|
508
|
+
"12x": "12rem",
|
|
509
|
+
"24x": "24rem"
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
return space;
|
|
513
|
+
}
|
|
487
514
|
|
|
488
515
|
var breakpoints = {};
|
|
489
516
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
517
|
+
var hasRequiredBreakpoints;
|
|
518
|
+
function requireBreakpoints() {
|
|
519
|
+
if (hasRequiredBreakpoints) return breakpoints;
|
|
520
|
+
hasRequiredBreakpoints = 1;
|
|
521
|
+
Object.defineProperty(breakpoints, "__esModule", {
|
|
522
|
+
value: true
|
|
523
|
+
});
|
|
524
|
+
breakpoints.breakpoints = void 0;
|
|
525
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
526
|
+
breakpoints.breakpoints = {
|
|
527
|
+
"xs": "25rem",
|
|
528
|
+
"sm": "48rem",
|
|
529
|
+
"md": "62rem",
|
|
530
|
+
"lg": "80rem",
|
|
531
|
+
"xl": "100rem"
|
|
532
|
+
};
|
|
533
|
+
return breakpoints;
|
|
534
|
+
}
|
|
502
535
|
|
|
503
536
|
var helpers = {};
|
|
504
537
|
|
|
505
538
|
var colorString = {exports: {}};
|
|
506
539
|
|
|
507
|
-
var colorName
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
540
|
+
var colorName;
|
|
541
|
+
var hasRequiredColorName;
|
|
542
|
+
function requireColorName() {
|
|
543
|
+
if (hasRequiredColorName) return colorName;
|
|
544
|
+
hasRequiredColorName = 1;
|
|
545
|
+
colorName = {
|
|
546
|
+
"aliceblue": [240, 248, 255],
|
|
547
|
+
"antiquewhite": [250, 235, 215],
|
|
548
|
+
"aqua": [0, 255, 255],
|
|
549
|
+
"aquamarine": [127, 255, 212],
|
|
550
|
+
"azure": [240, 255, 255],
|
|
551
|
+
"beige": [245, 245, 220],
|
|
552
|
+
"bisque": [255, 228, 196],
|
|
553
|
+
"black": [0, 0, 0],
|
|
554
|
+
"blanchedalmond": [255, 235, 205],
|
|
555
|
+
"blue": [0, 0, 255],
|
|
556
|
+
"blueviolet": [138, 43, 226],
|
|
557
|
+
"brown": [165, 42, 42],
|
|
558
|
+
"burlywood": [222, 184, 135],
|
|
559
|
+
"cadetblue": [95, 158, 160],
|
|
560
|
+
"chartreuse": [127, 255, 0],
|
|
561
|
+
"chocolate": [210, 105, 30],
|
|
562
|
+
"coral": [255, 127, 80],
|
|
563
|
+
"cornflowerblue": [100, 149, 237],
|
|
564
|
+
"cornsilk": [255, 248, 220],
|
|
565
|
+
"crimson": [220, 20, 60],
|
|
566
|
+
"cyan": [0, 255, 255],
|
|
567
|
+
"darkblue": [0, 0, 139],
|
|
568
|
+
"darkcyan": [0, 139, 139],
|
|
569
|
+
"darkgoldenrod": [184, 134, 11],
|
|
570
|
+
"darkgray": [169, 169, 169],
|
|
571
|
+
"darkgreen": [0, 100, 0],
|
|
572
|
+
"darkgrey": [169, 169, 169],
|
|
573
|
+
"darkkhaki": [189, 183, 107],
|
|
574
|
+
"darkmagenta": [139, 0, 139],
|
|
575
|
+
"darkolivegreen": [85, 107, 47],
|
|
576
|
+
"darkorange": [255, 140, 0],
|
|
577
|
+
"darkorchid": [153, 50, 204],
|
|
578
|
+
"darkred": [139, 0, 0],
|
|
579
|
+
"darksalmon": [233, 150, 122],
|
|
580
|
+
"darkseagreen": [143, 188, 143],
|
|
581
|
+
"darkslateblue": [72, 61, 139],
|
|
582
|
+
"darkslategray": [47, 79, 79],
|
|
583
|
+
"darkslategrey": [47, 79, 79],
|
|
584
|
+
"darkturquoise": [0, 206, 209],
|
|
585
|
+
"darkviolet": [148, 0, 211],
|
|
586
|
+
"deeppink": [255, 20, 147],
|
|
587
|
+
"deepskyblue": [0, 191, 255],
|
|
588
|
+
"dimgray": [105, 105, 105],
|
|
589
|
+
"dimgrey": [105, 105, 105],
|
|
590
|
+
"dodgerblue": [30, 144, 255],
|
|
591
|
+
"firebrick": [178, 34, 34],
|
|
592
|
+
"floralwhite": [255, 250, 240],
|
|
593
|
+
"forestgreen": [34, 139, 34],
|
|
594
|
+
"fuchsia": [255, 0, 255],
|
|
595
|
+
"gainsboro": [220, 220, 220],
|
|
596
|
+
"ghostwhite": [248, 248, 255],
|
|
597
|
+
"gold": [255, 215, 0],
|
|
598
|
+
"goldenrod": [218, 165, 32],
|
|
599
|
+
"gray": [128, 128, 128],
|
|
600
|
+
"green": [0, 128, 0],
|
|
601
|
+
"greenyellow": [173, 255, 47],
|
|
602
|
+
"grey": [128, 128, 128],
|
|
603
|
+
"honeydew": [240, 255, 240],
|
|
604
|
+
"hotpink": [255, 105, 180],
|
|
605
|
+
"indianred": [205, 92, 92],
|
|
606
|
+
"indigo": [75, 0, 130],
|
|
607
|
+
"ivory": [255, 255, 240],
|
|
608
|
+
"khaki": [240, 230, 140],
|
|
609
|
+
"lavender": [230, 230, 250],
|
|
610
|
+
"lavenderblush": [255, 240, 245],
|
|
611
|
+
"lawngreen": [124, 252, 0],
|
|
612
|
+
"lemonchiffon": [255, 250, 205],
|
|
613
|
+
"lightblue": [173, 216, 230],
|
|
614
|
+
"lightcoral": [240, 128, 128],
|
|
615
|
+
"lightcyan": [224, 255, 255],
|
|
616
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
617
|
+
"lightgray": [211, 211, 211],
|
|
618
|
+
"lightgreen": [144, 238, 144],
|
|
619
|
+
"lightgrey": [211, 211, 211],
|
|
620
|
+
"lightpink": [255, 182, 193],
|
|
621
|
+
"lightsalmon": [255, 160, 122],
|
|
622
|
+
"lightseagreen": [32, 178, 170],
|
|
623
|
+
"lightskyblue": [135, 206, 250],
|
|
624
|
+
"lightslategray": [119, 136, 153],
|
|
625
|
+
"lightslategrey": [119, 136, 153],
|
|
626
|
+
"lightsteelblue": [176, 196, 222],
|
|
627
|
+
"lightyellow": [255, 255, 224],
|
|
628
|
+
"lime": [0, 255, 0],
|
|
629
|
+
"limegreen": [50, 205, 50],
|
|
630
|
+
"linen": [250, 240, 230],
|
|
631
|
+
"magenta": [255, 0, 255],
|
|
632
|
+
"maroon": [128, 0, 0],
|
|
633
|
+
"mediumaquamarine": [102, 205, 170],
|
|
634
|
+
"mediumblue": [0, 0, 205],
|
|
635
|
+
"mediumorchid": [186, 85, 211],
|
|
636
|
+
"mediumpurple": [147, 112, 219],
|
|
637
|
+
"mediumseagreen": [60, 179, 113],
|
|
638
|
+
"mediumslateblue": [123, 104, 238],
|
|
639
|
+
"mediumspringgreen": [0, 250, 154],
|
|
640
|
+
"mediumturquoise": [72, 209, 204],
|
|
641
|
+
"mediumvioletred": [199, 21, 133],
|
|
642
|
+
"midnightblue": [25, 25, 112],
|
|
643
|
+
"mintcream": [245, 255, 250],
|
|
644
|
+
"mistyrose": [255, 228, 225],
|
|
645
|
+
"moccasin": [255, 228, 181],
|
|
646
|
+
"navajowhite": [255, 222, 173],
|
|
647
|
+
"navy": [0, 0, 128],
|
|
648
|
+
"oldlace": [253, 245, 230],
|
|
649
|
+
"olive": [128, 128, 0],
|
|
650
|
+
"olivedrab": [107, 142, 35],
|
|
651
|
+
"orange": [255, 165, 0],
|
|
652
|
+
"orangered": [255, 69, 0],
|
|
653
|
+
"orchid": [218, 112, 214],
|
|
654
|
+
"palegoldenrod": [238, 232, 170],
|
|
655
|
+
"palegreen": [152, 251, 152],
|
|
656
|
+
"paleturquoise": [175, 238, 238],
|
|
657
|
+
"palevioletred": [219, 112, 147],
|
|
658
|
+
"papayawhip": [255, 239, 213],
|
|
659
|
+
"peachpuff": [255, 218, 185],
|
|
660
|
+
"peru": [205, 133, 63],
|
|
661
|
+
"pink": [255, 192, 203],
|
|
662
|
+
"plum": [221, 160, 221],
|
|
663
|
+
"powderblue": [176, 224, 230],
|
|
664
|
+
"purple": [128, 0, 128],
|
|
665
|
+
"rebeccapurple": [102, 51, 153],
|
|
666
|
+
"red": [255, 0, 0],
|
|
667
|
+
"rosybrown": [188, 143, 143],
|
|
668
|
+
"royalblue": [65, 105, 225],
|
|
669
|
+
"saddlebrown": [139, 69, 19],
|
|
670
|
+
"salmon": [250, 128, 114],
|
|
671
|
+
"sandybrown": [244, 164, 96],
|
|
672
|
+
"seagreen": [46, 139, 87],
|
|
673
|
+
"seashell": [255, 245, 238],
|
|
674
|
+
"sienna": [160, 82, 45],
|
|
675
|
+
"silver": [192, 192, 192],
|
|
676
|
+
"skyblue": [135, 206, 235],
|
|
677
|
+
"slateblue": [106, 90, 205],
|
|
678
|
+
"slategray": [112, 128, 144],
|
|
679
|
+
"slategrey": [112, 128, 144],
|
|
680
|
+
"snow": [255, 250, 250],
|
|
681
|
+
"springgreen": [0, 255, 127],
|
|
682
|
+
"steelblue": [70, 130, 180],
|
|
683
|
+
"tan": [210, 180, 140],
|
|
684
|
+
"teal": [0, 128, 128],
|
|
685
|
+
"thistle": [216, 191, 216],
|
|
686
|
+
"tomato": [255, 99, 71],
|
|
687
|
+
"turquoise": [64, 224, 208],
|
|
688
|
+
"violet": [238, 130, 238],
|
|
689
|
+
"wheat": [245, 222, 179],
|
|
690
|
+
"white": [255, 255, 255],
|
|
691
|
+
"whitesmoke": [245, 245, 245],
|
|
692
|
+
"yellow": [255, 255, 0],
|
|
693
|
+
"yellowgreen": [154, 205, 50]
|
|
694
|
+
};
|
|
695
|
+
return colorName;
|
|
696
|
+
}
|
|
657
697
|
|
|
658
698
|
var simpleSwizzle = {exports: {}};
|
|
659
699
|
|
|
660
|
-
var isArrayish
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
700
|
+
var isArrayish;
|
|
701
|
+
var hasRequiredIsArrayish;
|
|
702
|
+
function requireIsArrayish() {
|
|
703
|
+
if (hasRequiredIsArrayish) return isArrayish;
|
|
704
|
+
hasRequiredIsArrayish = 1;
|
|
705
|
+
isArrayish = function isArrayish(obj) {
|
|
706
|
+
if (!obj || typeof obj === 'string') {
|
|
707
|
+
return false;
|
|
708
|
+
}
|
|
709
|
+
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== 'String');
|
|
710
|
+
};
|
|
711
|
+
return isArrayish;
|
|
712
|
+
}
|
|
666
713
|
|
|
667
|
-
var
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
var
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
714
|
+
var hasRequiredSimpleSwizzle;
|
|
715
|
+
function requireSimpleSwizzle() {
|
|
716
|
+
if (hasRequiredSimpleSwizzle) return simpleSwizzle.exports;
|
|
717
|
+
hasRequiredSimpleSwizzle = 1;
|
|
718
|
+
var isArrayish = requireIsArrayish();
|
|
719
|
+
var concat = Array.prototype.concat;
|
|
720
|
+
var slice = Array.prototype.slice;
|
|
721
|
+
var swizzle = simpleSwizzle.exports = function swizzle(args) {
|
|
722
|
+
var results = [];
|
|
723
|
+
for (var i = 0, len = args.length; i < len; i++) {
|
|
724
|
+
var arg = args[i];
|
|
725
|
+
if (isArrayish(arg)) {
|
|
726
|
+
// http://jsperf.com/javascript-array-concat-vs-push/98
|
|
727
|
+
results = concat.call(results, slice.call(arg));
|
|
728
|
+
} else {
|
|
729
|
+
results.push(arg);
|
|
730
|
+
}
|
|
679
731
|
}
|
|
680
|
-
|
|
681
|
-
return results;
|
|
682
|
-
};
|
|
683
|
-
swizzle$1.wrap = function (fn) {
|
|
684
|
-
return function () {
|
|
685
|
-
return fn(swizzle$1(arguments));
|
|
732
|
+
return results;
|
|
686
733
|
};
|
|
687
|
-
|
|
688
|
-
|
|
734
|
+
swizzle.wrap = function (fn) {
|
|
735
|
+
return function () {
|
|
736
|
+
return fn(swizzle(arguments));
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
return simpleSwizzle.exports;
|
|
740
|
+
}
|
|
689
741
|
|
|
690
742
|
/* MIT license */
|
|
691
|
-
var
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}
|
|
706
|
-
cs
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
var model;
|
|
710
|
-
switch (prefix) {
|
|
711
|
-
case 'hsl':
|
|
712
|
-
val = cs.get.hsl(string);
|
|
713
|
-
model = 'hsl';
|
|
714
|
-
break;
|
|
715
|
-
case 'hwb':
|
|
716
|
-
val = cs.get.hwb(string);
|
|
717
|
-
model = 'hwb';
|
|
718
|
-
break;
|
|
719
|
-
default:
|
|
720
|
-
val = cs.get.rgb(string);
|
|
721
|
-
model = 'rgb';
|
|
722
|
-
break;
|
|
723
|
-
}
|
|
724
|
-
if (!val) {
|
|
725
|
-
return null;
|
|
726
|
-
}
|
|
727
|
-
return {
|
|
728
|
-
model: model,
|
|
729
|
-
value: val
|
|
743
|
+
var hasRequiredColorString;
|
|
744
|
+
function requireColorString() {
|
|
745
|
+
if (hasRequiredColorString) return colorString.exports;
|
|
746
|
+
hasRequiredColorString = 1;
|
|
747
|
+
var colorNames = requireColorName();
|
|
748
|
+
var swizzle = requireSimpleSwizzle();
|
|
749
|
+
var hasOwnProperty = Object.hasOwnProperty;
|
|
750
|
+
var reverseNames = Object.create(null);
|
|
751
|
+
|
|
752
|
+
// create a list of reverse color names
|
|
753
|
+
for (var name in colorNames) {
|
|
754
|
+
if (hasOwnProperty.call(colorNames, name)) {
|
|
755
|
+
reverseNames[colorNames[name]] = name;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
var cs = colorString.exports = {
|
|
759
|
+
to: {},
|
|
760
|
+
get: {}
|
|
730
761
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
for (i = 0; i < 3; i++) {
|
|
749
|
-
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
750
|
-
var i2 = i * 2;
|
|
751
|
-
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
752
|
-
}
|
|
753
|
-
if (hexAlpha) {
|
|
754
|
-
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
755
|
-
}
|
|
756
|
-
} else if (match = string.match(abbr)) {
|
|
757
|
-
match = match[1];
|
|
758
|
-
hexAlpha = match[3];
|
|
759
|
-
for (i = 0; i < 3; i++) {
|
|
760
|
-
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
762
|
+
cs.get = function (string) {
|
|
763
|
+
var prefix = string.substring(0, 3).toLowerCase();
|
|
764
|
+
var val;
|
|
765
|
+
var model;
|
|
766
|
+
switch (prefix) {
|
|
767
|
+
case 'hsl':
|
|
768
|
+
val = cs.get.hsl(string);
|
|
769
|
+
model = 'hsl';
|
|
770
|
+
break;
|
|
771
|
+
case 'hwb':
|
|
772
|
+
val = cs.get.hwb(string);
|
|
773
|
+
model = 'hwb';
|
|
774
|
+
break;
|
|
775
|
+
default:
|
|
776
|
+
val = cs.get.rgb(string);
|
|
777
|
+
model = 'rgb';
|
|
778
|
+
break;
|
|
761
779
|
}
|
|
762
|
-
if (
|
|
763
|
-
|
|
780
|
+
if (!val) {
|
|
781
|
+
return null;
|
|
764
782
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
783
|
+
return {
|
|
784
|
+
model: model,
|
|
785
|
+
value: val
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
cs.get.rgb = function (string) {
|
|
789
|
+
if (!string) {
|
|
790
|
+
return null;
|
|
768
791
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
792
|
+
var abbr = /^#([a-f0-9]{3,4})$/i;
|
|
793
|
+
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
|
794
|
+
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
795
|
+
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
796
|
+
var keyword = /^(\w+)$/;
|
|
797
|
+
var rgb = [0, 0, 0, 1];
|
|
798
|
+
var match;
|
|
799
|
+
var i;
|
|
800
|
+
var hexAlpha;
|
|
801
|
+
if (match = string.match(hex)) {
|
|
802
|
+
hexAlpha = match[2];
|
|
803
|
+
match = match[1];
|
|
804
|
+
for (i = 0; i < 3; i++) {
|
|
805
|
+
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
806
|
+
var i2 = i * 2;
|
|
807
|
+
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
808
|
+
}
|
|
809
|
+
if (hexAlpha) {
|
|
810
|
+
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
811
|
+
}
|
|
812
|
+
} else if (match = string.match(abbr)) {
|
|
813
|
+
match = match[1];
|
|
814
|
+
hexAlpha = match[3];
|
|
815
|
+
for (i = 0; i < 3; i++) {
|
|
816
|
+
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
817
|
+
}
|
|
818
|
+
if (hexAlpha) {
|
|
819
|
+
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
820
|
+
}
|
|
821
|
+
} else if (match = string.match(rgba)) {
|
|
822
|
+
for (i = 0; i < 3; i++) {
|
|
823
|
+
rgb[i] = parseInt(match[i + 1], 0);
|
|
824
|
+
}
|
|
825
|
+
if (match[4]) {
|
|
826
|
+
if (match[5]) {
|
|
827
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
828
|
+
} else {
|
|
829
|
+
rgb[3] = parseFloat(match[4]);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
} else if (match = string.match(per)) {
|
|
833
|
+
for (i = 0; i < 3; i++) {
|
|
834
|
+
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
835
|
+
}
|
|
836
|
+
if (match[4]) {
|
|
837
|
+
if (match[5]) {
|
|
838
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
839
|
+
} else {
|
|
840
|
+
rgb[3] = parseFloat(match[4]);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
} else if (match = string.match(keyword)) {
|
|
844
|
+
if (match[1] === 'transparent') {
|
|
845
|
+
return [0, 0, 0, 0];
|
|
774
846
|
}
|
|
847
|
+
if (!hasOwnProperty.call(colorNames, match[1])) {
|
|
848
|
+
return null;
|
|
849
|
+
}
|
|
850
|
+
rgb = colorNames[match[1]];
|
|
851
|
+
rgb[3] = 1;
|
|
852
|
+
return rgb;
|
|
853
|
+
} else {
|
|
854
|
+
return null;
|
|
775
855
|
}
|
|
776
|
-
} else if (match = string.match(per)) {
|
|
777
856
|
for (i = 0; i < 3; i++) {
|
|
778
|
-
rgb[i] =
|
|
857
|
+
rgb[i] = clamp(rgb[i], 0, 255);
|
|
779
858
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
859
|
+
rgb[3] = clamp(rgb[3], 0, 1);
|
|
860
|
+
return rgb;
|
|
861
|
+
};
|
|
862
|
+
cs.get.hsl = function (string) {
|
|
863
|
+
if (!string) {
|
|
864
|
+
return null;
|
|
786
865
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
866
|
+
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
867
|
+
var match = string.match(hsl);
|
|
868
|
+
if (match) {
|
|
869
|
+
var alpha = parseFloat(match[4]);
|
|
870
|
+
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
871
|
+
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
872
|
+
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
873
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
874
|
+
return [h, s, l, a];
|
|
790
875
|
}
|
|
791
|
-
|
|
876
|
+
return null;
|
|
877
|
+
};
|
|
878
|
+
cs.get.hwb = function (string) {
|
|
879
|
+
if (!string) {
|
|
792
880
|
return null;
|
|
793
881
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
return rgb;
|
|
805
|
-
};
|
|
806
|
-
cs.get.hsl = function (string) {
|
|
807
|
-
if (!string) {
|
|
808
|
-
return null;
|
|
809
|
-
}
|
|
810
|
-
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
811
|
-
var match = string.match(hsl);
|
|
812
|
-
if (match) {
|
|
813
|
-
var alpha = parseFloat(match[4]);
|
|
814
|
-
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
815
|
-
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
816
|
-
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
817
|
-
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
818
|
-
return [h, s, l, a];
|
|
819
|
-
}
|
|
820
|
-
return null;
|
|
821
|
-
};
|
|
822
|
-
cs.get.hwb = function (string) {
|
|
823
|
-
if (!string) {
|
|
882
|
+
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
883
|
+
var match = string.match(hwb);
|
|
884
|
+
if (match) {
|
|
885
|
+
var alpha = parseFloat(match[4]);
|
|
886
|
+
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
887
|
+
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
888
|
+
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
889
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
890
|
+
return [h, w, b, a];
|
|
891
|
+
}
|
|
824
892
|
return null;
|
|
825
|
-
}
|
|
826
|
-
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
827
|
-
var match = string.match(hwb);
|
|
828
|
-
if (match) {
|
|
829
|
-
var alpha = parseFloat(match[4]);
|
|
830
|
-
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
831
|
-
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
832
|
-
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
833
|
-
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
834
|
-
return [h, w, b, a];
|
|
835
|
-
}
|
|
836
|
-
return null;
|
|
837
|
-
};
|
|
838
|
-
cs.to.hex = function () {
|
|
839
|
-
var rgba = swizzle(arguments);
|
|
840
|
-
return '#' + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : '');
|
|
841
|
-
};
|
|
842
|
-
cs.to.rgb = function () {
|
|
843
|
-
var rgba = swizzle(arguments);
|
|
844
|
-
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')' : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
845
|
-
};
|
|
846
|
-
cs.to.rgb.percent = function () {
|
|
847
|
-
var rgba = swizzle(arguments);
|
|
848
|
-
var r = Math.round(rgba[0] / 255 * 100);
|
|
849
|
-
var g = Math.round(rgba[1] / 255 * 100);
|
|
850
|
-
var b = Math.round(rgba[2] / 255 * 100);
|
|
851
|
-
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)' : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
852
|
-
};
|
|
853
|
-
cs.to.hsl = function () {
|
|
854
|
-
var hsla = swizzle(arguments);
|
|
855
|
-
return hsla.length < 4 || hsla[3] === 1 ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)' : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
856
|
-
};
|
|
857
|
-
|
|
858
|
-
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
859
|
-
// (hwb have alpha optional & 1 is default value)
|
|
860
|
-
cs.to.hwb = function () {
|
|
861
|
-
var hwba = swizzle(arguments);
|
|
862
|
-
var a = '';
|
|
863
|
-
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
864
|
-
a = ', ' + hwba[3];
|
|
865
|
-
}
|
|
866
|
-
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
867
|
-
};
|
|
868
|
-
cs.to.keyword = function (rgb) {
|
|
869
|
-
return reverseNames[rgb.slice(0, 3)];
|
|
870
|
-
};
|
|
871
|
-
|
|
872
|
-
// helpers
|
|
873
|
-
function clamp(num, min, max) {
|
|
874
|
-
return Math.min(Math.max(min, num), max);
|
|
875
|
-
}
|
|
876
|
-
function hexDouble(num) {
|
|
877
|
-
var str = Math.round(num).toString(16).toUpperCase();
|
|
878
|
-
return str.length < 2 ? '0' + str : str;
|
|
879
|
-
}
|
|
880
|
-
var colorStringExports = colorString.exports;
|
|
881
|
-
|
|
882
|
-
(function (exports) {
|
|
883
|
-
|
|
884
|
-
var __assign = commonjsGlobal && commonjsGlobal.__assign || function () {
|
|
885
|
-
__assign = Object.assign || function (t) {
|
|
886
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
887
|
-
s = arguments[i];
|
|
888
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
889
|
-
}
|
|
890
|
-
return t;
|
|
891
|
-
};
|
|
892
|
-
return __assign.apply(this, arguments);
|
|
893
893
|
};
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
898
|
-
ar[i] = from[i];
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
894
|
+
cs.to.hex = function () {
|
|
895
|
+
var rgba = swizzle(arguments);
|
|
896
|
+
return '#' + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : '');
|
|
902
897
|
};
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
exports.spacing = exports.colorInHex = exports.color = exports.remToUnitlessPx = exports.text = void 0;
|
|
907
|
-
var colorString = colorStringExports;
|
|
908
|
-
var colors_1 = colors;
|
|
909
|
-
var space_1 = space;
|
|
910
|
-
var typography_1 = typography;
|
|
911
|
-
var text = function text(name, font) {
|
|
912
|
-
if (font === void 0) {
|
|
913
|
-
font = 'sans';
|
|
914
|
-
}
|
|
915
|
-
var treatment = typography_1.typography['text-treatments'][name];
|
|
916
|
-
return __assign(__assign({}, treatment), {
|
|
917
|
-
'font-family': typography_1.typography.fonts[font].join(','),
|
|
918
|
-
'line-height': "".concat(treatment['line-height'])
|
|
919
|
-
});
|
|
898
|
+
cs.to.rgb = function () {
|
|
899
|
+
var rgba = swizzle(arguments);
|
|
900
|
+
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')' : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
920
901
|
};
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
902
|
+
cs.to.rgb.percent = function () {
|
|
903
|
+
var rgba = swizzle(arguments);
|
|
904
|
+
var r = Math.round(rgba[0] / 255 * 100);
|
|
905
|
+
var g = Math.round(rgba[1] / 255 * 100);
|
|
906
|
+
var b = Math.round(rgba[2] / 255 * 100);
|
|
907
|
+
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)' : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
924
908
|
};
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
var color = colors_1.colors.all[name];
|
|
929
|
-
return alpha != null ?
|
|
930
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
931
|
-
colorString.to.rgb(__spreadArray(__spreadArray([], ((_a = colorString.get.rgb(color)) === null || _a === void 0 ? void 0 : _a.slice(0, 3)) || [], true), [alpha], false)) : color;
|
|
909
|
+
cs.to.hsl = function () {
|
|
910
|
+
var hsla = swizzle(arguments);
|
|
911
|
+
return hsla.length < 4 || hsla[3] === 1 ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)' : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
932
912
|
};
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
913
|
+
|
|
914
|
+
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
915
|
+
// (hwb have alpha optional & 1 is default value)
|
|
916
|
+
cs.to.hwb = function () {
|
|
917
|
+
var hwba = swizzle(arguments);
|
|
918
|
+
var a = '';
|
|
919
|
+
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
920
|
+
a = ', ' + hwba[3];
|
|
921
|
+
}
|
|
922
|
+
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
936
923
|
};
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
return [topY, rightX, bottom, left].reduce(function (acc, value) {
|
|
940
|
-
var _a;
|
|
941
|
-
if (value === undefined) return acc;
|
|
942
|
-
return [acc, (_a = space_1.space.scale[Number(value)]) !== null && _a !== void 0 ? _a : value].join(' ');
|
|
943
|
-
}, '');
|
|
924
|
+
cs.to.keyword = function (rgb) {
|
|
925
|
+
return reverseNames[rgb.slice(0, 3)];
|
|
944
926
|
};
|
|
945
|
-
exports.spacing = spacing;
|
|
946
|
-
})(helpers);
|
|
947
927
|
|
|
948
|
-
|
|
928
|
+
// helpers
|
|
929
|
+
function clamp(num, min, max) {
|
|
930
|
+
return Math.min(Math.max(min, num), max);
|
|
931
|
+
}
|
|
932
|
+
function hexDouble(num) {
|
|
933
|
+
var str = Math.round(num).toString(16).toUpperCase();
|
|
934
|
+
return str.length < 2 ? '0' + str : str;
|
|
935
|
+
}
|
|
936
|
+
return colorString.exports;
|
|
937
|
+
}
|
|
949
938
|
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
939
|
+
var hasRequiredHelpers;
|
|
940
|
+
function requireHelpers() {
|
|
941
|
+
if (hasRequiredHelpers) return helpers;
|
|
942
|
+
hasRequiredHelpers = 1;
|
|
943
|
+
(function (exports) {
|
|
944
|
+
|
|
945
|
+
var __assign = helpers && helpers.__assign || function () {
|
|
946
|
+
__assign = Object.assign || function (t) {
|
|
947
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
948
|
+
s = arguments[i];
|
|
949
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
958
950
|
}
|
|
951
|
+
return t;
|
|
959
952
|
};
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
return
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
return
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
953
|
+
return __assign.apply(this, arguments);
|
|
954
|
+
};
|
|
955
|
+
var __spreadArray = helpers && helpers.__spreadArray || function (to, from, pack) {
|
|
956
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
957
|
+
if (ar || !(i in from)) {
|
|
958
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
959
|
+
ar[i] = from[i];
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
963
|
+
};
|
|
964
|
+
Object.defineProperty(exports, "__esModule", {
|
|
965
|
+
value: true
|
|
966
|
+
});
|
|
967
|
+
exports.spacing = exports.colorInHex = exports.color = exports.remToUnitlessPx = exports.text = void 0;
|
|
968
|
+
var colorString = requireColorString();
|
|
969
|
+
var colors_1 = requireColors();
|
|
970
|
+
var space_1 = requireSpace();
|
|
971
|
+
var typography_1 = requireTypography();
|
|
972
|
+
var text = function text(name, font) {
|
|
973
|
+
if (font === void 0) {
|
|
974
|
+
font = 'sans';
|
|
975
|
+
}
|
|
976
|
+
var treatment = typography_1.typography['text-treatments'][name];
|
|
977
|
+
return __assign(__assign({}, treatment), {
|
|
978
|
+
'font-family': typography_1.typography.fonts[font].join(','),
|
|
979
|
+
'line-height': "".concat(treatment['line-height'])
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
exports.text = text;
|
|
983
|
+
var remToUnitlessPx = function remToUnitlessPx(value) {
|
|
984
|
+
return parseFloat(value) * parseInt(typography_1.typography['root-font-size'], 10);
|
|
985
|
+
};
|
|
986
|
+
exports.remToUnitlessPx = remToUnitlessPx;
|
|
987
|
+
var color = function color(name, alpha) {
|
|
988
|
+
var _a;
|
|
989
|
+
var color = colors_1.colors.all[name];
|
|
990
|
+
return alpha != null ?
|
|
991
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
992
|
+
colorString.to.rgb(__spreadArray(__spreadArray([], ((_a = colorString.get.rgb(color)) === null || _a === void 0 ? void 0 : _a.slice(0, 3)) || [], true), [alpha], false)) : color;
|
|
993
|
+
};
|
|
994
|
+
exports.color = color;
|
|
995
|
+
var colorInHex = function colorInHex(name, alpha) {
|
|
996
|
+
return colorString.to.hex(colorString.get.rgb((0, exports.color)(name, alpha)));
|
|
997
|
+
};
|
|
998
|
+
exports.colorInHex = colorInHex;
|
|
999
|
+
var spacing = function spacing(topY, rightX, bottom, left) {
|
|
1000
|
+
return [topY, rightX, bottom, left].reduce(function (acc, value) {
|
|
1001
|
+
var _a;
|
|
1002
|
+
if (value === undefined) return acc;
|
|
1003
|
+
return [acc, (_a = space_1.space.scale[Number(value)]) !== null && _a !== void 0 ? _a : value].join(' ');
|
|
1004
|
+
}, '');
|
|
1005
|
+
};
|
|
1006
|
+
exports.spacing = spacing;
|
|
1007
|
+
})(helpers);
|
|
1008
|
+
return helpers;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
var hasRequiredDist$4;
|
|
1012
|
+
function requireDist$4() {
|
|
1013
|
+
if (hasRequiredDist$4) return dist$4;
|
|
1014
|
+
hasRequiredDist$4 = 1;
|
|
1015
|
+
(function (exports) {
|
|
1016
|
+
|
|
1017
|
+
var __createBinding = dist$4 && dist$4.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1018
|
+
if (k2 === undefined) k2 = k;
|
|
1019
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1020
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1021
|
+
desc = {
|
|
1022
|
+
enumerable: true,
|
|
1023
|
+
get: function get() {
|
|
1024
|
+
return m[k];
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
Object.defineProperty(o, k2, desc);
|
|
1029
|
+
} : function (o, m, k, k2) {
|
|
1030
|
+
if (k2 === undefined) k2 = k;
|
|
1031
|
+
o[k2] = m[k];
|
|
1032
|
+
});
|
|
1033
|
+
var __exportStar = dist$4 && dist$4.__exportStar || function (m, exports) {
|
|
1034
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1035
|
+
};
|
|
1036
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1037
|
+
value: true
|
|
1038
|
+
});
|
|
1039
|
+
exports.breakpoints = exports.space = exports.typography = exports.colors = void 0;
|
|
1040
|
+
var colors_1 = requireColors();
|
|
1041
|
+
Object.defineProperty(exports, "colors", {
|
|
1042
|
+
enumerable: true,
|
|
1043
|
+
get: function get() {
|
|
1044
|
+
return colors_1.colors;
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
var typography_1 = requireTypography();
|
|
1048
|
+
Object.defineProperty(exports, "typography", {
|
|
1049
|
+
enumerable: true,
|
|
1050
|
+
get: function get() {
|
|
1051
|
+
return typography_1.typography;
|
|
1052
|
+
}
|
|
1053
|
+
});
|
|
1054
|
+
var space_1 = requireSpace();
|
|
1055
|
+
Object.defineProperty(exports, "space", {
|
|
1056
|
+
enumerable: true,
|
|
1057
|
+
get: function get() {
|
|
1058
|
+
return space_1.space;
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
var breakpoints_1 = requireBreakpoints();
|
|
1062
|
+
Object.defineProperty(exports, "breakpoints", {
|
|
1063
|
+
enumerable: true,
|
|
1064
|
+
get: function get() {
|
|
1065
|
+
return breakpoints_1.breakpoints;
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
__exportStar(requireHelpers(), exports);
|
|
1069
|
+
})(dist$4);
|
|
1070
|
+
return dist$4;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
var distExports$4 = requireDist$4();
|
|
1003
1074
|
|
|
1004
1075
|
function _arrayLikeToArray(r, a) {
|
|
1005
1076
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -1200,61 +1271,68 @@ var isRenderProps = function isRenderProps(children) {
|
|
|
1200
1271
|
|
|
1201
1272
|
var classnames = {exports: {}};
|
|
1202
1273
|
|
|
1203
|
-
|
|
1204
|
-
|
|
1274
|
+
var hasRequiredClassnames;
|
|
1275
|
+
function requireClassnames() {
|
|
1276
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
1277
|
+
hasRequiredClassnames = 1;
|
|
1278
|
+
(function (module) {
|
|
1279
|
+
/* global define */
|
|
1205
1280
|
|
|
1206
|
-
|
|
1281
|
+
(function () {
|
|
1207
1282
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1283
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1284
|
+
function classNames() {
|
|
1285
|
+
var classes = '';
|
|
1286
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1287
|
+
var arg = arguments[i];
|
|
1288
|
+
if (arg) {
|
|
1289
|
+
classes = appendClass(classes, parseValue(arg));
|
|
1290
|
+
}
|
|
1215
1291
|
}
|
|
1292
|
+
return classes;
|
|
1216
1293
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
if (Array.isArray(arg)) {
|
|
1227
|
-
return classNames.apply(null, arg);
|
|
1228
|
-
}
|
|
1229
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
1230
|
-
return arg.toString();
|
|
1231
|
-
}
|
|
1232
|
-
var classes = '';
|
|
1233
|
-
for (var key in arg) {
|
|
1234
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1235
|
-
classes = appendClass(classes, key);
|
|
1294
|
+
function parseValue(arg) {
|
|
1295
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
1296
|
+
return arg;
|
|
1297
|
+
}
|
|
1298
|
+
if (_typeof$1(arg) !== 'object') {
|
|
1299
|
+
return '';
|
|
1300
|
+
}
|
|
1301
|
+
if (Array.isArray(arg)) {
|
|
1302
|
+
return classNames.apply(null, arg);
|
|
1236
1303
|
}
|
|
1304
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
1305
|
+
return arg.toString();
|
|
1306
|
+
}
|
|
1307
|
+
var classes = '';
|
|
1308
|
+
for (var key in arg) {
|
|
1309
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1310
|
+
classes = appendClass(classes, key);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
return classes;
|
|
1237
1314
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1315
|
+
function appendClass(value, newClass) {
|
|
1316
|
+
if (!newClass) {
|
|
1317
|
+
return value;
|
|
1318
|
+
}
|
|
1319
|
+
if (value) {
|
|
1320
|
+
return value + ' ' + newClass;
|
|
1321
|
+
}
|
|
1322
|
+
return value + newClass;
|
|
1243
1323
|
}
|
|
1244
|
-
if (
|
|
1245
|
-
|
|
1324
|
+
if (module.exports) {
|
|
1325
|
+
classNames["default"] = classNames;
|
|
1326
|
+
module.exports = classNames;
|
|
1327
|
+
} else {
|
|
1328
|
+
window.classNames = classNames;
|
|
1246
1329
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
window.classNames = classNames;
|
|
1254
|
-
}
|
|
1255
|
-
})();
|
|
1256
|
-
})(classnames);
|
|
1257
|
-
var classnamesExports = classnames.exports;
|
|
1330
|
+
})();
|
|
1331
|
+
})(classnames);
|
|
1332
|
+
return classnames.exports;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
var classnamesExports = requireClassnames();
|
|
1258
1336
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
1259
1337
|
|
|
1260
1338
|
var _excluded$G = ["className", "children", "space", "direction", "alignItems", "justifyContent", "style"];
|
|
@@ -1385,15 +1463,15 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
1385
1463
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
1386
1464
|
|
|
1387
1465
|
|
|
1388
|
-
var __assign$
|
|
1389
|
-
__assign$
|
|
1466
|
+
var __assign$a = function() {
|
|
1467
|
+
__assign$a = Object.assign || function __assign(t) {
|
|
1390
1468
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1391
1469
|
s = arguments[i];
|
|
1392
1470
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1393
1471
|
}
|
|
1394
1472
|
return t;
|
|
1395
1473
|
};
|
|
1396
|
-
return __assign$
|
|
1474
|
+
return __assign$a.apply(this, arguments);
|
|
1397
1475
|
};
|
|
1398
1476
|
|
|
1399
1477
|
function __rest$a(s, e) {
|
|
@@ -1637,7 +1715,7 @@ function createSidecarMedium(options) {
|
|
|
1637
1715
|
options = {};
|
|
1638
1716
|
}
|
|
1639
1717
|
var medium = innerCreateMedium(null);
|
|
1640
|
-
medium.options = __assign$
|
|
1718
|
+
medium.options = __assign$a({
|
|
1641
1719
|
async: true,
|
|
1642
1720
|
ssr: false
|
|
1643
1721
|
}, options);
|
|
@@ -1654,7 +1732,7 @@ var SideCar$1 = function SideCar(_a) {
|
|
|
1654
1732
|
if (!Target) {
|
|
1655
1733
|
throw new Error('Sidecar medium not found');
|
|
1656
1734
|
}
|
|
1657
|
-
return /*#__PURE__*/React.createElement(Target, __assign$
|
|
1735
|
+
return /*#__PURE__*/React.createElement(Target, __assign$a({}, rest));
|
|
1658
1736
|
};
|
|
1659
1737
|
SideCar$1.isSideCarExport = true;
|
|
1660
1738
|
function exportSidecar(medium, exported) {
|
|
@@ -1695,8 +1773,8 @@ var RemoveScroll = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
|
|
|
1695
1773
|
rest = __rest$a(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
1696
1774
|
var SideCar = sideCar;
|
|
1697
1775
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1698
|
-
var containerProps = __assign$
|
|
1699
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, enabled && (
|
|
1776
|
+
var containerProps = __assign$a(__assign$a({}, rest), callbacks);
|
|
1777
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, enabled && (/*#__PURE__*/React.createElement(SideCar, {
|
|
1700
1778
|
sideCar: effectCar$1,
|
|
1701
1779
|
removeScrollBar: removeScrollBar,
|
|
1702
1780
|
shards: shards,
|
|
@@ -1706,9 +1784,9 @@ var RemoveScroll = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
|
|
|
1706
1784
|
allowPinchZoom: !!allowPinchZoom,
|
|
1707
1785
|
lockRef: ref,
|
|
1708
1786
|
gapMode: gapMode
|
|
1709
|
-
})), forwardProps ? (
|
|
1787
|
+
})), forwardProps ? (/*#__PURE__*/React.cloneElement(React.Children.only(children), __assign$a(__assign$a({}, containerProps), {
|
|
1710
1788
|
ref: containerRef
|
|
1711
|
-
}))) : (
|
|
1789
|
+
}))) : (/*#__PURE__*/React.createElement(Container, __assign$a({}, containerProps, {
|
|
1712
1790
|
className: className,
|
|
1713
1791
|
ref: containerRef
|
|
1714
1792
|
}), children)));
|
|
@@ -2147,9 +2225,9 @@ function requireCheckPropTypes() {
|
|
|
2147
2225
|
hasRequiredCheckPropTypes = 1;
|
|
2148
2226
|
var printWarning = function printWarning() {};
|
|
2149
2227
|
if (process.env.NODE_ENV !== 'production') {
|
|
2150
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2228
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
2151
2229
|
var loggedTypeFailures = {};
|
|
2152
|
-
var has = requireHas();
|
|
2230
|
+
var has = /*@__PURE__*/requireHas();
|
|
2153
2231
|
printWarning = function printWarning(text) {
|
|
2154
2232
|
var message = 'Warning: ' + text;
|
|
2155
2233
|
if (typeof console !== 'undefined') {
|
|
@@ -2231,9 +2309,9 @@ function requireFactoryWithTypeCheckers() {
|
|
|
2231
2309
|
hasRequiredFactoryWithTypeCheckers = 1;
|
|
2232
2310
|
var ReactIs = requireReactIs();
|
|
2233
2311
|
var assign = requireObjectAssign();
|
|
2234
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2235
|
-
var has = requireHas();
|
|
2236
|
-
var checkPropTypes = requireCheckPropTypes();
|
|
2312
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
2313
|
+
var has = /*@__PURE__*/requireHas();
|
|
2314
|
+
var checkPropTypes = /*@__PURE__*/requireCheckPropTypes();
|
|
2237
2315
|
var printWarning = function printWarning() {};
|
|
2238
2316
|
if (process.env.NODE_ENV !== 'production') {
|
|
2239
2317
|
printWarning = function printWarning(text) {
|
|
@@ -2782,7 +2860,7 @@ var hasRequiredFactoryWithThrowingShims;
|
|
|
2782
2860
|
function requireFactoryWithThrowingShims() {
|
|
2783
2861
|
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
2784
2862
|
hasRequiredFactoryWithThrowingShims = 1;
|
|
2785
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2863
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
2786
2864
|
function emptyFunction() {}
|
|
2787
2865
|
function emptyFunctionWithReset() {}
|
|
2788
2866
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
@@ -2837,19 +2915,26 @@ function requireFactoryWithThrowingShims() {
|
|
|
2837
2915
|
* This source code is licensed under the MIT license found in the
|
|
2838
2916
|
* LICENSE file in the root directory of this source tree.
|
|
2839
2917
|
*/
|
|
2840
|
-
|
|
2841
|
-
|
|
2918
|
+
var hasRequiredPropTypes;
|
|
2919
|
+
function requirePropTypes() {
|
|
2920
|
+
if (hasRequiredPropTypes) return propTypes.exports;
|
|
2921
|
+
hasRequiredPropTypes = 1;
|
|
2922
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2923
|
+
var ReactIs = requireReactIs();
|
|
2842
2924
|
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
} else {
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2925
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
2926
|
+
// http://fb.me/prop-types-in-prod
|
|
2927
|
+
var throwOnDirectAccess = true;
|
|
2928
|
+
propTypes.exports = /*@__PURE__*/requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
2929
|
+
} else {
|
|
2930
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
2931
|
+
// http://fb.me/prop-types-in-prod
|
|
2932
|
+
propTypes.exports = /*@__PURE__*/requireFactoryWithThrowingShims()();
|
|
2933
|
+
}
|
|
2934
|
+
return propTypes.exports;
|
|
2851
2935
|
}
|
|
2852
|
-
|
|
2936
|
+
|
|
2937
|
+
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
2853
2938
|
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
2854
2939
|
|
|
2855
2940
|
/**
|
|
@@ -3125,7 +3210,7 @@ var FocusOn$1 = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
|
|
|
3125
3210
|
var onActivation = lockProps.onActivation,
|
|
3126
3211
|
onDeactivation = lockProps.onDeactivation,
|
|
3127
3212
|
restProps = __rest$a(lockProps, ["onActivation", "onDeactivation"]);
|
|
3128
|
-
var appliedLockProps = __assign$
|
|
3213
|
+
var appliedLockProps = __assign$a(__assign$a({}, restProps), {
|
|
3129
3214
|
as: as,
|
|
3130
3215
|
style: style,
|
|
3131
3216
|
sideCar: sideCar,
|
|
@@ -3150,7 +3235,7 @@ var FocusOn$1 = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
|
|
|
3150
3235
|
lockProps: appliedLockProps,
|
|
3151
3236
|
focusOptions: preventScrollOnFocus ? PREVENT_SCROLL : undefined,
|
|
3152
3237
|
as: RemoveScroll
|
|
3153
|
-
}, children), enabled && (
|
|
3238
|
+
}, children), enabled && (/*#__PURE__*/React.createElement(SideCar, __assign$a({}, rest, {
|
|
3154
3239
|
sideCar: effectCar,
|
|
3155
3240
|
setLockProps: setLockProps,
|
|
3156
3241
|
shards: shards
|
|
@@ -4789,7 +4874,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4789
4874
|
return;
|
|
4790
4875
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
4791
4876
|
var shouldCancelEvent = React.useCallback(function (event, parent) {
|
|
4792
|
-
if ('touches' in event && event.touches.length === 2) {
|
|
4877
|
+
if ('touches' in event && event.touches.length === 2 || event.type === 'wheel' && event.ctrlKey) {
|
|
4793
4878
|
return !lastProps.current.allowPinchZoom;
|
|
4794
4879
|
}
|
|
4795
4880
|
var touch = getTouchXY(event);
|
|
@@ -5173,10 +5258,10 @@ function Effect(_a) {
|
|
|
5173
5258
|
var SideCar = exportSidecar(effectCar, Effect);
|
|
5174
5259
|
|
|
5175
5260
|
var RequireSideCar = function RequireSideCar(props) {
|
|
5176
|
-
return /*#__PURE__*/React.createElement(SideCar, __assign$
|
|
5261
|
+
return /*#__PURE__*/React.createElement(SideCar, __assign$a({}, props));
|
|
5177
5262
|
};
|
|
5178
5263
|
var FocusOn = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
5179
|
-
return /*#__PURE__*/React.createElement(FocusOn$1, __assign$
|
|
5264
|
+
return /*#__PURE__*/React.createElement(FocusOn$1, __assign$a({}, props, {
|
|
5180
5265
|
ref: ref,
|
|
5181
5266
|
sideCar: RequireSideCar
|
|
5182
5267
|
}));
|
|
@@ -5186,87 +5271,101 @@ var dist$3 = {};
|
|
|
5186
5271
|
|
|
5187
5272
|
var scale = {};
|
|
5188
5273
|
|
|
5189
|
-
|
|
5274
|
+
var hasRequiredScale;
|
|
5275
|
+
function requireScale() {
|
|
5276
|
+
if (hasRequiredScale) return scale;
|
|
5277
|
+
hasRequiredScale = 1;
|
|
5278
|
+
(function (exports) {
|
|
5190
5279
|
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5280
|
+
var __assign = scale && scale.__assign || function () {
|
|
5281
|
+
__assign = Object.assign || function (t) {
|
|
5282
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5283
|
+
s = arguments[i];
|
|
5284
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
5285
|
+
}
|
|
5286
|
+
return t;
|
|
5287
|
+
};
|
|
5288
|
+
return __assign.apply(this, arguments);
|
|
5289
|
+
};
|
|
5290
|
+
var __rest = scale && scale.__rest || function (s, e) {
|
|
5291
|
+
var t = {};
|
|
5292
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5293
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5294
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
5196
5295
|
}
|
|
5197
5296
|
return t;
|
|
5198
5297
|
};
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
exports.paddingBottom = function (_a) {
|
|
5222
|
-
var width = _a.width,
|
|
5223
|
-
height = _a.height;
|
|
5224
|
-
return height / width * 100.0 + "%";
|
|
5225
|
-
};
|
|
5226
|
-
exports.scale = function (_a) {
|
|
5227
|
-
var width = _a.width,
|
|
5228
|
-
height = _a.height,
|
|
5229
|
-
dimensions = __rest(_a, ["width", "height"]);
|
|
5230
|
-
var scale = exports.factor(__assign({
|
|
5231
|
-
width: width,
|
|
5232
|
-
height: height
|
|
5233
|
-
}, dimensions));
|
|
5234
|
-
var scaledWidth = Math.floor(width * scale);
|
|
5235
|
-
var scaledHeight = Math.floor(height * scale);
|
|
5236
|
-
return {
|
|
5237
|
-
width: scaledWidth,
|
|
5238
|
-
height: scaledHeight,
|
|
5239
|
-
paddingBottom: exports.paddingBottom({
|
|
5298
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5299
|
+
value: true
|
|
5300
|
+
});
|
|
5301
|
+
exports.scale = exports.paddingBottom = exports.factor = void 0;
|
|
5302
|
+
exports.factor = function (_a) {
|
|
5303
|
+
var width = _a.width,
|
|
5304
|
+
height = _a.height,
|
|
5305
|
+
dimensions = __rest(_a, ["width", "height"]);
|
|
5306
|
+
if ("maxHeight" in dimensions && !("maxWidth" in dimensions)) return dimensions.maxHeight / height;
|
|
5307
|
+
if ("maxWidth" in dimensions && !("maxHeight" in dimensions)) return dimensions.maxWidth / width;
|
|
5308
|
+
return Math.min(dimensions.maxWidth / width, dimensions.maxHeight / height);
|
|
5309
|
+
};
|
|
5310
|
+
exports.paddingBottom = function (_a) {
|
|
5311
|
+
var width = _a.width,
|
|
5312
|
+
height = _a.height;
|
|
5313
|
+
return height / width * 100.0 + "%";
|
|
5314
|
+
};
|
|
5315
|
+
exports.scale = function (_a) {
|
|
5316
|
+
var width = _a.width,
|
|
5317
|
+
height = _a.height,
|
|
5318
|
+
dimensions = __rest(_a, ["width", "height"]);
|
|
5319
|
+
var scale = exports.factor(__assign({
|
|
5240
5320
|
width: width,
|
|
5241
5321
|
height: height
|
|
5242
|
-
})
|
|
5243
|
-
|
|
5322
|
+
}, dimensions));
|
|
5323
|
+
var scaledWidth = Math.floor(width * scale);
|
|
5324
|
+
var scaledHeight = Math.floor(height * scale);
|
|
5325
|
+
return {
|
|
5326
|
+
width: scaledWidth,
|
|
5327
|
+
height: scaledHeight,
|
|
5328
|
+
paddingBottom: exports.paddingBottom({
|
|
5329
|
+
width: width,
|
|
5330
|
+
height: height
|
|
5331
|
+
}),
|
|
5332
|
+
scale: scale
|
|
5333
|
+
};
|
|
5244
5334
|
};
|
|
5245
|
-
};
|
|
5246
|
-
|
|
5335
|
+
})(scale);
|
|
5336
|
+
return scale;
|
|
5337
|
+
}
|
|
5247
5338
|
|
|
5248
|
-
|
|
5339
|
+
var hasRequiredDist$3;
|
|
5340
|
+
function requireDist$3() {
|
|
5341
|
+
if (hasRequiredDist$3) return dist$3;
|
|
5342
|
+
hasRequiredDist$3 = 1;
|
|
5343
|
+
(function (exports) {
|
|
5249
5344
|
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5345
|
+
var __createBinding = dist$3 && dist$3.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
5346
|
+
if (k2 === undefined) k2 = k;
|
|
5347
|
+
Object.defineProperty(o, k2, {
|
|
5348
|
+
enumerable: true,
|
|
5349
|
+
get: function get() {
|
|
5350
|
+
return m[k];
|
|
5351
|
+
}
|
|
5352
|
+
});
|
|
5353
|
+
} : function (o, m, k, k2) {
|
|
5354
|
+
if (k2 === undefined) k2 = k;
|
|
5355
|
+
o[k2] = m[k];
|
|
5257
5356
|
});
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5357
|
+
var __exportStar = dist$3 && dist$3.__exportStar || function (m, exports) {
|
|
5358
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
5359
|
+
};
|
|
5360
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5361
|
+
value: true
|
|
5362
|
+
});
|
|
5363
|
+
__exportStar(requireScale(), exports);
|
|
5364
|
+
})(dist$3);
|
|
5365
|
+
return dist$3;
|
|
5366
|
+
}
|
|
5367
|
+
|
|
5368
|
+
var distExports$3 = requireDist$3();
|
|
5270
5369
|
|
|
5271
5370
|
var _excluded$D = ["aspectWidth", "aspectHeight", "maxWidth", "maxHeight", "outlined", "children", "className"];
|
|
5272
5371
|
var DEFAULT_PRODUCT_ASPECT_WIDTH = 128;
|
|
@@ -5277,18 +5376,18 @@ var scaleDimensions = function scaleDimensions(_ref) {
|
|
|
5277
5376
|
height = _ref.height,
|
|
5278
5377
|
maxWidth = _ref.maxWidth,
|
|
5279
5378
|
maxHeight = _ref.maxHeight;
|
|
5280
|
-
if (maxWidth && maxHeight) return
|
|
5379
|
+
if (maxWidth && maxHeight) return distExports$3.scale({
|
|
5281
5380
|
width: width,
|
|
5282
5381
|
height: height,
|
|
5283
5382
|
maxWidth: maxWidth,
|
|
5284
5383
|
maxHeight: maxHeight
|
|
5285
5384
|
});
|
|
5286
|
-
if (maxWidth) return
|
|
5385
|
+
if (maxWidth) return distExports$3.scale({
|
|
5287
5386
|
width: width,
|
|
5288
5387
|
height: height,
|
|
5289
5388
|
maxWidth: maxWidth
|
|
5290
5389
|
});
|
|
5291
|
-
if (maxHeight) return
|
|
5390
|
+
if (maxHeight) return distExports$3.scale({
|
|
5292
5391
|
width: width,
|
|
5293
5392
|
height: height,
|
|
5294
5393
|
maxHeight: maxHeight
|
|
@@ -5296,7 +5395,7 @@ var scaleDimensions = function scaleDimensions(_ref) {
|
|
|
5296
5395
|
return {
|
|
5297
5396
|
width: width,
|
|
5298
5397
|
height: height,
|
|
5299
|
-
paddingBottom:
|
|
5398
|
+
paddingBottom: distExports$3.paddingBottom({
|
|
5300
5399
|
width: width,
|
|
5301
5400
|
height: height
|
|
5302
5401
|
}),
|
|
@@ -5364,7 +5463,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
5364
5463
|
itemType: "http://schema.org/BreadcrumbList",
|
|
5365
5464
|
className: classNames('Breadcrumbs', className)
|
|
5366
5465
|
}, rest), Children.map(children, function (child, index) {
|
|
5367
|
-
if (
|
|
5466
|
+
if (/*#__PURE__*/isValidElement(child)) {
|
|
5368
5467
|
position = position + 1;
|
|
5369
5468
|
return /*#__PURE__*/cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
|
|
5370
5469
|
key: index,
|
|
@@ -6238,7 +6337,7 @@ function _xfilter(f) {
|
|
|
6238
6337
|
*
|
|
6239
6338
|
* R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
|
|
6240
6339
|
*/
|
|
6241
|
-
var filter = /*#__PURE__*/_curry2(
|
|
6340
|
+
var filter = /*#__PURE__*/_curry2(/*#__PURE__*/_dispatchable(['fantasy-land/filter', 'filter'], _xfilter, function (pred, filterable) {
|
|
6242
6341
|
return _isObject(filterable) ? _arrayReduce(function (acc, key) {
|
|
6243
6342
|
if (pred(filterable[key])) {
|
|
6244
6343
|
acc[key] = filterable[key];
|
|
@@ -6459,7 +6558,7 @@ var _xmap = function _xmap(f) {
|
|
|
6459
6558
|
* @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }
|
|
6460
6559
|
* @symb R.map(f, functor_o) = functor_o.map(f)
|
|
6461
6560
|
*/
|
|
6462
|
-
var map = /*#__PURE__*/_curry2(
|
|
6561
|
+
var map = /*#__PURE__*/_curry2(/*#__PURE__*/_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
6463
6562
|
switch (Object.prototype.toString.call(functor)) {
|
|
6464
6563
|
case '[object Function]':
|
|
6465
6564
|
return curryN(functor.length, function () {
|
|
@@ -6951,7 +7050,7 @@ function _xuniqBy(f) {
|
|
|
6951
7050
|
*
|
|
6952
7051
|
* R.uniqBy(Math.abs, [-1, -5, 2, 10, 1, 2]); //=> [-1, -5, 2, 10]
|
|
6953
7052
|
*/
|
|
6954
|
-
var uniqBy = /*#__PURE__*/_curry2(
|
|
7053
|
+
var uniqBy = /*#__PURE__*/_curry2(/*#__PURE__*/_dispatchable([], _xuniqBy, function (fn, list) {
|
|
6955
7054
|
var set = new _Set();
|
|
6956
7055
|
var result = [];
|
|
6957
7056
|
var idx = 0;
|
|
@@ -7053,7 +7152,7 @@ var range = /*#__PURE__*/_curry2(function range(from, to) {
|
|
|
7053
7152
|
return result;
|
|
7054
7153
|
});
|
|
7055
7154
|
|
|
7056
|
-
var breakpointKeys = Object.keys(
|
|
7155
|
+
var breakpointKeys = Object.keys(distExports$4.breakpoints);
|
|
7057
7156
|
|
|
7058
7157
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
7059
7158
|
var ONE_PIXEL = 1 / 16;
|
|
@@ -7064,19 +7163,19 @@ var getMediaQueryBounds = function getMediaQueryBounds(_ref) {
|
|
|
7064
7163
|
case 'at':
|
|
7065
7164
|
{
|
|
7066
7165
|
var prevIndex = breakpointKeys.indexOf(breakpoint) - 1;
|
|
7067
|
-
var prevWidth = prevIndex === -1 ? 0 : parseInt(
|
|
7166
|
+
var prevWidth = prevIndex === -1 ? 0 : parseInt(distExports$4.breakpoints[breakpointKeys[prevIndex]], 10) + ONE_PIXEL;
|
|
7068
7167
|
return {
|
|
7069
7168
|
min: prevWidth,
|
|
7070
|
-
max: parseInt(
|
|
7169
|
+
max: parseInt(distExports$4.breakpoints[breakpoint], 10)
|
|
7071
7170
|
};
|
|
7072
7171
|
}
|
|
7073
7172
|
case 'gt':
|
|
7074
7173
|
return {
|
|
7075
|
-
min: parseInt(
|
|
7174
|
+
min: parseInt(distExports$4.breakpoints[breakpoint], 10) + ONE_PIXEL
|
|
7076
7175
|
};
|
|
7077
7176
|
case 'lt':
|
|
7078
7177
|
return {
|
|
7079
|
-
max: parseInt(
|
|
7178
|
+
max: parseInt(distExports$4.breakpoints[breakpoint], 10)
|
|
7080
7179
|
};
|
|
7081
7180
|
}
|
|
7082
7181
|
};
|
|
@@ -7198,15 +7297,15 @@ var Button = function Button(_ref) {
|
|
|
7198
7297
|
}, rest));
|
|
7199
7298
|
};
|
|
7200
7299
|
|
|
7201
|
-
var __assign$
|
|
7202
|
-
__assign$
|
|
7300
|
+
var __assign$9 = undefined && undefined.__assign || function () {
|
|
7301
|
+
__assign$9 = Object.assign || function (t) {
|
|
7203
7302
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7204
7303
|
s = arguments[i];
|
|
7205
7304
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7206
7305
|
}
|
|
7207
7306
|
return t;
|
|
7208
7307
|
};
|
|
7209
|
-
return __assign$
|
|
7308
|
+
return __assign$9.apply(this, arguments);
|
|
7210
7309
|
};
|
|
7211
7310
|
var __rest$9 = undefined && undefined.__rest || function (s, e) {
|
|
7212
7311
|
var t = {};
|
|
@@ -7224,7 +7323,7 @@ var Checkmark16 = function Checkmark16(_a) {
|
|
|
7224
7323
|
_d = _a.width,
|
|
7225
7324
|
width = _d === void 0 ? '16px' : _d,
|
|
7226
7325
|
rest = __rest$9(_a, ["color", "height", "width"]);
|
|
7227
|
-
var svgStyle = __assign$
|
|
7326
|
+
var svgStyle = __assign$9({
|
|
7228
7327
|
"position": "absolute",
|
|
7229
7328
|
"top": "0",
|
|
7230
7329
|
"right": "0",
|
|
@@ -7235,8 +7334,8 @@ var Checkmark16 = function Checkmark16(_a) {
|
|
|
7235
7334
|
}, {
|
|
7236
7335
|
fill: color
|
|
7237
7336
|
});
|
|
7238
|
-
return /*#__PURE__*/React.createElement("div", __assign$
|
|
7239
|
-
style: __assign$
|
|
7337
|
+
return /*#__PURE__*/React.createElement("div", __assign$9({
|
|
7338
|
+
style: __assign$9({
|
|
7240
7339
|
"position": "relative"
|
|
7241
7340
|
}, {
|
|
7242
7341
|
height: height,
|
|
@@ -7251,15 +7350,15 @@ var Checkmark16 = function Checkmark16(_a) {
|
|
|
7251
7350
|
};
|
|
7252
7351
|
Checkmark16.displayName = 'Checkmark16';
|
|
7253
7352
|
|
|
7254
|
-
var __assign$
|
|
7255
|
-
__assign$
|
|
7353
|
+
var __assign$8 = undefined && undefined.__assign || function () {
|
|
7354
|
+
__assign$8 = Object.assign || function (t) {
|
|
7256
7355
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7257
7356
|
s = arguments[i];
|
|
7258
7357
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7259
7358
|
}
|
|
7260
7359
|
return t;
|
|
7261
7360
|
};
|
|
7262
|
-
return __assign$
|
|
7361
|
+
return __assign$8.apply(this, arguments);
|
|
7263
7362
|
};
|
|
7264
7363
|
var __rest$8 = undefined && undefined.__rest || function (s, e) {
|
|
7265
7364
|
var t = {};
|
|
@@ -7277,7 +7376,7 @@ var Circle12 = function Circle12(_a) {
|
|
|
7277
7376
|
_d = _a.width,
|
|
7278
7377
|
width = _d === void 0 ? '12px' : _d,
|
|
7279
7378
|
rest = __rest$8(_a, ["color", "height", "width"]);
|
|
7280
|
-
var svgStyle = __assign$
|
|
7379
|
+
var svgStyle = __assign$8({
|
|
7281
7380
|
"position": "absolute",
|
|
7282
7381
|
"top": "0",
|
|
7283
7382
|
"right": "0",
|
|
@@ -7288,8 +7387,8 @@ var Circle12 = function Circle12(_a) {
|
|
|
7288
7387
|
}, {
|
|
7289
7388
|
fill: color
|
|
7290
7389
|
});
|
|
7291
|
-
return /*#__PURE__*/React.createElement("div", __assign$
|
|
7292
|
-
style: __assign$
|
|
7390
|
+
return /*#__PURE__*/React.createElement("div", __assign$8({
|
|
7391
|
+
style: __assign$8({
|
|
7293
7392
|
"position": "relative"
|
|
7294
7393
|
}, {
|
|
7295
7394
|
height: height,
|
|
@@ -7545,7 +7644,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
7545
7644
|
};
|
|
7546
7645
|
}, [element]);
|
|
7547
7646
|
if (!element) return null;
|
|
7548
|
-
return /*#__PURE__*/createPortal(
|
|
7647
|
+
return /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement(Overlay, _extends$1({
|
|
7549
7648
|
className: classNames('ModalOverlay', overlayClassName),
|
|
7550
7649
|
show: show
|
|
7551
7650
|
}, rest), /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -7574,7 +7673,7 @@ var Text = function Text(_ref) {
|
|
|
7574
7673
|
return /*#__PURE__*/React__default.createElement(Component, _extends$1({
|
|
7575
7674
|
className: classNames("Text Text--".concat(treatment, " ").concat(family ? "Text--".concat(family) : ''), className),
|
|
7576
7675
|
style: _objectSpread2({
|
|
7577
|
-
color:
|
|
7676
|
+
color: distExports$4.colors.all[color]
|
|
7578
7677
|
}, style)
|
|
7579
7678
|
}, rest), children);
|
|
7580
7679
|
};
|
|
@@ -9265,377 +9364,430 @@ function requireReactInputMask_development() {
|
|
|
9265
9364
|
return reactInputMask_development;
|
|
9266
9365
|
}
|
|
9267
9366
|
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9367
|
+
var hasRequiredReactInputMask;
|
|
9368
|
+
function requireReactInputMask() {
|
|
9369
|
+
if (hasRequiredReactInputMask) return reactInputMask.exports;
|
|
9370
|
+
hasRequiredReactInputMask = 1;
|
|
9371
|
+
if (process.env.NODE_ENV === 'production') {
|
|
9372
|
+
reactInputMask.exports = requireReactInputMask_production_min();
|
|
9373
|
+
} else {
|
|
9374
|
+
reactInputMask.exports = requireReactInputMask_development();
|
|
9375
|
+
}
|
|
9376
|
+
return reactInputMask.exports;
|
|
9272
9377
|
}
|
|
9273
|
-
|
|
9378
|
+
|
|
9379
|
+
var reactInputMaskExports = requireReactInputMask();
|
|
9274
9380
|
var InputMask = /*@__PURE__*/getDefaultExportFromCjs(reactInputMaskExports);
|
|
9275
9381
|
|
|
9276
|
-
var
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9382
|
+
var cardTypes_1;
|
|
9383
|
+
var hasRequiredCardTypes;
|
|
9384
|
+
function requireCardTypes() {
|
|
9385
|
+
if (hasRequiredCardTypes) return cardTypes_1;
|
|
9386
|
+
hasRequiredCardTypes = 1;
|
|
9387
|
+
var cardTypes = {
|
|
9388
|
+
visa: {
|
|
9389
|
+
niceType: "Visa",
|
|
9390
|
+
type: "visa",
|
|
9391
|
+
patterns: [4],
|
|
9392
|
+
gaps: [4, 8, 12],
|
|
9393
|
+
lengths: [16, 18, 19],
|
|
9394
|
+
code: {
|
|
9395
|
+
name: "CVV",
|
|
9396
|
+
size: 3
|
|
9397
|
+
}
|
|
9398
|
+
},
|
|
9399
|
+
mastercard: {
|
|
9400
|
+
niceType: "Mastercard",
|
|
9401
|
+
type: "mastercard",
|
|
9402
|
+
patterns: [[51, 55], [2221, 2229], [223, 229], [23, 26], [270, 271], 2720],
|
|
9403
|
+
gaps: [4, 8, 12],
|
|
9404
|
+
lengths: [16],
|
|
9405
|
+
code: {
|
|
9406
|
+
name: "CVC",
|
|
9407
|
+
size: 3
|
|
9408
|
+
}
|
|
9409
|
+
},
|
|
9410
|
+
"american-express": {
|
|
9411
|
+
niceType: "American Express",
|
|
9412
|
+
type: "american-express",
|
|
9413
|
+
patterns: [34, 37],
|
|
9414
|
+
gaps: [4, 10],
|
|
9415
|
+
lengths: [15],
|
|
9416
|
+
code: {
|
|
9417
|
+
name: "CID",
|
|
9418
|
+
size: 4
|
|
9419
|
+
}
|
|
9420
|
+
},
|
|
9421
|
+
"diners-club": {
|
|
9422
|
+
niceType: "Diners Club",
|
|
9423
|
+
type: "diners-club",
|
|
9424
|
+
patterns: [[300, 305], 36, 38, 39],
|
|
9425
|
+
gaps: [4, 10],
|
|
9426
|
+
lengths: [14, 16, 19],
|
|
9427
|
+
code: {
|
|
9428
|
+
name: "CVV",
|
|
9429
|
+
size: 3
|
|
9430
|
+
}
|
|
9431
|
+
},
|
|
9432
|
+
discover: {
|
|
9433
|
+
niceType: "Discover",
|
|
9434
|
+
type: "discover",
|
|
9435
|
+
patterns: [6011, [644, 649], 65],
|
|
9436
|
+
gaps: [4, 8, 12],
|
|
9437
|
+
lengths: [16, 19],
|
|
9438
|
+
code: {
|
|
9439
|
+
name: "CID",
|
|
9440
|
+
size: 3
|
|
9441
|
+
}
|
|
9442
|
+
},
|
|
9443
|
+
jcb: {
|
|
9444
|
+
niceType: "JCB",
|
|
9445
|
+
type: "jcb",
|
|
9446
|
+
patterns: [2131, 1800, [3528, 3589]],
|
|
9447
|
+
gaps: [4, 8, 12],
|
|
9448
|
+
lengths: [16, 17, 18, 19],
|
|
9449
|
+
code: {
|
|
9450
|
+
name: "CVV",
|
|
9451
|
+
size: 3
|
|
9452
|
+
}
|
|
9453
|
+
},
|
|
9454
|
+
unionpay: {
|
|
9455
|
+
niceType: "UnionPay",
|
|
9456
|
+
type: "unionpay",
|
|
9457
|
+
patterns: [620, [62100, 62182], [62184, 62187], [62185, 62197], [62200, 62205], [622010, 622999], 622018, [62207, 62209], [623, 626], 6270, 6272, 6276, [627700, 627779], [627781, 627799], [6282, 6289], 6291, 6292, 810, [8110, 8131], [8132, 8151], [8152, 8163], [8164, 8171]],
|
|
9458
|
+
gaps: [4, 8, 12],
|
|
9459
|
+
lengths: [14, 15, 16, 17, 18, 19],
|
|
9460
|
+
code: {
|
|
9461
|
+
name: "CVN",
|
|
9462
|
+
size: 3
|
|
9463
|
+
}
|
|
9464
|
+
},
|
|
9465
|
+
maestro: {
|
|
9466
|
+
niceType: "Maestro",
|
|
9467
|
+
type: "maestro",
|
|
9468
|
+
patterns: [493698, [500000, 504174], [504176, 506698], [506779, 508999], [56, 59], 63, 67, 6],
|
|
9469
|
+
gaps: [4, 8, 12],
|
|
9470
|
+
lengths: [12, 13, 14, 15, 16, 17, 18, 19],
|
|
9471
|
+
code: {
|
|
9472
|
+
name: "CVC",
|
|
9473
|
+
size: 3
|
|
9474
|
+
}
|
|
9475
|
+
},
|
|
9476
|
+
elo: {
|
|
9477
|
+
niceType: "Elo",
|
|
9478
|
+
type: "elo",
|
|
9479
|
+
patterns: [401178, 401179, 438935, 457631, 457632, 431274, 451416, 457393, 504175, [506699, 506778], [509000, 509999], 627780, 636297, 636368, [650031, 650033], [650035, 650051], [650405, 650439], [650485, 650538], [650541, 650598], [650700, 650718], [650720, 650727], [650901, 650978], [651652, 651679], [655000, 655019], [655021, 655058]],
|
|
9480
|
+
gaps: [4, 8, 12],
|
|
9481
|
+
lengths: [16],
|
|
9482
|
+
code: {
|
|
9483
|
+
name: "CVE",
|
|
9484
|
+
size: 3
|
|
9485
|
+
}
|
|
9486
|
+
},
|
|
9487
|
+
mir: {
|
|
9488
|
+
niceType: "Mir",
|
|
9489
|
+
type: "mir",
|
|
9490
|
+
patterns: [[2200, 2204]],
|
|
9491
|
+
gaps: [4, 8, 12],
|
|
9492
|
+
lengths: [16, 17, 18, 19],
|
|
9493
|
+
code: {
|
|
9494
|
+
name: "CVP2",
|
|
9495
|
+
size: 3
|
|
9496
|
+
}
|
|
9497
|
+
},
|
|
9498
|
+
hiper: {
|
|
9499
|
+
niceType: "Hiper",
|
|
9500
|
+
type: "hiper",
|
|
9501
|
+
patterns: [637095, 63737423, 63743358, 637568, 637599, 637609, 637612],
|
|
9502
|
+
gaps: [4, 8, 12],
|
|
9503
|
+
lengths: [16],
|
|
9504
|
+
code: {
|
|
9505
|
+
name: "CVC",
|
|
9506
|
+
size: 3
|
|
9507
|
+
}
|
|
9508
|
+
},
|
|
9509
|
+
hipercard: {
|
|
9510
|
+
niceType: "Hipercard",
|
|
9511
|
+
type: "hipercard",
|
|
9512
|
+
patterns: [606282],
|
|
9513
|
+
gaps: [4, 8, 12],
|
|
9514
|
+
lengths: [16],
|
|
9515
|
+
code: {
|
|
9516
|
+
name: "CVC",
|
|
9517
|
+
size: 3
|
|
9518
|
+
}
|
|
9407
9519
|
}
|
|
9408
|
-
}
|
|
9409
|
-
|
|
9410
|
-
|
|
9520
|
+
};
|
|
9521
|
+
cardTypes_1 = cardTypes;
|
|
9522
|
+
return cardTypes_1;
|
|
9523
|
+
}
|
|
9411
9524
|
|
|
9412
|
-
var addMatchingCardsToResults
|
|
9525
|
+
var addMatchingCardsToResults = {};
|
|
9413
9526
|
|
|
9414
|
-
var clone
|
|
9527
|
+
var clone = {};
|
|
9415
9528
|
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9529
|
+
var hasRequiredClone;
|
|
9530
|
+
function requireClone() {
|
|
9531
|
+
if (hasRequiredClone) return clone;
|
|
9532
|
+
hasRequiredClone = 1;
|
|
9533
|
+
Object.defineProperty(clone, "__esModule", {
|
|
9534
|
+
value: true
|
|
9535
|
+
});
|
|
9536
|
+
clone.clone = void 0;
|
|
9537
|
+
function clone$1(originalObject) {
|
|
9538
|
+
if (!originalObject) {
|
|
9539
|
+
return null;
|
|
9540
|
+
}
|
|
9541
|
+
return JSON.parse(JSON.stringify(originalObject));
|
|
9423
9542
|
}
|
|
9424
|
-
|
|
9543
|
+
clone.clone = clone$1;
|
|
9544
|
+
return clone;
|
|
9425
9545
|
}
|
|
9426
|
-
clone$1.clone = clone;
|
|
9427
9546
|
|
|
9428
|
-
var matches
|
|
9547
|
+
var matches = {};
|
|
9429
9548
|
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
}
|
|
9449
|
-
function
|
|
9450
|
-
|
|
9451
|
-
return
|
|
9549
|
+
var hasRequiredMatches;
|
|
9550
|
+
function requireMatches() {
|
|
9551
|
+
if (hasRequiredMatches) return matches;
|
|
9552
|
+
hasRequiredMatches = 1;
|
|
9553
|
+
/*
|
|
9554
|
+
* Adapted from https://github.com/polvo-labs/card-type/blob/aaab11f80fa1939bccc8f24905a06ae3cd864356/src/cardType.js#L37-L42
|
|
9555
|
+
* */
|
|
9556
|
+
Object.defineProperty(matches, "__esModule", {
|
|
9557
|
+
value: true
|
|
9558
|
+
});
|
|
9559
|
+
matches.matches = void 0;
|
|
9560
|
+
function matchesRange(cardNumber, min, max) {
|
|
9561
|
+
var maxLengthToCheck = String(min).length;
|
|
9562
|
+
var substr = cardNumber.substr(0, maxLengthToCheck);
|
|
9563
|
+
var integerRepresentationOfCardNumber = parseInt(substr, 10);
|
|
9564
|
+
min = parseInt(String(min).substr(0, substr.length), 10);
|
|
9565
|
+
max = parseInt(String(max).substr(0, substr.length), 10);
|
|
9566
|
+
return integerRepresentationOfCardNumber >= min && integerRepresentationOfCardNumber <= max;
|
|
9567
|
+
}
|
|
9568
|
+
function matchesPattern(cardNumber, pattern) {
|
|
9569
|
+
pattern = String(pattern);
|
|
9570
|
+
return pattern.substring(0, cardNumber.length) === cardNumber.substring(0, pattern.length);
|
|
9571
|
+
}
|
|
9572
|
+
function matches$1(cardNumber, pattern) {
|
|
9573
|
+
if (Array.isArray(pattern)) {
|
|
9574
|
+
return matchesRange(cardNumber, pattern[0], pattern[1]);
|
|
9575
|
+
}
|
|
9576
|
+
return matchesPattern(cardNumber, pattern);
|
|
9452
9577
|
}
|
|
9453
|
-
|
|
9578
|
+
matches.matches = matches$1;
|
|
9579
|
+
return matches;
|
|
9454
9580
|
}
|
|
9455
|
-
matches$1.matches = matches;
|
|
9456
9581
|
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9582
|
+
var hasRequiredAddMatchingCardsToResults;
|
|
9583
|
+
function requireAddMatchingCardsToResults() {
|
|
9584
|
+
if (hasRequiredAddMatchingCardsToResults) return addMatchingCardsToResults;
|
|
9585
|
+
hasRequiredAddMatchingCardsToResults = 1;
|
|
9586
|
+
Object.defineProperty(addMatchingCardsToResults, "__esModule", {
|
|
9587
|
+
value: true
|
|
9588
|
+
});
|
|
9589
|
+
addMatchingCardsToResults.addMatchingCardsToResults = void 0;
|
|
9590
|
+
var clone_1 = requireClone();
|
|
9591
|
+
var matches_1 = requireMatches();
|
|
9592
|
+
function addMatchingCardsToResults$1(cardNumber, cardConfiguration, results) {
|
|
9593
|
+
var i, patternLength;
|
|
9594
|
+
for (i = 0; i < cardConfiguration.patterns.length; i++) {
|
|
9595
|
+
var pattern = cardConfiguration.patterns[i];
|
|
9596
|
+
if (!(0, matches_1.matches)(cardNumber, pattern)) {
|
|
9597
|
+
continue;
|
|
9598
|
+
}
|
|
9599
|
+
var clonedCardConfiguration = (0, clone_1.clone)(cardConfiguration);
|
|
9600
|
+
if (Array.isArray(pattern)) {
|
|
9601
|
+
patternLength = String(pattern[0]).length;
|
|
9602
|
+
} else {
|
|
9603
|
+
patternLength = String(pattern).length;
|
|
9604
|
+
}
|
|
9605
|
+
if (cardNumber.length >= patternLength) {
|
|
9606
|
+
clonedCardConfiguration.matchStrength = patternLength;
|
|
9607
|
+
}
|
|
9608
|
+
results.push(clonedCardConfiguration);
|
|
9609
|
+
break;
|
|
9478
9610
|
}
|
|
9479
|
-
results.push(clonedCardConfiguration);
|
|
9480
|
-
break;
|
|
9481
9611
|
}
|
|
9612
|
+
addMatchingCardsToResults.addMatchingCardsToResults = addMatchingCardsToResults$1;
|
|
9613
|
+
return addMatchingCardsToResults;
|
|
9482
9614
|
}
|
|
9483
|
-
addMatchingCardsToResults$1.addMatchingCardsToResults = addMatchingCardsToResults;
|
|
9484
9615
|
|
|
9485
|
-
var isValidInputType
|
|
9616
|
+
var isValidInputType = {};
|
|
9486
9617
|
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9618
|
+
var hasRequiredIsValidInputType;
|
|
9619
|
+
function requireIsValidInputType() {
|
|
9620
|
+
if (hasRequiredIsValidInputType) return isValidInputType;
|
|
9621
|
+
hasRequiredIsValidInputType = 1;
|
|
9622
|
+
Object.defineProperty(isValidInputType, "__esModule", {
|
|
9623
|
+
value: true
|
|
9624
|
+
});
|
|
9625
|
+
isValidInputType.isValidInputType = void 0;
|
|
9626
|
+
function isValidInputType$1(cardNumber) {
|
|
9627
|
+
return typeof cardNumber === "string" || cardNumber instanceof String;
|
|
9628
|
+
}
|
|
9629
|
+
isValidInputType.isValidInputType = isValidInputType$1;
|
|
9630
|
+
return isValidInputType;
|
|
9493
9631
|
}
|
|
9494
|
-
isValidInputType$1.isValidInputType = isValidInputType;
|
|
9495
9632
|
|
|
9496
|
-
var findBestMatch
|
|
9633
|
+
var findBestMatch = {};
|
|
9497
9634
|
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
* */
|
|
9511
|
-
return numberOfResultsWithMaxStrengthProperty > 0 && numberOfResultsWithMaxStrengthProperty === results.length;
|
|
9512
|
-
}
|
|
9513
|
-
function findBestMatch(results) {
|
|
9514
|
-
if (!hasEnoughResultsToDetermineBestMatch(results)) {
|
|
9515
|
-
return null;
|
|
9516
|
-
}
|
|
9517
|
-
return results.reduce(function (bestMatch, result) {
|
|
9518
|
-
if (!bestMatch) {
|
|
9519
|
-
return result;
|
|
9520
|
-
}
|
|
9635
|
+
var hasRequiredFindBestMatch;
|
|
9636
|
+
function requireFindBestMatch() {
|
|
9637
|
+
if (hasRequiredFindBestMatch) return findBestMatch;
|
|
9638
|
+
hasRequiredFindBestMatch = 1;
|
|
9639
|
+
Object.defineProperty(findBestMatch, "__esModule", {
|
|
9640
|
+
value: true
|
|
9641
|
+
});
|
|
9642
|
+
findBestMatch.findBestMatch = void 0;
|
|
9643
|
+
function hasEnoughResultsToDetermineBestMatch(results) {
|
|
9644
|
+
var numberOfResultsWithMaxStrengthProperty = results.filter(function (result) {
|
|
9645
|
+
return result.matchStrength;
|
|
9646
|
+
}).length;
|
|
9521
9647
|
/*
|
|
9522
|
-
*
|
|
9523
|
-
*
|
|
9648
|
+
* if all possible results have a maxStrength property that means the card
|
|
9649
|
+
* number is sufficiently long enough to determine conclusively what the card
|
|
9650
|
+
* type is
|
|
9524
9651
|
* */
|
|
9525
|
-
|
|
9526
|
-
|
|
9652
|
+
return numberOfResultsWithMaxStrengthProperty > 0 && numberOfResultsWithMaxStrengthProperty === results.length;
|
|
9653
|
+
}
|
|
9654
|
+
function findBestMatch$1(results) {
|
|
9655
|
+
if (!hasEnoughResultsToDetermineBestMatch(results)) {
|
|
9656
|
+
return null;
|
|
9527
9657
|
}
|
|
9528
|
-
return bestMatch
|
|
9529
|
-
|
|
9658
|
+
return results.reduce(function (bestMatch, result) {
|
|
9659
|
+
if (!bestMatch) {
|
|
9660
|
+
return result;
|
|
9661
|
+
}
|
|
9662
|
+
/*
|
|
9663
|
+
* If the current best match pattern is less specific than this result, set
|
|
9664
|
+
* the result as the new best match
|
|
9665
|
+
* */
|
|
9666
|
+
if (Number(bestMatch.matchStrength) < Number(result.matchStrength)) {
|
|
9667
|
+
return result;
|
|
9668
|
+
}
|
|
9669
|
+
return bestMatch;
|
|
9670
|
+
});
|
|
9671
|
+
}
|
|
9672
|
+
findBestMatch.findBestMatch = findBestMatch$1;
|
|
9673
|
+
return findBestMatch;
|
|
9530
9674
|
}
|
|
9531
|
-
findBestMatch$1.findBestMatch = findBestMatch;
|
|
9532
9675
|
|
|
9533
|
-
var
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9676
|
+
var dist$2;
|
|
9677
|
+
var hasRequiredDist$2;
|
|
9678
|
+
function requireDist$2() {
|
|
9679
|
+
if (hasRequiredDist$2) return dist$2;
|
|
9680
|
+
hasRequiredDist$2 = 1;
|
|
9681
|
+
var __assign = dist$2 && dist$2.__assign || function () {
|
|
9682
|
+
__assign = Object.assign || function (t) {
|
|
9683
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9684
|
+
s = arguments[i];
|
|
9685
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9686
|
+
}
|
|
9687
|
+
return t;
|
|
9688
|
+
};
|
|
9689
|
+
return __assign.apply(this, arguments);
|
|
9540
9690
|
};
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
var
|
|
9544
|
-
var
|
|
9545
|
-
var
|
|
9546
|
-
var
|
|
9547
|
-
var
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
HIPERCARD
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
return (0, clone_1.clone)(findType(cardType));
|
|
9571
|
-
});
|
|
9572
|
-
}
|
|
9573
|
-
function getCardPosition(name, ignoreErrorForNotExisting) {
|
|
9574
|
-
if (ignoreErrorForNotExisting === void 0) {
|
|
9575
|
-
ignoreErrorForNotExisting = false;
|
|
9691
|
+
var cardTypes = requireCardTypes();
|
|
9692
|
+
var add_matching_cards_to_results_1 = requireAddMatchingCardsToResults();
|
|
9693
|
+
var is_valid_input_type_1 = requireIsValidInputType();
|
|
9694
|
+
var find_best_match_1 = requireFindBestMatch();
|
|
9695
|
+
var clone_1 = requireClone();
|
|
9696
|
+
var customCards = {};
|
|
9697
|
+
var cardNames = {
|
|
9698
|
+
VISA: "visa",
|
|
9699
|
+
MASTERCARD: "mastercard",
|
|
9700
|
+
AMERICAN_EXPRESS: "american-express",
|
|
9701
|
+
DINERS_CLUB: "diners-club",
|
|
9702
|
+
DISCOVER: "discover",
|
|
9703
|
+
JCB: "jcb",
|
|
9704
|
+
UNIONPAY: "unionpay",
|
|
9705
|
+
MAESTRO: "maestro",
|
|
9706
|
+
ELO: "elo",
|
|
9707
|
+
MIR: "mir",
|
|
9708
|
+
HIPER: "hiper",
|
|
9709
|
+
HIPERCARD: "hipercard"
|
|
9710
|
+
};
|
|
9711
|
+
var ORIGINAL_TEST_ORDER = [cardNames.VISA, cardNames.MASTERCARD, cardNames.AMERICAN_EXPRESS, cardNames.DINERS_CLUB, cardNames.DISCOVER, cardNames.JCB, cardNames.UNIONPAY, cardNames.MAESTRO, cardNames.ELO, cardNames.MIR, cardNames.HIPER, cardNames.HIPERCARD];
|
|
9712
|
+
var testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);
|
|
9713
|
+
function findType(cardType) {
|
|
9714
|
+
return customCards[cardType] || cardTypes[cardType];
|
|
9715
|
+
}
|
|
9716
|
+
function getAllCardTypes() {
|
|
9717
|
+
return testOrder.map(function (cardType) {
|
|
9718
|
+
return (0, clone_1.clone)(findType(cardType));
|
|
9719
|
+
});
|
|
9576
9720
|
}
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9721
|
+
function getCardPosition(name, ignoreErrorForNotExisting) {
|
|
9722
|
+
if (ignoreErrorForNotExisting === void 0) {
|
|
9723
|
+
ignoreErrorForNotExisting = false;
|
|
9724
|
+
}
|
|
9725
|
+
var position = testOrder.indexOf(name);
|
|
9726
|
+
if (!ignoreErrorForNotExisting && position === -1) {
|
|
9727
|
+
throw new Error('"' + name + '" is not a supported card type.');
|
|
9728
|
+
}
|
|
9729
|
+
return position;
|
|
9580
9730
|
}
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9731
|
+
function creditCardType(cardNumber) {
|
|
9732
|
+
var results = [];
|
|
9733
|
+
if (!(0, is_valid_input_type_1.isValidInputType)(cardNumber)) {
|
|
9734
|
+
return results;
|
|
9735
|
+
}
|
|
9736
|
+
if (cardNumber.length === 0) {
|
|
9737
|
+
return getAllCardTypes();
|
|
9738
|
+
}
|
|
9739
|
+
testOrder.forEach(function (cardType) {
|
|
9740
|
+
var cardConfiguration = findType(cardType);
|
|
9741
|
+
(0, add_matching_cards_to_results_1.addMatchingCardsToResults)(cardNumber, cardConfiguration, results);
|
|
9742
|
+
});
|
|
9743
|
+
var bestMatch = (0, find_best_match_1.findBestMatch)(results);
|
|
9744
|
+
if (bestMatch) {
|
|
9745
|
+
return [bestMatch];
|
|
9746
|
+
}
|
|
9586
9747
|
return results;
|
|
9587
9748
|
}
|
|
9588
|
-
|
|
9589
|
-
return
|
|
9590
|
-
}
|
|
9591
|
-
|
|
9592
|
-
var
|
|
9593
|
-
|
|
9594
|
-
}
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9749
|
+
creditCardType.getTypeInfo = function (cardType) {
|
|
9750
|
+
return (0, clone_1.clone)(findType(cardType));
|
|
9751
|
+
};
|
|
9752
|
+
creditCardType.removeCard = function (name) {
|
|
9753
|
+
var position = getCardPosition(name);
|
|
9754
|
+
testOrder.splice(position, 1);
|
|
9755
|
+
};
|
|
9756
|
+
creditCardType.addCard = function (config) {
|
|
9757
|
+
var existingCardPosition = getCardPosition(config.type, true);
|
|
9758
|
+
customCards[config.type] = config;
|
|
9759
|
+
if (existingCardPosition === -1) {
|
|
9760
|
+
testOrder.push(config.type);
|
|
9761
|
+
}
|
|
9762
|
+
};
|
|
9763
|
+
creditCardType.updateCard = function (cardType, updates) {
|
|
9764
|
+
var originalObject = customCards[cardType] || cardTypes[cardType];
|
|
9765
|
+
if (!originalObject) {
|
|
9766
|
+
throw new Error("\"".concat(cardType, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
9767
|
+
}
|
|
9768
|
+
if (updates.type && originalObject.type !== updates.type) {
|
|
9769
|
+
throw new Error("Cannot overwrite type parameter.");
|
|
9770
|
+
}
|
|
9771
|
+
var clonedCard = (0, clone_1.clone)(originalObject);
|
|
9772
|
+
clonedCard = __assign(__assign({}, clonedCard), updates);
|
|
9773
|
+
customCards[clonedCard.type] = clonedCard;
|
|
9774
|
+
};
|
|
9775
|
+
creditCardType.changeOrder = function (name, position) {
|
|
9776
|
+
var currentPosition = getCardPosition(name);
|
|
9777
|
+
testOrder.splice(currentPosition, 1);
|
|
9778
|
+
testOrder.splice(position, 0, name);
|
|
9779
|
+
};
|
|
9780
|
+
creditCardType.resetModifications = function () {
|
|
9781
|
+
testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);
|
|
9782
|
+
customCards = {};
|
|
9783
|
+
};
|
|
9784
|
+
creditCardType.types = cardNames;
|
|
9785
|
+
dist$2 = creditCardType;
|
|
9786
|
+
return dist$2;
|
|
9600
9787
|
}
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
creditCardType.removeCard = function (name) {
|
|
9605
|
-
var position = getCardPosition(name);
|
|
9606
|
-
testOrder.splice(position, 1);
|
|
9607
|
-
};
|
|
9608
|
-
creditCardType.addCard = function (config) {
|
|
9609
|
-
var existingCardPosition = getCardPosition(config.type, true);
|
|
9610
|
-
customCards[config.type] = config;
|
|
9611
|
-
if (existingCardPosition === -1) {
|
|
9612
|
-
testOrder.push(config.type);
|
|
9613
|
-
}
|
|
9614
|
-
};
|
|
9615
|
-
creditCardType.updateCard = function (cardType, updates) {
|
|
9616
|
-
var originalObject = customCards[cardType] || cardTypes[cardType];
|
|
9617
|
-
if (!originalObject) {
|
|
9618
|
-
throw new Error("\"".concat(cardType, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
9619
|
-
}
|
|
9620
|
-
if (updates.type && originalObject.type !== updates.type) {
|
|
9621
|
-
throw new Error("Cannot overwrite type parameter.");
|
|
9622
|
-
}
|
|
9623
|
-
var clonedCard = (0, clone_1.clone)(originalObject);
|
|
9624
|
-
clonedCard = __assign$8(__assign$8({}, clonedCard), updates);
|
|
9625
|
-
customCards[clonedCard.type] = clonedCard;
|
|
9626
|
-
};
|
|
9627
|
-
creditCardType.changeOrder = function (name, position) {
|
|
9628
|
-
var currentPosition = getCardPosition(name);
|
|
9629
|
-
testOrder.splice(currentPosition, 1);
|
|
9630
|
-
testOrder.splice(position, 0, name);
|
|
9631
|
-
};
|
|
9632
|
-
creditCardType.resetModifications = function () {
|
|
9633
|
-
testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);
|
|
9634
|
-
customCards = {};
|
|
9635
|
-
};
|
|
9636
|
-
creditCardType.types = cardNames;
|
|
9637
|
-
var dist$2 = creditCardType;
|
|
9638
|
-
var creditCardType$1 = /*@__PURE__*/getDefaultExportFromCjs(dist$2);
|
|
9788
|
+
|
|
9789
|
+
var distExports$2 = requireDist$2();
|
|
9790
|
+
var creditCardType = /*@__PURE__*/getDefaultExportFromCjs(distExports$2);
|
|
9639
9791
|
|
|
9640
9792
|
var __assign$7 = undefined && undefined.__assign || function () {
|
|
9641
9793
|
__assign$7 = Object.assign || function (t) {
|
|
@@ -9829,27 +9981,41 @@ var dist$1 = {};
|
|
|
9829
9981
|
|
|
9830
9982
|
var mapCursorToMax = {};
|
|
9831
9983
|
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
if (cursor >= 0) return cursor % max;
|
|
9838
|
-
var modulo = cursor % max;
|
|
9839
|
-
if (modulo === 0) return Math.abs(modulo); // -0
|
|
9840
|
-
return modulo + max;
|
|
9841
|
-
};
|
|
9842
|
-
|
|
9843
|
-
(function (exports) {
|
|
9844
|
-
|
|
9845
|
-
function __export(m) {
|
|
9846
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
9847
|
-
}
|
|
9848
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9984
|
+
var hasRequiredMapCursorToMax;
|
|
9985
|
+
function requireMapCursorToMax() {
|
|
9986
|
+
if (hasRequiredMapCursorToMax) return mapCursorToMax;
|
|
9987
|
+
hasRequiredMapCursorToMax = 1;
|
|
9988
|
+
Object.defineProperty(mapCursorToMax, "__esModule", {
|
|
9849
9989
|
value: true
|
|
9850
9990
|
});
|
|
9851
|
-
|
|
9852
|
-
|
|
9991
|
+
mapCursorToMax.mapCursorToMax = function (cursor, max) {
|
|
9992
|
+
if (max === 0) return 0;
|
|
9993
|
+
if (cursor >= 0) return cursor % max;
|
|
9994
|
+
var modulo = cursor % max;
|
|
9995
|
+
if (modulo === 0) return Math.abs(modulo); // -0
|
|
9996
|
+
return modulo + max;
|
|
9997
|
+
};
|
|
9998
|
+
return mapCursorToMax;
|
|
9999
|
+
}
|
|
10000
|
+
|
|
10001
|
+
var hasRequiredDist$1;
|
|
10002
|
+
function requireDist$1() {
|
|
10003
|
+
if (hasRequiredDist$1) return dist$1;
|
|
10004
|
+
hasRequiredDist$1 = 1;
|
|
10005
|
+
(function (exports) {
|
|
10006
|
+
|
|
10007
|
+
function __export(m) {
|
|
10008
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
10009
|
+
}
|
|
10010
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10011
|
+
value: true
|
|
10012
|
+
});
|
|
10013
|
+
__export(requireMapCursorToMax());
|
|
10014
|
+
})(dist$1);
|
|
10015
|
+
return dist$1;
|
|
10016
|
+
}
|
|
10017
|
+
|
|
10018
|
+
var distExports$1 = requireDist$1();
|
|
9853
10019
|
|
|
9854
10020
|
var reducer$1 = function reducer(state, action) {
|
|
9855
10021
|
switch (action.type) {
|
|
@@ -9913,7 +10079,7 @@ var useKeyboardListNavigation = function useKeyboardListNavigation(_ref) {
|
|
|
9913
10079
|
dispatch = _useReducer2[1];
|
|
9914
10080
|
var searchTerm = useRef('');
|
|
9915
10081
|
var idleTimeout = useRef(null);
|
|
9916
|
-
var index =
|
|
10082
|
+
var index = distExports$1.mapCursorToMax(state.cursor, list.length);
|
|
9917
10083
|
var handleKeyDown = useCallback(function (event) {
|
|
9918
10084
|
switch (event.key) {
|
|
9919
10085
|
case 'ArrowUp':
|
|
@@ -10134,7 +10300,8 @@ var Search20 = function Search20(_a) {
|
|
|
10134
10300
|
};
|
|
10135
10301
|
Search20.displayName = 'Search20';
|
|
10136
10302
|
|
|
10137
|
-
var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value"];
|
|
10303
|
+
var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value", "searchIconSize"];
|
|
10304
|
+
var SEARCH_ICON_DEFAULT_SIZE = 20;
|
|
10138
10305
|
var DEFAULT_INPUT_VALUE = '';
|
|
10139
10306
|
var SearchInput = function SearchInput(_ref) {
|
|
10140
10307
|
var className = _ref.className,
|
|
@@ -10146,6 +10313,8 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
10146
10313
|
noBorders = _ref$noBorders === void 0 ? false : _ref$noBorders,
|
|
10147
10314
|
_ref$value = _ref.value,
|
|
10148
10315
|
value = _ref$value === void 0 ? DEFAULT_INPUT_VALUE : _ref$value,
|
|
10316
|
+
_ref$searchIconSize = _ref.searchIconSize,
|
|
10317
|
+
searchIconSize = _ref$searchIconSize === void 0 ? SEARCH_ICON_DEFAULT_SIZE : _ref$searchIconSize,
|
|
10149
10318
|
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
10150
10319
|
var ref = useRef(null);
|
|
10151
10320
|
var _useState = useState(value),
|
|
@@ -10170,7 +10339,10 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
10170
10339
|
className: classNames('SearchInput', className)
|
|
10171
10340
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10172
10341
|
className: "SearchInput__icon"
|
|
10173
|
-
}, /*#__PURE__*/React__default.createElement(Search20,
|
|
10342
|
+
}, /*#__PURE__*/React__default.createElement(Search20, {
|
|
10343
|
+
height: "".concat(searchIconSize, "px"),
|
|
10344
|
+
width: "".concat(searchIconSize, "px")
|
|
10345
|
+
})), /*#__PURE__*/React__default.createElement(TextInput, _extends$1({
|
|
10174
10346
|
className: classNames('SearchInput__input', {
|
|
10175
10347
|
'SearchInput__input--round-borders': roundBorders,
|
|
10176
10348
|
'SearchInput__input--no-borders': noBorders
|
|
@@ -10930,7 +11102,7 @@ var CreditCardNumberInput = function CreditCardNumberInput(_ref) {
|
|
|
10930
11102
|
value = _useState2[0],
|
|
10931
11103
|
setValue = _useState2[1];
|
|
10932
11104
|
var mask = useMemo(function () {
|
|
10933
|
-
var cardType = creditCardType
|
|
11105
|
+
var cardType = creditCardType(value)[0];
|
|
10934
11106
|
if (!cardType) return DEFAULT_MASK;
|
|
10935
11107
|
var gaps = cardType.gaps,
|
|
10936
11108
|
lengths = cardType.lengths;
|
|
@@ -11077,53 +11249,67 @@ var dist = {};
|
|
|
11077
11249
|
|
|
11078
11250
|
var useCursor = {};
|
|
11079
11251
|
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
return
|
|
11098
|
-
});
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
});
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11252
|
+
var hasRequiredUseCursor;
|
|
11253
|
+
function requireUseCursor() {
|
|
11254
|
+
if (hasRequiredUseCursor) return useCursor;
|
|
11255
|
+
hasRequiredUseCursor = 1;
|
|
11256
|
+
Object.defineProperty(useCursor, "__esModule", {
|
|
11257
|
+
value: true
|
|
11258
|
+
});
|
|
11259
|
+
var react_1 = React__default;
|
|
11260
|
+
var map_cursor_to_max_1 = requireDist$1();
|
|
11261
|
+
useCursor.useCursor = function (_a) {
|
|
11262
|
+
var max = _a.max,
|
|
11263
|
+
_b = _a.initialCursor,
|
|
11264
|
+
initialCursor = _b === void 0 ? 0 : _b;
|
|
11265
|
+
var _c = react_1.useState(initialCursor),
|
|
11266
|
+
cursor = _c[0],
|
|
11267
|
+
setCursor = _c[1];
|
|
11268
|
+
react_1.useEffect(function () {
|
|
11269
|
+
return setCursor(initialCursor);
|
|
11270
|
+
}, [initialCursor]);
|
|
11271
|
+
var handlePrev = react_1.useCallback(function () {
|
|
11272
|
+
return setCursor(function (n) {
|
|
11273
|
+
return n - 1;
|
|
11274
|
+
});
|
|
11275
|
+
}, []);
|
|
11276
|
+
var handleNext = react_1.useCallback(function () {
|
|
11277
|
+
return setCursor(function (n) {
|
|
11278
|
+
return n + 1;
|
|
11279
|
+
});
|
|
11280
|
+
}, []);
|
|
11281
|
+
var index = react_1.useMemo(function () {
|
|
11282
|
+
return map_cursor_to_max_1.mapCursorToMax(cursor, max);
|
|
11283
|
+
}, [cursor, max]);
|
|
11284
|
+
return {
|
|
11285
|
+
handlePrev: handlePrev,
|
|
11286
|
+
handleNext: handleNext,
|
|
11287
|
+
setCursor: setCursor,
|
|
11288
|
+
cursor: cursor,
|
|
11289
|
+
index: index
|
|
11290
|
+
};
|
|
11114
11291
|
};
|
|
11115
|
-
|
|
11292
|
+
return useCursor;
|
|
11293
|
+
}
|
|
11116
11294
|
|
|
11117
|
-
|
|
11295
|
+
var hasRequiredDist;
|
|
11296
|
+
function requireDist() {
|
|
11297
|
+
if (hasRequiredDist) return dist;
|
|
11298
|
+
hasRequiredDist = 1;
|
|
11299
|
+
(function (exports) {
|
|
11118
11300
|
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
})(dist);
|
|
11301
|
+
function __export(m) {
|
|
11302
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
11303
|
+
}
|
|
11304
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11305
|
+
value: true
|
|
11306
|
+
});
|
|
11307
|
+
__export(requireUseCursor());
|
|
11308
|
+
})(dist);
|
|
11309
|
+
return dist;
|
|
11310
|
+
}
|
|
11311
|
+
|
|
11312
|
+
var distExports = requireDist();
|
|
11127
11313
|
|
|
11128
11314
|
var Window = function Window(props) {
|
|
11129
11315
|
return /*#__PURE__*/React__default.createElement("svg", _extends$1({
|
|
@@ -11266,7 +11452,7 @@ var FRAMES = [Triangle, Diamond, ArcWindow, Circle];
|
|
|
11266
11452
|
var Loading = function Loading(_ref) {
|
|
11267
11453
|
var className = _ref.className,
|
|
11268
11454
|
rest = _objectWithoutProperties(_ref, _excluded$a);
|
|
11269
|
-
var _useCursor =
|
|
11455
|
+
var _useCursor = distExports.useCursor({
|
|
11270
11456
|
max: FRAMES.length
|
|
11271
11457
|
}),
|
|
11272
11458
|
index = _useCursor.index,
|
|
@@ -11342,7 +11528,7 @@ var LoadingBalls = function LoadingBalls(_ref) {
|
|
|
11342
11528
|
var INTERVAL_MS = 250;
|
|
11343
11529
|
var LoadingShapes = function LoadingShapes() {
|
|
11344
11530
|
var items = [Triangle, Diamond, ArcWindow, Circle];
|
|
11345
|
-
var _useCursor =
|
|
11531
|
+
var _useCursor = distExports.useCursor({
|
|
11346
11532
|
max: items.length
|
|
11347
11533
|
}),
|
|
11348
11534
|
index = _useCursor.index,
|
|
@@ -12041,10 +12227,10 @@ var VerticalDivider = function VerticalDivider(_ref) {
|
|
|
12041
12227
|
};
|
|
12042
12228
|
|
|
12043
12229
|
var tokens = {
|
|
12044
|
-
colors:
|
|
12045
|
-
typography:
|
|
12046
|
-
space:
|
|
12047
|
-
breakpoints:
|
|
12230
|
+
colors: distExports$4.colors,
|
|
12231
|
+
typography: distExports$4.typography,
|
|
12232
|
+
space: distExports$4.space,
|
|
12233
|
+
breakpoints: distExports$4.breakpoints
|
|
12048
12234
|
};
|
|
12049
12235
|
var Utilities = {
|
|
12050
12236
|
States: States
|