@bigbinary/neeto-tags-frontend 1.6.1 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -13,14 +13,13 @@ var reactI18next = require('react-i18next');
13
13
  var i18next = require('i18next');
14
14
  var classNames = require('classnames');
15
15
  var Metadata = require('@bigbinary/neeto-molecules/Metadata');
16
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
17
16
  var reactRouterDom = require('react-router-dom');
17
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
18
18
  var neetoFiltersFrontend = require('@bigbinary/neeto-filters-frontend');
19
19
  var Container$1 = require('@bigbinary/neeto-molecules/Container');
20
20
  var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
21
21
  var reactQuery = require('react-query');
22
22
  var axios = require('axios');
23
- var require$$0 = require('util');
24
23
  var yup = require('yup');
25
24
  var NeetoHeader = require('@bigbinary/neeto-molecules/Header');
26
25
  var formik = require('@bigbinary/neetoui/formik');
@@ -55,7 +54,6 @@ var Metadata__default = /*#__PURE__*/_interopDefaultLegacy(Metadata);
55
54
  var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container$1);
56
55
  var SubHeader__default = /*#__PURE__*/_interopDefaultLegacy(SubHeader);
57
56
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
58
- var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
59
57
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
60
58
  var NeetoHeader__default = /*#__PURE__*/_interopDefaultLegacy(NeetoHeader);
61
59
  var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
@@ -250,13 +248,37 @@ var TagsList = function TagsList(_ref) {
250
248
  }));
251
249
  };
252
250
 
253
- var TagsSelector = reactUtils.withT(function (_ref) {
254
- var t = _ref.t,
255
- defaultMenuIsOpen = _ref.defaultMenuIsOpen,
251
+ var TagsSelector = function TagsSelector(_ref) {
252
+ var defaultMenuIsOpen = _ref.defaultMenuIsOpen,
256
253
  tags = _ref.tags,
257
254
  onChange = _ref.onChange,
258
255
  onCreateOption = _ref.onCreateOption,
259
256
  selectProps = _ref.selectProps;
257
+ var _useState = React.useState(""),
258
+ _useState2 = _slicedToArray(_useState, 2),
259
+ inputValue = _useState2[0],
260
+ setInputValue = _useState2[1];
261
+ var isMenuOpen = React.useRef(defaultMenuIsOpen);
262
+ var _useTranslation = reactI18next.useTranslation(),
263
+ t = _useTranslation.t;
264
+ var handleMenuOpen = function handleMenuOpen() {
265
+ var _selectProps$onMenuOp;
266
+ isMenuOpen.current = true;
267
+ (_selectProps$onMenuOp = selectProps.onMenuOpen) === null || _selectProps$onMenuOp === void 0 || _selectProps$onMenuOp.call(selectProps);
268
+ };
269
+ var handleMenuClose = function handleMenuClose() {
270
+ var _selectProps$onMenuCl;
271
+ isMenuOpen.current = false;
272
+ (_selectProps$onMenuCl = selectProps.onMenuClose) === null || _selectProps$onMenuCl === void 0 || _selectProps$onMenuCl.call(selectProps);
273
+ };
274
+ var handleKeyDown = function handleKeyDown(event) {
275
+ var _selectProps$onKeyDow;
276
+ if (!inputValue) return;
277
+ if (event.key === "Enter" && isMenuOpen.current) {
278
+ event.stopPropagation();
279
+ }
280
+ (_selectProps$onKeyDow = selectProps.onKeyDown) === null || _selectProps$onKeyDow === void 0 || _selectProps$onKeyDow.call(selectProps, event);
281
+ };
260
282
  return /*#__PURE__*/React__default["default"].createElement(neetoui.Select, _extends({
261
283
  defaultMenuIsOpen: defaultMenuIsOpen,
262
284
  onChange: onChange,
@@ -266,8 +288,13 @@ var TagsSelector = reactUtils.withT(function (_ref) {
266
288
  maxLength: 50,
267
289
  options: tags,
268
290
  placeholder: t("neetoTags.placeholder.selectOrCreateTag")
269
- }, selectProps));
270
- });
291
+ }, selectProps, {
292
+ onInputChange: setInputValue,
293
+ onKeyDown: handleKeyDown,
294
+ onMenuClose: handleMenuClose,
295
+ onMenuOpen: handleMenuOpen
296
+ }));
297
+ };
271
298
 
272
299
  /**
273
300
  * A component that helps to manage tags.
@@ -283,7 +310,8 @@ var Tags$2 = function Tags(_ref) {
283
310
  onTagCreate = _ref.onTagCreate,
284
311
  onTagDelete = _ref.onTagDelete,
285
312
  tagProps = _ref.tagProps,
286
- selectProps = _ref.selectProps,
313
+ _ref$selectProps = _ref.selectProps,
314
+ selectProps = _ref$selectProps === void 0 ? {} : _ref$selectProps,
287
315
  buttonProps = _ref.buttonProps,
288
316
  _ref$showSuccessToast = _ref.showSuccessToastr,
289
317
  showSuccessToastr = _ref$showSuccessToast === void 0 ? false : _ref$showSuccessToast,
@@ -323,9 +351,9 @@ var Tags$2 = function Tags(_ref) {
323
351
  return !selectedTagValues.includes(value);
324
352
  });
325
353
  }, [allTags, selectedTags]);
326
- var handleAddExistingTag = function handleAddExistingTag(event) {
354
+ var handleAddExistingTag = function handleAddExistingTag(tag) {
327
355
  setIsTagsDropdownVisible(false);
328
- onTagSelect(event);
356
+ onTagSelect(tag);
329
357
  // @ts-ignore
330
358
  showSuccessToastr && neetoui.Toastr.success("", {
331
359
  icon: "👍",
@@ -363,12 +391,10 @@ var Tags$2 = function Tags(_ref) {
363
391
  var tagsSelectorProps = {
364
392
  defaultMenuIsOpen: showAddTagsOnTitle,
365
393
  tags: tags,
366
- onChange: function onChange(event) {
367
- return handleAddExistingTag(event);
368
- },
369
- onCreateOption: function onCreateOption(event) {
394
+ onChange: handleAddExistingTag,
395
+ onCreateOption: function onCreateOption(tagName) {
370
396
  setIsTagsDropdownVisible(false);
371
- onTagCreate(event);
397
+ onTagCreate(tagName);
372
398
  },
373
399
  selectProps: selectProps
374
400
  };
@@ -506,2073 +532,12 @@ function _objectWithoutProperties(source, excluded) {
506
532
  return target;
507
533
  }
508
534
 
509
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
510
-
511
- function getDefaultExportFromCjs (x) {
512
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
513
- }
514
-
515
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
516
- var shams = function hasSymbols() {
517
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
518
- if (typeof Symbol.iterator === 'symbol') { return true; }
519
-
520
- var obj = {};
521
- var sym = Symbol('test');
522
- var symObj = Object(sym);
523
- if (typeof sym === 'string') { return false; }
524
-
525
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
526
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
527
-
528
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
529
- // if (sym instanceof Symbol) { return false; }
530
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
531
- // if (!(symObj instanceof Symbol)) { return false; }
532
-
533
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
534
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
535
-
536
- var symVal = 42;
537
- obj[sym] = symVal;
538
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
539
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
540
-
541
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
542
-
543
- var syms = Object.getOwnPropertySymbols(obj);
544
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
545
-
546
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
547
-
548
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
549
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
550
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
551
- }
552
-
553
- return true;
554
- };
555
-
556
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
557
- var hasSymbolSham = shams;
558
-
559
- var hasSymbols$1 = function hasNativeSymbols() {
560
- if (typeof origSymbol !== 'function') { return false; }
561
- if (typeof Symbol !== 'function') { return false; }
562
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
563
- if (typeof Symbol('bar') !== 'symbol') { return false; }
564
-
565
- return hasSymbolSham();
566
- };
567
-
568
- var test = {
569
- foo: {}
570
- };
571
-
572
- var $Object = Object;
573
-
574
- var hasProto$1 = function hasProto() {
575
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
576
- };
577
-
578
- /* eslint no-invalid-this: 1 */
579
-
580
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
581
- var slice = Array.prototype.slice;
582
- var toStr$1 = Object.prototype.toString;
583
- var funcType = '[object Function]';
584
-
585
- var implementation$1 = function bind(that) {
586
- var target = this;
587
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
588
- throw new TypeError(ERROR_MESSAGE + target);
589
- }
590
- var args = slice.call(arguments, 1);
591
-
592
- var bound;
593
- var binder = function () {
594
- if (this instanceof bound) {
595
- var result = target.apply(
596
- this,
597
- args.concat(slice.call(arguments))
598
- );
599
- if (Object(result) === result) {
600
- return result;
601
- }
602
- return this;
603
- } else {
604
- return target.apply(
605
- that,
606
- args.concat(slice.call(arguments))
607
- );
608
- }
609
- };
610
-
611
- var boundLength = Math.max(0, target.length - args.length);
612
- var boundArgs = [];
613
- for (var i = 0; i < boundLength; i++) {
614
- boundArgs.push('$' + i);
615
- }
616
-
617
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
618
-
619
- if (target.prototype) {
620
- var Empty = function Empty() {};
621
- Empty.prototype = target.prototype;
622
- bound.prototype = new Empty();
623
- Empty.prototype = null;
624
- }
625
-
626
- return bound;
627
- };
628
-
629
- var implementation = implementation$1;
630
-
631
- var functionBind = Function.prototype.bind || implementation;
632
-
633
- var bind$1 = functionBind;
634
-
635
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
636
-
637
- var undefined$1;
638
-
639
- var $SyntaxError = SyntaxError;
640
- var $Function = Function;
641
- var $TypeError$1 = TypeError;
642
-
643
- // eslint-disable-next-line consistent-return
644
- var getEvalledConstructor = function (expressionSyntax) {
645
- try {
646
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
647
- } catch (e) {}
648
- };
649
-
650
- var $gOPD = Object.getOwnPropertyDescriptor;
651
- if ($gOPD) {
652
- try {
653
- $gOPD({}, '');
654
- } catch (e) {
655
- $gOPD = null; // this is IE 8, which has a broken gOPD
656
- }
657
- }
658
-
659
- var throwTypeError = function () {
660
- throw new $TypeError$1();
661
- };
662
- var ThrowTypeError = $gOPD
663
- ? (function () {
664
- try {
665
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
666
- arguments.callee; // IE 8 does not throw here
667
- return throwTypeError;
668
- } catch (calleeThrows) {
669
- try {
670
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
671
- return $gOPD(arguments, 'callee').get;
672
- } catch (gOPDthrows) {
673
- return throwTypeError;
674
- }
675
- }
676
- }())
677
- : throwTypeError;
678
-
679
- var hasSymbols = hasSymbols$1();
680
- var hasProto = hasProto$1();
681
-
682
- var getProto = Object.getPrototypeOf || (
683
- hasProto
684
- ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
685
- : null
686
- );
687
-
688
- var needsEval = {};
689
-
690
- var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
691
-
692
- var INTRINSICS = {
693
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
694
- '%Array%': Array,
695
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
696
- '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
697
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
698
- '%AsyncFunction%': needsEval,
699
- '%AsyncGenerator%': needsEval,
700
- '%AsyncGeneratorFunction%': needsEval,
701
- '%AsyncIteratorPrototype%': needsEval,
702
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
703
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
704
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
705
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
706
- '%Boolean%': Boolean,
707
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
708
- '%Date%': Date,
709
- '%decodeURI%': decodeURI,
710
- '%decodeURIComponent%': decodeURIComponent,
711
- '%encodeURI%': encodeURI,
712
- '%encodeURIComponent%': encodeURIComponent,
713
- '%Error%': Error,
714
- '%eval%': eval, // eslint-disable-line no-eval
715
- '%EvalError%': EvalError,
716
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
717
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
718
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
719
- '%Function%': $Function,
720
- '%GeneratorFunction%': needsEval,
721
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
722
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
723
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
724
- '%isFinite%': isFinite,
725
- '%isNaN%': isNaN,
726
- '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
727
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
728
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
729
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
730
- '%Math%': Math,
731
- '%Number%': Number,
732
- '%Object%': Object,
733
- '%parseFloat%': parseFloat,
734
- '%parseInt%': parseInt,
735
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
736
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
737
- '%RangeError%': RangeError,
738
- '%ReferenceError%': ReferenceError,
739
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
740
- '%RegExp%': RegExp,
741
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
742
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
743
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
744
- '%String%': String,
745
- '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
746
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
747
- '%SyntaxError%': $SyntaxError,
748
- '%ThrowTypeError%': ThrowTypeError,
749
- '%TypedArray%': TypedArray,
750
- '%TypeError%': $TypeError$1,
751
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
752
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
753
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
754
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
755
- '%URIError%': URIError,
756
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
757
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
758
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
759
- };
760
-
761
- if (getProto) {
762
- try {
763
- null.error; // eslint-disable-line no-unused-expressions
764
- } catch (e) {
765
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
766
- var errorProto = getProto(getProto(e));
767
- INTRINSICS['%Error.prototype%'] = errorProto;
768
- }
769
- }
770
-
771
- var doEval = function doEval(name) {
772
- var value;
773
- if (name === '%AsyncFunction%') {
774
- value = getEvalledConstructor('async function () {}');
775
- } else if (name === '%GeneratorFunction%') {
776
- value = getEvalledConstructor('function* () {}');
777
- } else if (name === '%AsyncGeneratorFunction%') {
778
- value = getEvalledConstructor('async function* () {}');
779
- } else if (name === '%AsyncGenerator%') {
780
- var fn = doEval('%AsyncGeneratorFunction%');
781
- if (fn) {
782
- value = fn.prototype;
783
- }
784
- } else if (name === '%AsyncIteratorPrototype%') {
785
- var gen = doEval('%AsyncGenerator%');
786
- if (gen && getProto) {
787
- value = getProto(gen.prototype);
788
- }
789
- }
790
-
791
- INTRINSICS[name] = value;
792
-
793
- return value;
794
- };
795
-
796
- var LEGACY_ALIASES = {
797
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
798
- '%ArrayPrototype%': ['Array', 'prototype'],
799
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
800
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
801
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
802
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
803
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
804
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
805
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
806
- '%BooleanPrototype%': ['Boolean', 'prototype'],
807
- '%DataViewPrototype%': ['DataView', 'prototype'],
808
- '%DatePrototype%': ['Date', 'prototype'],
809
- '%ErrorPrototype%': ['Error', 'prototype'],
810
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
811
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
812
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
813
- '%FunctionPrototype%': ['Function', 'prototype'],
814
- '%Generator%': ['GeneratorFunction', 'prototype'],
815
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
816
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
817
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
818
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
819
- '%JSONParse%': ['JSON', 'parse'],
820
- '%JSONStringify%': ['JSON', 'stringify'],
821
- '%MapPrototype%': ['Map', 'prototype'],
822
- '%NumberPrototype%': ['Number', 'prototype'],
823
- '%ObjectPrototype%': ['Object', 'prototype'],
824
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
825
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
826
- '%PromisePrototype%': ['Promise', 'prototype'],
827
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
828
- '%Promise_all%': ['Promise', 'all'],
829
- '%Promise_reject%': ['Promise', 'reject'],
830
- '%Promise_resolve%': ['Promise', 'resolve'],
831
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
832
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
833
- '%RegExpPrototype%': ['RegExp', 'prototype'],
834
- '%SetPrototype%': ['Set', 'prototype'],
835
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
836
- '%StringPrototype%': ['String', 'prototype'],
837
- '%SymbolPrototype%': ['Symbol', 'prototype'],
838
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
839
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
840
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
841
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
842
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
843
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
844
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
845
- '%URIErrorPrototype%': ['URIError', 'prototype'],
846
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
847
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
848
- };
849
-
850
- var bind = functionBind;
851
- var hasOwn$1 = src;
852
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
853
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
854
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
855
- var $strSlice = bind.call(Function.call, String.prototype.slice);
856
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
857
-
858
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
859
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
860
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
861
- var stringToPath = function stringToPath(string) {
862
- var first = $strSlice(string, 0, 1);
863
- var last = $strSlice(string, -1);
864
- if (first === '%' && last !== '%') {
865
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
866
- } else if (last === '%' && first !== '%') {
867
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
868
- }
869
- var result = [];
870
- $replace$1(string, rePropName, function (match, number, quote, subString) {
871
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
872
- });
873
- return result;
874
- };
875
- /* end adaptation */
876
-
877
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
878
- var intrinsicName = name;
879
- var alias;
880
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
881
- alias = LEGACY_ALIASES[intrinsicName];
882
- intrinsicName = '%' + alias[0] + '%';
883
- }
884
-
885
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
886
- var value = INTRINSICS[intrinsicName];
887
- if (value === needsEval) {
888
- value = doEval(intrinsicName);
889
- }
890
- if (typeof value === 'undefined' && !allowMissing) {
891
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
892
- }
893
-
894
- return {
895
- alias: alias,
896
- name: intrinsicName,
897
- value: value
898
- };
899
- }
900
-
901
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
902
- };
903
-
904
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
905
- if (typeof name !== 'string' || name.length === 0) {
906
- throw new $TypeError$1('intrinsic name must be a non-empty string');
907
- }
908
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
909
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
910
- }
911
-
912
- if ($exec(/^%?[^%]*%?$/, name) === null) {
913
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
914
- }
915
- var parts = stringToPath(name);
916
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
917
-
918
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
919
- var intrinsicRealName = intrinsic.name;
920
- var value = intrinsic.value;
921
- var skipFurtherCaching = false;
922
-
923
- var alias = intrinsic.alias;
924
- if (alias) {
925
- intrinsicBaseName = alias[0];
926
- $spliceApply(parts, $concat$1([0, 1], alias));
927
- }
928
-
929
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
930
- var part = parts[i];
931
- var first = $strSlice(part, 0, 1);
932
- var last = $strSlice(part, -1);
933
- if (
934
- (
935
- (first === '"' || first === "'" || first === '`')
936
- || (last === '"' || last === "'" || last === '`')
937
- )
938
- && first !== last
939
- ) {
940
- throw new $SyntaxError('property names with quotes must have matching quotes');
941
- }
942
- if (part === 'constructor' || !isOwn) {
943
- skipFurtherCaching = true;
944
- }
945
-
946
- intrinsicBaseName += '.' + part;
947
- intrinsicRealName = '%' + intrinsicBaseName + '%';
948
-
949
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
950
- value = INTRINSICS[intrinsicRealName];
951
- } else if (value != null) {
952
- if (!(part in value)) {
953
- if (!allowMissing) {
954
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
955
- }
956
- return void undefined$1;
957
- }
958
- if ($gOPD && (i + 1) >= parts.length) {
959
- var desc = $gOPD(value, part);
960
- isOwn = !!desc;
961
-
962
- // By convention, when a data property is converted to an accessor
963
- // property to emulate a data property that does not suffer from
964
- // the override mistake, that accessor's getter is marked with
965
- // an `originalValue` property. Here, when we detect this, we
966
- // uphold the illusion by pretending to see that original data
967
- // property, i.e., returning the value rather than the getter
968
- // itself.
969
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
970
- value = desc.get;
971
- } else {
972
- value = value[part];
973
- }
974
- } else {
975
- isOwn = hasOwn$1(value, part);
976
- value = value[part];
977
- }
978
-
979
- if (isOwn && !skipFurtherCaching) {
980
- INTRINSICS[intrinsicRealName] = value;
981
- }
982
- }
983
- }
984
- return value;
985
- };
986
-
987
- var callBind$1 = {exports: {}};
988
-
989
- callBind$1.exports;
990
-
991
- (function (module) {
992
-
993
- var bind = functionBind;
994
- var GetIntrinsic = getIntrinsic;
995
-
996
- var $apply = GetIntrinsic('%Function.prototype.apply%');
997
- var $call = GetIntrinsic('%Function.prototype.call%');
998
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
999
-
1000
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
1001
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
1002
- var $max = GetIntrinsic('%Math.max%');
1003
-
1004
- if ($defineProperty) {
1005
- try {
1006
- $defineProperty({}, 'a', { value: 1 });
1007
- } catch (e) {
1008
- // IE 8 has a broken defineProperty
1009
- $defineProperty = null;
1010
- }
1011
- }
1012
-
1013
- module.exports = function callBind(originalFunction) {
1014
- var func = $reflectApply(bind, $call, arguments);
1015
- if ($gOPD && $defineProperty) {
1016
- var desc = $gOPD(func, 'length');
1017
- if (desc.configurable) {
1018
- // original length, plus the receiver, minus any additional arguments (after the receiver)
1019
- $defineProperty(
1020
- func,
1021
- 'length',
1022
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
1023
- );
1024
- }
1025
- }
1026
- return func;
1027
- };
1028
-
1029
- var applyBind = function applyBind() {
1030
- return $reflectApply(bind, $apply, arguments);
1031
- };
1032
-
1033
- if ($defineProperty) {
1034
- $defineProperty(module.exports, 'apply', { value: applyBind });
1035
- } else {
1036
- module.exports.apply = applyBind;
1037
- }
1038
- } (callBind$1));
1039
-
1040
- var callBindExports = callBind$1.exports;
1041
-
1042
- var GetIntrinsic$1 = getIntrinsic;
1043
-
1044
- var callBind = callBindExports;
1045
-
1046
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
1047
-
1048
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
1049
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
1050
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1051
- return callBind(intrinsic);
1052
- }
1053
- return intrinsic;
1054
- };
1055
-
1056
- var util_inspect = require$$0__default["default"].inspect;
1057
-
1058
- var hasMap = typeof Map === 'function' && Map.prototype;
1059
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
1060
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
1061
- var mapForEach = hasMap && Map.prototype.forEach;
1062
- var hasSet = typeof Set === 'function' && Set.prototype;
1063
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
1064
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
1065
- var setForEach = hasSet && Set.prototype.forEach;
1066
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
1067
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
1068
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
1069
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
1070
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
1071
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
1072
- var booleanValueOf = Boolean.prototype.valueOf;
1073
- var objectToString = Object.prototype.toString;
1074
- var functionToString = Function.prototype.toString;
1075
- var $match = String.prototype.match;
1076
- var $slice = String.prototype.slice;
1077
- var $replace = String.prototype.replace;
1078
- var $toUpperCase = String.prototype.toUpperCase;
1079
- var $toLowerCase = String.prototype.toLowerCase;
1080
- var $test = RegExp.prototype.test;
1081
- var $concat = Array.prototype.concat;
1082
- var $join = Array.prototype.join;
1083
- var $arrSlice = Array.prototype.slice;
1084
- var $floor = Math.floor;
1085
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
1086
- var gOPS = Object.getOwnPropertySymbols;
1087
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
1088
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
1089
- // ie, `has-tostringtag/shams
1090
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
1091
- ? Symbol.toStringTag
1092
- : null;
1093
- var isEnumerable = Object.prototype.propertyIsEnumerable;
1094
-
1095
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
1096
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
1097
- ? function (O) {
1098
- return O.__proto__; // eslint-disable-line no-proto
1099
- }
1100
- : null
1101
- );
1102
-
1103
- function addNumericSeparator(num, str) {
1104
- if (
1105
- num === Infinity
1106
- || num === -Infinity
1107
- || num !== num
1108
- || (num && num > -1000 && num < 1000)
1109
- || $test.call(/e/, str)
1110
- ) {
1111
- return str;
1112
- }
1113
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1114
- if (typeof num === 'number') {
1115
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
1116
- if (int !== num) {
1117
- var intStr = String(int);
1118
- var dec = $slice.call(str, intStr.length + 1);
1119
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
1120
- }
1121
- }
1122
- return $replace.call(str, sepRegex, '$&_');
1123
- }
1124
-
1125
- var utilInspect = util_inspect;
1126
- var inspectCustom = utilInspect.custom;
1127
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
1128
-
1129
- var objectInspect = function inspect_(obj, options, depth, seen) {
1130
- var opts = options || {};
1131
-
1132
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1133
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
1134
- }
1135
- if (
1136
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
1137
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
1138
- : opts.maxStringLength !== null
1139
- )
1140
- ) {
1141
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1142
- }
1143
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
1144
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
1145
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
1146
- }
1147
-
1148
- if (
1149
- has$3(opts, 'indent')
1150
- && opts.indent !== null
1151
- && opts.indent !== '\t'
1152
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
1153
- ) {
1154
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1155
- }
1156
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
1157
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1158
- }
1159
- var numericSeparator = opts.numericSeparator;
1160
-
1161
- if (typeof obj === 'undefined') {
1162
- return 'undefined';
1163
- }
1164
- if (obj === null) {
1165
- return 'null';
1166
- }
1167
- if (typeof obj === 'boolean') {
1168
- return obj ? 'true' : 'false';
1169
- }
1170
-
1171
- if (typeof obj === 'string') {
1172
- return inspectString(obj, opts);
1173
- }
1174
- if (typeof obj === 'number') {
1175
- if (obj === 0) {
1176
- return Infinity / obj > 0 ? '0' : '-0';
1177
- }
1178
- var str = String(obj);
1179
- return numericSeparator ? addNumericSeparator(obj, str) : str;
1180
- }
1181
- if (typeof obj === 'bigint') {
1182
- var bigIntStr = String(obj) + 'n';
1183
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
1184
- }
1185
-
1186
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
1187
- if (typeof depth === 'undefined') { depth = 0; }
1188
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
1189
- return isArray$3(obj) ? '[Array]' : '[Object]';
1190
- }
1191
-
1192
- var indent = getIndent(opts, depth);
1193
-
1194
- if (typeof seen === 'undefined') {
1195
- seen = [];
1196
- } else if (indexOf(seen, obj) >= 0) {
1197
- return '[Circular]';
1198
- }
1199
-
1200
- function inspect(value, from, noIndent) {
1201
- if (from) {
1202
- seen = $arrSlice.call(seen);
1203
- seen.push(from);
1204
- }
1205
- if (noIndent) {
1206
- var newOpts = {
1207
- depth: opts.depth
1208
- };
1209
- if (has$3(opts, 'quoteStyle')) {
1210
- newOpts.quoteStyle = opts.quoteStyle;
1211
- }
1212
- return inspect_(value, newOpts, depth + 1, seen);
1213
- }
1214
- return inspect_(value, opts, depth + 1, seen);
1215
- }
1216
-
1217
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
1218
- var name = nameOf(obj);
1219
- var keys = arrObjKeys(obj, inspect);
1220
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
1221
- }
1222
- if (isSymbol(obj)) {
1223
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1224
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
1225
- }
1226
- if (isElement(obj)) {
1227
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
1228
- var attrs = obj.attributes || [];
1229
- for (var i = 0; i < attrs.length; i++) {
1230
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
1231
- }
1232
- s += '>';
1233
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
1234
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
1235
- return s;
1236
- }
1237
- if (isArray$3(obj)) {
1238
- if (obj.length === 0) { return '[]'; }
1239
- var xs = arrObjKeys(obj, inspect);
1240
- if (indent && !singleLineValues(xs)) {
1241
- return '[' + indentedJoin(xs, indent) + ']';
1242
- }
1243
- return '[ ' + $join.call(xs, ', ') + ' ]';
1244
- }
1245
- if (isError(obj)) {
1246
- var parts = arrObjKeys(obj, inspect);
1247
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
1248
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1249
- }
1250
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
1251
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1252
- }
1253
- if (typeof obj === 'object' && customInspect) {
1254
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
1255
- return utilInspect(obj, { depth: maxDepth - depth });
1256
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
1257
- return obj.inspect();
1258
- }
1259
- }
1260
- if (isMap(obj)) {
1261
- var mapParts = [];
1262
- if (mapForEach) {
1263
- mapForEach.call(obj, function (value, key) {
1264
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
1265
- });
1266
- }
1267
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
1268
- }
1269
- if (isSet(obj)) {
1270
- var setParts = [];
1271
- if (setForEach) {
1272
- setForEach.call(obj, function (value) {
1273
- setParts.push(inspect(value, obj));
1274
- });
1275
- }
1276
- return collectionOf('Set', setSize.call(obj), setParts, indent);
1277
- }
1278
- if (isWeakMap(obj)) {
1279
- return weakCollectionOf('WeakMap');
1280
- }
1281
- if (isWeakSet(obj)) {
1282
- return weakCollectionOf('WeakSet');
1283
- }
1284
- if (isWeakRef(obj)) {
1285
- return weakCollectionOf('WeakRef');
1286
- }
1287
- if (isNumber(obj)) {
1288
- return markBoxed(inspect(Number(obj)));
1289
- }
1290
- if (isBigInt(obj)) {
1291
- return markBoxed(inspect(bigIntValueOf.call(obj)));
1292
- }
1293
- if (isBoolean(obj)) {
1294
- return markBoxed(booleanValueOf.call(obj));
1295
- }
1296
- if (isString(obj)) {
1297
- return markBoxed(inspect(String(obj)));
1298
- }
1299
- if (!isDate(obj) && !isRegExp$1(obj)) {
1300
- var ys = arrObjKeys(obj, inspect);
1301
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1302
- var protoTag = obj instanceof Object ? '' : 'null prototype';
1303
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
1304
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
1305
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
1306
- if (ys.length === 0) { return tag + '{}'; }
1307
- if (indent) {
1308
- return tag + '{' + indentedJoin(ys, indent) + '}';
1309
- }
1310
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
1311
- }
1312
- return String(obj);
1313
- };
1314
-
1315
- function wrapQuotes(s, defaultStyle, opts) {
1316
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1317
- return quoteChar + s + quoteChar;
1318
- }
1319
-
1320
- function quote(s) {
1321
- return $replace.call(String(s), /"/g, '&quot;');
1322
- }
1323
-
1324
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1325
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1326
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1327
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1328
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1329
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1330
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1331
-
1332
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
1333
- function isSymbol(obj) {
1334
- if (hasShammedSymbols) {
1335
- return obj && typeof obj === 'object' && obj instanceof Symbol;
1336
- }
1337
- if (typeof obj === 'symbol') {
1338
- return true;
1339
- }
1340
- if (!obj || typeof obj !== 'object' || !symToString) {
1341
- return false;
1342
- }
1343
- try {
1344
- symToString.call(obj);
1345
- return true;
1346
- } catch (e) {}
1347
- return false;
1348
- }
1349
-
1350
- function isBigInt(obj) {
1351
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
1352
- return false;
1353
- }
1354
- try {
1355
- bigIntValueOf.call(obj);
1356
- return true;
1357
- } catch (e) {}
1358
- return false;
1359
- }
1360
-
1361
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
1362
- function has$3(obj, key) {
1363
- return hasOwn.call(obj, key);
1364
- }
1365
-
1366
- function toStr(obj) {
1367
- return objectToString.call(obj);
1368
- }
1369
-
1370
- function nameOf(f) {
1371
- if (f.name) { return f.name; }
1372
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
1373
- if (m) { return m[1]; }
1374
- return null;
1375
- }
1376
-
1377
- function indexOf(xs, x) {
1378
- if (xs.indexOf) { return xs.indexOf(x); }
1379
- for (var i = 0, l = xs.length; i < l; i++) {
1380
- if (xs[i] === x) { return i; }
1381
- }
1382
- return -1;
1383
- }
1384
-
1385
- function isMap(x) {
1386
- if (!mapSize || !x || typeof x !== 'object') {
1387
- return false;
1388
- }
1389
- try {
1390
- mapSize.call(x);
1391
- try {
1392
- setSize.call(x);
1393
- } catch (s) {
1394
- return true;
1395
- }
1396
- return x instanceof Map; // core-js workaround, pre-v2.5.0
1397
- } catch (e) {}
1398
- return false;
1399
- }
1400
-
1401
- function isWeakMap(x) {
1402
- if (!weakMapHas || !x || typeof x !== 'object') {
1403
- return false;
1404
- }
1405
- try {
1406
- weakMapHas.call(x, weakMapHas);
1407
- try {
1408
- weakSetHas.call(x, weakSetHas);
1409
- } catch (s) {
1410
- return true;
1411
- }
1412
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
1413
- } catch (e) {}
1414
- return false;
1415
- }
1416
-
1417
- function isWeakRef(x) {
1418
- if (!weakRefDeref || !x || typeof x !== 'object') {
1419
- return false;
1420
- }
1421
- try {
1422
- weakRefDeref.call(x);
1423
- return true;
1424
- } catch (e) {}
1425
- return false;
1426
- }
1427
-
1428
- function isSet(x) {
1429
- if (!setSize || !x || typeof x !== 'object') {
1430
- return false;
1431
- }
1432
- try {
1433
- setSize.call(x);
1434
- try {
1435
- mapSize.call(x);
1436
- } catch (m) {
1437
- return true;
1438
- }
1439
- return x instanceof Set; // core-js workaround, pre-v2.5.0
1440
- } catch (e) {}
1441
- return false;
1442
- }
1443
-
1444
- function isWeakSet(x) {
1445
- if (!weakSetHas || !x || typeof x !== 'object') {
1446
- return false;
1447
- }
1448
- try {
1449
- weakSetHas.call(x, weakSetHas);
1450
- try {
1451
- weakMapHas.call(x, weakMapHas);
1452
- } catch (s) {
1453
- return true;
1454
- }
1455
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
1456
- } catch (e) {}
1457
- return false;
1458
- }
1459
-
1460
- function isElement(x) {
1461
- if (!x || typeof x !== 'object') { return false; }
1462
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
1463
- return true;
1464
- }
1465
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
1466
- }
1467
-
1468
- function inspectString(str, opts) {
1469
- if (str.length > opts.maxStringLength) {
1470
- var remaining = str.length - opts.maxStringLength;
1471
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1472
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1473
- }
1474
- // eslint-disable-next-line no-control-regex
1475
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1476
- return wrapQuotes(s, 'single', opts);
1477
- }
1478
-
1479
- function lowbyte(c) {
1480
- var n = c.charCodeAt(0);
1481
- var x = {
1482
- 8: 'b',
1483
- 9: 't',
1484
- 10: 'n',
1485
- 12: 'f',
1486
- 13: 'r'
1487
- }[n];
1488
- if (x) { return '\\' + x; }
1489
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
1490
- }
1491
-
1492
- function markBoxed(str) {
1493
- return 'Object(' + str + ')';
1494
- }
1495
-
1496
- function weakCollectionOf(type) {
1497
- return type + ' { ? }';
1498
- }
1499
-
1500
- function collectionOf(type, size, entries, indent) {
1501
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
1502
- return type + ' (' + size + ') {' + joinedEntries + '}';
1503
- }
1504
-
1505
- function singleLineValues(xs) {
1506
- for (var i = 0; i < xs.length; i++) {
1507
- if (indexOf(xs[i], '\n') >= 0) {
1508
- return false;
1509
- }
1510
- }
1511
- return true;
1512
- }
1513
-
1514
- function getIndent(opts, depth) {
1515
- var baseIndent;
1516
- if (opts.indent === '\t') {
1517
- baseIndent = '\t';
1518
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
1519
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
1520
- } else {
1521
- return null;
1522
- }
1523
- return {
1524
- base: baseIndent,
1525
- prev: $join.call(Array(depth + 1), baseIndent)
1526
- };
1527
- }
1528
-
1529
- function indentedJoin(xs, indent) {
1530
- if (xs.length === 0) { return ''; }
1531
- var lineJoiner = '\n' + indent.prev + indent.base;
1532
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
1533
- }
1534
-
1535
- function arrObjKeys(obj, inspect) {
1536
- var isArr = isArray$3(obj);
1537
- var xs = [];
1538
- if (isArr) {
1539
- xs.length = obj.length;
1540
- for (var i = 0; i < obj.length; i++) {
1541
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
1542
- }
1543
- }
1544
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
1545
- var symMap;
1546
- if (hasShammedSymbols) {
1547
- symMap = {};
1548
- for (var k = 0; k < syms.length; k++) {
1549
- symMap['$' + syms[k]] = syms[k];
1550
- }
1551
- }
1552
-
1553
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
1554
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1555
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1556
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
1557
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
1558
- continue; // eslint-disable-line no-restricted-syntax, no-continue
1559
- } else if ($test.call(/[^\w$]/, key)) {
1560
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
1561
- } else {
1562
- xs.push(key + ': ' + inspect(obj[key], obj));
1563
- }
1564
- }
1565
- if (typeof gOPS === 'function') {
1566
- for (var j = 0; j < syms.length; j++) {
1567
- if (isEnumerable.call(obj, syms[j])) {
1568
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
1569
- }
1570
- }
1571
- }
1572
- return xs;
1573
- }
1574
-
1575
- var GetIntrinsic = getIntrinsic;
1576
- var callBound = callBound$1;
1577
- var inspect = objectInspect;
1578
-
1579
- var $TypeError = GetIntrinsic('%TypeError%');
1580
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
1581
- var $Map = GetIntrinsic('%Map%', true);
1582
-
1583
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
1584
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
1585
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
1586
- var $mapGet = callBound('Map.prototype.get', true);
1587
- var $mapSet = callBound('Map.prototype.set', true);
1588
- var $mapHas = callBound('Map.prototype.has', true);
1589
-
1590
- /*
1591
- * This function traverses the list returning the node corresponding to the
1592
- * given key.
1593
- *
1594
- * That node is also moved to the head of the list, so that if it's accessed
1595
- * again we don't need to traverse the whole list. By doing so, all the recently
1596
- * used nodes can be accessed relatively quickly.
1597
- */
1598
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
1599
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
1600
- if (curr.key === key) {
1601
- prev.next = curr.next;
1602
- curr.next = list.next;
1603
- list.next = curr; // eslint-disable-line no-param-reassign
1604
- return curr;
1605
- }
1606
- }
1607
- };
1608
-
1609
- var listGet = function (objects, key) {
1610
- var node = listGetNode(objects, key);
1611
- return node && node.value;
1612
- };
1613
- var listSet = function (objects, key, value) {
1614
- var node = listGetNode(objects, key);
1615
- if (node) {
1616
- node.value = value;
1617
- } else {
1618
- // Prepend the new node to the beginning of the list
1619
- objects.next = { // eslint-disable-line no-param-reassign
1620
- key: key,
1621
- next: objects.next,
1622
- value: value
1623
- };
1624
- }
1625
- };
1626
- var listHas = function (objects, key) {
1627
- return !!listGetNode(objects, key);
1628
- };
1629
-
1630
- var sideChannel = function getSideChannel() {
1631
- var $wm;
1632
- var $m;
1633
- var $o;
1634
- var channel = {
1635
- assert: function (key) {
1636
- if (!channel.has(key)) {
1637
- throw new $TypeError('Side channel does not contain ' + inspect(key));
1638
- }
1639
- },
1640
- get: function (key) { // eslint-disable-line consistent-return
1641
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1642
- if ($wm) {
1643
- return $weakMapGet($wm, key);
1644
- }
1645
- } else if ($Map) {
1646
- if ($m) {
1647
- return $mapGet($m, key);
1648
- }
1649
- } else {
1650
- if ($o) { // eslint-disable-line no-lonely-if
1651
- return listGet($o, key);
1652
- }
1653
- }
1654
- },
1655
- has: function (key) {
1656
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1657
- if ($wm) {
1658
- return $weakMapHas($wm, key);
1659
- }
1660
- } else if ($Map) {
1661
- if ($m) {
1662
- return $mapHas($m, key);
1663
- }
1664
- } else {
1665
- if ($o) { // eslint-disable-line no-lonely-if
1666
- return listHas($o, key);
1667
- }
1668
- }
1669
- return false;
1670
- },
1671
- set: function (key, value) {
1672
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1673
- if (!$wm) {
1674
- $wm = new $WeakMap();
1675
- }
1676
- $weakMapSet($wm, key, value);
1677
- } else if ($Map) {
1678
- if (!$m) {
1679
- $m = new $Map();
1680
- }
1681
- $mapSet($m, key, value);
1682
- } else {
1683
- if (!$o) {
1684
- /*
1685
- * Initialize the linked list as an empty node, so that we don't have
1686
- * to special-case handling of the first node: we can always refer to
1687
- * it as (previous node).next, instead of something like (list).head
1688
- */
1689
- $o = { key: {}, next: null };
1690
- }
1691
- listSet($o, key, value);
1692
- }
1693
- }
1694
- };
1695
- return channel;
1696
- };
1697
-
1698
- var replace = String.prototype.replace;
1699
- var percentTwenties = /%20/g;
1700
-
1701
- var Format = {
1702
- RFC1738: 'RFC1738',
1703
- RFC3986: 'RFC3986'
1704
- };
1705
-
1706
- var formats$3 = {
1707
- 'default': Format.RFC3986,
1708
- formatters: {
1709
- RFC1738: function (value) {
1710
- return replace.call(value, percentTwenties, '+');
1711
- },
1712
- RFC3986: function (value) {
1713
- return String(value);
1714
- }
1715
- },
1716
- RFC1738: Format.RFC1738,
1717
- RFC3986: Format.RFC3986
1718
- };
1719
-
1720
- var formats$2 = formats$3;
1721
-
1722
- var has$2 = Object.prototype.hasOwnProperty;
1723
- var isArray$2 = Array.isArray;
1724
-
1725
- var hexTable = (function () {
1726
- var array = [];
1727
- for (var i = 0; i < 256; ++i) {
1728
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
1729
- }
1730
-
1731
- return array;
1732
- }());
1733
-
1734
- var compactQueue = function compactQueue(queue) {
1735
- while (queue.length > 1) {
1736
- var item = queue.pop();
1737
- var obj = item.obj[item.prop];
1738
-
1739
- if (isArray$2(obj)) {
1740
- var compacted = [];
1741
-
1742
- for (var j = 0; j < obj.length; ++j) {
1743
- if (typeof obj[j] !== 'undefined') {
1744
- compacted.push(obj[j]);
1745
- }
1746
- }
1747
-
1748
- item.obj[item.prop] = compacted;
1749
- }
1750
- }
1751
- };
1752
-
1753
- var arrayToObject = function arrayToObject(source, options) {
1754
- var obj = options && options.plainObjects ? Object.create(null) : {};
1755
- for (var i = 0; i < source.length; ++i) {
1756
- if (typeof source[i] !== 'undefined') {
1757
- obj[i] = source[i];
1758
- }
1759
- }
1760
-
1761
- return obj;
1762
- };
1763
-
1764
- var merge$1 = function merge(target, source, options) {
1765
- /* eslint no-param-reassign: 0 */
1766
- if (!source) {
1767
- return target;
1768
- }
1769
-
1770
- if (typeof source !== 'object') {
1771
- if (isArray$2(target)) {
1772
- target.push(source);
1773
- } else if (target && typeof target === 'object') {
1774
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
1775
- target[source] = true;
1776
- }
1777
- } else {
1778
- return [target, source];
1779
- }
1780
-
1781
- return target;
1782
- }
1783
-
1784
- if (!target || typeof target !== 'object') {
1785
- return [target].concat(source);
1786
- }
1787
-
1788
- var mergeTarget = target;
1789
- if (isArray$2(target) && !isArray$2(source)) {
1790
- mergeTarget = arrayToObject(target, options);
1791
- }
1792
-
1793
- if (isArray$2(target) && isArray$2(source)) {
1794
- source.forEach(function (item, i) {
1795
- if (has$2.call(target, i)) {
1796
- var targetItem = target[i];
1797
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
1798
- target[i] = merge(targetItem, item, options);
1799
- } else {
1800
- target.push(item);
1801
- }
1802
- } else {
1803
- target[i] = item;
1804
- }
1805
- });
1806
- return target;
1807
- }
1808
-
1809
- return Object.keys(source).reduce(function (acc, key) {
1810
- var value = source[key];
1811
-
1812
- if (has$2.call(acc, key)) {
1813
- acc[key] = merge(acc[key], value, options);
1814
- } else {
1815
- acc[key] = value;
1816
- }
1817
- return acc;
1818
- }, mergeTarget);
1819
- };
1820
-
1821
- var assign = function assignSingleSource(target, source) {
1822
- return Object.keys(source).reduce(function (acc, key) {
1823
- acc[key] = source[key];
1824
- return acc;
1825
- }, target);
1826
- };
1827
-
1828
- var decode = function (str, decoder, charset) {
1829
- var strWithoutPlus = str.replace(/\+/g, ' ');
1830
- if (charset === 'iso-8859-1') {
1831
- // unescape never throws, no try...catch needed:
1832
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1833
- }
1834
- // utf-8
1835
- try {
1836
- return decodeURIComponent(strWithoutPlus);
1837
- } catch (e) {
1838
- return strWithoutPlus;
1839
- }
1840
- };
1841
-
1842
- var encode = function encode(str, defaultEncoder, charset, kind, format) {
1843
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
1844
- // It has been adapted here for stricter adherence to RFC 3986
1845
- if (str.length === 0) {
1846
- return str;
1847
- }
1848
-
1849
- var string = str;
1850
- if (typeof str === 'symbol') {
1851
- string = Symbol.prototype.toString.call(str);
1852
- } else if (typeof str !== 'string') {
1853
- string = String(str);
1854
- }
1855
-
1856
- if (charset === 'iso-8859-1') {
1857
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1858
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1859
- });
1860
- }
1861
-
1862
- var out = '';
1863
- for (var i = 0; i < string.length; ++i) {
1864
- var c = string.charCodeAt(i);
1865
-
1866
- if (
1867
- c === 0x2D // -
1868
- || c === 0x2E // .
1869
- || c === 0x5F // _
1870
- || c === 0x7E // ~
1871
- || (c >= 0x30 && c <= 0x39) // 0-9
1872
- || (c >= 0x41 && c <= 0x5A) // a-z
1873
- || (c >= 0x61 && c <= 0x7A) // A-Z
1874
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
1875
- ) {
1876
- out += string.charAt(i);
1877
- continue;
1878
- }
1879
-
1880
- if (c < 0x80) {
1881
- out = out + hexTable[c];
1882
- continue;
1883
- }
1884
-
1885
- if (c < 0x800) {
1886
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
1887
- continue;
1888
- }
1889
-
1890
- if (c < 0xD800 || c >= 0xE000) {
1891
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
1892
- continue;
1893
- }
1894
-
1895
- i += 1;
1896
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
1897
- /* eslint operator-linebreak: [2, "before"] */
1898
- out += hexTable[0xF0 | (c >> 18)]
1899
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
1900
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
1901
- + hexTable[0x80 | (c & 0x3F)];
1902
- }
1903
-
1904
- return out;
1905
- };
1906
-
1907
- var compact = function compact(value) {
1908
- var queue = [{ obj: { o: value }, prop: 'o' }];
1909
- var refs = [];
1910
-
1911
- for (var i = 0; i < queue.length; ++i) {
1912
- var item = queue[i];
1913
- var obj = item.obj[item.prop];
1914
-
1915
- var keys = Object.keys(obj);
1916
- for (var j = 0; j < keys.length; ++j) {
1917
- var key = keys[j];
1918
- var val = obj[key];
1919
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
1920
- queue.push({ obj: obj, prop: key });
1921
- refs.push(val);
1922
- }
1923
- }
1924
- }
1925
-
1926
- compactQueue(queue);
1927
-
1928
- return value;
1929
- };
1930
-
1931
- var isRegExp = function isRegExp(obj) {
1932
- return Object.prototype.toString.call(obj) === '[object RegExp]';
1933
- };
1934
-
1935
- var isBuffer = function isBuffer(obj) {
1936
- if (!obj || typeof obj !== 'object') {
1937
- return false;
1938
- }
1939
-
1940
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1941
- };
1942
-
1943
- var combine = function combine(a, b) {
1944
- return [].concat(a, b);
1945
- };
1946
-
1947
- var maybeMap = function maybeMap(val, fn) {
1948
- if (isArray$2(val)) {
1949
- var mapped = [];
1950
- for (var i = 0; i < val.length; i += 1) {
1951
- mapped.push(fn(val[i]));
1952
- }
1953
- return mapped;
1954
- }
1955
- return fn(val);
1956
- };
1957
-
1958
- var utils$2 = {
1959
- arrayToObject: arrayToObject,
1960
- assign: assign,
1961
- combine: combine,
1962
- compact: compact,
1963
- decode: decode,
1964
- encode: encode,
1965
- isBuffer: isBuffer,
1966
- isRegExp: isRegExp,
1967
- maybeMap: maybeMap,
1968
- merge: merge$1
1969
- };
1970
-
1971
- var getSideChannel = sideChannel;
1972
- var utils$1 = utils$2;
1973
- var formats$1 = formats$3;
1974
- var has$1 = Object.prototype.hasOwnProperty;
1975
-
1976
- var arrayPrefixGenerators = {
1977
- brackets: function brackets(prefix) {
1978
- return prefix + '[]';
1979
- },
1980
- comma: 'comma',
1981
- indices: function indices(prefix, key) {
1982
- return prefix + '[' + key + ']';
1983
- },
1984
- repeat: function repeat(prefix) {
1985
- return prefix;
1986
- }
1987
- };
1988
-
1989
- var isArray$1 = Array.isArray;
1990
- var push = Array.prototype.push;
1991
- var pushToArray = function (arr, valueOrArray) {
1992
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
1993
- };
1994
-
1995
- var toISO = Date.prototype.toISOString;
1996
-
1997
- var defaultFormat = formats$1['default'];
1998
- var defaults$1 = {
1999
- addQueryPrefix: false,
2000
- allowDots: false,
2001
- charset: 'utf-8',
2002
- charsetSentinel: false,
2003
- delimiter: '&',
2004
- encode: true,
2005
- encoder: utils$1.encode,
2006
- encodeValuesOnly: false,
2007
- format: defaultFormat,
2008
- formatter: formats$1.formatters[defaultFormat],
2009
- // deprecated
2010
- indices: false,
2011
- serializeDate: function serializeDate(date) {
2012
- return toISO.call(date);
2013
- },
2014
- skipNulls: false,
2015
- strictNullHandling: false
2016
- };
2017
-
2018
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
2019
- return typeof v === 'string'
2020
- || typeof v === 'number'
2021
- || typeof v === 'boolean'
2022
- || typeof v === 'symbol'
2023
- || typeof v === 'bigint';
2024
- };
2025
-
2026
- var sentinel = {};
2027
-
2028
- var stringify$1 = function stringify(
2029
- object,
2030
- prefix,
2031
- generateArrayPrefix,
2032
- commaRoundTrip,
2033
- strictNullHandling,
2034
- skipNulls,
2035
- encoder,
2036
- filter,
2037
- sort,
2038
- allowDots,
2039
- serializeDate,
2040
- format,
2041
- formatter,
2042
- encodeValuesOnly,
2043
- charset,
2044
- sideChannel
2045
- ) {
2046
- var obj = object;
2047
-
2048
- var tmpSc = sideChannel;
2049
- var step = 0;
2050
- var findFlag = false;
2051
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
2052
- // Where object last appeared in the ref tree
2053
- var pos = tmpSc.get(object);
2054
- step += 1;
2055
- if (typeof pos !== 'undefined') {
2056
- if (pos === step) {
2057
- throw new RangeError('Cyclic object value');
2058
- } else {
2059
- findFlag = true; // Break while
2060
- }
2061
- }
2062
- if (typeof tmpSc.get(sentinel) === 'undefined') {
2063
- step = 0;
2064
- }
2065
- }
2066
-
2067
- if (typeof filter === 'function') {
2068
- obj = filter(prefix, obj);
2069
- } else if (obj instanceof Date) {
2070
- obj = serializeDate(obj);
2071
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
2072
- obj = utils$1.maybeMap(obj, function (value) {
2073
- if (value instanceof Date) {
2074
- return serializeDate(value);
2075
- }
2076
- return value;
2077
- });
2078
- }
2079
-
2080
- if (obj === null) {
2081
- if (strictNullHandling) {
2082
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
2083
- }
2084
-
2085
- obj = '';
2086
- }
2087
-
2088
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
2089
- if (encoder) {
2090
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
2091
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
2092
- }
2093
- return [formatter(prefix) + '=' + formatter(String(obj))];
2094
- }
2095
-
2096
- var values = [];
2097
-
2098
- if (typeof obj === 'undefined') {
2099
- return values;
2100
- }
2101
-
2102
- var objKeys;
2103
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
2104
- // we need to join elements in
2105
- if (encodeValuesOnly && encoder) {
2106
- obj = utils$1.maybeMap(obj, encoder);
2107
- }
2108
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
2109
- } else if (isArray$1(filter)) {
2110
- objKeys = filter;
2111
- } else {
2112
- var keys = Object.keys(obj);
2113
- objKeys = sort ? keys.sort(sort) : keys;
2114
- }
2115
-
2116
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
2117
-
2118
- for (var j = 0; j < objKeys.length; ++j) {
2119
- var key = objKeys[j];
2120
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
2121
-
2122
- if (skipNulls && value === null) {
2123
- continue;
2124
- }
2125
-
2126
- var keyPrefix = isArray$1(obj)
2127
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
2128
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
2129
-
2130
- sideChannel.set(object, step);
2131
- var valueSideChannel = getSideChannel();
2132
- valueSideChannel.set(sentinel, sideChannel);
2133
- pushToArray(values, stringify(
2134
- value,
2135
- keyPrefix,
2136
- generateArrayPrefix,
2137
- commaRoundTrip,
2138
- strictNullHandling,
2139
- skipNulls,
2140
- generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
2141
- filter,
2142
- sort,
2143
- allowDots,
2144
- serializeDate,
2145
- format,
2146
- formatter,
2147
- encodeValuesOnly,
2148
- charset,
2149
- valueSideChannel
2150
- ));
2151
- }
2152
-
2153
- return values;
2154
- };
2155
-
2156
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
2157
- if (!opts) {
2158
- return defaults$1;
2159
- }
2160
-
2161
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
2162
- throw new TypeError('Encoder has to be a function.');
2163
- }
2164
-
2165
- var charset = opts.charset || defaults$1.charset;
2166
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2167
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2168
- }
2169
-
2170
- var format = formats$1['default'];
2171
- if (typeof opts.format !== 'undefined') {
2172
- if (!has$1.call(formats$1.formatters, opts.format)) {
2173
- throw new TypeError('Unknown format option provided.');
2174
- }
2175
- format = opts.format;
2176
- }
2177
- var formatter = formats$1.formatters[format];
2178
-
2179
- var filter = defaults$1.filter;
2180
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
2181
- filter = opts.filter;
2182
- }
2183
-
2184
- return {
2185
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
2186
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
2187
- charset: charset,
2188
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
2189
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
2190
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
2191
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
2192
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
2193
- filter: filter,
2194
- format: format,
2195
- formatter: formatter,
2196
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
2197
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
2198
- sort: typeof opts.sort === 'function' ? opts.sort : null,
2199
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
2200
- };
2201
- };
2202
-
2203
- var stringify_1 = function (object, opts) {
2204
- var obj = object;
2205
- var options = normalizeStringifyOptions(opts);
2206
-
2207
- var objKeys;
2208
- var filter;
2209
-
2210
- if (typeof options.filter === 'function') {
2211
- filter = options.filter;
2212
- obj = filter('', obj);
2213
- } else if (isArray$1(options.filter)) {
2214
- filter = options.filter;
2215
- objKeys = filter;
2216
- }
2217
-
2218
- var keys = [];
2219
-
2220
- if (typeof obj !== 'object' || obj === null) {
2221
- return '';
2222
- }
2223
-
2224
- var arrayFormat;
2225
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
2226
- arrayFormat = opts.arrayFormat;
2227
- } else if (opts && 'indices' in opts) {
2228
- arrayFormat = opts.indices ? 'indices' : 'repeat';
2229
- } else {
2230
- arrayFormat = 'indices';
2231
- }
2232
-
2233
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2234
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2235
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2236
- }
2237
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
2238
-
2239
- if (!objKeys) {
2240
- objKeys = Object.keys(obj);
2241
- }
2242
-
2243
- if (options.sort) {
2244
- objKeys.sort(options.sort);
2245
- }
2246
-
2247
- var sideChannel = getSideChannel();
2248
- for (var i = 0; i < objKeys.length; ++i) {
2249
- var key = objKeys[i];
2250
-
2251
- if (options.skipNulls && obj[key] === null) {
2252
- continue;
2253
- }
2254
- pushToArray(keys, stringify$1(
2255
- obj[key],
2256
- key,
2257
- generateArrayPrefix,
2258
- commaRoundTrip,
2259
- options.strictNullHandling,
2260
- options.skipNulls,
2261
- options.encode ? options.encoder : null,
2262
- options.filter,
2263
- options.sort,
2264
- options.allowDots,
2265
- options.serializeDate,
2266
- options.format,
2267
- options.formatter,
2268
- options.encodeValuesOnly,
2269
- options.charset,
2270
- sideChannel
2271
- ));
2272
- }
2273
-
2274
- var joined = keys.join(options.delimiter);
2275
- var prefix = options.addQueryPrefix === true ? '?' : '';
2276
-
2277
- if (options.charsetSentinel) {
2278
- if (options.charset === 'iso-8859-1') {
2279
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
2280
- prefix += 'utf8=%26%2310003%3B&';
2281
- } else {
2282
- // encodeURIComponent('✓')
2283
- prefix += 'utf8=%E2%9C%93&';
2284
- }
2285
- }
2286
-
2287
- return joined.length > 0 ? prefix + joined : '';
2288
- };
2289
-
2290
- var utils = utils$2;
2291
-
2292
- var has = Object.prototype.hasOwnProperty;
2293
- var isArray = Array.isArray;
2294
-
2295
- var defaults = {
2296
- allowDots: false,
2297
- allowPrototypes: false,
2298
- allowSparse: false,
2299
- arrayLimit: 20,
2300
- charset: 'utf-8',
2301
- charsetSentinel: false,
2302
- comma: false,
2303
- decoder: utils.decode,
2304
- delimiter: '&',
2305
- depth: 5,
2306
- ignoreQueryPrefix: false,
2307
- interpretNumericEntities: false,
2308
- parameterLimit: 1000,
2309
- parseArrays: true,
2310
- plainObjects: false,
2311
- strictNullHandling: false
2312
- };
2313
-
2314
- var interpretNumericEntities = function (str) {
2315
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
2316
- return String.fromCharCode(parseInt(numberStr, 10));
2317
- });
2318
- };
2319
-
2320
- var parseArrayValue = function (val, options) {
2321
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
2322
- return val.split(',');
2323
- }
2324
-
2325
- return val;
2326
- };
2327
-
2328
- // This is what browsers will submit when the ✓ character occurs in an
2329
- // application/x-www-form-urlencoded body and the encoding of the page containing
2330
- // the form is iso-8859-1, or when the submitted form has an accept-charset
2331
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
2332
- // the ✓ character, such as us-ascii.
2333
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2334
-
2335
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
2336
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2337
-
2338
- var parseValues = function parseQueryStringValues(str, options) {
2339
- var obj = { __proto__: null };
2340
-
2341
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2342
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2343
- var parts = cleanStr.split(options.delimiter, limit);
2344
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
2345
- var i;
2346
-
2347
- var charset = options.charset;
2348
- if (options.charsetSentinel) {
2349
- for (i = 0; i < parts.length; ++i) {
2350
- if (parts[i].indexOf('utf8=') === 0) {
2351
- if (parts[i] === charsetSentinel) {
2352
- charset = 'utf-8';
2353
- } else if (parts[i] === isoSentinel) {
2354
- charset = 'iso-8859-1';
2355
- }
2356
- skipIndex = i;
2357
- i = parts.length; // The eslint settings do not allow break;
2358
- }
2359
- }
2360
- }
2361
-
2362
- for (i = 0; i < parts.length; ++i) {
2363
- if (i === skipIndex) {
2364
- continue;
2365
- }
2366
- var part = parts[i];
2367
-
2368
- var bracketEqualsPos = part.indexOf(']=');
2369
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2370
-
2371
- var key, val;
2372
- if (pos === -1) {
2373
- key = options.decoder(part, defaults.decoder, charset, 'key');
2374
- val = options.strictNullHandling ? null : '';
2375
- } else {
2376
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
2377
- val = utils.maybeMap(
2378
- parseArrayValue(part.slice(pos + 1), options),
2379
- function (encodedVal) {
2380
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
2381
- }
2382
- );
2383
- }
2384
-
2385
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
2386
- val = interpretNumericEntities(val);
2387
- }
2388
-
2389
- if (part.indexOf('[]=') > -1) {
2390
- val = isArray(val) ? [val] : val;
2391
- }
2392
-
2393
- if (has.call(obj, key)) {
2394
- obj[key] = utils.combine(obj[key], val);
2395
- } else {
2396
- obj[key] = val;
2397
- }
2398
- }
2399
-
2400
- return obj;
2401
- };
2402
-
2403
- var parseObject = function (chain, val, options, valuesParsed) {
2404
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
2405
-
2406
- for (var i = chain.length - 1; i >= 0; --i) {
2407
- var obj;
2408
- var root = chain[i];
2409
-
2410
- if (root === '[]' && options.parseArrays) {
2411
- obj = [].concat(leaf);
2412
- } else {
2413
- obj = options.plainObjects ? Object.create(null) : {};
2414
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2415
- var index = parseInt(cleanRoot, 10);
2416
- if (!options.parseArrays && cleanRoot === '') {
2417
- obj = { 0: leaf };
2418
- } else if (
2419
- !isNaN(index)
2420
- && root !== cleanRoot
2421
- && String(index) === cleanRoot
2422
- && index >= 0
2423
- && (options.parseArrays && index <= options.arrayLimit)
2424
- ) {
2425
- obj = [];
2426
- obj[index] = leaf;
2427
- } else if (cleanRoot !== '__proto__') {
2428
- obj[cleanRoot] = leaf;
2429
- }
2430
- }
2431
-
2432
- leaf = obj;
2433
- }
2434
-
2435
- return leaf;
2436
- };
2437
-
2438
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2439
- if (!givenKey) {
2440
- return;
2441
- }
2442
-
2443
- // Transform dot notation to bracket notation
2444
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2445
-
2446
- // The regex chunks
2447
-
2448
- var brackets = /(\[[^[\]]*])/;
2449
- var child = /(\[[^[\]]*])/g;
2450
-
2451
- // Get the parent
2452
-
2453
- var segment = options.depth > 0 && brackets.exec(key);
2454
- var parent = segment ? key.slice(0, segment.index) : key;
2455
-
2456
- // Stash the parent if it exists
2457
-
2458
- var keys = [];
2459
- if (parent) {
2460
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2461
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
2462
- if (!options.allowPrototypes) {
2463
- return;
2464
- }
2465
- }
2466
-
2467
- keys.push(parent);
2468
- }
2469
-
2470
- // Loop through children appending to the array until we hit depth
2471
-
2472
- var i = 0;
2473
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2474
- i += 1;
2475
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2476
- if (!options.allowPrototypes) {
2477
- return;
2478
- }
2479
- }
2480
- keys.push(segment[1]);
2481
- }
2482
-
2483
- // If there's a remainder, just add whatever is left
2484
-
2485
- if (segment) {
2486
- keys.push('[' + key.slice(segment.index) + ']');
2487
- }
2488
-
2489
- return parseObject(keys, val, options, valuesParsed);
2490
- };
2491
-
2492
- var normalizeParseOptions = function normalizeParseOptions(opts) {
2493
- if (!opts) {
2494
- return defaults;
2495
- }
2496
-
2497
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2498
- throw new TypeError('Decoder has to be a function.');
2499
- }
2500
-
2501
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2502
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2503
- }
2504
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2505
-
2506
- return {
2507
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2508
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2509
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2510
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2511
- charset: charset,
2512
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2513
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2514
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2515
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2516
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2517
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2518
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2519
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2520
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2521
- parseArrays: opts.parseArrays !== false,
2522
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2523
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2524
- };
2525
- };
2526
-
2527
- var parse$1 = function (str, opts) {
2528
- var options = normalizeParseOptions(opts);
2529
-
2530
- if (str === '' || str === null || typeof str === 'undefined') {
2531
- return options.plainObjects ? Object.create(null) : {};
2532
- }
2533
-
2534
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2535
- var obj = options.plainObjects ? Object.create(null) : {};
2536
-
2537
- // Iterate over the keys and setup the new object
2538
-
2539
- var keys = Object.keys(tempObj);
2540
- for (var i = 0; i < keys.length; ++i) {
2541
- var key = keys[i];
2542
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2543
- obj = utils.merge(obj, newObj, options);
2544
- }
2545
-
2546
- if (options.allowSparse === true) {
2547
- return obj;
2548
- }
2549
-
2550
- return utils.compact(obj);
2551
- };
2552
-
2553
- var stringify = stringify_1;
2554
- var parse = parse$1;
2555
- var formats = formats$3;
2556
-
2557
- var lib = {
2558
- formats: formats,
2559
- parse: parse,
2560
- stringify: stringify
2561
- };
2562
-
2563
- var qs = /*@__PURE__*/getDefaultExportFromCjs(lib);
2564
-
2565
535
  var _excluded = ["url"];
2566
536
  var fetch = function fetch(_ref) {
2567
537
  var url = _ref.url,
2568
538
  params = _objectWithoutProperties(_ref, _excluded);
2569
539
  return axios__default["default"].get(url, {
2570
- params: params,
2571
- paramsSerializer: function paramsSerializer(params) {
2572
- return qs.stringify(params, {
2573
- arrayFormat: "brackets"
2574
- });
2575
- }
540
+ params: params
2576
541
  });
2577
542
  };
2578
543
  var create = function create(url, payload) {
@@ -3260,6 +1225,12 @@ var List = function List(_ref) {
3260
1225
  })));
3261
1226
  };
3262
1227
 
1228
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1229
+
1230
+ function getDefaultExportFromCjs (x) {
1231
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1232
+ }
1233
+
3263
1234
  function commonjsRequire(path) {
3264
1235
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
3265
1236
  }