@bigbinary/neeto-commons-frontend 2.0.8 → 2.0.9

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