@kne/super-select 0.1.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.
@@ -0,0 +1,3149 @@
1
+ import React, { useState } from 'react';
2
+ import { createContext } from '@kne/global-context';
3
+ import useResize from '@kne/use-resize';
4
+ import useControlValue from '@kne/use-control-value';
5
+ import classnames from 'classnames';
6
+ import { App, Popover, Modal, Flex, Tag, Checkbox, List } from 'antd';
7
+ import { CloseCircleFilled, DownOutlined, CheckOutlined } from '@ant-design/icons';
8
+ import SimpleBar from 'simplebar-react';
9
+ import 'simplebar-react/dist/simplebar.min.css';
10
+ import SearchInput from '@kne/search-input';
11
+ import { FetchScrollLoader } from '@kne/scroll-loader';
12
+
13
+ function _extends() {
14
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
15
+ for (var e = 1; e < arguments.length; e++) {
16
+ var t = arguments[e];
17
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
18
+ }
19
+ return n;
20
+ }, _extends.apply(null, arguments);
21
+ }
22
+ function _objectWithoutPropertiesLoose(r, e) {
23
+ if (null == r) return {};
24
+ var t = {};
25
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
26
+ if (e.includes(n)) continue;
27
+ t[n] = r[n];
28
+ }
29
+ return t;
30
+ }
31
+
32
+ const context = createContext();
33
+ const {
34
+ Provider,
35
+ useContext
36
+ } = context;
37
+
38
+ var style$3 = {"select-input":"_d8lGc","disabled":"_3kjwO","wrap":"_dsTM2","select-input-inner":"_NQoX9","large":"_T8ZX8","small":"_1B72H","select-input-icon":"_g8QC-","placeholder":"_r3q69","overlay-content":"_zEqGe","overlay":"_ybN30"};
39
+
40
+ const _excluded$1 = ["children"];
41
+ const numberToPx = val => {
42
+ return typeof val === 'number' ? `${val}px` : val;
43
+ };
44
+ const pxToNumber = value => {
45
+ if (!value) return 0;
46
+ const match = value.match(/^\d*(\.\d*)?/);
47
+ return match ? Number(match[0]) : 0;
48
+ };
49
+ const ModalContent = _ref => {
50
+ let {
51
+ children
52
+ } = _ref,
53
+ others = _objectWithoutPropertiesLoose(_ref, _excluded$1);
54
+ const [value, setValue] = useState(others.value);
55
+ const {
56
+ placeholder
57
+ } = others.props;
58
+ const {
59
+ open,
60
+ onOpenChange
61
+ } = others;
62
+ const contextProps = Object.assign({}, others, {
63
+ value,
64
+ setValue,
65
+ onAdd: item => others.onAdd(item, setValue),
66
+ onSelect: item => others.onSelect(item, setValue),
67
+ onRemove: item => others.onRemove(item, setValue),
68
+ children
69
+ });
70
+ return /*#__PURE__*/React.createElement(Modal, {
71
+ width: 1000,
72
+ open: open,
73
+ title: placeholder,
74
+ onCancel: () => {
75
+ onOpenChange(false);
76
+ },
77
+ onOk: () => {
78
+ others.setValue(value);
79
+ onOpenChange(false);
80
+ }
81
+ }, /*#__PURE__*/React.createElement(Provider, {
82
+ value: contextProps
83
+ }, children(contextProps)));
84
+ };
85
+ const SelectInput = p => {
86
+ const locale = Object.assign({}, {
87
+ placeholder: '请选择',
88
+ selectAll: '全选',
89
+ selected: '已选',
90
+ search: '搜索',
91
+ numberOf: '%s个',
92
+ maxLengthError: '最大数量不能超过%s',
93
+ defaultChildren: '下拉内容,需要调用方实现'
94
+ }, p.locale);
95
+ const props = Object.assign({}, {
96
+ children: () => locale.defaultChildren,
97
+ maxLength: null,
98
+ single: false,
99
+ disabled: false,
100
+ isPopup: true,
101
+ defaultValue: [],
102
+ placeholder: locale.placeholder,
103
+ searchPlaceholder: locale.search,
104
+ allowSelectedAll: false,
105
+ selectedAllValue: {
106
+ value: 'all',
107
+ label: locale.selectAll
108
+ },
109
+ placement: 'bottomLeft',
110
+ labelWrap: true,
111
+ showSelectedTag: true,
112
+ allowClear: true,
113
+ extra: null,
114
+ renderModal: props => /*#__PURE__*/React.createElement(ModalContent, props)
115
+ }, p, {
116
+ locale
117
+ });
118
+ const [value, setValue] = useControlValue(props);
119
+ const [searchText, setSearchText] = useState('');
120
+ const [open, setOpen] = useState(false);
121
+ const [hover, setHover] = useState(false);
122
+ const [inputWidth, setInputWidth] = useState(0);
123
+ const inputRef = useResize(el => {
124
+ setInputWidth(el.clientWidth);
125
+ });
126
+ const {
127
+ children,
128
+ className,
129
+ maxLength,
130
+ overlayClassName,
131
+ single,
132
+ labelWrap,
133
+ isPopup,
134
+ allowClear,
135
+ disabled,
136
+ placeholder,
137
+ selectedAllValue,
138
+ overlayWidth,
139
+ placement,
140
+ renderModal
141
+ } = props;
142
+ const popupOverlayWidth = numberToPx(Math.max(inputWidth, pxToNumber(overlayWidth)));
143
+ const {
144
+ message
145
+ } = App.useApp();
146
+ const checkMaxLength = (value, maxLength) => {
147
+ if (Number.isInteger(maxLength) && maxLength > 0 && value.length >= maxLength) {
148
+ message.error(locale.maxLengthError.replace('%s', maxLength));
149
+ return false;
150
+ }
151
+ return true;
152
+ };
153
+ const onRemove = (item, currentSetValue) => {
154
+ (currentSetValue || setValue)(value => {
155
+ const newValue = value.slice(0);
156
+ const index = value.findIndex(currentItem => currentItem.value === item.value);
157
+ if (index > -1) {
158
+ newValue.splice(index, 1);
159
+ }
160
+ return newValue;
161
+ });
162
+ };
163
+ const onAdd = (item, currentSetValue) => {
164
+ (currentSetValue || setValue)(value => {
165
+ if (checkMaxLength(value, maxLength)) {
166
+ return value;
167
+ }
168
+ const newValue = value.slice(0);
169
+ const index = value.findIndex(currentItem => currentItem.value === item.value);
170
+ if (index === -1) {
171
+ newValue.push(item);
172
+ }
173
+ return newValue;
174
+ });
175
+ };
176
+ const onSelect = (item, currentSetValue) => {
177
+ (currentSetValue || setValue)(value => {
178
+ const newValue = value.slice(0);
179
+ const index = value.findIndex(currentItem => currentItem.value === item.value);
180
+ if (index === -1 && !checkMaxLength(value, maxLength)) {
181
+ return value;
182
+ }
183
+ if (index === -1) {
184
+ newValue.push(item);
185
+ } else {
186
+ newValue.splice(index, 1);
187
+ }
188
+ return newValue;
189
+ });
190
+ };
191
+ const inputInnerRender = (props = {}) => /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
192
+ ref: inputRef,
193
+ className: classnames(className, style$3['select-input'], {
194
+ [style$3['wrap']]: labelWrap,
195
+ [style$3['disabled']]: disabled
196
+ }),
197
+ justify: "space-between",
198
+ onMouseOver: () => {
199
+ setHover(true);
200
+ },
201
+ onMouseOut: () => {
202
+ setHover(false);
203
+ }
204
+ }), /*#__PURE__*/React.createElement("div", {
205
+ className: style$3['select-input-inner']
206
+ }, (value || []).length > 0 ? single || value[0].value === selectedAllValue.value ? value[0].label : value.map(item => {
207
+ return /*#__PURE__*/React.createElement(Tag, {
208
+ key: item.value,
209
+ closable: true,
210
+ bordered: false,
211
+ onClose: e => {
212
+ e.preventDefault();
213
+ onRemove(item);
214
+ }
215
+ }, item.label);
216
+ }) : /*#__PURE__*/React.createElement("span", {
217
+ className: style$3['placeholder']
218
+ }, placeholder)), /*#__PURE__*/React.createElement("div", {
219
+ className: style$3['select-input-icon']
220
+ }, !disabled && allowClear && hover && (value || []).length > 0 ? /*#__PURE__*/React.createElement(CloseCircleFilled, {
221
+ onClick: e => {
222
+ e.stopPropagation();
223
+ setValue([]);
224
+ }
225
+ }) : /*#__PURE__*/React.createElement(DownOutlined, null)));
226
+ const contextProps = {
227
+ props,
228
+ value,
229
+ setValue,
230
+ searchText,
231
+ setSearchText,
232
+ hover,
233
+ inputWidth,
234
+ onAdd,
235
+ onRemove,
236
+ onSelect,
237
+ open: !disabled && open,
238
+ onOpenChange: setOpen,
239
+ children
240
+ };
241
+ return /*#__PURE__*/React.createElement(Provider, {
242
+ value: contextProps
243
+ }, isPopup ? /*#__PURE__*/React.createElement(Popover, {
244
+ open: !disabled && open,
245
+ onOpenChange: setOpen,
246
+ placement: placement,
247
+ arrow: false,
248
+ transitionName: "",
249
+ overlayClassName: classnames(style$3['overlay'], overlayClassName),
250
+ trigger: "click",
251
+ content: /*#__PURE__*/React.createElement("div", {
252
+ style: {
253
+ '--overlay-width': popupOverlayWidth
254
+ },
255
+ className: classnames(style$3['overlay-content'], 'over-content'),
256
+ onClick: e => {
257
+ e.stopPropagation();
258
+ }
259
+ }, children(contextProps))
260
+ }, /*#__PURE__*/React.createElement("span", null, inputInnerRender())) : /*#__PURE__*/React.createElement(React.Fragment, null, inputInnerRender({
261
+ onClick: () => {
262
+ setOpen(true);
263
+ }
264
+ }), renderModal(contextProps)));
265
+ };
266
+
267
+ /**
268
+ * Checks if `value` is classified as an `Array` object.
269
+ *
270
+ * @static
271
+ * @memberOf _
272
+ * @since 0.1.0
273
+ * @category Lang
274
+ * @param {*} value The value to check.
275
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
276
+ * @example
277
+ *
278
+ * _.isArray([1, 2, 3]);
279
+ * // => true
280
+ *
281
+ * _.isArray(document.body.children);
282
+ * // => false
283
+ *
284
+ * _.isArray('abc');
285
+ * // => false
286
+ *
287
+ * _.isArray(_.noop);
288
+ * // => false
289
+ */
290
+ var isArray = Array.isArray;
291
+
292
+ var isArray_1 = isArray;
293
+
294
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
295
+
296
+ function createCommonjsModule(fn) {
297
+ var module = { exports: {} };
298
+ return fn(module, module.exports), module.exports;
299
+ }
300
+
301
+ /** Detect free variable `global` from Node.js. */
302
+
303
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
304
+
305
+ var _freeGlobal = freeGlobal;
306
+
307
+ /** Detect free variable `self`. */
308
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
309
+
310
+ /** Used as a reference to the global object. */
311
+ var root = _freeGlobal || freeSelf || Function('return this')();
312
+
313
+ var _root = root;
314
+
315
+ /** Built-in value references. */
316
+ var Symbol = _root.Symbol;
317
+
318
+ var _Symbol = Symbol;
319
+
320
+ /** Used for built-in method references. */
321
+ var objectProto$a = Object.prototype;
322
+
323
+ /** Used to check objects for own properties. */
324
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
325
+
326
+ /**
327
+ * Used to resolve the
328
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
329
+ * of values.
330
+ */
331
+ var nativeObjectToString$1 = objectProto$a.toString;
332
+
333
+ /** Built-in value references. */
334
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
335
+
336
+ /**
337
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
338
+ *
339
+ * @private
340
+ * @param {*} value The value to query.
341
+ * @returns {string} Returns the raw `toStringTag`.
342
+ */
343
+ function getRawTag(value) {
344
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
345
+ tag = value[symToStringTag$1];
346
+
347
+ try {
348
+ value[symToStringTag$1] = undefined;
349
+ var unmasked = true;
350
+ } catch (e) {}
351
+
352
+ var result = nativeObjectToString$1.call(value);
353
+ if (unmasked) {
354
+ if (isOwn) {
355
+ value[symToStringTag$1] = tag;
356
+ } else {
357
+ delete value[symToStringTag$1];
358
+ }
359
+ }
360
+ return result;
361
+ }
362
+
363
+ var _getRawTag = getRawTag;
364
+
365
+ /** Used for built-in method references. */
366
+ var objectProto$9 = Object.prototype;
367
+
368
+ /**
369
+ * Used to resolve the
370
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
371
+ * of values.
372
+ */
373
+ var nativeObjectToString = objectProto$9.toString;
374
+
375
+ /**
376
+ * Converts `value` to a string using `Object.prototype.toString`.
377
+ *
378
+ * @private
379
+ * @param {*} value The value to convert.
380
+ * @returns {string} Returns the converted string.
381
+ */
382
+ function objectToString(value) {
383
+ return nativeObjectToString.call(value);
384
+ }
385
+
386
+ var _objectToString = objectToString;
387
+
388
+ /** `Object#toString` result references. */
389
+ var nullTag = '[object Null]',
390
+ undefinedTag = '[object Undefined]';
391
+
392
+ /** Built-in value references. */
393
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
394
+
395
+ /**
396
+ * The base implementation of `getTag` without fallbacks for buggy environments.
397
+ *
398
+ * @private
399
+ * @param {*} value The value to query.
400
+ * @returns {string} Returns the `toStringTag`.
401
+ */
402
+ function baseGetTag(value) {
403
+ if (value == null) {
404
+ return value === undefined ? undefinedTag : nullTag;
405
+ }
406
+ return (symToStringTag && symToStringTag in Object(value))
407
+ ? _getRawTag(value)
408
+ : _objectToString(value);
409
+ }
410
+
411
+ var _baseGetTag = baseGetTag;
412
+
413
+ /**
414
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
415
+ * and has a `typeof` result of "object".
416
+ *
417
+ * @static
418
+ * @memberOf _
419
+ * @since 4.0.0
420
+ * @category Lang
421
+ * @param {*} value The value to check.
422
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
423
+ * @example
424
+ *
425
+ * _.isObjectLike({});
426
+ * // => true
427
+ *
428
+ * _.isObjectLike([1, 2, 3]);
429
+ * // => true
430
+ *
431
+ * _.isObjectLike(_.noop);
432
+ * // => false
433
+ *
434
+ * _.isObjectLike(null);
435
+ * // => false
436
+ */
437
+ function isObjectLike(value) {
438
+ return value != null && typeof value == 'object';
439
+ }
440
+
441
+ var isObjectLike_1 = isObjectLike;
442
+
443
+ /** `Object#toString` result references. */
444
+ var symbolTag = '[object Symbol]';
445
+
446
+ /**
447
+ * Checks if `value` is classified as a `Symbol` primitive or object.
448
+ *
449
+ * @static
450
+ * @memberOf _
451
+ * @since 4.0.0
452
+ * @category Lang
453
+ * @param {*} value The value to check.
454
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
455
+ * @example
456
+ *
457
+ * _.isSymbol(Symbol.iterator);
458
+ * // => true
459
+ *
460
+ * _.isSymbol('abc');
461
+ * // => false
462
+ */
463
+ function isSymbol(value) {
464
+ return typeof value == 'symbol' ||
465
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
466
+ }
467
+
468
+ var isSymbol_1 = isSymbol;
469
+
470
+ /** Used to match property names within property paths. */
471
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
472
+ reIsPlainProp = /^\w*$/;
473
+
474
+ /**
475
+ * Checks if `value` is a property name and not a property path.
476
+ *
477
+ * @private
478
+ * @param {*} value The value to check.
479
+ * @param {Object} [object] The object to query keys on.
480
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
481
+ */
482
+ function isKey(value, object) {
483
+ if (isArray_1(value)) {
484
+ return false;
485
+ }
486
+ var type = typeof value;
487
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
488
+ value == null || isSymbol_1(value)) {
489
+ return true;
490
+ }
491
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
492
+ (object != null && value in Object(object));
493
+ }
494
+
495
+ var _isKey = isKey;
496
+
497
+ /**
498
+ * Checks if `value` is the
499
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
500
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
501
+ *
502
+ * @static
503
+ * @memberOf _
504
+ * @since 0.1.0
505
+ * @category Lang
506
+ * @param {*} value The value to check.
507
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
508
+ * @example
509
+ *
510
+ * _.isObject({});
511
+ * // => true
512
+ *
513
+ * _.isObject([1, 2, 3]);
514
+ * // => true
515
+ *
516
+ * _.isObject(_.noop);
517
+ * // => true
518
+ *
519
+ * _.isObject(null);
520
+ * // => false
521
+ */
522
+ function isObject(value) {
523
+ var type = typeof value;
524
+ return value != null && (type == 'object' || type == 'function');
525
+ }
526
+
527
+ var isObject_1 = isObject;
528
+
529
+ /** `Object#toString` result references. */
530
+ var asyncTag = '[object AsyncFunction]',
531
+ funcTag$1 = '[object Function]',
532
+ genTag = '[object GeneratorFunction]',
533
+ proxyTag = '[object Proxy]';
534
+
535
+ /**
536
+ * Checks if `value` is classified as a `Function` object.
537
+ *
538
+ * @static
539
+ * @memberOf _
540
+ * @since 0.1.0
541
+ * @category Lang
542
+ * @param {*} value The value to check.
543
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
544
+ * @example
545
+ *
546
+ * _.isFunction(_);
547
+ * // => true
548
+ *
549
+ * _.isFunction(/abc/);
550
+ * // => false
551
+ */
552
+ function isFunction(value) {
553
+ if (!isObject_1(value)) {
554
+ return false;
555
+ }
556
+ // The use of `Object#toString` avoids issues with the `typeof` operator
557
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
558
+ var tag = _baseGetTag(value);
559
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
560
+ }
561
+
562
+ var isFunction_1 = isFunction;
563
+
564
+ /** Used to detect overreaching core-js shims. */
565
+ var coreJsData = _root['__core-js_shared__'];
566
+
567
+ var _coreJsData = coreJsData;
568
+
569
+ /** Used to detect methods masquerading as native. */
570
+ var maskSrcKey = (function() {
571
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
572
+ return uid ? ('Symbol(src)_1.' + uid) : '';
573
+ }());
574
+
575
+ /**
576
+ * Checks if `func` has its source masked.
577
+ *
578
+ * @private
579
+ * @param {Function} func The function to check.
580
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
581
+ */
582
+ function isMasked(func) {
583
+ return !!maskSrcKey && (maskSrcKey in func);
584
+ }
585
+
586
+ var _isMasked = isMasked;
587
+
588
+ /** Used for built-in method references. */
589
+ var funcProto$2 = Function.prototype;
590
+
591
+ /** Used to resolve the decompiled source of functions. */
592
+ var funcToString$2 = funcProto$2.toString;
593
+
594
+ /**
595
+ * Converts `func` to its source code.
596
+ *
597
+ * @private
598
+ * @param {Function} func The function to convert.
599
+ * @returns {string} Returns the source code.
600
+ */
601
+ function toSource(func) {
602
+ if (func != null) {
603
+ try {
604
+ return funcToString$2.call(func);
605
+ } catch (e) {}
606
+ try {
607
+ return (func + '');
608
+ } catch (e) {}
609
+ }
610
+ return '';
611
+ }
612
+
613
+ var _toSource = toSource;
614
+
615
+ /**
616
+ * Used to match `RegExp`
617
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
618
+ */
619
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
620
+
621
+ /** Used to detect host constructors (Safari). */
622
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
623
+
624
+ /** Used for built-in method references. */
625
+ var funcProto$1 = Function.prototype,
626
+ objectProto$8 = Object.prototype;
627
+
628
+ /** Used to resolve the decompiled source of functions. */
629
+ var funcToString$1 = funcProto$1.toString;
630
+
631
+ /** Used to check objects for own properties. */
632
+ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
633
+
634
+ /** Used to detect if a method is native. */
635
+ var reIsNative = RegExp('^' +
636
+ funcToString$1.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
637
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
638
+ );
639
+
640
+ /**
641
+ * The base implementation of `_.isNative` without bad shim checks.
642
+ *
643
+ * @private
644
+ * @param {*} value The value to check.
645
+ * @returns {boolean} Returns `true` if `value` is a native function,
646
+ * else `false`.
647
+ */
648
+ function baseIsNative(value) {
649
+ if (!isObject_1(value) || _isMasked(value)) {
650
+ return false;
651
+ }
652
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
653
+ return pattern.test(_toSource(value));
654
+ }
655
+
656
+ var _baseIsNative = baseIsNative;
657
+
658
+ /**
659
+ * Gets the value at `key` of `object`.
660
+ *
661
+ * @private
662
+ * @param {Object} [object] The object to query.
663
+ * @param {string} key The key of the property to get.
664
+ * @returns {*} Returns the property value.
665
+ */
666
+ function getValue(object, key) {
667
+ return object == null ? undefined : object[key];
668
+ }
669
+
670
+ var _getValue = getValue;
671
+
672
+ /**
673
+ * Gets the native function at `key` of `object`.
674
+ *
675
+ * @private
676
+ * @param {Object} object The object to query.
677
+ * @param {string} key The key of the method to get.
678
+ * @returns {*} Returns the function if it's native, else `undefined`.
679
+ */
680
+ function getNative(object, key) {
681
+ var value = _getValue(object, key);
682
+ return _baseIsNative(value) ? value : undefined;
683
+ }
684
+
685
+ var _getNative = getNative;
686
+
687
+ /* Built-in method references that are verified to be native. */
688
+ var nativeCreate = _getNative(Object, 'create');
689
+
690
+ var _nativeCreate = nativeCreate;
691
+
692
+ /**
693
+ * Removes all key-value entries from the hash.
694
+ *
695
+ * @private
696
+ * @name clear
697
+ * @memberOf Hash
698
+ */
699
+ function hashClear() {
700
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
701
+ this.size = 0;
702
+ }
703
+
704
+ var _hashClear = hashClear;
705
+
706
+ /**
707
+ * Removes `key` and its value from the hash.
708
+ *
709
+ * @private
710
+ * @name delete
711
+ * @memberOf Hash
712
+ * @param {Object} hash The hash to modify.
713
+ * @param {string} key The key of the value to remove.
714
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
715
+ */
716
+ function hashDelete(key) {
717
+ var result = this.has(key) && delete this.__data__[key];
718
+ this.size -= result ? 1 : 0;
719
+ return result;
720
+ }
721
+
722
+ var _hashDelete = hashDelete;
723
+
724
+ /** Used to stand-in for `undefined` hash values. */
725
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
726
+
727
+ /** Used for built-in method references. */
728
+ var objectProto$7 = Object.prototype;
729
+
730
+ /** Used to check objects for own properties. */
731
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
732
+
733
+ /**
734
+ * Gets the hash value for `key`.
735
+ *
736
+ * @private
737
+ * @name get
738
+ * @memberOf Hash
739
+ * @param {string} key The key of the value to get.
740
+ * @returns {*} Returns the entry value.
741
+ */
742
+ function hashGet(key) {
743
+ var data = this.__data__;
744
+ if (_nativeCreate) {
745
+ var result = data[key];
746
+ return result === HASH_UNDEFINED$1 ? undefined : result;
747
+ }
748
+ return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
749
+ }
750
+
751
+ var _hashGet = hashGet;
752
+
753
+ /** Used for built-in method references. */
754
+ var objectProto$6 = Object.prototype;
755
+
756
+ /** Used to check objects for own properties. */
757
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
758
+
759
+ /**
760
+ * Checks if a hash value for `key` exists.
761
+ *
762
+ * @private
763
+ * @name has
764
+ * @memberOf Hash
765
+ * @param {string} key The key of the entry to check.
766
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
767
+ */
768
+ function hashHas(key) {
769
+ var data = this.__data__;
770
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
771
+ }
772
+
773
+ var _hashHas = hashHas;
774
+
775
+ /** Used to stand-in for `undefined` hash values. */
776
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
777
+
778
+ /**
779
+ * Sets the hash `key` to `value`.
780
+ *
781
+ * @private
782
+ * @name set
783
+ * @memberOf Hash
784
+ * @param {string} key The key of the value to set.
785
+ * @param {*} value The value to set.
786
+ * @returns {Object} Returns the hash instance.
787
+ */
788
+ function hashSet(key, value) {
789
+ var data = this.__data__;
790
+ this.size += this.has(key) ? 0 : 1;
791
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
792
+ return this;
793
+ }
794
+
795
+ var _hashSet = hashSet;
796
+
797
+ /**
798
+ * Creates a hash object.
799
+ *
800
+ * @private
801
+ * @constructor
802
+ * @param {Array} [entries] The key-value pairs to cache.
803
+ */
804
+ function Hash(entries) {
805
+ var index = -1,
806
+ length = entries == null ? 0 : entries.length;
807
+
808
+ this.clear();
809
+ while (++index < length) {
810
+ var entry = entries[index];
811
+ this.set(entry[0], entry[1]);
812
+ }
813
+ }
814
+
815
+ // Add methods to `Hash`.
816
+ Hash.prototype.clear = _hashClear;
817
+ Hash.prototype['delete'] = _hashDelete;
818
+ Hash.prototype.get = _hashGet;
819
+ Hash.prototype.has = _hashHas;
820
+ Hash.prototype.set = _hashSet;
821
+
822
+ var _Hash = Hash;
823
+
824
+ /**
825
+ * Removes all key-value entries from the list cache.
826
+ *
827
+ * @private
828
+ * @name clear
829
+ * @memberOf ListCache
830
+ */
831
+ function listCacheClear() {
832
+ this.__data__ = [];
833
+ this.size = 0;
834
+ }
835
+
836
+ var _listCacheClear = listCacheClear;
837
+
838
+ /**
839
+ * Performs a
840
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
841
+ * comparison between two values to determine if they are equivalent.
842
+ *
843
+ * @static
844
+ * @memberOf _
845
+ * @since 4.0.0
846
+ * @category Lang
847
+ * @param {*} value The value to compare.
848
+ * @param {*} other The other value to compare.
849
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
850
+ * @example
851
+ *
852
+ * var object = { 'a': 1 };
853
+ * var other = { 'a': 1 };
854
+ *
855
+ * _.eq(object, object);
856
+ * // => true
857
+ *
858
+ * _.eq(object, other);
859
+ * // => false
860
+ *
861
+ * _.eq('a', 'a');
862
+ * // => true
863
+ *
864
+ * _.eq('a', Object('a'));
865
+ * // => false
866
+ *
867
+ * _.eq(NaN, NaN);
868
+ * // => true
869
+ */
870
+ function eq(value, other) {
871
+ return value === other || (value !== value && other !== other);
872
+ }
873
+
874
+ var eq_1 = eq;
875
+
876
+ /**
877
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
878
+ *
879
+ * @private
880
+ * @param {Array} array The array to inspect.
881
+ * @param {*} key The key to search for.
882
+ * @returns {number} Returns the index of the matched value, else `-1`.
883
+ */
884
+ function assocIndexOf(array, key) {
885
+ var length = array.length;
886
+ while (length--) {
887
+ if (eq_1(array[length][0], key)) {
888
+ return length;
889
+ }
890
+ }
891
+ return -1;
892
+ }
893
+
894
+ var _assocIndexOf = assocIndexOf;
895
+
896
+ /** Used for built-in method references. */
897
+ var arrayProto = Array.prototype;
898
+
899
+ /** Built-in value references. */
900
+ var splice = arrayProto.splice;
901
+
902
+ /**
903
+ * Removes `key` and its value from the list cache.
904
+ *
905
+ * @private
906
+ * @name delete
907
+ * @memberOf ListCache
908
+ * @param {string} key The key of the value to remove.
909
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
910
+ */
911
+ function listCacheDelete(key) {
912
+ var data = this.__data__,
913
+ index = _assocIndexOf(data, key);
914
+
915
+ if (index < 0) {
916
+ return false;
917
+ }
918
+ var lastIndex = data.length - 1;
919
+ if (index == lastIndex) {
920
+ data.pop();
921
+ } else {
922
+ splice.call(data, index, 1);
923
+ }
924
+ --this.size;
925
+ return true;
926
+ }
927
+
928
+ var _listCacheDelete = listCacheDelete;
929
+
930
+ /**
931
+ * Gets the list cache value for `key`.
932
+ *
933
+ * @private
934
+ * @name get
935
+ * @memberOf ListCache
936
+ * @param {string} key The key of the value to get.
937
+ * @returns {*} Returns the entry value.
938
+ */
939
+ function listCacheGet(key) {
940
+ var data = this.__data__,
941
+ index = _assocIndexOf(data, key);
942
+
943
+ return index < 0 ? undefined : data[index][1];
944
+ }
945
+
946
+ var _listCacheGet = listCacheGet;
947
+
948
+ /**
949
+ * Checks if a list cache value for `key` exists.
950
+ *
951
+ * @private
952
+ * @name has
953
+ * @memberOf ListCache
954
+ * @param {string} key The key of the entry to check.
955
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
956
+ */
957
+ function listCacheHas(key) {
958
+ return _assocIndexOf(this.__data__, key) > -1;
959
+ }
960
+
961
+ var _listCacheHas = listCacheHas;
962
+
963
+ /**
964
+ * Sets the list cache `key` to `value`.
965
+ *
966
+ * @private
967
+ * @name set
968
+ * @memberOf ListCache
969
+ * @param {string} key The key of the value to set.
970
+ * @param {*} value The value to set.
971
+ * @returns {Object} Returns the list cache instance.
972
+ */
973
+ function listCacheSet(key, value) {
974
+ var data = this.__data__,
975
+ index = _assocIndexOf(data, key);
976
+
977
+ if (index < 0) {
978
+ ++this.size;
979
+ data.push([key, value]);
980
+ } else {
981
+ data[index][1] = value;
982
+ }
983
+ return this;
984
+ }
985
+
986
+ var _listCacheSet = listCacheSet;
987
+
988
+ /**
989
+ * Creates an list cache object.
990
+ *
991
+ * @private
992
+ * @constructor
993
+ * @param {Array} [entries] The key-value pairs to cache.
994
+ */
995
+ function ListCache(entries) {
996
+ var index = -1,
997
+ length = entries == null ? 0 : entries.length;
998
+
999
+ this.clear();
1000
+ while (++index < length) {
1001
+ var entry = entries[index];
1002
+ this.set(entry[0], entry[1]);
1003
+ }
1004
+ }
1005
+
1006
+ // Add methods to `ListCache`.
1007
+ ListCache.prototype.clear = _listCacheClear;
1008
+ ListCache.prototype['delete'] = _listCacheDelete;
1009
+ ListCache.prototype.get = _listCacheGet;
1010
+ ListCache.prototype.has = _listCacheHas;
1011
+ ListCache.prototype.set = _listCacheSet;
1012
+
1013
+ var _ListCache = ListCache;
1014
+
1015
+ /* Built-in method references that are verified to be native. */
1016
+ var Map = _getNative(_root, 'Map');
1017
+
1018
+ var _Map = Map;
1019
+
1020
+ /**
1021
+ * Removes all key-value entries from the map.
1022
+ *
1023
+ * @private
1024
+ * @name clear
1025
+ * @memberOf MapCache
1026
+ */
1027
+ function mapCacheClear() {
1028
+ this.size = 0;
1029
+ this.__data__ = {
1030
+ 'hash': new _Hash,
1031
+ 'map': new (_Map || _ListCache),
1032
+ 'string': new _Hash
1033
+ };
1034
+ }
1035
+
1036
+ var _mapCacheClear = mapCacheClear;
1037
+
1038
+ /**
1039
+ * Checks if `value` is suitable for use as unique object key.
1040
+ *
1041
+ * @private
1042
+ * @param {*} value The value to check.
1043
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1044
+ */
1045
+ function isKeyable(value) {
1046
+ var type = typeof value;
1047
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1048
+ ? (value !== '__proto__')
1049
+ : (value === null);
1050
+ }
1051
+
1052
+ var _isKeyable = isKeyable;
1053
+
1054
+ /**
1055
+ * Gets the data for `map`.
1056
+ *
1057
+ * @private
1058
+ * @param {Object} map The map to query.
1059
+ * @param {string} key The reference key.
1060
+ * @returns {*} Returns the map data.
1061
+ */
1062
+ function getMapData(map, key) {
1063
+ var data = map.__data__;
1064
+ return _isKeyable(key)
1065
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1066
+ : data.map;
1067
+ }
1068
+
1069
+ var _getMapData = getMapData;
1070
+
1071
+ /**
1072
+ * Removes `key` and its value from the map.
1073
+ *
1074
+ * @private
1075
+ * @name delete
1076
+ * @memberOf MapCache
1077
+ * @param {string} key The key of the value to remove.
1078
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1079
+ */
1080
+ function mapCacheDelete(key) {
1081
+ var result = _getMapData(this, key)['delete'](key);
1082
+ this.size -= result ? 1 : 0;
1083
+ return result;
1084
+ }
1085
+
1086
+ var _mapCacheDelete = mapCacheDelete;
1087
+
1088
+ /**
1089
+ * Gets the map value for `key`.
1090
+ *
1091
+ * @private
1092
+ * @name get
1093
+ * @memberOf MapCache
1094
+ * @param {string} key The key of the value to get.
1095
+ * @returns {*} Returns the entry value.
1096
+ */
1097
+ function mapCacheGet(key) {
1098
+ return _getMapData(this, key).get(key);
1099
+ }
1100
+
1101
+ var _mapCacheGet = mapCacheGet;
1102
+
1103
+ /**
1104
+ * Checks if a map value for `key` exists.
1105
+ *
1106
+ * @private
1107
+ * @name has
1108
+ * @memberOf MapCache
1109
+ * @param {string} key The key of the entry to check.
1110
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1111
+ */
1112
+ function mapCacheHas(key) {
1113
+ return _getMapData(this, key).has(key);
1114
+ }
1115
+
1116
+ var _mapCacheHas = mapCacheHas;
1117
+
1118
+ /**
1119
+ * Sets the map `key` to `value`.
1120
+ *
1121
+ * @private
1122
+ * @name set
1123
+ * @memberOf MapCache
1124
+ * @param {string} key The key of the value to set.
1125
+ * @param {*} value The value to set.
1126
+ * @returns {Object} Returns the map cache instance.
1127
+ */
1128
+ function mapCacheSet(key, value) {
1129
+ var data = _getMapData(this, key),
1130
+ size = data.size;
1131
+
1132
+ data.set(key, value);
1133
+ this.size += data.size == size ? 0 : 1;
1134
+ return this;
1135
+ }
1136
+
1137
+ var _mapCacheSet = mapCacheSet;
1138
+
1139
+ /**
1140
+ * Creates a map cache object to store key-value pairs.
1141
+ *
1142
+ * @private
1143
+ * @constructor
1144
+ * @param {Array} [entries] The key-value pairs to cache.
1145
+ */
1146
+ function MapCache(entries) {
1147
+ var index = -1,
1148
+ length = entries == null ? 0 : entries.length;
1149
+
1150
+ this.clear();
1151
+ while (++index < length) {
1152
+ var entry = entries[index];
1153
+ this.set(entry[0], entry[1]);
1154
+ }
1155
+ }
1156
+
1157
+ // Add methods to `MapCache`.
1158
+ MapCache.prototype.clear = _mapCacheClear;
1159
+ MapCache.prototype['delete'] = _mapCacheDelete;
1160
+ MapCache.prototype.get = _mapCacheGet;
1161
+ MapCache.prototype.has = _mapCacheHas;
1162
+ MapCache.prototype.set = _mapCacheSet;
1163
+
1164
+ var _MapCache = MapCache;
1165
+
1166
+ /** Error message constants. */
1167
+ var FUNC_ERROR_TEXT = 'Expected a function';
1168
+
1169
+ /**
1170
+ * Creates a function that memoizes the result of `func`. If `resolver` is
1171
+ * provided, it determines the cache key for storing the result based on the
1172
+ * arguments provided to the memoized function. By default, the first argument
1173
+ * provided to the memoized function is used as the map cache key. The `func`
1174
+ * is invoked with the `this` binding of the memoized function.
1175
+ *
1176
+ * **Note:** The cache is exposed as the `cache` property on the memoized
1177
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
1178
+ * constructor with one whose instances implement the
1179
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1180
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1181
+ *
1182
+ * @static
1183
+ * @memberOf _
1184
+ * @since 0.1.0
1185
+ * @category Function
1186
+ * @param {Function} func The function to have its output memoized.
1187
+ * @param {Function} [resolver] The function to resolve the cache key.
1188
+ * @returns {Function} Returns the new memoized function.
1189
+ * @example
1190
+ *
1191
+ * var object = { 'a': 1, 'b': 2 };
1192
+ * var other = { 'c': 3, 'd': 4 };
1193
+ *
1194
+ * var values = _.memoize(_.values);
1195
+ * values(object);
1196
+ * // => [1, 2]
1197
+ *
1198
+ * values(other);
1199
+ * // => [3, 4]
1200
+ *
1201
+ * object.a = 2;
1202
+ * values(object);
1203
+ * // => [1, 2]
1204
+ *
1205
+ * // Modify the result cache.
1206
+ * values.cache.set(object, ['a', 'b']);
1207
+ * values(object);
1208
+ * // => ['a', 'b']
1209
+ *
1210
+ * // Replace `_.memoize.Cache`.
1211
+ * _.memoize.Cache = WeakMap;
1212
+ */
1213
+ function memoize(func, resolver) {
1214
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1215
+ throw new TypeError(FUNC_ERROR_TEXT);
1216
+ }
1217
+ var memoized = function() {
1218
+ var args = arguments,
1219
+ key = resolver ? resolver.apply(this, args) : args[0],
1220
+ cache = memoized.cache;
1221
+
1222
+ if (cache.has(key)) {
1223
+ return cache.get(key);
1224
+ }
1225
+ var result = func.apply(this, args);
1226
+ memoized.cache = cache.set(key, result) || cache;
1227
+ return result;
1228
+ };
1229
+ memoized.cache = new (memoize.Cache || _MapCache);
1230
+ return memoized;
1231
+ }
1232
+
1233
+ // Expose `MapCache`.
1234
+ memoize.Cache = _MapCache;
1235
+
1236
+ var memoize_1 = memoize;
1237
+
1238
+ /** Used as the maximum memoize cache size. */
1239
+ var MAX_MEMOIZE_SIZE = 500;
1240
+
1241
+ /**
1242
+ * A specialized version of `_.memoize` which clears the memoized function's
1243
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1244
+ *
1245
+ * @private
1246
+ * @param {Function} func The function to have its output memoized.
1247
+ * @returns {Function} Returns the new memoized function.
1248
+ */
1249
+ function memoizeCapped(func) {
1250
+ var result = memoize_1(func, function(key) {
1251
+ if (cache.size === MAX_MEMOIZE_SIZE) {
1252
+ cache.clear();
1253
+ }
1254
+ return key;
1255
+ });
1256
+
1257
+ var cache = result.cache;
1258
+ return result;
1259
+ }
1260
+
1261
+ var _memoizeCapped = memoizeCapped;
1262
+
1263
+ /** Used to match property names within property paths. */
1264
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1265
+
1266
+ /** Used to match backslashes in property paths. */
1267
+ var reEscapeChar = /\\(\\)?/g;
1268
+
1269
+ /**
1270
+ * Converts `string` to a property path array.
1271
+ *
1272
+ * @private
1273
+ * @param {string} string The string to convert.
1274
+ * @returns {Array} Returns the property path array.
1275
+ */
1276
+ var stringToPath = _memoizeCapped(function(string) {
1277
+ var result = [];
1278
+ if (string.charCodeAt(0) === 46 /* . */) {
1279
+ result.push('');
1280
+ }
1281
+ string.replace(rePropName, function(match, number, quote, subString) {
1282
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1283
+ });
1284
+ return result;
1285
+ });
1286
+
1287
+ var _stringToPath = stringToPath;
1288
+
1289
+ /**
1290
+ * A specialized version of `_.map` for arrays without support for iteratee
1291
+ * shorthands.
1292
+ *
1293
+ * @private
1294
+ * @param {Array} [array] The array to iterate over.
1295
+ * @param {Function} iteratee The function invoked per iteration.
1296
+ * @returns {Array} Returns the new mapped array.
1297
+ */
1298
+ function arrayMap(array, iteratee) {
1299
+ var index = -1,
1300
+ length = array == null ? 0 : array.length,
1301
+ result = Array(length);
1302
+
1303
+ while (++index < length) {
1304
+ result[index] = iteratee(array[index], index, array);
1305
+ }
1306
+ return result;
1307
+ }
1308
+
1309
+ var _arrayMap = arrayMap;
1310
+
1311
+ /** Used as references for various `Number` constants. */
1312
+ var INFINITY$1 = 1 / 0;
1313
+
1314
+ /** Used to convert symbols to primitives and strings. */
1315
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1316
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
1317
+
1318
+ /**
1319
+ * The base implementation of `_.toString` which doesn't convert nullish
1320
+ * values to empty strings.
1321
+ *
1322
+ * @private
1323
+ * @param {*} value The value to process.
1324
+ * @returns {string} Returns the string.
1325
+ */
1326
+ function baseToString(value) {
1327
+ // Exit early for strings to avoid a performance hit in some environments.
1328
+ if (typeof value == 'string') {
1329
+ return value;
1330
+ }
1331
+ if (isArray_1(value)) {
1332
+ // Recursively convert values (susceptible to call stack limits).
1333
+ return _arrayMap(value, baseToString) + '';
1334
+ }
1335
+ if (isSymbol_1(value)) {
1336
+ return symbolToString ? symbolToString.call(value) : '';
1337
+ }
1338
+ var result = (value + '');
1339
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
1340
+ }
1341
+
1342
+ var _baseToString = baseToString;
1343
+
1344
+ /**
1345
+ * Converts `value` to a string. An empty string is returned for `null`
1346
+ * and `undefined` values. The sign of `-0` is preserved.
1347
+ *
1348
+ * @static
1349
+ * @memberOf _
1350
+ * @since 4.0.0
1351
+ * @category Lang
1352
+ * @param {*} value The value to convert.
1353
+ * @returns {string} Returns the converted string.
1354
+ * @example
1355
+ *
1356
+ * _.toString(null);
1357
+ * // => ''
1358
+ *
1359
+ * _.toString(-0);
1360
+ * // => '-0'
1361
+ *
1362
+ * _.toString([1, 2, 3]);
1363
+ * // => '1,2,3'
1364
+ */
1365
+ function toString(value) {
1366
+ return value == null ? '' : _baseToString(value);
1367
+ }
1368
+
1369
+ var toString_1 = toString;
1370
+
1371
+ /**
1372
+ * Casts `value` to a path array if it's not one.
1373
+ *
1374
+ * @private
1375
+ * @param {*} value The value to inspect.
1376
+ * @param {Object} [object] The object to query keys on.
1377
+ * @returns {Array} Returns the cast property path array.
1378
+ */
1379
+ function castPath(value, object) {
1380
+ if (isArray_1(value)) {
1381
+ return value;
1382
+ }
1383
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
1384
+ }
1385
+
1386
+ var _castPath = castPath;
1387
+
1388
+ /** Used as references for various `Number` constants. */
1389
+ var INFINITY = 1 / 0;
1390
+
1391
+ /**
1392
+ * Converts `value` to a string key if it's not a string or symbol.
1393
+ *
1394
+ * @private
1395
+ * @param {*} value The value to inspect.
1396
+ * @returns {string|symbol} Returns the key.
1397
+ */
1398
+ function toKey(value) {
1399
+ if (typeof value == 'string' || isSymbol_1(value)) {
1400
+ return value;
1401
+ }
1402
+ var result = (value + '');
1403
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1404
+ }
1405
+
1406
+ var _toKey = toKey;
1407
+
1408
+ /**
1409
+ * The base implementation of `_.get` without support for default values.
1410
+ *
1411
+ * @private
1412
+ * @param {Object} object The object to query.
1413
+ * @param {Array|string} path The path of the property to get.
1414
+ * @returns {*} Returns the resolved value.
1415
+ */
1416
+ function baseGet(object, path) {
1417
+ path = _castPath(path, object);
1418
+
1419
+ var index = 0,
1420
+ length = path.length;
1421
+
1422
+ while (object != null && index < length) {
1423
+ object = object[_toKey(path[index++])];
1424
+ }
1425
+ return (index && index == length) ? object : undefined;
1426
+ }
1427
+
1428
+ var _baseGet = baseGet;
1429
+
1430
+ /**
1431
+ * Gets the value at `path` of `object`. If the resolved value is
1432
+ * `undefined`, the `defaultValue` is returned in its place.
1433
+ *
1434
+ * @static
1435
+ * @memberOf _
1436
+ * @since 3.7.0
1437
+ * @category Object
1438
+ * @param {Object} object The object to query.
1439
+ * @param {Array|string} path The path of the property to get.
1440
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1441
+ * @returns {*} Returns the resolved value.
1442
+ * @example
1443
+ *
1444
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1445
+ *
1446
+ * _.get(object, 'a[0].b.c');
1447
+ * // => 3
1448
+ *
1449
+ * _.get(object, ['a', '0', 'b', 'c']);
1450
+ * // => 3
1451
+ *
1452
+ * _.get(object, 'a.b.c', 'default');
1453
+ * // => 'default'
1454
+ */
1455
+ function get(object, path, defaultValue) {
1456
+ var result = object == null ? undefined : _baseGet(object, path);
1457
+ return result === undefined ? defaultValue : result;
1458
+ }
1459
+
1460
+ var get_1 = get;
1461
+
1462
+ var style$2 = {"selected-all":"_prlgN","selected-all-outer":"_h6RBS"};
1463
+
1464
+ const SelectedAll = () => {
1465
+ const {
1466
+ props,
1467
+ value,
1468
+ setValue
1469
+ } = useContext();
1470
+ const {
1471
+ unit,
1472
+ selectedAllValue,
1473
+ locale
1474
+ } = Object.assign({}, {
1475
+ unit: number => locale.numberOf.replace('%s', number)
1476
+ }, props);
1477
+ const isSelectedAll = computedIsSelectAll(value, selectedAllValue);
1478
+ return /*#__PURE__*/React.createElement("div", {
1479
+ className: style$2['selected-all-outer']
1480
+ }, /*#__PURE__*/React.createElement(Flex, {
1481
+ justify: "space-between",
1482
+ className: style$2['selected-all']
1483
+ }, /*#__PURE__*/React.createElement(Flex, {
1484
+ gap: 8
1485
+ }, /*#__PURE__*/React.createElement("span", null, locale.selected, ":"), /*#__PURE__*/React.createElement("span", null, isSelectedAll ? selectedAllValue.label : typeof unit === 'function' ? unit(value.length) : value.length)), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Checkbox, {
1486
+ checked: isSelectedAll,
1487
+ onChange: e => {
1488
+ const checked = e.target.checked;
1489
+ if (!checked) {
1490
+ setValue([]);
1491
+ } else {
1492
+ setValue([selectedAllValue]);
1493
+ }
1494
+ }
1495
+ }, locale.selectAll))));
1496
+ };
1497
+ const computedIsSelectAll = (value, selectedAllValue) => {
1498
+ return (value == null ? void 0 : value.length) === 1 && get_1(value, '[0].value') === selectedAllValue.value;
1499
+ };
1500
+
1501
+ var style$1 = {"label":"_l3KoW","tag-list":"_CCPzb","tag-list-outer":"_epbhk","tag-container":"_dKZHi","tag-container-inner":"_oijCI"};
1502
+
1503
+ const SelectedTagList = () => {
1504
+ const {
1505
+ props,
1506
+ value,
1507
+ onRemove
1508
+ } = useContext();
1509
+ const {
1510
+ locale,
1511
+ single,
1512
+ maxLength
1513
+ } = Object.assign({}, props);
1514
+ return /*#__PURE__*/React.createElement("div", {
1515
+ className: style$1['tag-list-outer']
1516
+ }, /*#__PURE__*/React.createElement(Flex, {
1517
+ className: style$1['tag-list'],
1518
+ gap: 8
1519
+ }, /*#__PURE__*/React.createElement("div", {
1520
+ className: style$1['label']
1521
+ }, locale.selected, !single && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React.createElement(SimpleBar, {
1522
+ className: style$1['tag-container']
1523
+ }, /*#__PURE__*/React.createElement(Flex, {
1524
+ gap: 8,
1525
+ wrap: true,
1526
+ className: style$1['tag-container-inner']
1527
+ }, value.map(item => {
1528
+ return /*#__PURE__*/React.createElement(Tag, {
1529
+ key: item.value,
1530
+ closable: true,
1531
+ bordered: false,
1532
+ onClose: e => {
1533
+ e.preventDefault();
1534
+ onRemove(item);
1535
+ }
1536
+ }, item.label);
1537
+ })))));
1538
+ };
1539
+
1540
+ /**
1541
+ * Removes all key-value entries from the stack.
1542
+ *
1543
+ * @private
1544
+ * @name clear
1545
+ * @memberOf Stack
1546
+ */
1547
+ function stackClear() {
1548
+ this.__data__ = new _ListCache;
1549
+ this.size = 0;
1550
+ }
1551
+
1552
+ var _stackClear = stackClear;
1553
+
1554
+ /**
1555
+ * Removes `key` and its value from the stack.
1556
+ *
1557
+ * @private
1558
+ * @name delete
1559
+ * @memberOf Stack
1560
+ * @param {string} key The key of the value to remove.
1561
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1562
+ */
1563
+ function stackDelete(key) {
1564
+ var data = this.__data__,
1565
+ result = data['delete'](key);
1566
+
1567
+ this.size = data.size;
1568
+ return result;
1569
+ }
1570
+
1571
+ var _stackDelete = stackDelete;
1572
+
1573
+ /**
1574
+ * Gets the stack value for `key`.
1575
+ *
1576
+ * @private
1577
+ * @name get
1578
+ * @memberOf Stack
1579
+ * @param {string} key The key of the value to get.
1580
+ * @returns {*} Returns the entry value.
1581
+ */
1582
+ function stackGet(key) {
1583
+ return this.__data__.get(key);
1584
+ }
1585
+
1586
+ var _stackGet = stackGet;
1587
+
1588
+ /**
1589
+ * Checks if a stack value for `key` exists.
1590
+ *
1591
+ * @private
1592
+ * @name has
1593
+ * @memberOf Stack
1594
+ * @param {string} key The key of the entry to check.
1595
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1596
+ */
1597
+ function stackHas(key) {
1598
+ return this.__data__.has(key);
1599
+ }
1600
+
1601
+ var _stackHas = stackHas;
1602
+
1603
+ /** Used as the size to enable large array optimizations. */
1604
+ var LARGE_ARRAY_SIZE = 200;
1605
+
1606
+ /**
1607
+ * Sets the stack `key` to `value`.
1608
+ *
1609
+ * @private
1610
+ * @name set
1611
+ * @memberOf Stack
1612
+ * @param {string} key The key of the value to set.
1613
+ * @param {*} value The value to set.
1614
+ * @returns {Object} Returns the stack cache instance.
1615
+ */
1616
+ function stackSet(key, value) {
1617
+ var data = this.__data__;
1618
+ if (data instanceof _ListCache) {
1619
+ var pairs = data.__data__;
1620
+ if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1621
+ pairs.push([key, value]);
1622
+ this.size = ++data.size;
1623
+ return this;
1624
+ }
1625
+ data = this.__data__ = new _MapCache(pairs);
1626
+ }
1627
+ data.set(key, value);
1628
+ this.size = data.size;
1629
+ return this;
1630
+ }
1631
+
1632
+ var _stackSet = stackSet;
1633
+
1634
+ /**
1635
+ * Creates a stack cache object to store key-value pairs.
1636
+ *
1637
+ * @private
1638
+ * @constructor
1639
+ * @param {Array} [entries] The key-value pairs to cache.
1640
+ */
1641
+ function Stack(entries) {
1642
+ var data = this.__data__ = new _ListCache(entries);
1643
+ this.size = data.size;
1644
+ }
1645
+
1646
+ // Add methods to `Stack`.
1647
+ Stack.prototype.clear = _stackClear;
1648
+ Stack.prototype['delete'] = _stackDelete;
1649
+ Stack.prototype.get = _stackGet;
1650
+ Stack.prototype.has = _stackHas;
1651
+ Stack.prototype.set = _stackSet;
1652
+
1653
+ var _Stack = Stack;
1654
+
1655
+ var defineProperty = (function() {
1656
+ try {
1657
+ var func = _getNative(Object, 'defineProperty');
1658
+ func({}, '', {});
1659
+ return func;
1660
+ } catch (e) {}
1661
+ }());
1662
+
1663
+ var _defineProperty = defineProperty;
1664
+
1665
+ /**
1666
+ * The base implementation of `assignValue` and `assignMergeValue` without
1667
+ * value checks.
1668
+ *
1669
+ * @private
1670
+ * @param {Object} object The object to modify.
1671
+ * @param {string} key The key of the property to assign.
1672
+ * @param {*} value The value to assign.
1673
+ */
1674
+ function baseAssignValue(object, key, value) {
1675
+ if (key == '__proto__' && _defineProperty) {
1676
+ _defineProperty(object, key, {
1677
+ 'configurable': true,
1678
+ 'enumerable': true,
1679
+ 'value': value,
1680
+ 'writable': true
1681
+ });
1682
+ } else {
1683
+ object[key] = value;
1684
+ }
1685
+ }
1686
+
1687
+ var _baseAssignValue = baseAssignValue;
1688
+
1689
+ /**
1690
+ * This function is like `assignValue` except that it doesn't assign
1691
+ * `undefined` values.
1692
+ *
1693
+ * @private
1694
+ * @param {Object} object The object to modify.
1695
+ * @param {string} key The key of the property to assign.
1696
+ * @param {*} value The value to assign.
1697
+ */
1698
+ function assignMergeValue(object, key, value) {
1699
+ if ((value !== undefined && !eq_1(object[key], value)) ||
1700
+ (value === undefined && !(key in object))) {
1701
+ _baseAssignValue(object, key, value);
1702
+ }
1703
+ }
1704
+
1705
+ var _assignMergeValue = assignMergeValue;
1706
+
1707
+ /**
1708
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
1709
+ *
1710
+ * @private
1711
+ * @param {boolean} [fromRight] Specify iterating from right to left.
1712
+ * @returns {Function} Returns the new base function.
1713
+ */
1714
+ function createBaseFor(fromRight) {
1715
+ return function(object, iteratee, keysFunc) {
1716
+ var index = -1,
1717
+ iterable = Object(object),
1718
+ props = keysFunc(object),
1719
+ length = props.length;
1720
+
1721
+ while (length--) {
1722
+ var key = props[fromRight ? length : ++index];
1723
+ if (iteratee(iterable[key], key, iterable) === false) {
1724
+ break;
1725
+ }
1726
+ }
1727
+ return object;
1728
+ };
1729
+ }
1730
+
1731
+ var _createBaseFor = createBaseFor;
1732
+
1733
+ /**
1734
+ * The base implementation of `baseForOwn` which iterates over `object`
1735
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
1736
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
1737
+ *
1738
+ * @private
1739
+ * @param {Object} object The object to iterate over.
1740
+ * @param {Function} iteratee The function invoked per iteration.
1741
+ * @param {Function} keysFunc The function to get the keys of `object`.
1742
+ * @returns {Object} Returns `object`.
1743
+ */
1744
+ var baseFor = _createBaseFor();
1745
+
1746
+ var _baseFor = baseFor;
1747
+
1748
+ var _cloneBuffer = createCommonjsModule(function (module, exports) {
1749
+ /** Detect free variable `exports`. */
1750
+ var freeExports = exports && !exports.nodeType && exports;
1751
+
1752
+ /** Detect free variable `module`. */
1753
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1754
+
1755
+ /** Detect the popular CommonJS extension `module.exports`. */
1756
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1757
+
1758
+ /** Built-in value references. */
1759
+ var Buffer = moduleExports ? _root.Buffer : undefined,
1760
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1761
+
1762
+ /**
1763
+ * Creates a clone of `buffer`.
1764
+ *
1765
+ * @private
1766
+ * @param {Buffer} buffer The buffer to clone.
1767
+ * @param {boolean} [isDeep] Specify a deep clone.
1768
+ * @returns {Buffer} Returns the cloned buffer.
1769
+ */
1770
+ function cloneBuffer(buffer, isDeep) {
1771
+ if (isDeep) {
1772
+ return buffer.slice();
1773
+ }
1774
+ var length = buffer.length,
1775
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1776
+
1777
+ buffer.copy(result);
1778
+ return result;
1779
+ }
1780
+
1781
+ module.exports = cloneBuffer;
1782
+ });
1783
+
1784
+ /** Built-in value references. */
1785
+ var Uint8Array = _root.Uint8Array;
1786
+
1787
+ var _Uint8Array = Uint8Array;
1788
+
1789
+ /**
1790
+ * Creates a clone of `arrayBuffer`.
1791
+ *
1792
+ * @private
1793
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1794
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
1795
+ */
1796
+ function cloneArrayBuffer(arrayBuffer) {
1797
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1798
+ new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
1799
+ return result;
1800
+ }
1801
+
1802
+ var _cloneArrayBuffer = cloneArrayBuffer;
1803
+
1804
+ /**
1805
+ * Creates a clone of `typedArray`.
1806
+ *
1807
+ * @private
1808
+ * @param {Object} typedArray The typed array to clone.
1809
+ * @param {boolean} [isDeep] Specify a deep clone.
1810
+ * @returns {Object} Returns the cloned typed array.
1811
+ */
1812
+ function cloneTypedArray(typedArray, isDeep) {
1813
+ var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1814
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1815
+ }
1816
+
1817
+ var _cloneTypedArray = cloneTypedArray;
1818
+
1819
+ /**
1820
+ * Copies the values of `source` to `array`.
1821
+ *
1822
+ * @private
1823
+ * @param {Array} source The array to copy values from.
1824
+ * @param {Array} [array=[]] The array to copy values to.
1825
+ * @returns {Array} Returns `array`.
1826
+ */
1827
+ function copyArray(source, array) {
1828
+ var index = -1,
1829
+ length = source.length;
1830
+
1831
+ array || (array = Array(length));
1832
+ while (++index < length) {
1833
+ array[index] = source[index];
1834
+ }
1835
+ return array;
1836
+ }
1837
+
1838
+ var _copyArray = copyArray;
1839
+
1840
+ /** Built-in value references. */
1841
+ var objectCreate = Object.create;
1842
+
1843
+ /**
1844
+ * The base implementation of `_.create` without support for assigning
1845
+ * properties to the created object.
1846
+ *
1847
+ * @private
1848
+ * @param {Object} proto The object to inherit from.
1849
+ * @returns {Object} Returns the new object.
1850
+ */
1851
+ var baseCreate = (function() {
1852
+ function object() {}
1853
+ return function(proto) {
1854
+ if (!isObject_1(proto)) {
1855
+ return {};
1856
+ }
1857
+ if (objectCreate) {
1858
+ return objectCreate(proto);
1859
+ }
1860
+ object.prototype = proto;
1861
+ var result = new object;
1862
+ object.prototype = undefined;
1863
+ return result;
1864
+ };
1865
+ }());
1866
+
1867
+ var _baseCreate = baseCreate;
1868
+
1869
+ /**
1870
+ * Creates a unary function that invokes `func` with its argument transformed.
1871
+ *
1872
+ * @private
1873
+ * @param {Function} func The function to wrap.
1874
+ * @param {Function} transform The argument transform.
1875
+ * @returns {Function} Returns the new function.
1876
+ */
1877
+ function overArg(func, transform) {
1878
+ return function(arg) {
1879
+ return func(transform(arg));
1880
+ };
1881
+ }
1882
+
1883
+ var _overArg = overArg;
1884
+
1885
+ /** Built-in value references. */
1886
+ var getPrototype = _overArg(Object.getPrototypeOf, Object);
1887
+
1888
+ var _getPrototype = getPrototype;
1889
+
1890
+ /** Used for built-in method references. */
1891
+ var objectProto$5 = Object.prototype;
1892
+
1893
+ /**
1894
+ * Checks if `value` is likely a prototype object.
1895
+ *
1896
+ * @private
1897
+ * @param {*} value The value to check.
1898
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1899
+ */
1900
+ function isPrototype(value) {
1901
+ var Ctor = value && value.constructor,
1902
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
1903
+
1904
+ return value === proto;
1905
+ }
1906
+
1907
+ var _isPrototype = isPrototype;
1908
+
1909
+ /**
1910
+ * Initializes an object clone.
1911
+ *
1912
+ * @private
1913
+ * @param {Object} object The object to clone.
1914
+ * @returns {Object} Returns the initialized clone.
1915
+ */
1916
+ function initCloneObject(object) {
1917
+ return (typeof object.constructor == 'function' && !_isPrototype(object))
1918
+ ? _baseCreate(_getPrototype(object))
1919
+ : {};
1920
+ }
1921
+
1922
+ var _initCloneObject = initCloneObject;
1923
+
1924
+ /** `Object#toString` result references. */
1925
+ var argsTag$1 = '[object Arguments]';
1926
+
1927
+ /**
1928
+ * The base implementation of `_.isArguments`.
1929
+ *
1930
+ * @private
1931
+ * @param {*} value The value to check.
1932
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1933
+ */
1934
+ function baseIsArguments(value) {
1935
+ return isObjectLike_1(value) && _baseGetTag(value) == argsTag$1;
1936
+ }
1937
+
1938
+ var _baseIsArguments = baseIsArguments;
1939
+
1940
+ /** Used for built-in method references. */
1941
+ var objectProto$4 = Object.prototype;
1942
+
1943
+ /** Used to check objects for own properties. */
1944
+ var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
1945
+
1946
+ /** Built-in value references. */
1947
+ var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
1948
+
1949
+ /**
1950
+ * Checks if `value` is likely an `arguments` object.
1951
+ *
1952
+ * @static
1953
+ * @memberOf _
1954
+ * @since 0.1.0
1955
+ * @category Lang
1956
+ * @param {*} value The value to check.
1957
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1958
+ * else `false`.
1959
+ * @example
1960
+ *
1961
+ * _.isArguments(function() { return arguments; }());
1962
+ * // => true
1963
+ *
1964
+ * _.isArguments([1, 2, 3]);
1965
+ * // => false
1966
+ */
1967
+ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
1968
+ return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') &&
1969
+ !propertyIsEnumerable.call(value, 'callee');
1970
+ };
1971
+
1972
+ var isArguments_1 = isArguments;
1973
+
1974
+ /** Used as references for various `Number` constants. */
1975
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
1976
+
1977
+ /**
1978
+ * Checks if `value` is a valid array-like length.
1979
+ *
1980
+ * **Note:** This method is loosely based on
1981
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1982
+ *
1983
+ * @static
1984
+ * @memberOf _
1985
+ * @since 4.0.0
1986
+ * @category Lang
1987
+ * @param {*} value The value to check.
1988
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1989
+ * @example
1990
+ *
1991
+ * _.isLength(3);
1992
+ * // => true
1993
+ *
1994
+ * _.isLength(Number.MIN_VALUE);
1995
+ * // => false
1996
+ *
1997
+ * _.isLength(Infinity);
1998
+ * // => false
1999
+ *
2000
+ * _.isLength('3');
2001
+ * // => false
2002
+ */
2003
+ function isLength(value) {
2004
+ return typeof value == 'number' &&
2005
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
2006
+ }
2007
+
2008
+ var isLength_1 = isLength;
2009
+
2010
+ /**
2011
+ * Checks if `value` is array-like. A value is considered array-like if it's
2012
+ * not a function and has a `value.length` that's an integer greater than or
2013
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2014
+ *
2015
+ * @static
2016
+ * @memberOf _
2017
+ * @since 4.0.0
2018
+ * @category Lang
2019
+ * @param {*} value The value to check.
2020
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2021
+ * @example
2022
+ *
2023
+ * _.isArrayLike([1, 2, 3]);
2024
+ * // => true
2025
+ *
2026
+ * _.isArrayLike(document.body.children);
2027
+ * // => true
2028
+ *
2029
+ * _.isArrayLike('abc');
2030
+ * // => true
2031
+ *
2032
+ * _.isArrayLike(_.noop);
2033
+ * // => false
2034
+ */
2035
+ function isArrayLike(value) {
2036
+ return value != null && isLength_1(value.length) && !isFunction_1(value);
2037
+ }
2038
+
2039
+ var isArrayLike_1 = isArrayLike;
2040
+
2041
+ /**
2042
+ * This method is like `_.isArrayLike` except that it also checks if `value`
2043
+ * is an object.
2044
+ *
2045
+ * @static
2046
+ * @memberOf _
2047
+ * @since 4.0.0
2048
+ * @category Lang
2049
+ * @param {*} value The value to check.
2050
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
2051
+ * else `false`.
2052
+ * @example
2053
+ *
2054
+ * _.isArrayLikeObject([1, 2, 3]);
2055
+ * // => true
2056
+ *
2057
+ * _.isArrayLikeObject(document.body.children);
2058
+ * // => true
2059
+ *
2060
+ * _.isArrayLikeObject('abc');
2061
+ * // => false
2062
+ *
2063
+ * _.isArrayLikeObject(_.noop);
2064
+ * // => false
2065
+ */
2066
+ function isArrayLikeObject(value) {
2067
+ return isObjectLike_1(value) && isArrayLike_1(value);
2068
+ }
2069
+
2070
+ var isArrayLikeObject_1 = isArrayLikeObject;
2071
+
2072
+ /**
2073
+ * This method returns `false`.
2074
+ *
2075
+ * @static
2076
+ * @memberOf _
2077
+ * @since 4.13.0
2078
+ * @category Util
2079
+ * @returns {boolean} Returns `false`.
2080
+ * @example
2081
+ *
2082
+ * _.times(2, _.stubFalse);
2083
+ * // => [false, false]
2084
+ */
2085
+ function stubFalse() {
2086
+ return false;
2087
+ }
2088
+
2089
+ var stubFalse_1 = stubFalse;
2090
+
2091
+ var isBuffer_1 = createCommonjsModule(function (module, exports) {
2092
+ /** Detect free variable `exports`. */
2093
+ var freeExports = exports && !exports.nodeType && exports;
2094
+
2095
+ /** Detect free variable `module`. */
2096
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2097
+
2098
+ /** Detect the popular CommonJS extension `module.exports`. */
2099
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2100
+
2101
+ /** Built-in value references. */
2102
+ var Buffer = moduleExports ? _root.Buffer : undefined;
2103
+
2104
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2105
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
2106
+
2107
+ /**
2108
+ * Checks if `value` is a buffer.
2109
+ *
2110
+ * @static
2111
+ * @memberOf _
2112
+ * @since 4.3.0
2113
+ * @category Lang
2114
+ * @param {*} value The value to check.
2115
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2116
+ * @example
2117
+ *
2118
+ * _.isBuffer(new Buffer(2));
2119
+ * // => true
2120
+ *
2121
+ * _.isBuffer(new Uint8Array(2));
2122
+ * // => false
2123
+ */
2124
+ var isBuffer = nativeIsBuffer || stubFalse_1;
2125
+
2126
+ module.exports = isBuffer;
2127
+ });
2128
+
2129
+ /** `Object#toString` result references. */
2130
+ var objectTag$1 = '[object Object]';
2131
+
2132
+ /** Used for built-in method references. */
2133
+ var funcProto = Function.prototype,
2134
+ objectProto$3 = Object.prototype;
2135
+
2136
+ /** Used to resolve the decompiled source of functions. */
2137
+ var funcToString = funcProto.toString;
2138
+
2139
+ /** Used to check objects for own properties. */
2140
+ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
2141
+
2142
+ /** Used to infer the `Object` constructor. */
2143
+ var objectCtorString = funcToString.call(Object);
2144
+
2145
+ /**
2146
+ * Checks if `value` is a plain object, that is, an object created by the
2147
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
2148
+ *
2149
+ * @static
2150
+ * @memberOf _
2151
+ * @since 0.8.0
2152
+ * @category Lang
2153
+ * @param {*} value The value to check.
2154
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
2155
+ * @example
2156
+ *
2157
+ * function Foo() {
2158
+ * this.a = 1;
2159
+ * }
2160
+ *
2161
+ * _.isPlainObject(new Foo);
2162
+ * // => false
2163
+ *
2164
+ * _.isPlainObject([1, 2, 3]);
2165
+ * // => false
2166
+ *
2167
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
2168
+ * // => true
2169
+ *
2170
+ * _.isPlainObject(Object.create(null));
2171
+ * // => true
2172
+ */
2173
+ function isPlainObject(value) {
2174
+ if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag$1) {
2175
+ return false;
2176
+ }
2177
+ var proto = _getPrototype(value);
2178
+ if (proto === null) {
2179
+ return true;
2180
+ }
2181
+ var Ctor = hasOwnProperty$3.call(proto, 'constructor') && proto.constructor;
2182
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
2183
+ funcToString.call(Ctor) == objectCtorString;
2184
+ }
2185
+
2186
+ var isPlainObject_1 = isPlainObject;
2187
+
2188
+ /** `Object#toString` result references. */
2189
+ var argsTag = '[object Arguments]',
2190
+ arrayTag = '[object Array]',
2191
+ boolTag = '[object Boolean]',
2192
+ dateTag = '[object Date]',
2193
+ errorTag = '[object Error]',
2194
+ funcTag = '[object Function]',
2195
+ mapTag = '[object Map]',
2196
+ numberTag = '[object Number]',
2197
+ objectTag = '[object Object]',
2198
+ regexpTag = '[object RegExp]',
2199
+ setTag = '[object Set]',
2200
+ stringTag = '[object String]',
2201
+ weakMapTag = '[object WeakMap]';
2202
+
2203
+ var arrayBufferTag = '[object ArrayBuffer]',
2204
+ dataViewTag = '[object DataView]',
2205
+ float32Tag = '[object Float32Array]',
2206
+ float64Tag = '[object Float64Array]',
2207
+ int8Tag = '[object Int8Array]',
2208
+ int16Tag = '[object Int16Array]',
2209
+ int32Tag = '[object Int32Array]',
2210
+ uint8Tag = '[object Uint8Array]',
2211
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2212
+ uint16Tag = '[object Uint16Array]',
2213
+ uint32Tag = '[object Uint32Array]';
2214
+
2215
+ /** Used to identify `toStringTag` values of typed arrays. */
2216
+ var typedArrayTags = {};
2217
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
2218
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
2219
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
2220
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
2221
+ typedArrayTags[uint32Tag] = true;
2222
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
2223
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
2224
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
2225
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
2226
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
2227
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
2228
+ typedArrayTags[setTag] = typedArrayTags[stringTag] =
2229
+ typedArrayTags[weakMapTag] = false;
2230
+
2231
+ /**
2232
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
2233
+ *
2234
+ * @private
2235
+ * @param {*} value The value to check.
2236
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2237
+ */
2238
+ function baseIsTypedArray(value) {
2239
+ return isObjectLike_1(value) &&
2240
+ isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
2241
+ }
2242
+
2243
+ var _baseIsTypedArray = baseIsTypedArray;
2244
+
2245
+ /**
2246
+ * The base implementation of `_.unary` without support for storing metadata.
2247
+ *
2248
+ * @private
2249
+ * @param {Function} func The function to cap arguments for.
2250
+ * @returns {Function} Returns the new capped function.
2251
+ */
2252
+ function baseUnary(func) {
2253
+ return function(value) {
2254
+ return func(value);
2255
+ };
2256
+ }
2257
+
2258
+ var _baseUnary = baseUnary;
2259
+
2260
+ var _nodeUtil = createCommonjsModule(function (module, exports) {
2261
+ /** Detect free variable `exports`. */
2262
+ var freeExports = exports && !exports.nodeType && exports;
2263
+
2264
+ /** Detect free variable `module`. */
2265
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2266
+
2267
+ /** Detect the popular CommonJS extension `module.exports`. */
2268
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2269
+
2270
+ /** Detect free variable `process` from Node.js. */
2271
+ var freeProcess = moduleExports && _freeGlobal.process;
2272
+
2273
+ /** Used to access faster Node.js helpers. */
2274
+ var nodeUtil = (function() {
2275
+ try {
2276
+ // Use `util.types` for Node.js 10+.
2277
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
2278
+
2279
+ if (types) {
2280
+ return types;
2281
+ }
2282
+
2283
+ // Legacy `process.binding('util')` for Node.js < 10.
2284
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
2285
+ } catch (e) {}
2286
+ }());
2287
+
2288
+ module.exports = nodeUtil;
2289
+ });
2290
+
2291
+ /* Node.js helper references. */
2292
+ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
2293
+
2294
+ /**
2295
+ * Checks if `value` is classified as a typed array.
2296
+ *
2297
+ * @static
2298
+ * @memberOf _
2299
+ * @since 3.0.0
2300
+ * @category Lang
2301
+ * @param {*} value The value to check.
2302
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2303
+ * @example
2304
+ *
2305
+ * _.isTypedArray(new Uint8Array);
2306
+ * // => true
2307
+ *
2308
+ * _.isTypedArray([]);
2309
+ * // => false
2310
+ */
2311
+ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
2312
+
2313
+ var isTypedArray_1 = isTypedArray;
2314
+
2315
+ /**
2316
+ * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
2317
+ *
2318
+ * @private
2319
+ * @param {Object} object The object to query.
2320
+ * @param {string} key The key of the property to get.
2321
+ * @returns {*} Returns the property value.
2322
+ */
2323
+ function safeGet(object, key) {
2324
+ if (key === 'constructor' && typeof object[key] === 'function') {
2325
+ return;
2326
+ }
2327
+
2328
+ if (key == '__proto__') {
2329
+ return;
2330
+ }
2331
+
2332
+ return object[key];
2333
+ }
2334
+
2335
+ var _safeGet = safeGet;
2336
+
2337
+ /** Used for built-in method references. */
2338
+ var objectProto$2 = Object.prototype;
2339
+
2340
+ /** Used to check objects for own properties. */
2341
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2342
+
2343
+ /**
2344
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
2345
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2346
+ * for equality comparisons.
2347
+ *
2348
+ * @private
2349
+ * @param {Object} object The object to modify.
2350
+ * @param {string} key The key of the property to assign.
2351
+ * @param {*} value The value to assign.
2352
+ */
2353
+ function assignValue(object, key, value) {
2354
+ var objValue = object[key];
2355
+ if (!(hasOwnProperty$2.call(object, key) && eq_1(objValue, value)) ||
2356
+ (value === undefined && !(key in object))) {
2357
+ _baseAssignValue(object, key, value);
2358
+ }
2359
+ }
2360
+
2361
+ var _assignValue = assignValue;
2362
+
2363
+ /**
2364
+ * Copies properties of `source` to `object`.
2365
+ *
2366
+ * @private
2367
+ * @param {Object} source The object to copy properties from.
2368
+ * @param {Array} props The property identifiers to copy.
2369
+ * @param {Object} [object={}] The object to copy properties to.
2370
+ * @param {Function} [customizer] The function to customize copied values.
2371
+ * @returns {Object} Returns `object`.
2372
+ */
2373
+ function copyObject(source, props, object, customizer) {
2374
+ var isNew = !object;
2375
+ object || (object = {});
2376
+
2377
+ var index = -1,
2378
+ length = props.length;
2379
+
2380
+ while (++index < length) {
2381
+ var key = props[index];
2382
+
2383
+ var newValue = customizer
2384
+ ? customizer(object[key], source[key], key, object, source)
2385
+ : undefined;
2386
+
2387
+ if (newValue === undefined) {
2388
+ newValue = source[key];
2389
+ }
2390
+ if (isNew) {
2391
+ _baseAssignValue(object, key, newValue);
2392
+ } else {
2393
+ _assignValue(object, key, newValue);
2394
+ }
2395
+ }
2396
+ return object;
2397
+ }
2398
+
2399
+ var _copyObject = copyObject;
2400
+
2401
+ /**
2402
+ * The base implementation of `_.times` without support for iteratee shorthands
2403
+ * or max array length checks.
2404
+ *
2405
+ * @private
2406
+ * @param {number} n The number of times to invoke `iteratee`.
2407
+ * @param {Function} iteratee The function invoked per iteration.
2408
+ * @returns {Array} Returns the array of results.
2409
+ */
2410
+ function baseTimes(n, iteratee) {
2411
+ var index = -1,
2412
+ result = Array(n);
2413
+
2414
+ while (++index < n) {
2415
+ result[index] = iteratee(index);
2416
+ }
2417
+ return result;
2418
+ }
2419
+
2420
+ var _baseTimes = baseTimes;
2421
+
2422
+ /** Used as references for various `Number` constants. */
2423
+ var MAX_SAFE_INTEGER = 9007199254740991;
2424
+
2425
+ /** Used to detect unsigned integer values. */
2426
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2427
+
2428
+ /**
2429
+ * Checks if `value` is a valid array-like index.
2430
+ *
2431
+ * @private
2432
+ * @param {*} value The value to check.
2433
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2434
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2435
+ */
2436
+ function isIndex(value, length) {
2437
+ var type = typeof value;
2438
+ length = length == null ? MAX_SAFE_INTEGER : length;
2439
+
2440
+ return !!length &&
2441
+ (type == 'number' ||
2442
+ (type != 'symbol' && reIsUint.test(value))) &&
2443
+ (value > -1 && value % 1 == 0 && value < length);
2444
+ }
2445
+
2446
+ var _isIndex = isIndex;
2447
+
2448
+ /** Used for built-in method references. */
2449
+ var objectProto$1 = Object.prototype;
2450
+
2451
+ /** Used to check objects for own properties. */
2452
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2453
+
2454
+ /**
2455
+ * Creates an array of the enumerable property names of the array-like `value`.
2456
+ *
2457
+ * @private
2458
+ * @param {*} value The value to query.
2459
+ * @param {boolean} inherited Specify returning inherited property names.
2460
+ * @returns {Array} Returns the array of property names.
2461
+ */
2462
+ function arrayLikeKeys(value, inherited) {
2463
+ var isArr = isArray_1(value),
2464
+ isArg = !isArr && isArguments_1(value),
2465
+ isBuff = !isArr && !isArg && isBuffer_1(value),
2466
+ isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
2467
+ skipIndexes = isArr || isArg || isBuff || isType,
2468
+ result = skipIndexes ? _baseTimes(value.length, String) : [],
2469
+ length = result.length;
2470
+
2471
+ for (var key in value) {
2472
+ if ((inherited || hasOwnProperty$1.call(value, key)) &&
2473
+ !(skipIndexes && (
2474
+ // Safari 9 has enumerable `arguments.length` in strict mode.
2475
+ key == 'length' ||
2476
+ // Node.js 0.10 has enumerable non-index properties on buffers.
2477
+ (isBuff && (key == 'offset' || key == 'parent')) ||
2478
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
2479
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2480
+ // Skip index properties.
2481
+ _isIndex(key, length)
2482
+ ))) {
2483
+ result.push(key);
2484
+ }
2485
+ }
2486
+ return result;
2487
+ }
2488
+
2489
+ var _arrayLikeKeys = arrayLikeKeys;
2490
+
2491
+ /**
2492
+ * This function is like
2493
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2494
+ * except that it includes inherited enumerable properties.
2495
+ *
2496
+ * @private
2497
+ * @param {Object} object The object to query.
2498
+ * @returns {Array} Returns the array of property names.
2499
+ */
2500
+ function nativeKeysIn(object) {
2501
+ var result = [];
2502
+ if (object != null) {
2503
+ for (var key in Object(object)) {
2504
+ result.push(key);
2505
+ }
2506
+ }
2507
+ return result;
2508
+ }
2509
+
2510
+ var _nativeKeysIn = nativeKeysIn;
2511
+
2512
+ /** Used for built-in method references. */
2513
+ var objectProto = Object.prototype;
2514
+
2515
+ /** Used to check objects for own properties. */
2516
+ var hasOwnProperty = objectProto.hasOwnProperty;
2517
+
2518
+ /**
2519
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
2520
+ *
2521
+ * @private
2522
+ * @param {Object} object The object to query.
2523
+ * @returns {Array} Returns the array of property names.
2524
+ */
2525
+ function baseKeysIn(object) {
2526
+ if (!isObject_1(object)) {
2527
+ return _nativeKeysIn(object);
2528
+ }
2529
+ var isProto = _isPrototype(object),
2530
+ result = [];
2531
+
2532
+ for (var key in object) {
2533
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
2534
+ result.push(key);
2535
+ }
2536
+ }
2537
+ return result;
2538
+ }
2539
+
2540
+ var _baseKeysIn = baseKeysIn;
2541
+
2542
+ /**
2543
+ * Creates an array of the own and inherited enumerable property names of `object`.
2544
+ *
2545
+ * **Note:** Non-object values are coerced to objects.
2546
+ *
2547
+ * @static
2548
+ * @memberOf _
2549
+ * @since 3.0.0
2550
+ * @category Object
2551
+ * @param {Object} object The object to query.
2552
+ * @returns {Array} Returns the array of property names.
2553
+ * @example
2554
+ *
2555
+ * function Foo() {
2556
+ * this.a = 1;
2557
+ * this.b = 2;
2558
+ * }
2559
+ *
2560
+ * Foo.prototype.c = 3;
2561
+ *
2562
+ * _.keysIn(new Foo);
2563
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
2564
+ */
2565
+ function keysIn(object) {
2566
+ return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
2567
+ }
2568
+
2569
+ var keysIn_1 = keysIn;
2570
+
2571
+ /**
2572
+ * Converts `value` to a plain object flattening inherited enumerable string
2573
+ * keyed properties of `value` to own properties of the plain object.
2574
+ *
2575
+ * @static
2576
+ * @memberOf _
2577
+ * @since 3.0.0
2578
+ * @category Lang
2579
+ * @param {*} value The value to convert.
2580
+ * @returns {Object} Returns the converted plain object.
2581
+ * @example
2582
+ *
2583
+ * function Foo() {
2584
+ * this.b = 2;
2585
+ * }
2586
+ *
2587
+ * Foo.prototype.c = 3;
2588
+ *
2589
+ * _.assign({ 'a': 1 }, new Foo);
2590
+ * // => { 'a': 1, 'b': 2 }
2591
+ *
2592
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
2593
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
2594
+ */
2595
+ function toPlainObject(value) {
2596
+ return _copyObject(value, keysIn_1(value));
2597
+ }
2598
+
2599
+ var toPlainObject_1 = toPlainObject;
2600
+
2601
+ /**
2602
+ * A specialized version of `baseMerge` for arrays and objects which performs
2603
+ * deep merges and tracks traversed objects enabling objects with circular
2604
+ * references to be merged.
2605
+ *
2606
+ * @private
2607
+ * @param {Object} object The destination object.
2608
+ * @param {Object} source The source object.
2609
+ * @param {string} key The key of the value to merge.
2610
+ * @param {number} srcIndex The index of `source`.
2611
+ * @param {Function} mergeFunc The function to merge values.
2612
+ * @param {Function} [customizer] The function to customize assigned values.
2613
+ * @param {Object} [stack] Tracks traversed source values and their merged
2614
+ * counterparts.
2615
+ */
2616
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
2617
+ var objValue = _safeGet(object, key),
2618
+ srcValue = _safeGet(source, key),
2619
+ stacked = stack.get(srcValue);
2620
+
2621
+ if (stacked) {
2622
+ _assignMergeValue(object, key, stacked);
2623
+ return;
2624
+ }
2625
+ var newValue = customizer
2626
+ ? customizer(objValue, srcValue, (key + ''), object, source, stack)
2627
+ : undefined;
2628
+
2629
+ var isCommon = newValue === undefined;
2630
+
2631
+ if (isCommon) {
2632
+ var isArr = isArray_1(srcValue),
2633
+ isBuff = !isArr && isBuffer_1(srcValue),
2634
+ isTyped = !isArr && !isBuff && isTypedArray_1(srcValue);
2635
+
2636
+ newValue = srcValue;
2637
+ if (isArr || isBuff || isTyped) {
2638
+ if (isArray_1(objValue)) {
2639
+ newValue = objValue;
2640
+ }
2641
+ else if (isArrayLikeObject_1(objValue)) {
2642
+ newValue = _copyArray(objValue);
2643
+ }
2644
+ else if (isBuff) {
2645
+ isCommon = false;
2646
+ newValue = _cloneBuffer(srcValue, true);
2647
+ }
2648
+ else if (isTyped) {
2649
+ isCommon = false;
2650
+ newValue = _cloneTypedArray(srcValue, true);
2651
+ }
2652
+ else {
2653
+ newValue = [];
2654
+ }
2655
+ }
2656
+ else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) {
2657
+ newValue = objValue;
2658
+ if (isArguments_1(objValue)) {
2659
+ newValue = toPlainObject_1(objValue);
2660
+ }
2661
+ else if (!isObject_1(objValue) || isFunction_1(objValue)) {
2662
+ newValue = _initCloneObject(srcValue);
2663
+ }
2664
+ }
2665
+ else {
2666
+ isCommon = false;
2667
+ }
2668
+ }
2669
+ if (isCommon) {
2670
+ // Recursively merge objects and arrays (susceptible to call stack limits).
2671
+ stack.set(srcValue, newValue);
2672
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
2673
+ stack['delete'](srcValue);
2674
+ }
2675
+ _assignMergeValue(object, key, newValue);
2676
+ }
2677
+
2678
+ var _baseMergeDeep = baseMergeDeep;
2679
+
2680
+ /**
2681
+ * The base implementation of `_.merge` without support for multiple sources.
2682
+ *
2683
+ * @private
2684
+ * @param {Object} object The destination object.
2685
+ * @param {Object} source The source object.
2686
+ * @param {number} srcIndex The index of `source`.
2687
+ * @param {Function} [customizer] The function to customize merged values.
2688
+ * @param {Object} [stack] Tracks traversed source values and their merged
2689
+ * counterparts.
2690
+ */
2691
+ function baseMerge(object, source, srcIndex, customizer, stack) {
2692
+ if (object === source) {
2693
+ return;
2694
+ }
2695
+ _baseFor(source, function(srcValue, key) {
2696
+ stack || (stack = new _Stack);
2697
+ if (isObject_1(srcValue)) {
2698
+ _baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
2699
+ }
2700
+ else {
2701
+ var newValue = customizer
2702
+ ? customizer(_safeGet(object, key), srcValue, (key + ''), object, source, stack)
2703
+ : undefined;
2704
+
2705
+ if (newValue === undefined) {
2706
+ newValue = srcValue;
2707
+ }
2708
+ _assignMergeValue(object, key, newValue);
2709
+ }
2710
+ }, keysIn_1);
2711
+ }
2712
+
2713
+ var _baseMerge = baseMerge;
2714
+
2715
+ /**
2716
+ * This method returns the first argument it receives.
2717
+ *
2718
+ * @static
2719
+ * @since 0.1.0
2720
+ * @memberOf _
2721
+ * @category Util
2722
+ * @param {*} value Any value.
2723
+ * @returns {*} Returns `value`.
2724
+ * @example
2725
+ *
2726
+ * var object = { 'a': 1 };
2727
+ *
2728
+ * console.log(_.identity(object) === object);
2729
+ * // => true
2730
+ */
2731
+ function identity(value) {
2732
+ return value;
2733
+ }
2734
+
2735
+ var identity_1 = identity;
2736
+
2737
+ /**
2738
+ * A faster alternative to `Function#apply`, this function invokes `func`
2739
+ * with the `this` binding of `thisArg` and the arguments of `args`.
2740
+ *
2741
+ * @private
2742
+ * @param {Function} func The function to invoke.
2743
+ * @param {*} thisArg The `this` binding of `func`.
2744
+ * @param {Array} args The arguments to invoke `func` with.
2745
+ * @returns {*} Returns the result of `func`.
2746
+ */
2747
+ function apply(func, thisArg, args) {
2748
+ switch (args.length) {
2749
+ case 0: return func.call(thisArg);
2750
+ case 1: return func.call(thisArg, args[0]);
2751
+ case 2: return func.call(thisArg, args[0], args[1]);
2752
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
2753
+ }
2754
+ return func.apply(thisArg, args);
2755
+ }
2756
+
2757
+ var _apply = apply;
2758
+
2759
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2760
+ var nativeMax = Math.max;
2761
+
2762
+ /**
2763
+ * A specialized version of `baseRest` which transforms the rest array.
2764
+ *
2765
+ * @private
2766
+ * @param {Function} func The function to apply a rest parameter to.
2767
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
2768
+ * @param {Function} transform The rest array transform.
2769
+ * @returns {Function} Returns the new function.
2770
+ */
2771
+ function overRest(func, start, transform) {
2772
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
2773
+ return function() {
2774
+ var args = arguments,
2775
+ index = -1,
2776
+ length = nativeMax(args.length - start, 0),
2777
+ array = Array(length);
2778
+
2779
+ while (++index < length) {
2780
+ array[index] = args[start + index];
2781
+ }
2782
+ index = -1;
2783
+ var otherArgs = Array(start + 1);
2784
+ while (++index < start) {
2785
+ otherArgs[index] = args[index];
2786
+ }
2787
+ otherArgs[start] = transform(array);
2788
+ return _apply(func, this, otherArgs);
2789
+ };
2790
+ }
2791
+
2792
+ var _overRest = overRest;
2793
+
2794
+ /**
2795
+ * Creates a function that returns `value`.
2796
+ *
2797
+ * @static
2798
+ * @memberOf _
2799
+ * @since 2.4.0
2800
+ * @category Util
2801
+ * @param {*} value The value to return from the new function.
2802
+ * @returns {Function} Returns the new constant function.
2803
+ * @example
2804
+ *
2805
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
2806
+ *
2807
+ * console.log(objects);
2808
+ * // => [{ 'a': 1 }, { 'a': 1 }]
2809
+ *
2810
+ * console.log(objects[0] === objects[1]);
2811
+ * // => true
2812
+ */
2813
+ function constant(value) {
2814
+ return function() {
2815
+ return value;
2816
+ };
2817
+ }
2818
+
2819
+ var constant_1 = constant;
2820
+
2821
+ /**
2822
+ * The base implementation of `setToString` without support for hot loop shorting.
2823
+ *
2824
+ * @private
2825
+ * @param {Function} func The function to modify.
2826
+ * @param {Function} string The `toString` result.
2827
+ * @returns {Function} Returns `func`.
2828
+ */
2829
+ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
2830
+ return _defineProperty(func, 'toString', {
2831
+ 'configurable': true,
2832
+ 'enumerable': false,
2833
+ 'value': constant_1(string),
2834
+ 'writable': true
2835
+ });
2836
+ };
2837
+
2838
+ var _baseSetToString = baseSetToString;
2839
+
2840
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
2841
+ var HOT_COUNT = 800,
2842
+ HOT_SPAN = 16;
2843
+
2844
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2845
+ var nativeNow = Date.now;
2846
+
2847
+ /**
2848
+ * Creates a function that'll short out and invoke `identity` instead
2849
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
2850
+ * milliseconds.
2851
+ *
2852
+ * @private
2853
+ * @param {Function} func The function to restrict.
2854
+ * @returns {Function} Returns the new shortable function.
2855
+ */
2856
+ function shortOut(func) {
2857
+ var count = 0,
2858
+ lastCalled = 0;
2859
+
2860
+ return function() {
2861
+ var stamp = nativeNow(),
2862
+ remaining = HOT_SPAN - (stamp - lastCalled);
2863
+
2864
+ lastCalled = stamp;
2865
+ if (remaining > 0) {
2866
+ if (++count >= HOT_COUNT) {
2867
+ return arguments[0];
2868
+ }
2869
+ } else {
2870
+ count = 0;
2871
+ }
2872
+ return func.apply(undefined, arguments);
2873
+ };
2874
+ }
2875
+
2876
+ var _shortOut = shortOut;
2877
+
2878
+ /**
2879
+ * Sets the `toString` method of `func` to return `string`.
2880
+ *
2881
+ * @private
2882
+ * @param {Function} func The function to modify.
2883
+ * @param {Function} string The `toString` result.
2884
+ * @returns {Function} Returns `func`.
2885
+ */
2886
+ var setToString = _shortOut(_baseSetToString);
2887
+
2888
+ var _setToString = setToString;
2889
+
2890
+ /**
2891
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
2892
+ *
2893
+ * @private
2894
+ * @param {Function} func The function to apply a rest parameter to.
2895
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
2896
+ * @returns {Function} Returns the new function.
2897
+ */
2898
+ function baseRest(func, start) {
2899
+ return _setToString(_overRest(func, start, identity_1), func + '');
2900
+ }
2901
+
2902
+ var _baseRest = baseRest;
2903
+
2904
+ /**
2905
+ * Checks if the given arguments are from an iteratee call.
2906
+ *
2907
+ * @private
2908
+ * @param {*} value The potential iteratee value argument.
2909
+ * @param {*} index The potential iteratee index or key argument.
2910
+ * @param {*} object The potential iteratee object argument.
2911
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
2912
+ * else `false`.
2913
+ */
2914
+ function isIterateeCall(value, index, object) {
2915
+ if (!isObject_1(object)) {
2916
+ return false;
2917
+ }
2918
+ var type = typeof index;
2919
+ if (type == 'number'
2920
+ ? (isArrayLike_1(object) && _isIndex(index, object.length))
2921
+ : (type == 'string' && index in object)
2922
+ ) {
2923
+ return eq_1(object[index], value);
2924
+ }
2925
+ return false;
2926
+ }
2927
+
2928
+ var _isIterateeCall = isIterateeCall;
2929
+
2930
+ /**
2931
+ * Creates a function like `_.assign`.
2932
+ *
2933
+ * @private
2934
+ * @param {Function} assigner The function to assign values.
2935
+ * @returns {Function} Returns the new assigner function.
2936
+ */
2937
+ function createAssigner(assigner) {
2938
+ return _baseRest(function(object, sources) {
2939
+ var index = -1,
2940
+ length = sources.length,
2941
+ customizer = length > 1 ? sources[length - 1] : undefined,
2942
+ guard = length > 2 ? sources[2] : undefined;
2943
+
2944
+ customizer = (assigner.length > 3 && typeof customizer == 'function')
2945
+ ? (length--, customizer)
2946
+ : undefined;
2947
+
2948
+ if (guard && _isIterateeCall(sources[0], sources[1], guard)) {
2949
+ customizer = length < 3 ? undefined : customizer;
2950
+ length = 1;
2951
+ }
2952
+ object = Object(object);
2953
+ while (++index < length) {
2954
+ var source = sources[index];
2955
+ if (source) {
2956
+ assigner(object, source, index, customizer);
2957
+ }
2958
+ }
2959
+ return object;
2960
+ });
2961
+ }
2962
+
2963
+ var _createAssigner = createAssigner;
2964
+
2965
+ /**
2966
+ * This method is like `_.assign` except that it recursively merges own and
2967
+ * inherited enumerable string keyed properties of source objects into the
2968
+ * destination object. Source properties that resolve to `undefined` are
2969
+ * skipped if a destination value exists. Array and plain object properties
2970
+ * are merged recursively. Other objects and value types are overridden by
2971
+ * assignment. Source objects are applied from left to right. Subsequent
2972
+ * sources overwrite property assignments of previous sources.
2973
+ *
2974
+ * **Note:** This method mutates `object`.
2975
+ *
2976
+ * @static
2977
+ * @memberOf _
2978
+ * @since 0.5.0
2979
+ * @category Object
2980
+ * @param {Object} object The destination object.
2981
+ * @param {...Object} [sources] The source objects.
2982
+ * @returns {Object} Returns `object`.
2983
+ * @example
2984
+ *
2985
+ * var object = {
2986
+ * 'a': [{ 'b': 2 }, { 'd': 4 }]
2987
+ * };
2988
+ *
2989
+ * var other = {
2990
+ * 'a': [{ 'c': 3 }, { 'e': 5 }]
2991
+ * };
2992
+ *
2993
+ * _.merge(object, other);
2994
+ * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
2995
+ */
2996
+ var merge = _createAssigner(function(object, source, srcIndex) {
2997
+ _baseMerge(object, source, srcIndex);
2998
+ });
2999
+
3000
+ var merge_1 = merge;
3001
+
3002
+ var style = {"list":"_IsXdU","default-list":"_QD1Mz","is-selected-all":"_M-mOy","item-label":"_LLTTB","list-item":"_PKNDm","default-list-item":"_KtOsz","is-selected":"_TQhBB","default-item-label":"_gLh9e","default-item-des":"_GodU-","single-checked":"_2rUrh","is-disabled":"_NbwX5","default-item-description":"_yjSTl"};
3003
+
3004
+ const _excluded = ["children"];
3005
+ const SelectList = _ref => {
3006
+ let {
3007
+ children
3008
+ } = _ref,
3009
+ p = _objectWithoutPropertiesLoose(_ref, _excluded);
3010
+ const props = Object.assign({}, {
3011
+ renderList: ({
3012
+ props,
3013
+ isSelectedAll,
3014
+ value,
3015
+ list,
3016
+ onSelect,
3017
+ setValue,
3018
+ onOpenChange
3019
+ }) => {
3020
+ const {
3021
+ single,
3022
+ isPopup
3023
+ } = props;
3024
+ return /*#__PURE__*/React.createElement(List, {
3025
+ className: classnames(style['default-list'], {
3026
+ [style['is-selected-all']]: isSelectedAll
3027
+ }),
3028
+ size: "small",
3029
+ dataSource: list,
3030
+ renderItem: item => {
3031
+ const isChecked = value.some(target => target.value === item.value);
3032
+ return /*#__PURE__*/React.createElement(List.Item, {
3033
+ className: classnames(style['default-list-item'], {
3034
+ [style['is-selected']]: isChecked
3035
+ }),
3036
+ key: item.value,
3037
+ onClick: () => {
3038
+ if (item.disabled) {
3039
+ return;
3040
+ }
3041
+ if (isSelectedAll) {
3042
+ return;
3043
+ }
3044
+ if (single) {
3045
+ setValue([item]);
3046
+ } else {
3047
+ onSelect(item);
3048
+ }
3049
+ if (isPopup && single) {
3050
+ onOpenChange(false);
3051
+ }
3052
+ }
3053
+ }, !single && /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Checkbox, {
3054
+ checked: isSelectedAll || isChecked,
3055
+ disabled: isSelectedAll || item.disabled
3056
+ })), /*#__PURE__*/React.createElement(Flex, {
3057
+ vertical: true,
3058
+ gag: 8,
3059
+ flex: 1
3060
+ }, /*#__PURE__*/React.createElement("div", {
3061
+ className: style['default-item-label']
3062
+ }, item.label), item.description && /*#__PURE__*/React.createElement("div", {
3063
+ className: style['default-item-description']
3064
+ }, item.description)), single && /*#__PURE__*/React.createElement("div", {
3065
+ className: style['single-checked']
3066
+ }, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
3067
+ }
3068
+ });
3069
+ }
3070
+ }, p);
3071
+ return /*#__PURE__*/React.createElement(SelectInput, props, targetProps => {
3072
+ const {
3073
+ props,
3074
+ value,
3075
+ searchText,
3076
+ setSearchText
3077
+ } = targetProps;
3078
+ const {
3079
+ isPopup,
3080
+ getSearchProps,
3081
+ getSearchCallback,
3082
+ searchPlaceholder
3083
+ } = props;
3084
+ const {
3085
+ single,
3086
+ allowSelectedAll,
3087
+ showSelectedTag,
3088
+ api,
3089
+ options,
3090
+ renderList,
3091
+ selectedAllValue
3092
+ } = props;
3093
+ const components = {
3094
+ search: (api && typeof getSearchProps === 'function' || options && typeof getSearchCallback === 'function') && /*#__PURE__*/React.createElement(SearchInput, {
3095
+ placeholder: searchPlaceholder,
3096
+ value: searchText,
3097
+ onSearch: value => {
3098
+ setSearchText(value);
3099
+ },
3100
+ simple: isPopup,
3101
+ showSearchButton: !isPopup
3102
+ }),
3103
+ selectedAll: !single && allowSelectedAll && /*#__PURE__*/React.createElement(SelectedAll, null),
3104
+ fetchList: /*#__PURE__*/React.createElement(FetchScrollLoader, _extends({}, props, {
3105
+ className: style['list'],
3106
+ api: Object.assign({}, options ? {
3107
+ data: {
3108
+ options,
3109
+ searchText
3110
+ },
3111
+ loader: ({
3112
+ data
3113
+ }) => {
3114
+ const {
3115
+ options,
3116
+ searchText
3117
+ } = data;
3118
+ if (typeof getSearchCallback === 'function') {
3119
+ const newOptions = options.filter(item => getSearchCallback(searchText, item));
3120
+ return {
3121
+ pageData: newOptions,
3122
+ totalCount: newOptions.length
3123
+ };
3124
+ }
3125
+ return {
3126
+ pageData: options,
3127
+ totalCount: options.length
3128
+ };
3129
+ }
3130
+ } : merge_1({}, api, typeof getSearchProps === 'function' && searchText ? getSearchProps(searchText) : {}))
3131
+ }), fetchProps => {
3132
+ const isSelectedAll = computedIsSelectAll(value, selectedAllValue);
3133
+ return renderList(Object.assign({}, fetchProps, targetProps, {
3134
+ isSelectedAll
3135
+ }));
3136
+ }),
3137
+ selectedTag: showSelectedTag && /*#__PURE__*/React.createElement(SelectedTagList, null)
3138
+ };
3139
+ if (typeof children === 'function') {
3140
+ return children(components);
3141
+ }
3142
+ return /*#__PURE__*/React.createElement(Flex, {
3143
+ vertical: true
3144
+ }, components.search, components.selectedAll, components.fetchList, components.selectedTag);
3145
+ });
3146
+ };
3147
+
3148
+ export { SelectInput, SelectedAll, SelectedTagList, SelectList as default };
3149
+ //# sourceMappingURL=index.modern.js.map