@commercetools-frontend/experimental-components 6.4.6 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/commercetools-frontend-experimental-components.cjs.dev.js +1310 -1094
  2. package/dist/commercetools-frontend-experimental-components.cjs.prod.js +1309 -1093
  3. package/dist/commercetools-frontend-experimental-components.esm.js +1292 -1090
  4. package/dist/declarations/src/components/channel-picker-input/channel-picker-input.d.ts +3 -3
  5. package/dist/declarations/src/components/divider/divider.d.ts +2 -2
  6. package/dist/declarations/src/components/formatted-date-time/formatted-date-time.d.ts +0 -1
  7. package/dist/declarations/src/components/recurrent-interval-picker/index.d.ts +2 -0
  8. package/dist/declarations/src/components/recurrent-interval-picker/recurrent-interval-picker.d.ts +13 -0
  9. package/dist/declarations/src/components/recurrent-interval-picker/use-recurrence-intervals/index.d.ts +1 -0
  10. package/dist/declarations/src/{hooks → components/recurrent-interval-picker}/use-recurrence-intervals/use-recurrence-intervals.d.ts +6 -1
  11. package/dist/declarations/src/components/store-select-input/constants.d.ts +2 -0
  12. package/dist/declarations/src/components/validated-input/validated-input.d.ts +7 -38
  13. package/dist/declarations/src/constants/index.d.ts +1 -0
  14. package/dist/declarations/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.d.ts +0 -1
  15. package/dist/declarations/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.d.ts +0 -1
  16. package/dist/declarations/src/custom-fields/custom-fields/constants.d.ts +36 -0
  17. package/dist/declarations/src/custom-fields/custom-fields/custom-field-input.d.ts +2 -0
  18. package/dist/declarations/src/custom-fields/custom-fields/index.d.ts +2 -1
  19. package/dist/declarations/src/features/picker/shared/hooks/use-load-options.d.ts +1 -1
  20. package/dist/declarations/src/features/picker/shared/hooks/use-product-type-options.d.ts +2 -2
  21. package/dist/declarations/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer-provider.d.ts +0 -1
  22. package/dist/declarations/src/features/pim-indexer/components/with-pim-indexer/with-pim-indexer.d.ts +0 -1
  23. package/dist/declarations/src/features/platform-limits/business-units/hooks/index.d.ts +2 -0
  24. package/dist/declarations/src/features/platform-limits/business-units/hooks/use-business-units-platform-limits/index.d.ts +1 -0
  25. package/dist/declarations/src/features/platform-limits/business-units/hooks/use-business-units-platform-limits/use-business-units-platform-limits.d.ts +10 -0
  26. package/dist/declarations/src/features/platform-limits/business-units/hooks/use-business-units-platform-limits-fetcher/index.d.ts +1 -0
  27. package/dist/declarations/src/features/platform-limits/business-units/hooks/use-business-units-platform-limits-fetcher/use-business-units-platform-limits-fetcher.d.ts +12 -0
  28. package/dist/declarations/src/features/platform-limits/business-units/index.d.ts +1 -0
  29. package/dist/declarations/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits/use-customer-groups-platform-limits.d.ts +1 -1
  30. package/dist/declarations/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/use-customer-groups-platform-limits-fetcher.d.ts +1 -1
  31. package/dist/declarations/src/features/platform-limits/customers/hooks/use-customers-platform-limits/use-customers-platform-limits.d.ts +2 -1
  32. package/dist/declarations/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/use-customers-platform-limits-fetcher.d.ts +1 -1
  33. package/dist/declarations/src/features/platform-limits/index.d.ts +3 -0
  34. package/dist/declarations/src/features/platform-limits/shared/components/index.d.ts +2 -0
  35. package/dist/declarations/src/features/platform-limits/shared/components/notifications/error/error.d.ts +12 -0
  36. package/dist/declarations/src/features/platform-limits/shared/components/notifications/error/index.d.ts +1 -0
  37. package/dist/declarations/src/features/platform-limits/shared/components/notifications/index.d.ts +1 -0
  38. package/dist/declarations/src/features/platform-limits/shared/components/notifications/notifications.d.ts +7 -0
  39. package/dist/declarations/src/features/platform-limits/shared/components/notifications/warning/index.d.ts +1 -0
  40. package/dist/declarations/src/features/platform-limits/shared/components/notifications/warning/warning.d.ts +12 -0
  41. package/dist/declarations/src/features/platform-limits/shared/components/status-text/index.d.ts +1 -0
  42. package/dist/declarations/src/features/platform-limits/shared/components/status-text/status-text.d.ts +12 -0
  43. package/dist/declarations/src/features/platform-limits/shared/constants.d.ts +13 -0
  44. package/dist/declarations/src/features/platform-limits/shared/hooks/index.d.ts +3 -0
  45. package/dist/declarations/src/features/platform-limits/shared/hooks/use-intercept-navigation/index.d.ts +1 -0
  46. package/dist/declarations/src/features/platform-limits/shared/hooks/use-intercept-navigation/use-intercept-navigation.d.ts +7 -0
  47. package/dist/declarations/src/features/platform-limits/shared/hooks/use-limits-modal-state/index.d.ts +1 -0
  48. package/dist/declarations/src/features/platform-limits/shared/hooks/use-limits-modal-state/use-limits-modal-state.d.ts +6 -0
  49. package/dist/declarations/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/index.d.ts +3 -0
  50. package/dist/declarations/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/platform-limits-query-variables.d.ts +2 -0
  51. package/dist/declarations/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.d.ts +7 -0
  52. package/dist/declarations/src/features/platform-limits/shared/index.d.ts +4 -0
  53. package/dist/declarations/src/features/platform-limits/shared/utils/index.d.ts +1 -0
  54. package/dist/declarations/src/features/platform-limits/shared/utils/utils.d.ts +14 -0
  55. package/dist/declarations/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits/use-shipping-methods-platform-limits.d.ts +1 -1
  56. package/dist/declarations/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/use-shipping-methods-platform-limits-fetcher.d.ts +1 -1
  57. package/dist/declarations/src/features/platform-limits/stores/hooks/index.d.ts +3 -0
  58. package/dist/declarations/src/features/platform-limits/stores/hooks/use-store-platform-limits/index.d.ts +1 -0
  59. package/dist/declarations/src/features/platform-limits/stores/hooks/use-store-platform-limits/use-store-platform-limits.d.ts +15 -0
  60. package/dist/declarations/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/index.d.ts +1 -0
  61. package/dist/declarations/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/use-store-platform-limits-fetcher.d.ts +13 -0
  62. package/dist/declarations/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/index.d.ts +1 -0
  63. package/dist/declarations/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/use-store-platform-limits-status.d.ts +5 -0
  64. package/dist/declarations/src/features/platform-limits/stores/index.d.ts +1 -0
  65. package/dist/declarations/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits/use-tax-categories-platform-limits.d.ts +1 -1
  66. package/dist/declarations/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/use-tax-categories-platform-limits-fetcher.d.ts +1 -1
  67. package/dist/declarations/src/features/platform-limits/zones/hooks/use-zones-platform-limits/use-zones-platform-limits.d.ts +1 -1
  68. package/dist/declarations/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/use-zones-platform-limits-fetcher.d.ts +1 -1
  69. package/dist/declarations/src/fields/numeric-format-input/numeric-format-input.d.ts +0 -1
  70. package/dist/declarations/src/fields/search-input/search-input.d.ts +0 -1
  71. package/dist/declarations/src/fields/throttled-field/throttled-field.d.ts +0 -1
  72. package/dist/declarations/src/hooks/index.d.ts +0 -2
  73. package/dist/declarations/src/hooks/use-persisted-reminder/use-persisted-reminder.d.ts +1 -1
  74. package/dist/declarations/src/hooks/use-previous/use-previous.d.ts +1 -1
  75. package/dist/declarations/src/hooks/use-product-selections-fetcher/use-product-selections-fetcher.d.ts +1 -6
  76. package/dist/declarations/src/hooks/use-stores-list-fetcher/use-stores-list-fetcher.d.ts +1 -8
  77. package/dist/declarations/src/index.d.ts +10 -8
  78. package/dist/declarations/src/utils/type-definitions/type-definitions.d.ts +1 -1
  79. package/dist/styles.css +118 -118
  80. package/package.json +25 -28
  81. package/dist/declarations/src/hooks/use-did-form-validation-fail/index.d.ts +0 -1
  82. package/dist/declarations/src/hooks/use-did-form-validation-fail/use-did-form-validation-fail.d.ts +0 -1
@@ -27,7 +27,7 @@ import { useApolloClient, useQuery as useQuery$1 } from '@apollo/client';
27
27
  import { useQuery, useApolloClient as useApolloClient$1 } from '@apollo/client/react';
28
28
  import { defineMessages, useIntl, injectIntl, FormattedMessage } from 'react-intl';
29
29
  import { useApplicationContext, ApplicationContext, withApplicationContext } from '@commercetools-frontend/application-shell-connectors';
30
- import { LoadingSpinner, Constraints, Spacings, AsyncSelectInput, Text, SearchIcon, Tooltip, AccessibleHidden, SecondaryIconButton, CloseIcon, usePaginationState, useDataTableSortingState, useToggleState, Link, MoneyInput, SearchSelectInput, AsyncSelectField, SelectField, SelectInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinLinearIcon, PlusBoldIcon, DateInput, DateTimeInput, LocalizedTextInput, LocalizedMultilineTextInput, SecondaryButton, RevertIcon, Grid, customProperties, SubdirectoryArrowIcon, Tag, EditIcon, FieldLabel, WarningIcon, NumberInput, TextInput, MultilineTextInput, TimeInput, SwitcherIcon, ErrorIcon, DragIcon, Card, SearchSelectField, SelectableSearchInput, FieldErrors, CollapsiblePanel, designTokens, ContentNotification, ListIcon, CheckboxInput, SearchTextInput } from '@commercetools-frontend/ui-kit';
30
+ import { LoadingSpinner, Constraints, Spacings, AsyncSelectInput, Text, SearchIcon, Tooltip, AccessibleHidden, SecondaryIconButton, CloseIcon, usePaginationState, useDataTableSortingState, useToggleState, Link, MoneyInput, SearchSelectInput, AsyncSelectField, SelectField, SelectInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinLinearIcon, PlusBoldIcon, DateInput, DateTimeInput, LocalizedTextInput, LocalizedMultilineTextInput, SecondaryButton, RevertIcon, Grid, customProperties, SubdirectoryArrowIcon, Tag, EditIcon, FieldLabel, WarningIcon, NumberInput, TextInput, MultilineTextInput, TimeInput, SwitcherIcon, ErrorIcon, DragIcon, Card, SearchSelectField, ContentNotification, SelectableSearchInput, FieldErrors, CollapsiblePanel, designTokens, ListIcon, CheckboxInput, SearchTextInput } from '@commercetools-frontend/ui-kit';
31
31
  import _Map from '@babel/runtime-corejs3/core-js-stable/map';
32
32
  import _everyInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/every';
33
33
  import _Promise from '@babel/runtime-corejs3/core-js-stable/promise';
@@ -73,7 +73,7 @@ import { useFeatureToggle, useAdapterStatus } from '@commercetools-frontend/appl
73
73
  import { ErrorMessage } from '@commercetools-frontend/ui-kit/';
74
74
  import PropTypes from 'prop-types';
75
75
  import { css } from '@emotion/react';
76
- import { Draggable, DragDropContext, Droppable } from 'react-beautiful-dnd';
76
+ import { Draggable, DragDropContext, Droppable } from '@hello-pangea/dnd';
77
77
  import ReactDOM from 'react-dom';
78
78
  import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/index-of';
79
79
  import { CustomSelectInputOption } from '@commercetools-uikit/select-utils';
@@ -129,6 +129,9 @@ const CenteredLoadingSpinner = () => jsx("div", {
129
129
  CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
130
130
  var CenteredLoadingSpinner$1 = CenteredLoadingSpinner;
131
131
 
132
+ const LOWER_STORES_LIMIT = 60;
133
+ const UPPER_STORES_LIMIT = 500;
134
+
132
135
  const QUERY_MAX_LIMIT = 500;
133
136
  const SHOW_TOOLTIP_CHARS_COUNT = 40;
134
137
  const SEARCHABLE_REFERENCES = {
@@ -172,7 +175,7 @@ const PRODUCT_TAILORING_FOR_ATTRIBUTES_FALLBACK_VALUES = 'productTailoringForAtt
172
175
  // TODO: apply a more robust solution to overlaying issues
173
176
  const Z_INDEX_DROPDOWN = 30000;
174
177
 
175
- var pickerMessages$1 = defineMessages({
178
+ var commonPickerMessages = defineMessages({
176
179
  loadingErrorMessage: {
177
180
  id: 'Pickers.loadingErrorMessage',
178
181
  description: 'Message shown to used when picker fails to load data from server.',
@@ -185,7 +188,7 @@ var pickerMessages$1 = defineMessages({
185
188
  }
186
189
  });
187
190
 
188
- var messages$R = defineMessages({
191
+ var messages$S = defineMessages({
189
192
  noChannelsFound: {
190
193
  id: 'Products.ChannelPickerInput.noChannelsFound',
191
194
  description: 'The message to display when no channels were found',
@@ -207,16 +210,19 @@ const getRolesClause = roles => roles && roles.length > 0 ? `roles contains any
207
210
  const ChannelPickerInput = _ref => {
208
211
  let isClearable = _ref.isClearable,
209
212
  isDisabled = _ref.isDisabled,
210
- isReadOnly = _ref.isReadOnly,
213
+ _ref$isReadOnly = _ref.isReadOnly,
214
+ isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
211
215
  onChange = _ref.onChange,
212
216
  name = _ref.name,
213
217
  onBlur = _ref.onBlur,
214
218
  value = _ref.value,
215
219
  hasError = _ref.hasError,
216
- onError = _ref.onError,
220
+ _ref$onError = _ref.onError,
221
+ onError = _ref$onError === void 0 ? null : _ref$onError,
217
222
  placeholder = _ref.placeholder,
218
223
  roles = _ref.roles,
219
- hasWarning = _ref.hasWarning,
224
+ _ref$hasWarning = _ref.hasWarning,
225
+ hasWarning = _ref$hasWarning === void 0 ? false : _ref$hasWarning,
220
226
  _ref$isMulti = _ref.isMulti,
221
227
  isMulti = _ref$isMulti === void 0 ? false : _ref$isMulti;
222
228
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
@@ -300,7 +306,7 @@ const ChannelPickerInput = _ref => {
300
306
  if (isCurrentOptionLoadingFailed && onError) onError(currentOptions.error);
301
307
  }, [isCurrentOptionLoadingFailed, onError, currentOptions]);
302
308
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
303
- const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$R.noChannelsFound), [loadingError, formatMessage]);
309
+ const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$S.noChannelsFound), [loadingError, formatMessage]);
304
310
  const tooltipTitle = !isMulti ? currentSingleOption?.data?.label ?? '' : '';
305
311
  const selectedValue = currentOptions.data ?? (isMulti ? [] : null);
306
312
  return jsx(Constraints.Horizontal, {
@@ -312,7 +318,7 @@ const ChannelPickerInput = _ref => {
312
318
  children: jsx(AsyncSelectInput, {
313
319
  id: name,
314
320
  name: name,
315
- placeholder: placeholder ?? formatMessage(messages$R.placeholder),
321
+ placeholder: placeholder ?? formatMessage(messages$S.placeholder),
316
322
  loadOptions: loadOptionsDebounced,
317
323
  defaultOptions: true,
318
324
  showOptionGroupDivider: true,
@@ -335,7 +341,7 @@ const ChannelPickerInput = _ref => {
335
341
  })
336
342
  }), isLoadingFailed && jsx(Text.Body, {
337
343
  tone: "negative",
338
- intlMessage: pickerMessages$1.loadingErrorMessage
344
+ intlMessage: commonPickerMessages.loadingErrorMessage
339
345
  })]
340
346
  })
341
347
  });
@@ -369,7 +375,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
369
375
  FormattedDateTime.displayName = 'FormattedDateTime';
370
376
  var FormattedDateTime$1 = injectIntl(FormattedDateTime);
371
377
 
372
- var messages$Q = defineMessages({
378
+ var messages$R = defineMessages({
373
379
  noProductTypesFound: {
374
380
  id: 'Products.ProductTypePickerInput.noProductTypesFound',
375
381
  description: 'The message to display when no product types were found',
@@ -458,7 +464,7 @@ const ProductTypePickerInput = _ref => {
458
464
  children: jsx(AsyncSelectInput, {
459
465
  id: name,
460
466
  name: name,
461
- placeholder: formatMessage(messages$Q.placeholder),
467
+ placeholder: formatMessage(messages$R.placeholder),
462
468
  loadOptions: loadOptionsDebounced,
463
469
  defaultOptions: [],
464
470
  isClearable: isClearable,
@@ -471,7 +477,7 @@ const ProductTypePickerInput = _ref => {
471
477
  onInputChange: handleInputChange,
472
478
  onBlur: onBlur,
473
479
  value: currentOption.data,
474
- noOptionsMessage: () => loadingError ? null : formatMessage(messages$Q.noProductTypesFound),
480
+ noOptionsMessage: () => loadingError ? null : formatMessage(messages$R.noProductTypesFound),
475
481
  hasError: hasError || isLoadingFailed,
476
482
  menuPortalZIndex: Z_INDEX_DROPDOWN,
477
483
  menuPortalTarget: document.body,
@@ -479,7 +485,7 @@ const ProductTypePickerInput = _ref => {
479
485
  })
480
486
  }), isLoadingFailed && jsx(Text.Body, {
481
487
  tone: "negative",
482
- intlMessage: pickerMessages$1.loadingErrorMessage
488
+ intlMessage: commonPickerMessages.loadingErrorMessage
483
489
  })]
484
490
  })
485
491
  });
@@ -487,7 +493,7 @@ const ProductTypePickerInput = _ref => {
487
493
  ProductTypePickerInput.displayName = 'ProductTypePickerInput';
488
494
  var ProductTypePickerInput$1 = ProductTypePickerInput;
489
495
 
490
- var messages$P = defineMessages({
496
+ var messages$Q = defineMessages({
491
497
  noStatesFound: {
492
498
  id: 'Products.StatePickerInput.noStatesFound',
493
499
  description: 'The message to display when no states were found',
@@ -571,7 +577,7 @@ const StatePickerInput = _ref => {
571
577
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
572
578
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
573
579
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
574
- const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$P.noStatesFound), [loadingError, formatMessage]);
580
+ const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$Q.noStatesFound), [loadingError, formatMessage]);
575
581
  const tooltipTitle = currentOption?.data?.label ?? '';
576
582
  return jsx(Constraints.Horizontal, {
577
583
  max: "scale",
@@ -583,7 +589,7 @@ const StatePickerInput = _ref => {
583
589
  id: name,
584
590
  name: name,
585
591
  horizontalConstraint: "scale",
586
- placeholder: formatMessage(messages$P.placeholder),
592
+ placeholder: formatMessage(messages$Q.placeholder),
587
593
  loadOptions: loadOptionsDebounced,
588
594
  defaultOptions: true,
589
595
  showOptionGroupDivider: true,
@@ -605,7 +611,7 @@ const StatePickerInput = _ref => {
605
611
  }, dataLocale)
606
612
  }), isLoadingFailed && jsx(Text.Body, {
607
613
  tone: "negative",
608
- intlMessage: pickerMessages$1.loadingErrorMessage
614
+ intlMessage: commonPickerMessages.loadingErrorMessage
609
615
  })]
610
616
  })
611
617
  });
@@ -640,7 +646,7 @@ const CustomFieldTooltip = _ref => {
640
646
  };
641
647
  var CustomFieldTooltip$1 = CustomFieldTooltip;
642
648
 
643
- var messages$O = defineMessages({
649
+ var messages$P = defineMessages({
644
650
  bottomOption: {
645
651
  id: 'Products.Pickers.bottomOption',
646
652
  description: 'The message to display at the end of the options menu',
@@ -652,7 +658,7 @@ function ownKeys$1p(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertyS
652
658
  function _objectSpread$1p(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$1p(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1p(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
653
659
  const getBottomOption = formatMessage => ({
654
660
  options: [{
655
- label: formatMessage ? formatMessage(messages$O.bottomOption) : messages$O.bottomOption,
661
+ label: formatMessage ? formatMessage(messages$P.bottomOption) : messages$P.bottomOption,
656
662
  isBottomOption: true,
657
663
  isDisabled: true
658
664
  }]
@@ -1253,7 +1259,7 @@ ThrottledField.defaultProps = {
1253
1259
  };
1254
1260
  var ThrottledField$1 = ThrottledField;
1255
1261
 
1256
- var messages$N = defineMessages({
1262
+ var messages$O = defineMessages({
1257
1263
  buttonLabel: {
1258
1264
  id: 'SearchInput.buttonLabel',
1259
1265
  description: 'Label for "Search" button.',
@@ -1358,7 +1364,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
1358
1364
  "data-testid": this.props.testId || 'search-input',
1359
1365
  value: this.state.text,
1360
1366
  label: this.props.label,
1361
- placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$N.placeholder),
1367
+ placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$O.placeholder),
1362
1368
  inputRef: this.props.inputRef || this.setInputRef,
1363
1369
  onChange: this.handleInputChange,
1364
1370
  onEnter: this.handleEnter,
@@ -1928,34 +1934,6 @@ const useStoreKeysInDataFences = _ref => {
1928
1934
  };
1929
1935
  var useStoreKeysInDataFences$1 = useStoreKeysInDataFences;
1930
1936
 
1931
- function useDidFormValidationFail() {
1932
- const _useState = useState(false),
1933
- _useState2 = _slicedToArray(_useState, 2),
1934
- didFormValidationFail = _useState2[0],
1935
- setDidFormValidationFail = _useState2[1];
1936
- const _useState3 = useState(false),
1937
- _useState4 = _slicedToArray(_useState3, 2),
1938
- wasValidationRequested = _useState4[0],
1939
- setWasValidationRequested = _useState4[1];
1940
- const _useFormikContext = useFormikContext(),
1941
- dirty = _useFormikContext.dirty,
1942
- isValid = _useFormikContext.isValid,
1943
- isValidating = _useFormikContext.isValidating;
1944
- useEffect(() => {
1945
- if (dirty) setWasValidationRequested(false);
1946
- }, [dirty]);
1947
- useEffect(() => {
1948
- if (isValidating) setWasValidationRequested(true);
1949
- }, [isValidating]);
1950
- useEffect(() => {
1951
- if (wasValidationRequested && !isValid) {
1952
- setDidFormValidationFail(true);
1953
- setWasValidationRequested(false);
1954
- }
1955
- }, [isValid, setWasValidationRequested, setDidFormValidationFail, wasValidationRequested]);
1956
- return Boolean(didFormValidationFail);
1957
- }
1958
-
1959
1937
  function ownKeys$1a(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1960
1938
  function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$1a(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1a(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1961
1939
  const TEN_MINUTES_IN_MS = 600000;
@@ -2032,7 +2010,7 @@ const usePersistedReminder = function () {
2032
2010
  };
2033
2011
  var usePersistedReminder$1 = usePersistedReminder;
2034
2012
 
2035
- var messages$M = defineMessages({
2013
+ var messages$N = defineMessages({
2036
2014
  profileUpdated: {
2037
2015
  id: 'NotificationText.profileUpdated',
2038
2016
  description: 'Label for the notification header',
@@ -2056,22 +2034,22 @@ const LinkToProfile = props => {
2056
2034
  return jsx(Link, {
2057
2035
  to: "/account/profile",
2058
2036
  children: props.children
2059
- });
2037
+ }, "link");
2060
2038
  };
2061
2039
  LinkToProfile.displayName = 'LinkToProfile';
2062
2040
  const getLinkToProfile = msg => jsx(LinkToProfile, {
2063
2041
  children: msg
2064
- });
2065
- const getNewLine = () => jsx("br", {});
2042
+ }, "linkToProfile");
2043
+ const getNewLine = () => jsx("br", {}, crypto.randomUUID());
2066
2044
  const NotificationText = () => jsxs(Spacings.Stack, {
2067
2045
  children: [jsxs(Spacings.Stack, {
2068
2046
  scale: "xs",
2069
2047
  children: [jsx(Text.Body, {
2070
2048
  as: "p",
2071
2049
  isBold: true,
2072
- intlMessage: messages$M.profileUpdated
2050
+ intlMessage: messages$N.profileUpdated
2073
2051
  }), jsx(Text.Body, {
2074
- intlMessage: _objectSpread$19(_objectSpread$19({}, messages$M.addMoreInformation), {}, {
2052
+ intlMessage: _objectSpread$19(_objectSpread$19({}, messages$N.addMoreInformation), {}, {
2075
2053
  values: {
2076
2054
  newline: getNewLine
2077
2055
  }
@@ -2080,7 +2058,7 @@ const NotificationText = () => jsxs(Spacings.Stack, {
2080
2058
  }), jsx(Spacings.Stack, {
2081
2059
  scale: "xs",
2082
2060
  children: jsx(Text.Body, {
2083
- intlMessage: _objectSpread$19(_objectSpread$19({}, messages$M.informationAndProfileLink), {}, {
2061
+ intlMessage: _objectSpread$19(_objectSpread$19({}, messages$N.informationAndProfileLink), {}, {
2084
2062
  values: {
2085
2063
  newline: getNewLine,
2086
2064
  link: getLinkToProfile
@@ -2163,8 +2141,11 @@ function usePendingRequests() {
2163
2141
  pendingRequests = _useState2[0],
2164
2142
  setPendingRequests = _useState2[1];
2165
2143
  const isUnmountedRef = useRef(false);
2166
- useEffect(() => () => {
2167
- isUnmountedRef.current = true;
2144
+ useEffect(() => {
2145
+ isUnmountedRef.current = false;
2146
+ return () => {
2147
+ isUnmountedRef.current = true;
2148
+ };
2168
2149
  }, []);
2169
2150
  const change = useCallback(delta => {
2170
2151
  // FIXME: isMounted is an anti pattern
@@ -2205,7 +2186,7 @@ const useEventCallback = (fn, dependencies) => {
2205
2186
  };
2206
2187
  var useEventCallback$1 = useEventCallback;
2207
2188
 
2208
- var messages$L = defineMessages({
2189
+ var messages$M = defineMessages({
2209
2190
  fallbackHint: {
2210
2191
  id: 'KeyFallback.fallbackHint',
2211
2192
  description: 'key fallback for a specified resource key (e.g name)',
@@ -2229,7 +2210,7 @@ const useLocalizedKeyFallback = () => {
2229
2210
  return values => {
2230
2211
  if (!values.resource) return null;
2231
2212
  const localizedString = values.resource[values.localizedStringFieldName];
2232
- const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
2213
+ const fallbackHintWithKey = intl.formatMessage(messages$M.fallbackHint, {
2233
2214
  key: values.resource.key
2234
2215
  });
2235
2216
  if (!localizedString) return fallbackHintWithKey;
@@ -2377,7 +2358,7 @@ const convertProductSelectionsFromGraphQl = productSelections => {
2377
2358
  });
2378
2359
  };
2379
2360
 
2380
- var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, defaultValue: { kind: "NullValue" }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, defaultValue: { kind: "NullValue" }, 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" } } } }, defaultValue: { kind: "NullValue" }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, defaultValue: { kind: "NullValue" }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, 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: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 400, source: { body: "query FetchProductSelections($limit: Int = null, $offset: Int = null, $sort: [String!] = null, $where: String = null) {\n productSelections(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
2361
+ var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, defaultValue: { kind: "NullValue" }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, defaultValue: { kind: "NullValue" }, 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" } } } }, defaultValue: { kind: "NullValue" }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, defaultValue: { kind: "NullValue" }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, 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: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 424, source: { body: "query FetchProductSelections(\n $limit: Int = null\n $offset: Int = null\n $sort: [String!] = null\n $where: String = null\n) {\n productSelections(\n limit: $limit\n offset: $offset\n sort: $sort\n where: $where\n ) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
2381
2362
  const createQueryVariables$5 = function () {
2382
2363
  let ownProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2383
2364
  return {
@@ -2413,841 +2394,244 @@ const useProductSelectionsFetcher = props => {
2413
2394
  };
2414
2395
  var useProductSelectionsFetcher$1 = useProductSelectionsFetcher;
2415
2396
 
2416
- const _excluded$d = ["action"];
2417
- function ownKeys$16(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2418
- function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context0, _context1; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context0 = ownKeys$16(Object(t), !0)).call(_context0, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context1 = ownKeys$16(Object(t))).call(_context1, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
2397
+ const setToArray = function () {
2398
+ let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2399
+ return `id in (${_mapInstanceProperty(values).call(values, value => `"${value}"`).join(', ')})`;
2400
+ };
2419
2401
 
2420
- /**
2421
- * Checks if a value is a LocalizedString
2422
- *
2423
- * { en: 'Hello' } -> true
2424
- * 'Hello' -> false
2425
- */
2402
+ function capitalizeFirst(text) {
2403
+ return text.charAt(0).toUpperCase() + _sliceInstanceProperty(text).call(text, 1);
2404
+ }
2426
2405
 
2427
- const getIsLocalizedString = maybeLocalizedString => {
2428
- if (typeof maybeLocalizedString === 'string') return false;
2429
- if (!maybeLocalizedString || typeof maybeLocalizedString === 'object' && _Object$keys(maybeLocalizedString).length === 0) return false;
2430
- return true;
2406
+ const PRODUCT_STATUSES = {
2407
+ PUBLISHED: 'published',
2408
+ UNPUBLISHED: 'unpublished',
2409
+ MODIFIED: 'modified'
2431
2410
  };
2432
-
2433
- /**
2434
- * Transforms a list of `CustomField` into a `CustomField` object
2435
- *
2436
- * [{ name: 'fieldA', value: 'Hello' }] -> { fieldA: 'Hello' }
2437
- */
2438
- const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
2439
- if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
2440
- return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$16(_objectSpread$16({}, customFields), {}, {
2441
- [customField.name]: customField.value
2442
- }), {});
2411
+ const FILTER_TYPES = {
2412
+ lessThan: 'lessThan',
2413
+ moreThan: 'moreThan',
2414
+ equalTo: 'equalTo',
2415
+ range: 'range',
2416
+ missing: 'missing',
2417
+ missingIn: 'missingIn',
2418
+ in: 'in'
2419
+ };
2420
+ const FIELD_TYPES = {
2421
+ Money: 'Money',
2422
+ LocalizedString: 'LocalizedString',
2423
+ Time: 'Time',
2424
+ DateTime: 'DateTime',
2425
+ Boolean: 'Boolean',
2426
+ String: 'String',
2427
+ Enum: 'Enum',
2428
+ LocalizedEnum: 'LocalizedEnum',
2429
+ Number: 'Number',
2430
+ Date: 'Date',
2431
+ Reference: 'Reference',
2432
+ Set: 'Set'
2443
2433
  };
2434
+ const PRECISION_TYPES = {
2435
+ highPrecision: 'highPrecision',
2436
+ centPrecision: 'centPrecision'
2437
+ };
2438
+ const ERROR_CODES = {
2439
+ semanticError: 'SemanticError',
2440
+ invalidInput: 'InvalidInput'
2441
+ };
2442
+ const DefaultPageSizes = [20, 50, 100];
2443
+ DefaultPageSizes[0];
2444
2444
 
2445
- // --- Types mapping ---
2445
+ const regexpData = /^data-/;
2446
+ function filterDataAttributes(obj) {
2447
+ var _context, _context2;
2448
+ return _reduceInstanceProperty(_context = _filterInstanceProperty(_context2 = _Object$keys(obj)).call(_context2, p => regexpData.test(p))).call(_context, (acc, p) => {
2449
+ // eslint-disable-next-line no-param-reassign
2450
+ acc[p] = obj[p];
2451
+ return acc;
2452
+ }, {});
2453
+ }
2446
2454
 
2447
- /**
2448
- * Map category GraphQL shape with nameAllLocales to reference shape
2449
- * Includes ancestors and parent
2450
- *
2451
- * @param {Object} category - A category result object from graphql
2452
- * @return {Object} Category (as a REST API representation):
2453
- * `{ id, obj: { id, name } }`
2454
- */
2455
- function transformLocalizedFieldsForCategory(category) {
2456
- var _context;
2457
- let transformationOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [{
2458
- from: 'nameAllLocales',
2459
- to: 'name'
2460
- }];
2461
- const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
2462
- const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
2463
- const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
2464
- return _objectSpread$16(_objectSpread$16(_objectSpread$16({}, transformedData), parent ? {
2465
- parent
2466
- } : {}), ancestors ? {
2467
- ancestors
2468
- } : {});
2455
+ const invalidValues$1 = [null, undefined, ''];
2456
+ function isEmpty$2(_ref) {
2457
+ let value = _ref.value;
2458
+ return _includesInstanceProperty(invalidValues$1).call(invalidValues$1, value) || _includesInstanceProperty(invalidValues$1).call(invalidValues$1, value.from) && _includesInstanceProperty(invalidValues$1).call(invalidValues$1, value.to);
2469
2459
  }
2470
- function transformLocalizedFieldsForCartDiscount(cartDiscount) {
2471
- const transformationOptions = [{
2472
- from: 'nameAllLocales',
2473
- to: 'name'
2474
- }];
2475
- return applyTransformedLocalizedFields(cartDiscount, transformationOptions);
2460
+
2461
+ const invalidValues = [null, undefined, ''];
2462
+ function validateSingleFilter(_ref) {
2463
+ let value = _ref.value;
2464
+ return _includesInstanceProperty(invalidValues).call(invalidValues, value);
2476
2465
  }
2477
- function mapShippingRateTierToGraphQL(tiers) {
2478
- return _reduceInstanceProperty(tiers).call(tiers, (graphQlTiers, tier) => [...graphQlTiers, {
2479
- [tier.type]: {
2480
- price: tier.price ? {
2481
- centAmount: tier.price.centAmount,
2482
- currencyCode: tier.price.currencyCode
2483
- } : undefined,
2484
- minimumCentAmount: tier.minimumCentAmount,
2485
- value: tier.value || undefined,
2486
- priceFunction: tier.priceFunction ? {
2487
- function: tier.priceFunction.function,
2488
- currencyCode: tier.priceFunction.currencyCode
2489
- } : undefined,
2490
- score: tier.score
2466
+
2467
+ const dateFormatDayStart$1 = 'YYYY-MM-DDT00:00:00.000';
2468
+ const dateFormatDayEnd$1 = 'YYYY-MM-DDT23:59:59.999';
2469
+ const getDateTimeInUTC = (date, timezone, format) => {
2470
+ const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSS';
2471
+ const momentDate = moment(date);
2472
+ // check if the date is date only or datetime
2473
+ const noTimeSpecified = momentDate.hours() === 0 && momentDate.minutes() === 0 && momentDate.seconds() === 0;
2474
+ // if it's a date then convert it to UTC datetime based on timezone
2475
+ if (noTimeSpecified) {
2476
+ const offset = moment(date).tz(timezone)?.utcOffset() || 0;
2477
+ const formattedDate = momentDate.format(format);
2478
+ const formattedDateWithOffset = moment(formattedDate).add(offset, 'minutes').format(dateFormat);
2479
+ // console.log(formattedDateWithOffset);
2480
+ return formattedDateWithOffset;
2481
+ }
2482
+ // if it's a datetime we assume that it's already in UTC
2483
+ // and just return it
2484
+ return date;
2485
+ };
2486
+ function dateTransformer$1(filterKey, filters) {
2487
+ let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultFilterValidator$1;
2488
+ const queries = _mapInstanceProperty(filters).call(filters, _ref => {
2489
+ let type = _ref.type,
2490
+ value = _ref.value,
2491
+ timezone = _ref.timezone;
2492
+ if (!filterValidator({
2493
+ type,
2494
+ value
2495
+ })) return '';
2496
+ switch (type) {
2497
+ case FILTER_TYPES.lessThan:
2498
+ return `${filterKey} < "${getDateTimeInUTC(value, timezone, dateFormatDayStart$1)}"`;
2499
+ case FILTER_TYPES.moreThan:
2500
+ return `${filterKey} > "${getDateTimeInUTC(value, timezone, dateFormatDayEnd$1)}"`;
2501
+ case FILTER_TYPES.equalTo:
2502
+ return oneLine`
2503
+ (${filterKey} >= "${getDateTimeInUTC(value, timezone, dateFormatDayStart$1)}"
2504
+ and ${filterKey} <= "${getDateTimeInUTC(value, timezone, dateFormatDayEnd$1)}")
2505
+ `;
2506
+ case FILTER_TYPES.range:
2507
+ return oneLine`
2508
+ (${filterKey} >= "${getDateTimeInUTC(value.from, timezone, dateFormatDayStart$1)}"
2509
+ and ${filterKey} <= "${getDateTimeInUTC(value.to, timezone, dateFormatDayEnd$1)}")
2510
+ `;
2511
+ default:
2512
+ return '';
2491
2513
  }
2492
- }], []);
2514
+ });
2515
+
2516
+ // The separator is and `or` as they are the same filter
2517
+ const queryString = _filterInstanceProperty(queries).call(queries, q => q !== '').join(' or ');
2518
+
2519
+ /* The parenthesis involing the `queryString` are needed since they are all part of the
2520
+ * same filter so we need something to work with
2521
+ * (
2522
+ * (createdAt >= "2018-04-25T00:00:00.000+02:00" and createdAt <= "2018-04-25T23:59:59.999+02:00") o
2523
+ * (createdAt >= "2018-02-15T00:00:00.000+01:00" and createdAt <= "2018-02-15T23:59:59.999+01:00")
2524
+ * ) or some_more_filters
2525
+ */
2526
+ return queryString === '' ? null : `(${queryString})`;
2527
+ }
2528
+ function defaultFilterValidator$1(_ref2) {
2529
+ let type = _ref2.type,
2530
+ value = _ref2.value;
2531
+ if (type !== 'range' && (validateSingleFilter({
2532
+ value
2533
+ }) || !moment(value).isValid())) return false;
2534
+ if (type === 'range' && (isEmpty$2({
2535
+ value
2536
+ }) || !moment(value.from).isValid() || !moment(value.to).isValid())) return false;
2537
+ return true;
2493
2538
  }
2494
2539
 
2495
- /**
2496
- * NOTE:
2497
- * This module massages update actions produced by the JS SDK
2498
- * to be compatible with CTP GraphQL mutations. This logic should be
2499
- * moved into the JS SDK once discounts is fully 100% migrated to
2500
- * GraphQL or any other plugin/app needs this functionality. Until
2501
- * then this serves as a collective set of requirements before
2502
- * prematurely adding a not fully working set of conversions to the
2503
- * JS SDK.
2504
- */
2540
+ var localizedTextTransformer = localizedString => {
2541
+ var _context;
2542
+ return _mapInstanceProperty(_context = _Object$keys(localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
2543
+ };
2505
2544
 
2506
- const createAttributeTypeValue = attribute => {
2507
- switch (attribute.type.name) {
2508
- case 'set':
2509
- return {
2510
- set: {
2511
- elementType: createAttributeTypeValue({
2512
- type: attribute.type.elementType
2513
- })
2514
- }
2515
- };
2516
- case 'boolean':
2517
- case 'date':
2518
- case 'datetime':
2519
- case 'ltext':
2520
- case 'money':
2521
- case 'number':
2522
- case 'text':
2523
- case 'time':
2524
- return {
2525
- [attribute.type.name]: {}
2526
- };
2527
- case 'enum':
2528
- case 'lenum':
2529
- return {
2530
- [attribute.type.name]: {
2531
- values: []
2532
- }
2533
- };
2534
- case 'reference':
2535
- {
2536
- return {
2537
- [attribute.type.name]: {
2538
- referenceTypeId: attribute.type.referenceTypeId
2539
- }
2540
- };
2541
- }
2542
- default:
2543
- return attribute.type;
2545
+ const getCentAmountClause = (value, operator, locale) => `centAmount ${operator} ${MoneyInput.convertToMoneyValue(value, locale).centAmount}`;
2546
+ function moneyTransformer(value, option, locale) {
2547
+ const clauses = [];
2548
+ if (option === FILTER_TYPES.range) {
2549
+ clauses[0] = `currencyCode = "${value.from.currencyCode}"`;
2550
+ clauses[1] = getCentAmountClause(value.from, '>=', locale);
2551
+ clauses[2] = getCentAmountClause(value.to, '<=', locale);
2552
+ return clauses.join(' and ');
2544
2553
  }
2545
- };
2546
-
2547
- /*
2548
- * Fixed price supports high precision. Action format is nested with the
2549
- * the type of the money. Absolute discount only works with cent precision,
2550
- * hence the action structure is flat.
2551
- */
2552
- const formatMoney$2 = valueType => money => {
2553
- switch (valueType) {
2554
- case 'fixed':
2555
- case 'fixedCart':
2556
- return {
2557
- [money.type]: _objectSpread$16({
2558
- centAmount: money.centAmount,
2559
- currencyCode: money.currencyCode
2560
- }, money.type === PRECISION_TYPES.highPrecision && {
2561
- preciseAmount: money.preciseAmount,
2562
- fractionDigits: money.fractionDigits
2563
- })
2564
- };
2565
- case 'absolute':
2566
- case 'absoluteCart':
2567
- return {
2568
- centAmount: money.centAmount,
2569
- currencyCode: money.currencyCode
2570
- };
2554
+ clauses[0] = `currencyCode = "${value.currencyCode}"`;
2555
+ switch (option) {
2556
+ case FILTER_TYPES.lessThan:
2557
+ clauses[1] = getCentAmountClause(value, '<', locale);
2558
+ break;
2559
+ case FILTER_TYPES.moreThan:
2560
+ clauses[1] = getCentAmountClause(value, '>', locale);
2561
+ break;
2562
+ case FILTER_TYPES.equalTo:
2563
+ clauses[1] = getCentAmountClause(value, '=', locale);
2564
+ break;
2571
2565
  default:
2572
- throw new Error('Unexpected value type for money.');
2566
+ return '';
2573
2567
  }
2574
- };
2568
+ return clauses.join(' and ');
2569
+ }
2575
2570
 
2576
- /**
2577
- * converts the `changeValue` action to GraphQL actions variable
2578
- * @param {Object} actionPayload
2571
+ const formatTime = 'HH:mm:ss.SSS';
2572
+
2573
+ /* TimeInput only allows HH:mm:ss and adds the seconds as 00 and
2574
+ * the milliseconds always as 000.
2575
+ * This function returns the same time with the
2579
2576
  */
2580
- const convertChangeValueAction = actionPayload => {
2581
- const valueType = actionPayload.value.type;
2582
- const possibleTypeKeys = {
2583
- relative: ['permyriad'],
2584
- absolute: ['money'],
2585
- absoluteCart: ['money', 'applicationMode'],
2586
- fixed: ['money'],
2587
- fixedCart: ['money', 'applicationMode'],
2588
- giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
2589
- };
2590
- const filteredValue = pick(actionPayload.value, possibleTypeKeys[valueType]);
2591
- if (filteredValue.money) {
2592
- var _context2;
2593
- const moneyFormatter = formatMoney$2(valueType);
2594
- filteredValue.money = _mapInstanceProperty(_context2 = filteredValue.money).call(_context2, moneyFormatter);
2595
- }
2596
- return {
2597
- changeValue: {
2598
- value: {
2599
- [valueType]: filteredValue
2600
- }
2577
+ const getEndOfSecond = value => moment(value, formatTime).endOf('minute').format(formatTime);
2578
+ const defaultFilterValidator = _ref => {
2579
+ let type = _ref.type,
2580
+ value = _ref.value;
2581
+ if (type !== FILTER_TYPES.range && validateSingleFilter({
2582
+ value
2583
+ })) return false;
2584
+ if (type === FILTER_TYPES.range && isEmpty$2({
2585
+ value
2586
+ })) return false;
2587
+ return true;
2588
+ };
2589
+ const timeTransformer = function (filterKey, filters) {
2590
+ let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultFilterValidator;
2591
+ const queries = _mapInstanceProperty(filters).call(filters, _ref2 => {
2592
+ let type = _ref2.type,
2593
+ value = _ref2.value;
2594
+ if (!filterValidator({
2595
+ type,
2596
+ value
2597
+ })) return '';
2598
+ switch (type) {
2599
+ case FILTER_TYPES.lessThan:
2600
+ return `${filterKey} < "${value}"`;
2601
+ case FILTER_TYPES.moreThan:
2602
+ return `${filterKey} > "${value}"`;
2603
+ case FILTER_TYPES.equalTo:
2604
+ return oneLine`
2605
+ (${filterKey} >= "${value}"
2606
+ and ${filterKey} <= "${getEndOfSecond(value)}")
2607
+ `;
2608
+ case FILTER_TYPES.range:
2609
+ return oneLine`
2610
+ (${filterKey} >= "${value.from}"
2611
+ and ${filterKey} <= "${getEndOfSecond(value.to)}")
2612
+ `;
2613
+ default:
2614
+ return '';
2601
2615
  }
2602
- };
2616
+ });
2617
+
2618
+ // The separator is and `or` as they are the same filter
2619
+ const queryString = _filterInstanceProperty(queries).call(queries, q => q !== '').join(' or ');
2620
+
2621
+ /* The parenthesis involing the `queryString` are needed since they are all part of the
2622
+ * same filter so we need something to work with
2623
+ * (
2624
+ * (pickUpTime >= "12:00" and pickUpTime <= "13:00") o
2625
+ * (pickUpTime >= "14:00" and pickUpTime <= "15:00")
2626
+ * ) or some_more_filters
2627
+ */
2628
+ return queryString === '' ? null : `(${queryString})`;
2603
2629
  };
2604
2630
 
2605
- /**
2606
- * This function changes any payload after the actions have been computed.
2607
- * Currently we only need to change the `setCustomField` action payload
2608
- * as its dynamic content can not be typed in SDL for the mutation.
2609
- */
2610
- const convertAction = (actionName, actionPayload) => {
2611
- var _context3, _context4, _context5, _context6, _context7;
2612
- const getNameFromPayload = payload => {
2613
- // changeName for `Organizations`
2614
- if (typeof payload.name === 'string') return payload;
2615
- // changeName for `UserProfile`
2616
- if (payload.firstName || payload.lastName) return payload;
2617
- // assume `changeName` for LocalizedString type
2618
- return {
2619
- name: transformLocalizedStringToLocalizedField(payload.name)
2620
- };
2621
- };
2622
- switch (actionName) {
2623
- case 'changeName':
2624
- return {
2625
- [actionName]: getNameFromPayload(actionPayload)
2626
- };
2627
- case 'setDescription':
2628
- case 'changeDescription':
2629
- return {
2630
- [actionName]: {
2631
- description: getIsLocalizedString(actionPayload.description) ? transformLocalizedStringToLocalizedField(actionPayload.description) : actionPayload.description
2632
- }
2633
- };
2634
- case 'setLocalizedDescription':
2635
- return {
2636
- [actionName]: {
2637
- localizedDescription: transformLocalizedStringToLocalizedField(actionPayload.localizedDescription)
2638
- }
2639
- };
2640
- case 'setName':
2641
- return {
2642
- [actionName]: getNameFromPayload(actionPayload)
2643
- };
2644
- case 'setLocalizedName':
2645
- return {
2646
- [actionName]: {
2647
- localizedName: transformLocalizedStringToLocalizedField(actionPayload.localizedName)
2648
- }
2649
- };
2650
- case 'setLineItemCustomField':
2651
- return {
2652
- [actionName]: {
2653
- lineItemId: actionPayload.lineItemId,
2654
- name: actionPayload.name,
2655
- value: _JSON$stringify(actionPayload.value)
2656
- }
2657
- };
2658
- case 'setCustomLineItemCustomField':
2659
- return {
2660
- [actionName]: {
2661
- customLineItemId: actionPayload.customLineItemId,
2662
- name: actionPayload.name,
2663
- value: _JSON$stringify(actionPayload.value)
2664
- }
2665
- };
2666
- case 'setCustomField':
2667
- return {
2668
- [actionName]: {
2669
- name: actionPayload.name,
2670
- value: _JSON$stringify(actionPayload.value)
2671
- }
2672
- };
2673
- case 'setCustomType':
2674
- return {
2675
- [actionName]: {
2676
- typeId: actionPayload.type?.id,
2677
- fields: actionPayload.fields ? _mapInstanceProperty(_context3 = _Object$entries(actionPayload.fields)).call(_context3, _ref => {
2678
- let _ref2 = _slicedToArray(_ref, 2),
2679
- customField = _ref2[0],
2680
- value = _ref2[1];
2681
- return {
2682
- name: customField,
2683
- value: _JSON$stringify(value)
2684
- };
2685
- }) : undefined
2686
- }
2687
- };
2688
- case 'removeLocation':
2689
- return {
2690
- [actionName]: {
2691
- location: {
2692
- country: actionPayload.location.country
2693
- }
2694
- }
2695
- };
2696
- case 'addLocation':
2697
- return {
2698
- [actionName]: {
2699
- location: {
2700
- country: actionPayload.location.country
2701
- }
2702
- }
2703
- };
2704
- case 'setGeoLocation':
2705
- return {
2706
- [actionName]: actionPayload?.geoLocation ? {
2707
- geoLocation: {
2708
- type: 'Point',
2709
- coordinates: [_parseFloat(actionPayload.geoLocation?.longitude), _parseFloat(actionPayload.geoLocation?.latitude)]
2710
- }
2711
- } : {
2712
- undefined
2713
- }
2714
- };
2715
- case 'changeLabel':
2716
- return {
2717
- changeLabel: {
2718
- attributeName: actionPayload.attributeName,
2719
- label: transformLocalizedStringToLocalizedField(actionPayload.label)
2720
- }
2721
- };
2722
- case 'setInputTip':
2723
- return {
2724
- setInputTip: {
2725
- attributeName: actionPayload.attributeName,
2726
- inputTip: transformLocalizedStringToLocalizedField(actionPayload.inputTip)
2727
- }
2728
- };
2729
- case 'addAttributeDefinition':
2730
- return {
2731
- [actionName]: {
2732
- attributeDefinition: _objectSpread$16(_objectSpread$16({}, actionPayload.attribute), {}, {
2733
- label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
2734
- inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
2735
- type: createAttributeTypeValue(actionPayload.attribute)
2736
- })
2737
- }
2738
- };
2739
- case 'replaceTaxRate':
2740
- return {
2741
- [actionName]: {
2742
- taxRate: {
2743
- name: actionPayload.taxRate.name,
2744
- country: actionPayload.taxRate.country,
2745
- includedInPrice: actionPayload.taxRate.includedInPrice,
2746
- amount: actionPayload.taxRate.amount,
2747
- state: actionPayload.taxRate.state,
2748
- key: actionPayload.taxRate.key,
2749
- subRates: actionPayload.taxRate.subRates
2750
- },
2751
- taxRateId: actionPayload.taxRateId
2752
- }
2753
- };
2754
- case 'addZone':
2755
- return {
2756
- [actionName]: {
2757
- zone: {
2758
- id: actionPayload.zone.id,
2759
- typeId: actionPayload.zone.typeId
2760
- }
2761
- }
2762
- };
2763
- case 'removeZone':
2764
- return {
2765
- [actionName]: {
2766
- zone: {
2767
- id: actionPayload.zone.id,
2768
- typeId: actionPayload.zone.typeId
2769
- }
2770
- }
2771
- };
2772
- case 'changeTaxCategory':
2773
- return {
2774
- [actionName]: {
2775
- taxCategory: {
2776
- id: actionPayload.taxCategory.id,
2777
- typeId: actionPayload.taxCategory.typeId
2778
- }
2779
- }
2780
- };
2781
- case 'addShippingRate':
2782
- return {
2783
- [actionName]: {
2784
- zone: {
2785
- id: actionPayload.zone.id,
2786
- typeId: actionPayload.zone.typeId
2787
- },
2788
- shippingRate: {
2789
- price: {
2790
- centAmount: actionPayload.shippingRate.price.centAmount,
2791
- currencyCode: actionPayload.shippingRate.price.currencyCode
2792
- },
2793
- freeAbove: actionPayload.shippingRate.freeAbove ? {
2794
- centAmount: actionPayload.shippingRate.freeAbove.centAmount,
2795
- currencyCode: actionPayload.shippingRate.freeAbove.currencyCode
2796
- } : undefined,
2797
- tiers: actionPayload.shippingRate.tiers ? mapShippingRateTierToGraphQL(actionPayload.shippingRate.tiers) : undefined
2798
- }
2799
- }
2800
- };
2801
- case 'removeShippingRate':
2802
- return {
2803
- [actionName]: {
2804
- zone: {
2805
- id: actionPayload.zone.id,
2806
- typeId: actionPayload.zone.typeId
2807
- },
2808
- shippingRate: {
2809
- price: {
2810
- centAmount: actionPayload.shippingRate.price.centAmount,
2811
- currencyCode: actionPayload.shippingRate.price.currencyCode
2812
- },
2813
- freeAbove: actionPayload.shippingRate.freeAbove ? {
2814
- centAmount: actionPayload.shippingRate.freeAbove.centAmount,
2815
- currencyCode: actionPayload.shippingRate.freeAbove.currencyCode
2816
- } : undefined,
2817
- tiers: actionPayload.shippingRate.tiers ? mapShippingRateTierToGraphQL(actionPayload.shippingRate.tiers) : undefined
2818
- }
2819
- }
2820
- };
2821
- case 'changeValue':
2822
- return convertChangeValueAction(actionPayload);
2823
- // product-types -> attributes -> enum
2824
- case 'addLocalizedEnumValue':
2825
- return {
2826
- [actionName]: {
2827
- attributeName: actionPayload.attributeName,
2828
- value: _objectSpread$16(_objectSpread$16({}, actionPayload.value), {}, {
2829
- label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
2830
- })
2831
- }
2832
- };
2833
- case 'changeLocalizedEnumValueLabel':
2834
- return {
2835
- [actionName]: {
2836
- attributeName: actionPayload.attributeName,
2837
- newValue: _objectSpread$16(_objectSpread$16({}, actionPayload.newValue), {}, {
2838
- label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
2839
- })
2840
- }
2841
- };
2842
- case 'setShippingRateInputType':
2843
- return {
2844
- [actionName]: {
2845
- shippingRateInputType: actionPayload.shippingRateInputType?.type ? {
2846
- [actionPayload.shippingRateInputType.type]: {
2847
- values: actionPayload.shippingRateInputType.type === 'CartClassification' ? _mapInstanceProperty(_context4 = _valuesInstanceProperty(actionPayload.shippingRateInputType)).call(_context4, value => ({
2848
- key: value.key,
2849
- label: value.allLocaleLabels
2850
- })) : undefined
2851
- }
2852
- } : undefined
2853
- }
2854
- };
2855
- case 'addCustomLineItem':
2856
- {
2857
- return {
2858
- [actionName]: {
2859
- slug: actionPayload.slug,
2860
- quantity: actionPayload.quantity,
2861
- name: transformLocalizedStringToLocalizedField(actionPayload.name),
2862
- taxCategory: actionPayload.taxCategory,
2863
- money: {
2864
- [actionPayload.money.type]: _objectSpread$16({
2865
- centAmount: actionPayload.money.centAmount,
2866
- currencyCode: actionPayload.money.currencyCode
2867
- }, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
2868
- preciseAmount: actionPayload.money.preciseAmount,
2869
- fractionDigits: actionPayload.money.fractionDigits
2870
- })
2871
- }
2872
- }
2873
- };
2874
- }
2875
- case 'setDataFences':
2876
- return {
2877
- [actionName]: {
2878
- dataFences: _reduceInstanceProperty(_context5 = actionPayload.dataFences).call(_context5, (nextDataFences, dataFence) => {
2879
- if (dataFence.type.toLowerCase() === 'store') return [...nextDataFences, {
2880
- [dataFence.type.toLowerCase()]: {
2881
- storeKeys: dataFence.storeKeys
2882
- }
2883
- }];
2884
- return nextDataFences;
2885
- }, [])
2886
- }
2887
- };
2888
- case 'changeTarget':
2889
- return {
2890
- [actionName]: {
2891
- target: {
2892
- [actionPayload.target.type]: _objectSpread$16(_objectSpread$16(_objectSpread$16({}, omit(actionPayload.target, ['type', '__typename'])), actionPayload.target.triggerPattern && {
2893
- triggerPattern: _mapInstanceProperty(_context6 = actionPayload.target.triggerPattern).call(_context6, pattern => ({
2894
- [pattern.type]: omit(pattern, ['type', '__typename'])
2895
- }))
2896
- }), actionPayload.target.targetPattern && {
2897
- targetPattern: _mapInstanceProperty(_context7 = actionPayload.target.targetPattern).call(_context7, pattern => ({
2898
- [pattern.type]: omit(pattern, ['type', '__typename'])
2899
- }))
2900
- })
2901
- }
2902
- }
2903
- };
2904
- case 'addAddress':
2905
- case 'changeAddress':
2906
- {
2907
- var _context8;
2908
- const _ref3 = actionPayload.address?.custom || {},
2909
- _ref3$fields = _ref3.fields,
2910
- fields = _ref3$fields === void 0 ? {} : _ref3$fields;
2911
- const customFields = isEmpty$3(fields) ? null : _mapInstanceProperty(_context8 = _Object$entries(fields)).call(_context8, _ref4 => {
2912
- let _ref5 = _slicedToArray(_ref4, 2),
2913
- name = _ref5[0],
2914
- value = _ref5[1];
2915
- return {
2916
- name,
2917
- value: _JSON$stringify(value)
2918
- };
2919
- });
2920
- const custom = actionPayload.address?.custom?.type?.id ? {
2921
- type: {
2922
- id: actionPayload.address.custom.type.id
2923
- },
2924
- fields: customFields
2925
- } : null;
2926
- return {
2927
- [actionName]: _objectSpread$16(_objectSpread$16({}, actionPayload), {}, {
2928
- address: _objectSpread$16(_objectSpread$16({}, omit(actionPayload.address, ['__typename'])), {}, {
2929
- custom
2930
- })
2931
- })
2932
- };
2933
- }
2934
- case 'setAddressCustomType':
2935
- {
2936
- var _context9;
2937
- const _ref6 = actionPayload || {},
2938
- addressId = _ref6.addressId,
2939
- _ref6$fields = _ref6.fields,
2940
- fields = _ref6$fields === void 0 ? {} : _ref6$fields,
2941
- type = _ref6.type;
2942
- const customFields = isEmpty$3(fields) ? null : _mapInstanceProperty(_context9 = _Object$entries(fields)).call(_context9, _ref7 => {
2943
- let _ref8 = _slicedToArray(_ref7, 2),
2944
- name = _ref8[0],
2945
- value = _ref8[1];
2946
- return {
2947
- name,
2948
- value: _JSON$stringify(value)
2949
- };
2950
- });
2951
- const customType = type?.id ? {
2952
- id: type.id
2953
- } : null;
2954
- return {
2955
- [actionName]: {
2956
- addressId,
2957
- fields: customFields,
2958
- type: customType
2959
- }
2960
- };
2961
- }
2962
- default:
2963
- return {
2964
- [actionName]: actionPayload
2965
- };
2966
- }
2967
- };
2968
- const createGraphQlUpdateActions = actions => _reduceInstanceProperty(actions).call(actions, (previousActions, _ref9) => {
2969
- let actionName = _ref9.action,
2970
- actionPayload = _objectWithoutProperties(_ref9, _excluded$d);
2971
- return [...previousActions, convertAction(actionName, actionPayload)];
2972
- }, []);
2973
- const extractErrorFromGraphQlResponse = graphQlResponse => {
2974
- if (graphQlResponse.networkError?.result?.errors?.length > 0) {
2975
- return graphQlResponse.networkError.result.errors;
2976
- }
2977
- if (graphQlResponse.graphQLErrors?.length > 0) {
2978
- return graphQlResponse.graphQLErrors;
2979
- }
2980
- return graphQlResponse;
2981
- };
2982
-
2983
- var FetchRecurrencePolicies = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchRecurrencePolicies" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "recurrencePolicies" }, 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: "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: 160, source: { body: "query FetchRecurrencePolicies {\n recurrencePolicies {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
2984
- const isRecurringOrdersDisabledError = error => {
2985
- var _context;
2986
- return error.extensions?.code === '403' && _includesInstanceProperty(_context = error.message).call(_context, "The feature 'recurring-orders' is not enabled for this project. Please contact commercetools support.");
2987
- };
2988
- const useRecurrenceIntervals = () => {
2989
- const _useQuery = useQuery$1(FetchRecurrencePolicies, {
2990
- context: {
2991
- target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
2992
- },
2993
- fetchPolicy: 'cache-and-network'
2994
- }),
2995
- data = _useQuery.data,
2996
- loading = _useQuery.loading,
2997
- rawError = _useQuery.error;
2998
-
2999
- // @TODO: Remove these error checks when the feature is enabled by default
3000
- const extractedErrors = rawError ? extractErrorFromGraphQlResponse(rawError) : [];
3001
- const isRecurringOrdersDisabled = extractedErrors.length > 0 &&
3002
- // If the only error is a 403 with the specific message, we assume the feature is disabled
3003
- _everyInstanceProperty(extractedErrors).call(extractedErrors, isRecurringOrdersDisabledError);
3004
- const error = isRecurringOrdersDisabled ? undefined : rawError;
3005
- return {
3006
- recurrencePolicies: data?.recurrencePolicies?.results ?? [],
3007
- loading,
3008
- error,
3009
- isRecurringOrdersDisabled
3010
- };
3011
- };
3012
-
3013
- const setToArray = function () {
3014
- let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
3015
- return `id in (${_mapInstanceProperty(values).call(values, value => `"${value}"`).join(', ')})`;
3016
- };
3017
-
3018
- function capitalizeFirst(text) {
3019
- return text.charAt(0).toUpperCase() + _sliceInstanceProperty(text).call(text, 1);
3020
- }
3021
-
3022
- const PRODUCT_STATUSES = {
3023
- PUBLISHED: 'published',
3024
- UNPUBLISHED: 'unpublished',
3025
- MODIFIED: 'modified'
3026
- };
3027
- const FILTER_TYPES = {
3028
- lessThan: 'lessThan',
3029
- moreThan: 'moreThan',
3030
- equalTo: 'equalTo',
3031
- range: 'range',
3032
- missing: 'missing',
3033
- missingIn: 'missingIn',
3034
- in: 'in'
3035
- };
3036
- const FIELD_TYPES = {
3037
- Money: 'Money',
3038
- LocalizedString: 'LocalizedString',
3039
- Time: 'Time',
3040
- DateTime: 'DateTime',
3041
- Boolean: 'Boolean',
3042
- String: 'String',
3043
- Enum: 'Enum',
3044
- LocalizedEnum: 'LocalizedEnum',
3045
- Number: 'Number',
3046
- Date: 'Date',
3047
- Reference: 'Reference',
3048
- Set: 'Set'
3049
- };
3050
- const PRECISION_TYPES = {
3051
- highPrecision: 'highPrecision',
3052
- centPrecision: 'centPrecision'
3053
- };
3054
- const ERROR_CODES = {
3055
- semanticError: 'SemanticError',
3056
- invalidInput: 'InvalidInput'
3057
- };
3058
- const DefaultPageSizes = [20, 50, 100];
3059
- DefaultPageSizes[0];
3060
-
3061
- const regexpData = /^data-/;
3062
- function filterDataAttributes(obj) {
3063
- var _context, _context2;
3064
- return _reduceInstanceProperty(_context = _filterInstanceProperty(_context2 = _Object$keys(obj)).call(_context2, p => regexpData.test(p))).call(_context, (acc, p) => {
3065
- // eslint-disable-next-line no-param-reassign
3066
- acc[p] = obj[p];
3067
- return acc;
3068
- }, {});
3069
- }
3070
-
3071
- const invalidValues$1 = [null, undefined, ''];
3072
- function isEmpty$2(_ref) {
3073
- let value = _ref.value;
3074
- return _includesInstanceProperty(invalidValues$1).call(invalidValues$1, value) || _includesInstanceProperty(invalidValues$1).call(invalidValues$1, value.from) && _includesInstanceProperty(invalidValues$1).call(invalidValues$1, value.to);
3075
- }
3076
-
3077
- const invalidValues = [null, undefined, ''];
3078
- function validateSingleFilter(_ref) {
3079
- let value = _ref.value;
3080
- return _includesInstanceProperty(invalidValues).call(invalidValues, value);
3081
- }
3082
-
3083
- const dateFormatDayStart$1 = 'YYYY-MM-DDT00:00:00.000';
3084
- const dateFormatDayEnd$1 = 'YYYY-MM-DDT23:59:59.999';
3085
- const getDateTimeInUTC = (date, timezone, format) => {
3086
- const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSS';
3087
- const momentDate = moment(date);
3088
- // check if the date is date only or datetime
3089
- const noTimeSpecified = momentDate.hours() === 0 && momentDate.minutes() === 0 && momentDate.seconds() === 0;
3090
- // if it's a date then convert it to UTC datetime based on timezone
3091
- if (noTimeSpecified) {
3092
- const offset = moment(date).tz(timezone)?.utcOffset() || 0;
3093
- const formattedDate = momentDate.format(format);
3094
- const formattedDateWithOffset = moment(formattedDate).add(offset, 'minutes').format(dateFormat);
3095
- // console.log(formattedDateWithOffset);
3096
- return formattedDateWithOffset;
3097
- }
3098
- // if it's a datetime we assume that it's already in UTC
3099
- // and just return it
3100
- return date;
3101
- };
3102
- function dateTransformer$1(filterKey, filters) {
3103
- let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultFilterValidator$1;
3104
- const queries = _mapInstanceProperty(filters).call(filters, _ref => {
3105
- let type = _ref.type,
3106
- value = _ref.value,
3107
- timezone = _ref.timezone;
3108
- if (!filterValidator({
3109
- type,
3110
- value
3111
- })) return '';
3112
- switch (type) {
3113
- case FILTER_TYPES.lessThan:
3114
- return `${filterKey} < "${getDateTimeInUTC(value, timezone, dateFormatDayStart$1)}"`;
3115
- case FILTER_TYPES.moreThan:
3116
- return `${filterKey} > "${getDateTimeInUTC(value, timezone, dateFormatDayEnd$1)}"`;
3117
- case FILTER_TYPES.equalTo:
3118
- return oneLine`
3119
- (${filterKey} >= "${getDateTimeInUTC(value, timezone, dateFormatDayStart$1)}"
3120
- and ${filterKey} <= "${getDateTimeInUTC(value, timezone, dateFormatDayEnd$1)}")
3121
- `;
3122
- case FILTER_TYPES.range:
3123
- return oneLine`
3124
- (${filterKey} >= "${getDateTimeInUTC(value.from, timezone, dateFormatDayStart$1)}"
3125
- and ${filterKey} <= "${getDateTimeInUTC(value.to, timezone, dateFormatDayEnd$1)}")
3126
- `;
3127
- default:
3128
- return '';
3129
- }
3130
- });
3131
-
3132
- // The separator is and `or` as they are the same filter
3133
- const queryString = _filterInstanceProperty(queries).call(queries, q => q !== '').join(' or ');
3134
-
3135
- /* The parenthesis involing the `queryString` are needed since they are all part of the
3136
- * same filter so we need something to work with
3137
- * (
3138
- * (createdAt >= "2018-04-25T00:00:00.000+02:00" and createdAt <= "2018-04-25T23:59:59.999+02:00") o
3139
- * (createdAt >= "2018-02-15T00:00:00.000+01:00" and createdAt <= "2018-02-15T23:59:59.999+01:00")
3140
- * ) or some_more_filters
3141
- */
3142
- return queryString === '' ? null : `(${queryString})`;
3143
- }
3144
- function defaultFilterValidator$1(_ref2) {
3145
- let type = _ref2.type,
3146
- value = _ref2.value;
3147
- if (type !== 'range' && (validateSingleFilter({
3148
- value
3149
- }) || !moment(value).isValid())) return false;
3150
- if (type === 'range' && (isEmpty$2({
3151
- value
3152
- }) || !moment(value.from).isValid() || !moment(value.to).isValid())) return false;
3153
- return true;
3154
- }
3155
-
3156
- var localizedTextTransformer = localizedString => {
3157
- var _context;
3158
- return _mapInstanceProperty(_context = _Object$keys(localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
3159
- };
3160
-
3161
- const getCentAmountClause = (value, operator, locale) => `centAmount ${operator} ${MoneyInput.convertToMoneyValue(value, locale).centAmount}`;
3162
- function moneyTransformer(value, option, locale) {
3163
- const clauses = [];
3164
- if (option === FILTER_TYPES.range) {
3165
- clauses[0] = `currencyCode = "${value.from.currencyCode}"`;
3166
- clauses[1] = getCentAmountClause(value.from, '>=', locale);
3167
- clauses[2] = getCentAmountClause(value.to, '<=', locale);
3168
- return clauses.join(' and ');
3169
- }
3170
- clauses[0] = `currencyCode = "${value.currencyCode}"`;
3171
- switch (option) {
3172
- case FILTER_TYPES.lessThan:
3173
- clauses[1] = getCentAmountClause(value, '<', locale);
3174
- break;
3175
- case FILTER_TYPES.moreThan:
3176
- clauses[1] = getCentAmountClause(value, '>', locale);
3177
- break;
3178
- case FILTER_TYPES.equalTo:
3179
- clauses[1] = getCentAmountClause(value, '=', locale);
3180
- break;
3181
- default:
3182
- return '';
3183
- }
3184
- return clauses.join(' and ');
3185
- }
3186
-
3187
- const formatTime = 'HH:mm:ss.SSS';
3188
-
3189
- /* TimeInput only allows HH:mm:ss and adds the seconds as 00 and
3190
- * the milliseconds always as 000.
3191
- * This function returns the same time with the
3192
- */
3193
- const getEndOfSecond = value => moment(value, formatTime).endOf('minute').format(formatTime);
3194
- const defaultFilterValidator = _ref => {
3195
- let type = _ref.type,
3196
- value = _ref.value;
3197
- if (type !== FILTER_TYPES.range && validateSingleFilter({
3198
- value
3199
- })) return false;
3200
- if (type === FILTER_TYPES.range && isEmpty$2({
3201
- value
3202
- })) return false;
3203
- return true;
3204
- };
3205
- const timeTransformer = function (filterKey, filters) {
3206
- let filterValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultFilterValidator;
3207
- const queries = _mapInstanceProperty(filters).call(filters, _ref2 => {
3208
- let type = _ref2.type,
3209
- value = _ref2.value;
3210
- if (!filterValidator({
3211
- type,
3212
- value
3213
- })) return '';
3214
- switch (type) {
3215
- case FILTER_TYPES.lessThan:
3216
- return `${filterKey} < "${value}"`;
3217
- case FILTER_TYPES.moreThan:
3218
- return `${filterKey} > "${value}"`;
3219
- case FILTER_TYPES.equalTo:
3220
- return oneLine`
3221
- (${filterKey} >= "${value}"
3222
- and ${filterKey} <= "${getEndOfSecond(value)}")
3223
- `;
3224
- case FILTER_TYPES.range:
3225
- return oneLine`
3226
- (${filterKey} >= "${value.from}"
3227
- and ${filterKey} <= "${getEndOfSecond(value.to)}")
3228
- `;
3229
- default:
3230
- return '';
3231
- }
3232
- });
3233
-
3234
- // The separator is and `or` as they are the same filter
3235
- const queryString = _filterInstanceProperty(queries).call(queries, q => q !== '').join(' or ');
3236
-
3237
- /* The parenthesis involing the `queryString` are needed since they are all part of the
3238
- * same filter so we need something to work with
3239
- * (
3240
- * (pickUpTime >= "12:00" and pickUpTime <= "13:00") o
3241
- * (pickUpTime >= "14:00" and pickUpTime <= "15:00")
3242
- * ) or some_more_filters
3243
- */
3244
- return queryString === '' ? null : `(${queryString})`;
3245
- };
3246
-
3247
- function formatDateRangeValue(value, type) {
3248
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
3249
- locale: 'en',
3250
- timeZone: moment$1.tz.guess()
2631
+ function formatDateRangeValue(value, type) {
2632
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
2633
+ locale: 'en',
2634
+ timeZone: moment$1.tz.guess()
3251
2635
  };
3252
2636
  if (value.from === value.to) return formatDateTime$1(type, value.from, options);
3253
2637
  if (value.from && value.to) return oneLine`
@@ -4452,8 +3836,8 @@ const getData = (code, field) => {
4452
3836
  };
4453
3837
  const getFractionDigit = code => getData(code, 'fractionDigit');
4454
3838
 
4455
- function ownKeys$15(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4456
- function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$15(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$15(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
3839
+ function ownKeys$16(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3840
+ 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(_context = ownKeys$16(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$16(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
4457
3841
  function formatMoneyRangeValue(value, intl) {
4458
3842
  if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
4459
3843
  if (value.from && value.to) return `${formatMoneyValue(value.from, value.currency, intl)} -
@@ -4463,7 +3847,7 @@ function formatMoneyRangeValue(value, intl) {
4463
3847
  return '';
4464
3848
  }
4465
3849
  function formatMoneyValue(amount, currency, intl) {
4466
- return formatMoney$1(_objectSpread$15({
3850
+ return formatMoney$2(_objectSpread$16({
4467
3851
  centAmount: amount,
4468
3852
  fractionDigits: getFractionDigit(currency)
4469
3853
  }, currency ? {
@@ -4478,15 +3862,15 @@ function getFractionedAmount(moneyValue) {
4478
3862
  const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
4479
3863
  return amount / 10 ** fractionDigits;
4480
3864
  }
4481
- function formatMoney$1(moneyValue, intl, options) {
4482
- return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$15({
3865
+ function formatMoney$2(moneyValue, intl, options) {
3866
+ return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$16({
4483
3867
  style: 'currency',
4484
3868
  currency: moneyValue.currencyCode,
4485
3869
  minimumFractionDigits: moneyValue.fractionDigits
4486
3870
  }, options));
4487
3871
  }
4488
3872
 
4489
- var messages$K = defineMessages({
3873
+ var messages$L = defineMessages({
4490
3874
  booleanYes: {
4491
3875
  id: 'AttributeTypeFormats.boolean.yes',
4492
3876
  description: 'The label for boolean attribute `true` value',
@@ -4526,10 +3910,10 @@ const formatLtext = _ref3 => {
4526
3910
  locale: language
4527
3911
  });
4528
3912
  };
4529
- const formatMoney = _ref4 => {
3913
+ const formatMoney$1 = _ref4 => {
4530
3914
  let value = _ref4.value,
4531
3915
  intl = _ref4.intl;
4532
- return formatMoney$1(value, intl);
3916
+ return formatMoney$2(value, intl);
4533
3917
  };
4534
3918
  const formatReference = _ref5 => {
4535
3919
  let value = _ref5.value;
@@ -4568,7 +3952,7 @@ const formatDateTime = _ref7 => {
4568
3952
  const formatBoolean = _ref8 => {
4569
3953
  let value = _ref8.value,
4570
3954
  intl = _ref8.intl;
4571
- return value ? intl.formatMessage(messages$K.booleanYes) : intl.formatMessage(messages$K.booleanNo);
3955
+ return value ? intl.formatMessage(messages$L.booleanYes) : intl.formatMessage(messages$L.booleanNo);
4572
3956
  };
4573
3957
  const formatNilType = _ref9 => {
4574
3958
  let value = _ref9.value,
@@ -4590,144 +3974,717 @@ const formatUnknown = _ref0 => {
4590
3974
  extra: {
4591
3975
  value
4592
3976
  }
4593
- });
4594
- return fallbackValue;
4595
- };
4596
- const formatNested = _ref1 => {
4597
- let fallbackValue = _ref1.fallbackValue;
4598
- return fallbackValue;
4599
- };
4600
- const formatSet = _ref10 => {
4601
- let type = _ref10.type,
4602
- value = _ref10.value,
4603
- intl = _ref10.intl,
4604
- language = _ref10.language,
4605
- languages = _ref10.languages,
4606
- fallbackValue = _ref10.fallbackValue;
4607
- const formatedElements = _mapInstanceProperty(value).call(value, elementValue => formatAttribute({
4608
- type: type.elementType,
4609
- value: elementValue,
4610
- intl,
4611
- language,
4612
- languages,
4613
- fallbackValue
4614
- }));
4615
- return formatedElements.join(', ');
3977
+ });
3978
+ return fallbackValue;
3979
+ };
3980
+ const formatNested = _ref1 => {
3981
+ let fallbackValue = _ref1.fallbackValue;
3982
+ return fallbackValue;
3983
+ };
3984
+ const formatSet = _ref10 => {
3985
+ let type = _ref10.type,
3986
+ value = _ref10.value,
3987
+ intl = _ref10.intl,
3988
+ language = _ref10.language,
3989
+ languages = _ref10.languages,
3990
+ fallbackValue = _ref10.fallbackValue;
3991
+ const formatedElements = _mapInstanceProperty(value).call(value, elementValue => formatAttribute({
3992
+ type: type.elementType,
3993
+ value: elementValue,
3994
+ intl,
3995
+ language,
3996
+ languages,
3997
+ fallbackValue
3998
+ }));
3999
+ return formatedElements.join(', ');
4000
+ };
4001
+ const doNotFormat = _ref11 => {
4002
+ let value = _ref11.value;
4003
+ return value;
4004
+ };
4005
+ const getFormatter = type => {
4006
+ if (isNil$1(type)) return formatNilType;else if (type.name === 'nested') return formatNested;else if (type.name === 'set') return formatSet;else if (type.name === 'enum') return formatEnum;else if (type.name === 'lenum') return formatLenum;else if (type.name === 'ltext') return formatLtext;else if (type.name === 'money') return formatMoney$1;else if (type.name === 'reference') return formatReference;else if (type.name === 'date') return formatDate;else if (type.name === 'time') return doNotFormat;else if (type.name === 'datetime') return formatDateTime;else if (type.name === 'boolean') return formatBoolean;else if (type.name === 'text') return doNotFormat;else if (type.name === 'number') return doNotFormat;else return formatUnknown;
4007
+ };
4008
+ function formatAttribute(_ref12) {
4009
+ let type = _ref12.type,
4010
+ value = _ref12.value,
4011
+ intl = _ref12.intl,
4012
+ language = _ref12.language,
4013
+ languages = _ref12.languages,
4014
+ userTimeZone = _ref12.userTimeZone,
4015
+ _ref12$fallbackValue = _ref12.fallbackValue,
4016
+ fallbackValue = _ref12$fallbackValue === void 0 ? NO_VALUE_FALLBACK : _ref12$fallbackValue;
4017
+ if (isNil$1(value)) {
4018
+ return fallbackValue;
4019
+ }
4020
+ const formatter = getFormatter(type);
4021
+ return formatter({
4022
+ type,
4023
+ value,
4024
+ intl,
4025
+ language,
4026
+ languages,
4027
+ userTimeZone,
4028
+ fallbackValue
4029
+ });
4030
+ }
4031
+
4032
+ const attributeTypeNames = {
4033
+ Boolean: 'boolean',
4034
+ Date: 'date',
4035
+ DateTime: 'datetime',
4036
+ Enum: 'enum',
4037
+ LocalizedEnum: 'lenum',
4038
+ LocalizedString: 'ltext',
4039
+ Money: 'money',
4040
+ Nested: 'nested',
4041
+ Reference: 'reference',
4042
+ Set: 'set',
4043
+ String: 'text',
4044
+ Time: 'time',
4045
+ Number: 'number'
4046
+ };
4047
+ const convertToAttributeType = customFieldType => {
4048
+ if (isNil$1(customFieldType)) return customFieldType;
4049
+ const attributeTypeName = attributeTypeNames[customFieldType.name];
4050
+ const elementTypeName = attributeTypeNames[customFieldType.elementType?.name];
4051
+ return {
4052
+ name: attributeTypeName,
4053
+ elementType: {
4054
+ name: elementTypeName
4055
+ }
4056
+ };
4057
+ };
4058
+ const inlineEnumValues = (type, value) => {
4059
+ if (isNil$1(type)) return value;
4060
+ if (type.name === 'Set') {
4061
+ return _mapInstanceProperty(value).call(value, setValue => inlineEnumValues(type.elementType, setValue));
4062
+ }
4063
+ if (type.name === 'Enum' || type.name === 'LocalizedEnum') {
4064
+ var _context;
4065
+ return _findInstanceProperty(_context = _valuesInstanceProperty(type)).call(_context, enumValue => enumValue.key === value);
4066
+ }
4067
+ return value;
4068
+ };
4069
+
4070
+ /**
4071
+ * Formats `Custom Fields`: https://docs.commercetools.com/api/projects/custom-fields
4072
+ * Despite having different names, most of `Custom Field` maps one-to-one with an appropriate
4073
+ * `Product Attribute Type`, hence we can reuse product attributes formatting logic.
4074
+ *
4075
+ * The only exception is `Enum` and `LEnum` types. Unlike when dealing with `Product Attribute Types`,
4076
+ * value in `Custom Fields` contains a key of an `Enum` entry, and not an entry itself.
4077
+ * Therefore, before passing value to attributes formatter we need to replace value with Enum entry.
4078
+ */
4079
+ function formatCustomField(_ref) {
4080
+ let type = _ref.type,
4081
+ value = _ref.value,
4082
+ intl = _ref.intl,
4083
+ language = _ref.language,
4084
+ languages = _ref.languages,
4085
+ userTimeZone = _ref.userTimeZone;
4086
+ const attributeType = convertToAttributeType(type);
4087
+ return formatAttribute({
4088
+ type: attributeType,
4089
+ value: inlineEnumValues(type, value),
4090
+ intl,
4091
+ language,
4092
+ languages,
4093
+ userTimeZone
4094
+ });
4095
+ }
4096
+
4097
+ // FIXME: delete once prefix search is supported in ctp api
4098
+
4099
+ // Currently prefix search of products in the ctp is not supported.
4100
+ // This is a temporary hack which should be deleted once the feature is
4101
+ // supported in ctp.
4102
+ // It mimics the prefix search feature by computing lower and upper bounds
4103
+ // related to the provided `input`.
4104
+ // usage:
4105
+ // If I want to do a prefix search of term 'F', I get first the bounds
4106
+ // const [lowerBound, upperBound] = getPrefixSearch('F');
4107
+ // and then use them in the search
4108
+ // e.g
4109
+ // where: `masterData(current(name(en >= "${lowerBound}" and en < "${upperBound}")))`
4110
+ const getPrefixSearchBounds = input => {
4111
+ const getNextCharacter = character => String.fromCharCode(character.charCodeAt() + 1);
4112
+ return [input, `${_sliceInstanceProperty(input).call(input, 0, input.length - 1)}${getNextCharacter(_sliceInstanceProperty(input).call(input, input.length - 1))}`];
4113
+ };
4114
+ var getPrefixSearchBounds$1 = getPrefixSearchBounds;
4115
+
4116
+ const _excluded$d = ["action"];
4117
+ function ownKeys$15(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4118
+ function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var _context0, _context1; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context0 = ownKeys$15(Object(t), !0)).call(_context0, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context1 = ownKeys$15(Object(t))).call(_context1, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
4119
+
4120
+ /**
4121
+ * Checks if a value is a LocalizedString
4122
+ *
4123
+ * { en: 'Hello' } -> true
4124
+ * 'Hello' -> false
4125
+ */
4126
+
4127
+ const getIsLocalizedString = maybeLocalizedString => {
4128
+ if (typeof maybeLocalizedString === 'string') return false;
4129
+ if (!maybeLocalizedString || typeof maybeLocalizedString === 'object' && _Object$keys(maybeLocalizedString).length === 0) return false;
4130
+ return true;
4131
+ };
4132
+
4133
+ /**
4134
+ * Transforms a list of `CustomField` into a `CustomField` object
4135
+ *
4136
+ * [{ name: 'fieldA', value: 'Hello' }] -> { fieldA: 'Hello' }
4137
+ */
4138
+ const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
4139
+ if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
4140
+ return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$15(_objectSpread$15({}, customFields), {}, {
4141
+ [customField.name]: customField.value
4142
+ }), {});
4143
+ };
4144
+
4145
+ // --- Types mapping ---
4146
+
4147
+ /**
4148
+ * Map category GraphQL shape with nameAllLocales to reference shape
4149
+ * Includes ancestors and parent
4150
+ *
4151
+ * @param {Object} category - A category result object from graphql
4152
+ * @return {Object} Category (as a REST API representation):
4153
+ * `{ id, obj: { id, name } }`
4154
+ */
4155
+ function transformLocalizedFieldsForCategory(category) {
4156
+ var _context;
4157
+ let transformationOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [{
4158
+ from: 'nameAllLocales',
4159
+ to: 'name'
4160
+ }];
4161
+ const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
4162
+ const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
4163
+ const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
4164
+ return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, transformedData), parent ? {
4165
+ parent
4166
+ } : {}), ancestors ? {
4167
+ ancestors
4168
+ } : {});
4169
+ }
4170
+ function transformLocalizedFieldsForCartDiscount(cartDiscount) {
4171
+ const transformationOptions = [{
4172
+ from: 'nameAllLocales',
4173
+ to: 'name'
4174
+ }];
4175
+ return applyTransformedLocalizedFields(cartDiscount, transformationOptions);
4176
+ }
4177
+ function mapShippingRateTierToGraphQL(tiers) {
4178
+ return _reduceInstanceProperty(tiers).call(tiers, (graphQlTiers, tier) => [...graphQlTiers, {
4179
+ [tier.type]: {
4180
+ price: tier.price ? {
4181
+ centAmount: tier.price.centAmount,
4182
+ currencyCode: tier.price.currencyCode
4183
+ } : undefined,
4184
+ minimumCentAmount: tier.minimumCentAmount,
4185
+ value: tier.value || undefined,
4186
+ priceFunction: tier.priceFunction ? {
4187
+ function: tier.priceFunction.function,
4188
+ currencyCode: tier.priceFunction.currencyCode
4189
+ } : undefined,
4190
+ score: tier.score
4191
+ }
4192
+ }], []);
4193
+ }
4194
+
4195
+ /**
4196
+ * NOTE:
4197
+ * This module massages update actions produced by the JS SDK
4198
+ * to be compatible with CTP GraphQL mutations. This logic should be
4199
+ * moved into the JS SDK once discounts is fully 100% migrated to
4200
+ * GraphQL or any other plugin/app needs this functionality. Until
4201
+ * then this serves as a collective set of requirements before
4202
+ * prematurely adding a not fully working set of conversions to the
4203
+ * JS SDK.
4204
+ */
4205
+
4206
+ const createAttributeTypeValue = attribute => {
4207
+ switch (attribute.type.name) {
4208
+ case 'set':
4209
+ return {
4210
+ set: {
4211
+ elementType: createAttributeTypeValue({
4212
+ type: attribute.type.elementType
4213
+ })
4214
+ }
4215
+ };
4216
+ case 'boolean':
4217
+ case 'date':
4218
+ case 'datetime':
4219
+ case 'ltext':
4220
+ case 'money':
4221
+ case 'number':
4222
+ case 'text':
4223
+ case 'time':
4224
+ return {
4225
+ [attribute.type.name]: {}
4226
+ };
4227
+ case 'enum':
4228
+ case 'lenum':
4229
+ return {
4230
+ [attribute.type.name]: {
4231
+ values: []
4232
+ }
4233
+ };
4234
+ case 'reference':
4235
+ {
4236
+ return {
4237
+ [attribute.type.name]: {
4238
+ referenceTypeId: attribute.type.referenceTypeId
4239
+ }
4240
+ };
4241
+ }
4242
+ default:
4243
+ return attribute.type;
4244
+ }
4616
4245
  };
4617
- const doNotFormat = _ref11 => {
4618
- let value = _ref11.value;
4619
- return value;
4246
+
4247
+ /*
4248
+ * Fixed price supports high precision. Action format is nested with the
4249
+ * the type of the money. Absolute discount only works with cent precision,
4250
+ * hence the action structure is flat.
4251
+ */
4252
+ const formatMoney = valueType => money => {
4253
+ switch (valueType) {
4254
+ case 'fixed':
4255
+ case 'fixedCart':
4256
+ return {
4257
+ [money.type]: _objectSpread$15({
4258
+ centAmount: money.centAmount,
4259
+ currencyCode: money.currencyCode
4260
+ }, money.type === PRECISION_TYPES.highPrecision && {
4261
+ preciseAmount: money.preciseAmount,
4262
+ fractionDigits: money.fractionDigits
4263
+ })
4264
+ };
4265
+ case 'absolute':
4266
+ case 'absoluteCart':
4267
+ return {
4268
+ centAmount: money.centAmount,
4269
+ currencyCode: money.currencyCode
4270
+ };
4271
+ default:
4272
+ throw new Error('Unexpected value type for money.');
4273
+ }
4620
4274
  };
4621
- const getFormatter = type => {
4622
- if (isNil$1(type)) return formatNilType;else if (type.name === 'nested') return formatNested;else if (type.name === 'set') return formatSet;else if (type.name === 'enum') return formatEnum;else if (type.name === 'lenum') return formatLenum;else if (type.name === 'ltext') return formatLtext;else if (type.name === 'money') return formatMoney;else if (type.name === 'reference') return formatReference;else if (type.name === 'date') return formatDate;else if (type.name === 'time') return doNotFormat;else if (type.name === 'datetime') return formatDateTime;else if (type.name === 'boolean') return formatBoolean;else if (type.name === 'text') return doNotFormat;else if (type.name === 'number') return doNotFormat;else return formatUnknown;
4275
+
4276
+ /**
4277
+ * converts the `changeValue` action to GraphQL actions variable
4278
+ * @param {Object} actionPayload
4279
+ */
4280
+ const convertChangeValueAction = actionPayload => {
4281
+ const valueType = actionPayload.value.type;
4282
+ const possibleTypeKeys = {
4283
+ relative: ['permyriad'],
4284
+ absolute: ['money'],
4285
+ absoluteCart: ['money', 'applicationMode'],
4286
+ fixed: ['money'],
4287
+ fixedCart: ['money', 'applicationMode'],
4288
+ giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
4289
+ };
4290
+ const filteredValue = pick(actionPayload.value, possibleTypeKeys[valueType]);
4291
+ if (filteredValue.money) {
4292
+ var _context2;
4293
+ const moneyFormatter = formatMoney(valueType);
4294
+ filteredValue.money = _mapInstanceProperty(_context2 = filteredValue.money).call(_context2, moneyFormatter);
4295
+ }
4296
+ return {
4297
+ changeValue: {
4298
+ value: {
4299
+ [valueType]: filteredValue
4300
+ }
4301
+ }
4302
+ };
4623
4303
  };
4624
- function formatAttribute(_ref12) {
4625
- let type = _ref12.type,
4626
- value = _ref12.value,
4627
- intl = _ref12.intl,
4628
- language = _ref12.language,
4629
- languages = _ref12.languages,
4630
- userTimeZone = _ref12.userTimeZone,
4631
- _ref12$fallbackValue = _ref12.fallbackValue,
4632
- fallbackValue = _ref12$fallbackValue === void 0 ? NO_VALUE_FALLBACK : _ref12$fallbackValue;
4633
- if (isNil$1(value)) {
4634
- return fallbackValue;
4304
+
4305
+ /**
4306
+ * This function changes any payload after the actions have been computed.
4307
+ * Currently we only need to change the `setCustomField` action payload
4308
+ * as its dynamic content can not be typed in SDL for the mutation.
4309
+ */
4310
+ const convertAction = (actionName, actionPayload) => {
4311
+ var _context3, _context4, _context5, _context6, _context7;
4312
+ const getNameFromPayload = payload => {
4313
+ // changeName for `Organizations`
4314
+ if (typeof payload.name === 'string') return payload;
4315
+ // changeName for `UserProfile`
4316
+ if (payload.firstName || payload.lastName) return payload;
4317
+ // assume `changeName` for LocalizedString type
4318
+ return {
4319
+ name: transformLocalizedStringToLocalizedField(payload.name)
4320
+ };
4321
+ };
4322
+ switch (actionName) {
4323
+ case 'changeName':
4324
+ return {
4325
+ [actionName]: getNameFromPayload(actionPayload)
4326
+ };
4327
+ case 'setDescription':
4328
+ case 'changeDescription':
4329
+ return {
4330
+ [actionName]: {
4331
+ description: getIsLocalizedString(actionPayload.description) ? transformLocalizedStringToLocalizedField(actionPayload.description) : actionPayload.description
4332
+ }
4333
+ };
4334
+ case 'setLocalizedDescription':
4335
+ return {
4336
+ [actionName]: {
4337
+ localizedDescription: transformLocalizedStringToLocalizedField(actionPayload.localizedDescription)
4338
+ }
4339
+ };
4340
+ case 'setName':
4341
+ return {
4342
+ [actionName]: getNameFromPayload(actionPayload)
4343
+ };
4344
+ case 'setLocalizedName':
4345
+ return {
4346
+ [actionName]: {
4347
+ localizedName: transformLocalizedStringToLocalizedField(actionPayload.localizedName)
4348
+ }
4349
+ };
4350
+ case 'setSlug':
4351
+ return {
4352
+ [actionName]: {
4353
+ slug: transformLocalizedStringToLocalizedField(actionPayload.slug)
4354
+ }
4355
+ };
4356
+ case 'setLineItemCustomField':
4357
+ return {
4358
+ [actionName]: {
4359
+ lineItemId: actionPayload.lineItemId,
4360
+ name: actionPayload.name,
4361
+ value: _JSON$stringify(actionPayload.value)
4362
+ }
4363
+ };
4364
+ case 'setCustomLineItemCustomField':
4365
+ return {
4366
+ [actionName]: {
4367
+ customLineItemId: actionPayload.customLineItemId,
4368
+ name: actionPayload.name,
4369
+ value: _JSON$stringify(actionPayload.value)
4370
+ }
4371
+ };
4372
+ case 'setCustomField':
4373
+ return {
4374
+ [actionName]: {
4375
+ name: actionPayload.name,
4376
+ value: _JSON$stringify(actionPayload.value)
4377
+ }
4378
+ };
4379
+ case 'setCustomType':
4380
+ return {
4381
+ [actionName]: {
4382
+ typeId: actionPayload.type?.id,
4383
+ fields: actionPayload.fields ? _mapInstanceProperty(_context3 = _Object$entries(actionPayload.fields)).call(_context3, _ref => {
4384
+ let _ref2 = _slicedToArray(_ref, 2),
4385
+ customField = _ref2[0],
4386
+ value = _ref2[1];
4387
+ return {
4388
+ name: customField,
4389
+ value: _JSON$stringify(value)
4390
+ };
4391
+ }) : undefined
4392
+ }
4393
+ };
4394
+ case 'removeLocation':
4395
+ return {
4396
+ [actionName]: {
4397
+ location: {
4398
+ country: actionPayload.location.country
4399
+ }
4400
+ }
4401
+ };
4402
+ case 'addLocation':
4403
+ return {
4404
+ [actionName]: {
4405
+ location: {
4406
+ country: actionPayload.location.country
4407
+ }
4408
+ }
4409
+ };
4410
+ case 'setGeoLocation':
4411
+ return {
4412
+ [actionName]: actionPayload?.geoLocation ? {
4413
+ geoLocation: {
4414
+ type: 'Point',
4415
+ coordinates: [_parseFloat(actionPayload.geoLocation?.longitude), _parseFloat(actionPayload.geoLocation?.latitude)]
4416
+ }
4417
+ } : {
4418
+ undefined
4419
+ }
4420
+ };
4421
+ case 'changeLabel':
4422
+ return {
4423
+ changeLabel: {
4424
+ attributeName: actionPayload.attributeName,
4425
+ label: transformLocalizedStringToLocalizedField(actionPayload.label)
4426
+ }
4427
+ };
4428
+ case 'setInputTip':
4429
+ return {
4430
+ setInputTip: {
4431
+ attributeName: actionPayload.attributeName,
4432
+ inputTip: transformLocalizedStringToLocalizedField(actionPayload.inputTip)
4433
+ }
4434
+ };
4435
+ case 'addAttributeDefinition':
4436
+ return {
4437
+ [actionName]: {
4438
+ attributeDefinition: _objectSpread$15(_objectSpread$15({}, actionPayload.attribute), {}, {
4439
+ label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
4440
+ inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
4441
+ type: createAttributeTypeValue(actionPayload.attribute)
4442
+ })
4443
+ }
4444
+ };
4445
+ case 'replaceTaxRate':
4446
+ return {
4447
+ [actionName]: {
4448
+ taxRate: {
4449
+ name: actionPayload.taxRate.name,
4450
+ country: actionPayload.taxRate.country,
4451
+ includedInPrice: actionPayload.taxRate.includedInPrice,
4452
+ amount: actionPayload.taxRate.amount,
4453
+ state: actionPayload.taxRate.state,
4454
+ key: actionPayload.taxRate.key,
4455
+ subRates: actionPayload.taxRate.subRates
4456
+ },
4457
+ taxRateId: actionPayload.taxRateId
4458
+ }
4459
+ };
4460
+ case 'addZone':
4461
+ return {
4462
+ [actionName]: {
4463
+ zone: {
4464
+ id: actionPayload.zone.id,
4465
+ typeId: actionPayload.zone.typeId
4466
+ }
4467
+ }
4468
+ };
4469
+ case 'removeZone':
4470
+ return {
4471
+ [actionName]: {
4472
+ zone: {
4473
+ id: actionPayload.zone.id,
4474
+ typeId: actionPayload.zone.typeId
4475
+ }
4476
+ }
4477
+ };
4478
+ case 'changeTaxCategory':
4479
+ return {
4480
+ [actionName]: {
4481
+ taxCategory: {
4482
+ id: actionPayload.taxCategory.id,
4483
+ typeId: actionPayload.taxCategory.typeId
4484
+ }
4485
+ }
4486
+ };
4487
+ case 'addShippingRate':
4488
+ return {
4489
+ [actionName]: {
4490
+ zone: {
4491
+ id: actionPayload.zone.id,
4492
+ typeId: actionPayload.zone.typeId
4493
+ },
4494
+ shippingRate: {
4495
+ price: {
4496
+ centAmount: actionPayload.shippingRate.price.centAmount,
4497
+ currencyCode: actionPayload.shippingRate.price.currencyCode
4498
+ },
4499
+ freeAbove: actionPayload.shippingRate.freeAbove ? {
4500
+ centAmount: actionPayload.shippingRate.freeAbove.centAmount,
4501
+ currencyCode: actionPayload.shippingRate.freeAbove.currencyCode
4502
+ } : undefined,
4503
+ tiers: actionPayload.shippingRate.tiers ? mapShippingRateTierToGraphQL(actionPayload.shippingRate.tiers) : undefined
4504
+ }
4505
+ }
4506
+ };
4507
+ case 'removeShippingRate':
4508
+ return {
4509
+ [actionName]: {
4510
+ zone: {
4511
+ id: actionPayload.zone.id,
4512
+ typeId: actionPayload.zone.typeId
4513
+ },
4514
+ shippingRate: {
4515
+ price: {
4516
+ centAmount: actionPayload.shippingRate.price.centAmount,
4517
+ currencyCode: actionPayload.shippingRate.price.currencyCode
4518
+ },
4519
+ freeAbove: actionPayload.shippingRate.freeAbove ? {
4520
+ centAmount: actionPayload.shippingRate.freeAbove.centAmount,
4521
+ currencyCode: actionPayload.shippingRate.freeAbove.currencyCode
4522
+ } : undefined,
4523
+ tiers: actionPayload.shippingRate.tiers ? mapShippingRateTierToGraphQL(actionPayload.shippingRate.tiers) : undefined
4524
+ }
4525
+ }
4526
+ };
4527
+ case 'changeValue':
4528
+ return convertChangeValueAction(actionPayload);
4529
+ // product-types -> attributes -> enum
4530
+ case 'addLocalizedEnumValue':
4531
+ return {
4532
+ [actionName]: {
4533
+ attributeName: actionPayload.attributeName,
4534
+ value: _objectSpread$15(_objectSpread$15({}, actionPayload.value), {}, {
4535
+ label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
4536
+ })
4537
+ }
4538
+ };
4539
+ case 'changeLocalizedEnumValueLabel':
4540
+ return {
4541
+ [actionName]: {
4542
+ attributeName: actionPayload.attributeName,
4543
+ newValue: _objectSpread$15(_objectSpread$15({}, actionPayload.newValue), {}, {
4544
+ label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
4545
+ })
4546
+ }
4547
+ };
4548
+ case 'setShippingRateInputType':
4549
+ return {
4550
+ [actionName]: {
4551
+ shippingRateInputType: actionPayload.shippingRateInputType?.type ? {
4552
+ [actionPayload.shippingRateInputType.type]: {
4553
+ values: actionPayload.shippingRateInputType.type === 'CartClassification' ? _mapInstanceProperty(_context4 = _valuesInstanceProperty(actionPayload.shippingRateInputType)).call(_context4, value => ({
4554
+ key: value.key,
4555
+ label: value.allLocaleLabels
4556
+ })) : undefined
4557
+ }
4558
+ } : undefined
4559
+ }
4560
+ };
4561
+ case 'addCustomLineItem':
4562
+ {
4563
+ return {
4564
+ [actionName]: {
4565
+ slug: actionPayload.slug,
4566
+ quantity: actionPayload.quantity,
4567
+ name: transformLocalizedStringToLocalizedField(actionPayload.name),
4568
+ taxCategory: actionPayload.taxCategory,
4569
+ money: {
4570
+ [actionPayload.money.type]: _objectSpread$15({
4571
+ centAmount: actionPayload.money.centAmount,
4572
+ currencyCode: actionPayload.money.currencyCode
4573
+ }, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
4574
+ preciseAmount: actionPayload.money.preciseAmount,
4575
+ fractionDigits: actionPayload.money.fractionDigits
4576
+ })
4577
+ }
4578
+ }
4579
+ };
4580
+ }
4581
+ case 'setDataFences':
4582
+ return {
4583
+ [actionName]: {
4584
+ dataFences: _reduceInstanceProperty(_context5 = actionPayload.dataFences).call(_context5, (nextDataFences, dataFence) => {
4585
+ if (dataFence.type.toLowerCase() === 'store') return [...nextDataFences, {
4586
+ [dataFence.type.toLowerCase()]: {
4587
+ storeKeys: dataFence.storeKeys
4588
+ }
4589
+ }];
4590
+ return nextDataFences;
4591
+ }, [])
4592
+ }
4593
+ };
4594
+ case 'changeTarget':
4595
+ return {
4596
+ [actionName]: {
4597
+ target: {
4598
+ [actionPayload.target.type]: _objectSpread$15(_objectSpread$15(_objectSpread$15({}, omit(actionPayload.target, ['type', '__typename'])), actionPayload.target.triggerPattern && {
4599
+ triggerPattern: _mapInstanceProperty(_context6 = actionPayload.target.triggerPattern).call(_context6, pattern => ({
4600
+ [pattern.type]: omit(pattern, ['type', '__typename'])
4601
+ }))
4602
+ }), actionPayload.target.targetPattern && {
4603
+ targetPattern: _mapInstanceProperty(_context7 = actionPayload.target.targetPattern).call(_context7, pattern => ({
4604
+ [pattern.type]: omit(pattern, ['type', '__typename'])
4605
+ }))
4606
+ })
4607
+ }
4608
+ }
4609
+ };
4610
+ case 'addAddress':
4611
+ case 'changeAddress':
4612
+ {
4613
+ var _context8;
4614
+ const _ref3 = actionPayload.address?.custom || {},
4615
+ _ref3$fields = _ref3.fields,
4616
+ fields = _ref3$fields === void 0 ? {} : _ref3$fields;
4617
+ const customFields = isEmpty$3(fields) ? null : _mapInstanceProperty(_context8 = _Object$entries(fields)).call(_context8, _ref4 => {
4618
+ let _ref5 = _slicedToArray(_ref4, 2),
4619
+ name = _ref5[0],
4620
+ value = _ref5[1];
4621
+ return {
4622
+ name,
4623
+ value: _JSON$stringify(value)
4624
+ };
4625
+ });
4626
+ const custom = actionPayload.address?.custom?.type?.id ? {
4627
+ type: {
4628
+ id: actionPayload.address.custom.type.id
4629
+ },
4630
+ fields: customFields
4631
+ } : null;
4632
+ return {
4633
+ [actionName]: _objectSpread$15(_objectSpread$15({}, actionPayload), {}, {
4634
+ address: _objectSpread$15(_objectSpread$15({}, omit(actionPayload.address, ['__typename'])), {}, {
4635
+ custom
4636
+ })
4637
+ })
4638
+ };
4639
+ }
4640
+ case 'setAddressCustomType':
4641
+ {
4642
+ var _context9;
4643
+ const _ref6 = actionPayload || {},
4644
+ addressId = _ref6.addressId,
4645
+ _ref6$fields = _ref6.fields,
4646
+ fields = _ref6$fields === void 0 ? {} : _ref6$fields,
4647
+ type = _ref6.type;
4648
+ const customFields = isEmpty$3(fields) ? null : _mapInstanceProperty(_context9 = _Object$entries(fields)).call(_context9, _ref7 => {
4649
+ let _ref8 = _slicedToArray(_ref7, 2),
4650
+ name = _ref8[0],
4651
+ value = _ref8[1];
4652
+ return {
4653
+ name,
4654
+ value: _JSON$stringify(value)
4655
+ };
4656
+ });
4657
+ const customType = type?.id ? {
4658
+ id: type.id
4659
+ } : null;
4660
+ return {
4661
+ [actionName]: {
4662
+ addressId,
4663
+ fields: customFields,
4664
+ type: customType
4665
+ }
4666
+ };
4667
+ }
4668
+ default:
4669
+ return {
4670
+ [actionName]: actionPayload
4671
+ };
4635
4672
  }
4636
- const formatter = getFormatter(type);
4637
- return formatter({
4638
- type,
4639
- value,
4640
- intl,
4641
- language,
4642
- languages,
4643
- userTimeZone,
4644
- fallbackValue
4645
- });
4646
- }
4647
-
4648
- const attributeTypeNames = {
4649
- Boolean: 'boolean',
4650
- Date: 'date',
4651
- DateTime: 'datetime',
4652
- Enum: 'enum',
4653
- LocalizedEnum: 'lenum',
4654
- LocalizedString: 'ltext',
4655
- Money: 'money',
4656
- Nested: 'nested',
4657
- Reference: 'reference',
4658
- Set: 'set',
4659
- String: 'text',
4660
- Time: 'time',
4661
- Number: 'number'
4662
- };
4663
- const convertToAttributeType = customFieldType => {
4664
- if (isNil$1(customFieldType)) return customFieldType;
4665
- const attributeTypeName = attributeTypeNames[customFieldType.name];
4666
- const elementTypeName = attributeTypeNames[customFieldType.elementType?.name];
4667
- return {
4668
- name: attributeTypeName,
4669
- elementType: {
4670
- name: elementTypeName
4671
- }
4672
- };
4673
4673
  };
4674
- const inlineEnumValues = (type, value) => {
4675
- if (isNil$1(type)) return value;
4676
- if (type.name === 'Set') {
4677
- return _mapInstanceProperty(value).call(value, setValue => inlineEnumValues(type.elementType, setValue));
4674
+ const createGraphQlUpdateActions = actions => _reduceInstanceProperty(actions).call(actions, (previousActions, _ref9) => {
4675
+ let actionName = _ref9.action,
4676
+ actionPayload = _objectWithoutProperties(_ref9, _excluded$d);
4677
+ return [...previousActions, convertAction(actionName, actionPayload)];
4678
+ }, []);
4679
+ const extractErrorFromGraphQlResponse = graphQlResponse => {
4680
+ if (graphQlResponse.networkError?.result?.errors?.length > 0) {
4681
+ return graphQlResponse.networkError.result.errors;
4678
4682
  }
4679
- if (type.name === 'Enum' || type.name === 'LocalizedEnum') {
4680
- var _context;
4681
- return _findInstanceProperty(_context = _valuesInstanceProperty(type)).call(_context, enumValue => enumValue.key === value);
4683
+ if (graphQlResponse.graphQLErrors?.length > 0) {
4684
+ return graphQlResponse.graphQLErrors;
4682
4685
  }
4683
- return value;
4684
- };
4685
-
4686
- /**
4687
- * Formats `Custom Fields`: https://docs.commercetools.com/api/projects/custom-fields
4688
- * Despite having different names, most of `Custom Field` maps one-to-one with an appropriate
4689
- * `Product Attribute Type`, hence we can reuse product attributes formatting logic.
4690
- *
4691
- * The only exception is `Enum` and `LEnum` types. Unlike when dealing with `Product Attribute Types`,
4692
- * value in `Custom Fields` contains a key of an `Enum` entry, and not an entry itself.
4693
- * Therefore, before passing value to attributes formatter we need to replace value with Enum entry.
4694
- */
4695
- function formatCustomField(_ref) {
4696
- let type = _ref.type,
4697
- value = _ref.value,
4698
- intl = _ref.intl,
4699
- language = _ref.language,
4700
- languages = _ref.languages,
4701
- userTimeZone = _ref.userTimeZone;
4702
- const attributeType = convertToAttributeType(type);
4703
- return formatAttribute({
4704
- type: attributeType,
4705
- value: inlineEnumValues(type, value),
4706
- intl,
4707
- language,
4708
- languages,
4709
- userTimeZone
4710
- });
4711
- }
4712
-
4713
- // FIXME: delete once prefix search is supported in ctp api
4714
-
4715
- // Currently prefix search of products in the ctp is not supported.
4716
- // This is a temporary hack which should be deleted once the feature is
4717
- // supported in ctp.
4718
- // It mimics the prefix search feature by computing lower and upper bounds
4719
- // related to the provided `input`.
4720
- // usage:
4721
- // If I want to do a prefix search of term 'F', I get first the bounds
4722
- // const [lowerBound, upperBound] = getPrefixSearch('F');
4723
- // and then use them in the search
4724
- // e.g
4725
- // where: `masterData(current(name(en >= "${lowerBound}" and en < "${upperBound}")))`
4726
- const getPrefixSearchBounds = input => {
4727
- const getNextCharacter = character => String.fromCharCode(character.charCodeAt() + 1);
4728
- return [input, `${_sliceInstanceProperty(input).call(input, 0, input.length - 1)}${getNextCharacter(_sliceInstanceProperty(input).call(input, input.length - 1))}`];
4686
+ return graphQlResponse;
4729
4687
  };
4730
- var getPrefixSearchBounds$1 = getPrefixSearchBounds;
4731
4688
 
4732
4689
  const isUUID = string => /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/.test(string);
4733
4690
  var isUUID$1 = isUUID;
@@ -5127,7 +5084,7 @@ function uniqueObjects(items) {
5127
5084
 
5128
5085
  */
5129
5086
 
5130
- const messages$J = defineMessages({
5087
+ const messages$K = defineMessages({
5131
5088
  unique: {
5132
5089
  id: 'Validation.unique',
5133
5090
  description: 'An error message to show if the field must be unique',
@@ -5169,7 +5126,7 @@ const messages$J = defineMessages({
5169
5126
  defaultMessage: 'Invalid ID format. Please enter a valid ID.'
5170
5127
  }
5171
5128
  });
5172
- var validationMessages = messages$J;
5129
+ var validationMessages = messages$K;
5173
5130
 
5174
5131
  function getIndexesOfInvalidValues(values) {
5175
5132
  let invalidValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
@@ -5428,7 +5385,7 @@ function ReferenceSearch(props) {
5428
5385
  });
5429
5386
  }
5430
5387
 
5431
- const messages$H = defineMessages({
5388
+ const messages$I = defineMessages({
5432
5389
  placeholder: {
5433
5390
  id: 'CartDiscountReferenceSearch.placeholder',
5434
5391
  description: 'Placeholder for search for a cart discount',
@@ -5455,7 +5412,7 @@ const messages$H = defineMessages({
5455
5412
  defaultMessage: 'Enter search term'
5456
5413
  }
5457
5414
  });
5458
- var messages$I = messages$H;
5415
+ var messages$J = messages$I;
5459
5416
 
5460
5417
  function ownKeys$11(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5461
5418
  function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$11(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$11(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -5480,7 +5437,7 @@ function Option$1(props) {
5480
5437
  fallbackOrder: languages
5481
5438
  })
5482
5439
  }), jsxs(Text.Detail, {
5483
- children: [formatMessage(messages$I.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
5440
+ children: [formatMessage(messages$J.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
5484
5441
  })]
5485
5442
  })
5486
5443
  }));
@@ -5556,10 +5513,10 @@ function CartDiscountReferenceSearch(props) {
5556
5513
  onBlur: props.onBlur,
5557
5514
  onChange: props.onChange,
5558
5515
  value: returnNullIfEmpty(props.value),
5559
- placeholderLabel: formatMessage(messages$I.placeholder),
5560
- searchPromptLabel: formatMessage(messages$I.searchPrompt),
5561
- noResultsLabel: formatMessage(messages$I.noResults),
5562
- referenceIsMissingLabel: formatMessage(messages$I.isMissing),
5516
+ placeholderLabel: formatMessage(messages$J.placeholder),
5517
+ searchPromptLabel: formatMessage(messages$J.searchPrompt),
5518
+ noResultsLabel: formatMessage(messages$J.noResults),
5519
+ referenceIsMissingLabel: formatMessage(messages$J.isMissing),
5563
5520
  mapItemToOption: mapItemToOption,
5564
5521
  loadItemsBySearchTerm: loadItemsBySearchTerm,
5565
5522
  loadItemsByIds: loadItemsByIds,
@@ -5569,7 +5526,7 @@ function CartDiscountReferenceSearch(props) {
5569
5526
  });
5570
5527
  }
5571
5528
 
5572
- const messages$F = defineMessages({
5529
+ const messages$G = defineMessages({
5573
5530
  placeholder: {
5574
5531
  id: 'CategoryReferenceSearch.placeholder',
5575
5532
  description: 'Placeholder for search for a category',
@@ -5601,7 +5558,7 @@ const messages$F = defineMessages({
5601
5558
  defaultMessage: 'Parent Category'
5602
5559
  }
5603
5560
  });
5604
- var messages$G = messages$F;
5561
+ var messages$H = messages$G;
5605
5562
 
5606
5563
  function ownKeys$$(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5607
5564
  function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$$(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$$(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -5626,7 +5583,7 @@ function Option(props) {
5626
5583
  fallbackOrder: languages
5627
5584
  })
5628
5585
  }), category.parent && jsx(Text.Detail, {
5629
- children: `${formatMessage(messages$G.parentCategory)}: ${formatLocalizedString(category.parent, {
5586
+ children: `${formatMessage(messages$H.parentCategory)}: ${formatLocalizedString(category.parent, {
5630
5587
  key: 'name',
5631
5588
  locale: language,
5632
5589
  fallbackOrder: languages
@@ -5638,7 +5595,7 @@ function Option(props) {
5638
5595
  fallbackOrder: languages
5639
5596
  })}`
5640
5597
  }), category.externalId && jsx(Text.Detail, {
5641
- children: `${formatMessage(messages$G.externalId)}: ${category.externalId || NO_VALUE_FALLBACK}`
5598
+ children: `${formatMessage(messages$H.externalId)}: ${category.externalId || NO_VALUE_FALLBACK}`
5642
5599
  })]
5643
5600
  })
5644
5601
  }));
@@ -5686,10 +5643,10 @@ function CategoryReferenceSearch(props) {
5686
5643
  onBlur: props.onBlur,
5687
5644
  onChange: props.onChange,
5688
5645
  value: props.value,
5689
- placeholderLabel: formatMessage(messages$G.placeholder),
5690
- searchPromptLabel: formatMessage(messages$G.searchPrompt),
5691
- noResultsLabel: formatMessage(messages$G.noResults),
5692
- referenceIsMissingLabel: formatMessage(messages$G.isMissing),
5646
+ placeholderLabel: formatMessage(messages$H.placeholder),
5647
+ searchPromptLabel: formatMessage(messages$H.searchPrompt),
5648
+ noResultsLabel: formatMessage(messages$H.noResults),
5649
+ referenceIsMissingLabel: formatMessage(messages$H.isMissing),
5693
5650
  mapItemToOption: mapItemToOption,
5694
5651
  loadItemsBySearchTerm: loadItemsBySearchTerm,
5695
5652
  loadItemsByIds: loadItemsByIds,
@@ -5766,7 +5723,7 @@ const Button = _ref => {
5766
5723
  Button.displayName = 'Button';
5767
5724
  var Button$1 = Button;
5768
5725
 
5769
- var messages$E = defineMessages({
5726
+ var messages$F = defineMessages({
5770
5727
  chooseFile: {
5771
5728
  id: 'ButtonFileInput.chooseFile',
5772
5729
  description: 'The label text of the field for upload local file',
@@ -5783,7 +5740,7 @@ var styles$f = {
5783
5740
  };
5784
5741
  const FileInput = _ref => {
5785
5742
  let _ref$children = _ref.children,
5786
- children = _ref$children === void 0 ? jsx(FormattedMessage, _objectSpread$Y({}, messages$E.chooseFile)) : _ref$children,
5743
+ children = _ref$children === void 0 ? jsx(FormattedMessage, _objectSpread$Y({}, messages$F.chooseFile)) : _ref$children,
5787
5744
  _ref$allowMultiple = _ref.allowMultiple,
5788
5745
  allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
5789
5746
  _ref$acceptTypes = _ref.acceptTypes,
@@ -5806,7 +5763,7 @@ const FileInput = _ref => {
5806
5763
  FileInput.displayName = 'FileInput';
5807
5764
  var FileInput$1 = FileInput;
5808
5765
 
5809
- var messages$D = defineMessages({
5766
+ var messages$E = defineMessages({
5810
5767
  countriesBasicSelectPlaceholder: {
5811
5768
  id: 'CountriesPicker.countriesBasicSelectPlaceholder',
5812
5769
  description: 'Placeholder of the basic field for countries',
@@ -5827,7 +5784,7 @@ var messages$D = defineMessages({
5827
5784
  function ownKeys$X(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5828
5785
  function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context8 = ownKeys$X(Object(t), !0)).call(_context8, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context9 = ownKeys$X(Object(t))).call(_context9, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
5829
5786
  const emptyCountryOption = intl => [{
5830
- label: intl.formatMessage(messages$D.countriesAsyncSelectDropdownTypeAheadPrompt),
5787
+ label: intl.formatMessage(messages$E.countriesAsyncSelectDropdownTypeAheadPrompt),
5831
5788
  value: undefined,
5832
5789
  isDisabled: true
5833
5790
  }];
@@ -5870,7 +5827,7 @@ function CountriesAsyncSelectDropdown(props) {
5870
5827
  var _context7;
5871
5828
  return _findInstanceProperty(_context7 = props.options).call(_context7, country => country.value === countryCode);
5872
5829
  }),
5873
- placeholder: intl.formatMessage(messages$D.countriesAsyncSelectPlaceholder),
5830
+ placeholder: intl.formatMessage(messages$E.countriesAsyncSelectPlaceholder),
5874
5831
  loadOptions: handleLoadOptions,
5875
5832
  onChange: onOptionChange,
5876
5833
  isDisabled: props.isDisabled,
@@ -5890,7 +5847,7 @@ function CountriesBasicSelectDropdown(props) {
5890
5847
  value: props.value,
5891
5848
  isRequired: props.isRequired,
5892
5849
  description: props.description,
5893
- placeholder: intl.formatMessage(messages$D.countriesBasicSelectPlaceholder),
5850
+ placeholder: intl.formatMessage(messages$E.countriesBasicSelectPlaceholder),
5894
5851
  options: props.options,
5895
5852
  onChange: props.onChange,
5896
5853
  isDisabled: props.isDisabled,
@@ -5926,7 +5883,7 @@ function CountriesPicker(_ref) {
5926
5883
  });
5927
5884
  }
5928
5885
 
5929
- var messages$C = defineMessages({
5886
+ var messages$D = defineMessages({
5930
5887
  noCustomerGroupsFound: {
5931
5888
  id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
5932
5889
  description: 'The message to display when no customer groups were found',
@@ -6016,7 +5973,7 @@ const CustomerGroupPickerInput = _ref => {
6016
5973
  if (isCurrentOptionLoadingFailed) onError(currentOption.error);
6017
5974
  }, [isCurrentOptionLoadingFailed, onError, currentOption]);
6018
5975
  const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
6019
- const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$C.noCustomerGroupsFound), [loadingError, formatMessage]);
5976
+ const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$D.noCustomerGroupsFound), [loadingError, formatMessage]);
6020
5977
  const tooltipTitle = currentOption?.data?.label ?? '';
6021
5978
  return jsx(Constraints.Horizontal, {
6022
5979
  max: "scale",
@@ -6027,7 +5984,7 @@ const CustomerGroupPickerInput = _ref => {
6027
5984
  children: jsx(AsyncSelectInput, {
6028
5985
  id: name,
6029
5986
  name: name,
6030
- placeholder: placeholder ?? formatMessage(messages$C.placeholder),
5987
+ placeholder: placeholder ?? formatMessage(messages$D.placeholder),
6031
5988
  loadOptions: loadOptionsDebounced,
6032
5989
  defaultOptions: true,
6033
5990
  showOptionGroupDivider: true,
@@ -6046,7 +6003,7 @@ const CustomerGroupPickerInput = _ref => {
6046
6003
  })
6047
6004
  }), isLoadingFailed && jsx(Text.Body, {
6048
6005
  tone: "negative",
6049
- intlMessage: pickerMessages$1.loadingErrorMessage
6006
+ intlMessage: commonPickerMessages.loadingErrorMessage
6050
6007
  })]
6051
6008
  })
6052
6009
  });
@@ -6062,7 +6019,8 @@ var styles$e = {
6062
6019
  "divider-dashed": "divider-module__divider-dashed___2Em8A divider-module__divider___4-vdy"
6063
6020
  };
6064
6021
  function Divider(_ref) {
6065
- let isDashed = _ref.isDashed,
6022
+ let _ref$isDashed = _ref.isDashed,
6023
+ isDashed = _ref$isDashed === void 0 ? false : _ref$isDashed,
6066
6024
  _ref$orientation = _ref.orientation,
6067
6025
  orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
6068
6026
  return jsx("hr", {
@@ -6133,12 +6091,13 @@ const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(error
6133
6091
  const CustomFieldErrors = props => {
6134
6092
  // We want to highlight fields with errors not only after a form submission,
6135
6093
  // but also after manually triggered form validation.
6136
- const didFormValidationFail = useDidFormValidationFail();
6094
+ const _useFormikContext = useFormikContext(),
6095
+ isFormValid = _useFormikContext.isValid;
6137
6096
  const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
6138
6097
  return jsxs(Fragment, {
6139
- children: [props.isTouched || didFormValidationFail && errors?.missing && jsx(ErrorMessage, {
6098
+ children: [props.isTouched || !isFormValid && errors?.missing && jsx(ErrorMessage, {
6140
6099
  intlMessage: validationMessages.required
6141
- }), props.isTouched || didFormValidationFail && errors?.duplicated && jsx(ErrorMessage, {
6100
+ }), props.isTouched || !isFormValid && errors?.duplicated && jsx(ErrorMessage, {
6142
6101
  intlMessage: validationMessages.unique
6143
6102
  })]
6144
6103
  });
@@ -6163,7 +6122,7 @@ const makeChangeHandler = setValue => event => {
6163
6122
  // attributes.
6164
6123
  const omitUnknownValues = (valuesAsMap, fieldDefinitionsAsMap) => omitBy(valuesAsMap, (value, key) => isNil$1(fieldDefinitionsAsMap[key]));
6165
6124
 
6166
- var messages$B = defineMessages({
6125
+ var messages$C = defineMessages({
6167
6126
  booleanSetInputYesLabel: {
6168
6127
  id: 'CustomBooleanInputSet.booleanSetInputYesLabel',
6169
6128
  description: 'Custom boolean input set Yes label',
@@ -6205,13 +6164,13 @@ function CustomBooleanInputSet(props) {
6205
6164
  formatMessage = _useIntl.formatMessage;
6206
6165
  const options = useMemo(() => [{
6207
6166
  value: 'true',
6208
- label: formatMessage(messages$B.booleanSetInputYesLabel)
6167
+ label: formatMessage(messages$C.booleanSetInputYesLabel)
6209
6168
  }, {
6210
6169
  value: 'false',
6211
- label: formatMessage(messages$B.booleanSetInputNoLabel)
6170
+ label: formatMessage(messages$C.booleanSetInputNoLabel)
6212
6171
  }, {
6213
6172
  value: 'all',
6214
- label: formatMessage(messages$B.booleanSetInputAllLabel)
6173
+ label: formatMessage(messages$C.booleanSetInputAllLabel)
6215
6174
  }], [formatMessage]);
6216
6175
  const handleChange = makeChangeHandler(rawValue => {
6217
6176
  const nullifiedIfNeeded = !rawValue ? undefined : valueToBooleanSet(rawValue);
@@ -6795,7 +6754,7 @@ const NestingLevelContext = /*#__PURE__*/createContext(0);
6795
6754
  var NestingLevelContext$1 = NestingLevelContext;
6796
6755
 
6797
6756
  // eslint-disable-next-line import/prefer-default-export
6798
- const messages$A = defineMessages({
6757
+ const messages$B = defineMessages({
6799
6758
  aboveFifthLevelWarning: {
6800
6759
  id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
6801
6760
  description: 'Warning message shown when nested attribute are above the fifth level',
@@ -6807,9 +6766,9 @@ const messages$A = defineMessages({
6807
6766
  defaultMessage: 'Empty'
6808
6767
  }
6809
6768
  });
6810
- var customFieldsMessages = messages$A;
6769
+ var customFieldsMessages = messages$B;
6811
6770
 
6812
- var messages$z = defineMessages({
6771
+ var messages$A = defineMessages({
6813
6772
  updateButton: {
6814
6773
  id: 'NestedAttributes.Details.updateButton',
6815
6774
  description: 'Update button label',
@@ -6894,7 +6853,7 @@ const EditButton = props => {
6894
6853
  formatMessage = _useIntl.formatMessage;
6895
6854
  return jsx(Tooltip, {
6896
6855
  placement: "top",
6897
- title: formatMessage(messages$z.editTooltip),
6856
+ title: formatMessage(messages$A.editTooltip),
6898
6857
  children: jsx(IconButton, {
6899
6858
  label: "Edit",
6900
6859
  isDisabled: props.isDisabled,
@@ -6910,12 +6869,12 @@ const DropChangesConfirmation = props => {
6910
6869
  formatMessage = _useIntl2.formatMessage;
6911
6870
  return jsx(ConfirmationDialog, {
6912
6871
  isOpen: props.isOpen || false,
6913
- title: formatMessage(messages$z.confirmationDialogTitle),
6914
- labelPrimary: formatMessage(messages$z.nestedAttributesConfirmLabel),
6872
+ title: formatMessage(messages$A.confirmationDialogTitle),
6873
+ labelPrimary: formatMessage(messages$A.nestedAttributesConfirmLabel),
6915
6874
  onConfirm: props.onConfirm,
6916
6875
  onCancel: props.onCancel,
6917
6876
  children: jsx(Text.Body, {
6918
- intlMessage: messages$z.confirmationDialogBody
6877
+ intlMessage: messages$A.confirmationDialogBody
6919
6878
  })
6920
6879
  });
6921
6880
  };
@@ -6940,11 +6899,11 @@ const NestedAttributeModalPage = props => {
6940
6899
  children: [jsx(SecondaryButton, {
6941
6900
  isDisabled: !formik.dirty,
6942
6901
  iconLeft: jsx(RevertIcon, {}),
6943
- label: formatMessage(messages$z.cancelButton),
6902
+ label: formatMessage(messages$A.cancelButton),
6944
6903
  onClick: formik.resetForm
6945
6904
  }), jsx(CustomFormModalPage.FormPrimaryButton, {
6946
6905
  isDisabled: !formik.dirty,
6947
- label: formatMessage(messages$z.updateButton),
6906
+ label: formatMessage(messages$A.updateButton),
6948
6907
  onClick: formik.handleSubmit
6949
6908
  })]
6950
6909
  }),
@@ -6986,7 +6945,7 @@ const NestedInputControls = props => {
6986
6945
  if (nextNestingLevel >= 6) return jsx(MaxNestingLevelReached, {});
6987
6946
  const hasAttributes = props.productType.attributeDefinitions.length > 0;
6988
6947
  if (!hasAttributes) return jsx(Text.Body, {
6989
- intlMessage: messages$z.emptyProductType,
6948
+ intlMessage: messages$A.emptyProductType,
6990
6949
  tone: "secondary"
6991
6950
  });
6992
6951
  return jsxs(Spacings.Inline, {
@@ -7062,7 +7021,7 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
7062
7021
  if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
7063
7022
  kind: 'success',
7064
7023
  domain: DOMAINS.SIDE,
7065
- text: formatMessage(messages$z.attributeUpdateSucceeded)
7024
+ text: formatMessage(messages$A.attributeUpdateSucceeded)
7066
7025
  });
7067
7026
  setSubmitting(false);
7068
7027
  },
@@ -7181,7 +7140,7 @@ function CustomChannelReferenceInput(props) {
7181
7140
  }
7182
7141
  CustomChannelReferenceInput.displayName = 'CustomChannelReferenceInput';
7183
7142
 
7184
- var messages$y = defineMessages({
7143
+ var messages$z = defineMessages({
7185
7144
  noProductsFound: {
7186
7145
  id: 'Shared.ProductPickerInput.noProductsFound',
7187
7146
  description: 'The message to display when no products were found',
@@ -7279,7 +7238,7 @@ const ProductPickerInput = _ref => {
7279
7238
  children: jsx(AsyncSelectInput, {
7280
7239
  id: name,
7281
7240
  name: name,
7282
- placeholder: formatMessage(messages$y.placeholder),
7241
+ placeholder: formatMessage(messages$z.placeholder),
7283
7242
  loadOptions: loadOptionsDebounced,
7284
7243
  defaultOptions: [],
7285
7244
  isClearable: isClearable,
@@ -7293,7 +7252,7 @@ const ProductPickerInput = _ref => {
7293
7252
  onInputChange: handleInputChange,
7294
7253
  onBlur: onBlur,
7295
7254
  value: currentOption.data,
7296
- noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$y.noProductsFound),
7255
+ noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
7297
7256
  hasError: hasError || isLoadingFailed,
7298
7257
  menuPortalZIndex: Z_INDEX_DROPDOWN,
7299
7258
  menuPortalTarget: document.body,
@@ -7301,7 +7260,7 @@ const ProductPickerInput = _ref => {
7301
7260
  })
7302
7261
  }), isLoadingFailed && showLoadingErrorMessage && jsx(Text.Body, {
7303
7262
  tone: "negative",
7304
- intlMessage: pickerMessages$1.loadingErrorMessage
7263
+ intlMessage: commonPickerMessages.loadingErrorMessage
7305
7264
  })]
7306
7265
  })
7307
7266
  });
@@ -7533,7 +7492,7 @@ const CustomFieldInput = /*#__PURE__*/memo(props => {
7533
7492
  CustomFieldInput.displayName = 'CustomFieldInput';
7534
7493
  var CustomFieldInput$1 = CustomFieldInput;
7535
7494
 
7536
- var messages$x = defineMessages({
7495
+ var messages$y = defineMessages({
7537
7496
  productReferenceLabel: {
7538
7497
  id: 'CustomFieldsLabel.productReferenceLabel',
7539
7498
  description: 'Label shown above the product picker input.',
@@ -7602,7 +7561,7 @@ const CustomFieldsLabelHint = _ref2 => {
7602
7561
  children: [jsx(WarningIcon, {
7603
7562
  size: "medium",
7604
7563
  color: "warning"
7605
- }), jsx(FormattedMessage, _objectSpread$P({}, messages$x.cartDiscountMoreThan500))]
7564
+ }), jsx(FormattedMessage, _objectSpread$P({}, messages$y.cartDiscountMoreThan500))]
7606
7565
  });
7607
7566
  }
7608
7567
  return formatLocalizedString(fieldDefinition, {
@@ -7616,8 +7575,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
7616
7575
  formatMessage = _useIntl.formatMessage;
7617
7576
  const _usePimStatus = usePimStatus(),
7618
7577
  isProjectIndexed = _usePimStatus.isProjectIndexed;
7619
- if (isProjectIndexed) return formatMessage(messages$x.productTypeReferenceLabelI);
7620
- return formatMessage(messages$x.productTypeReferenceLabel);
7578
+ if (isProjectIndexed) return formatMessage(messages$y.productTypeReferenceLabelI);
7579
+ return formatMessage(messages$y.productTypeReferenceLabel);
7621
7580
  }
7622
7581
 
7623
7582
  // TODO(pa3): this logic may be misplaced and probably
@@ -7634,13 +7593,13 @@ function CustomFieldsLabelSubtitle(_ref3) {
7634
7593
  const referenceTypeName = capitalizeFirst(referenceTypeId);
7635
7594
  if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
7636
7595
  if (referenceTypeId === SEARCHABLE_REFERENCES.product) {
7637
- return formatMessage(messages$x.productReferenceLabel);
7596
+ return formatMessage(messages$y.productReferenceLabel);
7638
7597
  } else if (referenceTypeId === SEARCHABLE_REFERENCES.productType) {
7639
7598
  return jsx(CustomFieldsProductTypeReferenceSubtitle, {});
7640
7599
  } else if (referenceTypeId === SEARCHABLE_REFERENCES.channel) {
7641
- return formatMessage(messages$x.channelReferenceLabel);
7600
+ return formatMessage(messages$y.channelReferenceLabel);
7642
7601
  } else if (referenceTypeId === SEARCHABLE_REFERENCES.state) {
7643
- return formatMessage(messages$x.stateReferenceLabel);
7602
+ return formatMessage(messages$y.stateReferenceLabel);
7644
7603
  } else {
7645
7604
  return `${referenceTypeName} ID`;
7646
7605
  }
@@ -7660,7 +7619,7 @@ function CustomFieldsCountIndicator(_ref4) {
7660
7619
  const _useIntl3 = useIntl(),
7661
7620
  formatMessage = _useIntl3.formatMessage;
7662
7621
  return assignedAttributeGroups?.length > 1 ? jsx(Tooltip, {
7663
- title: formatMessage(messages$x.attributeGroupCountTooltip, {
7622
+ title: formatMessage(messages$y.attributeGroupCountTooltip, {
7664
7623
  attributeGroups: _mapInstanceProperty(assignedAttributeGroups).call(assignedAttributeGroups, assignedAttributeGroup => formatLocalizedField(assignedAttributeGroup.nameAllLocales)).join(', '),
7665
7624
  count: assignedAttributeGroups.length
7666
7625
  }),
@@ -7717,7 +7676,7 @@ const CustomFieldsLabel = /*#__PURE__*/memo(_ref5 => {
7717
7676
  CustomFieldsLabel.displayName = 'CustomFieldsTitle';
7718
7677
  var CustomFieldsLabel$1 = CustomFieldsLabel;
7719
7678
 
7720
- var messages$w = defineMessages({
7679
+ var messages$x = defineMessages({
7721
7680
  referencedProductType: {
7722
7681
  id: 'NestedAttributes.referencedProductType',
7723
7682
  description: 'Product type referenced hint',
@@ -7728,7 +7687,7 @@ var messages$w = defineMessages({
7728
7687
  function ownKeys$O(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7729
7688
  function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$O(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$O(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
7730
7689
  function ProductTypeReference(props) {
7731
- const productTypeMessage = _objectSpread$O(_objectSpread$O({}, messages$w.referencedProductType), {}, {
7690
+ const productTypeMessage = _objectSpread$O(_objectSpread$O({}, messages$x.referencedProductType), {}, {
7732
7691
  values: {
7733
7692
  productTypeName: props.productType.name
7734
7693
  }
@@ -7752,7 +7711,7 @@ function CustomNestedFieldInput(props) {
7752
7711
  color: "error"
7753
7712
  }), jsx(Text.Body, {
7754
7713
  tone: "negative",
7755
- intlMessage: pickerMessages$1.loadingErrorMessage
7714
+ intlMessage: commonPickerMessages.loadingErrorMessage
7756
7715
  })]
7757
7716
  });
7758
7717
  if (!productType) return null;
@@ -7798,7 +7757,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
7798
7757
  styles: "z-index:100000!important"
7799
7758
  } : {
7800
7759
  name: "4jor1w-child",
7801
- styles: "z-index:100000!important;label:child;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyYWdnYWJsZS13cmFwcGVyLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q29CIiwiZmlsZSI6ImRyYWdnYWJsZS13cmFwcGVyLmpzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyBEcmFnZ2FibGUgfSBmcm9tICdyZWFjdC1iZWF1dGlmdWwtZG5kJztcbmltcG9ydCBSZWFjdERPTSBmcm9tICdyZWFjdC1kb20nO1xuaW1wb3J0IHsgY3VzdG9tUHJvcGVydGllcywgR3JpZCwgQ2FyZCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCc7XG5pbXBvcnQgeyBEcmFnSGFuZGxlIH0gZnJvbSAnLi9kcmFnLWhhbmRsZSc7XG5cbmV4cG9ydCBjb25zdCBEcmFnZ2FibGVXcmFwcGVyID0gKHtcbiAgY2hpbGRyZW4sXG4gIGRyYWdnYWJsZUtleSxcbiAgZHJhZ2dhYmxlSWQsXG4gIGluZGV4LFxufSkgPT4ge1xuICBjb25zdCBwb3J0YWwgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcbiAgcG9ydGFsLmlkID0gJ2RyYWctcmJkLXBvcnRhbCc7XG4gIGRvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQocG9ydGFsKTtcblxuICBjb25zdCBEcmFnZ2luZ0NhcmQgPSAoeyBpc0RyYWdnaW5nLCBjaGlsZHJlbiB9KSA9PiB7XG4gICAgaWYgKGlzRHJhZ2dpbmcpIHtcbiAgICAgIHJldHVybiAoXG4gICAgICAgIDxDYXJkIHRoZW1lPVwibGlnaHRcIiBpbnNldFNjYWxlPVwibVwiPlxuICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgPC9DYXJkPlxuICAgICAgKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGNoaWxkcmVuO1xuICAgIH1cbiAgfTtcbiAgRHJhZ2dpbmdDYXJkLnByb3BUeXBlcyA9IHtcbiAgICBpc0RyYWdnaW5nOiBQcm9wVHlwZXMuYm9vbC5pc1JlcXVpcmVkLFxuICAgIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZS5pc1JlcXVpcmVkLFxuICB9O1xuICByZXR1cm4gKFxuICAgIDxEcmFnZ2FibGUga2V5PXtkcmFnZ2FibGVLZXl9IGRyYWdnYWJsZUlkPXtkcmFnZ2FibGVJZH0gaW5kZXg9e2luZGV4fT5cbiAgICAgIHsocHJvdmlkZWQsIHNuYXBzaG90KSA9PiB7XG4gICAgICAgIGNvbnN0IGNoaWxkID0gKFxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIHJlZj17cHJvdmlkZWQuaW5uZXJSZWZ9XG4gICAgICAgICAgICB7Li4ucHJvdmlkZWQuZHJhZ2dhYmxlUHJvcHN9XG4gICAgICAgICAgICBjc3M9e2Nzc2BcbiAgICAgICAgICAgICAgei1pbmRleDogMTAwMDAwICFpbXBvcnRhbnQ7XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxEcmFnZ2luZ0NhcmQgaXNEcmFnZ2luZz17c25hcHNob3QuaXNEcmFnZ2luZ30+XG4gICAgICAgICAgICAgIDxHcmlkXG4gICAgICAgICAgICAgICAgZ3JpZFRlbXBsYXRlQ29sdW1ucz17JzFmciAyMGZyJ31cbiAgICAgICAgICAgICAgICBncmlkVGVtcGxhdGVSb3dzPVwiYXV0byAxZnIgYXV0b1wiXG4gICAgICAgICAgICAgICAgZ3JpZEdhcD17XG4gICAgICAgICAgICAgICAgICBzbmFwc2hvdC5pc0RyYWdnaW5nXG4gICAgICAgICAgICAgICAgICAgID8gY3VzdG9tUHJvcGVydGllcy5zcGFjaW5nU1xuICAgICAgICAgICAgICAgICAgICA6IGN1c3RvbVByb3BlcnRpZXMuc3BhY2luZ01cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8R3JpZC5JdGVtPlxuICAgICAgICAgICAgICAgICAgPERyYWdIYW5kbGUgey4uLnByb3ZpZGVkLmRyYWdIYW5kbGVQcm9wc30gLz5cbiAgICAgICAgICAgICAgICA8L0dyaWQuSXRlbT5cbiAgICAgICAgICAgICAgICA8R3JpZC5JdGVtPntjaGlsZHJlbn08L0dyaWQuSXRlbT5cbiAgICAgICAgICAgICAgPC9HcmlkPlxuICAgICAgICAgICAgPC9EcmFnZ2luZ0NhcmQ+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICk7XG5cbiAgICAgICAgaWYgKCFzbmFwc2hvdC5pc0RyYWdnaW5nKSB7XG4gICAgICAgICAgcmV0dXJuIGNoaWxkO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gcmVuZGVyIHRoZSBkcmFnZ2FibGUgaW4gdGhlIHBvcnRhbCB3aGVuIGl0J3MgYmVpbmcgZHJhZ2dlZFxuICAgICAgICByZXR1cm4gUmVhY3RET00uY3JlYXRlUG9ydGFsKDxkaXY+e2NoaWxkfTwvZGl2PiwgcG9ydGFsKTtcbiAgICAgIH19XG4gICAgPC9EcmFnZ2FibGU+XG4gICk7XG59O1xuXG5EcmFnZ2FibGVXcmFwcGVyLnByb3BUeXBlcyA9IHtcbiAgZHJhZ2dhYmxlS2V5OiBQcm9wVHlwZXMuc3RyaW5nLmlzUmVxdWlyZWQsXG4gIGluZGV4OiBQcm9wVHlwZXMubnVtYmVyLmlzUmVxdWlyZWQsXG4gIGRyYWdnYWJsZUlkOiBQcm9wVHlwZXMuc3RyaW5nLmlzUmVxdWlyZWQsXG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZS5pc1JlcXVpcmVkLFxufTtcbiJdfQ== */",
7760
+ styles: "z-index:100000!important;label:child;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyYWdnYWJsZS13cmFwcGVyLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q29CIiwiZmlsZSI6ImRyYWdnYWJsZS13cmFwcGVyLmpzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyBEcmFnZ2FibGUgfSBmcm9tICdAaGVsbG8tcGFuZ2VhL2RuZCc7XG5pbXBvcnQgUmVhY3RET00gZnJvbSAncmVhY3QtZG9tJztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMsIEdyaWQsIENhcmQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnO1xuaW1wb3J0IHsgRHJhZ0hhbmRsZSB9IGZyb20gJy4vZHJhZy1oYW5kbGUnO1xuXG5leHBvcnQgY29uc3QgRHJhZ2dhYmxlV3JhcHBlciA9ICh7XG4gIGNoaWxkcmVuLFxuICBkcmFnZ2FibGVLZXksXG4gIGRyYWdnYWJsZUlkLFxuICBpbmRleCxcbn0pID0+IHtcbiAgY29uc3QgcG9ydGFsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7XG4gIHBvcnRhbC5pZCA9ICdkcmFnLXJiZC1wb3J0YWwnO1xuICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHBvcnRhbCk7XG5cbiAgY29uc3QgRHJhZ2dpbmdDYXJkID0gKHsgaXNEcmFnZ2luZywgY2hpbGRyZW4gfSkgPT4ge1xuICAgIGlmIChpc0RyYWdnaW5nKSB7XG4gICAgICByZXR1cm4gKFxuICAgICAgICA8Q2FyZCB0aGVtZT1cImxpZ2h0XCIgaW5zZXRTY2FsZT1cIm1cIj5cbiAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgIDwvQ2FyZD5cbiAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBjaGlsZHJlbjtcbiAgICB9XG4gIH07XG4gIERyYWdnaW5nQ2FyZC5wcm9wVHlwZXMgPSB7XG4gICAgaXNEcmFnZ2luZzogUHJvcFR5cGVzLmJvb2wuaXNSZXF1aXJlZCxcbiAgICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUuaXNSZXF1aXJlZCxcbiAgfTtcbiAgcmV0dXJuIChcbiAgICA8RHJhZ2dhYmxlIGtleT17ZHJhZ2dhYmxlS2V5fSBkcmFnZ2FibGVJZD17ZHJhZ2dhYmxlSWR9IGluZGV4PXtpbmRleH0+XG4gICAgICB7KHByb3ZpZGVkLCBzbmFwc2hvdCkgPT4ge1xuICAgICAgICBjb25zdCBjaGlsZCA9IChcbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICByZWY9e3Byb3ZpZGVkLmlubmVyUmVmfVxuICAgICAgICAgICAgey4uLnByb3ZpZGVkLmRyYWdnYWJsZVByb3BzfVxuICAgICAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgICAgIHotaW5kZXg6IDEwMDAwMCAhaW1wb3J0YW50O1xuICAgICAgICAgICAgYH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICA8RHJhZ2dpbmdDYXJkIGlzRHJhZ2dpbmc9e3NuYXBzaG90LmlzRHJhZ2dpbmd9PlxuICAgICAgICAgICAgICA8R3JpZFxuICAgICAgICAgICAgICAgIGdyaWRUZW1wbGF0ZUNvbHVtbnM9eycxZnIgMjBmcid9XG4gICAgICAgICAgICAgICAgZ3JpZFRlbXBsYXRlUm93cz1cImF1dG8gMWZyIGF1dG9cIlxuICAgICAgICAgICAgICAgIGdyaWRHYXA9e1xuICAgICAgICAgICAgICAgICAgc25hcHNob3QuaXNEcmFnZ2luZ1xuICAgICAgICAgICAgICAgICAgICA/IGN1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1NcbiAgICAgICAgICAgICAgICAgICAgOiBjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdNXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgPEdyaWQuSXRlbT5cbiAgICAgICAgICAgICAgICAgIDxEcmFnSGFuZGxlIHsuLi5wcm92aWRlZC5kcmFnSGFuZGxlUHJvcHN9IC8+XG4gICAgICAgICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgICAgICAgICAgPEdyaWQuSXRlbT57Y2hpbGRyZW59PC9HcmlkLkl0ZW0+XG4gICAgICAgICAgICAgIDwvR3JpZD5cbiAgICAgICAgICAgIDwvRHJhZ2dpbmdDYXJkPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICApO1xuXG4gICAgICAgIGlmICghc25hcHNob3QuaXNEcmFnZ2luZykge1xuICAgICAgICAgIHJldHVybiBjaGlsZDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHJlbmRlciB0aGUgZHJhZ2dhYmxlIGluIHRoZSBwb3J0YWwgd2hlbiBpdCdzIGJlaW5nIGRyYWdnZWRcbiAgICAgICAgcmV0dXJuIFJlYWN0RE9NLmNyZWF0ZVBvcnRhbCg8ZGl2PntjaGlsZH08L2Rpdj4sIHBvcnRhbCk7XG4gICAgICB9fVxuICAgIDwvRHJhZ2dhYmxlPlxuICApO1xufTtcblxuRHJhZ2dhYmxlV3JhcHBlci5wcm9wVHlwZXMgPSB7XG4gIGRyYWdnYWJsZUtleTogUHJvcFR5cGVzLnN0cmluZy5pc1JlcXVpcmVkLFxuICBpbmRleDogUHJvcFR5cGVzLm51bWJlci5pc1JlcXVpcmVkLFxuICBkcmFnZ2FibGVJZDogUHJvcFR5cGVzLnN0cmluZy5pc1JlcXVpcmVkLFxuICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUuaXNSZXF1aXJlZCxcbn07XG4iXX0= */",
7802
7761
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
7803
7762
  };
7804
7763
  const DraggableWrapper = _ref2 => {
@@ -7958,7 +7917,8 @@ const CustomFieldsInternal = _ref => {
7958
7917
  touched = _useFormikContext.touched,
7959
7918
  values = _valuesInstanceProperty(_useFormikContext),
7960
7919
  handleBlur = _useFormikContext.handleBlur,
7961
- status = _useFormikContext.status;
7920
+ status = _useFormikContext.status,
7921
+ isFormValid = _useFormikContext.isValid;
7962
7922
  const _useIntl = useIntl(),
7963
7923
  locale = _useIntl.locale;
7964
7924
  const _useApplicationContex = useApplicationContext(applicationContext => ({
@@ -7970,7 +7930,6 @@ const CustomFieldsInternal = _ref => {
7970
7930
  const isTailoringAttributesEnabled = useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
7971
7931
  const isTailoringAttributeForOtherTypes = useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT);
7972
7932
  const isTailoringFallbackEnabled = useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_FALLBACK_VALUES);
7973
- const didFormValidationFail = useDidFormValidationFail();
7974
7933
  const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
7975
7934
  const _useDnDContext = useDnDContext(),
7976
7935
  DroppableWrapper = _useDnDContext.DroppableWrapper,
@@ -7992,7 +7951,7 @@ const CustomFieldsInternal = _ref => {
7992
7951
 
7993
7952
  // We want to highlight fields with errors not only after a form submission,
7994
7953
  // but also after manually triggered form validation.
7995
- const hasError = Boolean(fieldErrors) && (isTouched || didFormValidationFail);
7954
+ const hasError = Boolean(fieldErrors) && (isTouched || !isFormValid);
7996
7955
  const validate = value => {
7997
7956
  if (fieldDefinition.required && isNil$1(value)) return {
7998
7957
  missing: true
@@ -8697,6 +8656,146 @@ function ProductSelectionsPicker(_ref) {
8697
8656
  });
8698
8657
  }
8699
8658
 
8659
+ var messages$w = defineMessages({
8660
+ placeholder: {
8661
+ id: 'RecurrentIntervalPicker.placeholder',
8662
+ description: 'The placeholder of the input',
8663
+ defaultMessage: 'Not restricted to any recurrent interval'
8664
+ },
8665
+ missingOptionLabel: {
8666
+ id: 'RecurrentIntervalPicker.missingOptionLabel',
8667
+ description: 'The label of the option when the recurrent interval is not found',
8668
+ defaultMessage: 'Unknown recurrent interval ({value})'
8669
+ },
8670
+ missingSelectedWarning: {
8671
+ id: 'RecurrentIntervalPicker.missingSelectedWarning',
8672
+ description: 'The warning message shown below the input when the selected recurrent interval is not found in the options',
8673
+ defaultMessage: 'The selected recurrent interval could not be retrieved. Please check your recurrence policy configuration.'
8674
+ },
8675
+ noRecurrentIntervalsConfigured: {
8676
+ id: 'RecurrentIntervalPicker.noRecurrentIntervalsConfigured',
8677
+ description: 'Banner warning message shown when no recurrent intervals are configured in the project',
8678
+ defaultMessage: 'No recurrent intervals configured. Please check your recurrence policy configuration'
8679
+ }
8680
+ });
8681
+
8682
+ var FetchRecurrencePolicies = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchRecurrencePolicies" }, 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: "recurrencePolicies" }, 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: "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: 191, source: { body: "query FetchRecurrencePolicies($where: String) {\n recurrencePolicies(where: $where) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
8683
+ const isRecurringOrdersDisabledError = error => {
8684
+ var _context;
8685
+ return error.extensions?.code === '403' && _includesInstanceProperty(_context = error.message).call(_context, "The feature 'recurring-orders' is not enabled for this project. Please contact commercetools support.");
8686
+ };
8687
+ // @TODO: Remove these error checks when the feature is enabled by default
8688
+ const useRecurrenceIntervals = _ref => {
8689
+ let where = _ref.where,
8690
+ _ref$skip = _ref.skip,
8691
+ skip = _ref$skip === void 0 ? false : _ref$skip;
8692
+ const _useQuery = useQuery$1(FetchRecurrencePolicies, {
8693
+ context: {
8694
+ target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
8695
+ },
8696
+ fetchPolicy: 'cache-and-network',
8697
+ variables: where ? {
8698
+ where
8699
+ } : undefined,
8700
+ skip
8701
+ }),
8702
+ data = _useQuery.data,
8703
+ loading = _useQuery.loading,
8704
+ rawError = _useQuery.error;
8705
+ const extractedErrors = rawError ? extractErrorFromGraphQlResponse(rawError) : [];
8706
+ const isRecurringOrdersDisabled = extractedErrors.length > 0 &&
8707
+ // If the only error is a 403 with the specific message, we assume the feature is disabled.
8708
+ _everyInstanceProperty(extractedErrors).call(extractedErrors, isRecurringOrdersDisabledError);
8709
+ const error = isRecurringOrdersDisabled ? undefined : rawError;
8710
+ return {
8711
+ recurrencePolicies: data?.recurrencePolicies?.results ?? [],
8712
+ loading,
8713
+ error,
8714
+ isRecurringOrdersDisabled
8715
+ };
8716
+ };
8717
+
8718
+ const RecurrentIntervalPicker = _ref => {
8719
+ let name = _ref.name,
8720
+ value = _ref.value,
8721
+ onChange = _ref.onChange,
8722
+ onBlur = _ref.onBlur,
8723
+ onError = _ref.onError,
8724
+ _ref$isClearable = _ref.isClearable,
8725
+ isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
8726
+ _ref$isDisabled = _ref.isDisabled,
8727
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
8728
+ _ref$isReadOnly = _ref.isReadOnly,
8729
+ isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly;
8730
+ const _useIntl = useIntl(),
8731
+ formatMessage = _useIntl.formatMessage;
8732
+ const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
8733
+ const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
8734
+ const skip = isReadOnly && !value;
8735
+ const where = isReadOnly && value ? `id="${value}"` : undefined;
8736
+ const _useRecurrenceInterva = useRecurrenceIntervals({
8737
+ where,
8738
+ skip
8739
+ }),
8740
+ recurrencePolicies = _useRecurrenceInterva.recurrencePolicies,
8741
+ loading = _useRecurrenceInterva.loading,
8742
+ error = _useRecurrenceInterva.error;
8743
+ const selectedIsMissingInData = Boolean(value) && !_someInstanceProperty(recurrencePolicies).call(recurrencePolicies, policy => policy.id === value);
8744
+ const options = useMemo(() => {
8745
+ if (loading) return [];
8746
+ const mapped = _mapInstanceProperty(recurrencePolicies).call(recurrencePolicies, policy => ({
8747
+ value: policy.id,
8748
+ label: formatLocalizedFieldToString(policy.nameAllLocales, policy.key)
8749
+ }));
8750
+
8751
+ // If the selected value cannot be loaded, add it as a missing option
8752
+ if (selectedIsMissingInData && value) {
8753
+ const label = formatMessage(messages$w.missingOptionLabel, {
8754
+ value
8755
+ });
8756
+ return [{
8757
+ value,
8758
+ label
8759
+ }, ...mapped];
8760
+ }
8761
+ return mapped;
8762
+ }, [recurrencePolicies, selectedIsMissingInData, value, dataLocale, formatMessage, formatLocalizedFieldToString, loading]);
8763
+ const noRecurrentIntervalsConfigured = !loading && recurrencePolicies.length === 0;
8764
+ useEffect(() => {
8765
+ if (error && onError) {
8766
+ onError(error);
8767
+ }
8768
+ }, [error, onError]);
8769
+ return jsxs(Spacings.Stack, {
8770
+ scale: "s",
8771
+ children: [jsx(SelectInput, {
8772
+ id: name,
8773
+ name: name,
8774
+ value: value,
8775
+ placeholder: messages$w.placeholder.defaultMessage,
8776
+ options: options,
8777
+ isClearable: isClearable,
8778
+ isReadOnly: isReadOnly,
8779
+ isDisabled: isDisabled || loading || noRecurrentIntervalsConfigured,
8780
+ onChange: onChange,
8781
+ onBlur: onBlur,
8782
+ hasError: !loading && !error && selectedIsMissingInData
8783
+ }), error ? jsx(Text.Body, {
8784
+ tone: "negative",
8785
+ intlMessage: commonPickerMessages.loadingErrorMessage
8786
+ }) : selectedIsMissingInData ? jsx(Text.Body, {
8787
+ tone: "negative",
8788
+ intlMessage: messages$w.missingSelectedWarning
8789
+ }) : null, !error && noRecurrentIntervalsConfigured && jsx(ContentNotification, {
8790
+ type: "warning",
8791
+ children: jsx(Text.Detail, {
8792
+ intlMessage: messages$w.noRecurrentIntervalsConfigured
8793
+ })
8794
+ })]
8795
+ });
8796
+ };
8797
+ var RecurrentIntervalPicker$1 = RecurrentIntervalPicker;
8798
+
8700
8799
  // NOTE: this component is duplicated in `app-shell/from-core`.
8701
8800
  var styles$b = {
8702
8801
  "colored": "required-indicator-module__colored____YUFm",
@@ -8853,9 +8952,6 @@ var messages$u = defineMessages({
8853
8952
  }
8854
8953
  });
8855
8954
 
8856
- const LOWER_STORES_LIMIT = 60;
8857
- const UPPER_STORES_LIMIT = 500;
8858
-
8859
8955
  // map store to options
8860
8956
  const mapStoresToOptions = _ref => {
8861
8957
  var _context, _context2;
@@ -10836,9 +10932,9 @@ const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesW
10836
10932
  }, previousIncludedLimits), {});
10837
10933
  var createPlatformLimitsQueryVariables = createQueryVariables;
10838
10934
 
10839
- 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 } } } };
10935
+ var PlatformLimitsFetcherQuery$1 = { 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: "maxGroupsPerCustomer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, 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: 2158, 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 maxGroupsPerCustomer {\n limit\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 } } } };
10840
10936
  const usePlatformLimitsFetcher = platformLimit => {
10841
- const _useQuery = useQuery(PlatformLimitsFetcherQuery, {
10937
+ const _useQuery = useQuery(PlatformLimitsFetcherQuery$1, {
10842
10938
  variables: createPlatformLimitsQueryVariables(platformLimit),
10843
10939
  context: {
10844
10940
  target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
@@ -10859,6 +10955,8 @@ const usePlatformLimitsFetcher = platformLimit => {
10859
10955
  };
10860
10956
  var usePlatformLimitsFetcher$1 = usePlatformLimitsFetcher;
10861
10957
 
10958
+ 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: "maxGroupsPerCustomer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "limit" }, 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: 2158, 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 maxGroupsPerCustomer {\n limit\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 } } } };
10959
+
10862
10960
  const useLimitsModalState = function () {
10863
10961
  let isInitiallyOpen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
10864
10962
  const _useState = useState(isInitiallyOpen),
@@ -10985,7 +11083,7 @@ const getCustomerSupportLink = msg => jsx(Link, {
10985
11083
  isExternal: true,
10986
11084
  to: SUPPORT_PORTAL_URL,
10987
11085
  children: msg
10988
- });
11086
+ }, `msg-${msg}`);
10989
11087
  const PlatformLimitWarningNotification = _ref => {
10990
11088
  let resource = _ref.resource,
10991
11089
  limit = _ref.limit;
@@ -11823,11 +11921,13 @@ var CustomersCombined = PlatformLimitsCustomersCombined;
11823
11921
 
11824
11922
  const useCustomersPlatformLimits = () => {
11825
11923
  const _useCustomersPlatform = useCustomersPlatformLimitsFetcher$1(),
11924
+ platformLimits = _useCustomersPlatform.platformLimits,
11826
11925
  refetch = _useCustomersPlatform.refetch;
11827
11926
  const _useCustomersPlatform2 = useCustomersPlatformLimitsStatus(),
11828
11927
  hasReachedCustomersWarningLimit = _useCustomersPlatform2.hasReachedCustomersWarningLimit,
11829
11928
  hasReachedCustomersErrorLimit = _useCustomersPlatform2.hasReachedCustomersErrorLimit;
11830
11929
  const interceptNavigation = useInterceptNavigation$1(hasReachedCustomersErrorLimit);
11930
+ const maxGroupsPerCustomerLimit = platformLimits?.customers?.maxGroupsPerCustomer?.limit;
11831
11931
  return {
11832
11932
  CustomersLimits: {
11833
11933
  Notifications: CustomersNotification,
@@ -11837,6 +11937,7 @@ const useCustomersPlatformLimits = () => {
11837
11937
  ErrorModal: CustomersErrorModal
11838
11938
  },
11839
11939
  refetchCustomersPlatformLimits: refetch,
11940
+ maxGroupsPerCustomerLimit,
11840
11941
  interceptNavigation,
11841
11942
  status: {
11842
11943
  hasReachedCustomersWarningLimit,
@@ -11861,6 +11962,38 @@ const injectCustomersPlatformLimits = () => WrappedComponent => {
11861
11962
  };
11862
11963
  var injectCustomersPlatformLimits$1 = injectCustomersPlatformLimits;
11863
11964
 
11965
+ const useBusinessUnitsPlatformLimitsFetcher = () => {
11966
+ const _usePlatformLimitsFet = usePlatformLimitsFetcher$1(RESOURCES_WITH_PLATFORM_LIMITS.businessUnits),
11967
+ isLoading = _usePlatformLimitsFet.isLoading,
11968
+ error = _usePlatformLimitsFet.error,
11969
+ platformLimits = _usePlatformLimitsFet.platformLimits,
11970
+ refetch = _usePlatformLimitsFet.refetch;
11971
+ const formattedPlatformLimits = {
11972
+ businessUnitsMaxDivisionsLimit: platformLimits.businessUnits?.maxDivisions.limit,
11973
+ businessUnitsMaxDepthLimit: platformLimits.businessUnits?.maxDepthLimit.limit,
11974
+ businessUnitsMaxAssociatesLimit: platformLimits.businessUnits?.maxAssociates.limit,
11975
+ businessUnitsMaxAssociateRolesLimit: platformLimits.businessUnits?.maxAssociateRoles.limit
11976
+ };
11977
+ return {
11978
+ isLoading,
11979
+ error,
11980
+ platformLimits: formattedPlatformLimits,
11981
+ refetch
11982
+ };
11983
+ };
11984
+ var useBusinessUnitsPlatformLimitsFetcher$1 = useBusinessUnitsPlatformLimitsFetcher;
11985
+
11986
+ const useBusinessUnitsLimits = () => {
11987
+ const _useBusinessUnitsPlat = useBusinessUnitsPlatformLimitsFetcher$1(),
11988
+ refetch = _useBusinessUnitsPlat.refetch,
11989
+ platformLimits = _useBusinessUnitsPlat.platformLimits;
11990
+ return {
11991
+ BusinessUnitsLimits: platformLimits,
11992
+ refetchBusinessUnitsPlatformLimits: refetch
11993
+ };
11994
+ };
11995
+ var useBusinessUnitsLimits$1 = useBusinessUnitsLimits;
11996
+
11864
11997
  const useCustomerGroupsPlatformLimitsFetcher = () => {
11865
11998
  const _usePlatformLimitsFet = usePlatformLimitsFetcher$1(RESOURCES_WITH_PLATFORM_LIMITS.customerGroups),
11866
11999
  isLoading = _usePlatformLimitsFet.isLoading,
@@ -12208,6 +12341,72 @@ const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
12208
12341
  };
12209
12342
  var injectCustomerGroupsPlatformLimits$1 = injectCustomerGroupsPlatformLimits;
12210
12343
 
12344
+ const useStoresPlatformLimitsFetcher = () => {
12345
+ const _usePlatformLimitsFet = usePlatformLimitsFetcher$1(RESOURCES_WITH_PLATFORM_LIMITS.stores),
12346
+ isLoading = _usePlatformLimitsFet.isLoading,
12347
+ error = _usePlatformLimitsFet.error,
12348
+ platformLimits = _usePlatformLimitsFet.platformLimits,
12349
+ refetch = _usePlatformLimitsFet.refetch;
12350
+ const formattedPlatformLimits = {
12351
+ total: platformLimits.stores?.total.limit,
12352
+ storeLimit: platformLimits.stores?.total.limit,
12353
+ storeCurrent: platformLimits.stores?.total.current,
12354
+ inventorySupplyChannels: platformLimits.stores?.inventorySupplyChannels.limit,
12355
+ productDistributionChannels: platformLimits.stores?.productDistributionChannels.limit
12356
+ };
12357
+ return {
12358
+ isLoading,
12359
+ error,
12360
+ platformLimits: formattedPlatformLimits,
12361
+ refetch
12362
+ };
12363
+ };
12364
+ var useStoresPlatformLimitsFetcher$1 = useStoresPlatformLimitsFetcher;
12365
+
12366
+ const useStoresPlatformLimits = () => {
12367
+ const _useStoresPlatformLim = useStoresPlatformLimitsFetcher$1(),
12368
+ platformLimits = _useStoresPlatformLim.platformLimits;
12369
+ if (!platformLimits?.total) {
12370
+ return {
12371
+ hasReachedStoresWarningLimit: false,
12372
+ hasReachedStoresErrorLimit: false
12373
+ };
12374
+ }
12375
+ const storeLimit = platformLimits.storeLimit,
12376
+ storeCurrent = platformLimits.storeCurrent;
12377
+ const hasReachedStoresWarningLimit = getHasExceededWarningThreshold({
12378
+ limit: storeLimit,
12379
+ current: storeCurrent
12380
+ });
12381
+ const hasReachedStoresErrorLimit = getHasExceededLimit({
12382
+ limit: storeLimit,
12383
+ current: storeCurrent
12384
+ });
12385
+ return {
12386
+ hasReachedStoresWarningLimit,
12387
+ hasReachedStoresErrorLimit
12388
+ };
12389
+ };
12390
+ var useStoresPlatformLimitsStatus = useStoresPlatformLimits;
12391
+
12392
+ const useStoresLimits = () => {
12393
+ const _useStoresPlatformLim = useStoresPlatformLimitsFetcher$1(),
12394
+ refetch = _useStoresPlatformLim.refetch,
12395
+ platformLimits = _useStoresPlatformLim.platformLimits;
12396
+ const _useStoresPlatformLim2 = useStoresPlatformLimitsStatus(),
12397
+ hasReachedStoresWarningLimit = _useStoresPlatformLim2.hasReachedStoresWarningLimit,
12398
+ hasReachedStoresErrorLimit = _useStoresPlatformLim2.hasReachedStoresErrorLimit;
12399
+ return {
12400
+ StoreLimits: platformLimits,
12401
+ refetchStoresPlatformLimits: refetch,
12402
+ status: {
12403
+ hasReachedStoresWarningLimit,
12404
+ hasReachedStoresErrorLimit
12405
+ }
12406
+ };
12407
+ };
12408
+ var useStoresLimits$1 = useStoresLimits;
12409
+
12211
12410
  var messages$c = defineMessages({
12212
12411
  yes: {
12213
12412
  id: 'BooleanField.yes',
@@ -13503,7 +13702,7 @@ function formatDiscount(discount, currencyCode, intl) {
13503
13702
  if (discount.type === 'relative') return `${discount.permyriad / 100}%`;
13504
13703
  if (!discount.money) return null;
13505
13704
  const moneyForCurrencyCode = _findInstanceProperty(_context = discount.money).call(_context, discountMoney => discountMoney.currencyCode === currencyCode);
13506
- return moneyForCurrencyCode ? formatMoney$1(moneyForCurrencyCode, intl) : null;
13705
+ return moneyForCurrencyCode ? formatMoney$2(moneyForCurrencyCode, intl) : null;
13507
13706
  }
13508
13707
 
13509
13708
  function formatPercentage(percentage) {
@@ -13649,6 +13848,9 @@ function resolveStatusType(product) {
13649
13848
  if (published && !hasStagedChanges) return PRODUCT_STATUSES.PUBLISHED;
13650
13849
  return PRODUCT_STATUSES.UNPUBLISHED;
13651
13850
  }
13851
+ function getStampToneByPublishState(statusCode) {
13852
+ if (statusCode === PRODUCT_STATUSES.UNPUBLISHED) return 'secondary';else if (statusCode === PRODUCT_STATUSES.PUBLISHED) return 'positive';else if (statusCode === PRODUCT_STATUSES.MODIFIED) return 'warning';
13853
+ }
13652
13854
  const computedProperties = {
13653
13855
  // TODO: show relative time as tooltip
13654
13856
  // `intl.formatRelative(<DATETIME>)`
@@ -13680,7 +13882,7 @@ const computedProperties = {
13680
13882
  intl = _ref4.intl;
13681
13883
  const allVariants = _concatInstanceProperty(_context2 = product.variants).call(_context2, product.masterVariant);
13682
13884
  const variantPrices = flatMap(allVariants, variant => variant.prices);
13683
- return _mapInstanceProperty(_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$1(price, intl)).join(', ') || NO_VALUE_FALLBACK;
13885
+ return _mapInstanceProperty(_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$2(price, intl)).join(', ') || NO_VALUE_FALLBACK;
13684
13886
  },
13685
13887
  sku(_ref5) {
13686
13888
  var _context4, _context5;
@@ -13970,4 +14172,4 @@ function withPendingRequests() {
13970
14172
 
13971
14173
  var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, 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: "slugAllLocales" }, 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: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
13972
14174
 
13973
- export { booleanField as BooleanField, Button$1 as Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner$1 as CenteredLoadingSpinner, ChannelPickerInput$1 as ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, CustomFieldTooltip$1 as CustomFieldTooltip, CustomFieldTypeDefinitionsConnector$1 as CustomFieldTypeDefinitionsConnector, CustomFields$1 as CustomFields, CustomFieldsErrorTextNotification$1 as CustomFieldsErrorTextNotification, CustomFieldsFormField$1 as CustomFieldsFormField, CustomerGroupPickerInput$1 as CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput$1 as FileInput, FormattedDateTime$1 as FormattedDateTime, FormattedLocalizedString, LabelRange$1 as LabelRange, MC_RESOURCES_WITH_KEYS, MissingValueField$1 as MissingValueField, MultiValueSearchInput$1 as MultiValueSearchInput, numericFormatInput as NumericFormatInput, Option$2 as Option, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput$1 as ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, QUERY_LIMIT, RequestCache$1 as RequestCache, RequiredIndicator$1 as RequiredIndicator, ScrollToFieldError$1 as ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput$1 as SelectableFieldSearchInput, StoreSelectField$1 as StoreSelectField, StoreSelectInput$1 as StoreSelectInput, ThrottledField$1 as ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer$1 as WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$c as booleanMessages, buildSearchQuery$1 as buildSearchQuery, businessRoleConstants$1 as businessRoleConstants, messages$7 as businessRoleMessages, businessRoleKeys$1 as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition$1 as createNextSortDefinition, createReducer, createResourceReducer, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$1 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBottomOption, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName$1 as getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds$1 as getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError$1 as hasInvalidInputError, hasSemanticError$1 as hasSemanticError, injectCustomerGroupsPlatformLimits$1 as injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits$1 as injectCustomersPlatformLimits, injectDataTablePaginationState$1 as injectDataTablePaginationState, injectModalState$3 as injectModalState, injectNotifications$1 as injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits$1 as injectShippingMethodsPlatformLimits, injectStorage$1 as injectStorage, injectTaxCategoriesPlatformLimits$1 as injectTaxCategoriesPlatformLimits, injectModalState$1 as injectToggleState, injectZonesPlatformLimits$1 as injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID$1 as isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName$1 as keepDisplayName, mapStoresToOptions, mapTimeZonesToOptions, minusify, messages$9 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, pickerMessages$1 as pickerMessages, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$N as searchInputMessages, setDisplayName$1 as setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, stringToBase64, swapArrayItems, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, useCachedCategoryOptions, useCurrentOption, useDnDContext as useCustomFieldsDnDContext, useCustomerGroupsPlatformLimits$1 as useCustomerGroupsPlatformLimits, useCustomersPlatformLimits$1 as useCustomersPlatformLimits, useDebouncedPromiseCallback$1 as useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useFormatLocalizedString, useIsFieldDuplicated$1 as useIsFieldDuplicated, useLoadOptions$1 as useLoadOptions, useLocalizedKeyFallback$1 as useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration$1 as usePersistedTableConfiguration, usePimIndexer, usePrevious$1 as usePrevious, useProductSelectionsFetcher$1 as useProductSelectionsFetcher, useProductSelectionsTotalFetcher$1 as useProductSelectionsTotalFetcher, useRecurrenceIntervals, useRoleNotificationEffect$1 as useRoleNotificationEffect, useShippingMethodsPlatformLimits, useStorage$1 as useStorage, useStoreKeysInDataFences$1 as useStoreKeysInDataFences, useStoresListFetcher$1 as useStoresListFetcher, useTaxCategoriesPlatformLimits, useTotalNumberOfStoresFetcher$1 as useTotalNumberOfStoresFetcher, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, validationMessages, withPendingRequests, withProps$1 as withProps, withRedirectTo$1 as withRedirectTo, withoutEmptyErrorsByField$1 as withoutEmptyErrorsByField, wrapDisplayName$1 as wrapDisplayName };
14175
+ export { booleanField as BooleanField, Button$1 as Button, CUSTOM_FIELD_TYPES, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner$1 as CenteredLoadingSpinner, ChannelPickerInput$1 as ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, CustomFieldInput$1 as CustomFieldInput, CustomFieldTooltip$1 as CustomFieldTooltip, CustomFieldTypeDefinitionsConnector$1 as CustomFieldTypeDefinitionsConnector, CustomFields$1 as CustomFields, CustomFieldsErrorTextNotification$1 as CustomFieldsErrorTextNotification, CustomFieldsFormField$1 as CustomFieldsFormField, CustomerGroupPickerInput$1 as CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput$1 as FileInput, FormattedDateTime$1 as FormattedDateTime, FormattedLocalizedString, LOWER_STORES_LIMIT, LabelRange$1 as LabelRange, MC_RESOURCES_WITH_KEYS, MissingValueField$1 as MissingValueField, MultiValueSearchInput$1 as MultiValueSearchInput, numericFormatInput as NumericFormatInput, Option$2 as Option, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, PlatformLimitsFetcherQuery, ProductAttributeInput, ProductAttributes, ProductPickerInput$1 as ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, QUERY_LIMIT, QUERY_MAX_LIMIT, RESOURCES_WITH_PLATFORM_LIMITS, RecurrentIntervalPicker$1 as RecurrentIntervalPicker, RequestCache$1 as RequestCache, RequiredIndicator$1 as RequiredIndicator, ScrollToFieldError$1 as ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput$1 as SelectableFieldSearchInput, StoreSelectField$1 as StoreSelectField, StoreSelectInput$1 as StoreSelectInput, ThrottledField$1 as ThrottledField, UPPER_STORES_LIMIT, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer$1 as WithPimIndexer, allowedProperties, and, attributeToCustomField, attributesMapToNameValuePairs, base64ToString, messages$c as booleanMessages, buildSearchQuery$1 as buildSearchQuery, businessRoleConstants$1 as businessRoleConstants, messages$7 as businessRoleMessages, businessRoleKeys$1 as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition$1 as createNextSortDefinition, createPlatformLimitsQueryVariables, createReducer, createResourceReducer, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$2 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBottomOption, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName$1 as getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds$1 as getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getStampToneByPublishState, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError$1 as hasInvalidInputError, hasSemanticError$1 as hasSemanticError, injectCustomerGroupsPlatformLimits$1 as injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits$1 as injectCustomersPlatformLimits, injectDataTablePaginationState$1 as injectDataTablePaginationState, injectModalState$3 as injectModalState, injectNotifications$1 as injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits$1 as injectShippingMethodsPlatformLimits, injectStorage$1 as injectStorage, injectTaxCategoriesPlatformLimits$1 as injectTaxCategoriesPlatformLimits, injectModalState$1 as injectToggleState, injectZonesPlatformLimits$1 as injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID$1 as isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName$1 as keepDisplayName, mapShippingRateTierToGraphQL, mapStoresToOptions, mapTimeZonesToOptions, minusify, messages$9 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$O as searchInputMessages, setDisplayName$1 as setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, stringToBase64, swapArrayItems, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, useBusinessUnitsLimits$1 as useBusinessUnitsPlatformLimits, useCachedCategoryOptions, useCurrentOption, useDnDContext as useCustomFieldsDnDContext, useCustomerGroupsPlatformLimits$1 as useCustomerGroupsPlatformLimits, useCustomersPlatformLimits$1 as useCustomersPlatformLimits, useDebouncedPromiseCallback$1 as useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useFormatLocalizedString, useIsFieldDuplicated$1 as useIsFieldDuplicated, useLoadOptions$1 as useLoadOptions, useLocalizedKeyFallback$1 as useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration$1 as usePersistedTableConfiguration, usePimIndexer, usePrevious$1 as usePrevious, useProductSelectionsFetcher$1 as useProductSelectionsFetcher, useProductSelectionsTotalFetcher$1 as useProductSelectionsTotalFetcher, useRecurrenceIntervals, useRoleNotificationEffect$1 as useRoleNotificationEffect, useShippingMethodsPlatformLimits, useStorage$1 as useStorage, useStoreKeysInDataFences$1 as useStoreKeysInDataFences, useStoresListFetcher$1 as useStoresListFetcher, useStoresLimits$1 as useStoresPlatformLimits, useTaxCategoriesPlatformLimits, useTotalNumberOfStoresFetcher$1 as useTotalNumberOfStoresFetcher, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, validationMessages, withPendingRequests, withProps$1 as withProps, withRedirectTo$1 as withRedirectTo, withoutEmptyErrorsByField$1 as withoutEmptyErrorsByField, wrapDisplayName$1 as wrapDisplayName };