@nebula.js/stardust 5.1.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/esm/dev.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v5.1.2
2
+ * @nebula.js/stardust v5.2.0
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -717,14 +717,14 @@ function _defineProperty(e, r, t) {
717
717
  writable: !0
718
718
  }) : e[r] = t, e;
719
719
  }
720
- function _extends$6() {
721
- return _extends$6 = Object.assign ? Object.assign.bind() : function (n) {
720
+ function _extends$2() {
721
+ return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
722
722
  for (var e = 1; e < arguments.length; e++) {
723
723
  var t = arguments[e];
724
724
  for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
725
725
  }
726
726
  return n;
727
- }, _extends$6.apply(null, arguments);
727
+ }, _extends$2.apply(null, arguments);
728
728
  }
729
729
  function ownKeys(e, r) {
730
730
  var t = Object.keys(e);
@@ -751,14 +751,14 @@ function _objectWithoutProperties(e, t) {
751
751
  if (null == e) return {};
752
752
  var o,
753
753
  r,
754
- i = _objectWithoutPropertiesLoose$2(e, t);
754
+ i = _objectWithoutPropertiesLoose$1(e, t);
755
755
  if (Object.getOwnPropertySymbols) {
756
756
  var n = Object.getOwnPropertySymbols(e);
757
757
  for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
758
758
  }
759
759
  return i;
760
760
  }
761
- function _objectWithoutPropertiesLoose$2(r, e) {
761
+ function _objectWithoutPropertiesLoose$1(r, e) {
762
762
  if (null == r) return {};
763
763
  var t = {};
764
764
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
@@ -1954,6 +1954,12 @@ var Visualization_UnfulfilledCalculationCondition = {
1954
1954
  "zh-TW": "不符計算條件"
1955
1955
  }
1956
1956
  };
1957
+ var Listbox_Clear_Search = {
1958
+ id: "Listbox.Clear.Search",
1959
+ locale: {
1960
+ "en-US": "Clear search"
1961
+ }
1962
+ };
1957
1963
  var all = {
1958
1964
  Cancel: Cancel$1,
1959
1965
  CurrentSelections_All: CurrentSelections_All,
@@ -2008,7 +2014,8 @@ var all = {
2008
2014
  Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
2009
2015
  Visualization_Invalid_Measure: Visualization_Invalid_Measure,
2010
2016
  Visualization_LayoutError: Visualization_LayoutError,
2011
- Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
2017
+ Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
2018
+ Listbox_Clear_Search: Listbox_Clear_Search
2012
2019
  };
2013
2020
 
2014
2021
  function appLocaleFn(language) {
@@ -3916,32 +3923,24 @@ var formatMuiErrorMessage = /*#__PURE__*/Object.freeze({
3916
3923
 
3917
3924
  var THEME_ID = '$$material';
3918
3925
 
3919
- function _extends$5() {
3920
- _extends$5 = Object.assign ? Object.assign.bind() : function (target) {
3921
- for (var i = 1; i < arguments.length; i++) {
3922
- var source = arguments[i];
3923
- for (var key in source) {
3924
- if (Object.prototype.hasOwnProperty.call(source, key)) {
3925
- target[key] = source[key];
3926
- }
3927
- }
3926
+ function _extends$1() {
3927
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
3928
+ for (var e = 1; e < arguments.length; e++) {
3929
+ var t = arguments[e];
3930
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
3928
3931
  }
3929
- return target;
3930
- };
3931
- return _extends$5.apply(this, arguments);
3932
+ return n;
3933
+ }, _extends$1.apply(null, arguments);
3932
3934
  }
3933
3935
 
3934
- function _objectWithoutPropertiesLoose$1(source, excluded) {
3935
- if (source == null) return {};
3936
- var target = {};
3937
- var sourceKeys = Object.keys(source);
3938
- var key, i;
3939
- for (i = 0; i < sourceKeys.length; i++) {
3940
- key = sourceKeys[i];
3941
- if (excluded.indexOf(key) >= 0) continue;
3942
- target[key] = source[key];
3936
+ function _objectWithoutPropertiesLoose(r, e) {
3937
+ if (null == r) return {};
3938
+ var t = {};
3939
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
3940
+ if (e.indexOf(n) >= 0) continue;
3941
+ t[n] = r[n];
3943
3942
  }
3944
- return target;
3943
+ return t;
3945
3944
  }
3946
3945
 
3947
3946
  /*
@@ -5275,49 +5274,6 @@ var styledEngine = /*#__PURE__*/Object.freeze({
5275
5274
  keyframes: keyframes
5276
5275
  });
5277
5276
 
5278
- function _extends$4() {
5279
- _extends$4 = Object.assign ? Object.assign.bind() : function (target) {
5280
- for (var i = 1; i < arguments.length; i++) {
5281
- var source = arguments[i];
5282
- for (var key in source) {
5283
- if (Object.prototype.hasOwnProperty.call(source, key)) {
5284
- target[key] = source[key];
5285
- }
5286
- }
5287
- }
5288
- return target;
5289
- };
5290
- return _extends$4.apply(this, arguments);
5291
- }
5292
-
5293
- function _objectWithoutPropertiesLoose(source, excluded) {
5294
- if (source == null) return {};
5295
- var target = {};
5296
- var sourceKeys = Object.keys(source);
5297
- var key, i;
5298
- for (i = 0; i < sourceKeys.length; i++) {
5299
- key = sourceKeys[i];
5300
- if (excluded.indexOf(key) >= 0) continue;
5301
- target[key] = source[key];
5302
- }
5303
- return target;
5304
- }
5305
-
5306
- function _extends$3() {
5307
- _extends$3 = Object.assign ? Object.assign.bind() : function (target) {
5308
- for (var i = 1; i < arguments.length; i++) {
5309
- var source = arguments[i];
5310
- for (var key in source) {
5311
- if (Object.prototype.hasOwnProperty.call(source, key)) {
5312
- target[key] = source[key];
5313
- }
5314
- }
5315
- }
5316
- return target;
5317
- };
5318
- return _extends$3.apply(this, arguments);
5319
- }
5320
-
5321
5277
  // https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
5322
5278
  function isPlainObject(item) {
5323
5279
  if (typeof item !== 'object' || item === null) {
@@ -5339,14 +5295,12 @@ function deepClone(source) {
5339
5295
  function deepmerge$1(target, source, options = {
5340
5296
  clone: true
5341
5297
  }) {
5342
- const output = options.clone ? _extends$3({}, target) : target;
5298
+ const output = options.clone ? _extends$1({}, target) : target;
5343
5299
  if (isPlainObject(target) && isPlainObject(source)) {
5344
5300
  Object.keys(source).forEach(key => {
5301
+ if (isPlainObject(source[key]) &&
5345
5302
  // Avoid prototype pollution
5346
- if (key === '__proto__') {
5347
- return;
5348
- }
5349
- if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
5303
+ Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
5350
5304
  // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
5351
5305
  output[key] = deepmerge$1(target[key], source[key], options);
5352
5306
  } else if (options.clone) {
@@ -5374,7 +5328,7 @@ const sortBreakpointsValues = values => {
5374
5328
  // Sort in ascending order
5375
5329
  breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
5376
5330
  return breakpointsAsArray.reduce((acc, obj) => {
5377
- return _extends$4({}, acc, {
5331
+ return _extends$1({}, acc, {
5378
5332
  [obj.key]: obj.val
5379
5333
  });
5380
5334
  }, {});
@@ -5431,7 +5385,7 @@ function createBreakpoints(breakpoints) {
5431
5385
  }
5432
5386
  return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
5433
5387
  }
5434
- return _extends$4({
5388
+ return _extends$1({
5435
5389
  keys,
5436
5390
  values: sortedValues,
5437
5391
  up,
@@ -6478,15 +6432,15 @@ function createTheme$2(options = {}, ...args) {
6478
6432
  direction: 'ltr',
6479
6433
  components: {},
6480
6434
  // Inject component definitions.
6481
- palette: _extends$4({
6435
+ palette: _extends$1({
6482
6436
  mode: 'light'
6483
6437
  }, paletteInput),
6484
6438
  spacing,
6485
- shape: _extends$4({}, shape, shapeInput)
6439
+ shape: _extends$1({}, shape, shapeInput)
6486
6440
  }, other);
6487
6441
  muiTheme.applyStyles = applyStyles;
6488
6442
  muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
6489
- muiTheme.unstable_sxConfig = _extends$4({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
6443
+ muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
6490
6444
  muiTheme.unstable_sx = function sx(props) {
6491
6445
  return styleFunctionSx$1({
6492
6446
  sx: props,
@@ -6551,12 +6505,12 @@ function extendSxProp(props) {
6551
6505
  if (!isPlainObject(result)) {
6552
6506
  return systemProps;
6553
6507
  }
6554
- return _extends$4({}, systemProps, result);
6508
+ return _extends$1({}, systemProps, result);
6555
6509
  };
6556
6510
  } else {
6557
- finalSx = _extends$4({}, systemProps, inSx);
6511
+ finalSx = _extends$1({}, systemProps, inSx);
6558
6512
  }
6559
- return _extends$4({}, otherProps, {
6513
+ return _extends$1({}, otherProps, {
6560
6514
  sx: finalSx
6561
6515
  });
6562
6516
  }
@@ -6699,10 +6653,10 @@ var getDisplayName = /*#__PURE__*/Object.freeze({
6699
6653
  * @returns {object} resolved props
6700
6654
  */
6701
6655
  function resolveProps(defaultProps, props) {
6702
- const output = _extends$3({}, props);
6656
+ const output = _extends$1({}, props);
6703
6657
  Object.keys(defaultProps).forEach(propName => {
6704
6658
  if (propName.toString().match(/^(components|slots)$/)) {
6705
- output[propName] = _extends$3({}, defaultProps[propName], output[propName]);
6659
+ output[propName] = _extends$1({}, defaultProps[propName], output[propName]);
6706
6660
  } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
6707
6661
  const defaultSlotProps = defaultProps[propName] || {};
6708
6662
  const slotProps = props[propName];
@@ -6714,7 +6668,7 @@ function resolveProps(defaultProps, props) {
6714
6668
  // Reduce the iteration if the default slot props is empty
6715
6669
  output[propName] = slotProps;
6716
6670
  } else {
6717
- output[propName] = _extends$3({}, slotProps);
6671
+ output[propName] = _extends$1({}, slotProps);
6718
6672
  Object.keys(defaultSlotProps).forEach(slotPropName => {
6719
6673
  output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
6720
6674
  });
@@ -6774,21 +6728,6 @@ var clamp = /*#__PURE__*/Object.freeze({
6774
6728
  default: clamp$1
6775
6729
  });
6776
6730
 
6777
- function _extends$2() {
6778
- _extends$2 = Object.assign ? Object.assign.bind() : function (target) {
6779
- for (var i = 1; i < arguments.length; i++) {
6780
- var source = arguments[i];
6781
- for (var key in source) {
6782
- if (Object.prototype.hasOwnProperty.call(source, key)) {
6783
- target[key] = source[key];
6784
- }
6785
- }
6786
- }
6787
- return target;
6788
- };
6789
- return _extends$2.apply(this, arguments);
6790
- }
6791
-
6792
6731
  /**
6793
6732
  * Safe chained function.
6794
6733
  *
@@ -7186,7 +7125,7 @@ function mergeOuterLocalTheme(outerTheme, localTheme) {
7186
7125
  const mergedTheme = localTheme(outerTheme);
7187
7126
  return mergedTheme;
7188
7127
  }
7189
- return _extends$2({}, outerTheme, localTheme);
7128
+ return _extends$1({}, outerTheme, localTheme);
7190
7129
  }
7191
7130
 
7192
7131
  /**
@@ -7220,7 +7159,7 @@ function RtlProvider(_ref) {
7220
7159
  value
7221
7160
  } = _ref,
7222
7161
  props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
7223
- return /*#__PURE__*/jsxRuntimeExports.jsx(RtlContext.Provider, _extends$4({
7162
+ return /*#__PURE__*/jsxRuntimeExports.jsx(RtlContext.Provider, _extends$1({
7224
7163
  value: value != null ? value : true
7225
7164
  }, props));
7226
7165
  }
@@ -7231,7 +7170,7 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
7231
7170
  const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
7232
7171
  if (typeof localTheme === 'function') {
7233
7172
  const mergedTheme = localTheme(resolvedTheme);
7234
- const result = themeId ? _extends$4({}, upperTheme, {
7173
+ const result = themeId ? _extends$1({}, upperTheme, {
7235
7174
  [themeId]: mergedTheme
7236
7175
  }) : mergedTheme;
7237
7176
  // must return a function for the private theme to NOT merge with the upper theme.
@@ -7241,9 +7180,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
7241
7180
  }
7242
7181
  return result;
7243
7182
  }
7244
- return themeId ? _extends$4({}, upperTheme, {
7183
+ return themeId ? _extends$1({}, upperTheme, {
7245
7184
  [themeId]: localTheme
7246
- }) : _extends$4({}, upperTheme, localTheme);
7185
+ }) : _extends$1({}, upperTheme, localTheme);
7247
7186
  }, [themeId, upperTheme, localTheme, isPrivate]);
7248
7187
  }
7249
7188
 
@@ -7288,8 +7227,8 @@ function adaptV4Theme(inputTheme) {
7288
7227
  props = {},
7289
7228
  styleOverrides = {}
7290
7229
  } = inputTheme,
7291
- other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$d);
7292
- const theme = _extends$5({}, other, {
7230
+ other = _objectWithoutPropertiesLoose(inputTheme, _excluded$d);
7231
+ const theme = _extends$1({}, other, {
7293
7232
  components: {}
7294
7233
  });
7295
7234
 
@@ -7323,13 +7262,13 @@ function adaptV4Theme(inputTheme) {
7323
7262
  // theme.mixins.gutters
7324
7263
  const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
7325
7264
  const spacing = theme.spacing;
7326
- theme.mixins = _extends$5({
7265
+ theme.mixins = _extends$1({
7327
7266
  gutters: (styles = {}) => {
7328
- return _extends$5({
7267
+ return _extends$1({
7329
7268
  paddingLeft: spacing(2),
7330
7269
  paddingRight: spacing(2)
7331
7270
  }, styles, {
7332
- [breakpoints.up('sm')]: _extends$5({
7271
+ [breakpoints.up('sm')]: _extends$1({
7333
7272
  paddingLeft: spacing(3),
7334
7273
  paddingRight: spacing(3)
7335
7274
  }, styles[breakpoints.up('sm')])
@@ -7340,9 +7279,9 @@ function adaptV4Theme(inputTheme) {
7340
7279
  type: typeInput,
7341
7280
  mode: modeInput
7342
7281
  } = palette,
7343
- paletteRest = _objectWithoutPropertiesLoose$1(palette, _excluded2$2);
7282
+ paletteRest = _objectWithoutPropertiesLoose(palette, _excluded2$2);
7344
7283
  const finalMode = modeInput || typeInput || 'light';
7345
- theme.palette = _extends$5({
7284
+ theme.palette = _extends$1({
7346
7285
  // theme.palette.text.hint
7347
7286
  text: {
7348
7287
  hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
@@ -7354,7 +7293,7 @@ function adaptV4Theme(inputTheme) {
7354
7293
  }
7355
7294
 
7356
7295
  function createMixins(breakpoints, mixins) {
7357
- return _extends$5({
7296
+ return _extends$1({
7358
7297
  toolbar: {
7359
7298
  minHeight: 56,
7360
7299
  [breakpoints.up('xs')]: {
@@ -7371,24 +7310,24 @@ function createMixins(breakpoints, mixins) {
7371
7310
 
7372
7311
  var colorManipulator = {};
7373
7312
 
7374
- var interopRequireDefault$1 = {exports: {}};
7313
+ var interopRequireDefault = {exports: {}};
7375
7314
 
7376
7315
  (function (module) {
7377
- function _interopRequireDefault(obj) {
7378
- return obj && obj.__esModule ? obj : {
7379
- "default": obj
7316
+ function _interopRequireDefault(e) {
7317
+ return e && e.__esModule ? e : {
7318
+ "default": e
7380
7319
  };
7381
7320
  }
7382
7321
  module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
7383
- } (interopRequireDefault$1));
7322
+ } (interopRequireDefault));
7384
7323
 
7385
- var interopRequireDefaultExports$1 = interopRequireDefault$1.exports;
7324
+ var interopRequireDefaultExports = interopRequireDefault.exports;
7386
7325
 
7387
7326
  var require$$1 = /*@__PURE__*/getAugmentedNamespace(formatMuiErrorMessage);
7388
7327
 
7389
7328
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(clamp);
7390
7329
 
7391
- var _interopRequireDefault$2 = interopRequireDefaultExports$1;
7330
+ var _interopRequireDefault$2 = interopRequireDefaultExports;
7392
7331
  Object.defineProperty(colorManipulator, "__esModule", {
7393
7332
  value: true
7394
7333
  });
@@ -8045,7 +7984,7 @@ function createPalette(palette) {
8045
7984
  contrastThreshold = 3,
8046
7985
  tonalOffset = 0.2
8047
7986
  } = palette,
8048
- other = _objectWithoutPropertiesLoose$1(palette, _excluded$c);
7987
+ other = _objectWithoutPropertiesLoose(palette, _excluded$c);
8049
7988
  const primary = palette.primary || getDefaultPrimary(mode);
8050
7989
  const secondary = palette.secondary || getDefaultSecondary(mode);
8051
7990
  const error = palette.error || getDefaultError(mode);
@@ -8067,7 +8006,7 @@ function createPalette(palette) {
8067
8006
  lightShade = 300,
8068
8007
  darkShade = 700
8069
8008
  }) => {
8070
- color = _extends$5({}, color);
8009
+ color = _extends$1({}, color);
8071
8010
  if (!color.main && color[mainShade]) {
8072
8011
  color.main = color[mainShade];
8073
8012
  }
@@ -8088,9 +8027,9 @@ function createPalette(palette) {
8088
8027
  dark: dark$1,
8089
8028
  light: light$1
8090
8029
  };
8091
- const paletteOutput = deepmerge$1(_extends$5({
8030
+ const paletteOutput = deepmerge$1(_extends$1({
8092
8031
  // A collection of common colors.
8093
- common: _extends$5({}, common),
8032
+ common: _extends$1({}, common),
8094
8033
  // prevent mutable object.
8095
8034
  // The palette mode, can be light or dark.
8096
8035
  mode,
@@ -8175,10 +8114,10 @@ function createTypography(palette, typography) {
8175
8114
  allVariants,
8176
8115
  pxToRem: pxToRem2
8177
8116
  } = _ref,
8178
- other = _objectWithoutPropertiesLoose$1(_ref, _excluded$b);
8117
+ other = _objectWithoutPropertiesLoose(_ref, _excluded$b);
8179
8118
  const coef = fontSize / 14;
8180
8119
  const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
8181
- const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$5({
8120
+ const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$1({
8182
8121
  fontFamily,
8183
8122
  fontWeight,
8184
8123
  fontSize: pxToRem(size),
@@ -8210,7 +8149,7 @@ function createTypography(palette, typography) {
8210
8149
  letterSpacing: 'inherit'
8211
8150
  }
8212
8151
  };
8213
- return deepmerge$1(_extends$5({
8152
+ return deepmerge$1(_extends$1({
8214
8153
  htmlFontSize,
8215
8154
  pxToRem,
8216
8155
  fontFamily,
@@ -8277,18 +8216,18 @@ function getAutoHeightDuration(height) {
8277
8216
  return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
8278
8217
  }
8279
8218
  function createTransitions(inputTransitions) {
8280
- const mergedEasing = _extends$5({}, easing, inputTransitions.easing);
8281
- const mergedDuration = _extends$5({}, duration, inputTransitions.duration);
8219
+ const mergedEasing = _extends$1({}, easing, inputTransitions.easing);
8220
+ const mergedDuration = _extends$1({}, duration, inputTransitions.duration);
8282
8221
  const create = (props = ['all'], options = {}) => {
8283
8222
  const {
8284
8223
  duration: durationOption = mergedDuration.standard,
8285
8224
  easing: easingOption = mergedEasing.easeInOut,
8286
8225
  delay = 0
8287
8226
  } = options;
8288
- _objectWithoutPropertiesLoose$1(options, _excluded$a);
8227
+ _objectWithoutPropertiesLoose(options, _excluded$a);
8289
8228
  return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
8290
8229
  };
8291
- return _extends$5({
8230
+ return _extends$1({
8292
8231
  getAutoHeightDuration,
8293
8232
  create
8294
8233
  }, inputTransitions, {
@@ -8318,7 +8257,7 @@ function createTheme(options = {}, ...args) {
8318
8257
  transitions: transitionsInput = {},
8319
8258
  typography: typographyInput = {}
8320
8259
  } = options,
8321
- other = _objectWithoutPropertiesLoose$1(options, _excluded$9);
8260
+ other = _objectWithoutPropertiesLoose(options, _excluded$9);
8322
8261
  if (options.vars) {
8323
8262
  throw new Error(formatMuiErrorMessage$1(18));
8324
8263
  }
@@ -8331,11 +8270,11 @@ function createTheme(options = {}, ...args) {
8331
8270
  shadows: shadows.slice(),
8332
8271
  typography: createTypography(palette, typographyInput),
8333
8272
  transitions: createTransitions(transitionsInput),
8334
- zIndex: _extends$5({}, zIndex)
8273
+ zIndex: _extends$1({}, zIndex)
8335
8274
  });
8336
8275
  muiTheme = deepmerge$1(muiTheme, other);
8337
8276
  muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
8338
- muiTheme.unstable_sxConfig = _extends$5({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
8277
+ muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
8339
8278
  muiTheme.unstable_sx = function sx(props) {
8340
8279
  return styleFunctionSx$1({
8341
8280
  sx: props,
@@ -8366,31 +8305,26 @@ function useThemeProps({
8366
8305
 
8367
8306
  var createStyled$1 = {};
8368
8307
 
8369
- var _extends$1 = {exports: {}};
8308
+ var _extends = {exports: {}};
8370
8309
 
8371
8310
  var hasRequired_extends;
8372
8311
 
8373
8312
  function require_extends () {
8374
- if (hasRequired_extends) return _extends$1.exports;
8313
+ if (hasRequired_extends) return _extends.exports;
8375
8314
  hasRequired_extends = 1;
8376
8315
  (function (module) {
8377
8316
  function _extends() {
8378
- module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
8379
- for (var i = 1; i < arguments.length; i++) {
8380
- var source = arguments[i];
8381
- for (var key in source) {
8382
- if (Object.prototype.hasOwnProperty.call(source, key)) {
8383
- target[key] = source[key];
8384
- }
8385
- }
8317
+ return (module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
8318
+ for (var e = 1; e < arguments.length; e++) {
8319
+ var t = arguments[e];
8320
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
8386
8321
  }
8387
- return target;
8388
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
8389
- return _extends.apply(this, arguments);
8322
+ return n;
8323
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _extends.apply(null, arguments);
8390
8324
  }
8391
8325
  module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
8392
- } (_extends$1));
8393
- return _extends$1.exports;
8326
+ } (_extends));
8327
+ return _extends.exports;
8394
8328
  }
8395
8329
 
8396
8330
  var objectWithoutPropertiesLoose = {exports: {}};
@@ -8401,17 +8335,14 @@ function requireObjectWithoutPropertiesLoose () {
8401
8335
  if (hasRequiredObjectWithoutPropertiesLoose) return objectWithoutPropertiesLoose.exports;
8402
8336
  hasRequiredObjectWithoutPropertiesLoose = 1;
8403
8337
  (function (module) {
8404
- function _objectWithoutPropertiesLoose(source, excluded) {
8405
- if (source == null) return {};
8406
- var target = {};
8407
- var sourceKeys = Object.keys(source);
8408
- var key, i;
8409
- for (i = 0; i < sourceKeys.length; i++) {
8410
- key = sourceKeys[i];
8411
- if (excluded.indexOf(key) >= 0) continue;
8412
- target[key] = source[key];
8338
+ function _objectWithoutPropertiesLoose(r, e) {
8339
+ if (null == r) return {};
8340
+ var t = {};
8341
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
8342
+ if (e.indexOf(n) >= 0) continue;
8343
+ t[n] = r[n];
8413
8344
  }
8414
- return target;
8345
+ return t;
8415
8346
  }
8416
8347
  module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
8417
8348
  } (objectWithoutPropertiesLoose));
@@ -8430,7 +8361,7 @@ var require$$7 = /*@__PURE__*/getAugmentedNamespace(createTheme$1);
8430
8361
 
8431
8362
  var require$$8 = /*@__PURE__*/getAugmentedNamespace(styleFunctionSx);
8432
8363
 
8433
- var _interopRequireDefault$1 = interopRequireDefaultExports$1;
8364
+ var _interopRequireDefault$1 = interopRequireDefaultExports;
8434
8365
  Object.defineProperty(createStyled$1, "__esModule", {
8435
8366
  value: true
8436
8367
  });
@@ -8681,51 +8612,27 @@ function ThemeProvider(_ref) {
8681
8612
  let {
8682
8613
  theme: themeInput
8683
8614
  } = _ref,
8684
- props = _objectWithoutPropertiesLoose$1(_ref, _excluded$7);
8615
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
8685
8616
  const scopedTheme = themeInput[THEME_ID];
8686
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$5({}, props, {
8617
+ return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$1({}, props, {
8687
8618
  themeId: scopedTheme ? THEME_ID : undefined,
8688
8619
  theme: scopedTheme || themeInput
8689
8620
  }));
8690
8621
  }
8691
8622
 
8692
- function _extends() {
8693
- _extends = Object.assign ? Object.assign.bind() : function (target) {
8694
- for (var i = 1; i < arguments.length; i++) {
8695
- var source = arguments[i];
8696
-
8697
- for (var key in source) {
8698
- if (Object.prototype.hasOwnProperty.call(source, key)) {
8699
- target[key] = source[key];
8700
- }
8701
- }
8702
- }
8703
-
8704
- return target;
8705
- };
8706
- return _extends.apply(this, arguments);
8707
- }
8708
-
8709
- function _setPrototypeOf(o, p) {
8710
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
8711
- o.__proto__ = p;
8712
- return o;
8713
- };
8714
- return _setPrototypeOf(o, p);
8623
+ function _setPrototypeOf(t, e) {
8624
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
8625
+ return t.__proto__ = e, t;
8626
+ }, _setPrototypeOf(t, e);
8715
8627
  }
8716
8628
 
8717
- function _inheritsLoose(subClass, superClass) {
8718
- subClass.prototype = Object.create(superClass.prototype);
8719
- subClass.prototype.constructor = subClass;
8720
- _setPrototypeOf(subClass, superClass);
8629
+ function _inheritsLoose(t, o) {
8630
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
8721
8631
  }
8722
8632
 
8723
- function _assertThisInitialized(self) {
8724
- if (self === void 0) {
8725
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8726
- }
8727
-
8728
- return self;
8633
+ function _assertThisInitialized(e) {
8634
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8635
+ return e;
8729
8636
  }
8730
8637
 
8731
8638
  const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
@@ -9067,7 +8974,7 @@ function create$3(definition) {
9067
8974
  return cache[key];
9068
8975
  }
9069
8976
 
9070
- const NEBULA_VERSION_HASH = "4acd" ;
8977
+ const NEBULA_VERSION_HASH = "01bb" ;
9071
8978
  ClassNameGenerator.configure(componentName => {
9072
8979
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
9073
8980
  });
@@ -9299,7 +9206,7 @@ function boot(_ref2) {
9299
9206
  const appRef = React__default.createRef();
9300
9207
  const element = document.createElement('div');
9301
9208
  element.style.display = 'none';
9302
- element.setAttribute('data-nebulajs-version', "5.1.2" );
9209
+ element.setAttribute('data-nebulajs-version', "5.2.0" );
9303
9210
  element.setAttribute('data-app-id', app.id);
9304
9211
  document.body.appendChild(element);
9305
9212
  if (context) {
@@ -9683,7 +9590,7 @@ function SvgIcon$1(_ref) {
9683
9590
  return (
9684
9591
  /*#__PURE__*/
9685
9592
  // eslint-disable-next-line react/no-array-index-key
9686
- React__default.createElement(Type, _extends$6({
9593
+ React__default.createElement(Type, _extends$2({
9687
9594
  key: ix
9688
9595
  }, attrs))
9689
9596
  );
@@ -11493,6 +11400,10 @@ function getRowsKeyboardNavigation(_ref) {
11493
11400
  }
11494
11401
  break;
11495
11402
  case KEYS.ESCAPE:
11403
+ if (typeof isModal === 'undefined') {
11404
+ cancel();
11405
+ return;
11406
+ }
11496
11407
  if (isModal()) {
11497
11408
  cancel();
11498
11409
  } else {
@@ -12441,7 +12352,7 @@ function createGridComponent(_ref2) {
12441
12352
  className: className,
12442
12353
  onScroll: this._onScroll,
12443
12354
  ref: this._outerRefSetter,
12444
- style: _extends({
12355
+ style: _extends$1({
12445
12356
  position: 'relative',
12446
12357
  height: height,
12447
12358
  width: width,
@@ -12940,7 +12851,7 @@ function createListComponent(_ref) {
12940
12851
  className: className,
12941
12852
  onScroll: onScroll,
12942
12853
  ref: this._outerRefSetter,
12943
- style: _extends({
12854
+ style: _extends$1({
12944
12855
  position: 'relative',
12945
12856
  height: height,
12946
12857
  width: width,
@@ -13495,7 +13406,7 @@ function getListBoxComponents(_ref) {
13495
13406
  local.current.listRef = ref;
13496
13407
  return /*#__PURE__*/React__default.createElement(StyledFixedSizeList
13497
13408
  // eslint-disable-next-line react/jsx-props-no-spreading
13498
- , _extends$6({}, commonComponentOptions, {
13409
+ , _extends$2({}, commonComponentOptions, {
13499
13410
  dataTestid: "fixed-size-list",
13500
13411
  scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
13501
13412
  height: listHeight,
@@ -13572,7 +13483,7 @@ function getListBoxComponents(_ref) {
13572
13483
  };
13573
13484
  return /*#__PURE__*/React__default.createElement(StyledFixedSizeGrid
13574
13485
  // eslint-disable-next-line react/jsx-props-no-spreading
13575
- , _extends$6({}, commonComponentOptions, {
13486
+ , _extends$2({}, commonComponentOptions, {
13576
13487
  dataTestid: "fixed-size-grid",
13577
13488
  scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
13578
13489
  height: gridHeight,
@@ -13994,20 +13905,7 @@ function ListBoxDisclaimer(_ref2) {
13994
13905
  }, translatorDynamic.get(text)));
13995
13906
  }
13996
13907
 
13997
- var Close = {};
13998
-
13999
- var interopRequireDefault = {exports: {}};
14000
-
14001
- (function (module) {
14002
- function _interopRequireDefault(obj) {
14003
- return obj && obj.__esModule ? obj : {
14004
- "default": obj
14005
- };
14006
- }
14007
- module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
14008
- } (interopRequireDefault));
14009
-
14010
- var interopRequireDefaultExports = interopRequireDefault.exports;
13908
+ var Close$1 = {};
14011
13909
 
14012
13910
  var createSvgIcon$1 = {};
14013
13911
 
@@ -14084,9 +13982,9 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
14084
13982
  titleAccess,
14085
13983
  viewBox = '0 0 24 24'
14086
13984
  } = props,
14087
- other = _objectWithoutPropertiesLoose$1(props, _excluded$5);
13985
+ other = _objectWithoutPropertiesLoose(props, _excluded$5);
14088
13986
  const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';
14089
- const ownerState = _extends$5({}, props, {
13987
+ const ownerState = _extends$1({}, props, {
14090
13988
  color,
14091
13989
  component,
14092
13990
  fontSize,
@@ -14100,7 +13998,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
14100
13998
  more.viewBox = viewBox;
14101
13999
  }
14102
14000
  const classes = useUtilityClasses(ownerState);
14103
- return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$5({
14001
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$1({
14104
14002
  as: component,
14105
14003
  className: clsx(classes.root, className),
14106
14004
  focusable: "false",
@@ -14119,7 +14017,7 @@ SvgIcon.muiName = 'SvgIcon';
14119
14017
 
14120
14018
  function createSvgIcon(path, displayName) {
14121
14019
  function Component(props, ref) {
14122
- return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$5({
14020
+ return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$1({
14123
14021
  "data-testid": `${displayName}Icon`,
14124
14022
  ref: ref
14125
14023
  }, props, {
@@ -14185,13 +14083,13 @@ function requireCreateSvgIcon () {
14185
14083
  }
14186
14084
 
14187
14085
  var _interopRequireDefault = interopRequireDefaultExports;
14188
- Object.defineProperty(Close, "__esModule", {
14086
+ Object.defineProperty(Close$1, "__esModule", {
14189
14087
  value: true
14190
14088
  });
14191
- var default_1 = Close.default = void 0;
14089
+ var default_1 = Close$1.default = void 0;
14192
14090
  var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
14193
14091
  var _jsxRuntime = jsxRuntimeExports;
14194
- default_1 = Close.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
14092
+ default_1 = Close$1.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
14195
14093
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
14196
14094
  }), 'Close');
14197
14095
 
@@ -14838,11 +14736,18 @@ var createListboxSelectionToolbar = (_ref => {
14838
14736
  model,
14839
14737
  translator,
14840
14738
  selectionState,
14841
- isDirectQuery = false
14739
+ isDirectQuery = false,
14740
+ selections
14842
14741
  } = _ref;
14843
14742
  if (layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne) {
14844
14743
  return [];
14845
14744
  }
14745
+ const path = '/qListObjectDef';
14746
+ const activateSelection = () => {
14747
+ if (!selections.isActive()) {
14748
+ selections.begin(path);
14749
+ }
14750
+ };
14846
14751
  const canSelectAll = () => ['qOption', 'qAlternative', 'qExcluded', 'qDeselected'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
14847
14752
  const canSelectPossible = () => ['qOption'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
14848
14753
  const canSelectAlternative = () => ['qAlternative'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
@@ -14854,8 +14759,9 @@ var createListboxSelectionToolbar = (_ref => {
14854
14759
  getSvgIconShape: selectAll,
14855
14760
  enabled: canSelectAll,
14856
14761
  action: () => {
14762
+ activateSelection();
14857
14763
  selectionState.clearItemStates(false);
14858
- model.selectListObjectAll('/qListObjectDef');
14764
+ model.selectListObjectAll(path);
14859
14765
  }
14860
14766
  }, {
14861
14767
  key: 'selectPossible',
@@ -14864,8 +14770,9 @@ var createListboxSelectionToolbar = (_ref => {
14864
14770
  getSvgIconShape: selectPossible,
14865
14771
  enabled: canSelectPossible,
14866
14772
  action: () => {
14773
+ activateSelection();
14867
14774
  selectionState.clearItemStates(false);
14868
- model.selectListObjectPossible('/qListObjectDef');
14775
+ model.selectListObjectPossible(path);
14869
14776
  }
14870
14777
  }, isDirectQuery ? false : {
14871
14778
  key: 'selectAlternative',
@@ -14874,8 +14781,9 @@ var createListboxSelectionToolbar = (_ref => {
14874
14781
  getSvgIconShape: selectAlternative,
14875
14782
  enabled: canSelectAlternative,
14876
14783
  action: () => {
14784
+ activateSelection();
14877
14785
  selectionState.clearItemStates(false);
14878
- model.selectListObjectAlternative('/qListObjectDef');
14786
+ model.selectListObjectAlternative(path);
14879
14787
  }
14880
14788
  }, isDirectQuery ? false : {
14881
14789
  key: 'selectExcluded',
@@ -14884,8 +14792,9 @@ var createListboxSelectionToolbar = (_ref => {
14884
14792
  getSvgIconShape: selectExcluded,
14885
14793
  enabled: canSelectExcluded,
14886
14794
  action: () => {
14795
+ activateSelection();
14887
14796
  selectionState.clearItemStates(false);
14888
- model.selectListObjectExcluded('/qListObjectDef');
14797
+ model.selectListObjectExcluded(path);
14889
14798
  }
14890
14799
  }].filter(Boolean);
14891
14800
  });
@@ -14975,6 +14884,7 @@ const close = props => _objectSpread2(_objectSpread2({}, props), {}, {
14975
14884
  }
14976
14885
  }]
14977
14886
  });
14887
+ var Close = (props => SvgIcon$1(close(props)));
14978
14888
 
14979
14889
  const clearSelections = props => _objectSpread2(_objectSpread2({}, props), {}, {
14980
14890
  shapes: [{
@@ -15096,7 +15006,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
15096
15006
  const autoFocusIndex = actions.findIndex(action => !action.disabled);
15097
15007
  return showActions && /*#__PURE__*/React__default.createElement(StyledPopover$1
15098
15008
  // eslint-disable-next-line react/jsx-props-no-spreading
15099
- , _extends$6({}, popoverProps, {
15009
+ , _extends$2({}, popoverProps, {
15100
15010
  onClose: onCloseOrActionClick,
15101
15011
  ref: ref,
15102
15012
  open: show,
@@ -15362,7 +15272,7 @@ function ActionsToolbar(_ref3) {
15362
15272
  moreEnabled = true;
15363
15273
  moreActions = [...newMoreActions, ...more$1.actions];
15364
15274
  }
15365
- if (!selections.show && newActions.length === 0) return null;
15275
+ if (!selections.show && newActions.length === 0 && !moreEnabled) return null;
15366
15276
  const handleCloseShowMoreItems = () => {
15367
15277
  setShowMoreItems(false);
15368
15278
  };
@@ -15466,7 +15376,6 @@ const StyledOutlinedInput = styled(OutlinedInput, {
15466
15376
  shouldForwardProp: p => !['styles', 'dense', 'isRtl'].includes(p)
15467
15377
  })(_ref => {
15468
15378
  let {
15469
- theme,
15470
15379
  styles,
15471
15380
  dense,
15472
15381
  isRtl
@@ -15475,10 +15384,11 @@ const StyledOutlinedInput = styled(OutlinedInput, {
15475
15384
  if (dense) {
15476
15385
  denseProps = {
15477
15386
  fontSize: 12,
15478
- paddingLeft: theme.spacing(1),
15479
15387
  '& input': {
15480
15388
  paddingTop: '5px',
15481
- paddingBottom: '5px'
15389
+ paddingBottom: '5px',
15390
+ color: styles.search.color,
15391
+ textAlign: isRtl ? 'right' : 'left'
15482
15392
  }
15483
15393
  };
15484
15394
  }
@@ -15489,7 +15399,8 @@ const StyledOutlinedInput = styled(OutlinedInput, {
15489
15399
  borderRadius: 0,
15490
15400
  backgroundColor: styles.search.backgroundColor,
15491
15401
  backdropFilter: styles.background.backgroundImage ? styles.search.backdropFilter : undefined,
15492
- paddingLeft: "".concat(CELL_PADDING_LEFT, "px"),
15402
+ paddingLeft: 0,
15403
+ paddingRight: 0,
15493
15404
  flexDirection: isRtl ? 'row-reverse' : 'row',
15494
15405
  '& fieldset': {
15495
15406
  borderColor: "".concat(styles.search.borderColor),
@@ -15509,8 +15420,22 @@ const StyledOutlinedInput = styled(OutlinedInput, {
15509
15420
  }
15510
15421
  }, denseProps);
15511
15422
  });
15423
+ const StyledIconButton = styled(IconButton)(() => ({
15424
+ border: 0,
15425
+ padding: '8px',
15426
+ cursor: 'pointer',
15427
+ lineHeight: '12px',
15428
+ '&:hover': {
15429
+ backgroundColor: 'transparent'
15430
+ },
15431
+ ':focus-visible': {
15432
+ borderRadius: '4px',
15433
+ boxShadow: 'inset 0 0 0 2px rgb(2, 117, 217)'
15434
+ }
15435
+ }));
15512
15436
  function ListBoxSearch(_ref2) {
15513
15437
  let {
15438
+ popoverOpen,
15514
15439
  selections,
15515
15440
  selectionState,
15516
15441
  model,
@@ -15530,6 +15455,8 @@ function ListBoxSearch(_ref2) {
15530
15455
  const [value, setValue] = useState$1('');
15531
15456
  const [wildcardOn, setWildcardOn] = useState$1(false);
15532
15457
  const inputRef = useRef();
15458
+ const clearSearchRef = useRef();
15459
+ const clearSearchText = translator.get('Listbox.Clear.Search');
15533
15460
  const {
15534
15461
  getStoreValue,
15535
15462
  setStoreValue
@@ -15617,12 +15544,17 @@ function ListBoxSearch(_ref2) {
15617
15544
  {
15618
15545
  focusRow(container);
15619
15546
  cancel();
15547
+ if (popoverOpen) {
15548
+ return undefined;
15549
+ }
15620
15550
  break;
15621
15551
  }
15622
15552
  case 'Tab':
15623
15553
  {
15624
15554
  if (e.shiftKey) {
15625
15555
  keyboard.focusSelection();
15556
+ } else if (clearSearchRef.current) {
15557
+ clearSearchRef.current.focus();
15626
15558
  } else {
15627
15559
  // Focus the row we last visited or the first one.
15628
15560
  focusRow(container);
@@ -15653,6 +15585,42 @@ function ListBoxSearch(_ref2) {
15653
15585
  e.stopPropagation();
15654
15586
  return undefined;
15655
15587
  };
15588
+ const focusOnInput = () => {
15589
+ var _inputRef$current;
15590
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
15591
+ };
15592
+ const onClearSearch = () => {
15593
+ abortSearch();
15594
+ focusOnInput();
15595
+ };
15596
+ const onKeyDownClearSearch = async e => {
15597
+ const container = e.currentTarget.closest('.listbox-container');
15598
+ switch (e.key) {
15599
+ case 'Enter':
15600
+ onClearSearch();
15601
+ break;
15602
+ case 'Tab':
15603
+ {
15604
+ if (e.shiftKey) {
15605
+ focusOnInput();
15606
+ } else {
15607
+ // Focus the row we last visited or the first one.
15608
+ focusRow(container);
15609
+
15610
+ // Clean up.
15611
+ container === null || container === void 0 || container.querySelectorAll('.last-focused').forEach(elm => {
15612
+ elm.classList.remove('last-focused');
15613
+ });
15614
+ }
15615
+ break;
15616
+ }
15617
+ default:
15618
+ return undefined;
15619
+ }
15620
+ e.preventDefault();
15621
+ e.stopPropagation();
15622
+ return undefined;
15623
+ };
15656
15624
  if (!visible || searchEnabled === false) {
15657
15625
  return null;
15658
15626
  }
@@ -15661,10 +15629,28 @@ function ListBoxSearch(_ref2) {
15661
15629
  dense: dense,
15662
15630
  isRtl: isRtl,
15663
15631
  startAdornment: /*#__PURE__*/React__default.createElement(InputAdornment, {
15664
- position: "start"
15632
+ position: "start",
15633
+ sx: {
15634
+ marginLeft: dense ? '8px' : "".concat(CELL_PADDING_LEFT, "px")
15635
+ }
15665
15636
  }, /*#__PURE__*/React__default.createElement(SearchIcon, {
15666
15637
  size: dense ? 'small' : 'normal'
15667
15638
  })),
15639
+ endAdornment: /*#__PURE__*/React__default.createElement(InputAdornment, {
15640
+ position: "end",
15641
+ sx: {
15642
+ marginLeft: 0
15643
+ }
15644
+ }, value !== '' && /*#__PURE__*/React__default.createElement(StyledIconButton, {
15645
+ tabIndex: 0,
15646
+ ref: clearSearchRef,
15647
+ title: clearSearchText,
15648
+ "aria-label": clearSearchText,
15649
+ onClick: onClearSearch,
15650
+ onKeyDown: onKeyDownClearSearch
15651
+ }, /*#__PURE__*/React__default.createElement(Close, {
15652
+ size: dense ? 'small' : 'normal'
15653
+ }))),
15668
15654
  className: "search",
15669
15655
  inputRef: inputRef,
15670
15656
  size: "small",
@@ -18003,6 +17989,13 @@ const LIGHT = '#FFF';
18003
17989
  const DARK = '#000';
18004
17990
  const CONTRAST_THRESHOLD = 1.5;
18005
17991
  const LIGHT_PREFERRED_THRESHOLD = 3;
17992
+ const DEFAULT_SELECTION_COLORS = {
17993
+ selected: '#009845',
17994
+ alternative: '#E4E4E4',
17995
+ excluded: '#A9A9A9',
17996
+ selectedExcluded: '#A9A9A9',
17997
+ possible: '#FFFFFF'
17998
+ };
18006
17999
  const getContrast = (desired, background) => {
18007
18000
  let contrast = false;
18008
18001
  const des = new Color(desired);
@@ -18054,52 +18047,35 @@ function getOverridesAsObject() {
18054
18047
  return overrides;
18055
18048
  }
18056
18049
  function getSelectionColors(_ref) {
18057
- var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections, _theme$palette2, _theme$palette3, _theme$palette4, _theme$palette5, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10, _theme$palette11;
18050
+ var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections;
18058
18051
  let {
18059
18052
  getColorPickerColor,
18060
18053
  theme,
18061
18054
  getListboxStyle,
18062
18055
  overrides,
18063
- checkboxes
18056
+ checkboxes,
18057
+ themeSelectionColorsEnabled
18064
18058
  } = _ref;
18065
18059
  const componentContentTextColor = (_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0 ? void 0 : _overrides$theme.fontColor;
18060
+
18061
+ // color priority: layout.component > theme content color > MUI theme
18066
18062
  const desiredTextColor = getColorPickerColor(componentContentTextColor) || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
18067
18063
  const useContrastTextColor = !checkboxes && ((_overrides$theme$cont = (_overrides$theme2 = overrides.theme) === null || _overrides$theme2 === void 0 || (_overrides$theme2 = _overrides$theme2.content) === null || _overrides$theme2 === void 0 ? void 0 : _overrides$theme2.useContrastColor) !== null && _overrides$theme$cont !== void 0 ? _overrides$theme$cont : true);
18068
-
18069
- // Background colors
18070
- const selectionColors = ((_overrides$selections = overrides.selections) === null || _overrides$selections === void 0 ? void 0 : _overrides$selections.colors) || {};
18071
- const selected = getColorPickerColor(selectionColors.selected) || ((_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.selected.main) || '#009845';
18072
- const alternative = getColorPickerColor(selectionColors.alternative) || ((_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.selected.alternative) || '#E4E4E4';
18073
- const excluded = getColorPickerColor(selectionColors.excluded) || ((_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.selected.excluded) || '#A9A9A9';
18074
- const selectedExcluded = getColorPickerColor(selectionColors.selectedExcluded) || ((_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.selected.selectedExcluded) || '#A9A9A9';
18075
- const possible = getColorPickerColor(selectionColors.possible) || getListboxStyle('', 'backgroundColor') || ((_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.selected.possible) || '#FFFFFF';
18076
-
18077
- // Font colors
18078
- let selectedContrast = desiredTextColor || ((_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.selected.selectedContrastText);
18079
- let alternativeContrast = desiredTextColor || ((_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.selected.alternativeContrastText);
18080
- let excludedContrast = desiredTextColor || ((_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.selected.excludedContrastText);
18081
- let selectedExcludedContrast = desiredTextColor || ((_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.selected.selectedExcludedContrastText);
18082
- let possibleContrast = desiredTextColor || ((_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.selected.possibleContrastText);
18083
- if (useContrastTextColor) {
18084
- // Override preferred text color if it does not contrast enough with the background color.
18085
- selectedContrast = getContrastingColor(selected, desiredTextColor);
18086
- alternativeContrast = getContrastingColor(alternative, desiredTextColor);
18087
- excludedContrast = getContrastingColor(excluded, desiredTextColor);
18088
- selectedExcludedContrast = getContrastingColor(selectedExcluded, desiredTextColor);
18089
- possibleContrast = getContrastingColor(possible, desiredTextColor);
18090
- }
18091
- return {
18092
- selected,
18093
- alternative,
18094
- excluded,
18095
- selectedExcluded,
18096
- possible,
18097
- selectedContrast,
18098
- alternativeContrast,
18099
- excludedContrast,
18100
- selectedExcludedContrast,
18101
- possibleContrast
18064
+ const getSelectionThemeColor = state => themeSelectionColorsEnabled ? getListboxStyle('', "dataColors.".concat(state)) : undefined;
18065
+ const componentSelectionColors = ((_overrides$selections = overrides.selections) === null || _overrides$selections === void 0 ? void 0 : _overrides$selections.colors) || {};
18066
+ const getSelectionStateColors = state => {
18067
+ var _theme$palette2, _theme$palette3;
18068
+ const paletteState = state === 'selected' ? 'main' : state;
18069
+ const contrastState = "".concat(state, "Contrast");
18070
+ // color priority: layout.component > theme dataColors > theme background (only for 'possible') > MUI theme > hardcoded default
18071
+ const color = getColorPickerColor(componentSelectionColors[state]) || getSelectionThemeColor(state) || state === 'possible' && getListboxStyle('', 'backgroundColor') || ((_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.selected[paletteState]) || DEFAULT_SELECTION_COLORS[state];
18072
+ const contrastColor = useContrastTextColor ? getContrastingColor(color, desiredTextColor) : desiredTextColor || ((_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.selected["".concat(contrastState, "Text}")]);
18073
+ return {
18074
+ [state]: color,
18075
+ [contrastState]: contrastColor
18076
+ };
18102
18077
  };
18078
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getSelectionStateColors('selected')), getSelectionStateColors('alternative')), getSelectionStateColors('excluded')), getSelectionStateColors('selectedExcluded')), getSelectionStateColors('possible'));
18103
18079
  }
18104
18080
  function getBackgroundColor(_ref2) {
18105
18081
  let {
@@ -18137,7 +18113,8 @@ function getStyles(_ref3) {
18137
18113
  themeApi,
18138
18114
  theme,
18139
18115
  components = [],
18140
- checkboxes = false
18116
+ checkboxes = false,
18117
+ themeSelectionColorsEnabled = false
18141
18118
  } = _ref3;
18142
18119
  const overrides = getOverridesAsObject(components);
18143
18120
  const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
@@ -18147,7 +18124,8 @@ function getStyles(_ref3) {
18147
18124
  theme,
18148
18125
  getListboxStyle,
18149
18126
  overrides,
18150
- checkboxes
18127
+ checkboxes,
18128
+ themeSelectionColorsEnabled
18151
18129
  });
18152
18130
  const themeOverrides = overrides.theme || {};
18153
18131
  const headerColor = getColorPickerColor((_themeOverrides$heade = themeOverrides.header) === null || _themeOverrides$heade === void 0 ? void 0 : _themeOverrides$heade.fontColor) || getListboxStyle('title.main', 'color');
@@ -18221,7 +18199,8 @@ function ListBoxPopover(_ref) {
18221
18199
  autoFocus,
18222
18200
  components,
18223
18201
  checkboxes: checkboxesOption,
18224
- selectDisabled = () => false
18202
+ selectDisabled = () => false,
18203
+ flags
18225
18204
  } = _ref;
18226
18205
  const isMasterDim = Boolean(fieldName === null || fieldName === void 0 ? void 0 : fieldName.qLibraryId);
18227
18206
  const open = show && Boolean(alignTo.current);
@@ -18273,11 +18252,13 @@ function ListBoxPopover(_ref) {
18273
18252
  const {
18274
18253
  checkboxes = checkboxesOption
18275
18254
  } = layout || {};
18255
+ const themeSelectionColorsEnabled = flags.isEnabled('PS_22149_THEME_SELECTION_COLORS');
18276
18256
  const styles = getStyles({
18277
18257
  themeApi,
18278
18258
  theme,
18279
18259
  components,
18280
- checkboxes
18260
+ checkboxes,
18261
+ themeSelectionColorsEnabled
18281
18262
  });
18282
18263
  useEffect$1(() => {
18283
18264
  if (selections && open) {
@@ -18379,6 +18360,7 @@ function ListBoxPopover(_ref) {
18379
18360
  item: true,
18380
18361
  ref: searchContainerRef
18381
18362
  }, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
18363
+ popoverOpen: open,
18382
18364
  styles: styles,
18383
18365
  visible: true,
18384
18366
  model: model,
@@ -19865,7 +19847,8 @@ function getListboxActionProps(_ref) {
19865
19847
  },
19866
19848
  extraItems,
19867
19849
  more: {
19868
- enabled: !isLocked,
19850
+ enabled: !isLocked && (showToolbar || selections.isActive()),
19851
+ // show more button even when popover is not in selection mode
19869
19852
  actions: listboxSelectionToolbarItems,
19870
19853
  popoverProps: {
19871
19854
  elevation: 0
@@ -19876,7 +19859,7 @@ function getListboxActionProps(_ref) {
19876
19859
  }
19877
19860
  },
19878
19861
  selections: {
19879
- show: showToolbar,
19862
+ show: showToolbar && selections.isActive(),
19880
19863
  api: selections,
19881
19864
  onConfirm: () => {
19882
19865
  keyboard === null || keyboard === void 0 || keyboard.focus();
@@ -20155,8 +20138,7 @@ function ListBoxHeader(_ref2) {
20155
20138
  selections,
20156
20139
  keyboard,
20157
20140
  autoConfirm,
20158
- app,
20159
- isInSelection
20141
+ app
20160
20142
  } = _ref2;
20161
20143
  const [isToolbarDetached, setIsToolbarDetached] = useState$1(showDetachedToolbarOnly);
20162
20144
  const [isLocked, setLocked] = useState$1(layout === null || layout === void 0 || (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 || (_layout$qListObject = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject === void 0 ? void 0 : _layout$qListObject.qLocked);
@@ -20194,7 +20176,8 @@ function ListBoxHeader(_ref2) {
20194
20176
  model,
20195
20177
  translator,
20196
20178
  selectionState,
20197
- isDirectQuery
20179
+ isDirectQuery,
20180
+ selections
20198
20181
  });
20199
20182
  const extraItems = isLocked || !showLock ? undefined : [{
20200
20183
  key: 'lock',
@@ -20238,6 +20221,7 @@ function ListBoxHeader(_ref2) {
20238
20221
  isDetached: isPopover ? false : isToolbarDetached,
20239
20222
  showToolbar,
20240
20223
  containerRef,
20224
+ isPopover,
20241
20225
  isLocked,
20242
20226
  extraItems,
20243
20227
  listboxSelectionToolbarItems,
@@ -20245,7 +20229,7 @@ function ListBoxHeader(_ref2) {
20245
20229
  keyboard,
20246
20230
  autoConfirm
20247
20231
  });
20248
- const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$6({
20232
+ const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$2({
20249
20233
  isRtl: isRtl,
20250
20234
  layout: layout
20251
20235
  }, toolbarProps));
@@ -20283,7 +20267,7 @@ function ListBoxHeader(_ref2) {
20283
20267
  }, lockedIconComp || showSearchIcon && searchIconComp, /*#__PURE__*/React__default.createElement(DimensionIcon, {
20284
20268
  iconData: iconData,
20285
20269
  iconStyle: iconStyle,
20286
- disabled: isInSelection && isPopover,
20270
+ disabled: selections.isActive() && isPopover,
20287
20271
  translator: translator
20288
20272
  })), /*#__PURE__*/React__default.createElement(Grid, {
20289
20273
  item: true,
@@ -20380,7 +20364,8 @@ function ListBoxInline(_ref3) {
20380
20364
  isPopover = false,
20381
20365
  showLock = false,
20382
20366
  components,
20383
- selectDisabled = () => false
20367
+ selectDisabled = () => false,
20368
+ flags
20384
20369
  } = options;
20385
20370
 
20386
20371
  // Hook that will trigger update when used in useEffects.
@@ -20404,12 +20389,14 @@ function ListBoxInline(_ref3) {
20404
20389
  const {
20405
20390
  checkboxes = checkboxesOption
20406
20391
  } = layout || {};
20392
+ const themeSelectionColorsEnabled = flags.isEnabled('PS_22149_THEME_SELECTION_COLORS');
20407
20393
  const styles = getStyles({
20408
20394
  app,
20409
20395
  themeApi,
20410
20396
  theme,
20411
20397
  components,
20412
- checkboxes
20398
+ checkboxes,
20399
+ themeSelectionColorsEnabled
20413
20400
  });
20414
20401
  const isDirectQuery = isDirectQueryEnabled({
20415
20402
  appLayout: app === null || app === void 0 ? void 0 : app.layout
@@ -20444,7 +20431,6 @@ function ListBoxInline(_ref3) {
20444
20431
  }), [app, appSelections]);
20445
20432
  const isInvalid = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qError;
20446
20433
  const errorText = isInvalid && constraints.active ? 'Visualization.Invalid.Dimension' : 'Visualization.Incomplete';
20447
- const [isInSelection, setIsInSelection] = useState$1(false);
20448
20434
  const {
20449
20435
  handleKeyDown,
20450
20436
  handleOnMouseEnter,
@@ -20473,11 +20459,9 @@ function ListBoxInline(_ref3) {
20473
20459
  }
20474
20460
  const show = () => {
20475
20461
  setShowToolbar(true);
20476
- setIsInSelection(true);
20477
20462
  };
20478
20463
  const hide = () => {
20479
20464
  setShowToolbar(false);
20480
- setIsInSelection(false);
20481
20465
  if (search === 'toggle') {
20482
20466
  setShowSearch(false);
20483
20467
  }
@@ -20495,7 +20479,7 @@ function ListBoxInline(_ref3) {
20495
20479
  selections.on('activated', show);
20496
20480
  selections.on('deactivated', hide);
20497
20481
  }
20498
- setShowToolbar(selections.isActive());
20482
+ setShowToolbar(isPopover || selections.isActive());
20499
20483
  }
20500
20484
  return () => {
20501
20485
  if (selections && selections.removeListener) {
@@ -20579,8 +20563,7 @@ function ListBoxInline(_ref3) {
20579
20563
  model: model,
20580
20564
  selectionState: selectionState$1,
20581
20565
  selections: selections,
20582
- keyboard: keyboard,
20583
- isInSelection: isInSelection
20566
+ keyboard: keyboard
20584
20567
  });
20585
20568
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && listBoxHeader, /*#__PURE__*/React__default.createElement(StyledGrid$3, {
20586
20569
  className: "listbox-container",
@@ -21122,7 +21105,8 @@ function ListBoxWrapper(_ref) {
21122
21105
  stateName,
21123
21106
  element,
21124
21107
  options,
21125
- renderedCallback
21108
+ renderedCallback,
21109
+ flags
21126
21110
  } = _ref;
21127
21111
  const {
21128
21112
  isExistingObject,
@@ -21159,7 +21143,8 @@ function ListBoxWrapper(_ref) {
21159
21143
  selections,
21160
21144
  model,
21161
21145
  app,
21162
- renderedCallback
21146
+ renderedCallback,
21147
+ flags
21163
21148
  }), [options, selections, model, app]);
21164
21149
  if (!selections || !model) {
21165
21150
  return null;
@@ -21176,7 +21161,8 @@ function ListBoxPortal(_ref2) {
21176
21161
  qId,
21177
21162
  stateName = '$',
21178
21163
  options = {},
21179
- renderedCallback
21164
+ renderedCallback,
21165
+ flags
21180
21166
  } = _ref2;
21181
21167
  return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(ListBoxWrapper, {
21182
21168
  app: app,
@@ -21185,7 +21171,8 @@ function ListBoxPortal(_ref2) {
21185
21171
  qId: qId,
21186
21172
  stateName: stateName,
21187
21173
  options: options,
21188
- renderedCallback: renderedCallback
21174
+ renderedCallback: renderedCallback,
21175
+ flags: flags
21189
21176
  }), element, uid());
21190
21177
  }
21191
21178
 
@@ -21212,7 +21199,8 @@ function ListBoxPopoverWrapper(_ref) {
21212
21199
  fieldIdentifier,
21213
21200
  stateName,
21214
21201
  element,
21215
- options = {}
21202
+ options = {},
21203
+ flags
21216
21204
  } = _ref;
21217
21205
  const [showState, setShowstate] = useState$1(!!options.show);
21218
21206
  const handleCloseShowState = () => {
@@ -21233,7 +21221,8 @@ function ListBoxPopoverWrapper(_ref) {
21233
21221
  fieldName: fieldIdentifier,
21234
21222
  stateName: stateName,
21235
21223
  autoFocus: options.autoFocus,
21236
- components: options.components
21224
+ components: options.components,
21225
+ flags: flags
21237
21226
  });
21238
21227
  }
21239
21228
 
@@ -22615,13 +22604,13 @@ function Progress(_ref2) {
22615
22604
  const s = SIZES[size];
22616
22605
  return /*#__PURE__*/React__default.createElement(Root, {
22617
22606
  className: classes$3.root
22618
- }, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$6({
22607
+ }, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$2({
22619
22608
  variant: "determinate",
22620
22609
  value: 100,
22621
22610
  className: classes$3.back,
22622
22611
  size: s,
22623
22612
  thickness: 3
22624
- }, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$6({
22613
+ }, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$2({
22625
22614
  variant: "indeterminate",
22626
22615
  disableShrink: true,
22627
22616
  className: classes$3.front,
@@ -22671,7 +22660,7 @@ function Cancel(_ref) {
22671
22660
  variant: "h6",
22672
22661
  align: "center",
22673
22662
  "data-tid": "update-active"
22674
- }, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$6({
22663
+ }, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$2({
22675
22664
  item: true
22676
22665
  }, props), /*#__PURE__*/React__default.createElement(Button, {
22677
22666
  variant: "contained",
@@ -22698,7 +22687,7 @@ function Retry(_ref2) {
22698
22687
  "data-tid": "update-cancelled"
22699
22688
  }, translator.get('Object.Update.Cancelled'))), /*#__PURE__*/React__default.createElement(Grid, {
22700
22689
  item: true
22701
- }, /*#__PURE__*/React__default.createElement(Button, _extends$6({
22690
+ }, /*#__PURE__*/React__default.createElement(Button, _extends$2({
22702
22691
  variant: "contained",
22703
22692
  onClick: retry
22704
22693
  }, props), translator.get('Retry'))));
@@ -27057,52 +27046,59 @@ function flagsFn () {
27057
27046
  }
27058
27047
 
27059
27048
  class LRUCache {
27060
- constructor() {
27049
+ constructor () {
27061
27050
  this.max = 1000;
27062
27051
  this.map = new Map();
27063
27052
  }
27064
- get(key) {
27053
+
27054
+ get (key) {
27065
27055
  const value = this.map.get(key);
27066
27056
  if (value === undefined) {
27067
- return undefined;
27057
+ return undefined
27068
27058
  } else {
27069
27059
  // Remove the key from the map and add it to the end
27070
27060
  this.map.delete(key);
27071
27061
  this.map.set(key, value);
27072
- return value;
27062
+ return value
27073
27063
  }
27074
27064
  }
27075
- delete(key) {
27076
- return this.map.delete(key);
27065
+
27066
+ delete (key) {
27067
+ return this.map.delete(key)
27077
27068
  }
27078
- set(key, value) {
27069
+
27070
+ set (key, value) {
27079
27071
  const deleted = this.delete(key);
27072
+
27080
27073
  if (!deleted && value !== undefined) {
27081
27074
  // If cache is full, delete the least recently used item
27082
27075
  if (this.map.size >= this.max) {
27083
27076
  const firstKey = this.map.keys().next().value;
27084
27077
  this.delete(firstKey);
27085
27078
  }
27079
+
27086
27080
  this.map.set(key, value);
27087
27081
  }
27088
- return this;
27082
+
27083
+ return this
27089
27084
  }
27090
27085
  }
27086
+
27091
27087
  var lrucache = LRUCache;
27092
27088
 
27093
27089
  // parse out just the options we care about
27094
- const looseOption = Object.freeze({
27095
- loose: true
27096
- });
27097
- const emptyOpts = Object.freeze({});
27090
+ const looseOption = Object.freeze({ loose: true });
27091
+ const emptyOpts = Object.freeze({ });
27098
27092
  const parseOptions$1 = options => {
27099
27093
  if (!options) {
27100
- return emptyOpts;
27094
+ return emptyOpts
27101
27095
  }
27096
+
27102
27097
  if (typeof options !== 'object') {
27103
- return looseOption;
27098
+ return looseOption
27104
27099
  }
27105
- return options;
27100
+
27101
+ return options
27106
27102
  };
27107
27103
  var parseOptions_1 = parseOptions$1;
27108
27104
 
@@ -27111,8 +27107,10 @@ var re$1 = {exports: {}};
27111
27107
  // Note: this is the semver.org version of the spec that it implements
27112
27108
  // Not necessarily the package version of this code.
27113
27109
  const SEMVER_SPEC_VERSION = '2.0.0';
27110
+
27114
27111
  const MAX_LENGTH$1 = 256;
27115
- const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */9007199254740991;
27112
+ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
27113
+ /* istanbul ignore next */ 9007199254740991;
27116
27114
 
27117
27115
  // Max safe segment length for coercion.
27118
27116
  const MAX_SAFE_COMPONENT_LENGTH = 16;
@@ -27120,7 +27118,17 @@ const MAX_SAFE_COMPONENT_LENGTH = 16;
27120
27118
  // Max safe length for a build identifier. The max length minus 6 characters for
27121
27119
  // the shortest version with a build 0.0.0+BUILD.
27122
27120
  const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
27123
- const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];
27121
+
27122
+ const RELEASE_TYPES = [
27123
+ 'major',
27124
+ 'premajor',
27125
+ 'minor',
27126
+ 'preminor',
27127
+ 'patch',
27128
+ 'prepatch',
27129
+ 'prerelease',
27130
+ ];
27131
+
27124
27132
  var constants = {
27125
27133
  MAX_LENGTH: MAX_LENGTH$1,
27126
27134
  MAX_SAFE_COMPONENT_LENGTH,
@@ -27129,352 +27137,443 @@ var constants = {
27129
27137
  RELEASE_TYPES,
27130
27138
  SEMVER_SPEC_VERSION,
27131
27139
  FLAG_INCLUDE_PRERELEASE: 0b001,
27132
- FLAG_LOOSE: 0b010
27140
+ FLAG_LOOSE: 0b010,
27133
27141
  };
27134
27142
 
27135
- const debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? function () {
27136
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27137
- args[_key] = arguments[_key];
27138
- }
27139
- return console.error('SEMVER', ...args);
27140
- } : () => {};
27143
+ const debug$1 = (
27144
+ typeof process === 'object' &&
27145
+ process.env &&
27146
+ process.env.NODE_DEBUG &&
27147
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)
27148
+ ) ? (...args) => console.error('SEMVER', ...args)
27149
+ : () => {};
27150
+
27141
27151
  var debug_1 = debug$1;
27142
27152
 
27143
27153
  (function (module, exports) {
27144
- const {
27145
- MAX_SAFE_COMPONENT_LENGTH,
27146
- MAX_SAFE_BUILD_LENGTH,
27147
- MAX_LENGTH
27148
- } = constants;
27149
- const debug = debug_1;
27150
- exports = module.exports = {};
27151
-
27152
- // The actual regexps go on exports.re
27153
- const re = exports.re = [];
27154
- const safeRe = exports.safeRe = [];
27155
- const src = exports.src = [];
27156
- const t = exports.t = {};
27157
- let R = 0;
27158
- const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
27159
-
27160
- // Replace some greedy regex tokens to prevent regex dos issues. These regex are
27161
- // used internally via the safeRe object since all inputs in this library get
27162
- // normalized first to trim and collapse all extra whitespace. The original
27163
- // regexes are exported for userland consumption and lower level usage. A
27164
- // future breaking change could export the safer regex only with a note that
27165
- // all input should have extra whitespace removed.
27166
- const safeRegexReplacements = [['\\s', 1], ['\\d', MAX_LENGTH], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]];
27167
- const makeSafeRegex = value => {
27168
- for (const [token, max] of safeRegexReplacements) {
27169
- value = value.split("".concat(token, "*")).join("".concat(token, "{0,").concat(max, "}")).split("".concat(token, "+")).join("".concat(token, "{1,").concat(max, "}"));
27170
- }
27171
- return value;
27172
- };
27173
- const createToken = (name, value, isGlobal) => {
27174
- const safe = makeSafeRegex(value);
27175
- const index = R++;
27176
- debug(name, index, value);
27177
- t[name] = index;
27178
- src[index] = value;
27179
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
27180
- safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
27181
- };
27154
+ const {
27155
+ MAX_SAFE_COMPONENT_LENGTH,
27156
+ MAX_SAFE_BUILD_LENGTH,
27157
+ MAX_LENGTH,
27158
+ } = constants;
27159
+ const debug = debug_1;
27160
+ exports = module.exports = {};
27161
+
27162
+ // The actual regexps go on exports.re
27163
+ const re = exports.re = [];
27164
+ const safeRe = exports.safeRe = [];
27165
+ const src = exports.src = [];
27166
+ const t = exports.t = {};
27167
+ let R = 0;
27168
+
27169
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
27170
+
27171
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
27172
+ // used internally via the safeRe object since all inputs in this library get
27173
+ // normalized first to trim and collapse all extra whitespace. The original
27174
+ // regexes are exported for userland consumption and lower level usage. A
27175
+ // future breaking change could export the safer regex only with a note that
27176
+ // all input should have extra whitespace removed.
27177
+ const safeRegexReplacements = [
27178
+ ['\\s', 1],
27179
+ ['\\d', MAX_LENGTH],
27180
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
27181
+ ];
27182
+
27183
+ const makeSafeRegex = (value) => {
27184
+ for (const [token, max] of safeRegexReplacements) {
27185
+ value = value
27186
+ .split(`${token}*`).join(`${token}{0,${max}}`)
27187
+ .split(`${token}+`).join(`${token}{1,${max}}`);
27188
+ }
27189
+ return value
27190
+ };
27191
+
27192
+ const createToken = (name, value, isGlobal) => {
27193
+ const safe = makeSafeRegex(value);
27194
+ const index = R++;
27195
+ debug(name, index, value);
27196
+ t[name] = index;
27197
+ src[index] = value;
27198
+ re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
27199
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
27200
+ };
27201
+
27202
+ // The following Regular Expressions can be used for tokenizing,
27203
+ // validating, and parsing SemVer version strings.
27204
+
27205
+ // ## Numeric Identifier
27206
+ // A single `0`, or a non-zero digit followed by zero or more digits.
27207
+
27208
+ createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
27209
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
27210
+
27211
+ // ## Non-numeric Identifier
27212
+ // Zero or more digits, followed by a letter or hyphen, and then zero or
27213
+ // more letters, digits, or hyphens.
27214
+
27215
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
27216
+
27217
+ // ## Main Version
27218
+ // Three dot-separated numeric identifiers.
27219
+
27220
+ createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
27221
+ `(${src[t.NUMERICIDENTIFIER]})\\.` +
27222
+ `(${src[t.NUMERICIDENTIFIER]})`);
27223
+
27224
+ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
27225
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
27226
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
27227
+
27228
+ // ## Pre-release Version Identifier
27229
+ // A numeric identifier, or a non-numeric identifier.
27230
+
27231
+ createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
27232
+ }|${src[t.NONNUMERICIDENTIFIER]})`);
27233
+
27234
+ createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
27235
+ }|${src[t.NONNUMERICIDENTIFIER]})`);
27236
+
27237
+ // ## Pre-release Version
27238
+ // Hyphen, followed by one or more dot-separated pre-release version
27239
+ // identifiers.
27240
+
27241
+ createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
27242
+ }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
27243
+
27244
+ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
27245
+ }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
27246
+
27247
+ // ## Build Metadata Identifier
27248
+ // Any combination of digits, letters, or hyphens.
27249
+
27250
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
27251
+
27252
+ // ## Build Metadata
27253
+ // Plus sign, followed by one or more period-separated build metadata
27254
+ // identifiers.
27255
+
27256
+ createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
27257
+ }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
27258
+
27259
+ // ## Full Version String
27260
+ // A main version, followed optionally by a pre-release version and
27261
+ // build metadata.
27262
+
27263
+ // Note that the only major, minor, patch, and pre-release sections of
27264
+ // the version string are capturing groups. The build metadata is not a
27265
+ // capturing group, because it should not ever be used in version
27266
+ // comparison.
27267
+
27268
+ createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
27269
+ }${src[t.PRERELEASE]}?${
27270
+ src[t.BUILD]}?`);
27271
+
27272
+ createToken('FULL', `^${src[t.FULLPLAIN]}$`);
27273
+
27274
+ // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
27275
+ // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
27276
+ // common in the npm registry.
27277
+ createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
27278
+ }${src[t.PRERELEASELOOSE]}?${
27279
+ src[t.BUILD]}?`);
27280
+
27281
+ createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
27282
+
27283
+ createToken('GTLT', '((?:<|>)?=?)');
27284
+
27285
+ // Something like "2.*" or "1.2.x".
27286
+ // Note that "x.x" is a valid xRange identifer, meaning "any version"
27287
+ // Only the first item is strictly required.
27288
+ createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
27289
+ createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
27290
+
27291
+ createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
27292
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
27293
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
27294
+ `(?:${src[t.PRERELEASE]})?${
27295
+ src[t.BUILD]}?` +
27296
+ `)?)?`);
27297
+
27298
+ createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
27299
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
27300
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
27301
+ `(?:${src[t.PRERELEASELOOSE]})?${
27302
+ src[t.BUILD]}?` +
27303
+ `)?)?`);
27304
+
27305
+ createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
27306
+ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
27307
+
27308
+ // Coercion.
27309
+ // Extract anything that could conceivably be a part of a valid semver
27310
+ createToken('COERCEPLAIN', `${'(^|[^\\d])' +
27311
+ '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
27312
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
27313
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
27314
+ createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
27315
+ createToken('COERCEFULL', src[t.COERCEPLAIN] +
27316
+ `(?:${src[t.PRERELEASE]})?` +
27317
+ `(?:${src[t.BUILD]})?` +
27318
+ `(?:$|[^\\d])`);
27319
+ createToken('COERCERTL', src[t.COERCE], true);
27320
+ createToken('COERCERTLFULL', src[t.COERCEFULL], true);
27321
+
27322
+ // Tilde ranges.
27323
+ // Meaning is "reasonably at or greater than"
27324
+ createToken('LONETILDE', '(?:~>?)');
27325
+
27326
+ createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
27327
+ exports.tildeTrimReplace = '$1~';
27328
+
27329
+ createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
27330
+ createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
27331
+
27332
+ // Caret ranges.
27333
+ // Meaning is "at least and backwards compatible with"
27334
+ createToken('LONECARET', '(?:\\^)');
27335
+
27336
+ createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
27337
+ exports.caretTrimReplace = '$1^';
27338
+
27339
+ createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
27340
+ createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
27341
+
27342
+ // A simple gt/lt/eq thing, or just "" to indicate "any version"
27343
+ createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
27344
+ createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
27345
+
27346
+ // An expression to strip any whitespace between the gtlt and the thing
27347
+ // it modifies, so that `> 1.2.3` ==> `>1.2.3`
27348
+ createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
27349
+ }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
27350
+ exports.comparatorTrimReplace = '$1$2$3';
27351
+
27352
+ // Something like `1.2.3 - 1.2.4`
27353
+ // Note that these all use the loose form, because they'll be
27354
+ // checked against either the strict or loose comparator form
27355
+ // later.
27356
+ createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
27357
+ `\\s+-\\s+` +
27358
+ `(${src[t.XRANGEPLAIN]})` +
27359
+ `\\s*$`);
27360
+
27361
+ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
27362
+ `\\s+-\\s+` +
27363
+ `(${src[t.XRANGEPLAINLOOSE]})` +
27364
+ `\\s*$`);
27365
+
27366
+ // Star ranges basically just allow anything at all.
27367
+ createToken('STAR', '(<|>)?=?\\s*\\*');
27368
+ // >=0.0.0 is like a star
27369
+ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
27370
+ createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
27371
+ } (re$1, re$1.exports));
27182
27372
 
27183
- // The following Regular Expressions can be used for tokenizing,
27184
- // validating, and parsing SemVer version strings.
27185
-
27186
- // ## Numeric Identifier
27187
- // A single `0`, or a non-zero digit followed by zero or more digits.
27188
-
27189
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
27190
- createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
27191
-
27192
- // ## Non-numeric Identifier
27193
- // Zero or more digits, followed by a letter or hyphen, and then zero or
27194
- // more letters, digits, or hyphens.
27195
-
27196
- createToken('NONNUMERICIDENTIFIER', "\\d*[a-zA-Z-]".concat(LETTERDASHNUMBER, "*"));
27197
-
27198
- // ## Main Version
27199
- // Three dot-separated numeric identifiers.
27200
-
27201
- createToken('MAINVERSION', "(".concat(src[t.NUMERICIDENTIFIER], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIER], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIER], ")"));
27202
- createToken('MAINVERSIONLOOSE', "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")"));
27203
-
27204
- // ## Pre-release Version Identifier
27205
- // A numeric identifier, or a non-numeric identifier.
27206
-
27207
- createToken('PRERELEASEIDENTIFIER', "(?:".concat(src[t.NUMERICIDENTIFIER], "|").concat(src[t.NONNUMERICIDENTIFIER], ")"));
27208
- createToken('PRERELEASEIDENTIFIERLOOSE', "(?:".concat(src[t.NUMERICIDENTIFIERLOOSE], "|").concat(src[t.NONNUMERICIDENTIFIER], ")"));
27209
-
27210
- // ## Pre-release Version
27211
- // Hyphen, followed by one or more dot-separated pre-release version
27212
- // identifiers.
27213
-
27214
- createToken('PRERELEASE', "(?:-(".concat(src[t.PRERELEASEIDENTIFIER], "(?:\\.").concat(src[t.PRERELEASEIDENTIFIER], ")*))"));
27215
- createToken('PRERELEASELOOSE', "(?:-?(".concat(src[t.PRERELEASEIDENTIFIERLOOSE], "(?:\\.").concat(src[t.PRERELEASEIDENTIFIERLOOSE], ")*))"));
27216
-
27217
- // ## Build Metadata Identifier
27218
- // Any combination of digits, letters, or hyphens.
27219
-
27220
- createToken('BUILDIDENTIFIER', "".concat(LETTERDASHNUMBER, "+"));
27221
-
27222
- // ## Build Metadata
27223
- // Plus sign, followed by one or more period-separated build metadata
27224
- // identifiers.
27225
-
27226
- createToken('BUILD', "(?:\\+(".concat(src[t.BUILDIDENTIFIER], "(?:\\.").concat(src[t.BUILDIDENTIFIER], ")*))"));
27227
-
27228
- // ## Full Version String
27229
- // A main version, followed optionally by a pre-release version and
27230
- // build metadata.
27231
-
27232
- // Note that the only major, minor, patch, and pre-release sections of
27233
- // the version string are capturing groups. The build metadata is not a
27234
- // capturing group, because it should not ever be used in version
27235
- // comparison.
27236
-
27237
- createToken('FULLPLAIN', "v?".concat(src[t.MAINVERSION]).concat(src[t.PRERELEASE], "?").concat(src[t.BUILD], "?"));
27238
- createToken('FULL', "^".concat(src[t.FULLPLAIN], "$"));
27239
-
27240
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
27241
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
27242
- // common in the npm registry.
27243
- createToken('LOOSEPLAIN', "[v=\\s]*".concat(src[t.MAINVERSIONLOOSE]).concat(src[t.PRERELEASELOOSE], "?").concat(src[t.BUILD], "?"));
27244
- createToken('LOOSE', "^".concat(src[t.LOOSEPLAIN], "$"));
27245
- createToken('GTLT', '((?:<|>)?=?)');
27246
-
27247
- // Something like "2.*" or "1.2.x".
27248
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
27249
- // Only the first item is strictly required.
27250
- createToken('XRANGEIDENTIFIERLOOSE', "".concat(src[t.NUMERICIDENTIFIERLOOSE], "|x|X|\\*"));
27251
- createToken('XRANGEIDENTIFIER', "".concat(src[t.NUMERICIDENTIFIER], "|x|X|\\*"));
27252
- createToken('XRANGEPLAIN', "[v=\\s]*(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:".concat(src[t.PRERELEASE], ")?").concat(src[t.BUILD], "?") + ")?)?");
27253
- createToken('XRANGEPLAINLOOSE', "[v=\\s]*(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:".concat(src[t.PRERELEASELOOSE], ")?").concat(src[t.BUILD], "?") + ")?)?");
27254
- createToken('XRANGE', "^".concat(src[t.GTLT], "\\s*").concat(src[t.XRANGEPLAIN], "$"));
27255
- createToken('XRANGELOOSE', "^".concat(src[t.GTLT], "\\s*").concat(src[t.XRANGEPLAINLOOSE], "$"));
27256
-
27257
- // Coercion.
27258
- // Extract anything that could conceivably be a part of a valid semver
27259
- createToken('COERCEPLAIN', "".concat('(^|[^\\d])' + '(\\d{1,').concat(MAX_SAFE_COMPONENT_LENGTH, "})") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?"));
27260
- createToken('COERCE', "".concat(src[t.COERCEPLAIN], "(?:$|[^\\d])"));
27261
- createToken('COERCEFULL', src[t.COERCEPLAIN] + "(?:".concat(src[t.PRERELEASE], ")?") + "(?:".concat(src[t.BUILD], ")?") + "(?:$|[^\\d])");
27262
- createToken('COERCERTL', src[t.COERCE], true);
27263
- createToken('COERCERTLFULL', src[t.COERCEFULL], true);
27264
-
27265
- // Tilde ranges.
27266
- // Meaning is "reasonably at or greater than"
27267
- createToken('LONETILDE', '(?:~>?)');
27268
- createToken('TILDETRIM', "(\\s*)".concat(src[t.LONETILDE], "\\s+"), true);
27269
- exports.tildeTrimReplace = '$1~';
27270
- createToken('TILDE', "^".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAIN], "$"));
27271
- createToken('TILDELOOSE', "^".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAINLOOSE], "$"));
27272
-
27273
- // Caret ranges.
27274
- // Meaning is "at least and backwards compatible with"
27275
- createToken('LONECARET', '(?:\\^)');
27276
- createToken('CARETTRIM', "(\\s*)".concat(src[t.LONECARET], "\\s+"), true);
27277
- exports.caretTrimReplace = '$1^';
27278
- createToken('CARET', "^".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAIN], "$"));
27279
- createToken('CARETLOOSE', "^".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAINLOOSE], "$"));
27280
-
27281
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
27282
- createToken('COMPARATORLOOSE', "^".concat(src[t.GTLT], "\\s*(").concat(src[t.LOOSEPLAIN], ")$|^$"));
27283
- createToken('COMPARATOR', "^".concat(src[t.GTLT], "\\s*(").concat(src[t.FULLPLAIN], ")$|^$"));
27284
-
27285
- // An expression to strip any whitespace between the gtlt and the thing
27286
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
27287
- createToken('COMPARATORTRIM', "(\\s*)".concat(src[t.GTLT], "\\s*(").concat(src[t.LOOSEPLAIN], "|").concat(src[t.XRANGEPLAIN], ")"), true);
27288
- exports.comparatorTrimReplace = '$1$2$3';
27289
-
27290
- // Something like `1.2.3 - 1.2.4`
27291
- // Note that these all use the loose form, because they'll be
27292
- // checked against either the strict or loose comparator form
27293
- // later.
27294
- createToken('HYPHENRANGE', "^\\s*(".concat(src[t.XRANGEPLAIN], ")") + "\\s+-\\s+" + "(".concat(src[t.XRANGEPLAIN], ")") + "\\s*$");
27295
- createToken('HYPHENRANGELOOSE', "^\\s*(".concat(src[t.XRANGEPLAINLOOSE], ")") + "\\s+-\\s+" + "(".concat(src[t.XRANGEPLAINLOOSE], ")") + "\\s*$");
27296
-
27297
- // Star ranges basically just allow anything at all.
27298
- createToken('STAR', '(<|>)?=?\\s*\\*');
27299
- // >=0.0.0 is like a star
27300
- createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
27301
- createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
27302
- })(re$1, re$1.exports);
27303
27373
  var reExports = re$1.exports;
27304
27374
 
27305
27375
  const numeric = /^[0-9]+$/;
27306
27376
  const compareIdentifiers$1 = (a, b) => {
27307
27377
  const anum = numeric.test(a);
27308
27378
  const bnum = numeric.test(b);
27379
+
27309
27380
  if (anum && bnum) {
27310
27381
  a = +a;
27311
27382
  b = +b;
27312
27383
  }
27313
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
27384
+
27385
+ return a === b ? 0
27386
+ : (anum && !bnum) ? -1
27387
+ : (bnum && !anum) ? 1
27388
+ : a < b ? -1
27389
+ : 1
27314
27390
  };
27391
+
27315
27392
  const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
27393
+
27316
27394
  var identifiers = {
27317
27395
  compareIdentifiers: compareIdentifiers$1,
27318
- rcompareIdentifiers
27396
+ rcompareIdentifiers,
27319
27397
  };
27320
27398
 
27321
27399
  const debug = debug_1;
27322
- const {
27323
- MAX_LENGTH,
27324
- MAX_SAFE_INTEGER
27325
- } = constants;
27326
- const {
27327
- safeRe: re,
27328
- t
27329
- } = reExports;
27400
+ const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;
27401
+ const { safeRe: re, t } = reExports;
27402
+
27330
27403
  const parseOptions = parseOptions_1;
27331
- const {
27332
- compareIdentifiers
27333
- } = identifiers;
27404
+ const { compareIdentifiers } = identifiers;
27334
27405
  let SemVer$1 = class SemVer {
27335
- constructor(version, options) {
27406
+ constructor (version, options) {
27336
27407
  options = parseOptions(options);
27408
+
27337
27409
  if (version instanceof SemVer) {
27338
- if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
27339
- return version;
27410
+ if (version.loose === !!options.loose &&
27411
+ version.includePrerelease === !!options.includePrerelease) {
27412
+ return version
27340
27413
  } else {
27341
27414
  version = version.version;
27342
27415
  }
27343
27416
  } else if (typeof version !== 'string') {
27344
- throw new TypeError("Invalid version. Must be a string. Got type \"".concat(typeof version, "\"."));
27417
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
27345
27418
  }
27419
+
27346
27420
  if (version.length > MAX_LENGTH) {
27347
- throw new TypeError("version is longer than ".concat(MAX_LENGTH, " characters"));
27421
+ throw new TypeError(
27422
+ `version is longer than ${MAX_LENGTH} characters`
27423
+ )
27348
27424
  }
27425
+
27349
27426
  debug('SemVer', version, options);
27350
27427
  this.options = options;
27351
27428
  this.loose = !!options.loose;
27352
27429
  // this isn't actually relevant for versions, but keep it so that we
27353
27430
  // don't run into trouble passing this.options around.
27354
27431
  this.includePrerelease = !!options.includePrerelease;
27432
+
27355
27433
  const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
27434
+
27356
27435
  if (!m) {
27357
- throw new TypeError("Invalid Version: ".concat(version));
27436
+ throw new TypeError(`Invalid Version: ${version}`)
27358
27437
  }
27438
+
27359
27439
  this.raw = version;
27360
27440
 
27361
27441
  // these are actually numbers
27362
27442
  this.major = +m[1];
27363
27443
  this.minor = +m[2];
27364
27444
  this.patch = +m[3];
27445
+
27365
27446
  if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
27366
- throw new TypeError('Invalid major version');
27447
+ throw new TypeError('Invalid major version')
27367
27448
  }
27449
+
27368
27450
  if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
27369
- throw new TypeError('Invalid minor version');
27451
+ throw new TypeError('Invalid minor version')
27370
27452
  }
27453
+
27371
27454
  if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
27372
- throw new TypeError('Invalid patch version');
27455
+ throw new TypeError('Invalid patch version')
27373
27456
  }
27374
27457
 
27375
27458
  // numberify any prerelease numeric ids
27376
27459
  if (!m[4]) {
27377
27460
  this.prerelease = [];
27378
27461
  } else {
27379
- this.prerelease = m[4].split('.').map(id => {
27462
+ this.prerelease = m[4].split('.').map((id) => {
27380
27463
  if (/^[0-9]+$/.test(id)) {
27381
27464
  const num = +id;
27382
27465
  if (num >= 0 && num < MAX_SAFE_INTEGER) {
27383
- return num;
27466
+ return num
27384
27467
  }
27385
27468
  }
27386
- return id;
27469
+ return id
27387
27470
  });
27388
27471
  }
27472
+
27389
27473
  this.build = m[5] ? m[5].split('.') : [];
27390
27474
  this.format();
27391
27475
  }
27392
- format() {
27393
- this.version = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
27476
+
27477
+ format () {
27478
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
27394
27479
  if (this.prerelease.length) {
27395
- this.version += "-".concat(this.prerelease.join('.'));
27480
+ this.version += `-${this.prerelease.join('.')}`;
27396
27481
  }
27397
- return this.version;
27482
+ return this.version
27398
27483
  }
27399
- toString() {
27400
- return this.version;
27484
+
27485
+ toString () {
27486
+ return this.version
27401
27487
  }
27402
- compare(other) {
27488
+
27489
+ compare (other) {
27403
27490
  debug('SemVer.compare', this.version, this.options, other);
27404
27491
  if (!(other instanceof SemVer)) {
27405
27492
  if (typeof other === 'string' && other === this.version) {
27406
- return 0;
27493
+ return 0
27407
27494
  }
27408
27495
  other = new SemVer(other, this.options);
27409
27496
  }
27497
+
27410
27498
  if (other.version === this.version) {
27411
- return 0;
27499
+ return 0
27412
27500
  }
27413
- return this.compareMain(other) || this.comparePre(other);
27501
+
27502
+ return this.compareMain(other) || this.comparePre(other)
27414
27503
  }
27415
- compareMain(other) {
27504
+
27505
+ compareMain (other) {
27416
27506
  if (!(other instanceof SemVer)) {
27417
27507
  other = new SemVer(other, this.options);
27418
27508
  }
27419
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
27509
+
27510
+ return (
27511
+ compareIdentifiers(this.major, other.major) ||
27512
+ compareIdentifiers(this.minor, other.minor) ||
27513
+ compareIdentifiers(this.patch, other.patch)
27514
+ )
27420
27515
  }
27421
- comparePre(other) {
27516
+
27517
+ comparePre (other) {
27422
27518
  if (!(other instanceof SemVer)) {
27423
27519
  other = new SemVer(other, this.options);
27424
27520
  }
27425
27521
 
27426
27522
  // NOT having a prerelease is > having one
27427
27523
  if (this.prerelease.length && !other.prerelease.length) {
27428
- return -1;
27524
+ return -1
27429
27525
  } else if (!this.prerelease.length && other.prerelease.length) {
27430
- return 1;
27526
+ return 1
27431
27527
  } else if (!this.prerelease.length && !other.prerelease.length) {
27432
- return 0;
27528
+ return 0
27433
27529
  }
27530
+
27434
27531
  let i = 0;
27435
27532
  do {
27436
27533
  const a = this.prerelease[i];
27437
27534
  const b = other.prerelease[i];
27438
27535
  debug('prerelease compare', i, a, b);
27439
27536
  if (a === undefined && b === undefined) {
27440
- return 0;
27537
+ return 0
27441
27538
  } else if (b === undefined) {
27442
- return 1;
27539
+ return 1
27443
27540
  } else if (a === undefined) {
27444
- return -1;
27541
+ return -1
27445
27542
  } else if (a === b) {
27446
- continue;
27543
+ continue
27447
27544
  } else {
27448
- return compareIdentifiers(a, b);
27545
+ return compareIdentifiers(a, b)
27449
27546
  }
27450
- } while (++i);
27547
+ } while (++i)
27451
27548
  }
27452
- compareBuild(other) {
27549
+
27550
+ compareBuild (other) {
27453
27551
  if (!(other instanceof SemVer)) {
27454
27552
  other = new SemVer(other, this.options);
27455
27553
  }
27554
+
27456
27555
  let i = 0;
27457
27556
  do {
27458
27557
  const a = this.build[i];
27459
27558
  const b = other.build[i];
27460
27559
  debug('build compare', i, a, b);
27461
27560
  if (a === undefined && b === undefined) {
27462
- return 0;
27561
+ return 0
27463
27562
  } else if (b === undefined) {
27464
- return 1;
27563
+ return 1
27465
27564
  } else if (a === undefined) {
27466
- return -1;
27565
+ return -1
27467
27566
  } else if (a === b) {
27468
- continue;
27567
+ continue
27469
27568
  } else {
27470
- return compareIdentifiers(a, b);
27569
+ return compareIdentifiers(a, b)
27471
27570
  }
27472
- } while (++i);
27571
+ } while (++i)
27473
27572
  }
27474
27573
 
27475
27574
  // preminor will bump the version up to the next minor release, and immediately
27476
27575
  // down to pre-release. premajor and prepatch work the same way.
27477
- inc(release, identifier, identifierBase) {
27576
+ inc (release, identifier, identifierBase) {
27478
27577
  switch (release) {
27479
27578
  case 'premajor':
27480
27579
  this.prerelease.length = 0;
@@ -27482,13 +27581,13 @@ let SemVer$1 = class SemVer {
27482
27581
  this.minor = 0;
27483
27582
  this.major++;
27484
27583
  this.inc('pre', identifier, identifierBase);
27485
- break;
27584
+ break
27486
27585
  case 'preminor':
27487
27586
  this.prerelease.length = 0;
27488
27587
  this.patch = 0;
27489
27588
  this.minor++;
27490
27589
  this.inc('pre', identifier, identifierBase);
27491
- break;
27590
+ break
27492
27591
  case 'prepatch':
27493
27592
  // If this is already a prerelease, it will bump to the next version
27494
27593
  // drop any prereleases that might already exist, since they are not
@@ -27496,7 +27595,7 @@ let SemVer$1 = class SemVer {
27496
27595
  this.prerelease.length = 0;
27497
27596
  this.inc('patch', identifier, identifierBase);
27498
27597
  this.inc('pre', identifier, identifierBase);
27499
- break;
27598
+ break
27500
27599
  // If the input is a non-prerelease version, this acts the same as
27501
27600
  // prepatch.
27502
27601
  case 'prerelease':
@@ -27504,19 +27603,24 @@ let SemVer$1 = class SemVer {
27504
27603
  this.inc('patch', identifier, identifierBase);
27505
27604
  }
27506
27605
  this.inc('pre', identifier, identifierBase);
27507
- break;
27606
+ break
27607
+
27508
27608
  case 'major':
27509
27609
  // If this is a pre-major version, bump up to the same major version.
27510
27610
  // Otherwise increment major.
27511
27611
  // 1.0.0-5 bumps to 1.0.0
27512
27612
  // 1.1.0 bumps to 2.0.0
27513
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
27613
+ if (
27614
+ this.minor !== 0 ||
27615
+ this.patch !== 0 ||
27616
+ this.prerelease.length === 0
27617
+ ) {
27514
27618
  this.major++;
27515
27619
  }
27516
27620
  this.minor = 0;
27517
27621
  this.patch = 0;
27518
27622
  this.prerelease = [];
27519
- break;
27623
+ break
27520
27624
  case 'minor':
27521
27625
  // If this is a pre-minor version, bump up to the same minor version.
27522
27626
  // Otherwise increment minor.
@@ -27527,7 +27631,7 @@ let SemVer$1 = class SemVer {
27527
27631
  }
27528
27632
  this.patch = 0;
27529
27633
  this.prerelease = [];
27530
- break;
27634
+ break
27531
27635
  case 'patch':
27532
27636
  // If this is not a pre-release version, it will increment the patch.
27533
27637
  // If it is a pre-release it will bump up to the same patch version.
@@ -27537,64 +27641,68 @@ let SemVer$1 = class SemVer {
27537
27641
  this.patch++;
27538
27642
  }
27539
27643
  this.prerelease = [];
27540
- break;
27644
+ break
27541
27645
  // This probably shouldn't be used publicly.
27542
27646
  // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
27543
- case 'pre':
27544
- {
27545
- const base = Number(identifierBase) ? 1 : 0;
27546
- if (!identifier && identifierBase === false) {
27547
- throw new Error('invalid increment argument: identifier is empty');
27548
- }
27549
- if (this.prerelease.length === 0) {
27550
- this.prerelease = [base];
27551
- } else {
27552
- let i = this.prerelease.length;
27553
- while (--i >= 0) {
27554
- if (typeof this.prerelease[i] === 'number') {
27555
- this.prerelease[i]++;
27556
- i = -2;
27557
- }
27558
- }
27559
- if (i === -1) {
27560
- // didn't increment anything
27561
- if (identifier === this.prerelease.join('.') && identifierBase === false) {
27562
- throw new Error('invalid increment argument: identifier already exists');
27563
- }
27564
- this.prerelease.push(base);
27647
+ case 'pre': {
27648
+ const base = Number(identifierBase) ? 1 : 0;
27649
+
27650
+ if (!identifier && identifierBase === false) {
27651
+ throw new Error('invalid increment argument: identifier is empty')
27652
+ }
27653
+
27654
+ if (this.prerelease.length === 0) {
27655
+ this.prerelease = [base];
27656
+ } else {
27657
+ let i = this.prerelease.length;
27658
+ while (--i >= 0) {
27659
+ if (typeof this.prerelease[i] === 'number') {
27660
+ this.prerelease[i]++;
27661
+ i = -2;
27565
27662
  }
27566
27663
  }
27567
- if (identifier) {
27568
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
27569
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
27570
- let prerelease = [identifier, base];
27571
- if (identifierBase === false) {
27572
- prerelease = [identifier];
27664
+ if (i === -1) {
27665
+ // didn't increment anything
27666
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
27667
+ throw new Error('invalid increment argument: identifier already exists')
27573
27668
  }
27574
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
27575
- if (isNaN(this.prerelease[1])) {
27576
- this.prerelease = prerelease;
27577
- }
27578
- } else {
27669
+ this.prerelease.push(base);
27670
+ }
27671
+ }
27672
+ if (identifier) {
27673
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
27674
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
27675
+ let prerelease = [identifier, base];
27676
+ if (identifierBase === false) {
27677
+ prerelease = [identifier];
27678
+ }
27679
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
27680
+ if (isNaN(this.prerelease[1])) {
27579
27681
  this.prerelease = prerelease;
27580
27682
  }
27683
+ } else {
27684
+ this.prerelease = prerelease;
27581
27685
  }
27582
- break;
27583
27686
  }
27687
+ break
27688
+ }
27584
27689
  default:
27585
- throw new Error("invalid increment argument: ".concat(release));
27690
+ throw new Error(`invalid increment argument: ${release}`)
27586
27691
  }
27587
27692
  this.raw = this.format();
27588
27693
  if (this.build.length) {
27589
- this.raw += "+".concat(this.build.join('.'));
27694
+ this.raw += `+${this.build.join('.')}`;
27590
27695
  }
27591
- return this;
27696
+ return this
27592
27697
  }
27593
27698
  };
27699
+
27594
27700
  var semver = SemVer$1;
27595
27701
 
27596
27702
  const SemVer = semver;
27597
- const compare$6 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
27703
+ const compare$6 = (a, b, loose) =>
27704
+ new SemVer(a, loose).compare(new SemVer(b, loose));
27705
+
27598
27706
  var compare_1 = compare$6;
27599
27707
 
27600
27708
  const compare$5 = compare_1;
@@ -27627,6 +27735,7 @@ const gt = gt_1;
27627
27735
  const gte = gte_1;
27628
27736
  const lt = lt_1;
27629
27737
  const lte = lte_1;
27738
+
27630
27739
  const cmp = (a, op, b, loose) => {
27631
27740
  switch (op) {
27632
27741
  case '===':
@@ -27636,7 +27745,8 @@ const cmp = (a, op, b, loose) => {
27636
27745
  if (typeof b === 'object') {
27637
27746
  b = b.version;
27638
27747
  }
27639
- return a === b;
27748
+ return a === b
27749
+
27640
27750
  case '!==':
27641
27751
  if (typeof a === 'object') {
27642
27752
  a = a.version;
@@ -27644,609 +27754,731 @@ const cmp = (a, op, b, loose) => {
27644
27754
  if (typeof b === 'object') {
27645
27755
  b = b.version;
27646
27756
  }
27647
- return a !== b;
27757
+ return a !== b
27758
+
27648
27759
  case '':
27649
27760
  case '=':
27650
27761
  case '==':
27651
- return eq(a, b, loose);
27762
+ return eq(a, b, loose)
27763
+
27652
27764
  case '!=':
27653
- return neq(a, b, loose);
27765
+ return neq(a, b, loose)
27766
+
27654
27767
  case '>':
27655
- return gt(a, b, loose);
27768
+ return gt(a, b, loose)
27769
+
27656
27770
  case '>=':
27657
- return gte(a, b, loose);
27771
+ return gte(a, b, loose)
27772
+
27658
27773
  case '<':
27659
- return lt(a, b, loose);
27774
+ return lt(a, b, loose)
27775
+
27660
27776
  case '<=':
27661
- return lte(a, b, loose);
27777
+ return lte(a, b, loose)
27778
+
27662
27779
  default:
27663
- throw new TypeError("Invalid operator: ".concat(op));
27780
+ throw new TypeError(`Invalid operator: ${op}`)
27664
27781
  }
27665
27782
  };
27666
27783
  var cmp_1 = cmp;
27667
27784
 
27668
27785
  var comparator;
27669
27786
  var hasRequiredComparator;
27670
- function requireComparator() {
27671
- if (hasRequiredComparator) return comparator;
27672
- hasRequiredComparator = 1;
27673
- const ANY = Symbol('SemVer ANY');
27674
- // hoisted class for cyclic dependency
27675
- class Comparator {
27676
- static get ANY() {
27677
- return ANY;
27678
- }
27679
- constructor(comp, options) {
27680
- options = parseOptions(options);
27681
- if (comp instanceof Comparator) {
27682
- if (comp.loose === !!options.loose) {
27683
- return comp;
27684
- } else {
27685
- comp = comp.value;
27686
- }
27687
- }
27688
- comp = comp.trim().split(/\s+/).join(' ');
27689
- debug('comparator', comp, options);
27690
- this.options = options;
27691
- this.loose = !!options.loose;
27692
- this.parse(comp);
27693
- if (this.semver === ANY) {
27694
- this.value = '';
27695
- } else {
27696
- this.value = this.operator + this.semver.version;
27697
- }
27698
- debug('comp', this);
27699
- }
27700
- parse(comp) {
27701
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
27702
- const m = comp.match(r);
27703
- if (!m) {
27704
- throw new TypeError("Invalid comparator: ".concat(comp));
27705
- }
27706
- this.operator = m[1] !== undefined ? m[1] : '';
27707
- if (this.operator === '=') {
27708
- this.operator = '';
27709
- }
27710
27787
 
27711
- // if it literally is just '>' or '' then allow anything.
27712
- if (!m[2]) {
27713
- this.semver = ANY;
27714
- } else {
27715
- this.semver = new SemVer(m[2], this.options.loose);
27716
- }
27717
- }
27718
- toString() {
27719
- return this.value;
27720
- }
27721
- test(version) {
27722
- debug('Comparator.test', version, this.options.loose);
27723
- if (this.semver === ANY || version === ANY) {
27724
- return true;
27725
- }
27726
- if (typeof version === 'string') {
27727
- try {
27728
- version = new SemVer(version, this.options);
27729
- } catch (er) {
27730
- return false;
27731
- }
27732
- }
27733
- return cmp(version, this.operator, this.semver, this.options);
27734
- }
27735
- intersects(comp, options) {
27736
- if (!(comp instanceof Comparator)) {
27737
- throw new TypeError('a Comparator is required');
27738
- }
27739
- if (this.operator === '') {
27740
- if (this.value === '') {
27741
- return true;
27742
- }
27743
- return new Range(comp.value, options).test(this.value);
27744
- } else if (comp.operator === '') {
27745
- if (comp.value === '') {
27746
- return true;
27747
- }
27748
- return new Range(this.value, options).test(comp.semver);
27749
- }
27750
- options = parseOptions(options);
27788
+ function requireComparator () {
27789
+ if (hasRequiredComparator) return comparator;
27790
+ hasRequiredComparator = 1;
27791
+ const ANY = Symbol('SemVer ANY');
27792
+ // hoisted class for cyclic dependency
27793
+ class Comparator {
27794
+ static get ANY () {
27795
+ return ANY
27796
+ }
27797
+
27798
+ constructor (comp, options) {
27799
+ options = parseOptions(options);
27800
+
27801
+ if (comp instanceof Comparator) {
27802
+ if (comp.loose === !!options.loose) {
27803
+ return comp
27804
+ } else {
27805
+ comp = comp.value;
27806
+ }
27807
+ }
27808
+
27809
+ comp = comp.trim().split(/\s+/).join(' ');
27810
+ debug('comparator', comp, options);
27811
+ this.options = options;
27812
+ this.loose = !!options.loose;
27813
+ this.parse(comp);
27814
+
27815
+ if (this.semver === ANY) {
27816
+ this.value = '';
27817
+ } else {
27818
+ this.value = this.operator + this.semver.version;
27819
+ }
27820
+
27821
+ debug('comp', this);
27822
+ }
27823
+
27824
+ parse (comp) {
27825
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
27826
+ const m = comp.match(r);
27827
+
27828
+ if (!m) {
27829
+ throw new TypeError(`Invalid comparator: ${comp}`)
27830
+ }
27831
+
27832
+ this.operator = m[1] !== undefined ? m[1] : '';
27833
+ if (this.operator === '=') {
27834
+ this.operator = '';
27835
+ }
27836
+
27837
+ // if it literally is just '>' or '' then allow anything.
27838
+ if (!m[2]) {
27839
+ this.semver = ANY;
27840
+ } else {
27841
+ this.semver = new SemVer(m[2], this.options.loose);
27842
+ }
27843
+ }
27844
+
27845
+ toString () {
27846
+ return this.value
27847
+ }
27848
+
27849
+ test (version) {
27850
+ debug('Comparator.test', version, this.options.loose);
27851
+
27852
+ if (this.semver === ANY || version === ANY) {
27853
+ return true
27854
+ }
27855
+
27856
+ if (typeof version === 'string') {
27857
+ try {
27858
+ version = new SemVer(version, this.options);
27859
+ } catch (er) {
27860
+ return false
27861
+ }
27862
+ }
27863
+
27864
+ return cmp(version, this.operator, this.semver, this.options)
27865
+ }
27866
+
27867
+ intersects (comp, options) {
27868
+ if (!(comp instanceof Comparator)) {
27869
+ throw new TypeError('a Comparator is required')
27870
+ }
27871
+
27872
+ if (this.operator === '') {
27873
+ if (this.value === '') {
27874
+ return true
27875
+ }
27876
+ return new Range(comp.value, options).test(this.value)
27877
+ } else if (comp.operator === '') {
27878
+ if (comp.value === '') {
27879
+ return true
27880
+ }
27881
+ return new Range(this.value, options).test(comp.semver)
27882
+ }
27883
+
27884
+ options = parseOptions(options);
27885
+
27886
+ // Special cases where nothing can possibly be lower
27887
+ if (options.includePrerelease &&
27888
+ (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
27889
+ return false
27890
+ }
27891
+ if (!options.includePrerelease &&
27892
+ (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
27893
+ return false
27894
+ }
27895
+
27896
+ // Same direction increasing (> or >=)
27897
+ if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
27898
+ return true
27899
+ }
27900
+ // Same direction decreasing (< or <=)
27901
+ if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
27902
+ return true
27903
+ }
27904
+ // same SemVer and both sides are inclusive (<= or >=)
27905
+ if (
27906
+ (this.semver.version === comp.semver.version) &&
27907
+ this.operator.includes('=') && comp.operator.includes('=')) {
27908
+ return true
27909
+ }
27910
+ // opposite directions less than
27911
+ if (cmp(this.semver, '<', comp.semver, options) &&
27912
+ this.operator.startsWith('>') && comp.operator.startsWith('<')) {
27913
+ return true
27914
+ }
27915
+ // opposite directions greater than
27916
+ if (cmp(this.semver, '>', comp.semver, options) &&
27917
+ this.operator.startsWith('<') && comp.operator.startsWith('>')) {
27918
+ return true
27919
+ }
27920
+ return false
27921
+ }
27922
+ }
27751
27923
 
27752
- // Special cases where nothing can possibly be lower
27753
- if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
27754
- return false;
27755
- }
27756
- if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
27757
- return false;
27758
- }
27924
+ comparator = Comparator;
27759
27925
 
27760
- // Same direction increasing (> or >=)
27761
- if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
27762
- return true;
27763
- }
27764
- // Same direction decreasing (< or <=)
27765
- if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
27766
- return true;
27767
- }
27768
- // same SemVer and both sides are inclusive (<= or >=)
27769
- if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) {
27770
- return true;
27771
- }
27772
- // opposite directions less than
27773
- if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) {
27774
- return true;
27775
- }
27776
- // opposite directions greater than
27777
- if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) {
27778
- return true;
27779
- }
27780
- return false;
27781
- }
27782
- }
27783
- comparator = Comparator;
27784
- const parseOptions = parseOptions_1;
27785
- const {
27786
- safeRe: re,
27787
- t
27788
- } = reExports;
27789
- const cmp = cmp_1;
27790
- const debug = debug_1;
27791
- const SemVer = semver;
27792
- const Range = requireRange();
27793
- return comparator;
27926
+ const parseOptions = parseOptions_1;
27927
+ const { safeRe: re, t } = reExports;
27928
+ const cmp = cmp_1;
27929
+ const debug = debug_1;
27930
+ const SemVer = semver;
27931
+ const Range = requireRange();
27932
+ return comparator;
27794
27933
  }
27795
27934
 
27796
27935
  var range;
27797
27936
  var hasRequiredRange;
27798
- function requireRange() {
27799
- if (hasRequiredRange) return range;
27800
- hasRequiredRange = 1;
27801
- // hoisted class for cyclic dependency
27802
- class Range {
27803
- constructor(range, options) {
27804
- options = parseOptions(options);
27805
- if (range instanceof Range) {
27806
- if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
27807
- return range;
27808
- } else {
27809
- return new Range(range.raw, options);
27810
- }
27811
- }
27812
- if (range instanceof Comparator) {
27813
- // just put it in the set and return
27814
- this.raw = range.value;
27815
- this.set = [[range]];
27816
- this.format();
27817
- return this;
27818
- }
27819
- this.options = options;
27820
- this.loose = !!options.loose;
27821
- this.includePrerelease = !!options.includePrerelease;
27822
-
27823
- // First reduce all whitespace as much as possible so we do not have to rely
27824
- // on potentially slow regexes like \s*. This is then stored and used for
27825
- // future error messages as well.
27826
- this.raw = range.trim().split(/\s+/).join(' ');
27827
-
27828
- // First, split on ||
27829
- this.set = this.raw.split('||')
27830
- // map the range to a 2d array of comparators
27831
- .map(r => this.parseRange(r.trim()))
27832
- // throw out any comparator lists that are empty
27833
- // this generally means that it was not a valid range, which is allowed
27834
- // in loose mode, but will still throw if the WHOLE range is invalid.
27835
- .filter(c => c.length);
27836
- if (!this.set.length) {
27837
- throw new TypeError("Invalid SemVer Range: ".concat(this.raw));
27838
- }
27839
-
27840
- // if we have any that are not the null set, throw out null sets.
27841
- if (this.set.length > 1) {
27842
- // keep the first one, in case they're all null sets
27843
- const first = this.set[0];
27844
- this.set = this.set.filter(c => !isNullSet(c[0]));
27845
- if (this.set.length === 0) {
27846
- this.set = [first];
27847
- } else if (this.set.length > 1) {
27848
- // if we have any that are *, then the range is just *
27849
- for (const c of this.set) {
27850
- if (c.length === 1 && isAny(c[0])) {
27851
- this.set = [c];
27852
- break;
27853
- }
27854
- }
27855
- }
27856
- }
27857
- this.format();
27858
- }
27859
- format() {
27860
- this.range = this.set.map(comps => comps.join(' ').trim()).join('||').trim();
27861
- return this.range;
27862
- }
27863
- toString() {
27864
- return this.range;
27865
- }
27866
- parseRange(range) {
27867
- // memoize range parsing for performance.
27868
- // this is a very hot path, and fully deterministic.
27869
- const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
27870
- const memoKey = memoOpts + ':' + range;
27871
- const cached = cache.get(memoKey);
27872
- if (cached) {
27873
- return cached;
27874
- }
27875
- const loose = this.options.loose;
27876
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
27877
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
27878
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
27879
- debug('hyphen replace', range);
27880
-
27881
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
27882
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
27883
- debug('comparator trim', range);
27884
-
27885
- // `~ 1.2.3` => `~1.2.3`
27886
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
27887
- debug('tilde trim', range);
27888
-
27889
- // `^ 1.2.3` => `^1.2.3`
27890
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
27891
- debug('caret trim', range);
27892
-
27893
- // At this point, the range is completely trimmed and
27894
- // ready to be split into comparators.
27895
-
27896
- let rangeList = range.split(' ').map(comp => parseComparator(comp, this.options)).join(' ').split(/\s+/)
27897
- // >=0.0.0 is equivalent to *
27898
- .map(comp => replaceGTE0(comp, this.options));
27899
- if (loose) {
27900
- // in loose mode, throw out any that are not valid comparators
27901
- rangeList = rangeList.filter(comp => {
27902
- debug('loose invalid filter', comp, this.options);
27903
- return !!comp.match(re[t.COMPARATORLOOSE]);
27904
- });
27905
- }
27906
- debug('range list', rangeList);
27907
-
27908
- // if any comparators are the null set, then replace with JUST null set
27909
- // if more than one comparator, remove any * comparators
27910
- // also, don't include the same comparator more than once
27911
- const rangeMap = new Map();
27912
- const comparators = rangeList.map(comp => new Comparator(comp, this.options));
27913
- for (const comp of comparators) {
27914
- if (isNullSet(comp)) {
27915
- return [comp];
27916
- }
27917
- rangeMap.set(comp.value, comp);
27918
- }
27919
- if (rangeMap.size > 1 && rangeMap.has('')) {
27920
- rangeMap.delete('');
27921
- }
27922
- const result = [...rangeMap.values()];
27923
- cache.set(memoKey, result);
27924
- return result;
27925
- }
27926
- intersects(range, options) {
27927
- if (!(range instanceof Range)) {
27928
- throw new TypeError('a Range is required');
27929
- }
27930
- return this.set.some(thisComparators => {
27931
- return isSatisfiable(thisComparators, options) && range.set.some(rangeComparators => {
27932
- return isSatisfiable(rangeComparators, options) && thisComparators.every(thisComparator => {
27933
- return rangeComparators.every(rangeComparator => {
27934
- return thisComparator.intersects(rangeComparator, options);
27935
- });
27936
- });
27937
- });
27938
- });
27939
- }
27940
27937
 
27941
- // if ANY of the sets match ALL of its comparators, then pass
27942
- test(version) {
27943
- if (!version) {
27944
- return false;
27945
- }
27946
- if (typeof version === 'string') {
27947
- try {
27948
- version = new SemVer(version, this.options);
27949
- } catch (er) {
27950
- return false;
27951
- }
27952
- }
27953
- for (let i = 0; i < this.set.length; i++) {
27954
- if (testSet(this.set[i], version, this.options)) {
27955
- return true;
27956
- }
27957
- }
27958
- return false;
27959
- }
27960
- }
27961
- range = Range;
27962
- const LRU = lrucache;
27963
- const cache = new LRU();
27964
- const parseOptions = parseOptions_1;
27965
- const Comparator = requireComparator();
27966
- const debug = debug_1;
27967
- const SemVer = semver;
27968
- const {
27969
- safeRe: re,
27970
- t,
27971
- comparatorTrimReplace,
27972
- tildeTrimReplace,
27973
- caretTrimReplace
27974
- } = reExports;
27975
- const {
27976
- FLAG_INCLUDE_PRERELEASE,
27977
- FLAG_LOOSE
27978
- } = constants;
27979
- const isNullSet = c => c.value === '<0.0.0-0';
27980
- const isAny = c => c.value === '';
27981
-
27982
- // take a set of comparators and determine whether there
27983
- // exists a version which can satisfy it
27984
- const isSatisfiable = (comparators, options) => {
27985
- let result = true;
27986
- const remainingComparators = comparators.slice();
27987
- let testComparator = remainingComparators.pop();
27988
- while (result && remainingComparators.length) {
27989
- result = remainingComparators.every(otherComparator => {
27990
- return testComparator.intersects(otherComparator, options);
27991
- });
27992
- testComparator = remainingComparators.pop();
27993
- }
27994
- return result;
27995
- };
27996
-
27997
- // comprised of xranges, tildes, stars, and gtlt's at this point.
27998
- // already replaced the hyphen ranges
27999
- // turn into a set of JUST comparators.
28000
- const parseComparator = (comp, options) => {
28001
- debug('comp', comp, options);
28002
- comp = replaceCarets(comp, options);
28003
- debug('caret', comp);
28004
- comp = replaceTildes(comp, options);
28005
- debug('tildes', comp);
28006
- comp = replaceXRanges(comp, options);
28007
- debug('xrange', comp);
28008
- comp = replaceStars(comp, options);
28009
- debug('stars', comp);
28010
- return comp;
28011
- };
28012
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
28013
-
28014
- // ~, ~> --> * (any, kinda silly)
28015
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
28016
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
28017
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
28018
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
28019
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
28020
- // ~0.0.1 --> >=0.0.1 <0.1.0-0
28021
- const replaceTildes = (comp, options) => {
28022
- return comp.trim().split(/\s+/).map(c => replaceTilde(c, options)).join(' ');
28023
- };
28024
- const replaceTilde = (comp, options) => {
28025
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
28026
- return comp.replace(r, (_, M, m, p, pr) => {
28027
- debug('tilde', comp, _, M, m, p, pr);
28028
- let ret;
28029
- if (isX(M)) {
28030
- ret = '';
28031
- } else if (isX(m)) {
28032
- ret = ">=".concat(M, ".0.0 <").concat(+M + 1, ".0.0-0");
28033
- } else if (isX(p)) {
28034
- // ~1.2 == >=1.2.0 <1.3.0-0
28035
- ret = ">=".concat(M, ".").concat(m, ".0 <").concat(M, ".").concat(+m + 1, ".0-0");
28036
- } else if (pr) {
28037
- debug('replaceTilde pr', pr);
28038
- ret = ">=".concat(M, ".").concat(m, ".").concat(p, "-").concat(pr, " <").concat(M, ".").concat(+m + 1, ".0-0");
28039
- } else {
28040
- // ~1.2.3 == >=1.2.3 <1.3.0-0
28041
- ret = ">=".concat(M, ".").concat(m, ".").concat(p, " <").concat(M, ".").concat(+m + 1, ".0-0");
28042
- }
28043
- debug('tilde return', ret);
28044
- return ret;
28045
- });
28046
- };
28047
-
28048
- // ^ --> * (any, kinda silly)
28049
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
28050
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
28051
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
28052
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
28053
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
28054
- // ^0.0.1 --> >=0.0.1 <0.0.2-0
28055
- // ^0.1.0 --> >=0.1.0 <0.2.0-0
28056
- const replaceCarets = (comp, options) => {
28057
- return comp.trim().split(/\s+/).map(c => replaceCaret(c, options)).join(' ');
28058
- };
28059
- const replaceCaret = (comp, options) => {
28060
- debug('caret', comp, options);
28061
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
28062
- const z = options.includePrerelease ? '-0' : '';
28063
- return comp.replace(r, (_, M, m, p, pr) => {
28064
- debug('caret', comp, _, M, m, p, pr);
28065
- let ret;
28066
- if (isX(M)) {
28067
- ret = '';
28068
- } else if (isX(m)) {
28069
- ret = ">=".concat(M, ".0.0").concat(z, " <").concat(+M + 1, ".0.0-0");
28070
- } else if (isX(p)) {
28071
- if (M === '0') {
28072
- ret = ">=".concat(M, ".").concat(m, ".0").concat(z, " <").concat(M, ".").concat(+m + 1, ".0-0");
28073
- } else {
28074
- ret = ">=".concat(M, ".").concat(m, ".0").concat(z, " <").concat(+M + 1, ".0.0-0");
28075
- }
28076
- } else if (pr) {
28077
- debug('replaceCaret pr', pr);
28078
- if (M === '0') {
28079
- if (m === '0') {
28080
- ret = ">=".concat(M, ".").concat(m, ".").concat(p, "-").concat(pr, " <").concat(M, ".").concat(m, ".").concat(+p + 1, "-0");
28081
- } else {
28082
- ret = ">=".concat(M, ".").concat(m, ".").concat(p, "-").concat(pr, " <").concat(M, ".").concat(+m + 1, ".0-0");
28083
- }
28084
- } else {
28085
- ret = ">=".concat(M, ".").concat(m, ".").concat(p, "-").concat(pr, " <").concat(+M + 1, ".0.0-0");
28086
- }
28087
- } else {
28088
- debug('no pr');
28089
- if (M === '0') {
28090
- if (m === '0') {
28091
- ret = ">=".concat(M, ".").concat(m, ".").concat(p).concat(z, " <").concat(M, ".").concat(m, ".").concat(+p + 1, "-0");
28092
- } else {
28093
- ret = ">=".concat(M, ".").concat(m, ".").concat(p).concat(z, " <").concat(M, ".").concat(+m + 1, ".0-0");
28094
- }
28095
- } else {
28096
- ret = ">=".concat(M, ".").concat(m, ".").concat(p, " <").concat(+M + 1, ".0.0-0");
28097
- }
28098
- }
28099
- debug('caret return', ret);
28100
- return ret;
28101
- });
28102
- };
28103
- const replaceXRanges = (comp, options) => {
28104
- debug('replaceXRanges', comp, options);
28105
- return comp.split(/\s+/).map(c => replaceXRange(c, options)).join(' ');
28106
- };
28107
- const replaceXRange = (comp, options) => {
28108
- comp = comp.trim();
28109
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
28110
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
28111
- debug('xRange', comp, ret, gtlt, M, m, p, pr);
28112
- const xM = isX(M);
28113
- const xm = xM || isX(m);
28114
- const xp = xm || isX(p);
28115
- const anyX = xp;
28116
- if (gtlt === '=' && anyX) {
28117
- gtlt = '';
28118
- }
28119
-
28120
- // if we're including prereleases in the match, then we need
28121
- // to fix this to -0, the lowest possible prerelease value
28122
- pr = options.includePrerelease ? '-0' : '';
28123
- if (xM) {
28124
- if (gtlt === '>' || gtlt === '<') {
28125
- // nothing is allowed
28126
- ret = '<0.0.0-0';
28127
- } else {
28128
- // nothing is forbidden
28129
- ret = '*';
28130
- }
28131
- } else if (gtlt && anyX) {
28132
- // we know patch is an x, because we have any x at all.
28133
- // replace X with 0
28134
- if (xm) {
28135
- m = 0;
28136
- }
28137
- p = 0;
28138
- if (gtlt === '>') {
28139
- // >1 => >=2.0.0
28140
- // >1.2 => >=1.3.0
28141
- gtlt = '>=';
28142
- if (xm) {
28143
- M = +M + 1;
28144
- m = 0;
28145
- p = 0;
28146
- } else {
28147
- m = +m + 1;
28148
- p = 0;
28149
- }
28150
- } else if (gtlt === '<=') {
28151
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
28152
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
28153
- gtlt = '<';
28154
- if (xm) {
28155
- M = +M + 1;
28156
- } else {
28157
- m = +m + 1;
28158
- }
28159
- }
28160
- if (gtlt === '<') {
28161
- pr = '-0';
28162
- }
28163
- ret = "".concat(gtlt + M, ".").concat(m, ".").concat(p).concat(pr);
28164
- } else if (xm) {
28165
- ret = ">=".concat(M, ".0.0").concat(pr, " <").concat(+M + 1, ".0.0-0");
28166
- } else if (xp) {
28167
- ret = ">=".concat(M, ".").concat(m, ".0").concat(pr, " <").concat(M, ".").concat(+m + 1, ".0-0");
28168
- }
28169
- debug('xRange return', ret);
28170
- return ret;
28171
- });
28172
- };
28173
-
28174
- // Because * is AND-ed with everything else in the comparator,
28175
- // and '' means "any version", just remove the *s entirely.
28176
- const replaceStars = (comp, options) => {
28177
- debug('replaceStars', comp, options);
28178
- // Looseness is ignored here. star is always as loose as it gets!
28179
- return comp.trim().replace(re[t.STAR], '');
28180
- };
28181
- const replaceGTE0 = (comp, options) => {
28182
- debug('replaceGTE0', comp, options);
28183
- return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');
28184
- };
28185
-
28186
- // This function is passed to string.replace(re[t.HYPHENRANGE])
28187
- // M, m, patch, prerelease, build
28188
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
28189
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
28190
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
28191
- // TODO build?
28192
- const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
28193
- if (isX(fM)) {
28194
- from = '';
28195
- } else if (isX(fm)) {
28196
- from = ">=".concat(fM, ".0.0").concat(incPr ? '-0' : '');
28197
- } else if (isX(fp)) {
28198
- from = ">=".concat(fM, ".").concat(fm, ".0").concat(incPr ? '-0' : '');
28199
- } else if (fpr) {
28200
- from = ">=".concat(from);
28201
- } else {
28202
- from = ">=".concat(from).concat(incPr ? '-0' : '');
28203
- }
28204
- if (isX(tM)) {
28205
- to = '';
28206
- } else if (isX(tm)) {
28207
- to = "<".concat(+tM + 1, ".0.0-0");
28208
- } else if (isX(tp)) {
28209
- to = "<".concat(tM, ".").concat(+tm + 1, ".0-0");
28210
- } else if (tpr) {
28211
- to = "<=".concat(tM, ".").concat(tm, ".").concat(tp, "-").concat(tpr);
28212
- } else if (incPr) {
28213
- to = "<".concat(tM, ".").concat(tm, ".").concat(+tp + 1, "-0");
28214
- } else {
28215
- to = "<=".concat(to);
28216
- }
28217
- return "".concat(from, " ").concat(to).trim();
28218
- };
28219
- const testSet = (set, version, options) => {
28220
- for (let i = 0; i < set.length; i++) {
28221
- if (!set[i].test(version)) {
28222
- return false;
28223
- }
28224
- }
28225
- if (version.prerelease.length && !options.includePrerelease) {
28226
- // Find the set of versions that are allowed to have prereleases
28227
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
28228
- // That should allow `1.2.3-pr.2` to pass.
28229
- // However, `1.2.4-alpha.notready` should NOT be allowed,
28230
- // even though it's within the range set by the comparators.
28231
- for (let i = 0; i < set.length; i++) {
28232
- debug(set[i].semver);
28233
- if (set[i].semver === Comparator.ANY) {
28234
- continue;
28235
- }
28236
- if (set[i].semver.prerelease.length > 0) {
28237
- const allowed = set[i].semver;
28238
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
28239
- return true;
28240
- }
28241
- }
28242
- }
27938
+ function requireRange () {
27939
+ if (hasRequiredRange) return range;
27940
+ hasRequiredRange = 1;
27941
+ // hoisted class for cyclic dependency
27942
+ class Range {
27943
+ constructor (range, options) {
27944
+ options = parseOptions(options);
27945
+
27946
+ if (range instanceof Range) {
27947
+ if (
27948
+ range.loose === !!options.loose &&
27949
+ range.includePrerelease === !!options.includePrerelease
27950
+ ) {
27951
+ return range
27952
+ } else {
27953
+ return new Range(range.raw, options)
27954
+ }
27955
+ }
27956
+
27957
+ if (range instanceof Comparator) {
27958
+ // just put it in the set and return
27959
+ this.raw = range.value;
27960
+ this.set = [[range]];
27961
+ this.format();
27962
+ return this
27963
+ }
27964
+
27965
+ this.options = options;
27966
+ this.loose = !!options.loose;
27967
+ this.includePrerelease = !!options.includePrerelease;
27968
+
27969
+ // First reduce all whitespace as much as possible so we do not have to rely
27970
+ // on potentially slow regexes like \s*. This is then stored and used for
27971
+ // future error messages as well.
27972
+ this.raw = range
27973
+ .trim()
27974
+ .split(/\s+/)
27975
+ .join(' ');
27976
+
27977
+ // First, split on ||
27978
+ this.set = this.raw
27979
+ .split('||')
27980
+ // map the range to a 2d array of comparators
27981
+ .map(r => this.parseRange(r.trim()))
27982
+ // throw out any comparator lists that are empty
27983
+ // this generally means that it was not a valid range, which is allowed
27984
+ // in loose mode, but will still throw if the WHOLE range is invalid.
27985
+ .filter(c => c.length);
27986
+
27987
+ if (!this.set.length) {
27988
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
27989
+ }
27990
+
27991
+ // if we have any that are not the null set, throw out null sets.
27992
+ if (this.set.length > 1) {
27993
+ // keep the first one, in case they're all null sets
27994
+ const first = this.set[0];
27995
+ this.set = this.set.filter(c => !isNullSet(c[0]));
27996
+ if (this.set.length === 0) {
27997
+ this.set = [first];
27998
+ } else if (this.set.length > 1) {
27999
+ // if we have any that are *, then the range is just *
28000
+ for (const c of this.set) {
28001
+ if (c.length === 1 && isAny(c[0])) {
28002
+ this.set = [c];
28003
+ break
28004
+ }
28005
+ }
28006
+ }
28007
+ }
28008
+
28009
+ this.format();
28010
+ }
28011
+
28012
+ format () {
28013
+ this.range = this.set
28014
+ .map((comps) => comps.join(' ').trim())
28015
+ .join('||')
28016
+ .trim();
28017
+ return this.range
28018
+ }
28019
+
28020
+ toString () {
28021
+ return this.range
28022
+ }
28023
+
28024
+ parseRange (range) {
28025
+ // memoize range parsing for performance.
28026
+ // this is a very hot path, and fully deterministic.
28027
+ const memoOpts =
28028
+ (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
28029
+ (this.options.loose && FLAG_LOOSE);
28030
+ const memoKey = memoOpts + ':' + range;
28031
+ const cached = cache.get(memoKey);
28032
+ if (cached) {
28033
+ return cached
28034
+ }
28035
+
28036
+ const loose = this.options.loose;
28037
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
28038
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
28039
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
28040
+ debug('hyphen replace', range);
28041
+
28042
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
28043
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
28044
+ debug('comparator trim', range);
28045
+
28046
+ // `~ 1.2.3` => `~1.2.3`
28047
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
28048
+ debug('tilde trim', range);
28049
+
28050
+ // `^ 1.2.3` => `^1.2.3`
28051
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
28052
+ debug('caret trim', range);
28053
+
28054
+ // At this point, the range is completely trimmed and
28055
+ // ready to be split into comparators.
28056
+
28057
+ let rangeList = range
28058
+ .split(' ')
28059
+ .map(comp => parseComparator(comp, this.options))
28060
+ .join(' ')
28061
+ .split(/\s+/)
28062
+ // >=0.0.0 is equivalent to *
28063
+ .map(comp => replaceGTE0(comp, this.options));
28064
+
28065
+ if (loose) {
28066
+ // in loose mode, throw out any that are not valid comparators
28067
+ rangeList = rangeList.filter(comp => {
28068
+ debug('loose invalid filter', comp, this.options);
28069
+ return !!comp.match(re[t.COMPARATORLOOSE])
28070
+ });
28071
+ }
28072
+ debug('range list', rangeList);
28073
+
28074
+ // if any comparators are the null set, then replace with JUST null set
28075
+ // if more than one comparator, remove any * comparators
28076
+ // also, don't include the same comparator more than once
28077
+ const rangeMap = new Map();
28078
+ const comparators = rangeList.map(comp => new Comparator(comp, this.options));
28079
+ for (const comp of comparators) {
28080
+ if (isNullSet(comp)) {
28081
+ return [comp]
28082
+ }
28083
+ rangeMap.set(comp.value, comp);
28084
+ }
28085
+ if (rangeMap.size > 1 && rangeMap.has('')) {
28086
+ rangeMap.delete('');
28087
+ }
28088
+
28089
+ const result = [...rangeMap.values()];
28090
+ cache.set(memoKey, result);
28091
+ return result
28092
+ }
28093
+
28094
+ intersects (range, options) {
28095
+ if (!(range instanceof Range)) {
28096
+ throw new TypeError('a Range is required')
28097
+ }
28098
+
28099
+ return this.set.some((thisComparators) => {
28100
+ return (
28101
+ isSatisfiable(thisComparators, options) &&
28102
+ range.set.some((rangeComparators) => {
28103
+ return (
28104
+ isSatisfiable(rangeComparators, options) &&
28105
+ thisComparators.every((thisComparator) => {
28106
+ return rangeComparators.every((rangeComparator) => {
28107
+ return thisComparator.intersects(rangeComparator, options)
28108
+ })
28109
+ })
28110
+ )
28111
+ })
28112
+ )
28113
+ })
28114
+ }
28115
+
28116
+ // if ANY of the sets match ALL of its comparators, then pass
28117
+ test (version) {
28118
+ if (!version) {
28119
+ return false
28120
+ }
28121
+
28122
+ if (typeof version === 'string') {
28123
+ try {
28124
+ version = new SemVer(version, this.options);
28125
+ } catch (er) {
28126
+ return false
28127
+ }
28128
+ }
28129
+
28130
+ for (let i = 0; i < this.set.length; i++) {
28131
+ if (testSet(this.set[i], version, this.options)) {
28132
+ return true
28133
+ }
28134
+ }
28135
+ return false
28136
+ }
28137
+ }
28243
28138
 
28244
- // Version has a -pre, but it's not one of the ones we like.
28245
- return false;
28246
- }
28247
- return true;
28248
- };
28249
- return range;
28139
+ range = Range;
28140
+
28141
+ const LRU = lrucache;
28142
+ const cache = new LRU();
28143
+
28144
+ const parseOptions = parseOptions_1;
28145
+ const Comparator = requireComparator();
28146
+ const debug = debug_1;
28147
+ const SemVer = semver;
28148
+ const {
28149
+ safeRe: re,
28150
+ t,
28151
+ comparatorTrimReplace,
28152
+ tildeTrimReplace,
28153
+ caretTrimReplace,
28154
+ } = reExports;
28155
+ const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = constants;
28156
+
28157
+ const isNullSet = c => c.value === '<0.0.0-0';
28158
+ const isAny = c => c.value === '';
28159
+
28160
+ // take a set of comparators and determine whether there
28161
+ // exists a version which can satisfy it
28162
+ const isSatisfiable = (comparators, options) => {
28163
+ let result = true;
28164
+ const remainingComparators = comparators.slice();
28165
+ let testComparator = remainingComparators.pop();
28166
+
28167
+ while (result && remainingComparators.length) {
28168
+ result = remainingComparators.every((otherComparator) => {
28169
+ return testComparator.intersects(otherComparator, options)
28170
+ });
28171
+
28172
+ testComparator = remainingComparators.pop();
28173
+ }
28174
+
28175
+ return result
28176
+ };
28177
+
28178
+ // comprised of xranges, tildes, stars, and gtlt's at this point.
28179
+ // already replaced the hyphen ranges
28180
+ // turn into a set of JUST comparators.
28181
+ const parseComparator = (comp, options) => {
28182
+ debug('comp', comp, options);
28183
+ comp = replaceCarets(comp, options);
28184
+ debug('caret', comp);
28185
+ comp = replaceTildes(comp, options);
28186
+ debug('tildes', comp);
28187
+ comp = replaceXRanges(comp, options);
28188
+ debug('xrange', comp);
28189
+ comp = replaceStars(comp, options);
28190
+ debug('stars', comp);
28191
+ return comp
28192
+ };
28193
+
28194
+ const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
28195
+
28196
+ // ~, ~> --> * (any, kinda silly)
28197
+ // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
28198
+ // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
28199
+ // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
28200
+ // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
28201
+ // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
28202
+ // ~0.0.1 --> >=0.0.1 <0.1.0-0
28203
+ const replaceTildes = (comp, options) => {
28204
+ return comp
28205
+ .trim()
28206
+ .split(/\s+/)
28207
+ .map((c) => replaceTilde(c, options))
28208
+ .join(' ')
28209
+ };
28210
+
28211
+ const replaceTilde = (comp, options) => {
28212
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
28213
+ return comp.replace(r, (_, M, m, p, pr) => {
28214
+ debug('tilde', comp, _, M, m, p, pr);
28215
+ let ret;
28216
+
28217
+ if (isX(M)) {
28218
+ ret = '';
28219
+ } else if (isX(m)) {
28220
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
28221
+ } else if (isX(p)) {
28222
+ // ~1.2 == >=1.2.0 <1.3.0-0
28223
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
28224
+ } else if (pr) {
28225
+ debug('replaceTilde pr', pr);
28226
+ ret = `>=${M}.${m}.${p}-${pr
28227
+ } <${M}.${+m + 1}.0-0`;
28228
+ } else {
28229
+ // ~1.2.3 == >=1.2.3 <1.3.0-0
28230
+ ret = `>=${M}.${m}.${p
28231
+ } <${M}.${+m + 1}.0-0`;
28232
+ }
28233
+
28234
+ debug('tilde return', ret);
28235
+ return ret
28236
+ })
28237
+ };
28238
+
28239
+ // ^ --> * (any, kinda silly)
28240
+ // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
28241
+ // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
28242
+ // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
28243
+ // ^1.2.3 --> >=1.2.3 <2.0.0-0
28244
+ // ^1.2.0 --> >=1.2.0 <2.0.0-0
28245
+ // ^0.0.1 --> >=0.0.1 <0.0.2-0
28246
+ // ^0.1.0 --> >=0.1.0 <0.2.0-0
28247
+ const replaceCarets = (comp, options) => {
28248
+ return comp
28249
+ .trim()
28250
+ .split(/\s+/)
28251
+ .map((c) => replaceCaret(c, options))
28252
+ .join(' ')
28253
+ };
28254
+
28255
+ const replaceCaret = (comp, options) => {
28256
+ debug('caret', comp, options);
28257
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
28258
+ const z = options.includePrerelease ? '-0' : '';
28259
+ return comp.replace(r, (_, M, m, p, pr) => {
28260
+ debug('caret', comp, _, M, m, p, pr);
28261
+ let ret;
28262
+
28263
+ if (isX(M)) {
28264
+ ret = '';
28265
+ } else if (isX(m)) {
28266
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
28267
+ } else if (isX(p)) {
28268
+ if (M === '0') {
28269
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
28270
+ } else {
28271
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
28272
+ }
28273
+ } else if (pr) {
28274
+ debug('replaceCaret pr', pr);
28275
+ if (M === '0') {
28276
+ if (m === '0') {
28277
+ ret = `>=${M}.${m}.${p}-${pr
28278
+ } <${M}.${m}.${+p + 1}-0`;
28279
+ } else {
28280
+ ret = `>=${M}.${m}.${p}-${pr
28281
+ } <${M}.${+m + 1}.0-0`;
28282
+ }
28283
+ } else {
28284
+ ret = `>=${M}.${m}.${p}-${pr
28285
+ } <${+M + 1}.0.0-0`;
28286
+ }
28287
+ } else {
28288
+ debug('no pr');
28289
+ if (M === '0') {
28290
+ if (m === '0') {
28291
+ ret = `>=${M}.${m}.${p
28292
+ }${z} <${M}.${m}.${+p + 1}-0`;
28293
+ } else {
28294
+ ret = `>=${M}.${m}.${p
28295
+ }${z} <${M}.${+m + 1}.0-0`;
28296
+ }
28297
+ } else {
28298
+ ret = `>=${M}.${m}.${p
28299
+ } <${+M + 1}.0.0-0`;
28300
+ }
28301
+ }
28302
+
28303
+ debug('caret return', ret);
28304
+ return ret
28305
+ })
28306
+ };
28307
+
28308
+ const replaceXRanges = (comp, options) => {
28309
+ debug('replaceXRanges', comp, options);
28310
+ return comp
28311
+ .split(/\s+/)
28312
+ .map((c) => replaceXRange(c, options))
28313
+ .join(' ')
28314
+ };
28315
+
28316
+ const replaceXRange = (comp, options) => {
28317
+ comp = comp.trim();
28318
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
28319
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
28320
+ debug('xRange', comp, ret, gtlt, M, m, p, pr);
28321
+ const xM = isX(M);
28322
+ const xm = xM || isX(m);
28323
+ const xp = xm || isX(p);
28324
+ const anyX = xp;
28325
+
28326
+ if (gtlt === '=' && anyX) {
28327
+ gtlt = '';
28328
+ }
28329
+
28330
+ // if we're including prereleases in the match, then we need
28331
+ // to fix this to -0, the lowest possible prerelease value
28332
+ pr = options.includePrerelease ? '-0' : '';
28333
+
28334
+ if (xM) {
28335
+ if (gtlt === '>' || gtlt === '<') {
28336
+ // nothing is allowed
28337
+ ret = '<0.0.0-0';
28338
+ } else {
28339
+ // nothing is forbidden
28340
+ ret = '*';
28341
+ }
28342
+ } else if (gtlt && anyX) {
28343
+ // we know patch is an x, because we have any x at all.
28344
+ // replace X with 0
28345
+ if (xm) {
28346
+ m = 0;
28347
+ }
28348
+ p = 0;
28349
+
28350
+ if (gtlt === '>') {
28351
+ // >1 => >=2.0.0
28352
+ // >1.2 => >=1.3.0
28353
+ gtlt = '>=';
28354
+ if (xm) {
28355
+ M = +M + 1;
28356
+ m = 0;
28357
+ p = 0;
28358
+ } else {
28359
+ m = +m + 1;
28360
+ p = 0;
28361
+ }
28362
+ } else if (gtlt === '<=') {
28363
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
28364
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
28365
+ gtlt = '<';
28366
+ if (xm) {
28367
+ M = +M + 1;
28368
+ } else {
28369
+ m = +m + 1;
28370
+ }
28371
+ }
28372
+
28373
+ if (gtlt === '<') {
28374
+ pr = '-0';
28375
+ }
28376
+
28377
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
28378
+ } else if (xm) {
28379
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
28380
+ } else if (xp) {
28381
+ ret = `>=${M}.${m}.0${pr
28382
+ } <${M}.${+m + 1}.0-0`;
28383
+ }
28384
+
28385
+ debug('xRange return', ret);
28386
+
28387
+ return ret
28388
+ })
28389
+ };
28390
+
28391
+ // Because * is AND-ed with everything else in the comparator,
28392
+ // and '' means "any version", just remove the *s entirely.
28393
+ const replaceStars = (comp, options) => {
28394
+ debug('replaceStars', comp, options);
28395
+ // Looseness is ignored here. star is always as loose as it gets!
28396
+ return comp
28397
+ .trim()
28398
+ .replace(re[t.STAR], '')
28399
+ };
28400
+
28401
+ const replaceGTE0 = (comp, options) => {
28402
+ debug('replaceGTE0', comp, options);
28403
+ return comp
28404
+ .trim()
28405
+ .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
28406
+ };
28407
+
28408
+ // This function is passed to string.replace(re[t.HYPHENRANGE])
28409
+ // M, m, patch, prerelease, build
28410
+ // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
28411
+ // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
28412
+ // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
28413
+ // TODO build?
28414
+ const hyphenReplace = incPr => ($0,
28415
+ from, fM, fm, fp, fpr, fb,
28416
+ to, tM, tm, tp, tpr) => {
28417
+ if (isX(fM)) {
28418
+ from = '';
28419
+ } else if (isX(fm)) {
28420
+ from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
28421
+ } else if (isX(fp)) {
28422
+ from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
28423
+ } else if (fpr) {
28424
+ from = `>=${from}`;
28425
+ } else {
28426
+ from = `>=${from}${incPr ? '-0' : ''}`;
28427
+ }
28428
+
28429
+ if (isX(tM)) {
28430
+ to = '';
28431
+ } else if (isX(tm)) {
28432
+ to = `<${+tM + 1}.0.0-0`;
28433
+ } else if (isX(tp)) {
28434
+ to = `<${tM}.${+tm + 1}.0-0`;
28435
+ } else if (tpr) {
28436
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
28437
+ } else if (incPr) {
28438
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
28439
+ } else {
28440
+ to = `<=${to}`;
28441
+ }
28442
+
28443
+ return `${from} ${to}`.trim()
28444
+ };
28445
+
28446
+ const testSet = (set, version, options) => {
28447
+ for (let i = 0; i < set.length; i++) {
28448
+ if (!set[i].test(version)) {
28449
+ return false
28450
+ }
28451
+ }
28452
+
28453
+ if (version.prerelease.length && !options.includePrerelease) {
28454
+ // Find the set of versions that are allowed to have prereleases
28455
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
28456
+ // That should allow `1.2.3-pr.2` to pass.
28457
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
28458
+ // even though it's within the range set by the comparators.
28459
+ for (let i = 0; i < set.length; i++) {
28460
+ debug(set[i].semver);
28461
+ if (set[i].semver === Comparator.ANY) {
28462
+ continue
28463
+ }
28464
+
28465
+ if (set[i].semver.prerelease.length > 0) {
28466
+ const allowed = set[i].semver;
28467
+ if (allowed.major === version.major &&
28468
+ allowed.minor === version.minor &&
28469
+ allowed.patch === version.patch) {
28470
+ return true
28471
+ }
28472
+ }
28473
+ }
28474
+
28475
+ // Version has a -pre, but it's not one of the ones we like.
28476
+ return false
28477
+ }
28478
+
28479
+ return true
28480
+ };
28481
+ return range;
28250
28482
  }
28251
28483
 
28252
28484
  const Range = requireRange();
@@ -28254,11 +28486,12 @@ const satisfies = (version, range, options) => {
28254
28486
  try {
28255
28487
  range = new Range(range, options);
28256
28488
  } catch (er) {
28257
- return false;
28489
+ return false
28258
28490
  }
28259
- return range.test(version);
28491
+ return range.test(version)
28260
28492
  };
28261
28493
  var satisfies_1 = satisfies;
28494
+
28262
28495
  var satisfies$1 = /*@__PURE__*/getDefaultExportFromCjs(satisfies_1);
28263
28496
 
28264
28497
  const LOADED = {};
@@ -28973,7 +29206,8 @@ function nuked() {
28973
29206
  onSelectionDeactivated
28974
29207
  }, options)),
28975
29208
  stateName: options.stateName || '$',
28976
- renderedCallback: resolve
29209
+ renderedCallback: resolve,
29210
+ flags: halo.public.galaxy.flags
28977
29211
  });
28978
29212
  root.add(this._instance);
28979
29213
  });
@@ -29027,7 +29261,8 @@ function nuked() {
29027
29261
  app,
29028
29262
  fieldIdentifier,
29029
29263
  options: opts,
29030
- stateName: options.stateName || '$'
29264
+ stateName: options.stateName || '$',
29265
+ flags: halo.public.galaxy.flags
29031
29266
  });
29032
29267
  root.add(api._popoverInstance);
29033
29268
  }