@bigbinary/neetoui 5.2.30 → 5.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/formik.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { createContext, useLayoutEffect, useEffect, useContext, useRef, useInsertionEffect as useInsertionEffect$1, useCallback, useMemo, forwardRef as forwardRef$1, createElement, useId as useId$1, useState, cloneElement, Children, isValidElement, useSyncExternalStore, Fragment, Component, startTransition } from 'react';
3
3
  import { useFormikContext, Field, Form as Form$1, Formik, useField } from 'formik';
4
+ import { isEmpty, equals, is, replace as replace$1, assoc, pluck, mergeLeft, prop, either, isNil } from 'ramda';
4
5
  import { Link, useHistory } from 'react-router-dom';
5
6
  import ReactDOM, { createPortal } from 'react-dom';
6
7
  import { Close, Info, Down, Check } from '@bigbinary/neeto-icons';
8
+ import '@bigbinary/neeto-cist';
7
9
  import _ConfigProvider from 'antd/lib/config-provider';
8
10
  import _Slider from 'antd/lib/slider';
9
11
  import _TreeSelect from 'antd/lib/tree-select';
@@ -79,1558 +81,6 @@ var classnames$2 = {exports: {}};
79
81
 
80
82
  var classnames$1 = classnames$2.exports;
81
83
 
82
- function _isPlaceholder(a) {
83
- return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
84
- }
85
-
86
- /**
87
- * Optimized internal one-arity curry function.
88
- *
89
- * @private
90
- * @category Function
91
- * @param {Function} fn The function to curry.
92
- * @return {Function} The curried function.
93
- */
94
-
95
- function _curry1(fn) {
96
- return function f1(a) {
97
- if (arguments.length === 0 || _isPlaceholder(a)) {
98
- return f1;
99
- } else {
100
- return fn.apply(this, arguments);
101
- }
102
- };
103
- }
104
-
105
- /**
106
- * Optimized internal two-arity curry function.
107
- *
108
- * @private
109
- * @category Function
110
- * @param {Function} fn The function to curry.
111
- * @return {Function} The curried function.
112
- */
113
-
114
- function _curry2(fn) {
115
- return function f2(a, b) {
116
- switch (arguments.length) {
117
- case 0:
118
- return f2;
119
-
120
- case 1:
121
- return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
122
- return fn(a, _b);
123
- });
124
-
125
- default:
126
- return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
127
- return fn(_a, b);
128
- }) : _isPlaceholder(b) ? _curry1(function (_b) {
129
- return fn(a, _b);
130
- }) : fn(a, b);
131
- }
132
- };
133
- }
134
-
135
- /**
136
- * Private `concat` function to merge two array-like objects.
137
- *
138
- * @private
139
- * @param {Array|Arguments} [set1=[]] An array-like object.
140
- * @param {Array|Arguments} [set2=[]] An array-like object.
141
- * @return {Array} A new, merged array.
142
- * @example
143
- *
144
- * _concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]
145
- */
146
- function _concat(set1, set2) {
147
- set1 = set1 || [];
148
- set2 = set2 || [];
149
- var idx;
150
- var len1 = set1.length;
151
- var len2 = set2.length;
152
- var result = [];
153
- idx = 0;
154
-
155
- while (idx < len1) {
156
- result[result.length] = set1[idx];
157
- idx += 1;
158
- }
159
-
160
- idx = 0;
161
-
162
- while (idx < len2) {
163
- result[result.length] = set2[idx];
164
- idx += 1;
165
- }
166
-
167
- return result;
168
- }
169
-
170
- function _arity(n, fn) {
171
- /* eslint-disable no-unused-vars */
172
- switch (n) {
173
- case 0:
174
- return function () {
175
- return fn.apply(this, arguments);
176
- };
177
-
178
- case 1:
179
- return function (a0) {
180
- return fn.apply(this, arguments);
181
- };
182
-
183
- case 2:
184
- return function (a0, a1) {
185
- return fn.apply(this, arguments);
186
- };
187
-
188
- case 3:
189
- return function (a0, a1, a2) {
190
- return fn.apply(this, arguments);
191
- };
192
-
193
- case 4:
194
- return function (a0, a1, a2, a3) {
195
- return fn.apply(this, arguments);
196
- };
197
-
198
- case 5:
199
- return function (a0, a1, a2, a3, a4) {
200
- return fn.apply(this, arguments);
201
- };
202
-
203
- case 6:
204
- return function (a0, a1, a2, a3, a4, a5) {
205
- return fn.apply(this, arguments);
206
- };
207
-
208
- case 7:
209
- return function (a0, a1, a2, a3, a4, a5, a6) {
210
- return fn.apply(this, arguments);
211
- };
212
-
213
- case 8:
214
- return function (a0, a1, a2, a3, a4, a5, a6, a7) {
215
- return fn.apply(this, arguments);
216
- };
217
-
218
- case 9:
219
- return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
220
- return fn.apply(this, arguments);
221
- };
222
-
223
- case 10:
224
- return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
225
- return fn.apply(this, arguments);
226
- };
227
-
228
- default:
229
- throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
230
- }
231
- }
232
-
233
- /**
234
- * Internal curryN function.
235
- *
236
- * @private
237
- * @category Function
238
- * @param {Number} length The arity of the curried function.
239
- * @param {Array} received An array of arguments received thus far.
240
- * @param {Function} fn The function to curry.
241
- * @return {Function} The curried function.
242
- */
243
-
244
- function _curryN(length, received, fn) {
245
- return function () {
246
- var combined = [];
247
- var argsIdx = 0;
248
- var left = length;
249
- var combinedIdx = 0;
250
-
251
- while (combinedIdx < received.length || argsIdx < arguments.length) {
252
- var result;
253
-
254
- if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {
255
- result = received[combinedIdx];
256
- } else {
257
- result = arguments[argsIdx];
258
- argsIdx += 1;
259
- }
260
-
261
- combined[combinedIdx] = result;
262
-
263
- if (!_isPlaceholder(result)) {
264
- left -= 1;
265
- }
266
-
267
- combinedIdx += 1;
268
- }
269
-
270
- return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
271
- };
272
- }
273
-
274
- /**
275
- * Returns a curried equivalent of the provided function, with the specified
276
- * arity. The curried function has two unusual capabilities. First, its
277
- * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the
278
- * following are equivalent:
279
- *
280
- * - `g(1)(2)(3)`
281
- * - `g(1)(2, 3)`
282
- * - `g(1, 2)(3)`
283
- * - `g(1, 2, 3)`
284
- *
285
- * Secondly, the special placeholder value [`R.__`](#__) may be used to specify
286
- * "gaps", allowing partial application of any combination of arguments,
287
- * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
288
- * the following are equivalent:
289
- *
290
- * - `g(1, 2, 3)`
291
- * - `g(_, 2, 3)(1)`
292
- * - `g(_, _, 3)(1)(2)`
293
- * - `g(_, _, 3)(1, 2)`
294
- * - `g(_, 2)(1)(3)`
295
- * - `g(_, 2)(1, 3)`
296
- * - `g(_, 2)(_, 3)(1)`
297
- *
298
- * @func
299
- * @memberOf R
300
- * @since v0.5.0
301
- * @category Function
302
- * @sig Number -> (* -> a) -> (* -> a)
303
- * @param {Number} length The arity for the returned function.
304
- * @param {Function} fn The function to curry.
305
- * @return {Function} A new, curried function.
306
- * @see R.curry
307
- * @example
308
- *
309
- * const sumArgs = (...args) => R.sum(args);
310
- *
311
- * const curriedAddFourNumbers = R.curryN(4, sumArgs);
312
- * const f = curriedAddFourNumbers(1, 2);
313
- * const g = f(3);
314
- * g(4); //=> 10
315
- */
316
-
317
- var curryN =
318
- /*#__PURE__*/
319
- _curry2(function curryN(length, fn) {
320
- if (length === 1) {
321
- return _curry1(fn);
322
- }
323
-
324
- return _arity(length, _curryN(length, [], fn));
325
- });
326
-
327
- /**
328
- * Optimized internal three-arity curry function.
329
- *
330
- * @private
331
- * @category Function
332
- * @param {Function} fn The function to curry.
333
- * @return {Function} The curried function.
334
- */
335
-
336
- function _curry3(fn) {
337
- return function f3(a, b, c) {
338
- switch (arguments.length) {
339
- case 0:
340
- return f3;
341
-
342
- case 1:
343
- return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {
344
- return fn(a, _b, _c);
345
- });
346
-
347
- case 2:
348
- return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {
349
- return fn(_a, b, _c);
350
- }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {
351
- return fn(a, _b, _c);
352
- }) : _curry1(function (_c) {
353
- return fn(a, b, _c);
354
- });
355
-
356
- default:
357
- return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {
358
- return fn(_a, _b, c);
359
- }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {
360
- return fn(_a, b, _c);
361
- }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {
362
- return fn(a, _b, _c);
363
- }) : _isPlaceholder(a) ? _curry1(function (_a) {
364
- return fn(_a, b, c);
365
- }) : _isPlaceholder(b) ? _curry1(function (_b) {
366
- return fn(a, _b, c);
367
- }) : _isPlaceholder(c) ? _curry1(function (_c) {
368
- return fn(a, b, _c);
369
- }) : fn(a, b, c);
370
- }
371
- };
372
- }
373
-
374
- /**
375
- * Tests whether or not an object is an array.
376
- *
377
- * @private
378
- * @param {*} val The object to test.
379
- * @return {Boolean} `true` if `val` is an array, `false` otherwise.
380
- * @example
381
- *
382
- * _isArray([]); //=> true
383
- * _isArray(null); //=> false
384
- * _isArray({}); //=> false
385
- */
386
- var _isArray = Array.isArray || function _isArray(val) {
387
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';
388
- };
389
-
390
- function _isTransformer(obj) {
391
- return obj != null && typeof obj['@@transducer/step'] === 'function';
392
- }
393
-
394
- /**
395
- * Returns a function that dispatches with different strategies based on the
396
- * object in list position (last argument). If it is an array, executes [fn].
397
- * Otherwise, if it has a function with one of the given method names, it will
398
- * execute that function (functor case). Otherwise, if it is a transformer,
399
- * uses transducer created by [transducerCreator] to return a new transformer
400
- * (transducer case).
401
- * Otherwise, it will default to executing [fn].
402
- *
403
- * @private
404
- * @param {Array} methodNames properties to check for a custom implementation
405
- * @param {Function} transducerCreator transducer factory if object is transformer
406
- * @param {Function} fn default ramda implementation
407
- * @return {Function} A function that dispatches on object in list position
408
- */
409
-
410
- function _dispatchable(methodNames, transducerCreator, fn) {
411
- return function () {
412
- if (arguments.length === 0) {
413
- return fn();
414
- }
415
-
416
- var obj = arguments[arguments.length - 1];
417
-
418
- if (!_isArray(obj)) {
419
- var idx = 0;
420
-
421
- while (idx < methodNames.length) {
422
- if (typeof obj[methodNames[idx]] === 'function') {
423
- return obj[methodNames[idx]].apply(obj, Array.prototype.slice.call(arguments, 0, -1));
424
- }
425
-
426
- idx += 1;
427
- }
428
-
429
- if (_isTransformer(obj)) {
430
- var transducer = transducerCreator.apply(null, Array.prototype.slice.call(arguments, 0, -1));
431
- return transducer(obj);
432
- }
433
- }
434
-
435
- return fn.apply(this, arguments);
436
- };
437
- }
438
-
439
- var _xfBase = {
440
- init: function () {
441
- return this.xf['@@transducer/init']();
442
- },
443
- result: function (result) {
444
- return this.xf['@@transducer/result'](result);
445
- }
446
- };
447
-
448
- function _arrayFromIterator(iter) {
449
- var list = [];
450
- var next;
451
-
452
- while (!(next = iter.next()).done) {
453
- list.push(next.value);
454
- }
455
-
456
- return list;
457
- }
458
-
459
- function _includesWith(pred, x, list) {
460
- var idx = 0;
461
- var len = list.length;
462
-
463
- while (idx < len) {
464
- if (pred(x, list[idx])) {
465
- return true;
466
- }
467
-
468
- idx += 1;
469
- }
470
-
471
- return false;
472
- }
473
-
474
- function _functionName(f) {
475
- // String(x => x) evaluates to "x => x", so the pattern may not match.
476
- var match = String(f).match(/^function (\w*)/);
477
- return match == null ? '' : match[1];
478
- }
479
-
480
- function _has(prop, obj) {
481
- return Object.prototype.hasOwnProperty.call(obj, prop);
482
- }
483
-
484
- // Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
485
- function _objectIs(a, b) {
486
- // SameValue algorithm
487
- if (a === b) {
488
- // Steps 1-5, 7-10
489
- // Steps 6.b-6.e: +0 != -0
490
- return a !== 0 || 1 / a === 1 / b;
491
- } else {
492
- // Step 6.a: NaN == NaN
493
- return a !== a && b !== b;
494
- }
495
- }
496
-
497
- var _objectIs$1 = typeof Object.is === 'function' ? Object.is : _objectIs;
498
-
499
- var toString = Object.prototype.toString;
500
-
501
- var _isArguments =
502
- /*#__PURE__*/
503
- function () {
504
- return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
505
- return toString.call(x) === '[object Arguments]';
506
- } : function _isArguments(x) {
507
- return _has('callee', x);
508
- };
509
- }();
510
-
511
- var hasEnumBug = !
512
- /*#__PURE__*/
513
- {
514
- toString: null
515
- }.propertyIsEnumerable('toString');
516
- var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; // Safari bug
517
-
518
- var hasArgsEnumBug =
519
- /*#__PURE__*/
520
- function () {
521
-
522
- return arguments.propertyIsEnumerable('length');
523
- }();
524
-
525
- var contains$1 = function contains(list, item) {
526
- var idx = 0;
527
-
528
- while (idx < list.length) {
529
- if (list[idx] === item) {
530
- return true;
531
- }
532
-
533
- idx += 1;
534
- }
535
-
536
- return false;
537
- };
538
- /**
539
- * Returns a list containing the names of all the enumerable own properties of
540
- * the supplied object.
541
- * Note that the order of the output array is not guaranteed to be consistent
542
- * across different JS platforms.
543
- *
544
- * @func
545
- * @memberOf R
546
- * @since v0.1.0
547
- * @category Object
548
- * @sig {k: v} -> [k]
549
- * @param {Object} obj The object to extract properties from
550
- * @return {Array} An array of the object's own properties.
551
- * @see R.keysIn, R.values, R.toPairs
552
- * @example
553
- *
554
- * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']
555
- */
556
-
557
-
558
- var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ?
559
- /*#__PURE__*/
560
- _curry1(function keys(obj) {
561
- return Object(obj) !== obj ? [] : Object.keys(obj);
562
- }) :
563
- /*#__PURE__*/
564
- _curry1(function keys(obj) {
565
- if (Object(obj) !== obj) {
566
- return [];
567
- }
568
-
569
- var prop, nIdx;
570
- var ks = [];
571
-
572
- var checkArgsLength = hasArgsEnumBug && _isArguments(obj);
573
-
574
- for (prop in obj) {
575
- if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {
576
- ks[ks.length] = prop;
577
- }
578
- }
579
-
580
- if (hasEnumBug) {
581
- nIdx = nonEnumerableProps.length - 1;
582
-
583
- while (nIdx >= 0) {
584
- prop = nonEnumerableProps[nIdx];
585
-
586
- if (_has(prop, obj) && !contains$1(ks, prop)) {
587
- ks[ks.length] = prop;
588
- }
589
-
590
- nIdx -= 1;
591
- }
592
- }
593
-
594
- return ks;
595
- });
596
-
597
- /**
598
- * Gives a single-word string description of the (native) type of a value,
599
- * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
600
- * attempt to distinguish user Object types any further, reporting them all as
601
- * 'Object'.
602
- *
603
- * @func
604
- * @memberOf R
605
- * @since v0.8.0
606
- * @category Type
607
- * @sig * -> String
608
- * @param {*} val The value to test
609
- * @return {String}
610
- * @example
611
- *
612
- * R.type({}); //=> "Object"
613
- * R.type(1); //=> "Number"
614
- * R.type(false); //=> "Boolean"
615
- * R.type('s'); //=> "String"
616
- * R.type(null); //=> "Null"
617
- * R.type([]); //=> "Array"
618
- * R.type(/[A-z]/); //=> "RegExp"
619
- * R.type(() => {}); //=> "Function"
620
- * R.type(undefined); //=> "Undefined"
621
- */
622
-
623
- var type =
624
- /*#__PURE__*/
625
- _curry1(function type(val) {
626
- return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
627
- });
628
-
629
- /**
630
- * private _uniqContentEquals function.
631
- * That function is checking equality of 2 iterator contents with 2 assumptions
632
- * - iterators lengths are the same
633
- * - iterators values are unique
634
- *
635
- * false-positive result will be returned for comparison of, e.g.
636
- * - [1,2,3] and [1,2,3,4]
637
- * - [1,1,1] and [1,2,3]
638
- * */
639
-
640
- function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
641
- var a = _arrayFromIterator(aIterator);
642
-
643
- var b = _arrayFromIterator(bIterator);
644
-
645
- function eq(_a, _b) {
646
- return _equals(_a, _b, stackA.slice(), stackB.slice());
647
- } // if *a* array contains any element that is not included in *b*
648
-
649
-
650
- return !_includesWith(function (b, aItem) {
651
- return !_includesWith(eq, aItem, b);
652
- }, b, a);
653
- }
654
-
655
- function _equals(a, b, stackA, stackB) {
656
- if (_objectIs$1(a, b)) {
657
- return true;
658
- }
659
-
660
- var typeA = type(a);
661
-
662
- if (typeA !== type(b)) {
663
- return false;
664
- }
665
-
666
- if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {
667
- return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);
668
- }
669
-
670
- if (typeof a.equals === 'function' || typeof b.equals === 'function') {
671
- return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);
672
- }
673
-
674
- switch (typeA) {
675
- case 'Arguments':
676
- case 'Array':
677
- case 'Object':
678
- if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {
679
- return a === b;
680
- }
681
-
682
- break;
683
-
684
- case 'Boolean':
685
- case 'Number':
686
- case 'String':
687
- if (!(typeof a === typeof b && _objectIs$1(a.valueOf(), b.valueOf()))) {
688
- return false;
689
- }
690
-
691
- break;
692
-
693
- case 'Date':
694
- if (!_objectIs$1(a.valueOf(), b.valueOf())) {
695
- return false;
696
- }
697
-
698
- break;
699
-
700
- case 'Error':
701
- return a.name === b.name && a.message === b.message;
702
-
703
- case 'RegExp':
704
- if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {
705
- return false;
706
- }
707
-
708
- break;
709
- }
710
-
711
- var idx = stackA.length - 1;
712
-
713
- while (idx >= 0) {
714
- if (stackA[idx] === a) {
715
- return stackB[idx] === b;
716
- }
717
-
718
- idx -= 1;
719
- }
720
-
721
- switch (typeA) {
722
- case 'Map':
723
- if (a.size !== b.size) {
724
- return false;
725
- }
726
-
727
- return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
728
-
729
- case 'Set':
730
- if (a.size !== b.size) {
731
- return false;
732
- }
733
-
734
- return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));
735
-
736
- case 'Arguments':
737
- case 'Array':
738
- case 'Object':
739
- case 'Boolean':
740
- case 'Number':
741
- case 'String':
742
- case 'Date':
743
- case 'Error':
744
- case 'RegExp':
745
- case 'Int8Array':
746
- case 'Uint8Array':
747
- case 'Uint8ClampedArray':
748
- case 'Int16Array':
749
- case 'Uint16Array':
750
- case 'Int32Array':
751
- case 'Uint32Array':
752
- case 'Float32Array':
753
- case 'Float64Array':
754
- case 'ArrayBuffer':
755
- break;
756
-
757
- default:
758
- // Values of other types are only equal if identical.
759
- return false;
760
- }
761
-
762
- var keysA = keys(a);
763
-
764
- if (keysA.length !== keys(b).length) {
765
- return false;
766
- }
767
-
768
- var extendedStackA = stackA.concat([a]);
769
- var extendedStackB = stackB.concat([b]);
770
- idx = keysA.length - 1;
771
-
772
- while (idx >= 0) {
773
- var key = keysA[idx];
774
-
775
- if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {
776
- return false;
777
- }
778
-
779
- idx -= 1;
780
- }
781
-
782
- return true;
783
- }
784
-
785
- /**
786
- * Returns `true` if its arguments are equivalent, `false` otherwise. Handles
787
- * cyclical data structures.
788
- *
789
- * Dispatches symmetrically to the `equals` methods of both arguments, if
790
- * present.
791
- *
792
- * @func
793
- * @memberOf R
794
- * @since v0.15.0
795
- * @category Relation
796
- * @sig a -> b -> Boolean
797
- * @param {*} a
798
- * @param {*} b
799
- * @return {Boolean}
800
- * @example
801
- *
802
- * R.equals(1, 1); //=> true
803
- * R.equals(1, '1'); //=> false
804
- * R.equals([1, 2, 3], [1, 2, 3]); //=> true
805
- *
806
- * const a = {}; a.v = a;
807
- * const b = {}; b.v = b;
808
- * R.equals(a, b); //=> true
809
- */
810
-
811
- var equals =
812
- /*#__PURE__*/
813
- _curry2(function equals(a, b) {
814
- return _equals(a, b, [], []);
815
- });
816
-
817
- function _map(fn, functor) {
818
- var idx = 0;
819
- var len = functor.length;
820
- var result = Array(len);
821
-
822
- while (idx < len) {
823
- result[idx] = fn(functor[idx]);
824
- idx += 1;
825
- }
826
-
827
- return result;
828
- }
829
-
830
- function _arrayReduce(reducer, acc, list) {
831
- var index = 0;
832
- var length = list.length;
833
-
834
- while (index < length) {
835
- acc = reducer(acc, list[index]);
836
- index += 1;
837
- }
838
-
839
- return acc;
840
- }
841
-
842
- function _isObject(x) {
843
- return Object.prototype.toString.call(x) === '[object Object]';
844
- }
845
-
846
- var XMap =
847
- /*#__PURE__*/
848
- function () {
849
- function XMap(f, xf) {
850
- this.xf = xf;
851
- this.f = f;
852
- }
853
-
854
- XMap.prototype['@@transducer/init'] = _xfBase.init;
855
- XMap.prototype['@@transducer/result'] = _xfBase.result;
856
-
857
- XMap.prototype['@@transducer/step'] = function (result, input) {
858
- return this.xf['@@transducer/step'](result, this.f(input));
859
- };
860
-
861
- return XMap;
862
- }();
863
-
864
- var _xmap = function _xmap(f) {
865
- return function (xf) {
866
- return new XMap(f, xf);
867
- };
868
- };
869
-
870
- /**
871
- * Takes a function and
872
- * a [functor](https://github.com/fantasyland/fantasy-land#functor),
873
- * applies the function to each of the functor's values, and returns
874
- * a functor of the same shape.
875
- *
876
- * Ramda provides suitable `map` implementations for `Array` and `Object`,
877
- * so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.
878
- *
879
- * Dispatches to the `map` method of the second argument, if present.
880
- *
881
- * Acts as a transducer if a transformer is given in list position.
882
- *
883
- * Also treats functions as functors and will compose them together.
884
- *
885
- * @func
886
- * @memberOf R
887
- * @since v0.1.0
888
- * @category List
889
- * @sig Functor f => (a -> b) -> f a -> f b
890
- * @param {Function} fn The function to be called on every element of the input `list`.
891
- * @param {Array} list The list to be iterated over.
892
- * @return {Array} The new list.
893
- * @see R.transduce, R.addIndex, R.pluck, R.project
894
- * @example
895
- *
896
- * const double = x => x * 2;
897
- *
898
- * R.map(double, [1, 2, 3]); //=> [2, 4, 6]
899
- *
900
- * R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}
901
- * @symb R.map(f, [a, b]) = [f(a), f(b)]
902
- * @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }
903
- * @symb R.map(f, functor_o) = functor_o.map(f)
904
- */
905
-
906
- var map =
907
- /*#__PURE__*/
908
- _curry2(
909
- /*#__PURE__*/
910
- _dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
911
- switch (Object.prototype.toString.call(functor)) {
912
- case '[object Function]':
913
- return curryN(functor.length, function () {
914
- return fn.call(this, functor.apply(this, arguments));
915
- });
916
-
917
- case '[object Object]':
918
- return _arrayReduce(function (acc, key) {
919
- acc[key] = fn(functor[key]);
920
- return acc;
921
- }, {}, keys(functor));
922
-
923
- default:
924
- return _map(fn, functor);
925
- }
926
- }));
927
-
928
- /**
929
- * Determine if the passed argument is an integer.
930
- *
931
- * @private
932
- * @param {*} n
933
- * @category Type
934
- * @return {Boolean}
935
- */
936
- var _isInteger = Number.isInteger || function _isInteger(n) {
937
- return n << 0 === n;
938
- };
939
-
940
- function _isString(x) {
941
- return Object.prototype.toString.call(x) === '[object String]';
942
- }
943
-
944
- /**
945
- * Returns the nth element of the given list or string. If n is negative the
946
- * element at index length + n is returned.
947
- *
948
- * @func
949
- * @memberOf R
950
- * @since v0.1.0
951
- * @category List
952
- * @sig Number -> [a] -> a | Undefined
953
- * @sig Number -> String -> String
954
- * @param {Number} offset
955
- * @param {*} list
956
- * @return {*}
957
- * @example
958
- *
959
- * const list = ['foo', 'bar', 'baz', 'quux'];
960
- * R.nth(1, list); //=> 'bar'
961
- * R.nth(-1, list); //=> 'quux'
962
- * R.nth(-99, list); //=> undefined
963
- *
964
- * R.nth(2, 'abc'); //=> 'c'
965
- * R.nth(3, 'abc'); //=> ''
966
- * @symb R.nth(-1, [a, b, c]) = c
967
- * @symb R.nth(0, [a, b, c]) = a
968
- * @symb R.nth(1, [a, b, c]) = b
969
- */
970
-
971
- var nth =
972
- /*#__PURE__*/
973
- _curry2(function nth(offset, list) {
974
- var idx = offset < 0 ? list.length + offset : offset;
975
- return _isString(list) ? list.charAt(idx) : list[idx];
976
- });
977
-
978
- /**
979
- * Returns a function that when supplied an object returns the indicated
980
- * property of that object, if it exists.
981
- *
982
- * @func
983
- * @memberOf R
984
- * @since v0.1.0
985
- * @category Object
986
- * @typedefn Idx = String | Int | Symbol
987
- * @sig Idx -> {s: a} -> a | Undefined
988
- * @param {String|Number} p The property name or array index
989
- * @param {Object} obj The object to query
990
- * @return {*} The value at `obj.p`.
991
- * @see R.path, R.props, R.pluck, R.project, R.nth
992
- * @example
993
- *
994
- * R.prop('x', {x: 100}); //=> 100
995
- * R.prop('x', {}); //=> undefined
996
- * R.prop(0, [100]); //=> 100
997
- * R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4
998
- */
999
-
1000
- var prop =
1001
- /*#__PURE__*/
1002
- _curry2(function prop(p, obj) {
1003
- if (obj == null) {
1004
- return;
1005
- }
1006
-
1007
- return _isInteger(p) ? nth(p, obj) : obj[p];
1008
- });
1009
-
1010
- /**
1011
- * Returns a new list by plucking the same named property off all objects in
1012
- * the list supplied.
1013
- *
1014
- * `pluck` will work on
1015
- * any [functor](https://github.com/fantasyland/fantasy-land#functor) in
1016
- * addition to arrays, as it is equivalent to `R.map(R.prop(k), f)`.
1017
- *
1018
- * @func
1019
- * @memberOf R
1020
- * @since v0.1.0
1021
- * @category List
1022
- * @sig Functor f => k -> f {k: v} -> f v
1023
- * @param {Number|String} key The key name to pluck off of each object.
1024
- * @param {Array} f The array or functor to consider.
1025
- * @return {Array} The list of values for the given key.
1026
- * @see R.project, R.prop, R.props
1027
- * @example
1028
- *
1029
- * var getAges = R.pluck('age');
1030
- * getAges([{name: 'fred', age: 29}, {name: 'wilma', age: 27}]); //=> [29, 27]
1031
- *
1032
- * R.pluck(0, [[1, 2], [3, 4]]); //=> [1, 3]
1033
- * R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}
1034
- * @symb R.pluck('x', [{x: 1, y: 2}, {x: 3, y: 4}, {x: 5, y: 6}]) = [1, 3, 5]
1035
- * @symb R.pluck(0, [[1, 2], [3, 4], [5, 6]]) = [1, 3, 5]
1036
- */
1037
-
1038
- var pluck =
1039
- /*#__PURE__*/
1040
- _curry2(function pluck(p, list) {
1041
- return map(prop(p), list);
1042
- });
1043
-
1044
- /**
1045
- * Tests whether or not an object is similar to an array.
1046
- *
1047
- * @private
1048
- * @category Type
1049
- * @category List
1050
- * @sig * -> Boolean
1051
- * @param {*} x The object to test.
1052
- * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.
1053
- * @example
1054
- *
1055
- * _isArrayLike([]); //=> true
1056
- * _isArrayLike(true); //=> false
1057
- * _isArrayLike({}); //=> false
1058
- * _isArrayLike({length: 10}); //=> false
1059
- * _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
1060
- * _isArrayLike({nodeType: 1, length: 1}) // => false
1061
- */
1062
-
1063
- var _isArrayLike =
1064
- /*#__PURE__*/
1065
- _curry1(function isArrayLike(x) {
1066
- if (_isArray(x)) {
1067
- return true;
1068
- }
1069
-
1070
- if (!x) {
1071
- return false;
1072
- }
1073
-
1074
- if (typeof x !== 'object') {
1075
- return false;
1076
- }
1077
-
1078
- if (_isString(x)) {
1079
- return false;
1080
- }
1081
-
1082
- if (x.length === 0) {
1083
- return true;
1084
- }
1085
-
1086
- if (x.length > 0) {
1087
- return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);
1088
- }
1089
-
1090
- return false;
1091
- });
1092
-
1093
- var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
1094
- function _createReduce(arrayReduce, methodReduce, iterableReduce) {
1095
- return function _reduce(xf, acc, list) {
1096
- if (_isArrayLike(list)) {
1097
- return arrayReduce(xf, acc, list);
1098
- }
1099
-
1100
- if (list == null) {
1101
- return acc;
1102
- }
1103
-
1104
- if (typeof list['fantasy-land/reduce'] === 'function') {
1105
- return methodReduce(xf, acc, list, 'fantasy-land/reduce');
1106
- }
1107
-
1108
- if (list[symIterator] != null) {
1109
- return iterableReduce(xf, acc, list[symIterator]());
1110
- }
1111
-
1112
- if (typeof list.next === 'function') {
1113
- return iterableReduce(xf, acc, list);
1114
- }
1115
-
1116
- if (typeof list.reduce === 'function') {
1117
- return methodReduce(xf, acc, list, 'reduce');
1118
- }
1119
-
1120
- throw new TypeError('reduce: list must be array or iterable');
1121
- };
1122
- }
1123
-
1124
- function _iterableReduce(reducer, acc, iter) {
1125
- var step = iter.next();
1126
-
1127
- while (!step.done) {
1128
- acc = reducer(acc, step.value);
1129
- step = iter.next();
1130
- }
1131
-
1132
- return acc;
1133
- }
1134
-
1135
- function _methodReduce(reducer, acc, obj, methodName) {
1136
- return obj[methodName](reducer, acc);
1137
- }
1138
-
1139
- var _reduce =
1140
- /*#__PURE__*/
1141
- _createReduce(_arrayReduce, _methodReduce, _iterableReduce);
1142
-
1143
- /**
1144
- * ap applies a list of functions to a list of values.
1145
- *
1146
- * Dispatches to the `ap` method of the first argument, if present. Also
1147
- * treats curried functions as applicatives.
1148
- *
1149
- * @func
1150
- * @memberOf R
1151
- * @since v0.3.0
1152
- * @category Function
1153
- * @sig [a -> b] -> [a] -> [b]
1154
- * @sig Apply f => f (a -> b) -> f a -> f b
1155
- * @sig (r -> a -> b) -> (r -> a) -> (r -> b)
1156
- * @param {*} applyF
1157
- * @param {*} applyX
1158
- * @return {*}
1159
- * @example
1160
- *
1161
- * R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]
1162
- * R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> ["tasty pizza", "tasty salad", "PIZZA", "SALAD"]
1163
- *
1164
- * // R.ap can also be used as S combinator
1165
- * // when only two functions are passed
1166
- * R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'
1167
- * @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]
1168
- */
1169
-
1170
- var ap =
1171
- /*#__PURE__*/
1172
- _curry2(function ap(applyF, applyX) {
1173
- return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {
1174
- return applyF(x)(applyX(x));
1175
- } : _reduce(function (acc, f) {
1176
- return _concat(acc, map(f, applyX));
1177
- }, [], applyF);
1178
- });
1179
-
1180
- /**
1181
- * Makes a shallow clone of an object, setting or overriding the specified
1182
- * property with the given value. Note that this copies and flattens prototype
1183
- * properties onto the new object as well. All non-primitive properties are
1184
- * copied by reference.
1185
- *
1186
- * @private
1187
- * @param {String|Number} prop The property name to set
1188
- * @param {*} val The new value
1189
- * @param {Object|Array} obj The object to clone
1190
- * @return {Object|Array} A new object equivalent to the original except for the changed property.
1191
- */
1192
-
1193
- function _assoc(prop, val, obj) {
1194
- if (_isInteger(prop) && _isArray(obj)) {
1195
- var arr = [].concat(obj);
1196
- arr[prop] = val;
1197
- return arr;
1198
- }
1199
-
1200
- var result = {};
1201
-
1202
- for (var p in obj) {
1203
- result[p] = obj[p];
1204
- }
1205
-
1206
- result[prop] = val;
1207
- return result;
1208
- }
1209
-
1210
- /**
1211
- * Checks if the input value is `null` or `undefined`.
1212
- *
1213
- * @func
1214
- * @memberOf R
1215
- * @since v0.9.0
1216
- * @category Type
1217
- * @sig * -> Boolean
1218
- * @param {*} x The value to test.
1219
- * @return {Boolean} `true` if `x` is `undefined` or `null`, otherwise `false`.
1220
- * @example
1221
- *
1222
- * R.isNil(null); //=> true
1223
- * R.isNil(undefined); //=> true
1224
- * R.isNil(0); //=> false
1225
- * R.isNil([]); //=> false
1226
- */
1227
-
1228
- var isNil =
1229
- /*#__PURE__*/
1230
- _curry1(function isNil(x) {
1231
- return x == null;
1232
- });
1233
-
1234
- /**
1235
- * Makes a shallow clone of an object, setting or overriding the nodes required
1236
- * to create the given path, and placing the specific value at the tail end of
1237
- * that path. Note that this copies and flattens prototype properties onto the
1238
- * new object as well. All non-primitive properties are copied by reference.
1239
- *
1240
- * @func
1241
- * @memberOf R
1242
- * @since v0.8.0
1243
- * @category Object
1244
- * @typedefn Idx = String | Int | Symbol
1245
- * @sig [Idx] -> a -> {a} -> {a}
1246
- * @param {Array} path the path to set
1247
- * @param {*} val The new value
1248
- * @param {Object} obj The object to clone
1249
- * @return {Object} A new object equivalent to the original except along the specified path.
1250
- * @see R.dissocPath
1251
- * @example
1252
- *
1253
- * R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}
1254
- *
1255
- * // Any missing or non-object keys in path will be overridden
1256
- * R.assocPath(['a', 'b', 'c'], 42, {a: 5}); //=> {a: {b: {c: 42}}}
1257
- */
1258
-
1259
- var assocPath =
1260
- /*#__PURE__*/
1261
- _curry3(function assocPath(path, val, obj) {
1262
- if (path.length === 0) {
1263
- return val;
1264
- }
1265
-
1266
- var idx = path[0];
1267
-
1268
- if (path.length > 1) {
1269
- var nextObj = !isNil(obj) && _has(idx, obj) && typeof obj[idx] === 'object' ? obj[idx] : _isInteger(path[1]) ? [] : {};
1270
- val = assocPath(Array.prototype.slice.call(path, 1), val, nextObj);
1271
- }
1272
-
1273
- return _assoc(idx, val, obj);
1274
- });
1275
-
1276
- /**
1277
- * Makes a shallow clone of an object, setting or overriding the specified
1278
- * property with the given value. Note that this copies and flattens prototype
1279
- * properties onto the new object as well. All non-primitive properties are
1280
- * copied by reference.
1281
- *
1282
- * @func
1283
- * @memberOf R
1284
- * @since v0.8.0
1285
- * @category Object
1286
- * @typedefn Idx = String | Int
1287
- * @sig Idx -> a -> {k: v} -> {k: v}
1288
- * @param {String|Number} prop The property name to set
1289
- * @param {*} val The new value
1290
- * @param {Object} obj The object to clone
1291
- * @return {Object} A new object equivalent to the original except for the changed property.
1292
- * @see R.dissoc, R.pick
1293
- * @example
1294
- *
1295
- * R.assoc('c', 3, {a: 1, b: 2}); //=> {a: 1, b: 2, c: 3}
1296
- */
1297
-
1298
- var assoc =
1299
- /*#__PURE__*/
1300
- _curry3(function assoc(prop, val, obj) {
1301
- return assocPath([prop], val, obj);
1302
- });
1303
-
1304
- function _isFunction(x) {
1305
- var type = Object.prototype.toString.call(x);
1306
- return type === '[object Function]' || type === '[object AsyncFunction]' || type === '[object GeneratorFunction]' || type === '[object AsyncGeneratorFunction]';
1307
- }
1308
-
1309
- /**
1310
- * "lifts" a function to be the specified arity, so that it may "map over" that
1311
- * many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).
1312
- *
1313
- * @func
1314
- * @memberOf R
1315
- * @since v0.7.0
1316
- * @category Function
1317
- * @sig Number -> (*... -> *) -> ([*]... -> [*])
1318
- * @param {Function} fn The function to lift into higher context
1319
- * @return {Function} The lifted function.
1320
- * @see R.lift, R.ap
1321
- * @example
1322
- *
1323
- * const madd3 = R.liftN(3, (...args) => R.sum(args));
1324
- * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]
1325
- */
1326
-
1327
- var liftN =
1328
- /*#__PURE__*/
1329
- _curry2(function liftN(arity, fn) {
1330
- var lifted = curryN(arity, fn);
1331
- return curryN(arity, function () {
1332
- return _arrayReduce(ap, map(lifted, arguments[0]), Array.prototype.slice.call(arguments, 1));
1333
- });
1334
- });
1335
-
1336
- /**
1337
- * "lifts" a function of arity >= 1 so that it may "map over" a list, Function or other
1338
- * object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).
1339
- *
1340
- * @func
1341
- * @memberOf R
1342
- * @since v0.7.0
1343
- * @category Function
1344
- * @sig (*... -> *) -> ([*]... -> [*])
1345
- * @param {Function} fn The function to lift into higher context
1346
- * @return {Function} The lifted function.
1347
- * @see R.liftN
1348
- * @example
1349
- *
1350
- * const madd3 = R.lift((a, b, c) => a + b + c);
1351
- *
1352
- * madd3([100, 200], [30, 40], [5, 6, 7]); //=> [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]
1353
- *
1354
- * const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);
1355
- *
1356
- * madd5([10, 20], [1], [2, 3], [4], [100, 200]); //=> [117, 217, 118, 218, 127, 227, 128, 228]
1357
- */
1358
-
1359
- var lift =
1360
- /*#__PURE__*/
1361
- _curry1(function lift(fn) {
1362
- return liftN(fn.length, fn);
1363
- });
1364
-
1365
- /**
1366
- * Returns the first argument if it is truthy, otherwise the second argument.
1367
- * Acts as the boolean `or` statement if both inputs are `Boolean`s.
1368
- *
1369
- * @func
1370
- * @memberOf R
1371
- * @since v0.1.0
1372
- * @category Logic
1373
- * @sig a -> b -> a | b
1374
- * @param {Any} a
1375
- * @param {Any} b
1376
- * @return {Any}
1377
- * @see R.either, R.and
1378
- * @example
1379
- *
1380
- * R.or(true, true); //=> true
1381
- * R.or(true, false); //=> true
1382
- * R.or(false, true); //=> true
1383
- * R.or(false, false); //=> false
1384
- */
1385
-
1386
- var or =
1387
- /*#__PURE__*/
1388
- _curry2(function or(a, b) {
1389
- return a || b;
1390
- });
1391
-
1392
- /**
1393
- * A function wrapping calls to the two functions in an `||` operation,
1394
- * returning the result of the first function if it is truth-y and the result
1395
- * of the second function otherwise. Note that this is short-circuited,
1396
- * meaning that the second function will not be invoked if the first returns a
1397
- * truth-y value.
1398
- *
1399
- * In addition to functions, `R.either` also accepts any fantasy-land compatible
1400
- * applicative functor.
1401
- *
1402
- * @func
1403
- * @memberOf R
1404
- * @since v0.12.0
1405
- * @category Logic
1406
- * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
1407
- * @param {Function} f a predicate
1408
- * @param {Function} g another predicate
1409
- * @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.
1410
- * @see R.both, R.anyPass, R.or
1411
- * @example
1412
- *
1413
- * const gt10 = x => x > 10;
1414
- * const even = x => x % 2 === 0;
1415
- * const f = R.either(gt10, even);
1416
- * f(101); //=> true
1417
- * f(8); //=> true
1418
- *
1419
- * R.either(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(55)
1420
- * R.either([false, false, 'a'], [11]) // => [11, 11, "a"]
1421
- */
1422
-
1423
- var either =
1424
- /*#__PURE__*/
1425
- _curry2(function either(f, g) {
1426
- return _isFunction(f) ? function _either() {
1427
- return f.apply(this, arguments) || g.apply(this, arguments);
1428
- } : lift(or)(f, g);
1429
- });
1430
-
1431
- /**
1432
- * Tests whether or not an object is a typed array.
1433
- *
1434
- * @private
1435
- * @param {*} val The object to test.
1436
- * @return {Boolean} `true` if `val` is a typed array, `false` otherwise.
1437
- * @example
1438
- *
1439
- * _isTypedArray(new Uint8Array([])); //=> true
1440
- * _isTypedArray(new Float32Array([])); //=> true
1441
- * _isTypedArray([]); //=> false
1442
- * _isTypedArray(null); //=> false
1443
- * _isTypedArray({}); //=> false
1444
- */
1445
- function _isTypedArray(val) {
1446
- var type = Object.prototype.toString.call(val);
1447
- return type === '[object Uint8ClampedArray]' || type === '[object Int8Array]' || type === '[object Uint8Array]' || type === '[object Int16Array]' || type === '[object Uint16Array]' || type === '[object Int32Array]' || type === '[object Uint32Array]' || type === '[object Float32Array]' || type === '[object Float64Array]' || type === '[object BigInt64Array]' || type === '[object BigUint64Array]';
1448
- }
1449
-
1450
- /**
1451
- * Returns the empty value of its argument's type. Ramda defines the empty
1452
- * value of Array (`[]`), Object (`{}`), String (`''`),
1453
- * TypedArray (`Uint8Array []`, `Float32Array []`, etc), and Arguments. Other
1454
- * types are supported if they define `<Type>.empty`,
1455
- * `<Type>.prototype.empty` or implement the
1456
- * [FantasyLand Monoid spec](https://github.com/fantasyland/fantasy-land#monoid).
1457
- *
1458
- * Dispatches to the `empty` method of the first argument, if present.
1459
- *
1460
- * @func
1461
- * @memberOf R
1462
- * @since v0.3.0
1463
- * @category Function
1464
- * @sig a -> a
1465
- * @param {*} x
1466
- * @return {*}
1467
- * @example
1468
- *
1469
- * R.empty(Just(42)); //=> Nothing()
1470
- * R.empty([1, 2, 3]); //=> []
1471
- * R.empty('unicorns'); //=> ''
1472
- * R.empty({x: 1, y: 2}); //=> {}
1473
- * R.empty(Uint8Array.from('123')); //=> Uint8Array []
1474
- */
1475
-
1476
- var empty =
1477
- /*#__PURE__*/
1478
- _curry1(function empty(x) {
1479
- return x != null && typeof x['fantasy-land/empty'] === 'function' ? x['fantasy-land/empty']() : x != null && x.constructor != null && typeof x.constructor['fantasy-land/empty'] === 'function' ? x.constructor['fantasy-land/empty']() : x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments(x) ? function () {
1480
- return arguments;
1481
- }() : _isTypedArray(x) ? x.constructor.from('') : void 0 // else
1482
- ;
1483
- });
1484
-
1485
- function _objectAssign(target) {
1486
- if (target == null) {
1487
- throw new TypeError('Cannot convert undefined or null to object');
1488
- }
1489
-
1490
- var output = Object(target);
1491
- var idx = 1;
1492
- var length = arguments.length;
1493
-
1494
- while (idx < length) {
1495
- var source = arguments[idx];
1496
-
1497
- if (source != null) {
1498
- for (var nextKey in source) {
1499
- if (_has(nextKey, source)) {
1500
- output[nextKey] = source[nextKey];
1501
- }
1502
- }
1503
- }
1504
-
1505
- idx += 1;
1506
- }
1507
-
1508
- return output;
1509
- }
1510
-
1511
- var _objectAssign$1 = typeof Object.assign === 'function' ? Object.assign : _objectAssign;
1512
-
1513
- /**
1514
- * See if an object (i.e. `val`) is an instance of the supplied constructor. This
1515
- * function will check up the inheritance chain, if any.
1516
- * If `val` was created using `Object.create`, `R.is(Object, val) === true`.
1517
- *
1518
- * @func
1519
- * @memberOf R
1520
- * @since v0.3.0
1521
- * @category Type
1522
- * @sig (* -> {*}) -> a -> Boolean
1523
- * @param {Object} ctor A constructor
1524
- * @param {*} val The value to test
1525
- * @return {Boolean}
1526
- * @example
1527
- *
1528
- * R.is(Object, {}); //=> true
1529
- * R.is(Number, 1); //=> true
1530
- * R.is(Object, 1); //=> false
1531
- * R.is(String, 's'); //=> true
1532
- * R.is(String, new String('')); //=> true
1533
- * R.is(Object, new String('')); //=> true
1534
- * R.is(Object, 's'); //=> false
1535
- * R.is(Number, {}); //=> false
1536
- */
1537
-
1538
- var is =
1539
- /*#__PURE__*/
1540
- _curry2(function is(Ctor, val) {
1541
- return val instanceof Ctor || val != null && (val.constructor === Ctor || Ctor.name === 'Object' && typeof val === 'object');
1542
- });
1543
-
1544
- /**
1545
- * Returns `true` if the given value is its type's empty value; `false`
1546
- * otherwise.
1547
- *
1548
- * @func
1549
- * @memberOf R
1550
- * @since v0.1.0
1551
- * @category Logic
1552
- * @sig a -> Boolean
1553
- * @param {*} x
1554
- * @return {Boolean}
1555
- * @see R.empty
1556
- * @example
1557
- *
1558
- * R.isEmpty([1, 2, 3]); //=> false
1559
- * R.isEmpty([]); //=> true
1560
- * R.isEmpty(''); //=> true
1561
- * R.isEmpty(null); //=> false
1562
- * R.isEmpty({}); //=> true
1563
- * R.isEmpty({length: 0}); //=> false
1564
- * R.isEmpty(Uint8Array.from('')); //=> true
1565
- */
1566
-
1567
- var isEmpty =
1568
- /*#__PURE__*/
1569
- _curry1(function isEmpty(x) {
1570
- return x != null && equals(x, empty(x));
1571
- });
1572
-
1573
- /**
1574
- * Create a new object with the own properties of the first object merged with
1575
- * the own properties of the second object. If a key exists in both objects,
1576
- * the value from the first object will be used.
1577
- *
1578
- * @func
1579
- * @memberOf R
1580
- * @since v0.26.0
1581
- * @category Object
1582
- * @sig {k: v} -> {k: v} -> {k: v}
1583
- * @param {Object} l
1584
- * @param {Object} r
1585
- * @return {Object}
1586
- * @see R.mergeRight, R.mergeDeepLeft, R.mergeWith, R.mergeWithKey
1587
- * @example
1588
- *
1589
- * R.mergeLeft({ 'age': 40 }, { 'name': 'fred', 'age': 10 });
1590
- * //=> { 'name': 'fred', 'age': 40 }
1591
- *
1592
- * const resetToDefault = R.mergeLeft({x: 0});
1593
- * resetToDefault({x: 5, y: 2}); //=> {x: 0, y: 2}
1594
- * @symb R.mergeLeft(a, b) = {...b, ...a}
1595
- */
1596
-
1597
- var mergeLeft =
1598
- /*#__PURE__*/
1599
- _curry2(function mergeLeft(l, r) {
1600
- return _objectAssign$1({}, r, l);
1601
- });
1602
-
1603
- /**
1604
- * Replace a substring or regex match in a string with a replacement.
1605
- *
1606
- * The first two parameters correspond to the parameters of the
1607
- * `String.prototype.replace()` function, so the second parameter can also be a
1608
- * function.
1609
- *
1610
- * @func
1611
- * @memberOf R
1612
- * @since v0.7.0
1613
- * @category String
1614
- * @sig RegExp|String -> String -> String -> String
1615
- * @param {RegExp|String} pattern A regular expression or a substring to match.
1616
- * @param {String} replacement The string to replace the matches with.
1617
- * @param {String} str The String to do the search and replacement in.
1618
- * @return {String} The result.
1619
- * @example
1620
- *
1621
- * R.replace('foo', 'bar', 'foo foo foo'); //=> 'bar foo foo'
1622
- * R.replace(/foo/, 'bar', 'foo foo foo'); //=> 'bar foo foo'
1623
- *
1624
- * // Use the "g" (global) flag to replace all occurrences:
1625
- * R.replace(/foo/g, 'bar', 'foo foo foo'); //=> 'bar bar bar'
1626
- */
1627
-
1628
- var replace$1 =
1629
- /*#__PURE__*/
1630
- _curry3(function replace(regex, replacement, str) {
1631
- return str.replace(regex, replacement);
1632
- });
1633
-
1634
84
  function _objectWithoutPropertiesLoose$3(source, excluded) {
1635
85
  if (source == null) return {};
1636
86
  var target = {};
@@ -17507,6 +15957,539 @@ var weekOfYear$1 = {exports: {}};
17507
15957
 
17508
15958
  var weekOfYear = weekOfYear$1.exports;
17509
15959
 
15960
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
15961
+ var shams = function hasSymbols() {
15962
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
15963
+ if (typeof Symbol.iterator === 'symbol') { return true; }
15964
+
15965
+ var obj = {};
15966
+ var sym = Symbol('test');
15967
+ var symObj = Object(sym);
15968
+ if (typeof sym === 'string') { return false; }
15969
+
15970
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
15971
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
15972
+
15973
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
15974
+ // if (sym instanceof Symbol) { return false; }
15975
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
15976
+ // if (!(symObj instanceof Symbol)) { return false; }
15977
+
15978
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
15979
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
15980
+
15981
+ var symVal = 42;
15982
+ obj[sym] = symVal;
15983
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
15984
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
15985
+
15986
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
15987
+
15988
+ var syms = Object.getOwnPropertySymbols(obj);
15989
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
15990
+
15991
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
15992
+
15993
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
15994
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
15995
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
15996
+ }
15997
+
15998
+ return true;
15999
+ };
16000
+
16001
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
16002
+ var hasSymbolSham = shams;
16003
+
16004
+ var hasSymbols$1 = function hasNativeSymbols() {
16005
+ if (typeof origSymbol !== 'function') { return false; }
16006
+ if (typeof Symbol !== 'function') { return false; }
16007
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
16008
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
16009
+
16010
+ return hasSymbolSham();
16011
+ };
16012
+
16013
+ /* eslint no-invalid-this: 1 */
16014
+
16015
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
16016
+ var slice$1 = Array.prototype.slice;
16017
+ var toStr = Object.prototype.toString;
16018
+ var funcType = '[object Function]';
16019
+
16020
+ var implementation$1 = function bind(that) {
16021
+ var target = this;
16022
+ if (typeof target !== 'function' || toStr.call(target) !== funcType) {
16023
+ throw new TypeError(ERROR_MESSAGE + target);
16024
+ }
16025
+ var args = slice$1.call(arguments, 1);
16026
+
16027
+ var bound;
16028
+ var binder = function () {
16029
+ if (this instanceof bound) {
16030
+ var result = target.apply(
16031
+ this,
16032
+ args.concat(slice$1.call(arguments))
16033
+ );
16034
+ if (Object(result) === result) {
16035
+ return result;
16036
+ }
16037
+ return this;
16038
+ } else {
16039
+ return target.apply(
16040
+ that,
16041
+ args.concat(slice$1.call(arguments))
16042
+ );
16043
+ }
16044
+ };
16045
+
16046
+ var boundLength = Math.max(0, target.length - args.length);
16047
+ var boundArgs = [];
16048
+ for (var i = 0; i < boundLength; i++) {
16049
+ boundArgs.push('$' + i);
16050
+ }
16051
+
16052
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
16053
+
16054
+ if (target.prototype) {
16055
+ var Empty = function Empty() {};
16056
+ Empty.prototype = target.prototype;
16057
+ bound.prototype = new Empty();
16058
+ Empty.prototype = null;
16059
+ }
16060
+
16061
+ return bound;
16062
+ };
16063
+
16064
+ var implementation = implementation$1;
16065
+
16066
+ var functionBind = Function.prototype.bind || implementation;
16067
+
16068
+ var bind$1 = functionBind;
16069
+
16070
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
16071
+
16072
+ var undefined$1;
16073
+
16074
+ var $SyntaxError = SyntaxError;
16075
+ var $Function = Function;
16076
+ var $TypeError = TypeError;
16077
+
16078
+ // eslint-disable-next-line consistent-return
16079
+ var getEvalledConstructor = function (expressionSyntax) {
16080
+ try {
16081
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
16082
+ } catch (e) {}
16083
+ };
16084
+
16085
+ var $gOPD = Object.getOwnPropertyDescriptor;
16086
+ if ($gOPD) {
16087
+ try {
16088
+ $gOPD({}, '');
16089
+ } catch (e) {
16090
+ $gOPD = null; // this is IE 8, which has a broken gOPD
16091
+ }
16092
+ }
16093
+
16094
+ var throwTypeError = function () {
16095
+ throw new $TypeError();
16096
+ };
16097
+ var ThrowTypeError = $gOPD
16098
+ ? (function () {
16099
+ try {
16100
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
16101
+ arguments.callee; // IE 8 does not throw here
16102
+ return throwTypeError;
16103
+ } catch (calleeThrows) {
16104
+ try {
16105
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
16106
+ return $gOPD(arguments, 'callee').get;
16107
+ } catch (gOPDthrows) {
16108
+ return throwTypeError;
16109
+ }
16110
+ }
16111
+ }())
16112
+ : throwTypeError;
16113
+
16114
+ var hasSymbols = hasSymbols$1();
16115
+
16116
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
16117
+
16118
+ var needsEval = {};
16119
+
16120
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
16121
+
16122
+ var INTRINSICS = {
16123
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
16124
+ '%Array%': Array,
16125
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
16126
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
16127
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
16128
+ '%AsyncFunction%': needsEval,
16129
+ '%AsyncGenerator%': needsEval,
16130
+ '%AsyncGeneratorFunction%': needsEval,
16131
+ '%AsyncIteratorPrototype%': needsEval,
16132
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
16133
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
16134
+ '%Boolean%': Boolean,
16135
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
16136
+ '%Date%': Date,
16137
+ '%decodeURI%': decodeURI,
16138
+ '%decodeURIComponent%': decodeURIComponent,
16139
+ '%encodeURI%': encodeURI,
16140
+ '%encodeURIComponent%': encodeURIComponent,
16141
+ '%Error%': Error,
16142
+ '%eval%': eval, // eslint-disable-line no-eval
16143
+ '%EvalError%': EvalError,
16144
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
16145
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
16146
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
16147
+ '%Function%': $Function,
16148
+ '%GeneratorFunction%': needsEval,
16149
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
16150
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
16151
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
16152
+ '%isFinite%': isFinite,
16153
+ '%isNaN%': isNaN,
16154
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
16155
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
16156
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
16157
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
16158
+ '%Math%': Math,
16159
+ '%Number%': Number,
16160
+ '%Object%': Object,
16161
+ '%parseFloat%': parseFloat,
16162
+ '%parseInt%': parseInt,
16163
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
16164
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
16165
+ '%RangeError%': RangeError,
16166
+ '%ReferenceError%': ReferenceError,
16167
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
16168
+ '%RegExp%': RegExp,
16169
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
16170
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
16171
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
16172
+ '%String%': String,
16173
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
16174
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
16175
+ '%SyntaxError%': $SyntaxError,
16176
+ '%ThrowTypeError%': ThrowTypeError,
16177
+ '%TypedArray%': TypedArray,
16178
+ '%TypeError%': $TypeError,
16179
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
16180
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
16181
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
16182
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
16183
+ '%URIError%': URIError,
16184
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
16185
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
16186
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
16187
+ };
16188
+
16189
+ var doEval = function doEval(name) {
16190
+ var value;
16191
+ if (name === '%AsyncFunction%') {
16192
+ value = getEvalledConstructor('async function () {}');
16193
+ } else if (name === '%GeneratorFunction%') {
16194
+ value = getEvalledConstructor('function* () {}');
16195
+ } else if (name === '%AsyncGeneratorFunction%') {
16196
+ value = getEvalledConstructor('async function* () {}');
16197
+ } else if (name === '%AsyncGenerator%') {
16198
+ var fn = doEval('%AsyncGeneratorFunction%');
16199
+ if (fn) {
16200
+ value = fn.prototype;
16201
+ }
16202
+ } else if (name === '%AsyncIteratorPrototype%') {
16203
+ var gen = doEval('%AsyncGenerator%');
16204
+ if (gen) {
16205
+ value = getProto(gen.prototype);
16206
+ }
16207
+ }
16208
+
16209
+ INTRINSICS[name] = value;
16210
+
16211
+ return value;
16212
+ };
16213
+
16214
+ var LEGACY_ALIASES = {
16215
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
16216
+ '%ArrayPrototype%': ['Array', 'prototype'],
16217
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
16218
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
16219
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
16220
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
16221
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
16222
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
16223
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
16224
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
16225
+ '%DataViewPrototype%': ['DataView', 'prototype'],
16226
+ '%DatePrototype%': ['Date', 'prototype'],
16227
+ '%ErrorPrototype%': ['Error', 'prototype'],
16228
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
16229
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
16230
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
16231
+ '%FunctionPrototype%': ['Function', 'prototype'],
16232
+ '%Generator%': ['GeneratorFunction', 'prototype'],
16233
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
16234
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
16235
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
16236
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
16237
+ '%JSONParse%': ['JSON', 'parse'],
16238
+ '%JSONStringify%': ['JSON', 'stringify'],
16239
+ '%MapPrototype%': ['Map', 'prototype'],
16240
+ '%NumberPrototype%': ['Number', 'prototype'],
16241
+ '%ObjectPrototype%': ['Object', 'prototype'],
16242
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
16243
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
16244
+ '%PromisePrototype%': ['Promise', 'prototype'],
16245
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
16246
+ '%Promise_all%': ['Promise', 'all'],
16247
+ '%Promise_reject%': ['Promise', 'reject'],
16248
+ '%Promise_resolve%': ['Promise', 'resolve'],
16249
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
16250
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
16251
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
16252
+ '%SetPrototype%': ['Set', 'prototype'],
16253
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
16254
+ '%StringPrototype%': ['String', 'prototype'],
16255
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
16256
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
16257
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
16258
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
16259
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
16260
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
16261
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
16262
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
16263
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
16264
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
16265
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
16266
+ };
16267
+
16268
+ var bind = functionBind;
16269
+ var hasOwn = src;
16270
+ var $concat = bind.call(Function.call, Array.prototype.concat);
16271
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
16272
+ var $replace = bind.call(Function.call, String.prototype.replace);
16273
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
16274
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
16275
+
16276
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
16277
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
16278
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
16279
+ var stringToPath = function stringToPath(string) {
16280
+ var first = $strSlice(string, 0, 1);
16281
+ var last = $strSlice(string, -1);
16282
+ if (first === '%' && last !== '%') {
16283
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
16284
+ } else if (last === '%' && first !== '%') {
16285
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
16286
+ }
16287
+ var result = [];
16288
+ $replace(string, rePropName, function (match, number, quote, subString) {
16289
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
16290
+ });
16291
+ return result;
16292
+ };
16293
+ /* end adaptation */
16294
+
16295
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
16296
+ var intrinsicName = name;
16297
+ var alias;
16298
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
16299
+ alias = LEGACY_ALIASES[intrinsicName];
16300
+ intrinsicName = '%' + alias[0] + '%';
16301
+ }
16302
+
16303
+ if (hasOwn(INTRINSICS, intrinsicName)) {
16304
+ var value = INTRINSICS[intrinsicName];
16305
+ if (value === needsEval) {
16306
+ value = doEval(intrinsicName);
16307
+ }
16308
+ if (typeof value === 'undefined' && !allowMissing) {
16309
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
16310
+ }
16311
+
16312
+ return {
16313
+ alias: alias,
16314
+ name: intrinsicName,
16315
+ value: value
16316
+ };
16317
+ }
16318
+
16319
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
16320
+ };
16321
+
16322
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
16323
+ if (typeof name !== 'string' || name.length === 0) {
16324
+ throw new $TypeError('intrinsic name must be a non-empty string');
16325
+ }
16326
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
16327
+ throw new $TypeError('"allowMissing" argument must be a boolean');
16328
+ }
16329
+
16330
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
16331
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
16332
+ }
16333
+ var parts = stringToPath(name);
16334
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
16335
+
16336
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
16337
+ var intrinsicRealName = intrinsic.name;
16338
+ var value = intrinsic.value;
16339
+ var skipFurtherCaching = false;
16340
+
16341
+ var alias = intrinsic.alias;
16342
+ if (alias) {
16343
+ intrinsicBaseName = alias[0];
16344
+ $spliceApply(parts, $concat([0, 1], alias));
16345
+ }
16346
+
16347
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
16348
+ var part = parts[i];
16349
+ var first = $strSlice(part, 0, 1);
16350
+ var last = $strSlice(part, -1);
16351
+ if (
16352
+ (
16353
+ (first === '"' || first === "'" || first === '`')
16354
+ || (last === '"' || last === "'" || last === '`')
16355
+ )
16356
+ && first !== last
16357
+ ) {
16358
+ throw new $SyntaxError('property names with quotes must have matching quotes');
16359
+ }
16360
+ if (part === 'constructor' || !isOwn) {
16361
+ skipFurtherCaching = true;
16362
+ }
16363
+
16364
+ intrinsicBaseName += '.' + part;
16365
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
16366
+
16367
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
16368
+ value = INTRINSICS[intrinsicRealName];
16369
+ } else if (value != null) {
16370
+ if (!(part in value)) {
16371
+ if (!allowMissing) {
16372
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
16373
+ }
16374
+ return void undefined$1;
16375
+ }
16376
+ if ($gOPD && (i + 1) >= parts.length) {
16377
+ var desc = $gOPD(value, part);
16378
+ isOwn = !!desc;
16379
+
16380
+ // By convention, when a data property is converted to an accessor
16381
+ // property to emulate a data property that does not suffer from
16382
+ // the override mistake, that accessor's getter is marked with
16383
+ // an `originalValue` property. Here, when we detect this, we
16384
+ // uphold the illusion by pretending to see that original data
16385
+ // property, i.e., returning the value rather than the getter
16386
+ // itself.
16387
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
16388
+ value = desc.get;
16389
+ } else {
16390
+ value = value[part];
16391
+ }
16392
+ } else {
16393
+ isOwn = hasOwn(value, part);
16394
+ value = value[part];
16395
+ }
16396
+
16397
+ if (isOwn && !skipFurtherCaching) {
16398
+ INTRINSICS[intrinsicRealName] = value;
16399
+ }
16400
+ }
16401
+ }
16402
+ return value;
16403
+ };
16404
+
16405
+ var callBind$1 = {exports: {}};
16406
+
16407
+ (function (module) {
16408
+
16409
+ var bind = functionBind;
16410
+ var GetIntrinsic = getIntrinsic;
16411
+
16412
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
16413
+ var $call = GetIntrinsic('%Function.prototype.call%');
16414
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
16415
+
16416
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
16417
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
16418
+ var $max = GetIntrinsic('%Math.max%');
16419
+
16420
+ if ($defineProperty) {
16421
+ try {
16422
+ $defineProperty({}, 'a', { value: 1 });
16423
+ } catch (e) {
16424
+ // IE 8 has a broken defineProperty
16425
+ $defineProperty = null;
16426
+ }
16427
+ }
16428
+
16429
+ module.exports = function callBind(originalFunction) {
16430
+ var func = $reflectApply(bind, $call, arguments);
16431
+ if ($gOPD && $defineProperty) {
16432
+ var desc = $gOPD(func, 'length');
16433
+ if (desc.configurable) {
16434
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
16435
+ $defineProperty(
16436
+ func,
16437
+ 'length',
16438
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
16439
+ );
16440
+ }
16441
+ }
16442
+ return func;
16443
+ };
16444
+
16445
+ var applyBind = function applyBind() {
16446
+ return $reflectApply(bind, $apply, arguments);
16447
+ };
16448
+
16449
+ if ($defineProperty) {
16450
+ $defineProperty(module.exports, 'apply', { value: applyBind });
16451
+ } else {
16452
+ module.exports.apply = applyBind;
16453
+ }
16454
+ } (callBind$1));
16455
+
16456
+ var GetIntrinsic$1 = getIntrinsic;
16457
+
16458
+ var callBind = callBind$1.exports;
16459
+
16460
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
16461
+
16462
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
16463
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
16464
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
16465
+ return callBind(intrinsic);
16466
+ }
16467
+ return intrinsic;
16468
+ };
16469
+
16470
+ var GetIntrinsic = getIntrinsic;
16471
+ var callBound = callBound$1;
16472
+
16473
+ GetIntrinsic('%TypeError%');
16474
+ GetIntrinsic('%WeakMap%', true);
16475
+ GetIntrinsic('%Map%', true);
16476
+
16477
+ callBound('WeakMap.prototype.get', true);
16478
+ callBound('WeakMap.prototype.set', true);
16479
+ callBound('WeakMap.prototype.has', true);
16480
+ callBound('Map.prototype.get', true);
16481
+ callBound('Map.prototype.set', true);
16482
+ callBound('Map.prototype.has', true);
16483
+
16484
+ ((function () {
16485
+ var array = [];
16486
+ for (var i = 0; i < 256; ++i) {
16487
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
16488
+ }
16489
+
16490
+ return array;
16491
+ })());
16492
+
17510
16493
  dayjs.extend(weekOfYear);
17511
16494
  dayjs.extend(weekday);
17512
16495
  dayjs.extend(localeData);
@@ -18745,6 +17728,8 @@ Form.propTypes = {
18745
17728
  };
18746
17729
 
18747
17730
  var _excluded$n = ["size", "type", "label", "error", "suffix", "prefix", "disabled", "helpText", "className", "nakedInput", "contentSize", "required", "maxLength", "unlimitedChars", "labelProps", "rejectCharsRegex", "onBlur", "disableTrimOnBlur"];
17731
+ function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17732
+ function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18748
17733
  var SIZES$3 = {
18749
17734
  small: "small",
18750
17735
  medium: "medium",
@@ -18796,10 +17781,13 @@ var Input$2 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
18796
17781
  var valueLength = (value === null || value === void 0 ? void 0 : value.toString().length) || 0;
18797
17782
  var isCharacterLimitVisible = valueLength >= maxLength * 0.85;
18798
17783
  var maxLengthError = unlimitedChars && valueLength > maxLength;
18799
- var onChangeInternal = function onChangeInternal(e) {
18800
- return setValueInternal(e.target.value);
17784
+ var onChange = function onChange(e) {
17785
+ var _otherProps$onChange;
17786
+ if (!otherProps.onChange || !otherProps.value) {
17787
+ setValueInternal(e.target.value);
17788
+ }
17789
+ (_otherProps$onChange = otherProps.onChange) === null || _otherProps$onChange === void 0 ? void 0 : _otherProps$onChange.call(otherProps, e);
18801
17790
  };
18802
- var onChange = otherProps.onChange || onChangeInternal;
18803
17791
  var isMaxLengthPresent = !!maxLength || maxLength === 0;
18804
17792
  var handleRegexChange = function handleRegexChange(e) {
18805
17793
  var globalRegex = new RegExp(rejectCharsRegex, "g");
@@ -18819,9 +17807,9 @@ var Input$2 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
18819
17807
  }, /*#__PURE__*/React__default.createElement("div", {
18820
17808
  className: "neeto-ui-input__label-wrapper"
18821
17809
  }, label && /*#__PURE__*/React__default.createElement(Label, _extends$2({
17810
+ required: required,
18822
17811
  "data-cy": "".concat(hyphenize(label), "-input-label"),
18823
- htmlFor: id,
18824
- required: required
17812
+ htmlFor: id
18825
17813
  }, labelProps), label), isCharacterLimitVisible && /*#__PURE__*/React__default.createElement(Typography, {
18826
17814
  style: "body2",
18827
17815
  className: classnames$1("neeto-ui-input__max-length", {
@@ -18841,17 +17829,19 @@ var Input$2 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
18841
17829
  }, prefix), /*#__PURE__*/React__default.createElement("input", _extends$2({
18842
17830
  "aria-invalid": !!error,
18843
17831
  "data-cy": "".concat(hyphenize(label), "-input-field"),
17832
+ size: contentSize,
17833
+ "aria-describedby": classnames$1((_classnames = {}, _defineProperty$1(_classnames, errorId, !!error), _defineProperty$1(_classnames, helpTextId, helpText), _classnames))
17834
+ }, _objectSpread$6(_objectSpread$6(_objectSpread$6({
18844
17835
  disabled: disabled,
18845
17836
  id: id,
18846
17837
  ref: ref,
18847
17838
  required: required,
18848
- size: contentSize,
18849
- type: type,
18850
- "aria-describedby": classnames$1((_classnames = {}, _defineProperty$1(_classnames, errorId, !!error), _defineProperty$1(_classnames, helpTextId, helpText), _classnames))
17839
+ type: type
18851
17840
  }, isMaxLengthPresent && !unlimitedChars && {
18852
17841
  maxLength: maxLength
18853
- }, otherProps, {
18854
- value: value,
17842
+ }), otherProps), {}, {
17843
+ value: value
17844
+ }), {
18855
17845
  onBlur: handleOnBlur,
18856
17846
  onChange: handleChange
18857
17847
  })), suffix && /*#__PURE__*/React__default.createElement("div", {