@bigbinary/neeto-team-members-frontend 2.4.17 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,25 +1,27 @@
1
1
  import React, { createElement, isValidElement, cloneElement, createContext, useContext, useState, useRef, useEffect, useMemo, useCallback, useLayoutEffect } from 'react';
2
- import { complement, isEmpty, modifyPath, prepend, assocPath, findIndex, propEq, dissocPath, groupBy, is, prop, keys, map, identical, modify, includes, pluck, fromPairs, toPairs, filter, isNil, curry, __, trim, toLower, identity, without, append, clamp, mergeLeft, head, reverse, assoc } from 'ramda';
3
- import { ExternalLink, MenuHorizontal, Up, Down, Search, Right as Right$1, Info } from '@bigbinary/neeto-icons';
4
2
  import { QueryClient, QueryCache, QueryClientProvider, useQuery, useMutation } from 'react-query';
5
3
  import { ReactQueryDevtools } from 'react-query/devtools';
6
4
  import axios from 'axios';
5
+ import { curryN, isNil, complement, isEmpty, curry, modifyPath, prepend, assocPath, findIndex, propEq, dissocPath, groupBy, is, prop, keys, map, identical, modify, includes, pluck, fromPairs, toPairs, filter, __, trim, toLower, identity, without, append, clamp, mergeLeft, assoc, head, reverse } from 'ramda';
7
6
  import { Toastr, Tooltip, Button, Typography, Checkbox, Pane, Dropdown, Alert, Input as Input$1, PageLoader, Label, Avatar, Tag, Modal, Table as Table$1 } from '@bigbinary/neetoui';
7
+ import { ExternalLink, MenuHorizontal, Up, Down, Search, Right as Right$1, Info } from '@bigbinary/neeto-icons';
8
8
  import { Header as Header$2, Container, MenuBar, SubHeader as SubHeader$1 } from '@bigbinary/neetoui/layouts';
9
9
  import { useFormikContext } from 'formik';
10
10
  import { Form, Input, Textarea, MultiEmailInput, Radio } from '@bigbinary/neetoui/formik';
11
11
  import * as yup from 'yup';
12
12
  import { object, string } from 'yup';
13
13
  import classnames from 'classnames';
14
+ import require$$0 from 'util';
15
+ import { Filters, buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
14
16
 
15
- function _typeof(obj) {
17
+ function _typeof$1(obj) {
16
18
  "@babel/helpers - typeof";
17
19
 
18
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
20
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
19
21
  return typeof obj;
20
22
  } : function (obj) {
21
23
  return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
22
- }, _typeof(obj);
24
+ }, _typeof$1(obj);
23
25
  }
24
26
 
25
27
  function _classCallCheck(instance, Constructor) {
@@ -29,11 +31,11 @@ function _classCallCheck(instance, Constructor) {
29
31
  }
30
32
 
31
33
  function _toPrimitive(input, hint) {
32
- if (_typeof(input) !== "object" || input === null) return input;
34
+ if (_typeof$1(input) !== "object" || input === null) return input;
33
35
  var prim = input[Symbol.toPrimitive];
34
36
  if (prim !== undefined) {
35
37
  var res = prim.call(input, hint || "default");
36
- if (_typeof(res) !== "object") return res;
38
+ if (_typeof$1(res) !== "object") return res;
37
39
  throw new TypeError("@@toPrimitive must return a primitive value.");
38
40
  }
39
41
  return (hint === "string" ? String : Number)(input);
@@ -41,7 +43,7 @@ function _toPrimitive(input, hint) {
41
43
 
42
44
  function _toPropertyKey(arg) {
43
45
  var key = _toPrimitive(arg, "string");
44
- return _typeof(key) === "symbol" ? key : String(key);
46
+ return _typeof$1(key) === "symbol" ? key : String(key);
45
47
  }
46
48
 
47
49
  function _defineProperties(target, props) {
@@ -95,7 +97,7 @@ function _inherits(subClass, superClass) {
95
97
  }
96
98
 
97
99
  function _possibleConstructorReturn(self, call) {
98
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
100
+ if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
99
101
  return call;
100
102
  } else if (call !== void 0) {
101
103
  throw new TypeError("Derived constructors may only return object or undefined");
@@ -125,7 +127,7 @@ function _defineProperty(obj, key, value) {
125
127
  return obj;
126
128
  }
127
129
 
128
- function _arrayWithHoles(arr) {
130
+ function _arrayWithHoles$1(arr) {
129
131
  if (Array.isArray(arr)) return arr;
130
132
  }
131
133
 
@@ -133,29 +135,27 @@ function _iterableToArray(iter) {
133
135
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
134
136
  }
135
137
 
136
- function _arrayLikeToArray(arr, len) {
138
+ function _arrayLikeToArray$1(arr, len) {
137
139
  if (len == null || len > arr.length) len = arr.length;
138
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
139
- arr2[i] = arr[i];
140
- }
140
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
141
141
  return arr2;
142
142
  }
143
143
 
144
- function _unsupportedIterableToArray(o, minLen) {
144
+ function _unsupportedIterableToArray$1(o, minLen) {
145
145
  if (!o) return;
146
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
146
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
147
147
  var n = Object.prototype.toString.call(o).slice(8, -1);
148
148
  if (n === "Object" && o.constructor) n = o.constructor.name;
149
149
  if (n === "Map" || n === "Set") return Array.from(o);
150
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
150
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
151
151
  }
152
152
 
153
- function _nonIterableRest() {
153
+ function _nonIterableRest$1() {
154
154
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
155
155
  }
156
156
 
157
157
  function _toArray(arr) {
158
- return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
158
+ return _arrayWithHoles$1(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableRest$1();
159
159
  }
160
160
 
161
161
  function ownKeys$6$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; }
@@ -402,7 +402,7 @@ var _entityMap = {
402
402
  "'": '&#39;',
403
403
  '/': '&#x2F;'
404
404
  };
405
- function escape(data) {
405
+ function escape$1(data) {
406
406
  if (typeof data === 'string') {
407
407
  return data.replace(/[&<>"'\/]/g, function (s) {
408
408
  return _entityMap[s];
@@ -710,7 +710,7 @@ var Translator = function (_EventEmitter) {
710
710
  key: "translate",
711
711
  value: function translate(keys, options, lastKey) {
712
712
  var _this2 = this;
713
- if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
713
+ if (_typeof$1(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
714
714
  options = this.options.overloadTranslationOptionHandler(arguments);
715
715
  }
716
716
  if (!options) options = {};
@@ -1456,7 +1456,7 @@ var Interpolator = function () {
1456
1456
  escapeValue: true
1457
1457
  };
1458
1458
  var iOpts = options.interpolation;
1459
- this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;
1459
+ this.escape = iOpts.escape !== undefined ? iOpts.escape : escape$1;
1460
1460
  this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;
1461
1461
  this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;
1462
1462
  this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';
@@ -2065,10 +2065,10 @@ function get() {
2065
2065
  appendNamespaceToCIMode: false,
2066
2066
  overloadTranslationOptionHandler: function handle(args) {
2067
2067
  var ret = {};
2068
- if (_typeof(args[1]) === 'object') ret = args[1];
2068
+ if (_typeof$1(args[1]) === 'object') ret = args[1];
2069
2069
  if (typeof args[1] === 'string') ret.defaultValue = args[1];
2070
2070
  if (typeof args[2] === 'string') ret.tDescription = args[2];
2071
- if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {
2071
+ if (_typeof$1(args[2]) === 'object' || _typeof$1(args[3]) === 'object') {
2072
2072
  var options = args[3] || args[2];
2073
2073
  Object.keys(options).forEach(function (key) {
2074
2074
  ret[key] = options[key];
@@ -2438,7 +2438,7 @@ var I18n = function (_EventEmitter) {
2438
2438
  var _this5 = this;
2439
2439
  var fixedT = function fixedT(key, opts) {
2440
2440
  var options;
2441
- if (_typeof(opts) !== 'object') {
2441
+ if (_typeof$1(opts) !== 'object') {
2442
2442
  for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
2443
2443
  rest[_key3 - 2] = arguments[_key3];
2444
2444
  }
@@ -2632,9 +2632,9 @@ instance.loadLanguages;
2632
2632
 
2633
2633
  var arr = [];
2634
2634
  var each = arr.forEach;
2635
- var slice = arr.slice;
2636
- function defaults(obj) {
2637
- each.call(slice.call(arguments, 1), function (source) {
2635
+ var slice$1 = arr.slice;
2636
+ function defaults$2(obj) {
2637
+ each.call(slice$1.call(arguments, 1), function (source) {
2638
2638
  if (source) {
2639
2639
  for (var prop in source) {
2640
2640
  if (obj[prop] === undefined) obj[prop] = source[prop];
@@ -2928,7 +2928,7 @@ var Browser = /*#__PURE__*/function () {
2928
2928
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2929
2929
  var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2930
2930
  this.services = services;
2931
- this.options = defaults(options, this.options || {}, getDefaults$1());
2931
+ this.options = defaults$2(options, this.options || {}, getDefaults$1());
2932
2932
 
2933
2933
  // backwards compatibility
2934
2934
  if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
@@ -3142,7 +3142,7 @@ var unescapeHtmlEntity = function unescapeHtmlEntity(m) {
3142
3142
  return htmlEntities[m];
3143
3143
  };
3144
3144
 
3145
- var unescape = function unescape(text) {
3145
+ var unescape$1 = function unescape(text) {
3146
3146
  return text.replace(matchHtmlEntity, unescapeHtmlEntity);
3147
3147
  };
3148
3148
 
@@ -3157,7 +3157,7 @@ var defaultOptions = {
3157
3157
  transWrapTextNodes: '',
3158
3158
  transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
3159
3159
  useSuspense: true,
3160
- unescape: unescape
3160
+ unescape: unescape$1
3161
3161
  };
3162
3162
  function setDefaults() {
3163
3163
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -3239,7 +3239,7 @@ function nodesToString(children, i18nOptions) {
3239
3239
  }
3240
3240
  } else if (child === null) {
3241
3241
  warn("Trans: the passed in value is invalid - seems you passed in a null child.");
3242
- } else if (_typeof(child) === 'object') {
3242
+ } else if (_typeof$1(child) === 'object') {
3243
3243
  var format = child.format,
3244
3244
  clone = _objectWithoutProperties(child, _excluded$4);
3245
3245
 
@@ -3269,7 +3269,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
3269
3269
  var childrenArray = getAsArray(childs);
3270
3270
  childrenArray.forEach(function (child) {
3271
3271
  if (typeof child === 'string') return;
3272
- if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !isValidElement(child)) Object.assign(data, child);
3272
+ if (hasChildren(child)) getData(getChildren(child));else if (_typeof$1(child) === 'object' && !isValidElement(child)) Object.assign(data, child);
3273
3273
  });
3274
3274
  }
3275
3275
 
@@ -3306,8 +3306,8 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
3306
3306
  }, tmp) : tmp;
3307
3307
  var isElement = isValidElement(child);
3308
3308
  var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
3309
- var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;
3310
- var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
3309
+ var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof$1(child) === 'object' && child.dummy && !isElement;
3310
+ var isKnownComponent = _typeof$1(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
3311
3311
 
3312
3312
  if (typeof child === 'string') {
3313
3313
  var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
@@ -3345,7 +3345,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
3345
3345
 
3346
3346
  mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
3347
3347
  }
3348
- } else if (_typeof(child) === 'object' && !isElement) {
3348
+ } else if (_typeof$1(child) === 'object' && !isElement) {
3349
3349
  var content = node.children[0] ? translationContent : null;
3350
3350
  if (content) mem.push(content);
3351
3351
  } else if (node.children.length === 1 && translationContent) {
@@ -3523,7 +3523,7 @@ function Trans(_ref) {
3523
3523
  }, additionalProps));
3524
3524
  }
3525
3525
 
3526
- function _iterableToArrayLimit(arr, i) {
3526
+ function _iterableToArrayLimit$1(arr, i) {
3527
3527
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
3528
3528
  if (null != _i) {
3529
3529
  var _s,
@@ -3537,9 +3537,7 @@ function _iterableToArrayLimit(arr, i) {
3537
3537
  if (_x = (_i = _i.call(arr)).next, 0 === i) {
3538
3538
  if (Object(_i) !== _i) return;
3539
3539
  _n = !1;
3540
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
3541
- ;
3542
- }
3540
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
3543
3541
  } catch (err) {
3544
3542
  _d = !0, _e = err;
3545
3543
  } finally {
@@ -3553,8 +3551,8 @@ function _iterableToArrayLimit(arr, i) {
3553
3551
  }
3554
3552
  }
3555
3553
 
3556
- function _slicedToArray(arr, i) {
3557
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
3554
+ function _slicedToArray$1(arr, i) {
3555
+ return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
3558
3556
  }
3559
3557
 
3560
3558
  function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -3612,7 +3610,7 @@ function useTranslation(ns) {
3612
3610
  }
3613
3611
 
3614
3612
  var _useState = useState(getT),
3615
- _useState2 = _slicedToArray(_useState, 2),
3613
+ _useState2 = _slicedToArray$1(_useState, 2),
3616
3614
  t = _useState2[0],
3617
3615
  setT = _useState2[1];
3618
3616
 
@@ -3914,17 +3912,6 @@ const getScrollBarWidth = () => {
3914
3912
  document.body.removeChild(outerElement);
3915
3913
  return w1 - w2;
3916
3914
  };
3917
- const noop = () => {};
3918
- const slugify = string => string.toString().toLowerCase().replace(/\s+/g, "-") // Replace spaces with -
3919
- .replace(/&/g, "-and-") // Replace & with 'and'
3920
- .replace(/[^\w-]+/g, "") // Remove all non-word characters
3921
- .replace(/--+/g, "-") // Replace multiple - with single -
3922
- .replace(/^-+/, "") // Trim - from start of text
3923
- .replace(/-+$/, ""); // Trim - from end of text
3924
-
3925
- const capitalize = string => string.charAt(0).toUpperCase() + string.slice(1);
3926
- const isNotEmpty$1 = complement(isEmpty);
3927
- const isNotEqual = (a, b) => !Object.is(a, b);
3928
3915
 
3929
3916
  const SINGULAR = {
3930
3917
  count: 1
@@ -3960,9 +3947,10 @@ const permissionsApi = {
3960
3947
  const DEFAULT_STALE_TIME = 300000; // 5 minutes
3961
3948
 
3962
3949
  const QUERY_KEYS = {
3963
- TEAMS: "neeto-team-members-teams",
3950
+ PERMISSIONS: "neeto-team-members-permissions",
3964
3951
  ROLES: "neeto-team-members-roles",
3965
- PERMISSIONS: "neeto-team-members-permissions"
3952
+ TEAMS: "neeto-team-members-teams",
3953
+ TEAMS_DEPENDENCIES: "neeto-team-members-teams-dependencies"
3966
3954
  };
3967
3955
 
3968
3956
  function ownKeys$8(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; }
@@ -3988,6 +3976,204 @@ const organizationRolesApi = {
3988
3976
  destroy
3989
3977
  };
3990
3978
 
3979
+ function _arrayWithHoles(arr) {
3980
+ if (Array.isArray(arr)) return arr;
3981
+ }
3982
+
3983
+ function _iterableToArrayLimit(arr, i) {
3984
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3985
+
3986
+ if (_i == null) return;
3987
+ var _arr = [];
3988
+ var _n = true;
3989
+ var _d = false;
3990
+
3991
+ var _s, _e;
3992
+
3993
+ try {
3994
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
3995
+ _arr.push(_s.value);
3996
+
3997
+ if (i && _arr.length === i) break;
3998
+ }
3999
+ } catch (err) {
4000
+ _d = true;
4001
+ _e = err;
4002
+ } finally {
4003
+ try {
4004
+ if (!_n && _i["return"] != null) _i["return"]();
4005
+ } finally {
4006
+ if (_d) throw _e;
4007
+ }
4008
+ }
4009
+
4010
+ return _arr;
4011
+ }
4012
+
4013
+ function _arrayLikeToArray(arr, len) {
4014
+ if (len == null || len > arr.length) len = arr.length;
4015
+
4016
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
4017
+ arr2[i] = arr[i];
4018
+ }
4019
+
4020
+ return arr2;
4021
+ }
4022
+
4023
+ function _unsupportedIterableToArray(o, minLen) {
4024
+ if (!o) return;
4025
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
4026
+ var n = Object.prototype.toString.call(o).slice(8, -1);
4027
+ if (n === "Object" && o.constructor) n = o.constructor.name;
4028
+ if (n === "Map" || n === "Set") return Array.from(o);
4029
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
4030
+ }
4031
+
4032
+ function _nonIterableRest() {
4033
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4034
+ }
4035
+
4036
+ function _slicedToArray(arr, i) {
4037
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
4038
+ }
4039
+
4040
+ function _typeof(obj) {
4041
+ "@babel/helpers - typeof";
4042
+
4043
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
4044
+ return typeof obj;
4045
+ } : function (obj) {
4046
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
4047
+ }, _typeof(obj);
4048
+ }
4049
+
4050
+ /**
4051
+ * @template {Function} T
4052
+ * @param {T} func
4053
+ * @returns {T}
4054
+ */
4055
+
4056
+ var nullSafe = function nullSafe(func) {
4057
+ return (// @ts-ignore
4058
+ curryN(func.length, function () {
4059
+ var _ref;
4060
+
4061
+ var dataArg = (_ref = func.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]);
4062
+ return isNil(dataArg) ? dataArg : func.apply(void 0, arguments);
4063
+ })
4064
+ );
4065
+ };
4066
+ var noop = function noop() {};
4067
+ var toLabelAndValue = function toLabelAndValue(string) {
4068
+ return {
4069
+ label: string,
4070
+ value: string
4071
+ };
4072
+ };
4073
+ var isNotEmpty = /*#__PURE__*/complement(isEmpty);
4074
+ var notEquals = /*#__PURE__*/curry(function (x, y) {
4075
+ return x !== y;
4076
+ });
4077
+
4078
+ var slugify = function slugify(string) {
4079
+ return string.toString().toLowerCase().replace(/\s+/g, "-") // Replace spaces with -
4080
+ .replace(/&/g, "-and-") // Replace & with 'and'
4081
+ .replace(/[^\w-]+/g, "") // Remove all non-word characters
4082
+ .replace(/--+/g, "-") // Replace multiple - with single -
4083
+ .replace(/^-+/, "") // Trim - from start of text
4084
+ .replace(/-+$/, "");
4085
+ }; // Trim - from end of text
4086
+
4087
+ var humanize = function humanize(string) {
4088
+ string = string.replace(/[_-]+/g, " ").replace(/\s{2,}/g, " ").replace(/([a-z\d])([A-Z])/g, "$1" + " " + "$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1" + " " + "$2").toLowerCase().trim();
4089
+ string = string.charAt(0).toUpperCase() + string.slice(1);
4090
+ return string;
4091
+ };
4092
+ var snakeToCamelCase = function snakeToCamelCase(string) {
4093
+ return string.replace(/(_\w)/g, function (letter) {
4094
+ return letter[1].toUpperCase();
4095
+ });
4096
+ };
4097
+ var camelToSnakeCase = function camelToSnakeCase(string) {
4098
+ return string.replace(/[A-Z]/g, function (letter) {
4099
+ return "_".concat(letter.toLowerCase());
4100
+ });
4101
+ };
4102
+ var capitalize = function capitalize(string) {
4103
+ return string.charAt(0).toUpperCase() + string.slice(1);
4104
+ };
4105
+ nullSafe(slugify);
4106
+ nullSafe(humanize);
4107
+ nullSafe(snakeToCamelCase);
4108
+ nullSafe(camelToSnakeCase);
4109
+ nullSafe(capitalize);
4110
+
4111
+ var matchesImpl = function matchesImpl(pattern, object) {
4112
+ var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
4113
+
4114
+ if (object === pattern) return true;
4115
+ if (typeof pattern === "function" && pattern(object, __parent)) return true;
4116
+ if (isNil(pattern) || isNil(object)) return false;
4117
+ if (_typeof(pattern) !== "object") return false;
4118
+ return Object.entries(pattern).every(function (_ref) {
4119
+ var _ref2 = _slicedToArray(_ref, 2),
4120
+ key = _ref2[0],
4121
+ value = _ref2[1];
4122
+
4123
+ return matchesImpl(value, object[key], __parent);
4124
+ });
4125
+ };
4126
+
4127
+ var transformObjectDeep = function transformObjectDeep(object, keyValueTransformer) {
4128
+ var objectPreProcessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
4129
+
4130
+ if (objectPreProcessor && typeof objectPreProcessor === "function") {
4131
+ object = objectPreProcessor(object);
4132
+ }
4133
+
4134
+ if (Array.isArray(object)) {
4135
+ return object.map(function (obj) {
4136
+ return transformObjectDeep(obj, keyValueTransformer, objectPreProcessor);
4137
+ });
4138
+ } else if (object === null || _typeof(object) !== "object") {
4139
+ return object;
4140
+ }
4141
+
4142
+ return Object.fromEntries(Object.entries(object).map(function (_ref3) {
4143
+ var _ref4 = _slicedToArray(_ref3, 2),
4144
+ key = _ref4[0],
4145
+ value = _ref4[1];
4146
+
4147
+ return keyValueTransformer(key, transformObjectDeep(value, keyValueTransformer, objectPreProcessor));
4148
+ }));
4149
+ };
4150
+ var keysToSnakeCase = function keysToSnakeCase(object) {
4151
+ return transformObjectDeep(object, function (key, value) {
4152
+ return [camelToSnakeCase(key), value];
4153
+ });
4154
+ };
4155
+ var matches = /*#__PURE__*/curry(function (pattern, object) {
4156
+ return matchesImpl(pattern, object);
4157
+ });
4158
+ var filterNonNull = function filterNonNull(object) {
4159
+ return Object.fromEntries(Object.entries(object).filter(function (_ref5) {
4160
+ var _ref6 = _slicedToArray(_ref5, 2),
4161
+ v = _ref6[1];
4162
+
4163
+ return !isNil(v);
4164
+ }).map(function (_ref7) {
4165
+ var _ref8 = _slicedToArray(_ref7, 2),
4166
+ k = _ref8[0],
4167
+ v = _ref8[1];
4168
+
4169
+ return [k, _typeof(v) === "object" && !Array.isArray(v) ? filterNonNull(v) : v];
4170
+ }));
4171
+ };
4172
+ nullSafe(filterNonNull);
4173
+ var removeBy = /*#__PURE__*/curry(function (pattern, array) {
4174
+ return array.filter(complement(matches(pattern)));
4175
+ });
4176
+
3991
4177
  const _excluded$2 = ["onSuccess"],
3992
4178
  _excluded2$2 = ["onSuccess"],
3993
4179
  _excluded3$1 = ["onSuccess"];
@@ -4005,6 +4191,7 @@ const useCreateRole = _ref => {
4005
4191
  options = _objectWithoutProperties(_ref, _excluded$2);
4006
4192
  return useMutation(organizationRolesApi.create, _objectSpread$7({
4007
4193
  onSuccess: response => {
4194
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
4008
4195
  queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
4009
4196
  if (!!cachedData.data && !!cachedData.data.organizationRoles) {
4010
4197
  return modifyPath(["data", "organizationRoles"], prepend(response.data.organizationRole), cachedData);
@@ -4026,6 +4213,7 @@ const useUpdateRole = _ref2 => {
4026
4213
  }, _objectSpread$7({
4027
4214
  onSuccess: response => {
4028
4215
  queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
4216
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
4029
4217
  queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
4030
4218
  if (!!cachedData.data && !!cachedData.data.organizationRoles) {
4031
4219
  return assocPath(["data", "organizationRoles", findIndex(propEq("id", response.data.organizationRole.id), cachedData.data.organizationRoles)], response.data.organizationRole, cachedData);
@@ -4047,6 +4235,8 @@ const useDestroyRole = _ref4 => {
4047
4235
  return organizationRolesApi.destroy(id, payload);
4048
4236
  }, _objectSpread$7({
4049
4237
  onSuccess: response => {
4238
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
4239
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
4050
4240
  queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
4051
4241
  if (!!cachedData.data && !!cachedData.data.organizationRoles) {
4052
4242
  return dissocPath(["data", "organizationRoles", findIndex(propEq("id", response.data.id), cachedData.data.organizationRoles)], cachedData);
@@ -4059,7 +4249,11 @@ const useDestroyRole = _ref4 => {
4059
4249
  }, options));
4060
4250
  };
4061
4251
 
4062
- var dist = {exports: {}};
4252
+ var distExports = {};
4253
+ var dist = {
4254
+ get exports(){ return distExports; },
4255
+ set exports(v){ distExports = v; },
4256
+ };
4063
4257
 
4064
4258
  (function (module, exports) {
4065
4259
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -5903,7 +6097,7 @@ const TableHeader = _ref => {
5903
6097
  }
5904
6098
  }, [setIsScrollPresent]);
5905
6099
  useEffect(() => getOverflowStatus(), [getOverflowStatus, scrollSyncElement, roles]);
5906
- return /*#__PURE__*/React.createElement(dist.exports.ScrollSyncPane, {
6100
+ return /*#__PURE__*/React.createElement(distExports.ScrollSyncPane, {
5907
6101
  ref: scrollSyncElement,
5908
6102
  group: "horizontal"
5909
6103
  }, /*#__PURE__*/React.createElement("div", {
@@ -6090,7 +6284,7 @@ const Columns$1 = _ref => {
6090
6284
  roles = _ref.roles,
6091
6285
  setIsScrollPresent = _ref.setIsScrollPresent;
6092
6286
  const _useState = useState(DEFAULT_MANAGE_ROLE_VALUES),
6093
- _useState2 = _slicedToArray(_useState, 2),
6287
+ _useState2 = _slicedToArray$1(_useState, 2),
6094
6288
  manageRole = _useState2[0],
6095
6289
  setManageRole = _useState2[1];
6096
6290
  const categories = Object.keys(filteredGroupPermissions);
@@ -6102,7 +6296,7 @@ const Columns$1 = _ref => {
6102
6296
  setManageRole: setManageRole,
6103
6297
  roles: filteredRoles,
6104
6298
  setIsScrollPresent: setIsScrollPresent
6105
- }), /*#__PURE__*/React.createElement(dist.exports.ScrollSyncPane, {
6299
+ }), /*#__PURE__*/React.createElement(distExports.ScrollSyncPane, {
6106
6300
  group: ["horizontal", "vertical"]
6107
6301
  }, /*#__PURE__*/React.createElement("div", {
6108
6302
  className: "ntm-roles-table__rows"
@@ -6213,7 +6407,7 @@ const Sidebar = _ref => {
6213
6407
  prefix: /*#__PURE__*/React.createElement(Search, null),
6214
6408
  type: "search",
6215
6409
  value: searchTerm
6216
- })), /*#__PURE__*/React.createElement(dist.exports.ScrollSyncPane, {
6410
+ })), /*#__PURE__*/React.createElement(distExports.ScrollSyncPane, {
6217
6411
  group: "vertical"
6218
6412
  }, /*#__PURE__*/React.createElement("div", {
6219
6413
  className: "ntm-roles-table-sidebar__list"
@@ -6245,15 +6439,15 @@ const Table = _ref => {
6245
6439
  const _useTranslation = useTranslation(),
6246
6440
  t = _useTranslation.t;
6247
6441
  const _useState = useState(""),
6248
- _useState2 = _slicedToArray(_useState, 2),
6442
+ _useState2 = _slicedToArray$1(_useState, 2),
6249
6443
  searchTerm = _useState2[0],
6250
6444
  setSearchTerm = _useState2[1];
6251
6445
  const _useState3 = useState(permissionGroups),
6252
- _useState4 = _slicedToArray(_useState3, 2),
6446
+ _useState4 = _slicedToArray$1(_useState3, 2),
6253
6447
  filteredGroupPermissions = _useState4[0],
6254
6448
  setFilteredGroupPermissions = _useState4[1];
6255
6449
  const _useState5 = useState(false),
6256
- _useState6 = _slicedToArray(_useState5, 2),
6450
+ _useState6 = _slicedToArray$1(_useState5, 2),
6257
6451
  isScrollPresent = _useState6[0],
6258
6452
  setIsScrollPresent = _useState6[1];
6259
6453
  const toggleDropdown = category => {
@@ -6261,7 +6455,7 @@ const Table = _ref => {
6261
6455
  };
6262
6456
  useEffect(() => {
6263
6457
  setFilteredGroupPermissions(fromPairs(toPairs(permissionGroups).map(_ref2 => {
6264
- let _ref3 = _slicedToArray(_ref2, 2),
6458
+ let _ref3 = _slicedToArray$1(_ref2, 2),
6265
6459
  category = _ref3[0],
6266
6460
  options = _ref3[1];
6267
6461
  return [category, modify("permissions", filter(_ref4 => {
@@ -6301,15 +6495,15 @@ const Roles = _ref => {
6301
6495
  const _useTranslation = useTranslation(),
6302
6496
  t = _useTranslation.t;
6303
6497
  const _useState = useState(""),
6304
- _useState2 = _slicedToArray(_useState, 2),
6498
+ _useState2 = _slicedToArray$1(_useState, 2),
6305
6499
  searchString = _useState2[0],
6306
6500
  setSearchString = _useState2[1];
6307
6501
  const _useState3 = useState([]),
6308
- _useState4 = _slicedToArray(_useState3, 2),
6502
+ _useState4 = _slicedToArray$1(_useState3, 2),
6309
6503
  filteredRoles = _useState4[0],
6310
6504
  setFilteredRoles = _useState4[1];
6311
6505
  const _useState5 = useState(false),
6312
- _useState6 = _slicedToArray(_useState5, 2),
6506
+ _useState6 = _slicedToArray$1(_useState5, 2),
6313
6507
  isNewRolePaneOpen = _useState6[0],
6314
6508
  setIsNewRolePaneOpen = _useState6[1];
6315
6509
  const _useFetchRoles = useFetchRoles({
@@ -6335,7 +6529,7 @@ const Roles = _ref => {
6335
6529
  className: "ntm-members-page-loader"
6336
6530
  }, /*#__PURE__*/React.createElement(PageLoader, null));
6337
6531
  }
6338
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(dist.exports.ScrollSync, null, /*#__PURE__*/React.createElement(Container, {
6532
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(distExports.ScrollSync, null, /*#__PURE__*/React.createElement(Container, {
6339
6533
  isHeaderFixed: true
6340
6534
  }, /*#__PURE__*/React.createElement(Header$1, {
6341
6535
  config: config,
@@ -6365,89 +6559,6 @@ const Roles = _ref => {
6365
6559
  };
6366
6560
  var index$1 = withReactQuery(Roles);
6367
6561
 
6368
- const fetch = params => axios.get(`${BASE_URL}/teams`, {
6369
- params
6370
- });
6371
- const create = payload => axios.post(`${BASE_URL}/teams`, payload);
6372
- const update = (id, payload) => axios.put(`${BASE_URL}/teams/${id}`, {
6373
- team: payload
6374
- });
6375
- const bulkUpdate = payload => axios.patch(`${BASE_URL}/teams/bulk_update`, payload);
6376
- const teamsApi = {
6377
- bulkUpdate,
6378
- create,
6379
- fetch,
6380
- update
6381
- };
6382
-
6383
- const _excluded$1 = ["onSuccess"],
6384
- _excluded2$1 = ["onSuccess"],
6385
- _excluded3 = ["onSuccess"];
6386
- function ownKeys$4(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; }
6387
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6388
- const useFetchMembers = function () {
6389
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6390
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6391
- return useQuery([QUERY_KEYS.TEAMS, params], () => teamsApi.fetch(params), _objectSpread$4({
6392
- staleTime: DEFAULT_STALE_TIME,
6393
- select: response => response.data || response,
6394
- keepPreviousData: true
6395
- }, options));
6396
- };
6397
- const useCreateMember = _ref => {
6398
- let onSuccess = _ref.onSuccess,
6399
- options = _objectWithoutProperties(_ref, _excluded$1);
6400
- return useMutation(teamsApi.create, _objectSpread$4({
6401
- onSuccess: response => {
6402
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6403
- Toastr.success(response.ntmNotice || response.data.ntmNotice);
6404
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
6405
- }
6406
- }, options));
6407
- };
6408
- const useUpdateMember = _ref2 => {
6409
- let onSuccess = _ref2.onSuccess,
6410
- options = _objectWithoutProperties(_ref2, _excluded2$1);
6411
- return useMutation(_ref3 => {
6412
- let id = _ref3.id,
6413
- payload = _ref3.payload;
6414
- return teamsApi.update(id, payload);
6415
- }, _objectSpread$4({
6416
- onSuccess: response => {
6417
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6418
- Toastr.success(response.ntmNotice || response.data.ntmNotice);
6419
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
6420
- }
6421
- }, options));
6422
- };
6423
- const useBulkUpdateMembers = _ref4 => {
6424
- let onSuccess = _ref4.onSuccess,
6425
- options = _objectWithoutProperties(_ref4, _excluded3);
6426
- return useMutation(teamsApi.bulkUpdate, _objectSpread$4({
6427
- onSuccess: response => {
6428
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6429
- Toastr.success(response.ntmNotice || response.data.ntmNotice);
6430
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
6431
- }
6432
- }, options));
6433
- };
6434
- const refetchMembers = () => {
6435
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6436
- };
6437
-
6438
- const useDebounce = function (value) {
6439
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
6440
- const _useState = useState(value),
6441
- _useState2 = _slicedToArray(_useState, 2),
6442
- debouncedValue = _useState2[0],
6443
- setDebouncedValue = _useState2[1];
6444
- useEffect(() => {
6445
- const handler = setTimeout(() => setDebouncedValue(value), delay);
6446
- return () => clearTimeout(handler);
6447
- }, [value, delay]);
6448
- return debouncedValue;
6449
- };
6450
-
6451
6562
  function _extends() {
6452
6563
  _extends = Object.assign ? Object.assign.bind() : function (target) {
6453
6564
  for (var i = 1; i < arguments.length; i++) {
@@ -6463,55 +6574,2182 @@ function _extends() {
6463
6574
  return _extends.apply(this, arguments);
6464
6575
  }
6465
6576
 
6466
- const FIXED_COLUMNS = ["actions"];
6467
- const COLUMNS_DROPDOWN_PROPS = {
6468
- label: instance.t("common.column", PLURAL)
6469
- };
6470
- const COLUMNS_SEARCH_PROPS = {
6471
- placeholder: instance.t("columns.search")
6577
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
6578
+ var shams = function hasSymbols() {
6579
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
6580
+ if (typeof Symbol.iterator === 'symbol') { return true; }
6581
+
6582
+ var obj = {};
6583
+ var sym = Symbol('test');
6584
+ var symObj = Object(sym);
6585
+ if (typeof sym === 'string') { return false; }
6586
+
6587
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
6588
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
6589
+
6590
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
6591
+ // if (sym instanceof Symbol) { return false; }
6592
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
6593
+ // if (!(symObj instanceof Symbol)) { return false; }
6594
+
6595
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
6596
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
6597
+
6598
+ var symVal = 42;
6599
+ obj[sym] = symVal;
6600
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
6601
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
6602
+
6603
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
6604
+
6605
+ var syms = Object.getOwnPropertySymbols(obj);
6606
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
6607
+
6608
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
6609
+
6610
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
6611
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
6612
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
6613
+ }
6614
+
6615
+ return true;
6472
6616
  };
6473
- const MANAGE_ROLES_BUTTON_LABEL = instance.t("common.manage_", {
6474
- what: instance.t("common.role", PLURAL).toLocaleLowerCase()
6475
- });
6476
6617
 
6477
- const Header = _ref => {
6478
- var _permissions$create, _config$header;
6479
- let config = _ref.config,
6480
- _ref$isEmptyState = _ref.isEmptyState,
6481
- isEmptyState = _ref$isEmptyState === void 0 ? false : _ref$isEmptyState,
6482
- metaName = _ref.metaName,
6483
- _ref$onClick = _ref.onClick,
6484
- onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
6485
- permissions = _ref.permissions,
6486
- rolesButtonProps = _ref.rolesButtonProps;
6487
- const isRolesButtonVisible = !!rolesButtonProps;
6488
- const hasCreatePermission = (_permissions$create = permissions === null || permissions === void 0 ? void 0 : permissions.create) !== null && _permissions$create !== void 0 ? _permissions$create : hasPermission(MANAGE_MEMBER_PERMISSIONS);
6489
- const isOtherActionBlockVisible = !!(config !== null && config !== void 0 && (_config$header = config.header) !== null && _config$header !== void 0 && _config$header.otherActionBlock) && !isEmptyState;
6490
- return /*#__PURE__*/React.createElement(React.Fragment, null, isOtherActionBlockVisible && config.header.otherActionBlock(), isRolesButtonVisible ? /*#__PURE__*/React.createElement(Button, _extends({
6491
- "data-cy": "ntm-manage-roles-button",
6492
- label: MANAGE_ROLES_BUTTON_LABEL,
6493
- style: "secondary"
6494
- }, rolesButtonProps)) : null, /*#__PURE__*/React.createElement(Tooltip, {
6495
- content: instance.t("tooltips.noPermissionToAddMember"),
6496
- disabled: hasCreatePermission,
6497
- position: "bottom"
6498
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Button, {
6499
- "data-cy": "ntm-add-member-button",
6500
- disabled: !hasCreatePermission,
6501
- label: instance.t("common.add_", {
6502
- what: metaName(SINGULAR).toLocaleLowerCase()
6503
- }),
6504
- onClick: onClick
6505
- }))));
6618
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
6619
+ var hasSymbolSham = shams;
6620
+
6621
+ var hasSymbols$1 = function hasNativeSymbols() {
6622
+ if (typeof origSymbol !== 'function') { return false; }
6623
+ if (typeof Symbol !== 'function') { return false; }
6624
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
6625
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
6626
+
6627
+ return hasSymbolSham();
6506
6628
  };
6507
6629
 
6508
- const getStorageValue = (key, defaultValue) => {
6509
- const saved = localStorage.getItem(key);
6630
+ /* eslint no-invalid-this: 1 */
6631
+
6632
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
6633
+ var slice = Array.prototype.slice;
6634
+ var toStr$1 = Object.prototype.toString;
6635
+ var funcType = '[object Function]';
6636
+
6637
+ var implementation$1 = function bind(that) {
6638
+ var target = this;
6639
+ if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
6640
+ throw new TypeError(ERROR_MESSAGE + target);
6641
+ }
6642
+ var args = slice.call(arguments, 1);
6643
+
6644
+ var bound;
6645
+ var binder = function () {
6646
+ if (this instanceof bound) {
6647
+ var result = target.apply(
6648
+ this,
6649
+ args.concat(slice.call(arguments))
6650
+ );
6651
+ if (Object(result) === result) {
6652
+ return result;
6653
+ }
6654
+ return this;
6655
+ } else {
6656
+ return target.apply(
6657
+ that,
6658
+ args.concat(slice.call(arguments))
6659
+ );
6660
+ }
6661
+ };
6662
+
6663
+ var boundLength = Math.max(0, target.length - args.length);
6664
+ var boundArgs = [];
6665
+ for (var i = 0; i < boundLength; i++) {
6666
+ boundArgs.push('$' + i);
6667
+ }
6668
+
6669
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
6670
+
6671
+ if (target.prototype) {
6672
+ var Empty = function Empty() {};
6673
+ Empty.prototype = target.prototype;
6674
+ bound.prototype = new Empty();
6675
+ Empty.prototype = null;
6676
+ }
6677
+
6678
+ return bound;
6679
+ };
6680
+
6681
+ var implementation = implementation$1;
6682
+
6683
+ var functionBind = Function.prototype.bind || implementation;
6684
+
6685
+ var bind$1 = functionBind;
6686
+
6687
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
6688
+
6689
+ var undefined$1;
6690
+
6691
+ var $SyntaxError = SyntaxError;
6692
+ var $Function = Function;
6693
+ var $TypeError$1 = TypeError;
6694
+
6695
+ // eslint-disable-next-line consistent-return
6696
+ var getEvalledConstructor = function (expressionSyntax) {
6697
+ try {
6698
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
6699
+ } catch (e) {}
6700
+ };
6701
+
6702
+ var $gOPD = Object.getOwnPropertyDescriptor;
6703
+ if ($gOPD) {
6704
+ try {
6705
+ $gOPD({}, '');
6706
+ } catch (e) {
6707
+ $gOPD = null; // this is IE 8, which has a broken gOPD
6708
+ }
6709
+ }
6710
+
6711
+ var throwTypeError = function () {
6712
+ throw new $TypeError$1();
6713
+ };
6714
+ var ThrowTypeError = $gOPD
6715
+ ? (function () {
6716
+ try {
6717
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
6718
+ arguments.callee; // IE 8 does not throw here
6719
+ return throwTypeError;
6720
+ } catch (calleeThrows) {
6721
+ try {
6722
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
6723
+ return $gOPD(arguments, 'callee').get;
6724
+ } catch (gOPDthrows) {
6725
+ return throwTypeError;
6726
+ }
6727
+ }
6728
+ }())
6729
+ : throwTypeError;
6730
+
6731
+ var hasSymbols = hasSymbols$1();
6732
+
6733
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
6734
+
6735
+ var needsEval = {};
6736
+
6737
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
6738
+
6739
+ var INTRINSICS = {
6740
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
6741
+ '%Array%': Array,
6742
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
6743
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
6744
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
6745
+ '%AsyncFunction%': needsEval,
6746
+ '%AsyncGenerator%': needsEval,
6747
+ '%AsyncGeneratorFunction%': needsEval,
6748
+ '%AsyncIteratorPrototype%': needsEval,
6749
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
6750
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
6751
+ '%Boolean%': Boolean,
6752
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
6753
+ '%Date%': Date,
6754
+ '%decodeURI%': decodeURI,
6755
+ '%decodeURIComponent%': decodeURIComponent,
6756
+ '%encodeURI%': encodeURI,
6757
+ '%encodeURIComponent%': encodeURIComponent,
6758
+ '%Error%': Error,
6759
+ '%eval%': eval, // eslint-disable-line no-eval
6760
+ '%EvalError%': EvalError,
6761
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
6762
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
6763
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
6764
+ '%Function%': $Function,
6765
+ '%GeneratorFunction%': needsEval,
6766
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
6767
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
6768
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
6769
+ '%isFinite%': isFinite,
6770
+ '%isNaN%': isNaN,
6771
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
6772
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
6773
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
6774
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
6775
+ '%Math%': Math,
6776
+ '%Number%': Number,
6777
+ '%Object%': Object,
6778
+ '%parseFloat%': parseFloat,
6779
+ '%parseInt%': parseInt,
6780
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
6781
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
6782
+ '%RangeError%': RangeError,
6783
+ '%ReferenceError%': ReferenceError,
6784
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
6785
+ '%RegExp%': RegExp,
6786
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
6787
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
6788
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
6789
+ '%String%': String,
6790
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
6791
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
6792
+ '%SyntaxError%': $SyntaxError,
6793
+ '%ThrowTypeError%': ThrowTypeError,
6794
+ '%TypedArray%': TypedArray,
6795
+ '%TypeError%': $TypeError$1,
6796
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
6797
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
6798
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
6799
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
6800
+ '%URIError%': URIError,
6801
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
6802
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
6803
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
6804
+ };
6805
+
6806
+ var doEval = function doEval(name) {
6807
+ var value;
6808
+ if (name === '%AsyncFunction%') {
6809
+ value = getEvalledConstructor('async function () {}');
6810
+ } else if (name === '%GeneratorFunction%') {
6811
+ value = getEvalledConstructor('function* () {}');
6812
+ } else if (name === '%AsyncGeneratorFunction%') {
6813
+ value = getEvalledConstructor('async function* () {}');
6814
+ } else if (name === '%AsyncGenerator%') {
6815
+ var fn = doEval('%AsyncGeneratorFunction%');
6816
+ if (fn) {
6817
+ value = fn.prototype;
6818
+ }
6819
+ } else if (name === '%AsyncIteratorPrototype%') {
6820
+ var gen = doEval('%AsyncGenerator%');
6821
+ if (gen) {
6822
+ value = getProto(gen.prototype);
6823
+ }
6824
+ }
6825
+
6826
+ INTRINSICS[name] = value;
6827
+
6828
+ return value;
6829
+ };
6830
+
6831
+ var LEGACY_ALIASES = {
6832
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
6833
+ '%ArrayPrototype%': ['Array', 'prototype'],
6834
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
6835
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
6836
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
6837
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
6838
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
6839
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
6840
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
6841
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
6842
+ '%DataViewPrototype%': ['DataView', 'prototype'],
6843
+ '%DatePrototype%': ['Date', 'prototype'],
6844
+ '%ErrorPrototype%': ['Error', 'prototype'],
6845
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
6846
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
6847
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
6848
+ '%FunctionPrototype%': ['Function', 'prototype'],
6849
+ '%Generator%': ['GeneratorFunction', 'prototype'],
6850
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
6851
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
6852
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
6853
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
6854
+ '%JSONParse%': ['JSON', 'parse'],
6855
+ '%JSONStringify%': ['JSON', 'stringify'],
6856
+ '%MapPrototype%': ['Map', 'prototype'],
6857
+ '%NumberPrototype%': ['Number', 'prototype'],
6858
+ '%ObjectPrototype%': ['Object', 'prototype'],
6859
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
6860
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
6861
+ '%PromisePrototype%': ['Promise', 'prototype'],
6862
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
6863
+ '%Promise_all%': ['Promise', 'all'],
6864
+ '%Promise_reject%': ['Promise', 'reject'],
6865
+ '%Promise_resolve%': ['Promise', 'resolve'],
6866
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
6867
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
6868
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
6869
+ '%SetPrototype%': ['Set', 'prototype'],
6870
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
6871
+ '%StringPrototype%': ['String', 'prototype'],
6872
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
6873
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
6874
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
6875
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
6876
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
6877
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
6878
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
6879
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
6880
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
6881
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
6882
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
6883
+ };
6884
+
6885
+ var bind = functionBind;
6886
+ var hasOwn$1 = src;
6887
+ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
6888
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
6889
+ var $replace$1 = bind.call(Function.call, String.prototype.replace);
6890
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
6891
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
6892
+
6893
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
6894
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
6895
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
6896
+ var stringToPath = function stringToPath(string) {
6897
+ var first = $strSlice(string, 0, 1);
6898
+ var last = $strSlice(string, -1);
6899
+ if (first === '%' && last !== '%') {
6900
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
6901
+ } else if (last === '%' && first !== '%') {
6902
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
6903
+ }
6904
+ var result = [];
6905
+ $replace$1(string, rePropName, function (match, number, quote, subString) {
6906
+ result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
6907
+ });
6908
+ return result;
6909
+ };
6910
+ /* end adaptation */
6911
+
6912
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
6913
+ var intrinsicName = name;
6914
+ var alias;
6915
+ if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
6916
+ alias = LEGACY_ALIASES[intrinsicName];
6917
+ intrinsicName = '%' + alias[0] + '%';
6918
+ }
6919
+
6920
+ if (hasOwn$1(INTRINSICS, intrinsicName)) {
6921
+ var value = INTRINSICS[intrinsicName];
6922
+ if (value === needsEval) {
6923
+ value = doEval(intrinsicName);
6924
+ }
6925
+ if (typeof value === 'undefined' && !allowMissing) {
6926
+ throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
6927
+ }
6928
+
6929
+ return {
6930
+ alias: alias,
6931
+ name: intrinsicName,
6932
+ value: value
6933
+ };
6934
+ }
6935
+
6936
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
6937
+ };
6938
+
6939
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
6940
+ if (typeof name !== 'string' || name.length === 0) {
6941
+ throw new $TypeError$1('intrinsic name must be a non-empty string');
6942
+ }
6943
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
6944
+ throw new $TypeError$1('"allowMissing" argument must be a boolean');
6945
+ }
6946
+
6947
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
6948
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
6949
+ }
6950
+ var parts = stringToPath(name);
6951
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
6952
+
6953
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
6954
+ var intrinsicRealName = intrinsic.name;
6955
+ var value = intrinsic.value;
6956
+ var skipFurtherCaching = false;
6957
+
6958
+ var alias = intrinsic.alias;
6959
+ if (alias) {
6960
+ intrinsicBaseName = alias[0];
6961
+ $spliceApply(parts, $concat$1([0, 1], alias));
6962
+ }
6963
+
6964
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
6965
+ var part = parts[i];
6966
+ var first = $strSlice(part, 0, 1);
6967
+ var last = $strSlice(part, -1);
6968
+ if (
6969
+ (
6970
+ (first === '"' || first === "'" || first === '`')
6971
+ || (last === '"' || last === "'" || last === '`')
6972
+ )
6973
+ && first !== last
6974
+ ) {
6975
+ throw new $SyntaxError('property names with quotes must have matching quotes');
6976
+ }
6977
+ if (part === 'constructor' || !isOwn) {
6978
+ skipFurtherCaching = true;
6979
+ }
6980
+
6981
+ intrinsicBaseName += '.' + part;
6982
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
6983
+
6984
+ if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
6985
+ value = INTRINSICS[intrinsicRealName];
6986
+ } else if (value != null) {
6987
+ if (!(part in value)) {
6988
+ if (!allowMissing) {
6989
+ throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
6990
+ }
6991
+ return void undefined$1;
6992
+ }
6993
+ if ($gOPD && (i + 1) >= parts.length) {
6994
+ var desc = $gOPD(value, part);
6995
+ isOwn = !!desc;
6996
+
6997
+ // By convention, when a data property is converted to an accessor
6998
+ // property to emulate a data property that does not suffer from
6999
+ // the override mistake, that accessor's getter is marked with
7000
+ // an `originalValue` property. Here, when we detect this, we
7001
+ // uphold the illusion by pretending to see that original data
7002
+ // property, i.e., returning the value rather than the getter
7003
+ // itself.
7004
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
7005
+ value = desc.get;
7006
+ } else {
7007
+ value = value[part];
7008
+ }
7009
+ } else {
7010
+ isOwn = hasOwn$1(value, part);
7011
+ value = value[part];
7012
+ }
7013
+
7014
+ if (isOwn && !skipFurtherCaching) {
7015
+ INTRINSICS[intrinsicRealName] = value;
7016
+ }
7017
+ }
7018
+ }
7019
+ return value;
7020
+ };
7021
+
7022
+ var callBindExports = {};
7023
+ var callBind$1 = {
7024
+ get exports(){ return callBindExports; },
7025
+ set exports(v){ callBindExports = v; },
7026
+ };
7027
+
7028
+ (function (module) {
7029
+
7030
+ var bind = functionBind;
7031
+ var GetIntrinsic = getIntrinsic;
7032
+
7033
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
7034
+ var $call = GetIntrinsic('%Function.prototype.call%');
7035
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
7036
+
7037
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
7038
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
7039
+ var $max = GetIntrinsic('%Math.max%');
7040
+
7041
+ if ($defineProperty) {
7042
+ try {
7043
+ $defineProperty({}, 'a', { value: 1 });
7044
+ } catch (e) {
7045
+ // IE 8 has a broken defineProperty
7046
+ $defineProperty = null;
7047
+ }
7048
+ }
7049
+
7050
+ module.exports = function callBind(originalFunction) {
7051
+ var func = $reflectApply(bind, $call, arguments);
7052
+ if ($gOPD && $defineProperty) {
7053
+ var desc = $gOPD(func, 'length');
7054
+ if (desc.configurable) {
7055
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
7056
+ $defineProperty(
7057
+ func,
7058
+ 'length',
7059
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
7060
+ );
7061
+ }
7062
+ }
7063
+ return func;
7064
+ };
7065
+
7066
+ var applyBind = function applyBind() {
7067
+ return $reflectApply(bind, $apply, arguments);
7068
+ };
7069
+
7070
+ if ($defineProperty) {
7071
+ $defineProperty(module.exports, 'apply', { value: applyBind });
7072
+ } else {
7073
+ module.exports.apply = applyBind;
7074
+ }
7075
+ } (callBind$1));
7076
+
7077
+ var GetIntrinsic$1 = getIntrinsic;
7078
+
7079
+ var callBind = callBindExports;
7080
+
7081
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
7082
+
7083
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
7084
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
7085
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
7086
+ return callBind(intrinsic);
7087
+ }
7088
+ return intrinsic;
7089
+ };
7090
+
7091
+ var util_inspect = require$$0.inspect;
7092
+
7093
+ var hasMap = typeof Map === 'function' && Map.prototype;
7094
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
7095
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
7096
+ var mapForEach = hasMap && Map.prototype.forEach;
7097
+ var hasSet = typeof Set === 'function' && Set.prototype;
7098
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
7099
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
7100
+ var setForEach = hasSet && Set.prototype.forEach;
7101
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
7102
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
7103
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
7104
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
7105
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
7106
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
7107
+ var booleanValueOf = Boolean.prototype.valueOf;
7108
+ var objectToString = Object.prototype.toString;
7109
+ var functionToString = Function.prototype.toString;
7110
+ var $match = String.prototype.match;
7111
+ var $slice = String.prototype.slice;
7112
+ var $replace = String.prototype.replace;
7113
+ var $toUpperCase = String.prototype.toUpperCase;
7114
+ var $toLowerCase = String.prototype.toLowerCase;
7115
+ var $test = RegExp.prototype.test;
7116
+ var $concat = Array.prototype.concat;
7117
+ var $join = Array.prototype.join;
7118
+ var $arrSlice = Array.prototype.slice;
7119
+ var $floor = Math.floor;
7120
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
7121
+ var gOPS = Object.getOwnPropertySymbols;
7122
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
7123
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
7124
+ // ie, `has-tostringtag/shams
7125
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
7126
+ ? Symbol.toStringTag
7127
+ : null;
7128
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
7129
+
7130
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
7131
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
7132
+ ? function (O) {
7133
+ return O.__proto__; // eslint-disable-line no-proto
7134
+ }
7135
+ : null
7136
+ );
7137
+
7138
+ function addNumericSeparator(num, str) {
7139
+ if (
7140
+ num === Infinity
7141
+ || num === -Infinity
7142
+ || num !== num
7143
+ || (num && num > -1000 && num < 1000)
7144
+ || $test.call(/e/, str)
7145
+ ) {
7146
+ return str;
7147
+ }
7148
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
7149
+ if (typeof num === 'number') {
7150
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
7151
+ if (int !== num) {
7152
+ var intStr = String(int);
7153
+ var dec = $slice.call(str, intStr.length + 1);
7154
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
7155
+ }
7156
+ }
7157
+ return $replace.call(str, sepRegex, '$&_');
7158
+ }
7159
+
7160
+ var utilInspect = util_inspect;
7161
+ var inspectCustom = utilInspect.custom;
7162
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
7163
+
7164
+ var objectInspect = function inspect_(obj, options, depth, seen) {
7165
+ var opts = options || {};
7166
+
7167
+ if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
7168
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
7169
+ }
7170
+ if (
7171
+ has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
7172
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
7173
+ : opts.maxStringLength !== null
7174
+ )
7175
+ ) {
7176
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
7177
+ }
7178
+ var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
7179
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
7180
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
7181
+ }
7182
+
7183
+ if (
7184
+ has$3(opts, 'indent')
7185
+ && opts.indent !== null
7186
+ && opts.indent !== '\t'
7187
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
7188
+ ) {
7189
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
7190
+ }
7191
+ if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
7192
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
7193
+ }
7194
+ var numericSeparator = opts.numericSeparator;
7195
+
7196
+ if (typeof obj === 'undefined') {
7197
+ return 'undefined';
7198
+ }
7199
+ if (obj === null) {
7200
+ return 'null';
7201
+ }
7202
+ if (typeof obj === 'boolean') {
7203
+ return obj ? 'true' : 'false';
7204
+ }
7205
+
7206
+ if (typeof obj === 'string') {
7207
+ return inspectString(obj, opts);
7208
+ }
7209
+ if (typeof obj === 'number') {
7210
+ if (obj === 0) {
7211
+ return Infinity / obj > 0 ? '0' : '-0';
7212
+ }
7213
+ var str = String(obj);
7214
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
7215
+ }
7216
+ if (typeof obj === 'bigint') {
7217
+ var bigIntStr = String(obj) + 'n';
7218
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
7219
+ }
7220
+
7221
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
7222
+ if (typeof depth === 'undefined') { depth = 0; }
7223
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
7224
+ return isArray$3(obj) ? '[Array]' : '[Object]';
7225
+ }
7226
+
7227
+ var indent = getIndent(opts, depth);
7228
+
7229
+ if (typeof seen === 'undefined') {
7230
+ seen = [];
7231
+ } else if (indexOf(seen, obj) >= 0) {
7232
+ return '[Circular]';
7233
+ }
7234
+
7235
+ function inspect(value, from, noIndent) {
7236
+ if (from) {
7237
+ seen = $arrSlice.call(seen);
7238
+ seen.push(from);
7239
+ }
7240
+ if (noIndent) {
7241
+ var newOpts = {
7242
+ depth: opts.depth
7243
+ };
7244
+ if (has$3(opts, 'quoteStyle')) {
7245
+ newOpts.quoteStyle = opts.quoteStyle;
7246
+ }
7247
+ return inspect_(value, newOpts, depth + 1, seen);
7248
+ }
7249
+ return inspect_(value, opts, depth + 1, seen);
7250
+ }
7251
+
7252
+ if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
7253
+ var name = nameOf(obj);
7254
+ var keys = arrObjKeys(obj, inspect);
7255
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
7256
+ }
7257
+ if (isSymbol(obj)) {
7258
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
7259
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
7260
+ }
7261
+ if (isElement(obj)) {
7262
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
7263
+ var attrs = obj.attributes || [];
7264
+ for (var i = 0; i < attrs.length; i++) {
7265
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
7266
+ }
7267
+ s += '>';
7268
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
7269
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
7270
+ return s;
7271
+ }
7272
+ if (isArray$3(obj)) {
7273
+ if (obj.length === 0) { return '[]'; }
7274
+ var xs = arrObjKeys(obj, inspect);
7275
+ if (indent && !singleLineValues(xs)) {
7276
+ return '[' + indentedJoin(xs, indent) + ']';
7277
+ }
7278
+ return '[ ' + $join.call(xs, ', ') + ' ]';
7279
+ }
7280
+ if (isError(obj)) {
7281
+ var parts = arrObjKeys(obj, inspect);
7282
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
7283
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
7284
+ }
7285
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
7286
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
7287
+ }
7288
+ if (typeof obj === 'object' && customInspect) {
7289
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
7290
+ return utilInspect(obj, { depth: maxDepth - depth });
7291
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
7292
+ return obj.inspect();
7293
+ }
7294
+ }
7295
+ if (isMap(obj)) {
7296
+ var mapParts = [];
7297
+ mapForEach.call(obj, function (value, key) {
7298
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
7299
+ });
7300
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
7301
+ }
7302
+ if (isSet(obj)) {
7303
+ var setParts = [];
7304
+ setForEach.call(obj, function (value) {
7305
+ setParts.push(inspect(value, obj));
7306
+ });
7307
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
7308
+ }
7309
+ if (isWeakMap(obj)) {
7310
+ return weakCollectionOf('WeakMap');
7311
+ }
7312
+ if (isWeakSet(obj)) {
7313
+ return weakCollectionOf('WeakSet');
7314
+ }
7315
+ if (isWeakRef(obj)) {
7316
+ return weakCollectionOf('WeakRef');
7317
+ }
7318
+ if (isNumber(obj)) {
7319
+ return markBoxed(inspect(Number(obj)));
7320
+ }
7321
+ if (isBigInt(obj)) {
7322
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
7323
+ }
7324
+ if (isBoolean(obj)) {
7325
+ return markBoxed(booleanValueOf.call(obj));
7326
+ }
7327
+ if (isString(obj)) {
7328
+ return markBoxed(inspect(String(obj)));
7329
+ }
7330
+ if (!isDate(obj) && !isRegExp$1(obj)) {
7331
+ var ys = arrObjKeys(obj, inspect);
7332
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
7333
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
7334
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
7335
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
7336
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
7337
+ if (ys.length === 0) { return tag + '{}'; }
7338
+ if (indent) {
7339
+ return tag + '{' + indentedJoin(ys, indent) + '}';
7340
+ }
7341
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
7342
+ }
7343
+ return String(obj);
7344
+ };
7345
+
7346
+ function wrapQuotes(s, defaultStyle, opts) {
7347
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
7348
+ return quoteChar + s + quoteChar;
7349
+ }
7350
+
7351
+ function quote(s) {
7352
+ return $replace.call(String(s), /"/g, '&quot;');
7353
+ }
7354
+
7355
+ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7356
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7357
+ function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7358
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7359
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7360
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7361
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7362
+
7363
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
7364
+ function isSymbol(obj) {
7365
+ if (hasShammedSymbols) {
7366
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
7367
+ }
7368
+ if (typeof obj === 'symbol') {
7369
+ return true;
7370
+ }
7371
+ if (!obj || typeof obj !== 'object' || !symToString) {
7372
+ return false;
7373
+ }
7374
+ try {
7375
+ symToString.call(obj);
7376
+ return true;
7377
+ } catch (e) {}
7378
+ return false;
7379
+ }
7380
+
7381
+ function isBigInt(obj) {
7382
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
7383
+ return false;
7384
+ }
7385
+ try {
7386
+ bigIntValueOf.call(obj);
7387
+ return true;
7388
+ } catch (e) {}
7389
+ return false;
7390
+ }
7391
+
7392
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
7393
+ function has$3(obj, key) {
7394
+ return hasOwn.call(obj, key);
7395
+ }
7396
+
7397
+ function toStr(obj) {
7398
+ return objectToString.call(obj);
7399
+ }
7400
+
7401
+ function nameOf(f) {
7402
+ if (f.name) { return f.name; }
7403
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
7404
+ if (m) { return m[1]; }
7405
+ return null;
7406
+ }
7407
+
7408
+ function indexOf(xs, x) {
7409
+ if (xs.indexOf) { return xs.indexOf(x); }
7410
+ for (var i = 0, l = xs.length; i < l; i++) {
7411
+ if (xs[i] === x) { return i; }
7412
+ }
7413
+ return -1;
7414
+ }
7415
+
7416
+ function isMap(x) {
7417
+ if (!mapSize || !x || typeof x !== 'object') {
7418
+ return false;
7419
+ }
7420
+ try {
7421
+ mapSize.call(x);
7422
+ try {
7423
+ setSize.call(x);
7424
+ } catch (s) {
7425
+ return true;
7426
+ }
7427
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
7428
+ } catch (e) {}
7429
+ return false;
7430
+ }
7431
+
7432
+ function isWeakMap(x) {
7433
+ if (!weakMapHas || !x || typeof x !== 'object') {
7434
+ return false;
7435
+ }
7436
+ try {
7437
+ weakMapHas.call(x, weakMapHas);
7438
+ try {
7439
+ weakSetHas.call(x, weakSetHas);
7440
+ } catch (s) {
7441
+ return true;
7442
+ }
7443
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
7444
+ } catch (e) {}
7445
+ return false;
7446
+ }
7447
+
7448
+ function isWeakRef(x) {
7449
+ if (!weakRefDeref || !x || typeof x !== 'object') {
7450
+ return false;
7451
+ }
7452
+ try {
7453
+ weakRefDeref.call(x);
7454
+ return true;
7455
+ } catch (e) {}
7456
+ return false;
7457
+ }
7458
+
7459
+ function isSet(x) {
7460
+ if (!setSize || !x || typeof x !== 'object') {
7461
+ return false;
7462
+ }
7463
+ try {
7464
+ setSize.call(x);
7465
+ try {
7466
+ mapSize.call(x);
7467
+ } catch (m) {
7468
+ return true;
7469
+ }
7470
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
7471
+ } catch (e) {}
7472
+ return false;
7473
+ }
7474
+
7475
+ function isWeakSet(x) {
7476
+ if (!weakSetHas || !x || typeof x !== 'object') {
7477
+ return false;
7478
+ }
7479
+ try {
7480
+ weakSetHas.call(x, weakSetHas);
7481
+ try {
7482
+ weakMapHas.call(x, weakMapHas);
7483
+ } catch (s) {
7484
+ return true;
7485
+ }
7486
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
7487
+ } catch (e) {}
7488
+ return false;
7489
+ }
7490
+
7491
+ function isElement(x) {
7492
+ if (!x || typeof x !== 'object') { return false; }
7493
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
7494
+ return true;
7495
+ }
7496
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
7497
+ }
7498
+
7499
+ function inspectString(str, opts) {
7500
+ if (str.length > opts.maxStringLength) {
7501
+ var remaining = str.length - opts.maxStringLength;
7502
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
7503
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
7504
+ }
7505
+ // eslint-disable-next-line no-control-regex
7506
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
7507
+ return wrapQuotes(s, 'single', opts);
7508
+ }
7509
+
7510
+ function lowbyte(c) {
7511
+ var n = c.charCodeAt(0);
7512
+ var x = {
7513
+ 8: 'b',
7514
+ 9: 't',
7515
+ 10: 'n',
7516
+ 12: 'f',
7517
+ 13: 'r'
7518
+ }[n];
7519
+ if (x) { return '\\' + x; }
7520
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
7521
+ }
7522
+
7523
+ function markBoxed(str) {
7524
+ return 'Object(' + str + ')';
7525
+ }
7526
+
7527
+ function weakCollectionOf(type) {
7528
+ return type + ' { ? }';
7529
+ }
7530
+
7531
+ function collectionOf(type, size, entries, indent) {
7532
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
7533
+ return type + ' (' + size + ') {' + joinedEntries + '}';
7534
+ }
7535
+
7536
+ function singleLineValues(xs) {
7537
+ for (var i = 0; i < xs.length; i++) {
7538
+ if (indexOf(xs[i], '\n') >= 0) {
7539
+ return false;
7540
+ }
7541
+ }
7542
+ return true;
7543
+ }
7544
+
7545
+ function getIndent(opts, depth) {
7546
+ var baseIndent;
7547
+ if (opts.indent === '\t') {
7548
+ baseIndent = '\t';
7549
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
7550
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
7551
+ } else {
7552
+ return null;
7553
+ }
7554
+ return {
7555
+ base: baseIndent,
7556
+ prev: $join.call(Array(depth + 1), baseIndent)
7557
+ };
7558
+ }
7559
+
7560
+ function indentedJoin(xs, indent) {
7561
+ if (xs.length === 0) { return ''; }
7562
+ var lineJoiner = '\n' + indent.prev + indent.base;
7563
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
7564
+ }
7565
+
7566
+ function arrObjKeys(obj, inspect) {
7567
+ var isArr = isArray$3(obj);
7568
+ var xs = [];
7569
+ if (isArr) {
7570
+ xs.length = obj.length;
7571
+ for (var i = 0; i < obj.length; i++) {
7572
+ xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
7573
+ }
7574
+ }
7575
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
7576
+ var symMap;
7577
+ if (hasShammedSymbols) {
7578
+ symMap = {};
7579
+ for (var k = 0; k < syms.length; k++) {
7580
+ symMap['$' + syms[k]] = syms[k];
7581
+ }
7582
+ }
7583
+
7584
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
7585
+ if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
7586
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
7587
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
7588
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
7589
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
7590
+ } else if ($test.call(/[^\w$]/, key)) {
7591
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
7592
+ } else {
7593
+ xs.push(key + ': ' + inspect(obj[key], obj));
7594
+ }
7595
+ }
7596
+ if (typeof gOPS === 'function') {
7597
+ for (var j = 0; j < syms.length; j++) {
7598
+ if (isEnumerable.call(obj, syms[j])) {
7599
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
7600
+ }
7601
+ }
7602
+ }
7603
+ return xs;
7604
+ }
7605
+
7606
+ var GetIntrinsic = getIntrinsic;
7607
+ var callBound = callBound$1;
7608
+ var inspect = objectInspect;
7609
+
7610
+ var $TypeError = GetIntrinsic('%TypeError%');
7611
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
7612
+ var $Map = GetIntrinsic('%Map%', true);
7613
+
7614
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
7615
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
7616
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
7617
+ var $mapGet = callBound('Map.prototype.get', true);
7618
+ var $mapSet = callBound('Map.prototype.set', true);
7619
+ var $mapHas = callBound('Map.prototype.has', true);
7620
+
7621
+ /*
7622
+ * This function traverses the list returning the node corresponding to the
7623
+ * given key.
7624
+ *
7625
+ * That node is also moved to the head of the list, so that if it's accessed
7626
+ * again we don't need to traverse the whole list. By doing so, all the recently
7627
+ * used nodes can be accessed relatively quickly.
7628
+ */
7629
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
7630
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
7631
+ if (curr.key === key) {
7632
+ prev.next = curr.next;
7633
+ curr.next = list.next;
7634
+ list.next = curr; // eslint-disable-line no-param-reassign
7635
+ return curr;
7636
+ }
7637
+ }
7638
+ };
7639
+
7640
+ var listGet = function (objects, key) {
7641
+ var node = listGetNode(objects, key);
7642
+ return node && node.value;
7643
+ };
7644
+ var listSet = function (objects, key, value) {
7645
+ var node = listGetNode(objects, key);
7646
+ if (node) {
7647
+ node.value = value;
7648
+ } else {
7649
+ // Prepend the new node to the beginning of the list
7650
+ objects.next = { // eslint-disable-line no-param-reassign
7651
+ key: key,
7652
+ next: objects.next,
7653
+ value: value
7654
+ };
7655
+ }
7656
+ };
7657
+ var listHas = function (objects, key) {
7658
+ return !!listGetNode(objects, key);
7659
+ };
7660
+
7661
+ var sideChannel = function getSideChannel() {
7662
+ var $wm;
7663
+ var $m;
7664
+ var $o;
7665
+ var channel = {
7666
+ assert: function (key) {
7667
+ if (!channel.has(key)) {
7668
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
7669
+ }
7670
+ },
7671
+ get: function (key) { // eslint-disable-line consistent-return
7672
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
7673
+ if ($wm) {
7674
+ return $weakMapGet($wm, key);
7675
+ }
7676
+ } else if ($Map) {
7677
+ if ($m) {
7678
+ return $mapGet($m, key);
7679
+ }
7680
+ } else {
7681
+ if ($o) { // eslint-disable-line no-lonely-if
7682
+ return listGet($o, key);
7683
+ }
7684
+ }
7685
+ },
7686
+ has: function (key) {
7687
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
7688
+ if ($wm) {
7689
+ return $weakMapHas($wm, key);
7690
+ }
7691
+ } else if ($Map) {
7692
+ if ($m) {
7693
+ return $mapHas($m, key);
7694
+ }
7695
+ } else {
7696
+ if ($o) { // eslint-disable-line no-lonely-if
7697
+ return listHas($o, key);
7698
+ }
7699
+ }
7700
+ return false;
7701
+ },
7702
+ set: function (key, value) {
7703
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
7704
+ if (!$wm) {
7705
+ $wm = new $WeakMap();
7706
+ }
7707
+ $weakMapSet($wm, key, value);
7708
+ } else if ($Map) {
7709
+ if (!$m) {
7710
+ $m = new $Map();
7711
+ }
7712
+ $mapSet($m, key, value);
7713
+ } else {
7714
+ if (!$o) {
7715
+ /*
7716
+ * Initialize the linked list as an empty node, so that we don't have
7717
+ * to special-case handling of the first node: we can always refer to
7718
+ * it as (previous node).next, instead of something like (list).head
7719
+ */
7720
+ $o = { key: {}, next: null };
7721
+ }
7722
+ listSet($o, key, value);
7723
+ }
7724
+ }
7725
+ };
7726
+ return channel;
7727
+ };
7728
+
7729
+ var replace = String.prototype.replace;
7730
+ var percentTwenties = /%20/g;
7731
+
7732
+ var Format = {
7733
+ RFC1738: 'RFC1738',
7734
+ RFC3986: 'RFC3986'
7735
+ };
7736
+
7737
+ var formats$3 = {
7738
+ 'default': Format.RFC3986,
7739
+ formatters: {
7740
+ RFC1738: function (value) {
7741
+ return replace.call(value, percentTwenties, '+');
7742
+ },
7743
+ RFC3986: function (value) {
7744
+ return String(value);
7745
+ }
7746
+ },
7747
+ RFC1738: Format.RFC1738,
7748
+ RFC3986: Format.RFC3986
7749
+ };
7750
+
7751
+ var formats$2 = formats$3;
7752
+
7753
+ var has$2 = Object.prototype.hasOwnProperty;
7754
+ var isArray$2 = Array.isArray;
7755
+
7756
+ var hexTable = (function () {
7757
+ var array = [];
7758
+ for (var i = 0; i < 256; ++i) {
7759
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
7760
+ }
7761
+
7762
+ return array;
7763
+ }());
7764
+
7765
+ var compactQueue = function compactQueue(queue) {
7766
+ while (queue.length > 1) {
7767
+ var item = queue.pop();
7768
+ var obj = item.obj[item.prop];
7769
+
7770
+ if (isArray$2(obj)) {
7771
+ var compacted = [];
7772
+
7773
+ for (var j = 0; j < obj.length; ++j) {
7774
+ if (typeof obj[j] !== 'undefined') {
7775
+ compacted.push(obj[j]);
7776
+ }
7777
+ }
7778
+
7779
+ item.obj[item.prop] = compacted;
7780
+ }
7781
+ }
7782
+ };
7783
+
7784
+ var arrayToObject = function arrayToObject(source, options) {
7785
+ var obj = options && options.plainObjects ? Object.create(null) : {};
7786
+ for (var i = 0; i < source.length; ++i) {
7787
+ if (typeof source[i] !== 'undefined') {
7788
+ obj[i] = source[i];
7789
+ }
7790
+ }
7791
+
7792
+ return obj;
7793
+ };
7794
+
7795
+ var merge = function merge(target, source, options) {
7796
+ /* eslint no-param-reassign: 0 */
7797
+ if (!source) {
7798
+ return target;
7799
+ }
7800
+
7801
+ if (typeof source !== 'object') {
7802
+ if (isArray$2(target)) {
7803
+ target.push(source);
7804
+ } else if (target && typeof target === 'object') {
7805
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
7806
+ target[source] = true;
7807
+ }
7808
+ } else {
7809
+ return [target, source];
7810
+ }
7811
+
7812
+ return target;
7813
+ }
7814
+
7815
+ if (!target || typeof target !== 'object') {
7816
+ return [target].concat(source);
7817
+ }
7818
+
7819
+ var mergeTarget = target;
7820
+ if (isArray$2(target) && !isArray$2(source)) {
7821
+ mergeTarget = arrayToObject(target, options);
7822
+ }
7823
+
7824
+ if (isArray$2(target) && isArray$2(source)) {
7825
+ source.forEach(function (item, i) {
7826
+ if (has$2.call(target, i)) {
7827
+ var targetItem = target[i];
7828
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
7829
+ target[i] = merge(targetItem, item, options);
7830
+ } else {
7831
+ target.push(item);
7832
+ }
7833
+ } else {
7834
+ target[i] = item;
7835
+ }
7836
+ });
7837
+ return target;
7838
+ }
7839
+
7840
+ return Object.keys(source).reduce(function (acc, key) {
7841
+ var value = source[key];
7842
+
7843
+ if (has$2.call(acc, key)) {
7844
+ acc[key] = merge(acc[key], value, options);
7845
+ } else {
7846
+ acc[key] = value;
7847
+ }
7848
+ return acc;
7849
+ }, mergeTarget);
7850
+ };
7851
+
7852
+ var assign = function assignSingleSource(target, source) {
7853
+ return Object.keys(source).reduce(function (acc, key) {
7854
+ acc[key] = source[key];
7855
+ return acc;
7856
+ }, target);
7857
+ };
7858
+
7859
+ var decode = function (str, decoder, charset) {
7860
+ var strWithoutPlus = str.replace(/\+/g, ' ');
7861
+ if (charset === 'iso-8859-1') {
7862
+ // unescape never throws, no try...catch needed:
7863
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
7864
+ }
7865
+ // utf-8
7866
+ try {
7867
+ return decodeURIComponent(strWithoutPlus);
7868
+ } catch (e) {
7869
+ return strWithoutPlus;
7870
+ }
7871
+ };
7872
+
7873
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
7874
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
7875
+ // It has been adapted here for stricter adherence to RFC 3986
7876
+ if (str.length === 0) {
7877
+ return str;
7878
+ }
7879
+
7880
+ var string = str;
7881
+ if (typeof str === 'symbol') {
7882
+ string = Symbol.prototype.toString.call(str);
7883
+ } else if (typeof str !== 'string') {
7884
+ string = String(str);
7885
+ }
7886
+
7887
+ if (charset === 'iso-8859-1') {
7888
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
7889
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
7890
+ });
7891
+ }
7892
+
7893
+ var out = '';
7894
+ for (var i = 0; i < string.length; ++i) {
7895
+ var c = string.charCodeAt(i);
7896
+
7897
+ if (
7898
+ c === 0x2D // -
7899
+ || c === 0x2E // .
7900
+ || c === 0x5F // _
7901
+ || c === 0x7E // ~
7902
+ || (c >= 0x30 && c <= 0x39) // 0-9
7903
+ || (c >= 0x41 && c <= 0x5A) // a-z
7904
+ || (c >= 0x61 && c <= 0x7A) // A-Z
7905
+ || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
7906
+ ) {
7907
+ out += string.charAt(i);
7908
+ continue;
7909
+ }
7910
+
7911
+ if (c < 0x80) {
7912
+ out = out + hexTable[c];
7913
+ continue;
7914
+ }
7915
+
7916
+ if (c < 0x800) {
7917
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
7918
+ continue;
7919
+ }
7920
+
7921
+ if (c < 0xD800 || c >= 0xE000) {
7922
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
7923
+ continue;
7924
+ }
7925
+
7926
+ i += 1;
7927
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
7928
+ /* eslint operator-linebreak: [2, "before"] */
7929
+ out += hexTable[0xF0 | (c >> 18)]
7930
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
7931
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
7932
+ + hexTable[0x80 | (c & 0x3F)];
7933
+ }
7934
+
7935
+ return out;
7936
+ };
7937
+
7938
+ var compact = function compact(value) {
7939
+ var queue = [{ obj: { o: value }, prop: 'o' }];
7940
+ var refs = [];
7941
+
7942
+ for (var i = 0; i < queue.length; ++i) {
7943
+ var item = queue[i];
7944
+ var obj = item.obj[item.prop];
7945
+
7946
+ var keys = Object.keys(obj);
7947
+ for (var j = 0; j < keys.length; ++j) {
7948
+ var key = keys[j];
7949
+ var val = obj[key];
7950
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
7951
+ queue.push({ obj: obj, prop: key });
7952
+ refs.push(val);
7953
+ }
7954
+ }
7955
+ }
7956
+
7957
+ compactQueue(queue);
7958
+
7959
+ return value;
7960
+ };
7961
+
7962
+ var isRegExp = function isRegExp(obj) {
7963
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
7964
+ };
7965
+
7966
+ var isBuffer = function isBuffer(obj) {
7967
+ if (!obj || typeof obj !== 'object') {
7968
+ return false;
7969
+ }
7970
+
7971
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
7972
+ };
7973
+
7974
+ var combine = function combine(a, b) {
7975
+ return [].concat(a, b);
7976
+ };
7977
+
7978
+ var maybeMap = function maybeMap(val, fn) {
7979
+ if (isArray$2(val)) {
7980
+ var mapped = [];
7981
+ for (var i = 0; i < val.length; i += 1) {
7982
+ mapped.push(fn(val[i]));
7983
+ }
7984
+ return mapped;
7985
+ }
7986
+ return fn(val);
7987
+ };
7988
+
7989
+ var utils$2 = {
7990
+ arrayToObject: arrayToObject,
7991
+ assign: assign,
7992
+ combine: combine,
7993
+ compact: compact,
7994
+ decode: decode,
7995
+ encode: encode,
7996
+ isBuffer: isBuffer,
7997
+ isRegExp: isRegExp,
7998
+ maybeMap: maybeMap,
7999
+ merge: merge
8000
+ };
8001
+
8002
+ var getSideChannel = sideChannel;
8003
+ var utils$1 = utils$2;
8004
+ var formats$1 = formats$3;
8005
+ var has$1 = Object.prototype.hasOwnProperty;
8006
+
8007
+ var arrayPrefixGenerators = {
8008
+ brackets: function brackets(prefix) {
8009
+ return prefix + '[]';
8010
+ },
8011
+ comma: 'comma',
8012
+ indices: function indices(prefix, key) {
8013
+ return prefix + '[' + key + ']';
8014
+ },
8015
+ repeat: function repeat(prefix) {
8016
+ return prefix;
8017
+ }
8018
+ };
8019
+
8020
+ var isArray$1 = Array.isArray;
8021
+ var split = String.prototype.split;
8022
+ var push = Array.prototype.push;
8023
+ var pushToArray = function (arr, valueOrArray) {
8024
+ push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
8025
+ };
8026
+
8027
+ var toISO = Date.prototype.toISOString;
8028
+
8029
+ var defaultFormat = formats$1['default'];
8030
+ var defaults$1 = {
8031
+ addQueryPrefix: false,
8032
+ allowDots: false,
8033
+ charset: 'utf-8',
8034
+ charsetSentinel: false,
8035
+ delimiter: '&',
8036
+ encode: true,
8037
+ encoder: utils$1.encode,
8038
+ encodeValuesOnly: false,
8039
+ format: defaultFormat,
8040
+ formatter: formats$1.formatters[defaultFormat],
8041
+ // deprecated
8042
+ indices: false,
8043
+ serializeDate: function serializeDate(date) {
8044
+ return toISO.call(date);
8045
+ },
8046
+ skipNulls: false,
8047
+ strictNullHandling: false
8048
+ };
8049
+
8050
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
8051
+ return typeof v === 'string'
8052
+ || typeof v === 'number'
8053
+ || typeof v === 'boolean'
8054
+ || typeof v === 'symbol'
8055
+ || typeof v === 'bigint';
8056
+ };
8057
+
8058
+ var sentinel = {};
8059
+
8060
+ var stringify$1 = function stringify(
8061
+ object,
8062
+ prefix,
8063
+ generateArrayPrefix,
8064
+ commaRoundTrip,
8065
+ strictNullHandling,
8066
+ skipNulls,
8067
+ encoder,
8068
+ filter,
8069
+ sort,
8070
+ allowDots,
8071
+ serializeDate,
8072
+ format,
8073
+ formatter,
8074
+ encodeValuesOnly,
8075
+ charset,
8076
+ sideChannel
8077
+ ) {
8078
+ var obj = object;
8079
+
8080
+ var tmpSc = sideChannel;
8081
+ var step = 0;
8082
+ var findFlag = false;
8083
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
8084
+ // Where object last appeared in the ref tree
8085
+ var pos = tmpSc.get(object);
8086
+ step += 1;
8087
+ if (typeof pos !== 'undefined') {
8088
+ if (pos === step) {
8089
+ throw new RangeError('Cyclic object value');
8090
+ } else {
8091
+ findFlag = true; // Break while
8092
+ }
8093
+ }
8094
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
8095
+ step = 0;
8096
+ }
8097
+ }
8098
+
8099
+ if (typeof filter === 'function') {
8100
+ obj = filter(prefix, obj);
8101
+ } else if (obj instanceof Date) {
8102
+ obj = serializeDate(obj);
8103
+ } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
8104
+ obj = utils$1.maybeMap(obj, function (value) {
8105
+ if (value instanceof Date) {
8106
+ return serializeDate(value);
8107
+ }
8108
+ return value;
8109
+ });
8110
+ }
8111
+
8112
+ if (obj === null) {
8113
+ if (strictNullHandling) {
8114
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
8115
+ }
8116
+
8117
+ obj = '';
8118
+ }
8119
+
8120
+ if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
8121
+ if (encoder) {
8122
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
8123
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
8124
+ var valuesArray = split.call(String(obj), ',');
8125
+ var valuesJoined = '';
8126
+ for (var i = 0; i < valuesArray.length; ++i) {
8127
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
8128
+ }
8129
+ return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
8130
+ }
8131
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
8132
+ }
8133
+ return [formatter(prefix) + '=' + formatter(String(obj))];
8134
+ }
8135
+
8136
+ var values = [];
8137
+
8138
+ if (typeof obj === 'undefined') {
8139
+ return values;
8140
+ }
8141
+
8142
+ var objKeys;
8143
+ if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
8144
+ // we need to join elements in
8145
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
8146
+ } else if (isArray$1(filter)) {
8147
+ objKeys = filter;
8148
+ } else {
8149
+ var keys = Object.keys(obj);
8150
+ objKeys = sort ? keys.sort(sort) : keys;
8151
+ }
8152
+
8153
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
8154
+
8155
+ for (var j = 0; j < objKeys.length; ++j) {
8156
+ var key = objKeys[j];
8157
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
8158
+
8159
+ if (skipNulls && value === null) {
8160
+ continue;
8161
+ }
8162
+
8163
+ var keyPrefix = isArray$1(obj)
8164
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
8165
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
8166
+
8167
+ sideChannel.set(object, step);
8168
+ var valueSideChannel = getSideChannel();
8169
+ valueSideChannel.set(sentinel, sideChannel);
8170
+ pushToArray(values, stringify(
8171
+ value,
8172
+ keyPrefix,
8173
+ generateArrayPrefix,
8174
+ commaRoundTrip,
8175
+ strictNullHandling,
8176
+ skipNulls,
8177
+ encoder,
8178
+ filter,
8179
+ sort,
8180
+ allowDots,
8181
+ serializeDate,
8182
+ format,
8183
+ formatter,
8184
+ encodeValuesOnly,
8185
+ charset,
8186
+ valueSideChannel
8187
+ ));
8188
+ }
8189
+
8190
+ return values;
8191
+ };
8192
+
8193
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
8194
+ if (!opts) {
8195
+ return defaults$1;
8196
+ }
8197
+
8198
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
8199
+ throw new TypeError('Encoder has to be a function.');
8200
+ }
8201
+
8202
+ var charset = opts.charset || defaults$1.charset;
8203
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
8204
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
8205
+ }
8206
+
8207
+ var format = formats$1['default'];
8208
+ if (typeof opts.format !== 'undefined') {
8209
+ if (!has$1.call(formats$1.formatters, opts.format)) {
8210
+ throw new TypeError('Unknown format option provided.');
8211
+ }
8212
+ format = opts.format;
8213
+ }
8214
+ var formatter = formats$1.formatters[format];
8215
+
8216
+ var filter = defaults$1.filter;
8217
+ if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
8218
+ filter = opts.filter;
8219
+ }
8220
+
8221
+ return {
8222
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
8223
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
8224
+ charset: charset,
8225
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
8226
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
8227
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
8228
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
8229
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
8230
+ filter: filter,
8231
+ format: format,
8232
+ formatter: formatter,
8233
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
8234
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
8235
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
8236
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
8237
+ };
8238
+ };
8239
+
8240
+ var stringify_1 = function (object, opts) {
8241
+ var obj = object;
8242
+ var options = normalizeStringifyOptions(opts);
8243
+
8244
+ var objKeys;
8245
+ var filter;
8246
+
8247
+ if (typeof options.filter === 'function') {
8248
+ filter = options.filter;
8249
+ obj = filter('', obj);
8250
+ } else if (isArray$1(options.filter)) {
8251
+ filter = options.filter;
8252
+ objKeys = filter;
8253
+ }
8254
+
8255
+ var keys = [];
8256
+
8257
+ if (typeof obj !== 'object' || obj === null) {
8258
+ return '';
8259
+ }
8260
+
8261
+ var arrayFormat;
8262
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
8263
+ arrayFormat = opts.arrayFormat;
8264
+ } else if (opts && 'indices' in opts) {
8265
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
8266
+ } else {
8267
+ arrayFormat = 'indices';
8268
+ }
8269
+
8270
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
8271
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
8272
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
8273
+ }
8274
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
8275
+
8276
+ if (!objKeys) {
8277
+ objKeys = Object.keys(obj);
8278
+ }
8279
+
8280
+ if (options.sort) {
8281
+ objKeys.sort(options.sort);
8282
+ }
8283
+
8284
+ var sideChannel = getSideChannel();
8285
+ for (var i = 0; i < objKeys.length; ++i) {
8286
+ var key = objKeys[i];
8287
+
8288
+ if (options.skipNulls && obj[key] === null) {
8289
+ continue;
8290
+ }
8291
+ pushToArray(keys, stringify$1(
8292
+ obj[key],
8293
+ key,
8294
+ generateArrayPrefix,
8295
+ commaRoundTrip,
8296
+ options.strictNullHandling,
8297
+ options.skipNulls,
8298
+ options.encode ? options.encoder : null,
8299
+ options.filter,
8300
+ options.sort,
8301
+ options.allowDots,
8302
+ options.serializeDate,
8303
+ options.format,
8304
+ options.formatter,
8305
+ options.encodeValuesOnly,
8306
+ options.charset,
8307
+ sideChannel
8308
+ ));
8309
+ }
8310
+
8311
+ var joined = keys.join(options.delimiter);
8312
+ var prefix = options.addQueryPrefix === true ? '?' : '';
8313
+
8314
+ if (options.charsetSentinel) {
8315
+ if (options.charset === 'iso-8859-1') {
8316
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
8317
+ prefix += 'utf8=%26%2310003%3B&';
8318
+ } else {
8319
+ // encodeURIComponent('✓')
8320
+ prefix += 'utf8=%E2%9C%93&';
8321
+ }
8322
+ }
8323
+
8324
+ return joined.length > 0 ? prefix + joined : '';
8325
+ };
8326
+
8327
+ var utils = utils$2;
8328
+
8329
+ var has = Object.prototype.hasOwnProperty;
8330
+ var isArray = Array.isArray;
8331
+
8332
+ var defaults = {
8333
+ allowDots: false,
8334
+ allowPrototypes: false,
8335
+ allowSparse: false,
8336
+ arrayLimit: 20,
8337
+ charset: 'utf-8',
8338
+ charsetSentinel: false,
8339
+ comma: false,
8340
+ decoder: utils.decode,
8341
+ delimiter: '&',
8342
+ depth: 5,
8343
+ ignoreQueryPrefix: false,
8344
+ interpretNumericEntities: false,
8345
+ parameterLimit: 1000,
8346
+ parseArrays: true,
8347
+ plainObjects: false,
8348
+ strictNullHandling: false
8349
+ };
8350
+
8351
+ var interpretNumericEntities = function (str) {
8352
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
8353
+ return String.fromCharCode(parseInt(numberStr, 10));
8354
+ });
8355
+ };
8356
+
8357
+ var parseArrayValue = function (val, options) {
8358
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
8359
+ return val.split(',');
8360
+ }
8361
+
8362
+ return val;
8363
+ };
8364
+
8365
+ // This is what browsers will submit when the ✓ character occurs in an
8366
+ // application/x-www-form-urlencoded body and the encoding of the page containing
8367
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
8368
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
8369
+ // the ✓ character, such as us-ascii.
8370
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
8371
+
8372
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
8373
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
8374
+
8375
+ var parseValues = function parseQueryStringValues(str, options) {
8376
+ var obj = {};
8377
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
8378
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
8379
+ var parts = cleanStr.split(options.delimiter, limit);
8380
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
8381
+ var i;
8382
+
8383
+ var charset = options.charset;
8384
+ if (options.charsetSentinel) {
8385
+ for (i = 0; i < parts.length; ++i) {
8386
+ if (parts[i].indexOf('utf8=') === 0) {
8387
+ if (parts[i] === charsetSentinel) {
8388
+ charset = 'utf-8';
8389
+ } else if (parts[i] === isoSentinel) {
8390
+ charset = 'iso-8859-1';
8391
+ }
8392
+ skipIndex = i;
8393
+ i = parts.length; // The eslint settings do not allow break;
8394
+ }
8395
+ }
8396
+ }
8397
+
8398
+ for (i = 0; i < parts.length; ++i) {
8399
+ if (i === skipIndex) {
8400
+ continue;
8401
+ }
8402
+ var part = parts[i];
8403
+
8404
+ var bracketEqualsPos = part.indexOf(']=');
8405
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
8406
+
8407
+ var key, val;
8408
+ if (pos === -1) {
8409
+ key = options.decoder(part, defaults.decoder, charset, 'key');
8410
+ val = options.strictNullHandling ? null : '';
8411
+ } else {
8412
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
8413
+ val = utils.maybeMap(
8414
+ parseArrayValue(part.slice(pos + 1), options),
8415
+ function (encodedVal) {
8416
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
8417
+ }
8418
+ );
8419
+ }
8420
+
8421
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
8422
+ val = interpretNumericEntities(val);
8423
+ }
8424
+
8425
+ if (part.indexOf('[]=') > -1) {
8426
+ val = isArray(val) ? [val] : val;
8427
+ }
8428
+
8429
+ if (has.call(obj, key)) {
8430
+ obj[key] = utils.combine(obj[key], val);
8431
+ } else {
8432
+ obj[key] = val;
8433
+ }
8434
+ }
8435
+
8436
+ return obj;
8437
+ };
8438
+
8439
+ var parseObject = function (chain, val, options, valuesParsed) {
8440
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
8441
+
8442
+ for (var i = chain.length - 1; i >= 0; --i) {
8443
+ var obj;
8444
+ var root = chain[i];
8445
+
8446
+ if (root === '[]' && options.parseArrays) {
8447
+ obj = [].concat(leaf);
8448
+ } else {
8449
+ obj = options.plainObjects ? Object.create(null) : {};
8450
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
8451
+ var index = parseInt(cleanRoot, 10);
8452
+ if (!options.parseArrays && cleanRoot === '') {
8453
+ obj = { 0: leaf };
8454
+ } else if (
8455
+ !isNaN(index)
8456
+ && root !== cleanRoot
8457
+ && String(index) === cleanRoot
8458
+ && index >= 0
8459
+ && (options.parseArrays && index <= options.arrayLimit)
8460
+ ) {
8461
+ obj = [];
8462
+ obj[index] = leaf;
8463
+ } else if (cleanRoot !== '__proto__') {
8464
+ obj[cleanRoot] = leaf;
8465
+ }
8466
+ }
8467
+
8468
+ leaf = obj;
8469
+ }
8470
+
8471
+ return leaf;
8472
+ };
8473
+
8474
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
8475
+ if (!givenKey) {
8476
+ return;
8477
+ }
8478
+
8479
+ // Transform dot notation to bracket notation
8480
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
8481
+
8482
+ // The regex chunks
8483
+
8484
+ var brackets = /(\[[^[\]]*])/;
8485
+ var child = /(\[[^[\]]*])/g;
8486
+
8487
+ // Get the parent
8488
+
8489
+ var segment = options.depth > 0 && brackets.exec(key);
8490
+ var parent = segment ? key.slice(0, segment.index) : key;
8491
+
8492
+ // Stash the parent if it exists
8493
+
8494
+ var keys = [];
8495
+ if (parent) {
8496
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
8497
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
8498
+ if (!options.allowPrototypes) {
8499
+ return;
8500
+ }
8501
+ }
8502
+
8503
+ keys.push(parent);
8504
+ }
8505
+
8506
+ // Loop through children appending to the array until we hit depth
8507
+
8508
+ var i = 0;
8509
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
8510
+ i += 1;
8511
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
8512
+ if (!options.allowPrototypes) {
8513
+ return;
8514
+ }
8515
+ }
8516
+ keys.push(segment[1]);
8517
+ }
8518
+
8519
+ // If there's a remainder, just add whatever is left
8520
+
8521
+ if (segment) {
8522
+ keys.push('[' + key.slice(segment.index) + ']');
8523
+ }
8524
+
8525
+ return parseObject(keys, val, options, valuesParsed);
8526
+ };
8527
+
8528
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
8529
+ if (!opts) {
8530
+ return defaults;
8531
+ }
8532
+
8533
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
8534
+ throw new TypeError('Decoder has to be a function.');
8535
+ }
8536
+
8537
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
8538
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
8539
+ }
8540
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
8541
+
8542
+ return {
8543
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
8544
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
8545
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
8546
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
8547
+ charset: charset,
8548
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
8549
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
8550
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
8551
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
8552
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
8553
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
8554
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
8555
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
8556
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
8557
+ parseArrays: opts.parseArrays !== false,
8558
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
8559
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
8560
+ };
8561
+ };
8562
+
8563
+ var parse$1 = function (str, opts) {
8564
+ var options = normalizeParseOptions(opts);
8565
+
8566
+ if (str === '' || str === null || typeof str === 'undefined') {
8567
+ return options.plainObjects ? Object.create(null) : {};
8568
+ }
8569
+
8570
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
8571
+ var obj = options.plainObjects ? Object.create(null) : {};
8572
+
8573
+ // Iterate over the keys and setup the new object
8574
+
8575
+ var keys = Object.keys(tempObj);
8576
+ for (var i = 0; i < keys.length; ++i) {
8577
+ var key = keys[i];
8578
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
8579
+ obj = utils.merge(obj, newObj, options);
8580
+ }
8581
+
8582
+ if (options.allowSparse === true) {
8583
+ return obj;
8584
+ }
8585
+
8586
+ return utils.compact(obj);
8587
+ };
8588
+
8589
+ var stringify = stringify_1;
8590
+ var parse = parse$1;
8591
+ var formats = formats$3;
8592
+
8593
+ var lib = {
8594
+ formats: formats,
8595
+ parse: parse,
8596
+ stringify: stringify
8597
+ };
8598
+
8599
+ const fetch = params => axios.get(`${BASE_URL}/teams`, {
8600
+ params: keysToSnakeCase(params),
8601
+ paramsSerializer: params => lib.stringify(params, {
8602
+ arrayFormat: "brackets",
8603
+ encode: false
8604
+ })
8605
+ });
8606
+ const create = payload => axios.post(`${BASE_URL}/teams`, payload);
8607
+ const update = (id, payload) => axios.put(`${BASE_URL}/teams/${id}`, {
8608
+ team: payload
8609
+ });
8610
+ const bulkUpdate = payload => axios.patch(`${BASE_URL}/teams/bulk_update`, payload);
8611
+ const fetchFilterOptions = params => axios.get(`${BASE_URL}/teams/filter_options`, {
8612
+ params: keysToSnakeCase(params)
8613
+ });
8614
+ const teamsApi = {
8615
+ bulkUpdate,
8616
+ create,
8617
+ fetch,
8618
+ fetchFilterOptions,
8619
+ update
8620
+ };
8621
+
8622
+ const _excluded$1 = ["onSuccess"],
8623
+ _excluded2$1 = ["onSuccess"],
8624
+ _excluded3 = ["onSuccess"];
8625
+ function ownKeys$4(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; }
8626
+ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8627
+ const useFetchMembers = function () {
8628
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8629
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8630
+ return useQuery([QUERY_KEYS.TEAMS, params], () => teamsApi.fetch(params), _objectSpread$4({
8631
+ staleTime: DEFAULT_STALE_TIME,
8632
+ select: response => response.data || response,
8633
+ keepPreviousData: true
8634
+ }, options));
8635
+ };
8636
+ const useCreateMember = _ref => {
8637
+ let onSuccess = _ref.onSuccess,
8638
+ options = _objectWithoutProperties(_ref, _excluded$1);
8639
+ return useMutation(teamsApi.create, _objectSpread$4({
8640
+ onSuccess: response => {
8641
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8642
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8643
+ Toastr.success(response.ntmNotice || response.data.ntmNotice);
8644
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
8645
+ }
8646
+ }, options));
8647
+ };
8648
+ const useUpdateMember = _ref2 => {
8649
+ let onSuccess = _ref2.onSuccess,
8650
+ options = _objectWithoutProperties(_ref2, _excluded2$1);
8651
+ return useMutation(_ref3 => {
8652
+ let id = _ref3.id,
8653
+ payload = _ref3.payload;
8654
+ return teamsApi.update(id, payload);
8655
+ }, _objectSpread$4({
8656
+ onSuccess: response => {
8657
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8658
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8659
+ Toastr.success(response.ntmNotice || response.data.ntmNotice);
8660
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
8661
+ }
8662
+ }, options));
8663
+ };
8664
+ const useBulkUpdateMembers = _ref4 => {
8665
+ let onSuccess = _ref4.onSuccess,
8666
+ options = _objectWithoutProperties(_ref4, _excluded3);
8667
+ return useMutation(teamsApi.bulkUpdate, _objectSpread$4({
8668
+ onSuccess: response => {
8669
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8670
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8671
+ Toastr.success(response.ntmNotice || response.data.ntmNotice);
8672
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
8673
+ }
8674
+ }, options));
8675
+ };
8676
+ const refetchMembers = () => {
8677
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8678
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8679
+ };
8680
+ const useFetchFilterOptions = _ref5 => {
8681
+ let _ref5$params = _ref5.params,
8682
+ params = _ref5$params === void 0 ? {} : _ref5$params,
8683
+ _ref5$options = _ref5.options,
8684
+ options = _ref5$options === void 0 ? {} : _ref5$options;
8685
+ return useQuery([QUERY_KEYS.TEAMS_DEPENDENCIES, params], () => teamsApi.fetchFilterOptions(params), _objectSpread$4({
8686
+ staleTime: DEFAULT_STALE_TIME,
8687
+ select: response => response.data || response
8688
+ }, options));
8689
+ };
8690
+
8691
+ const FIXED_COLUMNS = ["actions"];
8692
+ const COLUMNS_DROPDOWN_PROPS = {
8693
+ label: instance.t("common.column", PLURAL)
8694
+ };
8695
+ const COLUMNS_SEARCH_PROPS = {
8696
+ placeholder: instance.t("columns.search")
8697
+ };
8698
+ const MANAGE_ROLES_BUTTON_LABEL = instance.t("common.manage_", {
8699
+ what: instance.t("common.role", PLURAL).toLocaleLowerCase()
8700
+ });
8701
+
8702
+ const Header = _ref => {
8703
+ var _permissions$create, _config$header;
8704
+ let config = _ref.config,
8705
+ _ref$isEmptyState = _ref.isEmptyState,
8706
+ isEmptyState = _ref$isEmptyState === void 0 ? false : _ref$isEmptyState,
8707
+ metaName = _ref.metaName,
8708
+ _ref$onClick = _ref.onClick,
8709
+ onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
8710
+ permissions = _ref.permissions,
8711
+ rolesButtonProps = _ref.rolesButtonProps;
8712
+ const isRolesButtonVisible = !!rolesButtonProps;
8713
+ const hasCreatePermission = (_permissions$create = permissions === null || permissions === void 0 ? void 0 : permissions.create) !== null && _permissions$create !== void 0 ? _permissions$create : hasPermission(MANAGE_MEMBER_PERMISSIONS);
8714
+ const isOtherActionBlockVisible = !!(config !== null && config !== void 0 && (_config$header = config.header) !== null && _config$header !== void 0 && _config$header.otherActionBlock) && !isEmptyState;
8715
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isOtherActionBlockVisible && config.header.otherActionBlock(), isRolesButtonVisible ? /*#__PURE__*/React.createElement(Button, _extends({
8716
+ "data-cy": "ntm-manage-roles-button",
8717
+ label: MANAGE_ROLES_BUTTON_LABEL,
8718
+ style: "secondary"
8719
+ }, rolesButtonProps)) : null, /*#__PURE__*/React.createElement(Tooltip, {
8720
+ content: instance.t("tooltips.noPermissionToAddMember"),
8721
+ disabled: hasCreatePermission,
8722
+ position: "bottom"
8723
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Button, {
8724
+ "data-cy": "ntm-add-member-button",
8725
+ disabled: !hasCreatePermission,
8726
+ label: instance.t("common.add_", {
8727
+ what: metaName(SINGULAR).toLocaleLowerCase()
8728
+ }),
8729
+ onClick: onClick
8730
+ }))));
8731
+ };
8732
+
8733
+ const useDebounce = function (value) {
8734
+ let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
8735
+ const _useState = useState(value),
8736
+ _useState2 = _slicedToArray$1(_useState, 2),
8737
+ debouncedValue = _useState2[0],
8738
+ setDebouncedValue = _useState2[1];
8739
+ useEffect(() => {
8740
+ const handler = setTimeout(() => setDebouncedValue(value), delay);
8741
+ return () => clearTimeout(handler);
8742
+ }, [value, delay]);
8743
+ return debouncedValue;
8744
+ };
8745
+
8746
+ const getStorageValue = (key, defaultValue) => {
8747
+ const saved = localStorage.getItem(key);
6510
8748
  return JSON.parse(saved) || defaultValue;
6511
8749
  };
6512
8750
  const useLocalStorage = (key, defaultValue) => {
6513
8751
  const _useState = useState(() => getStorageValue(key, defaultValue)),
6514
- _useState2 = _slicedToArray(_useState, 2),
8752
+ _useState2 = _slicedToArray$1(_useState, 2),
6515
8753
  storedValue = _useState2[0],
6516
8754
  setStoredValue = _useState2[1];
6517
8755
  const setValue = value => {
@@ -6525,27 +8763,11 @@ const useLocalStorage = (key, defaultValue) => {
6525
8763
  return [storedValue, setValue];
6526
8764
  };
6527
8765
 
6528
- const matchesImpl = function (pattern, object) {
6529
- let __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
6530
- if (object === pattern) return true;
6531
- if (typeof pattern === "function" && pattern(object, __parent)) return true;
6532
- if (isNil(pattern) || isNil(object)) return false;
6533
- if (typeof pattern !== "object") return false;
6534
- return Object.entries(pattern).every(_ref => {
6535
- let _ref2 = _slicedToArray(_ref, 2),
6536
- key = _ref2[0],
6537
- value = _ref2[1];
6538
- return matchesImpl(value, object[key], __parent);
6539
- });
6540
- };
6541
- const matches = curry((pattern, object) => matchesImpl(pattern, object));
6542
- const isNotEmpty = complement(isEmpty);
6543
- const removeBy = curry((pattern, array) => array.filter(complement(matches(pattern))));
6544
8766
  const removeFixedColumns = (fixedColumns, columnData) => removeBy({
6545
8767
  dataIndex: includes(__, fixedColumns)
6546
8768
  }, columnData);
6547
- const filterBySearchTerm$1 = (searchTerm, columns) => filter(_ref3 => {
6548
- let title = _ref3.title;
8769
+ const filterBySearchTerm$1 = (searchTerm, columns) => filter(_ref => {
8770
+ let title = _ref.title;
6549
8771
  return includes(trim(toLower(searchTerm)), trim(toLower(title)));
6550
8772
  }, columns);
6551
8773
 
@@ -6574,11 +8796,11 @@ const Columns = _ref => {
6574
8796
  Menu = Dropdown.Menu,
6575
8797
  MenuItem = Dropdown.MenuItem;
6576
8798
  const _useLocalStorage = useLocalStorage(localStorageKey, []),
6577
- _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
8799
+ _useLocalStorage2 = _slicedToArray$1(_useLocalStorage, 2),
6578
8800
  hiddenColumns = _useLocalStorage2[0],
6579
8801
  setHiddenColumns = _useLocalStorage2[1];
6580
8802
  const _useState = useState(""),
6581
- _useState2 = _slicedToArray(_useState, 2),
8803
+ _useState2 = _slicedToArray$1(_useState, 2),
6582
8804
  searchTerm = _useState2[0],
6583
8805
  setSearchTerm = _useState2[1];
6584
8806
  const columns = removeFixedColumns(fixedColumns, columnData);
@@ -6640,8 +8862,14 @@ const filterBySearchTerm = (searchTerm, roles) => filter(_ref => {
6640
8862
  let name = _ref.name;
6641
8863
  return includes(trim(toLower(searchTerm)), trim(toLower(name)));
6642
8864
  }, roles);
6643
- const getActivateButtonVisible = selectedRows => selectedRows.active.some(active => active === false);
6644
- const getDeactivatedButtonVisible = selectedRows => selectedRows.active.some(active => active === true);
8865
+ const getActivateButtonVisible = (selectedRows, config) => {
8866
+ var _config$hiddenBulkAct;
8867
+ return selectedRows.active.some(active => active === false) && !(config !== null && config !== void 0 && (_config$hiddenBulkAct = config.hiddenBulkActions) !== null && _config$hiddenBulkAct !== void 0 && _config$hiddenBulkAct.includes("activate"));
8868
+ };
8869
+ const getDeactivatedButtonVisible = (selectedRows, config) => {
8870
+ var _config$hiddenBulkAct2;
8871
+ return selectedRows.active.some(active => active === true) && !(config !== null && config !== void 0 && (_config$hiddenBulkAct2 = config.hiddenBulkActions) !== null && _config$hiddenBulkAct2 !== void 0 && _config$hiddenBulkAct2.includes("deactivate"));
8872
+ };
6645
8873
 
6646
8874
  const Menu$2 = Dropdown.Menu,
6647
8875
  MenuItem$1 = Dropdown.MenuItem;
@@ -6653,11 +8881,11 @@ const RolesDropdown = _ref => {
6653
8881
  _ref$roles = _ref.roles,
6654
8882
  roles = _ref$roles === void 0 ? [] : _ref$roles;
6655
8883
  const _useState = useState(false),
6656
- _useState2 = _slicedToArray(_useState, 2),
8884
+ _useState2 = _slicedToArray$1(_useState, 2),
6657
8885
  isDropdownOpen = _useState2[0],
6658
8886
  setIsDropdownOpen = _useState2[1];
6659
8887
  const _useState3 = useState(""),
6660
- _useState4 = _slicedToArray(_useState3, 2),
8888
+ _useState4 = _slicedToArray$1(_useState3, 2),
6661
8889
  searchTerm = _useState4[0],
6662
8890
  setSearchTerm = _useState4[1];
6663
8891
  const filteredRoles = filterBySearchTerm(searchTerm, roles);
@@ -6703,7 +8931,7 @@ const RolesDropdown = _ref => {
6703
8931
  prefix: /*#__PURE__*/React.createElement(Search, null),
6704
8932
  type: "search",
6705
8933
  value: searchTerm
6706
- })), isNotEmpty$1(filteredRoles) ? filteredRoles.map(_ref3 => {
8934
+ })), isNotEmpty(filteredRoles) ? filteredRoles.map(_ref3 => {
6707
8935
  let id = _ref3.id,
6708
8936
  name = _ref3.name;
6709
8937
  return /*#__PURE__*/React.createElement(MenuItem$1.Button, {
@@ -6740,7 +8968,7 @@ const MEMBER_FILTER = {
6740
8968
  const DEFAULT_RADIX = 10;
6741
8969
  const DEFAULT_MEMBER_FILTER = MEMBER_FILTER.ACTIVE.value;
6742
8970
  const DEFAULT_PAGE_NUMBER = 1;
6743
- const DEFAULT_PAGE_SIZE = 15;
8971
+ const DEFAULT_PAGE_SIZE = 50;
6744
8972
  const DROPDOWN_BUTTON_PROPS = {
6745
8973
  "data-cy": "ntm-members-table-row-dropdown-button",
6746
8974
  size: "medium"
@@ -6755,17 +8983,32 @@ const DEFAULT_FILTER_VALUES = {
6755
8983
  results: clamp(10, 100, parseInt(URL_PARAMS.get("results"))) || DEFAULT_PAGE_SIZE,
6756
8984
  category: ((_URLSearchParams$get = new URLSearchParams(window.location.search).get("filter")) === null || _URLSearchParams$get === void 0 ? void 0 : _URLSearchParams$get.toUpperCase()) || DEFAULT_MEMBER_FILTER,
6757
8985
  search: "",
6758
- sort_by: "",
6759
- sort_direction: ""
8986
+ sortBy: "",
8987
+ sortDirection: "",
8988
+ neetoFilters: []
6760
8989
  };
6761
8990
  const DEFAULT_SELECTED_ROWS = {
6762
8991
  active: [],
6763
8992
  emails: [],
6764
8993
  keys: []
6765
8994
  };
8995
+ const DEFAULT_NEETO_FILTERS_COLUMNS = [{
8996
+ key: "email",
8997
+ node: "email",
8998
+ label: instance.t("common.email", SINGULAR),
8999
+ type: "multi_option",
9000
+ values: []
9001
+ }, {
9002
+ key: "role",
9003
+ node: "organization_role.name",
9004
+ model: "OrganizationRole",
9005
+ label: instance.t("common.role", SINGULAR),
9006
+ type: "multi_option",
9007
+ values: []
9008
+ }];
6766
9009
 
6767
9010
  const Left = _ref => {
6768
- var _selectedRows$keys, _selectedRows$keys2, _config$permissions$u, _config$permissions, _config$otherBulkActi;
9011
+ var _selectedRows$keys, _selectedRows$keys2, _config$permissions$u, _config$permissions, _config$hiddenBulkAct, _config$otherBulkActi;
6769
9012
  let config = _ref.config,
6770
9013
  filteredCount = _ref.filteredCount,
6771
9014
  metaName = _ref.metaName,
@@ -6773,7 +9016,7 @@ const Left = _ref => {
6773
9016
  selectedRows = _ref.selectedRows,
6774
9017
  setSelectedRows = _ref.setSelectedRows,
6775
9018
  totalCount = _ref.totalCount;
6776
- const hasSelectedRows = isNotEmpty$1(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.keys);
9019
+ const hasSelectedRows = isNotEmpty(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.keys);
6777
9020
  const pluralizedByFilterCount = metaName({
6778
9021
  count: filteredCount
6779
9022
  }).toLocaleLowerCase();
@@ -6831,15 +9074,15 @@ const Left = _ref => {
6831
9074
  buttonStyle: "secondary",
6832
9075
  disabled: !hasUpdatePermission,
6833
9076
  label: instance.t("common.takeAction")
6834
- }, /*#__PURE__*/React.createElement(Menu, null, getDeactivatedButtonVisible(selectedRows) && /*#__PURE__*/React.createElement(MenuItem.Button, {
9077
+ }, /*#__PURE__*/React.createElement(Menu, null, getDeactivatedButtonVisible(selectedRows, config) && /*#__PURE__*/React.createElement(MenuItem.Button, {
6835
9078
  "data-cy": "ntm-deactivate-members-button",
6836
9079
  disabled: !hasUpdatePermission,
6837
9080
  onClick: () => handleDeactivateMembers()
6838
- }, instance.t("common.deactivate")), getActivateButtonVisible(selectedRows) && /*#__PURE__*/React.createElement(MenuItem.Button, {
9081
+ }, instance.t("common.deactivate")), getActivateButtonVisible(selectedRows, config) && /*#__PURE__*/React.createElement(MenuItem.Button, {
6839
9082
  "data-cy": "ntm-activate-members-button",
6840
9083
  disabled: !hasUpdatePermission,
6841
9084
  onClick: () => handleActivateMembers()
6842
- }, instance.t("common.activate")), /*#__PURE__*/React.createElement(RolesDropdown, {
9085
+ }, instance.t("common.activate")), !(config !== null && config !== void 0 && (_config$hiddenBulkAct = config.hiddenBulkActions) !== null && _config$hiddenBulkAct !== void 0 && _config$hiddenBulkAct.includes("role")) && /*#__PURE__*/React.createElement(RolesDropdown, {
6843
9086
  handleRoleChange: handleRoleChange,
6844
9087
  hasUpdatePermission: hasUpdatePermission,
6845
9088
  roles: roles
@@ -6847,8 +9090,12 @@ const Left = _ref => {
6847
9090
  };
6848
9091
  const Right = _ref2 => {
6849
9092
  let columns = _ref2.columns,
6850
- setColumnData = _ref2.setColumnData;
6851
- return /*#__PURE__*/React.createElement(Columns, {
9093
+ setColumnData = _ref2.setColumnData,
9094
+ filterColumns = _ref2.filterColumns,
9095
+ handleFilterChange = _ref2.handleFilterChange,
9096
+ setIsFiltersPaneOpen = _ref2.setIsFiltersPaneOpen,
9097
+ isFiltersPaneOpen = _ref2.isFiltersPaneOpen;
9098
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Columns, {
6852
9099
  columnData: columns,
6853
9100
  dropdownProps: COLUMNS_DROPDOWN_PROPS,
6854
9101
  fixedColumns: FIXED_COLUMNS,
@@ -6856,7 +9103,15 @@ const Right = _ref2 => {
6856
9103
  noColumnMessage: instance.t("columns.noColumnsFound"),
6857
9104
  onChange: setColumnData,
6858
9105
  searchProps: COLUMNS_SEARCH_PROPS
6859
- });
9106
+ }), /*#__PURE__*/React.createElement(Filters, {
9107
+ columns: filterColumns,
9108
+ onChange: filters => handleFilterChange({
9109
+ neetoFilters: filters,
9110
+ page: DEFAULT_PAGE_NUMBER
9111
+ }),
9112
+ isOpen: isFiltersPaneOpen,
9113
+ setIsOpen: setIsFiltersPaneOpen
9114
+ }));
6860
9115
  };
6861
9116
  const SubHeader = {
6862
9117
  Left,
@@ -6867,7 +9122,11 @@ function commonjsRequire(path) {
6867
9122
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
6868
9123
  }
6869
9124
 
6870
- var pluralize$1 = {exports: {}};
9125
+ var pluralizeExports = {};
9126
+ var pluralize$1 = {
9127
+ get exports(){ return pluralizeExports; },
9128
+ set exports(v){ pluralizeExports = v; },
9129
+ };
6871
9130
 
6872
9131
  /* global define */
6873
9132
 
@@ -7370,10 +9629,8 @@ var pluralize$1 = {exports: {}};
7370
9629
  });
7371
9630
  } (pluralize$1));
7372
9631
 
7373
- var pluralize = pluralize$1.exports;
9632
+ var pluralize = pluralizeExports;
7374
9633
 
7375
- 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; }
7376
- 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; }
7377
9634
  const Menu$1 = Dropdown.Menu,
7378
9635
  MenuItem = Dropdown.MenuItem;
7379
9636
  const renderNameColumn = (_ref, diplayStatusTag) => {
@@ -7531,9 +9788,15 @@ const renderUpdateAlert = (field, props) => {
7531
9788
  }
7532
9789
  return field === "title" ? getDefaultAlertTitle(props) : getDefaultAlertMessage(props);
7533
9790
  };
7534
- const getSearchParams = (page, filter) => new URLSearchParams(_objectSpread$3(_objectSpread$3({}, page), {}, {
7535
- filter: filter.toLowerCase()
7536
- })).toString();
9791
+ const getSearchParams = (_ref9, filter) => {
9792
+ let page = _ref9.page,
9793
+ results = _ref9.results;
9794
+ const searchParams = new URLSearchParams(window.location.search);
9795
+ searchParams.set("page", page);
9796
+ searchParams.set("results", results);
9797
+ searchParams.set("filter", filter.toLowerCase());
9798
+ return searchParams.toString();
9799
+ };
7537
9800
  const handlePageChange = (setFilters, filter) => (page, results) => {
7538
9801
  const pageParams = {
7539
9802
  page,
@@ -7551,7 +9814,31 @@ const getMetaName = curry((metaName, count) => {
7551
9814
  const translationWord = `metaNames.${singularizedMetaName}`;
7552
9815
  return instance.exists(translationWord, count) ? instance.t(translationWord, count) : pluralize(capitalize(singularizedMetaName), count.count);
7553
9816
  });
7554
- const clearSelectedMembers = (previousCategory, currentCategory) => isNotEqual(previousCategory, currentCategory) && isNotEqual(currentCategory, "ALL");
9817
+ const clearSelectedMembers = (previousCategory, currentCategory) => notEquals(previousCategory, currentCategory) && notEquals(currentCategory, "ALL");
9818
+ const buildFilterColumns = _ref10 => {
9819
+ let _ref10$options = _ref10.options,
9820
+ _ref10$options$emails = _ref10$options.emails,
9821
+ emails = _ref10$options$emails === void 0 ? [] : _ref10$options$emails,
9822
+ _ref10$options$organi = _ref10$options.organizationRoles,
9823
+ organizationRoles = _ref10$options$organi === void 0 ? [] : _ref10$options$organi,
9824
+ _ref10$emailConfig = _ref10.emailConfig,
9825
+ setSearchTerm = _ref10$emailConfig.setSearchTerm,
9826
+ isLoading = _ref10$emailConfig.isLoading;
9827
+ const columnValues = {
9828
+ email: emails.map(toLabelAndValue),
9829
+ role: organizationRoles.map(toLabelAndValue)
9830
+ };
9831
+ return DEFAULT_NEETO_FILTERS_COLUMNS.map(column => {
9832
+ const values = columnValues[column.key];
9833
+ if (column.key === "role") return assoc("values", values, column);
9834
+ const emailConfig = {
9835
+ values,
9836
+ isLoading,
9837
+ onInputChange: setSearchTerm
9838
+ };
9839
+ return mergeLeft(emailConfig, column);
9840
+ });
9841
+ };
7555
9842
 
7556
9843
  const _excluded = ["className", "children"],
7557
9844
  _excluded2 = ["className", "children"];
@@ -7575,15 +9862,15 @@ Page.Header = PageWrapper;
7575
9862
  Page.Body = PageWrapper;
7576
9863
  Page.Footer = PageWrapper;
7577
9864
 
7578
- 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; }
7579
- 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; }
9865
+ 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; }
9866
+ 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; }
7580
9867
  const MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA = {
7581
9868
  emails: yup.array().min(1, instance.t("validations.minOneEmail")).test("are-all-emails-valid", instance.t("validations.validEmail"), emails => emails.every(prop("valid"))).nullable()
7582
9869
  };
7583
9870
  const ROLES_RADIO_GROUP_VALIDATION_SCHEMA = {
7584
9871
  role: yup.string().required(instance.t("validations.roleRequired"))
7585
9872
  };
7586
- const VALIDATION_SCHEMA$1 = yup.object().shape(_objectSpread$2(_objectSpread$2({}, MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA));
9873
+ const VALIDATION_SCHEMA$1 = yup.object().shape(_objectSpread$3(_objectSpread$3({}, MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA));
7587
9874
  const FILTER_INVALID_EMAILS = {
7588
9875
  label: instance.t("validations.filterInvalidEmails")
7589
9876
  };
@@ -7702,8 +9989,8 @@ RolesRadioGroup.defaultProps = {
7702
9989
  roles: []
7703
9990
  };
7704
9991
 
7705
- 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; }
7706
- 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; }
9992
+ 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; }
9993
+ 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; }
7707
9994
  const ManageMember = _ref => {
7708
9995
  var _config$permissions$v, _config$permissions, _config$manageMember;
7709
9996
  let config = _ref.config,
@@ -7715,11 +10002,11 @@ const ManageMember = _ref => {
7715
10002
  _ref$componentConfig = _ref.componentConfig,
7716
10003
  componentConfig = _ref$componentConfig === void 0 ? {} : _ref$componentConfig;
7717
10004
  const _useState = useState(false),
7718
- _useState2 = _slicedToArray(_useState, 2),
10005
+ _useState2 = _slicedToArray$1(_useState, 2),
7719
10006
  hasSubmitted = _useState2[0],
7720
10007
  setHasSubmitted = _useState2[1];
7721
10008
  const formReference = useRef(null);
7722
- const manageMemberComponentConfig = _objectSpread$1(_objectSpread$1({}, DEFAULT_COMPONENT_CONFIG), componentConfig);
10009
+ const manageMemberComponentConfig = _objectSpread$2(_objectSpread$2({}, DEFAULT_COMPONENT_CONFIG), componentConfig);
7723
10010
  const Component = MEMBERS_FORM_COMPONENT_MAPPER[manageMemberComponentConfig.type || "pane"];
7724
10011
  const handleClose = () => {
7725
10012
  onComplete();
@@ -7788,7 +10075,7 @@ const ManageMember = _ref => {
7788
10075
  weight: "semibold"
7789
10076
  }, getTitle())), config !== null && config !== void 0 && (_config$manageMember = config.manageMember) !== null && _config$manageMember !== void 0 && _config$manageMember.component ? config.manageMember.component(manageMemberProps) : /*#__PURE__*/React.createElement(Form, {
7790
10077
  ref: formReference,
7791
- formikProps: _objectSpread$1(_objectSpread$1({}, MANAGE_MEMBERS_FORMIK_PROPS), {}, {
10078
+ formikProps: _objectSpread$2(_objectSpread$2({}, MANAGE_MEMBERS_FORMIK_PROPS), {}, {
7792
10079
  initialValues: renderInitialValues(selectedMember, rolesList),
7793
10080
  onSubmit: handleAddMember,
7794
10081
  validateOnBlur: hasSubmitted,
@@ -7851,33 +10138,98 @@ const Menu = _ref => {
7851
10138
  })), (config === null || config === void 0 ? void 0 : config.otherMenuElements) && config.otherMenuElements());
7852
10139
  };
7853
10140
 
10141
+ 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; }
10142
+ 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; }
10143
+ const useFilters = _ref => {
10144
+ let config = _ref.config;
10145
+ const metaName = getMetaName((config === null || config === void 0 ? void 0 : config.metaName) || "member");
10146
+ const defaultNeetoFilters = buildFiltersFromURL(DEFAULT_NEETO_FILTERS_COLUMNS);
10147
+ const _useState = useState(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_FILTER_VALUES), defaultNeetoFilters), config === null || config === void 0 ? void 0 : config.defaultFilterValues)),
10148
+ _useState2 = _slicedToArray$1(_useState, 2),
10149
+ filters = _useState2[0],
10150
+ setFilters = _useState2[1];
10151
+ const _useState3 = useState(""),
10152
+ _useState4 = _slicedToArray$1(_useState3, 2),
10153
+ emailSearchTerm = _useState4[0],
10154
+ setEmailSearchTerm = _useState4[1];
10155
+ const debouncedSearch = useDebounce(filters.search, 750);
10156
+ const debouncedEmailSearchTerm = useDebounce(emailSearchTerm, 750);
10157
+ const shouldFetchFilterOptions = isNil(config === null || config === void 0 ? void 0 : config.filterColumns);
10158
+ const _useFetchFilterOption = useFetchFilterOptions({
10159
+ params: {
10160
+ emailSearchTerm: debouncedEmailSearchTerm
10161
+ },
10162
+ options: {
10163
+ enabled: shouldFetchFilterOptions
10164
+ }
10165
+ }),
10166
+ _useFetchFilterOption2 = _useFetchFilterOption.data,
10167
+ filterOptions = _useFetchFilterOption2 === void 0 ? {} : _useFetchFilterOption2,
10168
+ isFilterOptionsLoading = _useFetchFilterOption.isLoading;
10169
+ const filterColumns = shouldFetchFilterOptions ? buildFilterColumns({
10170
+ options: filterOptions,
10171
+ emailConfig: {
10172
+ setSearchTerm: setEmailSearchTerm,
10173
+ isLoading: isFilterOptionsLoading
10174
+ }
10175
+ }) : config === null || config === void 0 ? void 0 : config.filterColumns;
10176
+ const searchProps = {
10177
+ "data-cy": "ntm-search-members-input",
10178
+ onChange: _ref2 => {
10179
+ let value = _ref2.target.value;
10180
+ return setFilters(mergeLeft({
10181
+ search: value,
10182
+ page: DEFAULT_PAGE_NUMBER
10183
+ }));
10184
+ },
10185
+ placeholder: instance.t("common.search_", {
10186
+ what: metaName(PLURAL).toLocaleLowerCase()
10187
+ }),
10188
+ value: filters.search
10189
+ };
10190
+ return {
10191
+ filters,
10192
+ setFilters,
10193
+ filterColumns,
10194
+ debouncedSearch,
10195
+ searchProps
10196
+ };
10197
+ };
10198
+
7854
10199
  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; }
7855
10200
  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; }
7856
10201
  const TeamMembers = _ref => {
7857
- var _config$permissions$v, _config$permissions, _config$permissions$v2, _config$permissions2, _config$fetchApiRespo, _filters$category, _config$table, _config$table$onDropd;
10202
+ var _config$permissions$v, _config$permissions, _config$permissions$v2, _config$permissions2, _config$fetchApiRespo, _filters$category, _config$table, _config$table$onDropd, _config$header;
7858
10203
  let config = _ref.config;
7859
10204
  const metaName = getMetaName((config === null || config === void 0 ? void 0 : config.metaName) || "member");
7860
10205
  const _useState = useState(DEFAULT_IS_OPEN_VALUES),
7861
- _useState2 = _slicedToArray(_useState, 2),
10206
+ _useState2 = _slicedToArray$1(_useState, 2),
7862
10207
  isOpen = _useState2[0],
7863
10208
  setIsOpen = _useState2[1];
7864
- const _useState3 = useState(DEFAULT_FILTER_VALUES),
7865
- _useState4 = _slicedToArray(_useState3, 2),
7866
- filters = _useState4[0],
7867
- setFilters = _useState4[1];
7868
- const _useState5 = useState(null),
7869
- _useState6 = _slicedToArray(_useState5, 2),
7870
- selectedMember = _useState6[0],
7871
- setSelectedMember = _useState6[1];
7872
- const debouncedSearch = useDebounce(filters.search, 750);
7873
- const _useState7 = useState([]),
7874
- _useState8 = _slicedToArray(_useState7, 2),
7875
- columnData = _useState8[0],
7876
- setColumnData = _useState8[1];
7877
- const _useState9 = useState(DEFAULT_SELECTED_ROWS),
7878
- _useState10 = _slicedToArray(_useState9, 2),
7879
- selectedRows = _useState10[0],
7880
- setSelectedRows = _useState10[1];
10209
+ const _useState3 = useState(null),
10210
+ _useState4 = _slicedToArray$1(_useState3, 2),
10211
+ selectedMember = _useState4[0],
10212
+ setSelectedMember = _useState4[1];
10213
+ const _useState5 = useState([]),
10214
+ _useState6 = _slicedToArray$1(_useState5, 2),
10215
+ columnData = _useState6[0],
10216
+ setColumnData = _useState6[1];
10217
+ const _useState7 = useState(DEFAULT_SELECTED_ROWS),
10218
+ _useState8 = _slicedToArray$1(_useState7, 2),
10219
+ selectedRows = _useState8[0],
10220
+ setSelectedRows = _useState8[1];
10221
+ const _useState9 = useState(false),
10222
+ _useState10 = _slicedToArray$1(_useState9, 2),
10223
+ isFiltersPaneOpen = _useState10[0],
10224
+ setIsFiltersPaneOpen = _useState10[1];
10225
+ const _useFilters = useFilters({
10226
+ config
10227
+ }),
10228
+ filters = _useFilters.filters,
10229
+ setFilters = _useFilters.setFilters,
10230
+ filterColumns = _useFilters.filterColumns,
10231
+ debouncedSearch = _useFilters.debouncedSearch,
10232
+ searchProps = _useFilters.searchProps;
7881
10233
  const _useFetchMembers = useFetchMembers(_objectSpread(_objectSpread({}, filters), {}, {
7882
10234
  search: debouncedSearch.trim(),
7883
10235
  category: filters.category.toLowerCase()
@@ -7905,20 +10257,6 @@ const TeamMembers = _ref => {
7905
10257
  team
7906
10258
  });
7907
10259
  const currentCategoryCount = team === null || team === void 0 ? void 0 : team.perCategoryCount[filters === null || filters === void 0 ? void 0 : (_filters$category = filters.category) === null || _filters$category === void 0 ? void 0 : _filters$category.toLowerCase()];
7908
- const searchProps = {
7909
- "data-cy": "ntm-search-members-input",
7910
- onChange: _ref3 => {
7911
- let value = _ref3.target.value;
7912
- return setFilters(mergeLeft({
7913
- search: value,
7914
- page: DEFAULT_PAGE_NUMBER
7915
- }));
7916
- },
7917
- placeholder: instance.t("common.search_", {
7918
- what: metaName(PLURAL).toLocaleLowerCase()
7919
- }),
7920
- value: filters.search
7921
- };
7922
10260
  const updateMemberAlertProps = {
7923
10261
  member: selectedMember,
7924
10262
  metaName,
@@ -7969,10 +10307,14 @@ const TeamMembers = _ref => {
7969
10307
  clearSelectedMembers(filters.category, filter) && setSelectedRows(DEFAULT_SELECTED_ROWS);
7970
10308
  handlePageChange(setFilters, filter)(DEFAULT_PAGE_NUMBER, filters.results);
7971
10309
  };
10310
+ const handleNeetoFilterChange = filter => {
10311
+ setFilters(mergeLeft(filter));
10312
+ clearSelectedMembers(filters.category, filter) && setSelectedRows(DEFAULT_SELECTED_ROWS);
10313
+ };
7972
10314
  const handleTableChange = (_, __, sorter) => {
7973
10315
  setFilters(mergeLeft({
7974
- sort_by: sorter.field,
7975
- sort_direction: sorter.order
10316
+ sortBy: sorter.field,
10317
+ sortDirection: sorter.order
7976
10318
  }));
7977
10319
  };
7978
10320
  const handleRowSelect = (keys, rowData) => {
@@ -8005,7 +10347,7 @@ const TeamMembers = _ref => {
8005
10347
  isMenuOpen: isOpen.menuBar,
8006
10348
  memberFilter: filters.category,
8007
10349
  metaName: metaName
8008
- }), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header$2, {
10350
+ }), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header$2, _extends({
8009
10351
  title: renderHeaderTitle(MEMBER_FILTER[filters.category].value, metaName),
8010
10352
  menuBarToggle: () => setIsOpen(state => _objectSpread(_objectSpread({}, state), {}, {
8011
10353
  menuBar: !state.menuBar
@@ -8018,7 +10360,7 @@ const TeamMembers = _ref => {
8018
10360
  permissions: config === null || config === void 0 ? void 0 : config.permissions,
8019
10361
  rolesButtonProps: config.rolesButtonProps
8020
10362
  })
8021
- }), /*#__PURE__*/React.createElement(SubHeader$1, {
10363
+ }, config === null || config === void 0 ? void 0 : (_config$header = config.header) === null || _config$header === void 0 ? void 0 : _config$header.otherProps)), /*#__PURE__*/React.createElement(SubHeader$1, {
8022
10364
  leftActionBlock: /*#__PURE__*/React.createElement(SubHeader.Left, {
8023
10365
  config: config,
8024
10366
  filteredCount: team === null || team === void 0 ? void 0 : team.membersCount,
@@ -8030,8 +10372,19 @@ const TeamMembers = _ref => {
8030
10372
  }),
8031
10373
  rightActionBlock: /*#__PURE__*/React.createElement(SubHeader.Right, {
8032
10374
  columns: columns,
8033
- setColumnData: setColumnData
10375
+ setColumnData: setColumnData,
10376
+ filterColumns: filterColumns,
10377
+ handleFilterChange: handleNeetoFilterChange,
10378
+ setIsFiltersPaneOpen: setIsFiltersPaneOpen,
10379
+ isFiltersPaneOpen: isFiltersPaneOpen
8034
10380
  })
10381
+ }), /*#__PURE__*/React.createElement(Bar, {
10382
+ columns: filterColumns,
10383
+ onChange: filters => handleNeetoFilterChange({
10384
+ neetoFilters: filters,
10385
+ page: DEFAULT_PAGE_NUMBER
10386
+ }),
10387
+ setIsPaneOpen: setIsFiltersPaneOpen
8035
10388
  }), (team === null || team === void 0 ? void 0 : team.membersCount) !== 0 ? /*#__PURE__*/React.createElement("div", {
8036
10389
  className: "ntm-members__table-wrapper"
8037
10390
  }, /*#__PURE__*/React.createElement(Table$1, {