1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
6 |
|
7 | require('./slicedToArray-0711941d.js');
|
8 | require('./unsupportedIterableToArray-68db1d3b.js');
|
9 | var React = require('react');
|
10 | var React__default = _interopDefault(React);
|
11 | require('./_commonjsHelpers-72d386ba.js');
|
12 | var index = require('./index-b0606964.js');
|
13 | var defineProperty$1 = require('./defineProperty-0921a47c.js');
|
14 | var toConsumableArray = require('./toConsumableArray-d8a4a2c3.js');
|
15 | var _styled = require('styled-components');
|
16 | var _styled__default = _interopDefault(_styled);
|
17 | var getPrototypeOf = require('./getPrototypeOf-2a661a20.js');
|
18 | require('./color.js');
|
19 | require('./components.js');
|
20 | require('./contains-component.js');
|
21 | var css = require('./css.js');
|
22 | var dayjs_min = require('./dayjs.min-e07657bf.js');
|
23 | var date = require('./date.js');
|
24 | require('./miscellaneous.js');
|
25 | require('./environment.js');
|
26 | require('./font.js');
|
27 | require('./math-f4029164.js');
|
28 | require('./characters.js');
|
29 | require('./format.js');
|
30 | require('./keycodes.js');
|
31 | require('./url.js');
|
32 | require('./web3.js');
|
33 | var constants = require('./constants.js');
|
34 | require('./breakpoints.js');
|
35 | require('./springs.js');
|
36 | var textStyles = require('./text-styles.js');
|
37 | require('./theme-dark.js');
|
38 | require('./theme-light.js');
|
39 | var Theme = require('./Theme.js');
|
40 | var _extends$1 = require('./extends-40571110.js');
|
41 | require('./objectWithoutProperties-35db8ab0.js');
|
42 | require('./index-ecc57c9f.js');
|
43 | var isObject = require('./isObject-ec755c87.js');
|
44 | require('./IconPropTypes-56de5759.js');
|
45 | require('./IconAddUser.js');
|
46 | require('./IconAlert.js');
|
47 | require('./IconAlignCenter.js');
|
48 | require('./IconAlignJustify.js');
|
49 | require('./IconAlignLeft.js');
|
50 | require('./IconAlignRight.js');
|
51 | require('./IconAragon.js');
|
52 | require('./IconArrowDown.js');
|
53 | require('./IconArrowLeft.js');
|
54 | require('./IconArrowRight.js');
|
55 | require('./IconArrowUp.js');
|
56 | require('./IconAtSign.js');
|
57 | require('./IconBlock.js');
|
58 | require('./IconBookmark.js');
|
59 | require('./IconCalendar.js');
|
60 | require('./IconCanvas.js');
|
61 | require('./IconCaution.js');
|
62 | require('./IconCenter.js');
|
63 | require('./IconChart.js');
|
64 | require('./IconChat.js');
|
65 | require('./IconCheck.js');
|
66 | require('./IconChip.js');
|
67 | require('./IconCircleCheck.js');
|
68 | require('./IconCircleMinus.js');
|
69 | require('./IconCirclePlus.js');
|
70 | var IconClock = require('./IconClock.js');
|
71 | require('./IconCloudDownload.js');
|
72 | require('./IconCloudUpload.js');
|
73 | require('./IconCoin.js');
|
74 | require('./IconConfiguration.js');
|
75 | require('./IconConnect.js');
|
76 | require('./IconConnection.js');
|
77 | require('./IconConsole.js');
|
78 | require('./IconCopy.js');
|
79 | require('./IconCross.js');
|
80 | require('./IconDashedSquare.js');
|
81 | require('./IconDown.js');
|
82 | require('./IconDownload.js');
|
83 | require('./IconEdit.js');
|
84 | require('./IconEllipsis.js');
|
85 | require('./IconEnter.js');
|
86 | require('./IconEthereum.js');
|
87 | require('./IconExternal.js');
|
88 | require('./IconFile.js');
|
89 | require('./IconFilter.js');
|
90 | require('./IconFlag.js');
|
91 | require('./IconFolder.js');
|
92 | require('./IconGraph2.js');
|
93 | require('./IconGraph.js');
|
94 | require('./IconGrid.js');
|
95 | require('./IconGroup.js');
|
96 | require('./IconHash.js');
|
97 | require('./IconHeart.js');
|
98 | require('./IconHide.js');
|
99 | require('./IconHome.js');
|
100 | require('./IconImage.js');
|
101 | require('./IconInfo.js');
|
102 | require('./IconLabel.js');
|
103 | require('./IconLayers.js');
|
104 | require('./IconLeft.js');
|
105 | require('./IconLink.js');
|
106 | require('./IconLocation.js');
|
107 | require('./IconLock.js');
|
108 | require('./IconMail.js');
|
109 | require('./IconMaximize.js');
|
110 | require('./IconMenu.js');
|
111 | require('./IconMinimize.js');
|
112 | require('./IconMinus.js');
|
113 | require('./IconMove.js');
|
114 | require('./IconNoPicture.js');
|
115 | require('./IconPicture.js');
|
116 | require('./IconPlus.js');
|
117 | require('./IconPower.js');
|
118 | require('./IconPrint.js');
|
119 | require('./IconProhibited.js');
|
120 | require('./IconQuestion.js');
|
121 | require('./IconRefresh.js');
|
122 | require('./IconRemoveUser.js');
|
123 | require('./IconRight.js');
|
124 | require('./IconRotateLeft.js');
|
125 | require('./IconRotateRight.js');
|
126 | require('./IconSearch.js');
|
127 | require('./IconSettings.js');
|
128 | require('./IconShare.js');
|
129 | require('./IconSquareMinus.js');
|
130 | require('./IconSquarePlus.js');
|
131 | require('./IconSquare.js');
|
132 | require('./IconStarFilled.js');
|
133 | require('./IconStar.js');
|
134 | require('./IconSwap.js');
|
135 | require('./IconTarget.js');
|
136 | require('./IconToken.js');
|
137 | require('./IconTrash.js');
|
138 | require('./IconUnlock.js');
|
139 | require('./IconUp.js');
|
140 | require('./IconUpload.js');
|
141 | require('./IconUser.js');
|
142 | require('./IconView.js');
|
143 | require('./IconVote.js');
|
144 | require('./IconWallet.js');
|
145 | require('./IconWarning.js');
|
146 | require('./IconWorld.js');
|
147 | require('./IconWrite.js');
|
148 | require('./IconZoomIn.js');
|
149 | require('./IconZoomOut.js');
|
150 | require('./getDisplayName-7ab6d318.js');
|
151 | var index$1$2 = require('./index-030bfca8.js');
|
152 |
|
153 |
|
154 | var asyncTag = '[object AsyncFunction]',
|
155 | funcTag = '[object Function]',
|
156 | genTag = '[object GeneratorFunction]',
|
157 | proxyTag = '[object Proxy]';
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | function isFunction(value) {
|
177 | if (!isObject.isObject(value)) {
|
178 | return false;
|
179 | }
|
180 |
|
181 |
|
182 | var tag = isObject.baseGetTag(value);
|
183 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
184 | }
|
185 |
|
186 | var isFunction_1 = isFunction;
|
187 |
|
188 |
|
189 | var coreJsData = isObject.root['__core-js_shared__'];
|
190 |
|
191 | var _coreJsData = coreJsData;
|
192 |
|
193 |
|
194 | var maskSrcKey = (function() {
|
195 | var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
196 | return uid ? ('Symbol(src)_1.' + uid) : '';
|
197 | }());
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 | function isMasked(func) {
|
207 | return !!maskSrcKey && (maskSrcKey in func);
|
208 | }
|
209 |
|
210 | var _isMasked = isMasked;
|
211 |
|
212 |
|
213 | var funcProto = Function.prototype;
|
214 |
|
215 |
|
216 | var funcToString = funcProto.toString;
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 | function toSource(func) {
|
226 | if (func != null) {
|
227 | try {
|
228 | return funcToString.call(func);
|
229 | } catch (e) {}
|
230 | try {
|
231 | return (func + '');
|
232 | } catch (e) {}
|
233 | }
|
234 | return '';
|
235 | }
|
236 |
|
237 | var _toSource = toSource;
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
244 |
|
245 |
|
246 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
247 |
|
248 |
|
249 | var funcProto$1 = Function.prototype,
|
250 | objectProto = Object.prototype;
|
251 |
|
252 |
|
253 | var funcToString$1 = funcProto$1.toString;
|
254 |
|
255 |
|
256 | var hasOwnProperty = objectProto.hasOwnProperty;
|
257 |
|
258 |
|
259 | var reIsNative = RegExp('^' +
|
260 | funcToString$1.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
261 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
262 | );
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 | function baseIsNative(value) {
|
273 | if (!isObject.isObject(value) || _isMasked(value)) {
|
274 | return false;
|
275 | }
|
276 | var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
277 | return pattern.test(_toSource(value));
|
278 | }
|
279 |
|
280 | var _baseIsNative = baseIsNative;
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 | function getValue(object, key) {
|
291 | return object == null ? undefined : object[key];
|
292 | }
|
293 |
|
294 | var _getValue = getValue;
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 | function getNative(object, key) {
|
305 | var value = _getValue(object, key);
|
306 | return _baseIsNative(value) ? value : undefined;
|
307 | }
|
308 |
|
309 | var _getNative = getNative;
|
310 |
|
311 |
|
312 | var nativeCreate = _getNative(Object, 'create');
|
313 |
|
314 | var _nativeCreate = nativeCreate;
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 | function hashClear() {
|
324 | this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
325 | this.size = 0;
|
326 | }
|
327 |
|
328 | var _hashClear = hashClear;
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 | function hashDelete(key) {
|
341 | var result = this.has(key) && delete this.__data__[key];
|
342 | this.size -= result ? 1 : 0;
|
343 | return result;
|
344 | }
|
345 |
|
346 | var _hashDelete = hashDelete;
|
347 |
|
348 |
|
349 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
350 |
|
351 |
|
352 | var objectProto$1 = Object.prototype;
|
353 |
|
354 |
|
355 | var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 | function hashGet(key) {
|
367 | var data = this.__data__;
|
368 | if (_nativeCreate) {
|
369 | var result = data[key];
|
370 | return result === HASH_UNDEFINED ? undefined : result;
|
371 | }
|
372 | return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
373 | }
|
374 |
|
375 | var _hashGet = hashGet;
|
376 |
|
377 |
|
378 | var objectProto$2 = Object.prototype;
|
379 |
|
380 |
|
381 | var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | function hashHas(key) {
|
393 | var data = this.__data__;
|
394 | return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$2.call(data, key);
|
395 | }
|
396 |
|
397 | var _hashHas = hashHas;
|
398 |
|
399 |
|
400 | var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 | function hashSet(key, value) {
|
413 | var data = this.__data__;
|
414 | this.size += this.has(key) ? 0 : 1;
|
415 | data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
|
416 | return this;
|
417 | }
|
418 |
|
419 | var _hashSet = hashSet;
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 | function Hash(entries) {
|
429 | var index = -1,
|
430 | length = entries == null ? 0 : entries.length;
|
431 |
|
432 | this.clear();
|
433 | while (++index < length) {
|
434 | var entry = entries[index];
|
435 | this.set(entry[0], entry[1]);
|
436 | }
|
437 | }
|
438 |
|
439 |
|
440 | Hash.prototype.clear = _hashClear;
|
441 | Hash.prototype['delete'] = _hashDelete;
|
442 | Hash.prototype.get = _hashGet;
|
443 | Hash.prototype.has = _hashHas;
|
444 | Hash.prototype.set = _hashSet;
|
445 |
|
446 | var _Hash = Hash;
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 | function listCacheClear() {
|
456 | this.__data__ = [];
|
457 | this.size = 0;
|
458 | }
|
459 |
|
460 | var _listCacheClear = listCacheClear;
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 | function eq(value, other) {
|
495 | return value === other || (value !== value && other !== other);
|
496 | }
|
497 |
|
498 | var eq_1 = eq;
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 | function assocIndexOf(array, key) {
|
509 | var length = array.length;
|
510 | while (length--) {
|
511 | if (eq_1(array[length][0], key)) {
|
512 | return length;
|
513 | }
|
514 | }
|
515 | return -1;
|
516 | }
|
517 |
|
518 | var _assocIndexOf = assocIndexOf;
|
519 |
|
520 |
|
521 | var arrayProto = Array.prototype;
|
522 |
|
523 |
|
524 | var splice = arrayProto.splice;
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 | function listCacheDelete(key) {
|
536 | var data = this.__data__,
|
537 | index = _assocIndexOf(data, key);
|
538 |
|
539 | if (index < 0) {
|
540 | return false;
|
541 | }
|
542 | var lastIndex = data.length - 1;
|
543 | if (index == lastIndex) {
|
544 | data.pop();
|
545 | } else {
|
546 | splice.call(data, index, 1);
|
547 | }
|
548 | --this.size;
|
549 | return true;
|
550 | }
|
551 |
|
552 | var _listCacheDelete = listCacheDelete;
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 | function listCacheGet(key) {
|
564 | var data = this.__data__,
|
565 | index = _assocIndexOf(data, key);
|
566 |
|
567 | return index < 0 ? undefined : data[index][1];
|
568 | }
|
569 |
|
570 | var _listCacheGet = listCacheGet;
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 | function listCacheHas(key) {
|
582 | return _assocIndexOf(this.__data__, key) > -1;
|
583 | }
|
584 |
|
585 | var _listCacheHas = listCacheHas;
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 | function listCacheSet(key, value) {
|
598 | var data = this.__data__,
|
599 | index = _assocIndexOf(data, key);
|
600 |
|
601 | if (index < 0) {
|
602 | ++this.size;
|
603 | data.push([key, value]);
|
604 | } else {
|
605 | data[index][1] = value;
|
606 | }
|
607 | return this;
|
608 | }
|
609 |
|
610 | var _listCacheSet = listCacheSet;
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 | function ListCache(entries) {
|
620 | var index = -1,
|
621 | length = entries == null ? 0 : entries.length;
|
622 |
|
623 | this.clear();
|
624 | while (++index < length) {
|
625 | var entry = entries[index];
|
626 | this.set(entry[0], entry[1]);
|
627 | }
|
628 | }
|
629 |
|
630 |
|
631 | ListCache.prototype.clear = _listCacheClear;
|
632 | ListCache.prototype['delete'] = _listCacheDelete;
|
633 | ListCache.prototype.get = _listCacheGet;
|
634 | ListCache.prototype.has = _listCacheHas;
|
635 | ListCache.prototype.set = _listCacheSet;
|
636 |
|
637 | var _ListCache = ListCache;
|
638 |
|
639 |
|
640 | var Map = _getNative(isObject.root, 'Map');
|
641 |
|
642 | var _Map = Map;
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 | function mapCacheClear() {
|
652 | this.size = 0;
|
653 | this.__data__ = {
|
654 | 'hash': new _Hash,
|
655 | 'map': new (_Map || _ListCache),
|
656 | 'string': new _Hash
|
657 | };
|
658 | }
|
659 |
|
660 | var _mapCacheClear = mapCacheClear;
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 | function isKeyable(value) {
|
670 | var type = typeof value;
|
671 | return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
672 | ? (value !== '__proto__')
|
673 | : (value === null);
|
674 | }
|
675 |
|
676 | var _isKeyable = isKeyable;
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 | function getMapData(map, key) {
|
687 | var data = map.__data__;
|
688 | return _isKeyable(key)
|
689 | ? data[typeof key == 'string' ? 'string' : 'hash']
|
690 | : data.map;
|
691 | }
|
692 |
|
693 | var _getMapData = getMapData;
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 | function mapCacheDelete(key) {
|
705 | var result = _getMapData(this, key)['delete'](key);
|
706 | this.size -= result ? 1 : 0;
|
707 | return result;
|
708 | }
|
709 |
|
710 | var _mapCacheDelete = mapCacheDelete;
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 | function mapCacheGet(key) {
|
722 | return _getMapData(this, key).get(key);
|
723 | }
|
724 |
|
725 | var _mapCacheGet = mapCacheGet;
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 | function mapCacheHas(key) {
|
737 | return _getMapData(this, key).has(key);
|
738 | }
|
739 |
|
740 | var _mapCacheHas = mapCacheHas;
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 | function mapCacheSet(key, value) {
|
753 | var data = _getMapData(this, key),
|
754 | size = data.size;
|
755 |
|
756 | data.set(key, value);
|
757 | this.size += data.size == size ? 0 : 1;
|
758 | return this;
|
759 | }
|
760 |
|
761 | var _mapCacheSet = mapCacheSet;
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 | function MapCache(entries) {
|
771 | var index = -1,
|
772 | length = entries == null ? 0 : entries.length;
|
773 |
|
774 | this.clear();
|
775 | while (++index < length) {
|
776 | var entry = entries[index];
|
777 | this.set(entry[0], entry[1]);
|
778 | }
|
779 | }
|
780 |
|
781 |
|
782 | MapCache.prototype.clear = _mapCacheClear;
|
783 | MapCache.prototype['delete'] = _mapCacheDelete;
|
784 | MapCache.prototype.get = _mapCacheGet;
|
785 | MapCache.prototype.has = _mapCacheHas;
|
786 | MapCache.prototype.set = _mapCacheSet;
|
787 |
|
788 | var _MapCache = MapCache;
|
789 |
|
790 |
|
791 | var FUNC_ERROR_TEXT = 'Expected a function';
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 |
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 |
|
833 |
|
834 |
|
835 |
|
836 |
|
837 | function memoize(func, resolver) {
|
838 | if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
839 | throw new TypeError(FUNC_ERROR_TEXT);
|
840 | }
|
841 | var memoized = function() {
|
842 | var args = arguments,
|
843 | key = resolver ? resolver.apply(this, args) : args[0],
|
844 | cache = memoized.cache;
|
845 |
|
846 | if (cache.has(key)) {
|
847 | return cache.get(key);
|
848 | }
|
849 | var result = func.apply(this, args);
|
850 | memoized.cache = cache.set(key, result) || cache;
|
851 | return result;
|
852 | };
|
853 | memoized.cache = new (memoize.Cache || _MapCache);
|
854 | return memoized;
|
855 | }
|
856 |
|
857 |
|
858 | memoize.Cache = _MapCache;
|
859 |
|
860 | var memoize_1 = memoize;
|
861 |
|
862 | function _createSuper(Derived) { return function () { var Super = getPrototypeOf._getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = getPrototypeOf._getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return getPrototypeOf._possibleConstructorReturn(this, result); }; }
|
863 |
|
864 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
865 | var RENDER_EVERY = 1000;
|
866 |
|
867 | var formatUnit = function formatUnit(v) {
|
868 | return String(v).padStart(2, '0');
|
869 | };
|
870 |
|
871 | var formats = {
|
872 | yMdhms: 'yMdhms',
|
873 | yMdhm: 'yMdhm',
|
874 | yMdh: 'yMdh',
|
875 | yMd: 'yMd',
|
876 | yM: 'yM',
|
877 | Mdhms: 'Mdhms',
|
878 | Mdhm: 'Mdhm',
|
879 | Mdh: 'Mdh',
|
880 | Md: 'Md',
|
881 | dhms: 'dhms',
|
882 | dhm: 'dhm',
|
883 | hms: 'hms',
|
884 | hm: 'hm',
|
885 | ms: 'ms',
|
886 | m: 'm',
|
887 | s: 's'
|
888 | };
|
889 | var unitNames = {
|
890 | y: 'years',
|
891 | M: 'months',
|
892 | d: 'days',
|
893 | h: 'hours',
|
894 | m: 'minutes',
|
895 | s: 'seconds'
|
896 | };
|
897 | var getFormat = memoize_1(function (format) {
|
898 | return ['y', 'M', 'd', 'h', 'm', 's'].reduce(function (units, symbol) {
|
899 | return formats[format].includes(symbol) ? [].concat(toConsumableArray._toConsumableArray(units), [unitNames[symbol]]) : units;
|
900 | }, []);
|
901 | });
|
902 |
|
903 | function getTime(start, end, format, showEmpty, maxUnits) {
|
904 | var date1 = end || new Date();
|
905 | var date2 = end ? new Date() : start;
|
906 | var totalInSeconds = dayjs_min.dayjs(date1).diff(date2, 'seconds');
|
907 |
|
908 | var _difference = date.difference(date1, date2, {
|
909 | keepLeadingZeros: showEmpty,
|
910 | maxUnits: maxUnits,
|
911 | units: getFormat(format)
|
912 | }),
|
913 | years = _difference.years,
|
914 | months = _difference.months,
|
915 | days = _difference.days,
|
916 | hours = _difference.hours,
|
917 | minutes = _difference.minutes,
|
918 | seconds = _difference.seconds;
|
919 |
|
920 | return {
|
921 | units: [['Y', years], ['M', months], ['D', days], ['H', hours], ['M', minutes], ['S', seconds]],
|
922 | totalInSeconds: totalInSeconds
|
923 | };
|
924 | }
|
925 |
|
926 | var _StyledTime = _styled__default("time").withConfig({
|
927 | displayName: "Timer___StyledTime",
|
928 | componentId: "sc-58hkwl-0"
|
929 | })(["display:flex;align-items:center;white-space:nowrap;", ";", ";"], function (p) {
|
930 | return p._css;
|
931 | }, function (p) {
|
932 | return p._css2;
|
933 | });
|
934 |
|
935 | var _StyledSpan = _styled__default("span").withConfig({
|
936 | displayName: "Timer___StyledSpan",
|
937 | componentId: "sc-58hkwl-1"
|
938 | })(["display:flex;align-items:center;margin-right:", "px;margin-top:-3px;"], function (p) {
|
939 | return p._css3;
|
940 | });
|
941 |
|
942 | var _StyledIconTime = _styled__default(IconClock.default).withConfig({
|
943 | displayName: "Timer___StyledIconTime",
|
944 | componentId: "sc-58hkwl-2"
|
945 | })(["color:", ";"], function (p) {
|
946 | return p._css4;
|
947 | });
|
948 |
|
949 | var _StyledSpan2 = _styled__default("span").withConfig({
|
950 | displayName: "Timer___StyledSpan2",
|
951 | componentId: "sc-58hkwl-3"
|
952 | })(["", ";color:", ";"], function (p) {
|
953 | return p._css5;
|
954 | }, function (p) {
|
955 | return p._css6;
|
956 | });
|
957 |
|
958 | var _StyledSpan3 = _styled__default("span").withConfig({
|
959 | displayName: "Timer___StyledSpan3",
|
960 | componentId: "sc-58hkwl-4"
|
961 | })(["color:", ";", ";"], function (p) {
|
962 | return p._css7;
|
963 | }, function (p) {
|
964 | return p._css8;
|
965 | });
|
966 |
|
967 | var _StyledSpan4 = _styled__default("span").withConfig({
|
968 | displayName: "Timer___StyledSpan4",
|
969 | componentId: "sc-58hkwl-5"
|
970 | })(["margin-left:2px;color:", ";"], function (p) {
|
971 | return p._css9;
|
972 | });
|
973 |
|
974 | var _StyledSpan5 = _styled__default("span").withConfig({
|
975 | displayName: "Timer___StyledSpan5",
|
976 | componentId: "sc-58hkwl-6"
|
977 | })(["margin:0 4px;color:", ";font-weight:400;"], function (p) {
|
978 | return p._css10;
|
979 | });
|
980 |
|
981 | var Timer = function (_React$Component) {
|
982 | getPrototypeOf._inherits(Timer, _React$Component);
|
983 |
|
984 | var _super = _createSuper(Timer);
|
985 |
|
986 | function Timer() {
|
987 | var _this;
|
988 |
|
989 | getPrototypeOf._classCallCheck(this, Timer);
|
990 |
|
991 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
992 | args[_key] = arguments[_key];
|
993 | }
|
994 |
|
995 | _this = _super.call.apply(_super, [this].concat(args));
|
996 |
|
997 | defineProperty$1._defineProperty(getPrototypeOf._assertThisInitialized(_this), "renderTime", function () {
|
998 | var _this$props = _this.props,
|
999 | start = _this$props.start,
|
1000 | end = _this$props.end,
|
1001 | theme = _this$props.theme,
|
1002 | format = _this$props.format,
|
1003 | showEmpty = _this$props.showEmpty,
|
1004 | maxUnits = _this$props.maxUnits;
|
1005 |
|
1006 | var _getTime = getTime(start, end, format, showEmpty, maxUnits),
|
1007 | totalInSeconds = _getTime.totalInSeconds,
|
1008 | units = _getTime.units;
|
1009 |
|
1010 | if (totalInSeconds < 0 || Object.is(totalInSeconds, -0)) {
|
1011 | return React__default.createElement(_StyledSpan2, {
|
1012 | _css5: textStyles.textStyle('body2'),
|
1013 | _css6: theme.surfaceContentSecondary
|
1014 | }, end ? 'Time out' : '−');
|
1015 | }
|
1016 |
|
1017 | var lastUnitIndex = units.reduce(function (lastIndex, unit, index) {
|
1018 | return unit[1] === null ? lastIndex : index;
|
1019 | }, 0);
|
1020 | return React__default.createElement("span", null, units.map(function (unit, index) {
|
1021 | var isLast = index === lastUnitIndex;
|
1022 | var isSeconds = index === units.length - 1;
|
1023 |
|
1024 |
|
1025 | var isTimeUnit = index >= units.length - 3;
|
1026 |
|
1027 | if (unit[1] === null) {
|
1028 | return null;
|
1029 | }
|
1030 |
|
1031 | return React__default.createElement(React__default.Fragment, {
|
1032 | key: index
|
1033 | }, React__default.createElement(_StyledSpan3, {
|
1034 | _css7: theme.surfaceContent,
|
1035 | _css8: isSeconds &&
|
1036 |
|
1037 | "\n display: inline-flex;\n align-items: baseline;\n justify-content: space-between;\n min-width: 31px;\n "
|
1038 | }, formatUnit(unit[1]), React__default.createElement(_StyledSpan4, {
|
1039 | _css9: theme.surfaceContentSecondary
|
1040 | }, unit[0])), !isLast &&
|
1041 |
|
1042 |
|
1043 | React__default.createElement(_StyledSpan5, {
|
1044 | _css10: theme.surfaceContentSecondary
|
1045 | }, isTimeUnit && ':'));
|
1046 | }));
|
1047 | });
|
1048 |
|
1049 | return _this;
|
1050 | }
|
1051 |
|
1052 | getPrototypeOf._createClass(Timer, [{
|
1053 | key: "render",
|
1054 | value: function render() {
|
1055 | var _this$props2 = this.props,
|
1056 | end = _this$props2.end,
|
1057 | start = _this$props2.start,
|
1058 | showIcon = _this$props2.showIcon,
|
1059 | theme = _this$props2.theme;
|
1060 | return React__default.createElement(_StyledTime, {
|
1061 | dateTime: date.formatHtmlDatetime(end || start),
|
1062 | _css: css.unselectable(),
|
1063 | _css2: textStyles.textStyle('body2')
|
1064 | }, showIcon && React__default.createElement(_StyledSpan, {
|
1065 | _css3: 0.5 * constants.GU
|
1066 | }, React__default.createElement(_StyledIconTime, {
|
1067 | _css4: theme.surfaceIcon
|
1068 | })), React__default.createElement(index$1$2.Redraw, {
|
1069 | interval: RENDER_EVERY
|
1070 | }, this.renderTime));
|
1071 | }
|
1072 | }]);
|
1073 |
|
1074 | return Timer;
|
1075 | }(React__default.Component);
|
1076 |
|
1077 | defineProperty$1._defineProperty(Timer, "propTypes", {
|
1078 | end: index.PropTypes.instanceOf(Date),
|
1079 | format: index.PropTypes.oneOf(Object.keys(formats)),
|
1080 | maxUnits: index.PropTypes.number,
|
1081 | showEmpty: index.PropTypes.bool,
|
1082 | showIcon: index.PropTypes.bool,
|
1083 | start: index.PropTypes.instanceOf(Date),
|
1084 | theme: index.PropTypes.object
|
1085 | });
|
1086 |
|
1087 | defineProperty$1._defineProperty(Timer, "defaultProps", {
|
1088 | format: formats.yMdhms,
|
1089 | maxUnits: -1,
|
1090 | showEmpty: false,
|
1091 | showIcon: true
|
1092 | });
|
1093 |
|
1094 | var Timer$1 = (function (props) {
|
1095 | var theme = Theme.useTheme();
|
1096 | return React__default.createElement(Timer, _extends$1._extends({}, props, {
|
1097 | theme: theme
|
1098 | }));
|
1099 | });
|
1100 |
|
1101 | exports.default = Timer$1;
|
1102 |
|