@commercetools-frontend/experimental-components 6.1.3 → 6.1.4

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.
@@ -29,7 +29,6 @@ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWit
29
29
  var _toArray = require('@babel/runtime-corejs3/helpers/toArray');
30
30
  var _reverseInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reverse');
31
31
  var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
32
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
33
32
  var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
34
33
  var client = require('@apollo/client');
35
34
  var react = require('@apollo/client/react');
@@ -59,7 +58,6 @@ var applicationShell = require('@commercetools-frontend/application-shell');
59
58
  var debounce = require('debounce-promise');
60
59
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
61
60
  var pick = require('lodash/pick');
62
- var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
63
61
  var oneLine = require('common-tags/lib/oneLine');
64
62
  var moment = require('moment');
65
63
  var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
@@ -73,7 +71,6 @@ var isEmpty$3 = require('lodash/isEmpty');
73
71
  var omit = require('lodash/omit');
74
72
  var _Object$freeze = require('@babel/runtime-corejs3/core-js-stable/object/freeze');
75
73
  var originalOmitDeep = require('omit-deep');
76
- var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
77
74
  var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
78
75
  var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
79
76
  var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
@@ -106,12 +103,14 @@ var uniqBy = require('lodash/uniqBy');
106
103
  var invariant = require('tiny-invariant');
107
104
  var hoistNonReactStatics = require('hoist-non-react-statics');
108
105
  var reactRedux = require('react-redux');
106
+ var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
109
107
  var _Math$trunc = require('@babel/runtime-corejs3/core-js-stable/math/trunc');
110
108
  var _Number$isNaN = require('@babel/runtime-corejs3/core-js-stable/number/is-nan');
111
109
  var Cleave = require('cleave.js/react');
112
110
  var isFinite = require('lodash/isFinite');
113
111
  var isUndefined = require('lodash/isUndefined');
114
112
  var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
113
+ var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
115
114
  var flatMap = require('lodash/flatMap');
116
115
  var compact = require('lodash/compact');
117
116
  var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
@@ -133,7 +132,6 @@ var React__default = /*#__PURE__*/_interopDefault(React);
133
132
  var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
134
133
  var _reverseInstanceProperty__default = /*#__PURE__*/_interopDefault(_reverseInstanceProperty);
135
134
  var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
136
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
137
135
  var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
138
136
  var classnames__default = /*#__PURE__*/_interopDefault(classnames);
139
137
  var flowRight__default = /*#__PURE__*/_interopDefault(flowRight);
@@ -163,7 +161,6 @@ var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty$3);
163
161
  var omit__default = /*#__PURE__*/_interopDefault(omit);
164
162
  var _Object$freeze__default = /*#__PURE__*/_interopDefault(_Object$freeze);
165
163
  var originalOmitDeep__default = /*#__PURE__*/_interopDefault(originalOmitDeep);
166
- var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findIndexInstanceProperty);
167
164
  var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
168
165
  var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
169
166
  var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
@@ -186,12 +183,14 @@ var flatten__default = /*#__PURE__*/_interopDefault(flatten);
186
183
  var uniqBy__default = /*#__PURE__*/_interopDefault(uniqBy);
187
184
  var invariant__default = /*#__PURE__*/_interopDefault(invariant);
188
185
  var hoistNonReactStatics__default = /*#__PURE__*/_interopDefault(hoistNonReactStatics);
186
+ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
189
187
  var _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
190
188
  var _Number$isNaN__default = /*#__PURE__*/_interopDefault(_Number$isNaN);
191
189
  var Cleave__default = /*#__PURE__*/_interopDefault(Cleave);
192
190
  var isFinite__default = /*#__PURE__*/_interopDefault(isFinite);
193
191
  var isUndefined__default = /*#__PURE__*/_interopDefault(isUndefined);
194
192
  var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
193
+ var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findIndexInstanceProperty);
195
194
  var flatMap__default = /*#__PURE__*/_interopDefault(flatMap);
196
195
  var compact__default = /*#__PURE__*/_interopDefault(compact);
197
196
  var _Set__default = /*#__PURE__*/_interopDefault(_Set);
@@ -282,9 +281,8 @@ function _objectSpread$1r(e) { for (var r = 1; r < arguments.length; r++) { var
282
281
  var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
283
282
  var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
284
283
  var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
285
- const getRolesClause = roles => roles && roles.length > 0 ? "roles contains any (".concat(_mapInstanceProperty__default["default"](roles).call(roles, role => "\"".concat(role, "\"")).join(','), ")") : undefined;
284
+ const getRolesClause = roles => roles && roles.length > 0 ? `roles contains any (${_mapInstanceProperty__default["default"](roles).call(roles, role => `"${role}"`).join(',')})` : undefined;
286
285
  const ChannelPickerInput = _ref => {
287
- var _currentOption$data$l, _currentOption$data;
288
286
  let isClearable = _ref.isClearable,
289
287
  isDisabled = _ref.isDisabled,
290
288
  isReadOnly = _ref.isReadOnly,
@@ -304,7 +302,7 @@ const ChannelPickerInput = _ref => {
304
302
  const variables = React.useMemo(() => {
305
303
  const rolesClause = getRolesClause(roles);
306
304
  return _objectSpread$1r({
307
- sortByNamePath: "name.".concat(dataLocale)
305
+ sortByNamePath: `name.${dataLocale}`
308
306
  }, rolesClause && {
309
307
  extraWhere: rolesClause
310
308
  });
@@ -325,7 +323,7 @@ const ChannelPickerInput = _ref => {
325
323
  }
326
324
  return channel;
327
325
  }, [formatLocalizedFieldToString]);
328
- const prefixSearchFields = React.useMemo(() => ["name.".concat(dataLocale), 'key'], [dataLocale]);
326
+ const prefixSearchFields = React.useMemo(() => [`name.${dataLocale}`, 'key'], [dataLocale]);
329
327
  const loadOptions = useLoadOptions({
330
328
  query: GetChannelsQuery,
331
329
  variables,
@@ -360,13 +358,13 @@ const ChannelPickerInput = _ref => {
360
358
  setLoadingError(null);
361
359
  handleInternalInputChange(event);
362
360
  }, [handleInternalInputChange]);
363
- const isCurrentOptionLoadingFailed = Boolean(currentOption === null || currentOption === void 0 ? void 0 : currentOption.error);
361
+ const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
364
362
  React.useEffect(() => {
365
363
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
366
364
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
367
365
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
368
366
  const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$K.noChannelsFound), [loadingError, formatMessage]);
369
- const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
367
+ const tooltipTitle = currentOption?.data?.label ?? '';
370
368
  return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
371
369
  max: "scale",
372
370
  children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -376,7 +374,7 @@ const ChannelPickerInput = _ref => {
376
374
  children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
377
375
  id: name,
378
376
  name: name,
379
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$K.placeholder),
377
+ placeholder: placeholder ?? formatMessage(messages$K.placeholder),
380
378
  loadOptions: loadOptionsDebounced,
381
379
  defaultOptions: true,
382
380
  showOptionGroupDivider: true,
@@ -418,10 +416,9 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
418
416
  value: function render() {
419
417
  return jsxRuntime.jsx(applicationShellConnectors.ApplicationContext, {
420
418
  render: _ref => {
421
- var _this$props;
422
419
  let user = _ref.user;
423
420
  return formatDateTime$1(this.props.type, this.props.value, {
424
- timeZone: (this === null || this === void 0 || (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.timeZone) || (user === null || user === void 0 ? void 0 : user.timeZone),
421
+ timeZone: this?.props?.timeZone || user?.timeZone,
425
422
  locale: this.props.intl.locale
426
423
  });
427
424
  }
@@ -460,7 +457,6 @@ const convertProductTypeToOption = productType => {
460
457
  };
461
458
  };
462
459
  const ProductTypePickerInput = _ref => {
463
- var _currentOption$data$l, _currentOption$data;
464
460
  let isClearable = _ref.isClearable,
465
461
  isDisabled = _ref.isDisabled,
466
462
  isReadOnly = _ref.isReadOnly,
@@ -492,9 +488,8 @@ const ProductTypePickerInput = _ref => {
492
488
  itemToOption: convertProductTypeToOption
493
489
  });
494
490
  const handleLoadOptions = React.useCallback(inputValue => loadProductTypes(inputValue).then(_ref3 => {
495
- var _data$productTypes;
496
491
  let data = _ref3.data;
497
- return ((_data$productTypes = data.productTypes) === null || _data$productTypes === void 0 ? void 0 : _data$productTypes.results) || [];
492
+ return data.productTypes?.results || [];
498
493
  }).then(productTypes => _mapInstanceProperty__default["default"](productTypes).call(productTypes, convertProductTypeToOption)).catch(error => {
499
494
  setLoadingError(error);
500
495
  onError(error);
@@ -508,12 +503,12 @@ const ProductTypePickerInput = _ref => {
508
503
  setLoadingError(null);
509
504
  handleInternalInputChange(event);
510
505
  }, [handleInternalInputChange]);
511
- const isCurrentOptionLoadingFailed = Boolean(currentOption === null || currentOption === void 0 ? void 0 : currentOption.error);
506
+ const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
512
507
  React.useEffect(() => {
513
508
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
514
509
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
515
510
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
516
- const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
511
+ const tooltipTitle = currentOption?.data?.label ?? '';
517
512
  return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
518
513
  max: "scale",
519
514
  children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -567,7 +562,6 @@ var messages$I = reactIntl.defineMessages({
567
562
  var GetStatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetStatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "states" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 377, source: { body: "query GetStatesQuery($where: String, $sortByNamePath: String!) {\n states(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery GetStateQuery($id: String) {\n state(id: $id) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
568
563
  var GetStateQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetStateQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "state" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 377, source: { body: "query GetStatesQuery($where: String, $sortByNamePath: String!) {\n states(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery GetStateQuery($id: String) {\n state(id: $id) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
569
564
  const StatePickerInput = _ref => {
570
- var _currentOption$data$l, _currentOption$data;
571
565
  let isClearable = _ref.isClearable,
572
566
  isDisabled = _ref.isDisabled,
573
567
  isReadOnly = _ref.isReadOnly,
@@ -583,7 +577,7 @@ const StatePickerInput = _ref => {
583
577
  formatMessage = _useIntl.formatMessage;
584
578
  const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
585
579
  const variables = React.useMemo(() => ({
586
- sortByNamePath: "name.".concat(dataLocale)
580
+ sortByNamePath: `name.${dataLocale}`
587
581
  }), [dataLocale]);
588
582
  const convertStateToOption = React.useCallback(state => {
589
583
  const localizedName = formatLocalizedFieldToString(state.nameAllLocales);
@@ -598,7 +592,7 @@ const StatePickerInput = _ref => {
598
592
  _useState2 = _slicedToArray(_useState, 2),
599
593
  loadingError = _useState2[0],
600
594
  setLoadingError = _useState2[1];
601
- const prefixSearchFields = React.useMemo(() => ["name.".concat(dataLocale), 'key'], [dataLocale]);
595
+ const prefixSearchFields = React.useMemo(() => [`name.${dataLocale}`, 'key'], [dataLocale]);
602
596
  const loadOptions = useLoadOptions({
603
597
  query: GetStatesQuery,
604
598
  variables,
@@ -631,13 +625,13 @@ const StatePickerInput = _ref => {
631
625
  setLoadingError(null);
632
626
  handleInternalInputChange(event);
633
627
  }, [handleInternalInputChange]);
634
- const isCurrentOptionLoadingFailed = Boolean(currentOption === null || currentOption === void 0 ? void 0 : currentOption.error);
628
+ const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
635
629
  React.useEffect(() => {
636
630
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
637
631
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
638
632
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
639
633
  const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$I.noStatesFound), [loadingError, formatMessage]);
640
- const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
634
+ const tooltipTitle = currentOption?.data?.label ?? '';
641
635
  return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
642
636
  max: "scale",
643
637
  children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -751,10 +745,9 @@ const useHandlers = onChange => {
751
745
  setInputValue(changedValue);
752
746
  }, []);
753
747
  const handleChange = useEventCallback(event => {
754
- var _event$target$value;
755
748
  const eventWithExtractedValue = _objectSpread$1o(_objectSpread$1o({}, event), {}, {
756
749
  target: _objectSpread$1o(_objectSpread$1o({}, event.target), {}, {
757
- value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
750
+ value: event.target.value?.value
758
751
  })
759
752
  });
760
753
  onChange(eventWithExtractedValue);
@@ -764,24 +757,21 @@ const useHandlers = onChange => {
764
757
 
765
758
  const _excluded$3 = ["extraWhere"];
766
759
  function ownKeys$1n(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
767
- function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$1n(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$1n(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
760
+ function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1n(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
768
761
  const constructPrefixSearchPredicate$1 = function () {
769
762
  let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
770
763
  let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
771
764
  let upperBound = arguments.length > 2 ? arguments[2] : undefined;
772
765
  const constructPrefixSearchExpression = field => {
773
- var _context, _context2, _context3, _context4;
766
+ var _context;
774
767
  const path = field.split('.');
775
768
  const _path$slice$reverse = _reverseInstanceProperty__default["default"](_context = _sliceInstanceProperty__default["default"](path).call(path)).call(_context),
776
769
  _path$slice$reverse2 = _toArray(_path$slice$reverse),
777
770
  finalValueInPath = _path$slice$reverse2[0],
778
771
  remainPathInReverse = _sliceInstanceProperty__default["default"](_path$slice$reverse2).call(_path$slice$reverse2, 1);
779
- const comparison = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = "".concat(finalValueInPath, " >= \"")).call(_context4, lowerBound, "\" and ")).call(_context3, finalValueInPath, " < \"")).call(_context2, upperBound, "\"");
772
+ const comparison = `${finalValueInPath} >= "${lowerBound}" and ${finalValueInPath} < "${upperBound}"`;
780
773
  if (remainPathInReverse.length) {
781
- return _reduceInstanceProperty__default["default"](remainPathInReverse).call(remainPathInReverse, (nestedPath, nextPath) => {
782
- var _context5;
783
- return _concatInstanceProperty__default["default"](_context5 = "".concat(nextPath, "(")).call(_context5, nestedPath, ")");
784
- }, comparison);
774
+ return _reduceInstanceProperty__default["default"](remainPathInReverse).call(remainPathInReverse, (nestedPath, nextPath) => `${nextPath}(${nestedPath})`, comparison);
785
775
  }
786
776
  return comparison;
787
777
  };
@@ -797,7 +787,7 @@ const useLoadOptions = _ref => {
797
787
  let where;
798
788
  if (inputValue.length) {
799
789
  if (isUUID(inputValue)) {
800
- where = "id = \"".concat(inputValue, "\"");
790
+ where = `id = "${inputValue}"`;
801
791
  } else {
802
792
  const _getPrefixSearchBound = getPrefixSearchBounds(inputValue),
803
793
  _getPrefixSearchBound2 = _slicedToArray(_getPrefixSearchBound, 2),
@@ -806,12 +796,11 @@ const useLoadOptions = _ref => {
806
796
  where = constructPrefixSearchPredicate$1(prefixSearchFields, lowerBound, upperBound);
807
797
  }
808
798
  }
809
- const _ref2 = variables !== null && variables !== void 0 ? variables : {},
799
+ const _ref2 = variables ?? {},
810
800
  extraWhere = _ref2.extraWhere,
811
801
  restVariables = _objectWithoutProperties(_ref2, _excluded$3);
812
802
  if (typeof extraWhere === 'string') {
813
- var _context6;
814
- where = where ? _concatInstanceProperty__default["default"](_context6 = "(".concat(where, ") and ")).call(_context6, variables.extraWhere) : variables.extraWhere;
803
+ where = where ? `(${where}) and ${variables.extraWhere}` : variables.extraWhere;
815
804
  }
816
805
  return client$1.query({
817
806
  query,
@@ -841,12 +830,12 @@ const useExecuteGraphQLRequest = () => {
841
830
  };
842
831
  const createSearchProductsFromPIMAction = (searchTerm, projectKey) => sdk.actions.post({
843
832
  mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.PIM_SEARCH,
844
- uri: "/".concat(projectKey, "/search/product-types"),
833
+ uri: `/${projectKey}/search/product-types`,
845
834
  payload: {
846
835
  query: {
847
836
  wildcard: {
848
837
  field: 'name',
849
- value: "*".concat(searchTerm, "*"),
838
+ value: `*${searchTerm}*`,
850
839
  caseInsensitive: true
851
840
  }
852
841
  },
@@ -860,9 +849,8 @@ const useFetchProductTypesFromPIM = _ref => {
860
849
  const dispatch = sdk.useAsyncDispatch();
861
850
  const executeGraphQLRequest = useExecuteGraphQLRequest();
862
851
  const fetchProductTypesFromPim = React.useCallback(async searchTerm => {
863
- var _result$hits$map, _result$hits;
864
852
  const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
865
- const ids = (_result$hits$map = result === null || result === void 0 || (_result$hits = result.hits) === null || _result$hits === void 0 ? void 0 : _mapInstanceProperty__default["default"](_result$hits).call(_result$hits, hit => hit.id)) !== null && _result$hits$map !== void 0 ? _result$hits$map : [];
853
+ const ids = result?.hits?.map(hit => hit.id) ?? [];
866
854
  // Avoid sending any requests if it's clear that nothing is found
867
855
  if (ids.length === 0) {
868
856
  return {
@@ -897,22 +885,19 @@ const useFetchProductTypesFromPIM = _ref => {
897
885
  */
898
886
  const constructNestedExpression = (reversedPath, predicate) => {
899
887
  if (reversedPath.length > 0) {
900
- return _reduceInstanceProperty__default["default"](reversedPath).call(reversedPath, (nextNestedValue, nestedSelection) => {
901
- var _context;
902
- return _concatInstanceProperty__default["default"](_context = "".concat(nestedSelection, "(")).call(_context, nextNestedValue, ")");
903
- }, predicate);
888
+ return _reduceInstanceProperty__default["default"](reversedPath).call(reversedPath, (nextNestedValue, nestedSelection) => `${nestedSelection}(${nextNestedValue})`, predicate);
904
889
  }
905
890
  return predicate;
906
891
  };
907
892
  const constructPrefixSearchPredicate = (prefixSearchFields, lowerBound, upperBound) => {
908
893
  const constructPrefixSearchExpression = field => {
909
- var _context2, _context3, _context4, _context5;
894
+ var _context;
910
895
  const parts = field.split('.');
911
- const _parts$slice$reverse = _reverseInstanceProperty__default["default"](_context2 = _sliceInstanceProperty__default["default"](parts).call(parts)).call(_context2),
896
+ const _parts$slice$reverse = _reverseInstanceProperty__default["default"](_context = _sliceInstanceProperty__default["default"](parts).call(parts)).call(_context),
912
897
  _parts$slice$reverse2 = _toArray(_parts$slice$reverse),
913
898
  valueToNest = _parts$slice$reverse2[0],
914
899
  reversedPathToNestedValue = _sliceInstanceProperty__default["default"](_parts$slice$reverse2).call(_parts$slice$reverse2, 1);
915
- const predicateExpression = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(valueToNest, " >= \"")).call(_context5, lowerBound, "\" and ")).call(_context4, valueToNest, " < \"")).call(_context3, upperBound, "\"");
900
+ const predicateExpression = `${valueToNest} >= "${lowerBound}" and ${valueToNest} < "${upperBound}"`;
916
901
  return constructNestedExpression(reversedPathToNestedValue, predicateExpression);
917
902
  };
918
903
  return _mapInstanceProperty__default["default"](prefixSearchFields).call(prefixSearchFields, constructPrefixSearchExpression).join(' or ');
@@ -920,7 +905,7 @@ const constructPrefixSearchPredicate = (prefixSearchFields, lowerBound, upperBou
920
905
  const constructWherePredicate = (inputValue, prefixSearchFields) => {
921
906
  const wherePredicate = function () {
922
907
  if (inputValue.length) {
923
- if (isUUID(inputValue)) return "id = \"".concat(inputValue, "\"");else {
908
+ if (isUUID(inputValue)) return `id = "${inputValue}"`;else {
924
909
  const _getPrefixSearchBound = getPrefixSearchBounds(inputValue),
925
910
  _getPrefixSearchBound2 = _slicedToArray(_getPrefixSearchBound, 2),
926
911
  lowerBound = _getPrefixSearchBound2[0],
@@ -945,7 +930,6 @@ const useFetchProductTypessFromCTP = _ref2 => {
945
930
  }, [prefixSearchFields, executeGraphQLRequest]);
946
931
  };
947
932
  const usePimStatus = () => {
948
- var _data$indicesExist;
949
933
  const _useQuery = react.useQuery(FetchIndicesExist$1, {
950
934
  context: {
951
935
  target: constants.GRAPHQL_TARGETS.PIM_INDEXER
@@ -955,20 +939,17 @@ const usePimStatus = () => {
955
939
  data = _useQuery.data;
956
940
  return {
957
941
  data,
958
- isProjectIndexed: Boolean(data === null || data === void 0 || (_data$indicesExist = data.indicesExist) === null || _data$indicesExist === void 0 || (_data$indicesExist = _data$indicesExist.productTypes) === null || _data$indicesExist === void 0 ? void 0 : _data$indicesExist.searchableIndexExists)
942
+ isProjectIndexed: Boolean(data?.indicesExist?.productTypes?.searchableIndexExists)
959
943
  };
960
944
  };
961
945
  const useProductTypeOptions = _ref3 => {
962
946
  let prefixSearchFields = _ref3.prefixSearchFields;
963
947
  const _usePimStatus = usePimStatus(),
964
948
  isProjectIndexed = _usePimStatus.isProjectIndexed;
965
- const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => {
966
- var _context$project;
967
- return {
968
- dataLocale: context.dataLocale,
969
- projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
970
- };
971
- }),
949
+ const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
950
+ dataLocale: context.dataLocale,
951
+ projectKey: context.project?.key
952
+ })),
972
953
  dataLocale = _useApplicationContex.dataLocale,
973
954
  projectKey = _useApplicationContex.projectKey;
974
955
  const fetchProductTypesFromPim = useFetchProductTypesFromPIM({
@@ -985,7 +966,6 @@ const useProductTypeOptions = _ref3 => {
985
966
  };
986
967
 
987
968
  function useCurrentOption(_ref) {
988
- var _context;
989
969
  let id = _ref.id,
990
970
  typename = _ref.typename,
991
971
  query = _ref.query,
@@ -997,7 +977,7 @@ function useCurrentOption(_ref) {
997
977
  // load from cache when possible to speed up initial render
998
978
  const canReadFromCache = id && typename && fragment;
999
979
  const cacheItem = canReadFromCache ? apolloClient.readFragment({
1000
- id: _concatInstanceProperty__default["default"](_context = "".concat(typename, ":")).call(_context, id),
980
+ id: `${typename}:${id}`,
1001
981
  fragment
1002
982
  }) : undefined;
1003
983
 
@@ -1015,7 +995,7 @@ function useCurrentOption(_ref) {
1015
995
  queryData = _useQuery.data,
1016
996
  queryError = _useQuery.error;
1017
997
  const queryItem = queryData && queryDataToItem(queryData);
1018
- const item = queryItem !== null && queryItem !== void 0 ? queryItem : cacheItem;
998
+ const item = queryItem ?? cacheItem;
1019
999
  const loading = item ? false : queryLoading;
1020
1000
  const error = item ? undefined : queryError;
1021
1001
  const data = item && itemToOption(item);
@@ -1044,10 +1024,7 @@ const setDisplayName = nextDisplayName => Component => {
1044
1024
 
1045
1025
  const keepDisplayName = component => setDisplayName(getDisplayName(component));
1046
1026
 
1047
- const wrapDisplayName = (BaseComponent, hocName) => {
1048
- var _context;
1049
- return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
1050
- };
1027
+ const wrapDisplayName = (BaseComponent, hocName) => `${hocName}(${getDisplayName(BaseComponent)})`;
1051
1028
 
1052
1029
  function ownKeys$1m(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1053
1030
  function _objectSpread$1m(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
@@ -1162,7 +1139,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
1162
1139
  };
1163
1140
  _this.doDelayedUpdate = (updateFunction, event, eventType) => {
1164
1141
  const self = _this;
1165
- const timeoutKey = "".concat(eventType, "Timeout");
1142
+ const timeoutKey = `${eventType}Timeout`;
1166
1143
  // TODO: can't we just use one variable?
1167
1144
  clearTimeout(_this[timeoutKey]);
1168
1145
  _this[timeoutKey] = _setTimeout__default["default"](() => {
@@ -1193,7 +1170,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
1193
1170
  }, this.props.onEnter ? {
1194
1171
  onKeyDown: this.handleEnter
1195
1172
  } : {}), filterDataAttributes(this.props));
1196
- const inputId = "throttled-field-".concat(this.props.name);
1173
+ const inputId = `throttled-field-${this.props.name}`;
1197
1174
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1198
1175
  children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
1199
1176
  children: jsxRuntime.jsx("label", {
@@ -1202,7 +1179,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
1202
1179
  })
1203
1180
  }), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$1l(_objectSpread$1l({}, commonProps), {}, {
1204
1181
  id: inputId,
1205
- className: classnames__default["default"](styles$i.textarea, styles$i["textarea-".concat(this.props.style)], {
1182
+ className: classnames__default["default"](styles$i.textarea, styles$i[`textarea-${this.props.style}`], {
1206
1183
  [styles$i.invalid]: !this.props.isValid,
1207
1184
  [styles$i.disabled]: this.props.disabled
1208
1185
  }),
@@ -1213,7 +1190,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
1213
1190
  id: inputId,
1214
1191
  ref: this.props.inputRef,
1215
1192
  type: this.props.as,
1216
- className: classnames__default["default"](styles$i["input-".concat(this.props.style)], {
1193
+ className: classnames__default["default"](styles$i[`input-${this.props.style}`], {
1217
1194
  [styles$i.invalid]: !this.props.isValid,
1218
1195
  [styles$i.disabled]: this.props.disabled,
1219
1196
  [styles$i.granular]: this.props.isGranular
@@ -1310,8 +1287,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
1310
1287
  });
1311
1288
  };
1312
1289
  _this.handleClear = () => {
1313
- var _this$inputRef;
1314
- (_this$inputRef = _this.inputRef) === null || _this$inputRef === void 0 || _this$inputRef.focus();
1290
+ _this.inputRef?.focus();
1315
1291
  _this.props.onChange(null);
1316
1292
  _this.props.onReset();
1317
1293
  _this.setState({
@@ -1413,16 +1389,15 @@ function ownKeys$1k(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
1413
1389
  function _objectSpread$1k(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1414
1390
  const injectDataTablePaginationState = initialValues => Component => {
1415
1391
  const WithDataTablePaginationState = props => {
1416
- var _initialValues$tableS, _initialValues$tableS2;
1417
1392
  const _usePaginationState = uiKit.usePaginationState({
1418
- page: initialValues === null || initialValues === void 0 ? void 0 : initialValues.page,
1419
- perPage: initialValues === null || initialValues === void 0 ? void 0 : initialValues.perPage
1393
+ page: initialValues?.page,
1394
+ perPage: initialValues?.perPage
1420
1395
  }),
1421
1396
  page = _usePaginationState.page,
1422
1397
  perPage = _usePaginationState.perPage;
1423
1398
  const tableSorting = uiKit.useDataTableSortingState({
1424
- key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
1425
- order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
1399
+ key: initialValues?.tableSorting?.key,
1400
+ order: initialValues?.tableSorting?.order
1426
1401
  });
1427
1402
  return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
1428
1403
  dataTablePaginationState: {
@@ -1456,7 +1431,7 @@ const injectNotifications = function () {
1456
1431
  [propName]: notifications
1457
1432
  }));
1458
1433
  };
1459
- WrappedComponent.displayName = "withNotifications(".concat(getDisplayName(Component));
1434
+ WrappedComponent.displayName = `withNotifications(${getDisplayName(Component)}`;
1460
1435
  return WrappedComponent;
1461
1436
  };
1462
1437
  };
@@ -1565,10 +1540,7 @@ const isNil = value => typeof value === 'undefined' || value === null;
1565
1540
  const useStorage = (storageKey, initialStorageValue, options) => {
1566
1541
  var _context;
1567
1542
  const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$2), options);
1568
- const userId = applicationShellConnectors.useApplicationContext(context => {
1569
- var _context$user;
1570
- return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
1571
- });
1543
+ const userId = applicationShellConnectors.useApplicationContext(context => context.user?.id);
1572
1544
  const scopedStorageKey = _filterInstanceProperty__default["default"](_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
1573
1545
  const readFromStorage = React.useCallback(() => {
1574
1546
  const rawStorageValue = getStorage(mergedOptions.storageType).getItem(scopedStorageKey);
@@ -1587,9 +1559,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
1587
1559
  return parsedStorageValue;
1588
1560
  }, [mergedOptions.storageType, scopedStorageKey]);
1589
1561
  const initializeStorageValue = () => {
1590
- var _ref, _readFromStorage;
1591
1562
  // default the storage value to the initial provided value when provided
1592
- return (_ref = (_readFromStorage = readFromStorage()) !== null && _readFromStorage !== void 0 ? _readFromStorage : initialStorageValue) !== null && _ref !== void 0 ? _ref : null;
1563
+ return readFromStorage() ?? initialStorageValue ?? null;
1593
1564
  };
1594
1565
  const _useState = React.useState(initializeStorageValue),
1595
1566
  _useState2 = _slicedToArray(_useState, 2),
@@ -1677,7 +1648,7 @@ function useFormatLocalizedFieldToString() {
1677
1648
  }
1678
1649
 
1679
1650
  function ownKeys$1c(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1680
- function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$1c(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$1c(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1651
+ function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1c(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1681
1652
  var FetchResourceTypeDuplicatedField = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchResourceTypeDuplicatedField" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipAssociateRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipAttributeGroups" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipBusinessUnits" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCarts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCartDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCategories" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipChannels" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCustomers" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCustomerGroups" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipDiscountCodes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipInventoryEntries" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipOrders" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipPayments" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProductDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipShippingMethods" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipTaxCategories" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipZones" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoles" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipAssociateRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "attributeGroups" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipAttributeGroups" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "businessUnits" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipBusinessUnits" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "carts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipCarts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipCartDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "categories" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipCategories" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipChannels" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "customers" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipCustomers" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "customerGroups" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipCustomerGroups" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "discountCodes" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipDiscountCodes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inventoryEntries" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipInventoryEntries" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "orders" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipOrders" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "payments" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipPayments" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "products" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productDiscounts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipProductDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "shippingMethods" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipShippingMethods" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "taxCategories" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipTaxCategories" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "zones" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipZones" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 2220, source: { body: "query FetchResourceTypeDuplicatedField(\n $where: String\n $skipAssociateRoles: Boolean!\n $skipAttributeGroups: Boolean!\n $skipBusinessUnits: Boolean!\n $skipCarts: Boolean!\n $skipCartDiscounts: Boolean!\n $skipCategories: Boolean!\n $skipChannels: Boolean!\n $skipCustomers: Boolean!\n $skipCustomerGroups: Boolean!\n $skipDiscountCodes: Boolean!\n $skipInventoryEntries: Boolean!\n $skipOrders: Boolean!\n $skipPayments: Boolean!\n $skipProducts: Boolean!\n $skipProductDiscounts: Boolean!\n $skipProductSelections: Boolean!\n $skipProductTypes: Boolean!\n $skipShippingMethods: Boolean!\n $skipStores: Boolean!\n $skipTaxCategories: Boolean!\n $skipZones: Boolean!\n) {\n associateRoles(where: $where) @skip(if: $skipAssociateRoles) {\n total\n }\n attributeGroups(where: $where) @skip(if: $skipAttributeGroups) {\n total\n }\n businessUnits(where: $where) @skip(if: $skipBusinessUnits) {\n total\n }\n carts(where: $where) @skip(if: $skipCarts) {\n total\n }\n cartDiscounts(where: $where) @skip(if: $skipCartDiscounts) {\n total\n }\n categories(where: $where) @skip(if: $skipCategories) {\n total\n }\n channels(where: $where) @skip(if: $skipChannels) {\n total\n }\n customers(where: $where) @skip(if: $skipCustomers) {\n total\n }\n customerGroups(where: $where) @skip(if: $skipCustomerGroups) {\n total\n }\n discountCodes(where: $where) @skip(if: $skipDiscountCodes) {\n total\n }\n inventoryEntries(where: $where) @skip(if: $skipInventoryEntries) {\n total\n }\n orders(where: $where) @skip(if: $skipOrders) {\n total\n }\n payments(where: $where) @skip(if: $skipPayments) {\n total\n }\n products(where: $where) @skip(if: $skipProducts) {\n total\n }\n productDiscounts(where: $where) @skip(if: $skipProductDiscounts) {\n total\n }\n productSelections(where: $where) @skip(if: $skipProductSelections) {\n total\n }\n productTypes(where: $where) @skip(if: $skipProductTypes) {\n total\n }\n shippingMethods(where: $where) @skip(if: $skipShippingMethods) {\n total\n }\n stores(where: $where) @skip(if: $skipStores) {\n total\n }\n taxCategories(where: $where) @skip(if: $skipTaxCategories) {\n total\n }\n zones(where: $where) @skip(if: $skipZones) {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
1682
1653
  const MC_RESOURCES_WITH_KEYS = {
1683
1654
  ASSOCIATE_ROLE: 'ASSOCIATE_ROLE',
@@ -1754,14 +1725,13 @@ const getSkipVariables = resourceType => {
1754
1725
  });
1755
1726
  };
1756
1727
  const getWhereClause$1 = function () {
1757
- var _context, _context2, _context3;
1758
1728
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1759
1729
  field = _ref.field,
1760
1730
  fieldValue = _ref.fieldValue,
1761
1731
  id = _ref.id;
1762
1732
  if (!id && !fieldValue) return null;
1763
- if (!id) return _concatInstanceProperty__default["default"](_context = "".concat(field, " = \"")).call(_context, fieldValue, "\"");
1764
- return _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(field, " = \"")).call(_context3, fieldValue, "\" and id != \"")).call(_context2, id, "\"");
1733
+ if (!id) return `${field} = "${fieldValue}"`;
1734
+ return `${field} = "${fieldValue}" and id != "${id}"`;
1765
1735
  };
1766
1736
  const getQueryVariables = _ref2 => {
1767
1737
  let resourceType = _ref2.resourceType,
@@ -1780,7 +1750,6 @@ const getQueryVariables = _ref2 => {
1780
1750
  }, skipVariables);
1781
1751
  };
1782
1752
  const useIsFieldDuplicated = () => {
1783
- var _Object$values$;
1784
1753
  const _useLazyQuery = hooks.useLazyQuery(FetchResourceTypeDuplicatedField, {
1785
1754
  context: {
1786
1755
  target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
@@ -1795,7 +1764,7 @@ const useIsFieldDuplicated = () => {
1795
1764
  return {
1796
1765
  getQueryVariables,
1797
1766
  isLoading: loading,
1798
- isFieldDuplicated: data ? ((_Object$values$ = _Object$values__default["default"](data)[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.total) > 0 : null,
1767
+ isFieldDuplicated: data ? _Object$values__default["default"](data)[0]?.total > 0 : null,
1799
1768
  queryIsFieldDuplicated: execute
1800
1769
  };
1801
1770
  };
@@ -1848,16 +1817,14 @@ function ownKeys$1b(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
1848
1817
  function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1849
1818
  var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n mode\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
1850
1819
  const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
1851
- var _storesQueryResult$re;
1852
1820
  if (!storesQueryResult) return null;
1853
1821
  return {
1854
1822
  total: storesQueryResult.total,
1855
1823
  count: storesQueryResult.count,
1856
1824
  offset: storesQueryResult.offset,
1857
- results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
1858
- var _store$productSelecti;
1825
+ results: storesQueryResult.results?.map(store => {
1859
1826
  return _objectSpread$1b(_objectSpread$1b({}, store), {}, {
1860
- productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
1827
+ productSelections: store.productSelections?.filter(productSelectionRef => Boolean(productSelectionRef.productSelection))
1861
1828
  });
1862
1829
  })
1863
1830
  };
@@ -1869,7 +1836,7 @@ const createQueryVariables$6 = ownProps => {
1869
1836
  offset: ownProps.offset,
1870
1837
  sort: _sortInstanceProperty__default["default"](ownProps)
1871
1838
  }, Boolean(ownProps.stores) && {
1872
- where: "key in (".concat(_mapInstanceProperty__default["default"](_context = ownProps.stores).call(_context, store => "\"".concat(store, "\"")).join(', '), ")")
1839
+ where: `key in (${_mapInstanceProperty__default["default"](_context = ownProps.stores).call(_context, store => `"${store}"`).join(', ')})`
1873
1840
  }), {}, {
1874
1841
  excludeExtendedStoresList: ownProps.excludeExtendedStoresList,
1875
1842
  excludeProductSelections: ownProps.excludeProductSelections
@@ -1894,10 +1861,7 @@ const useStoresListFetcher = props => {
1894
1861
  projectKey: props.projectKey
1895
1862
  },
1896
1863
  fetchPolicy: 'network-only',
1897
- onError: graphqlErrorResponse => {
1898
- var _props$onError;
1899
- return (_props$onError = props.onError) === null || _props$onError === void 0 ? void 0 : _props$onError.call(props, graphqlErrorResponse);
1900
- }
1864
+ onError: graphqlErrorResponse => props.onError?.(graphqlErrorResponse)
1901
1865
  }),
1902
1866
  data = _useQuery.data,
1903
1867
  refetch = _useQuery.refetch,
@@ -1905,7 +1869,7 @@ const useStoresListFetcher = props => {
1905
1869
  return {
1906
1870
  isLoading: loading,
1907
1871
  refetch,
1908
- stores: filterStoresOutdatedDanglingProductSelections(data === null || data === void 0 ? void 0 : data.stores),
1872
+ stores: filterStoresOutdatedDanglingProductSelections(data?.stores),
1909
1873
  refetchQuery: {
1910
1874
  query: FetchStoresQuery,
1911
1875
  variables: queryVariables,
@@ -1969,18 +1933,13 @@ const handlers$5 = {
1969
1933
  }
1970
1934
  };
1971
1935
 
1972
- const toPermission = (permission, resourceName) => {
1973
- var _context;
1974
- return camelCase__default["default"](_concatInstanceProperty__default["default"](_context = "can ".concat(permission, " ")).call(_context, resourceName));
1975
- };
1976
- const createPermissionsComposePath = permission => // e.g applicationContext.permissions?.canViewOrders
1977
- "permissions.".concat(permission);
1978
- const createDataFencesComposePath = resourceName => permission => {
1979
- var _context2;
1980
- return (// e.g applicationContext.dataFences?.store?.orders?.canViewOrders?.values
1981
- _concatInstanceProperty__default["default"](_context2 = "dataFences.store.".concat(resourceName, ".")).call(_context2, permission, ".values")
1982
- );
1983
- };
1936
+ const toPermission = (permission, resourceName) => camelCase__default["default"](`can ${permission} ${resourceName}`);
1937
+ const createPermissionsComposePath = permission =>
1938
+ // e.g applicationContext.permissions?.canViewOrders
1939
+ `permissions.${permission}`;
1940
+ const createDataFencesComposePath = resourceName => permission =>
1941
+ // e.g applicationContext.dataFences?.store?.orders?.canViewOrders?.values
1942
+ `dataFences.store.${resourceName}.${permission}.values`;
1984
1943
  const useStoreKeysInDataFences = _ref => {
1985
1944
  let resourceName = _ref.resourceName,
1986
1945
  _ref$permission = _ref.permission,
@@ -2388,7 +2347,7 @@ const usePersistedTableConfiguration = props => {
2388
2347
  * Therefore, if it will be missing from the local storage and hence we use the [] as default.
2389
2348
  */
2390
2349
  const getVisibleColumns = React.useCallback(() => {
2391
- if (cachedVisibleTableConfiguration !== null && cachedVisibleTableConfiguration !== void 0 && cachedVisibleTableConfiguration.columnsConfig) {
2350
+ if (cachedVisibleTableConfiguration?.columnsConfig) {
2392
2351
  return retrieveColumnsWithCachedConfiguration({
2393
2352
  allAvailableColumnsConfiguration,
2394
2353
  cachedVisibleTableConfiguration: cachedVisibleTableConfiguration.columnsConfig,
@@ -2402,8 +2361,8 @@ const usePersistedTableConfiguration = props => {
2402
2361
  return {
2403
2362
  visibleColumns,
2404
2363
  visibleColumnKeys,
2405
- cachedVisibleColumnsConfiguration: cachedVisibleTableConfiguration === null || cachedVisibleTableConfiguration === void 0 ? void 0 : cachedVisibleTableConfiguration.columnsConfig,
2406
- cachedDisplaySettings: cachedVisibleTableConfiguration === null || cachedVisibleTableConfiguration === void 0 ? void 0 : cachedVisibleTableConfiguration.displaySettings,
2364
+ cachedVisibleColumnsConfiguration: cachedVisibleTableConfiguration?.columnsConfig,
2365
+ cachedDisplaySettings: cachedVisibleTableConfiguration?.displaySettings,
2407
2366
  handleCachedTableConfigurationUpdate: update => handleCacheUpdate({
2408
2367
  update,
2409
2368
  cachedVisibleTableConfiguration,
@@ -2414,7 +2373,6 @@ const usePersistedTableConfiguration = props => {
2414
2373
 
2415
2374
  var FetchProductSelectionsTotal = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelectionsTotal" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 74, source: { body: "query FetchProductSelectionsTotal {\n productSelections {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
2416
2375
  const useProductSelectionsTotalFetcher = props => {
2417
- var _data$productSelectio;
2418
2376
  const _useQuery = hooks.useQuery(FetchProductSelectionsTotal, {
2419
2377
  context: {
2420
2378
  target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
@@ -2424,7 +2382,7 @@ const useProductSelectionsTotalFetcher = props => {
2424
2382
  data = _useQuery.data;
2425
2383
  return {
2426
2384
  isLoading: loading,
2427
- total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
2385
+ total: data?.productSelections?.total
2428
2386
  };
2429
2387
  };
2430
2388
 
@@ -2445,7 +2403,7 @@ function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var
2445
2403
  // eslint-disable-next-line import/prefer-default-export
2446
2404
  const convertProductSelectionsFromGraphQl = productSelections => {
2447
2405
  var _context;
2448
- return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$17(_objectSpread$17({}, productSelections), {}, {
2406
+ return productSelections?.results && _objectSpread$17(_objectSpread$17({}, productSelections), {}, {
2449
2407
  results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$17({}, l10n.applyTransformedLocalizedFields(productSelection, [{
2450
2408
  from: 'nameAllLocales',
2451
2409
  to: 'name'
@@ -2482,7 +2440,7 @@ const useProductSelectionsFetcher = props => {
2482
2440
  refetch = _useQuery.refetch;
2483
2441
  return {
2484
2442
  isLoading: loading,
2485
- productSelections: convertProductSelectionsFromGraphQl(data === null || data === void 0 ? void 0 : data.productSelections) || emptyProductSelections,
2443
+ productSelections: convertProductSelectionsFromGraphQl(data?.productSelections) || emptyProductSelections,
2486
2444
  refetch
2487
2445
  };
2488
2446
  };
@@ -2497,7 +2455,7 @@ const handlers$3 = {
2497
2455
 
2498
2456
  const setToArray = function () {
2499
2457
  let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2500
- return "id in (".concat(_mapInstanceProperty__default["default"](values).call(values, value => "\"".concat(value, "\"")).join(', '), ")");
2458
+ return `id in (${_mapInstanceProperty__default["default"](values).call(values, value => `"${value}"`).join(', ')})`;
2501
2459
  };
2502
2460
 
2503
2461
  function capitalizeFirst(text) {
@@ -2565,7 +2523,6 @@ function validateSingleFilter(_ref) {
2565
2523
  return _includesInstanceProperty__default["default"](invalidValues).call(invalidValues, value);
2566
2524
  }
2567
2525
 
2568
- var _templateObject$4, _templateObject2$2;
2569
2526
  const dateFormatDayStart$1 = 'YYYY-MM-DDT00:00:00.000';
2570
2527
  const dateFormatDayEnd$1 = 'YYYY-MM-DDT23:59:59.999';
2571
2528
  const getDateTimeInUTC = (date, timezone, format) => {
@@ -2575,8 +2532,7 @@ const getDateTimeInUTC = (date, timezone, format) => {
2575
2532
  const noTimeSpecified = momentDate.hours() === 0 && momentDate.minutes() === 0 && momentDate.seconds() === 0;
2576
2533
  // if it's a date then convert it to UTC datetime based on timezone
2577
2534
  if (noTimeSpecified) {
2578
- var _moment$tz;
2579
- const offset = ((_moment$tz = moment__default["default"](date).tz(timezone)) === null || _moment$tz === void 0 ? void 0 : _moment$tz.utcOffset()) || 0;
2535
+ const offset = moment__default["default"](date).tz(timezone)?.utcOffset() || 0;
2580
2536
  const formattedDate = momentDate.format(format);
2581
2537
  const formattedDateWithOffset = moment__default["default"](formattedDate).add(offset, 'minutes').format(dateFormat);
2582
2538
  // console.log(formattedDateWithOffset);
@@ -2589,7 +2545,6 @@ const getDateTimeInUTC = (date, timezone, format) => {
2589
2545
  function dateTransformer$1(filterKey, filters) {
2590
2546
  let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultFilterValidator$1;
2591
2547
  const queries = _mapInstanceProperty__default["default"](filters).call(filters, _ref => {
2592
- var _context, _context2;
2593
2548
  let type = _ref.type,
2594
2549
  value = _ref.value,
2595
2550
  timezone = _ref.timezone;
@@ -2599,13 +2554,19 @@ function dateTransformer$1(filterKey, filters) {
2599
2554
  })) return '';
2600
2555
  switch (type) {
2601
2556
  case FILTER_TYPES.lessThan:
2602
- return _concatInstanceProperty__default["default"](_context = "".concat(filterKey, " < \"")).call(_context, getDateTimeInUTC(value, timezone, dateFormatDayStart$1), "\"");
2557
+ return `${filterKey} < "${getDateTimeInUTC(value, timezone, dateFormatDayStart$1)}"`;
2603
2558
  case FILTER_TYPES.moreThan:
2604
- return _concatInstanceProperty__default["default"](_context2 = "".concat(filterKey, " > \"")).call(_context2, getDateTimeInUTC(value, timezone, dateFormatDayEnd$1), "\"");
2559
+ return `${filterKey} > "${getDateTimeInUTC(value, timezone, dateFormatDayEnd$1)}"`;
2605
2560
  case FILTER_TYPES.equalTo:
2606
- return oneLine__default["default"](_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n (", " >= \"", "\"\n and ", " <= \"", "\")\n "])), filterKey, getDateTimeInUTC(value, timezone, dateFormatDayStart$1), filterKey, getDateTimeInUTC(value, timezone, dateFormatDayEnd$1));
2561
+ return oneLine__default["default"]`
2562
+ (${filterKey} >= "${getDateTimeInUTC(value, timezone, dateFormatDayStart$1)}"
2563
+ and ${filterKey} <= "${getDateTimeInUTC(value, timezone, dateFormatDayEnd$1)}")
2564
+ `;
2607
2565
  case FILTER_TYPES.range:
2608
- return oneLine__default["default"](_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n (", " >= \"", "\"\n and ", " <= \"", "\")\n "])), filterKey, getDateTimeInUTC(value.from, timezone, dateFormatDayStart$1), filterKey, getDateTimeInUTC(value.to, timezone, dateFormatDayEnd$1));
2566
+ return oneLine__default["default"]`
2567
+ (${filterKey} >= "${getDateTimeInUTC(value.from, timezone, dateFormatDayStart$1)}"
2568
+ and ${filterKey} <= "${getDateTimeInUTC(value.to, timezone, dateFormatDayEnd$1)}")
2569
+ `;
2609
2570
  default:
2610
2571
  return '';
2611
2572
  }
@@ -2621,7 +2582,7 @@ function dateTransformer$1(filterKey, filters) {
2621
2582
  * (createdAt >= "2018-02-15T00:00:00.000+01:00" and createdAt <= "2018-02-15T23:59:59.999+01:00")
2622
2583
  * ) or some_more_filters
2623
2584
  */
2624
- return queryString === '' ? null : "(".concat(queryString, ")");
2585
+ return queryString === '' ? null : `(${queryString})`;
2625
2586
  }
2626
2587
  function defaultFilterValidator$1(_ref2) {
2627
2588
  let type = _ref2.type,
@@ -2637,25 +2598,19 @@ function defaultFilterValidator$1(_ref2) {
2637
2598
 
2638
2599
  var localizedTextTransformer = (localizedString => {
2639
2600
  var _context;
2640
- return _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](localizedString)).call(_context, locale => {
2641
- var _context2;
2642
- return _concatInstanceProperty__default["default"](_context2 = "".concat(locale, " = \"")).call(_context2, localizedString[locale], "\"");
2643
- }).join(' and ');
2601
+ return _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
2644
2602
  });
2645
2603
 
2646
- const getCentAmountClause = (value, operator, locale) => {
2647
- var _context;
2648
- return _concatInstanceProperty__default["default"](_context = "centAmount ".concat(operator, " ")).call(_context, uiKit.MoneyInput.convertToMoneyValue(value, locale).centAmount);
2649
- };
2604
+ const getCentAmountClause = (value, operator, locale) => `centAmount ${operator} ${uiKit.MoneyInput.convertToMoneyValue(value, locale).centAmount}`;
2650
2605
  function moneyTransformer(value, option, locale) {
2651
2606
  const clauses = [];
2652
2607
  if (option === FILTER_TYPES.range) {
2653
- clauses[0] = "currencyCode = \"".concat(value.from.currencyCode, "\"");
2608
+ clauses[0] = `currencyCode = "${value.from.currencyCode}"`;
2654
2609
  clauses[1] = getCentAmountClause(value.from, '>=', locale);
2655
2610
  clauses[2] = getCentAmountClause(value.to, '<=', locale);
2656
2611
  return clauses.join(' and ');
2657
2612
  }
2658
- clauses[0] = "currencyCode = \"".concat(value.currencyCode, "\"");
2613
+ clauses[0] = `currencyCode = "${value.currencyCode}"`;
2659
2614
  switch (option) {
2660
2615
  case FILTER_TYPES.lessThan:
2661
2616
  clauses[1] = getCentAmountClause(value, '<', locale);
@@ -2672,7 +2627,6 @@ function moneyTransformer(value, option, locale) {
2672
2627
  return clauses.join(' and ');
2673
2628
  }
2674
2629
 
2675
- var _templateObject$3, _templateObject2$1;
2676
2630
  const formatTime = 'HH:mm:ss.SSS';
2677
2631
 
2678
2632
  /* TimeInput only allows HH:mm:ss and adds the seconds as 00 and
@@ -2694,7 +2648,6 @@ const defaultFilterValidator = _ref => {
2694
2648
  const timeTransformer = function (filterKey, filters) {
2695
2649
  let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultFilterValidator;
2696
2650
  const queries = _mapInstanceProperty__default["default"](filters).call(filters, _ref2 => {
2697
- var _context, _context2;
2698
2651
  let type = _ref2.type,
2699
2652
  value = _ref2.value;
2700
2653
  if (!filterValidator({
@@ -2703,13 +2656,19 @@ const timeTransformer = function (filterKey, filters) {
2703
2656
  })) return '';
2704
2657
  switch (type) {
2705
2658
  case FILTER_TYPES.lessThan:
2706
- return _concatInstanceProperty__default["default"](_context = "".concat(filterKey, " < \"")).call(_context, value, "\"");
2659
+ return `${filterKey} < "${value}"`;
2707
2660
  case FILTER_TYPES.moreThan:
2708
- return _concatInstanceProperty__default["default"](_context2 = "".concat(filterKey, " > \"")).call(_context2, value, "\"");
2661
+ return `${filterKey} > "${value}"`;
2709
2662
  case FILTER_TYPES.equalTo:
2710
- return oneLine__default["default"](_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n (", " >= \"", "\"\n and ", " <= \"", "\")\n "])), filterKey, value, filterKey, getEndOfSecond(value));
2663
+ return oneLine__default["default"]`
2664
+ (${filterKey} >= "${value}"
2665
+ and ${filterKey} <= "${getEndOfSecond(value)}")
2666
+ `;
2711
2667
  case FILTER_TYPES.range:
2712
- return oneLine__default["default"](_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n (", " >= \"", "\"\n and ", " <= \"", "\")\n "])), filterKey, value.from, filterKey, getEndOfSecond(value.to));
2668
+ return oneLine__default["default"]`
2669
+ (${filterKey} >= "${value.from}"
2670
+ and ${filterKey} <= "${getEndOfSecond(value.to)}")
2671
+ `;
2713
2672
  default:
2714
2673
  return '';
2715
2674
  }
@@ -2725,19 +2684,21 @@ const timeTransformer = function (filterKey, filters) {
2725
2684
  * (pickUpTime >= "14:00" and pickUpTime <= "15:00")
2726
2685
  * ) or some_more_filters
2727
2686
  */
2728
- return queryString === '' ? null : "(".concat(queryString, ")");
2687
+ return queryString === '' ? null : `(${queryString})`;
2729
2688
  };
2730
2689
 
2731
- var _templateObject$2;
2732
2690
  function formatDateRangeValue(value, type) {
2733
2691
  let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
2734
2692
  locale: 'en',
2735
2693
  timeZone: moment__default$1["default"].tz.guess()
2736
2694
  };
2737
2695
  if (value.from === value.to) return formatDateTime$1(type, value.from, options);
2738
- if (value.from && value.to) return oneLine__default["default"](_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n ", " -\n ", "\n "])), formatDateTime$1(type, value.from, options), formatDateTime$1(type, value.to, options));
2739
- if (value.from) return "from ".concat(formatDateTime$1(type, value.from, options));
2740
- if (value.to) return "to ".concat(formatDateTime$1(type, value.to, options));
2696
+ if (value.from && value.to) return oneLine__default["default"]`
2697
+ ${formatDateTime$1(type, value.from, options)} -
2698
+ ${formatDateTime$1(type, value.to, options)}
2699
+ `;
2700
+ if (value.from) return `from ${formatDateTime$1(type, value.from, options)}`;
2701
+ if (value.to) return `to ${formatDateTime$1(type, value.to, options)}`;
2741
2702
  return '';
2742
2703
  }
2743
2704
  function formatDateTime$1(type, value) {
@@ -3934,13 +3895,13 @@ const getData = (code, field) => {
3934
3895
  const getFractionDigit = code => getData(code, 'fractionDigit');
3935
3896
 
3936
3897
  function ownKeys$16(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
3937
- function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$16(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$16(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
3898
+ function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$16(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$16(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
3938
3899
  function formatMoneyRangeValue(value, intl) {
3939
- var _context;
3940
3900
  if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
3941
- if (value.from && value.to) return _concatInstanceProperty__default["default"](_context = "".concat(formatMoneyValue(value.from, value.currency, intl), " -\n ")).call(_context, formatMoneyValue(value.to, value.currency, intl));
3942
- if (value.from) return "from ".concat(formatMoneyValue(value.from, value.currency, intl));
3943
- if (value.to) return "to ".concat(formatMoneyValue(value.to, value.currency, intl));
3901
+ if (value.from && value.to) return `${formatMoneyValue(value.from, value.currency, intl)} -
3902
+ ${formatMoneyValue(value.to, value.currency, intl)}`;
3903
+ if (value.from) return `from ${formatMoneyValue(value.from, value.currency, intl)}`;
3904
+ if (value.to) return `to ${formatMoneyValue(value.to, value.currency, intl)}`;
3944
3905
  return '';
3945
3906
  }
3946
3907
  function formatMoneyValue(amount, currency, intl) {
@@ -3960,8 +3921,7 @@ function getFractionedAmount(moneyValue) {
3960
3921
  return amount / 10 ** fractionDigits;
3961
3922
  }
3962
3923
  function formatMoney$2(moneyValue, intl, options) {
3963
- var _moneyValue$fractione;
3964
- return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$16({
3924
+ return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$16({
3965
3925
  style: 'currency',
3966
3926
  currency: moneyValue.currencyCode,
3967
3927
  minimumFractionDigits: moneyValue.fractionDigits
@@ -3982,13 +3942,11 @@ var messages$D = reactIntl.defineMessages({
3982
3942
  });
3983
3943
 
3984
3944
  const formatEnum = _ref => {
3985
- var _context;
3986
3945
  let value = _ref.value,
3987
3946
  fallbackValue = _ref.fallbackValue;
3988
- return value.label || _concatInstanceProperty__default["default"](_context = "".concat(fallbackValue, " (")).call(_context, value.key, ")");
3947
+ return value.label || `${fallbackValue} (${value.key})`;
3989
3948
  };
3990
3949
  const formatLenum = _ref2 => {
3991
- var _context2;
3992
3950
  let value = _ref2.value,
3993
3951
  language = _ref2.language,
3994
3952
  languages = _ref2.languages,
@@ -3996,7 +3954,7 @@ const formatLenum = _ref2 => {
3996
3954
  return l10n.formatLocalizedString(value, {
3997
3955
  key: 'label',
3998
3956
  locale: language,
3999
- fallback: _concatInstanceProperty__default["default"](_context2 = "".concat(fallbackValue, " (")).call(_context2, value.key, ")"),
3957
+ fallback: `${fallbackValue} (${value.key})`,
4000
3958
  fallbackOrder: languages
4001
3959
  });
4002
3960
  };
@@ -4032,7 +3990,6 @@ const formatDate = _ref6 => {
4032
3990
  });
4033
3991
  };
4034
3992
  const formatDateTime = _ref7 => {
4035
- var _context3;
4036
3993
  let value = _ref7.value,
4037
3994
  userTimeZone = _ref7.userTimeZone,
4038
3995
  intl = _ref7.intl;
@@ -4048,7 +4005,7 @@ const formatDateTime = _ref7 => {
4048
4005
  // defaults to utc if timeZone is not provided
4049
4006
  timeZone: userTimeZone || 'utc'
4050
4007
  });
4051
- return _concatInstanceProperty__default["default"](_context3 = "".concat(date, " (")).call(_context3, time, ")");
4008
+ return `${date} (${time})`;
4052
4009
  };
4053
4010
  const formatBoolean = _ref8 => {
4054
4011
  let value = _ref8.value,
@@ -4071,7 +4028,7 @@ const formatUnknown = _ref10 => {
4071
4028
  fallbackValue = _ref10.fallbackValue;
4072
4029
  // NOTE This is reporting within the render function, which is supposed to
4073
4030
  // be pure. This is quite bad as this is a side-effect in the render fn.
4074
- sentry.reportErrorToSentry(new Error("Unhandled custom attribute type '".concat(type.name, "' for value")), {
4031
+ sentry.reportErrorToSentry(new Error(`Unhandled custom attribute type '${type.name}' for value`), {
4075
4032
  extra: {
4076
4033
  value
4077
4034
  }
@@ -4144,10 +4101,9 @@ const attributeTypeNames = {
4144
4101
  Number: 'number'
4145
4102
  };
4146
4103
  const convertToAttributeType = customFieldType => {
4147
- var _customFieldType$elem;
4148
4104
  if (isNil__default["default"](customFieldType)) return customFieldType;
4149
4105
  const attributeTypeName = attributeTypeNames[customFieldType.name];
4150
- const elementTypeName = attributeTypeNames[(_customFieldType$elem = customFieldType.elementType) === null || _customFieldType$elem === void 0 ? void 0 : _customFieldType$elem.name];
4106
+ const elementTypeName = attributeTypeNames[customFieldType.elementType?.name];
4151
4107
  return {
4152
4108
  name: attributeTypeName,
4153
4109
  elementType: {
@@ -4208,9 +4164,8 @@ function formatCustomField(_ref) {
4208
4164
  // e.g
4209
4165
  // where: `masterData(current(name(en >= "${lowerBound}" and en < "${upperBound}")))`
4210
4166
  const getPrefixSearchBounds = input => {
4211
- var _context;
4212
4167
  const getNextCharacter = character => String.fromCharCode(character.charCodeAt() + 1);
4213
- return [input, _concatInstanceProperty__default["default"](_context = "".concat(_sliceInstanceProperty__default["default"](input).call(input, 0, input.length - 1))).call(_context, getNextCharacter(_sliceInstanceProperty__default["default"](input).call(input, input.length - 1)))];
4168
+ return [input, `${_sliceInstanceProperty__default["default"](input).call(input, 0, input.length - 1)}${getNextCharacter(_sliceInstanceProperty__default["default"](input).call(input, input.length - 1))}`];
4214
4169
  };
4215
4170
 
4216
4171
  const _excluded$2 = ["action"];
@@ -4403,7 +4358,7 @@ const convertChangeValueAction = actionPayload => {
4403
4358
  * as its dynamic content can not be typed in SDL for the mutation.
4404
4359
  */
4405
4360
  const convertAction = (actionName, actionPayload) => {
4406
- var _actionPayload$type, _context3, _actionPayload$geoLoc, _actionPayload$geoLoc2, _actionPayload$shippi, _context4, _context5;
4361
+ var _context3, _context4, _context5;
4407
4362
  const getNameFromPayload = payload => {
4408
4363
  // changeName for `Organizations`
4409
4364
  if (typeof payload.name === 'string') return payload;
@@ -4468,7 +4423,7 @@ const convertAction = (actionName, actionPayload) => {
4468
4423
  case 'setCustomType':
4469
4424
  return {
4470
4425
  [actionName]: {
4471
- typeId: (_actionPayload$type = actionPayload.type) === null || _actionPayload$type === void 0 ? void 0 : _actionPayload$type.id,
4426
+ typeId: actionPayload.type?.id,
4472
4427
  fields: actionPayload.fields ? _mapInstanceProperty__default["default"](_context3 = _Object$entries__default["default"](actionPayload.fields)).call(_context3, _ref => {
4473
4428
  let _ref2 = _slicedToArray(_ref, 2),
4474
4429
  customField = _ref2[0],
@@ -4498,10 +4453,10 @@ const convertAction = (actionName, actionPayload) => {
4498
4453
  };
4499
4454
  case 'setGeoLocation':
4500
4455
  return {
4501
- [actionName]: actionPayload !== null && actionPayload !== void 0 && actionPayload.geoLocation ? {
4456
+ [actionName]: actionPayload?.geoLocation ? {
4502
4457
  geoLocation: {
4503
4458
  type: 'Point',
4504
- coordinates: [_parseFloat__default["default"]((_actionPayload$geoLoc = actionPayload.geoLocation) === null || _actionPayload$geoLoc === void 0 ? void 0 : _actionPayload$geoLoc.longitude), _parseFloat__default["default"]((_actionPayload$geoLoc2 = actionPayload.geoLocation) === null || _actionPayload$geoLoc2 === void 0 ? void 0 : _actionPayload$geoLoc2.latitude)]
4459
+ coordinates: [_parseFloat__default["default"](actionPayload.geoLocation?.longitude), _parseFloat__default["default"](actionPayload.geoLocation?.latitude)]
4505
4460
  }
4506
4461
  } : {
4507
4462
  undefined
@@ -4637,7 +4592,7 @@ const convertAction = (actionName, actionPayload) => {
4637
4592
  case 'setShippingRateInputType':
4638
4593
  return {
4639
4594
  [actionName]: {
4640
- shippingRateInputType: (_actionPayload$shippi = actionPayload.shippingRateInputType) !== null && _actionPayload$shippi !== void 0 && _actionPayload$shippi.type ? {
4595
+ shippingRateInputType: actionPayload.shippingRateInputType?.type ? {
4641
4596
  [actionPayload.shippingRateInputType.type]: {
4642
4597
  values: actionPayload.shippingRateInputType.type === 'CartClassification' ? _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](actionPayload.shippingRateInputType)).call(_context4, value => ({
4643
4598
  key: value.key,
@@ -4691,8 +4646,8 @@ const convertAction = (actionName, actionPayload) => {
4691
4646
  case 'addAddress':
4692
4647
  case 'changeAddress':
4693
4648
  {
4694
- var _actionPayload$addres, _context6, _actionPayload$addres2;
4695
- const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
4649
+ var _context6;
4650
+ const _ref3 = actionPayload.address?.custom || {},
4696
4651
  _ref3$fields = _ref3.fields,
4697
4652
  fields = _ref3$fields === void 0 ? {} : _ref3$fields;
4698
4653
  const customFields = isEmpty__default["default"](fields) ? null : _mapInstanceProperty__default["default"](_context6 = _Object$entries__default["default"](fields)).call(_context6, _ref4 => {
@@ -4704,7 +4659,7 @@ const convertAction = (actionName, actionPayload) => {
4704
4659
  value: _JSON$stringify__default["default"](value)
4705
4660
  };
4706
4661
  });
4707
- const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.custom) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.type) !== null && _actionPayload$addres2 !== void 0 && _actionPayload$addres2.id ? {
4662
+ const custom = actionPayload.address?.custom?.type?.id ? {
4708
4663
  type: {
4709
4664
  id: actionPayload.address.custom.type.id
4710
4665
  },
@@ -4735,7 +4690,7 @@ const convertAction = (actionName, actionPayload) => {
4735
4690
  value: _JSON$stringify__default["default"](value)
4736
4691
  };
4737
4692
  });
4738
- const customType = type !== null && type !== void 0 && type.id ? {
4693
+ const customType = type?.id ? {
4739
4694
  id: type.id
4740
4695
  } : null;
4741
4696
  return {
@@ -4758,11 +4713,10 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["
4758
4713
  return [...previousActions, convertAction(actionName, actionPayload)];
4759
4714
  }, []);
4760
4715
  const extractErrorFromGraphQlResponse = graphQlResponse => {
4761
- var _graphQlResponse$netw, _graphQlResponse$grap;
4762
- if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.result) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.errors) === null || _graphQlResponse$netw === void 0 ? void 0 : _graphQlResponse$netw.length) > 0) {
4716
+ if (graphQlResponse.networkError?.result?.errors?.length > 0) {
4763
4717
  return graphQlResponse.networkError.result.errors;
4764
4718
  }
4765
- if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
4719
+ if (graphQlResponse.graphQLErrors?.length > 0) {
4766
4720
  return graphQlResponse.graphQLErrors;
4767
4721
  }
4768
4722
  return graphQlResponse;
@@ -4823,16 +4777,14 @@ function omitDeep(obj, fieldsToOmit) {
4823
4777
  function ownKeys$14(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
4824
4778
  function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$14(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
4825
4779
  function getPriceChannelName(price) {
4826
- var _ref, _price$channel$name, _price$channel, _price$channel2;
4827
- return (_ref = (_price$channel$name = (_price$channel = price.channel) === null || _price$channel === void 0 ? void 0 : _price$channel.name) !== null && _price$channel$name !== void 0 ? _price$channel$name : (_price$channel2 = price.channel) === null || _price$channel2 === void 0 ? void 0 : _price$channel2.key) !== null && _ref !== void 0 ? _ref : null;
4780
+ return price.channel?.name ?? price.channel?.key ?? null;
4828
4781
  }
4829
4782
  function getDiscountValue(price) {
4830
- var _price$value, _price$value2, _price$discounted;
4831
4783
  let preciseAmount;
4832
4784
  let fractionedAmount;
4833
- if (((_price$value = price.value) === null || _price$value === void 0 ? void 0 : _price$value.type) === PRECISION_TYPES.highPrecision && price.discounted.value.type === PRECISION_TYPES.highPrecision) {
4785
+ if (price.value?.type === PRECISION_TYPES.highPrecision && price.discounted.value.type === PRECISION_TYPES.highPrecision) {
4834
4786
  preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
4835
- } else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 || (_price$discounted = _price$discounted.value) === null || _price$discounted === void 0 ? void 0 : _price$discounted.type) === PRECISION_TYPES.centPrecision) {
4787
+ } else if (price.value?.type === PRECISION_TYPES.highPrecision && price.discounted?.value?.type === PRECISION_TYPES.centPrecision) {
4836
4788
  fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
4837
4789
  }
4838
4790
  return price.discounted ? _objectSpread$14(_objectSpread$14({}, price.value), {}, {
@@ -4846,28 +4798,23 @@ function getDiscountValue(price) {
4846
4798
  function getSelectedPrice(price) {
4847
4799
  return price.discounted ? price.discounted : price;
4848
4800
  }
4849
- function getNetUnitPrice(_ref2) {
4850
- var _lineItem$perMethodTa, _filteredPerMethodTax;
4851
- let lineItem = _ref2.lineItem,
4852
- shouldRoundAmount = _ref2.shouldRoundAmount;
4801
+ function getNetUnitPrice(_ref) {
4802
+ let lineItem = _ref.lineItem,
4803
+ shouldRoundAmount = _ref.shouldRoundAmount;
4853
4804
  const price = getSelectedPrice(lineItem.price);
4854
- const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 || (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
4855
- var _lineItem$shippingDet;
4856
- return (lineItem === null || lineItem === void 0 || (_lineItem$shippingDet = lineItem.shippingDetails) === null || _lineItem$shippingDet === void 0 || (_lineItem$shippingDet = _lineItem$shippingDet.targets) === null || _lineItem$shippingDet === void 0 ? void 0 : _findIndexInstanceProperty__default["default"](_lineItem$shippingDet).call(_lineItem$shippingDet, target => (target === null || target === void 0 ? void 0 : target.shippingMethodKey) === (perMethodTax === null || perMethodTax === void 0 ? void 0 : perMethodTax.shippingMethodKey))) >= 0;
4857
- });
4805
+ const filteredPerMethodTaxRate = lineItem?.perMethodTaxRate?.filter(perMethodTax => lineItem?.shippingDetails?.targets?.findIndex(target => target?.shippingMethodKey === perMethodTax?.shippingMethodKey) >= 0);
4858
4806
 
4859
4807
  // when shipping mode is multi with the same tax rate
4860
- if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (_filteredPerMethodTax = _filteredPerMethodTax.taxRate) !== null && _filteredPerMethodTax !== void 0 && _filteredPerMethodTax.includedInPrice) {
4861
- var _price$value3, _price$value4;
4808
+ if (filteredPerMethodTaxRate?.length > 0 && filteredPerMethodTaxRate[0]?.taxRate?.includedInPrice) {
4862
4809
  const taxRate = filteredPerMethodTaxRate[0].taxRate;
4863
4810
  let centAmount;
4864
4811
  // should accept 0 value
4865
- if (typeof ((_price$value3 = price.value) === null || _price$value3 === void 0 ? void 0 : _price$value3.centAmount) === 'number') {
4812
+ if (typeof price.value?.centAmount === 'number') {
4866
4813
  const amount = price.value.centAmount / (1 + taxRate.amount);
4867
4814
  centAmount = shouldRoundAmount ? Math.round(amount) : amount;
4868
4815
  }
4869
4816
  let preciseAmount;
4870
- if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
4817
+ if (price.value?.type === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
4871
4818
  return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
4872
4819
  centAmount,
4873
4820
  preciseAmount
@@ -4876,15 +4823,14 @@ function getNetUnitPrice(_ref2) {
4876
4823
 
4877
4824
  // when shipping mode is single
4878
4825
  if (lineItem.taxRate && lineItem.taxRate.includedInPrice) {
4879
- var _price$value5, _price$value6;
4880
4826
  let centAmount;
4881
4827
  // should accept 0 value
4882
- if (typeof ((_price$value5 = price.value) === null || _price$value5 === void 0 ? void 0 : _price$value5.centAmount) === 'number') {
4828
+ if (typeof price.value?.centAmount === 'number') {
4883
4829
  const amount = price.value.centAmount / (1 + lineItem.taxRate.amount);
4884
4830
  centAmount = shouldRoundAmount ? Math.round(amount) : amount;
4885
4831
  }
4886
4832
  let preciseAmount;
4887
- if (((_price$value6 = price.value) === null || _price$value6 === void 0 ? void 0 : _price$value6.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
4833
+ if (price.value?.type === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
4888
4834
  return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
4889
4835
  centAmount,
4890
4836
  preciseAmount
@@ -4918,18 +4864,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
4918
4864
  key: resource.custom.type.key,
4919
4865
  name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
4920
4866
  fieldDefinitions: _mapInstanceProperty__default["default"](_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
4921
- var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
4867
+ var _context2, _context3;
4922
4868
  return {
4923
4869
  name: fieldDefinition.name,
4924
4870
  required: fieldDefinition.required,
4925
- type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
4871
+ type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
4926
4872
  elementType: _objectSpread$13(_objectSpread$13({}, fieldDefinition.type.elementType), {}, {
4927
4873
  values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
4928
4874
  key: value.key,
4929
4875
  label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
4930
4876
  }))
4931
4877
  })
4932
- }) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
4878
+ }) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
4933
4879
  values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
4934
4880
  key: value.key,
4935
4881
  label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
@@ -4956,7 +4902,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
4956
4902
  from: 'nameAllLocales',
4957
4903
  to: 'name'
4958
4904
  }])), {}, {
4959
- custom: productSelection !== null && productSelection !== void 0 && productSelection.custom ? transformCustomFieldFromGraphQLResponse(productSelection) : null
4905
+ custom: productSelection?.custom ? transformCustomFieldFromGraphQLResponse(productSelection) : null
4960
4906
  });
4961
4907
  };
4962
4908
 
@@ -5079,7 +5025,7 @@ function omitSetsOfSets() {
5079
5025
  * duplicated in original values
5080
5026
  */
5081
5027
  function unique(values, properties) {
5082
- var _context2;
5028
+ var _context;
5083
5029
  let ignoredValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['', null, undefined];
5084
5030
  const duplicateValues = [];
5085
5031
  let realValues;
@@ -5088,20 +5034,19 @@ function unique(values, properties) {
5088
5034
  realValues = _filterInstanceProperty__default["default"](values).call(values, value => !_includesInstanceProperty__default["default"](ignoredValues).call(ignoredValues, value));
5089
5035
  if (!realValues.length) return [];
5090
5036
  if (properties) realValues = _mapInstanceProperty__default["default"](realValues).call(realValues, value => _reduceInstanceProperty__default["default"](properties).call(properties, (prev, curr) => {
5091
- var _context;
5092
5037
  const currentValue = value[curr] || '';
5093
- return _concatInstanceProperty__default["default"](_context = "".concat(prev, ":")).call(_context, currentValue);
5038
+ return `${prev}:${currentValue}`;
5094
5039
  }, ''));else realValues = _sliceInstanceProperty__default["default"](values).call(values, 0);
5095
5040
 
5096
5041
  // TODO: checking for dupes like this is slow, find a better way
5097
- _reduceInstanceProperty__default["default"](_context2 = _sortInstanceProperty__default["default"](realValues).call(realValues)).call(_context2, (prev, curr) => {
5042
+ _reduceInstanceProperty__default["default"](_context = _sortInstanceProperty__default["default"](realValues).call(realValues)).call(_context, (prev, curr) => {
5098
5043
  if (curr === null) return curr;
5099
5044
  if (curr !== '' && prev === curr && _indexOfInstanceProperty__default["default"](duplicateValues).call(duplicateValues, curr) === -1) duplicateValues.push(curr);
5100
5045
  return curr;
5101
5046
  });
5102
5047
  if (properties) return _mapInstanceProperty__default["default"](duplicateValues).call(duplicateValues, value => {
5103
- var _context3;
5104
- const parts = _sliceInstanceProperty__default["default"](_context3 = value.split(':')).call(_context3, 1);
5048
+ var _context2;
5049
+ const parts = _sliceInstanceProperty__default["default"](_context2 = value.split(':')).call(_context2, 1);
5105
5050
  return _reduceInstanceProperty__default["default"](properties).call(properties, (prev, curr, index) => {
5106
5051
  // eslint-disable-next-line no-param-reassign
5107
5052
  prev[curr] = parts[index];
@@ -5120,14 +5065,14 @@ function unique(values, properties) {
5120
5065
  * @return Array<Object> returns an array of objects with all duplicated values
5121
5066
  */
5122
5067
  function uniqueObjects(items) {
5123
- var _context4;
5068
+ var _context3;
5124
5069
  const emptyValues = [undefined, null, ''];
5125
- const itemsWorkingSet = items && items.length ? _filterInstanceProperty__default["default"](_context4 = _sliceInstanceProperty__default["default"](items).call(items)).call(_context4, x => !_includesInstanceProperty__default["default"](emptyValues).call(emptyValues, x)) : [];
5070
+ const itemsWorkingSet = items && items.length ? _filterInstanceProperty__default["default"](_context3 = _sliceInstanceProperty__default["default"](items).call(items)).call(_context3, x => !_includesInstanceProperty__default["default"](emptyValues).call(emptyValues, x)) : [];
5126
5071
  const duplicateValues = _reduceInstanceProperty__default["default"](itemsWorkingSet).call(itemsWorkingSet, (acc, item, index) => {
5127
- var _context5;
5072
+ var _context4;
5128
5073
  if (item === null) return acc;
5129
- const isDuplicate = _reduceInstanceProperty__default["default"](_context5 = _sliceInstanceProperty__default["default"](itemsWorkingSet).call(itemsWorkingSet, index + 1) // get sub-array after this index
5130
- ).call(_context5, (duplicateAcc, comparisonItem, comparisonIndex) => {
5074
+ const isDuplicate = _reduceInstanceProperty__default["default"](_context4 = _sliceInstanceProperty__default["default"](itemsWorkingSet).call(itemsWorkingSet, index + 1) // get sub-array after this index
5075
+ ).call(_context4, (duplicateAcc, comparisonItem, comparisonIndex) => {
5131
5076
  if (comparisonItem === null) return duplicateAcc;
5132
5077
 
5133
5078
  // check if its a dupe
@@ -5254,7 +5199,7 @@ function getCategoriesByIds(apolloClient, options) {
5254
5199
  return apolloClient.query({
5255
5200
  query: FetchCategoriesByIds,
5256
5201
  variables: {
5257
- where: "id in (".concat(_mapInstanceProperty__default["default"](_context2 = options.ids).call(_context2, id => "\"".concat(id, "\"")).join(', '), ")")
5202
+ where: `id in (${_mapInstanceProperty__default["default"](_context2 = options.ids).call(_context2, id => `"${id}"`).join(', ')})`
5258
5203
  },
5259
5204
  context: {
5260
5205
  target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
@@ -5274,8 +5219,8 @@ function getCategoriesByIds(apolloClient, options) {
5274
5219
  var SearchCartDiscount = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "SearchCartDiscount" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "500" } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 425, source: { body: "query SearchCartDiscount($where: String) {\n cartDiscounts(limit: 500, where: $where) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n\nquery FetchCartDiscountById($cartDiscountId: String!) {\n cartDiscount(id: $cartDiscountId) {\n id\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
5275
5220
  var FetchCartDiscountById = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchCartDiscountById" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "cartDiscountId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscount" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "cartDiscountId" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 425, source: { body: "query SearchCartDiscount($where: String) {\n cartDiscounts(limit: 500, where: $where) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n\nquery FetchCartDiscountById($cartDiscountId: String!) {\n cartDiscount(id: $cartDiscountId) {\n id\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
5276
5221
  const transformCartDiscountResponse = response => {
5277
- var _context, _response$data;
5278
- return _mapInstanceProperty__default["default"](_context = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.cartDiscounts.results) || []).call(_context, cartDiscount => transformLocalizedFieldsForCartDiscount(cartDiscount));
5222
+ var _context;
5223
+ return _mapInstanceProperty__default["default"](_context = response.data?.cartDiscounts.results || []).call(_context, cartDiscount => transformLocalizedFieldsForCartDiscount(cartDiscount));
5279
5224
  };
5280
5225
  function queryCartDiscounts(apolloClient) {
5281
5226
  return apolloClient.query({
@@ -5287,14 +5232,14 @@ function queryCartDiscounts(apolloClient) {
5287
5232
  }).then(transformCartDiscountResponse);
5288
5233
  }
5289
5234
  const getWhereClause = function () {
5290
- var _context2, _context3, _context4;
5235
+ var _context2, _context3;
5291
5236
  let searchText = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5292
5237
  let language = arguments.length > 1 ? arguments[1] : undefined;
5293
5238
  const query = _trimInstanceProperty__default["default"](_context2 = _JSON$stringify__default["default"](searchText)).call(_context2);
5294
- const idQuery = isUUID(searchText) && "id = ".concat(query);
5295
- const nameQuery = _concatInstanceProperty__default["default"](_context3 = "name(".concat(language, " = ")).call(_context3, query, ")");
5296
- const keyQuery = "key = ".concat(query);
5297
- return _filterInstanceProperty__default["default"](_context4 = [idQuery, nameQuery, keyQuery]).call(_context4, Boolean).join(' or ');
5239
+ const idQuery = isUUID(searchText) && `id = ${query}`;
5240
+ const nameQuery = `name(${language} = ${query})`;
5241
+ const keyQuery = `key = ${query}`;
5242
+ return _filterInstanceProperty__default["default"](_context3 = [idQuery, nameQuery, keyQuery]).call(_context3, Boolean).join(' or ');
5298
5243
  };
5299
5244
  function searchCartDiscountsByExactMatch(apolloClient, options) {
5300
5245
  return apolloClient.query({
@@ -5317,10 +5262,7 @@ function getCartDiscountById(apolloClient, options) {
5317
5262
  context: {
5318
5263
  target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
5319
5264
  }
5320
- }).then(response => {
5321
- var _response$data2;
5322
- return (_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.cartDiscount ? transformLocalizedFieldsForCartDiscount(response.data.cartDiscount) : null;
5323
- });
5265
+ }).then(response => response.data?.cartDiscount ? transformLocalizedFieldsForCartDiscount(response.data.cartDiscount) : null);
5324
5266
  }
5325
5267
 
5326
5268
  var styles$g = {
@@ -5405,13 +5347,10 @@ const useReferenceSearchItems = _ref => {
5405
5347
  };
5406
5348
  };
5407
5349
  function ReferenceSearch(props) {
5408
- const ids = React.useMemo(() => {
5409
- var _props$value, _props$value2;
5410
- return props.value ? props.isMulti ? (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _mapInstanceProperty__default["default"](_props$value).call(_props$value, _ref2 => {
5411
- let id = _ref2.id;
5412
- return id;
5413
- }) : [(_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.id] : [];
5414
- }, [props.value, props.isMulti]);
5350
+ const ids = React.useMemo(() => props.value ? props.isMulti ? props.value?.map(_ref2 => {
5351
+ let id = _ref2.id;
5352
+ return id;
5353
+ }) : [props.value?.id] : [], [props.value, props.isMulti]);
5415
5354
  const _useReferenceSearchIt = useReferenceSearchItems({
5416
5355
  loadItemsBySearchTerm: props.loadItemsBySearchTerm,
5417
5356
  loadItemsByIds: props.loadItemsByIds,
@@ -5422,14 +5361,14 @@ function ReferenceSearch(props) {
5422
5361
  areSomeItemsMissing = _useReferenceSearchIt.areSomeItemsMissing,
5423
5362
  handleLoadItems = _useReferenceSearchIt.handleLoadItems;
5424
5363
  if (areItemsLoading) return null;
5425
- const value = props.isMulti ? items : items === null || items === void 0 ? void 0 : items[0];
5364
+ const value = props.isMulti ? items : items?.[0];
5426
5365
  let filterValue = null;
5427
5366
  if (value) filterValue = props.isMulti ? _mapInstanceProperty__default["default"](value).call(value, props.mapItemToOption) : props.mapItemToOption(value);
5428
5367
  const tooltipTitle = value || props.value ? props.mapItemToOption(value || props.value).label : '';
5429
5368
  const loadItems = value => _Promise__default["default"].resolve(handleLoadItems(value)).then(items => _mapInstanceProperty__default["default"](items).call(items, item => props.mapItemToOption(item)));
5430
5369
  const handleChange = event => {
5431
- var _context, _event$target$value;
5432
- const option = props.isMulti ? _mapInstanceProperty__default["default"](_context = event.target.value).call(_context, item => item.value) : ((_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value) || null;
5370
+ var _context;
5371
+ const option = props.isMulti ? _mapInstanceProperty__default["default"](_context = event.target.value).call(_context, item => item.value) : event.target.value?.value || null;
5433
5372
  props.onChange(option);
5434
5373
  };
5435
5374
  return jsxRuntime.jsxs("div", {
@@ -5543,7 +5482,7 @@ function CartDiscountReferenceSearch(props) {
5543
5482
  }),
5544
5483
  loading = _useQuery.loading,
5545
5484
  data = _useQuery.data;
5546
- const isExactMatch = (data === null || data === void 0 ? void 0 : data.cartDiscounts.total) > QUERY_MAX_LIMIT;
5485
+ const isExactMatch = data?.cartDiscounts.total > QUERY_MAX_LIMIT;
5547
5486
  const _useIntl = reactIntl.useIntl(),
5548
5487
  formatMessage = _useIntl.formatMessage;
5549
5488
  const apolloClient = client.useApolloClient();
@@ -5643,9 +5582,8 @@ const messages$A = reactIntl.defineMessages({
5643
5582
  });
5644
5583
 
5645
5584
  function ownKeys$$(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
5646
- function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$$(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$$(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
5585
+ function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$$(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$$(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
5647
5586
  function Option(props) {
5648
- var _context, _context2;
5649
5587
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
5650
5588
  language: applicationContext.dataLocale,
5651
5589
  languages: applicationContext.project.languages
@@ -5666,19 +5604,19 @@ function Option(props) {
5666
5604
  fallbackOrder: languages
5667
5605
  })
5668
5606
  }), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
5669
- children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$A.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
5607
+ children: `${formatMessage(messages$A.parentCategory)}: ${l10n.formatLocalizedString(category.parent, {
5670
5608
  key: 'name',
5671
5609
  locale: language,
5672
5610
  fallbackOrder: languages
5673
- }))
5611
+ })}`
5674
5612
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
5675
- children: "Slug: ".concat(l10n.formatLocalizedString(category, {
5613
+ children: `Slug: ${l10n.formatLocalizedString(category, {
5676
5614
  key: 'slug',
5677
5615
  locale: language,
5678
5616
  fallbackOrder: languages
5679
- }))
5617
+ })}`
5680
5618
  }), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
5681
- children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$A.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
5619
+ children: `${formatMessage(messages$A.externalId)}: ${category.externalId || constants.NO_VALUE_FALLBACK}`
5682
5620
  })]
5683
5621
  })
5684
5622
  }));
@@ -5742,7 +5680,7 @@ var CategorySearchPickerOptionFragment$1 = { kind: "Document", definitions: [{ k
5742
5680
  function useCachedCategoryOptions(ids) {
5743
5681
  const apolloClient = client.useApolloClient();
5744
5682
  const fragments = _mapInstanceProperty__default["default"](ids).call(ids, id => apolloClient.readFragment({
5745
- id: "CategorySearch:".concat(id),
5683
+ id: `CategorySearch:${id}`,
5746
5684
  fragment: CategorySearchPickerOptionFragment$1
5747
5685
  }));
5748
5686
  return _mapInstanceProperty__default["default"](fragments).call(fragments, category => transformLocalizedFieldsForCategory(category, [{
@@ -5867,8 +5805,7 @@ function CountriesAsyncSelectDropdown(props) {
5867
5805
  var _context2;
5868
5806
  const intl = reactIntl.useIntl();
5869
5807
  const handleLoadOptions = async searchTerm => {
5870
- var _props$options, _props$options2;
5871
- const filteredOptions = (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _filterInstanceProperty__default["default"](_props$options).call(_props$options, country => {
5808
+ const filteredOptions = props.options?.filter(country => {
5872
5809
  var _context;
5873
5810
  return _includesInstanceProperty__default["default"](_context = country.label.toLowerCase()).call(_context, searchTerm.toLowerCase());
5874
5811
  });
@@ -5876,7 +5813,7 @@ function CountriesAsyncSelectDropdown(props) {
5876
5813
  return _sliceInstanceProperty__default["default"](filteredOptions).call(filteredOptions, 0, props.countriesAsyncLoadingLimit);
5877
5814
  }
5878
5815
  return [{
5879
- options: (_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _sliceInstanceProperty__default["default"](_props$options2).call(_props$options2, 0, props.countriesAsyncLoadingLimit)
5816
+ options: props.options?.slice(0, props.countriesAsyncLoadingLimit)
5880
5817
  }, {
5881
5818
  options: emptyCountryOption(intl)
5882
5819
  }];
@@ -5885,10 +5822,7 @@ function CountriesAsyncSelectDropdown(props) {
5885
5822
  const countries = event.target.value;
5886
5823
  props.onChange({
5887
5824
  target: _objectSpread$X(_objectSpread$X({}, event.target), {}, {
5888
- value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
5889
- var _country$value;
5890
- return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
5891
- })
5825
+ value: _mapInstanceProperty__default["default"](countries).call(countries, country => country?.value ?? country)
5892
5826
  })
5893
5827
  });
5894
5828
  };
@@ -5940,8 +5874,7 @@ const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
5940
5874
  function ownKeys$W(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
5941
5875
  function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$W(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$W(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
5942
5876
  function CountriesPicker(props) {
5943
- var _props$options;
5944
- const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
5877
+ const CustomCountriesPicker = props.options?.length <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
5945
5878
  return jsxRuntime.jsx(uiKit.Spacings.Stack, {
5946
5879
  children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$W({}, props))
5947
5880
  });
@@ -5970,7 +5903,6 @@ var GetCustomerGroupsQuery = { kind: "Document", definitions: [{ kind: "Operatio
5970
5903
  var GetCustomerGroupQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "customerGroup" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputCustomerGroups" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
5971
5904
  var PickerInputCustomerGroups = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
5972
5905
  const CustomerGroupPickerInput = _ref => {
5973
- var _currentOption$data$l, _currentOption$data;
5974
5906
  let isClearable = _ref.isClearable,
5975
5907
  isDisabled = _ref.isDisabled,
5976
5908
  isReadOnly = _ref.isReadOnly,
@@ -6039,13 +5971,13 @@ const CustomerGroupPickerInput = _ref => {
6039
5971
  setLoadingError(null);
6040
5972
  handleInternalInputChange(event);
6041
5973
  }, [handleInternalInputChange]);
6042
- const isCurrentOptionLoadingFailed = Boolean(currentOption === null || currentOption === void 0 ? void 0 : currentOption.error);
5974
+ const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
6043
5975
  React.useEffect(() => {
6044
5976
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
6045
5977
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
6046
5978
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
6047
5979
  const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$x.noCustomerGroupsFound), [loadingError, formatMessage]);
6048
- const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
5980
+ const tooltipTitle = currentOption?.data?.label ?? '';
6049
5981
  return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
6050
5982
  max: "scale",
6051
5983
  children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -6055,7 +5987,7 @@ const CustomerGroupPickerInput = _ref => {
6055
5987
  children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
6056
5988
  id: name,
6057
5989
  name: name,
6058
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$x.placeholder),
5990
+ placeholder: placeholder ?? formatMessage(messages$x.placeholder),
6059
5991
  loadOptions: loadOptionsDebounced,
6060
5992
  defaultOptions: true,
6061
5993
  showOptionGroupDivider: true,
@@ -6149,9 +6081,9 @@ const CustomFieldErrors = props => {
6149
6081
  const didFormValidationFail = useDidFormValidationFail();
6150
6082
  const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
6151
6083
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
6152
- children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
6084
+ children: [props.isTouched || didFormValidationFail && errors?.missing && jsxRuntime.jsx(_.ErrorMessage, {
6153
6085
  intlMessage: messages$C.required
6154
- }), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
6086
+ }), props.isTouched || didFormValidationFail && errors?.duplicated && jsxRuntime.jsx(_.ErrorMessage, {
6155
6087
  intlMessage: messages$C.unique
6156
6088
  })]
6157
6089
  });
@@ -6235,7 +6167,7 @@ const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spac
6235
6167
  }), jsxRuntime.jsx(uiKit.FlatButton, {
6236
6168
  tone: "primary",
6237
6169
  icon: props.isExpanded ? jsxRuntime.jsx(uiKit.AngleUpIcon, {}) : jsxRuntime.jsx(uiKit.AngleDownIcon, {}),
6238
- label: props.isExpanded ? "Hide set items (".concat(props.totalValues, ")") : "Show all set items (".concat(props.totalValues, ")"),
6170
+ label: props.isExpanded ? `Hide set items (${props.totalValues})` : `Show all set items (${props.totalValues})`,
6239
6171
  onClick: props.onExpand
6240
6172
  })]
6241
6173
  }) : null;
@@ -6270,7 +6202,7 @@ const SetButtons = props => {
6270
6202
  SetButtons.displayName = 'SetButtons';
6271
6203
 
6272
6204
  function ownKeys$U(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
6273
- function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$U(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$U(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
6205
+ function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$U(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$U(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
6274
6206
  const getDuplicateErrors = setValues => {
6275
6207
  /* eslint-disable no-plusplus */
6276
6208
  const result = [];
@@ -6310,13 +6242,10 @@ const getItemIndex = name => {
6310
6242
  return _parseInt__default["default"](rawIndex, 10);
6311
6243
  };
6312
6244
  const makeKeys = amount => times__default["default"](amount, () => uuid.v4());
6313
- const makeItemFieldName = (fieldName, index) => {
6314
- var _context;
6315
- return _concatInstanceProperty__default["default"](_context = "".concat(fieldName, ".[")).call(_context, index, "]");
6316
- };
6245
+ const makeItemFieldName = (fieldName, index) => `${fieldName}.[${index}]`;
6317
6246
  const makeMapForAllItems = (fieldName, items, value) => _reduceInstanceProperty__default["default"](items).call(items, (result, item, index) => set__default["default"](result, makeItemFieldName(fieldName, index), value), {});
6318
6247
  function CustomInputSet(props) {
6319
- var _context2;
6248
+ var _context;
6320
6249
  const _useToggleState = uiKit.useToggleState(false),
6321
6250
  _useToggleState2 = _slicedToArray(_useToggleState, 2),
6322
6251
  isExpanded = _useToggleState2[0],
@@ -6338,7 +6267,7 @@ function CustomInputSet(props) {
6338
6267
  _useState4 = _slicedToArray(_useState3, 2),
6339
6268
  keys = _useState4[0],
6340
6269
  setKeys = _useState4[1];
6341
- const totalAmount = internalValue === null || internalValue === void 0 ? void 0 : internalValue.length;
6270
+ const totalAmount = internalValue?.length;
6342
6271
  const amountToRender = isExpanded ? totalAmount : 1;
6343
6272
  const updateInternalValue = newValue => {
6344
6273
  const valueToSet = isEmpty$1(newValue) ? [undefined] : newValue;
@@ -6385,8 +6314,8 @@ function CustomInputSet(props) {
6385
6314
  // in <CustomFieldComponent /> where proper component for given field/attribute
6386
6315
  // type is selected.
6387
6316
  const type = getType(props.fieldDefinition);
6388
- const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
6389
- const areButtonsTopAligned = _includesInstanceProperty__default["default"](_context2 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context2, typeName);
6317
+ const typeName = type?.name.toLowerCase();
6318
+ const areButtonsTopAligned = _includesInstanceProperty__default["default"](_context = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context, typeName);
6390
6319
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
6391
6320
  children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
6392
6321
  children: jsxRuntime.jsx("label", {
@@ -6505,17 +6434,16 @@ function CustomDateTimeInput(props) {
6505
6434
  CustomDateTimeInput.displayName = 'CustomDateTimeInput';
6506
6435
 
6507
6436
  const convertTypeValuesToOptions$1 = reselect.defaultMemoize(typeValues => _mapInstanceProperty__default["default"](typeValues).call(typeValues, typeValue => ({
6508
- label: typeValue.label || "".concat(typeValue.key, " (key)"),
6437
+ label: typeValue.label || `${typeValue.key} (key)`,
6509
6438
  value: typeValue.key
6510
6439
  })));
6511
6440
  function CustomEnumInput(props) {
6512
- var _options$find$label, _options$find;
6513
6441
  const options = convertTypeValuesToOptions$1(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
6514
6442
  const handleChange = makeChangeHandler(rawValue => {
6515
6443
  props.setFieldValue(props.name, rawValue);
6516
6444
  props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6517
6445
  });
6518
- const tooltipTitle = props.value ? (_options$find$label = (_options$find = _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : '' : '';
6446
+ const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
6519
6447
  return jsxRuntime.jsx(CustomFieldTooltip, {
6520
6448
  title: tooltipTitle,
6521
6449
  children: jsxRuntime.jsx(uiKit.SelectInput, {
@@ -6544,13 +6472,12 @@ const convertTypeValuesToOptions = reselect.defaultMemoize((type, dataLocale, la
6544
6472
  key: 'label',
6545
6473
  locale: dataLocale,
6546
6474
  fallbackOrder: languages,
6547
- fallback: "".concat(value.key, " (key)")
6475
+ fallback: `${value.key} (key)`
6548
6476
  }),
6549
6477
  value: value.key
6550
6478
  }));
6551
6479
  });
6552
6480
  function CustomLocalizedEnumInput(props) {
6553
- var _options$find$label, _options$find;
6554
6481
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
6555
6482
  languages: applicationContext.project.languages,
6556
6483
  dataLocale: applicationContext.dataLocale
@@ -6562,7 +6489,7 @@ function CustomLocalizedEnumInput(props) {
6562
6489
  props.setFieldValue(props.name, rawValue);
6563
6490
  props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6564
6491
  });
6565
- const tooltipTitle = props.value ? (_options$find$label = (_options$find = _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : '' : '';
6492
+ const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
6566
6493
  return jsxRuntime.jsx(CustomFieldTooltip, {
6567
6494
  title: tooltipTitle,
6568
6495
  children: jsxRuntime.jsx(uiKit.SelectInput, {
@@ -6591,7 +6518,6 @@ const getSubfieldLanguage = subfieldName => {
6591
6518
  return subfieldName.substring(lastDotIndex + 1);
6592
6519
  };
6593
6520
  function CustomLocalizedTextInput(props) {
6594
- var _value$language;
6595
6521
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
6596
6522
  language: applicationContext.dataLocale,
6597
6523
  languages: applicationContext.project.languages
@@ -6617,7 +6543,7 @@ function CustomLocalizedTextInput(props) {
6617
6543
  props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6618
6544
  });
6619
6545
  const InputComponent = isMultiLine ? uiKit.LocalizedMultilineTextInput : uiKit.LocalizedTextInput;
6620
- const tooltipTitle = isMultiLine ? '' : value ? (_value$language = value[language]) !== null && _value$language !== void 0 ? _value$language : '' : '';
6546
+ const tooltipTitle = isMultiLine ? '' : value ? value[language] ?? '' : '';
6621
6547
  return jsxRuntime.jsx(CustomFieldTooltip, {
6622
6548
  title: tooltipTitle,
6623
6549
  children: jsxRuntime.jsx(InputComponent, {
@@ -6666,7 +6592,7 @@ const fixAmount = value => {
6666
6592
  // data user just entered effectively preventing full data from being entered.
6667
6593
  const fixEnteredValue = (newValue, initialValue, currencies) => {
6668
6594
  const withFixedCurrency = fixCurrencyCode(newValue, currencies);
6669
- if (!(initialValue !== null && initialValue !== void 0 && initialValue.amount)) {
6595
+ if (!initialValue?.amount) {
6670
6596
  return fixAmount(withFixedCurrency);
6671
6597
  }
6672
6598
  return withFixedCurrency;
@@ -6733,19 +6659,19 @@ function ownKeys$R(e, r) { var t = _Object$keys__default["default"](e); if (_Obj
6733
6659
  function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$R(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$R(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
6734
6660
  var FetchProductTypeQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductTypeQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productType" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "attributeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "100" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isRequired" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputTipAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1905, source: { body: "query FetchProductTypeQuery($id: String!) {\n productType(id: $id) {\n name\n attributeDefinitions(limit: 100) {\n results {\n name\n isRequired\n inputHint\n inputTipAllLocales {\n value\n locale\n }\n labelAllLocales {\n value\n locale\n }\n type {\n name\n ... on SetAttributeDefinitionType {\n elementType {\n name\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
6735
6661
  const mapAttributeDefinition = definition => {
6736
- var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
6662
+ var _context, _context2, _context3, _context4;
6737
6663
  return _objectSpread$R(_objectSpread$R({}, definition), {}, {
6738
6664
  required: definition.isRequired,
6739
6665
  inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
6740
6666
  label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
6741
- type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 || (_definition$type = _definition$type.elementType) === null || _definition$type === void 0 ? void 0 : _definition$type.name) ? _objectSpread$R(_objectSpread$R({}, definition.type), {}, {
6667
+ type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, definition.type?.elementType?.name) ? _objectSpread$R(_objectSpread$R({}, definition.type), {}, {
6742
6668
  elementType: _objectSpread$R(_objectSpread$R({}, definition.type.elementType), {}, {
6743
6669
  values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
6744
6670
  key: value.key,
6745
6671
  label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
6746
6672
  }))
6747
6673
  })
6748
- }) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$R(_objectSpread$R({}, definition.type), {}, {
6674
+ }) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, definition.type?.name) ? _objectSpread$R(_objectSpread$R({}, definition.type), {}, {
6749
6675
  values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
6750
6676
  key: value.key,
6751
6677
  label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
@@ -7083,8 +7009,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
7083
7009
  CustomNestedInput.displayName = 'CustomNestedInput';
7084
7010
 
7085
7011
  function CustomNumberInput(props) {
7086
- var _props$value;
7087
- const value = (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : '';
7012
+ const value = props.value ?? '';
7088
7013
  const handleChange = makeChangeHandler(rawValue => {
7089
7014
  props.setFieldValue(props.name, !rawValue ? undefined : Number(rawValue));
7090
7015
  props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
@@ -7158,8 +7083,7 @@ function CustomCategoryReferenceInput(props) {
7158
7083
  CustomCategoryReferenceInput.displayName = 'CustomCategoryReferenceInput';
7159
7084
 
7160
7085
  function CustomChannelReferenceInput(props) {
7161
- var _props$value;
7162
- const value = ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id) || '';
7086
+ const value = props.value?.id || '';
7163
7087
  return jsxRuntime.jsx(ChannelPickerInput, {
7164
7088
  value: value,
7165
7089
  name: props.name,
@@ -7195,7 +7119,6 @@ const DropdownIndicator = () => jsxRuntime.jsx(uiKit.SearchIcon, {
7195
7119
  });
7196
7120
  DropdownIndicator.displayName = 'DropdownIndicator';
7197
7121
  const ProductPickerInput = _ref => {
7198
- var _currentOption$data$l, _currentOption$data;
7199
7122
  let isClearable = _ref.isClearable,
7200
7123
  isDisabled = _ref.isDisabled,
7201
7124
  isReadOnly = _ref.isReadOnly,
@@ -7216,20 +7139,19 @@ const ProductPickerInput = _ref => {
7216
7139
  loadingError = _useState2[0],
7217
7140
  setLoadingError = _useState2[1];
7218
7141
  const convertProductToOption = React.useCallback(product => {
7219
- var _masterData$current;
7220
7142
  if (!product) return null;
7221
7143
  const id = product.id,
7222
7144
  key = product.key,
7223
7145
  masterData = product.masterData;
7224
- const localizedName = formatLocalizedFieldToString((_masterData$current = masterData.current) === null || _masterData$current === void 0 ? void 0 : _masterData$current.nameAllLocales);
7146
+ const localizedName = formatLocalizedFieldToString(masterData.current?.nameAllLocales);
7225
7147
  return {
7226
- label: localizedName + (key ? " (key: ".concat(key, ")") : ''),
7148
+ label: localizedName + (key ? ` (key: ${key})` : ''),
7227
7149
  value: id,
7228
7150
  name: localizedName,
7229
7151
  key
7230
7152
  };
7231
7153
  }, [formatLocalizedFieldToString]);
7232
- const prefixSearchFields = React.useMemo(() => ["masterData.current.name.".concat(dataLocale), 'key'], [dataLocale]);
7154
+ const prefixSearchFields = React.useMemo(() => [`masterData.current.name.${dataLocale}`, 'key'], [dataLocale]);
7233
7155
  const loadOptions = useLoadOptions({
7234
7156
  query: GetProductsQuery,
7235
7157
  prefixSearchFields
@@ -7260,12 +7182,12 @@ const ProductPickerInput = _ref => {
7260
7182
  setLoadingError(null);
7261
7183
  handleInternalInputChange(event);
7262
7184
  }, [handleInternalInputChange]);
7263
- const isCurrentOptionLoadingFailed = Boolean(currentOption === null || currentOption === void 0 ? void 0 : currentOption.error);
7185
+ const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
7264
7186
  React.useEffect(() => {
7265
7187
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
7266
7188
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
7267
7189
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
7268
- const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
7190
+ const tooltipTitle = currentOption?.data?.label ?? '';
7269
7191
  return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
7270
7192
  max: "scale",
7271
7193
  children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -7305,8 +7227,7 @@ const ProductPickerInput = _ref => {
7305
7227
  ProductPickerInput.displayName = 'ProductPickerInput';
7306
7228
 
7307
7229
  function CustomProductReferenceInput(props) {
7308
- var _props$value;
7309
- const value = ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id) || '';
7230
+ const value = props.value?.id || '';
7310
7231
  return jsxRuntime.jsx(ProductPickerInput, {
7311
7232
  value: value,
7312
7233
  name: props.name,
@@ -7324,8 +7245,7 @@ function CustomProductReferenceInput(props) {
7324
7245
  CustomProductReferenceInput.displayName = 'CustomProductReferenceInput';
7325
7246
 
7326
7247
  function CustomProductTypeReferenceInput(props) {
7327
- var _props$value;
7328
- const value = ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id) || '';
7248
+ const value = props.value?.id || '';
7329
7249
  return jsxRuntime.jsx(ProductTypePickerInput, {
7330
7250
  value: value,
7331
7251
  name: props.name,
@@ -7342,8 +7262,7 @@ function CustomProductTypeReferenceInput(props) {
7342
7262
  CustomProductTypeReferenceInput.displayName = 'CustomProductTypeReferenceInput';
7343
7263
 
7344
7264
  function CustomRawIdReferenceInput(props) {
7345
- var _props$value;
7346
- const value = ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id) || '';
7265
+ const value = props.value?.id || '';
7347
7266
  return jsxRuntime.jsx(CustomFieldTooltip, {
7348
7267
  title: value,
7349
7268
  children: jsxRuntime.jsx(uiKit.TextInput, {
@@ -7361,8 +7280,7 @@ function CustomRawIdReferenceInput(props) {
7361
7280
  CustomRawIdReferenceInput.displayName = 'CustomRawIdReferenceInput';
7362
7281
 
7363
7282
  function CustomStateReferenceInput(props) {
7364
- var _props$value;
7365
- const value = ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id) || '';
7283
+ const value = props.value?.id || '';
7366
7284
  return jsxRuntime.jsx(StatePickerInput, {
7367
7285
  value: value,
7368
7286
  name: props.name,
@@ -7498,14 +7416,12 @@ const nonSetComponents = {
7498
7416
  };
7499
7417
  const CustomFieldInput = /*#__PURE__*/React.memo(props => {
7500
7418
  const InputComponent = React.useMemo(() => {
7501
- var _props$fieldDefinitio;
7502
- const typeName = (_props$fieldDefinitio = props.fieldDefinition.type) === null || _props$fieldDefinitio === void 0 ? void 0 : _props$fieldDefinitio.name.toLowerCase();
7419
+ const typeName = props.fieldDefinition.type?.name.toLowerCase();
7503
7420
  if (typeName === 'set') {
7504
- var _getSetElementType;
7505
7421
  // Boolean is the only set element with peculiarities (i.e. way more
7506
7422
  // convenient for user to work with it as with select input with three values:
7507
7423
  // [true], [false] and [true, false]).
7508
- if (((_getSetElementType = getType(props.fieldDefinition)) === null || _getSetElementType === void 0 ? void 0 : _getSetElementType.name.toLowerCase()) === CUSTOM_FIELD_TYPES.boolean) {
7424
+ if (getType(props.fieldDefinition)?.name.toLowerCase() === CUSTOM_FIELD_TYPES.boolean) {
7509
7425
  return CustomBooleanInputSet;
7510
7426
  }
7511
7427
  // All the rest sets are just a fancy wrapper around single-item components
@@ -7573,10 +7489,9 @@ function _objectSpread$P(e) { for (var r = 1; r < arguments.length; r++) { var _
7573
7489
  function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
7574
7490
  var CartDiscountsCount = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 61, source: { body: "query CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
7575
7491
  const CustomFieldsLabelHint = _ref2 => {
7576
- var _type$name;
7577
7492
  let fieldDefinition = _ref2.fieldDefinition;
7578
7493
  const type = getType(fieldDefinition);
7579
- const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
7494
+ const isReference = type.name?.toLowerCase() === 'reference';
7580
7495
  const referenceTypeId = type.referenceTypeId;
7581
7496
  const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
7582
7497
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
@@ -7594,7 +7509,7 @@ const CustomFieldsLabelHint = _ref2 => {
7594
7509
  data = _useQuery.data,
7595
7510
  loading = _useQuery.loading;
7596
7511
  if (loading) return null;
7597
- if ((data === null || data === void 0 ? void 0 : data.cartDiscounts.total) > QUERY_MAX_LIMIT) {
7512
+ if (data?.cartDiscounts.total > QUERY_MAX_LIMIT) {
7598
7513
  return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
7599
7514
  alignItems: "center",
7600
7515
  children: [jsxRuntime.jsx(uiKit.WarningIcon, {
@@ -7621,17 +7536,17 @@ function CustomFieldsProductTypeReferenceSubtitle() {
7621
7536
  // TODO(pa3): this logic may be misplaced and probably
7622
7537
  // should belong to <CustomReferenceInput /> component instead.
7623
7538
  function CustomFieldsLabelSubtitle(_ref3) {
7624
- var _type$name2, _context;
7539
+ var _context;
7625
7540
  let fieldDefinition = _ref3.fieldDefinition;
7626
7541
  const _useIntl2 = reactIntl.useIntl(),
7627
7542
  formatMessage = _useIntl2.formatMessage;
7628
7543
  const type = getType(fieldDefinition);
7629
- const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
7544
+ const isReference = type.name?.toLowerCase() === 'reference';
7630
7545
  if (!isReference) return null;
7631
7546
  const referenceTypeId = type.referenceTypeId;
7632
7547
  const referenceTypeName = capitalizeFirst(referenceTypeId);
7633
7548
  if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
7634
- return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$t.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$t.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$t.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
7549
+ return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$t.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$t.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$t.stateReferenceLabel) : `${referenceTypeName} ID`;
7635
7550
  }
7636
7551
  const Portal = props => /*#__PURE__*/ReactDOM__default["default"].createPortal(props.children, document.body);
7637
7552
  var _ref$1 = process.env.NODE_ENV === "production" ? {
@@ -7648,7 +7563,7 @@ function CustomFieldsCountIndicator(_ref4) {
7648
7563
  const formatLocalizedField = useFormatLocalizedFieldToString();
7649
7564
  const _useIntl3 = reactIntl.useIntl(),
7650
7565
  formatMessage = _useIntl3.formatMessage;
7651
- return (assignedAttributeGroups === null || assignedAttributeGroups === void 0 ? void 0 : assignedAttributeGroups.length) > 1 ? jsxRuntime.jsx(uiKit.Tooltip, {
7566
+ return assignedAttributeGroups?.length > 1 ? jsxRuntime.jsx(uiKit.Tooltip, {
7652
7567
  title: formatMessage(messages$t.attributeGroupCountTooltip, {
7653
7568
  attributeGroups: _mapInstanceProperty__default["default"](assignedAttributeGroups).call(assignedAttributeGroups, assignedAttributeGroup => formatLocalizedField(assignedAttributeGroup.nameAllLocales)).join(', '),
7654
7569
  count: assignedAttributeGroups.length
@@ -7913,11 +7828,10 @@ const useDnDContext = () => {
7913
7828
 
7914
7829
  const _excluded$1 = ["WrapperComponent"];
7915
7830
  function ownKeys$J(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
7916
- function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$J(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$J(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
7831
+ function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$J(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
7917
7832
  const getFieldName = (parentName, fieldName) => {
7918
- var _context;
7919
7833
  if (!parentName) return fieldName;
7920
- return _concatInstanceProperty__default["default"](_context = "".concat(parentName, ".")).call(_context, fieldName);
7834
+ return `${parentName}.${fieldName}`;
7921
7835
  };
7922
7836
  const isNested = fieldDefinition => {
7923
7837
  const type = fieldDefinition.type;
@@ -7948,7 +7862,6 @@ const CustomFieldsInternal = _ref => {
7948
7862
  return jsxRuntime.jsx(DroppableWrapper, {
7949
7863
  onDragEnd: onDragEnd,
7950
7864
  children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
7951
- var _context2, _context3;
7952
7865
  const fieldName = getFieldName(props.name, fieldDefinition.name);
7953
7866
  const isTouched = Boolean(formik.getIn(touched, fieldName));
7954
7867
  const fieldErrors = formik.getIn(errors, fieldName);
@@ -7973,7 +7886,7 @@ const CustomFieldsInternal = _ref => {
7973
7886
  onBlur: handleBlur,
7974
7887
  setFieldValue: props.setFieldValue,
7975
7888
  hasError: hasError,
7976
- hasWarning: props.renderWarnings && (status === null || status === void 0 ? void 0 : status.warnings[fieldName]),
7889
+ hasWarning: props.renderWarnings && status?.warnings[fieldName],
7977
7890
  handleWarningChange: props.handleWarningChange,
7978
7891
  renderWarnings: props.renderWarnings
7979
7892
  };
@@ -7981,36 +7894,33 @@ const CustomFieldsInternal = _ref => {
7981
7894
  return jsxRuntime.jsx(formik.FastField, {
7982
7895
  name: fieldName,
7983
7896
  validate: validate,
7984
- children: () => {
7985
- var _context4, _context5;
7986
- return jsxRuntime.jsx(DraggableWrapper, {
7987
- draggableKey: _concatInstanceProperty__default["default"](_context4 = "".concat(fieldName, "-")).call(_context4, index),
7988
- draggableId: _concatInstanceProperty__default["default"](_context5 = "".concat(fieldName, "-")).call(_context5, index),
7989
- index: index,
7990
- children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
7991
- scale: "xs",
7992
- children: jsxRuntime.jsxs("div", {
7993
- "aria-invalid": _Object$keys__default["default"](fieldErrors !== null && fieldErrors !== void 0 ? fieldErrors : {}).length > 0,
7994
- "aria-errormessage": "".concat(fieldName, "-error"),
7995
- id: "".concat(fieldName, "-error"),
7996
- children: [jsxRuntime.jsx(CustomFieldsLabel, {
7997
- name: fieldName,
7998
- fieldDefinition: fieldDefinition
7999
- }), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
8000
- scale: "xs",
8001
- alignItems: "stretch",
8002
- children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
8003
- children: Field
8004
- }) : Field, props.renderWarnings && (status === null || status === void 0 ? void 0 : status.warnings[fieldName]) && props.renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors, {
8005
- isTouched: isTouched,
8006
- errors: fieldErrors
8007
- })]
7897
+ children: () => jsxRuntime.jsx(DraggableWrapper, {
7898
+ draggableKey: `${fieldName}-${index}`,
7899
+ draggableId: `${fieldName}-${index}`,
7900
+ index: index,
7901
+ children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
7902
+ scale: "xs",
7903
+ children: jsxRuntime.jsxs("div", {
7904
+ "aria-invalid": _Object$keys__default["default"](fieldErrors ?? {}).length > 0,
7905
+ "aria-errormessage": `${fieldName}-error`,
7906
+ id: `${fieldName}-error`,
7907
+ children: [jsxRuntime.jsx(CustomFieldsLabel, {
7908
+ name: fieldName,
7909
+ fieldDefinition: fieldDefinition
7910
+ }), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
7911
+ scale: "xs",
7912
+ alignItems: "stretch",
7913
+ children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
7914
+ children: Field
7915
+ }) : Field, props.renderWarnings && status?.warnings[fieldName] && props.renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors, {
7916
+ isTouched: isTouched,
7917
+ errors: fieldErrors
8008
7918
  })]
8009
- })
7919
+ })]
8010
7920
  })
8011
- });
8012
- }
8013
- }, _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(fieldName, "-")).call(_context3, index, "-")).call(_context2, fieldKey));
7921
+ })
7922
+ })
7923
+ }, `${fieldName}-${index}-${fieldKey}`);
8014
7924
  })
8015
7925
  });
8016
7926
  };
@@ -8023,9 +7933,9 @@ function ownKeys$I(e, r) { var t = _Object$keys__default["default"](e); if (_Obj
8023
7933
  function _objectSpread$I(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$I(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$I(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
8024
7934
  const getTypeName = type => type.name.toLowerCase();
8025
7935
  const findLabel = (enumType, key) => {
8026
- var _enumType$values$find, _enumType$values$find2, _context;
7936
+ var _context;
8027
7937
  const emptyValue = getTypeName(enumType) === 'enum' ? '' : {};
8028
- return (_enumType$values$find = (_enumType$values$find2 = _findInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](enumType)).call(_context, value => value.key === key)) === null || _enumType$values$find2 === void 0 ? void 0 : _enumType$values$find2.label) !== null && _enumType$values$find !== void 0 ? _enumType$values$find : emptyValue;
7938
+ return _findInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](enumType)).call(_context, value => value.key === key)?.label ?? emptyValue;
8029
7939
  };
8030
7940
  const convertEnumValues = (value, attributeDefinition) => {
8031
7941
  var _context2, _context3;
@@ -8091,7 +8001,7 @@ const attributesMapToNameValuePairs = map => {
8091
8001
  const _excluded = ["WrapperComponent"];
8092
8002
  const getAttributeShortName = (fullName, attributesPrefix) => {
8093
8003
  if (!attributesPrefix) return fullName;
8094
- return fullName.replace("".concat(attributesPrefix, "."), '');
8004
+ return fullName.replace(`${attributesPrefix}.`, '');
8095
8005
  };
8096
8006
  function ProductAttributes(_ref) {
8097
8007
  let WrapperComponent = _ref.WrapperComponent,
@@ -8189,7 +8099,7 @@ var pickerMessages = reactIntl.defineMessages({
8189
8099
  });
8190
8100
 
8191
8101
  function ownKeys$H(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
8192
- function _objectSpread$H(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$H(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$H(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
8102
+ function _objectSpread$H(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$H(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$H(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
8193
8103
  const PRODUCT_SELECTION_MODES = {
8194
8104
  INCLUSION: 'Individual',
8195
8105
  EXCLUSION: 'IndividualExclusion'
@@ -8200,11 +8110,10 @@ const PRODUCT_SELECTION_MODES_LABELS = {
8200
8110
  };
8201
8111
  const getMode = mode => mode === PRODUCT_SELECTION_MODES.INCLUSION || mode === PRODUCT_SELECTION_MODES_LABELS.INCLUSION ? 'inclusion' : 'exclusion';
8202
8112
  const addModeToLabel = function (ps) {
8203
- var _context;
8204
8113
  let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
8205
8114
  if (!ps) return undefined;
8206
8115
  return _objectSpread$H(_objectSpread$H({}, ps), {}, {
8207
- label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getMode(ps === null || ps === void 0 ? void 0 : ps.mode), ")") : '')
8116
+ label: `${ps?.label}${enableExcludingProducts ? ` (type: ${getMode(ps?.mode)})` : ''}`
8208
8117
  });
8209
8118
  };
8210
8119
 
@@ -8221,7 +8130,7 @@ const getValueFromOptions$3 = _ref => {
8221
8130
  // handle async-select-field value transformation
8222
8131
  if (isMulti) {
8223
8132
  var _context;
8224
- return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value))).call(_context, ps => addModeToLabel(ps, enableExcludingProducts));
8133
+ return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections?.includes(ps.value))).call(_context, ps => addModeToLabel(ps, enableExcludingProducts));
8225
8134
  }
8226
8135
 
8227
8136
  // in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
@@ -8233,7 +8142,6 @@ const emptyStoreOption$1 = intl => [{
8233
8142
  isDisabled: true
8234
8143
  }];
8235
8144
  function ProductSelectionsAsyncSelectDropdown(props) {
8236
- var _productSelectionsFet3;
8237
8145
  const intl = reactIntl.useIntl();
8238
8146
  const enableExcludingProducts = applicationShell.useFeatureToggle(EXCLUDING_PRODUCTS);
8239
8147
  const productSelectionsFetcher = useProductSelectionsFetcher({
@@ -8246,17 +8154,13 @@ function ProductSelectionsAsyncSelectDropdown(props) {
8246
8154
  })),
8247
8155
  projectLanguages = _useApplicationContex.projectLanguages,
8248
8156
  dataLocale = _useApplicationContex.dataLocale;
8249
- const productSelections = React.useMemo(() => {
8250
- var _productSelectionsFet, _productSelectionsFet2;
8251
- return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
8252
- }, [(_productSelectionsFet3 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet3 === void 0 ? void 0 : _productSelectionsFet3.results]);
8157
+ const productSelections = React.useMemo(() => productSelectionsFetcher.productSelections?.results ?? [], [productSelectionsFetcher.productSelections?.results]);
8253
8158
  const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
8254
8159
  var _context2;
8255
8160
  return !_includesInstanceProperty__default["default"](_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
8256
8161
  });
8257
8162
  const onOptionClick = event => {
8258
- var _event$target$value;
8259
- const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
8163
+ const productSelectionId = event.target.value?.value;
8260
8164
  const currentProductSelection = _findInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
8261
8165
  props.onChange(currentProductSelection);
8262
8166
  };
@@ -8339,7 +8243,6 @@ const mapProductSelectionsToOptions$1 = memoize__default["default"](function ()
8339
8243
  let enableExcludingProducts = arguments.length > 4 ? arguments[4] : undefined;
8340
8244
  const selectedPSList = _Array$isArray__default["default"](selectedPS) ? selectedPS : [selectedPS];
8341
8245
  return _mapInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => {
8342
- var _context;
8343
8246
  const label = l10n.formatLocalizedString(productSelection, {
8344
8247
  key: 'name',
8345
8248
  locale: dataLocale,
@@ -8348,14 +8251,13 @@ const mapProductSelectionsToOptions$1 = memoize__default["default"](function ()
8348
8251
  return {
8349
8252
  id: productSelection.id,
8350
8253
  value: productSelection.id,
8351
- label: _concatInstanceProperty__default["default"](_context = "".concat(label)).call(_context, _includesInstanceProperty__default["default"](selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(getMode(productSelection.mode), ")") : ''),
8254
+ label: `${label}${_includesInstanceProperty__default["default"](selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? ` (type: ${getMode(productSelection.mode)})` : ''}`,
8352
8255
  key: productSelection.key,
8353
8256
  mode: getMode(productSelection.mode)
8354
8257
  };
8355
8258
  });
8356
8259
  });
8357
8260
  function ProductSelectionBasicSelectDropdown(props) {
8358
- var _productSelectionsFet, _productSelectionsFet2;
8359
8261
  const intl = reactIntl.useIntl();
8360
8262
  const enableExcludingProducts = applicationShell.useFeatureToggle(EXCLUDING_PRODUCTS);
8361
8263
  const productSelectionsFetcher = useProductSelectionsFetcher({
@@ -8368,10 +8270,10 @@ function ProductSelectionBasicSelectDropdown(props) {
8368
8270
  projectLanguages = _useApplicationContex.projectLanguages,
8369
8271
  dataLocale = _useApplicationContex.dataLocale;
8370
8272
  if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
8371
- const productSelections = (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
8273
+ const productSelections = productSelectionsFetcher.productSelections?.results ?? [];
8372
8274
  const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
8373
- var _context2;
8374
- return !_includesInstanceProperty__default["default"](_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
8275
+ var _context;
8276
+ return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
8375
8277
  });
8376
8278
  const onOptionClick = event => {
8377
8279
  const productSelectionId = event.target.value;
@@ -8408,15 +8310,11 @@ function ProductSelectionBasicSelectDropdown(props) {
8408
8310
  }
8409
8311
 
8410
8312
  var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 223, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
8411
- const createQueryVariables$4 = (productSelections, predicateField) => {
8412
- var _context;
8413
- return {
8414
- where: _concatInstanceProperty__default["default"](_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty__default["default"](productSelections).call(productSelections, ps => "\"".concat(ps, "\"")).join(', '), ")"),
8415
- limit: 500
8416
- };
8417
- };
8313
+ const createQueryVariables$4 = (productSelections, predicateField) => ({
8314
+ where: `${predicateField} in (${_mapInstanceProperty__default["default"](productSelections).call(productSelections, ps => `"${ps}"`).join(', ')})`,
8315
+ limit: 500
8316
+ });
8418
8317
  const useProductSelectionsByFieldFetcher = (productSelections, predicateField) => {
8419
- var _productSelectionsQue, _productSelectionsQue2;
8420
8318
  const productSelectionList = _Array$isArray__default["default"](productSelections) ? productSelections : [productSelections];
8421
8319
  const productSelectionsQuery = react.useQuery(ProductSelectionsPickerFetcher$1, {
8422
8320
  context: {
@@ -8426,7 +8324,7 @@ const useProductSelectionsByFieldFetcher = (productSelections, predicateField) =
8426
8324
  skip: productSelectionList.length === 0
8427
8325
  });
8428
8326
  return {
8429
- productSelections: (_productSelectionsQue = (_productSelectionsQue2 = productSelectionsQuery.data) === null || _productSelectionsQue2 === void 0 ? void 0 : _productSelectionsQue2.productSelections.results) !== null && _productSelectionsQue !== void 0 ? _productSelectionsQue : [],
8327
+ productSelections: productSelectionsQuery.data?.productSelections.results ?? [],
8430
8328
  isLoading: productSelectionsQuery.loading
8431
8329
  };
8432
8330
  };
@@ -8467,8 +8365,8 @@ const createQueryVariables$3 = _ref3 => {
8467
8365
  var _context;
8468
8366
  let searchText = _ref3.searchText;
8469
8367
  const sanitizedSearchText = sanitize(_trimInstanceProperty__default["default"](searchText).call(searchText, searchText));
8470
- const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
8471
- const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
8368
+ const idQuery = isUUID(sanitizedSearchText) && `id = "${sanitizedSearchText}"`;
8369
+ const keyQuery = `key = "${sanitizedSearchText}"`;
8472
8370
  const searchTextQuery = _filterInstanceProperty__default["default"](_context = [idQuery, keyQuery]).call(_context, Boolean).join(' or ');
8473
8371
  return {
8474
8372
  where: searchTextQuery || undefined
@@ -8491,7 +8389,6 @@ function ProductSelectionsSearchSelectDropdown(props) {
8491
8389
  dataLocale = _useApplicationContex.dataLocale;
8492
8390
  const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
8493
8391
  const handleLoadOptions = async searchText => {
8494
- var _data$productSelectio, _data$productSelectio2;
8495
8392
  const _await$client$query = await client$1.query({
8496
8393
  query: ProductSelectionsPickerFetcher,
8497
8394
  variables: createQueryVariables$3({
@@ -8503,7 +8400,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
8503
8400
  fetchPolicy: 'network-only'
8504
8401
  }),
8505
8402
  data = _await$client$query.data;
8506
- const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 || (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
8403
+ const matchedProductSelections = data?.productSelections?.results ?? [];
8507
8404
  const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
8508
8405
  const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
8509
8406
  var _context2;
@@ -8519,8 +8416,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
8519
8416
  };
8520
8417
  const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
8521
8418
  const onOptionClick = event => {
8522
- var _event$target$value;
8523
- const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
8419
+ const productSelectionId = event.target.value?.value;
8524
8420
  const currentProductSelection = _findInstanceProperty__default["default"](productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
8525
8421
  props.onChange(currentProductSelection);
8526
8422
  };
@@ -8572,11 +8468,11 @@ function ModeSelectInputOption(props) {
8572
8468
  scale: "xs",
8573
8469
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
8574
8470
  isBold: true,
8575
- children: (data === null || data === void 0 ? void 0 : data.label) || noValueFallback
8471
+ children: data?.label || noValueFallback
8576
8472
  }), jsxRuntime.jsxs(uiKit.Text.Detail, {
8577
- children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
8473
+ children: ["Key: ", data?.key || noValueFallback]
8578
8474
  }), jsxRuntime.jsxs(uiKit.Text.Detail, {
8579
- children: ["Type: ", (data === null || data === void 0 ? void 0 : data.mode) || noValueFallback]
8475
+ children: ["Type: ", data?.mode || noValueFallback]
8580
8476
  })]
8581
8477
  })
8582
8478
  }));
@@ -8658,19 +8554,19 @@ const ScrollToFieldError = () => {
8658
8554
  if (isValid) return;
8659
8555
  const firstErrorElement = document.querySelector('[aria-invalid="true"]');
8660
8556
  if (firstErrorElement) {
8661
- var _ref, _ref2, _document$querySelect, _elementToScrollTo$sc;
8662
8557
  // Get a reference to the label.
8663
8558
  const firstElementId = firstErrorElement.getAttribute('id');
8664
- const localizedInputIndex = _indexOfInstanceProperty__default["default"](firstElementId).call(firstElementId, ".".concat(dataLocale));
8559
+ const localizedInputIndex = _indexOfInstanceProperty__default["default"](firstElementId).call(firstElementId, `.${dataLocale}`);
8665
8560
 
8666
8561
  // check if locale is appended then remove it from id
8667
- const id = localizedInputIndex > -1 ? firstElementId.replace(".".concat(dataLocale), '') : firstElementId;
8562
+ const id = localizedInputIndex > -1 ? firstElementId.replace(`.${dataLocale}`, '') : firstElementId;
8668
8563
 
8669
8564
  // Scroll to the label (if found), otherwise to the input element itself.
8670
8565
 
8671
- const elementToScrollTo = // div is used only for custom fields
8672
- (_ref = (_ref2 = (_document$querySelect = document.querySelector("div[aria-errormessage=\"".concat(firstElementId, "\"]"))) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("label[for=\"".concat(id, "\"]"))) !== null && _ref2 !== void 0 ? _ref2 : document.querySelector("label#".concat(id))) !== null && _ref !== void 0 ? _ref : firstErrorElement;
8673
- (_elementToScrollTo$sc = elementToScrollTo.scrollIntoView) === null || _elementToScrollTo$sc === void 0 || _elementToScrollTo$sc.call(elementToScrollTo, {
8566
+ const elementToScrollTo =
8567
+ // div is used only for custom fields
8568
+ document.querySelector(`div[aria-errormessage="${firstElementId}"]`) ?? document.querySelector(`label[for="${id}"]`) ?? document.querySelector(`label#${id}`) ?? firstErrorElement;
8569
+ elementToScrollTo.scrollIntoView?.({
8674
8570
  behavior: 'smooth'
8675
8571
  });
8676
8572
  }
@@ -8696,8 +8592,7 @@ var styles$9 = {
8696
8592
  "search-mode-menu": "selectable-field-search-input-module__search-mode-menu___Od6Le"
8697
8593
  };
8698
8594
  const SelectableFieldSearchInput = props => {
8699
- var _props$initialValue, _props$placeholder;
8700
- const _useState = React.useState((_props$initialValue = props.initialValue) !== null && _props$initialValue !== void 0 ? _props$initialValue : ''),
8595
+ const _useState = React.useState(props.initialValue ?? ''),
8701
8596
  _useState2 = _slicedToArray(_useState, 2),
8702
8597
  searchText = _useState2[0],
8703
8598
  setSearchText = _useState2[1];
@@ -8733,7 +8628,7 @@ const SelectableFieldSearchInput = props => {
8733
8628
  });
8734
8629
  },
8735
8630
  onReset: props.onReset,
8736
- placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$r.placeholder),
8631
+ placeholder: props.placeholder ?? intl.formatMessage(messages$r.placeholder),
8737
8632
  isDisabled: props.disabled
8738
8633
  })
8739
8634
  });
@@ -8783,7 +8678,6 @@ const UPPER_STORES_LIMIT = 500;
8783
8678
 
8784
8679
  // map store to options
8785
8680
  const mapStoresToOptions = _ref => {
8786
- var _store$productSelecti;
8787
8681
  let store = _ref.store,
8788
8682
  renderSelectInputOptionValuesByField = _ref.renderSelectInputOptionValuesByField,
8789
8683
  dataLocale = _ref.dataLocale;
@@ -8794,14 +8688,14 @@ const mapStoresToOptions = _ref => {
8794
8688
  const localizedName = l10n.formatLocalizedString(convertedStore, {
8795
8689
  key: 'name',
8796
8690
  locale: dataLocale,
8797
- fallback: "".concat(store.key, " (key)")
8691
+ fallback: `${store.key} (key)`
8798
8692
  });
8799
8693
  return {
8800
8694
  label: localizedName,
8801
8695
  value: renderSelectInputOptionValuesByField === 'key' ? store.key : store.id,
8802
8696
  key: store.key,
8803
8697
  id: store.id,
8804
- productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _mapInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => productSelectionRef.productSelection.id)
8698
+ productSelections: store.productSelections?.map(productSelectionRef => productSelectionRef.productSelection.id)
8805
8699
  };
8806
8700
  };
8807
8701
 
@@ -8830,7 +8724,7 @@ const getValueFromOptions$1 = _ref => {
8830
8724
  isMulti = _ref.isMulti;
8831
8725
  // handle async-select-field value transformation
8832
8726
  if (isMulti) {
8833
- return _filterInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === null || currentlySelectedStores === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedStores).call(currentlySelectedStores, store.value));
8727
+ return _filterInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores?.includes(store.value));
8834
8728
  }
8835
8729
 
8836
8730
  // return value as undefined if no options is yet selected. It is needed for cases where users sets initial values as empty string
@@ -8849,7 +8743,7 @@ const emptyStoreOption = intl => [{
8849
8743
  const StoresAsyncSelectInput = props => {
8850
8744
  const intl = reactIntl.useIntl();
8851
8745
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
8852
- dataLocale: applicationContext.dataLocale
8746
+ dataLocale: applicationContext.dataLocale || applicationContext.user?.locale
8853
8747
  })),
8854
8748
  dataLocale = _useApplicationContex.dataLocale;
8855
8749
  const keysOfStores = props.allAccessibleStoreKeysThroughDataFencePermissions;
@@ -8859,13 +8753,13 @@ const StoresAsyncSelectInput = props => {
8859
8753
  sort: 'createdAt asc',
8860
8754
  excludeExtendedStoresList: true,
8861
8755
  excludeProductSelections: !props.shouldFetchProductSelections,
8862
- stores: (keysOfStores === null || keysOfStores === void 0 ? void 0 : keysOfStores.length) && keysOfStores,
8756
+ stores: keysOfStores?.length && keysOfStores,
8863
8757
  projectKey: props.projectKey
8864
8758
  });
8865
8759
  const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors$2(props.errors) || props.hasError;
8866
8760
  const mappedStoresListOptions = React.useMemo(() => {
8867
- var _context2, _storesListFetcher$st;
8868
- return _mapInstanceProperty__default["default"](_context2 = ((_storesListFetcher$st = storesListFetcher.stores) === null || _storesListFetcher$st === void 0 ? void 0 : _storesListFetcher$st.results) || []).call(_context2, store => mapStoresToOptions({
8761
+ var _context2;
8762
+ return _mapInstanceProperty__default["default"](_context2 = storesListFetcher.stores?.results || []).call(_context2, store => mapStoresToOptions({
8869
8763
  store,
8870
8764
  dataLocale,
8871
8765
  renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
@@ -8951,7 +8845,7 @@ const hasErrors$1 = errors => {
8951
8845
  const StoresBasicSelectInput = props => {
8952
8846
  const intl = reactIntl.useIntl();
8953
8847
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
8954
- dataLocale: applicationContext.dataLocale
8848
+ dataLocale: applicationContext.dataLocale || applicationContext.user?.locale
8955
8849
  })),
8956
8850
  dataLocale = _useApplicationContex.dataLocale;
8957
8851
  const keysOfStores = props.allAccessibleStoreKeysThroughDataFencePermissions;
@@ -8961,31 +8855,30 @@ const StoresBasicSelectInput = props => {
8961
8855
  sort: 'createdAt asc',
8962
8856
  excludeExtendedStoresList: true,
8963
8857
  excludeProductSelections: !props.shouldFetchProductSelections,
8964
- stores: (keysOfStores === null || keysOfStores === void 0 ? void 0 : keysOfStores.length) && keysOfStores,
8858
+ stores: keysOfStores?.length && keysOfStores,
8965
8859
  projectKey: props.projectKey
8966
8860
  });
8967
8861
  const hasError = uiKit.SelectInput.isTouched(props.touched) && hasErrors$1(props.errors) || props.hasError;
8968
8862
  const mappedStoresListOptions = React.useMemo(() => {
8969
- var _context2, _storesListFetcher$st;
8970
- const results = _mapInstanceProperty__default["default"](_context2 = ((_storesListFetcher$st = storesListFetcher.stores) === null || _storesListFetcher$st === void 0 ? void 0 : _storesListFetcher$st.results) || []).call(_context2, store => mapStoresToOptions({
8863
+ var _context2;
8864
+ const results = _mapInstanceProperty__default["default"](_context2 = storesListFetcher.stores?.results || []).call(_context2, store => mapStoresToOptions({
8971
8865
  store,
8972
8866
  dataLocale,
8973
8867
  renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
8974
8868
  }));
8975
- return props !== null && props !== void 0 && props.renderLabel ? [{
8869
+ return props?.renderLabel ? [{
8976
8870
  options: getCustomGroupLabelOption(props.renderLabel)
8977
8871
  }, {
8978
8872
  options: results
8979
8873
  }] : results;
8980
- }, [dataLocale, storesListFetcher.stores, props.renderSelectInputOptionValuesByField, props === null || props === void 0 ? void 0 : props.renderLabel]);
8874
+ }, [dataLocale, storesListFetcher.stores, props.renderSelectInputOptionValuesByField, props?.renderLabel]);
8981
8875
  const handleChange = event => {
8982
- var _event$target$value$v, _event$target$value;
8983
- const value = (_event$target$value$v = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value) !== null && _event$target$value$v !== void 0 ? _event$target$value$v : event.target.value;
8984
- const listOptions = props !== null && props !== void 0 && props.renderLabel ? mappedStoresListOptions[1].options : mappedStoresListOptions;
8876
+ const value = event.target.value?.value ?? event.target.value;
8877
+ const listOptions = props?.renderLabel ? mappedStoresListOptions[1].options : mappedStoresListOptions;
8985
8878
  const currentStore = _findInstanceProperty__default["default"](listOptions).call(listOptions, store => store.value === value);
8986
8879
 
8987
8880
  // We need complete store info including productSelections
8988
- if (!props.shouldFetchProductSelections && !(props !== null && props !== void 0 && props.renderLabel)) {
8881
+ if (!props.shouldFetchProductSelections && !props?.renderLabel) {
8989
8882
  props.onChange(event);
8990
8883
  } else {
8991
8884
  props.onChange({
@@ -9039,7 +8932,6 @@ StoresBasicSelectInput.defaultProps = {
9039
8932
 
9040
8933
  var TotalNumberOfStores = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "TotalNumberOfStores" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "totalNumberOfStores" }, name: { kind: "Name", value: "stores" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 76, source: { body: "query TotalNumberOfStores {\n totalNumberOfStores: stores {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
9041
8934
  const useTotalNumberOfStoresFetcher = projectKey => {
9042
- var _totalNumberOfStoresQ;
9043
8935
  const totalNumberOfStoresQuery = react.useQuery(TotalNumberOfStores, {
9044
8936
  context: {
9045
8937
  target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM,
@@ -9048,7 +8940,7 @@ const useTotalNumberOfStoresFetcher = projectKey => {
9048
8940
  fetchPolicy: 'network-only'
9049
8941
  });
9050
8942
  return {
9051
- total: (_totalNumberOfStoresQ = totalNumberOfStoresQuery.data) === null || _totalNumberOfStoresQ === void 0 ? void 0 : _totalNumberOfStoresQ.totalNumberOfStores.total,
8943
+ total: totalNumberOfStoresQuery.data?.totalNumberOfStores.total,
9052
8944
  isLoading: totalNumberOfStoresQuery.loading
9053
8945
  };
9054
8946
  };
@@ -9066,19 +8958,15 @@ const handlers$2 = {
9066
8958
  };
9067
8959
 
9068
8960
  var FetchStoresByField = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByField" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "storesByField" }, name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 473, source: { body: "query FetchStoresByField(\n $where: String!\n $excludeProductSelections: Boolean!\n $limit: Int\n) {\n storesByField: stores(where: $where, limit: $limit) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
9069
- const createQueryVariables$2 = (stores, predicateField, shouldFetchProductSelections) => {
9070
- var _context;
9071
- return {
9072
- where: _concatInstanceProperty__default["default"](_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty__default["default"](stores).call(stores, store => "\"".concat(store, "\"")).join(', '), ")"),
9073
- limit: 500,
9074
- excludeProductSelections: !shouldFetchProductSelections
9075
- };
9076
- };
8961
+ const createQueryVariables$2 = (stores, predicateField, shouldFetchProductSelections) => ({
8962
+ where: `${predicateField} in (${_mapInstanceProperty__default["default"](stores).call(stores, store => `"${store}"`).join(', ')})`,
8963
+ limit: 500,
8964
+ excludeProductSelections: !shouldFetchProductSelections
8965
+ });
9077
8966
  const emptyStoresQueryResult = {
9078
8967
  results: []
9079
8968
  };
9080
8969
  const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
9081
- var _storesQuery$data;
9082
8970
  let shouldFetchProductSelections = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
9083
8971
  // incase of single select input stores are sent as single string literal
9084
8972
  const storesList = _Array$isArray__default["default"](stores) ? stores : [stores];
@@ -9091,13 +8979,13 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
9091
8979
  skip: storesList.length === 0
9092
8980
  });
9093
8981
  return {
9094
- stores: ((_storesQuery$data = storesQuery.data) === null || _storesQuery$data === void 0 ? void 0 : _storesQuery$data.storesByField) || emptyStoresQueryResult,
8982
+ stores: storesQuery.data?.storesByField || emptyStoresQueryResult,
9095
8983
  isLoading: storesQuery.loading
9096
8984
  };
9097
8985
  };
9098
8986
 
9099
8987
  function ownKeys$C(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
9100
- function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$C(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$C(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
8988
+ function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$C(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$C(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
9101
8989
  var FetchStoresByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "storesByWherePredicate" }, name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 525, source: { body: "query FetchStoresByWherePredicate(\n $where: String!\n $skipFetchingStores: Boolean!\n $excludeProductSelections: Boolean!\n) {\n storesByWherePredicate: stores(where: $where) @skip(if: $skipFetchingStores) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
9102
8990
  var styles$8 = {
9103
8991
  "renderLabelContainer": "stores-search-selector-module__renderLabelContainer___3_PBc",
@@ -9108,16 +8996,16 @@ const hasErrors = errors => {
9108
8996
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
9109
8997
  };
9110
8998
  const createQueryVariables$1 = _ref => {
9111
- var _context2, _context3;
8999
+ var _context2;
9112
9000
  let searchText = _ref.searchText,
9113
9001
  dataLocale = _ref.dataLocale,
9114
9002
  allAccessibleStoreKeysThroughDataFencePermissions = _ref.allAccessibleStoreKeysThroughDataFencePermissions,
9115
9003
  shouldFetchProductSelections = _ref.shouldFetchProductSelections;
9116
9004
  const sanitizedSearchText = sanitize(_trimInstanceProperty__default["default"](searchText).call(searchText, searchText));
9117
- const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
9005
+ const keyQuery = `key = "${sanitizedSearchText}"`;
9118
9006
 
9119
9007
  // if the user has data fence permissions then we only allow stores to fetched that user has access to
9120
- if (allAccessibleStoreKeysThroughDataFencePermissions !== null && allAccessibleStoreKeysThroughDataFencePermissions !== void 0 && allAccessibleStoreKeysThroughDataFencePermissions.length) {
9008
+ if (allAccessibleStoreKeysThroughDataFencePermissions?.length) {
9121
9009
  // if the current search term match the accessible stores keys, then proceed with fetching the store
9122
9010
  if (_includesInstanceProperty__default["default"](allAccessibleStoreKeysThroughDataFencePermissions).call(allAccessibleStoreKeysThroughDataFencePermissions, sanitizedSearchText)) {
9123
9011
  return {
@@ -9133,9 +9021,9 @@ const createQueryVariables$1 = _ref => {
9133
9021
  excludeProductSelections: !shouldFetchProductSelections
9134
9022
  };
9135
9023
  }
9136
- const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
9137
- const nameQuery = _concatInstanceProperty__default["default"](_context2 = "name(".concat(dataLocale, " = \"")).call(_context2, sanitizedSearchText, "\")");
9138
- const searchTextQuery = _filterInstanceProperty__default["default"](_context3 = [idQuery, nameQuery, keyQuery]).call(_context3, Boolean).join(' or ');
9024
+ const idQuery = isUUID(sanitizedSearchText) && `id = "${sanitizedSearchText}"`;
9025
+ const nameQuery = `name(${dataLocale} = "${sanitizedSearchText}")`;
9026
+ const searchTextQuery = _filterInstanceProperty__default["default"](_context2 = [idQuery, nameQuery, keyQuery]).call(_context2, Boolean).join(' or ');
9139
9027
  return {
9140
9028
  skipFetchingStores: false,
9141
9029
  where: searchTextQuery,
@@ -9143,7 +9031,6 @@ const createQueryVariables$1 = _ref => {
9143
9031
  };
9144
9032
  };
9145
9033
  const getValueFromOptions = _ref2 => {
9146
- var _storesByFieldFetcher, _context4;
9147
9034
  let isMulti = _ref2.isMulti,
9148
9035
  value = _ref2.value,
9149
9036
  dataLocale = _ref2.dataLocale,
@@ -9152,7 +9039,7 @@ const getValueFromOptions = _ref2 => {
9152
9039
  if (!value) {
9153
9040
  return undefined;
9154
9041
  }
9155
- const selectedOptions = (_storesByFieldFetcher = storesByFieldFetcher.stores) === null || _storesByFieldFetcher === void 0 ? void 0 : _mapInstanceProperty__default["default"](_context4 = _storesByFieldFetcher.results).call(_context4, store => mapStoresToOptions({
9042
+ const selectedOptions = storesByFieldFetcher.stores?.results.map(store => mapStoresToOptions({
9156
9043
  store,
9157
9044
  dataLocale,
9158
9045
  renderSelectInputOptionValuesByField: renderSelectInputOptionValuesByField
@@ -9168,7 +9055,7 @@ const getValueFromOptions = _ref2 => {
9168
9055
  const StoresSearchSelectInput = props => {
9169
9056
  // hooks
9170
9057
  const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
9171
- dataLocale: applicationContext.dataLocale
9058
+ dataLocale: applicationContext.dataLocale || applicationContext.user?.locale
9172
9059
  })),
9173
9060
  dataLocale = _useApplicationContex.dataLocale;
9174
9061
  const intl = reactIntl.useIntl();
@@ -9190,9 +9077,8 @@ const StoresSearchSelectInput = props => {
9190
9077
  },
9191
9078
  fetchPolicy: 'network-only'
9192
9079
  }).then(_ref3 => {
9193
- var _data$storesByWherePr, _context5;
9194
9080
  let data = _ref3.data;
9195
- const result = (_data$storesByWherePr = data.storesByWherePredicate) === null || _data$storesByWherePr === void 0 ? void 0 : _mapInstanceProperty__default["default"](_context5 = _data$storesByWherePr.results).call(_context5, store => mapStoresToOptions({
9081
+ const result = data.storesByWherePredicate?.results.map(store => mapStoresToOptions({
9196
9082
  store,
9197
9083
  dataLocale,
9198
9084
  renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
@@ -9213,7 +9099,7 @@ const StoresSearchSelectInput = props => {
9213
9099
  className: styles$8.renderLabelContainer,
9214
9100
  children: [jsxRuntime.jsx("div", {
9215
9101
  className: styles$8.customLabel,
9216
- children: (props === null || props === void 0 ? void 0 : props.renderLabel) && (props === null || props === void 0 ? void 0 : props.renderLabel)
9102
+ children: props?.renderLabel && props?.renderLabel
9217
9103
  }), jsxRuntime.jsx("div", {
9218
9104
  children: intl.formatMessage(inputValue ? messages$q.searchSelectInputNoOptionsFoundMessage : messages$q.searchSelectInputNoValueMessage)
9219
9105
  })]
@@ -9386,7 +9272,6 @@ StoreSelectField.defaultProps = {
9386
9272
  mappedValueField: 'id'
9387
9273
  };
9388
9274
 
9389
- var _templateObject$1;
9390
9275
  function ownKeys$z(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
9391
9276
  function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$z(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$z(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
9392
9277
  function _callSuper$5(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -9465,7 +9350,10 @@ const VALIDATOR_INTEGER = {
9465
9350
  * has emitted a warning once in the logs, not for every instance
9466
9351
  */
9467
9352
  let hasWarned = false;
9468
- const warningMessage = commonTags.oneLineTrim(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n `validatedInput` is no longer supported.\n Please use `formik` instead.\n"], ["\n \\`validatedInput\\` is no longer supported.\n Please use \\`formik\\` instead.\n"])));
9353
+ const warningMessage = commonTags.oneLineTrim`
9354
+ \`validatedInput\` is no longer supported.
9355
+ Please use \`formik\` instead.
9356
+ `;
9469
9357
  const ToolTipWrapperComponent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
9470
9358
  let children = _ref.children;
9471
9359
  return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
@@ -9612,7 +9500,7 @@ function validatedInput(InnerComponent, validators) {
9612
9500
  }
9613
9501
  }]);
9614
9502
  }(React.PureComponent);
9615
- ValidatedInput.displayName = "ValidatedInput(".concat(_InnerComponent.displayName, ")");
9503
+ ValidatedInput.displayName = `ValidatedInput(${_InnerComponent.displayName})`;
9616
9504
  ValidatedInput.defaultProps = {
9617
9505
  isValid: true,
9618
9506
  getInputRef: () => {}
@@ -9677,7 +9565,7 @@ let CustomFieldDefinitionsConnector = /*#__PURE__*/function (_Component) {
9677
9565
  value: function componentDidMount() {
9678
9566
  var _context;
9679
9567
  const hasUnsupportedResource = _someInstanceProperty__default["default"](_context = this.props.resources).call(_context, resource => !_includesInstanceProperty__default["default"](customizableResources$1).call(customizableResources$1, resource));
9680
- !!hasUnsupportedResource ? process.env.NODE_ENV !== "production" ? invariant__default["default"](false, "core/components/custom-field-definitions-connector: some of the specified resources are not supported.") : invariant__default["default"](false) : void 0;
9568
+ !!hasUnsupportedResource ? process.env.NODE_ENV !== "production" ? invariant__default["default"](false, `core/components/custom-field-definitions-connector: some of the specified resources are not supported.`) : invariant__default["default"](false) : void 0;
9681
9569
  }
9682
9570
  }, {
9683
9571
  key: "render",
@@ -9695,9 +9583,9 @@ CustomFieldDefinitionsConnector.displayName = 'CustomFieldDefinitionsConnector';
9695
9583
  CustomFieldDefinitionsConnector.defaultProps = {
9696
9584
  resources: []
9697
9585
  };
9698
- const stringifyResources$1 = resources => _mapInstanceProperty__default["default"](resources).call(resources, resource => "\"".concat(resource, "\"")).join();
9586
+ const stringifyResources$1 = resources => _mapInstanceProperty__default["default"](resources).call(resources, resource => `"${resource}"`).join();
9699
9587
  const mapPropsToOptions = ownProps => {
9700
- const where = ownProps.resources.length > 0 ? "resourceTypeIds contains any (".concat(stringifyResources$1(ownProps.resources), ")") : undefined;
9588
+ const where = ownProps.resources.length > 0 ? `resourceTypeIds contains any (${stringifyResources$1(ownProps.resources)})` : undefined;
9701
9589
  return {
9702
9590
  variables: {
9703
9591
  where,
@@ -9766,19 +9654,19 @@ const graphQlDocToForm = typeDefinition => {
9766
9654
  key: typeDefinition.key,
9767
9655
  name: l10n.transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
9768
9656
  fieldDefinitions: _mapInstanceProperty__default["default"](_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
9769
- var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
9657
+ var _context2, _context3;
9770
9658
  return {
9771
9659
  name: fieldDefinition.name,
9772
9660
  required: fieldDefinition.required,
9773
9661
  inputHint: fieldDefinition.inputHint,
9774
- type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$x(_objectSpread$x({}, fieldDefinition.type), {}, {
9662
+ type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$x(_objectSpread$x({}, fieldDefinition.type), {}, {
9775
9663
  elementType: _objectSpread$x(_objectSpread$x({}, fieldDefinition.type.elementType), {}, {
9776
9664
  values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
9777
9665
  key: value.key,
9778
9666
  label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
9779
9667
  }))
9780
9668
  })
9781
- }) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$x(_objectSpread$x({}, fieldDefinition.type), {}, {
9669
+ }) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$x(_objectSpread$x({}, fieldDefinition.type), {}, {
9782
9670
  values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
9783
9671
  key: value.key,
9784
9672
  label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
@@ -9810,7 +9698,7 @@ const formToGraphQlDoc = formCustomFields => ({
9810
9698
  // TODO(pa3): find usages and make sure only 1 param is passed
9811
9699
  const createEmptyCustomFields = typeDefinition => ({
9812
9700
  fields: {},
9813
- type: (typeDefinition === null || typeDefinition === void 0 ? void 0 : typeDefinition.type) || {
9701
+ type: typeDefinition?.type || {
9814
9702
  fieldDefinitions: []
9815
9703
  }
9816
9704
  });
@@ -9818,7 +9706,7 @@ const createEmptyCustomFields = typeDefinition => ({
9818
9706
  function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9819
9707
  function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function () { return !!t; })(); }
9820
9708
  var FetchTypeDefinitionsWithNamesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsWithNamesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "required" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1445, source: { body: "query FetchTypeDefinitionsWithNamesQuery(\n $where: String\n $limit: Int\n $offset: Int\n) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n id\n key\n nameAllLocales {\n value\n locale\n }\n fieldDefinitions {\n required\n type {\n name\n ... on ReferenceType {\n referenceTypeId\n }\n ... on SetType {\n elementType {\n name\n ... on ReferenceType {\n referenceTypeId\n name\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n inputHint\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
9821
- const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'quote', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection', 'order-return-item', 'order-parcel'];
9709
+ const customizableResources = ['asset', 'address', 'associate-role', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'quote', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection', 'order-return-item', 'order-parcel'];
9822
9710
  const emptyTypeDefinitions = {
9823
9711
  total: 0,
9824
9712
  count: 0,
@@ -9835,7 +9723,7 @@ let CustomFieldTypeDefinitionsConnector = /*#__PURE__*/function (_Component) {
9835
9723
  value: function componentDidMount() {
9836
9724
  var _context;
9837
9725
  const hasUnsupportedResource = _someInstanceProperty__default["default"](_context = this.props.resources).call(_context, resource => !_includesInstanceProperty__default["default"](customizableResources).call(customizableResources, resource));
9838
- !!hasUnsupportedResource ? process.env.NODE_ENV !== "production" ? invariant__default["default"](false, "core/components/custom-field-definitions-connector: some of the specified resources are not supported.") : invariant__default["default"](false) : void 0;
9726
+ !!hasUnsupportedResource ? process.env.NODE_ENV !== "production" ? invariant__default["default"](false, `core/components/custom-field-definitions-connector: some of the specified resources are not supported.`) : invariant__default["default"](false) : void 0;
9839
9727
  }
9840
9728
  }, {
9841
9729
  key: "render",
@@ -9859,9 +9747,9 @@ CustomFieldTypeDefinitionsConnector.graphQlDocToForm = graphQlDocToForm;
9859
9747
  CustomFieldTypeDefinitionsConnector.formToRestDoc = formToRestDoc;
9860
9748
  CustomFieldTypeDefinitionsConnector.formToGraphQlDoc = formToGraphQlDoc;
9861
9749
  CustomFieldTypeDefinitionsConnector.createEmptyCustomFields = createEmptyCustomFields;
9862
- const stringifyResources = resources => _mapInstanceProperty__default["default"](resources).call(resources, resource => "\"".concat(resource, "\"")).join();
9750
+ const stringifyResources = resources => _mapInstanceProperty__default["default"](resources).call(resources, resource => `"${resource}"`).join();
9863
9751
  const createGraphQlOptions = ownProps => {
9864
- const where = ownProps.resources.length > 0 ? "resourceTypeIds contains any (".concat(stringifyResources(ownProps.resources), ")") : undefined;
9752
+ const where = ownProps.resources.length > 0 ? `resourceTypeIds contains any (${stringifyResources(ownProps.resources)})` : undefined;
9865
9753
  return {
9866
9754
  variables: {
9867
9755
  where,
@@ -9911,7 +9799,7 @@ const extractDuplicatedValues = (values, type, language, languages) => {
9911
9799
  let validatedValues = [];
9912
9800
  if (type.name.toLowerCase() === 'money') {
9913
9801
  validatedValues = unique(values, ['amount', 'currencyCode']);
9914
- } else if (type.name.toLowerCase() === 'reference') validatedValues = unique(_filterInstanceProperty__default["default"](values).call(values, value => value === null || value === void 0 ? void 0 : value.id), ['id']);else if (type.name.toLowerCase() === 'localizedstring') {
9802
+ } else if (type.name.toLowerCase() === 'reference') validatedValues = unique(_filterInstanceProperty__default["default"](values).call(values, value => value?.id), ['id']);else if (type.name.toLowerCase() === 'localizedstring') {
9915
9803
  validatedValues = unique(values, languages);
9916
9804
  } else validatedValues = unique(values);
9917
9805
  return validatedValues;
@@ -10044,10 +9932,9 @@ var messages$o = reactIntl.defineMessages({
10044
9932
  const FIELD_NAME = 'custom';
10045
9933
 
10046
9934
  function ownKeys$u(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
10047
- function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$u(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$u(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
9935
+ function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$u(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$u(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
10048
9936
  const transformFieldType = fieldDefinition => {
10049
- var _fieldDefinition$type, _fieldDefinition$type2;
10050
- if (((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum') {
9937
+ if (fieldDefinition.type?.elementType?.name === 'LocalizedEnum') {
10051
9938
  var _context;
10052
9939
  return _objectSpread$u(_objectSpread$u({}, fieldDefinition.type), {}, {
10053
9940
  elementType: _objectSpread$u(_objectSpread$u({}, fieldDefinition.type.elementType), {}, {
@@ -10057,7 +9944,7 @@ const transformFieldType = fieldDefinition => {
10057
9944
  }))
10058
9945
  })
10059
9946
  });
10060
- } else if (((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum') {
9947
+ } else if (fieldDefinition.type?.name === 'LocalizedEnum') {
10061
9948
  var _context2;
10062
9949
  return _objectSpread$u(_objectSpread$u({}, fieldDefinition.type), {}, {
10063
9950
  values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context2, value => ({
@@ -10104,9 +9991,9 @@ const createFormStateFromResource = resource => {
10104
9991
  };
10105
9992
  };
10106
9993
  const createGraphQlDocFromFormState = formState => {
10107
- var _formState$FIELD_NAME, _context5;
9994
+ var _context5;
10108
9995
  // Unset the custom type if it's not in the form state
10109
- if (!((_formState$FIELD_NAME = formState[FIELD_NAME]) !== null && _formState$FIELD_NAME !== void 0 && (_formState$FIELD_NAME = _formState$FIELD_NAME.type) !== null && _formState$FIELD_NAME !== void 0 && _formState$FIELD_NAME.id)) {
9996
+ if (!formState[FIELD_NAME]?.type?.id) {
10110
9997
  return {
10111
9998
  [FIELD_NAME]: {}
10112
9999
  };
@@ -10132,8 +10019,7 @@ const createGraphQlDocFromFormState = formState => {
10132
10019
 
10133
10020
  // Creates a root field name accessor for `custom` form state
10134
10021
  const createRootFieldName = rootFieldName => {
10135
- var _context6;
10136
- return rootFieldName ? _concatInstanceProperty__default["default"](_context6 = "".concat(rootFieldName, ".")).call(_context6, FIELD_NAME) : FIELD_NAME;
10022
+ return rootFieldName ? `${rootFieldName}.${FIELD_NAME}` : FIELD_NAME;
10137
10023
  };
10138
10024
 
10139
10025
  function ownKeys$t(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -10142,8 +10028,7 @@ const typeDefinitionsExist = typeDefinitions => {
10142
10028
  return typeDefinitions.length > 0;
10143
10029
  };
10144
10030
  const typeDefinitionSelected = (formValues, rootFieldName) => {
10145
- var _getIn, _getIn2;
10146
- return ((_getIn = formik.getIn(formValues, rootFieldName)) === null || _getIn === void 0 ? void 0 : _getIn.type) && ((_getIn2 = formik.getIn(formValues, rootFieldName)) === null || _getIn2 === void 0 || (_getIn2 = _getIn2.type) === null || _getIn2 === void 0 ? void 0 : _getIn2.obj);
10031
+ return formik.getIn(formValues, rootFieldName)?.type && formik.getIn(formValues, rootFieldName)?.type?.obj;
10147
10032
  };
10148
10033
  const typeDefinitionContainsFieldDefinitions = (formValues, rootFieldName) => {
10149
10034
  return formik.getIn(formValues, rootFieldName).type.obj.key && formik.getIn(formValues, rootFieldName).type.obj.fieldDefinitions.length > 0;
@@ -10180,7 +10065,7 @@ const CustomFieldsInputWrapper = _ref2 => {
10180
10065
  max: "scale",
10181
10066
  children: jsxRuntime.jsx(CustomFields, {
10182
10067
  isReadOnly: isReadOnly,
10183
- name: "".concat(rootFieldName, ".fields"),
10068
+ name: `${rootFieldName}.fields`,
10184
10069
  fieldDefinitions: isReadOnly && hideEmptyFields ? fieldDefinitionsWithValues(formValues, rootFieldName) : formik.getIn(formValues, rootFieldName).type.obj.fieldDefinitions
10185
10070
  })
10186
10071
  });
@@ -10215,7 +10100,6 @@ const createFormStateFromTypeDefinition = selectedTypeDefinition => {
10215
10100
  };
10216
10101
  };
10217
10102
  const CustomTypeSubform = _ref => {
10218
- var _getIn3, _getIn4;
10219
10103
  let typeDefinitions = _ref.typeDefinitions,
10220
10104
  isReadOnly = _ref.isReadOnly,
10221
10105
  isCondensed = _ref.isCondensed,
@@ -10250,8 +10134,7 @@ const CustomTypeSubform = _ref => {
10250
10134
  }
10251
10135
  }, [typeDefinitions, setFieldValue, validateForm, rootFieldName]);
10252
10136
  const typeDefinitionSelected = formValues => {
10253
- var _getIn, _getIn2;
10254
- return ((_getIn = formik.getIn(formValues, rootFieldName)) === null || _getIn === void 0 ? void 0 : _getIn.type) && ((_getIn2 = formik.getIn(formValues, rootFieldName)) === null || _getIn2 === void 0 || (_getIn2 = _getIn2.type) === null || _getIn2 === void 0 ? void 0 : _getIn2.obj);
10137
+ return formik.getIn(formValues, rootFieldName)?.type && formik.getIn(formValues, rootFieldName)?.type?.obj;
10255
10138
  };
10256
10139
 
10257
10140
  // if the user has read-only permissions, empty fields are hidden, and no type definition is selected, hide the component
@@ -10266,9 +10149,9 @@ const CustomTypeSubform = _ref => {
10266
10149
  children: jsxRuntime.jsx(uiKit.SelectInput, {
10267
10150
  isClearable: true,
10268
10151
  "data-testid": "custom-type-select",
10269
- name: "".concat(rootFieldName, ".type.obj.key"),
10270
- options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_getIn3 = formik.getIn(formValues, rootFieldName)) === null || _getIn3 === void 0 || (_getIn3 = _getIn3.type) === null || _getIn3 === void 0 ? void 0 : _getIn3.id),
10271
- value: (_getIn4 = formik.getIn(formValues, rootFieldName)) === null || _getIn4 === void 0 || (_getIn4 = _getIn4.type) === null || _getIn4 === void 0 || (_getIn4 = _getIn4.obj) === null || _getIn4 === void 0 ? void 0 : _getIn4.key,
10152
+ name: `${rootFieldName}.type.obj.key`,
10153
+ options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, formik.getIn(formValues, rootFieldName)?.type?.id),
10154
+ value: formik.getIn(formValues, rootFieldName)?.type?.obj?.key,
10272
10155
  onChange: handleTypeDefinitionSelect,
10273
10156
  placeholder: formatMessage(messages$o.typesPlaceholder),
10274
10157
  isReadOnly: isReadOnly
@@ -10349,7 +10232,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
10349
10232
  try {
10350
10233
  await dispatch(sdk.actions.head({
10351
10234
  mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.PIM_SEARCH,
10352
- uri: "/".concat(projectKey, "/search/products")
10235
+ uri: `/${projectKey}/search/products`
10353
10236
  }));
10354
10237
  return {
10355
10238
  status: 'indexed'
@@ -10415,8 +10298,8 @@ const getIndexingJobIds = _ref => {
10415
10298
  products = _ref$data.products,
10416
10299
  productTypes = _ref$data.productTypes;
10417
10300
  return {
10418
- productsJobId: (products === null || products === void 0 ? void 0 : products.indexingJobId) || (products === null || products === void 0 ? void 0 : products.existingIndexingJobId),
10419
- productTypesJobId: (productTypes === null || productTypes === void 0 ? void 0 : productTypes.indexingJobId) || (productTypes === null || productTypes === void 0 ? void 0 : productTypes.existingIndexingJobId)
10301
+ productsJobId: products?.indexingJobId || products?.existingIndexingJobId,
10302
+ productTypesJobId: productTypes?.indexingJobId || productTypes?.existingIndexingJobId
10420
10303
  };
10421
10304
  };
10422
10305
  let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
@@ -10667,6 +10550,7 @@ function usePimIndexer() {
10667
10550
 
10668
10551
  // eslint-disable-next-line import/prefer-default-export
10669
10552
  const RESOURCES_WITH_PLATFORM_LIMITS = {
10553
+ businessUnits: 'businessUnits',
10670
10554
  shoppingLists: 'shoppingLists',
10671
10555
  productDiscounts: 'productDiscounts',
10672
10556
  cartDiscounts: 'cartDiscounts',
@@ -10683,10 +10567,10 @@ function ownKeys$p(e, r) { var t = _Object$keys__default["default"](e); if (_Obj
10683
10567
  function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$p(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$p(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
10684
10568
  const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
10685
10569
  const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$p({
10686
- [camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
10570
+ [camelCase__default["default"](`should include ${nextNameOfLimit}`)]: platformLimit ? nextNameOfLimit === platformLimit : true
10687
10571
  }, previousIncludedLimits), {});
10688
10572
 
10689
- var PlatformLimitsFetcherQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "PlatformLimitsFetcherQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShoppingLists" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCartDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomers" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomerGroups" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeZones" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeTaxCategories" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShippingMethods" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCarts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limits" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "shoppingLists" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShoppingLists" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "lineItems" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "textLineItems" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productDiscounts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "totalActive" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCartDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "totalActiveWithoutDiscountCodes" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inventorySupplyChannels" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productDistributionChannels" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customers" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomers" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customerGroups" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomerGroups" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "zones" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeZones" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "taxCategories" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeTaxCategories" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "shippingMethods" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShippingMethods" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "carts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCarts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1820, source: { body: "query PlatformLimitsFetcherQuery(\n $shouldIncludeShoppingLists: Boolean!\n $shouldIncludeProductDiscounts: Boolean!\n $shouldIncludeCartDiscounts: Boolean!\n $shouldIncludeStores: Boolean!\n $shouldIncludeCustomers: Boolean!\n $shouldIncludeCustomerGroups: Boolean!\n $shouldIncludeZones: Boolean!\n $shouldIncludeTaxCategories: Boolean!\n $shouldIncludeShippingMethods: Boolean!\n $shouldIncludeCarts: Boolean!\n) {\n limits {\n shoppingLists @include(if: $shouldIncludeShoppingLists) {\n total {\n limit\n current\n }\n lineItems {\n limit\n }\n textLineItems {\n limit\n }\n }\n productDiscounts @include(if: $shouldIncludeProductDiscounts) {\n totalActive {\n limit\n current\n }\n }\n cartDiscounts @include(if: $shouldIncludeCartDiscounts) {\n totalActiveWithoutDiscountCodes {\n limit\n current\n }\n }\n stores @include(if: $shouldIncludeStores) {\n total {\n limit\n current\n }\n inventorySupplyChannels {\n limit\n }\n productDistributionChannels {\n limit\n }\n }\n customers @include(if: $shouldIncludeCustomers) {\n total {\n limit\n current\n }\n }\n customerGroups @include(if: $shouldIncludeCustomerGroups) {\n total {\n limit\n current\n }\n }\n zones @include(if: $shouldIncludeZones) {\n total {\n limit\n current\n }\n }\n taxCategories @include(if: $shouldIncludeTaxCategories) {\n total {\n limit\n current\n }\n }\n shippingMethods @include(if: $shouldIncludeShippingMethods) {\n total {\n limit\n current\n }\n }\n carts @include(if: $shouldIncludeCarts) {\n total {\n limit\n current\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
10573
+ var PlatformLimitsFetcherQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "PlatformLimitsFetcherQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShoppingLists" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCartDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomers" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomerGroups" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeZones" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeTaxCategories" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShippingMethods" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCarts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeBusinessUnits" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limits" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "shoppingLists" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShoppingLists" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "lineItems" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "textLineItems" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productDiscounts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "totalActive" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCartDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "totalActiveWithoutDiscountCodes" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inventorySupplyChannels" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productDistributionChannels" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customers" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomers" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customerGroups" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCustomerGroups" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "zones" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeZones" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "taxCategories" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeTaxCategories" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "shippingMethods" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeShippingMethods" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "carts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeCarts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "businessUnits" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeBusinessUnits" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "maxDivisions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "maxDepthLimit" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "maxAssociates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "maxAssociateRoles" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 2107, source: { body: "query PlatformLimitsFetcherQuery(\n $shouldIncludeShoppingLists: Boolean!\n $shouldIncludeProductDiscounts: Boolean!\n $shouldIncludeCartDiscounts: Boolean!\n $shouldIncludeStores: Boolean!\n $shouldIncludeCustomers: Boolean!\n $shouldIncludeCustomerGroups: Boolean!\n $shouldIncludeZones: Boolean!\n $shouldIncludeTaxCategories: Boolean!\n $shouldIncludeShippingMethods: Boolean!\n $shouldIncludeCarts: Boolean!\n $shouldIncludeBusinessUnits: Boolean!\n) {\n limits {\n shoppingLists @include(if: $shouldIncludeShoppingLists) {\n total {\n limit\n current\n }\n lineItems {\n limit\n }\n textLineItems {\n limit\n }\n }\n productDiscounts @include(if: $shouldIncludeProductDiscounts) {\n totalActive {\n limit\n current\n }\n }\n cartDiscounts @include(if: $shouldIncludeCartDiscounts) {\n totalActiveWithoutDiscountCodes {\n limit\n current\n }\n }\n stores @include(if: $shouldIncludeStores) {\n total {\n limit\n current\n }\n inventorySupplyChannels {\n limit\n }\n productDistributionChannels {\n limit\n }\n }\n customers @include(if: $shouldIncludeCustomers) {\n total {\n limit\n current\n }\n }\n customerGroups @include(if: $shouldIncludeCustomerGroups) {\n total {\n limit\n current\n }\n }\n zones @include(if: $shouldIncludeZones) {\n total {\n limit\n current\n }\n }\n taxCategories @include(if: $shouldIncludeTaxCategories) {\n total {\n limit\n current\n }\n }\n shippingMethods @include(if: $shouldIncludeShippingMethods) {\n total {\n limit\n current\n }\n }\n carts @include(if: $shouldIncludeCarts) {\n total {\n limit\n current\n }\n }\n businessUnits @include(if: $shouldIncludeBusinessUnits) {\n maxDivisions {\n limit\n }\n maxDepthLimit {\n limit\n }\n maxAssociates {\n limit\n }\n maxAssociateRoles {\n limit\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
10690
10574
  const usePlatformLimitsFetcher = platformLimit => {
10691
10575
  const _useQuery = react.useQuery(PlatformLimitsFetcherQuery, {
10692
10576
  variables: createQueryVariables(platformLimit),
@@ -10699,7 +10583,7 @@ const usePlatformLimitsFetcher = platformLimit => {
10699
10583
  error = _useQuery.error,
10700
10584
  data = _useQuery.data,
10701
10585
  refetch = _useQuery.refetch;
10702
- const platformLimits = !loading ? omit__default["default"](data === null || data === void 0 ? void 0 : data.limits, '__typename') : {};
10586
+ const platformLimits = !loading ? omit__default["default"](data?.limits, '__typename') : {};
10703
10587
  return {
10704
10588
  isLoading: loading,
10705
10589
  error,
@@ -10890,11 +10774,10 @@ const getPlatformLimitsStatus = _ref3 => {
10890
10774
  total = _ref3.total,
10891
10775
  intl = _ref3.intl;
10892
10776
  if (limit) {
10893
- var _context;
10894
- return _concatInstanceProperty__default["default"](_context = "(".concat(intl.formatNumber(current), "/")).call(_context, intl.formatNumber(limit), ")");
10777
+ return `(${intl.formatNumber(current)}/${intl.formatNumber(limit)})`;
10895
10778
  }
10896
10779
  if (total) {
10897
- return "(".concat(intl.formatNumber(total), ")");
10780
+ return `(${intl.formatNumber(total)})`;
10898
10781
  }
10899
10782
  return '';
10900
10783
  };
@@ -10914,18 +10797,17 @@ const useShippingMethodsPlatformLimitsFetcher = () => {
10914
10797
  };
10915
10798
 
10916
10799
  const useShippingMethodsPlatformLimits = () => {
10917
- var _platformLimits$shipp;
10918
10800
  const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
10919
10801
  platformLimits = _useShippingMethodsPl.platformLimits;
10920
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$shipp = platformLimits.shippingMethods) !== null && _platformLimits$shipp !== void 0 && _platformLimits$shipp.total)) {
10802
+ if (!platformLimits?.shippingMethods?.total) {
10921
10803
  return {
10922
10804
  hasReachedShippingMethodsWarningLimit: false,
10923
10805
  hasReachedShippingMethodsErrorLimit: false
10924
10806
  };
10925
10807
  }
10926
- const _platformLimits$shipp2 = platformLimits.shippingMethods.total,
10927
- limit = _platformLimits$shipp2.limit,
10928
- current = _platformLimits$shipp2.current;
10808
+ const _platformLimits$shipp = platformLimits.shippingMethods.total,
10809
+ limit = _platformLimits$shipp.limit,
10810
+ current = _platformLimits$shipp.current;
10929
10811
  const hasReachedShippingMethodsWarningLimit = getHasExceededWarningThreshold({
10930
10812
  limit,
10931
10813
  current
@@ -10941,13 +10823,12 @@ const useShippingMethodsPlatformLimits = () => {
10941
10823
  };
10942
10824
 
10943
10825
  const PlatformLimitsShippingMethodsNotifications = () => {
10944
- var _platformLimits$shipp;
10945
10826
  const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
10946
10827
  platformLimits = _useShippingMethodsPl.platformLimits;
10947
10828
  const _useShippingMethodsPl2 = useShippingMethodsPlatformLimits(),
10948
10829
  hasReachedShippingMethodsWarningLimit = _useShippingMethodsPl2.hasReachedShippingMethodsWarningLimit,
10949
10830
  hasReachedShippingMethodsErrorLimit = _useShippingMethodsPl2.hasReachedShippingMethodsErrorLimit;
10950
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$shipp = platformLimits.shippingMethods) !== null && _platformLimits$shipp !== void 0 && _platformLimits$shipp.total)) {
10831
+ if (!platformLimits?.shippingMethods?.total) {
10951
10832
  return null;
10952
10833
  }
10953
10834
  if (hasReachedShippingMethodsErrorLimit) {
@@ -10993,13 +10874,12 @@ var messages$j = reactIntl.defineMessages({
10993
10874
  });
10994
10875
 
10995
10876
  const PlatformLimitsShippingMethodsStatus = _ref => {
10996
- var _platformLimits$shipp, _platformLimits$shipp2;
10997
10877
  let total = _ref.total;
10998
10878
  const intl = reactIntl.useIntl();
10999
10879
  const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
11000
10880
  platformLimits = _useShippingMethodsPl.platformLimits;
11001
- const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 || (_platformLimits$shipp = _platformLimits$shipp.total) === null || _platformLimits$shipp === void 0 ? void 0 : _platformLimits$shipp.current;
11002
- const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp2 = platformLimits.shippingMethods) === null || _platformLimits$shipp2 === void 0 || (_platformLimits$shipp2 = _platformLimits$shipp2.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.limit;
10881
+ const current = platformLimits?.shippingMethods?.total?.current;
10882
+ const limit = platformLimits?.shippingMethods?.total?.limit;
11003
10883
  return jsxRuntime.jsx(PlatformLimitsStatusText, {
11004
10884
  intlMessage: messages$j.shippingMethodsStatus,
11005
10885
  children: getPlatformLimitsStatus({
@@ -11061,18 +10941,17 @@ const useTaxCategoriesPlatformLimitsFetcher = () => {
11061
10941
  };
11062
10942
 
11063
10943
  const useTaxCategoriesPlatformLimits = () => {
11064
- var _platformLimits$taxCa;
11065
10944
  const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
11066
10945
  platformLimits = _useTaxCategoriesPlat.platformLimits;
11067
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$taxCa = platformLimits.taxCategories) !== null && _platformLimits$taxCa !== void 0 && _platformLimits$taxCa.total)) {
10946
+ if (!platformLimits?.taxCategories?.total) {
11068
10947
  return {
11069
10948
  hasReachedTaxCategoriesWarningLimit: false,
11070
10949
  hasReachedTaxCategoriesErrorLimit: false
11071
10950
  };
11072
10951
  }
11073
- const _platformLimits$taxCa2 = platformLimits.taxCategories.total,
11074
- limit = _platformLimits$taxCa2.limit,
11075
- current = _platformLimits$taxCa2.current;
10952
+ const _platformLimits$taxCa = platformLimits.taxCategories.total,
10953
+ limit = _platformLimits$taxCa.limit,
10954
+ current = _platformLimits$taxCa.current;
11076
10955
  const hasReachedTaxCategoriesWarningLimit = getHasExceededWarningThreshold({
11077
10956
  limit,
11078
10957
  current
@@ -11088,13 +10967,12 @@ const useTaxCategoriesPlatformLimits = () => {
11088
10967
  };
11089
10968
 
11090
10969
  const PlatformLimitsTaxCategoriesNotifications = () => {
11091
- var _platformLimits$taxCa;
11092
10970
  const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
11093
10971
  platformLimits = _useTaxCategoriesPlat.platformLimits;
11094
10972
  const _useTaxCategoriesPlat2 = useTaxCategoriesPlatformLimits(),
11095
10973
  hasReachedTaxCategoriesWarningLimit = _useTaxCategoriesPlat2.hasReachedTaxCategoriesWarningLimit,
11096
10974
  hasReachedTaxCategoriesErrorLimit = _useTaxCategoriesPlat2.hasReachedTaxCategoriesErrorLimit;
11097
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$taxCa = platformLimits.taxCategories) !== null && _platformLimits$taxCa !== void 0 && _platformLimits$taxCa.total)) {
10975
+ if (!platformLimits?.taxCategories?.total) {
11098
10976
  return null;
11099
10977
  }
11100
10978
  if (hasReachedTaxCategoriesErrorLimit) {
@@ -11140,13 +11018,12 @@ var messages$h = reactIntl.defineMessages({
11140
11018
  });
11141
11019
 
11142
11020
  const PlatformLimitsTaxCategoriesStatus = _ref => {
11143
- var _platformLimits$taxCa, _platformLimits$taxCa2;
11144
11021
  let total = _ref.total;
11145
11022
  const intl = reactIntl.useIntl();
11146
11023
  const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
11147
11024
  platformLimits = _useTaxCategoriesPlat.platformLimits;
11148
- const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 || (_platformLimits$taxCa = _platformLimits$taxCa.total) === null || _platformLimits$taxCa === void 0 ? void 0 : _platformLimits$taxCa.current;
11149
- const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa2 = platformLimits.taxCategories) === null || _platformLimits$taxCa2 === void 0 || (_platformLimits$taxCa2 = _platformLimits$taxCa2.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.limit;
11025
+ const current = platformLimits?.taxCategories?.total?.current;
11026
+ const limit = platformLimits?.taxCategories?.total?.limit;
11150
11027
  return jsxRuntime.jsx(PlatformLimitsStatusText, {
11151
11028
  intlMessage: messages$h.taxCategoriesStatus,
11152
11029
  children: getPlatformLimitsStatus({
@@ -11208,18 +11085,17 @@ const useZonesPlatformLimitsFetcher = () => {
11208
11085
  };
11209
11086
 
11210
11087
  const useZonesPlatformLimits = () => {
11211
- var _platformLimits$zones;
11212
11088
  const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
11213
11089
  platformLimits = _useZonesPlatformLimi.platformLimits;
11214
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$zones = platformLimits.zones) !== null && _platformLimits$zones !== void 0 && _platformLimits$zones.total)) {
11090
+ if (!platformLimits?.zones?.total) {
11215
11091
  return {
11216
11092
  hasReachedZonesWarningLimit: false,
11217
11093
  hasReachedZonesErrorLimit: false
11218
11094
  };
11219
11095
  }
11220
- const _platformLimits$zones2 = platformLimits.zones.total,
11221
- limit = _platformLimits$zones2.limit,
11222
- current = _platformLimits$zones2.current;
11096
+ const _platformLimits$zones = platformLimits.zones.total,
11097
+ limit = _platformLimits$zones.limit,
11098
+ current = _platformLimits$zones.current;
11223
11099
  const hasReachedZonesWarningLimit = getHasExceededWarningThreshold({
11224
11100
  limit,
11225
11101
  current
@@ -11235,13 +11111,12 @@ const useZonesPlatformLimits = () => {
11235
11111
  };
11236
11112
 
11237
11113
  const PlatformLimitsZonesNotifications = () => {
11238
- var _platformLimits$zones;
11239
11114
  const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
11240
11115
  platformLimits = _useZonesPlatformLimi.platformLimits;
11241
11116
  const _useZonesPlatformLimi2 = useZonesPlatformLimits(),
11242
11117
  hasReachedZonesWarningLimit = _useZonesPlatformLimi2.hasReachedZonesWarningLimit,
11243
11118
  hasReachedZonesErrorLimit = _useZonesPlatformLimi2.hasReachedZonesErrorLimit;
11244
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$zones = platformLimits.zones) !== null && _platformLimits$zones !== void 0 && _platformLimits$zones.total)) {
11119
+ if (!platformLimits?.zones?.total) {
11245
11120
  return null;
11246
11121
  }
11247
11122
  if (hasReachedZonesErrorLimit) {
@@ -11287,13 +11162,12 @@ var messages$f = reactIntl.defineMessages({
11287
11162
  });
11288
11163
 
11289
11164
  const PlatformLimitsZonesStatus = _ref => {
11290
- var _platformLimits$zones, _platformLimits$zones2;
11291
11165
  let total = _ref.total;
11292
11166
  const intl = reactIntl.useIntl();
11293
11167
  const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
11294
11168
  platformLimits = _useZonesPlatformLimi.platformLimits;
11295
- const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 || (_platformLimits$zones = _platformLimits$zones.total) === null || _platformLimits$zones === void 0 ? void 0 : _platformLimits$zones.current;
11296
- const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones2 = platformLimits.zones) === null || _platformLimits$zones2 === void 0 || (_platformLimits$zones2 = _platformLimits$zones2.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.limit;
11169
+ const current = platformLimits?.zones?.total?.current;
11170
+ const limit = platformLimits?.zones?.total?.limit;
11297
11171
  return jsxRuntime.jsx(PlatformLimitsStatusText, {
11298
11172
  intlMessage: messages$f.zonesStatus,
11299
11173
  children: getPlatformLimitsStatus({
@@ -11355,18 +11229,17 @@ const useCustomersPlatformLimitsFetcher = () => {
11355
11229
  };
11356
11230
 
11357
11231
  const useCustomersPlatformLimits$1 = () => {
11358
- var _platformLimits$custo;
11359
11232
  const _useCustomersPlatform = useCustomersPlatformLimitsFetcher(),
11360
11233
  platformLimits = _useCustomersPlatform.platformLimits;
11361
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$custo = platformLimits.customers) !== null && _platformLimits$custo !== void 0 && _platformLimits$custo.total)) {
11234
+ if (!platformLimits?.customers?.total) {
11362
11235
  return {
11363
11236
  hasReachedCustomersWarningLimit: false,
11364
11237
  hasReachedCustomersErrorLimit: false
11365
11238
  };
11366
11239
  }
11367
- const _platformLimits$custo2 = platformLimits.customers.total,
11368
- limit = _platformLimits$custo2.limit,
11369
- current = _platformLimits$custo2.current;
11240
+ const _platformLimits$custo = platformLimits.customers.total,
11241
+ limit = _platformLimits$custo.limit,
11242
+ current = _platformLimits$custo.current;
11370
11243
  const hasReachedCustomersWarningLimit = getHasExceededWarningThreshold({
11371
11244
  limit,
11372
11245
  current
@@ -11395,13 +11268,12 @@ const useCustomersPlatormLimitsModalState = () => {
11395
11268
  };
11396
11269
 
11397
11270
  const PlatformLimitsCustomersNotifications = () => {
11398
- var _platformLimits$custo;
11399
11271
  const _useCustomersPlatform = useCustomersPlatformLimitsFetcher(),
11400
11272
  platformLimits = _useCustomersPlatform.platformLimits;
11401
11273
  const _useCustomersPlatform2 = useCustomersPlatformLimits$1(),
11402
11274
  hasReachedCustomersWarningLimit = _useCustomersPlatform2.hasReachedCustomersWarningLimit,
11403
11275
  hasReachedCustomersErrorLimit = _useCustomersPlatform2.hasReachedCustomersErrorLimit;
11404
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$custo = platformLimits.customers) !== null && _platformLimits$custo !== void 0 && _platformLimits$custo.total)) {
11276
+ if (!platformLimits?.customers?.total) {
11405
11277
  return jsxRuntime.jsx("div", {});
11406
11278
  }
11407
11279
  if (hasReachedCustomersErrorLimit) {
@@ -11452,16 +11324,15 @@ var styles$6 = {
11452
11324
  "status": "platform-limits-customers-status-module__status___3rXYM"
11453
11325
  };
11454
11326
  const PlatformLimitsCustomersStatus = () => {
11455
- var _platformLimits$custo;
11456
11327
  const intl = reactIntl.useIntl();
11457
11328
  const _useCustomersPlatform = useCustomersPlatformLimitsFetcher(),
11458
11329
  platformLimits = _useCustomersPlatform.platformLimits;
11459
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$custo = platformLimits.customers) !== null && _platformLimits$custo !== void 0 && _platformLimits$custo.total)) {
11330
+ if (!platformLimits?.customers?.total) {
11460
11331
  return null;
11461
11332
  }
11462
- const _platformLimits$custo2 = platformLimits.customers.total,
11463
- current = _platformLimits$custo2.current,
11464
- limit = _platformLimits$custo2.limit;
11333
+ const _platformLimits$custo = platformLimits.customers.total,
11334
+ current = _platformLimits$custo.current,
11335
+ limit = _platformLimits$custo.limit;
11465
11336
  return jsxRuntime.jsx("div", {
11466
11337
  className: styles$6.status,
11467
11338
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
@@ -11695,18 +11566,17 @@ const useCustomerGroupsPlatformLimitsFetcher = () => {
11695
11566
  };
11696
11567
 
11697
11568
  const useCustomerGroupsPlatformLimitsStatus = () => {
11698
- var _platformLimits$custo;
11699
11569
  const _useCustomerGroupsPla = useCustomerGroupsPlatformLimitsFetcher(),
11700
11570
  platformLimits = _useCustomerGroupsPla.platformLimits;
11701
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$custo = platformLimits.customerGroups) !== null && _platformLimits$custo !== void 0 && _platformLimits$custo.total)) {
11571
+ if (!platformLimits?.customerGroups?.total) {
11702
11572
  return {
11703
11573
  hasReachedCustomerGroupsWarningLimit: false,
11704
11574
  hasReachedCustomerGroupsErrorLimit: false
11705
11575
  };
11706
11576
  }
11707
- const _platformLimits$custo2 = platformLimits.customerGroups.total,
11708
- limit = _platformLimits$custo2.limit,
11709
- current = _platformLimits$custo2.current;
11577
+ const _platformLimits$custo = platformLimits.customerGroups.total,
11578
+ limit = _platformLimits$custo.limit,
11579
+ current = _platformLimits$custo.current;
11710
11580
  const hasReachedCustomerGroupsWarningLimit = getHasExceededWarningThreshold({
11711
11581
  limit,
11712
11582
  current
@@ -11735,13 +11605,12 @@ const useCustomerGroupsPlatormLimitsModalState = () => {
11735
11605
  };
11736
11606
 
11737
11607
  const PlatformLimitsCustomerGroupsNotifications = () => {
11738
- var _platformLimits$custo;
11739
11608
  const _useCustomerGroupsPla = useCustomerGroupsPlatformLimitsFetcher(),
11740
11609
  platformLimits = _useCustomerGroupsPla.platformLimits;
11741
11610
  const _useCustomerGroupsPla2 = useCustomerGroupsPlatformLimitsStatus(),
11742
11611
  hasReachedCustomerGroupsWarningLimit = _useCustomerGroupsPla2.hasReachedCustomerGroupsWarningLimit,
11743
11612
  hasReachedCustomerGroupsErrorLimit = _useCustomerGroupsPla2.hasReachedCustomerGroupsErrorLimit;
11744
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$custo = platformLimits.customerGroups) !== null && _platformLimits$custo !== void 0 && _platformLimits$custo.total)) {
11613
+ if (!platformLimits?.customerGroups?.total) {
11745
11614
  return jsxRuntime.jsx("div", {});
11746
11615
  }
11747
11616
  if (hasReachedCustomerGroupsErrorLimit) {
@@ -11792,16 +11661,15 @@ var styles$4 = {
11792
11661
  "status": "platform-limits-customer-groups-status-module__status___6099G"
11793
11662
  };
11794
11663
  const PlatformLimitsCustomerGroupsStatus = () => {
11795
- var _platformLimits$custo;
11796
11664
  const intl = reactIntl.useIntl();
11797
11665
  const _useCustomerGroupsPla = useCustomerGroupsPlatformLimitsFetcher(),
11798
11666
  platformLimits = _useCustomerGroupsPla.platformLimits;
11799
- if (!(platformLimits !== null && platformLimits !== void 0 && (_platformLimits$custo = platformLimits.customerGroups) !== null && _platformLimits$custo !== void 0 && _platformLimits$custo.total)) {
11667
+ if (!platformLimits?.customerGroups?.total) {
11800
11668
  return null;
11801
11669
  }
11802
- const _platformLimits$custo2 = platformLimits.customerGroups.total,
11803
- current = _platformLimits$custo2.current,
11804
- limit = _platformLimits$custo2.limit;
11670
+ const _platformLimits$custo = platformLimits.customerGroups.total,
11671
+ current = _platformLimits$custo.current,
11672
+ limit = _platformLimits$custo.limit;
11805
11673
  return jsxRuntime.jsx("div", {
11806
11674
  className: styles$4.status,
11807
11675
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
@@ -12047,7 +11915,6 @@ const valueMapping = {
12047
11915
  all: [true, false]
12048
11916
  };
12049
11917
  const BooleanField = props => {
12050
- var _context;
12051
11918
  let selectedValue;
12052
11919
  if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray__default["default"](props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
12053
11920
  const yesLabel = props.intl.formatMessage(messages$8.yes);
@@ -12061,7 +11928,7 @@ const BooleanField = props => {
12061
11928
  }];
12062
11929
  if (props.isMulti) options.push({
12063
11930
  value: 'all',
12064
- label: _concatInstanceProperty__default["default"](_context = "".concat(yesLabel, " / ")).call(_context, noLabel)
11931
+ label: `${yesLabel} / ${noLabel}`
12065
11932
  });
12066
11933
  return jsxRuntime.jsx(uiKit.SelectInput, {
12067
11934
  name: props.name,
@@ -12176,7 +12043,7 @@ const MultiValueSelectorDropdown = props => {
12176
12043
  truncate: true,
12177
12044
  intlMessage: _objectSpread$5(_objectSpread$5({}, messages$5.filterWholeInput), {}, {
12178
12045
  values: {
12179
- values: "\"".concat(props.value, "\"")
12046
+ values: `"${props.value}"`
12180
12047
  }
12181
12048
  })
12182
12049
  })
@@ -12189,7 +12056,7 @@ const MultiValueSelectorDropdown = props => {
12189
12056
  truncate: true,
12190
12057
  intlMessage: _objectSpread$5(_objectSpread$5({}, messages$5.filterSeparateValues), {}, {
12191
12058
  values: {
12192
- values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
12059
+ values: `"${props.multiValue.join('", "')}"` || props.value
12193
12060
  }
12194
12061
  })
12195
12062
  })
@@ -12479,17 +12346,16 @@ function isEmpty(value) {
12479
12346
  }
12480
12347
 
12481
12348
  const buildSearchQuery = (searchQuery, searchMode, fragments) => {
12482
- var _fragments$searchMode;
12483
12349
  if (!searchQuery) return '';
12484
12350
  const buildAllFieldsQueryString = query => {
12485
12351
  const fragmentsArray = _Object$values__default["default"](fragments);
12486
- return "( ".concat(_mapInstanceProperty__default["default"](fragmentsArray).call(fragmentsArray, fragment => fragment.getQuery(query)).join(' or '), " )");
12352
+ return `( ${_mapInstanceProperty__default["default"](fragmentsArray).call(fragmentsArray, fragment => fragment.getQuery(query)).join(' or ')} )`;
12487
12353
  };
12488
12354
  const trimmedSearchQuery = oneLine__default["default"](searchQuery);
12489
12355
  if (searchMode === 'allFields') {
12490
12356
  return buildAllFieldsQueryString(trimmedSearchQuery);
12491
12357
  }
12492
- if (!fragments[searchMode] || typeof ((_fragments$searchMode = fragments[searchMode]) === null || _fragments$searchMode === void 0 ? void 0 : _fragments$searchMode.getQuery) !== 'function') {
12358
+ if (!fragments[searchMode] || typeof fragments[searchMode]?.getQuery !== 'function') {
12493
12359
  return '';
12494
12360
  }
12495
12361
  return fragments[searchMode].getQuery(trimmedSearchQuery);
@@ -12778,11 +12644,11 @@ function createResourceReducer(options) {
12778
12644
 
12779
12645
  // TODO: validate constant keys
12780
12646
  const actionsMap = {
12781
- ["".concat(plural, "_FETCHED")]: (_, action) => ({
12647
+ [`${plural}_FETCHED`]: (_, action) => ({
12782
12648
  currentQueryResult: action.payload
12783
12649
  }),
12784
- ["".concat(single, "_UPDATED_IN_LIST")]: updateStatusInList(mergeData),
12785
- ["".concat(single, "_DELETED_IN_LIST")]: (state, _ref) => {
12650
+ [`${single}_UPDATED_IN_LIST`]: updateStatusInList(mergeData),
12651
+ [`${single}_DELETED_IN_LIST`]: (state, _ref) => {
12786
12652
  let payload = _ref.payload;
12787
12653
  const results = state.currentQueryResult.results;
12788
12654
  return {
@@ -12794,27 +12660,27 @@ function createResourceReducer(options) {
12794
12660
  })
12795
12661
  };
12796
12662
  },
12797
- ["".concat(single, "_FETCHED")]: (_, _ref3) => {
12663
+ [`${single}_FETCHED`]: (_, _ref3) => {
12798
12664
  let payload = _ref3.payload;
12799
12665
  return {
12800
12666
  currentVisible: payload
12801
12667
  };
12802
12668
  },
12803
- ["".concat(single, "_CREATED")]: (_ref4, _ref5) => {
12669
+ [`${single}_CREATED`]: (_ref4, _ref5) => {
12804
12670
  let currentVisible = _ref4.currentVisible;
12805
12671
  let payload = _ref5.payload;
12806
12672
  return {
12807
12673
  currentVisible: mergeData(payload, currentVisible)
12808
12674
  };
12809
12675
  },
12810
- ["".concat(single, "_UPDATED")]: (_ref6, _ref7) => {
12676
+ [`${single}_UPDATED`]: (_ref6, _ref7) => {
12811
12677
  let currentVisible = _ref6.currentVisible;
12812
12678
  let payload = _ref7.payload;
12813
12679
  return {
12814
12680
  currentVisible: mergeData(payload, currentVisible)
12815
12681
  };
12816
12682
  },
12817
- ["".concat(single, "_DELETED")]: () => ({
12683
+ [`${single}_DELETED`]: () => ({
12818
12684
  currentVisible: null
12819
12685
  })
12820
12686
  };
@@ -12831,12 +12697,11 @@ function formatCustomerAddress(_ref) {
12831
12697
  }
12832
12698
 
12833
12699
  function formatCustomerName(_ref) {
12834
- var _context;
12835
12700
  let firstName = _ref.firstName,
12836
12701
  lastName = _ref.lastName;
12837
12702
  if (firstName && !lastName) return _trimInstanceProperty__default["default"](firstName).call(firstName);
12838
12703
  if (!firstName && lastName) return _trimInstanceProperty__default["default"](lastName).call(lastName);
12839
- if (firstName && lastName) return _concatInstanceProperty__default["default"](_context = "".concat(_trimInstanceProperty__default["default"](firstName).call(firstName), " ")).call(_context, _trimInstanceProperty__default["default"](lastName).call(lastName));
12704
+ if (firstName && lastName) return `${_trimInstanceProperty__default["default"](firstName).call(firstName)} ${_trimInstanceProperty__default["default"](lastName).call(lastName)}`;
12840
12705
  return constants.NO_VALUE_FALLBACK;
12841
12706
  }
12842
12707
 
@@ -12865,23 +12730,21 @@ function base64ToString(value) {
12865
12730
  }
12866
12731
 
12867
12732
  const composeNumberPredicateFromFilter = (target, value, option) => {
12868
- var _context, _context2, _context3, _context4, _context5, _context6;
12869
12733
  switch (option) {
12870
12734
  case FILTER_TYPES.lessThan:
12871
- return _concatInstanceProperty__default["default"](_context = "".concat(target, " < ")).call(_context, value);
12735
+ return `${target} < ${value}`;
12872
12736
  case FILTER_TYPES.moreThan:
12873
- return _concatInstanceProperty__default["default"](_context2 = "".concat(target, " > ")).call(_context2, value);
12737
+ return `${target} > ${value}`;
12874
12738
  case FILTER_TYPES.equalTo:
12875
- return _concatInstanceProperty__default["default"](_context3 = "".concat(target, " = ")).call(_context3, value);
12739
+ return `${target} = ${value}`;
12876
12740
  case FILTER_TYPES.range:
12877
- return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = "".concat(target, " >= ")).call(_context6, value.from, " and ")).call(_context5, target, " <= ")).call(_context4, value.to);
12741
+ return `${target} >= ${value.from} and ${target} <= ${value.to}`;
12878
12742
  default:
12879
12743
  return '';
12880
12744
  }
12881
12745
  };
12882
12746
  function customFields (filter, locale) {
12883
12747
  const customFieldsPredicates = _mapInstanceProperty__default["default"](filter).call(filter, customFieldFilter => {
12884
- var _context7, _context8, _context9, _context10, _context11;
12885
12748
  const _customFieldFilter$va = customFieldFilter.value,
12886
12749
  target = _customFieldFilter$va.target,
12887
12750
  type = _customFieldFilter$va.type,
@@ -12889,14 +12752,14 @@ function customFields (filter, locale) {
12889
12752
  option = _customFieldFilter$va.option;
12890
12753
  switch (type.name) {
12891
12754
  case FIELD_TYPES.Boolean:
12892
- return _concatInstanceProperty__default["default"](_context7 = "".concat(target, " = ")).call(_context7, value.value);
12755
+ return `${target} = ${value.value}`;
12893
12756
  case FIELD_TYPES.String:
12894
- return _concatInstanceProperty__default["default"](_context8 = "".concat(target, " = \"")).call(_context8, value, "\"");
12757
+ return `${target} = "${value}"`;
12895
12758
  case FIELD_TYPES.LocalizedString:
12896
- return _concatInstanceProperty__default["default"](_context9 = "".concat(target, "(")).call(_context9, localizedTextTransformer(value), ")");
12759
+ return `${target}(${localizedTextTransformer(value)})`;
12897
12760
  case FIELD_TYPES.Enum:
12898
12761
  case FIELD_TYPES.LocalizedEnum:
12899
- return _concatInstanceProperty__default["default"](_context10 = "".concat(target, " = \"")).call(_context10, value.value, "\"");
12762
+ return `${target} = "${value.value}"`;
12900
12763
  case FIELD_TYPES.Time:
12901
12764
  return timeTransformer(target, [{
12902
12765
  type: option,
@@ -12911,14 +12774,14 @@ function customFields (filter, locale) {
12911
12774
  case FIELD_TYPES.Number:
12912
12775
  return composeNumberPredicateFromFilter(target, value, option);
12913
12776
  case FIELD_TYPES.Money:
12914
- return _concatInstanceProperty__default["default"](_context11 = "".concat(target, "(")).call(_context11, moneyTransformer(value, option, locale), ")");
12777
+ return `${target}(${moneyTransformer(value, option, locale)})`;
12915
12778
  case FIELD_TYPES.Reference:
12916
12779
  case FIELD_TYPES.Set:
12917
12780
  default:
12918
12781
  throw new Error('Custom field type not recognized');
12919
12782
  }
12920
12783
  });
12921
- return "(custom(fields(".concat(customFieldsPredicates.join(' and '), ")))");
12784
+ return `(custom(fields(${customFieldsPredicates.join(' and ')})))`;
12922
12785
  }
12923
12786
 
12924
12787
  /**
@@ -12959,10 +12822,8 @@ function graphqlQueryBuilder(_ref) {
12959
12822
  }
12960
12823
 
12961
12824
  function numberTransformer(filterKey, filters) {
12962
- var _context3;
12963
12825
  let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isFilterValid$2;
12964
12826
  const queries = _mapInstanceProperty__default["default"](filters).call(filters, _ref => {
12965
- var _context, _context2;
12966
12827
  let type = _ref.type,
12967
12828
  value = _ref.value;
12968
12829
  if (!filterValidator({
@@ -12971,19 +12832,19 @@ function numberTransformer(filterKey, filters) {
12971
12832
  })) return '';
12972
12833
  switch (type) {
12973
12834
  case 'lessThan':
12974
- return "(* to ".concat(_parseInt__default["default"](value) - 1, ")");
12835
+ return `(* to ${_parseInt__default["default"](value) - 1})`;
12975
12836
  case 'moreThan':
12976
- return "(".concat(_parseInt__default["default"](value) + 1, " to *)");
12837
+ return `(${_parseInt__default["default"](value) + 1} to *)`;
12977
12838
  case 'equalTo':
12978
- return _concatInstanceProperty__default["default"](_context = "(".concat(value, " to ")).call(_context, value, ")");
12839
+ return `(${value} to ${value})`;
12979
12840
  case 'range':
12980
- return _concatInstanceProperty__default["default"](_context2 = "(".concat(value.from, " to ")).call(_context2, value.to, ")");
12841
+ return `(${value.from} to ${value.to})`;
12981
12842
  default:
12982
12843
  return '';
12983
12844
  }
12984
12845
  });
12985
12846
  const queryString = _filterInstanceProperty__default["default"](queries).call(queries, q => q !== '').join(', ');
12986
- return queryString === '' ? null : _concatInstanceProperty__default["default"](_context3 = "".concat(filterKey, ": range")).call(_context3, queryString);
12847
+ return queryString === '' ? null : `${filterKey}: range${queryString}`;
12987
12848
  }
12988
12849
  function isFilterValid$2(_ref2) {
12989
12850
  let type = _ref2.type,
@@ -13010,11 +12871,9 @@ function graphqlCategoryLevelTransformer(filterKey, filters, filterValidator) {
13010
12871
  return _filterInstanceProperty__default["default"](_context = [levelFilterQuery, lastLevelFilterQuery]).call(_context, Boolean);
13011
12872
  }
13012
12873
 
13013
- var _templateObject, _templateObject2;
13014
12874
  const dateFormatDayStart = 'YYYY-MM-DDT00:00:00.000Z';
13015
12875
  const dateFormatDayEnd = 'YYYY-MM-DDT23:59:59.999Z';
13016
12876
  function dateTransformer(filterKey, filters) {
13017
- var _context;
13018
12877
  let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isFilterValid$1;
13019
12878
  const queries = _mapInstanceProperty__default["default"](filters).call(filters, _ref => {
13020
12879
  let type = _ref.type,
@@ -13025,19 +12884,25 @@ function dateTransformer(filterKey, filters) {
13025
12884
  })) return '';
13026
12885
  switch (type) {
13027
12886
  case 'lessThan':
13028
- return "(* to \"".concat(moment__default["default"](value).format(dateFormatDayStart), "\")");
12887
+ return `(* to "${moment__default["default"](value).format(dateFormatDayStart)}")`;
13029
12888
  case 'moreThan':
13030
- return "(\"".concat(moment__default["default"](value).format(dateFormatDayEnd), "\" to *)");
12889
+ return `("${moment__default["default"](value).format(dateFormatDayEnd)}" to *)`;
13031
12890
  case 'equalTo':
13032
- return oneLine__default["default"](_templateObject || (_templateObject = _taggedTemplateLiteral(["\n (\"", "\"\n to \"", "\")\n "])), moment__default["default"](value).format(dateFormatDayStart), moment__default["default"](value).format(dateFormatDayEnd));
12891
+ return oneLine__default["default"]`
12892
+ ("${moment__default["default"](value).format(dateFormatDayStart)}"
12893
+ to "${moment__default["default"](value).format(dateFormatDayEnd)}")
12894
+ `;
13033
12895
  case 'range':
13034
- return oneLine__default["default"](_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n (\"", "\"\n to \"", "\")\n "])), moment__default["default"](value.from).format(dateFormatDayStart), moment__default["default"](value.to).format(dateFormatDayEnd));
12896
+ return oneLine__default["default"]`
12897
+ ("${moment__default["default"](value.from).format(dateFormatDayStart)}"
12898
+ to "${moment__default["default"](value.to).format(dateFormatDayEnd)}")
12899
+ `;
13035
12900
  default:
13036
12901
  return '';
13037
12902
  }
13038
12903
  });
13039
12904
  const queryString = _filterInstanceProperty__default["default"](queries).call(queries, q => q !== '').join(', ');
13040
- return queryString === '' ? null : _concatInstanceProperty__default["default"](_context = "".concat(filterKey, ": range")).call(_context, queryString);
12905
+ return queryString === '' ? null : `${filterKey}: range${queryString}`;
13041
12906
  }
13042
12907
  function isFilterValid$1(_ref2) {
13043
12908
  let type = _ref2.type,
@@ -13055,20 +12920,18 @@ function missingTransformer(filterKey, filters) {
13055
12920
  // Note: we assume for now that there can only be 1 missing filter value,
13056
12921
  // as the API doesn't support yet multiple OR values (for missing).
13057
12922
  if (filters.length === 0) return null;
13058
- return "".concat(filterKey, ":missing");
12923
+ return `${filterKey}:missing`;
13059
12924
  }
13060
12925
 
13061
12926
  function missingLocaleTransformer(filterKey, filters) {
13062
- var _context;
13063
12927
  // Note: we assume for now that there can only be 1 missing filter value,
13064
12928
  // as the API doesn't support yet multiple OR values (for missing).
13065
12929
  if (filters.length === 0) return null;
13066
12930
  const missingLocale = filters[0].value.value;
13067
- return _concatInstanceProperty__default["default"](_context = "".concat(filterKey, ".")).call(_context, missingLocale, ":missing");
12931
+ return `${filterKey}.${missingLocale}:missing`;
13068
12932
  }
13069
12933
 
13070
12934
  function referenceTransformer(filterKey, filters) {
13071
- var _context;
13072
12935
  let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isFilterValid;
13073
12936
  const queries = _mapInstanceProperty__default["default"](filters).call(filters, _ref => {
13074
12937
  let type = _ref.type,
@@ -13079,29 +12942,28 @@ function referenceTransformer(filterKey, filters) {
13079
12942
  })) return '';
13080
12943
  switch (type) {
13081
12944
  case 'equalTo':
13082
- return "\"".concat(value, "\"");
12945
+ return `"${value}"`;
13083
12946
  default:
13084
12947
  return '';
13085
12948
  }
13086
12949
  });
13087
12950
  const queryString = _filterInstanceProperty__default["default"](queries).call(queries, q => q !== '').join(', ');
13088
- return queryString === '' ? null : _concatInstanceProperty__default["default"](_context = "".concat(filterKey, ".id: ")).call(_context, queryString);
12951
+ return queryString === '' ? null : `${filterKey}.id: ${queryString}`;
13089
12952
  }
13090
12953
  function isFilterValid(_ref2) {
13091
- var _context2;
12954
+ var _context;
13092
12955
  let type = _ref2.type,
13093
12956
  value = _ref2.value;
13094
- if (type === 'equalTo' && !_includesInstanceProperty__default["default"](_context2 = [null, undefined, '']).call(_context2, value)) return true;
12957
+ if (type === 'equalTo' && !_includesInstanceProperty__default["default"](_context = [null, undefined, '']).call(_context, value)) return true;
13095
12958
  return false;
13096
12959
  }
13097
12960
 
13098
12961
  function textTransformer(filterKey, queries) {
13099
- var _context;
13100
12962
  if (queries.length === 0) return null;
13101
12963
 
13102
12964
  // Note: we assume for now that there can only be 1 text filter.
13103
12965
  const queryValue = queries[0].value;
13104
- return queryValue ? _concatInstanceProperty__default["default"](_context = "".concat(filterKey, ":\"")).call(_context, queryValue, "\"") : null;
12966
+ return queryValue ? `${filterKey}:"${queryValue}"` : null;
13105
12967
  }
13106
12968
 
13107
12969
  function isValidISOTime(_ref) {
@@ -13186,8 +13048,8 @@ function validateFilter$2(_ref, intl) {
13186
13048
  };
13187
13049
  }
13188
13050
  if (value.option === FILTER_TYPES.range) {
13189
- const from = validateValue(filterValue === null || filterValue === void 0 ? void 0 : filterValue.from, typeName, intl);
13190
- const to = from ? null : validateValue(filterValue === null || filterValue === void 0 ? void 0 : filterValue.to, typeName, intl);
13051
+ const from = validateValue(filterValue?.from, typeName, intl);
13052
+ const to = from ? null : validateValue(filterValue?.to, typeName, intl);
13191
13053
  return from || to ? {
13192
13054
  input: {
13193
13055
  from,
@@ -13224,16 +13086,16 @@ function validateFilter$1(_ref, intl) {
13224
13086
  type = _ref.type;
13225
13087
  if (type === 'range') {
13226
13088
  if (validateSingleFilter({
13227
- value: value === null || value === void 0 ? void 0 : value.from
13089
+ value: value?.from
13228
13090
  })) return {
13229
13091
  from: intl.formatMessage(messages$2.rangeMissingValue)
13230
13092
  };
13231
13093
  if (validateSingleFilter({
13232
- value: value === null || value === void 0 ? void 0 : value.to
13094
+ value: value?.to
13233
13095
  })) return {
13234
13096
  to: intl.formatMessage(messages$2.rangeMissingValue)
13235
13097
  };
13236
- if (moment__default["default"](value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
13098
+ if (moment__default["default"](value?.to).isBefore(value?.from)) return {
13237
13099
  from: intl.formatMessage(messages$2.rangeToSmallerThanFrom)
13238
13100
  };
13239
13101
  } else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
@@ -13310,14 +13172,14 @@ const validateText = function (text, intl) {
13310
13172
 
13311
13173
  function formatDiscount(discount, currencyCode, intl) {
13312
13174
  var _context;
13313
- if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
13175
+ if (discount.type === 'relative') return `${discount.permyriad / 100}%`;
13314
13176
  if (!discount.money) return null;
13315
13177
  const moneyForCurrencyCode = _findInstanceProperty__default["default"](_context = discount.money).call(_context, discountMoney => discountMoney.currencyCode === currencyCode);
13316
13178
  return moneyForCurrencyCode ? formatMoney$2(moneyForCurrencyCode, intl) : null;
13317
13179
  }
13318
13180
 
13319
13181
  function formatPercentage(percentage) {
13320
- return "".concat(percentage, "%");
13182
+ return `${percentage}%`;
13321
13183
  }
13322
13184
  function convertRatioToPercentage(ratio) {
13323
13185
  return _parseFloat__default["default"]((ratio * 100).toFixed(2));
@@ -13331,10 +13193,7 @@ function convertRatioToPercentage(ratio) {
13331
13193
  * @returns {boolean}
13332
13194
  */
13333
13195
  const hasErrorCode = (unmappedApiErrors, errorCode) => {
13334
- return _Array$isArray__default["default"](unmappedApiErrors) && _someInstanceProperty__default["default"](unmappedApiErrors).call(unmappedApiErrors, error => {
13335
- var _error$extensions;
13336
- return ((_error$extensions = error.extensions) === null || _error$extensions === void 0 ? void 0 : _error$extensions.code) === errorCode;
13337
- });
13196
+ return _Array$isArray__default["default"](unmappedApiErrors) && _someInstanceProperty__default["default"](unmappedApiErrors).call(unmappedApiErrors, error => error.extensions?.code === errorCode);
13338
13197
  };
13339
13198
 
13340
13199
  const hasInvalidInputError = errors => hasErrorCode(errors, ERROR_CODES.invalidInput);
@@ -13346,7 +13205,7 @@ function minusify(value) {
13346
13205
  return minus.concat(value);
13347
13206
  }
13348
13207
 
13349
- const flattenOperator = (operator, clauses) => compact__default["default"](_reduceInstanceProperty__default["default"](clauses).call(clauses, (result, clause) => _concatInstanceProperty__default["default"](result).call(result, (clause === null || clause === void 0 ? void 0 : clause[operator]) || clause), []));
13208
+ const flattenOperator = (operator, clauses) => compact__default["default"](_reduceInstanceProperty__default["default"](clauses).call(clauses, (result, clause) => _concatInstanceProperty__default["default"](result).call(result, clause?.[operator] || clause), []));
13350
13209
  const argsToArray = args => _reduceInstanceProperty__default["default"](args).call(args, (result, item) => _concatInstanceProperty__default["default"](result).call(result, item), []);
13351
13210
  const exists = (field, attributeType) => ({
13352
13211
  exists: {
@@ -13403,7 +13262,7 @@ const not = function () {
13403
13262
 
13404
13263
  const safelyAddFallback = function (string) {
13405
13264
  let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.NO_VALUE_FALLBACK;
13406
- return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
13265
+ return string === '' ? fallback : string ?? fallback;
13407
13266
  };
13408
13267
 
13409
13268
  var messages = reactIntl.defineMessages({
@@ -13538,19 +13397,19 @@ const computedProperties = {
13538
13397
  // has been deleted. See MC-1925 for further information.
13539
13398
  const filteredCategories = _filterInstanceProperty__default["default"](_context6 = product.categories).call(_context6, category => category.obj !== undefined);
13540
13399
  return _mapInstanceProperty__default["default"](filteredCategories).call(filteredCategories, category => {
13541
- var _context7;
13542
13400
  const categoryPath = getPathName(category, language, languages);
13543
13401
  const ancestors = getAncestors(category, language);
13544
- const externalIdValue = category.obj.externalId ? // hardcoding "ext. ID" since this is not part of a message to be
13402
+ const externalIdValue = category.obj.externalId ?
13403
+ // hardcoding "ext. ID" since this is not part of a message to be
13545
13404
  // translated. This has been communicated with Jenn
13546
- "| ext. ID: ".concat(category.obj.externalId) : '';
13405
+ `| ext. ID: ${category.obj.externalId}` : '';
13547
13406
  return {
13548
13407
  id: category.id,
13549
- name: _concatInstanceProperty__default["default"](_context7 = "".concat(l10n.formatLocalizedString(category.obj, {
13408
+ name: `${l10n.formatLocalizedString(category.obj, {
13550
13409
  key: 'name',
13551
13410
  locale: language,
13552
13411
  fallbackOrder: languages
13553
- }), " ")).call(_context7, externalIdValue),
13412
+ })} ${externalIdValue}`,
13554
13413
  path: categoryPath,
13555
13414
  level: ancestors.length
13556
13415
  };
@@ -13587,13 +13446,13 @@ const getAttributeValueByType = _ref12 => {
13587
13446
  value: value
13588
13447
  });
13589
13448
  case 'enum':
13590
- return safelyAddFallback(value.label, "".concat(value.key, " (key)"));
13449
+ return safelyAddFallback(value.label, `${value.key} (key)`);
13591
13450
  case 'lenum':
13592
13451
  return safelyAddFallback(l10n.formatLocalizedString(value, {
13593
13452
  key: 'label',
13594
13453
  locale: projectDataLocale,
13595
13454
  fallbackOrder: projectLanguages
13596
- }), "".concat(value.key, " (key)"));
13455
+ }), `${value.key} (key)`);
13597
13456
  case 'number':
13598
13457
  return safelyAddFallback(value);
13599
13458
  case 'boolean':
@@ -13715,7 +13574,6 @@ const reorderArrayItems = (array, from, to) => {
13715
13574
  const mapTimeZonesToOptions = memoize__default["default"](timeZones => {
13716
13575
  var _context;
13717
13576
  return _mapInstanceProperty__default["default"](_context = _Object$entries__default["default"](timeZones)).call(_context, _ref => {
13718
- var _context2;
13719
13577
  let _ref2 = _slicedToArray(_ref, 2),
13720
13578
  code = _ref2[0],
13721
13579
  value = _ref2[1];
@@ -13724,7 +13582,7 @@ const mapTimeZonesToOptions = memoize__default["default"](timeZones => {
13724
13582
  //E.g. `(GMT +02:00) Central European Time - Berlin`
13725
13583
  // unicode clock hex code: \u25F7
13726
13584
  //
13727
- label: _concatInstanceProperty__default["default"](_context2 = "(GMT ".concat(value.offset, ") ")).call(_context2, value.name)
13585
+ label: `(GMT ${value.offset}) ${value.name}`
13728
13586
  };
13729
13587
  });
13730
13588
  });
@@ -13732,12 +13590,9 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
13732
13590
  if (timeZones[selectedTimeZone]) {
13733
13591
  return selectedTimeZone;
13734
13592
  } else {
13735
- var _context3;
13736
- const fallbackTimeZoneId = _findInstanceProperty__default["default"](_context3 = _Object$keys__default["default"](timeZones)).call(_context3, timeZoneId => {
13737
- var _timeZones$timeZoneId;
13738
- return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0 || (_timeZones$timeZoneId = _timeZones$timeZoneId.translationFor) === null || _timeZones$timeZoneId === void 0 ? void 0 : _someInstanceProperty__default["default"](_timeZones$timeZoneId).call(_timeZones$timeZoneId, fallbackTimeZone => fallbackTimeZone === selectedTimeZone);
13739
- });
13740
- if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
13593
+ var _context2;
13594
+ const fallbackTimeZoneId = _findInstanceProperty__default["default"](_context2 = _Object$keys__default["default"](timeZones)).call(_context2, timeZoneId => timeZones[timeZoneId]?.translationFor?.some(fallbackTimeZone => fallbackTimeZone === selectedTimeZone));
13595
+ if (fallbackTimeZoneId?.length) {
13741
13596
  return fallbackTimeZoneId.toString();
13742
13597
  } else {
13743
13598
  return 'UTC';
@@ -13745,21 +13600,19 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
13745
13600
  }
13746
13601
  });
13747
13602
  const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZones) => {
13748
- var _context4;
13749
13603
  const timeZoneId = getTimeZoneId(selectedTimeZone, timeZones);
13750
13604
  const timeZoneData = timeZones[timeZoneId];
13751
- return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
13605
+ return `(GMT ${timeZoneData.offset}) ${timeZoneData.name}`;
13752
13606
  });
13753
13607
 
13754
13608
  const DEFAULT_LENGTH = 50;
13755
13609
  const DEFAULT_END = '...';
13756
13610
  function truncate (text) {
13757
- var _context;
13758
13611
  let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_LENGTH;
13759
13612
  let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_END;
13760
13613
  if (!text) return '';
13761
13614
  if (text.length < length) return text;
13762
- return _concatInstanceProperty__default["default"](_context = "".concat(text.substring(0, length))).call(_context, end);
13615
+ return `${text.substring(0, length)}${end}`;
13763
13616
  }
13764
13617
 
13765
13618
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }