@bigbinary/neeto-commons-frontend 2.1.8 → 2.1.10

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/react-utils.js CHANGED
@@ -5,12 +5,13 @@ import { Typography, Button } from '@bigbinary/neetoui';
5
5
  import { isNil, includes, __, prop, toPairs, mergeLeft, curry, keys, isEmpty, mergeDeepLeft, pick, omit } from 'ramda';
6
6
  import { useTranslation, Trans, withTranslation } from 'react-i18next';
7
7
  import ErrorPage from '@bigbinary/neeto-molecules/ErrorPage';
8
- import { Route, Redirect } from 'react-router-dom';
8
+ import { Route, Redirect, useLocation } from 'react-router-dom';
9
9
  import { isNotPresent } from '@bigbinary/neeto-commons-frontend/pure';
10
10
  import { usePersistedQuery as usePersistedQuery$1 } from '@bigbinary/neeto-commons-frontend/react-utils';
11
11
  import axios from 'axios';
12
12
  import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils';
13
13
  import { useQuery, useQueryClient, useMutation } from 'react-query';
14
+ import require$$0 from 'util';
14
15
  import { Helmet } from 'react-helmet';
15
16
 
16
17
  var IGNORABLE_ERRORS_REGEX = /(window\.requestAnimationFrame|ResizeObserver|ChunkLoadError|window\.webkit\.messageHandlers|Request aborted|Network Error)/;
@@ -258,24 +259,24 @@ var QUERY_KEYS = {
258
259
  var QUERY_CACHE_NAME_SPACE = "queryCache";
259
260
  var NEETO_APPS_LIST_STALE_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days
260
261
 
261
- function ownKeys$2(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; }
262
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
262
+ function ownKeys$3(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; }
263
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
263
264
  var useFetchNeetoApps = function useFetchNeetoApps(options) {
264
265
  var _globalProps$user;
265
266
  var scopedQueryKey = "".concat(QUERY_KEYS.NEETO_APPS_LIST, "-").concat((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.id);
266
267
  var neetoApps = usePersistedQuery$1.getCache(scopedQueryKey);
267
- return usePersistedQuery$1(scopedQueryKey, neetoAppsApi.fetch, _objectSpread$2({
268
+ return usePersistedQuery$1(scopedQueryKey, neetoAppsApi.fetch, _objectSpread$3({
268
269
  staleTime: NEETO_APPS_LIST_STALE_TIME,
269
270
  enabled: isNotPresent(neetoApps === null || neetoApps === void 0 ? void 0 : neetoApps.data)
270
271
  }, options));
271
272
  };
272
273
 
273
- function ownKeys$1(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; }
274
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
274
+ function ownKeys$2(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; }
275
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
275
276
  var localStorageQueryCache = {
276
277
  set: function set(key, data) {
277
278
  var cache = localStorageQueryCache.getAll();
278
- var newCache = _objectSpread$1(_objectSpread$1({}, cache), {}, _defineProperty({}, key, {
279
+ var newCache = _objectSpread$2(_objectSpread$2({}, cache), {}, _defineProperty({}, key, {
279
280
  data: data,
280
281
  modifiedAt: Date.now()
281
282
  }));
@@ -303,11 +304,11 @@ var usePersistedQuery = function usePersistedQuery(queryKey, fetch, options) {
303
304
  localStorageQueryCache.set(queryKey, queryResult.data);
304
305
  }, [queryKey, queryResult.data, queryResult.isSuccess]);
305
306
  if (isOutdated(localCache, options === null || options === void 0 ? void 0 : options.staleTime)) {
306
- return _objectSpread$1(_objectSpread$1({}, queryResult), {}, {
307
+ return _objectSpread$2(_objectSpread$2({}, queryResult), {}, {
307
308
  isFreshLoading: queryResult.isLoading
308
309
  });
309
310
  }
310
- return _objectSpread$1(_objectSpread$1({}, queryResult), {}, {
311
+ return _objectSpread$2(_objectSpread$2({}, queryResult), {}, {
311
312
  data: queryResult.data || localCache.data,
312
313
  isFreshLoading: false
313
314
  });
@@ -3395,6 +3396,9 @@ var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
3395
3396
  var ref = useRef(null);
3396
3397
  var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
3397
3398
  var config = mergeLeft(userConfig, DEFAULT_CONFIG);
3399
+ if (!handler) {
3400
+ throw new Error("You must provide a handler function to useHotKeys");
3401
+ }
3398
3402
  useEffect(function () {
3399
3403
  if (!config.enabled) return undefined;
3400
3404
  var mousetrapInstance = bindHotKey({
@@ -3566,15 +3570,15 @@ var useLocalStorage = function useLocalStorage(key, defaultValue) {
3566
3570
 
3567
3571
  var _excluded = ["keysToInvalidate"],
3568
3572
  _excluded2 = ["onSuccess"];
3569
- 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; }
3570
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3573
+ function ownKeys$1(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; }
3574
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3571
3575
  var useMutationWithInvalidation = function useMutationWithInvalidation(mutationFn, _ref) {
3572
3576
  var keysToInvalidate = _ref.keysToInvalidate,
3573
3577
  options = _objectWithoutProperties(_ref, _excluded);
3574
3578
  var queryClient = useQueryClient();
3575
3579
  var _onSuccess = options.onSuccess,
3576
3580
  otherOptions = _objectWithoutProperties(options, _excluded2);
3577
- return useMutation(mutationFn, _objectSpread({
3581
+ return useMutation(mutationFn, _objectSpread$1({
3578
3582
  onSuccess: function onSuccess(data, variables, context) {
3579
3583
  keysToInvalidate.forEach(function (key) {
3580
3584
  var keyToInvalidate = typeof key === "function" ? key(data, variables, context) : key;
@@ -3611,6 +3615,2048 @@ var usePrevious = function usePrevious(value) {
3611
3615
  return ref.current;
3612
3616
  };
3613
3617
 
3618
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
3619
+ var shams = function hasSymbols() {
3620
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
3621
+ if (typeof Symbol.iterator === 'symbol') { return true; }
3622
+
3623
+ var obj = {};
3624
+ var sym = Symbol('test');
3625
+ var symObj = Object(sym);
3626
+ if (typeof sym === 'string') { return false; }
3627
+
3628
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
3629
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
3630
+
3631
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
3632
+ // if (sym instanceof Symbol) { return false; }
3633
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
3634
+ // if (!(symObj instanceof Symbol)) { return false; }
3635
+
3636
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
3637
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
3638
+
3639
+ var symVal = 42;
3640
+ obj[sym] = symVal;
3641
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
3642
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
3643
+
3644
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
3645
+
3646
+ var syms = Object.getOwnPropertySymbols(obj);
3647
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
3648
+
3649
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
3650
+
3651
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
3652
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
3653
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
3654
+ }
3655
+
3656
+ return true;
3657
+ };
3658
+
3659
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
3660
+ var hasSymbolSham = shams;
3661
+
3662
+ var hasSymbols$1 = function hasNativeSymbols() {
3663
+ if (typeof origSymbol !== 'function') { return false; }
3664
+ if (typeof Symbol !== 'function') { return false; }
3665
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
3666
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
3667
+
3668
+ return hasSymbolSham();
3669
+ };
3670
+
3671
+ /* eslint no-invalid-this: 1 */
3672
+
3673
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
3674
+ var slice = Array.prototype.slice;
3675
+ var toStr$1 = Object.prototype.toString;
3676
+ var funcType = '[object Function]';
3677
+
3678
+ var implementation$1 = function bind(that) {
3679
+ var target = this;
3680
+ if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
3681
+ throw new TypeError(ERROR_MESSAGE + target);
3682
+ }
3683
+ var args = slice.call(arguments, 1);
3684
+
3685
+ var bound;
3686
+ var binder = function () {
3687
+ if (this instanceof bound) {
3688
+ var result = target.apply(
3689
+ this,
3690
+ args.concat(slice.call(arguments))
3691
+ );
3692
+ if (Object(result) === result) {
3693
+ return result;
3694
+ }
3695
+ return this;
3696
+ } else {
3697
+ return target.apply(
3698
+ that,
3699
+ args.concat(slice.call(arguments))
3700
+ );
3701
+ }
3702
+ };
3703
+
3704
+ var boundLength = Math.max(0, target.length - args.length);
3705
+ var boundArgs = [];
3706
+ for (var i = 0; i < boundLength; i++) {
3707
+ boundArgs.push('$' + i);
3708
+ }
3709
+
3710
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
3711
+
3712
+ if (target.prototype) {
3713
+ var Empty = function Empty() {};
3714
+ Empty.prototype = target.prototype;
3715
+ bound.prototype = new Empty();
3716
+ Empty.prototype = null;
3717
+ }
3718
+
3719
+ return bound;
3720
+ };
3721
+
3722
+ var implementation = implementation$1;
3723
+
3724
+ var functionBind = Function.prototype.bind || implementation;
3725
+
3726
+ var bind$1 = functionBind;
3727
+
3728
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
3729
+
3730
+ var undefined$1;
3731
+
3732
+ var $SyntaxError = SyntaxError;
3733
+ var $Function = Function;
3734
+ var $TypeError$1 = TypeError;
3735
+
3736
+ // eslint-disable-next-line consistent-return
3737
+ var getEvalledConstructor = function (expressionSyntax) {
3738
+ try {
3739
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
3740
+ } catch (e) {}
3741
+ };
3742
+
3743
+ var $gOPD = Object.getOwnPropertyDescriptor;
3744
+ if ($gOPD) {
3745
+ try {
3746
+ $gOPD({}, '');
3747
+ } catch (e) {
3748
+ $gOPD = null; // this is IE 8, which has a broken gOPD
3749
+ }
3750
+ }
3751
+
3752
+ var throwTypeError = function () {
3753
+ throw new $TypeError$1();
3754
+ };
3755
+ var ThrowTypeError = $gOPD
3756
+ ? (function () {
3757
+ try {
3758
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
3759
+ arguments.callee; // IE 8 does not throw here
3760
+ return throwTypeError;
3761
+ } catch (calleeThrows) {
3762
+ try {
3763
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
3764
+ return $gOPD(arguments, 'callee').get;
3765
+ } catch (gOPDthrows) {
3766
+ return throwTypeError;
3767
+ }
3768
+ }
3769
+ }())
3770
+ : throwTypeError;
3771
+
3772
+ var hasSymbols = hasSymbols$1();
3773
+
3774
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
3775
+
3776
+ var needsEval = {};
3777
+
3778
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
3779
+
3780
+ var INTRINSICS = {
3781
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
3782
+ '%Array%': Array,
3783
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
3784
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
3785
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
3786
+ '%AsyncFunction%': needsEval,
3787
+ '%AsyncGenerator%': needsEval,
3788
+ '%AsyncGeneratorFunction%': needsEval,
3789
+ '%AsyncIteratorPrototype%': needsEval,
3790
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
3791
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
3792
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
3793
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
3794
+ '%Boolean%': Boolean,
3795
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
3796
+ '%Date%': Date,
3797
+ '%decodeURI%': decodeURI,
3798
+ '%decodeURIComponent%': decodeURIComponent,
3799
+ '%encodeURI%': encodeURI,
3800
+ '%encodeURIComponent%': encodeURIComponent,
3801
+ '%Error%': Error,
3802
+ '%eval%': eval, // eslint-disable-line no-eval
3803
+ '%EvalError%': EvalError,
3804
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
3805
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
3806
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
3807
+ '%Function%': $Function,
3808
+ '%GeneratorFunction%': needsEval,
3809
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
3810
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
3811
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
3812
+ '%isFinite%': isFinite,
3813
+ '%isNaN%': isNaN,
3814
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
3815
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
3816
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
3817
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
3818
+ '%Math%': Math,
3819
+ '%Number%': Number,
3820
+ '%Object%': Object,
3821
+ '%parseFloat%': parseFloat,
3822
+ '%parseInt%': parseInt,
3823
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
3824
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
3825
+ '%RangeError%': RangeError,
3826
+ '%ReferenceError%': ReferenceError,
3827
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
3828
+ '%RegExp%': RegExp,
3829
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
3830
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
3831
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
3832
+ '%String%': String,
3833
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
3834
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
3835
+ '%SyntaxError%': $SyntaxError,
3836
+ '%ThrowTypeError%': ThrowTypeError,
3837
+ '%TypedArray%': TypedArray,
3838
+ '%TypeError%': $TypeError$1,
3839
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
3840
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
3841
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
3842
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
3843
+ '%URIError%': URIError,
3844
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
3845
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
3846
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
3847
+ };
3848
+
3849
+ try {
3850
+ null.error; // eslint-disable-line no-unused-expressions
3851
+ } catch (e) {
3852
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
3853
+ var errorProto = getProto(getProto(e));
3854
+ INTRINSICS['%Error.prototype%'] = errorProto;
3855
+ }
3856
+
3857
+ var doEval = function doEval(name) {
3858
+ var value;
3859
+ if (name === '%AsyncFunction%') {
3860
+ value = getEvalledConstructor('async function () {}');
3861
+ } else if (name === '%GeneratorFunction%') {
3862
+ value = getEvalledConstructor('function* () {}');
3863
+ } else if (name === '%AsyncGeneratorFunction%') {
3864
+ value = getEvalledConstructor('async function* () {}');
3865
+ } else if (name === '%AsyncGenerator%') {
3866
+ var fn = doEval('%AsyncGeneratorFunction%');
3867
+ if (fn) {
3868
+ value = fn.prototype;
3869
+ }
3870
+ } else if (name === '%AsyncIteratorPrototype%') {
3871
+ var gen = doEval('%AsyncGenerator%');
3872
+ if (gen) {
3873
+ value = getProto(gen.prototype);
3874
+ }
3875
+ }
3876
+
3877
+ INTRINSICS[name] = value;
3878
+
3879
+ return value;
3880
+ };
3881
+
3882
+ var LEGACY_ALIASES = {
3883
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
3884
+ '%ArrayPrototype%': ['Array', 'prototype'],
3885
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
3886
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
3887
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
3888
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
3889
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
3890
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
3891
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
3892
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
3893
+ '%DataViewPrototype%': ['DataView', 'prototype'],
3894
+ '%DatePrototype%': ['Date', 'prototype'],
3895
+ '%ErrorPrototype%': ['Error', 'prototype'],
3896
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
3897
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
3898
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
3899
+ '%FunctionPrototype%': ['Function', 'prototype'],
3900
+ '%Generator%': ['GeneratorFunction', 'prototype'],
3901
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
3902
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
3903
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
3904
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
3905
+ '%JSONParse%': ['JSON', 'parse'],
3906
+ '%JSONStringify%': ['JSON', 'stringify'],
3907
+ '%MapPrototype%': ['Map', 'prototype'],
3908
+ '%NumberPrototype%': ['Number', 'prototype'],
3909
+ '%ObjectPrototype%': ['Object', 'prototype'],
3910
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
3911
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
3912
+ '%PromisePrototype%': ['Promise', 'prototype'],
3913
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
3914
+ '%Promise_all%': ['Promise', 'all'],
3915
+ '%Promise_reject%': ['Promise', 'reject'],
3916
+ '%Promise_resolve%': ['Promise', 'resolve'],
3917
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
3918
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
3919
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
3920
+ '%SetPrototype%': ['Set', 'prototype'],
3921
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
3922
+ '%StringPrototype%': ['String', 'prototype'],
3923
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
3924
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
3925
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
3926
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
3927
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
3928
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
3929
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
3930
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
3931
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
3932
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
3933
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
3934
+ };
3935
+
3936
+ var bind = functionBind;
3937
+ var hasOwn$1 = src;
3938
+ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
3939
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
3940
+ var $replace$1 = bind.call(Function.call, String.prototype.replace);
3941
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
3942
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
3943
+
3944
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
3945
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
3946
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
3947
+ var stringToPath = function stringToPath(string) {
3948
+ var first = $strSlice(string, 0, 1);
3949
+ var last = $strSlice(string, -1);
3950
+ if (first === '%' && last !== '%') {
3951
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
3952
+ } else if (last === '%' && first !== '%') {
3953
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
3954
+ }
3955
+ var result = [];
3956
+ $replace$1(string, rePropName, function (match, number, quote, subString) {
3957
+ result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
3958
+ });
3959
+ return result;
3960
+ };
3961
+ /* end adaptation */
3962
+
3963
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
3964
+ var intrinsicName = name;
3965
+ var alias;
3966
+ if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
3967
+ alias = LEGACY_ALIASES[intrinsicName];
3968
+ intrinsicName = '%' + alias[0] + '%';
3969
+ }
3970
+
3971
+ if (hasOwn$1(INTRINSICS, intrinsicName)) {
3972
+ var value = INTRINSICS[intrinsicName];
3973
+ if (value === needsEval) {
3974
+ value = doEval(intrinsicName);
3975
+ }
3976
+ if (typeof value === 'undefined' && !allowMissing) {
3977
+ throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
3978
+ }
3979
+
3980
+ return {
3981
+ alias: alias,
3982
+ name: intrinsicName,
3983
+ value: value
3984
+ };
3985
+ }
3986
+
3987
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
3988
+ };
3989
+
3990
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
3991
+ if (typeof name !== 'string' || name.length === 0) {
3992
+ throw new $TypeError$1('intrinsic name must be a non-empty string');
3993
+ }
3994
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
3995
+ throw new $TypeError$1('"allowMissing" argument must be a boolean');
3996
+ }
3997
+
3998
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
3999
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
4000
+ }
4001
+ var parts = stringToPath(name);
4002
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
4003
+
4004
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
4005
+ var intrinsicRealName = intrinsic.name;
4006
+ var value = intrinsic.value;
4007
+ var skipFurtherCaching = false;
4008
+
4009
+ var alias = intrinsic.alias;
4010
+ if (alias) {
4011
+ intrinsicBaseName = alias[0];
4012
+ $spliceApply(parts, $concat$1([0, 1], alias));
4013
+ }
4014
+
4015
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
4016
+ var part = parts[i];
4017
+ var first = $strSlice(part, 0, 1);
4018
+ var last = $strSlice(part, -1);
4019
+ if (
4020
+ (
4021
+ (first === '"' || first === "'" || first === '`')
4022
+ || (last === '"' || last === "'" || last === '`')
4023
+ )
4024
+ && first !== last
4025
+ ) {
4026
+ throw new $SyntaxError('property names with quotes must have matching quotes');
4027
+ }
4028
+ if (part === 'constructor' || !isOwn) {
4029
+ skipFurtherCaching = true;
4030
+ }
4031
+
4032
+ intrinsicBaseName += '.' + part;
4033
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
4034
+
4035
+ if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
4036
+ value = INTRINSICS[intrinsicRealName];
4037
+ } else if (value != null) {
4038
+ if (!(part in value)) {
4039
+ if (!allowMissing) {
4040
+ throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
4041
+ }
4042
+ return void undefined$1;
4043
+ }
4044
+ if ($gOPD && (i + 1) >= parts.length) {
4045
+ var desc = $gOPD(value, part);
4046
+ isOwn = !!desc;
4047
+
4048
+ // By convention, when a data property is converted to an accessor
4049
+ // property to emulate a data property that does not suffer from
4050
+ // the override mistake, that accessor's getter is marked with
4051
+ // an `originalValue` property. Here, when we detect this, we
4052
+ // uphold the illusion by pretending to see that original data
4053
+ // property, i.e., returning the value rather than the getter
4054
+ // itself.
4055
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
4056
+ value = desc.get;
4057
+ } else {
4058
+ value = value[part];
4059
+ }
4060
+ } else {
4061
+ isOwn = hasOwn$1(value, part);
4062
+ value = value[part];
4063
+ }
4064
+
4065
+ if (isOwn && !skipFurtherCaching) {
4066
+ INTRINSICS[intrinsicRealName] = value;
4067
+ }
4068
+ }
4069
+ }
4070
+ return value;
4071
+ };
4072
+
4073
+ var callBind$1 = {exports: {}};
4074
+
4075
+ (function (module) {
4076
+
4077
+ var bind = functionBind;
4078
+ var GetIntrinsic = getIntrinsic;
4079
+
4080
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
4081
+ var $call = GetIntrinsic('%Function.prototype.call%');
4082
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
4083
+
4084
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
4085
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
4086
+ var $max = GetIntrinsic('%Math.max%');
4087
+
4088
+ if ($defineProperty) {
4089
+ try {
4090
+ $defineProperty({}, 'a', { value: 1 });
4091
+ } catch (e) {
4092
+ // IE 8 has a broken defineProperty
4093
+ $defineProperty = null;
4094
+ }
4095
+ }
4096
+
4097
+ module.exports = function callBind(originalFunction) {
4098
+ var func = $reflectApply(bind, $call, arguments);
4099
+ if ($gOPD && $defineProperty) {
4100
+ var desc = $gOPD(func, 'length');
4101
+ if (desc.configurable) {
4102
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
4103
+ $defineProperty(
4104
+ func,
4105
+ 'length',
4106
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
4107
+ );
4108
+ }
4109
+ }
4110
+ return func;
4111
+ };
4112
+
4113
+ var applyBind = function applyBind() {
4114
+ return $reflectApply(bind, $apply, arguments);
4115
+ };
4116
+
4117
+ if ($defineProperty) {
4118
+ $defineProperty(module.exports, 'apply', { value: applyBind });
4119
+ } else {
4120
+ module.exports.apply = applyBind;
4121
+ }
4122
+ } (callBind$1));
4123
+
4124
+ var GetIntrinsic$1 = getIntrinsic;
4125
+
4126
+ var callBind = callBind$1.exports;
4127
+
4128
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
4129
+
4130
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
4131
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
4132
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
4133
+ return callBind(intrinsic);
4134
+ }
4135
+ return intrinsic;
4136
+ };
4137
+
4138
+ var util_inspect = require$$0.inspect;
4139
+
4140
+ var hasMap = typeof Map === 'function' && Map.prototype;
4141
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
4142
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
4143
+ var mapForEach = hasMap && Map.prototype.forEach;
4144
+ var hasSet = typeof Set === 'function' && Set.prototype;
4145
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
4146
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
4147
+ var setForEach = hasSet && Set.prototype.forEach;
4148
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
4149
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
4150
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
4151
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
4152
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
4153
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4154
+ var booleanValueOf = Boolean.prototype.valueOf;
4155
+ var objectToString = Object.prototype.toString;
4156
+ var functionToString = Function.prototype.toString;
4157
+ var $match = String.prototype.match;
4158
+ var $slice = String.prototype.slice;
4159
+ var $replace = String.prototype.replace;
4160
+ var $toUpperCase = String.prototype.toUpperCase;
4161
+ var $toLowerCase = String.prototype.toLowerCase;
4162
+ var $test = RegExp.prototype.test;
4163
+ var $concat = Array.prototype.concat;
4164
+ var $join = Array.prototype.join;
4165
+ var $arrSlice = Array.prototype.slice;
4166
+ var $floor = Math.floor;
4167
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4168
+ var gOPS = Object.getOwnPropertySymbols;
4169
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4170
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4171
+ // ie, `has-tostringtag/shams
4172
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4173
+ ? Symbol.toStringTag
4174
+ : null;
4175
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
4176
+
4177
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
4178
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
4179
+ ? function (O) {
4180
+ return O.__proto__; // eslint-disable-line no-proto
4181
+ }
4182
+ : null
4183
+ );
4184
+
4185
+ function addNumericSeparator(num, str) {
4186
+ if (
4187
+ num === Infinity
4188
+ || num === -Infinity
4189
+ || num !== num
4190
+ || (num && num > -1000 && num < 1000)
4191
+ || $test.call(/e/, str)
4192
+ ) {
4193
+ return str;
4194
+ }
4195
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4196
+ if (typeof num === 'number') {
4197
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
4198
+ if (int !== num) {
4199
+ var intStr = String(int);
4200
+ var dec = $slice.call(str, intStr.length + 1);
4201
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
4202
+ }
4203
+ }
4204
+ return $replace.call(str, sepRegex, '$&_');
4205
+ }
4206
+
4207
+ var utilInspect = util_inspect;
4208
+ var inspectCustom = utilInspect.custom;
4209
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
4210
+
4211
+ var objectInspect = function inspect_(obj, options, depth, seen) {
4212
+ var opts = options || {};
4213
+
4214
+ if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
4215
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
4216
+ }
4217
+ if (
4218
+ has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
4219
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
4220
+ : opts.maxStringLength !== null
4221
+ )
4222
+ ) {
4223
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
4224
+ }
4225
+ var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
4226
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
4227
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
4228
+ }
4229
+
4230
+ if (
4231
+ has$3(opts, 'indent')
4232
+ && opts.indent !== null
4233
+ && opts.indent !== '\t'
4234
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4235
+ ) {
4236
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4237
+ }
4238
+ if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
4239
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
4240
+ }
4241
+ var numericSeparator = opts.numericSeparator;
4242
+
4243
+ if (typeof obj === 'undefined') {
4244
+ return 'undefined';
4245
+ }
4246
+ if (obj === null) {
4247
+ return 'null';
4248
+ }
4249
+ if (typeof obj === 'boolean') {
4250
+ return obj ? 'true' : 'false';
4251
+ }
4252
+
4253
+ if (typeof obj === 'string') {
4254
+ return inspectString(obj, opts);
4255
+ }
4256
+ if (typeof obj === 'number') {
4257
+ if (obj === 0) {
4258
+ return Infinity / obj > 0 ? '0' : '-0';
4259
+ }
4260
+ var str = String(obj);
4261
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
4262
+ }
4263
+ if (typeof obj === 'bigint') {
4264
+ var bigIntStr = String(obj) + 'n';
4265
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4266
+ }
4267
+
4268
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
4269
+ if (typeof depth === 'undefined') { depth = 0; }
4270
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
4271
+ return isArray$3(obj) ? '[Array]' : '[Object]';
4272
+ }
4273
+
4274
+ var indent = getIndent(opts, depth);
4275
+
4276
+ if (typeof seen === 'undefined') {
4277
+ seen = [];
4278
+ } else if (indexOf(seen, obj) >= 0) {
4279
+ return '[Circular]';
4280
+ }
4281
+
4282
+ function inspect(value, from, noIndent) {
4283
+ if (from) {
4284
+ seen = $arrSlice.call(seen);
4285
+ seen.push(from);
4286
+ }
4287
+ if (noIndent) {
4288
+ var newOpts = {
4289
+ depth: opts.depth
4290
+ };
4291
+ if (has$3(opts, 'quoteStyle')) {
4292
+ newOpts.quoteStyle = opts.quoteStyle;
4293
+ }
4294
+ return inspect_(value, newOpts, depth + 1, seen);
4295
+ }
4296
+ return inspect_(value, opts, depth + 1, seen);
4297
+ }
4298
+
4299
+ if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
4300
+ var name = nameOf(obj);
4301
+ var keys = arrObjKeys(obj, inspect);
4302
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4303
+ }
4304
+ if (isSymbol(obj)) {
4305
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4306
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4307
+ }
4308
+ if (isElement(obj)) {
4309
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
4310
+ var attrs = obj.attributes || [];
4311
+ for (var i = 0; i < attrs.length; i++) {
4312
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4313
+ }
4314
+ s += '>';
4315
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4316
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
4317
+ return s;
4318
+ }
4319
+ if (isArray$3(obj)) {
4320
+ if (obj.length === 0) { return '[]'; }
4321
+ var xs = arrObjKeys(obj, inspect);
4322
+ if (indent && !singleLineValues(xs)) {
4323
+ return '[' + indentedJoin(xs, indent) + ']';
4324
+ }
4325
+ return '[ ' + $join.call(xs, ', ') + ' ]';
4326
+ }
4327
+ if (isError(obj)) {
4328
+ var parts = arrObjKeys(obj, inspect);
4329
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
4330
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4331
+ }
4332
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
4333
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4334
+ }
4335
+ if (typeof obj === 'object' && customInspect) {
4336
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
4337
+ return utilInspect(obj, { depth: maxDepth - depth });
4338
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4339
+ return obj.inspect();
4340
+ }
4341
+ }
4342
+ if (isMap(obj)) {
4343
+ var mapParts = [];
4344
+ if (mapForEach) {
4345
+ mapForEach.call(obj, function (value, key) {
4346
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4347
+ });
4348
+ }
4349
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
4350
+ }
4351
+ if (isSet(obj)) {
4352
+ var setParts = [];
4353
+ if (setForEach) {
4354
+ setForEach.call(obj, function (value) {
4355
+ setParts.push(inspect(value, obj));
4356
+ });
4357
+ }
4358
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
4359
+ }
4360
+ if (isWeakMap(obj)) {
4361
+ return weakCollectionOf('WeakMap');
4362
+ }
4363
+ if (isWeakSet(obj)) {
4364
+ return weakCollectionOf('WeakSet');
4365
+ }
4366
+ if (isWeakRef(obj)) {
4367
+ return weakCollectionOf('WeakRef');
4368
+ }
4369
+ if (isNumber(obj)) {
4370
+ return markBoxed(inspect(Number(obj)));
4371
+ }
4372
+ if (isBigInt(obj)) {
4373
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
4374
+ }
4375
+ if (isBoolean(obj)) {
4376
+ return markBoxed(booleanValueOf.call(obj));
4377
+ }
4378
+ if (isString(obj)) {
4379
+ return markBoxed(inspect(String(obj)));
4380
+ }
4381
+ if (!isDate(obj) && !isRegExp$1(obj)) {
4382
+ var ys = arrObjKeys(obj, inspect);
4383
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
4384
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
4385
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
4386
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
4387
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
4388
+ if (ys.length === 0) { return tag + '{}'; }
4389
+ if (indent) {
4390
+ return tag + '{' + indentedJoin(ys, indent) + '}';
4391
+ }
4392
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
4393
+ }
4394
+ return String(obj);
4395
+ };
4396
+
4397
+ function wrapQuotes(s, defaultStyle, opts) {
4398
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
4399
+ return quoteChar + s + quoteChar;
4400
+ }
4401
+
4402
+ function quote(s) {
4403
+ return $replace.call(String(s), /"/g, '&quot;');
4404
+ }
4405
+
4406
+ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4407
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4408
+ function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4409
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4410
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4411
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4412
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4413
+
4414
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
4415
+ function isSymbol(obj) {
4416
+ if (hasShammedSymbols) {
4417
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
4418
+ }
4419
+ if (typeof obj === 'symbol') {
4420
+ return true;
4421
+ }
4422
+ if (!obj || typeof obj !== 'object' || !symToString) {
4423
+ return false;
4424
+ }
4425
+ try {
4426
+ symToString.call(obj);
4427
+ return true;
4428
+ } catch (e) {}
4429
+ return false;
4430
+ }
4431
+
4432
+ function isBigInt(obj) {
4433
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
4434
+ return false;
4435
+ }
4436
+ try {
4437
+ bigIntValueOf.call(obj);
4438
+ return true;
4439
+ } catch (e) {}
4440
+ return false;
4441
+ }
4442
+
4443
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
4444
+ function has$3(obj, key) {
4445
+ return hasOwn.call(obj, key);
4446
+ }
4447
+
4448
+ function toStr(obj) {
4449
+ return objectToString.call(obj);
4450
+ }
4451
+
4452
+ function nameOf(f) {
4453
+ if (f.name) { return f.name; }
4454
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4455
+ if (m) { return m[1]; }
4456
+ return null;
4457
+ }
4458
+
4459
+ function indexOf(xs, x) {
4460
+ if (xs.indexOf) { return xs.indexOf(x); }
4461
+ for (var i = 0, l = xs.length; i < l; i++) {
4462
+ if (xs[i] === x) { return i; }
4463
+ }
4464
+ return -1;
4465
+ }
4466
+
4467
+ function isMap(x) {
4468
+ if (!mapSize || !x || typeof x !== 'object') {
4469
+ return false;
4470
+ }
4471
+ try {
4472
+ mapSize.call(x);
4473
+ try {
4474
+ setSize.call(x);
4475
+ } catch (s) {
4476
+ return true;
4477
+ }
4478
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
4479
+ } catch (e) {}
4480
+ return false;
4481
+ }
4482
+
4483
+ function isWeakMap(x) {
4484
+ if (!weakMapHas || !x || typeof x !== 'object') {
4485
+ return false;
4486
+ }
4487
+ try {
4488
+ weakMapHas.call(x, weakMapHas);
4489
+ try {
4490
+ weakSetHas.call(x, weakSetHas);
4491
+ } catch (s) {
4492
+ return true;
4493
+ }
4494
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
4495
+ } catch (e) {}
4496
+ return false;
4497
+ }
4498
+
4499
+ function isWeakRef(x) {
4500
+ if (!weakRefDeref || !x || typeof x !== 'object') {
4501
+ return false;
4502
+ }
4503
+ try {
4504
+ weakRefDeref.call(x);
4505
+ return true;
4506
+ } catch (e) {}
4507
+ return false;
4508
+ }
4509
+
4510
+ function isSet(x) {
4511
+ if (!setSize || !x || typeof x !== 'object') {
4512
+ return false;
4513
+ }
4514
+ try {
4515
+ setSize.call(x);
4516
+ try {
4517
+ mapSize.call(x);
4518
+ } catch (m) {
4519
+ return true;
4520
+ }
4521
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
4522
+ } catch (e) {}
4523
+ return false;
4524
+ }
4525
+
4526
+ function isWeakSet(x) {
4527
+ if (!weakSetHas || !x || typeof x !== 'object') {
4528
+ return false;
4529
+ }
4530
+ try {
4531
+ weakSetHas.call(x, weakSetHas);
4532
+ try {
4533
+ weakMapHas.call(x, weakMapHas);
4534
+ } catch (s) {
4535
+ return true;
4536
+ }
4537
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
4538
+ } catch (e) {}
4539
+ return false;
4540
+ }
4541
+
4542
+ function isElement(x) {
4543
+ if (!x || typeof x !== 'object') { return false; }
4544
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
4545
+ return true;
4546
+ }
4547
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
4548
+ }
4549
+
4550
+ function inspectString(str, opts) {
4551
+ if (str.length > opts.maxStringLength) {
4552
+ var remaining = str.length - opts.maxStringLength;
4553
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
4554
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
4555
+ }
4556
+ // eslint-disable-next-line no-control-regex
4557
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
4558
+ return wrapQuotes(s, 'single', opts);
4559
+ }
4560
+
4561
+ function lowbyte(c) {
4562
+ var n = c.charCodeAt(0);
4563
+ var x = {
4564
+ 8: 'b',
4565
+ 9: 't',
4566
+ 10: 'n',
4567
+ 12: 'f',
4568
+ 13: 'r'
4569
+ }[n];
4570
+ if (x) { return '\\' + x; }
4571
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
4572
+ }
4573
+
4574
+ function markBoxed(str) {
4575
+ return 'Object(' + str + ')';
4576
+ }
4577
+
4578
+ function weakCollectionOf(type) {
4579
+ return type + ' { ? }';
4580
+ }
4581
+
4582
+ function collectionOf(type, size, entries, indent) {
4583
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
4584
+ return type + ' (' + size + ') {' + joinedEntries + '}';
4585
+ }
4586
+
4587
+ function singleLineValues(xs) {
4588
+ for (var i = 0; i < xs.length; i++) {
4589
+ if (indexOf(xs[i], '\n') >= 0) {
4590
+ return false;
4591
+ }
4592
+ }
4593
+ return true;
4594
+ }
4595
+
4596
+ function getIndent(opts, depth) {
4597
+ var baseIndent;
4598
+ if (opts.indent === '\t') {
4599
+ baseIndent = '\t';
4600
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
4601
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
4602
+ } else {
4603
+ return null;
4604
+ }
4605
+ return {
4606
+ base: baseIndent,
4607
+ prev: $join.call(Array(depth + 1), baseIndent)
4608
+ };
4609
+ }
4610
+
4611
+ function indentedJoin(xs, indent) {
4612
+ if (xs.length === 0) { return ''; }
4613
+ var lineJoiner = '\n' + indent.prev + indent.base;
4614
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
4615
+ }
4616
+
4617
+ function arrObjKeys(obj, inspect) {
4618
+ var isArr = isArray$3(obj);
4619
+ var xs = [];
4620
+ if (isArr) {
4621
+ xs.length = obj.length;
4622
+ for (var i = 0; i < obj.length; i++) {
4623
+ xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
4624
+ }
4625
+ }
4626
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
4627
+ var symMap;
4628
+ if (hasShammedSymbols) {
4629
+ symMap = {};
4630
+ for (var k = 0; k < syms.length; k++) {
4631
+ symMap['$' + syms[k]] = syms[k];
4632
+ }
4633
+ }
4634
+
4635
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
4636
+ if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4637
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4638
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
4639
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
4640
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
4641
+ } else if ($test.call(/[^\w$]/, key)) {
4642
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
4643
+ } else {
4644
+ xs.push(key + ': ' + inspect(obj[key], obj));
4645
+ }
4646
+ }
4647
+ if (typeof gOPS === 'function') {
4648
+ for (var j = 0; j < syms.length; j++) {
4649
+ if (isEnumerable.call(obj, syms[j])) {
4650
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
4651
+ }
4652
+ }
4653
+ }
4654
+ return xs;
4655
+ }
4656
+
4657
+ var GetIntrinsic = getIntrinsic;
4658
+ var callBound = callBound$1;
4659
+ var inspect = objectInspect;
4660
+
4661
+ var $TypeError = GetIntrinsic('%TypeError%');
4662
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
4663
+ var $Map = GetIntrinsic('%Map%', true);
4664
+
4665
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
4666
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
4667
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
4668
+ var $mapGet = callBound('Map.prototype.get', true);
4669
+ var $mapSet = callBound('Map.prototype.set', true);
4670
+ var $mapHas = callBound('Map.prototype.has', true);
4671
+
4672
+ /*
4673
+ * This function traverses the list returning the node corresponding to the
4674
+ * given key.
4675
+ *
4676
+ * That node is also moved to the head of the list, so that if it's accessed
4677
+ * again we don't need to traverse the whole list. By doing so, all the recently
4678
+ * used nodes can be accessed relatively quickly.
4679
+ */
4680
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
4681
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
4682
+ if (curr.key === key) {
4683
+ prev.next = curr.next;
4684
+ curr.next = list.next;
4685
+ list.next = curr; // eslint-disable-line no-param-reassign
4686
+ return curr;
4687
+ }
4688
+ }
4689
+ };
4690
+
4691
+ var listGet = function (objects, key) {
4692
+ var node = listGetNode(objects, key);
4693
+ return node && node.value;
4694
+ };
4695
+ var listSet = function (objects, key, value) {
4696
+ var node = listGetNode(objects, key);
4697
+ if (node) {
4698
+ node.value = value;
4699
+ } else {
4700
+ // Prepend the new node to the beginning of the list
4701
+ objects.next = { // eslint-disable-line no-param-reassign
4702
+ key: key,
4703
+ next: objects.next,
4704
+ value: value
4705
+ };
4706
+ }
4707
+ };
4708
+ var listHas = function (objects, key) {
4709
+ return !!listGetNode(objects, key);
4710
+ };
4711
+
4712
+ var sideChannel = function getSideChannel() {
4713
+ var $wm;
4714
+ var $m;
4715
+ var $o;
4716
+ var channel = {
4717
+ assert: function (key) {
4718
+ if (!channel.has(key)) {
4719
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
4720
+ }
4721
+ },
4722
+ get: function (key) { // eslint-disable-line consistent-return
4723
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4724
+ if ($wm) {
4725
+ return $weakMapGet($wm, key);
4726
+ }
4727
+ } else if ($Map) {
4728
+ if ($m) {
4729
+ return $mapGet($m, key);
4730
+ }
4731
+ } else {
4732
+ if ($o) { // eslint-disable-line no-lonely-if
4733
+ return listGet($o, key);
4734
+ }
4735
+ }
4736
+ },
4737
+ has: function (key) {
4738
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4739
+ if ($wm) {
4740
+ return $weakMapHas($wm, key);
4741
+ }
4742
+ } else if ($Map) {
4743
+ if ($m) {
4744
+ return $mapHas($m, key);
4745
+ }
4746
+ } else {
4747
+ if ($o) { // eslint-disable-line no-lonely-if
4748
+ return listHas($o, key);
4749
+ }
4750
+ }
4751
+ return false;
4752
+ },
4753
+ set: function (key, value) {
4754
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4755
+ if (!$wm) {
4756
+ $wm = new $WeakMap();
4757
+ }
4758
+ $weakMapSet($wm, key, value);
4759
+ } else if ($Map) {
4760
+ if (!$m) {
4761
+ $m = new $Map();
4762
+ }
4763
+ $mapSet($m, key, value);
4764
+ } else {
4765
+ if (!$o) {
4766
+ /*
4767
+ * Initialize the linked list as an empty node, so that we don't have
4768
+ * to special-case handling of the first node: we can always refer to
4769
+ * it as (previous node).next, instead of something like (list).head
4770
+ */
4771
+ $o = { key: {}, next: null };
4772
+ }
4773
+ listSet($o, key, value);
4774
+ }
4775
+ }
4776
+ };
4777
+ return channel;
4778
+ };
4779
+
4780
+ var replace = String.prototype.replace;
4781
+ var percentTwenties = /%20/g;
4782
+
4783
+ var Format = {
4784
+ RFC1738: 'RFC1738',
4785
+ RFC3986: 'RFC3986'
4786
+ };
4787
+
4788
+ var formats$3 = {
4789
+ 'default': Format.RFC3986,
4790
+ formatters: {
4791
+ RFC1738: function (value) {
4792
+ return replace.call(value, percentTwenties, '+');
4793
+ },
4794
+ RFC3986: function (value) {
4795
+ return String(value);
4796
+ }
4797
+ },
4798
+ RFC1738: Format.RFC1738,
4799
+ RFC3986: Format.RFC3986
4800
+ };
4801
+
4802
+ var formats$2 = formats$3;
4803
+
4804
+ var has$2 = Object.prototype.hasOwnProperty;
4805
+ var isArray$2 = Array.isArray;
4806
+
4807
+ var hexTable = (function () {
4808
+ var array = [];
4809
+ for (var i = 0; i < 256; ++i) {
4810
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
4811
+ }
4812
+
4813
+ return array;
4814
+ }());
4815
+
4816
+ var compactQueue = function compactQueue(queue) {
4817
+ while (queue.length > 1) {
4818
+ var item = queue.pop();
4819
+ var obj = item.obj[item.prop];
4820
+
4821
+ if (isArray$2(obj)) {
4822
+ var compacted = [];
4823
+
4824
+ for (var j = 0; j < obj.length; ++j) {
4825
+ if (typeof obj[j] !== 'undefined') {
4826
+ compacted.push(obj[j]);
4827
+ }
4828
+ }
4829
+
4830
+ item.obj[item.prop] = compacted;
4831
+ }
4832
+ }
4833
+ };
4834
+
4835
+ var arrayToObject = function arrayToObject(source, options) {
4836
+ var obj = options && options.plainObjects ? Object.create(null) : {};
4837
+ for (var i = 0; i < source.length; ++i) {
4838
+ if (typeof source[i] !== 'undefined') {
4839
+ obj[i] = source[i];
4840
+ }
4841
+ }
4842
+
4843
+ return obj;
4844
+ };
4845
+
4846
+ var merge = function merge(target, source, options) {
4847
+ /* eslint no-param-reassign: 0 */
4848
+ if (!source) {
4849
+ return target;
4850
+ }
4851
+
4852
+ if (typeof source !== 'object') {
4853
+ if (isArray$2(target)) {
4854
+ target.push(source);
4855
+ } else if (target && typeof target === 'object') {
4856
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
4857
+ target[source] = true;
4858
+ }
4859
+ } else {
4860
+ return [target, source];
4861
+ }
4862
+
4863
+ return target;
4864
+ }
4865
+
4866
+ if (!target || typeof target !== 'object') {
4867
+ return [target].concat(source);
4868
+ }
4869
+
4870
+ var mergeTarget = target;
4871
+ if (isArray$2(target) && !isArray$2(source)) {
4872
+ mergeTarget = arrayToObject(target, options);
4873
+ }
4874
+
4875
+ if (isArray$2(target) && isArray$2(source)) {
4876
+ source.forEach(function (item, i) {
4877
+ if (has$2.call(target, i)) {
4878
+ var targetItem = target[i];
4879
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
4880
+ target[i] = merge(targetItem, item, options);
4881
+ } else {
4882
+ target.push(item);
4883
+ }
4884
+ } else {
4885
+ target[i] = item;
4886
+ }
4887
+ });
4888
+ return target;
4889
+ }
4890
+
4891
+ return Object.keys(source).reduce(function (acc, key) {
4892
+ var value = source[key];
4893
+
4894
+ if (has$2.call(acc, key)) {
4895
+ acc[key] = merge(acc[key], value, options);
4896
+ } else {
4897
+ acc[key] = value;
4898
+ }
4899
+ return acc;
4900
+ }, mergeTarget);
4901
+ };
4902
+
4903
+ var assign = function assignSingleSource(target, source) {
4904
+ return Object.keys(source).reduce(function (acc, key) {
4905
+ acc[key] = source[key];
4906
+ return acc;
4907
+ }, target);
4908
+ };
4909
+
4910
+ var decode = function (str, decoder, charset) {
4911
+ var strWithoutPlus = str.replace(/\+/g, ' ');
4912
+ if (charset === 'iso-8859-1') {
4913
+ // unescape never throws, no try...catch needed:
4914
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
4915
+ }
4916
+ // utf-8
4917
+ try {
4918
+ return decodeURIComponent(strWithoutPlus);
4919
+ } catch (e) {
4920
+ return strWithoutPlus;
4921
+ }
4922
+ };
4923
+
4924
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
4925
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
4926
+ // It has been adapted here for stricter adherence to RFC 3986
4927
+ if (str.length === 0) {
4928
+ return str;
4929
+ }
4930
+
4931
+ var string = str;
4932
+ if (typeof str === 'symbol') {
4933
+ string = Symbol.prototype.toString.call(str);
4934
+ } else if (typeof str !== 'string') {
4935
+ string = String(str);
4936
+ }
4937
+
4938
+ if (charset === 'iso-8859-1') {
4939
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
4940
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
4941
+ });
4942
+ }
4943
+
4944
+ var out = '';
4945
+ for (var i = 0; i < string.length; ++i) {
4946
+ var c = string.charCodeAt(i);
4947
+
4948
+ if (
4949
+ c === 0x2D // -
4950
+ || c === 0x2E // .
4951
+ || c === 0x5F // _
4952
+ || c === 0x7E // ~
4953
+ || (c >= 0x30 && c <= 0x39) // 0-9
4954
+ || (c >= 0x41 && c <= 0x5A) // a-z
4955
+ || (c >= 0x61 && c <= 0x7A) // A-Z
4956
+ || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
4957
+ ) {
4958
+ out += string.charAt(i);
4959
+ continue;
4960
+ }
4961
+
4962
+ if (c < 0x80) {
4963
+ out = out + hexTable[c];
4964
+ continue;
4965
+ }
4966
+
4967
+ if (c < 0x800) {
4968
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
4969
+ continue;
4970
+ }
4971
+
4972
+ if (c < 0xD800 || c >= 0xE000) {
4973
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
4974
+ continue;
4975
+ }
4976
+
4977
+ i += 1;
4978
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
4979
+ /* eslint operator-linebreak: [2, "before"] */
4980
+ out += hexTable[0xF0 | (c >> 18)]
4981
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
4982
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
4983
+ + hexTable[0x80 | (c & 0x3F)];
4984
+ }
4985
+
4986
+ return out;
4987
+ };
4988
+
4989
+ var compact = function compact(value) {
4990
+ var queue = [{ obj: { o: value }, prop: 'o' }];
4991
+ var refs = [];
4992
+
4993
+ for (var i = 0; i < queue.length; ++i) {
4994
+ var item = queue[i];
4995
+ var obj = item.obj[item.prop];
4996
+
4997
+ var keys = Object.keys(obj);
4998
+ for (var j = 0; j < keys.length; ++j) {
4999
+ var key = keys[j];
5000
+ var val = obj[key];
5001
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
5002
+ queue.push({ obj: obj, prop: key });
5003
+ refs.push(val);
5004
+ }
5005
+ }
5006
+ }
5007
+
5008
+ compactQueue(queue);
5009
+
5010
+ return value;
5011
+ };
5012
+
5013
+ var isRegExp = function isRegExp(obj) {
5014
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
5015
+ };
5016
+
5017
+ var isBuffer = function isBuffer(obj) {
5018
+ if (!obj || typeof obj !== 'object') {
5019
+ return false;
5020
+ }
5021
+
5022
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
5023
+ };
5024
+
5025
+ var combine = function combine(a, b) {
5026
+ return [].concat(a, b);
5027
+ };
5028
+
5029
+ var maybeMap = function maybeMap(val, fn) {
5030
+ if (isArray$2(val)) {
5031
+ var mapped = [];
5032
+ for (var i = 0; i < val.length; i += 1) {
5033
+ mapped.push(fn(val[i]));
5034
+ }
5035
+ return mapped;
5036
+ }
5037
+ return fn(val);
5038
+ };
5039
+
5040
+ var utils$2 = {
5041
+ arrayToObject: arrayToObject,
5042
+ assign: assign,
5043
+ combine: combine,
5044
+ compact: compact,
5045
+ decode: decode,
5046
+ encode: encode,
5047
+ isBuffer: isBuffer,
5048
+ isRegExp: isRegExp,
5049
+ maybeMap: maybeMap,
5050
+ merge: merge
5051
+ };
5052
+
5053
+ var getSideChannel = sideChannel;
5054
+ var utils$1 = utils$2;
5055
+ var formats$1 = formats$3;
5056
+ var has$1 = Object.prototype.hasOwnProperty;
5057
+
5058
+ var arrayPrefixGenerators = {
5059
+ brackets: function brackets(prefix) {
5060
+ return prefix + '[]';
5061
+ },
5062
+ comma: 'comma',
5063
+ indices: function indices(prefix, key) {
5064
+ return prefix + '[' + key + ']';
5065
+ },
5066
+ repeat: function repeat(prefix) {
5067
+ return prefix;
5068
+ }
5069
+ };
5070
+
5071
+ var isArray$1 = Array.isArray;
5072
+ var split = String.prototype.split;
5073
+ var push = Array.prototype.push;
5074
+ var pushToArray = function (arr, valueOrArray) {
5075
+ push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
5076
+ };
5077
+
5078
+ var toISO = Date.prototype.toISOString;
5079
+
5080
+ var defaultFormat = formats$1['default'];
5081
+ var defaults$1 = {
5082
+ addQueryPrefix: false,
5083
+ allowDots: false,
5084
+ charset: 'utf-8',
5085
+ charsetSentinel: false,
5086
+ delimiter: '&',
5087
+ encode: true,
5088
+ encoder: utils$1.encode,
5089
+ encodeValuesOnly: false,
5090
+ format: defaultFormat,
5091
+ formatter: formats$1.formatters[defaultFormat],
5092
+ // deprecated
5093
+ indices: false,
5094
+ serializeDate: function serializeDate(date) {
5095
+ return toISO.call(date);
5096
+ },
5097
+ skipNulls: false,
5098
+ strictNullHandling: false
5099
+ };
5100
+
5101
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5102
+ return typeof v === 'string'
5103
+ || typeof v === 'number'
5104
+ || typeof v === 'boolean'
5105
+ || typeof v === 'symbol'
5106
+ || typeof v === 'bigint';
5107
+ };
5108
+
5109
+ var sentinel = {};
5110
+
5111
+ var stringify$1 = function stringify(
5112
+ object,
5113
+ prefix,
5114
+ generateArrayPrefix,
5115
+ commaRoundTrip,
5116
+ strictNullHandling,
5117
+ skipNulls,
5118
+ encoder,
5119
+ filter,
5120
+ sort,
5121
+ allowDots,
5122
+ serializeDate,
5123
+ format,
5124
+ formatter,
5125
+ encodeValuesOnly,
5126
+ charset,
5127
+ sideChannel
5128
+ ) {
5129
+ var obj = object;
5130
+
5131
+ var tmpSc = sideChannel;
5132
+ var step = 0;
5133
+ var findFlag = false;
5134
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
5135
+ // Where object last appeared in the ref tree
5136
+ var pos = tmpSc.get(object);
5137
+ step += 1;
5138
+ if (typeof pos !== 'undefined') {
5139
+ if (pos === step) {
5140
+ throw new RangeError('Cyclic object value');
5141
+ } else {
5142
+ findFlag = true; // Break while
5143
+ }
5144
+ }
5145
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
5146
+ step = 0;
5147
+ }
5148
+ }
5149
+
5150
+ if (typeof filter === 'function') {
5151
+ obj = filter(prefix, obj);
5152
+ } else if (obj instanceof Date) {
5153
+ obj = serializeDate(obj);
5154
+ } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5155
+ obj = utils$1.maybeMap(obj, function (value) {
5156
+ if (value instanceof Date) {
5157
+ return serializeDate(value);
5158
+ }
5159
+ return value;
5160
+ });
5161
+ }
5162
+
5163
+ if (obj === null) {
5164
+ if (strictNullHandling) {
5165
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
5166
+ }
5167
+
5168
+ obj = '';
5169
+ }
5170
+
5171
+ if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
5172
+ if (encoder) {
5173
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
5174
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5175
+ var valuesArray = split.call(String(obj), ',');
5176
+ var valuesJoined = '';
5177
+ for (var i = 0; i < valuesArray.length; ++i) {
5178
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
5179
+ }
5180
+ return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
5181
+ }
5182
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
5183
+ }
5184
+ return [formatter(prefix) + '=' + formatter(String(obj))];
5185
+ }
5186
+
5187
+ var values = [];
5188
+
5189
+ if (typeof obj === 'undefined') {
5190
+ return values;
5191
+ }
5192
+
5193
+ var objKeys;
5194
+ if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5195
+ // we need to join elements in
5196
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5197
+ } else if (isArray$1(filter)) {
5198
+ objKeys = filter;
5199
+ } else {
5200
+ var keys = Object.keys(obj);
5201
+ objKeys = sort ? keys.sort(sort) : keys;
5202
+ }
5203
+
5204
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
5205
+
5206
+ for (var j = 0; j < objKeys.length; ++j) {
5207
+ var key = objKeys[j];
5208
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
5209
+
5210
+ if (skipNulls && value === null) {
5211
+ continue;
5212
+ }
5213
+
5214
+ var keyPrefix = isArray$1(obj)
5215
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
5216
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
5217
+
5218
+ sideChannel.set(object, step);
5219
+ var valueSideChannel = getSideChannel();
5220
+ valueSideChannel.set(sentinel, sideChannel);
5221
+ pushToArray(values, stringify(
5222
+ value,
5223
+ keyPrefix,
5224
+ generateArrayPrefix,
5225
+ commaRoundTrip,
5226
+ strictNullHandling,
5227
+ skipNulls,
5228
+ encoder,
5229
+ filter,
5230
+ sort,
5231
+ allowDots,
5232
+ serializeDate,
5233
+ format,
5234
+ formatter,
5235
+ encodeValuesOnly,
5236
+ charset,
5237
+ valueSideChannel
5238
+ ));
5239
+ }
5240
+
5241
+ return values;
5242
+ };
5243
+
5244
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5245
+ if (!opts) {
5246
+ return defaults$1;
5247
+ }
5248
+
5249
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
5250
+ throw new TypeError('Encoder has to be a function.');
5251
+ }
5252
+
5253
+ var charset = opts.charset || defaults$1.charset;
5254
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5255
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5256
+ }
5257
+
5258
+ var format = formats$1['default'];
5259
+ if (typeof opts.format !== 'undefined') {
5260
+ if (!has$1.call(formats$1.formatters, opts.format)) {
5261
+ throw new TypeError('Unknown format option provided.');
5262
+ }
5263
+ format = opts.format;
5264
+ }
5265
+ var formatter = formats$1.formatters[format];
5266
+
5267
+ var filter = defaults$1.filter;
5268
+ if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
5269
+ filter = opts.filter;
5270
+ }
5271
+
5272
+ return {
5273
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
5274
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
5275
+ charset: charset,
5276
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
5277
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
5278
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
5279
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
5280
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
5281
+ filter: filter,
5282
+ format: format,
5283
+ formatter: formatter,
5284
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
5285
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
5286
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
5287
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
5288
+ };
5289
+ };
5290
+
5291
+ var stringify_1 = function (object, opts) {
5292
+ var obj = object;
5293
+ var options = normalizeStringifyOptions(opts);
5294
+
5295
+ var objKeys;
5296
+ var filter;
5297
+
5298
+ if (typeof options.filter === 'function') {
5299
+ filter = options.filter;
5300
+ obj = filter('', obj);
5301
+ } else if (isArray$1(options.filter)) {
5302
+ filter = options.filter;
5303
+ objKeys = filter;
5304
+ }
5305
+
5306
+ var keys = [];
5307
+
5308
+ if (typeof obj !== 'object' || obj === null) {
5309
+ return '';
5310
+ }
5311
+
5312
+ var arrayFormat;
5313
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
5314
+ arrayFormat = opts.arrayFormat;
5315
+ } else if (opts && 'indices' in opts) {
5316
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
5317
+ } else {
5318
+ arrayFormat = 'indices';
5319
+ }
5320
+
5321
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5322
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
5323
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
5324
+ }
5325
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
5326
+
5327
+ if (!objKeys) {
5328
+ objKeys = Object.keys(obj);
5329
+ }
5330
+
5331
+ if (options.sort) {
5332
+ objKeys.sort(options.sort);
5333
+ }
5334
+
5335
+ var sideChannel = getSideChannel();
5336
+ for (var i = 0; i < objKeys.length; ++i) {
5337
+ var key = objKeys[i];
5338
+
5339
+ if (options.skipNulls && obj[key] === null) {
5340
+ continue;
5341
+ }
5342
+ pushToArray(keys, stringify$1(
5343
+ obj[key],
5344
+ key,
5345
+ generateArrayPrefix,
5346
+ commaRoundTrip,
5347
+ options.strictNullHandling,
5348
+ options.skipNulls,
5349
+ options.encode ? options.encoder : null,
5350
+ options.filter,
5351
+ options.sort,
5352
+ options.allowDots,
5353
+ options.serializeDate,
5354
+ options.format,
5355
+ options.formatter,
5356
+ options.encodeValuesOnly,
5357
+ options.charset,
5358
+ sideChannel
5359
+ ));
5360
+ }
5361
+
5362
+ var joined = keys.join(options.delimiter);
5363
+ var prefix = options.addQueryPrefix === true ? '?' : '';
5364
+
5365
+ if (options.charsetSentinel) {
5366
+ if (options.charset === 'iso-8859-1') {
5367
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
5368
+ prefix += 'utf8=%26%2310003%3B&';
5369
+ } else {
5370
+ // encodeURIComponent('✓')
5371
+ prefix += 'utf8=%E2%9C%93&';
5372
+ }
5373
+ }
5374
+
5375
+ return joined.length > 0 ? prefix + joined : '';
5376
+ };
5377
+
5378
+ var utils = utils$2;
5379
+
5380
+ var has = Object.prototype.hasOwnProperty;
5381
+ var isArray = Array.isArray;
5382
+
5383
+ var defaults = {
5384
+ allowDots: false,
5385
+ allowPrototypes: false,
5386
+ allowSparse: false,
5387
+ arrayLimit: 20,
5388
+ charset: 'utf-8',
5389
+ charsetSentinel: false,
5390
+ comma: false,
5391
+ decoder: utils.decode,
5392
+ delimiter: '&',
5393
+ depth: 5,
5394
+ ignoreQueryPrefix: false,
5395
+ interpretNumericEntities: false,
5396
+ parameterLimit: 1000,
5397
+ parseArrays: true,
5398
+ plainObjects: false,
5399
+ strictNullHandling: false
5400
+ };
5401
+
5402
+ var interpretNumericEntities = function (str) {
5403
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
5404
+ return String.fromCharCode(parseInt(numberStr, 10));
5405
+ });
5406
+ };
5407
+
5408
+ var parseArrayValue = function (val, options) {
5409
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
5410
+ return val.split(',');
5411
+ }
5412
+
5413
+ return val;
5414
+ };
5415
+
5416
+ // This is what browsers will submit when the ✓ character occurs in an
5417
+ // application/x-www-form-urlencoded body and the encoding of the page containing
5418
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
5419
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
5420
+ // the ✓ character, such as us-ascii.
5421
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5422
+
5423
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
5424
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5425
+
5426
+ var parseValues = function parseQueryStringValues(str, options) {
5427
+ var obj = {};
5428
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5429
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5430
+ var parts = cleanStr.split(options.delimiter, limit);
5431
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
5432
+ var i;
5433
+
5434
+ var charset = options.charset;
5435
+ if (options.charsetSentinel) {
5436
+ for (i = 0; i < parts.length; ++i) {
5437
+ if (parts[i].indexOf('utf8=') === 0) {
5438
+ if (parts[i] === charsetSentinel) {
5439
+ charset = 'utf-8';
5440
+ } else if (parts[i] === isoSentinel) {
5441
+ charset = 'iso-8859-1';
5442
+ }
5443
+ skipIndex = i;
5444
+ i = parts.length; // The eslint settings do not allow break;
5445
+ }
5446
+ }
5447
+ }
5448
+
5449
+ for (i = 0; i < parts.length; ++i) {
5450
+ if (i === skipIndex) {
5451
+ continue;
5452
+ }
5453
+ var part = parts[i];
5454
+
5455
+ var bracketEqualsPos = part.indexOf(']=');
5456
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
5457
+
5458
+ var key, val;
5459
+ if (pos === -1) {
5460
+ key = options.decoder(part, defaults.decoder, charset, 'key');
5461
+ val = options.strictNullHandling ? null : '';
5462
+ } else {
5463
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
5464
+ val = utils.maybeMap(
5465
+ parseArrayValue(part.slice(pos + 1), options),
5466
+ function (encodedVal) {
5467
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
5468
+ }
5469
+ );
5470
+ }
5471
+
5472
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
5473
+ val = interpretNumericEntities(val);
5474
+ }
5475
+
5476
+ if (part.indexOf('[]=') > -1) {
5477
+ val = isArray(val) ? [val] : val;
5478
+ }
5479
+
5480
+ if (has.call(obj, key)) {
5481
+ obj[key] = utils.combine(obj[key], val);
5482
+ } else {
5483
+ obj[key] = val;
5484
+ }
5485
+ }
5486
+
5487
+ return obj;
5488
+ };
5489
+
5490
+ var parseObject = function (chain, val, options, valuesParsed) {
5491
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
5492
+
5493
+ for (var i = chain.length - 1; i >= 0; --i) {
5494
+ var obj;
5495
+ var root = chain[i];
5496
+
5497
+ if (root === '[]' && options.parseArrays) {
5498
+ obj = [].concat(leaf);
5499
+ } else {
5500
+ obj = options.plainObjects ? Object.create(null) : {};
5501
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
5502
+ var index = parseInt(cleanRoot, 10);
5503
+ if (!options.parseArrays && cleanRoot === '') {
5504
+ obj = { 0: leaf };
5505
+ } else if (
5506
+ !isNaN(index)
5507
+ && root !== cleanRoot
5508
+ && String(index) === cleanRoot
5509
+ && index >= 0
5510
+ && (options.parseArrays && index <= options.arrayLimit)
5511
+ ) {
5512
+ obj = [];
5513
+ obj[index] = leaf;
5514
+ } else if (cleanRoot !== '__proto__') {
5515
+ obj[cleanRoot] = leaf;
5516
+ }
5517
+ }
5518
+
5519
+ leaf = obj;
5520
+ }
5521
+
5522
+ return leaf;
5523
+ };
5524
+
5525
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
5526
+ if (!givenKey) {
5527
+ return;
5528
+ }
5529
+
5530
+ // Transform dot notation to bracket notation
5531
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
5532
+
5533
+ // The regex chunks
5534
+
5535
+ var brackets = /(\[[^[\]]*])/;
5536
+ var child = /(\[[^[\]]*])/g;
5537
+
5538
+ // Get the parent
5539
+
5540
+ var segment = options.depth > 0 && brackets.exec(key);
5541
+ var parent = segment ? key.slice(0, segment.index) : key;
5542
+
5543
+ // Stash the parent if it exists
5544
+
5545
+ var keys = [];
5546
+ if (parent) {
5547
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
5548
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
5549
+ if (!options.allowPrototypes) {
5550
+ return;
5551
+ }
5552
+ }
5553
+
5554
+ keys.push(parent);
5555
+ }
5556
+
5557
+ // Loop through children appending to the array until we hit depth
5558
+
5559
+ var i = 0;
5560
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
5561
+ i += 1;
5562
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
5563
+ if (!options.allowPrototypes) {
5564
+ return;
5565
+ }
5566
+ }
5567
+ keys.push(segment[1]);
5568
+ }
5569
+
5570
+ // If there's a remainder, just add whatever is left
5571
+
5572
+ if (segment) {
5573
+ keys.push('[' + key.slice(segment.index) + ']');
5574
+ }
5575
+
5576
+ return parseObject(keys, val, options, valuesParsed);
5577
+ };
5578
+
5579
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
5580
+ if (!opts) {
5581
+ return defaults;
5582
+ }
5583
+
5584
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
5585
+ throw new TypeError('Decoder has to be a function.');
5586
+ }
5587
+
5588
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5589
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5590
+ }
5591
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
5592
+
5593
+ return {
5594
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
5595
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
5596
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
5597
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
5598
+ charset: charset,
5599
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
5600
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
5601
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
5602
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
5603
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
5604
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
5605
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
5606
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
5607
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
5608
+ parseArrays: opts.parseArrays !== false,
5609
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
5610
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
5611
+ };
5612
+ };
5613
+
5614
+ var parse$2 = function (str, opts) {
5615
+ var options = normalizeParseOptions(opts);
5616
+
5617
+ if (str === '' || str === null || typeof str === 'undefined') {
5618
+ return options.plainObjects ? Object.create(null) : {};
5619
+ }
5620
+
5621
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
5622
+ var obj = options.plainObjects ? Object.create(null) : {};
5623
+
5624
+ // Iterate over the keys and setup the new object
5625
+
5626
+ var keys = Object.keys(tempObj);
5627
+ for (var i = 0; i < keys.length; ++i) {
5628
+ var key = keys[i];
5629
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
5630
+ obj = utils.merge(obj, newObj, options);
5631
+ }
5632
+
5633
+ if (options.allowSparse === true) {
5634
+ return obj;
5635
+ }
5636
+
5637
+ return utils.compact(obj);
5638
+ };
5639
+
5640
+ var stringify = stringify_1;
5641
+ var parse$1 = parse$2;
5642
+ var formats = formats$3;
5643
+
5644
+ var lib = {
5645
+ formats: formats,
5646
+ parse: parse$1,
5647
+ stringify: stringify
5648
+ };
5649
+
5650
+ 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; }
5651
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5652
+ var useQueryParams = function useQueryParams() {
5653
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5654
+ var location = useLocation();
5655
+ return lib.parse(location.search, _objectSpread({
5656
+ ignoreQueryPrefix: true
5657
+ }, options));
5658
+ };
5659
+
3614
5660
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3615
5661
  try {
3616
5662
  var info = gen[key](arg);
@@ -4834,5 +6880,5 @@ var useUpdateEffect = function useUpdateEffect(callback) {
4834
6880
  }, dependencies);
4835
6881
  };
4836
6882
 
4837
- export { HoneybadgerErrorBoundary, PrivateRoute, destroyBrowserSubscription, handleMetaClick, isMetaKeyPressed, registerBrowserNotifications, useDebounce, useDisplayErrorPage, useErrorDisplayStore, useFetchNeetoApps, useFuncDebounce, useHotKeys, useIsElementVisibleInDom, useKeyboardShortcutsPaneState, useLocalStorage, useMutationWithInvalidation, useNavigationCheckpoints, useOnClickOutside, usePersistedQuery, usePrevious, useRegisterNavigationCheckpoint, useStateWithDependency, useTimer, useUpdateEffect, withImmutableActions, withT, withTitle };
6883
+ export { HoneybadgerErrorBoundary, PrivateRoute, destroyBrowserSubscription, handleMetaClick, isMetaKeyPressed, registerBrowserNotifications, useDebounce, useDisplayErrorPage, useErrorDisplayStore, useFetchNeetoApps, useFuncDebounce, useHotKeys, useIsElementVisibleInDom, useKeyboardShortcutsPaneState, useLocalStorage, useMutationWithInvalidation, useNavigationCheckpoints, useOnClickOutside, usePersistedQuery, usePrevious, useQueryParams, useRegisterNavigationCheckpoint, useStateWithDependency, useTimer, useUpdateEffect, withImmutableActions, withT, withTitle };
4838
6884
  //# sourceMappingURL=react-utils.js.map