@bigbinary/neeto-team-members-frontend 2.4.18 → 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/README.md +2 -2
- package/dist/index.cjs.js +2433 -255
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2433 -256
- package/dist/index.esm.js.map +1 -1
- package/package.json +7 -5
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { createElement, isValidElement, cloneElement, createContext, useC
|
|
|
2
2
|
import { QueryClient, QueryCache, QueryClientProvider, useQuery, useMutation } from 'react-query';
|
|
3
3
|
import { ReactQueryDevtools } from 'react-query/devtools';
|
|
4
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, head, reverse
|
|
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';
|
|
6
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
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';
|
|
@@ -11,6 +11,8 @@ import { Form, Input, Textarea, MultiEmailInput, Radio } from '@bigbinary/neetou
|
|
|
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
17
|
function _typeof$1(obj) {
|
|
16
18
|
"@babel/helpers - typeof";
|
|
@@ -400,7 +402,7 @@ var _entityMap = {
|
|
|
400
402
|
"'": ''',
|
|
401
403
|
'/': '/'
|
|
402
404
|
};
|
|
403
|
-
function escape(data) {
|
|
405
|
+
function escape$1(data) {
|
|
404
406
|
if (typeof data === 'string') {
|
|
405
407
|
return data.replace(/[&<>"'\/]/g, function (s) {
|
|
406
408
|
return _entityMap[s];
|
|
@@ -1454,7 +1456,7 @@ var Interpolator = function () {
|
|
|
1454
1456
|
escapeValue: true
|
|
1455
1457
|
};
|
|
1456
1458
|
var iOpts = options.interpolation;
|
|
1457
|
-
this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;
|
|
1459
|
+
this.escape = iOpts.escape !== undefined ? iOpts.escape : escape$1;
|
|
1458
1460
|
this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;
|
|
1459
1461
|
this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;
|
|
1460
1462
|
this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';
|
|
@@ -2630,9 +2632,9 @@ instance.loadLanguages;
|
|
|
2630
2632
|
|
|
2631
2633
|
var arr = [];
|
|
2632
2634
|
var each = arr.forEach;
|
|
2633
|
-
var slice = arr.slice;
|
|
2634
|
-
function defaults(obj) {
|
|
2635
|
-
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) {
|
|
2636
2638
|
if (source) {
|
|
2637
2639
|
for (var prop in source) {
|
|
2638
2640
|
if (obj[prop] === undefined) obj[prop] = source[prop];
|
|
@@ -2926,7 +2928,7 @@ var Browser = /*#__PURE__*/function () {
|
|
|
2926
2928
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2927
2929
|
var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2928
2930
|
this.services = services;
|
|
2929
|
-
this.options = defaults(options, this.options || {}, getDefaults$1());
|
|
2931
|
+
this.options = defaults$2(options, this.options || {}, getDefaults$1());
|
|
2930
2932
|
|
|
2931
2933
|
// backwards compatibility
|
|
2932
2934
|
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
|
@@ -3140,7 +3142,7 @@ var unescapeHtmlEntity = function unescapeHtmlEntity(m) {
|
|
|
3140
3142
|
return htmlEntities[m];
|
|
3141
3143
|
};
|
|
3142
3144
|
|
|
3143
|
-
var unescape = function unescape(text) {
|
|
3145
|
+
var unescape$1 = function unescape(text) {
|
|
3144
3146
|
return text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
3145
3147
|
};
|
|
3146
3148
|
|
|
@@ -3155,7 +3157,7 @@ var defaultOptions = {
|
|
|
3155
3157
|
transWrapTextNodes: '',
|
|
3156
3158
|
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
|
|
3157
3159
|
useSuspense: true,
|
|
3158
|
-
unescape: unescape
|
|
3160
|
+
unescape: unescape$1
|
|
3159
3161
|
};
|
|
3160
3162
|
function setDefaults() {
|
|
3161
3163
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -3945,9 +3947,10 @@ const permissionsApi = {
|
|
|
3945
3947
|
const DEFAULT_STALE_TIME = 300000; // 5 minutes
|
|
3946
3948
|
|
|
3947
3949
|
const QUERY_KEYS = {
|
|
3948
|
-
|
|
3950
|
+
PERMISSIONS: "neeto-team-members-permissions",
|
|
3949
3951
|
ROLES: "neeto-team-members-roles",
|
|
3950
|
-
|
|
3952
|
+
TEAMS: "neeto-team-members-teams",
|
|
3953
|
+
TEAMS_DEPENDENCIES: "neeto-team-members-teams-dependencies"
|
|
3951
3954
|
};
|
|
3952
3955
|
|
|
3953
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; }
|
|
@@ -4061,6 +4064,12 @@ var nullSafe = function nullSafe(func) {
|
|
|
4061
4064
|
);
|
|
4062
4065
|
};
|
|
4063
4066
|
var noop = function noop() {};
|
|
4067
|
+
var toLabelAndValue = function toLabelAndValue(string) {
|
|
4068
|
+
return {
|
|
4069
|
+
label: string,
|
|
4070
|
+
value: string
|
|
4071
|
+
};
|
|
4072
|
+
};
|
|
4064
4073
|
var isNotEmpty = /*#__PURE__*/complement(isEmpty);
|
|
4065
4074
|
var notEquals = /*#__PURE__*/curry(function (x, y) {
|
|
4066
4075
|
return x !== y;
|
|
@@ -4182,6 +4191,7 @@ const useCreateRole = _ref => {
|
|
|
4182
4191
|
options = _objectWithoutProperties(_ref, _excluded$2);
|
|
4183
4192
|
return useMutation(organizationRolesApi.create, _objectSpread$7({
|
|
4184
4193
|
onSuccess: response => {
|
|
4194
|
+
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
4185
4195
|
queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
|
|
4186
4196
|
if (!!cachedData.data && !!cachedData.data.organizationRoles) {
|
|
4187
4197
|
return modifyPath(["data", "organizationRoles"], prepend(response.data.organizationRole), cachedData);
|
|
@@ -4203,6 +4213,7 @@ const useUpdateRole = _ref2 => {
|
|
|
4203
4213
|
}, _objectSpread$7({
|
|
4204
4214
|
onSuccess: response => {
|
|
4205
4215
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
4216
|
+
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
4206
4217
|
queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
|
|
4207
4218
|
if (!!cachedData.data && !!cachedData.data.organizationRoles) {
|
|
4208
4219
|
return assocPath(["data", "organizationRoles", findIndex(propEq("id", response.data.organizationRole.id), cachedData.data.organizationRoles)], response.data.organizationRole, cachedData);
|
|
@@ -4225,6 +4236,7 @@ const useDestroyRole = _ref4 => {
|
|
|
4225
4236
|
}, _objectSpread$7({
|
|
4226
4237
|
onSuccess: response => {
|
|
4227
4238
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
4239
|
+
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
4228
4240
|
queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
|
|
4229
4241
|
if (!!cachedData.data && !!cachedData.data.organizationRoles) {
|
|
4230
4242
|
return dissocPath(["data", "organizationRoles", findIndex(propEq("id", response.data.id), cachedData.data.organizationRoles)], cachedData);
|
|
@@ -6562,226 +6574,2270 @@ function _extends() {
|
|
|
6562
6574
|
return _extends.apply(this, arguments);
|
|
6563
6575
|
}
|
|
6564
6576
|
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
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;
|
|
6578
6616
|
};
|
|
6579
6617
|
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
select: response => response.data || response,
|
|
6591
|
-
keepPreviousData: true
|
|
6592
|
-
}, options));
|
|
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();
|
|
6593
6628
|
};
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6629
|
+
|
|
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);
|
|
6602
6641
|
}
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
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);
|
|
6617
6667
|
}
|
|
6618
|
-
|
|
6619
|
-
};
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
Toastr.success(response.ntmNotice || response.data.ntmNotice);
|
|
6627
|
-
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
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;
|
|
6628
6676
|
}
|
|
6629
|
-
}, options));
|
|
6630
|
-
};
|
|
6631
|
-
const refetchMembers = () => {
|
|
6632
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
6633
|
-
};
|
|
6634
6677
|
|
|
6635
|
-
|
|
6636
|
-
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
|
|
6637
|
-
const _useState = useState(value),
|
|
6638
|
-
_useState2 = _slicedToArray$1(_useState, 2),
|
|
6639
|
-
debouncedValue = _useState2[0],
|
|
6640
|
-
setDebouncedValue = _useState2[1];
|
|
6641
|
-
useEffect(() => {
|
|
6642
|
-
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
6643
|
-
return () => clearTimeout(handler);
|
|
6644
|
-
}, [value, delay]);
|
|
6645
|
-
return debouncedValue;
|
|
6678
|
+
return bound;
|
|
6646
6679
|
};
|
|
6647
6680
|
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
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) {}
|
|
6651
6700
|
};
|
|
6652
|
-
|
|
6653
|
-
|
|
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;
|
|
6654
6909
|
};
|
|
6655
|
-
|
|
6656
|
-
what: instance.t("common.role", PLURAL).toLocaleLowerCase()
|
|
6657
|
-
});
|
|
6910
|
+
/* end adaptation */
|
|
6658
6911
|
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
what: metaName(SINGULAR).toLocaleLowerCase()
|
|
6685
|
-
}),
|
|
6686
|
-
onClick: onClick
|
|
6687
|
-
}))));
|
|
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!');
|
|
6688
6937
|
};
|
|
6689
6938
|
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
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;
|
|
6693
7020
|
};
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
const setValue = value => {
|
|
6700
|
-
if (isNil(value)) {
|
|
6701
|
-
localStorage.removeItem(key);
|
|
6702
|
-
} else {
|
|
6703
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
6704
|
-
}
|
|
6705
|
-
setStoredValue(value);
|
|
6706
|
-
};
|
|
6707
|
-
return [storedValue, setValue];
|
|
7021
|
+
|
|
7022
|
+
var callBindExports = {};
|
|
7023
|
+
var callBind$1 = {
|
|
7024
|
+
get exports(){ return callBindExports; },
|
|
7025
|
+
set exports(v){ callBindExports = v; },
|
|
6708
7026
|
};
|
|
6709
7027
|
|
|
6710
|
-
|
|
6711
|
-
dataIndex: includes(__, fixedColumns)
|
|
6712
|
-
}, columnData);
|
|
6713
|
-
const filterBySearchTerm$1 = (searchTerm, columns) => filter(_ref => {
|
|
6714
|
-
let title = _ref.title;
|
|
6715
|
-
return includes(trim(toLower(searchTerm)), trim(toLower(title)));
|
|
6716
|
-
}, columns);
|
|
7028
|
+
(function (module) {
|
|
6717
7029
|
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
_ref$checkboxProps = _ref.checkboxProps,
|
|
6721
|
-
checkboxProps = _ref$checkboxProps === void 0 ? {} : _ref$checkboxProps,
|
|
6722
|
-
_ref$columnData = _ref.columnData,
|
|
6723
|
-
columnData = _ref$columnData === void 0 ? [] : _ref$columnData,
|
|
6724
|
-
_ref$dropdownProps = _ref.dropdownProps,
|
|
6725
|
-
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
6726
|
-
_ref$fixedColumns = _ref.fixedColumns,
|
|
6727
|
-
fixedColumns = _ref$fixedColumns === void 0 ? [] : _ref$fixedColumns,
|
|
6728
|
-
_ref$isSearchable = _ref.isSearchable,
|
|
6729
|
-
isSearchable = _ref$isSearchable === void 0 ? false : _ref$isSearchable,
|
|
6730
|
-
_ref$localStorageKey = _ref.localStorageKey,
|
|
6731
|
-
localStorageKey = _ref$localStorageKey === void 0 ? "" : _ref$localStorageKey,
|
|
6732
|
-
_ref$noColumnMessage = _ref.noColumnMessage,
|
|
6733
|
-
noColumnMessage = _ref$noColumnMessage === void 0 ? "No columns found!" : _ref$noColumnMessage,
|
|
6734
|
-
_ref$onChange = _ref.onChange,
|
|
6735
|
-
onChange = _ref$onChange === void 0 ? identity : _ref$onChange,
|
|
6736
|
-
_ref$searchProps = _ref.searchProps,
|
|
6737
|
-
searchProps = _ref$searchProps === void 0 ? {} : _ref$searchProps;
|
|
6738
|
-
// @ts-ignore
|
|
6739
|
-
const Divider = Dropdown.Divider,
|
|
6740
|
-
Menu = Dropdown.Menu,
|
|
6741
|
-
MenuItem = Dropdown.MenuItem;
|
|
6742
|
-
const _useLocalStorage = useLocalStorage(localStorageKey, []),
|
|
6743
|
-
_useLocalStorage2 = _slicedToArray$1(_useLocalStorage, 2),
|
|
6744
|
-
hiddenColumns = _useLocalStorage2[0],
|
|
6745
|
-
setHiddenColumns = _useLocalStorage2[1];
|
|
6746
|
-
const _useState = useState(""),
|
|
6747
|
-
_useState2 = _slicedToArray$1(_useState, 2),
|
|
6748
|
-
searchTerm = _useState2[0],
|
|
6749
|
-
setSearchTerm = _useState2[1];
|
|
6750
|
-
const columns = removeFixedColumns(fixedColumns, columnData);
|
|
6751
|
-
const filteredColumns = filterBySearchTerm$1(searchTerm, columns);
|
|
6752
|
-
const handleChange = _ref2 => {
|
|
6753
|
-
let _ref2$target = _ref2.target,
|
|
6754
|
-
dataIndex = _ref2$target.name,
|
|
6755
|
-
checked = _ref2$target.checked;
|
|
6756
|
-
return checked ? setHiddenColumns(without([dataIndex], hiddenColumns)) : setHiddenColumns(append(dataIndex, hiddenColumns));
|
|
6757
|
-
};
|
|
6758
|
-
const handleSearch = _ref3 => {
|
|
6759
|
-
let value = _ref3.target.value;
|
|
6760
|
-
return setSearchTerm(value);
|
|
6761
|
-
};
|
|
6762
|
-
useEffect(() => {
|
|
6763
|
-
onChange(removeBy({
|
|
6764
|
-
dataIndex: includes(__, hiddenColumns)
|
|
6765
|
-
}, columnData));
|
|
6766
|
-
}, [columnData, hiddenColumns]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
7030
|
+
var bind = functionBind;
|
|
7031
|
+
var GetIntrinsic = getIntrinsic;
|
|
6767
7032
|
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
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, '"');
|
|
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('✓'), 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('✓')
|
|
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);
|
|
8748
|
+
return JSON.parse(saved) || defaultValue;
|
|
8749
|
+
};
|
|
8750
|
+
const useLocalStorage = (key, defaultValue) => {
|
|
8751
|
+
const _useState = useState(() => getStorageValue(key, defaultValue)),
|
|
8752
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
8753
|
+
storedValue = _useState2[0],
|
|
8754
|
+
setStoredValue = _useState2[1];
|
|
8755
|
+
const setValue = value => {
|
|
8756
|
+
if (isNil(value)) {
|
|
8757
|
+
localStorage.removeItem(key);
|
|
8758
|
+
} else {
|
|
8759
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
8760
|
+
}
|
|
8761
|
+
setStoredValue(value);
|
|
8762
|
+
};
|
|
8763
|
+
return [storedValue, setValue];
|
|
8764
|
+
};
|
|
8765
|
+
|
|
8766
|
+
const removeFixedColumns = (fixedColumns, columnData) => removeBy({
|
|
8767
|
+
dataIndex: includes(__, fixedColumns)
|
|
8768
|
+
}, columnData);
|
|
8769
|
+
const filterBySearchTerm$1 = (searchTerm, columns) => filter(_ref => {
|
|
8770
|
+
let title = _ref.title;
|
|
8771
|
+
return includes(trim(toLower(searchTerm)), trim(toLower(title)));
|
|
8772
|
+
}, columns);
|
|
8773
|
+
|
|
8774
|
+
const Columns = _ref => {
|
|
8775
|
+
let actionBlock = _ref.actionBlock,
|
|
8776
|
+
_ref$checkboxProps = _ref.checkboxProps,
|
|
8777
|
+
checkboxProps = _ref$checkboxProps === void 0 ? {} : _ref$checkboxProps,
|
|
8778
|
+
_ref$columnData = _ref.columnData,
|
|
8779
|
+
columnData = _ref$columnData === void 0 ? [] : _ref$columnData,
|
|
8780
|
+
_ref$dropdownProps = _ref.dropdownProps,
|
|
8781
|
+
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
8782
|
+
_ref$fixedColumns = _ref.fixedColumns,
|
|
8783
|
+
fixedColumns = _ref$fixedColumns === void 0 ? [] : _ref$fixedColumns,
|
|
8784
|
+
_ref$isSearchable = _ref.isSearchable,
|
|
8785
|
+
isSearchable = _ref$isSearchable === void 0 ? false : _ref$isSearchable,
|
|
8786
|
+
_ref$localStorageKey = _ref.localStorageKey,
|
|
8787
|
+
localStorageKey = _ref$localStorageKey === void 0 ? "" : _ref$localStorageKey,
|
|
8788
|
+
_ref$noColumnMessage = _ref.noColumnMessage,
|
|
8789
|
+
noColumnMessage = _ref$noColumnMessage === void 0 ? "No columns found!" : _ref$noColumnMessage,
|
|
8790
|
+
_ref$onChange = _ref.onChange,
|
|
8791
|
+
onChange = _ref$onChange === void 0 ? identity : _ref$onChange,
|
|
8792
|
+
_ref$searchProps = _ref.searchProps,
|
|
8793
|
+
searchProps = _ref$searchProps === void 0 ? {} : _ref$searchProps;
|
|
8794
|
+
// @ts-ignore
|
|
8795
|
+
const Divider = Dropdown.Divider,
|
|
8796
|
+
Menu = Dropdown.Menu,
|
|
8797
|
+
MenuItem = Dropdown.MenuItem;
|
|
8798
|
+
const _useLocalStorage = useLocalStorage(localStorageKey, []),
|
|
8799
|
+
_useLocalStorage2 = _slicedToArray$1(_useLocalStorage, 2),
|
|
8800
|
+
hiddenColumns = _useLocalStorage2[0],
|
|
8801
|
+
setHiddenColumns = _useLocalStorage2[1];
|
|
8802
|
+
const _useState = useState(""),
|
|
8803
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
8804
|
+
searchTerm = _useState2[0],
|
|
8805
|
+
setSearchTerm = _useState2[1];
|
|
8806
|
+
const columns = removeFixedColumns(fixedColumns, columnData);
|
|
8807
|
+
const filteredColumns = filterBySearchTerm$1(searchTerm, columns);
|
|
8808
|
+
const handleChange = _ref2 => {
|
|
8809
|
+
let _ref2$target = _ref2.target,
|
|
8810
|
+
dataIndex = _ref2$target.name,
|
|
8811
|
+
checked = _ref2$target.checked;
|
|
8812
|
+
return checked ? setHiddenColumns(without([dataIndex], hiddenColumns)) : setHiddenColumns(append(dataIndex, hiddenColumns));
|
|
8813
|
+
};
|
|
8814
|
+
const handleSearch = _ref3 => {
|
|
8815
|
+
let value = _ref3.target.value;
|
|
8816
|
+
return setSearchTerm(value);
|
|
8817
|
+
};
|
|
8818
|
+
useEffect(() => {
|
|
8819
|
+
onChange(removeBy({
|
|
8820
|
+
dataIndex: includes(__, hiddenColumns)
|
|
8821
|
+
}, columnData));
|
|
8822
|
+
}, [columnData, hiddenColumns]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
8823
|
+
|
|
8824
|
+
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
8825
|
+
buttonSize: "medium",
|
|
8826
|
+
buttonStyle: "secondary",
|
|
8827
|
+
closeOnSelect: false,
|
|
8828
|
+
label: "Columns",
|
|
8829
|
+
onClose: () => setSearchTerm(""),
|
|
8830
|
+
position: "bottom-end"
|
|
8831
|
+
}, dropdownProps), /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", null, isSearchable && /*#__PURE__*/React.createElement(Input$1, _extends({
|
|
8832
|
+
className: "neeto-ui-px-3 neeto-ui-py-2",
|
|
8833
|
+
"data-cy": "neeto-ui-columns-search",
|
|
8834
|
+
onChange: handleSearch,
|
|
8835
|
+
placeholder: "Search columns",
|
|
8836
|
+
prefix: /*#__PURE__*/React.createElement(Search, null),
|
|
8837
|
+
type: "search",
|
|
8838
|
+
value: searchTerm
|
|
8839
|
+
}, searchProps)), isNotEmpty(filteredColumns) ? filteredColumns.map(_ref4 => {
|
|
8840
|
+
let dataIndex = _ref4.dataIndex,
|
|
6785
8841
|
key = _ref4.key,
|
|
6786
8842
|
title = _ref4.title;
|
|
6787
8843
|
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
@@ -6928,13 +8984,28 @@ const DEFAULT_FILTER_VALUES = {
|
|
|
6928
8984
|
category: ((_URLSearchParams$get = new URLSearchParams(window.location.search).get("filter")) === null || _URLSearchParams$get === void 0 ? void 0 : _URLSearchParams$get.toUpperCase()) || DEFAULT_MEMBER_FILTER,
|
|
6929
8985
|
search: "",
|
|
6930
8986
|
sortBy: "",
|
|
6931
|
-
sortDirection: ""
|
|
8987
|
+
sortDirection: "",
|
|
8988
|
+
neetoFilters: []
|
|
6932
8989
|
};
|
|
6933
8990
|
const DEFAULT_SELECTED_ROWS = {
|
|
6934
8991
|
active: [],
|
|
6935
8992
|
emails: [],
|
|
6936
8993
|
keys: []
|
|
6937
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
|
+
}];
|
|
6938
9009
|
|
|
6939
9010
|
const Left = _ref => {
|
|
6940
9011
|
var _selectedRows$keys, _selectedRows$keys2, _config$permissions$u, _config$permissions, _config$hiddenBulkAct, _config$otherBulkActi;
|
|
@@ -7019,8 +9090,12 @@ const Left = _ref => {
|
|
|
7019
9090
|
};
|
|
7020
9091
|
const Right = _ref2 => {
|
|
7021
9092
|
let columns = _ref2.columns,
|
|
7022
|
-
setColumnData = _ref2.setColumnData
|
|
7023
|
-
|
|
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, {
|
|
7024
9099
|
columnData: columns,
|
|
7025
9100
|
dropdownProps: COLUMNS_DROPDOWN_PROPS,
|
|
7026
9101
|
fixedColumns: FIXED_COLUMNS,
|
|
@@ -7028,7 +9103,15 @@ const Right = _ref2 => {
|
|
|
7028
9103
|
noColumnMessage: instance.t("columns.noColumnsFound"),
|
|
7029
9104
|
onChange: setColumnData,
|
|
7030
9105
|
searchProps: COLUMNS_SEARCH_PROPS
|
|
7031
|
-
})
|
|
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
|
+
}));
|
|
7032
9115
|
};
|
|
7033
9116
|
const SubHeader = {
|
|
7034
9117
|
Left,
|
|
@@ -7548,8 +9631,6 @@ var pluralize$1 = {
|
|
|
7548
9631
|
|
|
7549
9632
|
var pluralize = pluralizeExports;
|
|
7550
9633
|
|
|
7551
|
-
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; }
|
|
7552
|
-
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; }
|
|
7553
9634
|
const Menu$1 = Dropdown.Menu,
|
|
7554
9635
|
MenuItem = Dropdown.MenuItem;
|
|
7555
9636
|
const renderNameColumn = (_ref, diplayStatusTag) => {
|
|
@@ -7707,9 +9788,15 @@ const renderUpdateAlert = (field, props) => {
|
|
|
7707
9788
|
}
|
|
7708
9789
|
return field === "title" ? getDefaultAlertTitle(props) : getDefaultAlertMessage(props);
|
|
7709
9790
|
};
|
|
7710
|
-
const getSearchParams = (
|
|
7711
|
-
|
|
7712
|
-
|
|
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
|
+
};
|
|
7713
9800
|
const handlePageChange = (setFilters, filter) => (page, results) => {
|
|
7714
9801
|
const pageParams = {
|
|
7715
9802
|
page,
|
|
@@ -7728,6 +9815,30 @@ const getMetaName = curry((metaName, count) => {
|
|
|
7728
9815
|
return instance.exists(translationWord, count) ? instance.t(translationWord, count) : pluralize(capitalize(singularizedMetaName), count.count);
|
|
7729
9816
|
});
|
|
7730
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
|
+
};
|
|
7731
9842
|
|
|
7732
9843
|
const _excluded = ["className", "children"],
|
|
7733
9844
|
_excluded2 = ["className", "children"];
|
|
@@ -7751,15 +9862,15 @@ Page.Header = PageWrapper;
|
|
|
7751
9862
|
Page.Body = PageWrapper;
|
|
7752
9863
|
Page.Footer = PageWrapper;
|
|
7753
9864
|
|
|
7754
|
-
function ownKeys$
|
|
7755
|
-
function _objectSpread$
|
|
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; }
|
|
7756
9867
|
const MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA = {
|
|
7757
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()
|
|
7758
9869
|
};
|
|
7759
9870
|
const ROLES_RADIO_GROUP_VALIDATION_SCHEMA = {
|
|
7760
9871
|
role: yup.string().required(instance.t("validations.roleRequired"))
|
|
7761
9872
|
};
|
|
7762
|
-
const VALIDATION_SCHEMA$1 = yup.object().shape(_objectSpread$
|
|
9873
|
+
const VALIDATION_SCHEMA$1 = yup.object().shape(_objectSpread$3(_objectSpread$3({}, MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA));
|
|
7763
9874
|
const FILTER_INVALID_EMAILS = {
|
|
7764
9875
|
label: instance.t("validations.filterInvalidEmails")
|
|
7765
9876
|
};
|
|
@@ -7878,8 +9989,8 @@ RolesRadioGroup.defaultProps = {
|
|
|
7878
9989
|
roles: []
|
|
7879
9990
|
};
|
|
7880
9991
|
|
|
7881
|
-
function ownKeys$
|
|
7882
|
-
function _objectSpread$
|
|
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; }
|
|
7883
9994
|
const ManageMember = _ref => {
|
|
7884
9995
|
var _config$permissions$v, _config$permissions, _config$manageMember;
|
|
7885
9996
|
let config = _ref.config,
|
|
@@ -7895,7 +10006,7 @@ const ManageMember = _ref => {
|
|
|
7895
10006
|
hasSubmitted = _useState2[0],
|
|
7896
10007
|
setHasSubmitted = _useState2[1];
|
|
7897
10008
|
const formReference = useRef(null);
|
|
7898
|
-
const manageMemberComponentConfig = _objectSpread$
|
|
10009
|
+
const manageMemberComponentConfig = _objectSpread$2(_objectSpread$2({}, DEFAULT_COMPONENT_CONFIG), componentConfig);
|
|
7899
10010
|
const Component = MEMBERS_FORM_COMPONENT_MAPPER[manageMemberComponentConfig.type || "pane"];
|
|
7900
10011
|
const handleClose = () => {
|
|
7901
10012
|
onComplete();
|
|
@@ -7964,7 +10075,7 @@ const ManageMember = _ref => {
|
|
|
7964
10075
|
weight: "semibold"
|
|
7965
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, {
|
|
7966
10077
|
ref: formReference,
|
|
7967
|
-
formikProps: _objectSpread$
|
|
10078
|
+
formikProps: _objectSpread$2(_objectSpread$2({}, MANAGE_MEMBERS_FORMIK_PROPS), {}, {
|
|
7968
10079
|
initialValues: renderInitialValues(selectedMember, rolesList),
|
|
7969
10080
|
onSubmit: handleAddMember,
|
|
7970
10081
|
validateOnBlur: hasSubmitted,
|
|
@@ -8027,6 +10138,64 @@ const Menu = _ref => {
|
|
|
8027
10138
|
})), (config === null || config === void 0 ? void 0 : config.otherMenuElements) && config.otherMenuElements());
|
|
8028
10139
|
};
|
|
8029
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
|
+
|
|
8030
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; }
|
|
8031
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; }
|
|
8032
10201
|
const TeamMembers = _ref => {
|
|
@@ -8037,23 +10206,30 @@ const TeamMembers = _ref => {
|
|
|
8037
10206
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
8038
10207
|
isOpen = _useState2[0],
|
|
8039
10208
|
setIsOpen = _useState2[1];
|
|
8040
|
-
const _useState3 = useState(
|
|
10209
|
+
const _useState3 = useState(null),
|
|
8041
10210
|
_useState4 = _slicedToArray$1(_useState3, 2),
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
const _useState5 = useState(
|
|
10211
|
+
selectedMember = _useState4[0],
|
|
10212
|
+
setSelectedMember = _useState4[1];
|
|
10213
|
+
const _useState5 = useState([]),
|
|
8045
10214
|
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
const
|
|
8049
|
-
const _useState7 = useState([]),
|
|
10215
|
+
columnData = _useState6[0],
|
|
10216
|
+
setColumnData = _useState6[1];
|
|
10217
|
+
const _useState7 = useState(DEFAULT_SELECTED_ROWS),
|
|
8050
10218
|
_useState8 = _slicedToArray$1(_useState7, 2),
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
const _useState9 = useState(
|
|
10219
|
+
selectedRows = _useState8[0],
|
|
10220
|
+
setSelectedRows = _useState8[1];
|
|
10221
|
+
const _useState9 = useState(false),
|
|
8054
10222
|
_useState10 = _slicedToArray$1(_useState9, 2),
|
|
8055
|
-
|
|
8056
|
-
|
|
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;
|
|
8057
10233
|
const _useFetchMembers = useFetchMembers(_objectSpread(_objectSpread({}, filters), {}, {
|
|
8058
10234
|
search: debouncedSearch.trim(),
|
|
8059
10235
|
category: filters.category.toLowerCase()
|
|
@@ -8081,20 +10257,6 @@ const TeamMembers = _ref => {
|
|
|
8081
10257
|
team
|
|
8082
10258
|
});
|
|
8083
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()];
|
|
8084
|
-
const searchProps = {
|
|
8085
|
-
"data-cy": "ntm-search-members-input",
|
|
8086
|
-
onChange: _ref3 => {
|
|
8087
|
-
let value = _ref3.target.value;
|
|
8088
|
-
return setFilters(mergeLeft({
|
|
8089
|
-
search: value,
|
|
8090
|
-
page: DEFAULT_PAGE_NUMBER
|
|
8091
|
-
}));
|
|
8092
|
-
},
|
|
8093
|
-
placeholder: instance.t("common.search_", {
|
|
8094
|
-
what: metaName(PLURAL).toLocaleLowerCase()
|
|
8095
|
-
}),
|
|
8096
|
-
value: filters.search
|
|
8097
|
-
};
|
|
8098
10260
|
const updateMemberAlertProps = {
|
|
8099
10261
|
member: selectedMember,
|
|
8100
10262
|
metaName,
|
|
@@ -8145,6 +10307,10 @@ const TeamMembers = _ref => {
|
|
|
8145
10307
|
clearSelectedMembers(filters.category, filter) && setSelectedRows(DEFAULT_SELECTED_ROWS);
|
|
8146
10308
|
handlePageChange(setFilters, filter)(DEFAULT_PAGE_NUMBER, filters.results);
|
|
8147
10309
|
};
|
|
10310
|
+
const handleNeetoFilterChange = filter => {
|
|
10311
|
+
setFilters(mergeLeft(filter));
|
|
10312
|
+
clearSelectedMembers(filters.category, filter) && setSelectedRows(DEFAULT_SELECTED_ROWS);
|
|
10313
|
+
};
|
|
8148
10314
|
const handleTableChange = (_, __, sorter) => {
|
|
8149
10315
|
setFilters(mergeLeft({
|
|
8150
10316
|
sortBy: sorter.field,
|
|
@@ -8206,8 +10372,19 @@ const TeamMembers = _ref => {
|
|
|
8206
10372
|
}),
|
|
8207
10373
|
rightActionBlock: /*#__PURE__*/React.createElement(SubHeader.Right, {
|
|
8208
10374
|
columns: columns,
|
|
8209
|
-
setColumnData: setColumnData
|
|
10375
|
+
setColumnData: setColumnData,
|
|
10376
|
+
filterColumns: filterColumns,
|
|
10377
|
+
handleFilterChange: handleNeetoFilterChange,
|
|
10378
|
+
setIsFiltersPaneOpen: setIsFiltersPaneOpen,
|
|
10379
|
+
isFiltersPaneOpen: isFiltersPaneOpen
|
|
8210
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
|
|
8211
10388
|
}), (team === null || team === void 0 ? void 0 : team.membersCount) !== 0 ? /*#__PURE__*/React.createElement("div", {
|
|
8212
10389
|
className: "ntm-members__table-wrapper"
|
|
8213
10390
|
}, /*#__PURE__*/React.createElement(Table$1, {
|