camunda-bpmn-js 0.13.0-alpha.4 → 0.13.0-alpha.5

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.
@@ -61557,6 +61557,49 @@
61557
61557
  height: "16"
61558
61558
  };
61559
61559
 
61560
+ var FeelRequiredIcon = function FeelRequiredIcon(props) {
61561
+ return o$2("svg", { ...props,
61562
+ children: [o$2("path", {
61563
+ d: "M5.8 7.06V5.95h4.307v1.11H5.8zm0 3.071v-1.11h4.307v1.11H5.8z",
61564
+ fill: "#505562"
61565
+ }), o$2("path", {
61566
+ fillRule: "evenodd",
61567
+ clipRule: "evenodd",
61568
+ d: "M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268z",
61569
+ fill: "#505562"
61570
+ }), o$2("path", {
61571
+ d: "m11.28 6.072-.832-.56 1.016-1.224L10 3.848l.312-.912 1.392.584L11.632 2h1.032l-.072 1.52 1.392-.584.312.912-1.464.44 1.008 1.224-.832.552-.864-1.296-.864 1.304z",
61572
+ fill: "#505562"
61573
+ })]
61574
+ });
61575
+ };
61576
+
61577
+ FeelRequiredIcon.defaultProps = {
61578
+ viewBox: "0 0 16 16",
61579
+ fill: "none",
61580
+ xmlns: "http://www.w3.org/2000/svg"
61581
+ };
61582
+
61583
+ var FeelOptionalIcon = function FeelOptionalIcon(props) {
61584
+ return o$2("svg", { ...props,
61585
+ children: [o$2("path", {
61586
+ d: "M5.845 7.04V5.93h4.307v1.11H5.845zm0 3.07V9h4.307v1.11H5.845z",
61587
+ fill: "#505562"
61588
+ }), o$2("path", {
61589
+ fillRule: "evenodd",
61590
+ clipRule: "evenodd",
61591
+ d: "M3.286 8a4.714 4.714 0 1 0 9.428 0 4.714 4.714 0 0 0-9.428 0zM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z",
61592
+ fill: "#505562"
61593
+ })]
61594
+ });
61595
+ };
61596
+
61597
+ FeelOptionalIcon.defaultProps = {
61598
+ viewBox: "0 0 16 16",
61599
+ fill: "none",
61600
+ xmlns: "http://www.w3.org/2000/svg"
61601
+ };
61602
+
61560
61603
  function Group(props) {
61561
61604
  const {
61562
61605
  element,
@@ -61976,12 +62019,27 @@
61976
62019
  return `bio-properties-panel-${id}`;
61977
62020
  }
61978
62021
 
62022
+ function FeelIcon(props) {
62023
+ const {
62024
+ label,
62025
+ feel = false
62026
+ } = props;
62027
+ const feelRequiredLabel = ' must be a FEEL expression';
62028
+ const feelOptionalLabel = ' can optionally be a FEEL expression';
62029
+ return o$2("i", {
62030
+ class: "bio-properties-panel-feel-icon",
62031
+ title: label + (feel === 'required' ? feelRequiredLabel : feelOptionalLabel),
62032
+ children: feel === 'required' ? o$2(FeelRequiredIcon, {}) : o$2(FeelOptionalIcon, {})
62033
+ });
62034
+ }
62035
+
61979
62036
  function TextArea(props) {
61980
62037
  const {
61981
62038
  id,
61982
62039
  label,
61983
62040
  rows = 2,
61984
62041
  debounce,
62042
+ feel,
61985
62043
  onInput,
61986
62044
  value = '',
61987
62045
  disabled,
@@ -61997,7 +62055,10 @@
61997
62055
  children: [o$2("label", {
61998
62056
  for: prefixId$2(id),
61999
62057
  class: "bio-properties-panel-label",
62000
- children: label
62058
+ children: [label, feel && o$2(FeelIcon, {
62059
+ feel: feel,
62060
+ label: label
62061
+ })]
62001
62062
  }), o$2("textarea", {
62002
62063
  id: prefixId$2(id),
62003
62064
  name: id,
@@ -62033,6 +62094,7 @@
62033
62094
  id,
62034
62095
  description,
62035
62096
  debounce,
62097
+ feel,
62036
62098
  label,
62037
62099
  getValue,
62038
62100
  setValue,
@@ -62052,6 +62114,7 @@
62052
62114
  rows: rows,
62053
62115
  debounce: debounce,
62054
62116
  monospace: monospace,
62117
+ feel: feel,
62055
62118
  disabled: disabled
62056
62119
  }), o$2(Description, {
62057
62120
  forId: id,
@@ -62065,2918 +62128,207 @@
62065
62128
  } // helpers /////////////////
62066
62129
 
62067
62130
  function prefixId$2(id) {
62068
- return `bio-properties-panel-${id}`;
62069
- }
62070
-
62071
- function Textfield(props) {
62072
- const {
62073
- debounce,
62074
- disabled = false,
62075
- id,
62076
- label,
62077
- onInput,
62078
- value = ''
62079
- } = props;
62080
- const handleInput = d$1(() => {
62081
- return debounce(({
62082
- target
62083
- }) => onInput(target.value.length ? target.value : undefined));
62084
- }, [onInput, debounce]);
62085
- return o$2("div", {
62086
- class: "bio-properties-panel-textfield",
62087
- children: [o$2("label", {
62088
- for: prefixId$1(id),
62089
- class: "bio-properties-panel-label",
62090
- children: label
62091
- }), o$2("input", {
62092
- id: prefixId$1(id),
62093
- type: "text",
62094
- name: id,
62095
- spellCheck: "false",
62096
- autoComplete: "off",
62097
- disabled: disabled,
62098
- class: "bio-properties-panel-input",
62099
- onInput: handleInput,
62100
- onFocus: props.onFocus,
62101
- onBlur: props.onBlur,
62102
- value: value || ''
62103
- })]
62104
- });
62105
- }
62106
- /**
62107
- * @param {Object} props
62108
- * @param {Object} props.element
62109
- * @param {String} props.id
62110
- * @param {String} props.description
62111
- * @param {Boolean} props.debounce
62112
- * @param {Boolean} props.disabled
62113
- * @param {String} props.label
62114
- * @param {Function} props.getValue
62115
- * @param {Function} props.setValue
62116
- * @param {Function} props.validate
62117
- */
62118
-
62119
-
62120
- function TextfieldEntry(props) {
62121
- const {
62122
- element,
62123
- id,
62124
- description,
62125
- debounce,
62126
- disabled,
62127
- label,
62128
- getValue,
62129
- setValue,
62130
- validate
62131
- } = props;
62132
- const [error, setError] = l(null);
62133
- const [invalidValueCache, setInvalidValueCache] = l(null);
62134
- let value = getValue(element);
62135
- const prevValue = usePrevious(value); // validate again when value prop changed
62136
-
62137
- y$1(() => {
62138
- const err = validate ? validate(value) : null;
62139
- setError(err);
62140
- }, [value]); // validate on change
62141
-
62142
- const handleChange = newValue => {
62143
- const err = validate ? validate(newValue) : null;
62144
-
62145
- if (err) {
62146
- setInvalidValueCache(newValue);
62147
- } else {
62148
- setValue(newValue);
62149
- }
62150
-
62151
- setError(err);
62152
- }; // keep showing invalid value on errors, although it was not set
62153
-
62154
-
62155
- if (prevValue === value && error) {
62156
- value = invalidValueCache;
62157
- }
62158
-
62159
- return o$2("div", {
62160
- class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
62161
- "data-entry-id": id,
62162
- children: [o$2(Textfield, {
62163
- id: id,
62164
- label: label,
62165
- value: value,
62166
- onInput: handleChange,
62167
- debounce: debounce,
62168
- disabled: disabled
62169
- }), o$2(Description, {
62170
- forId: id,
62171
- element: element,
62172
- value: description
62173
- }), error && o$2("div", {
62174
- class: "bio-properties-panel-error",
62175
- children: error
62176
- })]
62177
- });
62178
- }
62179
- function isEdited$1(node) {
62180
- return node && !!node.value;
62181
- } // helpers /////////////////
62182
-
62183
- function prefixId$1(id) {
62184
- return `bio-properties-panel-${id}`;
62185
- }
62186
-
62187
- const DEFAULT_DEBOUNCE_TIME = 300;
62188
- function debounceInput(debounceDelay) {
62189
- return function _debounceInput(fn) {
62190
- if (debounceDelay !== false) {
62191
- var debounceTime = isNumber(debounceDelay) ? debounceDelay : DEFAULT_DEBOUNCE_TIME;
62192
- return debounce(fn, debounceTime);
62193
- } else {
62194
- return fn;
62195
- }
62196
- };
62197
- }
62198
- debounceInput.$inject = ['config.debounceInput'];
62199
-
62200
- var index$2 = {
62201
- debounceInput: ['factory', debounceInput]
62202
- };
62203
-
62204
- /**
62205
- * Failsafe remove an element from a collection
62206
- *
62207
- * @param {Array<Object>} [collection]
62208
- * @param {Object} [element]
62209
- *
62210
- * @return {number} the previous index of the element
62211
- */
62212
-
62213
- /**
62214
- * Fail save add an element to the given connection, ensuring
62215
- * it does not yet exist.
62216
- *
62217
- * @param {Array<Object>} collection
62218
- * @param {Object} element
62219
- * @param {number} idx
62220
- */
62221
- function add$2(collection, element, idx) {
62222
-
62223
- if (!collection || !element) {
62224
- return;
62225
- }
62226
-
62227
- if (typeof idx !== 'number') {
62228
- idx = -1;
62229
- }
62230
-
62231
- var currentIdx = collection.indexOf(element);
62232
-
62233
- if (currentIdx !== -1) {
62234
-
62235
- if (currentIdx === idx) {
62236
-
62237
- // nothing to do, position has not changed
62238
- return;
62239
- } else {
62240
-
62241
- if (idx !== -1) {
62242
-
62243
- // remove from current position
62244
- collection.splice(currentIdx, 1);
62245
- } else {
62246
-
62247
- // already exists in collection
62248
- return;
62249
- }
62250
- }
62251
- }
62252
-
62253
- if (idx !== -1) {
62254
-
62255
- // insert at specified position
62256
- collection.splice(idx, 0, element);
62257
- } else {
62258
-
62259
- // push to end
62260
- collection.push(element);
62261
- }
62262
- }
62263
-
62264
- // Note: this is the semver.org version of the spec that it implements
62265
- // Not necessarily the package version of this code.
62266
- const SEMVER_SPEC_VERSION = '2.0.0';
62267
-
62268
- const MAX_LENGTH = 256;
62269
- const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
62270
- /* istanbul ignore next */ 9007199254740991;
62271
-
62272
- // Max safe segment length for coercion.
62273
- const MAX_SAFE_COMPONENT_LENGTH = 16;
62274
-
62275
- var constants = {
62276
- SEMVER_SPEC_VERSION,
62277
- MAX_LENGTH,
62278
- MAX_SAFE_INTEGER,
62279
- MAX_SAFE_COMPONENT_LENGTH
62280
- };
62281
-
62282
- const debug = (
62283
- typeof process === 'object' &&
62284
- process.env &&
62285
- process.env.NODE_DEBUG &&
62286
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
62287
- ) ? (...args) => console.error('SEMVER', ...args)
62288
- : () => {};
62289
-
62290
- var debug_1 = debug;
62291
-
62292
- var re_1 = createCommonjsModule(function (module, exports) {
62293
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
62294
-
62295
- exports = module.exports = {};
62296
-
62297
- // The actual regexps go on exports.re
62298
- const re = exports.re = [];
62299
- const src = exports.src = [];
62300
- const t = exports.t = {};
62301
- let R = 0;
62302
-
62303
- const createToken = (name, value, isGlobal) => {
62304
- const index = R++;
62305
- debug_1(index, value);
62306
- t[name] = index;
62307
- src[index] = value;
62308
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
62309
- };
62310
-
62311
- // The following Regular Expressions can be used for tokenizing,
62312
- // validating, and parsing SemVer version strings.
62313
-
62314
- // ## Numeric Identifier
62315
- // A single `0`, or a non-zero digit followed by zero or more digits.
62316
-
62317
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
62318
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
62319
-
62320
- // ## Non-numeric Identifier
62321
- // Zero or more digits, followed by a letter or hyphen, and then zero or
62322
- // more letters, digits, or hyphens.
62323
-
62324
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
62325
-
62326
- // ## Main Version
62327
- // Three dot-separated numeric identifiers.
62328
-
62329
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
62330
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
62331
- `(${src[t.NUMERICIDENTIFIER]})`);
62332
-
62333
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
62334
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
62335
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
62336
-
62337
- // ## Pre-release Version Identifier
62338
- // A numeric identifier, or a non-numeric identifier.
62339
-
62340
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
62341
- }|${src[t.NONNUMERICIDENTIFIER]})`);
62342
-
62343
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
62344
- }|${src[t.NONNUMERICIDENTIFIER]})`);
62345
-
62346
- // ## Pre-release Version
62347
- // Hyphen, followed by one or more dot-separated pre-release version
62348
- // identifiers.
62349
-
62350
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
62351
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
62352
-
62353
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
62354
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
62355
-
62356
- // ## Build Metadata Identifier
62357
- // Any combination of digits, letters, or hyphens.
62358
-
62359
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
62360
-
62361
- // ## Build Metadata
62362
- // Plus sign, followed by one or more period-separated build metadata
62363
- // identifiers.
62364
-
62365
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
62366
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
62367
-
62368
- // ## Full Version String
62369
- // A main version, followed optionally by a pre-release version and
62370
- // build metadata.
62371
-
62372
- // Note that the only major, minor, patch, and pre-release sections of
62373
- // the version string are capturing groups. The build metadata is not a
62374
- // capturing group, because it should not ever be used in version
62375
- // comparison.
62376
-
62377
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
62378
- }${src[t.PRERELEASE]}?${
62379
- src[t.BUILD]}?`);
62380
-
62381
- createToken('FULL', `^${src[t.FULLPLAIN]}$`);
62382
-
62383
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
62384
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
62385
- // common in the npm registry.
62386
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
62387
- }${src[t.PRERELEASELOOSE]}?${
62388
- src[t.BUILD]}?`);
62389
-
62390
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
62391
-
62392
- createToken('GTLT', '((?:<|>)?=?)');
62393
-
62394
- // Something like "2.*" or "1.2.x".
62395
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
62396
- // Only the first item is strictly required.
62397
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
62398
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
62399
-
62400
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
62401
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
62402
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
62403
- `(?:${src[t.PRERELEASE]})?${
62404
- src[t.BUILD]}?` +
62405
- `)?)?`);
62406
-
62407
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
62408
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
62409
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
62410
- `(?:${src[t.PRERELEASELOOSE]})?${
62411
- src[t.BUILD]}?` +
62412
- `)?)?`);
62413
-
62414
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
62415
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
62416
-
62417
- // Coercion.
62418
- // Extract anything that could conceivably be a part of a valid semver
62419
- createToken('COERCE', `${'(^|[^\\d])' +
62420
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
62421
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
62422
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
62423
- `(?:$|[^\\d])`);
62424
- createToken('COERCERTL', src[t.COERCE], true);
62425
-
62426
- // Tilde ranges.
62427
- // Meaning is "reasonably at or greater than"
62428
- createToken('LONETILDE', '(?:~>?)');
62429
-
62430
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
62431
- exports.tildeTrimReplace = '$1~';
62432
-
62433
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
62434
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
62435
-
62436
- // Caret ranges.
62437
- // Meaning is "at least and backwards compatible with"
62438
- createToken('LONECARET', '(?:\\^)');
62439
-
62440
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
62441
- exports.caretTrimReplace = '$1^';
62442
-
62443
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
62444
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
62445
-
62446
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
62447
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
62448
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
62449
-
62450
- // An expression to strip any whitespace between the gtlt and the thing
62451
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
62452
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
62453
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
62454
- exports.comparatorTrimReplace = '$1$2$3';
62455
-
62456
- // Something like `1.2.3 - 1.2.4`
62457
- // Note that these all use the loose form, because they'll be
62458
- // checked against either the strict or loose comparator form
62459
- // later.
62460
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
62461
- `\\s+-\\s+` +
62462
- `(${src[t.XRANGEPLAIN]})` +
62463
- `\\s*$`);
62464
-
62465
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
62466
- `\\s+-\\s+` +
62467
- `(${src[t.XRANGEPLAINLOOSE]})` +
62468
- `\\s*$`);
62469
-
62470
- // Star ranges basically just allow anything at all.
62471
- createToken('STAR', '(<|>)?=?\\s*\\*');
62472
- // >=0.0.0 is like a star
62473
- createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$');
62474
- createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$');
62475
- });
62476
-
62477
- // parse out just the options we care about so we always get a consistent
62478
- // obj with keys in a consistent order.
62479
- const opts = ['includePrerelease', 'loose', 'rtl'];
62480
- const parseOptions = options =>
62481
- !options ? {}
62482
- : typeof options !== 'object' ? { loose: true }
62483
- : opts.filter(k => options[k]).reduce((options, k) => {
62484
- options[k] = true;
62485
- return options
62486
- }, {});
62487
- var parseOptions_1 = parseOptions;
62488
-
62489
- const numeric = /^[0-9]+$/;
62490
- const compareIdentifiers = (a, b) => {
62491
- const anum = numeric.test(a);
62492
- const bnum = numeric.test(b);
62493
-
62494
- if (anum && bnum) {
62495
- a = +a;
62496
- b = +b;
62497
- }
62498
-
62499
- return a === b ? 0
62500
- : (anum && !bnum) ? -1
62501
- : (bnum && !anum) ? 1
62502
- : a < b ? -1
62503
- : 1
62504
- };
62505
-
62506
- const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
62507
-
62508
- var identifiers = {
62509
- compareIdentifiers,
62510
- rcompareIdentifiers
62511
- };
62512
-
62513
- const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1 } = constants;
62514
- const { re: re$2, t: t$2 } = re_1;
62515
-
62516
-
62517
- const { compareIdentifiers: compareIdentifiers$1 } = identifiers;
62518
- class SemVer {
62519
- constructor (version, options) {
62520
- options = parseOptions_1(options);
62521
-
62522
- if (version instanceof SemVer) {
62523
- if (version.loose === !!options.loose &&
62524
- version.includePrerelease === !!options.includePrerelease) {
62525
- return version
62526
- } else {
62527
- version = version.version;
62528
- }
62529
- } else if (typeof version !== 'string') {
62530
- throw new TypeError(`Invalid Version: ${version}`)
62531
- }
62532
-
62533
- if (version.length > MAX_LENGTH$1) {
62534
- throw new TypeError(
62535
- `version is longer than ${MAX_LENGTH$1} characters`
62536
- )
62537
- }
62538
-
62539
- debug_1('SemVer', version, options);
62540
- this.options = options;
62541
- this.loose = !!options.loose;
62542
- // this isn't actually relevant for versions, but keep it so that we
62543
- // don't run into trouble passing this.options around.
62544
- this.includePrerelease = !!options.includePrerelease;
62545
-
62546
- const m = version.trim().match(options.loose ? re$2[t$2.LOOSE] : re$2[t$2.FULL]);
62547
-
62548
- if (!m) {
62549
- throw new TypeError(`Invalid Version: ${version}`)
62550
- }
62551
-
62552
- this.raw = version;
62553
-
62554
- // these are actually numbers
62555
- this.major = +m[1];
62556
- this.minor = +m[2];
62557
- this.patch = +m[3];
62558
-
62559
- if (this.major > MAX_SAFE_INTEGER$1 || this.major < 0) {
62560
- throw new TypeError('Invalid major version')
62561
- }
62562
-
62563
- if (this.minor > MAX_SAFE_INTEGER$1 || this.minor < 0) {
62564
- throw new TypeError('Invalid minor version')
62565
- }
62566
-
62567
- if (this.patch > MAX_SAFE_INTEGER$1 || this.patch < 0) {
62568
- throw new TypeError('Invalid patch version')
62569
- }
62570
-
62571
- // numberify any prerelease numeric ids
62572
- if (!m[4]) {
62573
- this.prerelease = [];
62574
- } else {
62575
- this.prerelease = m[4].split('.').map((id) => {
62576
- if (/^[0-9]+$/.test(id)) {
62577
- const num = +id;
62578
- if (num >= 0 && num < MAX_SAFE_INTEGER$1) {
62579
- return num
62580
- }
62581
- }
62582
- return id
62583
- });
62584
- }
62585
-
62586
- this.build = m[5] ? m[5].split('.') : [];
62587
- this.format();
62588
- }
62589
-
62590
- format () {
62591
- this.version = `${this.major}.${this.minor}.${this.patch}`;
62592
- if (this.prerelease.length) {
62593
- this.version += `-${this.prerelease.join('.')}`;
62594
- }
62595
- return this.version
62596
- }
62597
-
62598
- toString () {
62599
- return this.version
62600
- }
62601
-
62602
- compare (other) {
62603
- debug_1('SemVer.compare', this.version, this.options, other);
62604
- if (!(other instanceof SemVer)) {
62605
- if (typeof other === 'string' && other === this.version) {
62606
- return 0
62607
- }
62608
- other = new SemVer(other, this.options);
62609
- }
62610
-
62611
- if (other.version === this.version) {
62612
- return 0
62613
- }
62614
-
62615
- return this.compareMain(other) || this.comparePre(other)
62616
- }
62617
-
62618
- compareMain (other) {
62619
- if (!(other instanceof SemVer)) {
62620
- other = new SemVer(other, this.options);
62621
- }
62622
-
62623
- return (
62624
- compareIdentifiers$1(this.major, other.major) ||
62625
- compareIdentifiers$1(this.minor, other.minor) ||
62626
- compareIdentifiers$1(this.patch, other.patch)
62627
- )
62628
- }
62629
-
62630
- comparePre (other) {
62631
- if (!(other instanceof SemVer)) {
62632
- other = new SemVer(other, this.options);
62633
- }
62634
-
62635
- // NOT having a prerelease is > having one
62636
- if (this.prerelease.length && !other.prerelease.length) {
62637
- return -1
62638
- } else if (!this.prerelease.length && other.prerelease.length) {
62639
- return 1
62640
- } else if (!this.prerelease.length && !other.prerelease.length) {
62641
- return 0
62642
- }
62643
-
62644
- let i = 0;
62645
- do {
62646
- const a = this.prerelease[i];
62647
- const b = other.prerelease[i];
62648
- debug_1('prerelease compare', i, a, b);
62649
- if (a === undefined && b === undefined) {
62650
- return 0
62651
- } else if (b === undefined) {
62652
- return 1
62653
- } else if (a === undefined) {
62654
- return -1
62655
- } else if (a === b) {
62656
- continue
62657
- } else {
62658
- return compareIdentifiers$1(a, b)
62659
- }
62660
- } while (++i)
62661
- }
62662
-
62663
- compareBuild (other) {
62664
- if (!(other instanceof SemVer)) {
62665
- other = new SemVer(other, this.options);
62666
- }
62667
-
62668
- let i = 0;
62669
- do {
62670
- const a = this.build[i];
62671
- const b = other.build[i];
62672
- debug_1('prerelease compare', i, a, b);
62673
- if (a === undefined && b === undefined) {
62674
- return 0
62675
- } else if (b === undefined) {
62676
- return 1
62677
- } else if (a === undefined) {
62678
- return -1
62679
- } else if (a === b) {
62680
- continue
62681
- } else {
62682
- return compareIdentifiers$1(a, b)
62683
- }
62684
- } while (++i)
62685
- }
62686
-
62687
- // preminor will bump the version up to the next minor release, and immediately
62688
- // down to pre-release. premajor and prepatch work the same way.
62689
- inc (release, identifier) {
62690
- switch (release) {
62691
- case 'premajor':
62692
- this.prerelease.length = 0;
62693
- this.patch = 0;
62694
- this.minor = 0;
62695
- this.major++;
62696
- this.inc('pre', identifier);
62697
- break
62698
- case 'preminor':
62699
- this.prerelease.length = 0;
62700
- this.patch = 0;
62701
- this.minor++;
62702
- this.inc('pre', identifier);
62703
- break
62704
- case 'prepatch':
62705
- // If this is already a prerelease, it will bump to the next version
62706
- // drop any prereleases that might already exist, since they are not
62707
- // relevant at this point.
62708
- this.prerelease.length = 0;
62709
- this.inc('patch', identifier);
62710
- this.inc('pre', identifier);
62711
- break
62712
- // If the input is a non-prerelease version, this acts the same as
62713
- // prepatch.
62714
- case 'prerelease':
62715
- if (this.prerelease.length === 0) {
62716
- this.inc('patch', identifier);
62717
- }
62718
- this.inc('pre', identifier);
62719
- break
62720
-
62721
- case 'major':
62722
- // If this is a pre-major version, bump up to the same major version.
62723
- // Otherwise increment major.
62724
- // 1.0.0-5 bumps to 1.0.0
62725
- // 1.1.0 bumps to 2.0.0
62726
- if (
62727
- this.minor !== 0 ||
62728
- this.patch !== 0 ||
62729
- this.prerelease.length === 0
62730
- ) {
62731
- this.major++;
62732
- }
62733
- this.minor = 0;
62734
- this.patch = 0;
62735
- this.prerelease = [];
62736
- break
62737
- case 'minor':
62738
- // If this is a pre-minor version, bump up to the same minor version.
62739
- // Otherwise increment minor.
62740
- // 1.2.0-5 bumps to 1.2.0
62741
- // 1.2.1 bumps to 1.3.0
62742
- if (this.patch !== 0 || this.prerelease.length === 0) {
62743
- this.minor++;
62744
- }
62745
- this.patch = 0;
62746
- this.prerelease = [];
62747
- break
62748
- case 'patch':
62749
- // If this is not a pre-release version, it will increment the patch.
62750
- // If it is a pre-release it will bump up to the same patch version.
62751
- // 1.2.0-5 patches to 1.2.0
62752
- // 1.2.0 patches to 1.2.1
62753
- if (this.prerelease.length === 0) {
62754
- this.patch++;
62755
- }
62756
- this.prerelease = [];
62757
- break
62758
- // This probably shouldn't be used publicly.
62759
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
62760
- case 'pre':
62761
- if (this.prerelease.length === 0) {
62762
- this.prerelease = [0];
62763
- } else {
62764
- let i = this.prerelease.length;
62765
- while (--i >= 0) {
62766
- if (typeof this.prerelease[i] === 'number') {
62767
- this.prerelease[i]++;
62768
- i = -2;
62769
- }
62770
- }
62771
- if (i === -1) {
62772
- // didn't increment anything
62773
- this.prerelease.push(0);
62774
- }
62775
- }
62776
- if (identifier) {
62777
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
62778
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
62779
- if (this.prerelease[0] === identifier) {
62780
- if (isNaN(this.prerelease[1])) {
62781
- this.prerelease = [identifier, 0];
62782
- }
62783
- } else {
62784
- this.prerelease = [identifier, 0];
62785
- }
62786
- }
62787
- break
62788
-
62789
- default:
62790
- throw new Error(`invalid increment argument: ${release}`)
62791
- }
62792
- this.format();
62793
- this.raw = this.version;
62794
- return this
62795
- }
62796
- }
62797
-
62798
- var semver = SemVer;
62799
-
62800
- const {MAX_LENGTH: MAX_LENGTH$2} = constants;
62801
- const { re: re$3, t: t$3 } = re_1;
62802
-
62803
-
62804
-
62805
- const parse$2 = (version, options) => {
62806
- options = parseOptions_1(options);
62807
-
62808
- if (version instanceof semver) {
62809
- return version
62810
- }
62811
-
62812
- if (typeof version !== 'string') {
62813
- return null
62814
- }
62815
-
62816
- if (version.length > MAX_LENGTH$2) {
62817
- return null
62818
- }
62819
-
62820
- const r = options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL];
62821
- if (!r.test(version)) {
62822
- return null
62823
- }
62824
-
62825
- try {
62826
- return new semver(version, options)
62827
- } catch (er) {
62828
- return null
62829
- }
62830
- };
62831
-
62832
- var parse_1 = parse$2;
62833
-
62834
- const valid = (version, options) => {
62835
- const v = parse_1(version, options);
62836
- return v ? v.version : null
62837
- };
62838
- var valid_1 = valid;
62839
-
62840
- const clean = (version, options) => {
62841
- const s = parse_1(version.trim().replace(/^[=v]+/, ''), options);
62842
- return s ? s.version : null
62843
- };
62844
- var clean_1 = clean;
62845
-
62846
- const inc = (version, release, options, identifier) => {
62847
- if (typeof (options) === 'string') {
62848
- identifier = options;
62849
- options = undefined;
62850
- }
62851
-
62852
- try {
62853
- return new semver(version, options).inc(release, identifier).version
62854
- } catch (er) {
62855
- return null
62856
- }
62857
- };
62858
- var inc_1 = inc;
62859
-
62860
- const compare = (a, b, loose) =>
62861
- new semver(a, loose).compare(new semver(b, loose));
62862
-
62863
- var compare_1 = compare;
62864
-
62865
- const eq = (a, b, loose) => compare_1(a, b, loose) === 0;
62866
- var eq_1 = eq;
62867
-
62868
- const diff = (version1, version2) => {
62869
- if (eq_1(version1, version2)) {
62870
- return null
62871
- } else {
62872
- const v1 = parse_1(version1);
62873
- const v2 = parse_1(version2);
62874
- const hasPre = v1.prerelease.length || v2.prerelease.length;
62875
- const prefix = hasPre ? 'pre' : '';
62876
- const defaultResult = hasPre ? 'prerelease' : '';
62877
- for (const key in v1) {
62878
- if (key === 'major' || key === 'minor' || key === 'patch') {
62879
- if (v1[key] !== v2[key]) {
62880
- return prefix + key
62881
- }
62882
- }
62883
- }
62884
- return defaultResult // may be undefined
62885
- }
62886
- };
62887
- var diff_1 = diff;
62888
-
62889
- const major = (a, loose) => new semver(a, loose).major;
62890
- var major_1 = major;
62891
-
62892
- const minor = (a, loose) => new semver(a, loose).minor;
62893
- var minor_1 = minor;
62894
-
62895
- const patch = (a, loose) => new semver(a, loose).patch;
62896
- var patch_1 = patch;
62897
-
62898
- const prerelease = (version, options) => {
62899
- const parsed = parse_1(version, options);
62900
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
62901
- };
62902
- var prerelease_1 = prerelease;
62903
-
62904
- const rcompare = (a, b, loose) => compare_1(b, a, loose);
62905
- var rcompare_1 = rcompare;
62906
-
62907
- const compareLoose = (a, b) => compare_1(a, b, true);
62908
- var compareLoose_1 = compareLoose;
62909
-
62910
- const compareBuild = (a, b, loose) => {
62911
- const versionA = new semver(a, loose);
62912
- const versionB = new semver(b, loose);
62913
- return versionA.compare(versionB) || versionA.compareBuild(versionB)
62914
- };
62915
- var compareBuild_1 = compareBuild;
62916
-
62917
- const sort = (list, loose) => list.sort((a, b) => compareBuild_1(a, b, loose));
62918
- var sort_1 = sort;
62919
-
62920
- const rsort = (list, loose) => list.sort((a, b) => compareBuild_1(b, a, loose));
62921
- var rsort_1 = rsort;
62922
-
62923
- const gt = (a, b, loose) => compare_1(a, b, loose) > 0;
62924
- var gt_1 = gt;
62925
-
62926
- const lt = (a, b, loose) => compare_1(a, b, loose) < 0;
62927
- var lt_1 = lt;
62928
-
62929
- const neq = (a, b, loose) => compare_1(a, b, loose) !== 0;
62930
- var neq_1 = neq;
62931
-
62932
- const gte = (a, b, loose) => compare_1(a, b, loose) >= 0;
62933
- var gte_1 = gte;
62934
-
62935
- const lte = (a, b, loose) => compare_1(a, b, loose) <= 0;
62936
- var lte_1 = lte;
62937
-
62938
- const cmp = (a, op, b, loose) => {
62939
- switch (op) {
62940
- case '===':
62941
- if (typeof a === 'object')
62942
- a = a.version;
62943
- if (typeof b === 'object')
62944
- b = b.version;
62945
- return a === b
62946
-
62947
- case '!==':
62948
- if (typeof a === 'object')
62949
- a = a.version;
62950
- if (typeof b === 'object')
62951
- b = b.version;
62952
- return a !== b
62953
-
62954
- case '':
62955
- case '=':
62956
- case '==':
62957
- return eq_1(a, b, loose)
62958
-
62959
- case '!=':
62960
- return neq_1(a, b, loose)
62961
-
62962
- case '>':
62963
- return gt_1(a, b, loose)
62964
-
62965
- case '>=':
62966
- return gte_1(a, b, loose)
62967
-
62968
- case '<':
62969
- return lt_1(a, b, loose)
62970
-
62971
- case '<=':
62972
- return lte_1(a, b, loose)
62973
-
62974
- default:
62975
- throw new TypeError(`Invalid operator: ${op}`)
62976
- }
62977
- };
62978
- var cmp_1 = cmp;
62979
-
62980
- const {re: re$4, t: t$4} = re_1;
62981
-
62982
- const coerce = (version, options) => {
62983
- if (version instanceof semver) {
62984
- return version
62985
- }
62986
-
62987
- if (typeof version === 'number') {
62988
- version = String(version);
62989
- }
62990
-
62991
- if (typeof version !== 'string') {
62992
- return null
62993
- }
62994
-
62995
- options = options || {};
62996
-
62997
- let match = null;
62998
- if (!options.rtl) {
62999
- match = version.match(re$4[t$4.COERCE]);
63000
- } else {
63001
- // Find the right-most coercible string that does not share
63002
- // a terminus with a more left-ward coercible string.
63003
- // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
63004
- //
63005
- // Walk through the string checking with a /g regexp
63006
- // Manually set the index so as to pick up overlapping matches.
63007
- // Stop when we get a match that ends at the string end, since no
63008
- // coercible string can be more right-ward without the same terminus.
63009
- let next;
63010
- while ((next = re$4[t$4.COERCERTL].exec(version)) &&
63011
- (!match || match.index + match[0].length !== version.length)
63012
- ) {
63013
- if (!match ||
63014
- next.index + next[0].length !== match.index + match[0].length) {
63015
- match = next;
63016
- }
63017
- re$4[t$4.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
63018
- }
63019
- // leave it in a clean state
63020
- re$4[t$4.COERCERTL].lastIndex = -1;
63021
- }
63022
-
63023
- if (match === null)
63024
- return null
63025
-
63026
- return parse_1(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
63027
- };
63028
- var coerce_1 = coerce;
63029
-
63030
- var iterator = function (Yallist) {
63031
- Yallist.prototype[Symbol.iterator] = function* () {
63032
- for (let walker = this.head; walker; walker = walker.next) {
63033
- yield walker.value;
63034
- }
63035
- };
63036
- };
63037
-
63038
- var yallist = Yallist;
63039
-
63040
- Yallist.Node = Node$1;
63041
- Yallist.create = Yallist;
63042
-
63043
- function Yallist (list) {
63044
- var self = this;
63045
- if (!(self instanceof Yallist)) {
63046
- self = new Yallist();
63047
- }
63048
-
63049
- self.tail = null;
63050
- self.head = null;
63051
- self.length = 0;
63052
-
63053
- if (list && typeof list.forEach === 'function') {
63054
- list.forEach(function (item) {
63055
- self.push(item);
63056
- });
63057
- } else if (arguments.length > 0) {
63058
- for (var i = 0, l = arguments.length; i < l; i++) {
63059
- self.push(arguments[i]);
63060
- }
63061
- }
63062
-
63063
- return self
63064
- }
63065
-
63066
- Yallist.prototype.removeNode = function (node) {
63067
- if (node.list !== this) {
63068
- throw new Error('removing node which does not belong to this list')
63069
- }
63070
-
63071
- var next = node.next;
63072
- var prev = node.prev;
63073
-
63074
- if (next) {
63075
- next.prev = prev;
63076
- }
63077
-
63078
- if (prev) {
63079
- prev.next = next;
63080
- }
63081
-
63082
- if (node === this.head) {
63083
- this.head = next;
63084
- }
63085
- if (node === this.tail) {
63086
- this.tail = prev;
63087
- }
63088
-
63089
- node.list.length--;
63090
- node.next = null;
63091
- node.prev = null;
63092
- node.list = null;
63093
-
63094
- return next
63095
- };
63096
-
63097
- Yallist.prototype.unshiftNode = function (node) {
63098
- if (node === this.head) {
63099
- return
63100
- }
63101
-
63102
- if (node.list) {
63103
- node.list.removeNode(node);
63104
- }
63105
-
63106
- var head = this.head;
63107
- node.list = this;
63108
- node.next = head;
63109
- if (head) {
63110
- head.prev = node;
63111
- }
63112
-
63113
- this.head = node;
63114
- if (!this.tail) {
63115
- this.tail = node;
63116
- }
63117
- this.length++;
63118
- };
63119
-
63120
- Yallist.prototype.pushNode = function (node) {
63121
- if (node === this.tail) {
63122
- return
63123
- }
63124
-
63125
- if (node.list) {
63126
- node.list.removeNode(node);
63127
- }
63128
-
63129
- var tail = this.tail;
63130
- node.list = this;
63131
- node.prev = tail;
63132
- if (tail) {
63133
- tail.next = node;
63134
- }
63135
-
63136
- this.tail = node;
63137
- if (!this.head) {
63138
- this.head = node;
63139
- }
63140
- this.length++;
63141
- };
63142
-
63143
- Yallist.prototype.push = function () {
63144
- for (var i = 0, l = arguments.length; i < l; i++) {
63145
- push(this, arguments[i]);
63146
- }
63147
- return this.length
63148
- };
63149
-
63150
- Yallist.prototype.unshift = function () {
63151
- for (var i = 0, l = arguments.length; i < l; i++) {
63152
- unshift(this, arguments[i]);
63153
- }
63154
- return this.length
63155
- };
63156
-
63157
- Yallist.prototype.pop = function () {
63158
- if (!this.tail) {
63159
- return undefined
63160
- }
63161
-
63162
- var res = this.tail.value;
63163
- this.tail = this.tail.prev;
63164
- if (this.tail) {
63165
- this.tail.next = null;
63166
- } else {
63167
- this.head = null;
63168
- }
63169
- this.length--;
63170
- return res
63171
- };
63172
-
63173
- Yallist.prototype.shift = function () {
63174
- if (!this.head) {
63175
- return undefined
63176
- }
63177
-
63178
- var res = this.head.value;
63179
- this.head = this.head.next;
63180
- if (this.head) {
63181
- this.head.prev = null;
63182
- } else {
63183
- this.tail = null;
63184
- }
63185
- this.length--;
63186
- return res
63187
- };
63188
-
63189
- Yallist.prototype.forEach = function (fn, thisp) {
63190
- thisp = thisp || this;
63191
- for (var walker = this.head, i = 0; walker !== null; i++) {
63192
- fn.call(thisp, walker.value, i, this);
63193
- walker = walker.next;
63194
- }
63195
- };
63196
-
63197
- Yallist.prototype.forEachReverse = function (fn, thisp) {
63198
- thisp = thisp || this;
63199
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
63200
- fn.call(thisp, walker.value, i, this);
63201
- walker = walker.prev;
63202
- }
63203
- };
63204
-
63205
- Yallist.prototype.get = function (n) {
63206
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
63207
- // abort out of the list early if we hit a cycle
63208
- walker = walker.next;
63209
- }
63210
- if (i === n && walker !== null) {
63211
- return walker.value
63212
- }
63213
- };
63214
-
63215
- Yallist.prototype.getReverse = function (n) {
63216
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
63217
- // abort out of the list early if we hit a cycle
63218
- walker = walker.prev;
63219
- }
63220
- if (i === n && walker !== null) {
63221
- return walker.value
63222
- }
63223
- };
63224
-
63225
- Yallist.prototype.map = function (fn, thisp) {
63226
- thisp = thisp || this;
63227
- var res = new Yallist();
63228
- for (var walker = this.head; walker !== null;) {
63229
- res.push(fn.call(thisp, walker.value, this));
63230
- walker = walker.next;
63231
- }
63232
- return res
63233
- };
63234
-
63235
- Yallist.prototype.mapReverse = function (fn, thisp) {
63236
- thisp = thisp || this;
63237
- var res = new Yallist();
63238
- for (var walker = this.tail; walker !== null;) {
63239
- res.push(fn.call(thisp, walker.value, this));
63240
- walker = walker.prev;
63241
- }
63242
- return res
63243
- };
63244
-
63245
- Yallist.prototype.reduce = function (fn, initial) {
63246
- var acc;
63247
- var walker = this.head;
63248
- if (arguments.length > 1) {
63249
- acc = initial;
63250
- } else if (this.head) {
63251
- walker = this.head.next;
63252
- acc = this.head.value;
63253
- } else {
63254
- throw new TypeError('Reduce of empty list with no initial value')
63255
- }
63256
-
63257
- for (var i = 0; walker !== null; i++) {
63258
- acc = fn(acc, walker.value, i);
63259
- walker = walker.next;
63260
- }
63261
-
63262
- return acc
63263
- };
63264
-
63265
- Yallist.prototype.reduceReverse = function (fn, initial) {
63266
- var acc;
63267
- var walker = this.tail;
63268
- if (arguments.length > 1) {
63269
- acc = initial;
63270
- } else if (this.tail) {
63271
- walker = this.tail.prev;
63272
- acc = this.tail.value;
63273
- } else {
63274
- throw new TypeError('Reduce of empty list with no initial value')
63275
- }
63276
-
63277
- for (var i = this.length - 1; walker !== null; i--) {
63278
- acc = fn(acc, walker.value, i);
63279
- walker = walker.prev;
63280
- }
63281
-
63282
- return acc
63283
- };
63284
-
63285
- Yallist.prototype.toArray = function () {
63286
- var arr = new Array(this.length);
63287
- for (var i = 0, walker = this.head; walker !== null; i++) {
63288
- arr[i] = walker.value;
63289
- walker = walker.next;
63290
- }
63291
- return arr
63292
- };
63293
-
63294
- Yallist.prototype.toArrayReverse = function () {
63295
- var arr = new Array(this.length);
63296
- for (var i = 0, walker = this.tail; walker !== null; i++) {
63297
- arr[i] = walker.value;
63298
- walker = walker.prev;
63299
- }
63300
- return arr
63301
- };
63302
-
63303
- Yallist.prototype.slice = function (from, to) {
63304
- to = to || this.length;
63305
- if (to < 0) {
63306
- to += this.length;
63307
- }
63308
- from = from || 0;
63309
- if (from < 0) {
63310
- from += this.length;
63311
- }
63312
- var ret = new Yallist();
63313
- if (to < from || to < 0) {
63314
- return ret
63315
- }
63316
- if (from < 0) {
63317
- from = 0;
63318
- }
63319
- if (to > this.length) {
63320
- to = this.length;
63321
- }
63322
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
63323
- walker = walker.next;
63324
- }
63325
- for (; walker !== null && i < to; i++, walker = walker.next) {
63326
- ret.push(walker.value);
63327
- }
63328
- return ret
63329
- };
63330
-
63331
- Yallist.prototype.sliceReverse = function (from, to) {
63332
- to = to || this.length;
63333
- if (to < 0) {
63334
- to += this.length;
63335
- }
63336
- from = from || 0;
63337
- if (from < 0) {
63338
- from += this.length;
63339
- }
63340
- var ret = new Yallist();
63341
- if (to < from || to < 0) {
63342
- return ret
63343
- }
63344
- if (from < 0) {
63345
- from = 0;
63346
- }
63347
- if (to > this.length) {
63348
- to = this.length;
63349
- }
63350
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
63351
- walker = walker.prev;
63352
- }
63353
- for (; walker !== null && i > from; i--, walker = walker.prev) {
63354
- ret.push(walker.value);
63355
- }
63356
- return ret
63357
- };
63358
-
63359
- Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
63360
- if (start > this.length) {
63361
- start = this.length - 1;
63362
- }
63363
- if (start < 0) {
63364
- start = this.length + start;
63365
- }
63366
-
63367
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
63368
- walker = walker.next;
63369
- }
63370
-
63371
- var ret = [];
63372
- for (var i = 0; walker && i < deleteCount; i++) {
63373
- ret.push(walker.value);
63374
- walker = this.removeNode(walker);
63375
- }
63376
- if (walker === null) {
63377
- walker = this.tail;
63378
- }
63379
-
63380
- if (walker !== this.head && walker !== this.tail) {
63381
- walker = walker.prev;
63382
- }
63383
-
63384
- for (var i = 0; i < nodes.length; i++) {
63385
- walker = insert(this, walker, nodes[i]);
63386
- }
63387
- return ret;
63388
- };
63389
-
63390
- Yallist.prototype.reverse = function () {
63391
- var head = this.head;
63392
- var tail = this.tail;
63393
- for (var walker = head; walker !== null; walker = walker.prev) {
63394
- var p = walker.prev;
63395
- walker.prev = walker.next;
63396
- walker.next = p;
63397
- }
63398
- this.head = tail;
63399
- this.tail = head;
63400
- return this
63401
- };
63402
-
63403
- function insert (self, node, value) {
63404
- var inserted = node === self.head ?
63405
- new Node$1(value, null, node, self) :
63406
- new Node$1(value, node, node.next, self);
63407
-
63408
- if (inserted.next === null) {
63409
- self.tail = inserted;
63410
- }
63411
- if (inserted.prev === null) {
63412
- self.head = inserted;
63413
- }
63414
-
63415
- self.length++;
63416
-
63417
- return inserted
63418
- }
63419
-
63420
- function push (self, item) {
63421
- self.tail = new Node$1(item, self.tail, null, self);
63422
- if (!self.head) {
63423
- self.head = self.tail;
63424
- }
63425
- self.length++;
63426
- }
63427
-
63428
- function unshift (self, item) {
63429
- self.head = new Node$1(item, null, self.head, self);
63430
- if (!self.tail) {
63431
- self.tail = self.head;
63432
- }
63433
- self.length++;
63434
- }
63435
-
63436
- function Node$1 (value, prev, next, list) {
63437
- if (!(this instanceof Node$1)) {
63438
- return new Node$1(value, prev, next, list)
63439
- }
63440
-
63441
- this.list = list;
63442
- this.value = value;
63443
-
63444
- if (prev) {
63445
- prev.next = this;
63446
- this.prev = prev;
63447
- } else {
63448
- this.prev = null;
63449
- }
63450
-
63451
- if (next) {
63452
- next.prev = this;
63453
- this.next = next;
63454
- } else {
63455
- this.next = null;
63456
- }
63457
- }
63458
-
63459
- try {
63460
- // add if support for Symbol.iterator is present
63461
- iterator(Yallist);
63462
- } catch (er) {}
63463
-
63464
- // A linked list to keep track of recently-used-ness
63465
-
63466
-
63467
- const MAX = Symbol('max');
63468
- const LENGTH = Symbol('length');
63469
- const LENGTH_CALCULATOR = Symbol('lengthCalculator');
63470
- const ALLOW_STALE = Symbol('allowStale');
63471
- const MAX_AGE = Symbol('maxAge');
63472
- const DISPOSE = Symbol('dispose');
63473
- const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
63474
- const LRU_LIST = Symbol('lruList');
63475
- const CACHE = Symbol('cache');
63476
- const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
63477
-
63478
- const naiveLength = () => 1;
63479
-
63480
- // lruList is a yallist where the head is the youngest
63481
- // item, and the tail is the oldest. the list contains the Hit
63482
- // objects as the entries.
63483
- // Each Hit object has a reference to its Yallist.Node. This
63484
- // never changes.
63485
- //
63486
- // cache is a Map (or PseudoMap) that matches the keys to
63487
- // the Yallist.Node object.
63488
- class LRUCache {
63489
- constructor (options) {
63490
- if (typeof options === 'number')
63491
- options = { max: options };
63492
-
63493
- if (!options)
63494
- options = {};
63495
-
63496
- if (options.max && (typeof options.max !== 'number' || options.max < 0))
63497
- throw new TypeError('max must be a non-negative number')
63498
- // Kind of weird to have a default max of Infinity, but oh well.
63499
- this[MAX] = options.max || Infinity;
63500
-
63501
- const lc = options.length || naiveLength;
63502
- this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
63503
- this[ALLOW_STALE] = options.stale || false;
63504
- if (options.maxAge && typeof options.maxAge !== 'number')
63505
- throw new TypeError('maxAge must be a number')
63506
- this[MAX_AGE] = options.maxAge || 0;
63507
- this[DISPOSE] = options.dispose;
63508
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
63509
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
63510
- this.reset();
63511
- }
63512
-
63513
- // resize the cache when the max changes.
63514
- set max (mL) {
63515
- if (typeof mL !== 'number' || mL < 0)
63516
- throw new TypeError('max must be a non-negative number')
63517
-
63518
- this[MAX] = mL || Infinity;
63519
- trim(this);
63520
- }
63521
- get max () {
63522
- return this[MAX]
63523
- }
63524
-
63525
- set allowStale (allowStale) {
63526
- this[ALLOW_STALE] = !!allowStale;
63527
- }
63528
- get allowStale () {
63529
- return this[ALLOW_STALE]
63530
- }
63531
-
63532
- set maxAge (mA) {
63533
- if (typeof mA !== 'number')
63534
- throw new TypeError('maxAge must be a non-negative number')
63535
-
63536
- this[MAX_AGE] = mA;
63537
- trim(this);
63538
- }
63539
- get maxAge () {
63540
- return this[MAX_AGE]
63541
- }
63542
-
63543
- // resize the cache when the lengthCalculator changes.
63544
- set lengthCalculator (lC) {
63545
- if (typeof lC !== 'function')
63546
- lC = naiveLength;
63547
-
63548
- if (lC !== this[LENGTH_CALCULATOR]) {
63549
- this[LENGTH_CALCULATOR] = lC;
63550
- this[LENGTH] = 0;
63551
- this[LRU_LIST].forEach(hit => {
63552
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
63553
- this[LENGTH] += hit.length;
63554
- });
63555
- }
63556
- trim(this);
63557
- }
63558
- get lengthCalculator () { return this[LENGTH_CALCULATOR] }
63559
-
63560
- get length () { return this[LENGTH] }
63561
- get itemCount () { return this[LRU_LIST].length }
63562
-
63563
- rforEach (fn, thisp) {
63564
- thisp = thisp || this;
63565
- for (let walker = this[LRU_LIST].tail; walker !== null;) {
63566
- const prev = walker.prev;
63567
- forEachStep(this, fn, walker, thisp);
63568
- walker = prev;
63569
- }
63570
- }
63571
-
63572
- forEach (fn, thisp) {
63573
- thisp = thisp || this;
63574
- for (let walker = this[LRU_LIST].head; walker !== null;) {
63575
- const next = walker.next;
63576
- forEachStep(this, fn, walker, thisp);
63577
- walker = next;
63578
- }
63579
- }
63580
-
63581
- keys () {
63582
- return this[LRU_LIST].toArray().map(k => k.key)
63583
- }
63584
-
63585
- values () {
63586
- return this[LRU_LIST].toArray().map(k => k.value)
63587
- }
63588
-
63589
- reset () {
63590
- if (this[DISPOSE] &&
63591
- this[LRU_LIST] &&
63592
- this[LRU_LIST].length) {
63593
- this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
63594
- }
63595
-
63596
- this[CACHE] = new Map(); // hash of items by key
63597
- this[LRU_LIST] = new yallist(); // list of items in order of use recency
63598
- this[LENGTH] = 0; // length of items in the list
63599
- }
63600
-
63601
- dump () {
63602
- return this[LRU_LIST].map(hit =>
63603
- isStale(this, hit) ? false : {
63604
- k: hit.key,
63605
- v: hit.value,
63606
- e: hit.now + (hit.maxAge || 0)
63607
- }).toArray().filter(h => h)
63608
- }
63609
-
63610
- dumpLru () {
63611
- return this[LRU_LIST]
63612
- }
63613
-
63614
- set (key, value, maxAge) {
63615
- maxAge = maxAge || this[MAX_AGE];
63616
-
63617
- if (maxAge && typeof maxAge !== 'number')
63618
- throw new TypeError('maxAge must be a number')
63619
-
63620
- const now = maxAge ? Date.now() : 0;
63621
- const len = this[LENGTH_CALCULATOR](value, key);
63622
-
63623
- if (this[CACHE].has(key)) {
63624
- if (len > this[MAX]) {
63625
- del(this, this[CACHE].get(key));
63626
- return false
63627
- }
63628
-
63629
- const node = this[CACHE].get(key);
63630
- const item = node.value;
63631
-
63632
- // dispose of the old one before overwriting
63633
- // split out into 2 ifs for better coverage tracking
63634
- if (this[DISPOSE]) {
63635
- if (!this[NO_DISPOSE_ON_SET])
63636
- this[DISPOSE](key, item.value);
63637
- }
63638
-
63639
- item.now = now;
63640
- item.maxAge = maxAge;
63641
- item.value = value;
63642
- this[LENGTH] += len - item.length;
63643
- item.length = len;
63644
- this.get(key);
63645
- trim(this);
63646
- return true
63647
- }
63648
-
63649
- const hit = new Entry(key, value, len, now, maxAge);
63650
-
63651
- // oversized objects fall out of cache automatically.
63652
- if (hit.length > this[MAX]) {
63653
- if (this[DISPOSE])
63654
- this[DISPOSE](key, value);
63655
-
63656
- return false
63657
- }
63658
-
63659
- this[LENGTH] += hit.length;
63660
- this[LRU_LIST].unshift(hit);
63661
- this[CACHE].set(key, this[LRU_LIST].head);
63662
- trim(this);
63663
- return true
63664
- }
63665
-
63666
- has (key) {
63667
- if (!this[CACHE].has(key)) return false
63668
- const hit = this[CACHE].get(key).value;
63669
- return !isStale(this, hit)
63670
- }
63671
-
63672
- get (key) {
63673
- return get$3(this, key, true)
63674
- }
63675
-
63676
- peek (key) {
63677
- return get$3(this, key, false)
63678
- }
63679
-
63680
- pop () {
63681
- const node = this[LRU_LIST].tail;
63682
- if (!node)
63683
- return null
63684
-
63685
- del(this, node);
63686
- return node.value
63687
- }
63688
-
63689
- del (key) {
63690
- del(this, this[CACHE].get(key));
63691
- }
63692
-
63693
- load (arr) {
63694
- // reset the cache
63695
- this.reset();
63696
-
63697
- const now = Date.now();
63698
- // A previous serialized cache has the most recent items first
63699
- for (let l = arr.length - 1; l >= 0; l--) {
63700
- const hit = arr[l];
63701
- const expiresAt = hit.e || 0;
63702
- if (expiresAt === 0)
63703
- // the item was created without expiration in a non aged cache
63704
- this.set(hit.k, hit.v);
63705
- else {
63706
- const maxAge = expiresAt - now;
63707
- // dont add already expired items
63708
- if (maxAge > 0) {
63709
- this.set(hit.k, hit.v, maxAge);
63710
- }
63711
- }
63712
- }
63713
- }
63714
-
63715
- prune () {
63716
- this[CACHE].forEach((value, key) => get$3(this, key, false));
63717
- }
63718
- }
63719
-
63720
- const get$3 = (self, key, doUse) => {
63721
- const node = self[CACHE].get(key);
63722
- if (node) {
63723
- const hit = node.value;
63724
- if (isStale(self, hit)) {
63725
- del(self, node);
63726
- if (!self[ALLOW_STALE])
63727
- return undefined
63728
- } else {
63729
- if (doUse) {
63730
- if (self[UPDATE_AGE_ON_GET])
63731
- node.value.now = Date.now();
63732
- self[LRU_LIST].unshiftNode(node);
63733
- }
63734
- }
63735
- return hit.value
63736
- }
63737
- };
63738
-
63739
- const isStale = (self, hit) => {
63740
- if (!hit || (!hit.maxAge && !self[MAX_AGE]))
63741
- return false
63742
-
63743
- const diff = Date.now() - hit.now;
63744
- return hit.maxAge ? diff > hit.maxAge
63745
- : self[MAX_AGE] && (diff > self[MAX_AGE])
63746
- };
63747
-
63748
- const trim = self => {
63749
- if (self[LENGTH] > self[MAX]) {
63750
- for (let walker = self[LRU_LIST].tail;
63751
- self[LENGTH] > self[MAX] && walker !== null;) {
63752
- // We know that we're about to delete this one, and also
63753
- // what the next least recently used key will be, so just
63754
- // go ahead and set it now.
63755
- const prev = walker.prev;
63756
- del(self, walker);
63757
- walker = prev;
63758
- }
63759
- }
63760
- };
63761
-
63762
- const del = (self, node) => {
63763
- if (node) {
63764
- const hit = node.value;
63765
- if (self[DISPOSE])
63766
- self[DISPOSE](hit.key, hit.value);
63767
-
63768
- self[LENGTH] -= hit.length;
63769
- self[CACHE].delete(hit.key);
63770
- self[LRU_LIST].removeNode(node);
63771
- }
63772
- };
63773
-
63774
- class Entry {
63775
- constructor (key, value, length, now, maxAge) {
63776
- this.key = key;
63777
- this.value = value;
63778
- this.length = length;
63779
- this.now = now;
63780
- this.maxAge = maxAge || 0;
63781
- }
63782
- }
63783
-
63784
- const forEachStep = (self, fn, node, thisp) => {
63785
- let hit = node.value;
63786
- if (isStale(self, hit)) {
63787
- del(self, node);
63788
- if (!self[ALLOW_STALE])
63789
- hit = undefined;
63790
- }
63791
- if (hit)
63792
- fn.call(thisp, hit.value, hit.key, self);
63793
- };
63794
-
63795
- var lruCache = LRUCache;
63796
-
63797
- // hoisted class for cyclic dependency
63798
- class Range {
63799
- constructor (range, options) {
63800
- options = parseOptions_1(options);
63801
-
63802
- if (range instanceof Range) {
63803
- if (
63804
- range.loose === !!options.loose &&
63805
- range.includePrerelease === !!options.includePrerelease
63806
- ) {
63807
- return range
63808
- } else {
63809
- return new Range(range.raw, options)
63810
- }
63811
- }
63812
-
63813
- if (range instanceof comparator) {
63814
- // just put it in the set and return
63815
- this.raw = range.value;
63816
- this.set = [[range]];
63817
- this.format();
63818
- return this
63819
- }
63820
-
63821
- this.options = options;
63822
- this.loose = !!options.loose;
63823
- this.includePrerelease = !!options.includePrerelease;
63824
-
63825
- // First, split based on boolean or ||
63826
- this.raw = range;
63827
- this.set = range
63828
- .split(/\s*\|\|\s*/)
63829
- // map the range to a 2d array of comparators
63830
- .map(range => this.parseRange(range.trim()))
63831
- // throw out any comparator lists that are empty
63832
- // this generally means that it was not a valid range, which is allowed
63833
- // in loose mode, but will still throw if the WHOLE range is invalid.
63834
- .filter(c => c.length);
63835
-
63836
- if (!this.set.length) {
63837
- throw new TypeError(`Invalid SemVer Range: ${range}`)
63838
- }
63839
-
63840
- // if we have any that are not the null set, throw out null sets.
63841
- if (this.set.length > 1) {
63842
- // keep the first one, in case they're all null sets
63843
- const first = this.set[0];
63844
- this.set = this.set.filter(c => !isNullSet(c[0]));
63845
- if (this.set.length === 0)
63846
- this.set = [first];
63847
- else if (this.set.length > 1) {
63848
- // if we have any that are *, then the range is just *
63849
- for (const c of this.set) {
63850
- if (c.length === 1 && isAny$1(c[0])) {
63851
- this.set = [c];
63852
- break
63853
- }
63854
- }
63855
- }
63856
- }
63857
-
63858
- this.format();
63859
- }
63860
-
63861
- format () {
63862
- this.range = this.set
63863
- .map((comps) => {
63864
- return comps.join(' ').trim()
63865
- })
63866
- .join('||')
63867
- .trim();
63868
- return this.range
63869
- }
63870
-
63871
- toString () {
63872
- return this.range
63873
- }
63874
-
63875
- parseRange (range) {
63876
- range = range.trim();
63877
-
63878
- // memoize range parsing for performance.
63879
- // this is a very hot path, and fully deterministic.
63880
- const memoOpts = Object.keys(this.options).join(',');
63881
- const memoKey = `parseRange:${memoOpts}:${range}`;
63882
- const cached = cache.get(memoKey);
63883
- if (cached)
63884
- return cached
63885
-
63886
- const loose = this.options.loose;
63887
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
63888
- const hr = loose ? re$5[t$5.HYPHENRANGELOOSE] : re$5[t$5.HYPHENRANGE];
63889
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
63890
- debug_1('hyphen replace', range);
63891
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
63892
- range = range.replace(re$5[t$5.COMPARATORTRIM], comparatorTrimReplace);
63893
- debug_1('comparator trim', range, re$5[t$5.COMPARATORTRIM]);
63894
-
63895
- // `~ 1.2.3` => `~1.2.3`
63896
- range = range.replace(re$5[t$5.TILDETRIM], tildeTrimReplace);
63897
-
63898
- // `^ 1.2.3` => `^1.2.3`
63899
- range = range.replace(re$5[t$5.CARETTRIM], caretTrimReplace);
63900
-
63901
- // normalize spaces
63902
- range = range.split(/\s+/).join(' ');
63903
-
63904
- // At this point, the range is completely trimmed and
63905
- // ready to be split into comparators.
63906
-
63907
- const compRe = loose ? re$5[t$5.COMPARATORLOOSE] : re$5[t$5.COMPARATOR];
63908
- const rangeList = range
63909
- .split(' ')
63910
- .map(comp => parseComparator(comp, this.options))
63911
- .join(' ')
63912
- .split(/\s+/)
63913
- // >=0.0.0 is equivalent to *
63914
- .map(comp => replaceGTE0(comp, this.options))
63915
- // in loose mode, throw out any that are not valid comparators
63916
- .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)
63917
- .map(comp => new comparator(comp, this.options));
63918
-
63919
- // if any comparators are the null set, then replace with JUST null set
63920
- // if more than one comparator, remove any * comparators
63921
- // also, don't include the same comparator more than once
63922
- rangeList.length;
63923
- const rangeMap = new Map();
63924
- for (const comp of rangeList) {
63925
- if (isNullSet(comp))
63926
- return [comp]
63927
- rangeMap.set(comp.value, comp);
63928
- }
63929
- if (rangeMap.size > 1 && rangeMap.has(''))
63930
- rangeMap.delete('');
63931
-
63932
- const result = [...rangeMap.values()];
63933
- cache.set(memoKey, result);
63934
- return result
63935
- }
63936
-
63937
- intersects (range, options) {
63938
- if (!(range instanceof Range)) {
63939
- throw new TypeError('a Range is required')
63940
- }
63941
-
63942
- return this.set.some((thisComparators) => {
63943
- return (
63944
- isSatisfiable(thisComparators, options) &&
63945
- range.set.some((rangeComparators) => {
63946
- return (
63947
- isSatisfiable(rangeComparators, options) &&
63948
- thisComparators.every((thisComparator) => {
63949
- return rangeComparators.every((rangeComparator) => {
63950
- return thisComparator.intersects(rangeComparator, options)
63951
- })
63952
- })
63953
- )
63954
- })
63955
- )
63956
- })
63957
- }
63958
-
63959
- // if ANY of the sets match ALL of its comparators, then pass
63960
- test (version) {
63961
- if (!version) {
63962
- return false
63963
- }
63964
-
63965
- if (typeof version === 'string') {
63966
- try {
63967
- version = new semver(version, this.options);
63968
- } catch (er) {
63969
- return false
63970
- }
63971
- }
63972
-
63973
- for (let i = 0; i < this.set.length; i++) {
63974
- if (testSet(this.set[i], version, this.options)) {
63975
- return true
63976
- }
63977
- }
63978
- return false
63979
- }
63980
- }
63981
- var range = Range;
63982
-
63983
-
63984
- const cache = new lruCache({ max: 1000 });
63985
-
63986
-
63987
-
63988
-
63989
-
63990
- const {
63991
- re: re$5,
63992
- t: t$5,
63993
- comparatorTrimReplace,
63994
- tildeTrimReplace,
63995
- caretTrimReplace
63996
- } = re_1;
63997
-
63998
- const isNullSet = c => c.value === '<0.0.0-0';
63999
- const isAny$1 = c => c.value === '';
64000
-
64001
- // take a set of comparators and determine whether there
64002
- // exists a version which can satisfy it
64003
- const isSatisfiable = (comparators, options) => {
64004
- let result = true;
64005
- const remainingComparators = comparators.slice();
64006
- let testComparator = remainingComparators.pop();
64007
-
64008
- while (result && remainingComparators.length) {
64009
- result = remainingComparators.every((otherComparator) => {
64010
- return testComparator.intersects(otherComparator, options)
64011
- });
64012
-
64013
- testComparator = remainingComparators.pop();
64014
- }
64015
-
64016
- return result
64017
- };
64018
-
64019
- // comprised of xranges, tildes, stars, and gtlt's at this point.
64020
- // already replaced the hyphen ranges
64021
- // turn into a set of JUST comparators.
64022
- const parseComparator = (comp, options) => {
64023
- debug_1('comp', comp, options);
64024
- comp = replaceCarets(comp, options);
64025
- debug_1('caret', comp);
64026
- comp = replaceTildes(comp, options);
64027
- debug_1('tildes', comp);
64028
- comp = replaceXRanges(comp, options);
64029
- debug_1('xrange', comp);
64030
- comp = replaceStars(comp, options);
64031
- debug_1('stars', comp);
64032
- return comp
64033
- };
64034
-
64035
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
64036
-
64037
- // ~, ~> --> * (any, kinda silly)
64038
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
64039
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
64040
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
64041
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
64042
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
64043
- const replaceTildes = (comp, options) =>
64044
- comp.trim().split(/\s+/).map((comp) => {
64045
- return replaceTilde(comp, options)
64046
- }).join(' ');
64047
-
64048
- const replaceTilde = (comp, options) => {
64049
- const r = options.loose ? re$5[t$5.TILDELOOSE] : re$5[t$5.TILDE];
64050
- return comp.replace(r, (_, M, m, p, pr) => {
64051
- debug_1('tilde', comp, _, M, m, p, pr);
64052
- let ret;
64053
-
64054
- if (isX(M)) {
64055
- ret = '';
64056
- } else if (isX(m)) {
64057
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
64058
- } else if (isX(p)) {
64059
- // ~1.2 == >=1.2.0 <1.3.0-0
64060
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
64061
- } else if (pr) {
64062
- debug_1('replaceTilde pr', pr);
64063
- ret = `>=${M}.${m}.${p}-${pr
64064
- } <${M}.${+m + 1}.0-0`;
64065
- } else {
64066
- // ~1.2.3 == >=1.2.3 <1.3.0-0
64067
- ret = `>=${M}.${m}.${p
64068
- } <${M}.${+m + 1}.0-0`;
64069
- }
64070
-
64071
- debug_1('tilde return', ret);
64072
- return ret
64073
- })
64074
- };
64075
-
64076
- // ^ --> * (any, kinda silly)
64077
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
64078
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
64079
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
64080
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
64081
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
64082
- const replaceCarets = (comp, options) =>
64083
- comp.trim().split(/\s+/).map((comp) => {
64084
- return replaceCaret(comp, options)
64085
- }).join(' ');
64086
-
64087
- const replaceCaret = (comp, options) => {
64088
- debug_1('caret', comp, options);
64089
- const r = options.loose ? re$5[t$5.CARETLOOSE] : re$5[t$5.CARET];
64090
- const z = options.includePrerelease ? '-0' : '';
64091
- return comp.replace(r, (_, M, m, p, pr) => {
64092
- debug_1('caret', comp, _, M, m, p, pr);
64093
- let ret;
64094
-
64095
- if (isX(M)) {
64096
- ret = '';
64097
- } else if (isX(m)) {
64098
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
64099
- } else if (isX(p)) {
64100
- if (M === '0') {
64101
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
64102
- } else {
64103
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
64104
- }
64105
- } else if (pr) {
64106
- debug_1('replaceCaret pr', pr);
64107
- if (M === '0') {
64108
- if (m === '0') {
64109
- ret = `>=${M}.${m}.${p}-${pr
64110
- } <${M}.${m}.${+p + 1}-0`;
64111
- } else {
64112
- ret = `>=${M}.${m}.${p}-${pr
64113
- } <${M}.${+m + 1}.0-0`;
64114
- }
64115
- } else {
64116
- ret = `>=${M}.${m}.${p}-${pr
64117
- } <${+M + 1}.0.0-0`;
64118
- }
64119
- } else {
64120
- debug_1('no pr');
64121
- if (M === '0') {
64122
- if (m === '0') {
64123
- ret = `>=${M}.${m}.${p
64124
- }${z} <${M}.${m}.${+p + 1}-0`;
64125
- } else {
64126
- ret = `>=${M}.${m}.${p
64127
- }${z} <${M}.${+m + 1}.0-0`;
64128
- }
64129
- } else {
64130
- ret = `>=${M}.${m}.${p
64131
- } <${+M + 1}.0.0-0`;
64132
- }
64133
- }
64134
-
64135
- debug_1('caret return', ret);
64136
- return ret
64137
- })
64138
- };
64139
-
64140
- const replaceXRanges = (comp, options) => {
64141
- debug_1('replaceXRanges', comp, options);
64142
- return comp.split(/\s+/).map((comp) => {
64143
- return replaceXRange(comp, options)
64144
- }).join(' ')
64145
- };
64146
-
64147
- const replaceXRange = (comp, options) => {
64148
- comp = comp.trim();
64149
- const r = options.loose ? re$5[t$5.XRANGELOOSE] : re$5[t$5.XRANGE];
64150
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
64151
- debug_1('xRange', comp, ret, gtlt, M, m, p, pr);
64152
- const xM = isX(M);
64153
- const xm = xM || isX(m);
64154
- const xp = xm || isX(p);
64155
- const anyX = xp;
64156
-
64157
- if (gtlt === '=' && anyX) {
64158
- gtlt = '';
64159
- }
64160
-
64161
- // if we're including prereleases in the match, then we need
64162
- // to fix this to -0, the lowest possible prerelease value
64163
- pr = options.includePrerelease ? '-0' : '';
64164
-
64165
- if (xM) {
64166
- if (gtlt === '>' || gtlt === '<') {
64167
- // nothing is allowed
64168
- ret = '<0.0.0-0';
64169
- } else {
64170
- // nothing is forbidden
64171
- ret = '*';
64172
- }
64173
- } else if (gtlt && anyX) {
64174
- // we know patch is an x, because we have any x at all.
64175
- // replace X with 0
64176
- if (xm) {
64177
- m = 0;
64178
- }
64179
- p = 0;
64180
-
64181
- if (gtlt === '>') {
64182
- // >1 => >=2.0.0
64183
- // >1.2 => >=1.3.0
64184
- gtlt = '>=';
64185
- if (xm) {
64186
- M = +M + 1;
64187
- m = 0;
64188
- p = 0;
64189
- } else {
64190
- m = +m + 1;
64191
- p = 0;
64192
- }
64193
- } else if (gtlt === '<=') {
64194
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
64195
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
64196
- gtlt = '<';
64197
- if (xm) {
64198
- M = +M + 1;
64199
- } else {
64200
- m = +m + 1;
64201
- }
64202
- }
64203
-
64204
- if (gtlt === '<')
64205
- pr = '-0';
64206
-
64207
- ret = `${gtlt + M}.${m}.${p}${pr}`;
64208
- } else if (xm) {
64209
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
64210
- } else if (xp) {
64211
- ret = `>=${M}.${m}.0${pr
64212
- } <${M}.${+m + 1}.0-0`;
64213
- }
64214
-
64215
- debug_1('xRange return', ret);
64216
-
64217
- return ret
64218
- })
64219
- };
64220
-
64221
- // Because * is AND-ed with everything else in the comparator,
64222
- // and '' means "any version", just remove the *s entirely.
64223
- const replaceStars = (comp, options) => {
64224
- debug_1('replaceStars', comp, options);
64225
- // Looseness is ignored here. star is always as loose as it gets!
64226
- return comp.trim().replace(re$5[t$5.STAR], '')
64227
- };
64228
-
64229
- const replaceGTE0 = (comp, options) => {
64230
- debug_1('replaceGTE0', comp, options);
64231
- return comp.trim()
64232
- .replace(re$5[options.includePrerelease ? t$5.GTE0PRE : t$5.GTE0], '')
64233
- };
64234
-
64235
- // This function is passed to string.replace(re[t.HYPHENRANGE])
64236
- // M, m, patch, prerelease, build
64237
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
64238
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
64239
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
64240
- const hyphenReplace = incPr => ($0,
64241
- from, fM, fm, fp, fpr, fb,
64242
- to, tM, tm, tp, tpr, tb) => {
64243
- if (isX(fM)) {
64244
- from = '';
64245
- } else if (isX(fm)) {
64246
- from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
64247
- } else if (isX(fp)) {
64248
- from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
64249
- } else if (fpr) {
64250
- from = `>=${from}`;
64251
- } else {
64252
- from = `>=${from}${incPr ? '-0' : ''}`;
64253
- }
64254
-
64255
- if (isX(tM)) {
64256
- to = '';
64257
- } else if (isX(tm)) {
64258
- to = `<${+tM + 1}.0.0-0`;
64259
- } else if (isX(tp)) {
64260
- to = `<${tM}.${+tm + 1}.0-0`;
64261
- } else if (tpr) {
64262
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
64263
- } else if (incPr) {
64264
- to = `<${tM}.${tm}.${+tp + 1}-0`;
64265
- } else {
64266
- to = `<=${to}`;
64267
- }
64268
-
64269
- return (`${from} ${to}`).trim()
64270
- };
64271
-
64272
- const testSet = (set, version, options) => {
64273
- for (let i = 0; i < set.length; i++) {
64274
- if (!set[i].test(version)) {
64275
- return false
64276
- }
64277
- }
64278
-
64279
- if (version.prerelease.length && !options.includePrerelease) {
64280
- // Find the set of versions that are allowed to have prereleases
64281
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
64282
- // That should allow `1.2.3-pr.2` to pass.
64283
- // However, `1.2.4-alpha.notready` should NOT be allowed,
64284
- // even though it's within the range set by the comparators.
64285
- for (let i = 0; i < set.length; i++) {
64286
- debug_1(set[i].semver);
64287
- if (set[i].semver === comparator.ANY) {
64288
- continue
64289
- }
64290
-
64291
- if (set[i].semver.prerelease.length > 0) {
64292
- const allowed = set[i].semver;
64293
- if (allowed.major === version.major &&
64294
- allowed.minor === version.minor &&
64295
- allowed.patch === version.patch) {
64296
- return true
64297
- }
64298
- }
64299
- }
64300
-
64301
- // Version has a -pre, but it's not one of the ones we like.
64302
- return false
64303
- }
64304
-
64305
- return true
64306
- };
64307
-
64308
- const ANY = Symbol('SemVer ANY');
64309
- // hoisted class for cyclic dependency
64310
- class Comparator {
64311
- static get ANY () {
64312
- return ANY
64313
- }
64314
- constructor (comp, options) {
64315
- options = parseOptions_1(options);
64316
-
64317
- if (comp instanceof Comparator) {
64318
- if (comp.loose === !!options.loose) {
64319
- return comp
64320
- } else {
64321
- comp = comp.value;
64322
- }
64323
- }
64324
-
64325
- debug_1('comparator', comp, options);
64326
- this.options = options;
64327
- this.loose = !!options.loose;
64328
- this.parse(comp);
62131
+ return `bio-properties-panel-${id}`;
62132
+ }
64329
62133
 
64330
- if (this.semver === ANY) {
64331
- this.value = '';
64332
- } else {
64333
- this.value = this.operator + this.semver.version;
64334
- }
62134
+ function Textfield(props) {
62135
+ const {
62136
+ debounce,
62137
+ disabled = false,
62138
+ id,
62139
+ label,
62140
+ onInput,
62141
+ feel = false,
62142
+ value = ''
62143
+ } = props;
62144
+ const handleInput = d$1(() => {
62145
+ return debounce(({
62146
+ target
62147
+ }) => onInput(target.value.length ? target.value : undefined));
62148
+ }, [onInput, debounce]);
62149
+ return o$2("div", {
62150
+ class: "bio-properties-panel-textfield",
62151
+ children: [o$2("label", {
62152
+ for: prefixId$1(id),
62153
+ class: "bio-properties-panel-label",
62154
+ children: [label, feel && o$2(FeelIcon, {
62155
+ feel: feel,
62156
+ label: label
62157
+ })]
62158
+ }), o$2("input", {
62159
+ id: prefixId$1(id),
62160
+ type: "text",
62161
+ name: id,
62162
+ spellCheck: "false",
62163
+ autoComplete: "off",
62164
+ disabled: disabled,
62165
+ class: "bio-properties-panel-input",
62166
+ onInput: handleInput,
62167
+ onFocus: props.onFocus,
62168
+ onBlur: props.onBlur,
62169
+ value: value || ''
62170
+ })]
62171
+ });
62172
+ }
62173
+ /**
62174
+ * @param {Object} props
62175
+ * @param {Object} props.element
62176
+ * @param {String} props.id
62177
+ * @param {String} props.description
62178
+ * @param {Boolean} props.debounce
62179
+ * @param {Boolean} props.disabled
62180
+ * @param {String} props.label
62181
+ * @param {Function} props.getValue
62182
+ * @param {Function} props.setValue
62183
+ * @param {Function} props.validate
62184
+ */
64335
62185
 
64336
- debug_1('comp', this);
64337
- }
64338
62186
 
64339
- parse (comp) {
64340
- const r = this.options.loose ? re$6[t$6.COMPARATORLOOSE] : re$6[t$6.COMPARATOR];
64341
- const m = comp.match(r);
62187
+ function TextfieldEntry(props) {
62188
+ const {
62189
+ element,
62190
+ id,
62191
+ description,
62192
+ debounce,
62193
+ disabled,
62194
+ feel,
62195
+ label,
62196
+ getValue,
62197
+ setValue,
62198
+ validate
62199
+ } = props;
62200
+ const [error, setError] = l(null);
62201
+ const [invalidValueCache, setInvalidValueCache] = l(null);
62202
+ let value = getValue(element);
62203
+ const prevValue = usePrevious(value); // validate again when value prop changed
64342
62204
 
64343
- if (!m) {
64344
- throw new TypeError(`Invalid comparator: ${comp}`)
64345
- }
62205
+ y$1(() => {
62206
+ const err = validate ? validate(value) : null;
62207
+ setError(err);
62208
+ }, [value]); // validate on change
64346
62209
 
64347
- this.operator = m[1] !== undefined ? m[1] : '';
64348
- if (this.operator === '=') {
64349
- this.operator = '';
64350
- }
62210
+ const handleChange = newValue => {
62211
+ const err = validate ? validate(newValue) : null;
64351
62212
 
64352
- // if it literally is just '>' or '' then allow anything.
64353
- if (!m[2]) {
64354
- this.semver = ANY;
62213
+ if (err) {
62214
+ setInvalidValueCache(newValue);
64355
62215
  } else {
64356
- this.semver = new semver(m[2], this.options.loose);
62216
+ setValue(newValue);
64357
62217
  }
64358
- }
64359
62218
 
64360
- toString () {
64361
- return this.value
64362
- }
64363
-
64364
- test (version) {
64365
- debug_1('Comparator.test', version, this.options.loose);
64366
-
64367
- if (this.semver === ANY || version === ANY) {
64368
- return true
64369
- }
62219
+ setError(err);
62220
+ }; // keep showing invalid value on errors, although it was not set
64370
62221
 
64371
- if (typeof version === 'string') {
64372
- try {
64373
- version = new semver(version, this.options);
64374
- } catch (er) {
64375
- return false
64376
- }
64377
- }
64378
62222
 
64379
- return cmp_1(version, this.operator, this.semver, this.options)
62223
+ if (prevValue === value && error) {
62224
+ value = invalidValueCache;
64380
62225
  }
64381
62226
 
64382
- intersects (comp, options) {
64383
- if (!(comp instanceof Comparator)) {
64384
- throw new TypeError('a Comparator is required')
64385
- }
64386
-
64387
- if (!options || typeof options !== 'object') {
64388
- options = {
64389
- loose: !!options,
64390
- includePrerelease: false
64391
- };
64392
- }
64393
-
64394
- if (this.operator === '') {
64395
- if (this.value === '') {
64396
- return true
64397
- }
64398
- return new range(comp.value, options).test(this.value)
64399
- } else if (comp.operator === '') {
64400
- if (comp.value === '') {
64401
- return true
64402
- }
64403
- return new range(this.value, options).test(comp.semver)
64404
- }
64405
-
64406
- const sameDirectionIncreasing =
64407
- (this.operator === '>=' || this.operator === '>') &&
64408
- (comp.operator === '>=' || comp.operator === '>');
64409
- const sameDirectionDecreasing =
64410
- (this.operator === '<=' || this.operator === '<') &&
64411
- (comp.operator === '<=' || comp.operator === '<');
64412
- const sameSemVer = this.semver.version === comp.semver.version;
64413
- const differentDirectionsInclusive =
64414
- (this.operator === '>=' || this.operator === '<=') &&
64415
- (comp.operator === '>=' || comp.operator === '<=');
64416
- const oppositeDirectionsLessThan =
64417
- cmp_1(this.semver, '<', comp.semver, options) &&
64418
- (this.operator === '>=' || this.operator === '>') &&
64419
- (comp.operator === '<=' || comp.operator === '<');
64420
- const oppositeDirectionsGreaterThan =
64421
- cmp_1(this.semver, '>', comp.semver, options) &&
64422
- (this.operator === '<=' || this.operator === '<') &&
64423
- (comp.operator === '>=' || comp.operator === '>');
64424
-
64425
- return (
64426
- sameDirectionIncreasing ||
64427
- sameDirectionDecreasing ||
64428
- (sameSemVer && differentDirectionsInclusive) ||
64429
- oppositeDirectionsLessThan ||
64430
- oppositeDirectionsGreaterThan
64431
- )
64432
- }
62227
+ return o$2("div", {
62228
+ class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
62229
+ "data-entry-id": id,
62230
+ children: [o$2(Textfield, {
62231
+ id: id,
62232
+ label: label,
62233
+ value: value,
62234
+ onInput: handleChange,
62235
+ debounce: debounce,
62236
+ disabled: disabled,
62237
+ feel: feel
62238
+ }), o$2(Description, {
62239
+ forId: id,
62240
+ element: element,
62241
+ value: description
62242
+ }), error && o$2("div", {
62243
+ class: "bio-properties-panel-error",
62244
+ children: error
62245
+ })]
62246
+ });
64433
62247
  }
62248
+ function isEdited$1(node) {
62249
+ return node && !!node.value;
62250
+ } // helpers /////////////////
64434
62251
 
64435
- var comparator = Comparator;
64436
-
64437
-
64438
- const {re: re$6, t: t$6} = re_1;
64439
-
64440
- const satisfies = (version, range$1, options) => {
64441
- try {
64442
- range$1 = new range(range$1, options);
64443
- } catch (er) {
64444
- return false
64445
- }
64446
- return range$1.test(version)
64447
- };
64448
- var satisfies_1 = satisfies;
64449
-
64450
- // Mostly just for testing and legacy API reasons
64451
- const toComparators = (range$1, options) =>
64452
- new range(range$1, options).set
64453
- .map(comp => comp.map(c => c.value).join(' ').trim().split(' '));
64454
-
64455
- var toComparators_1 = toComparators;
62252
+ function prefixId$1(id) {
62253
+ return `bio-properties-panel-${id}`;
62254
+ }
64456
62255
 
64457
- const maxSatisfying = (versions, range$1, options) => {
64458
- let max = null;
64459
- let maxSV = null;
64460
- let rangeObj = null;
64461
- try {
64462
- rangeObj = new range(range$1, options);
64463
- } catch (er) {
64464
- return null
64465
- }
64466
- versions.forEach((v) => {
64467
- if (rangeObj.test(v)) {
64468
- // satisfies(v, range, options)
64469
- if (!max || maxSV.compare(v) === -1) {
64470
- // compare(max, v, true)
64471
- max = v;
64472
- maxSV = new semver(max, options);
64473
- }
62256
+ const DEFAULT_DEBOUNCE_TIME = 300;
62257
+ function debounceInput(debounceDelay) {
62258
+ return function _debounceInput(fn) {
62259
+ if (debounceDelay !== false) {
62260
+ var debounceTime = isNumber(debounceDelay) ? debounceDelay : DEFAULT_DEBOUNCE_TIME;
62261
+ return debounce(fn, debounceTime);
62262
+ } else {
62263
+ return fn;
64474
62264
  }
64475
- });
64476
- return max
64477
- };
64478
- var maxSatisfying_1 = maxSatisfying;
62265
+ };
62266
+ }
62267
+ debounceInput.$inject = ['config.debounceInput'];
64479
62268
 
64480
- const minSatisfying = (versions, range$1, options) => {
64481
- let min = null;
64482
- let minSV = null;
64483
- let rangeObj = null;
64484
- try {
64485
- rangeObj = new range(range$1, options);
64486
- } catch (er) {
64487
- return null
64488
- }
64489
- versions.forEach((v) => {
64490
- if (rangeObj.test(v)) {
64491
- // satisfies(v, range, options)
64492
- if (!min || minSV.compare(v) === 1) {
64493
- // compare(min, v, true)
64494
- min = v;
64495
- minSV = new semver(min, options);
64496
- }
64497
- }
64498
- });
64499
- return min
62269
+ var index$2 = {
62270
+ debounceInput: ['factory', debounceInput]
64500
62271
  };
64501
- var minSatisfying_1 = minSatisfying;
64502
-
64503
- const minVersion = (range$1, loose) => {
64504
- range$1 = new range(range$1, loose);
64505
-
64506
- let minver = new semver('0.0.0');
64507
- if (range$1.test(minver)) {
64508
- return minver
64509
- }
64510
-
64511
- minver = new semver('0.0.0-0');
64512
- if (range$1.test(minver)) {
64513
- return minver
64514
- }
64515
62272
 
64516
- minver = null;
64517
- for (let i = 0; i < range$1.set.length; ++i) {
64518
- const comparators = range$1.set[i];
62273
+ /**
62274
+ * Failsafe remove an element from a collection
62275
+ *
62276
+ * @param {Array<Object>} [collection]
62277
+ * @param {Object} [element]
62278
+ *
62279
+ * @return {number} the previous index of the element
62280
+ */
64519
62281
 
64520
- let setMin = null;
64521
- comparators.forEach((comparator) => {
64522
- // Clone to avoid manipulating the comparator's semver object.
64523
- const compver = new semver(comparator.semver.version);
64524
- switch (comparator.operator) {
64525
- case '>':
64526
- if (compver.prerelease.length === 0) {
64527
- compver.patch++;
64528
- } else {
64529
- compver.prerelease.push(0);
64530
- }
64531
- compver.raw = compver.format();
64532
- /* fallthrough */
64533
- case '':
64534
- case '>=':
64535
- if (!setMin || gt_1(compver, setMin)) {
64536
- setMin = compver;
64537
- }
64538
- break
64539
- case '<':
64540
- case '<=':
64541
- /* Ignore maximum versions */
64542
- break
64543
- /* istanbul ignore next */
64544
- default:
64545
- throw new Error(`Unexpected operation: ${comparator.operator}`)
64546
- }
64547
- });
64548
- if (setMin && (!minver || gt_1(minver, setMin)))
64549
- minver = setMin;
64550
- }
62282
+ /**
62283
+ * Fail save add an element to the given connection, ensuring
62284
+ * it does not yet exist.
62285
+ *
62286
+ * @param {Array<Object>} collection
62287
+ * @param {Object} element
62288
+ * @param {number} idx
62289
+ */
62290
+ function add$2(collection, element, idx) {
64551
62291
 
64552
- if (minver && range$1.test(minver)) {
64553
- return minver
62292
+ if (!collection || !element) {
62293
+ return;
64554
62294
  }
64555
62295
 
64556
- return null
64557
- };
64558
- var minVersion_1 = minVersion;
64559
-
64560
- const validRange = (range$1, options) => {
64561
- try {
64562
- // Return '*' instead of '' so that truthiness works.
64563
- // This will throw if it's invalid anyway
64564
- return new range(range$1, options).range || '*'
64565
- } catch (er) {
64566
- return null
62296
+ if (typeof idx !== 'number') {
62297
+ idx = -1;
64567
62298
  }
64568
- };
64569
- var valid$1 = validRange;
64570
-
64571
- const {ANY: ANY$1} = comparator;
64572
62299
 
62300
+ var currentIdx = collection.indexOf(element);
64573
62301
 
62302
+ if (currentIdx !== -1) {
64574
62303
 
62304
+ if (currentIdx === idx) {
64575
62305
 
62306
+ // nothing to do, position has not changed
62307
+ return;
62308
+ } else {
64576
62309
 
62310
+ if (idx !== -1) {
64577
62311
 
62312
+ // remove from current position
62313
+ collection.splice(currentIdx, 1);
62314
+ } else {
64578
62315
 
64579
- const outside = (version, range$1, hilo, options) => {
64580
- version = new semver(version, options);
64581
- range$1 = new range(range$1, options);
64582
-
64583
- let gtfn, ltefn, ltfn, comp, ecomp;
64584
- switch (hilo) {
64585
- case '>':
64586
- gtfn = gt_1;
64587
- ltefn = lte_1;
64588
- ltfn = lt_1;
64589
- comp = '>';
64590
- ecomp = '>=';
64591
- break
64592
- case '<':
64593
- gtfn = lt_1;
64594
- ltefn = gte_1;
64595
- ltfn = gt_1;
64596
- comp = '<';
64597
- ecomp = '<=';
64598
- break
64599
- default:
64600
- throw new TypeError('Must provide a hilo val of "<" or ">"')
64601
- }
64602
-
64603
- // If it satisfies the range it is not outside
64604
- if (satisfies_1(version, range$1, options)) {
64605
- return false
64606
- }
64607
-
64608
- // From now on, variable terms are as if we're in "gtr" mode.
64609
- // but note that everything is flipped for the "ltr" function.
64610
-
64611
- for (let i = 0; i < range$1.set.length; ++i) {
64612
- const comparators = range$1.set[i];
64613
-
64614
- let high = null;
64615
- let low = null;
64616
-
64617
- comparators.forEach((comparator$1) => {
64618
- if (comparator$1.semver === ANY$1) {
64619
- comparator$1 = new comparator('>=0.0.0');
64620
- }
64621
- high = high || comparator$1;
64622
- low = low || comparator$1;
64623
- if (gtfn(comparator$1.semver, high.semver, options)) {
64624
- high = comparator$1;
64625
- } else if (ltfn(comparator$1.semver, low.semver, options)) {
64626
- low = comparator$1;
62316
+ // already exists in collection
62317
+ return;
64627
62318
  }
64628
- });
64629
-
64630
- // If the edge version comparator has a operator then our version
64631
- // isn't outside it
64632
- if (high.operator === comp || high.operator === ecomp) {
64633
- return false
64634
- }
64635
-
64636
- // If the lowest version comparator has an operator and our version
64637
- // is less than it then it isn't higher than the range
64638
- if ((!low.operator || low.operator === comp) &&
64639
- ltefn(version, low.semver)) {
64640
- return false
64641
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
64642
- return false
64643
62319
  }
64644
62320
  }
64645
- return true
64646
- };
64647
-
64648
- var outside_1 = outside;
64649
-
64650
- // Determine if version is greater than all the versions possible in the range.
64651
-
64652
- const gtr = (version, range, options) => outside_1(version, range, '>', options);
64653
- var gtr_1 = gtr;
64654
-
64655
- // Determine if version is less than all the versions possible in the range
64656
- const ltr = (version, range, options) => outside_1(version, range, '<', options);
64657
- var ltr_1 = ltr;
64658
-
64659
- const intersects = (r1, r2, options) => {
64660
- r1 = new range(r1, options);
64661
- r2 = new range(r2, options);
64662
- return r1.intersects(r2)
64663
- };
64664
- var intersects_1 = intersects;
64665
-
64666
- // given a set of versions and a range, create a "simplified" range
64667
- // that includes the same versions that the original range does
64668
- // If the original range is shorter than the simplified one, return that.
64669
62321
 
62322
+ if (idx !== -1) {
64670
62323
 
64671
- var simplify = (versions, range, options) => {
64672
- const set = [];
64673
- let min = null;
64674
- let prev = null;
64675
- const v = versions.sort((a, b) => compare_1(a, b, options));
64676
- for (const version of v) {
64677
- const included = satisfies_1(version, range, options);
64678
- if (included) {
64679
- prev = version;
64680
- if (!min)
64681
- min = version;
64682
- } else {
64683
- if (prev) {
64684
- set.push([min, prev]);
64685
- }
64686
- prev = null;
64687
- min = null;
64688
- }
64689
- }
64690
- if (min)
64691
- set.push([min, null]);
62324
+ // insert at specified position
62325
+ collection.splice(idx, 0, element);
62326
+ } else {
64692
62327
 
64693
- const ranges = [];
64694
- for (const [min, max] of set) {
64695
- if (min === max)
64696
- ranges.push(min);
64697
- else if (!max && min === v[0])
64698
- ranges.push('*');
64699
- else if (!max)
64700
- ranges.push(`>=${min}`);
64701
- else if (min === v[0])
64702
- ranges.push(`<=${max}`);
64703
- else
64704
- ranges.push(`${min} - ${max}`);
62328
+ // push to end
62329
+ collection.push(element);
64705
62330
  }
64706
- const simplified = ranges.join(' || ');
64707
- const original = typeof range.raw === 'string' ? range.raw : String(range);
64708
- return simplified.length < original.length ? simplified : range
64709
- };
64710
-
64711
- const { ANY: ANY$2 } = comparator;
64712
-
64713
-
64714
-
64715
- // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
64716
- // - Every simple range `r1, r2, ...` is a null set, OR
64717
- // - Every simple range `r1, r2, ...` which is not a null set is a subset of
64718
- // some `R1, R2, ...`
64719
- //
64720
- // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
64721
- // - If c is only the ANY comparator
64722
- // - If C is only the ANY comparator, return true
64723
- // - Else if in prerelease mode, return false
64724
- // - else replace c with `[>=0.0.0]`
64725
- // - If C is only the ANY comparator
64726
- // - if in prerelease mode, return true
64727
- // - else replace C with `[>=0.0.0]`
64728
- // - Let EQ be the set of = comparators in c
64729
- // - If EQ is more than one, return true (null set)
64730
- // - Let GT be the highest > or >= comparator in c
64731
- // - Let LT be the lowest < or <= comparator in c
64732
- // - If GT and LT, and GT.semver > LT.semver, return true (null set)
64733
- // - If any C is a = range, and GT or LT are set, return false
64734
- // - If EQ
64735
- // - If GT, and EQ does not satisfy GT, return true (null set)
64736
- // - If LT, and EQ does not satisfy LT, return true (null set)
64737
- // - If EQ satisfies every C, return true
64738
- // - Else return false
64739
- // - If GT
64740
- // - If GT.semver is lower than any > or >= comp in C, return false
64741
- // - If GT is >=, and GT.semver does not satisfy every C, return false
64742
- // - If GT.semver has a prerelease, and not in prerelease mode
64743
- // - If no C has a prerelease and the GT.semver tuple, return false
64744
- // - If LT
64745
- // - If LT.semver is greater than any < or <= comp in C, return false
64746
- // - If LT is <=, and LT.semver does not satisfy every C, return false
64747
- // - If GT.semver has a prerelease, and not in prerelease mode
64748
- // - If no C has a prerelease and the LT.semver tuple, return false
64749
- // - Else return true
64750
-
64751
- const subset = (sub, dom, options = {}) => {
64752
- if (sub === dom)
64753
- return true
64754
-
64755
- sub = new range(sub, options);
64756
- dom = new range(dom, options);
64757
- let sawNonNull = false;
64758
-
64759
- OUTER: for (const simpleSub of sub.set) {
64760
- for (const simpleDom of dom.set) {
64761
- const isSub = simpleSubset(simpleSub, simpleDom, options);
64762
- sawNonNull = sawNonNull || isSub !== null;
64763
- if (isSub)
64764
- continue OUTER
64765
- }
64766
- // the null set is a subset of everything, but null simple ranges in
64767
- // a complex range should be ignored. so if we saw a non-null range,
64768
- // then we know this isn't a subset, but if EVERY simple range was null,
64769
- // then it is a subset.
64770
- if (sawNonNull)
64771
- return false
64772
- }
64773
- return true
64774
- };
64775
-
64776
- const simpleSubset = (sub, dom, options) => {
64777
- if (sub === dom)
64778
- return true
64779
-
64780
- if (sub.length === 1 && sub[0].semver === ANY$2) {
64781
- if (dom.length === 1 && dom[0].semver === ANY$2)
64782
- return true
64783
- else if (options.includePrerelease)
64784
- sub = [ new comparator('>=0.0.0-0') ];
64785
- else
64786
- sub = [ new comparator('>=0.0.0') ];
64787
- }
64788
-
64789
- if (dom.length === 1 && dom[0].semver === ANY$2) {
64790
- if (options.includePrerelease)
64791
- return true
64792
- else
64793
- dom = [ new comparator('>=0.0.0') ];
64794
- }
64795
-
64796
- const eqSet = new Set();
64797
- let gt, lt;
64798
- for (const c of sub) {
64799
- if (c.operator === '>' || c.operator === '>=')
64800
- gt = higherGT(gt, c, options);
64801
- else if (c.operator === '<' || c.operator === '<=')
64802
- lt = lowerLT(lt, c, options);
64803
- else
64804
- eqSet.add(c.semver);
64805
- }
64806
-
64807
- if (eqSet.size > 1)
64808
- return null
64809
-
64810
- let gtltComp;
64811
- if (gt && lt) {
64812
- gtltComp = compare_1(gt.semver, lt.semver, options);
64813
- if (gtltComp > 0)
64814
- return null
64815
- else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
64816
- return null
64817
- }
64818
-
64819
- // will iterate one or zero times
64820
- for (const eq of eqSet) {
64821
- if (gt && !satisfies_1(eq, String(gt), options))
64822
- return null
64823
-
64824
- if (lt && !satisfies_1(eq, String(lt), options))
64825
- return null
64826
-
64827
- for (const c of dom) {
64828
- if (!satisfies_1(eq, String(c), options))
64829
- return false
64830
- }
64831
-
64832
- return true
64833
- }
64834
-
64835
- let higher, lower;
64836
- let hasDomLT, hasDomGT;
64837
- // if the subset has a prerelease, we need a comparator in the superset
64838
- // with the same tuple and a prerelease, or it's not a subset
64839
- let needDomLTPre = lt &&
64840
- !options.includePrerelease &&
64841
- lt.semver.prerelease.length ? lt.semver : false;
64842
- let needDomGTPre = gt &&
64843
- !options.includePrerelease &&
64844
- gt.semver.prerelease.length ? gt.semver : false;
64845
- // exception: <1.2.3-0 is the same as <1.2.3
64846
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
64847
- lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
64848
- needDomLTPre = false;
64849
- }
64850
-
64851
- for (const c of dom) {
64852
- hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=';
64853
- hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=';
64854
- if (gt) {
64855
- if (needDomGTPre) {
64856
- if (c.semver.prerelease && c.semver.prerelease.length &&
64857
- c.semver.major === needDomGTPre.major &&
64858
- c.semver.minor === needDomGTPre.minor &&
64859
- c.semver.patch === needDomGTPre.patch) {
64860
- needDomGTPre = false;
64861
- }
64862
- }
64863
- if (c.operator === '>' || c.operator === '>=') {
64864
- higher = higherGT(gt, c, options);
64865
- if (higher === c && higher !== gt)
64866
- return false
64867
- } else if (gt.operator === '>=' && !satisfies_1(gt.semver, String(c), options))
64868
- return false
64869
- }
64870
- if (lt) {
64871
- if (needDomLTPre) {
64872
- if (c.semver.prerelease && c.semver.prerelease.length &&
64873
- c.semver.major === needDomLTPre.major &&
64874
- c.semver.minor === needDomLTPre.minor &&
64875
- c.semver.patch === needDomLTPre.patch) {
64876
- needDomLTPre = false;
64877
- }
64878
- }
64879
- if (c.operator === '<' || c.operator === '<=') {
64880
- lower = lowerLT(lt, c, options);
64881
- if (lower === c && lower !== lt)
64882
- return false
64883
- } else if (lt.operator === '<=' && !satisfies_1(lt.semver, String(c), options))
64884
- return false
64885
- }
64886
- if (!c.operator && (lt || gt) && gtltComp !== 0)
64887
- return false
64888
- }
64889
-
64890
- // if there was a < or >, and nothing in the dom, then must be false
64891
- // UNLESS it was limited by another range in the other direction.
64892
- // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
64893
- if (gt && hasDomLT && !lt && gtltComp !== 0)
64894
- return false
64895
-
64896
- if (lt && hasDomGT && !gt && gtltComp !== 0)
64897
- return false
64898
-
64899
- // we needed a prerelease range in a specific tuple, but didn't get one
64900
- // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
64901
- // because it includes prereleases in the 1.2.3 tuple
64902
- if (needDomGTPre || needDomLTPre)
64903
- return false
64904
-
64905
- return true
64906
- };
64907
-
64908
- // >=1.2.3 is lower than >1.2.3
64909
- const higherGT = (a, b, options) => {
64910
- if (!a)
64911
- return b
64912
- const comp = compare_1(a.semver, b.semver, options);
64913
- return comp > 0 ? a
64914
- : comp < 0 ? b
64915
- : b.operator === '>' && a.operator === '>=' ? b
64916
- : a
64917
- };
64918
-
64919
- // <=1.2.3 is higher than <1.2.3
64920
- const lowerLT = (a, b, options) => {
64921
- if (!a)
64922
- return b
64923
- const comp = compare_1(a.semver, b.semver, options);
64924
- return comp < 0 ? a
64925
- : comp > 0 ? b
64926
- : b.operator === '<' && a.operator === '<=' ? b
64927
- : a
64928
- };
64929
-
64930
- var subset_1 = subset;
64931
-
64932
- // just pre-load all the stuff that index.js lazily exports
64933
-
64934
- ({
64935
- re: re_1.re,
64936
- src: re_1.src,
64937
- tokens: re_1.t,
64938
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
64939
- SemVer: semver,
64940
- compareIdentifiers: identifiers.compareIdentifiers,
64941
- rcompareIdentifiers: identifiers.rcompareIdentifiers,
64942
- parse: parse_1,
64943
- valid: valid_1,
64944
- clean: clean_1,
64945
- inc: inc_1,
64946
- diff: diff_1,
64947
- major: major_1,
64948
- minor: minor_1,
64949
- patch: patch_1,
64950
- prerelease: prerelease_1,
64951
- compare: compare_1,
64952
- rcompare: rcompare_1,
64953
- compareLoose: compareLoose_1,
64954
- compareBuild: compareBuild_1,
64955
- sort: sort_1,
64956
- rsort: rsort_1,
64957
- gt: gt_1,
64958
- lt: lt_1,
64959
- eq: eq_1,
64960
- neq: neq_1,
64961
- gte: gte_1,
64962
- lte: lte_1,
64963
- cmp: cmp_1,
64964
- coerce: coerce_1,
64965
- Comparator: comparator,
64966
- Range: range,
64967
- satisfies: satisfies_1,
64968
- toComparators: toComparators_1,
64969
- maxSatisfying: maxSatisfying_1,
64970
- minSatisfying: minSatisfying_1,
64971
- minVersion: minVersion_1,
64972
- validRange: valid$1,
64973
- outside: outside_1,
64974
- gtr: gtr_1,
64975
- ltr: ltr_1,
64976
- intersects: intersects_1,
64977
- simplifyRange: simplify,
64978
- subset: subset_1,
64979
- });
62331
+ }
64980
62332
 
64981
62333
  const BpmnPropertiesPanelContext = q({
64982
62334
  selectedElement: null,
@@ -66859,7 +64211,7 @@
66859
64211
  label: translate('<none>')
66860
64212
  }];
66861
64213
  const activities = findActivityRefs(element);
66862
- sortByName$7(activities).forEach(function (activity) {
64214
+ sortByName$6(activities).forEach(function (activity) {
66863
64215
  options.push({
66864
64216
  value: activity.id,
66865
64217
  label: createOptionLabel(activity)
@@ -66982,7 +64334,7 @@
66982
64334
  return `${name ? name + ' ' : ''}(id=${id})`;
66983
64335
  }
66984
64336
 
66985
- function sortByName$7(elements) {
64337
+ function sortByName$6(elements) {
66986
64338
  return sortBy(elements, e => (e.name || '').toLowerCase());
66987
64339
  }
66988
64340
 
@@ -67286,7 +64638,7 @@
67286
64638
  label: translate('Create new ...')
67287
64639
  }];
67288
64640
  const errors = findRootElementsByType(getBusinessObject(element), 'bpmn:Error');
67289
- sortByName$6(errors).forEach(error => {
64641
+ sortByName$5(errors).forEach(error => {
67290
64642
  options.push({
67291
64643
  value: error.get('id'),
67292
64644
  label: error.get('name')
@@ -67373,7 +64725,7 @@
67373
64725
  } // helper /////////////////////////
67374
64726
 
67375
64727
 
67376
- function sortByName$6(elements) {
64728
+ function sortByName$5(elements) {
67377
64729
  return sortBy(elements, e => (e.name || '').toLowerCase());
67378
64730
  }
67379
64731
 
@@ -67480,7 +64832,7 @@
67480
64832
  label: translate('Create new ...')
67481
64833
  }];
67482
64834
  const escalations = findRootElementsByType(getBusinessObject(element), 'bpmn:Escalation');
67483
- sortByName$5(escalations).forEach(escalation => {
64835
+ sortByName$4(escalations).forEach(escalation => {
67484
64836
  options.push({
67485
64837
  value: escalation.get('id'),
67486
64838
  label: escalation.get('name')
@@ -67567,7 +64919,7 @@
67567
64919
  } // helper /////////////////////////
67568
64920
 
67569
64921
 
67570
- function sortByName$5(elements) {
64922
+ function sortByName$4(elements) {
67571
64923
  return sortBy(elements, e => (e.name || '').toLowerCase());
67572
64924
  }
67573
64925
 
@@ -67829,7 +65181,7 @@
67829
65181
  if (message) {
67830
65182
  entries = [...entries, {
67831
65183
  id: 'messageName',
67832
- component: MessageName,
65184
+ component: MessageName$1,
67833
65185
  isEdited: isEdited$1
67834
65186
  }];
67835
65187
  }
@@ -67905,7 +65257,7 @@
67905
65257
  label: translate('Create new ...')
67906
65258
  }];
67907
65259
  const messages = findRootElementsByType(getBusinessObject(element), 'bpmn:Message');
67908
- sortByName$4(messages).forEach(message => {
65260
+ sortByName$3(messages).forEach(message => {
67909
65261
  options.push({
67910
65262
  value: message.get('id'),
67911
65263
  label: message.get('name')
@@ -67925,7 +65277,7 @@
67925
65277
  });
67926
65278
  }
67927
65279
 
67928
- function MessageName(props) {
65280
+ function MessageName$1(props) {
67929
65281
  const {
67930
65282
  element
67931
65283
  } = props;
@@ -67959,7 +65311,7 @@
67959
65311
  } // helper /////////////////////////
67960
65312
 
67961
65313
 
67962
- function sortByName$4(elements) {
65314
+ function sortByName$3(elements) {
67963
65315
  return sortBy(elements, e => (e.name || '').toLowerCase());
67964
65316
  }
67965
65317
 
@@ -68525,7 +65877,7 @@
68525
65877
  label: translate('Create new ...')
68526
65878
  }];
68527
65879
  const signals = findRootElementsByType(getBusinessObject(element), 'bpmn:Signal');
68528
- sortByName$3(signals).forEach(signal => {
65880
+ sortByName$2(signals).forEach(signal => {
68529
65881
  options.push({
68530
65882
  value: signal.get('id'),
68531
65883
  label: signal.get('name')
@@ -68579,7 +65931,7 @@
68579
65931
  } // helper /////////////////////////
68580
65932
 
68581
65933
 
68582
- function sortByName$3(elements) {
65934
+ function sortByName$2(elements) {
68583
65935
  return sortBy(elements, e => (e.name || '').toLowerCase());
68584
65936
  }
68585
65937