From 3eb83020bf5d9a5f6abbe6d34e9ab686e3e4191f Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sat, 30 Aug 2025 14:54:29 -0400 Subject: [PATCH 01/76] fix(issue#4339): limit whitespace check * Fix issue #4339 by limiting the whitespace check for the deprecation notice to not produce false positives. --- packages/less/src/less/parser/parser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 76676f5fe..b9279a0d9 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -972,7 +972,10 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (elements) { parensIndex = parserInput.i; if (parserInput.$char('(')) { - parensWS = parserInput.isWhitespace(-2); + parserInput.save(); + parensWS = parserInput.$re(/[ \t\u00A0]$/, -2); + parserInput.forget(); + args = this.args(true).args; expectChar(')'); hasParens = true; From 043c19581dfdbcd8162865044137ed35089742d9 Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sat, 30 Aug 2025 15:29:30 -0400 Subject: [PATCH 02/76] fix(issue#4339): correct deprecation notice * Correct deprecation notice for issue #4339. --- packages/less/src/less/parser/parser.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index b9279a0d9..d77f2dd6b 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -971,11 +971,8 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (elements) { parensIndex = parserInput.i; - if (parserInput.$char('(')) { - parserInput.save(); - parensWS = parserInput.$re(/[ \t\u00A0]$/, -2); - parserInput.forget(); - + parensWS = parserInput.isWhitespace(-1); + if (parserInput.$char('(')) { args = this.args(true).args; expectChar(')'); hasParens = true; From 830682a4392f0a7edcc7bad5dc300d0a6d191426 Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sun, 25 Jan 2026 11:19:24 -0500 Subject: [PATCH 03/76] fix:(issue#4397): container query variable names * Fix for issue #4397 container query with variable names like @container @foo () {}. --- packages/less/src/less/parser/parser.js | 6 +- packages/less/src/less/tree/container.js | 67 ++++++++++++++++++- packages/less/src/less/tree/nested-at-rule.js | 4 +- .../less/src/less/tree/query-in-parens.js | 32 ++------- .../tests-unit/container/container.css | 5 ++ .../tests-unit/container/container.less | 8 ++- 6 files changed, 90 insertions(+), 32 deletions(-) diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 4d3b0c708..2b26ea96c 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -654,7 +654,8 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.save(); if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) { ch = parserInput.currentChar(); - if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\s/)) { + if ((ch === '(' && !parserInput.prevChar().match(/^\s/)) + || (ch === '[' && !parserInput.prevChar().match(/^\s/))) { // this may be a VariableCall lookup const result = parsers.variableCall(name); if (result) { @@ -1884,6 +1885,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup() if (e) { nodes.push(e); + if (e.type === 'Variable') { + spacing = true; + } } else if (parserInput.$char('(')) { p = this.property(); parserInput.save(); diff --git a/packages/less/src/less/tree/container.js b/packages/less/src/less/tree/container.js index 1a5502fa3..36d708e24 100644 --- a/packages/less/src/less/tree/container.js +++ b/packages/less/src/less/tree/container.js @@ -2,7 +2,10 @@ import Ruleset from './ruleset'; import Value from './value'; import Selector from './selector'; import AtRule from './atrule'; +import Anonymous from './anonymous'; +import Expression from './expression'; import NestableAtRulePrototype from './nested-at-rule'; +import * as utils from '../utils'; const Container = function(value, features, index, currentFileInfo, visibilityInfo) { this._index = index; @@ -32,17 +35,21 @@ Container.prototype = Object.assign(new AtRule(), { }, eval(context) { + if (this._evaluated) { + return this; + } if (!context.mediaBlocks) { context.mediaBlocks = []; context.mediaPath = []; } const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo()); + media._evaluated = true; if (this.debugInfo) { this.rules[0].debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } - + media.features = this.features.eval(context); context.mediaPath.push(media); @@ -57,6 +64,64 @@ Container.prototype = Object.assign(new AtRule(), { return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); + }, + + evalNested(context) { + this.evalFunction(); + + let i; + let value; + const path = context.mediaPath.concat([this]); + + for (i = 0; i < path.length; i++) { + if (path[i].type !== this.type) { + context.mediaBlocks.splice(i, 1); + return this; + } + + value = path[i].features instanceof Value ? + path[i].features.value : path[i].features; + const fragments = Array.isArray(value) ? value : [value]; + path[i] = fragments; + } + + this.features = new Value(this.permute(path).map(path => { + path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment)); + + for (i = path.length - 1; i > 0; i--) { + path.splice(i, 0, new Anonymous('and')); + } + + return new Expression(path); + })); + this.setParent(this.features, this); + + return new Ruleset([], []); + }, + + permute(arr) { + if (arr.length === 0) { + return []; + } else if (arr.length === 1) { + return arr[0]; + } else { + const result = []; + const rest = this.permute(arr.slice(1)); + for (let i = 0; i < rest.length; i++) { + for (let j = 0; j < arr[0].length; j++) { + result.push([arr[0][j]].concat(rest[i])); + } + } + return result; + } + }, + + bubbleSelectors(selectors) { + if (!selectors) { + return; + } + this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])]; + this.setParent(this.rules, this); } }); diff --git a/packages/less/src/less/tree/nested-at-rule.js b/packages/less/src/less/tree/nested-at-rule.js index fc383f344..dd2ff5284 100644 --- a/packages/less/src/less/tree/nested-at-rule.js +++ b/packages/less/src/less/tree/nested-at-rule.js @@ -31,7 +31,9 @@ const NestableAtRulePrototype = { for (let index = 0; index < exprValues.length; ++index) { expr = exprValues[index]; - if (expr.type === 'Keyword' && index + 1 < exprValues.length && (expr.noSpacing || expr.noSpacing == null)) { + if ((expr.type === 'Keyword' || expr.type === 'Variable') + && index + 1 < exprValues.length + && (expr.noSpacing || expr.noSpacing == null)) { paren = exprValues[index + 1]; if (paren.type === 'Paren' && paren.noSpacing) { diff --git a/packages/less/src/less/tree/query-in-parens.js b/packages/less/src/less/tree/query-in-parens.js index 40b48a71c..1c0200ef5 100644 --- a/packages/less/src/less/tree/query-in-parens.js +++ b/packages/less/src/less/tree/query-in-parens.js @@ -1,5 +1,4 @@ import { copy } from 'copy-anything'; -import Declaration from './declaration'; import Node from './node'; const QueryInParens = function (op, l, m, op2, r, i) { @@ -26,36 +25,13 @@ QueryInParens.prototype = Object.assign(new Node(), { eval(context) { this.lvalue = this.lvalue.eval(context); - let variableDeclaration; - let rule; - - for (let i = 0; (rule = context.frames[i]); i++) { - if (rule.type === 'Ruleset') { - variableDeclaration = rule.rules.find(function (r) { - if ((r instanceof Declaration) && r.variable) { - return true; - } - - return false; - }); - - if (variableDeclaration) { - break; - } - } - } - if (!this.mvalueCopy) { this.mvalueCopy = copy(this.mvalue); } - - if (variableDeclaration) { - this.mvalue = this.mvalueCopy; - this.mvalue = this.mvalue.eval(context); - this.mvalues.push(this.mvalue); - } else { - this.mvalue = this.mvalue.eval(context); - } + + this.mvalue = copy(this.mvalueCopy); + this.mvalue = this.mvalue.eval(context); + this.mvalues.push(this.mvalue); if (this.rvalue) { this.rvalue = this.rvalue.eval(context); diff --git a/packages/test-data/tests-unit/container/container.css b/packages/test-data/tests-unit/container/container.css index 2d518f871..285fd2784 100644 --- a/packages/test-data/tests-unit/container/container.css +++ b/packages/test-data/tests-unit/container/container.css @@ -268,3 +268,8 @@ font-size: 75%; } } +@container foo (min-width: 400px) { + #sticky-child { + font-size: 75%; + } +} diff --git a/packages/test-data/tests-unit/container/container.less b/packages/test-data/tests-unit/container/container.less index 229e9046f..5eec2f6d4 100644 --- a/packages/test-data/tests-unit/container/container.less +++ b/packages/test-data/tests-unit/container/container.less @@ -319,4 +319,10 @@ } } - +@varfoo: foo; +@threshold: 400px; +@container @varfoo (min-width: @threshold) { + #sticky-child { + font-size: 75%; + } +} From 3c03d00ca40c9c27ae2541da946953cc6e395786 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 12:16:53 -0700 Subject: [PATCH 04/76] feat(deprecation): add deprecation warnings for features removed in Less 5.x New deprecation infrastructure with automatic repetition limiting (max 5 per type): - deprecation.js: registry of deprecation IDs with descriptions - Parser warn() accepts deprecation IDs for categorized warnings - --quiet-deprecations: suppress only deprecation warnings (keeps other warnings) New deprecation warnings for features being removed in 5.x: - js-eval: inline JavaScript backtick expressions - at-plugin: @plugin directive Existing warnings now tagged with stable IDs: - mixin-call-no-parens, mixin-call-whitespace, dot-slash-operator - variable-in-unknown-value, property-in-unknown-value CLI deprecation notices for: --js, --line-numbers, --math=always --- packages/less/bin/lessc | 8 ++- packages/less/src/less-node/lessc-helper.js | 2 + packages/less/src/less/contexts.js | 1 + packages/less/src/less/deprecation.js | 64 +++++++++++++++++++++ packages/less/src/less/parser/parser.js | 53 +++++++++-------- 5 files changed, 104 insertions(+), 24 deletions(-) create mode 100644 packages/less/src/less/deprecation.js diff --git a/packages/less/bin/lessc b/packages/less/bin/lessc index 310665250..166ad6975 100755 --- a/packages/less/bin/lessc +++ b/packages/less/bin/lessc @@ -408,6 +408,10 @@ function processPluginQueue() { options.quiet = quiet = true; break; + case 'quiet-deprecations': + options.quietDeprecations = true; + break; + case 'l': case 'lint': options.lint = true; @@ -453,6 +457,7 @@ function processPluginQueue() { case 'js': options.javascriptEnabled = true; + console.warn('Warning: Inline JavaScript (--js) is deprecated and will be removed in Less 5.x. Use Less functions or custom plugins instead. (js-eval)'); break; case 'no-js': @@ -476,6 +481,7 @@ function processPluginQueue() { case 'line-numbers': if (checkArgFunc(arg, match[2])) { options.dumpLineNumbers = match[2]; + console.warn('Warning: The --line-numbers option is deprecated and will be removed in Less 5.x. Use source maps instead (--source-map). (dump-line-numbers)'); } break; @@ -581,7 +587,7 @@ function processPluginQueue() { let m = match[2]; if (checkArgFunc(arg, m)) { if (m === 'always') { - console.warn('--math=always is deprecated and will be removed in the future.'); + console.warn('Warning: --math=always is deprecated and will be removed in Less 5.x. Use --math=parens-division (default) or --math=parens. (math-always)'); options.math = Constants.Math.ALWAYS; } else if (m === 'parens-division') { options.math = Constants.Math.PARENS_DIVISION; diff --git a/packages/less/src/less-node/lessc-helper.js b/packages/less/src/less-node/lessc-helper.js index a24653b67..6103caa8d 100644 --- a/packages/less/src/less-node/lessc-helper.js +++ b/packages/less/src/less-node/lessc-helper.js @@ -70,6 +70,8 @@ const lessc_helper = { console.log(' or --clean-css="advanced"'); console.log(' --disable-plugin-rule Disallow @plugin statements'); console.log(''); + console.log(' --quiet-deprecations Suppress deprecation warnings only (keeps other warnings).'); + console.log(''); console.log('-------------------------- Deprecated ----------------'); console.log(' -sm=on|off Legacy parens-only math. Use --math'); console.log(' --strict-math=on|off '); diff --git a/packages/less/src/less/contexts.js b/packages/less/src/less/contexts.js index 6e3b38900..6f38fa2f5 100644 --- a/packages/less/src/less/contexts.js +++ b/packages/less/src/less/contexts.js @@ -32,6 +32,7 @@ const parseCopyProperties = [ // Used by the import manager to stop multiple import visitors being created. 'pluginManager', // Used as the plugin manager for the session 'quiet', // option - whether to log warnings + 'quietDeprecations', // option - whether to suppress deprecation warnings only ]; contexts.Parse = function(options) { diff --git a/packages/less/src/less/deprecation.js b/packages/less/src/less/deprecation.js new file mode 100644 index 000000000..d29fc9e5f --- /dev/null +++ b/packages/less/src/less/deprecation.js @@ -0,0 +1,64 @@ +/** + * Deprecation registry for Less.js + * + * Each deprecation has a unique ID and description. + * Repetition limiting caps warnings at 5 per deprecation type per parse. + * Use --quiet-deprecations to suppress all deprecation warnings. + */ + +const deprecations = { + 'mixin-call-no-parens': { + description: 'Calling a mixin without parentheses is deprecated.' + }, + 'mixin-call-whitespace': { + description: 'Whitespace between a mixin name and parentheses for a mixin call is deprecated.' + }, + 'dot-slash-operator': { + description: 'The ./ operator is deprecated.' + }, + 'variable-in-unknown-value': { + description: '@[ident] in custom property values is treated as literal text.' + }, + 'property-in-unknown-value': { + description: '$[ident] in custom property values is treated as literal text.' + }, + 'js-eval': { + description: 'Inline JavaScript evaluation (backtick expressions) is deprecated and will be removed in Less 5.x.' + }, + 'at-plugin': { + description: 'The @plugin directive is deprecated and will be removed in Less 5.x.' + }, + 'dump-line-numbers': { + description: 'The dumpLineNumbers option is deprecated and will be removed in Less 5.x.' + }, + 'math-always': { + description: '--math=always is deprecated and will be removed in Less 5.x.' + } +}; + +const MAX_REPETITIONS = 5; + +class DeprecationHandler { + constructor() { + this._counts = {}; + } + + shouldWarn(deprecationId) { + if (!deprecationId) { return true; } + const count = (this._counts[deprecationId] || 0) + 1; + this._counts[deprecationId] = count; + return count <= MAX_REPETITIONS; + } + + summarize(logger) { + for (const id of Object.keys(this._counts)) { + const omitted = this._counts[id] - MAX_REPETITIONS; + if (omitted > 0) { + logger.warn(`${omitted} repetitive "${id}" deprecation warning(s) omitted.`); + } + } + } +} + +export { deprecations, DeprecationHandler, MAX_REPETITIONS }; +export default { deprecations, DeprecationHandler }; diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 8b359b04b..a61f14fea 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -6,6 +6,7 @@ import * as utils from '../utils'; import functionRegistry from '../functions/function-registry'; import { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax'; import logger from '../logger'; +import { DeprecationHandler } from '../deprecation'; import Selector from '../tree/selector'; import Anonymous from '../tree/anonymous'; @@ -59,26 +60,30 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { ); } + const deprecationHandler = new DeprecationHandler(); + /** - * - * @param {string} msg - * @param {number} index - * @param {string} type + * @param {string} msg + * @param {number} index + * @param {string} type + * @param {string} [deprecationId] - stable deprecation ID for repetition limiting */ - function warn(msg, index, type) { - if (!context.quiet) { - logger.warn( - (new LessError( - { - index: index ?? parserInput.i, - filename: fileInfo.filename, - type: type ? `${type.toUpperCase()} WARNING` : 'WARNING', - message: msg - }, - imports - )).toString() - ); - } + function warn(msg, index, type, deprecationId) { + if (context.quiet) { return; } + if (deprecationId && context.quietDeprecations) { return; } + if (deprecationId && !deprecationHandler.shouldWarn(deprecationId)) { return; } + + logger.warn( + (new LessError( + { + index: index ?? parserInput.i, + filename: fileInfo.filename, + type: type ? `${type.toUpperCase()} WARNING` : 'WARNING', + message: msg + }, + imports + )).toString() + ); } function expect(arg, msg) { @@ -790,6 +795,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { js = parserInput.$re(/^[^`]*`/); if (js) { + warn('Inline JavaScript evaluation (backtick expressions) is deprecated and will be removed in Less 5.x. Use Less functions or custom plugins instead.', index, 'DEPRECATED', 'js-eval'); parserInput.forget(); return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo); } @@ -966,7 +972,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { expectChar(')'); hasParens = true; if (parensWS) { - warn('Whitespace between a mixin name and parentheses for a mixin call is deprecated', parensIndex, 'DEPRECATED'); + warn('Whitespace between a mixin name and parentheses for a mixin call is deprecated', parensIndex, 'DEPRECATED', 'mixin-call-whitespace'); } } @@ -996,7 +1002,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } else { if (!hasParens) { - warn('Calling a mixin without parentheses is deprecated', parensIndex, 'DEPRECATED'); + warn('Calling a mixin without parentheses is deprecated', parensIndex, 'DEPRECATED', 'mixin-call-no-parens'); } return mixin; } @@ -1776,10 +1782,10 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const variableRegex = /@([\w-]+)/g; const propRegex = /\$([\w-]+)/g; if (variableRegex.test(item)) { - warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED'); + warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED', 'variable-in-unknown-value'); } if (propRegex.test(item)) { - warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED'); + warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED', 'property-in-unknown-value'); } quote.variableRegex = /@([\w-]+)|@{([\w-]+)}/g; quote.propRegex = /\$([\w-]+)|\${([\w-]+)}/g; @@ -2014,6 +2020,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const dir = parserInput.$re(/^@plugin\s+/); if (dir) { + warn('The @plugin directive is deprecated and will be removed in Less 5.x. Use --plugin CLI option or the programmatic plugin API instead.', index, 'DEPRECATED', 'at-plugin'); args = this.pluginArgs(); if (args) { @@ -2296,7 +2303,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { let index = parserInput.i; op = parserInput.$str('./'); if (op) { - warn('./ operator is deprecated', index, 'DEPRECATED'); + warn('./ operator is deprecated', index, 'DEPRECATED', 'dot-slash-operator'); } } From 65dadc9c829f56d92216ab04d76b9762e78a9544 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 12:17:17 -0700 Subject: [PATCH 05/76] feat(benchmark): add historical benchmark suite with per-system result tracking Results organized as: results/latest/{system-id}.json - most recent per system results/runs/{date}_{system-id}.json - historical archive (gitignored) --- .../benchmark-import-reference-target.less | 82 +++ .../benchmark/benchmark-import-target.less | 43 ++ packages/less/benchmark/benchmark-runner.js | 164 ++++++ packages/less/benchmark/benchmark-v3.less | 134 +++++ packages/less/benchmark/benchmark-v37.less | 108 ++++ packages/less/benchmark/benchmark-v39.less | 84 +++ packages/less/benchmark/benchmark.less | 469 ++++++++++++++- packages/less/benchmark/results/.gitignore | 8 + .../results/latest/macbook-pro_arm64.json | 536 ++++++++++++++++++ packages/less/benchmark/run-historical.sh | 373 ++++++++++++ 10 files changed, 1999 insertions(+), 2 deletions(-) create mode 100644 packages/less/benchmark/benchmark-import-reference-target.less create mode 100644 packages/less/benchmark/benchmark-import-target.less create mode 100644 packages/less/benchmark/benchmark-runner.js create mode 100644 packages/less/benchmark/benchmark-v3.less create mode 100644 packages/less/benchmark/benchmark-v37.less create mode 100644 packages/less/benchmark/benchmark-v39.less create mode 100644 packages/less/benchmark/results/.gitignore create mode 100644 packages/less/benchmark/results/latest/macbook-pro_arm64.json create mode 100755 packages/less/benchmark/run-historical.sh diff --git a/packages/less/benchmark/benchmark-import-reference-target.less b/packages/less/benchmark/benchmark-import-reference-target.less new file mode 100644 index 000000000..1999ddb58 --- /dev/null +++ b/packages/less/benchmark/benchmark-import-reference-target.less @@ -0,0 +1,82 @@ +// Target for @import (reference) benchmarking +// These should NOT appear in output unless extended + +.ref-button { + display: inline-block; + padding: 8px 16px; + border: 1px solid #ccc; + border-radius: 4px; + cursor: pointer; + background: #f0f0f0; + color: #333; + text-decoration: none; + font-size: 14px; + line-height: 1.5; + text-align: center; + vertical-align: middle; + &:hover { + background: #e0e0e0; + border-color: #999; + } + &:active { + background: #d0d0d0; + } + &.primary { + background: #3498db; + color: #fff; + border-color: #2980b9; + &:hover { + background: #2980b9; + } + } + &.danger { + background: #e74c3c; + color: #fff; + border-color: #c0392b; + &:hover { + background: #c0392b; + } + } +} + +.ref-alert { + padding: 12px 20px; + border: 1px solid transparent; + border-radius: 4px; + margin-bottom: 16px; + &.success { + color: #155724; + background: #d4edda; + border-color: #c3e6cb; + } + &.warning { + color: #856404; + background: #fff3cd; + border-color: #ffeeba; + } + &.error { + color: #721c24; + background: #f8d7da; + border-color: #f5c6cb; + } +} + +.ref-grid-system { + .row { + display: flex; + flex-wrap: wrap; + margin: 0 -15px; + } + .col { + flex: 1; + padding: 0 15px; + } + .generate-cols(@n, @i: 1) when (@i =< @n) { + .col-@{i} { + flex: 0 0 percentage(@i / @n); + max-width: percentage(@i / @n); + } + .generate-cols(@n, (@i + 1)); + } + .generate-cols(12); +} diff --git a/packages/less/benchmark/benchmark-import-target.less b/packages/less/benchmark/benchmark-import-target.less new file mode 100644 index 000000000..ab1556bd3 --- /dev/null +++ b/packages/less/benchmark/benchmark-import-target.less @@ -0,0 +1,43 @@ +// Shared mixins and variables for import benchmarking +@import-base-color: #3498db; +@import-accent: #e74c3c; +@import-spacing: 8px; + +.imported-mixin(@size: 14px, @weight: normal) { + font-size: @size; + font-weight: @weight; + line-height: @size * 1.5; +} + +.imported-box(@w: 100px, @h: 100px) { + width: @w; + height: @h; + background: @import-base-color; + border: 1px solid darken(@import-base-color, 15%); + margin: @import-spacing; +} + +.imported-flex(@dir: row, @justify: flex-start, @align: stretch) { + display: flex; + flex-direction: @dir; + justify-content: @justify; + align-items: @align; +} + +.imported-grid(@cols: 12, @gap: @import-spacing) { + display: grid; + grid-template-columns: repeat(@cols, 1fr); + gap: @gap; +} + +.imported-base { + color: @import-base-color; + padding: @import-spacing; + .imported-mixin(); +} + +.imported-card { + .imported-box(300px, auto); + padding: @import-spacing * 2; + border-radius: 4px; +} diff --git a/packages/less/benchmark/benchmark-runner.js b/packages/less/benchmark/benchmark-runner.js new file mode 100644 index 000000000..1301d66bc --- /dev/null +++ b/packages/less/benchmark/benchmark-runner.js @@ -0,0 +1,164 @@ +#!/usr/bin/env node +// Portable benchmark runner - dropped into each version's worktree +// Finds the Less compiler, compiles the given file N times, reports JSON results. +// +// Usage: node benchmark-runner.js [runs=30] [warmup=5] + +var fs = require('fs'); +var path = require('path'); + +var file = process.argv[2]; +var totalRuns = parseInt(process.argv[3]) || 30; +var warmupRuns = parseInt(process.argv[4]) || 5; + +if (!file) { + console.error('Usage: node benchmark-runner.js [runs] [warmup]'); + process.exit(1); +} + +// Find Less compiler - try multiple paths for different version eras +var less; +var lessPath = ''; +var tryPaths = [ + // v4.x monorepo (after build) + './packages/less', + // v3.x / v2.x (lib in repo) + '.', + './lib/less-node', + // Fallback + 'less' +]; + +for (var i = 0; i < tryPaths.length; i++) { + try { + var p = tryPaths[i]; + var mod = require(path.resolve(p)); + // Handle both direct export and .default (ESM interop) + less = mod && mod.default ? mod.default : mod; + if (less && (less.render || less.parse)) { + lessPath = p; + break; + } + less = null; + } catch (e) { + // try next + } +} + +if (!less) { + console.error(JSON.stringify({ error: 'Could not find Less compiler', tried: tryPaths })); + process.exit(2); +} + +// Determine version +var version = 'unknown'; +if (less.version) { + if (Array.isArray(less.version)) { + version = less.version.join('.'); + } else { + version = String(less.version); + } +} + +var filePath = path.resolve(file); +var data = fs.readFileSync(filePath, 'utf8'); +var fileDir = path.dirname(filePath); + +// Use less.render() - stable across all versions +var renderTimes = []; +var parseTimes = []; +var completed = 0; +var errors = []; + +function hrNow() { + var hr = process.hrtime(); + return hr[0] * 1000 + hr[1] / 1e6; +} + +function runOnce(callback) { + var start = hrNow(); + less.render(data, { + filename: filePath, + paths: [fileDir] + }, function (err, output) { + var end = hrNow(); + if (err) { + errors.push({ run: completed, error: err.message || String(err) }); + callback(err); + return; + } + renderTimes.push(end - start); + completed++; + callback(null); + }); +} + +function runAll(i) { + if (i >= totalRuns) { + reportResults(); + return; + } + runOnce(function (err) { + if (err && errors.length > 3) { + // Too many errors, bail + reportResults(); + return; + } + runAll(i + 1); + }); +} + +function analyze(times, skipWarmup) { + var start = skipWarmup ? warmupRuns : 0; + if (times.length <= start) return null; + var effective = times.slice(start); + var total = 0, min = Infinity, max = 0; + for (var i = 0; i < effective.length; i++) { + total += effective[i]; + min = Math.min(min, effective[i]); + max = Math.max(max, effective[i]); + } + var avg = total / effective.length; + var variance = ((max - min) / avg) * 100; + + // Median + var sorted = effective.slice().sort(function (a, b) { return a - b; }); + var mid = Math.floor(sorted.length / 2); + var median = sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2; + + // Standard deviation + var sumSqDiff = 0; + for (var i = 0; i < effective.length; i++) { + sumSqDiff += (effective[i] - avg) * (effective[i] - avg); + } + var stddev = Math.sqrt(sumSqDiff / effective.length); + + return { + min: Math.round(min * 100) / 100, + max: Math.round(max * 100) / 100, + avg: Math.round(avg * 100) / 100, + median: Math.round(median * 100) / 100, + stddev: Math.round(stddev * 100) / 100, + variance_pct: Math.round(variance * 100) / 100, + samples: effective.length, + throughput_kbs: Math.round(1000 / avg * data.length / 1024) + }; +} + +function reportResults() { + var result = { + version: version, + lessPath: lessPath, + file: path.basename(file), + fileSize: data.length, + fileSizeKB: Math.round(data.length / 1024 * 10) / 10, + totalRuns: totalRuns, + warmupRuns: warmupRuns, + completedRuns: completed, + errors: errors.length > 0 ? errors : undefined, + render: analyze(renderTimes, true) + }; + console.log(JSON.stringify(result)); +} + +runAll(0); diff --git a/packages/less/benchmark/benchmark-v3.less b/packages/less/benchmark/benchmark-v3.less new file mode 100644 index 000000000..c9ee33a63 --- /dev/null +++ b/packages/less/benchmark/benchmark-v3.less @@ -0,0 +1,134 @@ +// Benchmark for Less v3.0+ features: if(), boolean(), $prop accessor, @plugin +// This file is standalone and does NOT import the base benchmark. + +// --- if() function --- +@mode: dark; +@size: large; + +.if-card { + background: if((@mode = dark), #1a1a2e, #ffffff); + color: if((@mode = dark), #eaeaea, #333333); + font-size: if((@size = large), 18px, 14px); + padding: if((@size = large), 24px, 12px); + border: 1px solid if((@mode = dark), #444, #ddd); +} + +// if() in loops +.gen-if-variants(@n, @i: 1) when (@i =< @n) { + .variant-@{i} { + color: if((@i > 5), #ff0000, #0000ff); + font-weight: if((mod(@i, 2) = 0), bold, normal); + opacity: if((@i > 8), 0.5, 1); + display: if((@i = @n), none, block); + } + .gen-if-variants(@n, (@i + 1)); +} +.gen-if-variants(12); + +// --- boolean() function (added v3.6.0) --- +@is-dark: boolean(@mode = dark); +@is-large: boolean(@size = large); +@is-rtl: boolean(1 = 0); + +.boolean-test { + .responsive(@flag) when (@flag) { + max-width: 1200px; + margin: 0 auto; + } + .responsive(@flag) when not (@flag) { + width: 100%; + } + .responsive(@is-large); +} + +// --- Property accessor $prop --- +.color-definitions { + primary: #3498db; + secondary: #2ecc71; + accent: #e74c3c; + neutral: #95a5a6; + warning: #f39c12; +} + +.prop-button { + color: .color-definitions[primary]; + border-color: .color-definitions[secondary]; +} + +.prop-alert-success { + background: .color-definitions[secondary]; + border-color: darken(.color-definitions[secondary], 10%); +} + +.prop-alert-danger { + background: .color-definitions[accent]; + border-color: darken(.color-definitions[accent], 10%); +} + +.prop-alert-warning { + background: .color-definitions[warning]; + border-color: darken(.color-definitions[warning], 10%); +} + +// Spacing scale via property accessor +.spacing-scale { + xs: 4px; + sm: 8px; + md: 16px; + lg: 24px; + xl: 32px; + xxl: 48px; +} + +.card-compact { + padding: .spacing-scale[sm]; + margin: .spacing-scale[xs]; +} +.card-normal { + padding: .spacing-scale[md]; + margin: .spacing-scale[sm]; +} +.card-spacious { + padding: .spacing-scale[xl]; + margin: .spacing-scale[lg]; +} + +// --- Complex guard + if combos --- +.button-variant(@bg, @border: darken(@bg, 10%), @color: #fff) { + background: @bg; + border-color: @border; + color: if((lightness(@bg) > 60%), #333, @color); + &:hover { + background: darken(@bg, 8%); + border-color: darken(@border, 12%); + } + &:active { + background: darken(@bg, 12%); + } +} + +.btn-primary { .button-variant(#3498db); } +.btn-success { .button-variant(#2ecc71); } +.btn-warning { .button-variant(#f1c40f); } +.btn-danger { .button-variant(#e74c3c); } +.btn-light { .button-variant(#f8f9fa); } +.btn-dark { .button-variant(#343a40); } + +// --- Stress: many property lookups in a loop --- +.z-index-scale { + dropdown: 1000; + sticky: 1020; + fixed: 1030; + modal-backdrop: 1040; + modal: 1050; + popover: 1060; + tooltip: 1070; +} + +.dropdown { z-index: .z-index-scale[dropdown]; } +.sticky-top { z-index: .z-index-scale[sticky]; } +.fixed-top { z-index: .z-index-scale[fixed]; } +.modal-backdrop { z-index: .z-index-scale[modal-backdrop]; } +.modal { z-index: .z-index-scale[modal]; } +.popover { z-index: .z-index-scale[popover]; } +.tooltip { z-index: .z-index-scale[tooltip]; } diff --git a/packages/less/benchmark/benchmark-v37.less b/packages/less/benchmark/benchmark-v37.less new file mode 100644 index 000000000..a0db9ec9f --- /dev/null +++ b/packages/less/benchmark/benchmark-v37.less @@ -0,0 +1,108 @@ +// Benchmark for Less v3.7+ features: each() +// Standalone file. + +// --- each() with lists --- +@breakpoints: xs, sm, md, lg, xl; + +each(@breakpoints, { + .container-@{value} { + max-width: if((@value = xs), 100%, if((@value = sm), 540px, if((@value = md), 720px, if((@value = lg), 960px, 1140px)))); + margin: 0 auto; + padding: 0 15px; + } +}); + +// --- each() with maps --- +@colors: { + primary: #3498db; + secondary: #2ecc71; + success: #27ae60; + danger: #e74c3c; + warning: #f39c12; + info: #17a2b8; + light: #f8f9fa; + dark: #343a40; +}; + +each(@colors, { + .text-@{key} { color: @value; } + .bg-@{key} { background-color: @value; } + .border-@{key} { border-color: @value; } + .btn-@{key} { + background: @value; + border: 1px solid darken(@value, 10%); + color: if((lightness(@value) > 60%), #333, #fff); + &:hover { + background: darken(@value, 8%); + } + } +}); + +// --- each() generating utility classes --- +@spacings: { + 0: 0; + 1: 4px; + 2: 8px; + 3: 16px; + 4: 24px; + 5: 32px; +}; + +@directions: top, right, bottom, left; + +each(@spacings, .(@size, @key) { + each(@directions, .(@dir) { + .m@{dir}-@{key} { + margin-@{dir}: @size; + } + .p@{dir}-@{key} { + padding-@{dir}: @size; + } + }); +}); + +// --- each() with display properties --- +@displays: block, inline, inline-block, flex, inline-flex, grid, none; + +each(@displays, { + .d-@{value} { display: @value; } +}); + +// --- each() generating component sizes --- +@sm-font: 12px; @sm-pad: 4px 8px; @sm-radius: 2px; +@md-font: 14px; @md-pad: 8px 16px; @md-radius: 4px; +@lg-font: 18px; @lg-pad: 12px 24px; @lg-radius: 6px; +@component-size-names: sm, md, lg; + +each(@component-size-names, { + .input-@{value} { + border: 1px solid #ccc; + line-height: 1.5; + } + .badge-@{value} { + display: inline-block; + } +}); + +// --- each() with float utilities --- +@positions: static, relative, absolute, fixed, sticky; +each(@positions, { + .position-@{value} { position: @value; } +}); + +// --- Nested each() stress --- +@font-weights: 100, 200, 300, 400, 500, 600, 700, 800, 900; +each(@font-weights, { + .fw-@{value} { font-weight: @value; } +}); + +@opacities: { + 0: 0; + 25: 0.25; + 50: 0.5; + 75: 0.75; + 100: 1; +}; +each(@opacities, .(@val, @key) { + .opacity-@{key} { opacity: @val; } +}); diff --git a/packages/less/benchmark/benchmark-v39.less b/packages/less/benchmark/benchmark-v39.less new file mode 100644 index 000000000..31e39ff69 --- /dev/null +++ b/packages/less/benchmark/benchmark-v39.less @@ -0,0 +1,84 @@ +// Benchmark for Less v3.9+ features: range() +// Standalone file. + +// --- range() basic --- +@columns: range(1, 12); + +each(@columns, { + .col-@{value} { + flex: 0 0 percentage(@value / 12); + max-width: percentage(@value / 12); + } +}); + +// --- range() for spacing scale --- +@spacing-steps: range(0, 20); + +each(@spacing-steps, { + .gap-@{value} { + gap: (@value * 4px); + } + .space-x-@{value} > * + * { + margin-left: (@value * 4px); + } + .space-y-@{value} > * + * { + margin-top: (@value * 4px); + } +}); + +// --- range() with step for font sizes --- +@font-sizes: range(10px, 48px, 2); + +each(@font-sizes, .(@size, @idx) { + .text-size-@{idx} { + font-size: @size; + line-height: @size * 1.5; + } +}); + +// --- range() for generating a color palette --- +@hue-steps: range(0, 350, 30); + +each(@hue-steps, .(@hue, @idx) { + .hue-@{idx} { + color: hsl(@hue, 70%, 50%); + background: hsl(@hue, 70%, 95%); + border-color: hsl(@hue, 70%, 80%); + } +}); + +// --- range() for grid system --- +@grid-cols: range(1, 24); + +each(@grid-cols, { + .grid-span-@{value} { + grid-column: span @value; + } +}); + +// --- range() for z-index layers --- +@layers: range(1, 10); + +each(@layers, { + .z-@{value} { + z-index: @value * 100; + } +}); + +// --- range() for opacity scale --- +@opacity-steps: range(0, 100, 5); + +each(@opacity-steps, .(@val) { + .o-@{val} { + opacity: @val / 100; + } +}); + +// --- range() for border-radius scale --- +@radius-steps: range(0, 24, 2); + +each(@radius-steps, .(@val) { + .rounded-@{val} { + border-radius: (@val * 1px); + } +}); diff --git a/packages/less/benchmark/benchmark.less b/packages/less/benchmark/benchmark.less index 997720578..1943a5e8e 100644 --- a/packages/less/benchmark/benchmark.less +++ b/packages/less/benchmark/benchmark.less @@ -3978,5 +3978,470 @@ body { left: 1; } -// add extend -.btn:extend(.button all) {} \ No newline at end of file +// ============================================================================ +// v2.0+ Features: Extend, Guards, Imports, Property Merging, Detached Rulesets +// ============================================================================ + +// --- Imports --- +@import "benchmark-import-target.less"; +@import (reference) "benchmark-import-reference-target.less"; + +// --- Extend --- +// Basic extend +.base-button { + display: inline-block; + padding: 8px 16px; + border: 1px solid #ccc; + border-radius: 4px; + cursor: pointer; + font-size: 14px; + text-align: center; +} + +.action-button:extend(.base-button) { + background: #3498db; + color: #fff; +} + +.cancel-button:extend(.base-button) { + background: #e74c3c; + color: #fff; +} + +// Extend all +.nav-base { + list-style: none; + padding: 0; + margin: 0; + li { + display: inline-block; + a { + text-decoration: none; + padding: 8px 12px; + color: #333; + } + } +} + +.main-nav:extend(.nav-base all) { + background: #f8f9fa; + border-bottom: 1px solid #dee2e6; +} + +.side-nav:extend(.nav-base all) { + background: #343a40; + li a { + color: #fff; + } +} + +// Extend from imported reference +.my-button:extend(.ref-button) {} +.my-primary-button:extend(.ref-button all) {} +.my-alert:extend(.ref-alert all) {} +.my-grid:extend(.ref-grid-system all) {} + +// Nested extend +.panel { + border: 1px solid #ddd; + border-radius: 4px; + .panel-heading { + padding: 10px 15px; + background: #f5f5f5; + border-bottom: 1px solid #ddd; + } + .panel-body { + padding: 15px; + } + .panel-footer { + padding: 10px 15px; + background: #f5f5f5; + border-top: 1px solid #ddd; + } +} + +.card { + &:extend(.panel all); + box-shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +.widget { + &:extend(.panel all); + margin-bottom: 20px; +} + +// Extend with pseudo-classes +.link-base { + color: #3498db; + text-decoration: none; + &:hover { + color: #2980b9; + text-decoration: underline; + } + &:visited { + color: #8e44ad; + } + &:active { + color: #e74c3c; + } +} + +.nav-link:extend(.link-base all) { + font-weight: bold; +} + +// --- Guards --- +.generate-spacing(@n, @i: 1) when (@i =< @n) { + .m-@{i} { margin: (@i * 4px); } + .p-@{i} { padding: (@i * 4px); } + .mt-@{i} { margin-top: (@i * 4px); } + .mb-@{i} { margin-bottom: (@i * 4px); } + .ml-@{i} { margin-left: (@i * 4px); } + .mr-@{i} { margin-right: (@i * 4px); } + .pt-@{i} { padding-top: (@i * 4px); } + .pb-@{i} { padding-bottom: (@i * 4px); } + .pl-@{i} { padding-left: (@i * 4px); } + .pr-@{i} { padding-right: (@i * 4px); } + .generate-spacing(@n, (@i + 1)); +} +.generate-spacing(10); + +.generate-font-sizes(@n, @i: 1) when (@i =< @n) { + .fs-@{i} { font-size: (10px + @i * 2); } + .generate-font-sizes(@n, (@i + 1)); +} +.generate-font-sizes(12); + +.generate-widths(@n, @i: 1) when (@i =< @n) { + .w-@{i} { width: percentage(@i / @n); } + .generate-widths(@n, (@i + 1)); +} +.generate-widths(12); + +// Guards with multiple conditions +.responsive-mixin(@size) when (@size < 576px) { + font-size: 12px; + padding: 4px; +} +.responsive-mixin(@size) when (@size >= 576px) and (@size < 768px) { + font-size: 14px; + padding: 8px; +} +.responsive-mixin(@size) when (@size >= 768px) and (@size < 992px) { + font-size: 16px; + padding: 12px; +} +.responsive-mixin(@size) when (@size >= 992px) { + font-size: 18px; + padding: 16px; +} + +.sm { .responsive-mixin(400px); } +.md { .responsive-mixin(700px); } +.lg { .responsive-mixin(800px); } +.xl { .responsive-mixin(1200px); } + +// Type-checking guards +.type-guard(@val) when (isnumber(@val)) { + width: @val; +} +.type-guard(@val) when (iscolor(@val)) { + color: @val; +} +.type-guard(@val) when (isstring(@val)) { + content: @val; +} + +.guard-number { .type-guard(100px); } +.guard-color { .type-guard(#ff0000); } +.guard-string { .type-guard("hello"); } + +// --- Property Merging --- +.shadow-base { + box-shadow+: 0 1px 3px rgba(0,0,0,0.12); +} +.shadow-elevated { + .shadow-base(); + box-shadow+: 0 4px 6px rgba(0,0,0,0.1); +} +.shadow-floating { + .shadow-elevated(); + box-shadow+: 0 10px 20px rgba(0,0,0,0.15); +} + +.transform-base { + transform+_: translateX(10px); +} +.transform-combo { + .transform-base(); + transform+_: rotate(45deg); + transform+_: scale(1.2); +} + +.transition-multi { + transition+: color 0.3s ease; + transition+: background 0.3s ease; + transition+: border-color 0.3s ease; + transition+: box-shadow 0.3s ease; +} + +.font-stack { + font-family+: "Helvetica Neue"; + font-family+: Arial; + font-family+: sans-serif; +} + +// --- Detached Rulesets --- +@media-mobile: { + font-size: 14px; + padding: 8px; + margin: 4px; +}; + +@media-desktop: { + font-size: 16px; + padding: 16px; + margin: 8px; +}; + +@theme-light: { + background: #ffffff; + color: #333333; + border-color: #dddddd; +}; + +@theme-dark: { + background: #1a1a2e; + color: #eaeaea; + border-color: #444444; +}; + +.mobile-component { + @media-mobile(); + border: 1px solid #ccc; +} + +.desktop-component { + @media-desktop(); + border: 1px solid #999; +} + +.light-section { + @theme-light(); + .heading { font-weight: bold; } +} + +.dark-section { + @theme-dark(); + .heading { font-weight: bold; } +} + +// Detached rulesets passed as arguments +.apply-theme(@theme) { + @theme(); + padding: 20px; + border-radius: 8px; +} + +.themed-card-light { + .apply-theme(@theme-light); +} +.themed-card-dark { + .apply-theme(@theme-dark); +} + +// --- Complex Nesting & Selectors --- +.component { + display: block; + & + & { margin-top: 16px; } + & > &-inner { padding: 8px; } + &&-active { background: #e8f4fd; } + &-header, &-footer { padding: 12px; } + &-body { + padding: 16px; + &--large { padding: 24px; } + &--compact { padding: 8px; } + } +} + +// --- Color Functions Stress --- +@base-hue: 210; +.color-gen(@i) when (@i > 0) { + .color-@{i} { + color: hsl(@base-hue, percentage(@i / 20), 50%); + background: lighten(hsl(@base-hue, 80%, 50%), @i * 2%); + border-color: darken(hsl(@base-hue, 80%, 50%), @i * 2%); + outline-color: spin(hsl(@base-hue, 80%, 50%), @i * 15); + text-shadow: 0 1px 0 fade(#000, @i * 5%); + box-shadow: 0 0 (@i * 1px) saturate(hsl(@base-hue, 50%, 50%), @i * 3%); + } + .color-gen((@i - 1)); +} +.color-gen(20); + +// --- String Interpolation & Escaping --- +@base-url: "/assets/images"; +@icon-prefix: "icon"; +.generate-icons(@n, @i: 1) when (@i =< @n) { + .@{icon-prefix}-@{i} { + background-image: url("@{base-url}/@{icon-prefix}-@{i}.svg"); + width: (16px + @i * 2); + height: (16px + @i * 2); + } + .generate-icons(@n, (@i + 1)); +} +.generate-icons(20); + +// --- Namespaces --- +#util { + .clearfix() { + &::after { + content: ""; + display: table; + clear: both; + } + } + .ellipsis() { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .visually-hidden() { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; + } + .center-block() { + display: block; + margin-left: auto; + margin-right: auto; + } +} + +.container { #util > .clearfix(); } +.title { #util > .ellipsis(); } +.sr-only { #util > .visually-hidden(); } +.image { #util > .center-block(); } + +// --- Math & Unit Functions --- +.math-stress { + a: ceil(4.3px); + b: floor(4.7px); + c: round(4.567px, 2); + d: percentage(0.5); + e: sqrt(25px); + f: abs(-18px); + g: min(3px, 42px, 1px, 16px); + h: max(3px, 42px, 1px, 16px); + i: mod(11px, 3); + j: convert(1s, ms); + k: unit(5em, px); + l: unit(100px); +} + +// --- Large Loop Stress (recursive mixin) --- +.gen-grid(@cols, @i: 1) when (@i =< @cols) { + .grid-col-@{i}-of-@{cols} { + width: percentage(@i / @cols); + float: left; + padding: 0 15px; + box-sizing: border-box; + } + .grid-push-@{i}-of-@{cols} { + margin-left: percentage(@i / @cols); + } + .grid-pull-@{i}-of-@{cols} { + margin-right: percentage(@i / @cols); + } + .grid-offset-@{i}-of-@{cols} { + margin-left: percentage(@i / @cols); + } + .gen-grid(@cols, (@i + 1)); +} +.gen-grid(24); + +// --- Deeply Nested Extend Chains --- +.typography-base { + font-family: sans-serif; + line-height: 1.6; +} +.heading-base:extend(.typography-base) { + font-weight: bold; + margin-bottom: 0.5em; +} +h1:extend(.heading-base) { font-size: 2.5em; } +h2:extend(.heading-base) { font-size: 2em; } +h3:extend(.heading-base) { font-size: 1.75em; } +h4:extend(.heading-base) { font-size: 1.5em; } +h5:extend(.heading-base) { font-size: 1.25em; } +h6:extend(.heading-base) { font-size: 1em; } + +.prose { + h1:extend(h1) {} + h2:extend(h2) {} + h3:extend(h3) {} + p:extend(.typography-base) { + margin-bottom: 1em; + } +} + +// --- Mixin with Variable Argument Lists --- +.multi-bg(@bgs...) { + background: @bgs; +} +.hero-section { + .multi-bg( + linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), + url("/images/hero.jpg") center/cover no-repeat + ); + min-height: 400px; +} + +// --- Scope & Variable Hoisting Stress --- +.scope-outer { + @var: outer; + .scope-inner { + @var: inner; + .scope-deepest { + content: @var; + @var: deepest; + } + content: @var; + } + content: @var; +} + +// --- Guard + Extend Combo --- +.status-mixin(@type) when (@type = success) { + color: #155724; + background-color: #d4edda; + border-color: #c3e6cb; +} +.status-mixin(@type) when (@type = warning) { + color: #856404; + background-color: #fff3cd; + border-color: #ffeeba; +} +.status-mixin(@type) when (@type = danger) { + color: #721c24; + background-color: #f8d7da; + border-color: #f5c6cb; +} +.status-mixin(@type) when (@type = info) { + color: #0c5460; + background-color: #d1ecf1; + border-color: #bee5eb; +} +.alert-success { .status-mixin(success); } +.alert-warning { .status-mixin(warning); } +.alert-danger { .status-mixin(danger); } +.alert-info { .status-mixin(info); } +.toast-success:extend(.alert-success all) {} +.toast-warning:extend(.alert-warning all) {} +.toast-danger:extend(.alert-danger all) {} +.toast-info:extend(.alert-info all) {} \ No newline at end of file diff --git a/packages/less/benchmark/results/.gitignore b/packages/less/benchmark/results/.gitignore new file mode 100644 index 000000000..4f5132387 --- /dev/null +++ b/packages/less/benchmark/results/.gitignore @@ -0,0 +1,8 @@ +# Track latest results per system, but not every historical run +# To include a specific run, use: git add -f runs/specific-file.json +runs/ + +# Legacy flat files (migrated to runs/ + latest/) +system-info.json +benchmark-results.json +v*.json diff --git a/packages/less/benchmark/results/latest/macbook-pro_arm64.json b/packages/less/benchmark/results/latest/macbook-pro_arm64.json new file mode 100644 index 000000000..f83bbf45d --- /dev/null +++ b/packages/less/benchmark/results/latest/macbook-pro_arm64.json @@ -0,0 +1,536 @@ +{ + "system": { + "hostname": "MacBook-Pro.local", + "platform": "Darwin", + "arch": "arm64", + "os_version": "25.3.0", + "cpus": "14", + "cpu_model": "Apple M4 Pro", + "total_memory_gb": 48.0, + "node_version": "v24.11.1", + "date": "2026-03-09T18:54:01Z", + "system_id": "macbook-pro_arm64" + }, + "versions": [ + { + "tag": "v3.5.0", + "version": "3.5.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:04Z", + "benchmarks": { + "benchmark.less": { + "version": "3.5.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 32.57, + "max": 50.01, + "avg": 38.55, + "median": 37.68, + "stddev": 3.96, + "variance_pct": 45.24, + "samples": 25, + "throughput_kbs": 2703 + } + } + } + }, + { + "tag": "v3.6.0", + "version": "3.6.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:10Z", + "benchmarks": { + "benchmark.less": { + "version": "3.6.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 32.58, + "max": 44.99, + "avg": 36.81, + "median": 36.45, + "stddev": 3.29, + "variance_pct": 33.71, + "samples": 25, + "throughput_kbs": 2831 + } + }, + "benchmark-v3.less": { + "version": "3.6.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.41, + "max": 10.1, + "avg": 2.61, + "median": 1.97, + "stddev": 1.74, + "variance_pct": 333.37, + "samples": 25, + "throughput_kbs": 1213 + } + } + } + }, + { + "tag": "v3.7.0", + "version": "3.7.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:15Z", + "benchmarks": { + "benchmark.less": { + "version": "3.7.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 35.95, + "max": 46.06, + "avg": 39.24, + "median": 38.01, + "stddev": 2.69, + "variance_pct": 25.77, + "samples": 25, + "throughput_kbs": 2656 + } + }, + "benchmark-v3.less": { + "version": "3.7.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.31, + "max": 9.52, + "avg": 2.63, + "median": 2.15, + "stddev": 1.69, + "variance_pct": 311.76, + "samples": 25, + "throughput_kbs": 1201 + } + }, + "benchmark-v37.less": { + "version": "3.7.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.18, + "max": 8.96, + "avg": 2.67, + "median": 1.95, + "stddev": 1.72, + "variance_pct": 291.4, + "samples": 25, + "throughput_kbs": 831 + } + } + } + }, + { + "tag": "v3.8.0", + "version": "3.8.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:21Z", + "benchmarks": { + "benchmark.less": { + "version": "3.8.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 36.69, + "max": 45.5, + "avg": 39.95, + "median": 39.1, + "stddev": 2.52, + "variance_pct": 22.05, + "samples": 25, + "throughput_kbs": 2609 + } + }, + "benchmark-v3.less": { + "version": "3.8.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.49, + "max": 8.69, + "avg": 2.64, + "median": 2.09, + "stddev": 1.53, + "variance_pct": 273.14, + "samples": 25, + "throughput_kbs": 1200 + } + }, + "benchmark-v37.less": { + "version": "3.8.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.18, + "max": 7.68, + "avg": 2.58, + "median": 1.91, + "stddev": 1.45, + "variance_pct": 252.07, + "samples": 25, + "throughput_kbs": 860 + } + } + } + }, + { + "tag": "v3.9.0", + "version": "3.9.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:33Z", + "benchmarks": { + "benchmark.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 32.62, + "max": 47.69, + "avg": 40.2, + "median": 39.67, + "stddev": 3.89, + "variance_pct": 37.47, + "samples": 25, + "throughput_kbs": 2592 + } + }, + "benchmark-v3.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.49, + "max": 8.91, + "avg": 2.56, + "median": 1.95, + "stddev": 1.55, + "variance_pct": 289.49, + "samples": 25, + "throughput_kbs": 1233 + } + }, + "benchmark-v37.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.2, + "max": 9.29, + "avg": 2.63, + "median": 2.03, + "stddev": 1.68, + "variance_pct": 307.32, + "samples": 25, + "throughput_kbs": 842 + } + }, + "benchmark-v39.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1554, + "fileSizeKB": 1.5, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.33, + "max": 11.52, + "avg": 3.12, + "median": 2.18, + "stddev": 2.18, + "variance_pct": 326.59, + "samples": 25, + "throughput_kbs": 486 + } + } + } + }, + { + "tag": "v3.10.0", + "version": "3.10.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:44Z", + "benchmarks": { + "benchmark.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 103.26, + "max": 176.43, + "avg": 125.98, + "median": 125.46, + "stddev": 15.69, + "variance_pct": 58.08, + "samples": 25, + "throughput_kbs": 827 + } + }, + "benchmark-v3.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 2.67, + "max": 8.79, + "avg": 4.63, + "median": 4.18, + "stddev": 1.6, + "variance_pct": 132.21, + "samples": 25, + "throughput_kbs": 683 + } + }, + "benchmark-v37.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 3.31, + "max": 19.77, + "avg": 5.42, + "median": 4.64, + "stddev": 3.33, + "variance_pct": 303.98, + "samples": 25, + "throughput_kbs": 409 + } + }, + "benchmark-v39.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1554, + "fileSizeKB": 1.5, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 4.5, + "max": 21.31, + "avg": 7.16, + "median": 6.55, + "stddev": 3.01, + "variance_pct": 234.62, + "samples": 25, + "throughput_kbs": 212 + } + } + } + }, + { + "tag": "v3.11.0", + "version": "3.11.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:56Z", + "benchmarks": { + "benchmark.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 104.12, + "max": 154.95, + "avg": 122.9, + "median": 119.99, + "stddev": 12.94, + "variance_pct": 41.36, + "samples": 25, + "throughput_kbs": 848 + } + }, + "benchmark-v3.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 2.84, + "max": 9.74, + "avg": 4.69, + "median": 4.33, + "stddev": 1.66, + "variance_pct": 146.96, + "samples": 25, + "throughput_kbs": 673 + } + }, + "benchmark-v37.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 3.29, + "max": 14.99, + "avg": 5.88, + "median": 5.08, + "stddev": 2.63, + "variance_pct": 198.81, + "samples": 25, + "throughput_kbs": 377 + } + }, + "benchmark-v39.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1554, + "fileSizeKB": 1.5, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 9.79, + "max": 22.26, + "avg": 11.71, + "median": 11.12, + "stddev": 2.4, + "variance_pct": 106.47, + "samples": 25, + "throughput_kbs": 130 + } + } + } + }, + { + "tag": "v4.2.0", + "version": "4.2.0", + "node_version": "v20.19.6", + "date": "2026-03-09T18:55:29Z", + "benchmarks": { + "benchmark.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + }, + "benchmark-v3.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + }, + "benchmark-v37.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + }, + "benchmark-v39.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + } + } + } + ] +} \ No newline at end of file diff --git a/packages/less/benchmark/run-historical.sh b/packages/less/benchmark/run-historical.sh new file mode 100755 index 000000000..ce99d5381 --- /dev/null +++ b/packages/less/benchmark/run-historical.sh @@ -0,0 +1,373 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Historical Less Benchmark Runner +# Benchmarks every major/minor Less release from v2.0.0 through v4.4.x +# Uses git worktrees for isolation, fnm for Node version management. +# +# Usage: ./run-historical.sh [--versions "v2.0.0 v3.0.0 ..."] [--runs 30] [--warmup 5] +# +# Results are saved to benchmark/results/ + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" +RESULTS_DIR="$SCRIPT_DIR/results" +RUNS_DIR="$RESULTS_DIR/runs" +LATEST_DIR="$RESULTS_DIR/latest" +WORKTREE_BASE="/tmp/less-bench-worktrees" +BENCHMARK_DIR="$SCRIPT_DIR" + +RUNS=30 +WARMUP=5 +NODE_FOR_OLD="v18.20.8" # v2.x/v3.x +NODE_FOR_NEW="v20.19.6" # v4.x +NODE_DEFAULT="" # will be set to current + +# All major/minor releases (no patches, no betas/RCs) +ALL_VERSIONS=( + v2.0.0 v2.1.0 v2.2.0 v2.3.0 v2.4.0 v2.5.0 v2.6.0 v2.7.0 + v3.0.0 v3.5.0 v3.6.0 v3.7.0 v3.8.0 v3.9.0 v3.10.0 v3.11.0 v3.12.0 v3.13.0 + v4.0.0 v4.1.0 v4.2.0 v4.3.0 v4.4.0 +) + +VERSIONS=("${ALL_VERSIONS[@]}") + +# Parse arguments +while [[ $# -gt 0 ]]; do + case $1 in + --versions) IFS=' ' read -ra VERSIONS <<< "$2"; shift 2 ;; + --runs) RUNS="$2"; shift 2 ;; + --warmup) WARMUP="$2"; shift 2 ;; + *) echo "Unknown option: $1"; exit 1 ;; + esac +done + +# Benchmark files and their minimum required versions (parallel arrays) +BENCH_FILE_NAMES=(benchmark.less benchmark-v3.less benchmark-v37.less benchmark-v39.less) +BENCH_FILE_MINVS=(2.0.0 3.6.0 3.7.0 3.9.0) + +# ----- Helpers ----- + +log() { echo "$(date '+%H:%M:%S') | $*"; } +err() { echo "$(date '+%H:%M:%S') | ERROR: $*" >&2; } + +version_ge() { + # Returns 0 if $1 >= $2 (semantic version comparison) + printf '%s\n%s' "$2" "$1" | sort -V -C +} + +strip_v() { echo "${1#v}"; } + +pick_node_version() { + local ver="$1" + local major="${ver%%.*}" + if [[ "$major" -ge 4 ]]; then + echo "$NODE_FOR_NEW" + else + echo "$NODE_FOR_OLD" + fi +} + +use_node() { + local nv="$1" + if command -v fnm &>/dev/null; then + fnm install "$nv" &>/dev/null || true + eval "$(fnm env --shell bash)" + fnm use "$nv" &>/dev/null + fi +} + +restore_node() { + if [[ -n "$NODE_DEFAULT" ]] && command -v fnm &>/dev/null; then + eval "$(fnm env --shell bash)" + fnm use "$NODE_DEFAULT" &>/dev/null + fi +} + +is_monorepo() { + local tag="$1" + git -C "$REPO_ROOT" show "$tag:packages/less/package.json" &>/dev/null 2>&1 +} + +get_system_info() { + python3 -c " +import json, platform, subprocess, datetime, re + +def run(cmd): + try: + return subprocess.check_output(cmd, shell=True, stderr=subprocess.DEVNULL).decode().strip() + except: + return 'unknown' + +hostname = platform.node() +arch = platform.machine() + +# Generate a stable, filesystem-safe system ID +system_id = re.sub(r'[^a-zA-Z0-9_-]', '-', hostname.split('.')[0].lower()) + '_' + arch + +info = { + 'system_id': system_id, + 'hostname': hostname, + 'platform': platform.system(), + 'arch': arch, + 'os_version': platform.release(), + 'cpus': run('sysctl -n hw.ncpu') if platform.system() == 'Darwin' else run('nproc'), + 'cpu_model': run('sysctl -n machdep.cpu.brand_string') if platform.system() == 'Darwin' else run(\"grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2\").strip(), + 'total_memory_gb': round(int(run('sysctl -n hw.memsize') or '0') / 1073741824, 1) if platform.system() == 'Darwin' else 'unknown', + 'node_version': run('node -v'), + 'date': datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ') +} +print(json.dumps(info, indent=2)) +" +} + +# ----- Setup ----- + +mkdir -p "$RUNS_DIR" "$LATEST_DIR" "$WORKTREE_BASE" +NODE_DEFAULT="$(node -v)" + +# Record system info and derive system ID + run filename +log "Recording system info..." +SYSTEM_INFO_JSON="$(get_system_info)" +echo "$SYSTEM_INFO_JSON" + +SYSTEM_ID="$(echo "$SYSTEM_INFO_JSON" | python3 -c "import json,sys; print(json.load(sys.stdin)['system_id'])")" +RUN_DATE="$(date -u +%Y-%m-%d)" +RUN_FILE="$RUNS_DIR/${RUN_DATE}_${SYSTEM_ID}.json" +LATEST_FILE="$LATEST_DIR/${SYSTEM_ID}.json" + +log "System ID: $SYSTEM_ID" +log "Run file: $RUN_FILE" + +# Initialize the run file (system info + empty results array) +python3 -c " +import json, sys +system_info = json.loads(sys.argv[1]) +run_data = {'system': system_info, 'versions': []} +print(json.dumps(run_data, indent=2)) +" "$SYSTEM_INFO_JSON" > "$RUN_FILE" + +# ----- Main Loop ----- + +total=${#VERSIONS[@]} +idx=0 + +for tag in "${VERSIONS[@]}"; do + idx=$((idx + 1)) + ver="$(strip_v "$tag")" + log "===== [$idx/$total] Benchmarking $tag =====" + + WORKTREE="$WORKTREE_BASE/$tag" + + # Verify tag exists + if ! git -C "$REPO_ROOT" rev-parse "$tag" &>/dev/null; then + err "Tag $tag not found, skipping" + continue + fi + + # Select Node version + node_ver="$(pick_node_version "$ver")" + log "Using Node $node_ver for $tag" + use_node "$node_ver" + log "Active Node: $(node -v)" + + # Create worktree + if [[ -d "$WORKTREE" ]]; then + log "Cleaning existing worktree $WORKTREE" + git -C "$REPO_ROOT" worktree remove --force "$WORKTREE" 2>/dev/null || rm -rf "$WORKTREE" + fi + + log "Creating worktree for $tag..." + git -C "$REPO_ROOT" worktree add --detach "$WORKTREE" "$tag" 2>/dev/null + + # Install dependencies + log "Installing dependencies..." + pushd "$WORKTREE" > /dev/null + + LESS_DIR="" + BENCH_TARGET="" + + if is_monorepo "$tag"; then + # Monorepo era (v4.x) + LESS_DIR="$WORKTREE/packages/less" + BENCH_TARGET="$LESS_DIR/benchmark" + + # Try npm install at root first (for lerna bootstrap) + npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || true + + # Install in packages/less specifically + pushd "$LESS_DIR" > /dev/null + npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || true + + # Build TypeScript + log "Building TypeScript..." + if [[ -f "tsconfig.json" ]] || [[ -f "tsconfig.build.json" ]]; then + # Install typescript directly (npx tsc is intercepted by a placeholder package) + npm install typescript --no-save 2>/dev/null || true + TSC="./node_modules/.bin/tsc" + if [[ ! -x "$TSC" ]]; then + # Try parent node_modules + TSC="$WORKTREE/node_modules/.bin/tsc" + fi + $TSC -p tsconfig.build.json 2>/dev/null || $TSC -p tsconfig.json 2>/dev/null || { + err "TypeScript build failed for $tag, trying with skipLibCheck" + $TSC --skipLibCheck -p tsconfig.build.json 2>/dev/null || $TSC --skipLibCheck -p tsconfig.json 2>/dev/null || { + err "Build failed completely for $tag, skipping" + popd > /dev/null + popd > /dev/null + git -C "$REPO_ROOT" worktree remove --force "$WORKTREE" 2>/dev/null || true + continue + } + } + fi + popd > /dev/null + else + # Pre-monorepo (v2.x, v3.x) - lib/ is already in git + LESS_DIR="$WORKTREE" + BENCH_TARGET="$WORKTREE/benchmark" + npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || true + fi + popd > /dev/null + + # Copy benchmark files and runner into the worktree + mkdir -p "$BENCH_TARGET" + cp "$BENCHMARK_DIR/benchmark-runner.js" "$BENCH_TARGET/" + cp "$BENCHMARK_DIR/benchmark.less" "$BENCH_TARGET/" + cp "$BENCHMARK_DIR/benchmark-import-target.less" "$BENCH_TARGET/" + cp "$BENCHMARK_DIR/benchmark-import-reference-target.less" "$BENCH_TARGET/" + cp "$BENCHMARK_DIR/benchmark-v3.less" "$BENCH_TARGET/" 2>/dev/null || true + cp "$BENCHMARK_DIR/benchmark-v37.less" "$BENCH_TARGET/" 2>/dev/null || true + cp "$BENCHMARK_DIR/benchmark-v39.less" "$BENCH_TARGET/" 2>/dev/null || true + + # Run benchmarks for applicable files + CURRENT_NODE="$(node -v)" + CURRENT_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" + + # Initialize tag JSON via python for safety + tag_json=$(python3 -c " +import json +print(json.dumps({ + 'tag': '$tag', + 'version': '$ver', + 'node_version': '$CURRENT_NODE', + 'date': '$CURRENT_DATE', + 'benchmarks': {} +})) +") + + bench_count=${#BENCH_FILE_NAMES[@]} + for (( bi=0; bi= $min_ver)" + continue + fi + + bench_path="$BENCH_TARGET/$bench_file" + if [[ ! -f "$bench_path" ]]; then + log " Skipping $bench_file (file not found)" + continue + fi + + log " Running $bench_file ($RUNS runs, $WARMUP warmup)..." + + # Run from the Less package directory so require() finds the compiler + # Save result to temp file to avoid shell quoting issues + result_file=$(mktemp) + (cd "$LESS_DIR" && node "$BENCH_TARGET/benchmark-runner.js" "$bench_path" "$RUNS" "$WARMUP" > "$result_file" 2>&1) || true + + # Use python to safely merge results + tag_json=$(python3 -c " +import sys, json + +tag_data = json.loads(sys.stdin.read()) +bench_file = sys.argv[1] +result_file = sys.argv[2] + +try: + with open(result_file) as f: + result_str = f.read().strip() + result_data = json.loads(result_str) + tag_data['benchmarks'][bench_file] = result_data + print(json.dumps(tag_data)) +except (json.JSONDecodeError, Exception) as e: + tag_data['benchmarks'][bench_file] = {'error': str(e)[:500]} + print(json.dumps(tag_data)) +" "$bench_file" "$result_file" <<< "$tag_json") + + if python3 -c "import json; json.load(open('$result_file'))" 2>/dev/null; then + log " Done $bench_file" + else + err " $bench_file failed: $(head -5 "$result_file")" + fi + rm -f "$result_file" + done + + # Append version results to run file + python3 -c " +import json, sys + +tag_data = json.loads(sys.stdin.read()) +run_file = sys.argv[1] +with open(run_file) as f: + run_data = json.load(f) +run_data['versions'].append(tag_data) +with open(run_file, 'w') as f: + json.dump(run_data, f, indent=2) +" "$RUN_FILE" <<< "$tag_json" + log "Results appended to $RUN_FILE" + + # Clean up worktree + log "Cleaning up worktree..." + git -C "$REPO_ROOT" worktree remove --force "$WORKTREE" 2>/dev/null || rm -rf "$WORKTREE" + + log "===== Done $tag =====" + echo "" +done + +# Restore original Node version +restore_node + +# Copy to latest +cp "$RUN_FILE" "$LATEST_FILE" +log "Latest results: $LATEST_FILE" + +# Generate summary +log "Generating summary..." +python3 - "$RUN_FILE" << 'PYEOF' +import json, sys + +with open(sys.argv[1]) as f: + run_data = json.load(f) + +system = run_data.get('system', {}) +print("\n" + "=" * 80) +print("LESS HISTORICAL BENCHMARK SUMMARY") +print(f"System: {system.get('cpu_model', '?')} | {system.get('arch', '?')} | {system.get('total_memory_gb', '?')} GB") +print(f"Date: {system.get('date', '?')}") +print("=" * 80) +print(f"\n{'Version':<12} {'Node':<12} {'File':<25} {'Avg (ms)':<12} {'Median':<12} {'Min':<10} {'Max':<10} {'+-pct':<8} {'KB/s':<8}") +print("-" * 110) + +for entry in run_data.get('versions', []): + tag = entry.get('tag', '?') + node = entry.get('node_version', '?') + for bench_name, bench_data in entry.get('benchmarks', {}).items(): + if 'error' in bench_data: + print(f"{tag:<12} {node:<12} {bench_name:<25} {'ERROR':>10}") + continue + render = bench_data.get('render') + if not render: + print(f"{tag:<12} {node:<12} {bench_name:<25} {'NO DATA':>10}") + continue + print(f"{tag:<12} {node:<12} {bench_name:<25} {render['avg']:>10.1f} {render['median']:>10.1f} {render['min']:>8.1f} {render['max']:>8.1f} {render['variance_pct']:>6.1f}% {render.get('throughput_kbs', 0):>6}") + +print("\n" + "=" * 80) +PYEOF + +log "All benchmarks complete! Results in $RESULTS_DIR/" +log " - This run: $RUN_FILE" +log " - Latest: $LATEST_FILE" +log " - All runs: $RUNS_DIR/" From ab9a74b3c41b0cd9083310f1ac2cda6eee8d7324 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 12:38:24 -0700 Subject: [PATCH 06/76] fix(benchmark): don't path.resolve bare package names in benchmark-runner path.resolve('less') turns the package name into an absolute filesystem path, preventing Node's package resolution from finding npm-installed versions. Only resolve relative paths starting with '.'. --- packages/less/benchmark/benchmark-runner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/less/benchmark/benchmark-runner.js b/packages/less/benchmark/benchmark-runner.js index 1301d66bc..5fcb743ad 100644 --- a/packages/less/benchmark/benchmark-runner.js +++ b/packages/less/benchmark/benchmark-runner.js @@ -32,7 +32,8 @@ var tryPaths = [ for (var i = 0; i < tryPaths.length; i++) { try { var p = tryPaths[i]; - var mod = require(path.resolve(p)); + // Use path.resolve for relative paths, but keep bare package names for Node resolution + var mod = require(p.startsWith('.') ? path.resolve(p) : p); // Handle both direct export and .default (ESM interop) less = mod && mod.default ? mod.default : mod; if (less && (less.render || less.parse)) { From 28bc5234527c18efbfcc9207c9dfa6467898b357 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 12:39:37 -0700 Subject: [PATCH 07/76] fix(benchmark): use coefficient of variation instead of range for variance_pct variance_pct was computing (max-min)/avg which is range-over-mean. Now uses stddev/avg (coefficient of variation) which is a proper variability statistic. --- packages/less/benchmark/benchmark-runner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/less/benchmark/benchmark-runner.js b/packages/less/benchmark/benchmark-runner.js index 5fcb743ad..0e4585a8f 100644 --- a/packages/less/benchmark/benchmark-runner.js +++ b/packages/less/benchmark/benchmark-runner.js @@ -120,19 +120,19 @@ function analyze(times, skipWarmup) { max = Math.max(max, effective[i]); } var avg = total / effective.length; - var variance = ((max - min) / avg) * 100; // Median var sorted = effective.slice().sort(function (a, b) { return a - b; }); var mid = Math.floor(sorted.length / 2); var median = sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2; - // Standard deviation + // Standard deviation and coefficient of variation var sumSqDiff = 0; for (var i = 0; i < effective.length; i++) { sumSqDiff += (effective[i] - avg) * (effective[i] - avg); } var stddev = Math.sqrt(sumSqDiff / effective.length); + var variancePct = avg === 0 ? 0 : (stddev / avg) * 100; return { min: Math.round(min * 100) / 100, @@ -140,7 +140,7 @@ function analyze(times, skipWarmup) { avg: Math.round(avg * 100) / 100, median: Math.round(median * 100) / 100, stddev: Math.round(stddev * 100) / 100, - variance_pct: Math.round(variance * 100) / 100, + variance_pct: Math.round(variancePct * 100) / 100, samples: effective.length, throughput_kbs: Math.round(1000 / avg * data.length / 1024) }; From d2d2cd5f2d424d87890a24b027a2a610beec5155 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 12:42:09 -0700 Subject: [PATCH 08/76] fix(benchmark): use timestamp instead of date for run filenames Prevents same-day runs from overwriting each other in the runs/ archive. --- packages/less/benchmark/run-historical.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/less/benchmark/run-historical.sh b/packages/less/benchmark/run-historical.sh index ce99d5381..18c2aa085 100755 --- a/packages/less/benchmark/run-historical.sh +++ b/packages/less/benchmark/run-historical.sh @@ -132,8 +132,8 @@ SYSTEM_INFO_JSON="$(get_system_info)" echo "$SYSTEM_INFO_JSON" SYSTEM_ID="$(echo "$SYSTEM_INFO_JSON" | python3 -c "import json,sys; print(json.load(sys.stdin)['system_id'])")" -RUN_DATE="$(date -u +%Y-%m-%d)" -RUN_FILE="$RUNS_DIR/${RUN_DATE}_${SYSTEM_ID}.json" +RUN_STAMP="$(date -u +%Y-%m-%dT%H-%M-%SZ)" +RUN_FILE="$RUNS_DIR/${RUN_STAMP}_${SYSTEM_ID}.json" LATEST_FILE="$LATEST_DIR/${SYSTEM_ID}.json" log "System ID: $SYSTEM_ID" From 63c98ee0c3bf2eb1ed1c684dbfb1234720f94ed1 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 12:45:44 -0700 Subject: [PATCH 09/76] fix(cli): queue deprecation warnings until after arg parsing Deprecation warnings from flags like --js, --line-numbers, and --math=always were printed immediately during arg parsing, so --quiet-deprecations only worked if it appeared before the deprecated flag. Now all CLI deprecation messages are queued and flushed after parsing completes, respecting --silent, --quiet, and --quiet-deprecations regardless of flag order. --- packages/less/bin/lessc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/less/bin/lessc b/packages/less/bin/lessc index 166ad6975..93c5254a9 100755 --- a/packages/less/bin/lessc +++ b/packages/less/bin/lessc @@ -65,6 +65,7 @@ var parseVariableOption = function parseVariableOption(option, variables) { }; var sourceMapFileInline = false; +var pendingDeprecations = []; function printUsage() { less.lesscHelper.printUsage(); @@ -457,7 +458,7 @@ function processPluginQueue() { case 'js': options.javascriptEnabled = true; - console.warn('Warning: Inline JavaScript (--js) is deprecated and will be removed in Less 5.x. Use Less functions or custom plugins instead. (js-eval)'); + pendingDeprecations.push('Warning: Inline JavaScript (--js) is deprecated and will be removed in Less 5.x. Use Less functions or custom plugins instead. (js-eval)'); break; case 'no-js': @@ -481,7 +482,7 @@ function processPluginQueue() { case 'line-numbers': if (checkArgFunc(arg, match[2])) { options.dumpLineNumbers = match[2]; - console.warn('Warning: The --line-numbers option is deprecated and will be removed in Less 5.x. Use source maps instead (--source-map). (dump-line-numbers)'); + pendingDeprecations.push('Warning: The --line-numbers option is deprecated and will be removed in Less 5.x. Use source maps instead (--source-map). (dump-line-numbers)'); } break; @@ -540,11 +541,11 @@ function processPluginQueue() { break; case 'ie-compat': - console.warn('The --ie-compat option is deprecated, as it has no effect on compilation.'); + pendingDeprecations.push('Warning: The --ie-compat option is deprecated, as it has no effect on compilation.'); break; case 'relative-urls': - console.warn('The --relative-urls option has been deprecated. Use --rewrite-urls=all.'); + pendingDeprecations.push('Warning: The --relative-urls option has been deprecated. Use --rewrite-urls=all.'); options.rewriteUrls = Constants.RewriteUrls.ALL; break; @@ -572,7 +573,7 @@ function processPluginQueue() { case 'sm': case 'strict-math': - console.warn('The --strict-math option has been deprecated. Use --math=strict.'); + pendingDeprecations.push('Warning: The --strict-math option has been deprecated. Use --math=strict.'); if (checkArgFunc(arg, match[2])) { if (checkBooleanArg(match[2])) { @@ -587,14 +588,14 @@ function processPluginQueue() { let m = match[2]; if (checkArgFunc(arg, m)) { if (m === 'always') { - console.warn('Warning: --math=always is deprecated and will be removed in Less 5.x. Use --math=parens-division (default) or --math=parens. (math-always)'); + pendingDeprecations.push('Warning: --math=always is deprecated and will be removed in Less 5.x. Use --math=parens-division (default) or --math=parens. (math-always)'); options.math = Constants.Math.ALWAYS; } else if (m === 'parens-division') { options.math = Constants.Math.PARENS_DIVISION; } else if (m === 'parens' || m === 'strict') { options.math = Constants.Math.PARENS; } else if (m === 'strict-legacy') { - console.warn('--math=strict-legacy has been removed. Defaulting to --math=strict'); + pendingDeprecations.push('Warning: --math=strict-legacy has been removed. Defaulting to --math=strict.'); options.math = Constants.Math.PARENS; } } @@ -662,6 +663,13 @@ function processPluginQueue() { } }); + // Flush queued deprecation warnings (respects --silent, --quiet, --quiet-deprecations) + if (!silent && !quiet && !options.quietDeprecations) { + pendingDeprecations.forEach(function (msg) { + console.warn(msg); + }); + } + if (queuePlugins.length > 0) { processPluginQueue(); } else { From 90b0cb5f95713af9cd6e92b0757a25e56c780e94 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 9 Mar 2026 20:19:45 +0000 Subject: [PATCH 10/76] Remove duplicate length check from expression.genCSS() (#4327) Follows-up 53f84f02bad6e, which started the conditional with a check for `i + 1 < this.value.length`, which is the same as the parent block. --- packages/less/src/less/tree/expression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/less/src/less/tree/expression.js b/packages/less/src/less/tree/expression.js index c72f55b5b..e4d370555 100644 --- a/packages/less/src/less/tree/expression.js +++ b/packages/less/src/less/tree/expression.js @@ -59,7 +59,7 @@ Expression.prototype = Object.assign(new Node(), { for (let i = 0; i < this.value.length; i++) { this.value[i].genCSS(context, output); if (!this.noSpacing && i + 1 < this.value.length) { - if (i + 1 < this.value.length && !(this.value[i + 1] instanceof Anonymous) || + if (!(this.value[i + 1] instanceof Anonymous) || this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') { output.add(' '); } From b8c23aec0ad27ce759f8984b3c0db5008ec7715a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 9 Mar 2026 20:19:48 +0000 Subject: [PATCH 11/76] Remove unused `parsers.entities.propertyCurly()` (#4271) Follows-up a38f8a1eb7beed589d2fa734fcf411cf4461d231, which introduced this as part of implementing property accessors. The method was not used there, and hasn't been used elsewhere since then either. Ref https://github.com/less/less.js/pull/3163. --- packages/less/src/less/parser/parser.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index a61f14fea..0b8094531 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -697,15 +697,6 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } }, - // A property entity useing the protective {} e.g. ${prop} - propertyCurly: function () { - let curly; - const index = parserInput.i; - - if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) { - return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo); - } - }, // // A Hexadecimal color // From c4c41af19927c4b09e3668e2cc47aa268477daec Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 9 Mar 2026 20:19:52 +0000 Subject: [PATCH 12/76] Remove redundant return from `parsers.blockRuleset()` (#4265) --- packages/less/src/less/parser/parser.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 0b8094531..f9b565552 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -1529,11 +1529,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { blockRuleset: function() { let block = this.block(); - if (block) { - block = new tree.Ruleset(null, block); + return new tree.Ruleset(null, block); } - return block; }, detachedRuleset: function() { @@ -2661,4 +2659,4 @@ Parser.serializeVars = vars => { return s; }; -export default Parser; \ No newline at end of file +export default Parser; From 87bec519e73a105e7fdb742fd186910e6cebfb42 Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Mon, 9 Mar 2026 21:19:56 +0100 Subject: [PATCH 13/76] chore: replace deprecated String.prototype.substr() (#3702) .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- packages/less/src/less-node/plugin-loader.js | 2 +- packages/less/src/less/less-error.js | 6 +++--- packages/less/src/less/parser/parser-input.js | 14 +++++++------- packages/less/src/less/parser/parser.js | 10 +++++----- packages/less/src/less/tree/dimension.js | 2 +- packages/less/src/less/tree/namespace-value.js | 12 ++++++------ 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/less/src/less-node/plugin-loader.js b/packages/less/src/less-node/plugin-loader.js index e9be545b7..d4a0b1d0e 100644 --- a/packages/less/src/less-node/plugin-loader.js +++ b/packages/less/src/less-node/plugin-loader.js @@ -9,7 +9,7 @@ const PluginLoader = function(less) { this.require = prefix => { prefix = path.dirname(prefix); return id => { - const str = id.substr(0, 2); + const str = id.slice(0, 2); if (str === '..' || str === './') { return require(path.join(prefix, id)); } diff --git a/packages/less/src/less/less-error.js b/packages/less/src/less/less-error.js index c559c1a3e..ee08b3e31 100644 --- a/packages/less/src/less/less-error.js +++ b/packages/less/src/less/less-error.js @@ -54,7 +54,7 @@ const LessError = function(e, fileContentMap, currentFilename) { /** * We have to figure out how this environment stringifies anonymous functions * so we can correctly map plugin errors. - * + * * Note, in Node 8, the output of anonymous funcs varied based on parameters * being present or not, so we inject dummy params. */ @@ -133,7 +133,7 @@ LessError.prototype.toString = function(options) { let errorTxt = `${this.line} `; if (extract[1]) { errorTxt += extract[1].slice(0, this.column) + - stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') + + stylize(stylize(stylize(extract[1].slice(this.column, this.column + 1), 'bold') + extract[1].slice(this.column + 1), 'red'), 'inverse'); } error.push(errorTxt); @@ -163,4 +163,4 @@ LessError.prototype.toString = function(options) { return message; }; -export default LessError; \ No newline at end of file +export default LessError; diff --git a/packages/less/src/less/parser/parser-input.js b/packages/less/src/less/parser/parser-input.js index 4129daede..096ce3826 100644 --- a/packages/less/src/less/parser/parser-input.js +++ b/packages/less/src/less/parser/parser-input.js @@ -56,7 +56,7 @@ export default () => { nextNewLine = endIndex; } parserInput.i = nextNewLine; - comment.text = inp.substr(comment.index, parserInput.i - comment.index); + comment.text = inp.slice(comment.index, parserInput.i); parserInput.commentStore.push(comment); continue; } else if (nextChar === '*') { @@ -64,7 +64,7 @@ export default () => { if (nextStarSlash >= 0) { comment = { index: parserInput.i, - text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i), + text: inp.slice(parserInput.i, nextStarSlash + 2), isLineComment: false }; parserInput.i += comment.text.length - 1; @@ -188,7 +188,7 @@ export default () => { case '\n': break; case startChar: { - const str = input.substr(currentPosition, i + 1); + const str = input.slice(currentPosition, currentPosition + i + 1); if (!loc && loc !== 0) { skipWhitespace(i + 1); return str @@ -228,7 +228,7 @@ export default () => { do { let nextChar = input.charAt(i); if (blockDepth === 0 && testChar(nextChar)) { - returnVal = input.substr(lastPos, i - lastPos); + returnVal = input.slice(lastPos, i); if (returnVal) { parseGroups.push(returnVal); } @@ -240,7 +240,7 @@ export default () => { loop = false } else { if (inComment) { - if (nextChar === '*' && + if (nextChar === '*' && input.charAt(i + 1) === '/') { i++; blockDepth--; @@ -253,7 +253,7 @@ export default () => { case '\\': i++; nextChar = input.charAt(i); - parseGroups.push(input.substr(lastPos, i - lastPos + 1)); + parseGroups.push(input.slice(lastPos, i + 1)); lastPos = i + 1; break; case '/': @@ -267,7 +267,7 @@ export default () => { case '"': quote = parserInput.$quoted(i); if (quote) { - parseGroups.push(input.substr(lastPos, i - lastPos), quote); + parseGroups.push(input.slice(lastPos, i), quote); i += quote[1].length - 1; lastPos = i + 1; } diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index f9b565552..8c53c7a08 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -406,7 +406,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } parserInput.forget(); - return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo); + return new(tree.Quoted)(str.charAt(0), str.slice(1, -1), isEscaped, index + currentIndex, fileInfo); }, // @@ -788,7 +788,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (js) { warn('Inline JavaScript evaluation (backtick expressions) is deprecated and will be removed in Less 5.x. Use Less functions or custom plugins instead.', index, 'DEPRECATED', 'js-eval'); parserInput.forget(); - return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo); + return new(tree.JavaScript)(js.slice(0, -1), Boolean(escape), index + currentIndex, fileInfo); } parserInput.restore('invalid javascript definition'); } @@ -1901,7 +1901,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } if (parserInput.$char(')')) { if (p && !e) { - nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index))); + nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index))); e = p; } else if (p && e) { nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true))); @@ -1986,12 +1986,12 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (parserInput.$str('@media')) { return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions); } - + if (parserInput.$str('@container')) { return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions); } } - + parserInput.restore(); }, diff --git a/packages/less/src/less/tree/dimension.js b/packages/less/src/less/tree/dimension.js index 838bd10e9..2a8e61b82 100644 --- a/packages/less/src/less/tree/dimension.js +++ b/packages/less/src/less/tree/dimension.js @@ -56,7 +56,7 @@ Dimension.prototype = Object.assign(new Node(), { // Float values doesn't need a leading zero if (value > 0 && value < 1) { - strValue = (strValue).substr(1); + strValue = (strValue).slice(1); } } diff --git a/packages/less/src/less/tree/namespace-value.js b/packages/less/src/less/tree/namespace-value.js index fd96ef612..6a6fa46f0 100644 --- a/packages/less/src/less/tree/namespace-value.js +++ b/packages/less/src/less/tree/namespace-value.js @@ -15,7 +15,7 @@ NamespaceValue.prototype = Object.assign(new Node(), { eval(context) { let i, name, rules = this.value.eval(context); - + for (i = 0; i < this.lookups.length; i++) { name = this.lookups[i]; @@ -33,12 +33,12 @@ NamespaceValue.prototype = Object.assign(new Node(), { } else if (name.charAt(0) === '@') { if (name.charAt(1) === '@') { - name = `@${new Variable(name.substr(1)).eval(context).value}`; + name = `@${new Variable(name.slice(1)).eval(context).value}`; } if (rules.variables) { rules = rules.variable(name); } - + if (!rules) { throw { type: 'Name', message: `variable ${name} not found`, @@ -48,7 +48,7 @@ NamespaceValue.prototype = Object.assign(new Node(), { } else { if (name.substring(0, 2) === '$@') { - name = `$${new Variable(name.substr(1)).eval(context).value}`; + name = `$${new Variable(name.slice(1)).eval(context).value}`; } else { name = name.charAt(0) === '$' ? name : `$${name}`; @@ -56,10 +56,10 @@ NamespaceValue.prototype = Object.assign(new Node(), { if (rules.properties) { rules = rules.property(name); } - + if (!rules) { throw { type: 'Name', - message: `property "${name.substr(1)}" not found`, + message: `property "${name.slice(1)}" not found`, filename: this.fileInfo().filename, index: this.getIndex() }; } From 3f89d179ab6d3829423ff605c125a453505e0386 Mon Sep 17 00:00:00 2001 From: Memmie Lenglet Date: Mon, 9 Mar 2026 21:19:59 +0100 Subject: [PATCH 14/76] Handle the lack of the optional dependencies (#3791) * Handle optional dependencies * Handle optional dependency image-size --- packages/less/src/less-node/environment.js | 17 ++++++++++++++--- packages/less/src/less-node/image-size.js | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/less/src/less-node/environment.js b/packages/less/src/less-node/environment.js index a9b790c9b..630a4c2d0 100644 --- a/packages/less/src/less-node/environment.js +++ b/packages/less/src/less-node/environment.js @@ -1,3 +1,11 @@ +class SourceMapGeneratorFallback { + addMapping(){} + setSourceContent(){} + toJSON(){ + return null; + } +}; + export default { encodeBase64: function encodeBase64(str) { // Avoid Buffer constructor on newer versions of Node.js. @@ -5,12 +13,15 @@ export default { return buffer.toString('base64'); }, mimeLookup: function (filename) { - return require('mime').lookup(filename); + const mimeModule = require('mime'); + return mimeModule ? mimeModule.lookup(filename) : "application/octet-stream"; }, charsetLookup: function (mime) { - return require('mime').charsets.lookup(mime); + const mimeModule = require('mime'); + return mimeModule ? mimeModule.charsets.lookup(mime) : undefined; }, getSourceMapGenerator: function getSourceMapGenerator() { - return require('source-map').SourceMapGenerator; + const sourceMapModule = require('source-map'); + return sourceMapModule ? sourceMapModule.SourceMapGenerator : SourceMapGeneratorFallback; } }; diff --git a/packages/less/src/less-node/image-size.js b/packages/less/src/less-node/image-size.js index 888a7a136..c53edd62e 100644 --- a/packages/less/src/less-node/image-size.js +++ b/packages/less/src/less-node/image-size.js @@ -31,7 +31,7 @@ export default environment => { } const sizeOf = require('image-size'); - return sizeOf(fileSync.filename); + return sizeOf ? sizeOf(fileSync.filename) : {width: 0, height: 0}; } const imageFunctions = { From 489892b87799be6f5ad06183020d44f661b90a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Mon, 9 Mar 2026 21:20:03 +0100 Subject: [PATCH 15/76] remove phantom stuff (#3782) * remove phantom stuff * lint fix * use deep clone --- packages/less/src/less-browser/index.js | 48 +++++++++++-------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/packages/less/src/less-browser/index.js b/packages/less/src/less-browser/index.js index d2ab24a77..8529273eb 100644 --- a/packages/less/src/less-browser/index.js +++ b/packages/less/src/less-browser/index.js @@ -12,6 +12,10 @@ import ErrorReporting from './error-reporting'; import Cache from './cache'; import ImageSize from './image-size'; +/** + * @param {Window} window + * @param {Object} options + */ export default (window, options) => { const document = window.document; const less = lessRoot(); @@ -46,42 +50,32 @@ export default (window, options) => { return cloned; } - // only really needed for phantom - function bind(func, thisArg) { - const curryArgs = Array.prototype.slice.call(arguments, 2); - return function() { - const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0)); - return func.apply(thisArg, args); - }; - } - function loadStyles(modifyVars) { const styles = document.getElementsByTagName('style'); - let style; - for (let i = 0; i < styles.length; i++) { - style = styles[i]; + for (let style of styles) { if (style.type.match(typePattern)) { - const instanceOptions = clone(options); - instanceOptions.modifyVars = modifyVars; + const instanceOptions = { + ...clone(options), + modifyVars, + filename: document.location.href.replace(/#.*$/, '') + } + const lessText = style.innerHTML || ''; - instanceOptions.filename = document.location.href.replace(/#.*$/, ''); /* jshint loopfunc:true */ - // use closure to store current style - less.render(lessText, instanceOptions, - bind((style, e, result) => { - if (e) { - errors.add(e, 'inline'); + less.render(lessText, instanceOptions, (err, result) => { + if (err) { + errors.add(err, 'inline'); + } else { + style.type = 'text/css'; + if (style.styleSheet) { + style.styleSheet.cssText = result.css; } else { - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = result.css; - } else { - style.innerHTML = result.css; - } + style.innerHTML = result.css; } - }, null, style)); + } + }); } } } From b00ceddbf74ca27a1f7bdbf23fe9dbf5612e32ce Mon Sep 17 00:00:00 2001 From: Shahadat Hossain <71395891+HridoyHazard@users.noreply.github.com> Date: Tue, 10 Mar 2026 02:20:07 +0600 Subject: [PATCH 16/76] fixed bug in import subpath module (#4236) --- packages/less/src/less-node/file-manager.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/less/src/less-node/file-manager.js b/packages/less/src/less-node/file-manager.js index 5482c420f..9f8f3f476 100644 --- a/packages/less/src/less-node/file-manager.js +++ b/packages/less/src/less-node/file-manager.js @@ -85,7 +85,12 @@ FileManager.prototype = Object.assign(new AbstractFileManager(), { fullFilename = fileParts.rawPath + prefixes[j] + fileParts.filename; if (paths[i]) { - fullFilename = path.join(paths[i], fullFilename); + if (paths[i].startsWith('#')) { + // Handling paths starting with '#' + fullFilename = paths[i].substr(1) + fullFilename; + }else{ + fullFilename = path.join(paths[i], fullFilename); + } } if (!explicit && paths[i] === '.') { From f5b7ad83e7045aa7c56c6b3d6530c36d4ba08024 Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Mon, 9 Mar 2026 16:20:10 -0400 Subject: [PATCH 17/76] fix(issue#4354): unknown at-rule expression commas (#4389) * Fix issue less#4354 unknown at-rule expressions should not have commas in a keyword list. * Add some additional layer at-rule tests. --- packages/less/src/less/tree/atrule.js | 3 -- packages/test-data/tests-unit/layer/layer.css | 40 ++++++++++++++ .../test-data/tests-unit/layer/layer.less | 53 +++++++++++++++++++ .../tests-unit/tailwind/tailwind.css | 3 ++ .../tests-unit/tailwind/tailwind.less | 3 ++ 5 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 packages/test-data/tests-unit/tailwind/tailwind.css create mode 100644 packages/test-data/tests-unit/tailwind/tailwind.less diff --git a/packages/less/src/less/tree/atrule.js b/packages/less/src/less/tree/atrule.js index df36a5d87..15301f29b 100644 --- a/packages/less/src/less/tree/atrule.js +++ b/packages/less/src/less/tree/atrule.js @@ -135,9 +135,6 @@ AtRule.prototype = Object.assign(new Node(), { if (value) { value = value.eval(context); - if (value.value && this.keywordList(value.value)) { - value = new Anonymous(value.value.map(keyword => keyword.value).join(', '), this.getIndex(), this.fileInfo()); - } } if (rules) { diff --git a/packages/test-data/tests-unit/layer/layer.css b/packages/test-data/tests-unit/layer/layer.css index 7196325af..31e54d2bb 100644 --- a/packages/test-data/tests-unit/layer/layer.css +++ b/packages/test-data/tests-unit/layer/layer.css @@ -91,3 +91,43 @@ color: #555; } } +@layer theme; +@layer layout, utilities; +body { + color: black; +} +@layer components { + .btn { + color: red; + } + .btn:hover { + color: blue; + } +} +@layer { + p { + margin-block: 1rem; + } +} +@layer framework.buttons.primary { + .btn-primary { + background: dodgerblue; + color: white; + } +} +.feature { + color: gray; +} +@layer component { + .feature h2 { + font-size: 1.5rem; + } +} +@layer ui { + .btn { + padding: 0.5rem 1rem; + border-radius: 4px; + background: rebeccapurple; + color: white; + } +} diff --git a/packages/test-data/tests-unit/layer/layer.less b/packages/test-data/tests-unit/layer/layer.less index 71578f20b..3968227a5 100644 --- a/packages/test-data/tests-unit/layer/layer.less +++ b/packages/test-data/tests-unit/layer/layer.less @@ -112,3 +112,56 @@ } +@layer theme; +@layer layout, utilities; + +body { + color: black; +} + +@layer components { + .btn { + color: red; + &:hover { + color: blue; + } + } +} + +@layer { + p { + margin-block: 1rem; + } +} + +@layer framework.buttons.primary { + .btn-primary { + background: dodgerblue; + color: white; + } +} + +.feature { + color: gray; + + @layer component { + h2 { + font-size: 1.5rem; + } + } +} + +@primary-color: rebeccapurple; + +.button-styles() { + padding: 0.5rem 1rem; + border-radius: 4px; +} + +@layer ui { + .btn { + .button-styles(); + background: @primary-color; + color: white; + } +} diff --git a/packages/test-data/tests-unit/tailwind/tailwind.css b/packages/test-data/tests-unit/tailwind/tailwind.css new file mode 100644 index 000000000..499decb21 --- /dev/null +++ b/packages/test-data/tests-unit/tailwind/tailwind.css @@ -0,0 +1,3 @@ +.box { + @apply h-64 w-64; +} diff --git a/packages/test-data/tests-unit/tailwind/tailwind.less b/packages/test-data/tests-unit/tailwind/tailwind.less new file mode 100644 index 000000000..499decb21 --- /dev/null +++ b/packages/test-data/tests-unit/tailwind/tailwind.less @@ -0,0 +1,3 @@ +.box { + @apply h-64 w-64; +} From 774f188de6d9f75bb40b318d1bf93f705d00015c Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Mon, 9 Mar 2026 16:20:18 -0400 Subject: [PATCH 18/76] chore: update README.md copyright (#4386) * Update README.md copyright year. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e93bf0e4..863f072a6 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR ## [License](LICENSE) -Copyright (c) 2009-2017 [Alexis Sellier](http://cloudhead.io) & The Core Less Team +Copyright (c) 2009-2025 [Alexis Sellier](http://cloudhead.io) & The Core Less Team Licensed under the [Apache License](LICENSE). From 9c917145e28baa20137c77f6959d995b3f17bb16 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 13:48:23 -0700 Subject: [PATCH 19/76] Fix no-prototype-builtins issues in Ruleset and ToCSSVisitor (#4404) Co-authored-by: Timo Tijhof --- packages/less/src/less/tree/ruleset.js | 3 +-- .../less/src/less/visitors/to-css-visitor.js | 17 +++++++---------- .../test-data/tests-unit/rulesets/rulesets.css | 1 + .../test-data/tests-unit/rulesets/rulesets.less | 1 + 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/less/src/less/tree/ruleset.js b/packages/less/src/less/tree/ruleset.js index a3324cf07..f7aadd84b 100644 --- a/packages/less/src/less/tree/ruleset.js +++ b/packages/less/src/less/tree/ruleset.js @@ -295,8 +295,7 @@ Ruleset.prototype = Object.assign(new Node(), { if (r.type === 'Import' && r.root && r.root.variables) { const vars = r.root.variables(); for (const name in vars) { - // eslint-disable-next-line no-prototype-builtins - if (vars.hasOwnProperty(name)) { + if (Object.prototype.hasOwnProperty.call(vars, name)) { hash[name] = r.root.variable(name); } } diff --git a/packages/less/src/less/visitors/to-css-visitor.js b/packages/less/src/less/visitors/to-css-visitor.js index 54ddd6398..d1d200951 100644 --- a/packages/less/src/less/visitors/to-css-visitor.js +++ b/packages/less/src/less/visitors/to-css-visitor.js @@ -303,19 +303,16 @@ ToCSSVisitor.prototype = { // remove duplicates const ruleCache = {}; - let ruleList; - let rule; - let i; - - for (i = rules.length - 1; i >= 0 ; i--) { - rule = rules[i]; + for (let i = rules.length - 1; i >= 0 ; i--) { + let rule = rules[i]; if (rule instanceof tree.Declaration) { - if (!ruleCache[rule.name]) { + if (!Object.prototype.hasOwnProperty.call(ruleCache, rule.name)) { ruleCache[rule.name] = rule; } else { - ruleList = ruleCache[rule.name]; - if (ruleList instanceof tree.Declaration) { - ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)]; + let ruleList = ruleCache[rule.name]; + if (!Array.isArray(ruleList)) { + const prevRuleCSS = ruleList.toCSS(this._context); + ruleList = ruleCache[rule.name] = [prevRuleCSS]; } const ruleCSS = rule.toCSS(this._context); if (ruleList.indexOf(ruleCSS) !== -1) { diff --git a/packages/test-data/tests-unit/rulesets/rulesets.css b/packages/test-data/tests-unit/rulesets/rulesets.css index 408c76aad..5b5c285db 100644 --- a/packages/test-data/tests-unit/rulesets/rulesets.css +++ b/packages/test-data/tests-unit/rulesets/rulesets.css @@ -1,5 +1,6 @@ #first > .one { font-size: 2em; + hasOwnProperty: blue; } #first > .one > #second .two > #deux { width: 50%; diff --git a/packages/test-data/tests-unit/rulesets/rulesets.less b/packages/test-data/tests-unit/rulesets/rulesets.less index 49d623a71..f2742138a 100644 --- a/packages/test-data/tests-unit/rulesets/rulesets.less +++ b/packages/test-data/tests-unit/rulesets/rulesets.less @@ -28,4 +28,5 @@ } } font-size: 2em; + hasOwnProperty: blue; } From b9f67e7633369e6d6b770de790eb84a2f58c6014 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 13:48:27 -0700 Subject: [PATCH 20/76] chore: add test for number with underscore parsing (#4406) In Less.js 2.6.0, parsing of dimensions changed so that `5_large` is seen as one value, instead of as a list containing "5" and "_large". In updating the Less.php port, we forgot to consider this change because none of the Less.js 3.13 tests seem to cover this behavior. Follows-up https://github.com/less/less.js/pull/2485. This adds the test case from https://github.com/less/less.js/issues/2462, as inpired by downstream https://gerrit.wikimedia.org/r/1197310. Co-authored-by: Timo Tijhof --- packages/test-data/tests-unit/variables/variables.css | 3 +++ packages/test-data/tests-unit/variables/variables.less | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/packages/test-data/tests-unit/variables/variables.css b/packages/test-data/tests-unit/variables/variables.css index d39c88e17..7c1bff2af 100644 --- a/packages/test-data/tests-unit/variables/variables.css +++ b/packages/test-data/tests-unit/variables/variables.css @@ -41,3 +41,6 @@ .variable-pollution { a: 'no-pollution'; } +.icon-5_large { + background-image: url(/img/icon/5_large.svg); +} diff --git a/packages/test-data/tests-unit/variables/variables.less b/packages/test-data/tests-unit/variables/variables.less index 208abae65..61abf255d 100644 --- a/packages/test-data/tests-unit/variables/variables.less +++ b/packages/test-data/tests-unit/variables/variables.less @@ -85,3 +85,9 @@ } + +// https://github.com/less/less.js/issues/2462 +@type: 5_large; +.icon-@{type} { + background-image: ~"url(/img/icon/@{type}.svg)"; +} From 3fda5b2cf3ae7a91c6c7849f97babd389b3ea49f Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 14:18:44 -0700 Subject: [PATCH 21/76] fix(#4331): exclude CSS at-rule keywords from declarationCall parsing (#4407) * fix(#4331): exclude CSS at-rule keywords from declarationCall parsing * fix(#4331): normalize spacing after CSS at-rule keywords in media queries When `and`, `or`, `not`, or `only` keywords appear without a space before `(` in media queries, ensure spacing is added in the output to produce valid CSS. --- packages/less/src/less/parser/parser.js | 9 ++++++++- packages/test-data/tests-unit/media/media.css | 5 +++++ packages/test-data/tests-unit/media/media.less | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 8c53c7a08..2eea8efd3 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -484,6 +484,12 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { validCall = validCall.substring(0, validCall.length - 1); + // CSS at-rule keywords should never be parsed as declaration calls + if (/^(and|or|not|only|layer)$/i.test(validCall)) { + parserInput.restore(); + return; + } + let rule = this.ruleProperty(); let value; @@ -1880,7 +1886,8 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup() if (e) { nodes.push(e); - if (e.type === 'Variable') { + if (e.type === 'Variable' || + (e.type === 'Keyword' && /^(and|or|not|only)$/i.test(e.value))) { spacing = true; } } else if (parserInput.$char('(')) { diff --git a/packages/test-data/tests-unit/media/media.css b/packages/test-data/tests-unit/media/media.css index d471401e8..eb9912364 100644 --- a/packages/test-data/tests-unit/media/media.css +++ b/packages/test-data/tests-unit/media/media.css @@ -269,3 +269,8 @@ color: red; } } +@media screen and (max-width: 1280px) { + .form-process-table { + color: red; + } +} diff --git a/packages/test-data/tests-unit/media/media.less b/packages/test-data/tests-unit/media/media.less index c49cd8860..3b55c761c 100644 --- a/packages/test-data/tests-unit/media/media.less +++ b/packages/test-data/tests-unit/media/media.less @@ -296,3 +296,9 @@ color: red; } } + +.form-process-table { + @media screen and(max-width: 1280px) { + color: red; + } +} From daa3e0066a36e630eb98c36a42afb7282ef29cda Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 14:18:48 -0700 Subject: [PATCH 22/76] fix(#4358): resolve parent selectors in comma-separated pseudo-selector lists (#4408) --- packages/less/src/less/tree/ruleset.js | 38 ++++++++++++++++--- .../tests-unit/selectors/selectors.css | 9 +++++ .../tests-unit/selectors/selectors.less | 7 ++++ 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/packages/less/src/less/tree/ruleset.js b/packages/less/src/less/tree/ruleset.js index f7aadd84b..72ccf4fb0 100644 --- a/packages/less/src/less/tree/ruleset.js +++ b/packages/less/src/less/tree/ruleset.js @@ -740,12 +740,40 @@ Ruleset.prototype = Object.assign(new Node(), { const nestedPaths = []; let replaced; const replacedNewSelectors = []; - replaced = replaceParentSelector(nestedPaths, context, nestedSelector); - hadParentSelector = hadParentSelector || replaced; - // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors - for (k = 0; k < nestedPaths.length; k++) { - const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); + + // Check if this is a comma-separated selector list inside the paren + // e.g. :not(&.a, &.b) produces Selector([Selector, Anonymous(','), Selector]) + const hasSubSelectors = nestedSelector.elements.some(e => e instanceof Selector); + + if (hasSubSelectors) { + // Process each sub-selector individually + const resolvedElements = []; + for (const subEl of nestedSelector.elements) { + if (subEl instanceof Selector) { + const subPaths = []; + const subReplaced = replaceParentSelector(subPaths, context, subEl); + replaced = replaced || subReplaced; + if (subPaths.length > 0 && subPaths[0].length > 0) { + resolvedElements.push(subPaths[0][0]); + } else { + resolvedElements.push(subEl); + } + } else { + resolvedElements.push(subEl); + } + } + hadParentSelector = hadParentSelector || replaced; + const resolvedNestedSelector = new Selector(resolvedElements); + const replacementSelector = createSelector(createParenthesis([resolvedNestedSelector], el), el); addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); + } else { + replaced = replaceParentSelector(nestedPaths, context, nestedSelector); + hadParentSelector = hadParentSelector || replaced; + // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors + for (k = 0; k < nestedPaths.length; k++) { + const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); + addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); + } } newSelectors = replacedNewSelectors; currentElements = []; diff --git a/packages/test-data/tests-unit/selectors/selectors.css b/packages/test-data/tests-unit/selectors/selectors.css index 1ac271954..a5c0f1bd4 100644 --- a/packages/test-data/tests-unit/selectors/selectors.css +++ b/packages/test-data/tests-unit/selectors/selectors.css @@ -182,6 +182,15 @@ blank blank blank blank blank blank blank blank blank blank blank blank blank bl .first-level .second-level.active2 { content: '\2661'; } +.x:is(.x.a) { + color: red; +} +.x:not(.x.b, .x.c) { + color: green; +} +.x:is(.x.d, .x.e, .x.f) { + color: blue; +} a:is(.b, :is(.c)) { color: blue; } diff --git a/packages/test-data/tests-unit/selectors/selectors.less b/packages/test-data/tests-unit/selectors/selectors.less index 30635b1d6..5cf26add7 100644 --- a/packages/test-data/tests-unit/selectors/selectors.less +++ b/packages/test-data/tests-unit/selectors/selectors.less @@ -202,6 +202,13 @@ blank blank blank blank blank blank blank blank blank blank blank blank blank bl } } +// https://github.com/less/less.js/issues/4358 +.x { + &:is(&.a) { color: red; } + &:not(&.b, &.c) { color: green; } + &:is(&.d, &.e, &.f) { color: blue; } +} + a:is(.b, :is(.c)) { color: blue; } From 7e48ad9d500b95cb839e5ac8b89a26b0fe09f2a9 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 14:18:51 -0700 Subject: [PATCH 23/76] refactor: code quality cleanup for container queries and related code (#4409) * fix: correct import and error handling in style() function - Fix incorrect import: `Anonymous` was imported from '../tree/variable' instead of '../tree/anonymous' (worked by accident since Variable was imported on the line above) - Simplify switch/case with single case 0 to a plain if statement - Add explanatory comment to the catch block documenting why it exists (CSS pass-through for @container style() queries) * refactor: remove dead boolean logic in evalRoot() - Remove `allAmpersands` variable that was initialized to false and never set to true, making it dead code - Replace string-based ampersand detection (genCSS + regex) with direct element value checks, avoiding unnecessary AST-to-string conversion - Simplify boolean conditions that referenced the dead variable * fix: add missing parserInput.forget() in colorOperand The colorOperand parser rule called parserInput.save() but only called restore() on failure, missing the forget() call on the success path. * refactor: QueryInParens eval() returns new node instead of mutating this QueryInParens.eval() was mutating `this` directly instead of returning a new node, violating the core Less.js tree pattern. It also used a brittle queue pattern where deep copies were pushed to an `mvalues` array during eval() and shifted off during genCSS(). Now eval() creates and returns a new QueryInParens with evaluated children, and genCSS() reads directly from the node's properties. The `copy-anything` import is removed from this file (still used elsewhere in the codebase). * refactor: extract mergeRules into shared utility to fix AtRule layering violation AtRule.eval() was directly calling ToCSSVisitor.prototype._mergeRules, which breaks the architectural boundary between tree nodes and visitors. Extract the merge logic into a standalone utility (merge-rules.js) that both AtRule.eval() and ToCSSVisitor can use without coupling. * fix: remove Container copy-paste duplication and fix evalNested splice index bug Container was overriding evalNested, permute, and bubbleSelectors with identical copies of the methods already provided by NestableAtRulePrototype. Remove the redundant overrides so Container properly inherits from the shared prototype. Also fix a bug in NestableAtRulePrototype.evalNested where context.mediaBlocks.splice(i, 1) used `i` (the index into `path`) to splice `mediaBlocks`. These are different arrays with different contents, so the index was wrong. Use indexOf(this) to find the correct position. --- packages/less/src/less/functions/style.js | 18 +++--- packages/less/src/less/parser/parser.js | 3 +- packages/less/src/less/tree/atrule.js | 20 +++--- packages/less/src/less/tree/container.js | 61 ------------------- packages/less/src/less/tree/merge-rules.js | 41 +++++++++++++ packages/less/src/less/tree/nested-at-rule.js | 10 +-- .../less/src/less/tree/query-in-parens.js | 28 +++------ .../less/src/less/visitors/to-css-visitor.js | 36 +---------- 8 files changed, 80 insertions(+), 137 deletions(-) create mode 100644 packages/less/src/less/tree/merge-rules.js diff --git a/packages/less/src/less/functions/style.js b/packages/less/src/less/functions/style.js index 85b6b0f96..cb090ae8d 100644 --- a/packages/less/src/less/functions/style.js +++ b/packages/less/src/less/functions/style.js @@ -1,16 +1,16 @@ import Variable from '../tree/variable'; -import Anonymous from '../tree/variable'; +import Anonymous from '../tree/anonymous'; const styleExpression = function (args) { args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; + if (args.length === 0) { + throw { type: 'Argument', message: 'one or more arguments required' }; } - + const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)]; - + args = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', '); - + return new Anonymous(`style(${args})`); }; @@ -18,6 +18,10 @@ export default { style: function(...args) { try { return styleExpression.call(this, args); - } catch (e) {} + } catch (e) { + // When style() is used as a CSS function (e.g. @container style(--responsive: true)), + // arguments won't be valid Less variables. Return undefined to let the + // parser fall through and treat it as plain CSS. + } }, }; diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index 2eea8efd3..6cdfeafef 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -2269,10 +2269,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { }, colorOperand: function () { parserInput.save(); - + // hsl or rgb or lch operand const match = parserInput.$re(/^[lchrgbs]\s+/); if (match) { + parserInput.forget(); return new tree.Keyword(match[0]); } diff --git a/packages/less/src/less/tree/atrule.js b/packages/less/src/less/tree/atrule.js index 15301f29b..d1cf3513f 100644 --- a/packages/less/src/less/tree/atrule.js +++ b/packages/less/src/less/tree/atrule.js @@ -3,6 +3,7 @@ import Selector from './selector'; import Ruleset from './ruleset'; import Anonymous from './anonymous'; import NestableAtRulePrototype from './nested-at-rule'; +import mergeRules from './merge-rules'; const AtRule = function( name, @@ -143,7 +144,6 @@ AtRule.prototype = Object.assign(new Node(), { if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) { const allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true); if (allMergeableDeclarations && !this.isRooted && !value) { - var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; mergeRules(rules[0].rules); rules = rules[0].rules; rules.forEach(rule => rule.merge = false); @@ -164,7 +164,6 @@ AtRule.prototype = Object.assign(new Node(), { let ampersandCount = 0; let noAmpersandCount = 0; let noAmpersands = true; - let allAmpersands = false; if (!this.simpleBlock) { rules = [rules[0].eval(context)]; @@ -184,25 +183,24 @@ AtRule.prototype = Object.assign(new Node(), { } } if (precedingSelectors.length > 0) { - let value = ''; - const output = { add: function (s) { value += s; } }; - for (let i = 0; i < precedingSelectors.length; i++) { - precedingSelectors[i].genCSS(context, output); - } - if (/^&+$/.test(value.replace(/\s+/g, ''))) { + const allAmpersandElements = precedingSelectors.every( + sel => sel.elements && sel.elements.length > 0 && sel.elements.every( + el => el.value === '&' + ) + ); + if (allAmpersandElements) { noAmpersands = false; noAmpersandCount++; } else { - allAmpersands = false; ampersandCount++; } } } } - const mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !allAmpersands && !noAmpersands; + const mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !noAmpersands; if ( - (this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && !allAmpersands && noAmpersands) + (this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && noAmpersands) || !mixedAmpersands ) { rules[0].root = true; diff --git a/packages/less/src/less/tree/container.js b/packages/less/src/less/tree/container.js index 36d708e24..2b84b7926 100644 --- a/packages/less/src/less/tree/container.js +++ b/packages/less/src/less/tree/container.js @@ -2,10 +2,7 @@ import Ruleset from './ruleset'; import Value from './value'; import Selector from './selector'; import AtRule from './atrule'; -import Anonymous from './anonymous'; -import Expression from './expression'; import NestableAtRulePrototype from './nested-at-rule'; -import * as utils from '../utils'; const Container = function(value, features, index, currentFileInfo, visibilityInfo) { this._index = index; @@ -64,64 +61,6 @@ Container.prototype = Object.assign(new AtRule(), { return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); - }, - - evalNested(context) { - this.evalFunction(); - - let i; - let value; - const path = context.mediaPath.concat([this]); - - for (i = 0; i < path.length; i++) { - if (path[i].type !== this.type) { - context.mediaBlocks.splice(i, 1); - return this; - } - - value = path[i].features instanceof Value ? - path[i].features.value : path[i].features; - const fragments = Array.isArray(value) ? value : [value]; - path[i] = fragments; - } - - this.features = new Value(this.permute(path).map(path => { - path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment)); - - for (i = path.length - 1; i > 0; i--) { - path.splice(i, 0, new Anonymous('and')); - } - - return new Expression(path); - })); - this.setParent(this.features, this); - - return new Ruleset([], []); - }, - - permute(arr) { - if (arr.length === 0) { - return []; - } else if (arr.length === 1) { - return arr[0]; - } else { - const result = []; - const rest = this.permute(arr.slice(1)); - for (let i = 0; i < rest.length; i++) { - for (let j = 0; j < arr[0].length; j++) { - result.push([arr[0][j]].concat(rest[i])); - } - } - return result; - } - }, - - bubbleSelectors(selectors) { - if (!selectors) { - return; - } - this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])]; - this.setParent(this.rules, this); } }); diff --git a/packages/less/src/less/tree/merge-rules.js b/packages/less/src/less/tree/merge-rules.js new file mode 100644 index 000000000..9adb08d16 --- /dev/null +++ b/packages/less/src/less/tree/merge-rules.js @@ -0,0 +1,41 @@ +import Expression from './expression'; +import Value from './value'; + +/** + * Merges declarations with merge flags (+ or ,) into combined values. + * Used by both the ToCSSVisitor and AtRule eval. + */ +export default function mergeRules(rules) { + if (!rules) { + return; + } + + const groups = {}; + const groupsArr = []; + + for (let i = 0; i < rules.length; i++) { + const rule = rules[i]; + if (rule.merge) { + const key = rule.name; + groups[key] ? rules.splice(i--, 1) : + groupsArr.push(groups[key] = []); + groups[key].push(rule); + } + } + + groupsArr.forEach(group => { + if (group.length > 0) { + const result = group[0]; + let space = []; + const comma = [new Expression(space)]; + group.forEach(rule => { + if ((rule.merge === '+') && (space.length > 0)) { + comma.push(new Expression(space = [])); + } + space.push(rule.value); + result.important = result.important || rule.important; + }); + result.value = new Value(comma); + } + }); +} diff --git a/packages/less/src/less/tree/nested-at-rule.js b/packages/less/src/less/tree/nested-at-rule.js index dd2ff5284..b0cde0876 100644 --- a/packages/less/src/less/tree/nested-at-rule.js +++ b/packages/less/src/less/tree/nested-at-rule.js @@ -74,10 +74,12 @@ const NestableAtRulePrototype = { // Extract the media-query conditions separated with `,` (OR). for (i = 0; i < path.length; i++) { - if (path[i].type !== this.type) { - context.mediaBlocks.splice(i, 1); - - return this; + if (path[i].type !== this.type) { + const blockIndex = context.mediaBlocks.indexOf(this); + if (blockIndex > -1) { + context.mediaBlocks.splice(blockIndex, 1); + } + return this; } value = path[i].features instanceof Value ? diff --git a/packages/less/src/less/tree/query-in-parens.js b/packages/less/src/less/tree/query-in-parens.js index 1c0200ef5..c4ef8c1a0 100644 --- a/packages/less/src/less/tree/query-in-parens.js +++ b/packages/less/src/less/tree/query-in-parens.js @@ -1,4 +1,3 @@ -import { copy } from 'copy-anything'; import Node from './node'; const QueryInParens = function (op, l, m, op2, r, i) { @@ -8,7 +7,6 @@ const QueryInParens = function (op, l, m, op2, r, i) { this.op2 = op2 ? op2.trim() : null; this.rvalue = r; this._index = i; - this.mvalues = []; }; QueryInParens.prototype = Object.assign(new Node(), { @@ -23,28 +21,20 @@ QueryInParens.prototype = Object.assign(new Node(), { }, eval(context) { - this.lvalue = this.lvalue.eval(context); - - if (!this.mvalueCopy) { - this.mvalueCopy = copy(this.mvalue); - } - - this.mvalue = copy(this.mvalueCopy); - this.mvalue = this.mvalue.eval(context); - this.mvalues.push(this.mvalue); - - if (this.rvalue) { - this.rvalue = this.rvalue.eval(context); - } - return this; + const node = new QueryInParens( + this.op, + this.lvalue.eval(context), + this.mvalue.eval(context), + this.op2, + this.rvalue ? this.rvalue.eval(context) : null, + this._index + ); + return node; }, genCSS(context, output) { this.lvalue.genCSS(context, output); output.add(' ' + this.op + ' '); - if (this.mvalues.length > 0) { - this.mvalue = this.mvalues.shift(); - } this.mvalue.genCSS(context, output); if (this.rvalue) { output.add(' ' + this.op2 + ' '); diff --git a/packages/less/src/less/visitors/to-css-visitor.js b/packages/less/src/less/visitors/to-css-visitor.js index d1d200951..ce1038efb 100644 --- a/packages/less/src/less/visitors/to-css-visitor.js +++ b/packages/less/src/less/visitors/to-css-visitor.js @@ -4,6 +4,7 @@ */ import tree from '../tree'; import Visitor from './visitor'; +import mergeRules from '../tree/merge-rules'; class CSSVisitorUtils { constructor(context) { @@ -325,40 +326,7 @@ ToCSSVisitor.prototype = { } }, - _mergeRules: function(rules) { - if (!rules) { - return; - } - - const groups = {}; - const groupsArr = []; - - for (let i = 0; i < rules.length; i++) { - const rule = rules[i]; - if (rule.merge) { - const key = rule.name; - groups[key] ? rules.splice(i--, 1) : - groupsArr.push(groups[key] = []); - groups[key].push(rule); - } - } - - groupsArr.forEach(group => { - if (group.length > 0) { - const result = group[0]; - let space = []; - const comma = [new tree.Expression(space)]; - group.forEach(rule => { - if ((rule.merge === '+') && (space.length > 0)) { - comma.push(new tree.Expression(space = [])); - } - space.push(rule.value); - result.important = result.important || rule.important; - }); - result.value = new tree.Value(comma); - } - }); - } + _mergeRules: mergeRules }; export default ToCSSVisitor; From 6f82d1934c43252a1c8c23ceb91e6e80b2450866 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 14:44:40 -0700 Subject: [PATCH 24/76] perf: optimize hot paths and fix benchmark infrastructure (#4410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(benchmark): fix division in benchmark files for v4 math defaults Wrap bare divisions inside percentage() calls in extra parens so benchmarks work with v4's default parens-division math mode. Add --math option passthrough to benchmark-runner.js and pass --math=always in run-historical.sh for consistent cross-version results. * perf: remove unnecessary closures in hot paths - Remove `extendVisitor` alias in findMatch, use `this` directly - Replace IIFE closure for functionRegistry lookup in Ruleset.eval with inline loop ~5% improvement on main benchmark (median 38.6ms → 37.1ms) * perf: replace forEach/map closures with for loops in hot paths - Selector.eval: replace map() closures with pre-allocated for loops - Ruleset transformDeclaration: replace forEach with for loop - extend-visitor visitRuleset: replace forEach with for loop, cache extend and pathCount to reduce repeated property access Combined with previous commit: ~8% improvement on 104KB benchmark (median 38.6ms → 36.4ms) * fix(benchmark): handle all v3.12+/v4.x build scenarios - Use pnpm for v4.3+ (workspace: protocol) - Fallback tsc installation when npm can't install locally - Install runtime deps separately when npm fails due to unpublished workspace packages (@less/test-import-module) - Use last patch version of each minor release - Skip v3.13.x (broken source: missing tree/util.js) * bench: update benchmark results after hot-path optimizations Median: 39.07ms → 34.32ms (~12% improvement) Throughput: 2,495 KB/s → 2,828 KB/s System: macbook-pro arm64 * bench: add historical benchmark results and track runs in git - Add historical benchmark data (v3.5–v4.2) to results/runs/ - Update latest/ with all versions including v4.5.0-dev optimized results - Format JSON with 2-space indentation - Update .gitignore to track runs/ (historical records belong in git) * bench: full historical benchmark run (v2.0–v4.5, 23 versions) Apple M4 Pro, arm64, Node v18/v20/v24 Key findings: - v2.4-v2.5 fastest era (~31ms median on 104KB file) - v3.10-v3.12 massive regression (3-5x slower, 126-185ms) - v4.0 recovered to ~40ms - v4.2 fastest v4.x (35.4ms) - v4.5.1 current master: 42.2ms * bench: prune version list to significant performance changes Reduced from 23 to 15 versions based on full benchmark data. Dropped versions with <5% difference from their predecessor: - v2.1 (broken), v2.5, v2.7 (plateau with v2.4/v2.6) - v3.6–v3.9 (all within 1ms, flat ~41ms) - v4.1 (identical to v4.0) The full set can still be run with --versions flag. --- .../benchmark-import-reference-target.less | 4 +- packages/less/benchmark/benchmark-runner.js | 14 +- packages/less/benchmark/benchmark-v39.less | 4 +- packages/less/benchmark/benchmark.less | 12 +- packages/less/benchmark/results/.gitignore | 4 - .../results/latest/macbook-pro_arm64.json | 1449 +++++++++++++---- ...026-03-09T21-34-11Z_macbook-pro_arm64.json | 1361 ++++++++++++++++ .../runs/2026-03-09_macbook-pro_arm64.json | 536 ++++++ packages/less/benchmark/run-historical.sh | 150 +- packages/less/src/less/tree/ruleset.js | 28 +- packages/less/src/less/tree/selector.js | 16 +- .../less/src/less/visitors/extend-visitor.js | 32 +- 12 files changed, 3220 insertions(+), 390 deletions(-) create mode 100644 packages/less/benchmark/results/runs/2026-03-09T21-34-11Z_macbook-pro_arm64.json create mode 100644 packages/less/benchmark/results/runs/2026-03-09_macbook-pro_arm64.json diff --git a/packages/less/benchmark/benchmark-import-reference-target.less b/packages/less/benchmark/benchmark-import-reference-target.less index 1999ddb58..d523f7f00 100644 --- a/packages/less/benchmark/benchmark-import-reference-target.less +++ b/packages/less/benchmark/benchmark-import-reference-target.less @@ -73,8 +73,8 @@ } .generate-cols(@n, @i: 1) when (@i =< @n) { .col-@{i} { - flex: 0 0 percentage(@i / @n); - max-width: percentage(@i / @n); + flex: 0 0 percentage((@i / @n)); + max-width: percentage((@i / @n)); } .generate-cols(@n, (@i + 1)); } diff --git a/packages/less/benchmark/benchmark-runner.js b/packages/less/benchmark/benchmark-runner.js index 0e4585a8f..685a0385a 100644 --- a/packages/less/benchmark/benchmark-runner.js +++ b/packages/less/benchmark/benchmark-runner.js @@ -10,6 +10,13 @@ var path = require('path'); var file = process.argv[2]; var totalRuns = parseInt(process.argv[3]) || 30; var warmupRuns = parseInt(process.argv[4]) || 5; +var extraOpts = {}; + +// Parse --key=value options from remaining args +for (var ai = 5; ai < process.argv.length; ai++) { + var optMatch = process.argv[ai].match(/^--([a-z-]+)=(.*)$/); + if (optMatch) { extraOpts[optMatch[1]] = optMatch[2]; } +} if (!file) { console.error('Usage: node benchmark-runner.js [runs] [warmup]'); @@ -78,10 +85,13 @@ function hrNow() { function runOnce(callback) { var start = hrNow(); - less.render(data, { + var opts = { filename: filePath, paths: [fileDir] - }, function (err, output) { + }; + // Forward extra options (e.g. --math=always) + for (var key in extraOpts) { opts[key] = extraOpts[key]; } + less.render(data, opts, function (err, output) { var end = hrNow(); if (err) { errors.push({ run: completed, error: err.message || String(err) }); diff --git a/packages/less/benchmark/benchmark-v39.less b/packages/less/benchmark/benchmark-v39.less index 31e39ff69..73823d3b5 100644 --- a/packages/less/benchmark/benchmark-v39.less +++ b/packages/less/benchmark/benchmark-v39.less @@ -6,8 +6,8 @@ each(@columns, { .col-@{value} { - flex: 0 0 percentage(@value / 12); - max-width: percentage(@value / 12); + flex: 0 0 percentage((@value / 12)); + max-width: percentage((@value / 12)); } }); diff --git a/packages/less/benchmark/benchmark.less b/packages/less/benchmark/benchmark.less index 1943a5e8e..003c7317a 100644 --- a/packages/less/benchmark/benchmark.less +++ b/packages/less/benchmark/benchmark.less @@ -4113,7 +4113,7 @@ body { .generate-font-sizes(12); .generate-widths(@n, @i: 1) when (@i =< @n) { - .w-@{i} { width: percentage(@i / @n); } + .w-@{i} { width: percentage((@i / @n)); } .generate-widths(@n, (@i + 1)); } .generate-widths(12); @@ -4268,7 +4268,7 @@ body { @base-hue: 210; .color-gen(@i) when (@i > 0) { .color-@{i} { - color: hsl(@base-hue, percentage(@i / 20), 50%); + color: hsl(@base-hue, percentage((@i / 20)), 50%); background: lighten(hsl(@base-hue, 80%, 50%), @i * 2%); border-color: darken(hsl(@base-hue, 80%, 50%), @i * 2%); outline-color: spin(hsl(@base-hue, 80%, 50%), @i * 15); @@ -4347,19 +4347,19 @@ body { // --- Large Loop Stress (recursive mixin) --- .gen-grid(@cols, @i: 1) when (@i =< @cols) { .grid-col-@{i}-of-@{cols} { - width: percentage(@i / @cols); + width: percentage((@i / @cols)); float: left; padding: 0 15px; box-sizing: border-box; } .grid-push-@{i}-of-@{cols} { - margin-left: percentage(@i / @cols); + margin-left: percentage((@i / @cols)); } .grid-pull-@{i}-of-@{cols} { - margin-right: percentage(@i / @cols); + margin-right: percentage((@i / @cols)); } .grid-offset-@{i}-of-@{cols} { - margin-left: percentage(@i / @cols); + margin-left: percentage((@i / @cols)); } .gen-grid(@cols, (@i + 1)); } diff --git a/packages/less/benchmark/results/.gitignore b/packages/less/benchmark/results/.gitignore index 4f5132387..0d8edfb2e 100644 --- a/packages/less/benchmark/results/.gitignore +++ b/packages/less/benchmark/results/.gitignore @@ -1,7 +1,3 @@ -# Track latest results per system, but not every historical run -# To include a specific run, use: git add -f runs/specific-file.json -runs/ - # Legacy flat files (migrated to runs/ + latest/) system-info.json benchmark-results.json diff --git a/packages/less/benchmark/results/latest/macbook-pro_arm64.json b/packages/less/benchmark/results/latest/macbook-pro_arm64.json index f83bbf45d..cc4cfa040 100644 --- a/packages/less/benchmark/results/latest/macbook-pro_arm64.json +++ b/packages/less/benchmark/results/latest/macbook-pro_arm64.json @@ -1,5 +1,6 @@ { "system": { + "system_id": "macbook-pro_arm64", "hostname": "MacBook-Pro.local", "platform": "Darwin", "arch": "arm64", @@ -8,34 +9,268 @@ "cpu_model": "Apple M4 Pro", "total_memory_gb": 48.0, "node_version": "v24.11.1", - "date": "2026-03-09T18:54:01Z", - "system_id": "macbook-pro_arm64" + "date": "2026-03-09T21:34:11Z" }, "versions": [ { - "tag": "v3.5.0", - "version": "3.5.0", + "tag": "v2.0.0", + "version": "2.0.0", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:04Z", + "date": "2026-03-09T21:34:21Z", "benchmarks": { "benchmark.less": { - "version": "3.5.0", + "version": "2.0.0", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, - "render": { - "min": 32.57, - "max": 50.01, - "avg": 38.55, - "median": 37.68, - "stddev": 3.96, - "variance_pct": 45.24, - "samples": 25, - "throughput_kbs": 2703 + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 29.27, + "max": 87.45, + "avg": 46.87, + "median": 46.89, + "stddev": 16.56, + "variance_pct": 35.33, + "samples": 12, + "throughput_kbs": 2224 + } + } + } + }, + { + "tag": "v2.1.2", + "version": "2.1.2", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:26Z", + "benchmarks": { + "benchmark.less": { + "error": "Extra data: line 2 column 1 (char 283)" + } + } + }, + { + "tag": "v2.2.0", + "version": "2.2.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:42Z", + "benchmarks": { + "benchmark.less": { + "version": "2.2.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 28.99, + "max": 62.52, + "avg": 38.51, + "median": 31.32, + "stddev": 12.38, + "variance_pct": 32.15, + "samples": 12, + "throughput_kbs": 2706 + } + } + } + }, + { + "tag": "v2.3.1", + "version": "2.3.1", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:47Z", + "benchmarks": { + "benchmark.less": { + "version": "2.3.1", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 30.8, + "max": 63.72, + "avg": 38.42, + "median": 33.57, + "stddev": 11.47, + "variance_pct": 29.85, + "samples": 12, + "throughput_kbs": 2713 + } + } + } + }, + { + "tag": "v2.4.0", + "version": "2.4.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:52Z", + "benchmarks": { + "benchmark.less": { + "version": "2.4.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 27.39, + "max": 57.2, + "avg": 35.24, + "median": 31.11, + "stddev": 9.93, + "variance_pct": 28.18, + "samples": 12, + "throughput_kbs": 2957 + } + } + } + }, + { + "tag": "v2.5.3", + "version": "2.5.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:56Z", + "benchmarks": { + "benchmark.less": { + "version": "2.5.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 29.83, + "max": 63.6, + "avg": 37.57, + "median": 30.87, + "stddev": 11.91, + "variance_pct": 31.69, + "samples": 12, + "throughput_kbs": 2774 + } + } + } + }, + { + "tag": "v2.6.1", + "version": "2.6.1", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:02Z", + "benchmarks": { + "benchmark.less": { + "version": "2.6.1", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 33.64, + "max": 69, + "avg": 42.08, + "median": 37.52, + "stddev": 11.96, + "variance_pct": 28.41, + "samples": 12, + "throughput_kbs": 2477 + } + } + } + }, + { + "tag": "v2.7.3", + "version": "2.7.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:08Z", + "benchmarks": { + "benchmark.less": { + "version": "2.7.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 33.99, + "max": 72.46, + "avg": 44.36, + "median": 36.95, + "stddev": 13, + "variance_pct": 29.29, + "samples": 12, + "throughput_kbs": 2349 + } + } + } + }, + { + "tag": "v3.0.4", + "version": "3.0.4", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:14Z", + "benchmarks": { + "benchmark.less": { + "version": "3.0.4", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 37.07, + "max": 75.95, + "avg": 43.98, + "median": 39.29, + "stddev": 10.66, + "variance_pct": 24.25, + "samples": 12, + "throughput_kbs": 2370 + } + } + } + }, + { + "tag": "v3.5.3", + "version": "3.5.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:18Z", + "benchmarks": { + "benchmark.less": { + "version": "3.5.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 35.09, + "max": 52.73, + "avg": 43.96, + "median": 42.4, + "stddev": 5.5, + "variance_pct": 12.5, + "samples": 12, + "throughput_kbs": 2371 } } } @@ -44,26 +279,26 @@ "tag": "v3.6.0", "version": "3.6.0", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:10Z", + "date": "2026-03-09T21:35:23Z", "benchmarks": { "benchmark.less": { "version": "3.6.0", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 32.58, - "max": 44.99, - "avg": 36.81, - "median": 36.45, - "stddev": 3.29, - "variance_pct": 33.71, - "samples": 25, - "throughput_kbs": 2831 + "min": 37.97, + "max": 49.87, + "avg": 42.39, + "median": 40.92, + "stddev": 3.8, + "variance_pct": 8.97, + "samples": 12, + "throughput_kbs": 2459 } }, "benchmark-v3.less": { @@ -72,154 +307,154 @@ "file": "benchmark-v3.less", "fileSize": 3237, "fileSizeKB": 3.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 1.41, - "max": 10.1, - "avg": 2.61, - "median": 1.97, - "stddev": 1.74, - "variance_pct": 333.37, - "samples": 25, - "throughput_kbs": 1213 + "min": 2.16, + "max": 4.09, + "avg": 2.94, + "median": 2.87, + "stddev": 0.63, + "variance_pct": 21.61, + "samples": 12, + "throughput_kbs": 1076 } } } }, { - "tag": "v3.7.0", - "version": "3.7.0", + "tag": "v3.7.1", + "version": "3.7.1", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:15Z", + "date": "2026-03-09T21:35:28Z", "benchmarks": { "benchmark.less": { - "version": "3.7.0", + "version": "3.7.1", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 35.95, - "max": 46.06, - "avg": 39.24, - "median": 38.01, - "stddev": 2.69, - "variance_pct": 25.77, - "samples": 25, - "throughput_kbs": 2656 + "min": 37.82, + "max": 52.26, + "avg": 43.33, + "median": 40.85, + "stddev": 4.7, + "variance_pct": 10.84, + "samples": 12, + "throughput_kbs": 2405 } }, "benchmark-v3.less": { - "version": "3.7.0", + "version": "3.7.1", "lessPath": ".", "file": "benchmark-v3.less", "fileSize": 3237, "fileSizeKB": 3.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 1.31, - "max": 9.52, - "avg": 2.63, - "median": 2.15, - "stddev": 1.69, - "variance_pct": 311.76, - "samples": 25, - "throughput_kbs": 1201 + "min": 2.02, + "max": 3.55, + "avg": 2.74, + "median": 2.89, + "stddev": 0.52, + "variance_pct": 19.1, + "samples": 12, + "throughput_kbs": 1154 } }, "benchmark-v37.less": { - "version": "3.7.0", + "version": "3.7.1", "lessPath": ".", "file": "benchmark-v37.less", "fileSize": 2270, "fileSizeKB": 2.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 1.18, - "max": 8.96, - "avg": 2.67, - "median": 1.95, - "stddev": 1.72, - "variance_pct": 291.4, - "samples": 25, - "throughput_kbs": 831 + "min": 1.63, + "max": 3.59, + "avg": 2.81, + "median": 2.9, + "stddev": 0.67, + "variance_pct": 23.77, + "samples": 12, + "throughput_kbs": 788 } } } }, { - "tag": "v3.8.0", - "version": "3.8.0", + "tag": "v3.8.1", + "version": "3.8.1", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:21Z", + "date": "2026-03-09T21:35:35Z", "benchmarks": { "benchmark.less": { - "version": "3.8.0", + "version": "3.8.1", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 36.69, - "max": 45.5, - "avg": 39.95, - "median": 39.1, - "stddev": 2.52, - "variance_pct": 22.05, - "samples": 25, - "throughput_kbs": 2609 + "min": 38.31, + "max": 49.98, + "avg": 43.22, + "median": 41.04, + "stddev": 4.17, + "variance_pct": 9.64, + "samples": 12, + "throughput_kbs": 2412 } }, "benchmark-v3.less": { - "version": "3.8.0", + "version": "3.8.1", "lessPath": ".", "file": "benchmark-v3.less", "fileSize": 3237, "fileSizeKB": 3.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 1.49, - "max": 8.69, - "avg": 2.64, - "median": 2.09, - "stddev": 1.53, - "variance_pct": 273.14, - "samples": 25, - "throughput_kbs": 1200 + "min": 2.06, + "max": 3.99, + "avg": 2.98, + "median": 2.91, + "stddev": 0.66, + "variance_pct": 22.1, + "samples": 12, + "throughput_kbs": 1062 } }, "benchmark-v37.less": { - "version": "3.8.0", + "version": "3.8.1", "lessPath": ".", "file": "benchmark-v37.less", "fileSize": 2270, "fileSizeKB": 2.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, - "render": { - "min": 1.18, - "max": 7.68, - "avg": 2.58, - "median": 1.91, - "stddev": 1.45, - "variance_pct": 252.07, - "samples": 25, - "throughput_kbs": 860 + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.8, + "max": 4.64, + "avg": 3.22, + "median": 3.06, + "stddev": 0.91, + "variance_pct": 28.34, + "samples": 12, + "throughput_kbs": 688 } } } @@ -228,26 +463,26 @@ "tag": "v3.9.0", "version": "3.9.0", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:33Z", + "date": "2026-03-09T21:35:41Z", "benchmarks": { "benchmark.less": { "version": "3.9.0", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 32.62, - "max": 47.69, - "avg": 40.2, - "median": 39.67, - "stddev": 3.89, - "variance_pct": 37.47, - "samples": 25, - "throughput_kbs": 2592 + "min": 38.78, + "max": 54.91, + "avg": 44.19, + "median": 40.7, + "stddev": 5.9, + "variance_pct": 13.35, + "samples": 12, + "throughput_kbs": 2358 } }, "benchmark-v3.less": { @@ -256,18 +491,18 @@ "file": "benchmark-v3.less", "fileSize": 3237, "fileSizeKB": 3.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 1.49, - "max": 8.91, - "avg": 2.56, - "median": 1.95, - "stddev": 1.55, - "variance_pct": 289.49, - "samples": 25, - "throughput_kbs": 1233 + "min": 2.16, + "max": 4.04, + "avg": 3.01, + "median": 3.04, + "stddev": 0.62, + "variance_pct": 20.71, + "samples": 12, + "throughput_kbs": 1051 } }, "benchmark-v37.less": { @@ -276,261 +511,851 @@ "file": "benchmark-v37.less", "fileSize": 2270, "fileSizeKB": 2.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 1.2, - "max": 9.29, - "avg": 2.63, - "median": 2.03, - "stddev": 1.68, - "variance_pct": 307.32, - "samples": 25, - "throughput_kbs": 842 + "min": 1.68, + "max": 4.06, + "avg": 2.87, + "median": 2.87, + "stddev": 0.76, + "variance_pct": 26.57, + "samples": 12, + "throughput_kbs": 774 } }, "benchmark-v39.less": { "version": "3.9.0", "lessPath": ".", "file": "benchmark-v39.less", - "fileSize": 1554, + "fileSize": 1558, "fileSizeKB": 1.5, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, - "render": { - "min": 1.33, - "max": 11.52, - "avg": 3.12, - "median": 2.18, - "stddev": 2.18, - "variance_pct": 326.59, - "samples": 25, - "throughput_kbs": 486 + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.06, + "max": 8.97, + "avg": 4.06, + "median": 3.91, + "stddev": 1.85, + "variance_pct": 45.62, + "samples": 12, + "throughput_kbs": 375 } } } }, { - "tag": "v3.10.0", - "version": "3.10.0", + "tag": "v3.10.3", + "version": "3.10.3", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:44Z", + "date": "2026-03-09T21:35:52Z", "benchmarks": { "benchmark.less": { - "version": "3.10.0", + "version": "3.10.3", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 103.26, - "max": 176.43, - "avg": 125.98, - "median": 125.46, - "stddev": 15.69, - "variance_pct": 58.08, - "samples": 25, - "throughput_kbs": 827 + "min": 118.01, + "max": 152.74, + "avg": 130.23, + "median": 126.14, + "stddev": 10.09, + "variance_pct": 7.75, + "samples": 12, + "throughput_kbs": 800 } }, "benchmark-v3.less": { - "version": "3.10.0", + "version": "3.10.3", "lessPath": ".", "file": "benchmark-v3.less", "fileSize": 3237, "fileSizeKB": 3.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 2.67, - "max": 8.79, - "avg": 4.63, - "median": 4.18, - "stddev": 1.6, - "variance_pct": 132.21, - "samples": 25, - "throughput_kbs": 683 + "min": 3.64, + "max": 9.65, + "avg": 5.79, + "median": 5.61, + "stddev": 1.75, + "variance_pct": 30.26, + "samples": 12, + "throughput_kbs": 546 } }, "benchmark-v37.less": { - "version": "3.10.0", + "version": "3.10.3", "lessPath": ".", "file": "benchmark-v37.less", "fileSize": 2270, "fileSizeKB": 2.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 3.31, - "max": 19.77, - "avg": 5.42, - "median": 4.64, - "stddev": 3.33, - "variance_pct": 303.98, - "samples": 25, - "throughput_kbs": 409 + "min": 3.84, + "max": 10.64, + "avg": 6.08, + "median": 5.57, + "stddev": 1.81, + "variance_pct": 29.73, + "samples": 12, + "throughput_kbs": 365 } }, "benchmark-v39.less": { - "version": "3.10.0", + "version": "3.10.3", "lessPath": ".", "file": "benchmark-v39.less", - "fileSize": 1554, + "fileSize": 1558, "fileSizeKB": 1.5, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, - "render": { - "min": 4.5, - "max": 21.31, - "avg": 7.16, - "median": 6.55, - "stddev": 3.01, - "variance_pct": 234.62, - "samples": 25, - "throughput_kbs": 212 + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 9.19, + "max": 16.24, + "avg": 11.6, + "median": 10.95, + "stddev": 2.13, + "variance_pct": 18.39, + "samples": 12, + "throughput_kbs": 131 } } } }, { - "tag": "v3.11.0", - "version": "3.11.0", + "tag": "v3.11.3", + "version": "3.11.3", "node_version": "v18.20.8", - "date": "2026-03-09T18:54:56Z", + "date": "2026-03-09T21:36:02Z", "benchmarks": { "benchmark.less": { - "version": "3.11.0", + "version": "3.11.3", "lessPath": ".", "file": "benchmark.less", - "fileSize": 106712, + "fileSize": 106724, "fileSizeKB": 104.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 104.12, - "max": 154.95, - "avg": 122.9, - "median": 119.99, - "stddev": 12.94, - "variance_pct": 41.36, - "samples": 25, - "throughput_kbs": 848 + "min": 123.6, + "max": 184.63, + "avg": 141.98, + "median": 135.73, + "stddev": 17, + "variance_pct": 11.97, + "samples": 12, + "throughput_kbs": 734 } }, "benchmark-v3.less": { - "version": "3.11.0", + "version": "3.11.3", "lessPath": ".", "file": "benchmark-v3.less", "fileSize": 3237, "fileSizeKB": 3.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, "render": { - "min": 2.84, - "max": 9.74, - "avg": 4.69, - "median": 4.33, - "stddev": 1.66, - "variance_pct": 146.96, - "samples": 25, - "throughput_kbs": 673 + "min": 4.07, + "max": 10.74, + "avg": 6.67, + "median": 6.18, + "stddev": 1.94, + "variance_pct": 29.07, + "samples": 12, + "throughput_kbs": 474 } }, "benchmark-v37.less": { - "version": "3.11.0", + "version": "3.11.3", "lessPath": ".", "file": "benchmark-v37.less", "fileSize": 2270, "fileSizeKB": 2.2, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, - "render": { - "min": 3.29, - "max": 14.99, - "avg": 5.88, - "median": 5.08, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 5.7, + "max": 10.64, + "avg": 7.81, + "median": 7.46, + "stddev": 1.39, + "variance_pct": 17.78, + "samples": 12, + "throughput_kbs": 284 + } + }, + "benchmark-v39.less": { + "version": "3.11.3", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 6.23, + "max": 14.21, + "avg": 7.67, + "median": 6.97, + "stddev": 2.09, + "variance_pct": 27.21, + "samples": 12, + "throughput_kbs": 198 + } + } + } + }, + { + "tag": "v3.12.2", + "version": "3.12.2", + "node_version": "v18.20.8", + "date": "2026-03-09T21:36:16Z", + "benchmarks": { + "benchmark.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 165.65, + "max": 209.38, + "avg": 187.15, + "median": 185.42, + "stddev": 12.88, + "variance_pct": 6.88, + "samples": 12, + "throughput_kbs": 557 + } + }, + "benchmark-v3.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 3.76, + "max": 9.79, + "avg": 5.58, + "median": 5.53, + "stddev": 1.63, + "variance_pct": 29.32, + "samples": 12, + "throughput_kbs": 567 + } + }, + "benchmark-v37.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 4.22, + "max": 8.17, + "avg": 5.92, + "median": 5.82, + "stddev": 1.04, + "variance_pct": 17.62, + "samples": 12, + "throughput_kbs": 375 + } + }, + "benchmark-v39.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 7.43, + "max": 21.7, + "avg": 10.87, + "median": 9.85, + "stddev": 3.5, + "variance_pct": 32.22, + "samples": 12, + "throughput_kbs": 140 + } + } + } + }, + { + "tag": "v4.0.0", + "version": "4.0.0", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:27Z", + "benchmarks": { + "benchmark.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 35.71, + "max": 68.55, + "avg": 44.82, + "median": 39.85, + "stddev": 10.75, + "variance_pct": 24, + "samples": 12, + "throughput_kbs": 2326 + } + }, + "benchmark-v3.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 0, + "errors": [ + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + } + ], + "render": null + }, + "benchmark-v37.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 0, + "errors": [ + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + } + ], + "render": null + }, + "benchmark-v39.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.9, + "max": 11.57, + "avg": 4, + "median": 3.28, "stddev": 2.63, - "variance_pct": 198.81, - "samples": 25, - "throughput_kbs": 377 + "variance_pct": 65.62, + "samples": 12, + "throughput_kbs": 380 + } + } + } + }, + { + "tag": "v4.1.3", + "version": "4.1.3", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:35Z", + "benchmarks": { + "benchmark.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 35.55, + "max": 68.29, + "avg": 43.74, + "median": 39.45, + "stddev": 10.63, + "variance_pct": 24.31, + "samples": 12, + "throughput_kbs": 2383 + } + }, + "benchmark-v3.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.51, + "max": 4.32, + "avg": 2.59, + "median": 2.52, + "stddev": 0.88, + "variance_pct": 34, + "samples": 12, + "throughput_kbs": 1220 + } + }, + "benchmark-v37.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.69, + "max": 4.27, + "avg": 3, + "median": 3.18, + "stddev": 0.8, + "variance_pct": 26.75, + "samples": 12, + "throughput_kbs": 738 + } + }, + "benchmark-v39.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.86, + "max": 11.57, + "avg": 4, + "median": 3.49, + "stddev": 2.58, + "variance_pct": 64.45, + "samples": 12, + "throughput_kbs": 380 + } + } + } + }, + { + "tag": "v4.2.2", + "version": "4.2.2", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:43Z", + "benchmarks": { + "benchmark.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 33.06, + "max": 71.26, + "avg": 41.5, + "median": 35.42, + "stddev": 12.93, + "variance_pct": 31.15, + "samples": 12, + "throughput_kbs": 2511 + } + }, + "benchmark-v3.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.68, + "max": 4.18, + "avg": 2.67, + "median": 2.69, + "stddev": 0.79, + "variance_pct": 29.71, + "samples": 12, + "throughput_kbs": 1184 + } + }, + "benchmark-v37.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.97, + "max": 10.6, + "avg": 3.77, + "median": 3.76, + "stddev": 2.2, + "variance_pct": 58.39, + "samples": 12, + "throughput_kbs": 587 + } + }, + "benchmark-v39.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.35, + "max": 9.8, + "avg": 4.85, + "median": 4.98, + "stddev": 2.16, + "variance_pct": 44.58, + "samples": 12, + "throughput_kbs": 314 + } + } + } + }, + { + "tag": "v4.3.0", + "version": "4.3.0", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:54Z", + "benchmarks": { + "benchmark.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 34.18, + "max": 73.61, + "avg": 43.07, + "median": 37.23, + "stddev": 12.22, + "variance_pct": 28.38, + "samples": 12, + "throughput_kbs": 2420 + } + }, + "benchmark-v3.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.63, + "max": 3.81, + "avg": 2.52, + "median": 2.45, + "stddev": 0.75, + "variance_pct": 29.7, + "samples": 12, + "throughput_kbs": 1254 + } + }, + "benchmark-v37.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.01, + "max": 9.44, + "avg": 3.51, + "median": 3.37, + "stddev": 1.9, + "variance_pct": 54.29, + "samples": 12, + "throughput_kbs": 632 } }, "benchmark-v39.less": { - "version": "3.11.0", + "version": "4.3.0", "lessPath": ".", "file": "benchmark-v39.less", - "fileSize": 1554, + "fileSize": 1558, "fileSizeKB": 1.5, - "totalRuns": 30, - "warmupRuns": 5, - "completedRuns": 30, - "render": { - "min": 9.79, - "max": 22.26, - "avg": 11.71, - "median": 11.12, - "stddev": 2.4, - "variance_pct": 106.47, - "samples": 25, - "throughput_kbs": 130 + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.22, + "max": 9.85, + "avg": 4.7, + "median": 4.26, + "stddev": 2.16, + "variance_pct": 46.07, + "samples": 12, + "throughput_kbs": 324 } } } }, { - "tag": "v4.2.0", - "version": "4.2.0", + "tag": "v4.4.2", + "version": "4.4.2", "node_version": "v20.19.6", - "date": "2026-03-09T18:55:29Z", + "date": "2026-03-09T21:37:06Z", "benchmarks": { "benchmark.less": { - "error": "Could not find Less compiler", - "tried": [ - "./packages/less", - ".", - "./lib/less-node", - "less" - ] + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 34.87, + "max": 73.71, + "avg": 45.83, + "median": 40.47, + "stddev": 11.86, + "variance_pct": 25.87, + "samples": 12, + "throughput_kbs": 2274 + } }, "benchmark-v3.less": { - "error": "Could not find Less compiler", - "tried": [ - "./packages/less", - ".", - "./lib/less-node", - "less" - ] + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.55, + "max": 3.67, + "avg": 2.53, + "median": 2.53, + "stddev": 0.66, + "variance_pct": 26.12, + "samples": 12, + "throughput_kbs": 1249 + } }, "benchmark-v37.less": { - "error": "Could not find Less compiler", - "tried": [ - "./packages/less", - ".", - "./lib/less-node", - "less" - ] + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.51, + "max": 10.07, + "avg": 3.59, + "median": 3.48, + "stddev": 2.11, + "variance_pct": 58.91, + "samples": 12, + "throughput_kbs": 618 + } + }, + "benchmark-v39.less": { + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.47, + "max": 10.4, + "avg": 4.92, + "median": 4.59, + "stddev": 2.24, + "variance_pct": 45.65, + "samples": 12, + "throughput_kbs": 310 + } + } + } + }, + { + "tag": "v4.5.1", + "version": "4.5.1", + "node_version": "v20.19.6", + "date": "2026-03-09T21:37:14Z", + "benchmarks": { + "benchmark.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 39.63, + "max": 72.55, + "avg": 47.4, + "median": 42.16, + "stddev": 11.09, + "variance_pct": 23.39, + "samples": 12, + "throughput_kbs": 2199 + } + }, + "benchmark-v3.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.61, + "max": 3.47, + "avg": 2.57, + "median": 2.62, + "stddev": 0.67, + "variance_pct": 26.21, + "samples": 12, + "throughput_kbs": 1231 + } + }, + "benchmark-v37.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.65, + "max": 9.51, + "avg": 3.79, + "median": 3.62, + "stddev": 1.96, + "variance_pct": 51.77, + "samples": 12, + "throughput_kbs": 585 + } }, "benchmark-v39.less": { - "error": "Could not find Less compiler", - "tried": [ - "./packages/less", - ".", - "./lib/less-node", - "less" - ] + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.18, + "max": 10.1, + "avg": 4.62, + "median": 4.73, + "stddev": 2.14, + "variance_pct": 46.29, + "samples": 12, + "throughput_kbs": 330 + } } } } ] -} \ No newline at end of file +} diff --git a/packages/less/benchmark/results/runs/2026-03-09T21-34-11Z_macbook-pro_arm64.json b/packages/less/benchmark/results/runs/2026-03-09T21-34-11Z_macbook-pro_arm64.json new file mode 100644 index 000000000..cc4cfa040 --- /dev/null +++ b/packages/less/benchmark/results/runs/2026-03-09T21-34-11Z_macbook-pro_arm64.json @@ -0,0 +1,1361 @@ +{ + "system": { + "system_id": "macbook-pro_arm64", + "hostname": "MacBook-Pro.local", + "platform": "Darwin", + "arch": "arm64", + "os_version": "25.3.0", + "cpus": "14", + "cpu_model": "Apple M4 Pro", + "total_memory_gb": 48.0, + "node_version": "v24.11.1", + "date": "2026-03-09T21:34:11Z" + }, + "versions": [ + { + "tag": "v2.0.0", + "version": "2.0.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:21Z", + "benchmarks": { + "benchmark.less": { + "version": "2.0.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 29.27, + "max": 87.45, + "avg": 46.87, + "median": 46.89, + "stddev": 16.56, + "variance_pct": 35.33, + "samples": 12, + "throughput_kbs": 2224 + } + } + } + }, + { + "tag": "v2.1.2", + "version": "2.1.2", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:26Z", + "benchmarks": { + "benchmark.less": { + "error": "Extra data: line 2 column 1 (char 283)" + } + } + }, + { + "tag": "v2.2.0", + "version": "2.2.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:42Z", + "benchmarks": { + "benchmark.less": { + "version": "2.2.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 28.99, + "max": 62.52, + "avg": 38.51, + "median": 31.32, + "stddev": 12.38, + "variance_pct": 32.15, + "samples": 12, + "throughput_kbs": 2706 + } + } + } + }, + { + "tag": "v2.3.1", + "version": "2.3.1", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:47Z", + "benchmarks": { + "benchmark.less": { + "version": "2.3.1", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 30.8, + "max": 63.72, + "avg": 38.42, + "median": 33.57, + "stddev": 11.47, + "variance_pct": 29.85, + "samples": 12, + "throughput_kbs": 2713 + } + } + } + }, + { + "tag": "v2.4.0", + "version": "2.4.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:52Z", + "benchmarks": { + "benchmark.less": { + "version": "2.4.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 27.39, + "max": 57.2, + "avg": 35.24, + "median": 31.11, + "stddev": 9.93, + "variance_pct": 28.18, + "samples": 12, + "throughput_kbs": 2957 + } + } + } + }, + { + "tag": "v2.5.3", + "version": "2.5.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:34:56Z", + "benchmarks": { + "benchmark.less": { + "version": "2.5.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 29.83, + "max": 63.6, + "avg": 37.57, + "median": 30.87, + "stddev": 11.91, + "variance_pct": 31.69, + "samples": 12, + "throughput_kbs": 2774 + } + } + } + }, + { + "tag": "v2.6.1", + "version": "2.6.1", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:02Z", + "benchmarks": { + "benchmark.less": { + "version": "2.6.1", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 33.64, + "max": 69, + "avg": 42.08, + "median": 37.52, + "stddev": 11.96, + "variance_pct": 28.41, + "samples": 12, + "throughput_kbs": 2477 + } + } + } + }, + { + "tag": "v2.7.3", + "version": "2.7.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:08Z", + "benchmarks": { + "benchmark.less": { + "version": "2.7.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 33.99, + "max": 72.46, + "avg": 44.36, + "median": 36.95, + "stddev": 13, + "variance_pct": 29.29, + "samples": 12, + "throughput_kbs": 2349 + } + } + } + }, + { + "tag": "v3.0.4", + "version": "3.0.4", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:14Z", + "benchmarks": { + "benchmark.less": { + "version": "3.0.4", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 37.07, + "max": 75.95, + "avg": 43.98, + "median": 39.29, + "stddev": 10.66, + "variance_pct": 24.25, + "samples": 12, + "throughput_kbs": 2370 + } + } + } + }, + { + "tag": "v3.5.3", + "version": "3.5.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:18Z", + "benchmarks": { + "benchmark.less": { + "version": "3.5.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 35.09, + "max": 52.73, + "avg": 43.96, + "median": 42.4, + "stddev": 5.5, + "variance_pct": 12.5, + "samples": 12, + "throughput_kbs": 2371 + } + } + } + }, + { + "tag": "v3.6.0", + "version": "3.6.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:23Z", + "benchmarks": { + "benchmark.less": { + "version": "3.6.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 37.97, + "max": 49.87, + "avg": 42.39, + "median": 40.92, + "stddev": 3.8, + "variance_pct": 8.97, + "samples": 12, + "throughput_kbs": 2459 + } + }, + "benchmark-v3.less": { + "version": "3.6.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.16, + "max": 4.09, + "avg": 2.94, + "median": 2.87, + "stddev": 0.63, + "variance_pct": 21.61, + "samples": 12, + "throughput_kbs": 1076 + } + } + } + }, + { + "tag": "v3.7.1", + "version": "3.7.1", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:28Z", + "benchmarks": { + "benchmark.less": { + "version": "3.7.1", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 37.82, + "max": 52.26, + "avg": 43.33, + "median": 40.85, + "stddev": 4.7, + "variance_pct": 10.84, + "samples": 12, + "throughput_kbs": 2405 + } + }, + "benchmark-v3.less": { + "version": "3.7.1", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.02, + "max": 3.55, + "avg": 2.74, + "median": 2.89, + "stddev": 0.52, + "variance_pct": 19.1, + "samples": 12, + "throughput_kbs": 1154 + } + }, + "benchmark-v37.less": { + "version": "3.7.1", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.63, + "max": 3.59, + "avg": 2.81, + "median": 2.9, + "stddev": 0.67, + "variance_pct": 23.77, + "samples": 12, + "throughput_kbs": 788 + } + } + } + }, + { + "tag": "v3.8.1", + "version": "3.8.1", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:35Z", + "benchmarks": { + "benchmark.less": { + "version": "3.8.1", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 38.31, + "max": 49.98, + "avg": 43.22, + "median": 41.04, + "stddev": 4.17, + "variance_pct": 9.64, + "samples": 12, + "throughput_kbs": 2412 + } + }, + "benchmark-v3.less": { + "version": "3.8.1", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.06, + "max": 3.99, + "avg": 2.98, + "median": 2.91, + "stddev": 0.66, + "variance_pct": 22.1, + "samples": 12, + "throughput_kbs": 1062 + } + }, + "benchmark-v37.less": { + "version": "3.8.1", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.8, + "max": 4.64, + "avg": 3.22, + "median": 3.06, + "stddev": 0.91, + "variance_pct": 28.34, + "samples": 12, + "throughput_kbs": 688 + } + } + } + }, + { + "tag": "v3.9.0", + "version": "3.9.0", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:41Z", + "benchmarks": { + "benchmark.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 38.78, + "max": 54.91, + "avg": 44.19, + "median": 40.7, + "stddev": 5.9, + "variance_pct": 13.35, + "samples": 12, + "throughput_kbs": 2358 + } + }, + "benchmark-v3.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.16, + "max": 4.04, + "avg": 3.01, + "median": 3.04, + "stddev": 0.62, + "variance_pct": 20.71, + "samples": 12, + "throughput_kbs": 1051 + } + }, + "benchmark-v37.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.68, + "max": 4.06, + "avg": 2.87, + "median": 2.87, + "stddev": 0.76, + "variance_pct": 26.57, + "samples": 12, + "throughput_kbs": 774 + } + }, + "benchmark-v39.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.06, + "max": 8.97, + "avg": 4.06, + "median": 3.91, + "stddev": 1.85, + "variance_pct": 45.62, + "samples": 12, + "throughput_kbs": 375 + } + } + } + }, + { + "tag": "v3.10.3", + "version": "3.10.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:35:52Z", + "benchmarks": { + "benchmark.less": { + "version": "3.10.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 118.01, + "max": 152.74, + "avg": 130.23, + "median": 126.14, + "stddev": 10.09, + "variance_pct": 7.75, + "samples": 12, + "throughput_kbs": 800 + } + }, + "benchmark-v3.less": { + "version": "3.10.3", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 3.64, + "max": 9.65, + "avg": 5.79, + "median": 5.61, + "stddev": 1.75, + "variance_pct": 30.26, + "samples": 12, + "throughput_kbs": 546 + } + }, + "benchmark-v37.less": { + "version": "3.10.3", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 3.84, + "max": 10.64, + "avg": 6.08, + "median": 5.57, + "stddev": 1.81, + "variance_pct": 29.73, + "samples": 12, + "throughput_kbs": 365 + } + }, + "benchmark-v39.less": { + "version": "3.10.3", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 9.19, + "max": 16.24, + "avg": 11.6, + "median": 10.95, + "stddev": 2.13, + "variance_pct": 18.39, + "samples": 12, + "throughput_kbs": 131 + } + } + } + }, + { + "tag": "v3.11.3", + "version": "3.11.3", + "node_version": "v18.20.8", + "date": "2026-03-09T21:36:02Z", + "benchmarks": { + "benchmark.less": { + "version": "3.11.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 123.6, + "max": 184.63, + "avg": 141.98, + "median": 135.73, + "stddev": 17, + "variance_pct": 11.97, + "samples": 12, + "throughput_kbs": 734 + } + }, + "benchmark-v3.less": { + "version": "3.11.3", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 4.07, + "max": 10.74, + "avg": 6.67, + "median": 6.18, + "stddev": 1.94, + "variance_pct": 29.07, + "samples": 12, + "throughput_kbs": 474 + } + }, + "benchmark-v37.less": { + "version": "3.11.3", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 5.7, + "max": 10.64, + "avg": 7.81, + "median": 7.46, + "stddev": 1.39, + "variance_pct": 17.78, + "samples": 12, + "throughput_kbs": 284 + } + }, + "benchmark-v39.less": { + "version": "3.11.3", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 6.23, + "max": 14.21, + "avg": 7.67, + "median": 6.97, + "stddev": 2.09, + "variance_pct": 27.21, + "samples": 12, + "throughput_kbs": 198 + } + } + } + }, + { + "tag": "v3.12.2", + "version": "3.12.2", + "node_version": "v18.20.8", + "date": "2026-03-09T21:36:16Z", + "benchmarks": { + "benchmark.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 165.65, + "max": 209.38, + "avg": 187.15, + "median": 185.42, + "stddev": 12.88, + "variance_pct": 6.88, + "samples": 12, + "throughput_kbs": 557 + } + }, + "benchmark-v3.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 3.76, + "max": 9.79, + "avg": 5.58, + "median": 5.53, + "stddev": 1.63, + "variance_pct": 29.32, + "samples": 12, + "throughput_kbs": 567 + } + }, + "benchmark-v37.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 4.22, + "max": 8.17, + "avg": 5.92, + "median": 5.82, + "stddev": 1.04, + "variance_pct": 17.62, + "samples": 12, + "throughput_kbs": 375 + } + }, + "benchmark-v39.less": { + "version": "3.12.2", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 7.43, + "max": 21.7, + "avg": 10.87, + "median": 9.85, + "stddev": 3.5, + "variance_pct": 32.22, + "samples": 12, + "throughput_kbs": 140 + } + } + } + }, + { + "tag": "v4.0.0", + "version": "4.0.0", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:27Z", + "benchmarks": { + "benchmark.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 35.71, + "max": 68.55, + "avg": 44.82, + "median": 39.85, + "stddev": 10.75, + "variance_pct": 24, + "samples": 12, + "throughput_kbs": 2326 + } + }, + "benchmark-v3.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 0, + "errors": [ + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + } + ], + "render": null + }, + "benchmark-v37.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 0, + "errors": [ + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + }, + { + "run": 0, + "error": "Error evaluating function `if`: tslib_1.__spreadArray is not a function" + } + ], + "render": null + }, + "benchmark-v39.less": { + "version": "4.0.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.9, + "max": 11.57, + "avg": 4, + "median": 3.28, + "stddev": 2.63, + "variance_pct": 65.62, + "samples": 12, + "throughput_kbs": 380 + } + } + } + }, + { + "tag": "v4.1.3", + "version": "4.1.3", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:35Z", + "benchmarks": { + "benchmark.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 35.55, + "max": 68.29, + "avg": 43.74, + "median": 39.45, + "stddev": 10.63, + "variance_pct": 24.31, + "samples": 12, + "throughput_kbs": 2383 + } + }, + "benchmark-v3.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.51, + "max": 4.32, + "avg": 2.59, + "median": 2.52, + "stddev": 0.88, + "variance_pct": 34, + "samples": 12, + "throughput_kbs": 1220 + } + }, + "benchmark-v37.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.69, + "max": 4.27, + "avg": 3, + "median": 3.18, + "stddev": 0.8, + "variance_pct": 26.75, + "samples": 12, + "throughput_kbs": 738 + } + }, + "benchmark-v39.less": { + "version": "4.1.3", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.86, + "max": 11.57, + "avg": 4, + "median": 3.49, + "stddev": 2.58, + "variance_pct": 64.45, + "samples": 12, + "throughput_kbs": 380 + } + } + } + }, + { + "tag": "v4.2.2", + "version": "4.2.2", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:43Z", + "benchmarks": { + "benchmark.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 33.06, + "max": 71.26, + "avg": 41.5, + "median": 35.42, + "stddev": 12.93, + "variance_pct": 31.15, + "samples": 12, + "throughput_kbs": 2511 + } + }, + "benchmark-v3.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.68, + "max": 4.18, + "avg": 2.67, + "median": 2.69, + "stddev": 0.79, + "variance_pct": 29.71, + "samples": 12, + "throughput_kbs": 1184 + } + }, + "benchmark-v37.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.97, + "max": 10.6, + "avg": 3.77, + "median": 3.76, + "stddev": 2.2, + "variance_pct": 58.39, + "samples": 12, + "throughput_kbs": 587 + } + }, + "benchmark-v39.less": { + "version": "4.2.2", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.35, + "max": 9.8, + "avg": 4.85, + "median": 4.98, + "stddev": 2.16, + "variance_pct": 44.58, + "samples": 12, + "throughput_kbs": 314 + } + } + } + }, + { + "tag": "v4.3.0", + "version": "4.3.0", + "node_version": "v20.19.6", + "date": "2026-03-09T21:36:54Z", + "benchmarks": { + "benchmark.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 34.18, + "max": 73.61, + "avg": 43.07, + "median": 37.23, + "stddev": 12.22, + "variance_pct": 28.38, + "samples": 12, + "throughput_kbs": 2420 + } + }, + "benchmark-v3.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.63, + "max": 3.81, + "avg": 2.52, + "median": 2.45, + "stddev": 0.75, + "variance_pct": 29.7, + "samples": 12, + "throughput_kbs": 1254 + } + }, + "benchmark-v37.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.01, + "max": 9.44, + "avg": 3.51, + "median": 3.37, + "stddev": 1.9, + "variance_pct": 54.29, + "samples": 12, + "throughput_kbs": 632 + } + }, + "benchmark-v39.less": { + "version": "4.3.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.22, + "max": 9.85, + "avg": 4.7, + "median": 4.26, + "stddev": 2.16, + "variance_pct": 46.07, + "samples": 12, + "throughput_kbs": 324 + } + } + } + }, + { + "tag": "v4.4.2", + "version": "4.4.2", + "node_version": "v20.19.6", + "date": "2026-03-09T21:37:06Z", + "benchmarks": { + "benchmark.less": { + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 34.87, + "max": 73.71, + "avg": 45.83, + "median": 40.47, + "stddev": 11.86, + "variance_pct": 25.87, + "samples": 12, + "throughput_kbs": 2274 + } + }, + "benchmark-v3.less": { + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.55, + "max": 3.67, + "avg": 2.53, + "median": 2.53, + "stddev": 0.66, + "variance_pct": 26.12, + "samples": 12, + "throughput_kbs": 1249 + } + }, + "benchmark-v37.less": { + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.51, + "max": 10.07, + "avg": 3.59, + "median": 3.48, + "stddev": 2.11, + "variance_pct": 58.91, + "samples": 12, + "throughput_kbs": 618 + } + }, + "benchmark-v39.less": { + "version": "4.4.2", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.47, + "max": 10.4, + "avg": 4.92, + "median": 4.59, + "stddev": 2.24, + "variance_pct": 45.65, + "samples": 12, + "throughput_kbs": 310 + } + } + } + }, + { + "tag": "v4.5.1", + "version": "4.5.1", + "node_version": "v20.19.6", + "date": "2026-03-09T21:37:14Z", + "benchmarks": { + "benchmark.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106724, + "fileSizeKB": 104.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 39.63, + "max": 72.55, + "avg": 47.4, + "median": 42.16, + "stddev": 11.09, + "variance_pct": 23.39, + "samples": 12, + "throughput_kbs": 2199 + } + }, + "benchmark-v3.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.61, + "max": 3.47, + "avg": 2.57, + "median": 2.62, + "stddev": 0.67, + "variance_pct": 26.21, + "samples": 12, + "throughput_kbs": 1231 + } + }, + "benchmark-v37.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 1.65, + "max": 9.51, + "avg": 3.79, + "median": 3.62, + "stddev": 1.96, + "variance_pct": 51.77, + "samples": 12, + "throughput_kbs": 585 + } + }, + "benchmark-v39.less": { + "version": "4.5.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1558, + "fileSizeKB": 1.5, + "totalRuns": 15, + "warmupRuns": 3, + "completedRuns": 15, + "render": { + "min": 2.18, + "max": 10.1, + "avg": 4.62, + "median": 4.73, + "stddev": 2.14, + "variance_pct": 46.29, + "samples": 12, + "throughput_kbs": 330 + } + } + } + } + ] +} diff --git a/packages/less/benchmark/results/runs/2026-03-09_macbook-pro_arm64.json b/packages/less/benchmark/results/runs/2026-03-09_macbook-pro_arm64.json new file mode 100644 index 000000000..bc8a05131 --- /dev/null +++ b/packages/less/benchmark/results/runs/2026-03-09_macbook-pro_arm64.json @@ -0,0 +1,536 @@ +{ + "system": { + "hostname": "MacBook-Pro.local", + "platform": "Darwin", + "arch": "arm64", + "os_version": "25.3.0", + "cpus": "14", + "cpu_model": "Apple M4 Pro", + "total_memory_gb": 48.0, + "node_version": "v24.11.1", + "date": "2026-03-09T18:54:01Z", + "system_id": "macbook-pro_arm64" + }, + "versions": [ + { + "tag": "v3.5.0", + "version": "3.5.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:04Z", + "benchmarks": { + "benchmark.less": { + "version": "3.5.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 32.57, + "max": 50.01, + "avg": 38.55, + "median": 37.68, + "stddev": 3.96, + "variance_pct": 45.24, + "samples": 25, + "throughput_kbs": 2703 + } + } + } + }, + { + "tag": "v3.6.0", + "version": "3.6.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:10Z", + "benchmarks": { + "benchmark.less": { + "version": "3.6.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 32.58, + "max": 44.99, + "avg": 36.81, + "median": 36.45, + "stddev": 3.29, + "variance_pct": 33.71, + "samples": 25, + "throughput_kbs": 2831 + } + }, + "benchmark-v3.less": { + "version": "3.6.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.41, + "max": 10.1, + "avg": 2.61, + "median": 1.97, + "stddev": 1.74, + "variance_pct": 333.37, + "samples": 25, + "throughput_kbs": 1213 + } + } + } + }, + { + "tag": "v3.7.0", + "version": "3.7.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:15Z", + "benchmarks": { + "benchmark.less": { + "version": "3.7.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 35.95, + "max": 46.06, + "avg": 39.24, + "median": 38.01, + "stddev": 2.69, + "variance_pct": 25.77, + "samples": 25, + "throughput_kbs": 2656 + } + }, + "benchmark-v3.less": { + "version": "3.7.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.31, + "max": 9.52, + "avg": 2.63, + "median": 2.15, + "stddev": 1.69, + "variance_pct": 311.76, + "samples": 25, + "throughput_kbs": 1201 + } + }, + "benchmark-v37.less": { + "version": "3.7.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.18, + "max": 8.96, + "avg": 2.67, + "median": 1.95, + "stddev": 1.72, + "variance_pct": 291.4, + "samples": 25, + "throughput_kbs": 831 + } + } + } + }, + { + "tag": "v3.8.0", + "version": "3.8.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:21Z", + "benchmarks": { + "benchmark.less": { + "version": "3.8.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 36.69, + "max": 45.5, + "avg": 39.95, + "median": 39.1, + "stddev": 2.52, + "variance_pct": 22.05, + "samples": 25, + "throughput_kbs": 2609 + } + }, + "benchmark-v3.less": { + "version": "3.8.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.49, + "max": 8.69, + "avg": 2.64, + "median": 2.09, + "stddev": 1.53, + "variance_pct": 273.14, + "samples": 25, + "throughput_kbs": 1200 + } + }, + "benchmark-v37.less": { + "version": "3.8.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.18, + "max": 7.68, + "avg": 2.58, + "median": 1.91, + "stddev": 1.45, + "variance_pct": 252.07, + "samples": 25, + "throughput_kbs": 860 + } + } + } + }, + { + "tag": "v3.9.0", + "version": "3.9.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:33Z", + "benchmarks": { + "benchmark.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 32.62, + "max": 47.69, + "avg": 40.2, + "median": 39.67, + "stddev": 3.89, + "variance_pct": 37.47, + "samples": 25, + "throughput_kbs": 2592 + } + }, + "benchmark-v3.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.49, + "max": 8.91, + "avg": 2.56, + "median": 1.95, + "stddev": 1.55, + "variance_pct": 289.49, + "samples": 25, + "throughput_kbs": 1233 + } + }, + "benchmark-v37.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.2, + "max": 9.29, + "avg": 2.63, + "median": 2.03, + "stddev": 1.68, + "variance_pct": 307.32, + "samples": 25, + "throughput_kbs": 842 + } + }, + "benchmark-v39.less": { + "version": "3.9.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1554, + "fileSizeKB": 1.5, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 1.33, + "max": 11.52, + "avg": 3.12, + "median": 2.18, + "stddev": 2.18, + "variance_pct": 326.59, + "samples": 25, + "throughput_kbs": 486 + } + } + } + }, + { + "tag": "v3.10.0", + "version": "3.10.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:44Z", + "benchmarks": { + "benchmark.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 103.26, + "max": 176.43, + "avg": 125.98, + "median": 125.46, + "stddev": 15.69, + "variance_pct": 58.08, + "samples": 25, + "throughput_kbs": 827 + } + }, + "benchmark-v3.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 2.67, + "max": 8.79, + "avg": 4.63, + "median": 4.18, + "stddev": 1.6, + "variance_pct": 132.21, + "samples": 25, + "throughput_kbs": 683 + } + }, + "benchmark-v37.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 3.31, + "max": 19.77, + "avg": 5.42, + "median": 4.64, + "stddev": 3.33, + "variance_pct": 303.98, + "samples": 25, + "throughput_kbs": 409 + } + }, + "benchmark-v39.less": { + "version": "3.10.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1554, + "fileSizeKB": 1.5, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 4.5, + "max": 21.31, + "avg": 7.16, + "median": 6.55, + "stddev": 3.01, + "variance_pct": 234.62, + "samples": 25, + "throughput_kbs": 212 + } + } + } + }, + { + "tag": "v3.11.0", + "version": "3.11.0", + "node_version": "v18.20.8", + "date": "2026-03-09T18:54:56Z", + "benchmarks": { + "benchmark.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark.less", + "fileSize": 106712, + "fileSizeKB": 104.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 104.12, + "max": 154.95, + "avg": 122.9, + "median": 119.99, + "stddev": 12.94, + "variance_pct": 41.36, + "samples": 25, + "throughput_kbs": 848 + } + }, + "benchmark-v3.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark-v3.less", + "fileSize": 3237, + "fileSizeKB": 3.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 2.84, + "max": 9.74, + "avg": 4.69, + "median": 4.33, + "stddev": 1.66, + "variance_pct": 146.96, + "samples": 25, + "throughput_kbs": 673 + } + }, + "benchmark-v37.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark-v37.less", + "fileSize": 2270, + "fileSizeKB": 2.2, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 3.29, + "max": 14.99, + "avg": 5.88, + "median": 5.08, + "stddev": 2.63, + "variance_pct": 198.81, + "samples": 25, + "throughput_kbs": 377 + } + }, + "benchmark-v39.less": { + "version": "3.11.0", + "lessPath": ".", + "file": "benchmark-v39.less", + "fileSize": 1554, + "fileSizeKB": 1.5, + "totalRuns": 30, + "warmupRuns": 5, + "completedRuns": 30, + "render": { + "min": 9.79, + "max": 22.26, + "avg": 11.71, + "median": 11.12, + "stddev": 2.4, + "variance_pct": 106.47, + "samples": 25, + "throughput_kbs": 130 + } + } + } + }, + { + "tag": "v4.2.0", + "version": "4.2.0", + "node_version": "v20.19.6", + "date": "2026-03-09T18:55:29Z", + "benchmarks": { + "benchmark.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + }, + "benchmark-v3.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + }, + "benchmark-v37.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + }, + "benchmark-v39.less": { + "error": "Could not find Less compiler", + "tried": [ + "./packages/less", + ".", + "./lib/less-node", + "less" + ] + } + } + } + ] +} diff --git a/packages/less/benchmark/run-historical.sh b/packages/less/benchmark/run-historical.sh index 18c2aa085..af94b9c33 100755 --- a/packages/less/benchmark/run-historical.sh +++ b/packages/less/benchmark/run-historical.sh @@ -23,11 +23,15 @@ NODE_FOR_OLD="v18.20.8" # v2.x/v3.x NODE_FOR_NEW="v20.19.6" # v4.x NODE_DEFAULT="" # will be set to current -# All major/minor releases (no patches, no betas/RCs) +# Versions chosen to capture significant performance changes. +# Pruned from full v2.0–v4.5 benchmark data (2026-03-09, M4 Pro): +# Dropped v2.1 (broken), v2.5 (<1% from v2.4), v2.7 (<2% from v2.6), +# v3.6–v3.9 (all within 1ms of each other), v4.1 (<1% from v4.0). +# Use --versions to override with the full set if needed. ALL_VERSIONS=( - v2.0.0 v2.1.0 v2.2.0 v2.3.0 v2.4.0 v2.5.0 v2.6.0 v2.7.0 - v3.0.0 v3.5.0 v3.6.0 v3.7.0 v3.8.0 v3.9.0 v3.10.0 v3.11.0 v3.12.0 v3.13.0 - v4.0.0 v4.1.0 v4.2.0 v4.3.0 v4.4.0 + v2.0.0 v2.2.0 v2.3.1 v2.4.0 v2.6.1 + v3.0.4 v3.5.3 v3.10.3 v3.11.3 v3.12.2 + v4.0.0 v4.2.2 v4.3.0 v4.4.2 v4.5.1 ) VERSIONS=("${ALL_VERSIONS[@]}") @@ -126,6 +130,25 @@ print(json.dumps(info, indent=2)) mkdir -p "$RUNS_DIR" "$LATEST_DIR" "$WORKTREE_BASE" NODE_DEFAULT="$(node -v)" +# Shared TypeScript compiler fallback (for versions where npm install can't get tsc) +TSC_FALLBACK_DIR="$WORKTREE_BASE/.tsc-fallback" +TSC_FALLBACK="" +ensure_tsc_fallback() { + if [[ -n "$TSC_FALLBACK" ]] && [[ -x "$TSC_FALLBACK" ]]; then + return 0 + fi + log "Installing shared TypeScript compiler fallback..." + mkdir -p "$TSC_FALLBACK_DIR" + (cd "$TSC_FALLBACK_DIR" && npm install typescript@4.9.5 2>/dev/null) || true + TSC_FALLBACK="$TSC_FALLBACK_DIR/node_modules/.bin/tsc" + if [[ -x "$TSC_FALLBACK" ]]; then + log "Fallback tsc ready: $TSC_FALLBACK" + return 0 + fi + err "Could not install fallback tsc" + return 1 +} + # Record system info and derive system ID + run filename log "Recording system info..." SYSTEM_INFO_JSON="$(get_system_info)" @@ -192,33 +215,104 @@ for tag in "${VERSIONS[@]}"; do LESS_DIR="$WORKTREE/packages/less" BENCH_TARGET="$LESS_DIR/benchmark" - # Try npm install at root first (for lerna bootstrap) - npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || true - - # Install in packages/less specifically - pushd "$LESS_DIR" > /dev/null - npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || true + # v4.3+ uses workspace: protocol requiring pnpm; earlier v4.x uses npm + if grep -q '"workspace:' "$LESS_DIR/package.json" 2>/dev/null || \ + grep -q '"workspace:' "$WORKTREE/package.json" 2>/dev/null; then + log "Detected workspace: protocol, using pnpm..." + if command -v pnpm &>/dev/null; then + (cd "$WORKTREE" && pnpm install --ignore-scripts 2>/dev/null) || true + else + err "pnpm not available but needed for $tag workspace: deps" + # Fallback: install just typescript in packages/less + (cd "$LESS_DIR" && npm install typescript --no-save 2>/dev/null) || true + fi + else + # npm-based install for older v4.x / v3.12+ + npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || true + pushd "$LESS_DIR" > /dev/null + npm install --ignore-scripts --legacy-peer-deps 2>/dev/null || { + # npm install often fails on monorepo versions due to unpublished workspace + # packages (e.g. @less/test-import-module). Install runtime deps separately. + log "npm install failed, installing runtime deps separately..." + runtime_deps=$(python3 -c " +import json +with open('package.json') as f: + d = json.load(f) +deps = d.get('dependencies', {}) +# Print package@range pairs +for name, ver in deps.items(): + if not name.startswith('@less/'): + print(name + '@' + ver.lstrip('^~')) +" 2>/dev/null) + if [[ -n "$runtime_deps" ]]; then + deps_temp="$WORKTREE_BASE/.deps-temp" + mkdir -p "$deps_temp" + (cd "$deps_temp" && npm install $runtime_deps 2>/dev/null) || true + mkdir -p node_modules + # Copy all installed packages (including transitive deps) into node_modules + if [[ -d "$deps_temp/node_modules" ]]; then + cp -r "$deps_temp"/node_modules/* node_modules/ 2>/dev/null || true + # Also copy @scoped packages + for scope_dir in "$deps_temp"/node_modules/@*/; do + if [[ -d "$scope_dir" ]]; then + scope_name="$(basename "$scope_dir")" + mkdir -p "node_modules/$scope_name" + cp -r "$scope_dir"*/ "node_modules/$scope_name/" 2>/dev/null || true + fi + done + fi + fi + } + popd > /dev/null + fi # Build TypeScript + pushd "$LESS_DIR" > /dev/null log "Building TypeScript..." - if [[ -f "tsconfig.json" ]] || [[ -f "tsconfig.build.json" ]]; then - # Install typescript directly (npx tsc is intercepted by a placeholder package) - npm install typescript --no-save 2>/dev/null || true - TSC="./node_modules/.bin/tsc" - if [[ ! -x "$TSC" ]]; then - # Try parent node_modules - TSC="$WORKTREE/node_modules/.bin/tsc" + if [[ -f "tsconfig.build.json" ]] || [[ -f "tsconfig.json" ]]; then + # Find tsc: check local, root, system, then shared fallback + TSC="" + for tsc_path in \ + "./node_modules/.bin/tsc" \ + "$WORKTREE/node_modules/.bin/tsc"; do + if [[ -x "$tsc_path" ]]; then + TSC="$tsc_path" + break + fi + done + + if [[ -z "$TSC" ]]; then + # Try installing locally first + npm install typescript --no-save 2>/dev/null || true + if [[ -x "./node_modules/.bin/tsc" ]]; then + TSC="./node_modules/.bin/tsc" + else + # Use shared fallback tsc + ensure_tsc_fallback && TSC="$TSC_FALLBACK" + fi fi - $TSC -p tsconfig.build.json 2>/dev/null || $TSC -p tsconfig.json 2>/dev/null || { - err "TypeScript build failed for $tag, trying with skipLibCheck" - $TSC --skipLibCheck -p tsconfig.build.json 2>/dev/null || $TSC --skipLibCheck -p tsconfig.json 2>/dev/null || { - err "Build failed completely for $tag, skipping" - popd > /dev/null - popd > /dev/null - git -C "$REPO_ROOT" worktree remove --force "$WORKTREE" 2>/dev/null || true - continue + + if [[ -n "$TSC" ]] && [[ -x "$TSC" ]]; then + TSCONFIG="tsconfig.build.json" + [[ -f "$TSCONFIG" ]] || TSCONFIG="tsconfig.json" + + $TSC -p "$TSCONFIG" 2>/dev/null || { + log "Retrying tsc with --skipLibCheck..." + $TSC --skipLibCheck -p "$TSCONFIG" 2>/dev/null || { + err "Build failed completely for $tag, skipping" + popd > /dev/null + popd > /dev/null + git -C "$REPO_ROOT" worktree remove --force "$WORKTREE" 2>/dev/null || true + continue + } } - } + else + err "No tsc available for $tag, skipping" + popd > /dev/null + popd > /dev/null + git -C "$REPO_ROOT" worktree remove --force "$WORKTREE" 2>/dev/null || true + continue + fi fi popd > /dev/null else @@ -276,7 +370,9 @@ print(json.dumps({ # Run from the Less package directory so require() finds the compiler # Save result to temp file to avoid shell quoting issues result_file=$(mktemp) - (cd "$LESS_DIR" && node "$BENCH_TARGET/benchmark-runner.js" "$bench_path" "$RUNS" "$WARMUP" > "$result_file" 2>&1) || true + # Pass --math=always for consistent cross-version results + # (v4+ defaults to parens-division which changes evaluation behavior) + (cd "$LESS_DIR" && node "$BENCH_TARGET/benchmark-runner.js" "$bench_path" "$RUNS" "$WARMUP" --math=always > "$result_file" 2>&1) || true # Use python to safely merge results tag_json=$(python3 -c " diff --git a/packages/less/src/less/tree/ruleset.js b/packages/less/src/less/tree/ruleset.js index 72ccf4fb0..0aa93dddf 100644 --- a/packages/less/src/less/tree/ruleset.js +++ b/packages/less/src/less/tree/ruleset.js @@ -114,21 +114,17 @@ Ruleset.prototype = Object.assign(new Node(), { rules.length = 0; } - // inherit a function registry from the frames stack when possible; - // otherwise from the global registry - ruleset.functionRegistry = (function (frames) { - let i = 0; - const n = frames.length; - let found; - for ( ; i !== n ; ++i ) { - found = frames[ i ].functionRegistry; - if ( found ) { return found; } - } - return globalFunctionRegistry; - }(context.frames)).inherit(); - // push the current ruleset to the frames stack const ctxFrames = context.frames; + + // inherit a function registry from the frames stack when possible; + // otherwise from the global registry + let foundRegistry; + for (let fi = 0, fn = ctxFrames.length; fi !== fn; ++fi) { + foundRegistry = ctxFrames[fi].functionRegistry; + if (foundRegistry) { break; } + } + ruleset.functionRegistry = (foundRegistry || globalFunctionRegistry).inherit(); ctxFrames.unshift(ruleset); // currrent selectors @@ -382,9 +378,9 @@ Ruleset.prototype = Object.assign(new Node(), { } else { const nodes = []; - toParse.forEach(function(n) { - nodes.push(transformDeclaration.call(self, n)); - }); + for (let ti = 0; ti < toParse.length; ti++) { + nodes.push(transformDeclaration.call(self, toParse[ti])); + } return nodes; } }, diff --git a/packages/less/src/less/tree/selector.js b/packages/less/src/less/tree/selector.js index c2e7db063..b4acb1c55 100644 --- a/packages/less/src/less/tree/selector.js +++ b/packages/less/src/less/tree/selector.js @@ -120,8 +120,20 @@ Selector.prototype = Object.assign(new Node(), { let elements = this.elements; let extendList = this.extendList; - elements = elements && elements.map(function (e) { return e.eval(context); }); - extendList = extendList && extendList.map(function(extend) { return extend.eval(context); }); + if (elements) { + const evaldElements = new Array(elements.length); + for (let i = 0; i < elements.length; i++) { + evaldElements[i] = elements[i].eval(context); + } + elements = evaldElements; + } + if (extendList) { + const evaldExtends = new Array(extendList.length); + for (let i = 0; i < extendList.length; i++) { + evaldExtends[i] = extendList[i].eval(context); + } + extendList = evaldExtends; + } return this.createDerived(elements, extendList, evaldCondition); }, diff --git a/packages/less/src/less/visitors/extend-visitor.js b/packages/less/src/less/visitors/extend-visitor.js index b3dedc93f..fd70ece77 100644 --- a/packages/less/src/less/visitors/extend-visitor.js +++ b/packages/less/src/less/visitors/extend-visitor.js @@ -262,38 +262,37 @@ class ProcessExtendsVisitor { return; } let matches; - let pathIndex; - let extendIndex; const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1]; const selectorsToAdd = []; - const extendVisitor = this; - let selectorPath; + const paths = rulesetNode.paths; + const pathCount = paths.length; // look at each selector path in the ruleset, find any extend matches and then copy, find and replace - for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { - for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) { - selectorPath = rulesetNode.paths[pathIndex]; + for (let extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { + const extend = allExtends[extendIndex]; + for (let pathIndex = 0; pathIndex < pathCount; pathIndex++) { + const selectorPath = paths[pathIndex]; // extending extends happens initially, before the main pass if (rulesetNode.extendOnEveryPath) { continue; } const extendList = selectorPath[selectorPath.length - 1].extendList; if (extendList && extendList.length) { continue; } - matches = this.findMatch(allExtends[extendIndex], selectorPath); + matches = this.findMatch(extend, selectorPath); if (matches.length) { - allExtends[extendIndex].hasFoundMatches = true; + extend.hasFoundMatches = true; - allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) { - let extendedSelectors; - extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible()); - selectorsToAdd.push(extendedSelectors); - }); + const selfSelectors = extend.selfSelectors; + const isVisible = extend.isVisible(); + for (let si = 0; si < selfSelectors.length; si++) { + selectorsToAdd.push(this.extendSelector(matches, selectorPath, selfSelectors[si], isVisible)); + } } } } - rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd); + rulesetNode.paths = paths.concat(selectorsToAdd); } findMatch(extend, haystackSelectorPath) { @@ -308,7 +307,6 @@ class ProcessExtendsVisitor { let haystackElement; let targetCombinator; let i; - const extendVisitor = this; const needleElements = extend.selector.elements; const potentialMatches = []; let potentialMatch; @@ -340,7 +338,7 @@ class ProcessExtendsVisitor { } // if we don't match, null our match to indicate failure - if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || + if (!this.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) { potentialMatch = null; } else { From c21e465d585600a3f6947ae84b7032d152f55760 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 16:55:44 -0700 Subject: [PATCH 25/76] feat: migrate to native ESM with no build step (#4411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: migrate to native ESM with no build step - Rename src/ to lib/ — source files are shipped directly, no compilation - Add "type": "module" to package.json for native ESM support (Node 18+) - Convert bin/lessc, test files, and build scripts from CJS to ESM - Rename Gruntfile.js and .eslintrc.js to .cjs (must remain CommonJS) - Add .js extensions to all relative import paths for ESM resolution - Use createRequire() for optional dependency resolution (npm packages, JSON) - Configure TypeScript for check-only mode (noEmit: true, allowJs: true) - Update Rollup config to read from lib/ directly - Update CI matrix to drop Node 16 (minimum Node 18+) - Browser build is smaller: 500KB (was 509KB), minified 153KB (was 158KB) - All 139 tests pass * chore: fix trailing semicolons from linter * chore: gitignore generated .css.map files in lib/ * fix(ci): restore lts/-3 to test matrix * chore: stop tracking dist/ build artifacts Generated browser bundles don't need to be in source control — they're built during publish and included in the npm package via the files field. Removes duplicate copies from both root dist/ and packages/less/dist/. * fix(ci): use pnpm exec for playwright install npx doesn't reliably find binaries with pnpm. Since playwright is already a devDependency, use pnpm exec to run the installed version. * fix(ci): use pnpm --filter for playwright, disable fail-fast pnpm exec at workspace root can't find playwright binary since it's a devDependency of the less package. Use --filter to run in that context. Also disable fail-fast so all matrix jobs complete independently. * fix(ci): move playwright to root devDependencies Makes pnpm exec playwright work from workspace root in CI. * fix: upgrade copy-anything to v3 for ESM compat, fix Windows test paths copy-anything v2 lacks "type": "module", causing named import failures on Node 18. v3 has proper ESM exports. Revert testFolder to absolute path (matching original behavior) so debug test path replacements match Less compiler output on Windows. * chore: add CodeRabbit config to raise file review limit * fix: add files field to package.json, remove postinstall from published package Restricts npm package to only bin/, lib/, dist/, index.js, and README.md. Previously shipped test files, Gruntfile, eslint config, etc. Removes postinstall script (Playwright browser install) which only applies in the monorepo dev environment and fails when installed from npm. Verified: npm pack --dry-run shows 120 files (was 229), lessc CLI and API both work from a clean tarball install. --- .coderabbit.yaml | 2 + .github/workflows/ci.yml | 4 +- .gitignore | 3 + dist/less.js | 11964 ---------------- dist/less.min.js | 11 - dist/less.min.js.map | 1 - package.json | 1 + packages/less/{.eslintrc.js => .eslintrc.cjs} | 0 packages/less/.gitignore | 5 +- packages/less/{Gruntfile.js => Gruntfile.cjs} | 25 +- packages/less/bin/lessc | 36 +- packages/less/build/banner.js | 7 +- packages/less/build/rollup.js | 38 +- packages/less/dist/less.js | 11964 ---------------- packages/less/dist/less.min.js | 11 - packages/less/dist/less.min.js.map | 1 - .../less-browser/add-default-options.js | 4 +- .../{src => lib}/less-browser/bootstrap.js | 6 +- .../less/{src => lib}/less-browser/browser.js | 2 +- .../less/{src => lib}/less-browser/cache.js | 0 .../less-browser/error-reporting.js | 4 +- .../{src => lib}/less-browser/file-manager.js | 0 .../{src => lib}/less-browser/image-size.js | 2 +- .../less/{src => lib}/less-browser/index.js | 21 +- .../{src => lib}/less-browser/log-listener.js | 0 .../less-browser/plugin-loader.js | 0 .../less/{src => lib}/less-browser/utils.js | 0 packages/less/lib/less-node/environment.js | 43 + .../{src => lib}/less-node/file-manager.js | 5 +- packages/less/lib/less-node/fs.js | 12 + .../less/{src => lib}/less-node/image-size.js | 9 +- packages/less/lib/less-node/index.js | 31 + .../{src => lib}/less-node/lessc-helper.js | 5 +- .../{src => lib}/less-node/plugin-loader.js | 3 + .../less-node/url-file-manager.js | 6 +- packages/less/{src => lib}/less/constants.js | 0 packages/less/{src => lib}/less/contexts.js | 2 +- .../less/{src => lib}/less/data/colors.js | 0 packages/less/lib/less/data/index.js | 4 + .../less/data/unit-conversions.js | 0 .../less/{src => lib}/less/default-options.js | 0 .../less/{src => lib}/less/deprecation.js | 0 .../less/environment/abstract-file-manager.js | 0 .../environment/abstract-plugin-loader.js | 4 +- .../less/environment/environment-api.ts | 0 .../less/environment/environment.js | 2 +- .../less/environment/file-manager-api.ts | 0 .../{src => lib}/less/functions/boolean.js | 4 +- .../less/functions/color-blending.js | 2 +- .../less/{src => lib}/less/functions/color.js | 12 +- .../{src => lib}/less/functions/data-uri.js | 8 +- .../{src => lib}/less/functions/default.js | 4 +- .../less/functions/function-caller.js | 2 +- .../less/functions/function-registry.js | 0 .../less/{src => lib}/less/functions/index.js | 28 +- .../less/{src => lib}/less/functions/list.js | 20 +- .../less/functions/math-helper.js | 2 +- .../less/{src => lib}/less/functions/math.js | 0 .../{src => lib}/less/functions/number.js | 4 +- .../{src => lib}/less/functions/string.js | 6 +- .../less/{src => lib}/less/functions/style.js | 4 +- .../less/{src => lib}/less/functions/svg.js | 10 +- .../less/{src => lib}/less/functions/types.js | 16 +- .../less/{src => lib}/less/import-manager.js | 10 +- packages/less/{src => lib}/less/index.js | 43 +- packages/less/{src => lib}/less/less-error.js | 2 +- packages/less/{src => lib}/less/logger.js | 0 packages/less/{src => lib}/less/parse-tree.js | 16 +- packages/less/{src => lib}/less/parse.js | 10 +- .../{src => lib}/less/parser/parser-input.js | 0 .../less/{src => lib}/less/parser/parser.js | 22 +- .../less/{src => lib}/less/plugin-manager.js | 0 packages/less/{src => lib}/less/render.js | 2 +- .../{src => lib}/less/source-map-builder.js | 0 .../{src => lib}/less/source-map-output.js | 0 .../less/{src => lib}/less/transform-tree.js | 6 +- .../less/{src => lib}/less/tree/anonymous.js | 2 +- .../less/{src => lib}/less/tree/assignment.js | 2 +- .../{src => lib}/less/tree/atrule-syntax.js | 0 .../less/{src => lib}/less/tree/atrule.js | 12 +- .../less/{src => lib}/less/tree/attribute.js | 2 +- packages/less/{src => lib}/less/tree/call.js | 6 +- packages/less/{src => lib}/less/tree/color.js | 4 +- .../less/{src => lib}/less/tree/combinator.js | 2 +- .../less/{src => lib}/less/tree/comment.js | 4 +- .../less/{src => lib}/less/tree/condition.js | 2 +- .../less/{src => lib}/less/tree/container.js | 10 +- .../less/{src => lib}/less/tree/debug-info.js | 0 .../{src => lib}/less/tree/declaration.js | 10 +- .../less/tree/detached-ruleset.js | 6 +- .../less/{src => lib}/less/tree/dimension.js | 8 +- .../less/{src => lib}/less/tree/element.js | 6 +- .../less/{src => lib}/less/tree/expression.js | 10 +- .../less/{src => lib}/less/tree/extend.js | 4 +- .../less/{src => lib}/less/tree/import.js | 18 +- packages/less/lib/less/tree/index.js | 55 + .../less/{src => lib}/less/tree/javascript.js | 8 +- .../{src => lib}/less/tree/js-eval-node.js | 4 +- .../less/{src => lib}/less/tree/keyword.js | 2 +- packages/less/{src => lib}/less/tree/media.js | 10 +- .../{src => lib}/less/tree/merge-rules.js | 4 +- .../less/{src => lib}/less/tree/mixin-call.js | 8 +- .../less/tree/mixin-definition.js | 16 +- .../{src => lib}/less/tree/namespace-value.js | 8 +- .../less/{src => lib}/less/tree/negative.js | 6 +- .../{src => lib}/less/tree/nested-at-rule.js | 12 +- packages/less/{src => lib}/less/tree/node.js | 0 .../less/{src => lib}/less/tree/operation.js | 8 +- packages/less/{src => lib}/less/tree/paren.js | 2 +- .../less/{src => lib}/less/tree/property.js | 4 +- .../{src => lib}/less/tree/query-in-parens.js | 2 +- .../less/{src => lib}/less/tree/quoted.js | 6 +- .../less/{src => lib}/less/tree/ruleset.js | 28 +- .../less/{src => lib}/less/tree/selector.js | 10 +- .../less/tree/unicode-descriptor.js | 2 +- packages/less/{src => lib}/less/tree/unit.js | 6 +- packages/less/{src => lib}/less/tree/url.js | 2 +- packages/less/{src => lib}/less/tree/value.js | 2 +- .../{src => lib}/less/tree/variable-call.js | 10 +- .../less/{src => lib}/less/tree/variable.js | 4 +- packages/less/{src => lib}/less/utils.js | 2 +- .../less/visitors/extend-visitor.js | 8 +- .../less/visitors/import-sequencer.js | 0 .../less/visitors/import-visitor.js | 8 +- packages/less/lib/less/visitors/index.js | 15 + .../less/visitors/join-selector-visitor.js | 2 +- .../visitors/set-tree-visibility-visitor.js | 0 .../less/visitors/to-css-visitor.js | 6 +- .../{src => lib}/less/visitors/visitor.js | 2 +- packages/less/package.json | 38 +- packages/less/scripts/coverage-lines.js | 54 +- packages/less/scripts/coverage-report.js | 62 +- packages/less/scripts/postinstall.js | 37 +- packages/less/src/less-node/environment.js | 27 - packages/less/src/less-node/fs.js | 10 - packages/less/src/less-node/index.js | 22 - packages/less/src/less/data/index.js | 4 - packages/less/src/less/tree/index.js | 55 - packages/less/src/less/visitors/index.js | 15 - ...nchmark.config.js => benchmark.config.cjs} | 0 .../less/test/browser/generator/generate.cjs | 78 + .../less/test/browser/generator/generate.js | 86 +- .../less/test/browser/generator/runner.cjs | 2 + .../{runner.config.js => runner.config.cjs} | 10 +- .../less/test/browser/generator/runner.js | 4 +- .../generator/{template.js => template.cjs} | 2 +- .../browser/generator/{utils.js => utils.cjs} | 0 packages/less/test/index.js | 190 +- packages/less/test/less-test.js | 270 +- packages/less/test/mocha-playwright/runner.js | 12 +- packages/less/test/modify-vars.js | 13 +- .../filemanager/{index.js => index.cjs} | 0 .../postprocess/{index.js => index.cjs} | 0 .../preprocess/{index.js => index.cjs} | 0 .../plugins/visitor/{index.js => index.cjs} | 0 .../less/test/sourcemaps/comprehensive.json | 2 +- .../less/test/{test-es6.ts => test-es6.js} | 4 +- packages/less/tsconfig.build.json | 7 - packages/less/tsconfig.json | 24 +- .../filemanagerPlugin/styles.config.cjs | 2 +- .../postProcessorPlugin/styles.config.cjs | 2 +- .../preProcessorPlugin/styles.config.cjs | 2 +- .../visitorPlugin/styles.config.cjs | 2 +- pnpm-lock.yaml | 230 +- 164 files changed, 945 insertions(+), 25162 deletions(-) create mode 100644 .coderabbit.yaml delete mode 100644 dist/less.js delete mode 100644 dist/less.min.js delete mode 100644 dist/less.min.js.map rename packages/less/{.eslintrc.js => .eslintrc.cjs} (100%) rename packages/less/{Gruntfile.js => Gruntfile.cjs} (94%) delete mode 100644 packages/less/dist/less.js delete mode 100644 packages/less/dist/less.min.js delete mode 100644 packages/less/dist/less.min.js.map rename packages/less/{src => lib}/less-browser/add-default-options.js (95%) rename packages/less/{src => lib}/less-browser/bootstrap.js (91%) rename packages/less/{src => lib}/less-browser/browser.js (98%) rename packages/less/{src => lib}/less-browser/cache.js (100%) rename packages/less/{src => lib}/less-browser/error-reporting.js (98%) rename packages/less/{src => lib}/less-browser/file-manager.js (100%) rename packages/less/{src => lib}/less-browser/image-size.js (98%) rename packages/less/{src => lib}/less-browser/index.js (95%) rename packages/less/{src => lib}/less-browser/log-listener.js (100%) rename packages/less/{src => lib}/less-browser/plugin-loader.js (100%) rename packages/less/{src => lib}/less-browser/utils.js (100%) create mode 100644 packages/less/lib/less-node/environment.js rename packages/less/{src => lib}/less-node/file-manager.js (98%) create mode 100644 packages/less/lib/less-node/fs.js rename packages/less/{src => lib}/less-node/image-size.js (90%) create mode 100644 packages/less/lib/less-node/index.js rename packages/less/{src => lib}/less-node/lessc-helper.js (97%) rename packages/less/{src => lib}/less-node/plugin-loader.js (95%) rename packages/less/{src => lib}/less-node/url-file-manager.js (94%) rename packages/less/{src => lib}/less/constants.js (100%) rename packages/less/{src => lib}/less/contexts.js (99%) rename packages/less/{src => lib}/less/data/colors.js (100%) create mode 100644 packages/less/lib/less/data/index.js rename packages/less/{src => lib}/less/data/unit-conversions.js (100%) rename packages/less/{src => lib}/less/default-options.js (100%) rename packages/less/{src => lib}/less/deprecation.js (100%) rename packages/less/{src => lib}/less/environment/abstract-file-manager.js (100%) rename packages/less/{src => lib}/less/environment/abstract-plugin-loader.js (98%) rename packages/less/{src => lib}/less/environment/environment-api.ts (100%) rename packages/less/{src => lib}/less/environment/environment.js (98%) rename packages/less/{src => lib}/less/environment/file-manager-api.ts (100%) rename packages/less/{src => lib}/less/functions/boolean.js (87%) rename packages/less/{src => lib}/less/functions/color-blending.js (98%) rename packages/less/{src => lib}/less/functions/color.js (98%) rename packages/less/{src => lib}/less/functions/data-uri.js (94%) rename packages/less/{src => lib}/less/functions/default.js (85%) rename packages/less/{src => lib}/less/functions/function-caller.js (97%) rename packages/less/{src => lib}/less/functions/function-registry.js (100%) rename packages/less/{src => lib}/less/functions/index.js (57%) rename packages/less/{src => lib}/less/functions/list.js (90%) rename packages/less/{src => lib}/less/functions/math-helper.js (87%) rename packages/less/{src => lib}/less/functions/math.js (100%) rename packages/less/{src => lib}/less/functions/number.js (97%) rename packages/less/{src => lib}/less/functions/string.js (91%) rename packages/less/{src => lib}/less/functions/style.js (90%) rename packages/less/{src => lib}/less/functions/svg.js (94%) rename packages/less/{src => lib}/less/functions/types.js (83%) rename packages/less/{src => lib}/less/import-manager.js (97%) rename packages/less/{src => lib}/less/index.js (72%) rename packages/less/{src => lib}/less/less-error.js (99%) rename packages/less/{src => lib}/less/logger.js (100%) rename packages/less/{src => lib}/less/parse-tree.js (93%) rename packages/less/{src => lib}/less/parse.js (93%) rename packages/less/{src => lib}/less/parser/parser-input.js (100%) rename packages/less/{src => lib}/less/parser/parser.js (99%) rename packages/less/{src => lib}/less/plugin-manager.js (100%) rename packages/less/{src => lib}/less/render.js (97%) rename packages/less/{src => lib}/less/source-map-builder.js (100%) rename packages/less/{src => lib}/less/source-map-output.js (100%) rename packages/less/{src => lib}/less/transform-tree.js (96%) rename packages/less/{src => lib}/less/tree/anonymous.js (97%) rename packages/less/{src => lib}/less/tree/assignment.js (95%) rename packages/less/{src => lib}/less/tree/atrule-syntax.js (100%) rename packages/less/{src => lib}/less/tree/atrule.js (97%) rename packages/less/{src => lib}/less/tree/attribute.js (96%) rename packages/less/{src => lib}/less/tree/call.js (96%) rename packages/less/{src => lib}/less/tree/color.js (99%) rename packages/less/{src => lib}/less/tree/combinator.js (95%) rename packages/less/{src => lib}/less/tree/comment.js (90%) rename packages/less/{src => lib}/less/tree/condition.js (97%) rename packages/less/{src => lib}/less/tree/container.js (90%) rename packages/less/{src => lib}/less/tree/debug-info.js (100%) rename packages/less/{src => lib}/less/tree/declaration.js (95%) rename packages/less/{src => lib}/less/tree/detached-ruleset.js (86%) rename packages/less/{src => lib}/less/tree/dimension.js (97%) rename packages/less/{src => lib}/less/tree/element.js (95%) rename packages/less/{src => lib}/less/tree/expression.js (92%) rename packages/less/{src => lib}/less/tree/extend.js (96%) rename packages/less/{src => lib}/less/tree/import.js (96%) create mode 100644 packages/less/lib/less/tree/index.js rename packages/less/{src => lib}/less/tree/javascript.js (83%) rename packages/less/{src => lib}/less/tree/js-eval-node.js (96%) rename packages/less/{src => lib}/less/tree/keyword.js (93%) rename packages/less/{src => lib}/less/tree/media.js (90%) rename packages/less/{src => lib}/less/tree/merge-rules.js (93%) rename packages/less/{src => lib}/less/tree/mixin-call.js (97%) rename packages/less/{src => lib}/less/tree/mixin-definition.js (95%) rename packages/less/{src => lib}/less/tree/namespace-value.js (94%) rename packages/less/{src => lib}/less/tree/negative.js (81%) rename packages/less/{src => lib}/less/tree/nested-at-rule.js (94%) rename packages/less/{src => lib}/less/tree/node.js (100%) rename packages/less/{src => lib}/less/tree/operation.js (91%) rename packages/less/{src => lib}/less/tree/paren.js (94%) rename packages/less/{src => lib}/less/tree/property.js (96%) rename packages/less/{src => lib}/less/tree/query-in-parens.js (97%) rename packages/less/{src => lib}/less/tree/quoted.js (95%) rename packages/less/{src => lib}/less/tree/ruleset.js (98%) rename packages/less/{src => lib}/less/tree/selector.js (96%) rename packages/less/{src => lib}/less/tree/unicode-descriptor.js (86%) rename packages/less/{src => lib}/less/tree/unit.js (96%) rename packages/less/{src => lib}/less/tree/url.js (98%) rename packages/less/{src => lib}/less/tree/value.js (97%) rename packages/less/{src => lib}/less/tree/variable-call.js (85%) rename packages/less/{src => lib}/less/tree/variable.js (96%) rename packages/less/{src => lib}/less/utils.js (98%) rename packages/less/{src => lib}/less/visitors/extend-visitor.js (99%) rename packages/less/{src => lib}/less/visitors/import-sequencer.js (100%) rename packages/less/{src => lib}/less/visitors/import-visitor.js (97%) create mode 100644 packages/less/lib/less/visitors/index.js rename packages/less/{src => lib}/less/visitors/join-selector-visitor.js (98%) rename packages/less/{src => lib}/less/visitors/set-tree-visibility-visitor.js (100%) rename packages/less/{src => lib}/less/visitors/to-css-visitor.js (98%) rename packages/less/{src => lib}/less/visitors/visitor.js (99%) delete mode 100644 packages/less/src/less-node/environment.js delete mode 100644 packages/less/src/less-node/fs.js delete mode 100644 packages/less/src/less-node/index.js delete mode 100644 packages/less/src/less/data/index.js delete mode 100644 packages/less/src/less/tree/index.js delete mode 100644 packages/less/src/less/visitors/index.js rename packages/less/test/browser/generator/{benchmark.config.js => benchmark.config.cjs} (100%) create mode 100644 packages/less/test/browser/generator/generate.cjs create mode 100644 packages/less/test/browser/generator/runner.cjs rename packages/less/test/browser/generator/{runner.config.js => runner.config.cjs} (96%) rename packages/less/test/browser/generator/{template.js => template.cjs} (98%) rename packages/less/test/browser/generator/{utils.js => utils.cjs} (100%) rename packages/less/test/plugins/filemanager/{index.js => index.cjs} (100%) rename packages/less/test/plugins/postprocess/{index.js => index.cjs} (100%) rename packages/less/test/plugins/preprocess/{index.js => index.cjs} (100%) rename packages/less/test/plugins/visitor/{index.js => index.cjs} (100%) rename packages/less/test/{test-es6.ts => test-es6.js} (76%) delete mode 100644 packages/less/tsconfig.build.json diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000..5f3e6ba80 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,2 @@ +reviews: + max_files: 200 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fb80138d..382333bb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: test: name: 'Tests on ${{matrix.os}} with Node "${{matrix.node}}"' strategy: + fail-fast: false matrix: # Test all mainstream operating systems os: [ubuntu-latest, macos-latest, windows-latest] @@ -40,8 +41,7 @@ jobs: run: pnpm install - name: Print put node & npm version run: node --version && pnpm --version - # Pin the version of Playwright to match package.json to avoid installing a newer version which may expect different binaries - name: Install chromium - run: npx playwright@1.50.1 install chromium + run: pnpm exec playwright install chromium - name: Run unit test run: pnpm run test diff --git a/.gitignore b/.gitignore index bb333eee6..4bfd00f50 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ npm-debug.log .nyc_output coverage *.lcov + +# Build output +dist diff --git a/dist/less.js b/dist/less.js deleted file mode 100644 index 0883ae41c..000000000 --- a/dist/less.js +++ /dev/null @@ -1,11964 +0,0 @@ -/** - * Less - Leaner CSS v4.4.2 - * http://lesscss.org - * - * Copyright (c) 2009-2025, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - * @license Apache-2.0 - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.less = factory()); -})(this, (function () { 'use strict'; - - // Export a new default each time - function defaultOptions () { - return { - /* Inline Javascript - @plugin still allowed */ - javascriptEnabled: false, - /* Outputs a makefile import dependency list to stdout. */ - depends: false, - /* (DEPRECATED) Compress using less built-in compression. - * This does an okay job but does not utilise all the tricks of - * dedicated css compression. */ - compress: false, - /* Runs the less parser and just reports errors without any output. */ - lint: false, - /* Sets available include paths. - * If the file in an @import rule does not exist at that exact location, - * less will look for it at the location(s) passed to this option. - * You might use this for instance to specify a path to a library which - * you want to be referenced simply and relatively in the less files. */ - paths: [], - /* color output in the terminal */ - color: true, - /* The strictImports controls whether the compiler will allow an @import inside of either - * @media blocks or (a later addition) other selector blocks. - * See: https://github.com/less/less.js/issues/656 */ - strictImports: false, - /* Allow Imports from Insecure HTTPS Hosts */ - insecure: false, - /* Allows you to add a path to every generated import and url in your css. - * This does not affect less import statements that are processed, just ones - * that are left in the output css. */ - rootpath: '', - /* By default URLs are kept as-is, so if you import a file in a sub-directory - * that references an image, exactly the same URL will be output in the css. - * This option allows you to re-write URL's in imported files so that the - * URL is always relative to the base imported file */ - rewriteUrls: false, - /* How to process math - * 0 always - eagerly try to solve all operations - * 1 parens-division - require parens for division "/" - * 2 parens | strict - require parens for all operations - * 3 strict-legacy - legacy strict behavior (super-strict) - */ - math: 1, - /* Without this option, less attempts to guess at the output unit when it does maths. */ - strictUnits: false, - /* Effectively the declaration is put at the top of your base Less file, - * meaning it can be used but it also can be overridden if this variable - * is defined in the file. */ - globalVars: null, - /* As opposed to the global variable option, this puts the declaration at the - * end of your base file, meaning it will override anything defined in your Less file. */ - modifyVars: null, - /* This option allows you to specify a argument to go on to every URL. */ - urlArgs: '' - }; - } - - function extractId(href) { - return href.replace(/^[a-z-]+:\/+?[^/]+/, '') // Remove protocol & domain - .replace(/[?&]livereload=\w+/, '') // Remove LiveReload cachebuster - .replace(/^\//, '') // Remove root / - .replace(/\.[a-zA-Z]+$/, '') // Remove simple extension - .replace(/[^.\w-]+/g, '-') // Replace illegal characters - .replace(/\./g, ':'); // Replace dots with colons(for valid id) - } - function addDataAttr(options, tag) { - if (!tag) { - return; - } // in case of tag is null or undefined - for (var opt in tag.dataset) { - if (Object.prototype.hasOwnProperty.call(tag.dataset, opt)) { - if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') { - options[opt] = tag.dataset[opt]; - } - else { - try { - options[opt] = JSON.parse(tag.dataset[opt]); - } - catch (_) { } - } - } - } - } - - var browser = { - createCSS: function (document, styles, sheet) { - // Strip the query-string - var href = sheet.href || ''; - // If there is no title set, use the filename, minus the extension - var id = "less:".concat(sheet.title || extractId(href)); - // If this has already been inserted into the DOM, we may need to replace it - var oldStyleNode = document.getElementById(id); - var keepOldStyleNode = false; - // Create a new stylesheet node for insertion or (if necessary) replacement - var styleNode = document.createElement('style'); - styleNode.setAttribute('type', 'text/css'); - if (sheet.media) { - styleNode.setAttribute('media', sheet.media); - } - styleNode.id = id; - if (!styleNode.styleSheet) { - styleNode.appendChild(document.createTextNode(styles)); - // If new contents match contents of oldStyleNode, don't replace oldStyleNode - keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 && - oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue); - } - var head = document.getElementsByTagName('head')[0]; - // If there is no oldStyleNode, just append; otherwise, only append if we need - // to replace oldStyleNode with an updated stylesheet - if (oldStyleNode === null || keepOldStyleNode === false) { - var nextEl = sheet && sheet.nextSibling || null; - if (nextEl) { - nextEl.parentNode.insertBefore(styleNode, nextEl); - } - else { - head.appendChild(styleNode); - } - } - if (oldStyleNode && keepOldStyleNode === false) { - oldStyleNode.parentNode.removeChild(oldStyleNode); - } - // For IE. - // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash. - // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head - if (styleNode.styleSheet) { - try { - styleNode.styleSheet.cssText = styles; - } - catch (e) { - throw new Error('Couldn\'t reassign styleSheet.cssText.'); - } - } - }, - currentScript: function (window) { - var document = window.document; - return document.currentScript || (function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - })(); - } - }; - - var addDefaultOptions = (function (window, options) { - // use options from the current script tag data attribues - addDataAttr(options, browser.currentScript(window)); - if (options.isFileProtocol === undefined) { - options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol); - } - // Load styles asynchronously (default: false) - // - // This is set to `false` by default, so that the body - // doesn't start loading before the stylesheets are parsed. - // Setting this to `true` can result in flickering. - // - options.async = options.async || false; - options.fileAsync = options.fileAsync || false; - // Interval between watch polls - options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500); - options.env = options.env || (window.location.hostname == '127.0.0.1' || - window.location.hostname == '0.0.0.0' || - window.location.hostname == 'localhost' || - (window.location.port && - window.location.port.length > 0) || - options.isFileProtocol ? 'development' - : 'production'); - var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash); - if (dumpLineNumbers) { - options.dumpLineNumbers = dumpLineNumbers[1]; - } - if (options.useFileCache === undefined) { - options.useFileCache = true; - } - if (options.onReady === undefined) { - options.onReady = true; - } - if (options.relativeUrls) { - options.rewriteUrls = 'all'; - } - }); - - var logger$1 = { - error: function (msg) { - this._fireEvent('error', msg); - }, - warn: function (msg) { - this._fireEvent('warn', msg); - }, - info: function (msg) { - this._fireEvent('info', msg); - }, - debug: function (msg) { - this._fireEvent('debug', msg); - }, - addListener: function (listener) { - this._listeners.push(listener); - }, - removeListener: function (listener) { - for (var i_1 = 0; i_1 < this._listeners.length; i_1++) { - if (this._listeners[i_1] === listener) { - this._listeners.splice(i_1, 1); - return; - } - } - }, - _fireEvent: function (type, msg) { - for (var i_2 = 0; i_2 < this._listeners.length; i_2++) { - var logFunction = this._listeners[i_2][type]; - if (logFunction) { - logFunction(msg); - } - } - }, - _listeners: [] - }; - - /** - * @todo Document why this abstraction exists, and the relationship between - * environment, file managers, and plugin manager - */ - var Environment = /** @class */ (function () { - function Environment(externalEnvironment, fileManagers) { - this.fileManagers = fileManagers || []; - externalEnvironment = externalEnvironment || {}; - var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator']; - var requiredFunctions = []; - var functions = requiredFunctions.concat(optionalFunctions); - for (var i_1 = 0; i_1 < functions.length; i_1++) { - var propName = functions[i_1]; - var environmentFunc = externalEnvironment[propName]; - if (environmentFunc) { - this[propName] = environmentFunc.bind(externalEnvironment); - } - else if (i_1 < requiredFunctions.length) { - this.warn("missing required function in environment - ".concat(propName)); - } - } - } - Environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) { - if (!filename) { - logger$1.warn('getFileManager called with no filename.. Please report this issue. continuing.'); - } - if (currentDirectory === undefined) { - logger$1.warn('getFileManager called with null directory.. Please report this issue. continuing.'); - } - var fileManagers = this.fileManagers; - if (options.pluginManager) { - fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers()); - } - for (var i_2 = fileManagers.length - 1; i_2 >= 0; i_2--) { - var fileManager = fileManagers[i_2]; - if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) { - return fileManager; - } - } - return null; - }; - Environment.prototype.addFileManager = function (fileManager) { - this.fileManagers.push(fileManager); - }; - Environment.prototype.clearFileManagers = function () { - this.fileManagers = []; - }; - return Environment; - }()); - - var colors = { - 'aliceblue': '#f0f8ff', - 'antiquewhite': '#faebd7', - 'aqua': '#00ffff', - 'aquamarine': '#7fffd4', - 'azure': '#f0ffff', - 'beige': '#f5f5dc', - 'bisque': '#ffe4c4', - 'black': '#000000', - 'blanchedalmond': '#ffebcd', - 'blue': '#0000ff', - 'blueviolet': '#8a2be2', - 'brown': '#a52a2a', - 'burlywood': '#deb887', - 'cadetblue': '#5f9ea0', - 'chartreuse': '#7fff00', - 'chocolate': '#d2691e', - 'coral': '#ff7f50', - 'cornflowerblue': '#6495ed', - 'cornsilk': '#fff8dc', - 'crimson': '#dc143c', - 'cyan': '#00ffff', - 'darkblue': '#00008b', - 'darkcyan': '#008b8b', - 'darkgoldenrod': '#b8860b', - 'darkgray': '#a9a9a9', - 'darkgrey': '#a9a9a9', - 'darkgreen': '#006400', - 'darkkhaki': '#bdb76b', - 'darkmagenta': '#8b008b', - 'darkolivegreen': '#556b2f', - 'darkorange': '#ff8c00', - 'darkorchid': '#9932cc', - 'darkred': '#8b0000', - 'darksalmon': '#e9967a', - 'darkseagreen': '#8fbc8f', - 'darkslateblue': '#483d8b', - 'darkslategray': '#2f4f4f', - 'darkslategrey': '#2f4f4f', - 'darkturquoise': '#00ced1', - 'darkviolet': '#9400d3', - 'deeppink': '#ff1493', - 'deepskyblue': '#00bfff', - 'dimgray': '#696969', - 'dimgrey': '#696969', - 'dodgerblue': '#1e90ff', - 'firebrick': '#b22222', - 'floralwhite': '#fffaf0', - 'forestgreen': '#228b22', - 'fuchsia': '#ff00ff', - 'gainsboro': '#dcdcdc', - 'ghostwhite': '#f8f8ff', - 'gold': '#ffd700', - 'goldenrod': '#daa520', - 'gray': '#808080', - 'grey': '#808080', - 'green': '#008000', - 'greenyellow': '#adff2f', - 'honeydew': '#f0fff0', - 'hotpink': '#ff69b4', - 'indianred': '#cd5c5c', - 'indigo': '#4b0082', - 'ivory': '#fffff0', - 'khaki': '#f0e68c', - 'lavender': '#e6e6fa', - 'lavenderblush': '#fff0f5', - 'lawngreen': '#7cfc00', - 'lemonchiffon': '#fffacd', - 'lightblue': '#add8e6', - 'lightcoral': '#f08080', - 'lightcyan': '#e0ffff', - 'lightgoldenrodyellow': '#fafad2', - 'lightgray': '#d3d3d3', - 'lightgrey': '#d3d3d3', - 'lightgreen': '#90ee90', - 'lightpink': '#ffb6c1', - 'lightsalmon': '#ffa07a', - 'lightseagreen': '#20b2aa', - 'lightskyblue': '#87cefa', - 'lightslategray': '#778899', - 'lightslategrey': '#778899', - 'lightsteelblue': '#b0c4de', - 'lightyellow': '#ffffe0', - 'lime': '#00ff00', - 'limegreen': '#32cd32', - 'linen': '#faf0e6', - 'magenta': '#ff00ff', - 'maroon': '#800000', - 'mediumaquamarine': '#66cdaa', - 'mediumblue': '#0000cd', - 'mediumorchid': '#ba55d3', - 'mediumpurple': '#9370d8', - 'mediumseagreen': '#3cb371', - 'mediumslateblue': '#7b68ee', - 'mediumspringgreen': '#00fa9a', - 'mediumturquoise': '#48d1cc', - 'mediumvioletred': '#c71585', - 'midnightblue': '#191970', - 'mintcream': '#f5fffa', - 'mistyrose': '#ffe4e1', - 'moccasin': '#ffe4b5', - 'navajowhite': '#ffdead', - 'navy': '#000080', - 'oldlace': '#fdf5e6', - 'olive': '#808000', - 'olivedrab': '#6b8e23', - 'orange': '#ffa500', - 'orangered': '#ff4500', - 'orchid': '#da70d6', - 'palegoldenrod': '#eee8aa', - 'palegreen': '#98fb98', - 'paleturquoise': '#afeeee', - 'palevioletred': '#d87093', - 'papayawhip': '#ffefd5', - 'peachpuff': '#ffdab9', - 'peru': '#cd853f', - 'pink': '#ffc0cb', - 'plum': '#dda0dd', - 'powderblue': '#b0e0e6', - 'purple': '#800080', - 'rebeccapurple': '#663399', - 'red': '#ff0000', - 'rosybrown': '#bc8f8f', - 'royalblue': '#4169e1', - 'saddlebrown': '#8b4513', - 'salmon': '#fa8072', - 'sandybrown': '#f4a460', - 'seagreen': '#2e8b57', - 'seashell': '#fff5ee', - 'sienna': '#a0522d', - 'silver': '#c0c0c0', - 'skyblue': '#87ceeb', - 'slateblue': '#6a5acd', - 'slategray': '#708090', - 'slategrey': '#708090', - 'snow': '#fffafa', - 'springgreen': '#00ff7f', - 'steelblue': '#4682b4', - 'tan': '#d2b48c', - 'teal': '#008080', - 'thistle': '#d8bfd8', - 'tomato': '#ff6347', - 'turquoise': '#40e0d0', - 'violet': '#ee82ee', - 'wheat': '#f5deb3', - 'white': '#ffffff', - 'whitesmoke': '#f5f5f5', - 'yellow': '#ffff00', - 'yellowgreen': '#9acd32' - }; - - var unitConversions = { - length: { - 'm': 1, - 'cm': 0.01, - 'mm': 0.001, - 'in': 0.0254, - 'px': 0.0254 / 96, - 'pt': 0.0254 / 72, - 'pc': 0.0254 / 72 * 12 - }, - duration: { - 's': 1, - 'ms': 0.001 - }, - angle: { - 'rad': 1 / (2 * Math.PI), - 'deg': 1 / 360, - 'grad': 1 / 400, - 'turn': 1 - } - }; - - var data = { colors: colors, unitConversions: unitConversions }; - - /** - * The reason why Node is a class and other nodes simply do not extend - * from Node (since we're transpiling) is due to this issue: - * - * @see https://github.com/less/less.js/issues/3434 - */ - var Node = /** @class */ (function () { - function Node() { - this.parent = null; - this.visibilityBlocks = undefined; - this.nodeVisible = undefined; - this.rootNode = null; - this.parsed = null; - } - Object.defineProperty(Node.prototype, "currentFileInfo", { - get: function () { - return this.fileInfo(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Node.prototype, "index", { - get: function () { - return this.getIndex(); - }, - enumerable: false, - configurable: true - }); - Node.prototype.setParent = function (nodes, parent) { - function set(node) { - if (node && node instanceof Node) { - node.parent = parent; - } - } - if (Array.isArray(nodes)) { - nodes.forEach(set); - } - else { - set(nodes); - } - }; - Node.prototype.getIndex = function () { - return this._index || (this.parent && this.parent.getIndex()) || 0; - }; - Node.prototype.fileInfo = function () { - return this._fileInfo || (this.parent && this.parent.fileInfo()) || {}; - }; - Node.prototype.isRulesetLike = function () { return false; }; - Node.prototype.toCSS = function (context) { - var strs = []; - this.genCSS(context, { - // remove when genCSS has JSDoc types - // eslint-disable-next-line no-unused-vars - add: function (chunk, fileInfo, index) { - strs.push(chunk); - }, - isEmpty: function () { - return strs.length === 0; - } - }); - return strs.join(''); - }; - Node.prototype.genCSS = function (context, output) { - output.add(this.value); - }; - Node.prototype.accept = function (visitor) { - this.value = visitor.visit(this.value); - }; - Node.prototype.eval = function () { return this; }; - Node.prototype._operate = function (context, op, a, b) { - switch (op) { - case '+': return a + b; - case '-': return a - b; - case '*': return a * b; - case '/': return a / b; - } - }; - Node.prototype.fround = function (context, value) { - var precision = context && context.numPrecision; - // add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded: - return (precision) ? Number((value + 2e-16).toFixed(precision)) : value; - }; - Node.compare = function (a, b) { - /* returns: - -1: a < b - 0: a = b - 1: a > b - and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */ - if ((a.compare) && - // for "symmetric results" force toCSS-based comparison - // of Quoted or Anonymous if either value is one of those - !(b.type === 'Quoted' || b.type === 'Anonymous')) { - return a.compare(b); - } - else if (b.compare) { - return -b.compare(a); - } - else if (a.type !== b.type) { - return undefined; - } - a = a.value; - b = b.value; - if (!Array.isArray(a)) { - return a === b ? 0 : undefined; - } - if (a.length !== b.length) { - return undefined; - } - for (var i_1 = 0; i_1 < a.length; i_1++) { - if (Node.compare(a[i_1], b[i_1]) !== 0) { - return undefined; - } - } - return 0; - }; - Node.numericCompare = function (a, b) { - return a < b ? -1 - : a === b ? 0 - : a > b ? 1 : undefined; - }; - // Returns true if this node represents root of ast imported by reference - Node.prototype.blocksVisibility = function () { - if (this.visibilityBlocks === undefined) { - this.visibilityBlocks = 0; - } - return this.visibilityBlocks !== 0; - }; - Node.prototype.addVisibilityBlock = function () { - if (this.visibilityBlocks === undefined) { - this.visibilityBlocks = 0; - } - this.visibilityBlocks = this.visibilityBlocks + 1; - }; - Node.prototype.removeVisibilityBlock = function () { - if (this.visibilityBlocks === undefined) { - this.visibilityBlocks = 0; - } - this.visibilityBlocks = this.visibilityBlocks - 1; - }; - // Turns on node visibility - if called node will be shown in output regardless - // of whether it comes from import by reference or not - Node.prototype.ensureVisibility = function () { - this.nodeVisible = true; - }; - // Turns off node visibility - if called node will NOT be shown in output regardless - // of whether it comes from import by reference or not - Node.prototype.ensureInvisibility = function () { - this.nodeVisible = false; - }; - // return values: - // false - the node must not be visible - // true - the node must be visible - // undefined or null - the node has the same visibility as its parent - Node.prototype.isVisible = function () { - return this.nodeVisible; - }; - Node.prototype.visibilityInfo = function () { - return { - visibilityBlocks: this.visibilityBlocks, - nodeVisible: this.nodeVisible - }; - }; - Node.prototype.copyVisibilityInfo = function (info) { - if (!info) { - return; - } - this.visibilityBlocks = info.visibilityBlocks; - this.nodeVisible = info.nodeVisible; - }; - return Node; - }()); - - // - // RGB Colors - #ff0014, #eee - // - var Color = function (rgb, a, originalForm) { - var self = this; - // - // The end goal here, is to parse the arguments - // into an integer triplet, such as `128, 255, 0` - // - // This facilitates operations and conversions. - // - if (Array.isArray(rgb)) { - this.rgb = rgb; - } - else if (rgb.length >= 6) { - this.rgb = []; - rgb.match(/.{2}/g).map(function (c, i) { - if (i < 3) { - self.rgb.push(parseInt(c, 16)); - } - else { - self.alpha = (parseInt(c, 16)) / 255; - } - }); - } - else { - this.rgb = []; - rgb.split('').map(function (c, i) { - if (i < 3) { - self.rgb.push(parseInt(c + c, 16)); - } - else { - self.alpha = (parseInt(c + c, 16)) / 255; - } - }); - } - this.alpha = this.alpha || (typeof a === 'number' ? a : 1); - if (typeof originalForm !== 'undefined') { - this.value = originalForm; - } - }; - Color.prototype = Object.assign(new Node(), { - type: 'Color', - luma: function () { - var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255; - r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4); - g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4); - b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4); - return 0.2126 * r + 0.7152 * g + 0.0722 * b; - }, - genCSS: function (context, output) { - output.add(this.toCSS(context)); - }, - toCSS: function (context, doNotCompress) { - var compress = context && context.compress && !doNotCompress; - var color; - var alpha; - var colorFunction; - var args = []; - // `value` is set if this color was originally - // converted from a named color string so we need - // to respect this and try to output named color too. - alpha = this.fround(context, this.alpha); - if (this.value) { - if (this.value.indexOf('rgb') === 0) { - if (alpha < 1) { - colorFunction = 'rgba'; - } - } - else if (this.value.indexOf('hsl') === 0) { - if (alpha < 1) { - colorFunction = 'hsla'; - } - else { - colorFunction = 'hsl'; - } - } - else { - return this.value; - } - } - else { - if (alpha < 1) { - colorFunction = 'rgba'; - } - } - switch (colorFunction) { - case 'rgba': - args = this.rgb.map(function (c) { - return clamp$1(Math.round(c), 255); - }).concat(clamp$1(alpha, 1)); - break; - case 'hsla': - args.push(clamp$1(alpha, 1)); - // eslint-disable-next-line no-fallthrough - case 'hsl': - color = this.toHSL(); - args = [ - this.fround(context, color.h), - "".concat(this.fround(context, color.s * 100), "%"), - "".concat(this.fround(context, color.l * 100), "%") - ].concat(args); - } - if (colorFunction) { - // Values are capped between `0` and `255`, rounded and zero-padded. - return "".concat(colorFunction, "(").concat(args.join(",".concat(compress ? '' : ' ')), ")"); - } - color = this.toRGB(); - if (compress) { - var splitcolor = color.split(''); - // Convert color to short format - if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) { - color = "#".concat(splitcolor[1]).concat(splitcolor[3]).concat(splitcolor[5]); - } - } - return color; - }, - // - // Operations have to be done per-channel, if not, - // channels will spill onto each other. Once we have - // our result, in the form of an integer triplet, - // we create a new Color node to hold the result. - // - operate: function (context, op, other) { - var rgb = new Array(3); - var alpha = this.alpha * (1 - other.alpha) + other.alpha; - for (var c = 0; c < 3; c++) { - rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]); - } - return new Color(rgb, alpha); - }, - toRGB: function () { - return toHex(this.rgb); - }, - toHSL: function () { - var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var s; - var l = (max + min) / 2; - var d = max - min; - if (max === min) { - h = s = 0; - } - else { - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - } - h /= 6; - } - return { h: h * 360, s: s, l: l, a: a }; - }, - // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - toHSV: function () { - var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var s; - var v = max; - var d = max - min; - if (max === 0) { - s = 0; - } - else { - s = d / max; - } - if (max === min) { - h = 0; - } - else { - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - } - h /= 6; - } - return { h: h * 360, s: s, v: v, a: a }; - }, - toARGB: function () { - return toHex([this.alpha * 255].concat(this.rgb)); - }, - compare: function (x) { - return (x.rgb && - x.rgb[0] === this.rgb[0] && - x.rgb[1] === this.rgb[1] && - x.rgb[2] === this.rgb[2] && - x.alpha === this.alpha) ? 0 : undefined; - } - }); - Color.fromKeyword = function (keyword) { - var c; - var key = keyword.toLowerCase(); - // eslint-disable-next-line no-prototype-builtins - if (colors.hasOwnProperty(key)) { - c = new Color(colors[key].slice(1)); - } - else if (key === 'transparent') { - c = new Color([0, 0, 0], 0); - } - if (c) { - c.value = keyword; - return c; - } - }; - function clamp$1(v, max) { - return Math.min(Math.max(v, 0), max); - } - function toHex(v) { - return "#".concat(v.map(function (c) { - c = clamp$1(Math.round(c), 255); - return (c < 16 ? '0' : '') + c.toString(16); - }).join('')); - } - - /****************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - - typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - var Paren = function (node) { - this.value = node; - }; - Paren.prototype = Object.assign(new Node(), { - type: 'Paren', - genCSS: function (context, output) { - output.add('('); - this.value.genCSS(context, output); - output.add(')'); - }, - eval: function (context) { - var paren = new Paren(this.value.eval(context)); - if (this.noSpacing) { - paren.noSpacing = true; - } - return paren; - } - }); - - var _noSpaceCombinators = { - '': true, - ' ': true, - '|': true - }; - var Combinator = function (value) { - if (value === ' ') { - this.value = ' '; - this.emptyOrWhitespace = true; - } - else { - this.value = value ? value.trim() : ''; - this.emptyOrWhitespace = this.value === ''; - } - }; - Combinator.prototype = Object.assign(new Node(), { - type: 'Combinator', - genCSS: function (context, output) { - var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' '; - output.add(spaceOrEmpty + this.value + spaceOrEmpty); - } - }); - - var Element = function (combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { - this.combinator = combinator instanceof Combinator ? - combinator : new Combinator(combinator); - if (typeof value === 'string') { - this.value = value.trim(); - } - else if (value) { - this.value = value; - } - else { - this.value = ''; - } - this.isVariable = isVariable; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.combinator, this); - }; - Element.prototype = Object.assign(new Node(), { - type: 'Element', - accept: function (visitor) { - var value = this.value; - this.combinator = visitor.visit(this.combinator); - if (typeof value === 'object') { - this.value = visitor.visit(value); - } - }, - eval: function (context) { - return new Element(this.combinator, this.value.eval ? this.value.eval(context) : this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - clone: function () { - return new Element(this.combinator, this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - genCSS: function (context, output) { - output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); - }, - toCSS: function (context) { - context = context || {}; - var value = this.value; - var firstSelector = context.firstSelector; - if (value instanceof Paren) { - // selector in parens should not be affected by outer selector - // flags (breaks only interpolated selectors - see #1973) - context.firstSelector = true; - } - value = value.toCSS ? value.toCSS(context) : value; - context.firstSelector = firstSelector; - if (value === '' && this.combinator.value.charAt(0) === '&') { - return ''; - } - else { - return this.combinator.toCSS(context) + value; - } - } - }); - - var Math$1 = { - ALWAYS: 0, - PARENS_DIVISION: 1, - PARENS: 2 - // removed - STRICT_LEGACY: 3 - }; - var RewriteUrls = { - OFF: 0, - LOCAL: 1, - ALL: 2 - }; - - /** - * Returns the object type of the given payload - * - * @param {*} payload - * @returns {string} - */ - function getType(payload) { - return Object.prototype.toString.call(payload).slice(8, -1); - } - /** - * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes) - * - * @param {*} payload - * @returns {payload is PlainObject} - */ - function isPlainObject(payload) { - if (getType(payload) !== 'Object') - return false; - return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype; - } - /** - * Returns whether the payload is an array - * - * @param {any} payload - * @returns {payload is any[]} - */ - function isArray(payload) { - return getType(payload) === 'Array'; - } - - function assignProp(carry, key, newVal, originalObject, includeNonenumerable) { - const propType = {}.propertyIsEnumerable.call(originalObject, key) - ? 'enumerable' - : 'nonenumerable'; - if (propType === 'enumerable') - carry[key] = newVal; - if (includeNonenumerable && propType === 'nonenumerable') { - Object.defineProperty(carry, key, { - value: newVal, - enumerable: false, - writable: true, - configurable: true, - }); - } - } - /** - * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked. - * - * @export - * @template T - * @param {T} target Target can be anything - * @param {Options} [options = {}] Options can be `props` or `nonenumerable` - * @returns {T} the target with replaced values - * @export - */ - function copy(target, options = {}) { - if (isArray(target)) { - return target.map((item) => copy(item, options)); - } - if (!isPlainObject(target)) { - return target; - } - const props = Object.getOwnPropertyNames(target); - const symbols = Object.getOwnPropertySymbols(target); - return [...props, ...symbols].reduce((carry, key) => { - if (isArray(options.props) && !options.props.includes(key)) { - return carry; - } - const val = target[key]; - const newVal = copy(val, options); - assignProp(carry, key, newVal, target, options.nonenumerable); - return carry; - }, {}); - } - - /* jshint proto: true */ - function getLocation(index, inputStream) { - var n = index + 1; - var line = null; - var column = -1; - while (--n >= 0 && inputStream.charAt(n) !== '\n') { - column++; - } - if (typeof index === 'number') { - line = (inputStream.slice(0, index).match(/\n/g) || '').length; - } - return { - line: line, - column: column - }; - } - function copyArray(arr) { - var i; - var length = arr.length; - var copy = new Array(length); - for (i = 0; i < length; i++) { - copy[i] = arr[i]; - } - return copy; - } - function clone(obj) { - var cloned = {}; - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - cloned[prop] = obj[prop]; - } - } - return cloned; - } - function defaults(obj1, obj2) { - var newObj = obj2 || {}; - if (!obj2._defaults) { - newObj = {}; - var defaults_1 = copy(obj1); - newObj._defaults = defaults_1; - var cloned = obj2 ? copy(obj2) : {}; - Object.assign(newObj, defaults_1, cloned); - } - return newObj; - } - function copyOptions(obj1, obj2) { - if (obj2 && obj2._defaults) { - return obj2; - } - var opts = defaults(obj1, obj2); - if (opts.strictMath) { - opts.math = Math$1.PARENS; - } - // Back compat with changed relativeUrls option - if (opts.relativeUrls) { - opts.rewriteUrls = RewriteUrls.ALL; - } - if (typeof opts.math === 'string') { - switch (opts.math.toLowerCase()) { - case 'always': - opts.math = Math$1.ALWAYS; - break; - case 'parens-division': - opts.math = Math$1.PARENS_DIVISION; - break; - case 'strict': - case 'parens': - opts.math = Math$1.PARENS; - break; - default: - opts.math = Math$1.PARENS; - } - } - if (typeof opts.rewriteUrls === 'string') { - switch (opts.rewriteUrls.toLowerCase()) { - case 'off': - opts.rewriteUrls = RewriteUrls.OFF; - break; - case 'local': - opts.rewriteUrls = RewriteUrls.LOCAL; - break; - case 'all': - opts.rewriteUrls = RewriteUrls.ALL; - break; - } - } - return opts; - } - function merge(obj1, obj2) { - for (var prop in obj2) { - if (Object.prototype.hasOwnProperty.call(obj2, prop)) { - obj1[prop] = obj2[prop]; - } - } - return obj1; - } - function flattenArray(arr, result) { - if (result === void 0) { result = []; } - for (var i_1 = 0, length_1 = arr.length; i_1 < length_1; i_1++) { - var value = arr[i_1]; - if (Array.isArray(value)) { - flattenArray(value, result); - } - else { - if (value !== undefined) { - result.push(value); - } - } - } - return result; - } - function isNullOrUndefined(val) { - return val === null || val === undefined; - } - - var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - getLocation: getLocation, - copyArray: copyArray, - clone: clone, - defaults: defaults, - copyOptions: copyOptions, - merge: merge, - flattenArray: flattenArray, - isNullOrUndefined: isNullOrUndefined - }); - - var anonymousFunc = /(|Function):(\d+):(\d+)/; - /** - * This is a centralized class of any error that could be thrown internally (mostly by the parser). - * Besides standard .message it keeps some additional data like a path to the file where the error - * occurred along with line and column numbers. - * - * @class - * @extends Error - * @type {module.LessError} - * - * @prop {string} type - * @prop {string} filename - * @prop {number} index - * @prop {number} line - * @prop {number} column - * @prop {number} callLine - * @prop {number} callExtract - * @prop {string[]} extract - * - * @param {Object} e - An error object to wrap around or just a descriptive object - * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager? - * @param {string} [currentFilename] - */ - var LessError = function (e, fileContentMap, currentFilename) { - Error.call(this); - var filename = e.filename || currentFilename; - this.message = e.message; - this.stack = e.stack; - if (fileContentMap && filename) { - var input = fileContentMap.contents[filename]; - var loc = getLocation(e.index, input); - var line = loc.line; - var col = loc.column; - var callLine = e.call && getLocation(e.call, input).line; - var lines = input ? input.split('\n') : ''; - this.type = e.type || 'Syntax'; - this.filename = filename; - this.index = e.index; - this.line = typeof line === 'number' ? line + 1 : null; - this.column = col; - if (!this.line && this.stack) { - var found = this.stack.match(anonymousFunc); - /** - * We have to figure out how this environment stringifies anonymous functions - * so we can correctly map plugin errors. - * - * Note, in Node 8, the output of anonymous funcs varied based on parameters - * being present or not, so we inject dummy params. - */ - var func = new Function('a', 'throw new Error()'); - var lineAdjust = 0; - try { - func(); - } - catch (e) { - var match = e.stack.match(anonymousFunc); - lineAdjust = 1 - parseInt(match[2]); - } - if (found) { - if (found[2]) { - this.line = parseInt(found[2]) + lineAdjust; - } - if (found[3]) { - this.column = parseInt(found[3]); - } - } - } - this.callLine = callLine + 1; - this.callExtract = lines[callLine]; - this.extract = [ - lines[this.line - 2], - lines[this.line - 1], - lines[this.line] - ]; - } - }; - if (typeof Object.create === 'undefined') { - var F = function () { }; - F.prototype = Error.prototype; - LessError.prototype = new F(); - } - else { - LessError.prototype = Object.create(Error.prototype); - } - LessError.prototype.constructor = LessError; - /** - * An overridden version of the default Object.prototype.toString - * which uses additional information to create a helpful message. - * - * @param {Object} options - * @returns {string} - */ - LessError.prototype.toString = function (options) { - var _a; - options = options || {}; - var isWarning = ((_a = this.type) !== null && _a !== void 0 ? _a : '').toLowerCase().includes('warning'); - var type = isWarning ? this.type : "".concat(this.type, "Error"); - var color = isWarning ? 'yellow' : 'red'; - var message = ''; - var extract = this.extract || []; - var error = []; - var stylize = function (str) { return str; }; - if (options.stylize) { - var type_1 = typeof options.stylize; - if (type_1 !== 'function') { - throw Error("options.stylize should be a function, got a ".concat(type_1, "!")); - } - stylize = options.stylize; - } - if (this.line !== null) { - if (!isWarning && typeof extract[0] === 'string') { - error.push(stylize("".concat(this.line - 1, " ").concat(extract[0]), 'grey')); - } - if (typeof extract[1] === 'string') { - var errorTxt = "".concat(this.line, " "); - if (extract[1]) { - errorTxt += extract[1].slice(0, this.column) + - stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') + - extract[1].slice(this.column + 1), 'red'), 'inverse'); - } - error.push(errorTxt); - } - if (!isWarning && typeof extract[2] === 'string') { - error.push(stylize("".concat(this.line + 1, " ").concat(extract[2]), 'grey')); - } - error = "".concat(error.join('\n') + stylize('', 'reset'), "\n"); - } - message += stylize("".concat(type, ": ").concat(this.message), color); - if (this.filename) { - message += stylize(' in ', color) + this.filename; - } - if (this.line) { - message += stylize(" on line ".concat(this.line, ", column ").concat(this.column + 1, ":"), 'grey'); - } - message += "\n".concat(error); - if (this.callLine) { - message += "".concat(stylize('from ', color) + (this.filename || ''), "/n"); - message += "".concat(stylize(this.callLine, 'grey'), " ").concat(this.callExtract, "/n"); - } - return message; - }; - - var _visitArgs = { visitDeeper: true }; - var _hasIndexed = false; - function _noop(node) { - return node; - } - function indexNodeTypes(parent, ticker) { - // add .typeIndex to tree node types for lookup table - var key, child; - for (key in parent) { - /* eslint guard-for-in: 0 */ - child = parent[key]; - switch (typeof child) { - case 'function': - // ignore bound functions directly on tree which do not have a prototype - // or aren't nodes - if (child.prototype && child.prototype.type) { - child.prototype.typeIndex = ticker++; - } - break; - case 'object': - ticker = indexNodeTypes(child, ticker); - break; - } - } - return ticker; - } - var Visitor = /** @class */ (function () { - function Visitor(implementation) { - this._implementation = implementation; - this._visitInCache = {}; - this._visitOutCache = {}; - if (!_hasIndexed) { - indexNodeTypes(tree, 1); - _hasIndexed = true; - } - } - Visitor.prototype.visit = function (node) { - if (!node) { - return node; - } - var nodeTypeIndex = node.typeIndex; - if (!nodeTypeIndex) { - // MixinCall args aren't a node type? - if (node.value && node.value.typeIndex) { - this.visit(node.value); - } - return node; - } - var impl = this._implementation; - var func = this._visitInCache[nodeTypeIndex]; - var funcOut = this._visitOutCache[nodeTypeIndex]; - var visitArgs = _visitArgs; - var fnName; - visitArgs.visitDeeper = true; - if (!func) { - fnName = "visit".concat(node.type); - func = impl[fnName] || _noop; - funcOut = impl["".concat(fnName, "Out")] || _noop; - this._visitInCache[nodeTypeIndex] = func; - this._visitOutCache[nodeTypeIndex] = funcOut; - } - if (func !== _noop) { - var newNode = func.call(impl, node, visitArgs); - if (node && impl.isReplacing) { - node = newNode; - } - } - if (visitArgs.visitDeeper && node) { - if (node.length) { - for (var i_1 = 0, cnt = node.length; i_1 < cnt; i_1++) { - if (node[i_1].accept) { - node[i_1].accept(this); - } - } - } - else if (node.accept) { - node.accept(this); - } - } - if (funcOut != _noop) { - funcOut.call(impl, node); - } - return node; - }; - Visitor.prototype.visitArray = function (nodes, nonReplacing) { - if (!nodes) { - return nodes; - } - var cnt = nodes.length; - var i; - // Non-replacing - if (nonReplacing || !this._implementation.isReplacing) { - for (i = 0; i < cnt; i++) { - this.visit(nodes[i]); - } - return nodes; - } - // Replacing - var out = []; - for (i = 0; i < cnt; i++) { - var evald = this.visit(nodes[i]); - if (evald === undefined) { - continue; - } - if (!evald.splice) { - out.push(evald); - } - else if (evald.length) { - this.flatten(evald, out); - } - } - return out; - }; - Visitor.prototype.flatten = function (arr, out) { - if (!out) { - out = []; - } - var cnt, i, item, nestedCnt, j, nestedItem; - for (i = 0, cnt = arr.length; i < cnt; i++) { - item = arr[i]; - if (item === undefined) { - continue; - } - if (!item.splice) { - out.push(item); - continue; - } - for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) { - nestedItem = item[j]; - if (nestedItem === undefined) { - continue; - } - if (!nestedItem.splice) { - out.push(nestedItem); - } - else if (nestedItem.length) { - this.flatten(nestedItem, out); - } - } - } - return out; - }; - return Visitor; - }()); - - var contexts = {}; - var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) { - if (!original) { - return; - } - for (var i_1 = 0; i_1 < propertiesToCopy.length; i_1++) { - if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i_1])) { - destination[propertiesToCopy[i_1]] = original[propertiesToCopy[i_1]]; - } - } - }; - /* - parse is used whilst parsing - */ - var parseCopyProperties = [ - // options - 'paths', - 'rewriteUrls', - 'rootpath', - 'strictImports', - 'insecure', - 'dumpLineNumbers', - 'compress', - 'syncImport', - 'chunkInput', - 'mime', - 'useFileCache', - // context - 'processImports', - // Used by the import manager to stop multiple import visitors being created. - 'pluginManager', - 'quiet', // option - whether to log warnings - ]; - contexts.Parse = function (options) { - copyFromOriginal(options, this, parseCopyProperties); - if (typeof this.paths === 'string') { - this.paths = [this.paths]; - } - }; - var evalCopyProperties = [ - 'paths', - 'compress', - 'math', - 'strictUnits', - 'sourceMap', - 'importMultiple', - 'urlArgs', - 'javascriptEnabled', - 'pluginManager', - 'importantScope', - 'rewriteUrls' // option - whether to adjust URL's to be relative - ]; - contexts.Eval = function (options, frames) { - copyFromOriginal(options, this, evalCopyProperties); - if (typeof this.paths === 'string') { - this.paths = [this.paths]; - } - this.frames = frames || []; - this.importantScope = this.importantScope || []; - }; - contexts.Eval.prototype.enterCalc = function () { - if (!this.calcStack) { - this.calcStack = []; - } - this.calcStack.push(true); - this.inCalc = true; - }; - contexts.Eval.prototype.exitCalc = function () { - this.calcStack.pop(); - if (!this.calcStack.length) { - this.inCalc = false; - } - }; - contexts.Eval.prototype.inParenthesis = function () { - if (!this.parensStack) { - this.parensStack = []; - } - this.parensStack.push(true); - }; - contexts.Eval.prototype.outOfParenthesis = function () { - this.parensStack.pop(); - }; - contexts.Eval.prototype.inCalc = false; - contexts.Eval.prototype.mathOn = true; - contexts.Eval.prototype.isMathOn = function (op) { - if (!this.mathOn) { - return false; - } - if (op === '/' && this.math !== Math$1.ALWAYS && (!this.parensStack || !this.parensStack.length)) { - return false; - } - if (this.math > Math$1.PARENS_DIVISION) { - return this.parensStack && this.parensStack.length; - } - return true; - }; - contexts.Eval.prototype.pathRequiresRewrite = function (path) { - var isRelative = this.rewriteUrls === RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative; - return isRelative(path); - }; - contexts.Eval.prototype.rewritePath = function (path, rootpath) { - var newPath; - rootpath = rootpath || ''; - newPath = this.normalizePath(rootpath + path); - // If a path was explicit relative and the rootpath was not an absolute path - // we must ensure that the new path is also explicit relative. - if (isPathLocalRelative(path) && - isPathRelative(rootpath) && - isPathLocalRelative(newPath) === false) { - newPath = "./".concat(newPath); - } - return newPath; - }; - contexts.Eval.prototype.normalizePath = function (path) { - var segments = path.split('/').reverse(); - var segment; - path = []; - while (segments.length !== 0) { - segment = segments.pop(); - switch (segment) { - case '.': - break; - case '..': - if ((path.length === 0) || (path[path.length - 1] === '..')) { - path.push(segment); - } - else { - path.pop(); - } - break; - default: - path.push(segment); - break; - } - } - return path.join('/'); - }; - function isPathRelative(path) { - return !/^(?:[a-z-]+:|\/|#)/i.test(path); - } - function isPathLocalRelative(path) { - return path.charAt(0) === '.'; - } - // todo - do the same for the toCSS ? - - var ImportSequencer = /** @class */ (function () { - function ImportSequencer(onSequencerEmpty) { - this.imports = []; - this.variableImports = []; - this._onSequencerEmpty = onSequencerEmpty; - this._currentDepth = 0; - } - ImportSequencer.prototype.addImport = function (callback) { - var importSequencer = this, importItem = { - callback: callback, - args: null, - isReady: false - }; - this.imports.push(importItem); - return function () { - importItem.args = Array.prototype.slice.call(arguments, 0); - importItem.isReady = true; - importSequencer.tryRun(); - }; - }; - ImportSequencer.prototype.addVariableImport = function (callback) { - this.variableImports.push(callback); - }; - ImportSequencer.prototype.tryRun = function () { - this._currentDepth++; - try { - while (true) { - while (this.imports.length > 0) { - var importItem = this.imports[0]; - if (!importItem.isReady) { - return; - } - this.imports = this.imports.slice(1); - importItem.callback.apply(null, importItem.args); - } - if (this.variableImports.length === 0) { - break; - } - var variableImport = this.variableImports[0]; - this.variableImports = this.variableImports.slice(1); - variableImport(); - } - } - finally { - this._currentDepth--; - } - if (this._currentDepth === 0 && this._onSequencerEmpty) { - this._onSequencerEmpty(); - } - }; - return ImportSequencer; - }()); - - /* eslint-disable no-unused-vars */ - var ImportVisitor = function (importer, finish) { - this._visitor = new Visitor(this); - this._importer = importer; - this._finish = finish; - this.context = new contexts.Eval(); - this.importCount = 0; - this.onceFileDetectionMap = {}; - this.recursionDetector = {}; - this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this)); - }; - ImportVisitor.prototype = { - isReplacing: false, - run: function (root) { - try { - // process the contents - this._visitor.visit(root); - } - catch (e) { - this.error = e; - } - this.isFinished = true; - this._sequencer.tryRun(); - }, - _onSequencerEmpty: function () { - if (!this.isFinished) { - return; - } - this._finish(this.error); - }, - visitImport: function (importNode, visitArgs) { - var inlineCSS = importNode.options.inline; - if (!importNode.css || inlineCSS) { - var context = new contexts.Eval(this.context, copyArray(this.context.frames)); - var importParent = context.frames[0]; - this.importCount++; - if (importNode.isVariableImport()) { - this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent)); - } - else { - this.processImportNode(importNode, context, importParent); - } - } - visitArgs.visitDeeper = false; - }, - processImportNode: function (importNode, context, importParent) { - var evaldImportNode; - var inlineCSS = importNode.options.inline; - try { - evaldImportNode = importNode.evalForImport(context); - } - catch (e) { - if (!e.filename) { - e.index = importNode.getIndex(); - e.filename = importNode.fileInfo().filename; - } - // attempt to eval properly and treat as css - importNode.css = true; - // if that fails, this error will be thrown - importNode.error = e; - } - if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) { - if (evaldImportNode.options.multiple) { - context.importMultiple = true; - } - // try appending if we haven't determined if it is css or not - var tryAppendLessExtension = evaldImportNode.css === undefined; - for (var i_1 = 0; i_1 < importParent.rules.length; i_1++) { - if (importParent.rules[i_1] === importNode) { - importParent.rules[i_1] = evaldImportNode; - break; - } - } - var onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported); - this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(), evaldImportNode.options, sequencedOnImported); - } - else { - this.importCount--; - if (this.isFinished) { - this._sequencer.tryRun(); - } - } - }, - onImported: function (importNode, context, e, root, importedAtRoot, fullPath) { - if (e) { - if (!e.filename) { - e.index = importNode.getIndex(); - e.filename = importNode.fileInfo().filename; - } - this.error = e; - } - var importVisitor = this, inlineCSS = importNode.options.inline, isPlugin = importNode.options.isPlugin, isOptional = importNode.options.optional, duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector; - if (!context.importMultiple) { - if (duplicateImport) { - importNode.skip = true; - } - else { - importNode.skip = function () { - if (fullPath in importVisitor.onceFileDetectionMap) { - return true; - } - importVisitor.onceFileDetectionMap[fullPath] = true; - return false; - }; - } - } - if (!fullPath && isOptional) { - importNode.skip = true; - } - if (root) { - importNode.root = root; - importNode.importedFilename = fullPath; - if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) { - importVisitor.recursionDetector[fullPath] = true; - var oldContext = this.context; - this.context = context; - try { - this._visitor.visit(root); - } - catch (e) { - this.error = e; - } - this.context = oldContext; - } - } - importVisitor.importCount--; - if (importVisitor.isFinished) { - importVisitor._sequencer.tryRun(); - } - }, - visitDeclaration: function (declNode, visitArgs) { - if (declNode.value.type === 'DetachedRuleset') { - this.context.frames.unshift(declNode); - } - else { - visitArgs.visitDeeper = false; - } - }, - visitDeclarationOut: function (declNode) { - if (declNode.value.type === 'DetachedRuleset') { - this.context.frames.shift(); - } - }, - visitAtRule: function (atRuleNode, visitArgs) { - if (atRuleNode.value) { - this.context.frames.unshift(atRuleNode); - } - else if (atRuleNode.declarations && atRuleNode.declarations.length) { - if (atRuleNode.isRooted) { - this.context.frames.unshift(atRuleNode); - } - else { - this.context.frames.unshift(atRuleNode.declarations[0]); - } - } - else if (atRuleNode.rules && atRuleNode.rules.length) { - this.context.frames.unshift(atRuleNode); - } - }, - visitAtRuleOut: function (atRuleNode) { - this.context.frames.shift(); - }, - visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { - this.context.frames.unshift(mixinDefinitionNode); - }, - visitMixinDefinitionOut: function (mixinDefinitionNode) { - this.context.frames.shift(); - }, - visitRuleset: function (rulesetNode, visitArgs) { - this.context.frames.unshift(rulesetNode); - }, - visitRulesetOut: function (rulesetNode) { - this.context.frames.shift(); - }, - visitMedia: function (mediaNode, visitArgs) { - this.context.frames.unshift(mediaNode.rules[0]); - }, - visitMediaOut: function (mediaNode) { - this.context.frames.shift(); - } - }; - - var SetTreeVisibilityVisitor = /** @class */ (function () { - function SetTreeVisibilityVisitor(visible) { - this.visible = visible; - } - SetTreeVisibilityVisitor.prototype.run = function (root) { - this.visit(root); - }; - SetTreeVisibilityVisitor.prototype.visitArray = function (nodes) { - if (!nodes) { - return nodes; - } - var cnt = nodes.length; - var i; - for (i = 0; i < cnt; i++) { - this.visit(nodes[i]); - } - return nodes; - }; - SetTreeVisibilityVisitor.prototype.visit = function (node) { - if (!node) { - return node; - } - if (node.constructor === Array) { - return this.visitArray(node); - } - if (!node.blocksVisibility || node.blocksVisibility()) { - return node; - } - if (this.visible) { - node.ensureVisibility(); - } - else { - node.ensureInvisibility(); - } - node.accept(this); - return node; - }; - return SetTreeVisibilityVisitor; - }()); - - /* eslint-disable no-unused-vars */ - /* jshint loopfunc:true */ - var ExtendFinderVisitor = /** @class */ (function () { - function ExtendFinderVisitor() { - this._visitor = new Visitor(this); - this.contexts = []; - this.allExtendsStack = [[]]; - } - ExtendFinderVisitor.prototype.run = function (root) { - root = this._visitor.visit(root); - root.allExtends = this.allExtendsStack[0]; - return root; - }; - ExtendFinderVisitor.prototype.visitDeclaration = function (declNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ExtendFinderVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ExtendFinderVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { - if (rulesetNode.root) { - return; - } - var i; - var j; - var extend; - var allSelectorsExtendList = []; - var extendList; - // get &:extend(.a); rules which apply to all selectors in this ruleset - var rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0; - for (i = 0; i < ruleCnt; i++) { - if (rulesetNode.rules[i] instanceof tree.Extend) { - allSelectorsExtendList.push(rules[i]); - rulesetNode.extendOnEveryPath = true; - } - } - // now find every selector and apply the extends that apply to all extends - // and the ones which apply to an individual extend - var paths = rulesetNode.paths; - for (i = 0; i < paths.length; i++) { - var selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList; - extendList = selExtendList ? copyArray(selExtendList).concat(allSelectorsExtendList) - : allSelectorsExtendList; - if (extendList) { - extendList = extendList.map(function (allSelectorsExtend) { - return allSelectorsExtend.clone(); - }); - } - for (j = 0; j < extendList.length; j++) { - this.foundExtends = true; - extend = extendList[j]; - extend.findSelfSelectors(selectorPath); - extend.ruleset = rulesetNode; - if (j === 0) { - extend.firstExtendOnThisSelectorPath = true; - } - this.allExtendsStack[this.allExtendsStack.length - 1].push(extend); - } - } - this.contexts.push(rulesetNode.selectors); - }; - ExtendFinderVisitor.prototype.visitRulesetOut = function (rulesetNode) { - if (!rulesetNode.root) { - this.contexts.length = this.contexts.length - 1; - } - }; - ExtendFinderVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { - mediaNode.allExtends = []; - this.allExtendsStack.push(mediaNode.allExtends); - }; - ExtendFinderVisitor.prototype.visitMediaOut = function (mediaNode) { - this.allExtendsStack.length = this.allExtendsStack.length - 1; - }; - ExtendFinderVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { - atRuleNode.allExtends = []; - this.allExtendsStack.push(atRuleNode.allExtends); - }; - ExtendFinderVisitor.prototype.visitAtRuleOut = function (atRuleNode) { - this.allExtendsStack.length = this.allExtendsStack.length - 1; - }; - return ExtendFinderVisitor; - }()); - var ProcessExtendsVisitor = /** @class */ (function () { - function ProcessExtendsVisitor() { - this._visitor = new Visitor(this); - } - ProcessExtendsVisitor.prototype.run = function (root) { - var extendFinder = new ExtendFinderVisitor(); - this.extendIndices = {}; - extendFinder.run(root); - if (!extendFinder.foundExtends) { - return root; - } - root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends)); - this.allExtendsStack = [root.allExtends]; - var newRoot = this._visitor.visit(root); - this.checkExtendsForNonMatched(root.allExtends); - return newRoot; - }; - ProcessExtendsVisitor.prototype.checkExtendsForNonMatched = function (extendList) { - var indices = this.extendIndices; - extendList.filter(function (extend) { - return !extend.hasFoundMatches && extend.parent_ids.length == 1; - }).forEach(function (extend) { - var selector = '_unknown_'; - try { - selector = extend.selector.toCSS({}); - } - catch (_) { } - if (!indices["".concat(extend.index, " ").concat(selector)]) { - indices["".concat(extend.index, " ").concat(selector)] = true; - /** - * @todo Shouldn't this be an error? To alert the developer - * that they may have made an error in the selector they are - * targeting? - */ - logger$1.warn("WARNING: extend '".concat(selector, "' has no matches")); - } - }); - }; - ProcessExtendsVisitor.prototype.doExtendChaining = function (extendsList, extendsListTarget, iterationCount) { - // - // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering - // and pasting the selector we would do normally, but we are also adding an extend with the same target selector - // this means this new extend can then go and alter other extends - // - // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors - // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already - // processed if we look at each selector at a time, as is done in visitRuleset - var extendIndex; - var targetExtendIndex; - var matches; - var extendsToAdd = []; - var newSelector; - var extendVisitor = this; - var selectorPath; - var extend; - var targetExtend; - var newExtend; - iterationCount = iterationCount || 0; - // loop through comparing every extend with every target extend. - // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place - // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one - // and the second is the target. - // the separation into two lists allows us to process a subset of chains with a bigger set, as is the - // case when processing media queries - for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) { - for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) { - extend = extendsList[extendIndex]; - targetExtend = extendsListTarget[targetExtendIndex]; - // look for circular references - if (extend.parent_ids.indexOf(targetExtend.object_id) >= 0) { - continue; - } - // find a match in the target extends self selector (the bit before :extend) - selectorPath = [targetExtend.selfSelectors[0]]; - matches = extendVisitor.findMatch(extend, selectorPath); - if (matches.length) { - extend.hasFoundMatches = true; - // we found a match, so for each self selector.. - extend.selfSelectors.forEach(function (selfSelector) { - var info = targetExtend.visibilityInfo(); - // process the extend as usual - newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible()); - // but now we create a new extend from it - newExtend = new (tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info); - newExtend.selfSelectors = newSelector; - // add the extend onto the list of extends for that selector - newSelector[newSelector.length - 1].extendList = [newExtend]; - // record that we need to add it. - extendsToAdd.push(newExtend); - newExtend.ruleset = targetExtend.ruleset; - // remember its parents for circular references - newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids); - // only process the selector once.. if we have :extend(.a,.b) then multiple - // extends will look at the same selector path, so when extending - // we know that any others will be duplicates in terms of what is added to the css - if (targetExtend.firstExtendOnThisSelectorPath) { - newExtend.firstExtendOnThisSelectorPath = true; - targetExtend.ruleset.paths.push(newSelector); - } - }); - } - } - } - if (extendsToAdd.length) { - // try to detect circular references to stop a stack overflow. - // may no longer be needed. - this.extendChainCount++; - if (iterationCount > 100) { - var selectorOne = '{unable to calculate}'; - var selectorTwo = '{unable to calculate}'; - try { - selectorOne = extendsToAdd[0].selfSelectors[0].toCSS(); - selectorTwo = extendsToAdd[0].selector.toCSS(); - } - catch (e) { } - throw { message: "extend circular reference detected. One of the circular extends is currently:".concat(selectorOne, ":extend(").concat(selectorTwo, ")") }; - } - // now process the new extends on the existing rules so that we can handle a extending b extending c extending - // d extending e... - return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1)); - } - else { - return extendsToAdd; - } - }; - ProcessExtendsVisitor.prototype.visitDeclaration = function (ruleNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ProcessExtendsVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ProcessExtendsVisitor.prototype.visitSelector = function (selectorNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ProcessExtendsVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { - if (rulesetNode.root) { - return; - } - var matches; - var pathIndex; - var extendIndex; - var allExtends = this.allExtendsStack[this.allExtendsStack.length - 1]; - var selectorsToAdd = []; - var extendVisitor = this; - var selectorPath; - // look at each selector path in the ruleset, find any extend matches and then copy, find and replace - for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { - for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) { - selectorPath = rulesetNode.paths[pathIndex]; - // extending extends happens initially, before the main pass - if (rulesetNode.extendOnEveryPath) { - continue; - } - var extendList = selectorPath[selectorPath.length - 1].extendList; - if (extendList && extendList.length) { - continue; - } - matches = this.findMatch(allExtends[extendIndex], selectorPath); - if (matches.length) { - allExtends[extendIndex].hasFoundMatches = true; - allExtends[extendIndex].selfSelectors.forEach(function (selfSelector) { - var extendedSelectors; - extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible()); - selectorsToAdd.push(extendedSelectors); - }); - } - } - } - rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd); - }; - ProcessExtendsVisitor.prototype.findMatch = function (extend, haystackSelectorPath) { - // - // look through the haystack selector path to try and find the needle - extend.selector - // returns an array of selector matches that can then be replaced - // - var haystackSelectorIndex; - var hackstackSelector; - var hackstackElementIndex; - var haystackElement; - var targetCombinator; - var i; - var extendVisitor = this; - var needleElements = extend.selector.elements; - var potentialMatches = []; - var potentialMatch; - var matches = []; - // loop through the haystack elements - for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) { - hackstackSelector = haystackSelectorPath[haystackSelectorIndex]; - for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) { - haystackElement = hackstackSelector.elements[hackstackElementIndex]; - // if we allow elements before our match we can add a potential match every time. otherwise only at the first element. - if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) { - potentialMatches.push({ pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, - initialCombinator: haystackElement.combinator }); - } - for (i = 0; i < potentialMatches.length; i++) { - potentialMatch = potentialMatches[i]; - // selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't - // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to - // work out what the resulting combinator will be - targetCombinator = haystackElement.combinator.value; - if (targetCombinator === '' && hackstackElementIndex === 0) { - targetCombinator = ' '; - } - // if we don't match, null our match to indicate failure - if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || - (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) { - potentialMatch = null; - } - else { - potentialMatch.matched++; - } - // if we are still valid and have finished, test whether we have elements after and whether these are allowed - if (potentialMatch) { - potentialMatch.finished = potentialMatch.matched === needleElements.length; - if (potentialMatch.finished && - (!extend.allowAfter && - (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) { - potentialMatch = null; - } - } - // if null we remove, if not, we are still valid, so either push as a valid match or continue - if (potentialMatch) { - if (potentialMatch.finished) { - potentialMatch.length = needleElements.length; - potentialMatch.endPathIndex = haystackSelectorIndex; - potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match - potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again - matches.push(potentialMatch); - } - } - else { - potentialMatches.splice(i, 1); - i--; - } - } - } - } - return matches; - }; - ProcessExtendsVisitor.prototype.isElementValuesEqual = function (elementValue1, elementValue2) { - if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') { - return elementValue1 === elementValue2; - } - if (elementValue1 instanceof tree.Attribute) { - if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) { - return false; - } - if (!elementValue1.value || !elementValue2.value) { - if (elementValue1.value || elementValue2.value) { - return false; - } - return true; - } - elementValue1 = elementValue1.value.value || elementValue1.value; - elementValue2 = elementValue2.value.value || elementValue2.value; - return elementValue1 === elementValue2; - } - elementValue1 = elementValue1.value; - elementValue2 = elementValue2.value; - if (elementValue1 instanceof tree.Selector) { - if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) { - return false; - } - for (var i_1 = 0; i_1 < elementValue1.elements.length; i_1++) { - if (elementValue1.elements[i_1].combinator.value !== elementValue2.elements[i_1].combinator.value) { - if (i_1 !== 0 || (elementValue1.elements[i_1].combinator.value || ' ') !== (elementValue2.elements[i_1].combinator.value || ' ')) { - return false; - } - } - if (!this.isElementValuesEqual(elementValue1.elements[i_1].value, elementValue2.elements[i_1].value)) { - return false; - } - } - return true; - } - return false; - }; - ProcessExtendsVisitor.prototype.extendSelector = function (matches, selectorPath, replacementSelector, isVisible) { - // for a set of matches, replace each match with the replacement selector - var currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements; - for (matchIndex = 0; matchIndex < matches.length; matchIndex++) { - match = matches[matchIndex]; - selector = selectorPath[match.pathIndex]; - firstElement = new tree.Element(match.initialCombinator, replacementSelector.elements[0].value, replacementSelector.elements[0].isVariable, replacementSelector.elements[0].getIndex(), replacementSelector.elements[0].fileInfo()); - if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1] - .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); - currentSelectorPathElementIndex = 0; - currentSelectorPathIndex++; - } - newElements = selector.elements - .slice(currentSelectorPathElementIndex, match.index) - .concat([firstElement]) - .concat(replacementSelector.elements.slice(1)); - if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) { - path[path.length - 1].elements = - path[path.length - 1].elements.concat(newElements); - } - else { - path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex)); - path.push(new tree.Selector(newElements)); - } - currentSelectorPathIndex = match.endPathIndex; - currentSelectorPathElementIndex = match.endPathElementIndex; - if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) { - currentSelectorPathElementIndex = 0; - currentSelectorPathIndex++; - } - } - if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1] - .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); - currentSelectorPathIndex++; - } - path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length)); - path = path.map(function (currentValue) { - // we can re-use elements here, because the visibility property matters only for selectors - var derived = currentValue.createDerived(currentValue.elements); - if (isVisible) { - derived.ensureVisibility(); - } - else { - derived.ensureInvisibility(); - } - return derived; - }); - return path; - }; - ProcessExtendsVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { - var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); - newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends)); - this.allExtendsStack.push(newAllExtends); - }; - ProcessExtendsVisitor.prototype.visitMediaOut = function (mediaNode) { - var lastIndex = this.allExtendsStack.length - 1; - this.allExtendsStack.length = lastIndex; - }; - ProcessExtendsVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { - var newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); - newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends)); - this.allExtendsStack.push(newAllExtends); - }; - ProcessExtendsVisitor.prototype.visitAtRuleOut = function (atRuleNode) { - var lastIndex = this.allExtendsStack.length - 1; - this.allExtendsStack.length = lastIndex; - }; - return ProcessExtendsVisitor; - }()); - - /* eslint-disable no-unused-vars */ - var JoinSelectorVisitor = /** @class */ (function () { - function JoinSelectorVisitor() { - this.contexts = [[]]; - this._visitor = new Visitor(this); - } - JoinSelectorVisitor.prototype.run = function (root) { - return this._visitor.visit(root); - }; - JoinSelectorVisitor.prototype.visitDeclaration = function (declNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - JoinSelectorVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - JoinSelectorVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - var paths = []; - var selectors; - this.contexts.push(paths); - if (!rulesetNode.root) { - selectors = rulesetNode.selectors; - if (selectors) { - selectors = selectors.filter(function (selector) { return selector.getIsOutput(); }); - rulesetNode.selectors = selectors.length ? selectors : (selectors = null); - if (selectors) { - rulesetNode.joinSelectors(paths, context, selectors); - } - } - if (!selectors) { - rulesetNode.rules = null; - } - rulesetNode.paths = paths; - } - }; - JoinSelectorVisitor.prototype.visitRulesetOut = function (rulesetNode) { - this.contexts.length = this.contexts.length - 1; - }; - JoinSelectorVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia); - }; - JoinSelectorVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - if (atRuleNode.declarations && atRuleNode.declarations.length) { - atRuleNode.declarations[0].root = (context.length === 0 || context[0].multiMedia); - } - else if (atRuleNode.rules && atRuleNode.rules.length) { - atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null); - } - }; - return JoinSelectorVisitor; - }()); - - /* eslint-disable no-unused-vars */ - var CSSVisitorUtils = /** @class */ (function () { - function CSSVisitorUtils(context) { - this._visitor = new Visitor(this); - this._context = context; - } - CSSVisitorUtils.prototype.containsSilentNonBlockedChild = function (bodyRules) { - var rule; - if (!bodyRules) { - return false; - } - for (var r = 0; r < bodyRules.length; r++) { - rule = bodyRules[r]; - if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) { - // the atrule contains something that was referenced (likely by extend) - // therefore it needs to be shown in output too - return true; - } - } - return false; - }; - CSSVisitorUtils.prototype.keepOnlyVisibleChilds = function (owner) { - if (owner && owner.rules) { - owner.rules = owner.rules.filter(function (thing) { return thing.isVisible(); }); - } - }; - CSSVisitorUtils.prototype.isEmpty = function (owner) { - return (owner && owner.rules) - ? (owner.rules.length === 0) : true; - }; - CSSVisitorUtils.prototype.hasVisibleSelector = function (rulesetNode) { - return (rulesetNode && rulesetNode.paths) - ? (rulesetNode.paths.length > 0) : false; - }; - CSSVisitorUtils.prototype.resolveVisibility = function (node) { - if (!node.blocksVisibility()) { - if (this.isEmpty(node)) { - return; - } - return node; - } - var compiledRulesBody = node.rules[0]; - this.keepOnlyVisibleChilds(compiledRulesBody); - if (this.isEmpty(compiledRulesBody)) { - return; - } - node.ensureVisibility(); - node.removeVisibilityBlock(); - return node; - }; - CSSVisitorUtils.prototype.isVisibleRuleset = function (rulesetNode) { - if (rulesetNode.firstRoot) { - return true; - } - if (this.isEmpty(rulesetNode)) { - return false; - } - if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) { - return false; - } - return true; - }; - return CSSVisitorUtils; - }()); - var ToCSSVisitor = function (context) { - this._visitor = new Visitor(this); - this._context = context; - this.utils = new CSSVisitorUtils(context); - }; - ToCSSVisitor.prototype = { - isReplacing: true, - run: function (root) { - return this._visitor.visit(root); - }, - visitDeclaration: function (declNode, visitArgs) { - if (declNode.blocksVisibility() || declNode.variable) { - return; - } - return declNode; - }, - visitMixinDefinition: function (mixinNode, visitArgs) { - // mixin definitions do not get eval'd - this means they keep state - // so we have to clear that state here so it isn't used if toCSS is called twice - mixinNode.frames = []; - }, - visitExtend: function (extendNode, visitArgs) { - }, - visitComment: function (commentNode, visitArgs) { - if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) { - return; - } - return commentNode; - }, - visitMedia: function (mediaNode, visitArgs) { - var originalRules = mediaNode.rules[0].rules; - mediaNode.accept(this._visitor); - visitArgs.visitDeeper = false; - return this.utils.resolveVisibility(mediaNode, originalRules); - }, - visitImport: function (importNode, visitArgs) { - if (importNode.blocksVisibility()) { - return; - } - return importNode; - }, - visitAtRule: function (atRuleNode, visitArgs) { - if (atRuleNode.rules && atRuleNode.rules.length) { - return this.visitAtRuleWithBody(atRuleNode, visitArgs); - } - else { - return this.visitAtRuleWithoutBody(atRuleNode, visitArgs); - } - }, - visitAnonymous: function (anonymousNode, visitArgs) { - if (!anonymousNode.blocksVisibility()) { - anonymousNode.accept(this._visitor); - return anonymousNode; - } - }, - visitAtRuleWithBody: function (atRuleNode, visitArgs) { - // if there is only one nested ruleset and that one has no path, then it is - // just fake ruleset - function hasFakeRuleset(atRuleNode) { - var bodyRules = atRuleNode.rules; - return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0); - } - function getBodyRules(atRuleNode) { - var nodeRules = atRuleNode.rules; - if (hasFakeRuleset(atRuleNode)) { - return nodeRules[0].rules; - } - return nodeRules; - } - // it is still true that it is only one ruleset in array - // this is last such moment - // process childs - var originalRules = getBodyRules(atRuleNode); - atRuleNode.accept(this._visitor); - visitArgs.visitDeeper = false; - if (!this.utils.isEmpty(atRuleNode)) { - this._mergeRules(atRuleNode.rules[0].rules); - } - return this.utils.resolveVisibility(atRuleNode, originalRules); - }, - visitAtRuleWithoutBody: function (atRuleNode, visitArgs) { - if (atRuleNode.blocksVisibility()) { - return; - } - if (atRuleNode.name === '@charset') { - // Only output the debug info together with subsequent @charset definitions - // a comment (or @media statement) before the actual @charset atrule would - // be considered illegal css as it has to be on the first line - if (this.charset) { - if (atRuleNode.debugInfo) { - var comment = new tree.Comment("/* ".concat(atRuleNode.toCSS(this._context).replace(/\n/g, ''), " */\n")); - comment.debugInfo = atRuleNode.debugInfo; - return this._visitor.visit(comment); - } - return; - } - this.charset = true; - } - return atRuleNode; - }, - checkValidNodes: function (rules, isRoot) { - if (!rules) { - return; - } - for (var i_1 = 0; i_1 < rules.length; i_1++) { - var ruleNode = rules[i_1]; - if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) { - throw { message: 'Properties must be inside selector blocks. They cannot be in the root', - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; - } - if (ruleNode instanceof tree.Call) { - throw { message: "Function '".concat(ruleNode.name, "' did not return a root node"), - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; - } - if (ruleNode.type && !ruleNode.allowRoot) { - throw { message: "".concat(ruleNode.type, " node returned by a function is not valid here"), - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; - } - } - }, - visitRuleset: function (rulesetNode, visitArgs) { - // at this point rulesets are nested into each other - var rule; - var rulesets = []; - this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot); - if (!rulesetNode.root) { - // remove invisible paths - this._compileRulesetPaths(rulesetNode); - // remove rulesets from this ruleset body and compile them separately - var nodeRules = rulesetNode.rules; - var nodeRuleCnt = nodeRules ? nodeRules.length : 0; - for (var i_2 = 0; i_2 < nodeRuleCnt;) { - rule = nodeRules[i_2]; - if (rule && rule.rules) { - // visit because we are moving them out from being a child - rulesets.push(this._visitor.visit(rule)); - nodeRules.splice(i_2, 1); - nodeRuleCnt--; - continue; - } - i_2++; - } - // accept the visitor to remove rules and refactor itself - // then we can decide nogw whether we want it or not - // compile body - if (nodeRuleCnt > 0) { - rulesetNode.accept(this._visitor); - } - else { - rulesetNode.rules = null; - } - visitArgs.visitDeeper = false; - } - else { // if (! rulesetNode.root) { - rulesetNode.accept(this._visitor); - visitArgs.visitDeeper = false; - } - if (rulesetNode.rules) { - this._mergeRules(rulesetNode.rules); - this._removeDuplicateRules(rulesetNode.rules); - } - // now decide whether we keep the ruleset - if (this.utils.isVisibleRuleset(rulesetNode)) { - rulesetNode.ensureVisibility(); - rulesets.splice(0, 0, rulesetNode); - } - if (rulesets.length === 1) { - return rulesets[0]; - } - return rulesets; - }, - _compileRulesetPaths: function (rulesetNode) { - if (rulesetNode.paths) { - rulesetNode.paths = rulesetNode.paths - .filter(function (p) { - var i; - if (p[0].elements[0].combinator.value === ' ') { - p[0].elements[0].combinator = new (tree.Combinator)(''); - } - for (i = 0; i < p.length; i++) { - if (p[i].isVisible() && p[i].getIsOutput()) { - return true; - } - } - return false; - }); - } - }, - _removeDuplicateRules: function (rules) { - if (!rules) { - return; - } - // remove duplicates - var ruleCache = {}; - var ruleList; - var rule; - var i; - for (i = rules.length - 1; i >= 0; i--) { - rule = rules[i]; - if (rule instanceof tree.Declaration) { - if (!ruleCache[rule.name]) { - ruleCache[rule.name] = rule; - } - else { - ruleList = ruleCache[rule.name]; - if (ruleList instanceof tree.Declaration) { - ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)]; - } - var ruleCSS = rule.toCSS(this._context); - if (ruleList.indexOf(ruleCSS) !== -1) { - rules.splice(i, 1); - } - else { - ruleList.push(ruleCSS); - } - } - } - } - }, - _mergeRules: function (rules) { - if (!rules) { - return; - } - var groups = {}; - var groupsArr = []; - for (var i_3 = 0; i_3 < rules.length; i_3++) { - var rule = rules[i_3]; - if (rule.merge) { - var key = rule.name; - groups[key] ? rules.splice(i_3--, 1) : - groupsArr.push(groups[key] = []); - groups[key].push(rule); - } - } - groupsArr.forEach(function (group) { - if (group.length > 0) { - var result_1 = group[0]; - var space_1 = []; - var comma_1 = [new tree.Expression(space_1)]; - group.forEach(function (rule) { - if ((rule.merge === '+') && (space_1.length > 0)) { - comma_1.push(new tree.Expression(space_1 = [])); - } - space_1.push(rule.value); - result_1.important = result_1.important || rule.important; - }); - result_1.value = new tree.Value(comma_1); - } - }); - } - }; - - var visitors = { - Visitor: Visitor, - ImportVisitor: ImportVisitor, - MarkVisibleSelectorsVisitor: SetTreeVisibilityVisitor, - ExtendVisitor: ProcessExtendsVisitor, - JoinSelectorVisitor: JoinSelectorVisitor, - ToCSSVisitor: ToCSSVisitor - }; - - // Split the input into chunks. - function chunker (input, fail) { - var len = input.length; - var level = 0; - var parenLevel = 0; - var lastOpening; - var lastOpeningParen; - var lastMultiComment; - var lastMultiCommentEndBrace; - var chunks = []; - var emitFrom = 0; - var chunkerCurrentIndex; - var currentChunkStartIndex; - var cc; - var cc2; - var matched; - function emitChunk(force) { - var len = chunkerCurrentIndex - emitFrom; - if (((len < 512) && !force) || !len) { - return; - } - chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1)); - emitFrom = chunkerCurrentIndex + 1; - } - for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc = input.charCodeAt(chunkerCurrentIndex); - if (((cc >= 97) && (cc <= 122)) || (cc < 34)) { - // a-z or whitespace - continue; - } - switch (cc) { - case 40: // ( - parenLevel++; - lastOpeningParen = chunkerCurrentIndex; - continue; - case 41: // ) - if (--parenLevel < 0) { - return fail('missing opening `(`', chunkerCurrentIndex); - } - continue; - case 59: // ; - if (!parenLevel) { - emitChunk(); - } - continue; - case 123: // { - level++; - lastOpening = chunkerCurrentIndex; - continue; - case 125: // } - if (--level < 0) { - return fail('missing opening `{`', chunkerCurrentIndex); - } - if (!level && !parenLevel) { - emitChunk(); - } - continue; - case 92: // \ - if (chunkerCurrentIndex < len - 1) { - chunkerCurrentIndex++; - continue; - } - return fail('unescaped `\\`', chunkerCurrentIndex); - case 34: - case 39: - case 96: // ", ' and ` - matched = 0; - currentChunkStartIndex = chunkerCurrentIndex; - for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if (cc2 > 96) { - continue; - } - if (cc2 == cc) { - matched = 1; - break; - } - if (cc2 == 92) { // \ - if (chunkerCurrentIndex == len - 1) { - return fail('unescaped `\\`', chunkerCurrentIndex); - } - chunkerCurrentIndex++; - } - } - if (matched) { - continue; - } - return fail("unmatched `".concat(String.fromCharCode(cc), "`"), currentChunkStartIndex); - case 47: // /, check for comment - if (parenLevel || (chunkerCurrentIndex == len - 1)) { - continue; - } - cc2 = input.charCodeAt(chunkerCurrentIndex + 1); - if (cc2 == 47) { - // //, find lnfeed - for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { - break; - } - } - } - else if (cc2 == 42) { - // /*, find */ - lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex; - for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if (cc2 == 125) { - lastMultiCommentEndBrace = chunkerCurrentIndex; - } - if (cc2 != 42) { - continue; - } - if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { - break; - } - } - if (chunkerCurrentIndex == len - 1) { - return fail('missing closing `*/`', currentChunkStartIndex); - } - chunkerCurrentIndex++; - } - continue; - case 42: // *, check for unmatched */ - if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) { - return fail('unmatched `/*`', chunkerCurrentIndex); - } - continue; - } - } - if (level !== 0) { - if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) { - return fail('missing closing `}` or `*/`', lastOpening); - } - else { - return fail('missing closing `}`', lastOpening); - } - } - else if (parenLevel !== 0) { - return fail('missing closing `)`', lastOpeningParen); - } - emitChunk(true); - return chunks; - } - - var getParserInput = (function () { - var // Less input string - input; - var // current chunk - j; - var // holds state for backtracking - saveStack = []; - var // furthest index the parser has gone to - furthest; - var // if this is furthest we got to, this is the probably cause - furthestPossibleErrorMessage; - var // chunkified input - chunks; - var // current chunk - current; - var // index of current chunk, in `input` - currentPos; - var parserInput = {}; - var CHARCODE_SPACE = 32; - var CHARCODE_TAB = 9; - var CHARCODE_LF = 10; - var CHARCODE_CR = 13; - var CHARCODE_PLUS = 43; - var CHARCODE_COMMA = 44; - var CHARCODE_FORWARD_SLASH = 47; - var CHARCODE_9 = 57; - function skipWhitespace(length) { - var oldi = parserInput.i; - var oldj = j; - var curr = parserInput.i - currentPos; - var endIndex = parserInput.i + current.length - curr; - var mem = (parserInput.i += length); - var inp = input; - var c; - var nextChar; - var comment; - for (; parserInput.i < endIndex; parserInput.i++) { - c = inp.charCodeAt(parserInput.i); - if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) { - nextChar = inp.charAt(parserInput.i + 1); - if (nextChar === '/') { - comment = { index: parserInput.i, isLineComment: true }; - var nextNewLine = inp.indexOf('\n', parserInput.i + 2); - if (nextNewLine < 0) { - nextNewLine = endIndex; - } - parserInput.i = nextNewLine; - comment.text = inp.substr(comment.index, parserInput.i - comment.index); - parserInput.commentStore.push(comment); - continue; - } - else if (nextChar === '*') { - var nextStarSlash = inp.indexOf('*/', parserInput.i + 2); - if (nextStarSlash >= 0) { - comment = { - index: parserInput.i, - text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i), - isLineComment: false - }; - parserInput.i += comment.text.length - 1; - parserInput.commentStore.push(comment); - continue; - } - } - break; - } - if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) { - break; - } - } - current = current.slice(length + parserInput.i - mem + curr); - currentPos = parserInput.i; - if (!current.length) { - if (j < chunks.length - 1) { - current = chunks[++j]; - skipWhitespace(0); // skip space at the beginning of a chunk - return true; // things changed - } - parserInput.finished = true; - } - return oldi !== parserInput.i || oldj !== j; - } - parserInput.save = function () { - currentPos = parserInput.i; - saveStack.push({ current: current, i: parserInput.i, j: j }); - }; - parserInput.restore = function (possibleErrorMessage) { - if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) { - furthest = parserInput.i; - furthestPossibleErrorMessage = possibleErrorMessage; - } - var state = saveStack.pop(); - current = state.current; - currentPos = parserInput.i = state.i; - j = state.j; - }; - parserInput.forget = function () { - saveStack.pop(); - }; - parserInput.isWhitespace = function (offset) { - var pos = parserInput.i + (offset || 0); - var code = input.charCodeAt(pos); - return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF); - }; - // Specialization of $(tok) - parserInput.$re = function (tok) { - if (parserInput.i > currentPos) { - current = current.slice(parserInput.i - currentPos); - currentPos = parserInput.i; - } - var m = tok.exec(current); - if (!m) { - return null; - } - skipWhitespace(m[0].length); - if (typeof m === 'string') { - return m; - } - return m.length === 1 ? m[0] : m; - }; - parserInput.$char = function (tok) { - if (input.charAt(parserInput.i) !== tok) { - return null; - } - skipWhitespace(1); - return tok; - }; - parserInput.$peekChar = function (tok) { - if (input.charAt(parserInput.i) !== tok) { - return null; - } - return tok; - }; - parserInput.$str = function (tok) { - var tokLength = tok.length; - // https://jsperf.com/string-startswith/21 - for (var i_1 = 0; i_1 < tokLength; i_1++) { - if (input.charAt(parserInput.i + i_1) !== tok.charAt(i_1)) { - return null; - } - } - skipWhitespace(tokLength); - return tok; - }; - parserInput.$quoted = function (loc) { - var pos = loc || parserInput.i; - var startChar = input.charAt(pos); - if (startChar !== '\'' && startChar !== '"') { - return; - } - var length = input.length; - var currentPosition = pos; - for (var i_2 = 1; i_2 + currentPosition < length; i_2++) { - var nextChar = input.charAt(i_2 + currentPosition); - switch (nextChar) { - case '\\': - i_2++; - continue; - case '\r': - case '\n': - break; - case startChar: { - var str = input.substr(currentPosition, i_2 + 1); - if (!loc && loc !== 0) { - skipWhitespace(i_2 + 1); - return str; - } - return [startChar, str]; - } - } - } - return null; - }; - /** - * Permissive parsing. Ignores everything except matching {} [] () and quotes - * until matching token (outside of blocks) - */ - parserInput.$parseUntil = function (tok) { - var quote = ''; - var returnVal = null; - var inComment = false; - var blockDepth = 0; - var blockStack = []; - var parseGroups = []; - var length = input.length; - var startPos = parserInput.i; - var lastPos = parserInput.i; - var i = parserInput.i; - var loop = true; - var testChar; - if (typeof tok === 'string') { - testChar = function (char) { return char === tok; }; - } - else { - testChar = function (char) { return tok.test(char); }; - } - do { - var nextChar = input.charAt(i); - if (blockDepth === 0 && testChar(nextChar)) { - returnVal = input.substr(lastPos, i - lastPos); - if (returnVal) { - parseGroups.push(returnVal); - } - else { - parseGroups.push(' '); - } - returnVal = parseGroups; - skipWhitespace(i - startPos); - loop = false; - } - else { - if (inComment) { - if (nextChar === '*' && - input.charAt(i + 1) === '/') { - i++; - blockDepth--; - inComment = false; - } - i++; - continue; - } - switch (nextChar) { - case '\\': - i++; - nextChar = input.charAt(i); - parseGroups.push(input.substr(lastPos, i - lastPos + 1)); - lastPos = i + 1; - break; - case '/': - if (input.charAt(i + 1) === '*') { - i++; - inComment = true; - blockDepth++; - } - break; - case '\'': - case '"': - quote = parserInput.$quoted(i); - if (quote) { - parseGroups.push(input.substr(lastPos, i - lastPos), quote); - i += quote[1].length - 1; - lastPos = i + 1; - } - else { - skipWhitespace(i - startPos); - returnVal = nextChar; - loop = false; - } - break; - case '{': - blockStack.push('}'); - blockDepth++; - break; - case '(': - blockStack.push(')'); - blockDepth++; - break; - case '[': - blockStack.push(']'); - blockDepth++; - break; - case '}': - case ')': - case ']': { - var expected = blockStack.pop(); - if (nextChar === expected) { - blockDepth--; - } - else { - // move the parser to the error and return expected - skipWhitespace(i - startPos); - returnVal = expected; - loop = false; - } - } - } - i++; - if (i > length) { - loop = false; - } - } - } while (loop); - return returnVal ? returnVal : null; - }; - parserInput.autoCommentAbsorb = true; - parserInput.commentStore = []; - parserInput.finished = false; - // Same as $(), but don't change the state of the parser, - // just return the match. - parserInput.peek = function (tok) { - if (typeof tok === 'string') { - // https://jsperf.com/string-startswith/21 - for (var i_3 = 0; i_3 < tok.length; i_3++) { - if (input.charAt(parserInput.i + i_3) !== tok.charAt(i_3)) { - return false; - } - } - return true; - } - else { - return tok.test(current); - } - }; - // Specialization of peek() - // TODO remove or change some currentChar calls to peekChar - parserInput.peekChar = function (tok) { return input.charAt(parserInput.i) === tok; }; - parserInput.currentChar = function () { return input.charAt(parserInput.i); }; - parserInput.prevChar = function () { return input.charAt(parserInput.i - 1); }; - parserInput.getInput = function () { return input; }; - parserInput.peekNotNumeric = function () { - var c = input.charCodeAt(parserInput.i); - // Is the first char of the dimension 0-9, '.', '+' or '-' - return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA; - }; - parserInput.start = function (str, chunkInput, failFunction) { - input = str; - parserInput.i = j = currentPos = furthest = 0; - // chunking apparently makes things quicker (but my tests indicate - // it might actually make things slower in node at least) - // and it is a non-perfect parse - it can't recognise - // unquoted urls, meaning it can't distinguish comments - // meaning comments with quotes or {}() in them get 'counted' - // and then lead to parse errors. - // In addition if the chunking chunks in the wrong place we might - // not be able to parse a parser statement in one go - // this is officially deprecated but can be switched on via an option - // in the case it causes too much performance issues. - if (chunkInput) { - chunks = chunker(str, failFunction); - } - else { - chunks = [str]; - } - current = chunks[0]; - skipWhitespace(0); - }; - parserInput.end = function () { - var message; - var isFinished = parserInput.i >= input.length; - if (parserInput.i < furthest) { - message = furthestPossibleErrorMessage; - parserInput.i = furthest; - } - return { - isFinished: isFinished, - furthest: parserInput.i, - furthestPossibleErrorMessage: message, - furthestReachedEnd: parserInput.i >= input.length - 1, - furthestChar: input[parserInput.i] - }; - }; - return parserInput; - }); - - function makeRegistry(base) { - return { - _data: {}, - add: function (name, func) { - // precautionary case conversion, as later querying of - // the registry by function-caller uses lower case as well. - name = name.toLowerCase(); - // eslint-disable-next-line no-prototype-builtins - if (this._data.hasOwnProperty(name)) ; - this._data[name] = func; - }, - addMultiple: function (functions) { - var _this = this; - Object.keys(functions).forEach(function (name) { - _this.add(name, functions[name]); - }); - }, - get: function (name) { - return this._data[name] || (base && base.get(name)); - }, - getLocalFunctions: function () { - return this._data; - }, - inherit: function () { - return makeRegistry(this); - }, - create: function (base) { - return makeRegistry(base); - } - }; - } - var functionRegistry = makeRegistry(null); - - var MediaSyntaxOptions = { - queryInParens: true - }; - var ContainerSyntaxOptions = { - queryInParens: true - }; - - var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { - this.value = value; - this._index = index; - this._fileInfo = currentFileInfo; - this.mapLines = mapLines; - this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; - this.allowRoot = true; - this.copyVisibilityInfo(visibilityInfo); - }; - Anonymous.prototype = Object.assign(new Node(), { - type: 'Anonymous', - eval: function () { - return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); - }, - compare: function (other) { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; - }, - isRulesetLike: function () { - return this.rulesetLike; - }, - genCSS: function (context, output) { - this.nodeVisible = Boolean(this.value); - if (this.nodeVisible) { - output.add(this.value, this._fileInfo, this._index, this.mapLines); - } - } - }); - - // - // less.js - parser - // - // A relatively straight-forward predictive parser. - // There is no tokenization/lexing stage, the input is parsed - // in one sweep. - // - // To make the parser fast enough to run in the browser, several - // optimization had to be made: - // - // - Matching and slicing on a huge input is often cause of slowdowns. - // The solution is to chunkify the input into smaller strings. - // The chunks are stored in the `chunks` var, - // `j` holds the current chunk index, and `currentPos` holds - // the index of the current chunk in relation to `input`. - // This gives us an almost 4x speed-up. - // - // - In many cases, we don't need to match individual tokens; - // for example, if a value doesn't hold any variables, operations - // or dynamic references, the parser can effectively 'skip' it, - // treating it as a literal. - // An example would be '1px solid #000' - which evaluates to itself, - // we don't need to know what the individual components are. - // The drawback, of course is that you don't get the benefits of - // syntax-checking on the CSS. This gives us a 50% speed-up in the parser, - // and a smaller speed-up in the code-gen. - // - // - // Token matching is done with the `$` function, which either takes - // a terminal string or regexp, or a non-terminal function to call. - // It also takes care of moving all the indices forwards. - // - var Parser = function Parser(context, imports, fileInfo, currentIndex) { - currentIndex = currentIndex || 0; - var parsers; - var parserInput = getParserInput(); - function error(msg, type) { - throw new LessError({ - index: parserInput.i, - filename: fileInfo.filename, - type: type || 'Syntax', - message: msg - }, imports); - } - /** - * - * @param {string} msg - * @param {number} index - * @param {string} type - */ - function warn(msg, index, type) { - if (!context.quiet) { - logger$1.warn((new LessError({ - index: index !== null && index !== void 0 ? index : parserInput.i, - filename: fileInfo.filename, - type: type ? "".concat(type.toUpperCase(), " WARNING") : 'WARNING', - message: msg - }, imports)).toString()); - } - } - function expect(arg, msg) { - // some older browsers return typeof 'function' for RegExp - var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); - if (result) { - return result; - } - error(msg || (typeof arg === 'string' - ? "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'") - : 'unexpected token')); - } - // Specialization of expect() - function expectChar(arg, msg) { - if (parserInput.$char(arg)) { - return arg; - } - error(msg || "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'")); - } - function getDebugInfo(index) { - var filename = fileInfo.filename; - return { - lineNumber: getLocation(index, parserInput.getInput()).line + 1, - fileName: filename - }; - } - /** - * Used after initial parsing to create nodes on the fly - * - * @param {String} str - string to parse - * @param {Array} parseList - array of parsers to run input through e.g. ["value", "important"] - * @param {Number} currentIndex - start number to begin indexing - * @param {Object} fileInfo - fileInfo to attach to created nodes - */ - function parseNode(str, parseList, callback) { - var result; - var returnNodes = []; - var parser = parserInput; - try { - parser.start(str, false, function fail(msg, index) { - callback({ - message: msg, - index: index + currentIndex - }); - }); - for (var x = 0, p = void 0; (p = parseList[x]); x++) { - result = parsers[p](); - returnNodes.push(result || null); - } - var endInfo = parser.end(); - if (endInfo.isFinished) { - callback(null, returnNodes); - } - else { - callback(true, null); - } - } - catch (e) { - throw new LessError({ - index: e.index + currentIndex, - message: e.message - }, imports, fileInfo.filename); - } - } - // - // The Parser - // - return { - parserInput: parserInput, - imports: imports, - fileInfo: fileInfo, - parseNode: parseNode, - // - // Parse an input string into an abstract syntax tree, - // @param str A string containing 'less' markup - // @param callback call `callback` when done. - // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply - // - parse: function (str, callback, additionalData) { - var root; - var err = null; - var globalVars; - var modifyVars; - var ignored; - var preText = ''; - // Optionally disable @plugin parsing - if (additionalData && additionalData.disablePluginRule) { - parsers.plugin = function () { - var dir = parserInput.$re(/^@plugin?\s+/); - if (dir) { - error('@plugin statements are not allowed when disablePluginRule is set to true'); - } - }; - } - globalVars = (additionalData && additionalData.globalVars) ? "".concat(Parser.serializeVars(additionalData.globalVars), "\n") : ''; - modifyVars = (additionalData && additionalData.modifyVars) ? "\n".concat(Parser.serializeVars(additionalData.modifyVars)) : ''; - if (context.pluginManager) { - var preProcessors = context.pluginManager.getPreProcessors(); - for (var i_1 = 0; i_1 < preProcessors.length; i_1++) { - str = preProcessors[i_1].process(str, { context: context, imports: imports, fileInfo: fileInfo }); - } - } - if (globalVars || (additionalData && additionalData.banner)) { - preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars; - ignored = imports.contentsIgnoredChars; - ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0; - ignored[fileInfo.filename] += preText.length; - } - str = str.replace(/\r\n?/g, '\n'); - // Remove potential UTF Byte Order Mark - str = preText + str.replace(/^\uFEFF/, '') + modifyVars; - imports.contents[fileInfo.filename] = str; - // Start with the primary rule. - // The whole syntax tree is held under a Ruleset node, - // with the `root` property set to true, so no `{}` are - // output. The callback is called when the input is parsed. - try { - parserInput.start(str, context.chunkInput, function fail(msg, index) { - throw new LessError({ - index: index, - type: 'Parse', - message: msg, - filename: fileInfo.filename - }, imports); - }); - tree.Node.prototype.parse = this; - root = new tree.Ruleset(null, this.parsers.primary()); - tree.Node.prototype.rootNode = root; - root.root = true; - root.firstRoot = true; - root.functionRegistry = functionRegistry.inherit(); - } - catch (e) { - return callback(new LessError(e, imports, fileInfo.filename)); - } - // If `i` is smaller than the `input.length - 1`, - // it means the parser wasn't able to parse the whole - // string, so we've got a parsing error. - // - // We try to extract a \n delimited string, - // showing the line where the parse error occurred. - // We split it up into two parts (the part which parsed, - // and the part which didn't), so we can color them differently. - var endInfo = parserInput.end(); - if (!endInfo.isFinished) { - var message = endInfo.furthestPossibleErrorMessage; - if (!message) { - message = 'Unrecognised input'; - if (endInfo.furthestChar === '}') { - message += '. Possibly missing opening \'{\''; - } - else if (endInfo.furthestChar === ')') { - message += '. Possibly missing opening \'(\''; - } - else if (endInfo.furthestReachedEnd) { - message += '. Possibly missing something'; - } - } - err = new LessError({ - type: 'Parse', - message: message, - index: endInfo.furthest, - filename: fileInfo.filename - }, imports); - } - var finish = function (e) { - e = err || e || imports.error; - if (e) { - if (!(e instanceof LessError)) { - e = new LessError(e, imports, fileInfo.filename); - } - return callback(e); - } - else { - return callback(null, root); - } - }; - if (context.processImports !== false) { - new visitors.ImportVisitor(imports, finish) - .run(root); - } - else { - return finish(); - } - }, - // - // Here in, the parsing rules/functions - // - // The basic structure of the syntax tree generated is as follows: - // - // Ruleset -> Declaration -> Value -> Expression -> Entity - // - // Here's some Less code: - // - // .class { - // color: #fff; - // border: 1px solid #000; - // width: @w + 4px; - // > .child {...} - // } - // - // And here's what the parse tree might look like: - // - // Ruleset (Selector '.class', [ - // Declaration ("color", Value ([Expression [Color #fff]])) - // Declaration ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) - // Declaration ("width", Value ([Expression [Operation " + " [Variable "@w"][Dimension 4px]]])) - // Ruleset (Selector [Element '>', '.child'], [...]) - // ]) - // - // In general, most rules will try to parse a token with the `$re()` function, and if the return - // value is truly, will return a new node, of the relevant type. Sometimes, we need to check - // first, before parsing, that's when we use `peek()`. - // - parsers: parsers = { - // - // The `primary` rule is the *entry* and *exit* point of the parser. - // The rules here can appear at any level of the parse tree. - // - // The recursive nature of the grammar is an interplay between the `block` - // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, - // as represented by this simplified grammar: - // - // primary → (ruleset | declaration)+ - // ruleset → selector+ block - // block → '{' primary '}' - // - // Only at one point is the primary rule not called from the - // block rule: at the root level. - // - primary: function () { - var mixin = this.mixin; - var root = []; - var node; - while (true) { - while (true) { - node = this.comment(); - if (!node) { - break; - } - root.push(node); - } - // always process comments before deciding if finished - if (parserInput.finished) { - break; - } - if (parserInput.peek('}')) { - break; - } - node = this.extendRule(); - if (node) { - root = root.concat(node); - continue; - } - node = mixin.definition() || this.declaration() || mixin.call(false, false) || - this.ruleset() || this.variableCall() || this.entities.call() || this.atrule(); - if (node) { - root.push(node); - } - else { - var foundSemiColon = false; - while (parserInput.$char(';')) { - foundSemiColon = true; - } - if (!foundSemiColon) { - break; - } - } - } - return root; - }, - // comments are collected by the main parsing mechanism and then assigned to nodes - // where the current structure allows it - comment: function () { - if (parserInput.commentStore.length) { - var comment = parserInput.commentStore.shift(); - return new (tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo); - } - }, - // - // Entities are tokens which can be found inside an Expression - // - entities: { - mixinLookup: function () { - return parsers.mixin.call(true, true); - }, - // - // A string, which supports escaping " and ' - // - // "milky way" 'he\'s the one!' - // - quoted: function (forceEscaped) { - var str; - var index = parserInput.i; - var isEscaped = false; - parserInput.save(); - if (parserInput.$char('~')) { - isEscaped = true; - } - else if (forceEscaped) { - parserInput.restore(); - return; - } - str = parserInput.$quoted(); - if (!str) { - parserInput.restore(); - return; - } - parserInput.forget(); - return new (tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo); - }, - // - // A catch-all word, such as: - // - // black border-collapse - // - keyword: function () { - var k = parserInput.$char('%') || parserInput.$re(/^\[?(?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\]?/); - if (k) { - return tree.Color.fromKeyword(k) || new (tree.Keyword)(k); - } - }, - // - // A function call - // - // rgb(255, 0, 255) - // - // The arguments are parsed with the `entities.arguments` parser. - // - call: function () { - var name; - var args; - var func; - var index = parserInput.i; - // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 - if (parserInput.peek(/^url\(/i)) { - return; - } - parserInput.save(); - name = parserInput.$re(/^([\w-]+|%|~|progid:[\w.]+)\(/); - if (!name) { - parserInput.forget(); - return; - } - name = name[1]; - func = this.customFuncCall(name); - if (func) { - args = func.parse(); - if (args && func.stop) { - parserInput.forget(); - return args; - } - } - args = this.arguments(args); - if (!parserInput.$char(')')) { - parserInput.restore('Could not parse call arguments or missing \')\''); - return; - } - parserInput.forget(); - return new (tree.Call)(name, args, index + currentIndex, fileInfo); - }, - declarationCall: function () { - var validCall; - var args; - var index = parserInput.i; - parserInput.save(); - validCall = parserInput.$re(/^[\w]+\(/); - if (!validCall) { - parserInput.forget(); - return; - } - validCall = validCall.substring(0, validCall.length - 1); - var rule = this.ruleProperty(); - var value; - if (rule) { - value = this.value(); - } - if (rule && value) { - args = [new (tree.Declaration)(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)]; - } - if (!parserInput.$char(')')) { - parserInput.restore('Could not parse call arguments or missing \')\''); - return; - } - parserInput.forget(); - return new (tree.Call)(validCall, args, index + currentIndex, fileInfo); - }, - // - // Parsing rules for functions with non-standard args, e.g.: - // - // boolean(not(2 > 1)) - // - // This is a quick prototype, to be modified/improved when - // more custom-parsed funcs come (e.g. `selector(...)`) - // - customFuncCall: function (name) { - /* Ideally the table is to be moved out of here for faster perf., - but it's quite tricky since it relies on all these `parsers` - and `expect` available only here */ - return { - alpha: f(parsers.ieAlpha, true), - boolean: f(condition), - 'if': f(condition) - }[name.toLowerCase()]; - function f(parse, stop) { - return { - parse: parse, - stop: stop // when true - stop after parse() and return its result, - // otherwise continue for plain args - }; - } - function condition() { - return [expect(parsers.condition, 'expected condition')]; - } - }, - arguments: function (prevArgs) { - var argsComma = prevArgs || []; - var argsSemiColon = []; - var isSemiColonSeparated; - var value; - parserInput.save(); - while (true) { - if (prevArgs) { - prevArgs = false; - } - else { - value = parsers.detachedRuleset() || this.assignment() || parsers.expression(); - if (!value) { - break; - } - if (value.value && value.value.length == 1) { - value = value.value[0]; - } - argsComma.push(value); - } - if (parserInput.$char(',')) { - continue; - } - if (parserInput.$char(';') || isSemiColonSeparated) { - isSemiColonSeparated = true; - value = (argsComma.length < 1) ? argsComma[0] - : new tree.Value(argsComma); - argsSemiColon.push(value); - argsComma = []; - } - } - parserInput.forget(); - return isSemiColonSeparated ? argsSemiColon : argsComma; - }, - literal: function () { - return this.dimension() || - this.color() || - this.quoted() || - this.unicodeDescriptor(); - }, - // Assignments are argument entities for calls. - // They are present in ie filter properties as shown below. - // - // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* ) - // - assignment: function () { - var key; - var value; - parserInput.save(); - key = parserInput.$re(/^\w+(?=\s?=)/i); - if (!key) { - parserInput.restore(); - return; - } - if (!parserInput.$char('=')) { - parserInput.restore(); - return; - } - value = parsers.entity(); - if (value) { - parserInput.forget(); - return new (tree.Assignment)(key, value); - } - else { - parserInput.restore(); - } - }, - // - // Parse url() tokens - // - // We use a specific rule for urls, because they don't really behave like - // standard function calls. The difference is that the argument doesn't have - // to be enclosed within a string, so it can't be parsed as an Expression. - // - url: function () { - var value; - var index = parserInput.i; - parserInput.autoCommentAbsorb = false; - if (!parserInput.$str('url(')) { - parserInput.autoCommentAbsorb = true; - return; - } - value = this.quoted() || this.variable() || this.property() || - parserInput.$re(/^(?:(?:\\[()'"])|[^()'"])+/) || ''; - parserInput.autoCommentAbsorb = true; - expectChar(')'); - return new (tree.URL)((value.value !== undefined || - value instanceof tree.Variable || - value instanceof tree.Property) ? - value : new (tree.Anonymous)(value, index), index + currentIndex, fileInfo); - }, - // - // A Variable entity, such as `@fink`, in - // - // width: @fink + 2px - // - // We use a different parser for variable definitions, - // see `parsers.variable`. - // - variable: function () { - var ch; - var name; - var index = parserInput.i; - parserInput.save(); - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) { - ch = parserInput.currentChar(); - if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\s/)) { - // this may be a VariableCall lookup - var result = parsers.variableCall(name); - if (result) { - parserInput.forget(); - return result; - } - } - parserInput.forget(); - return new (tree.Variable)(name, index + currentIndex, fileInfo); - } - parserInput.restore(); - }, - // A variable entity using the protective {} e.g. @{var} - variableCurly: function () { - var curly; - var index = parserInput.i; - if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { - return new (tree.Variable)("@".concat(curly[1]), index + currentIndex, fileInfo); - } - }, - // - // A Property accessor, such as `$color`, in - // - // background-color: $color - // - property: function () { - var name; - var index = parserInput.i; - if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\$[\w-]+/))) { - return new (tree.Property)(name, index + currentIndex, fileInfo); - } - }, - // A property entity useing the protective {} e.g. ${prop} - propertyCurly: function () { - var curly; - var index = parserInput.i; - if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) { - return new (tree.Property)("$".concat(curly[1]), index + currentIndex, fileInfo); - } - }, - // - // A Hexadecimal color - // - // #4F3C2F - // - // `rgb` and `hsl` colors are parsed through the `entities.call` parser. - // - color: function () { - var rgb; - parserInput.save(); - if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\w.#[])?/))) { - if (!rgb[2]) { - parserInput.forget(); - return new (tree.Color)(rgb[1], undefined, rgb[0]); - } - } - parserInput.restore(); - }, - colorKeyword: function () { - parserInput.save(); - var autoCommentAbsorb = parserInput.autoCommentAbsorb; - parserInput.autoCommentAbsorb = false; - var k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/); - parserInput.autoCommentAbsorb = autoCommentAbsorb; - if (!k) { - parserInput.forget(); - return; - } - parserInput.restore(); - var color = tree.Color.fromKeyword(k); - if (color) { - parserInput.$str(k); - return color; - } - }, - // - // A Dimension, that is, a number and a unit - // - // 0.5em 95% - // - dimension: function () { - if (parserInput.peekNotNumeric()) { - return; - } - var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i); - if (value) { - return new (tree.Dimension)(value[1], value[2]); - } - }, - // - // A unicode descriptor, as is used in unicode-range - // - // U+0?? or U+00A1-00A9 - // - unicodeDescriptor: function () { - var ud; - ud = parserInput.$re(/^U\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/); - if (ud) { - return new (tree.UnicodeDescriptor)(ud[0]); - } - }, - // - // JavaScript code to be evaluated - // - // `window.location.href` - // - javascript: function () { - var js; - var index = parserInput.i; - parserInput.save(); - var escape = parserInput.$char('~'); - var jsQuote = parserInput.$char('`'); - if (!jsQuote) { - parserInput.restore(); - return; - } - js = parserInput.$re(/^[^`]*`/); - if (js) { - parserInput.forget(); - return new (tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo); - } - parserInput.restore('invalid javascript definition'); - } - }, - // - // The variable part of a variable definition. Used in the `rule` parser - // - // @fink: - // - variable: function () { - var name; - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { - return name[1]; - } - }, - // - // Call a variable value to retrieve a detached ruleset - // or a value from a detached ruleset's rules. - // - // @fink(); - // @fink; - // color: @fink[@color]; - // - variableCall: function (parsedName) { - var lookups; - var i = parserInput.i; - var inValue = !!parsedName; - var name = parsedName; - parserInput.save(); - if (name || (parserInput.currentChar() === '@' - && (name = parserInput.$re(/^(@[\w-]+)(\(\s*\))?/)))) { - lookups = this.mixin.ruleLookups(); - if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) { - parserInput.restore('Missing \'[...]\' lookup in variable call'); - return; - } - if (!inValue) { - name = name[1]; - } - var call = new tree.VariableCall(name, i, fileInfo); - if (!inValue && parsers.end()) { - parserInput.forget(); - return call; - } - else { - parserInput.forget(); - return new tree.NamespaceValue(call, lookups, i, fileInfo); - } - } - parserInput.restore(); - }, - // - // extend syntax - used to extend selectors - // - extend: function (isRule) { - var elements; - var e; - var index = parserInput.i; - var option; - var extendList; - var extend; - if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) { - return; - } - do { - option = null; - elements = null; - var first = true; - while (!(option = parserInput.$re(/^(!?all)(?=\s*(\)|,))/))) { - e = this.element(); - if (!e) { - break; - } - /** - * @note - This will not catch selectors in pseudos like :is() and :where() because - * they don't currently parse their contents as selectors. - */ - if (!first && e.combinator.value) { - warn('Targeting complex selectors can have unexpected behavior, and this behavior may change in the future.', index); - } - first = false; - if (elements) { - elements.push(e); - } - else { - elements = [e]; - } - } - option = option && option[1]; - if (!elements) { - error('Missing target selector for :extend().'); - } - extend = new (tree.Extend)(new (tree.Selector)(elements), option, index + currentIndex, fileInfo); - if (extendList) { - extendList.push(extend); - } - else { - extendList = [extend]; - } - } while (parserInput.$char(',')); - expect(/^\)/); - if (isRule) { - expect(/^;/); - } - return extendList; - }, - // - // extendRule - used in a rule to extend all the parent selectors - // - extendRule: function () { - return this.extend(true); - }, - // - // Mixins - // - mixin: { - // - // A Mixin call, with an optional argument list - // - // #mixins > .square(#fff); - // #mixins.square(#fff); - // .rounded(4px, black); - // .button; - // - // We can lookup / return a value using the lookup syntax: - // - // color: #mixin.square(#fff)[@color]; - // - // The `while` loop is there because mixins can be - // namespaced, but we only support the child and descendant - // selector for now. - // - call: function (inValue, getLookup) { - var s = parserInput.currentChar(); - var important = false; - var lookups; - var index = parserInput.i; - var elements; - var args; - var hasParens; - var parensIndex; - var parensWS = false; - if (s !== '.' && s !== '#') { - return; - } - parserInput.save(); // stop us absorbing part of an invalid selector - elements = this.elements(); - if (elements) { - parensIndex = parserInput.i; - if (parserInput.$char('(')) { - parensWS = parserInput.isWhitespace(-2); - args = this.args(true).args; - expectChar(')'); - hasParens = true; - if (parensWS) { - warn('Whitespace between a mixin name and parentheses for a mixin call is deprecated', parensIndex, 'DEPRECATED'); - } - } - if (getLookup !== false) { - lookups = this.ruleLookups(); - } - if (getLookup === true && !lookups) { - parserInput.restore(); - return; - } - if (inValue && !lookups && !hasParens) { - // This isn't a valid in-value mixin call - parserInput.restore(); - return; - } - if (!inValue && parsers.important()) { - important = true; - } - if (inValue || parsers.end()) { - parserInput.forget(); - var mixin = new (tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important); - if (lookups) { - return new tree.NamespaceValue(mixin, lookups); - } - else { - if (!hasParens) { - warn('Calling a mixin without parentheses is deprecated', parensIndex, 'DEPRECATED'); - } - return mixin; - } - } - } - parserInput.restore(); - }, - /** - * Matching elements for mixins - * (Start with . or # and can have > ) - */ - elements: function () { - var elements; - var e; - var c; - var elem; - var elemIndex; - var re = /^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/; - while (true) { - elemIndex = parserInput.i; - e = parserInput.$re(re); - if (!e) { - break; - } - elem = new (tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo); - if (elements) { - elements.push(elem); - } - else { - elements = [elem]; - } - c = parserInput.$char('>'); - } - return elements; - }, - args: function (isCall) { - var entities = parsers.entities; - var returner = { args: null, variadic: false }; - var expressions = []; - var argsSemiColon = []; - var argsComma = []; - var isSemiColonSeparated; - var expressionContainsNamed; - var name; - var nameLoop; - var value; - var arg; - var expand; - var hasSep = true; - parserInput.save(); - while (true) { - if (isCall) { - arg = parsers.detachedRuleset() || parsers.expression(); - } - else { - parserInput.commentStore.length = 0; - if (parserInput.$str('...')) { - returner.variadic = true; - if (parserInput.$char(';') && !isSemiColonSeparated) { - isSemiColonSeparated = true; - } - (isSemiColonSeparated ? argsSemiColon : argsComma) - .push({ variadic: true }); - break; - } - arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true); - } - if (!arg || !hasSep) { - break; - } - nameLoop = null; - if (arg.throwAwayComments) { - arg.throwAwayComments(); - } - value = arg; - var val = null; - if (isCall) { - // Variable - if (arg.value && arg.value.length == 1) { - val = arg.value[0]; - } - } - else { - val = arg; - } - if (val && (val instanceof tree.Variable || val instanceof tree.Property)) { - if (parserInput.$char(':')) { - if (expressions.length > 0) { - if (isSemiColonSeparated) { - error('Cannot mix ; and , as delimiter types'); - } - expressionContainsNamed = true; - } - value = parsers.detachedRuleset() || parsers.expression(); - if (!value) { - if (isCall) { - error('could not understand value for named argument'); - } - else { - parserInput.restore(); - returner.args = []; - return returner; - } - } - nameLoop = (name = val.name); - } - else if (parserInput.$str('...')) { - if (!isCall) { - returner.variadic = true; - if (parserInput.$char(';') && !isSemiColonSeparated) { - isSemiColonSeparated = true; - } - (isSemiColonSeparated ? argsSemiColon : argsComma) - .push({ name: arg.name, variadic: true }); - break; - } - else { - expand = true; - } - } - else if (!isCall) { - name = nameLoop = val.name; - value = null; - } - } - if (value) { - expressions.push(value); - } - argsComma.push({ name: nameLoop, value: value, expand: expand }); - if (parserInput.$char(',')) { - hasSep = true; - continue; - } - hasSep = parserInput.$char(';') === ';'; - if (hasSep || isSemiColonSeparated) { - if (expressionContainsNamed) { - error('Cannot mix ; and , as delimiter types'); - } - isSemiColonSeparated = true; - if (expressions.length > 1) { - value = new (tree.Value)(expressions); - } - argsSemiColon.push({ name: name, value: value, expand: expand }); - name = null; - expressions = []; - expressionContainsNamed = false; - } - } - parserInput.forget(); - returner.args = isSemiColonSeparated ? argsSemiColon : argsComma; - return returner; - }, - // - // A Mixin definition, with a list of parameters - // - // .rounded (@radius: 2px, @color) { - // ... - // } - // - // Until we have a finer grained state-machine, we have to - // do a look-ahead, to make sure we don't have a mixin call. - // See the `rule` function for more information. - // - // We start by matching `.rounded (`, and then proceed on to - // the argument list, which has optional default values. - // We store the parameters in `params`, with a `value` key, - // if there is a value, such as in the case of `@radius`. - // - // Once we've got our params list, and a closing `)`, we parse - // the `{...}` block. - // - definition: function () { - var name; - var params = []; - var match; - var ruleset; - var cond; - var variadic = false; - if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') || - parserInput.peek(/^[^{]*\}/)) { - return; - } - parserInput.save(); - match = parserInput.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/); - if (match) { - name = match[1]; - var argInfo = this.args(false); - params = argInfo.args; - variadic = argInfo.variadic; - // .mixincall("@{a}"); - // looks a bit like a mixin definition.. - // also - // .mixincall(@a: {rule: set;}); - // so we have to be nice and restore - if (!parserInput.$char(')')) { - parserInput.restore('Missing closing \')\''); - return; - } - parserInput.commentStore.length = 0; - if (parserInput.$str('when')) { // Guard - cond = expect(parsers.conditions, 'expected condition'); - } - ruleset = parsers.block(); - if (ruleset) { - parserInput.forget(); - return new (tree.mixin.Definition)(name, params, ruleset, cond, variadic); - } - else { - parserInput.restore(); - } - } - else { - parserInput.restore(); - } - }, - ruleLookups: function () { - var rule; - var lookups = []; - if (parserInput.currentChar() !== '[') { - return; - } - while (true) { - parserInput.save(); - rule = this.lookupValue(); - if (!rule && rule !== '') { - parserInput.restore(); - break; - } - lookups.push(rule); - parserInput.forget(); - } - if (lookups.length > 0) { - return lookups; - } - }, - lookupValue: function () { - parserInput.save(); - if (!parserInput.$char('[')) { - parserInput.restore(); - return; - } - var name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/); - if (!parserInput.$char(']')) { - parserInput.restore(); - return; - } - if (name || name === '') { - parserInput.forget(); - return name; - } - parserInput.restore(); - } - }, - // - // Entities are the smallest recognized token, - // and can be found inside a rule's value. - // - entity: function () { - var entities = this.entities; - return this.comment() || entities.literal() || entities.variable() || entities.url() || - entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) || - entities.javascript(); - }, - // - // A Declaration terminator. Note that we use `peek()` to check for '}', - // because the `block` rule will be expecting it, but we still need to make sure - // it's there, if ';' was omitted. - // - end: function () { - return parserInput.$char(';') || parserInput.peek('}'); - }, - // - // IE's alpha function - // - // alpha(opacity=88) - // - ieAlpha: function () { - var value; - // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 - if (!parserInput.$re(/^opacity=/i)) { - return; - } - value = parserInput.$re(/^\d+/); - if (!value) { - value = expect(parsers.entities.variable, 'Could not parse alpha'); - value = "@{".concat(value.name.slice(1), "}"); - } - expectChar(')'); - return new tree.Quoted('', "alpha(opacity=".concat(value, ")")); - }, - /** - * A Selector Element - * - * div - * + h1 - * #socks - * input[type="text"] - * - * Elements are the building blocks for Selectors, - * they are made out of a `Combinator` (see combinator rule), - * and an element name, such as a tag a class, or `*`. - */ - element: function () { - var e; - var c; - var v; - var index = parserInput.i; - c = this.combinator(); - /** This selector parser is quite simplistic and will pass a number of invalid selectors. */ - e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || - // eslint-disable-next-line no-control-regex - parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || - parserInput.$char('*') || parserInput.$char('&') || this.attribute() || - parserInput.$re(/^\([^&()@]+\)/) || parserInput.$re(/^[.#:](?=@)/) || - this.entities.variableCurly(); - if (!e) { - parserInput.save(); - if (parserInput.$char('(')) { - if ((v = this.selector(false))) { - var selectors = []; - while (parserInput.$char(',')) { - selectors.push(v); - selectors.push(new Anonymous(',')); - v = this.selector(false); - } - selectors.push(v); - if (parserInput.$char(')')) { - if (selectors.length > 1) { - e = new (tree.Paren)(new Selector(selectors)); - } - else { - e = new (tree.Paren)(v); - } - parserInput.forget(); - } - else { - parserInput.restore('Missing closing \')\''); - } - } - else { - parserInput.restore('Missing closing \')\''); - } - } - else { - parserInput.forget(); - } - } - if (e) { - return new (tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); - } - }, - // - // Combinators combine elements together, in a Selector. - // - // Because our parser isn't white-space sensitive, special care - // has to be taken, when parsing the descendant combinator, ` `, - // as it's an empty space. We have to check the previous character - // in the input, to see if it's a ` ` character. More info on how - // we deal with this in *combinator.js*. - // - combinator: function () { - var c = parserInput.currentChar(); - if (c === '/') { - parserInput.save(); - var slashedCombinator = parserInput.$re(/^\/[a-z]+\//i); - if (slashedCombinator) { - parserInput.forget(); - return new (tree.Combinator)(slashedCombinator); - } - parserInput.restore(); - } - if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') { - parserInput.i++; - if (c === '^' && parserInput.currentChar() === '^') { - c = '^^'; - parserInput.i++; - } - while (parserInput.isWhitespace()) { - parserInput.i++; - } - return new (tree.Combinator)(c); - } - else if (parserInput.isWhitespace(-1)) { - return new (tree.Combinator)(' '); - } - else { - return new (tree.Combinator)(null); - } - }, - // - // A CSS Selector - // with less extensions e.g. the ability to extend and guard - // - // .class > div + h1 - // li a:hover - // - // Selectors are made out of one or more Elements, see above. - // - selector: function (isLess) { - var index = parserInput.i; - var elements; - var extendList; - var c; - var e; - var allExtends; - var when; - var condition; - isLess = isLess !== false; - while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) { - if (when) { - condition = expect(this.conditions, 'expected condition'); - } - else if (condition) { - error('CSS guard can only be used at the end of selector'); - } - else if (extendList) { - if (allExtends) { - allExtends = allExtends.concat(extendList); - } - else { - allExtends = extendList; - } - } - else { - if (allExtends) { - error('Extend can only be used at the end of selector'); - } - c = parserInput.currentChar(); - if (Array.isArray(e)) { - e.forEach(function (ele) { return elements.push(ele); }); - } - if (elements) { - elements.push(e); - } - else { - elements = [e]; - } - e = null; - } - if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') { - break; - } - } - if (elements) { - return new (tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); - } - if (allExtends) { - error('Extend must be used to extend a selector, it cannot be used on its own'); - } - }, - selectors: function () { - var s; - var selectors; - while (true) { - s = this.selector(); - if (!s) { - break; - } - if (selectors) { - selectors.push(s); - } - else { - selectors = [s]; - } - parserInput.commentStore.length = 0; - if (s.condition && selectors.length > 1) { - error('Guards are only currently allowed on a single selector.'); - } - if (!parserInput.$char(',')) { - break; - } - if (s.condition) { - error('Guards are only currently allowed on a single selector.'); - } - parserInput.commentStore.length = 0; - } - return selectors; - }, - attribute: function () { - if (!parserInput.$char('[')) { - return; - } - var entities = this.entities; - var key; - var val; - var op; - // - // case-insensitive flag - // e.g. [attr operator value i] - // - var cif; - if (!(key = entities.variableCurly())) { - key = expect(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/); - } - op = parserInput.$re(/^[|~*$^]?=/); - if (op) { - val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly(); - if (val) { - cif = parserInput.$re(/^[iIsS]/); - } - } - expectChar(']'); - return new (tree.Attribute)(key, op, val, cif); - }, - // - // The `block` rule is used by `ruleset` and `mixin.definition`. - // It's a wrapper around the `primary` rule, with added `{}`. - // - block: function () { - var content; - if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) { - return content; - } - }, - blockRuleset: function () { - var block = this.block(); - if (block) { - block = new tree.Ruleset(null, block); - } - return block; - }, - detachedRuleset: function () { - var argInfo; - var params; - var variadic; - parserInput.save(); - if (parserInput.$re(/^[.#]\(/)) { - /** - * DR args currently only implemented for each() function, and not - * yet settable as `@dr: #(@arg) {}` - * This should be done when DRs are merged with mixins. - * See: https://github.com/less/less-meta/issues/16 - */ - argInfo = this.mixin.args(false); - params = argInfo.args; - variadic = argInfo.variadic; - if (!parserInput.$char(')')) { - parserInput.restore(); - return; - } - } - var blockRuleset = this.blockRuleset(); - if (blockRuleset) { - parserInput.forget(); - if (params) { - return new tree.mixin.Definition(null, params, blockRuleset, null, variadic); - } - return new tree.DetachedRuleset(blockRuleset); - } - parserInput.restore(); - }, - // - // div, .class, body > p {...} - // - ruleset: function () { - var selectors; - var rules; - var debugInfo; - parserInput.save(); - if (context.dumpLineNumbers) { - debugInfo = getDebugInfo(parserInput.i); - } - selectors = this.selectors(); - if (selectors && (rules = this.block())) { - parserInput.forget(); - var ruleset = new (tree.Ruleset)(selectors, rules, context.strictImports); - if (context.dumpLineNumbers) { - ruleset.debugInfo = debugInfo; - } - return ruleset; - } - else { - parserInput.restore(); - } - }, - declaration: function () { - var name; - var value; - var index = parserInput.i; - var hasDR; - var c = parserInput.currentChar(); - var important; - var merge; - var isVariable; - if (c === '.' || c === '#' || c === '&' || c === ':') { - return; - } - parserInput.save(); - name = this.variable() || this.ruleProperty(); - if (name) { - isVariable = typeof name === 'string'; - if (isVariable) { - value = this.detachedRuleset(); - if (value) { - hasDR = true; - } - } - parserInput.commentStore.length = 0; - if (!value) { - // a name returned by this.ruleProperty() is always an array of the form: - // [string-1, ..., string-n, ""] or [string-1, ..., string-n, "+"] - // where each item is a tree.Keyword or tree.Variable - merge = !isVariable && name.length > 1 && name.pop().value; - // Custom property values get permissive parsing - if (name[0].value && name[0].value.slice(0, 2) === '--') { - if (parserInput.$char(';')) { - value = new Anonymous(''); - } - else { - value = this.permissiveValue(/[;}]/, true); - } - } - // Try to store values as anonymous - // If we need the value later we'll re-parse it in ruleset.parseValue - else { - value = this.anonymousValue(); - } - if (value) { - parserInput.forget(); - // anonymous values absorb the end ';' which is required for them to work - return new (tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo); - } - if (!value) { - value = this.value(); - } - if (value) { - important = this.important(); - } - else if (isVariable) { - /** - * As a last resort, try permissiveValue - * - * @todo - This has created some knock-on problems of not - * flagging incorrect syntax or detecting user intent. - */ - value = this.permissiveValue(); - } - } - if (value && (this.end() || hasDR)) { - parserInput.forget(); - return new (tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo); - } - else { - parserInput.restore(); - } - } - else { - parserInput.restore(); - } - }, - anonymousValue: function () { - var index = parserInput.i; - var match = parserInput.$re(/^([^.#@$+/'"*`(;{}-]*);/); - if (match) { - return new (tree.Anonymous)(match[1], index + currentIndex); - } - }, - /** - * Used for custom properties, at-rules, and variables (as fallback) - * Parses almost anything inside of {} [] () "" blocks - * until it reaches outer-most tokens. - * - * First, it will try to parse comments and entities to reach - * the end. This is mostly like the Expression parser except no - * math is allowed. - * - * @param {RexExp} untilTokens - Characters to stop parsing at - */ - permissiveValue: function (untilTokens) { - var i; - var e; - var done; - var value; - var tok = untilTokens || ';'; - var index = parserInput.i; - var result = []; - function testCurrentChar() { - var char = parserInput.currentChar(); - if (typeof tok === 'string') { - return char === tok; - } - else { - return tok.test(char); - } - } - if (testCurrentChar()) { - return; - } - value = []; - do { - e = this.comment(); - if (e) { - value.push(e); - continue; - } - e = this.entity(); - if (e) { - value.push(e); - } - if (parserInput.peek(',')) { - value.push(new (tree.Anonymous)(',', parserInput.i)); - parserInput.$char(','); - } - } while (e); - done = testCurrentChar(); - if (value.length > 0) { - value = new (tree.Expression)(value); - if (done) { - return value; - } - else { - result.push(value); - } - // Preserve space before $parseUntil as it will not - if (parserInput.prevChar() === ' ') { - result.push(new tree.Anonymous(' ', index)); - } - } - parserInput.save(); - value = parserInput.$parseUntil(tok); - if (value) { - if (typeof value === 'string') { - error("Expected '".concat(value, "'"), 'Parse'); - } - if (value.length === 1 && value[0] === ' ') { - parserInput.forget(); - return new tree.Anonymous('', index); - } - /** @type {string} */ - var item = void 0; - for (i = 0; i < value.length; i++) { - item = value[i]; - if (Array.isArray(item)) { - // Treat actual quotes as normal quoted values - result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo)); - } - else { - if (i === value.length - 1) { - item = item.trim(); - } - // Treat like quoted values, but replace vars like unquoted expressions - var quote = new tree.Quoted('\'', item, true, index, fileInfo); - var variableRegex = /@([\w-]+)/g; - var propRegex = /\$([\w-]+)/g; - if (variableRegex.test(item)) { - warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED'); - } - if (propRegex.test(item)) { - warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED'); - } - quote.variableRegex = /@([\w-]+)|@{([\w-]+)}/g; - quote.propRegex = /\$([\w-]+)|\${([\w-]+)}/g; - result.push(quote); - } - } - parserInput.forget(); - return new tree.Expression(result, true); - } - parserInput.restore(); - }, - // - // An @import atrule - // - // @import "lib"; - // - // Depending on our environment, importing is done differently: - // In the browser, it's an XHR request, in Node, it would be a - // file-system operation. The function used for importing is - // stored in `import`, which we pass to the Import constructor. - // - 'import': function () { - var path; - var features; - var index = parserInput.i; - var dir = parserInput.$re(/^@import\s+/); - if (dir) { - var options = (dir ? this.importOptions() : null) || {}; - if ((path = this.entities.quoted() || this.entities.url())) { - features = this.mediaFeatures({}); - if (!parserInput.$char(';')) { - parserInput.i = index; - error('missing semi-colon or unrecognised media features on import'); - } - features = features && new (tree.Value)(features); - return new (tree.Import)(path, features, options, index + currentIndex, fileInfo); - } - else { - parserInput.i = index; - error('malformed import statement'); - } - } - }, - importOptions: function () { - var o; - var options = {}; - var optionName; - var value; - // list of options, surrounded by parens - if (!parserInput.$char('(')) { - return null; - } - do { - o = this.importOption(); - if (o) { - optionName = o; - value = true; - switch (optionName) { - case 'css': - optionName = 'less'; - value = false; - break; - case 'once': - optionName = 'multiple'; - value = false; - break; - } - options[optionName] = value; - if (!parserInput.$char(',')) { - break; - } - } - } while (o); - expectChar(')'); - return options; - }, - importOption: function () { - var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); - if (opt) { - return opt[1]; - } - }, - mediaFeature: function (syntaxOptions) { - var entities = this.entities; - var nodes = []; - var e; - var p; - var rangeP; - var spacing = false; - parserInput.save(); - do { - parserInput.save(); - if (parserInput.$re(/^[0-9a-z-]*\s+\(/)) { - spacing = true; - } - parserInput.restore(); - e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup(); - if (e) { - nodes.push(e); - } - else if (parserInput.$char('(')) { - p = this.property(); - parserInput.save(); - if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\s*([<>]=|<=|>=|[<>]|=)/)) { - parserInput.restore(); - p = this.condition(); - parserInput.save(); - rangeP = this.atomicCondition(null, p.rvalue); - if (!rangeP) { - parserInput.restore(); - } - } - else { - parserInput.restore(); - e = this.value(); - } - if (parserInput.$char(')')) { - if (p && !e) { - nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index))); - e = p; - } - else if (p && e) { - nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true))); - if (!spacing) { - nodes[nodes.length - 1].noSpacing = true; - } - spacing = false; - } - else if (e) { - nodes.push(new (tree.Paren)(e)); - spacing = false; - } - else { - error('badly formed media feature definition'); - } - } - else { - error('Missing closing \')\'', 'Parse'); - } - } - } while (e); - parserInput.forget(); - if (nodes.length > 0) { - return new (tree.Expression)(nodes); - } - }, - mediaFeatures: function (syntaxOptions) { - var entities = this.entities; - var features = []; - var e; - do { - e = this.mediaFeature(syntaxOptions); - if (e) { - features.push(e); - if (!parserInput.$char(',')) { - break; - } - else if (!features[features.length - 1].noSpacing) { - features[features.length - 1].noSpacing = false; - } - } - else { - e = entities.variable() || entities.mixinLookup(); - if (e) { - features.push(e); - if (!parserInput.$char(',')) { - break; - } - else if (!features[features.length - 1].noSpacing) { - features[features.length - 1].noSpacing = false; - } - } - } - } while (e); - return features.length > 0 ? features : null; - }, - prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) { - var features = this.mediaFeatures(syntaxOptions); - var rules = this.block(); - if (!rules) { - error('media definitions require block statements after any features'); - } - parserInput.forget(); - var atRule = new (treeType)(rules, features, index + currentIndex, fileInfo); - if (context.dumpLineNumbers) { - atRule.debugInfo = debugInfo; - } - return atRule; - }, - nestableAtRule: function () { - var debugInfo; - var index = parserInput.i; - if (context.dumpLineNumbers) { - debugInfo = getDebugInfo(index); - } - parserInput.save(); - if (parserInput.$peekChar('@')) { - if (parserInput.$str('@media')) { - return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions); - } - if (parserInput.$str('@container')) { - return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions); - } - } - parserInput.restore(); - }, - // - // A @plugin directive, used to import plugins dynamically. - // - // @plugin (args) "lib"; - // - plugin: function () { - var path; - var args; - var options; - var index = parserInput.i; - var dir = parserInput.$re(/^@plugin\s+/); - if (dir) { - args = this.pluginArgs(); - if (args) { - options = { - pluginArgs: args, - isPlugin: true - }; - } - else { - options = { isPlugin: true }; - } - if ((path = this.entities.quoted() || this.entities.url())) { - if (!parserInput.$char(';')) { - parserInput.i = index; - error('missing semi-colon on @plugin'); - } - return new (tree.Import)(path, null, options, index + currentIndex, fileInfo); - } - else { - parserInput.i = index; - error('malformed @plugin statement'); - } - } - }, - pluginArgs: function () { - // list of options, surrounded by parens - parserInput.save(); - if (!parserInput.$char('(')) { - parserInput.restore(); - return null; - } - var args = parserInput.$re(/^\s*([^);]+)\)\s*/); - if (args[1]) { - parserInput.forget(); - return args[1].trim(); - } - else { - parserInput.restore(); - return null; - } - }, - atruleUnknown: function (value, name, hasBlock) { - value = this.permissiveValue(/^[{;]/); - hasBlock = (parserInput.currentChar() === '{'); - if (!value) { - if (!hasBlock && parserInput.currentChar() !== ';') { - error(''.concat(name, ' rule is missing block or ending semi-colon')); - } - } - else if (!value.value) { - value = null; - } - return [value, hasBlock]; - }, - atruleBlock: function (rules, value, isRooted, isKeywordList) { - rules = this.blockRuleset(); - parserInput.save(); - if (!rules && !isRooted) { - value = this.entity(); - rules = this.blockRuleset(); - } - if (!rules && !isRooted) { - parserInput.restore(); - var e = []; - value = this.entity(); - while (parserInput.$char(',')) { - e.push(value); - value = this.entity(); - } - if (value && e.length > 0) { - e.push(value); - value = e; - isKeywordList = true; - } - else { - rules = this.blockRuleset(); - } - } - else { - parserInput.forget(); - } - return [rules, value, isKeywordList]; - }, - // - // A CSS AtRule - // - // @charset "utf-8"; - // - atrule: function () { - var index = parserInput.i; - var name; - var value; - var rules; - var nonVendorSpecificName; - var hasIdentifier; - var hasExpression; - var hasUnknown; - var hasBlock = true; - var isRooted = true; - var isKeywordList = false; - if (parserInput.currentChar() !== '@') { - return; - } - value = this['import']() || this.plugin() || this.nestableAtRule(); - if (value) { - return value; - } - parserInput.save(); - name = parserInput.$re(/^@[a-z-]+/); - if (!name) { - return; - } - nonVendorSpecificName = name; - if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) { - nonVendorSpecificName = "@".concat(name.slice(name.indexOf('-', 2) + 1)); - } - switch (nonVendorSpecificName) { - case '@charset': - hasIdentifier = true; - hasBlock = false; - break; - case '@namespace': - hasExpression = true; - hasBlock = false; - break; - case '@keyframes': - case '@counter-style': - hasIdentifier = true; - break; - case '@document': - case '@supports': - hasUnknown = true; - isRooted = false; - break; - case '@starting-style': - isRooted = false; - break; - case '@layer': - isRooted = false; - break; - default: - hasUnknown = true; - break; - } - parserInput.commentStore.length = 0; - if (hasIdentifier) { - value = this.entity(); - if (!value) { - error("expected ".concat(name, " identifier")); - } - } - else if (hasExpression) { - value = this.expression(); - if (!value) { - error("expected ".concat(name, " expression")); - } - } - else if (hasUnknown) { - var unknownPackage = this.atruleUnknown(value, name, hasBlock); - value = unknownPackage[0]; - hasBlock = unknownPackage[1]; - } - if (hasBlock) { - var blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList); - rules = blockPackage[0]; - value = blockPackage[1]; - isKeywordList = blockPackage[2]; - if (!rules && !hasUnknown) { - parserInput.restore(); - name = parserInput.$re(/^@[a-z-]+/); - var unknownPackage = this.atruleUnknown(value, name, hasBlock); - value = unknownPackage[0]; - hasBlock = unknownPackage[1]; - if (hasBlock) { - blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList); - rules = blockPackage[0]; - value = blockPackage[1]; - isKeywordList = blockPackage[2]; - } - } - } - if (rules || isKeywordList || (!hasBlock && value && parserInput.$char(';'))) { - parserInput.forget(); - return new (tree.AtRule)(name, value, rules, index + currentIndex, fileInfo, context.dumpLineNumbers ? getDebugInfo(index) : null, isRooted); - } - parserInput.restore('at-rule options not recognised'); - }, - // - // A Value is a comma-delimited list of Expressions - // - // font-family: Baskerville, Georgia, serif; - // - // In a Rule, a Value represents everything after the `:`, - // and before the `;`. - // - value: function () { - var e; - var expressions = []; - var index = parserInput.i; - do { - e = this.expression(); - if (e) { - expressions.push(e); - if (!parserInput.$char(',')) { - break; - } - } - } while (e); - if (expressions.length > 0) { - return new (tree.Value)(expressions, index + currentIndex); - } - }, - important: function () { - if (parserInput.currentChar() === '!') { - return parserInput.$re(/^! *important/); - } - }, - sub: function () { - var a; - var e; - parserInput.save(); - if (parserInput.$char('(')) { - a = this.addition(); - if (a && parserInput.$char(')')) { - parserInput.forget(); - e = new (tree.Expression)([a]); - e.parens = true; - return e; - } - parserInput.restore('Expected \')\''); - return; - } - parserInput.restore(); - }, - colorOperand: function () { - parserInput.save(); - // hsl or rgb or lch operand - var match = parserInput.$re(/^[lchrgbs]\s+/); - if (match) { - return new tree.Keyword(match[0]); - } - parserInput.restore(); - }, - multiplication: function () { - var m; - var a; - var op; - var operation; - var isSpaced; - m = this.operand(); - if (m) { - isSpaced = parserInput.isWhitespace(-1); - while (true) { - if (parserInput.peek(/^\/[*/]/)) { - break; - } - parserInput.save(); - op = parserInput.$char('/') || parserInput.$char('*'); - if (!op) { - var index = parserInput.i; - op = parserInput.$str('./'); - if (op) { - warn('./ operator is deprecated', index, 'DEPRECATED'); - } - } - if (!op) { - parserInput.forget(); - break; - } - a = this.operand(); - if (!a) { - parserInput.restore(); - break; - } - parserInput.forget(); - m.parensInOp = true; - a.parensInOp = true; - operation = new (tree.Operation)(op, [operation || m, a], isSpaced); - isSpaced = parserInput.isWhitespace(-1); - } - return operation || m; - } - }, - addition: function () { - var m; - var a; - var op; - var operation; - var isSpaced; - m = this.multiplication(); - if (m) { - isSpaced = parserInput.isWhitespace(-1); - while (true) { - op = parserInput.$re(/^[-+]\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-'))); - if (!op) { - break; - } - a = this.multiplication(); - if (!a) { - break; - } - m.parensInOp = true; - a.parensInOp = true; - operation = new (tree.Operation)(op, [operation || m, a], isSpaced); - isSpaced = parserInput.isWhitespace(-1); - } - return operation || m; - } - }, - conditions: function () { - var a; - var b; - var index = parserInput.i; - var condition; - a = this.condition(true); - if (a) { - while (true) { - if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(',')) { - break; - } - b = this.condition(true); - if (!b) { - break; - } - condition = new (tree.Condition)('or', condition || a, b, index + currentIndex); - } - return condition || a; - } - }, - condition: function (needsParens) { - var result; - var logical; - var next; - function or() { - return parserInput.$str('or'); - } - result = this.conditionAnd(needsParens); - if (!result) { - return; - } - logical = or(); - if (logical) { - next = this.condition(needsParens); - if (next) { - result = new (tree.Condition)(logical, result, next); - } - else { - return; - } - } - return result; - }, - conditionAnd: function (needsParens) { - var result; - var logical; - var next; - var self = this; - function insideCondition() { - var cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens); - if (!cond && !needsParens) { - return self.atomicCondition(needsParens); - } - return cond; - } - function and() { - return parserInput.$str('and'); - } - result = insideCondition(); - if (!result) { - return; - } - logical = and(); - if (logical) { - next = this.conditionAnd(needsParens); - if (next) { - result = new (tree.Condition)(logical, result, next); - } - else { - return; - } - } - return result; - }, - negatedCondition: function (needsParens) { - if (parserInput.$str('not')) { - var result = this.parenthesisCondition(needsParens); - if (result) { - result.negate = !result.negate; - } - return result; - } - }, - parenthesisCondition: function (needsParens) { - function tryConditionFollowedByParenthesis(me) { - var body; - parserInput.save(); - body = me.condition(needsParens); - if (!body) { - parserInput.restore(); - return; - } - if (!parserInput.$char(')')) { - parserInput.restore(); - return; - } - parserInput.forget(); - return body; - } - var body; - parserInput.save(); - if (!parserInput.$str('(')) { - parserInput.restore(); - return; - } - body = tryConditionFollowedByParenthesis(this); - if (body) { - parserInput.forget(); - return body; - } - body = this.atomicCondition(needsParens); - if (!body) { - parserInput.restore(); - return; - } - if (!parserInput.$char(')')) { - parserInput.restore("expected ')' got '".concat(parserInput.currentChar(), "'")); - return; - } - parserInput.forget(); - return body; - }, - atomicCondition: function (needsParens, preparsedCond) { - var entities = this.entities; - var index = parserInput.i; - var a; - var b; - var c; - var op; - var cond = (function () { - return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); - }).bind(this); - if (preparsedCond) { - a = preparsedCond; - } - else { - a = cond(); - } - if (a) { - if (parserInput.$char('>')) { - if (parserInput.$char('=')) { - op = '>='; - } - else { - op = '>'; - } - } - else if (parserInput.$char('<')) { - if (parserInput.$char('=')) { - op = '<='; - } - else { - op = '<'; - } - } - else if (parserInput.$char('=')) { - if (parserInput.$char('>')) { - op = '=>'; - } - else if (parserInput.$char('<')) { - op = '=<'; - } - else { - op = '='; - } - } - if (op) { - b = cond(); - if (b) { - c = new (tree.Condition)(op, a, b, index + currentIndex, false); - } - else { - error('expected expression'); - } - } - else if (!preparsedCond) { - c = new (tree.Condition)('=', a, new (tree.Keyword)('true'), index + currentIndex, false); - } - return c; - } - }, - // - // An operand is anything that can be part of an operation, - // such as a Color, or a Variable - // - operand: function () { - var entities = this.entities; - var negate; - if (parserInput.peek(/^-[@$(]/)) { - negate = parserInput.$char('-'); - } - var o = this.sub() || entities.dimension() || - entities.color() || entities.variable() || - entities.property() || entities.call() || - entities.quoted(true) || entities.colorKeyword() || - this.colorOperand() || entities.mixinLookup(); - if (negate) { - o.parensInOp = true; - o = new (tree.Negative)(o); - } - return o; - }, - // - // Expressions either represent mathematical operations, - // or white-space delimited Entities. - // - // 1px solid black - // @var * 2 - // - expression: function () { - var entities = []; - var e; - var delim; - var index = parserInput.i; - do { - e = this.comment(); - if (e && !e.isLineComment) { - entities.push(e); - continue; - } - e = this.addition() || this.entity(); - if (e instanceof tree.Comment) { - e = null; - } - if (e) { - entities.push(e); - // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here - if (!parserInput.peek(/^\/[/*]/)) { - delim = parserInput.$char('/'); - if (delim) { - entities.push(new (tree.Anonymous)(delim, index + currentIndex)); - } - } - } - } while (e); - if (entities.length > 0) { - return new (tree.Expression)(entities); - } - }, - property: function () { - var name = parserInput.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/); - if (name) { - return name[1]; - } - }, - ruleProperty: function () { - var name = []; - var index = []; - var s; - var k; - parserInput.save(); - var simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\s*:/); - if (simpleProperty) { - name = [new (tree.Keyword)(simpleProperty[1])]; - parserInput.forget(); - return name; - } - function match(re) { - var i = parserInput.i; - var chunk = parserInput.$re(re); - if (chunk) { - index.push(i); - return name.push(chunk[1]); - } - } - match(/^(\*?)/); - while (true) { - if (!match(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/)) { - break; - } - } - if ((name.length > 1) && match(/^((?:\+_|\+)?)\s*:/)) { - parserInput.forget(); - // at last, we have the complete match now. move forward, - // convert name particles to tree objects and return: - if (name[0] === '') { - name.shift(); - index.shift(); - } - for (k = 0; k < name.length; k++) { - s = name[k]; - name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ? - new (tree.Keyword)(s) : - (s.charAt(0) === '@' ? - new (tree.Variable)("@".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo) : - new (tree.Property)("$".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo)); - } - return name; - } - parserInput.restore(); - } - } - }; - }; - Parser.serializeVars = function (vars) { - var s = ''; - for (var name_1 in vars) { - if (Object.hasOwnProperty.call(vars, name_1)) { - var value = vars[name_1]; - s += "".concat(((name_1[0] === '@') ? '' : '@') + name_1, ": ").concat(value).concat((String(value).slice(-1) === ';') ? '' : ';'); - } - } - return s; - }; - - var Selector = function (elements, extendList, condition, index, currentFileInfo, visibilityInfo) { - this.extendList = extendList; - this.condition = condition; - this.evaldCondition = !condition; - this._index = index; - this._fileInfo = currentFileInfo; - this.elements = this.getElements(elements); - this.mixinElements_ = undefined; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.elements, this); - }; - Selector.prototype = Object.assign(new Node(), { - type: 'Selector', - accept: function (visitor) { - if (this.elements) { - this.elements = visitor.visitArray(this.elements); - } - if (this.extendList) { - this.extendList = visitor.visitArray(this.extendList); - } - if (this.condition) { - this.condition = visitor.visit(this.condition); - } - }, - createDerived: function (elements, extendList, evaldCondition) { - elements = this.getElements(elements); - var newSelector = new Selector(elements, extendList || this.extendList, null, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - newSelector.evaldCondition = (!isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition; - newSelector.mediaEmpty = this.mediaEmpty; - return newSelector; - }, - getElements: function (els) { - if (!els) { - return [new Element('', '&', false, this._index, this._fileInfo)]; - } - if (typeof els === 'string') { - new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(els, ['selector'], function (err, result) { - if (err) { - throw new LessError({ - index: err.index, - message: err.message - }, this.parse.imports, this._fileInfo.filename); - } - els = result[0].elements; - }); - } - return els; - }, - createEmptySelectors: function () { - var el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)]; - sels[0].mediaEmpty = true; - return sels; - }, - match: function (other) { - var elements = this.elements; - var len = elements.length; - var olen; - var i; - other = other.mixinElements(); - olen = other.length; - if (olen === 0 || len < olen) { - return 0; - } - else { - for (i = 0; i < olen; i++) { - if (elements[i].value !== other[i]) { - return 0; - } - } - } - return olen; // return number of matched elements - }, - mixinElements: function () { - if (this.mixinElements_) { - return this.mixinElements_; - } - var elements = this.elements.map(function (v) { - return v.combinator.value + (v.value.value || v.value); - }).join('').match(/[,&#*.\w-]([\w-]|(\\.))*/g); - if (elements) { - if (elements[0] === '&') { - elements.shift(); - } - } - else { - elements = []; - } - return (this.mixinElements_ = elements); - }, - isJustParentSelector: function () { - return !this.mediaEmpty && - this.elements.length === 1 && - this.elements[0].value === '&' && - (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === ''); - }, - eval: function (context) { - var evaldCondition = this.condition && this.condition.eval(context); - var elements = this.elements; - var extendList = this.extendList; - elements = elements && elements.map(function (e) { return e.eval(context); }); - extendList = extendList && extendList.map(function (extend) { return extend.eval(context); }); - return this.createDerived(elements, extendList, evaldCondition); - }, - genCSS: function (context, output) { - var i, element; - if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') { - output.add(' ', this.fileInfo(), this.getIndex()); - } - for (i = 0; i < this.elements.length; i++) { - element = this.elements[i]; - element.genCSS(context, output); - } - }, - getIsOutput: function () { - return this.evaldCondition; - } - }); - - var Value = function (value) { - if (!value) { - throw new Error('Value requires an array argument'); - } - if (!Array.isArray(value)) { - this.value = [value]; - } - else { - this.value = value; - } - }; - Value.prototype = Object.assign(new Node(), { - type: 'Value', - accept: function (visitor) { - if (this.value) { - this.value = visitor.visitArray(this.value); - } - }, - eval: function (context) { - if (this.value.length === 1) { - return this.value[0].eval(context); - } - else { - return new Value(this.value.map(function (v) { - return v.eval(context); - })); - } - }, - genCSS: function (context, output) { - var i; - for (i = 0; i < this.value.length; i++) { - this.value[i].genCSS(context, output); - if (i + 1 < this.value.length) { - output.add((context && context.compress) ? ',' : ', '); - } - } - } - }); - - var Keyword = function (value) { - this.value = value; - }; - Keyword.prototype = Object.assign(new Node(), { - type: 'Keyword', - genCSS: function (context, output) { - if (this.value === '%') { - throw { type: 'Syntax', message: 'Invalid % without number' }; - } - output.add(this.value); - } - }); - Keyword.True = new Keyword('true'); - Keyword.False = new Keyword('false'); - - var MATH$1 = Math$1; - function evalName(context, name) { - var value = ''; - var i; - var n = name.length; - var output = { add: function (s) { value += s; } }; - for (i = 0; i < n; i++) { - name[i].eval(context).genCSS(context, output); - } - return value; - } - var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) { - this.name = name; - this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); - this.important = important ? " ".concat(important.trim()) : ''; - this.merge = merge; - this._index = index; - this._fileInfo = currentFileInfo; - this.inline = inline || false; - this.variable = (variable !== undefined) ? variable - : (name.charAt && (name.charAt(0) === '@')); - this.allowRoot = true; - this.setParent(this.value, this); - }; - Declaration.prototype = Object.assign(new Node(), { - type: 'Declaration', - genCSS: function (context, output) { - output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); - try { - this.value.genCSS(context, output); - } - catch (e) { - e.index = this._index; - e.filename = this._fileInfo.filename; - throw e; - } - output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index); - }, - eval: function (context) { - var mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable; - if (typeof name !== 'string') { - // expand 'primitive' name directly to get - // things faster (~10% for benchmark.less): - name = (name.length === 1) && (name[0] instanceof Keyword) ? - name[0].value : evalName(context, name); - variable = false; // never treat expanded interpolation as new variable name - } - // @todo remove when parens-division is default - if (name === 'font' && context.math === MATH$1.ALWAYS) { - mathBypass = true; - prevMath = context.math; - context.math = MATH$1.PARENS_DIVISION; - } - try { - context.importantScope.push({}); - evaldValue = this.value.eval(context); - if (!this.variable && evaldValue.type === 'DetachedRuleset') { - throw { message: 'Rulesets cannot be evaluated on a property.', - index: this.getIndex(), filename: this.fileInfo().filename }; - } - var important = this.important; - var importantResult = context.importantScope.pop(); - if (!important && importantResult.important) { - important = importantResult.important; - } - return new Declaration(name, evaldValue, important, this.merge, this.getIndex(), this.fileInfo(), this.inline, variable); - } - catch (e) { - if (typeof e.index !== 'number') { - e.index = this.getIndex(); - e.filename = this.fileInfo().filename; - } - throw e; - } - finally { - if (mathBypass) { - context.math = prevMath; - } - } - }, - makeImportant: function () { - return new Declaration(this.name, this.value, '!important', this.merge, this.getIndex(), this.fileInfo(), this.inline); - } - }); - - function asComment(ctx) { - return "/* line ".concat(ctx.debugInfo.lineNumber, ", ").concat(ctx.debugInfo.fileName, " */\n"); - } - function asMediaQuery(ctx) { - var filenameWithProtocol = ctx.debugInfo.fileName; - if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { - filenameWithProtocol = "file://".concat(filenameWithProtocol); - } - return "@media -sass-debug-info{filename{font-family:".concat(filenameWithProtocol.replace(/([.:/\\])/g, function (a) { - if (a == '\\') { - a = '/'; - } - return "\\".concat(a); - }), "}line{font-family:\\00003").concat(ctx.debugInfo.lineNumber, "}}\n"); - } - function debugInfo(context, ctx, lineSeparator) { - var result = ''; - if (context.dumpLineNumbers && !context.compress) { - switch (context.dumpLineNumbers) { - case 'comments': - result = asComment(ctx); - break; - case 'mediaquery': - result = asMediaQuery(ctx); - break; - case 'all': - result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx); - break; - } - } - return result; - } - - var Comment = function (value, isLineComment, index, currentFileInfo) { - this.value = value; - this.isLineComment = isLineComment; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; - }; - Comment.prototype = Object.assign(new Node(), { - type: 'Comment', - genCSS: function (context, output) { - if (this.debugInfo) { - output.add(debugInfo(context, this), this.fileInfo(), this.getIndex()); - } - output.add(this.value); - }, - isSilent: function (context) { - var isCompressed = context.compress && this.value[2] !== '!'; - return this.isLineComment || isCompressed; - } - }); - - var defaultFunc = { - eval: function () { - var v = this.value_; - var e = this.error_; - if (e) { - throw e; - } - if (!isNullOrUndefined(v)) { - return v ? Keyword.True : Keyword.False; - } - }, - value: function (v) { - this.value_ = v; - }, - error: function (e) { - this.error_ = e; - }, - reset: function () { - this.value_ = this.error_ = null; - } - }; - - var Ruleset = function (selectors, rules, strictImports, visibilityInfo) { - this.selectors = selectors; - this.rules = rules; - this._lookups = {}; - this._variables = null; - this._properties = null; - this.strictImports = strictImports; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(this.selectors, this); - this.setParent(this.rules, this); - }; - Ruleset.prototype = Object.assign(new Node(), { - type: 'Ruleset', - isRuleset: true, - isRulesetLike: function () { return true; }, - accept: function (visitor) { - if (this.paths) { - this.paths = visitor.visitArray(this.paths, true); - } - else if (this.selectors) { - this.selectors = visitor.visitArray(this.selectors); - } - if (this.rules && this.rules.length) { - this.rules = visitor.visitArray(this.rules); - } - }, - eval: function (context) { - var selectors; - var selCnt; - var selector; - var i; - var hasVariable; - var hasOnePassingSelector = false; - if (this.selectors && (selCnt = this.selectors.length)) { - selectors = new Array(selCnt); - defaultFunc.error({ - type: 'Syntax', - message: 'it is currently only allowed in parametric mixin guards,' - }); - for (i = 0; i < selCnt; i++) { - selector = this.selectors[i].eval(context); - for (var j = 0; j < selector.elements.length; j++) { - if (selector.elements[j].isVariable) { - hasVariable = true; - break; - } - } - selectors[i] = selector; - if (selector.evaldCondition) { - hasOnePassingSelector = true; - } - } - if (hasVariable) { - var toParseSelectors = new Array(selCnt); - for (i = 0; i < selCnt; i++) { - selector = selectors[i]; - toParseSelectors[i] = selector.toCSS(context); - } - var startingIndex = selectors[0].getIndex(); - var selectorFileInfo = selectors[0].fileInfo(); - new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(toParseSelectors.join(','), ['selectors'], function (err, result) { - if (result) { - selectors = flattenArray(result); - } - }); - } - defaultFunc.reset(); - } - else { - hasOnePassingSelector = true; - } - var rules = this.rules ? copyArray(this.rules) : null; - var ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo()); - var rule; - var subRule; - ruleset.originalRuleset = this; - ruleset.root = this.root; - ruleset.firstRoot = this.firstRoot; - ruleset.allowImports = this.allowImports; - if (this.debugInfo) { - ruleset.debugInfo = this.debugInfo; - } - if (!hasOnePassingSelector) { - rules.length = 0; - } - // inherit a function registry from the frames stack when possible; - // otherwise from the global registry - ruleset.functionRegistry = (function (frames) { - var i = 0; - var n = frames.length; - var found; - for (; i !== n; ++i) { - found = frames[i].functionRegistry; - if (found) { - return found; - } - } - return functionRegistry; - }(context.frames)).inherit(); - // push the current ruleset to the frames stack - var ctxFrames = context.frames; - ctxFrames.unshift(ruleset); - // currrent selectors - var ctxSelectors = context.selectors; - if (!ctxSelectors) { - context.selectors = ctxSelectors = []; - } - ctxSelectors.unshift(this.selectors); - // Evaluate imports - if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) { - ruleset.evalImports(context); - } - // Store the frames around mixin definitions, - // so they can be evaluated like closures when the time comes. - var rsRules = ruleset.rules; - for (i = 0; (rule = rsRules[i]); i++) { - if (rule.evalFirst) { - rsRules[i] = rule.eval(context); - } - } - var mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0; - // Evaluate mixin calls. - for (i = 0; (rule = rsRules[i]); i++) { - if (rule.type === 'MixinCall') { - /* jshint loopfunc:true */ - rules = rule.eval(context).filter(function (r) { - if ((r instanceof Declaration) && r.variable) { - // do not pollute the scope if the variable is - // already there. consider returning false here - // but we need a way to "return" variable from mixins - return !(ruleset.variable(r.name)); - } - return true; - }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); - i += rules.length - 1; - ruleset.resetCache(); - } - else if (rule.type === 'VariableCall') { - /* jshint loopfunc:true */ - rules = rule.eval(context).rules.filter(function (r) { - if ((r instanceof Declaration) && r.variable) { - // do not pollute the scope at all - return false; - } - return true; - }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); - i += rules.length - 1; - ruleset.resetCache(); - } - } - // Evaluate everything else - for (i = 0; (rule = rsRules[i]); i++) { - if (!rule.evalFirst) { - rsRules[i] = rule = rule.eval ? rule.eval(context) : rule; - } - } - // Evaluate everything else - for (i = 0; (rule = rsRules[i]); i++) { - // for rulesets, check if it is a css guard and can be removed - if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) { - // check if it can be folded in (e.g. & where) - if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) { - rsRules.splice(i--, 1); - for (var j = 0; (subRule = rule.rules[j]); j++) { - if (subRule instanceof Node) { - subRule.copyVisibilityInfo(rule.visibilityInfo()); - if (!(subRule instanceof Declaration) || !subRule.variable) { - rsRules.splice(++i, 0, subRule); - } - } - } - } - } - } - // Pop the stack - ctxFrames.shift(); - ctxSelectors.shift(); - if (context.mediaBlocks) { - for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) { - context.mediaBlocks[i].bubbleSelectors(selectors); - } - } - return ruleset; - }, - evalImports: function (context) { - var rules = this.rules; - var i; - var importRules; - if (!rules) { - return; - } - for (i = 0; i < rules.length; i++) { - if (rules[i].type === 'Import') { - importRules = rules[i].eval(context); - if (importRules && (importRules.length || importRules.length === 0)) { - rules.splice.apply(rules, [i, 1].concat(importRules)); - i += importRules.length - 1; - } - else { - rules.splice(i, 1, importRules); - } - this.resetCache(); - } - } - }, - makeImportant: function () { - var result = new Ruleset(this.selectors, this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(); - } - else { - return r; - } - }), this.strictImports, this.visibilityInfo()); - return result; - }, - matchArgs: function (args) { - return !args || args.length === 0; - }, - // lets you call a css selector with a guard - matchCondition: function (args, context) { - var lastSelector = this.selectors[this.selectors.length - 1]; - if (!lastSelector.evaldCondition) { - return false; - } - if (lastSelector.condition && - !lastSelector.condition.eval(new contexts.Eval(context, context.frames))) { - return false; - } - return true; - }, - resetCache: function () { - this._rulesets = null; - this._variables = null; - this._properties = null; - this._lookups = {}; - }, - variables: function () { - if (!this._variables) { - this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) { - if (r instanceof Declaration && r.variable === true) { - hash[r.name] = r; - } - // when evaluating variables in an import statement, imports have not been eval'd - // so we need to go inside import statements. - // guard against root being a string (in the case of inlined less) - if (r.type === 'Import' && r.root && r.root.variables) { - var vars = r.root.variables(); - for (var name_1 in vars) { - // eslint-disable-next-line no-prototype-builtins - if (vars.hasOwnProperty(name_1)) { - hash[name_1] = r.root.variable(name_1); - } - } - } - return hash; - }, {}); - } - return this._variables; - }, - properties: function () { - if (!this._properties) { - this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) { - if (r instanceof Declaration && r.variable !== true) { - var name_2 = (r.name.length === 1) && (r.name[0] instanceof Keyword) ? - r.name[0].value : r.name; - // Properties don't overwrite as they can merge - if (!hash["$".concat(name_2)]) { - hash["$".concat(name_2)] = [r]; - } - else { - hash["$".concat(name_2)].push(r); - } - } - return hash; - }, {}); - } - return this._properties; - }, - variable: function (name) { - var decl = this.variables()[name]; - if (decl) { - return this.parseValue(decl); - } - }, - property: function (name) { - var decl = this.properties()[name]; - if (decl) { - return this.parseValue(decl); - } - }, - lastDeclaration: function () { - for (var i_1 = this.rules.length; i_1 > 0; i_1--) { - var decl = this.rules[i_1 - 1]; - if (decl instanceof Declaration) { - return this.parseValue(decl); - } - } - }, - parseValue: function (toParse) { - var self = this; - function transformDeclaration(decl) { - if (decl.value instanceof Anonymous && !decl.parsed) { - if (typeof decl.value.value === 'string') { - new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(decl.value.value, ['value', 'important'], function (err, result) { - if (err) { - decl.parsed = true; - } - if (result) { - decl.value = result[0]; - decl.important = result[1] || ''; - decl.parsed = true; - } - }); - } - else { - decl.parsed = true; - } - return decl; - } - else { - return decl; - } - } - if (!Array.isArray(toParse)) { - return transformDeclaration.call(self, toParse); - } - else { - var nodes_1 = []; - toParse.forEach(function (n) { - nodes_1.push(transformDeclaration.call(self, n)); - }); - return nodes_1; - } - }, - rulesets: function () { - if (!this.rules) { - return []; - } - var filtRules = []; - var rules = this.rules; - var i; - var rule; - for (i = 0; (rule = rules[i]); i++) { - if (rule.isRuleset) { - filtRules.push(rule); - } - } - return filtRules; - }, - prependRule: function (rule) { - var rules = this.rules; - if (rules) { - rules.unshift(rule); - } - else { - this.rules = [rule]; - } - this.setParent(rule, this); - }, - find: function (selector, self, filter) { - self = self || this; - var rules = []; - var match; - var foundMixins; - var key = selector.toCSS(); - if (key in this._lookups) { - return this._lookups[key]; - } - this.rulesets().forEach(function (rule) { - if (rule !== self) { - for (var j = 0; j < rule.selectors.length; j++) { - match = selector.match(rule.selectors[j]); - if (match) { - if (selector.elements.length > match) { - if (!filter || filter(rule)) { - foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter); - for (var i_2 = 0; i_2 < foundMixins.length; ++i_2) { - foundMixins[i_2].path.push(rule); - } - Array.prototype.push.apply(rules, foundMixins); - } - } - else { - rules.push({ rule: rule, path: [] }); - } - break; - } - } - } - }); - this._lookups[key] = rules; - return rules; - }, - genCSS: function (context, output) { - var i; - var j; - var charsetRuleNodes = []; - var ruleNodes = []; - var // Line number debugging - debugInfo$1; - var rule; - var path; - context.tabLevel = (context.tabLevel || 0); - if (!this.root) { - context.tabLevel++; - } - var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' '); - var tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' '); - var sep; - var charsetNodeIndex = 0; - var importNodeIndex = 0; - for (i = 0; (rule = this.rules[i]); i++) { - if (rule instanceof Comment) { - if (importNodeIndex === i) { - importNodeIndex++; - } - ruleNodes.push(rule); - } - else if (rule.isCharset && rule.isCharset()) { - ruleNodes.splice(charsetNodeIndex, 0, rule); - charsetNodeIndex++; - importNodeIndex++; - } - else if (rule.type === 'Import') { - ruleNodes.splice(importNodeIndex, 0, rule); - importNodeIndex++; - } - else { - ruleNodes.push(rule); - } - } - ruleNodes = charsetRuleNodes.concat(ruleNodes); - // If this is the root node, we don't render - // a selector, or {}. - if (!this.root) { - debugInfo$1 = debugInfo(context, this, tabSetStr); - if (debugInfo$1) { - output.add(debugInfo$1); - output.add(tabSetStr); - } - var paths = this.paths; - var pathCnt = paths.length; - var pathSubCnt = void 0; - sep = context.compress ? ',' : (",\n".concat(tabSetStr)); - for (i = 0; i < pathCnt; i++) { - path = paths[i]; - if (!(pathSubCnt = path.length)) { - continue; - } - if (i > 0) { - output.add(sep); - } - context.firstSelector = true; - path[0].genCSS(context, output); - context.firstSelector = false; - for (j = 1; j < pathSubCnt; j++) { - path[j].genCSS(context, output); - } - } - output.add((context.compress ? '{' : ' {\n') + tabRuleStr); - } - // Compile rules and rulesets - for (i = 0; (rule = ruleNodes[i]); i++) { - if (i + 1 === ruleNodes.length) { - context.lastRule = true; - } - var currentLastRule = context.lastRule; - if (rule.isRulesetLike(rule)) { - context.lastRule = false; - } - if (rule.genCSS) { - rule.genCSS(context, output); - } - else if (rule.value) { - output.add(rule.value.toString()); - } - context.lastRule = currentLastRule; - if (!context.lastRule && rule.isVisible()) { - output.add(context.compress ? '' : ("\n".concat(tabRuleStr))); - } - else { - context.lastRule = false; - } - } - if (!this.root) { - output.add((context.compress ? '}' : "\n".concat(tabSetStr, "}"))); - context.tabLevel--; - } - if (!output.isEmpty() && !context.compress && this.firstRoot) { - output.add('\n'); - } - }, - joinSelectors: function (paths, context, selectors) { - for (var s = 0; s < selectors.length; s++) { - this.joinSelector(paths, context, selectors[s]); - } - }, - joinSelector: function (paths, context, selector) { - function createParenthesis(elementsToPak, originalElement) { - var replacementParen, j; - if (elementsToPak.length === 0) { - replacementParen = new Paren(elementsToPak[0]); - } - else { - var insideParent = new Array(elementsToPak.length); - for (j = 0; j < elementsToPak.length; j++) { - insideParent[j] = new Element(null, elementsToPak[j], originalElement.isVariable, originalElement._index, originalElement._fileInfo); - } - replacementParen = new Paren(new Selector(insideParent)); - } - return replacementParen; - } - function createSelector(containedElement, originalElement) { - var element, selector; - element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo); - selector = new Selector([element]); - return selector; - } - // joins selector path from `beginningPath` with selector path in `addPath` - // `replacedElement` contains element that is being replaced by `addPath` - // returns concatenated path - function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) { - var newSelectorPath, lastSelector, newJoinedSelector; - // our new selector path - newSelectorPath = []; - // construct the joined selector - if & is the first thing this will be empty, - // if not newJoinedSelector will be the last set of elements in the selector - if (beginningPath.length > 0) { - newSelectorPath = copyArray(beginningPath); - lastSelector = newSelectorPath.pop(); - newJoinedSelector = originalSelector.createDerived(copyArray(lastSelector.elements)); - } - else { - newJoinedSelector = originalSelector.createDerived([]); - } - if (addPath.length > 0) { - // /deep/ is a CSS4 selector - (removed, so should deprecate) - // that is valid without anything in front of it - // so if the & does not have a combinator that is "" or " " then - // and there is a combinator on the parent, then grab that. - // this also allows + a { & .b { .a & { ... though not sure why you would want to do that - var combinator = replacedElement.combinator; - var parentEl = addPath[0].elements[0]; - if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) { - combinator = parentEl.combinator; - } - // join the elements so far with the first part of the parent - newJoinedSelector.elements.push(new Element(combinator, parentEl.value, replacedElement.isVariable, replacedElement._index, replacedElement._fileInfo)); - newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1)); - } - // now add the joined selector - but only if it is not empty - if (newJoinedSelector.elements.length !== 0) { - newSelectorPath.push(newJoinedSelector); - } - // put together the parent selectors after the join (e.g. the rest of the parent) - if (addPath.length > 1) { - var restOfPath = addPath.slice(1); - restOfPath = restOfPath.map(function (selector) { - return selector.createDerived(selector.elements, []); - }); - newSelectorPath = newSelectorPath.concat(restOfPath); - } - return newSelectorPath; - } - // joins selector path from `beginningPath` with every selector path in `addPaths` array - // `replacedElement` contains element that is being replaced by `addPath` - // returns array with all concatenated paths - function addAllReplacementsIntoPath(beginningPath, addPaths, replacedElement, originalSelector, result) { - var j; - for (j = 0; j < beginningPath.length; j++) { - var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector); - result.push(newSelectorPath); - } - return result; - } - function mergeElementsOnToSelectors(elements, selectors) { - var i, sel; - if (elements.length === 0) { - return; - } - if (selectors.length === 0) { - selectors.push([new Selector(elements)]); - return; - } - for (i = 0; (sel = selectors[i]); i++) { - // if the previous thing in sel is a parent this needs to join on to it - if (sel.length > 0) { - sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements)); - } - else { - sel.push(new Selector(elements)); - } - } - } - // replace all parent selectors inside `inSelector` by content of `context` array - // resulting selectors are returned inside `paths` array - // returns true if `inSelector` contained at least one parent selector - function replaceParentSelector(paths, context, inSelector) { - // The paths are [[Selector]] - // The first list is a list of comma separated selectors - // The inner list is a list of inheritance separated selectors - // e.g. - // .a, .b { - // .c { - // } - // } - // == [[.a] [.c]] [[.b] [.c]] - // - var i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector; - function findNestedSelector(element) { - var maybeSelector; - if (!(element.value instanceof Paren)) { - return null; - } - maybeSelector = element.value.value; - if (!(maybeSelector instanceof Selector)) { - return null; - } - return maybeSelector; - } - // the elements from the current selector so far - currentElements = []; - // the current list of new selectors to add to the path. - // We will build it up. We initiate it with one empty selector as we "multiply" the new selectors - // by the parents - newSelectors = [ - [] - ]; - for (i = 0; (el = inSelector.elements[i]); i++) { - // non parent reference elements just get added - if (el.value !== '&') { - var nestedSelector = findNestedSelector(el); - if (nestedSelector !== null) { - // merge the current list of non parent selector elements - // on to the current list of selectors to add - mergeElementsOnToSelectors(currentElements, newSelectors); - var nestedPaths = []; - var replaced = void 0; - var replacedNewSelectors = []; - replaced = replaceParentSelector(nestedPaths, context, nestedSelector); - hadParentSelector = hadParentSelector || replaced; - // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors - for (k = 0; k < nestedPaths.length; k++) { - var replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); - addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); - } - newSelectors = replacedNewSelectors; - currentElements = []; - } - else { - currentElements.push(el); - } - } - else { - hadParentSelector = true; - // the new list of selectors to add - selectorsMultiplied = []; - // merge the current list of non parent selector elements - // on to the current list of selectors to add - mergeElementsOnToSelectors(currentElements, newSelectors); - // loop through our current selectors - for (j = 0; j < newSelectors.length; j++) { - sel = newSelectors[j]; - // if we don't have any parent paths, the & might be in a mixin so that it can be used - // whether there are parents or not - if (context.length === 0) { - // the combinator used on el should now be applied to the next element instead so that - // it is not lost - if (sel.length > 0) { - sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo)); - } - selectorsMultiplied.push(sel); - } - else { - // and the parent selectors - for (k = 0; k < context.length; k++) { - // We need to put the current selectors - // then join the last selector's elements on to the parents selectors - var newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector); - // add that to our new set of selectors - selectorsMultiplied.push(newSelectorPath); - } - } - } - // our new selectors has been multiplied, so reset the state - newSelectors = selectorsMultiplied; - currentElements = []; - } - } - // if we have any elements left over (e.g. .a& .b == .b) - // add them on to all the current selectors - mergeElementsOnToSelectors(currentElements, newSelectors); - for (i = 0; i < newSelectors.length; i++) { - length = newSelectors[i].length; - if (length > 0) { - paths.push(newSelectors[i]); - lastSelector = newSelectors[i][length - 1]; - newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList); - } - } - return hadParentSelector; - } - function deriveSelector(visibilityInfo, deriveFrom) { - var newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition); - newSelector.copyVisibilityInfo(visibilityInfo); - return newSelector; - } - // joinSelector code follows - var i, newPaths, hadParentSelector; - newPaths = []; - hadParentSelector = replaceParentSelector(newPaths, context, selector); - if (!hadParentSelector) { - if (context.length > 0) { - newPaths = []; - for (i = 0; i < context.length; i++) { - var concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo())); - concatenated.push(selector); - newPaths.push(concatenated); - } - } - else { - newPaths = [[selector]]; - } - } - for (i = 0; i < newPaths.length; i++) { - paths.push(newPaths[i]); - } - } - }); - - var Unit = function (numerator, denominator, backupUnit) { - this.numerator = numerator ? copyArray(numerator).sort() : []; - this.denominator = denominator ? copyArray(denominator).sort() : []; - if (backupUnit) { - this.backupUnit = backupUnit; - } - else if (numerator && numerator.length) { - this.backupUnit = numerator[0]; - } - }; - Unit.prototype = Object.assign(new Node(), { - type: 'Unit', - clone: function () { - return new Unit(copyArray(this.numerator), copyArray(this.denominator), this.backupUnit); - }, - genCSS: function (context, output) { - // Dimension checks the unit is singular and throws an error if in strict math mode. - var strictUnits = context && context.strictUnits; - if (this.numerator.length === 1) { - output.add(this.numerator[0]); // the ideal situation - } - else if (!strictUnits && this.backupUnit) { - output.add(this.backupUnit); - } - else if (!strictUnits && this.denominator.length) { - output.add(this.denominator[0]); - } - }, - toString: function () { - var i, returnStr = this.numerator.join('*'); - for (i = 0; i < this.denominator.length; i++) { - returnStr += "/".concat(this.denominator[i]); - } - return returnStr; - }, - compare: function (other) { - return this.is(other.toString()) ? 0 : undefined; - }, - is: function (unitString) { - return this.toString().toUpperCase() === unitString.toUpperCase(); - }, - isLength: function () { - return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); - }, - isEmpty: function () { - return this.numerator.length === 0 && this.denominator.length === 0; - }, - isSingular: function () { - return this.numerator.length <= 1 && this.denominator.length === 0; - }, - map: function (callback) { - var i; - for (i = 0; i < this.numerator.length; i++) { - this.numerator[i] = callback(this.numerator[i], false); - } - for (i = 0; i < this.denominator.length; i++) { - this.denominator[i] = callback(this.denominator[i], true); - } - }, - usedUnits: function () { - var group; - var result = {}; - var mapUnit; - var groupName; - mapUnit = function (atomicUnit) { - // eslint-disable-next-line no-prototype-builtins - if (group.hasOwnProperty(atomicUnit) && !result[groupName]) { - result[groupName] = atomicUnit; - } - return atomicUnit; - }; - for (groupName in unitConversions) { - // eslint-disable-next-line no-prototype-builtins - if (unitConversions.hasOwnProperty(groupName)) { - group = unitConversions[groupName]; - this.map(mapUnit); - } - } - return result; - }, - cancel: function () { - var counter = {}; - var atomicUnit; - var i; - for (i = 0; i < this.numerator.length; i++) { - atomicUnit = this.numerator[i]; - counter[atomicUnit] = (counter[atomicUnit] || 0) + 1; - } - for (i = 0; i < this.denominator.length; i++) { - atomicUnit = this.denominator[i]; - counter[atomicUnit] = (counter[atomicUnit] || 0) - 1; - } - this.numerator = []; - this.denominator = []; - for (atomicUnit in counter) { - // eslint-disable-next-line no-prototype-builtins - if (counter.hasOwnProperty(atomicUnit)) { - var count = counter[atomicUnit]; - if (count > 0) { - for (i = 0; i < count; i++) { - this.numerator.push(atomicUnit); - } - } - else if (count < 0) { - for (i = 0; i < -count; i++) { - this.denominator.push(atomicUnit); - } - } - } - } - this.numerator.sort(); - this.denominator.sort(); - } - }); - - /* eslint-disable no-prototype-builtins */ - // - // A number with a unit - // - var Dimension = function (value, unit) { - this.value = parseFloat(value); - if (isNaN(this.value)) { - throw new Error('Dimension is not a number.'); - } - this.unit = (unit && unit instanceof Unit) ? unit : - new Unit(unit ? [unit] : undefined); - this.setParent(this.unit, this); - }; - Dimension.prototype = Object.assign(new Node(), { - type: 'Dimension', - accept: function (visitor) { - this.unit = visitor.visit(this.unit); - }, - // remove when Nodes have JSDoc types - // eslint-disable-next-line no-unused-vars - eval: function (context) { - return this; - }, - toColor: function () { - return new Color([this.value, this.value, this.value]); - }, - genCSS: function (context, output) { - if ((context && context.strictUnits) && !this.unit.isSingular()) { - throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: ".concat(this.unit.toString())); - } - var value = this.fround(context, this.value); - var strValue = String(value); - if (value !== 0 && value < 0.000001 && value > -0.000001) { - // would be output 1e-6 etc. - strValue = value.toFixed(20).replace(/0+$/, ''); - } - if (context && context.compress) { - // Zero values doesn't need a unit - if (value === 0 && this.unit.isLength()) { - output.add(strValue); - return; - } - // Float values doesn't need a leading zero - if (value > 0 && value < 1) { - strValue = (strValue).substr(1); - } - } - output.add(strValue); - this.unit.genCSS(context, output); - }, - // In an operation between two Dimensions, - // we default to the first Dimension's unit, - // so `1px + 2` will yield `3px`. - operate: function (context, op, other) { - /* jshint noempty:false */ - var value = this._operate(context, op, this.value, other.value); - var unit = this.unit.clone(); - if (op === '+' || op === '-') { - if (unit.numerator.length === 0 && unit.denominator.length === 0) { - unit = other.unit.clone(); - if (this.unit.backupUnit) { - unit.backupUnit = this.unit.backupUnit; - } - } - else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) ; - else { - other = other.convertTo(this.unit.usedUnits()); - if (context.strictUnits && other.unit.toString() !== unit.toString()) { - throw new Error('Incompatible units. Change the units or use the unit function. ' - + "Bad units: '".concat(unit.toString(), "' and '").concat(other.unit.toString(), "'.")); - } - value = this._operate(context, op, this.value, other.value); - } - } - else if (op === '*') { - unit.numerator = unit.numerator.concat(other.unit.numerator).sort(); - unit.denominator = unit.denominator.concat(other.unit.denominator).sort(); - unit.cancel(); - } - else if (op === '/') { - unit.numerator = unit.numerator.concat(other.unit.denominator).sort(); - unit.denominator = unit.denominator.concat(other.unit.numerator).sort(); - unit.cancel(); - } - return new Dimension(value, unit); - }, - compare: function (other) { - var a, b; - if (!(other instanceof Dimension)) { - return undefined; - } - if (this.unit.isEmpty() || other.unit.isEmpty()) { - a = this; - b = other; - } - else { - a = this.unify(); - b = other.unify(); - if (a.unit.compare(b.unit) !== 0) { - return undefined; - } - } - return Node.numericCompare(a.value, b.value); - }, - unify: function () { - return this.convertTo({ length: 'px', duration: 's', angle: 'rad' }); - }, - convertTo: function (conversions) { - var value = this.value; - var unit = this.unit.clone(); - var i; - var groupName; - var group; - var targetUnit; - var derivedConversions = {}; - var applyUnit; - if (typeof conversions === 'string') { - for (i in unitConversions) { - if (unitConversions[i].hasOwnProperty(conversions)) { - derivedConversions = {}; - derivedConversions[i] = conversions; - } - } - conversions = derivedConversions; - } - applyUnit = function (atomicUnit, denominator) { - if (group.hasOwnProperty(atomicUnit)) { - if (denominator) { - value = value / (group[atomicUnit] / group[targetUnit]); - } - else { - value = value * (group[atomicUnit] / group[targetUnit]); - } - return targetUnit; - } - return atomicUnit; - }; - for (groupName in conversions) { - if (conversions.hasOwnProperty(groupName)) { - targetUnit = conversions[groupName]; - group = unitConversions[groupName]; - unit.map(applyUnit); - } - } - unit.cancel(); - return new Dimension(value, unit); - } - }); - - var Expression = function (value, noSpacing) { - this.value = value; - this.noSpacing = noSpacing; - if (!value) { - throw new Error('Expression requires an array parameter'); - } - }; - Expression.prototype = Object.assign(new Node(), { - type: 'Expression', - accept: function (visitor) { - this.value = visitor.visitArray(this.value); - }, - eval: function (context) { - var noSpacing = this.noSpacing; - var returnValue; - var mathOn = context.isMathOn(); - var inParenthesis = this.parens; - var doubleParen = false; - if (inParenthesis) { - context.inParenthesis(); - } - if (this.value.length > 1) { - returnValue = new Expression(this.value.map(function (e) { - if (!e.eval) { - return e; - } - return e.eval(context); - }), this.noSpacing); - } - else if (this.value.length === 1) { - if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) { - doubleParen = true; - } - returnValue = this.value[0].eval(context); - } - else { - returnValue = this; - } - if (inParenthesis) { - context.outOfParenthesis(); - } - if (this.parens && this.parensInOp && !mathOn && !doubleParen - && (!(returnValue instanceof Dimension))) { - returnValue = new Paren(returnValue); - } - returnValue.noSpacing = returnValue.noSpacing || noSpacing; - return returnValue; - }, - genCSS: function (context, output) { - for (var i_1 = 0; i_1 < this.value.length; i_1++) { - this.value[i_1].genCSS(context, output); - if (!this.noSpacing && i_1 + 1 < this.value.length) { - if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) || - this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ',') { - output.add(' '); - } - } - } - }, - throwAwayComments: function () { - this.value = this.value.filter(function (v) { - return !(v instanceof Comment); - }); - } - }); - - var NestableAtRulePrototype = { - isRulesetLike: function () { - return true; - }, - accept: function (visitor) { - if (this.features) { - this.features = visitor.visit(this.features); - } - if (this.rules) { - this.rules = visitor.visitArray(this.rules); - } - }, - evalFunction: function () { - if (!this.features || !Array.isArray(this.features.value) || this.features.value.length < 1) { - return; - } - var exprValues = this.features.value; - var expr, paren; - for (var index = 0; index < exprValues.length; ++index) { - expr = exprValues[index]; - if (expr.type === 'Keyword' && index + 1 < exprValues.length && (expr.noSpacing || expr.noSpacing == null)) { - paren = exprValues[index + 1]; - if (paren.type === 'Paren' && paren.noSpacing) { - exprValues[index] = new Expression([expr, paren]); - exprValues.splice(index + 1, 1); - exprValues[index].noSpacing = true; - } - } - } - }, - evalTop: function (context) { - this.evalFunction(); - var result = this; - // Render all dependent Media blocks. - if (context.mediaBlocks.length > 1) { - var selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors(); - result = new Ruleset(selectors, context.mediaBlocks); - result.multiMedia = true; - result.copyVisibilityInfo(this.visibilityInfo()); - this.setParent(result, this); - } - delete context.mediaBlocks; - delete context.mediaPath; - return result; - }, - evalNested: function (context) { - this.evalFunction(); - var i; - var value; - var path = context.mediaPath.concat([this]); - // Extract the media-query conditions separated with `,` (OR). - for (i = 0; i < path.length; i++) { - if (path[i].type !== this.type) { - context.mediaBlocks.splice(i, 1); - return this; - } - value = path[i].features instanceof Value ? - path[i].features.value : path[i].features; - path[i] = Array.isArray(value) ? value : [value]; - } - // Trace all permutations to generate the resulting media-query. - // - // (a, b and c) with nested (d, e) -> - // a and d - // a and e - // b and c and d - // b and c and e - this.features = new Value(this.permute(path).map(function (path) { - path = path.map(function (fragment) { return fragment.toCSS ? fragment : new Anonymous(fragment); }); - for (i = path.length - 1; i > 0; i--) { - path.splice(i, 0, new Anonymous('and')); - } - return new Expression(path); - })); - this.setParent(this.features, this); - // Fake a tree-node that doesn't output anything. - return new Ruleset([], []); - }, - permute: function (arr) { - if (arr.length === 0) { - return []; - } - else if (arr.length === 1) { - return arr[0]; - } - else { - var result = []; - var rest = this.permute(arr.slice(1)); - for (var i_1 = 0; i_1 < rest.length; i_1++) { - for (var j = 0; j < arr[0].length; j++) { - result.push([arr[0][j]].concat(rest[i_1])); - } - } - return result; - } - }, - bubbleSelectors: function (selectors) { - if (!selectors) { - return; - } - this.rules = [new Ruleset(copyArray(selectors), [this.rules[0]])]; - this.setParent(this.rules, this); - } - }; - - var AtRule = function (name, value, rules, index, currentFileInfo, debugInfo, isRooted, visibilityInfo) { - var _this = this; - var i; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - this.name = name; - this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); - if (rules) { - if (Array.isArray(rules)) { - var allDeclarations = this.declarationsBlock(rules); - var allRulesetDeclarations_1 = true; - rules.forEach(function (rule) { - if (rule.type === 'Ruleset' && rule.rules) - allRulesetDeclarations_1 = allRulesetDeclarations_1 && _this.declarationsBlock(rule.rules, true); - }); - if (allDeclarations && !isRooted) { - this.simpleBlock = true; - this.declarations = rules; - } - else if (allRulesetDeclarations_1 && rules.length === 1 && !isRooted && !value) { - this.simpleBlock = true; - this.declarations = rules[0].rules ? rules[0].rules : rules; - } - else { - this.rules = rules; - } - } - else { - var allDeclarations = this.declarationsBlock(rules.rules); - if (allDeclarations && !isRooted && !value) { - this.simpleBlock = true; - this.declarations = rules.rules; - } - else { - this.rules = [rules]; - this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); - } - } - if (!this.simpleBlock) { - for (i = 0; i < this.rules.length; i++) { - this.rules[i].allowImports = true; - } - } - this.setParent(selectors, this); - this.setParent(this.rules, this); - } - this._index = index; - this._fileInfo = currentFileInfo; - this.debugInfo = debugInfo; - this.isRooted = isRooted || false; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - }; - AtRule.prototype = Object.assign(new Node(), __assign(__assign({ type: 'AtRule' }, NestableAtRulePrototype), { declarationsBlock: function (rules, mergeable) { - if (mergeable === void 0) { mergeable = false; } - if (!mergeable) { - return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge; }).length === rules.length; - } - else { - return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length; - } - }, keywordList: function (rules) { - if (!Array.isArray(rules)) { - return false; - } - else { - return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length; - } - }, accept: function (visitor) { - var value = this.value, rules = this.rules, declarations = this.declarations; - if (rules) { - this.rules = visitor.visitArray(rules); - } - else if (declarations) { - this.declarations = visitor.visitArray(declarations); - } - if (value) { - this.value = visitor.visit(value); - } - }, isRulesetLike: function () { - return this.rules || !this.isCharset(); - }, isCharset: function () { - return '@charset' === this.name; - }, genCSS: function (context, output) { - var value = this.value, rules = this.rules || this.declarations; - output.add(this.name, this.fileInfo(), this.getIndex()); - if (value) { - output.add(' '); - value.genCSS(context, output); - } - if (this.simpleBlock) { - this.outputRuleset(context, output, this.declarations); - } - else if (rules) { - this.outputRuleset(context, output, rules); - } - else { - output.add(';'); - } - }, eval: function (context) { - var mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations; - // media stored inside other atrule should not bubble over it - // backpup media bubbling information - mediaPathBackup = context.mediaPath; - mediaBlocksBackup = context.mediaBlocks; - // deleted media bubbling information - context.mediaPath = []; - context.mediaBlocks = []; - if (value) { - value = value.eval(context); - if (value.value && this.keywordList(value.value)) { - value = new Anonymous(value.value.map(function (keyword) { return keyword.value; }).join(', '), this.getIndex(), this.fileInfo()); - } - } - if (rules) { - rules = this.evalRoot(context, rules); - } - if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) { - var allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true); - if (allMergeableDeclarations && !this.isRooted && !value) { - var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; - mergeRules(rules[0].rules); - rules = rules[0].rules; - rules.forEach(function (rule) { return rule.merge = false; }); - } - } - if (this.simpleBlock && rules) { - rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - rules = rules.map(function (rule) { return rule.eval(context); }); - } - // restore media bubbling information - context.mediaPath = mediaPathBackup; - context.mediaBlocks = mediaBlocksBackup; - return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); - }, evalRoot: function (context, rules) { - var ampersandCount = 0; - var noAmpersandCount = 0; - var noAmpersands = true; - var allAmpersands = false; - if (!this.simpleBlock) { - rules = [rules[0].eval(context)]; - } - var precedingSelectors = []; - if (context.frames.length > 0) { - var _loop_1 = function (index) { - var frame = context.frames[index]; - if (frame.type === 'Ruleset' && - frame.rules && - frame.rules.length > 0) { - if (frame && !frame.root && frame.selectors && frame.selectors.length > 0) { - precedingSelectors = precedingSelectors.concat(frame.selectors); - } - } - if (precedingSelectors.length > 0) { - var value_1 = ''; - var output = { add: function (s) { value_1 += s; } }; - for (var i_1 = 0; i_1 < precedingSelectors.length; i_1++) { - precedingSelectors[i_1].genCSS(context, output); - } - if (/^&+$/.test(value_1.replace(/\s+/g, ''))) { - noAmpersands = false; - noAmpersandCount++; - } - else { - allAmpersands = false; - ampersandCount++; - } - } - }; - for (var index = 0; index < context.frames.length; index++) { - _loop_1(index); - } - } - var mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !allAmpersands && !noAmpersands; - if ((this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && !allAmpersands && noAmpersands) - || !mixedAmpersands) { - rules[0].root = true; - } - return rules; - }, variable: function (name) { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.variable.call(this.rules[0], name); - } - }, find: function () { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.find.apply(this.rules[0], arguments); - } - }, rulesets: function () { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.rulesets.apply(this.rules[0]); - } - }, outputRuleset: function (context, output, rules) { - var ruleCnt = rules.length; - var i; - context.tabLevel = (context.tabLevel | 0) + 1; - // Compressed - if (context.compress) { - output.add('{'); - for (i = 0; i < ruleCnt; i++) { - rules[i].genCSS(context, output); - } - output.add('}'); - context.tabLevel--; - return; - } - // Non-compressed - var tabSetStr = "\n".concat(Array(context.tabLevel).join(' ')), tabRuleStr = "".concat(tabSetStr, " "); - if (!ruleCnt) { - output.add(" {".concat(tabSetStr, "}")); - } - else { - output.add(" {".concat(tabRuleStr)); - rules[0].genCSS(context, output); - for (i = 1; i < ruleCnt; i++) { - output.add(tabRuleStr); - rules[i].genCSS(context, output); - } - output.add("".concat(tabSetStr, "}")); - } - context.tabLevel--; - } })); - - var DetachedRuleset = function (ruleset, frames) { - this.ruleset = ruleset; - this.frames = frames; - this.setParent(this.ruleset, this); - }; - DetachedRuleset.prototype = Object.assign(new Node(), { - type: 'DetachedRuleset', - evalFirst: true, - accept: function (visitor) { - this.ruleset = visitor.visit(this.ruleset); - }, - eval: function (context) { - var frames = this.frames || copyArray(context.frames); - return new DetachedRuleset(this.ruleset, frames); - }, - callEval: function (context) { - return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); - } - }); - - var MATH = Math$1; - var Operation = function (op, operands, isSpaced) { - this.op = op.trim(); - this.operands = operands; - this.isSpaced = isSpaced; - }; - Operation.prototype = Object.assign(new Node(), { - type: 'Operation', - accept: function (visitor) { - this.operands = visitor.visitArray(this.operands); - }, - eval: function (context) { - var a = this.operands[0].eval(context), b = this.operands[1].eval(context), op; - if (context.isMathOn(this.op)) { - op = this.op === './' ? '/' : this.op; - if (a instanceof Dimension && b instanceof Color) { - a = a.toColor(); - } - if (b instanceof Dimension && a instanceof Color) { - b = b.toColor(); - } - if (!a.operate || !b.operate) { - if ((a instanceof Operation || b instanceof Operation) - && a.op === '/' && context.math === MATH.PARENS_DIVISION) { - return new Operation(this.op, [a, b], this.isSpaced); - } - throw { type: 'Operation', - message: 'Operation on an invalid type' }; - } - return a.operate(context, op, b); - } - else { - return new Operation(this.op, [a, b], this.isSpaced); - } - }, - genCSS: function (context, output) { - this.operands[0].genCSS(context, output); - if (this.isSpaced) { - output.add(' '); - } - output.add(this.op); - if (this.isSpaced) { - output.add(' '); - } - this.operands[1].genCSS(context, output); - } - }); - - var functionCaller = /** @class */ (function () { - function functionCaller(name, context, index, currentFileInfo) { - this.name = name.toLowerCase(); - this.index = index; - this.context = context; - this.currentFileInfo = currentFileInfo; - this.func = context.frames[0].functionRegistry.get(this.name); - } - functionCaller.prototype.isValid = function () { - return Boolean(this.func); - }; - functionCaller.prototype.call = function (args) { - var _this = this; - if (!(Array.isArray(args))) { - args = [args]; - } - var evalArgs = this.func.evalArgs; - if (evalArgs !== false) { - args = args.map(function (a) { return a.eval(_this.context); }); - } - var commentFilter = function (item) { return !(item.type === 'Comment'); }; - // This code is terrible and should be replaced as per this issue... - // https://github.com/less/less.js/issues/2477 - args = args - .filter(commentFilter) - .map(function (item) { - if (item.type === 'Expression') { - var subNodes = item.value.filter(commentFilter); - if (subNodes.length === 1) { - // https://github.com/less/less.js/issues/3616 - if (item.parens && subNodes[0].op === '/') { - return item; - } - return subNodes[0]; - } - else { - return new Expression(subNodes); - } - } - return item; - }); - if (evalArgs === false) { - return this.func.apply(this, __spreadArray([this.context], args, false)); - } - return this.func.apply(this, args); - }; - return functionCaller; - }()); - - // - // A function call node. - // - var Call = function (name, args, index, currentFileInfo) { - this.name = name; - this.args = args; - this.calc = name === 'calc'; - this._index = index; - this._fileInfo = currentFileInfo; - }; - Call.prototype = Object.assign(new Node(), { - type: 'Call', - accept: function (visitor) { - if (this.args) { - this.args = visitor.visitArray(this.args); - } - }, - // - // When evaluating a function call, - // we either find the function in the functionRegistry, - // in which case we call it, passing the evaluated arguments, - // if this returns null or we cannot find the function, we - // simply print it out as it appeared originally [2]. - // - // The reason why we evaluate the arguments, is in the case where - // we try to pass a variable to a function, like: `saturate(@color)`. - // The function should receive the value, not the variable. - // - eval: function (context) { - var _this = this; - /** - * Turn off math for calc(), and switch back on for evaluating nested functions - */ - var currentMathContext = context.mathOn; - context.mathOn = !this.calc; - if (this.calc || context.inCalc) { - context.enterCalc(); - } - var exitCalc = function () { - if (_this.calc || context.inCalc) { - context.exitCalc(); - } - context.mathOn = currentMathContext; - }; - var result; - var funcCaller = new functionCaller(this.name, context, this.getIndex(), this.fileInfo()); - if (funcCaller.isValid()) { - try { - result = funcCaller.call(this.args); - exitCalc(); - } - catch (e) { - // eslint-disable-next-line no-prototype-builtins - if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) { - throw e; - } - throw { - type: e.type || 'Runtime', - message: "Error evaluating function `".concat(this.name, "`").concat(e.message ? ": ".concat(e.message) : ''), - index: this.getIndex(), - filename: this.fileInfo().filename, - line: e.lineNumber, - column: e.columnNumber - }; - } - } - if (result !== null && result !== undefined) { - // Results that that are not nodes are cast as Anonymous nodes - // Falsy values or booleans are returned as empty nodes - if (!(result instanceof Node)) { - if (!result || result === true) { - result = new Anonymous(null); - } - else { - result = new Anonymous(result.toString()); - } - } - result._index = this._index; - result._fileInfo = this._fileInfo; - return result; - } - var args = this.args.map(function (a) { return a.eval(context); }); - exitCalc(); - return new Call(this.name, args, this.getIndex(), this.fileInfo()); - }, - genCSS: function (context, output) { - output.add("".concat(this.name, "("), this.fileInfo(), this.getIndex()); - for (var i_1 = 0; i_1 < this.args.length; i_1++) { - this.args[i_1].genCSS(context, output); - if (i_1 + 1 < this.args.length) { - output.add(', '); - } - } - output.add(')'); - } - }); - - var Variable = function (name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; - }; - Variable.prototype = Object.assign(new Node(), { - type: 'Variable', - eval: function (context) { - var variable, name = this.name; - if (name.indexOf('@@') === 0) { - name = "@".concat(new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value); - } - if (this.evaluating) { - throw { type: 'Name', - message: "Recursive variable definition for ".concat(name), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - this.evaluating = true; - variable = this.find(context.frames, function (frame) { - var v = frame.variable(name); - if (v) { - if (v.important) { - var importantScope = context.importantScope[context.importantScope.length - 1]; - importantScope.important = v.important; - } - // If in calc, wrap vars in a function call to cascade evaluate args first - if (context.inCalc) { - return (new Call('_SELF', [v.value])).eval(context); - } - else { - return v.value.eval(context); - } - } - }); - if (variable) { - this.evaluating = false; - return variable; - } - else { - throw { type: 'Name', - message: "variable ".concat(name, " is undefined"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - }, - find: function (obj, fun) { - for (var i_1 = 0, r = void 0; i_1 < obj.length; i_1++) { - r = fun.call(obj, obj[i_1]); - if (r) { - return r; - } - } - return null; - } - }); - - var Property = function (name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; - }; - Property.prototype = Object.assign(new Node(), { - type: 'Property', - eval: function (context) { - var property; - var name = this.name; - // TODO: shorten this reference - var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; - if (this.evaluating) { - throw { type: 'Name', - message: "Recursive property reference for ".concat(name), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - this.evaluating = true; - property = this.find(context.frames, function (frame) { - var v; - var vArr = frame.property(name); - if (vArr) { - for (var i_1 = 0; i_1 < vArr.length; i_1++) { - v = vArr[i_1]; - vArr[i_1] = new Declaration(v.name, v.value, v.important, v.merge, v.index, v.currentFileInfo, v.inline, v.variable); - } - mergeRules(vArr); - v = vArr[vArr.length - 1]; - if (v.important) { - var importantScope = context.importantScope[context.importantScope.length - 1]; - importantScope.important = v.important; - } - v = v.value.eval(context); - return v; - } - }); - if (property) { - this.evaluating = false; - return property; - } - else { - throw { type: 'Name', - message: "Property '".concat(name, "' is undefined"), - filename: this.currentFileInfo.filename, - index: this.index }; - } - }, - find: function (obj, fun) { - for (var i_2 = 0, r = void 0; i_2 < obj.length; i_2++) { - r = fun.call(obj, obj[i_2]); - if (r) { - return r; - } - } - return null; - } - }); - - var Attribute = function (key, op, value, cif) { - this.key = key; - this.op = op; - this.value = value; - this.cif = cif; - }; - Attribute.prototype = Object.assign(new Node(), { - type: 'Attribute', - eval: function (context) { - return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value, this.cif); - }, - genCSS: function (context, output) { - output.add(this.toCSS(context)); - }, - toCSS: function (context) { - var value = this.key.toCSS ? this.key.toCSS(context) : this.key; - if (this.op) { - value += this.op; - value += (this.value.toCSS ? this.value.toCSS(context) : this.value); - } - if (this.cif) { - value = value + ' ' + this.cif; - } - return "[".concat(value, "]"); - } - }); - - var Quoted = function (str, content, escaped, index, currentFileInfo) { - this.escaped = (escaped === undefined) ? true : escaped; - this.value = content || ''; - this.quote = str.charAt(0); - this._index = index; - this._fileInfo = currentFileInfo; - this.variableRegex = /@\{([\w-]+)\}/g; - this.propRegex = /\$\{([\w-]+)\}/g; - this.allowRoot = escaped; - }; - Quoted.prototype = Object.assign(new Node(), { - type: 'Quoted', - genCSS: function (context, output) { - if (!this.escaped) { - output.add(this.quote, this.fileInfo(), this.getIndex()); - } - output.add(this.value); - if (!this.escaped) { - output.add(this.quote); - } - }, - containsVariables: function () { - return this.value.match(this.variableRegex); - }, - eval: function (context) { - var that = this; - var value = this.value; - var variableReplacement = function (_, name1, name2) { - var v = new Variable("@".concat(name1 !== null && name1 !== void 0 ? name1 : name2), that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); - }; - var propertyReplacement = function (_, name1, name2) { - var v = new Property("$".concat(name1 !== null && name1 !== void 0 ? name1 : name2), that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); - }; - function iterativeReplace(value, regexp, replacementFnc) { - var evaluatedValue = value; - do { - value = evaluatedValue.toString(); - evaluatedValue = value.replace(regexp, replacementFnc); - } while (value !== evaluatedValue); - return evaluatedValue; - } - value = iterativeReplace(value, this.variableRegex, variableReplacement); - value = iterativeReplace(value, this.propRegex, propertyReplacement); - return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); - }, - compare: function (other) { - // when comparing quoted strings allow the quote to differ - if (other.type === 'Quoted' && !this.escaped && !other.escaped) { - return Node.numericCompare(this.value, other.value); - } - else { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; - } - } - }); - - function escapePath(path) { - return path.replace(/[()'"\s]/g, function (match) { return "\\".concat(match); }); - } - var URL = function (val, index, currentFileInfo, isEvald) { - this.value = val; - this._index = index; - this._fileInfo = currentFileInfo; - this.isEvald = isEvald; - }; - URL.prototype = Object.assign(new Node(), { - type: 'Url', - accept: function (visitor) { - this.value = visitor.visit(this.value); - }, - genCSS: function (context, output) { - output.add('url('); - this.value.genCSS(context, output); - output.add(')'); - }, - eval: function (context) { - var val = this.value.eval(context); - var rootpath; - if (!this.isEvald) { - // Add the rootpath if the URL requires a rewrite - rootpath = this.fileInfo() && this.fileInfo().rootpath; - if (typeof rootpath === 'string' && - typeof val.value === 'string' && - context.pathRequiresRewrite(val.value)) { - if (!val.quote) { - rootpath = escapePath(rootpath); - } - val.value = context.rewritePath(val.value, rootpath); - } - else { - val.value = context.normalizePath(val.value); - } - // Add url args if enabled - if (context.urlArgs) { - if (!val.value.match(/^\s*data:/)) { - var delimiter = val.value.indexOf('?') === -1 ? '?' : '&'; - var urlArgs = delimiter + context.urlArgs; - if (val.value.indexOf('#') !== -1) { - val.value = val.value.replace('#', "".concat(urlArgs, "#")); - } - else { - val.value += urlArgs; - } - } - } - } - return new URL(val, this.getIndex(), this.fileInfo(), true); - } - }); - - var Media = function (value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); - }; - Media.prototype = Object.assign(new AtRule(), __assign(__assign({ type: 'Media' }, NestableAtRulePrototype), { genCSS: function (context, output) { - output.add('@media ', this._fileInfo, this._index); - this.features.genCSS(context, output); - this.outputRuleset(context, output, this.rules); - }, eval: function (context) { - if (!context.mediaBlocks) { - context.mediaBlocks = []; - context.mediaPath = []; - } - var media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo()); - if (this.debugInfo) { - this.rules[0].debugInfo = this.debugInfo; - media.debugInfo = this.debugInfo; - } - media.features = this.features.eval(context); - context.mediaPath.push(media); - context.mediaBlocks.push(media); - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; - context.frames.shift(); - context.mediaPath.pop(); - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); - } })); - - // - // CSS @import node - // - // The general strategy here is that we don't want to wait - // for the parsing to be completed, before we start importing - // the file. That's because in the context of a browser, - // most of the time will be spent waiting for the server to respond. - // - // On creation, we push the import path to our import queue, though - // `import,push`, we also pass it a callback, which it'll call once - // the file has been fetched, and parsed. - // - var Import = function (path, features, options, index, currentFileInfo, visibilityInfo) { - this.options = options; - this._index = index; - this._fileInfo = currentFileInfo; - this.path = path; - this.features = features; - this.allowRoot = true; - if (this.options.less !== undefined || this.options.inline) { - this.css = !this.options.less || this.options.inline; - } - else { - var pathValue = this.getPath(); - if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) { - this.css = true; - } - } - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.features, this); - this.setParent(this.path, this); - }; - Import.prototype = Object.assign(new Node(), { - type: 'Import', - accept: function (visitor) { - if (this.features) { - this.features = visitor.visit(this.features); - } - this.path = visitor.visit(this.path); - if (!this.options.isPlugin && !this.options.inline && this.root) { - this.root = visitor.visit(this.root); - } - }, - genCSS: function (context, output) { - if (this.css && this.path._fileInfo.reference === undefined) { - output.add('@import ', this._fileInfo, this._index); - this.path.genCSS(context, output); - if (this.features) { - output.add(' '); - this.features.genCSS(context, output); - } - output.add(';'); - } - }, - getPath: function () { - return (this.path instanceof URL) ? - this.path.value.value : this.path.value; - }, - isVariableImport: function () { - var path = this.path; - if (path instanceof URL) { - path = path.value; - } - if (path instanceof Quoted) { - return path.containsVariables(); - } - return true; - }, - evalForImport: function (context) { - var path = this.path; - if (path instanceof URL) { - path = path.value; - } - return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); - }, - evalPath: function (context) { - var path = this.path.eval(context); - var fileInfo = this._fileInfo; - if (!(path instanceof URL)) { - // Add the rootpath if the URL requires a rewrite - var pathValue = path.value; - if (fileInfo && - pathValue && - context.pathRequiresRewrite(pathValue)) { - path.value = context.rewritePath(pathValue, fileInfo.rootpath); - } - else { - path.value = context.normalizePath(path.value); - } - } - return path; - }, - eval: function (context) { - var result = this.doEval(context); - if (this.options.reference || this.blocksVisibility()) { - if (result.length || result.length === 0) { - result.forEach(function (node) { - node.addVisibilityBlock(); - }); - } - else { - result.addVisibilityBlock(); - } - } - return result; - }, - doEval: function (context) { - var ruleset; - var registry; - var features = this.features && this.features.eval(context); - if (this.options.isPlugin) { - if (this.root && this.root.eval) { - try { - this.root.eval(context); - } - catch (e) { - e.message = 'Plugin error during evaluation'; - throw new LessError(e, this.root.imports, this.root.filename); - } - } - registry = context.frames[0] && context.frames[0].functionRegistry; - if (registry && this.root && this.root.functions) { - registry.addMultiple(this.root.functions); - } - return []; - } - if (this.skip) { - if (typeof this.skip === 'function') { - this.skip = this.skip(); - } - if (this.skip) { - return []; - } - } - if (this.features) { - var featureValue = this.features.value; - if (Array.isArray(featureValue) && featureValue.length >= 1) { - var expr = featureValue[0]; - if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) { - featureValue = expr.value; - var isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' - && featureValue[1].type === 'Paren'; - if (isLayer) { - this.css = false; - } - } - } - } - if (this.options.inline) { - var contents = new Anonymous(this.root, 0, { - filename: this.importedFilename, - reference: this.path._fileInfo && this.path._fileInfo.reference - }, true, true); - return this.features ? new Media([contents], this.features.value) : [contents]; - } - else if (this.css || this.layerCss) { - var newImport = new Import(this.evalPath(context), features, this.options, this._index); - if (this.layerCss) { - newImport.css = this.layerCss; - newImport.path._fileInfo = this._fileInfo; - } - if (!newImport.css && this.error) { - throw this.error; - } - return newImport; - } - else if (this.root) { - if (this.features) { - var featureValue = this.features.value; - if (Array.isArray(featureValue) && featureValue.length === 1) { - var expr = featureValue[0]; - if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) { - featureValue = expr.value; - var isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' - && featureValue[1].type === 'Paren'; - if (isLayer) { - this.layerCss = true; - featureValue[0] = new Expression(featureValue.slice(0, 2)); - featureValue.splice(1, 1); - featureValue[0].noSpacing = true; - return this; - } - } - } - } - ruleset = new Ruleset(null, copyArray(this.root.rules)); - ruleset.evalImports(context); - return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules; - } - else { - if (this.features) { - var featureValue = this.features.value; - if (Array.isArray(featureValue) && featureValue.length >= 1) { - featureValue = featureValue[0].value; - if (Array.isArray(featureValue) && featureValue.length >= 2) { - var isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' - && featureValue[1].type === 'Paren'; - if (isLayer) { - this.css = true; - featureValue[0] = new Expression(featureValue.slice(0, 2)); - featureValue.splice(1, 1); - featureValue[0].noSpacing = true; - return this; - } - } - } - } - return []; - } - } - }); - - var JsEvalNode = function () { }; - JsEvalNode.prototype = Object.assign(new Node(), { - evaluateJavaScript: function (expression, context) { - var result; - var that = this; - var evalContext = {}; - if (!context.javascriptEnabled) { - throw { message: 'Inline JavaScript is not enabled. Is it set in your options?', - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) { - return that.jsify(new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context)); - }); - try { - expression = new Function("return (".concat(expression, ")")); - } - catch (e) { - throw { message: "JavaScript evaluation error: ".concat(e.message, " from `").concat(expression, "`"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - var variables = context.frames[0].variables(); - for (var k in variables) { - // eslint-disable-next-line no-prototype-builtins - if (variables.hasOwnProperty(k)) { - evalContext[k.slice(1)] = { - value: variables[k].value, - toJS: function () { - return this.value.eval(context).toCSS(); - } - }; - } - } - try { - result = expression.call(evalContext); - } - catch (e) { - throw { message: "JavaScript evaluation error: '".concat(e.name, ": ").concat(e.message.replace(/["]/g, '\''), "'"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - return result; - }, - jsify: function (obj) { - if (Array.isArray(obj.value) && (obj.value.length > 1)) { - return "[".concat(obj.value.map(function (v) { return v.toCSS(); }).join(', '), "]"); - } - else { - return obj.toCSS(); - } - } - }); - - var JavaScript = function (string, escaped, index, currentFileInfo) { - this.escaped = escaped; - this.expression = string; - this._index = index; - this._fileInfo = currentFileInfo; - }; - JavaScript.prototype = Object.assign(new JsEvalNode(), { - type: 'JavaScript', - eval: function (context) { - var result = this.evaluateJavaScript(this.expression, context); - var type = typeof result; - if (type === 'number' && !isNaN(result)) { - return new Dimension(result); - } - else if (type === 'string') { - return new Quoted("\"".concat(result, "\""), result, this.escaped, this._index); - } - else if (Array.isArray(result)) { - return new Anonymous(result.join(', ')); - } - else { - return new Anonymous(result); - } - } - }); - - var Assignment = function (key, val) { - this.key = key; - this.value = val; - }; - Assignment.prototype = Object.assign(new Node(), { - type: 'Assignment', - accept: function (visitor) { - this.value = visitor.visit(this.value); - }, - eval: function (context) { - if (this.value.eval) { - return new Assignment(this.key, this.value.eval(context)); - } - return this; - }, - genCSS: function (context, output) { - output.add("".concat(this.key, "=")); - if (this.value.genCSS) { - this.value.genCSS(context, output); - } - else { - output.add(this.value); - } - } - }); - - var Condition = function (op, l, r, i, negate) { - this.op = op.trim(); - this.lvalue = l; - this.rvalue = r; - this._index = i; - this.negate = negate; - }; - Condition.prototype = Object.assign(new Node(), { - type: 'Condition', - accept: function (visitor) { - this.lvalue = visitor.visit(this.lvalue); - this.rvalue = visitor.visit(this.rvalue); - }, - eval: function (context) { - var result = (function (op, a, b) { - switch (op) { - case 'and': return a && b; - case 'or': return a || b; - default: - switch (Node.compare(a, b)) { - case -1: - return op === '<' || op === '=<' || op === '<='; - case 0: - return op === '=' || op === '>=' || op === '=<' || op === '<='; - case 1: - return op === '>' || op === '>='; - default: - return false; - } - } - })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); - return this.negate ? !result : result; - } - }); - - var QueryInParens = function (op, l, m, op2, r, i) { - this.op = op.trim(); - this.lvalue = l; - this.mvalue = m; - this.op2 = op2 ? op2.trim() : null; - this.rvalue = r; - this._index = i; - this.mvalues = []; - }; - QueryInParens.prototype = Object.assign(new Node(), { - type: 'QueryInParens', - accept: function (visitor) { - this.lvalue = visitor.visit(this.lvalue); - this.mvalue = visitor.visit(this.mvalue); - if (this.rvalue) { - this.rvalue = visitor.visit(this.rvalue); - } - }, - eval: function (context) { - this.lvalue = this.lvalue.eval(context); - var variableDeclaration; - var rule; - for (var i_1 = 0; (rule = context.frames[i_1]); i_1++) { - if (rule.type === 'Ruleset') { - variableDeclaration = rule.rules.find(function (r) { - if ((r instanceof Declaration) && r.variable) { - return true; - } - return false; - }); - if (variableDeclaration) { - break; - } - } - } - if (!this.mvalueCopy) { - this.mvalueCopy = copy(this.mvalue); - } - if (variableDeclaration) { - this.mvalue = this.mvalueCopy; - this.mvalue = this.mvalue.eval(context); - this.mvalues.push(this.mvalue); - } - else { - this.mvalue = this.mvalue.eval(context); - } - if (this.rvalue) { - this.rvalue = this.rvalue.eval(context); - } - return this; - }, - genCSS: function (context, output) { - this.lvalue.genCSS(context, output); - output.add(' ' + this.op + ' '); - if (this.mvalues.length > 0) { - this.mvalue = this.mvalues.shift(); - } - this.mvalue.genCSS(context, output); - if (this.rvalue) { - output.add(' ' + this.op2 + ' '); - this.rvalue.genCSS(context, output); - } - }, - }); - - var Container = function (value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); - }; - Container.prototype = Object.assign(new AtRule(), __assign(__assign({ type: 'Container' }, NestableAtRulePrototype), { genCSS: function (context, output) { - output.add('@container ', this._fileInfo, this._index); - this.features.genCSS(context, output); - this.outputRuleset(context, output, this.rules); - }, eval: function (context) { - if (!context.mediaBlocks) { - context.mediaBlocks = []; - context.mediaPath = []; - } - var media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo()); - if (this.debugInfo) { - this.rules[0].debugInfo = this.debugInfo; - media.debugInfo = this.debugInfo; - } - media.features = this.features.eval(context); - context.mediaPath.push(media); - context.mediaBlocks.push(media); - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; - context.frames.shift(); - context.mediaPath.pop(); - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); - } })); - - var UnicodeDescriptor = function (value) { - this.value = value; - }; - UnicodeDescriptor.prototype = Object.assign(new Node(), { - type: 'UnicodeDescriptor' - }); - - var Negative = function (node) { - this.value = node; - }; - Negative.prototype = Object.assign(new Node(), { - type: 'Negative', - genCSS: function (context, output) { - output.add('-'); - this.value.genCSS(context, output); - }, - eval: function (context) { - if (context.isMathOn()) { - return (new Operation('*', [new Dimension(-1), this.value])).eval(context); - } - return new Negative(this.value.eval(context)); - } - }); - - var Extend = function (selector, option, index, currentFileInfo, visibilityInfo) { - this.selector = selector; - this.option = option; - this.object_id = Extend.next_id++; - this.parent_ids = [this.object_id]; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - switch (option) { - case '!all': - case 'all': - this.allowBefore = true; - this.allowAfter = true; - break; - default: - this.allowBefore = false; - this.allowAfter = false; - break; - } - this.setParent(this.selector, this); - }; - Extend.prototype = Object.assign(new Node(), { - type: 'Extend', - accept: function (visitor) { - this.selector = visitor.visit(this.selector); - }, - eval: function (context) { - return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - // remove when Nodes have JSDoc types - // eslint-disable-next-line no-unused-vars - clone: function (context) { - return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - // it concatenates (joins) all selectors in selector array - findSelfSelectors: function (selectors) { - var selfElements = [], i, selectorElements; - for (i = 0; i < selectors.length; i++) { - selectorElements = selectors[i].elements; - // duplicate the logic in genCSS function inside the selector node. - // future TODO - move both logics into the selector joiner visitor - if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') { - selectorElements[0].combinator.value = ' '; - } - selfElements = selfElements.concat(selectors[i].elements); - } - this.selfSelectors = [new Selector(selfElements)]; - this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); - } - }); - Extend.next_id = 0; - - var VariableCall = function (variable, index, currentFileInfo) { - this.variable = variable; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; - }; - VariableCall.prototype = Object.assign(new Node(), { - type: 'VariableCall', - eval: function (context) { - var rules; - var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context); - var error = new LessError({ message: "Could not evaluate variable call ".concat(this.variable) }); - if (!detachedRuleset.ruleset) { - if (detachedRuleset.rules) { - rules = detachedRuleset; - } - else if (Array.isArray(detachedRuleset)) { - rules = new Ruleset('', detachedRuleset); - } - else if (Array.isArray(detachedRuleset.value)) { - rules = new Ruleset('', detachedRuleset.value); - } - else { - throw error; - } - detachedRuleset = new DetachedRuleset(rules); - } - if (detachedRuleset.ruleset) { - return detachedRuleset.callEval(context); - } - throw error; - } - }); - - var NamespaceValue = function (ruleCall, lookups, index, fileInfo) { - this.value = ruleCall; - this.lookups = lookups; - this._index = index; - this._fileInfo = fileInfo; - }; - NamespaceValue.prototype = Object.assign(new Node(), { - type: 'NamespaceValue', - eval: function (context) { - var i, name, rules = this.value.eval(context); - for (i = 0; i < this.lookups.length; i++) { - name = this.lookups[i]; - /** - * Eval'd DRs return rulesets. - * Eval'd mixins return rules, so let's make a ruleset if we need it. - * We need to do this because of late parsing of values - */ - if (Array.isArray(rules)) { - rules = new Ruleset([new Selector()], rules); - } - if (name === '') { - rules = rules.lastDeclaration(); - } - else if (name.charAt(0) === '@') { - if (name.charAt(1) === '@') { - name = "@".concat(new Variable(name.substr(1)).eval(context).value); - } - if (rules.variables) { - rules = rules.variable(name); - } - if (!rules) { - throw { type: 'Name', - message: "variable ".concat(name, " not found"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - } - else { - if (name.substring(0, 2) === '$@') { - name = "$".concat(new Variable(name.substr(1)).eval(context).value); - } - else { - name = name.charAt(0) === '$' ? name : "$".concat(name); - } - if (rules.properties) { - rules = rules.property(name); - } - if (!rules) { - throw { type: 'Name', - message: "property \"".concat(name.substr(1), "\" not found"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - // Properties are an array of values, since a ruleset can have multiple props. - // We pick the last one (the "cascaded" value) - rules = rules[rules.length - 1]; - } - if (rules.value) { - rules = rules.eval(context).value; - } - if (rules.ruleset) { - rules = rules.ruleset.eval(context); - } - } - return rules; - } - }); - - var Definition = function (name, params, rules, condition, variadic, frames, visibilityInfo) { - this.name = name || 'anonymous mixin'; - this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])]; - this.params = params; - this.condition = condition; - this.variadic = variadic; - this.arity = params.length; - this.rules = rules; - this._lookups = {}; - var optionalParameters = []; - this.required = params.reduce(function (count, p) { - if (!p.name || (p.name && !p.value)) { - return count + 1; - } - else { - optionalParameters.push(p.name); - return count; - } - }, 0); - this.optionalParameters = optionalParameters; - this.frames = frames; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - }; - Definition.prototype = Object.assign(new Ruleset(), { - type: 'MixinDefinition', - evalFirst: true, - accept: function (visitor) { - if (this.params && this.params.length) { - this.params = visitor.visitArray(this.params); - } - this.rules = visitor.visitArray(this.rules); - if (this.condition) { - this.condition = visitor.visit(this.condition); - } - }, - evalParams: function (context, mixinEnv, args, evaldArguments) { - /* jshint boss:true */ - var frame = new Ruleset(null, null); - var varargs; - var arg; - var params = copyArray(this.params); - var i; - var j; - var val; - var name; - var isNamedFound; - var argIndex; - var argsLength = 0; - if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) { - frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit(); - } - mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames)); - if (args) { - args = copyArray(args); - argsLength = args.length; - for (i = 0; i < argsLength; i++) { - arg = args[i]; - if (name = (arg && arg.name)) { - isNamedFound = false; - for (j = 0; j < params.length; j++) { - if (!evaldArguments[j] && name === params[j].name) { - evaldArguments[j] = arg.value.eval(context); - frame.prependRule(new Declaration(name, arg.value.eval(context))); - isNamedFound = true; - break; - } - } - if (isNamedFound) { - args.splice(i, 1); - i--; - continue; - } - else { - throw { type: 'Runtime', message: "Named argument for ".concat(this.name, " ").concat(args[i].name, " not found") }; - } - } - } - } - argIndex = 0; - for (i = 0; i < params.length; i++) { - if (evaldArguments[i]) { - continue; - } - arg = args && args[argIndex]; - if (name = params[i].name) { - if (params[i].variadic) { - varargs = []; - for (j = argIndex; j < argsLength; j++) { - varargs.push(args[j].value.eval(context)); - } - frame.prependRule(new Declaration(name, new Expression(varargs).eval(context))); - } - else { - val = arg && arg.value; - if (val) { - // This was a mixin call, pass in a detached ruleset of it's eval'd rules - if (Array.isArray(val)) { - val = new DetachedRuleset(new Ruleset('', val)); - } - else { - val = val.eval(context); - } - } - else if (params[i].value) { - val = params[i].value.eval(mixinEnv); - frame.resetCache(); - } - else { - throw { type: 'Runtime', message: "wrong number of arguments for ".concat(this.name, " (").concat(argsLength, " for ").concat(this.arity, ")") }; - } - frame.prependRule(new Declaration(name, val)); - evaldArguments[i] = val; - } - } - if (params[i].variadic && args) { - for (j = argIndex; j < argsLength; j++) { - evaldArguments[j] = args[j].value.eval(context); - } - } - argIndex++; - } - return frame; - }, - makeImportant: function () { - var rules = !this.rules ? this.rules : this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(true); - } - else { - return r; - } - }); - var result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); - return result; - }, - eval: function (context) { - return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || copyArray(context.frames)); - }, - evalCall: function (context, args, important) { - var _arguments = []; - var mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames; - var frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments); - var rules; - var ruleset; - frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context))); - rules = copyArray(this.rules); - ruleset = new Ruleset(null, rules); - ruleset.originalRuleset = this; - ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames))); - if (important) { - ruleset = ruleset.makeImportant(); - } - return ruleset; - }, - matchCondition: function (args, context) { - if (this.condition && !this.condition.eval(new contexts.Eval(context, [this.evalParams(context, /* the parameter variables */ new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] - .concat(this.frames || []) // the parent namespace/mixin frames - .concat(context.frames)))) { // the current environment frames - return false; - } - return true; - }, - matchArgs: function (args, context) { - var allArgsCnt = (args && args.length) || 0; - var len; - var optionalParameters = this.optionalParameters; - var requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) { - if (optionalParameters.indexOf(p.name) < 0) { - return count + 1; - } - else { - return count; - } - }, 0); - if (!this.variadic) { - if (requiredArgsCnt < this.required) { - return false; - } - if (allArgsCnt > this.params.length) { - return false; - } - } - else { - if (requiredArgsCnt < (this.required - 1)) { - return false; - } - } - // check patterns - len = Math.min(requiredArgsCnt, this.arity); - for (var i_1 = 0; i_1 < len; i_1++) { - if (!this.params[i_1].name && !this.params[i_1].variadic) { - if (args[i_1].value.eval(context).toCSS() != this.params[i_1].value.eval(context).toCSS()) { - return false; - } - } - } - return true; - } - }); - - var MixinCall = function (elements, args, index, currentFileInfo, important) { - this.selector = new Selector(elements); - this.arguments = args || []; - this._index = index; - this._fileInfo = currentFileInfo; - this.important = important; - this.allowRoot = true; - this.setParent(this.selector, this); - }; - MixinCall.prototype = Object.assign(new Node(), { - type: 'MixinCall', - accept: function (visitor) { - if (this.selector) { - this.selector = visitor.visit(this.selector); - } - if (this.arguments.length) { - this.arguments = visitor.visitArray(this.arguments); - } - }, - eval: function (context) { - var mixins; - var mixin; - var mixinPath; - var args = []; - var arg; - var argValue; - var rules = []; - var match = false; - var i; - var m; - var f; - var isRecursive; - var isOneFound; - var candidates = []; - var candidate; - var conditionResult = []; - var defaultResult; - var defFalseEitherCase = -1; - var defNone = 0; - var defTrue = 1; - var defFalse = 2; - var count; - var originalRuleset; - var noArgumentsFilter; - this.selector = this.selector.eval(context); - function calcDefGroup(mixin, mixinPath) { - var f, p, namespace; - for (f = 0; f < 2; f++) { - conditionResult[f] = true; - defaultFunc.value(f); - for (p = 0; p < mixinPath.length && conditionResult[f]; p++) { - namespace = mixinPath[p]; - if (namespace.matchCondition) { - conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context); - } - } - if (mixin.matchCondition) { - conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context); - } - } - if (conditionResult[0] || conditionResult[1]) { - if (conditionResult[0] != conditionResult[1]) { - return conditionResult[1] ? - defTrue : defFalse; - } - return defNone; - } - return defFalseEitherCase; - } - for (i = 0; i < this.arguments.length; i++) { - arg = this.arguments[i]; - argValue = arg.value.eval(context); - if (arg.expand && Array.isArray(argValue.value)) { - argValue = argValue.value; - for (m = 0; m < argValue.length; m++) { - args.push({ value: argValue[m] }); - } - } - else { - args.push({ name: arg.name, value: argValue }); - } - } - noArgumentsFilter = function (rule) { return rule.matchArgs(null, context); }; - for (i = 0; i < context.frames.length; i++) { - if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) { - isOneFound = true; - // To make `default()` function independent of definition order we have two "subpasses" here. - // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`), - // and build candidate list with corresponding flags. Then, when we know all possible matches, - // we make a final decision. - for (m = 0; m < mixins.length; m++) { - mixin = mixins[m].rule; - mixinPath = mixins[m].path; - isRecursive = false; - for (f = 0; f < context.frames.length; f++) { - if ((!(mixin instanceof Definition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) { - isRecursive = true; - break; - } - } - if (isRecursive) { - continue; - } - if (mixin.matchArgs(args, context)) { - candidate = { mixin: mixin, group: calcDefGroup(mixin, mixinPath) }; - if (candidate.group !== defFalseEitherCase) { - candidates.push(candidate); - } - match = true; - } - } - defaultFunc.reset(); - count = [0, 0, 0]; - for (m = 0; m < candidates.length; m++) { - count[candidates[m].group]++; - } - if (count[defNone] > 0) { - defaultResult = defFalse; - } - else { - defaultResult = defTrue; - if ((count[defTrue] + count[defFalse]) > 1) { - throw { type: 'Runtime', - message: "Ambiguous use of `default()` found when matching for `".concat(this.format(args), "`"), - index: this.getIndex(), filename: this.fileInfo().filename }; - } - } - for (m = 0; m < candidates.length; m++) { - candidate = candidates[m].group; - if ((candidate === defNone) || (candidate === defaultResult)) { - try { - mixin = candidates[m].mixin; - if (!(mixin instanceof Definition)) { - originalRuleset = mixin.originalRuleset || mixin; - mixin = new Definition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo()); - mixin.originalRuleset = originalRuleset; - } - var newRules = mixin.evalCall(context, args, this.important).rules; - this._setVisibilityToReplacement(newRules); - Array.prototype.push.apply(rules, newRules); - } - catch (e) { - throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack }; - } - } - } - if (match) { - return rules; - } - } - } - if (isOneFound) { - throw { type: 'Runtime', - message: "No matching definition was found for `".concat(this.format(args), "`"), - index: this.getIndex(), filename: this.fileInfo().filename }; - } - else { - throw { type: 'Name', - message: "".concat(this.selector.toCSS().trim(), " is undefined"), - index: this.getIndex(), filename: this.fileInfo().filename }; - } - }, - _setVisibilityToReplacement: function (replacement) { - var i, rule; - if (this.blocksVisibility()) { - for (i = 0; i < replacement.length; i++) { - rule = replacement[i]; - rule.addVisibilityBlock(); - } - } - }, - format: function (args) { - return "".concat(this.selector.toCSS().trim(), "(").concat(args ? args.map(function (a) { - var argValue = ''; - if (a.name) { - argValue += "".concat(a.name, ":"); - } - if (a.value.toCSS) { - argValue += a.value.toCSS(); - } - else { - argValue += '???'; - } - return argValue; - }).join(', ') : '', ")"); - } - }); - - var tree = { - Node: Node, - Color: Color, - AtRule: AtRule, - DetachedRuleset: DetachedRuleset, - Operation: Operation, - Dimension: Dimension, - Unit: Unit, - Keyword: Keyword, - Variable: Variable, - Property: Property, - Ruleset: Ruleset, - Element: Element, - Attribute: Attribute, - Combinator: Combinator, - Selector: Selector, - Quoted: Quoted, - Expression: Expression, - Declaration: Declaration, - Call: Call, - URL: URL, - Import: Import, - Comment: Comment, - Anonymous: Anonymous, - Value: Value, - JavaScript: JavaScript, - Assignment: Assignment, - Condition: Condition, - Paren: Paren, - Media: Media, - Container: Container, - QueryInParens: QueryInParens, - UnicodeDescriptor: UnicodeDescriptor, - Negative: Negative, - Extend: Extend, - VariableCall: VariableCall, - NamespaceValue: NamespaceValue, - mixin: { - Call: MixinCall, - Definition: Definition - } - }; - - var AbstractFileManager = /** @class */ (function () { - function AbstractFileManager() { - } - AbstractFileManager.prototype.getPath = function (filename) { - var j = filename.lastIndexOf('?'); - if (j > 0) { - filename = filename.slice(0, j); - } - j = filename.lastIndexOf('/'); - if (j < 0) { - j = filename.lastIndexOf('\\'); - } - if (j < 0) { - return ''; - } - return filename.slice(0, j + 1); - }; - AbstractFileManager.prototype.tryAppendExtension = function (path, ext) { - return /(\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext; - }; - AbstractFileManager.prototype.tryAppendLessExtension = function (path) { - return this.tryAppendExtension(path, '.less'); - }; - AbstractFileManager.prototype.supportsSync = function () { - return false; - }; - AbstractFileManager.prototype.alwaysMakePathsAbsolute = function () { - return false; - }; - AbstractFileManager.prototype.isPathAbsolute = function (filename) { - return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename); - }; - // TODO: pull out / replace? - AbstractFileManager.prototype.join = function (basePath, laterPath) { - if (!basePath) { - return laterPath; - } - return basePath + laterPath; - }; - AbstractFileManager.prototype.pathDiff = function (url, baseUrl) { - // diff between two paths to create a relative path - var urlParts = this.extractUrlParts(url); - var baseUrlParts = this.extractUrlParts(baseUrl); - var i; - var max; - var urlDirectories; - var baseUrlDirectories; - var diff = ''; - if (urlParts.hostPart !== baseUrlParts.hostPart) { - return ''; - } - max = Math.max(baseUrlParts.directories.length, urlParts.directories.length); - for (i = 0; i < max; i++) { - if (baseUrlParts.directories[i] !== urlParts.directories[i]) { - break; - } - } - baseUrlDirectories = baseUrlParts.directories.slice(i); - urlDirectories = urlParts.directories.slice(i); - for (i = 0; i < baseUrlDirectories.length - 1; i++) { - diff += '../'; - } - for (i = 0; i < urlDirectories.length - 1; i++) { - diff += "".concat(urlDirectories[i], "/"); - } - return diff; - }; - /** - * Helper function, not part of API. - * This should be replaceable by newer Node / Browser APIs - * - * @param {string} url - * @param {string} baseUrl - */ - AbstractFileManager.prototype.extractUrlParts = function (url, baseUrl) { - // urlParts[1] = protocol://hostname/ OR / - // urlParts[2] = / if path relative to host base - // urlParts[3] = directories - // urlParts[4] = filename - // urlParts[5] = parameters - var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^/?#]*\/)|([/\\]))?((?:[^/\\?#]*[/\\])*)([^/\\?#]*)([#?].*)?$/i; - var urlParts = url.match(urlPartsRegex); - var returner = {}; - var rawDirectories = []; - var directories = []; - var i; - var baseUrlParts; - if (!urlParts) { - throw new Error("Could not parse sheet href - '".concat(url, "'")); - } - // Stylesheets in IE don't always return the full path - if (baseUrl && (!urlParts[1] || urlParts[2])) { - baseUrlParts = baseUrl.match(urlPartsRegex); - if (!baseUrlParts) { - throw new Error("Could not parse page url - '".concat(baseUrl, "'")); - } - urlParts[1] = urlParts[1] || baseUrlParts[1] || ''; - if (!urlParts[2]) { - urlParts[3] = baseUrlParts[3] + urlParts[3]; - } - } - if (urlParts[3]) { - rawDirectories = urlParts[3].replace(/\\/g, '/').split('/'); - // collapse '..' and skip '.' - for (i = 0; i < rawDirectories.length; i++) { - if (rawDirectories[i] === '..') { - directories.pop(); - } - else if (rawDirectories[i] !== '.') { - directories.push(rawDirectories[i]); - } - } - } - returner.hostPart = urlParts[1]; - returner.directories = directories; - returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/'); - returner.path = (urlParts[1] || '') + directories.join('/'); - returner.filename = urlParts[4]; - returner.fileUrl = returner.path + (urlParts[4] || ''); - returner.url = returner.fileUrl + (urlParts[5] || ''); - return returner; - }; - return AbstractFileManager; - }()); - - var AbstractPluginLoader = /** @class */ (function () { - function AbstractPluginLoader() { - // Implemented by Node.js plugin loader - this.require = function () { - return null; - }; - } - AbstractPluginLoader.prototype.evalPlugin = function (contents, context, imports, pluginOptions, fileInfo) { - var loader, registry, pluginObj, localModule, pluginManager, filename, result; - pluginManager = context.pluginManager; - if (fileInfo) { - if (typeof fileInfo === 'string') { - filename = fileInfo; - } - else { - filename = fileInfo.filename; - } - } - var shortname = (new this.less.FileManager()).extractUrlParts(filename).filename; - if (filename) { - pluginObj = pluginManager.get(filename); - if (pluginObj) { - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - try { - if (pluginObj.use) { - pluginObj.use.call(this.context, pluginObj); - } - } - catch (e) { - e.message = e.message || 'Error during @plugin call'; - return new LessError(e, imports, filename); - } - return pluginObj; - } - } - localModule = { - exports: {}, - pluginManager: pluginManager, - fileInfo: fileInfo - }; - registry = functionRegistry.create(); - var registerPlugin = function (obj) { - pluginObj = obj; - }; - try { - loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents); - loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo); - } - catch (e) { - return new LessError(e, imports, filename); - } - if (!pluginObj) { - pluginObj = localModule.exports; - } - pluginObj = this.validatePlugin(pluginObj, filename, shortname); - if (pluginObj instanceof LessError) { - return pluginObj; - } - if (pluginObj) { - pluginObj.imports = imports; - pluginObj.filename = filename; - // For < 3.x (or unspecified minVersion) - setOptions() before install() - if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) { - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - } - // Run on first load - pluginManager.addPlugin(pluginObj, fileInfo.filename, registry); - pluginObj.functions = registry.getLocalFunctions(); - // Need to call setOptions again because the pluginObj might have functions - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - // Run every @plugin call - try { - if (pluginObj.use) { - pluginObj.use.call(this.context, pluginObj); - } - } - catch (e) { - e.message = e.message || 'Error during @plugin call'; - return new LessError(e, imports, filename); - } - } - else { - return new LessError({ message: 'Not a valid plugin' }, imports, filename); - } - return pluginObj; - }; - AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) { - if (options && !plugin.setOptions) { - return new LessError({ - message: "Options have been provided but the plugin ".concat(name, " does not support any options.") - }); - } - try { - plugin.setOptions && plugin.setOptions(options); - } - catch (e) { - return new LessError(e); - } - }; - AbstractPluginLoader.prototype.validatePlugin = function (plugin, filename, name) { - if (plugin) { - // support plugins being a function - // so that the plugin can be more usable programmatically - if (typeof plugin === 'function') { - plugin = new plugin(); - } - if (plugin.minVersion) { - if (this.compareVersion(plugin.minVersion, this.less.version) < 0) { - return new LessError({ - message: "Plugin ".concat(name, " requires version ").concat(this.versionToString(plugin.minVersion)) - }); - } - } - return plugin; - } - return null; - }; - AbstractPluginLoader.prototype.compareVersion = function (aVersion, bVersion) { - if (typeof aVersion === 'string') { - aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/); - aVersion.shift(); - } - for (var i_1 = 0; i_1 < aVersion.length; i_1++) { - if (aVersion[i_1] !== bVersion[i_1]) { - return parseInt(aVersion[i_1]) > parseInt(bVersion[i_1]) ? -1 : 1; - } - } - return 0; - }; - AbstractPluginLoader.prototype.versionToString = function (version) { - var versionString = ''; - for (var i_2 = 0; i_2 < version.length; i_2++) { - versionString += (versionString ? '.' : '') + version[i_2]; - } - return versionString; - }; - AbstractPluginLoader.prototype.printUsage = function (plugins) { - for (var i_3 = 0; i_3 < plugins.length; i_3++) { - var plugin = plugins[i_3]; - if (plugin.printUsage) { - plugin.printUsage(); - } - } - }; - return AbstractPluginLoader; - }()); - - function boolean(condition) { - return condition ? Keyword.True : Keyword.False; - } - /** - * Functions with evalArgs set to false are sent context - * as the first argument. - */ - function If(context, condition, trueValue, falseValue) { - return condition.eval(context) ? trueValue.eval(context) - : (falseValue ? falseValue.eval(context) : new Anonymous); - } - If.evalArgs = false; - function isdefined(context, variable) { - try { - variable.eval(context); - return Keyword.True; - } - catch (e) { - return Keyword.False; - } - } - isdefined.evalArgs = false; - var boolean$1 = { isdefined: isdefined, boolean: boolean, 'if': If }; - - var colorFunctions; - function clamp(val) { - return Math.min(1, Math.max(0, val)); - } - function hsla(origColor, hsl) { - var color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a); - if (color) { - if (origColor.value && - /^(rgb|hsl)/.test(origColor.value)) { - color.value = origColor.value; - } - else { - color.value = 'rgb'; - } - return color; - } - } - function toHSL(color) { - if (color.toHSL) { - return color.toHSL(); - } - else { - throw new Error('Argument cannot be evaluated to a color'); - } - } - function toHSV(color) { - if (color.toHSV) { - return color.toHSV(); - } - else { - throw new Error('Argument cannot be evaluated to a color'); - } - } - function number$1(n) { - if (n instanceof Dimension) { - return parseFloat(n.unit.is('%') ? n.value / 100 : n.value); - } - else if (typeof n === 'number') { - return n; - } - else { - throw { - type: 'Argument', - message: 'color functions take numbers as parameters' - }; - } - } - function scaled(n, size) { - if (n instanceof Dimension && n.unit.is('%')) { - return parseFloat(n.value * size / 100); - } - else { - return number$1(n); - } - } - colorFunctions = { - rgb: function (r, g, b) { - var a = 1; - /** - * Comma-less syntax - * e.g. rgb(0 128 255 / 50%) - */ - if (r instanceof Expression) { - var val = r.value; - r = val[0]; - g = val[1]; - b = val[2]; - /** - * @todo - should this be normalized in - * function caller? Or parsed differently? - */ - if (b instanceof Operation) { - var op = b; - b = op.operands[0]; - a = op.operands[1]; - } - } - var color = colorFunctions.rgba(r, g, b, a); - if (color) { - color.value = 'rgb'; - return color; - } - }, - rgba: function (r, g, b, a) { - try { - if (r instanceof Color) { - if (g) { - a = number$1(g); - } - else { - a = r.alpha; - } - return new Color(r.rgb, a, 'rgba'); - } - var rgb = [r, g, b].map(function (c) { return scaled(c, 255); }); - a = number$1(a); - return new Color(rgb, a, 'rgba'); - } - catch (e) { } - }, - hsl: function (h, s, l) { - var a = 1; - if (h instanceof Expression) { - var val = h.value; - h = val[0]; - s = val[1]; - l = val[2]; - if (l instanceof Operation) { - var op = l; - l = op.operands[0]; - a = op.operands[1]; - } - } - var color = colorFunctions.hsla(h, s, l, a); - if (color) { - color.value = 'hsl'; - return color; - } - }, - hsla: function (h, s, l, a) { - var m1; - var m2; - function hue(h) { - h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); - if (h * 6 < 1) { - return m1 + (m2 - m1) * h * 6; - } - else if (h * 2 < 1) { - return m2; - } - else if (h * 3 < 2) { - return m1 + (m2 - m1) * (2 / 3 - h) * 6; - } - else { - return m1; - } - } - try { - if (h instanceof Color) { - if (s) { - a = number$1(s); - } - else { - a = h.alpha; - } - return new Color(h.rgb, a, 'hsla'); - } - h = (number$1(h) % 360) / 360; - s = clamp(number$1(s)); - l = clamp(number$1(l)); - a = clamp(number$1(a)); - m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; - m1 = l * 2 - m2; - var rgb = [ - hue(h + 1 / 3) * 255, - hue(h) * 255, - hue(h - 1 / 3) * 255 - ]; - a = number$1(a); - return new Color(rgb, a, 'hsla'); - } - catch (e) { } - }, - hsv: function (h, s, v) { - return colorFunctions.hsva(h, s, v, 1.0); - }, - hsva: function (h, s, v, a) { - h = ((number$1(h) % 360) / 360) * 360; - s = number$1(s); - v = number$1(v); - a = number$1(a); - var i; - var f; - i = Math.floor((h / 60) % 6); - f = (h / 60) - i; - var vs = [v, - v * (1 - s), - v * (1 - f * s), - v * (1 - (1 - f) * s)]; - var perm = [[0, 3, 1], - [2, 0, 1], - [1, 0, 3], - [1, 2, 0], - [3, 1, 0], - [0, 1, 2]]; - return colorFunctions.rgba(vs[perm[i][0]] * 255, vs[perm[i][1]] * 255, vs[perm[i][2]] * 255, a); - }, - hue: function (color) { - return new Dimension(toHSL(color).h); - }, - saturation: function (color) { - return new Dimension(toHSL(color).s * 100, '%'); - }, - lightness: function (color) { - return new Dimension(toHSL(color).l * 100, '%'); - }, - hsvhue: function (color) { - return new Dimension(toHSV(color).h); - }, - hsvsaturation: function (color) { - return new Dimension(toHSV(color).s * 100, '%'); - }, - hsvvalue: function (color) { - return new Dimension(toHSV(color).v * 100, '%'); - }, - red: function (color) { - return new Dimension(color.rgb[0]); - }, - green: function (color) { - return new Dimension(color.rgb[1]); - }, - blue: function (color) { - return new Dimension(color.rgb[2]); - }, - alpha: function (color) { - return new Dimension(toHSL(color).a); - }, - luma: function (color) { - return new Dimension(color.luma() * color.alpha * 100, '%'); - }, - luminance: function (color) { - var luminance = (0.2126 * color.rgb[0] / 255) + - (0.7152 * color.rgb[1] / 255) + - (0.0722 * color.rgb[2] / 255); - return new Dimension(luminance * color.alpha * 100, '%'); - }, - saturate: function (color, amount, method) { - // filter: saturate(3.2); - // should be kept as is, so check for color - if (!color.rgb) { - return null; - } - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.s += hsl.s * amount.value / 100; - } - else { - hsl.s += amount.value / 100; - } - hsl.s = clamp(hsl.s); - return hsla(color, hsl); - }, - desaturate: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.s -= hsl.s * amount.value / 100; - } - else { - hsl.s -= amount.value / 100; - } - hsl.s = clamp(hsl.s); - return hsla(color, hsl); - }, - lighten: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.l += hsl.l * amount.value / 100; - } - else { - hsl.l += amount.value / 100; - } - hsl.l = clamp(hsl.l); - return hsla(color, hsl); - }, - darken: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.l -= hsl.l * amount.value / 100; - } - else { - hsl.l -= amount.value / 100; - } - hsl.l = clamp(hsl.l); - return hsla(color, hsl); - }, - fadein: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.a += hsl.a * amount.value / 100; - } - else { - hsl.a += amount.value / 100; - } - hsl.a = clamp(hsl.a); - return hsla(color, hsl); - }, - fadeout: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.a -= hsl.a * amount.value / 100; - } - else { - hsl.a -= amount.value / 100; - } - hsl.a = clamp(hsl.a); - return hsla(color, hsl); - }, - fade: function (color, amount) { - var hsl = toHSL(color); - hsl.a = amount.value / 100; - hsl.a = clamp(hsl.a); - return hsla(color, hsl); - }, - spin: function (color, amount) { - var hsl = toHSL(color); - var hue = (hsl.h + amount.value) % 360; - hsl.h = hue < 0 ? 360 + hue : hue; - return hsla(color, hsl); - }, - // - // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein - // http://sass-lang.com - // - mix: function (color1, color2, weight) { - if (!weight) { - weight = new Dimension(50); - } - var p = weight.value / 100.0; - var w = p * 2 - 1; - var a = toHSL(color1).a - toHSL(color2).a; - var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; - var w2 = 1 - w1; - var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, - color1.rgb[1] * w1 + color2.rgb[1] * w2, - color1.rgb[2] * w1 + color2.rgb[2] * w2]; - var alpha = color1.alpha * p + color2.alpha * (1 - p); - return new Color(rgb, alpha); - }, - greyscale: function (color) { - return colorFunctions.desaturate(color, new Dimension(100)); - }, - contrast: function (color, dark, light, threshold) { - // filter: contrast(3.2); - // should be kept as is, so check for color - if (!color.rgb) { - return null; - } - if (typeof light === 'undefined') { - light = colorFunctions.rgba(255, 255, 255, 1.0); - } - if (typeof dark === 'undefined') { - dark = colorFunctions.rgba(0, 0, 0, 1.0); - } - // Figure out which is actually light and dark: - if (dark.luma() > light.luma()) { - var t = light; - light = dark; - dark = t; - } - if (typeof threshold === 'undefined') { - threshold = 0.43; - } - else { - threshold = number$1(threshold); - } - if (color.luma() < threshold) { - return light; - } - else { - return dark; - } - }, - // Changes made in 2.7.0 - Reverted in 3.0.0 - // contrast: function (color, color1, color2, threshold) { - // // Return which of `color1` and `color2` has the greatest contrast with `color` - // // according to the standard WCAG contrast ratio calculation. - // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef - // // The threshold param is no longer used, in line with SASS. - // // filter: contrast(3.2); - // // should be kept as is, so check for color - // if (!color.rgb) { - // return null; - // } - // if (typeof color1 === 'undefined') { - // color1 = colorFunctions.rgba(0, 0, 0, 1.0); - // } - // if (typeof color2 === 'undefined') { - // color2 = colorFunctions.rgba(255, 255, 255, 1.0); - // } - // var contrast1, contrast2; - // var luma = color.luma(); - // var luma1 = color1.luma(); - // var luma2 = color2.luma(); - // // Calculate contrast ratios for each color - // if (luma > luma1) { - // contrast1 = (luma + 0.05) / (luma1 + 0.05); - // } else { - // contrast1 = (luma1 + 0.05) / (luma + 0.05); - // } - // if (luma > luma2) { - // contrast2 = (luma + 0.05) / (luma2 + 0.05); - // } else { - // contrast2 = (luma2 + 0.05) / (luma + 0.05); - // } - // if (contrast1 > contrast2) { - // return color1; - // } else { - // return color2; - // } - // }, - argb: function (color) { - return new Anonymous(color.toARGB()); - }, - color: function (c) { - if ((c instanceof Quoted) && - (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) { - var val = c.value.slice(1); - return new Color(val, undefined, "#".concat(val)); - } - if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) { - c.value = undefined; - return c; - } - throw { - type: 'Argument', - message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF' - }; - }, - tint: function (color, amount) { - return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount); - }, - shade: function (color, amount) { - return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount); - } - }; - var color = colorFunctions; - - // Color Blending - // ref: http://www.w3.org/TR/compositing-1 - function colorBlend(mode, color1, color2) { - var ab = color1.alpha; // result - var // backdrop - cb; - var as = color2.alpha; - var // source - cs; - var ar; - var cr; - var r = []; - ar = as + ab * (1 - as); - for (var i_1 = 0; i_1 < 3; i_1++) { - cb = color1.rgb[i_1] / 255; - cs = color2.rgb[i_1] / 255; - cr = mode(cb, cs); - if (ar) { - cr = (as * cs + ab * (cb - - as * (cb + cs - cr))) / ar; - } - r[i_1] = cr * 255; - } - return new Color(r, ar); - } - var colorBlendModeFunctions = { - multiply: function (cb, cs) { - return cb * cs; - }, - screen: function (cb, cs) { - return cb + cs - cb * cs; - }, - overlay: function (cb, cs) { - cb *= 2; - return (cb <= 1) ? - colorBlendModeFunctions.multiply(cb, cs) : - colorBlendModeFunctions.screen(cb - 1, cs); - }, - softlight: function (cb, cs) { - var d = 1; - var e = cb; - if (cs > 0.5) { - e = 1; - d = (cb > 0.25) ? Math.sqrt(cb) - : ((16 * cb - 12) * cb + 4) * cb; - } - return cb - (1 - 2 * cs) * e * (d - cb); - }, - hardlight: function (cb, cs) { - return colorBlendModeFunctions.overlay(cs, cb); - }, - difference: function (cb, cs) { - return Math.abs(cb - cs); - }, - exclusion: function (cb, cs) { - return cb + cs - 2 * cb * cs; - }, - // non-w3c functions: - average: function (cb, cs) { - return (cb + cs) / 2; - }, - negation: function (cb, cs) { - return 1 - Math.abs(cb + cs - 1); - } - }; - for (var f$1 in colorBlendModeFunctions) { - // eslint-disable-next-line no-prototype-builtins - if (colorBlendModeFunctions.hasOwnProperty(f$1)) { - colorBlend[f$1] = colorBlend.bind(null, colorBlendModeFunctions[f$1]); - } - } - - var dataUri = (function (environment) { - var fallback = function (functionThis, node) { return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); }; - return { 'data-uri': function (mimetypeNode, filePathNode) { - if (!filePathNode) { - filePathNode = mimetypeNode; - mimetypeNode = null; - } - var mimetype = mimetypeNode && mimetypeNode.value; - var filePath = filePathNode.value; - var currentFileInfo = this.currentFileInfo; - var currentDirectory = currentFileInfo.rewriteUrls ? - currentFileInfo.currentDirectory : currentFileInfo.entryPath; - var fragmentStart = filePath.indexOf('#'); - var fragment = ''; - if (fragmentStart !== -1) { - fragment = filePath.slice(fragmentStart); - filePath = filePath.slice(0, fragmentStart); - } - var context = clone(this.context); - context.rawBuffer = true; - var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true); - if (!fileManager) { - return fallback(this, filePathNode); - } - var useBase64 = false; - // detect the mimetype if not given - if (!mimetypeNode) { - mimetype = environment.mimeLookup(filePath); - if (mimetype === 'image/svg+xml') { - useBase64 = false; - } - else { - // use base 64 unless it's an ASCII or UTF-8 format - var charset = environment.charsetLookup(mimetype); - useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0; - } - if (useBase64) { - mimetype += ';base64'; - } - } - else { - useBase64 = /;base64$/.test(mimetype); - } - var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment); - if (!fileSync.contents) { - logger$1.warn("Skipped data-uri embedding of ".concat(filePath, " because file not found")); - return fallback(this, filePathNode || mimetypeNode); - } - var buf = fileSync.contents; - if (useBase64 && !environment.encodeBase64) { - return fallback(this, filePathNode); - } - buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); - var uri = "data:".concat(mimetype, ",").concat(buf).concat(fragment); - return new URL(new Quoted("\"".concat(uri, "\""), uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); - } }; - }); - - var getItemsFromNode = function (node) { - // handle non-array values as an array of length 1 - // return 'undefined' if index is invalid - var items = Array.isArray(node.value) ? - node.value : Array(node); - return items; - }; - var list = { - _SELF: function (n) { - return n; - }, - '~': function () { - var expr = []; - for (var _i = 0; _i < arguments.length; _i++) { - expr[_i] = arguments[_i]; - } - if (expr.length === 1) { - return expr[0]; - } - return new Value(expr); - }, - extract: function (values, index) { - // (1-based index) - index = index.value - 1; - return getItemsFromNode(values)[index]; - }, - length: function (values) { - return new Dimension(getItemsFromNode(values).length); - }, - /** - * Creates a Less list of incremental values. - * Modeled after Lodash's range function, also exists natively in PHP - * - * @param {Dimension} [start=1] - * @param {Dimension} end - e.g. 10 or 10px - unit is added to output - * @param {Dimension} [step=1] - */ - range: function (start, end, step) { - var from; - var to; - var stepValue = 1; - var list = []; - if (end) { - to = end; - from = start.value; - if (step) { - stepValue = step.value; - } - } - else { - from = 1; - to = start; - } - for (var i_1 = from; i_1 <= to.value; i_1 += stepValue) { - list.push(new Dimension(i_1, to.unit)); - } - return new Expression(list); - }, - each: function (list, rs) { - var _this = this; - var rules = []; - var newRules; - var iterator; - var tryEval = function (val) { - if (val instanceof Node) { - return val.eval(_this.context); - } - return val; - }; - if (list.value && !(list instanceof Quoted)) { - if (Array.isArray(list.value)) { - iterator = list.value.map(tryEval); - } - else { - iterator = [tryEval(list.value)]; - } - } - else if (list.ruleset) { - iterator = tryEval(list.ruleset).rules; - } - else if (list.rules) { - iterator = list.rules.map(tryEval); - } - else if (Array.isArray(list)) { - iterator = list.map(tryEval); - } - else { - iterator = [tryEval(list)]; - } - var valueName = '@value'; - var keyName = '@key'; - var indexName = '@index'; - if (rs.params) { - valueName = rs.params[0] && rs.params[0].name; - keyName = rs.params[1] && rs.params[1].name; - indexName = rs.params[2] && rs.params[2].name; - rs = rs.rules; - } - else { - rs = rs.ruleset; - } - for (var i_2 = 0; i_2 < iterator.length; i_2++) { - var key = void 0; - var value = void 0; - var item = iterator[i_2]; - if (item instanceof Declaration) { - key = typeof item.name === 'string' ? item.name : item.name[0].value; - value = item.value; - } - else { - key = new Dimension(i_2 + 1); - value = item; - } - if (item instanceof Comment) { - continue; - } - newRules = rs.rules.slice(0); - if (valueName) { - newRules.push(new Declaration(valueName, value, false, false, this.index, this.currentFileInfo)); - } - if (indexName) { - newRules.push(new Declaration(indexName, new Dimension(i_2 + 1), false, false, this.index, this.currentFileInfo)); - } - if (keyName) { - newRules.push(new Declaration(keyName, key, false, false, this.index, this.currentFileInfo)); - } - rules.push(new Ruleset([new (Selector)([new Element('', '&')])], newRules, rs.strictImports, rs.visibilityInfo())); - } - return new Ruleset([new (Selector)([new Element('', '&')])], rules, rs.strictImports, rs.visibilityInfo()).eval(this.context); - } - }; - - var MathHelper = function (fn, unit, n) { - if (!(n instanceof Dimension)) { - throw { type: 'Argument', message: 'argument must be a number' }; - } - if (unit === null) { - unit = n.unit; - } - else { - n = n.unify(); - } - return new Dimension(fn(parseFloat(n.value)), unit); - }; - - var mathFunctions = { - // name, unit - ceil: null, - floor: null, - sqrt: null, - abs: null, - tan: '', - sin: '', - cos: '', - atan: 'rad', - asin: 'rad', - acos: 'rad' - }; - for (var f in mathFunctions) { - // eslint-disable-next-line no-prototype-builtins - if (mathFunctions.hasOwnProperty(f)) { - mathFunctions[f] = MathHelper.bind(null, Math[f], mathFunctions[f]); - } - } - mathFunctions.round = function (n, f) { - var fraction = typeof f === 'undefined' ? 0 : f.value; - return MathHelper(function (num) { return num.toFixed(fraction); }, null, n); - }; - - var minMax = function (isMin, args) { - var _this = this; - args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; - } - var i; // key is the unit.toString() for unified Dimension values, - var j; - var current; - var currentUnified; - var referenceUnified; - var unit; - var unitStatic; - var unitClone; - var // elems only contains original argument values. - order = []; - var values = {}; - // value is the index into the order array. - for (i = 0; i < args.length; i++) { - current = args[i]; - if (!(current instanceof Dimension)) { - if (Array.isArray(args[i].value)) { - Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value)); - continue; - } - else { - throw { type: 'Argument', message: 'incompatible types' }; - } - } - currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify(); - unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString(); - unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic; - unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone; - j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit]; - if (j === undefined) { - if (unitStatic !== undefined && unit !== unitStatic) { - throw { type: 'Argument', message: 'incompatible types' }; - } - values[unit] = order.length; - order.push(current); - continue; - } - referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify(); - if (isMin && currentUnified.value < referenceUnified.value || - !isMin && currentUnified.value > referenceUnified.value) { - order[j] = current; - } - } - if (order.length == 1) { - return order[0]; - } - args = order.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', '); - return new Anonymous("".concat(isMin ? 'min' : 'max', "(").concat(args, ")")); - }; - var number = { - min: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return minMax.call(this, true, args); - } - catch (e) { } - }, - max: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return minMax.call(this, false, args); - } - catch (e) { } - }, - convert: function (val, unit) { - return val.convertTo(unit.value); - }, - pi: function () { - return new Dimension(Math.PI); - }, - mod: function (a, b) { - return new Dimension(a.value % b.value, a.unit); - }, - pow: function (x, y) { - if (typeof x === 'number' && typeof y === 'number') { - x = new Dimension(x); - y = new Dimension(y); - } - else if (!(x instanceof Dimension) || !(y instanceof Dimension)) { - throw { type: 'Argument', message: 'arguments must be numbers' }; - } - return new Dimension(Math.pow(x.value, y.value), x.unit); - }, - percentage: function (n) { - var result = MathHelper(function (num) { return num * 100; }, '%', n); - return result; - } - }; - - var string = { - e: function (str) { - return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true); - }, - escape: function (str) { - return new Anonymous(encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B') - .replace(/\(/g, '%28').replace(/\)/g, '%29')); - }, - replace: function (string, pattern, replacement, flags) { - var result = string.value; - replacement = (replacement.type === 'Quoted') ? - replacement.value : replacement.toCSS(); - result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement); - return new Quoted(string.quote || '', result, string.escaped); - }, - '%': function (string /* arg, arg, ... */) { - var args = Array.prototype.slice.call(arguments, 1); - var result = string.value; - var _loop_1 = function (i_1) { - /* jshint loopfunc:true */ - result = result.replace(/%[sda]/i, function (token) { - var value = ((args[i_1].type === 'Quoted') && - token.match(/s/i)) ? args[i_1].value : args[i_1].toCSS(); - return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value; - }); - }; - for (var i_1 = 0; i_1 < args.length; i_1++) { - _loop_1(i_1); - } - result = result.replace(/%%/g, '%'); - return new Quoted(string.quote || '', result, string.escaped); - } - }; - - var svg = (function () { - return { 'svg-gradient': function (direction) { - var stops; - var gradientDirectionSvg; - var gradientType = 'linear'; - var rectangleDimension = 'x="0" y="0" width="1" height="1"'; - var renderEnv = { compress: false }; - var returner; - var directionValue = direction.toCSS(renderEnv); - var i; - var color; - var position; - var positionValue; - var alpha; - function throwArgumentDescriptor() { - throw { type: 'Argument', - message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' + - ' end_color [end_position] or direction, color list' }; - } - if (arguments.length == 2) { - if (arguments[1].value.length < 2) { - throwArgumentDescriptor(); - } - stops = arguments[1].value; - } - else if (arguments.length < 3) { - throwArgumentDescriptor(); - } - else { - stops = Array.prototype.slice.call(arguments, 1); - } - switch (directionValue) { - case 'to bottom': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"'; - break; - case 'to right': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"'; - break; - case 'to bottom right': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"'; - break; - case 'to top right': - gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"'; - break; - case 'ellipse': - case 'ellipse at center': - gradientType = 'radial'; - gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"'; - rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; - break; - default: - throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' + - ' \'to bottom right\', \'to top right\' or \'ellipse at center\'' }; - } - returner = "<".concat(gradientType, "Gradient id=\"g\" ").concat(gradientDirectionSvg, ">"); - for (i = 0; i < stops.length; i += 1) { - if (stops[i] instanceof Expression) { - color = stops[i].value[0]; - position = stops[i].value[1]; - } - else { - color = stops[i]; - position = undefined; - } - if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) { - throwArgumentDescriptor(); - } - positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%'; - alpha = color.alpha; - returner += ""); - } - returner += ""); - returner = encodeURIComponent(returner); - returner = "data:image/svg+xml,".concat(returner); - return new URL(new Quoted("'".concat(returner, "'"), returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); - } }; - }); - - var isa = function (n, Type) { return (n instanceof Type) ? Keyword.True : Keyword.False; }; - var isunit = function (n, unit) { - if (unit === undefined) { - throw { type: 'Argument', message: 'missing the required second argument to isunit.' }; - } - unit = typeof unit.value === 'string' ? unit.value : unit; - if (typeof unit !== 'string') { - throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' }; - } - return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False; - }; - var types = { - isruleset: function (n) { - return isa(n, DetachedRuleset); - }, - iscolor: function (n) { - return isa(n, Color); - }, - isnumber: function (n) { - return isa(n, Dimension); - }, - isstring: function (n) { - return isa(n, Quoted); - }, - iskeyword: function (n) { - return isa(n, Keyword); - }, - isurl: function (n) { - return isa(n, URL); - }, - ispixel: function (n) { - return isunit(n, 'px'); - }, - ispercentage: function (n) { - return isunit(n, '%'); - }, - isem: function (n) { - return isunit(n, 'em'); - }, - isunit: isunit, - unit: function (val, unit) { - if (!(val instanceof Dimension)) { - throw { type: 'Argument', - message: "the first argument to unit must be a number".concat(val instanceof Operation ? '. Have you forgotten parenthesis?' : '') }; - } - if (unit) { - if (unit instanceof Keyword) { - unit = unit.value; - } - else { - unit = unit.toCSS(); - } - } - else { - unit = ''; - } - return new Dimension(val.value, unit); - }, - 'get-unit': function (n) { - return new Anonymous(n.unit); - } - }; - - var styleExpression = function (args) { - var _this = this; - args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; - } - var entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)]; - args = entityList.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', '); - return new Variable("style(".concat(args, ")")); - }; - var style$1 = { - style: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return styleExpression.call(this, args); - } - catch (e) { } - }, - }; - - var functions = (function (environment) { - var functions = { functionRegistry: functionRegistry, functionCaller: functionCaller }; - // register functions - functionRegistry.addMultiple(boolean$1); - functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc)); - functionRegistry.addMultiple(color); - functionRegistry.addMultiple(colorBlend); - functionRegistry.addMultiple(dataUri(environment)); - functionRegistry.addMultiple(list); - functionRegistry.addMultiple(mathFunctions); - functionRegistry.addMultiple(number); - functionRegistry.addMultiple(string); - functionRegistry.addMultiple(svg()); - functionRegistry.addMultiple(types); - functionRegistry.addMultiple(style$1); - return functions; - }); - - function transformTree (root, options) { - options = options || {}; - var evaldRoot; - var variables = options.variables; - var evalEnv = new contexts.Eval(options); - // - // Allows setting variables with a hash, so: - // - // `{ color: new tree.Color('#f01') }` will become: - // - // new tree.Declaration('@color', - // new tree.Value([ - // new tree.Expression([ - // new tree.Color('#f01') - // ]) - // ]) - // ) - // - if (typeof variables === 'object' && !Array.isArray(variables)) { - variables = Object.keys(variables).map(function (k) { - var value = variables[k]; - if (!(value instanceof tree.Value)) { - if (!(value instanceof tree.Expression)) { - value = new tree.Expression([value]); - } - value = new tree.Value([value]); - } - return new tree.Declaration("@".concat(k), value, false, null, 0); - }); - evalEnv.frames = [new tree.Ruleset(null, variables)]; - } - var visitors$1 = [ - new visitors.JoinSelectorVisitor(), - new visitors.MarkVisibleSelectorsVisitor(true), - new visitors.ExtendVisitor(), - new visitors.ToCSSVisitor({ compress: Boolean(options.compress) }) - ]; - var preEvalVisitors = []; - var v; - var visitorIterator; - /** - * first() / get() allows visitors to be added while visiting - * - * @todo Add scoping for visitors just like functions for @plugin; right now they're global - */ - if (options.pluginManager) { - visitorIterator = options.pluginManager.visitor(); - for (var i_1 = 0; i_1 < 2; i_1++) { - visitorIterator.first(); - while ((v = visitorIterator.get())) { - if (v.isPreEvalVisitor) { - if (i_1 === 0 || preEvalVisitors.indexOf(v) === -1) { - preEvalVisitors.push(v); - v.run(root); - } - } - else { - if (i_1 === 0 || visitors$1.indexOf(v) === -1) { - if (v.isPreVisitor) { - visitors$1.unshift(v); - } - else { - visitors$1.push(v); - } - } - } - } - } - } - evaldRoot = root.eval(evalEnv); - for (var i_2 = 0; i_2 < visitors$1.length; i_2++) { - visitors$1[i_2].run(evaldRoot); - } - // Run any remaining visitors added after eval pass - if (options.pluginManager) { - visitorIterator.first(); - while ((v = visitorIterator.get())) { - if (visitors$1.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) { - v.run(evaldRoot); - } - } - } - return evaldRoot; - } - - /** - * Plugin Manager - */ - var PluginManager = /** @class */ (function () { - function PluginManager(less) { - this.less = less; - this.visitors = []; - this.preProcessors = []; - this.postProcessors = []; - this.installedPlugins = []; - this.fileManagers = []; - this.iterator = -1; - this.pluginCache = {}; - this.Loader = new less.PluginLoader(less); - } - /** - * Adds all the plugins in the array - * @param {Array} plugins - */ - PluginManager.prototype.addPlugins = function (plugins) { - if (plugins) { - for (var i_1 = 0; i_1 < plugins.length; i_1++) { - this.addPlugin(plugins[i_1]); - } - } - }; - /** - * - * @param plugin - * @param {String} filename - */ - PluginManager.prototype.addPlugin = function (plugin, filename, functionRegistry) { - this.installedPlugins.push(plugin); - if (filename) { - this.pluginCache[filename] = plugin; - } - if (plugin.install) { - plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry); - } - }; - /** - * - * @param filename - */ - PluginManager.prototype.get = function (filename) { - return this.pluginCache[filename]; - }; - /** - * Adds a visitor. The visitor object has options on itself to determine - * when it should run. - * @param visitor - */ - PluginManager.prototype.addVisitor = function (visitor) { - this.visitors.push(visitor); - }; - /** - * Adds a pre processor object - * @param {object} preProcessor - * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import - */ - PluginManager.prototype.addPreProcessor = function (preProcessor, priority) { - var indexToInsertAt; - for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) { - if (this.preProcessors[indexToInsertAt].priority >= priority) { - break; - } - } - this.preProcessors.splice(indexToInsertAt, 0, { preProcessor: preProcessor, priority: priority }); - }; - /** - * Adds a post processor object - * @param {object} postProcessor - * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression - */ - PluginManager.prototype.addPostProcessor = function (postProcessor, priority) { - var indexToInsertAt; - for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) { - if (this.postProcessors[indexToInsertAt].priority >= priority) { - break; - } - } - this.postProcessors.splice(indexToInsertAt, 0, { postProcessor: postProcessor, priority: priority }); - }; - /** - * - * @param manager - */ - PluginManager.prototype.addFileManager = function (manager) { - this.fileManagers.push(manager); - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getPreProcessors = function () { - var preProcessors = []; - for (var i_2 = 0; i_2 < this.preProcessors.length; i_2++) { - preProcessors.push(this.preProcessors[i_2].preProcessor); - } - return preProcessors; - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getPostProcessors = function () { - var postProcessors = []; - for (var i_3 = 0; i_3 < this.postProcessors.length; i_3++) { - postProcessors.push(this.postProcessors[i_3].postProcessor); - } - return postProcessors; - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getVisitors = function () { - return this.visitors; - }; - PluginManager.prototype.visitor = function () { - var self = this; - return { - first: function () { - self.iterator = -1; - return self.visitors[self.iterator]; - }, - get: function () { - self.iterator += 1; - return self.visitors[self.iterator]; - } - }; - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getFileManagers = function () { - return this.fileManagers; - }; - return PluginManager; - }()); - var pm; - var PluginManagerFactory = function (less, newFactory) { - if (newFactory || !pm) { - pm = new PluginManager(less); - } - return pm; - }; - - function SourceMapOutput (environment) { - var SourceMapOutput = /** @class */ (function () { - function SourceMapOutput(options) { - this._css = []; - this._rootNode = options.rootNode; - this._contentsMap = options.contentsMap; - this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap; - if (options.sourceMapFilename) { - this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/'); - } - this._outputFilename = options.outputFilename; - this.sourceMapURL = options.sourceMapURL; - if (options.sourceMapBasepath) { - this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/'); - } - if (options.sourceMapRootpath) { - this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/'); - if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') { - this._sourceMapRootpath += '/'; - } - } - else { - this._sourceMapRootpath = ''; - } - this._outputSourceFiles = options.outputSourceFiles; - this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator(); - this._lineNumber = 0; - this._column = 0; - } - SourceMapOutput.prototype.removeBasepath = function (path) { - if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) { - path = path.substring(this._sourceMapBasepath.length); - if (path.charAt(0) === '\\' || path.charAt(0) === '/') { - path = path.substring(1); - } - } - return path; - }; - SourceMapOutput.prototype.normalizeFilename = function (filename) { - filename = filename.replace(/\\/g, '/'); - filename = this.removeBasepath(filename); - return (this._sourceMapRootpath || '') + filename; - }; - SourceMapOutput.prototype.add = function (chunk, fileInfo, index, mapLines) { - // ignore adding empty strings - if (!chunk) { - return; - } - var lines, sourceLines, columns, sourceColumns, i; - if (fileInfo && fileInfo.filename) { - var inputSource = this._contentsMap[fileInfo.filename]; - // remove vars/banner added to the top of the file - if (this._contentsIgnoredCharsMap[fileInfo.filename]) { - // adjust the index - index -= this._contentsIgnoredCharsMap[fileInfo.filename]; - if (index < 0) { - index = 0; - } - // adjust the source - inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]); - } - /** - * ignore empty content, or failsafe - * if contents map is incorrect - */ - if (inputSource === undefined) { - this._css.push(chunk); - return; - } - inputSource = inputSource.substring(0, index); - sourceLines = inputSource.split('\n'); - sourceColumns = sourceLines[sourceLines.length - 1]; - } - lines = chunk.split('\n'); - columns = lines[lines.length - 1]; - if (fileInfo && fileInfo.filename) { - if (!mapLines) { - this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column }, - original: { line: sourceLines.length, column: sourceColumns.length }, - source: this.normalizeFilename(fileInfo.filename) }); - } - else { - for (i = 0; i < lines.length; i++) { - this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0 }, - original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0 }, - source: this.normalizeFilename(fileInfo.filename) }); - } - } - } - if (lines.length === 1) { - this._column += columns.length; - } - else { - this._lineNumber += lines.length - 1; - this._column = columns.length; - } - this._css.push(chunk); - }; - SourceMapOutput.prototype.isEmpty = function () { - return this._css.length === 0; - }; - SourceMapOutput.prototype.toCSS = function (context) { - this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null }); - if (this._outputSourceFiles) { - for (var filename in this._contentsMap) { - // eslint-disable-next-line no-prototype-builtins - if (this._contentsMap.hasOwnProperty(filename)) { - var source = this._contentsMap[filename]; - if (this._contentsIgnoredCharsMap[filename]) { - source = source.slice(this._contentsIgnoredCharsMap[filename]); - } - this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source); - } - } - } - this._rootNode.genCSS(context, this); - if (this._css.length > 0) { - var sourceMapURL = void 0; - var sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON()); - if (this.sourceMapURL) { - sourceMapURL = this.sourceMapURL; - } - else if (this._sourceMapFilename) { - sourceMapURL = this._sourceMapFilename; - } - this.sourceMapURL = sourceMapURL; - this.sourceMap = sourceMapContent; - } - return this._css.join(''); - }; - return SourceMapOutput; - }()); - return SourceMapOutput; - } - - function SourceMapBuilder (SourceMapOutput, environment) { - var SourceMapBuilder = /** @class */ (function () { - function SourceMapBuilder(options) { - this.options = options; - } - SourceMapBuilder.prototype.toCSS = function (rootNode, options, imports) { - var sourceMapOutput = new SourceMapOutput({ - contentsIgnoredCharsMap: imports.contentsIgnoredChars, - rootNode: rootNode, - contentsMap: imports.contents, - sourceMapFilename: this.options.sourceMapFilename, - sourceMapURL: this.options.sourceMapURL, - outputFilename: this.options.sourceMapOutputFilename, - sourceMapBasepath: this.options.sourceMapBasepath, - sourceMapRootpath: this.options.sourceMapRootpath, - outputSourceFiles: this.options.outputSourceFiles, - sourceMapGenerator: this.options.sourceMapGenerator, - sourceMapFileInline: this.options.sourceMapFileInline, - disableSourcemapAnnotation: this.options.disableSourcemapAnnotation - }); - var css = sourceMapOutput.toCSS(options); - this.sourceMap = sourceMapOutput.sourceMap; - this.sourceMapURL = sourceMapOutput.sourceMapURL; - if (this.options.sourceMapInputFilename) { - this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename); - } - if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) { - this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL); - } - return css + this.getCSSAppendage(); - }; - SourceMapBuilder.prototype.getCSSAppendage = function () { - var sourceMapURL = this.sourceMapURL; - if (this.options.sourceMapFileInline) { - if (this.sourceMap === undefined) { - return ''; - } - sourceMapURL = "data:application/json;base64,".concat(environment.encodeBase64(this.sourceMap)); - } - if (this.options.disableSourcemapAnnotation) { - return ''; - } - if (sourceMapURL) { - return "/*# sourceMappingURL=".concat(sourceMapURL, " */"); - } - return ''; - }; - SourceMapBuilder.prototype.getExternalSourceMap = function () { - return this.sourceMap; - }; - SourceMapBuilder.prototype.setExternalSourceMap = function (sourceMap) { - this.sourceMap = sourceMap; - }; - SourceMapBuilder.prototype.isInline = function () { - return this.options.sourceMapFileInline; - }; - SourceMapBuilder.prototype.getSourceMapURL = function () { - return this.sourceMapURL; - }; - SourceMapBuilder.prototype.getOutputFilename = function () { - return this.options.sourceMapOutputFilename; - }; - SourceMapBuilder.prototype.getInputFilename = function () { - return this.sourceMapInputFilename; - }; - return SourceMapBuilder; - }()); - return SourceMapBuilder; - } - - function ParseTree (SourceMapBuilder) { - var ParseTree = /** @class */ (function () { - function ParseTree(root, imports) { - this.root = root; - this.imports = imports; - } - ParseTree.prototype.toCSS = function (options) { - var evaldRoot; - var result = {}; - var sourceMapBuilder; - try { - evaldRoot = transformTree(this.root, options); - } - catch (e) { - throw new LessError(e, this.imports); - } - try { - var compress = Boolean(options.compress); - if (compress) { - logger$1.warn('The compress option has been deprecated. ' + - 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.'); - } - var toCSSOptions = { - compress: compress, - dumpLineNumbers: options.dumpLineNumbers, - strictUnits: Boolean(options.strictUnits), - numPrecision: 8 - }; - if (options.sourceMap) { - sourceMapBuilder = new SourceMapBuilder(options.sourceMap); - result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports); - } - else { - result.css = evaldRoot.toCSS(toCSSOptions); - } - } - catch (e) { - throw new LessError(e, this.imports); - } - if (options.pluginManager) { - var postProcessors = options.pluginManager.getPostProcessors(); - for (var i_1 = 0; i_1 < postProcessors.length; i_1++) { - result.css = postProcessors[i_1].process(result.css, { sourceMap: sourceMapBuilder, options: options, imports: this.imports }); - } - } - if (options.sourceMap) { - result.map = sourceMapBuilder.getExternalSourceMap(); - } - result.imports = []; - for (var file_1 in this.imports.files) { - if (Object.prototype.hasOwnProperty.call(this.imports.files, file_1) && file_1 !== this.imports.rootFilename) { - result.imports.push(file_1); - } - } - return result; - }; - return ParseTree; - }()); - return ParseTree; - } - - function ImportManager (environment) { - // FileInfo = { - // 'rewriteUrls' - option - whether to adjust URL's to be relative - // 'filename' - full resolved filename of current file - // 'rootpath' - path to append to normal URLs for this node - // 'currentDirectory' - path to the current file, absolute - // 'rootFilename' - filename of the base file - // 'entryPath' - absolute path to the entry file - // 'reference' - whether the file should not be output and only output parts that are referenced - var ImportManager = /** @class */ (function () { - function ImportManager(less, context, rootFileInfo) { - this.less = less; - this.rootFilename = rootFileInfo.filename; - this.paths = context.paths || []; // Search paths, when importing - this.contents = {}; // map - filename to contents of all the files - this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore - this.mime = context.mime; - this.error = null; - this.context = context; - // Deprecated? Unused outside of here, could be useful. - this.queue = []; // Files which haven't been imported yet - this.files = {}; // Holds the imported parse trees. - } - /** - * Add an import to be imported - * @param path - the raw path - * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension) - * @param currentFileInfo - the current file info (used for instance to work out relative paths) - * @param importOptions - import options - * @param callback - callback for when it is imported - */ - ImportManager.prototype.push = function (path, tryAppendExtension, currentFileInfo, importOptions, callback) { - var importManager = this, pluginLoader = this.context.pluginManager.Loader; - this.queue.push(path); - var fileParsedFunc = function (e, root, fullPath) { - importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue - var importedEqualsRoot = fullPath === importManager.rootFilename; - if (importOptions.optional && e) { - callback(null, { rules: [] }, false, null); - logger$1.info("The file ".concat(fullPath, " was skipped because it was not found and the import was marked optional.")); - } - else { - // Inline imports aren't cached here. - // If we start to cache them, please make sure they won't conflict with non-inline imports of the - // same name as they used to do before this comment and the condition below have been added. - if (!importManager.files[fullPath] && !importOptions.inline) { - importManager.files[fullPath] = { root: root, options: importOptions }; - } - if (e && !importManager.error) { - importManager.error = e; - } - callback(e, root, importedEqualsRoot, fullPath); - } - }; - var newFileInfo = { - rewriteUrls: this.context.rewriteUrls, - entryPath: currentFileInfo.entryPath, - rootpath: currentFileInfo.rootpath, - rootFilename: currentFileInfo.rootFilename - }; - var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment); - if (!fileManager) { - fileParsedFunc({ message: "Could not find a file-manager for ".concat(path) }); - return; - } - var loadFileCallback = function (loadedFile) { - var plugin; - var resolvedFilename = loadedFile.filename; - var contents = loadedFile.contents.replace(/^\uFEFF/, ''); - // Pass on an updated rootpath if path of imported file is relative and file - // is in a (sub|sup) directory - // - // Examples: - // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/', - // then rootpath should become 'less/module/nav/' - // - If path of imported file is '../mixins.less' and rootpath is 'less/', - // then rootpath should become 'less/../' - newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename); - if (newFileInfo.rewriteUrls) { - newFileInfo.rootpath = fileManager.join((importManager.context.rootpath || ''), fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); - if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) { - newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath); - } - } - newFileInfo.filename = resolvedFilename; - var newEnv = new contexts.Parse(importManager.context); - newEnv.processImports = false; - importManager.contents[resolvedFilename] = contents; - if (currentFileInfo.reference || importOptions.reference) { - newFileInfo.reference = true; - } - if (importOptions.isPlugin) { - plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo); - if (plugin instanceof LessError) { - fileParsedFunc(plugin, null, resolvedFilename); - } - else { - fileParsedFunc(null, plugin, resolvedFilename); - } - } - else if (importOptions.inline) { - fileParsedFunc(null, contents, resolvedFilename); - } - else { - // import (multiple) parse trees apparently get altered and can't be cached. - // TODO: investigate why this is - if (importManager.files[resolvedFilename] - && !importManager.files[resolvedFilename].options.multiple - && !importOptions.multiple) { - fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename); - } - else { - new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) { - fileParsedFunc(e, root, resolvedFilename); - }); - } - } - }; - var loadedFile; - var promise; - var context = clone(this.context); - if (tryAppendExtension) { - context.ext = importOptions.isPlugin ? '.js' : '.less'; - } - if (importOptions.isPlugin) { - context.mime = 'application/javascript'; - if (context.syncImport) { - loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager); - } - else { - promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager); - } - } - else { - if (context.syncImport) { - loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment); - } - else { - promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, function (err, loadedFile) { - if (err) { - fileParsedFunc(err); - } - else { - loadFileCallback(loadedFile); - } - }); - } - } - if (loadedFile) { - if (!loadedFile.filename) { - fileParsedFunc(loadedFile); - } - else { - loadFileCallback(loadedFile); - } - } - else if (promise) { - promise.then(loadFileCallback, fileParsedFunc); - } - }; - return ImportManager; - }()); - return ImportManager; - } - - function Parse (environment, ParseTree, ImportManager) { - var parse = function (input, options, callback) { - if (typeof options === 'function') { - callback = options; - options = copyOptions(this.options, {}); - } - else { - options = copyOptions(this.options, options || {}); - } - if (!callback) { - var self_1 = this; - return new Promise(function (resolve, reject) { - parse.call(self_1, input, options, function (err, output) { - if (err) { - reject(err); - } - else { - resolve(output); - } - }); - }); - } - else { - var context_1; - var rootFileInfo = void 0; - var pluginManager_1 = new PluginManagerFactory(this, !options.reUsePluginManager); - options.pluginManager = pluginManager_1; - context_1 = new contexts.Parse(options); - if (options.rootFileInfo) { - rootFileInfo = options.rootFileInfo; - } - else { - var filename = options.filename || 'input'; - var entryPath = filename.replace(/[^/\\]*$/, ''); - rootFileInfo = { - filename: filename, - rewriteUrls: context_1.rewriteUrls, - rootpath: context_1.rootpath || '', - currentDirectory: entryPath, - entryPath: entryPath, - rootFilename: filename - }; - // add in a missing trailing slash - if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') { - rootFileInfo.rootpath += '/'; - } - } - var imports_1 = new ImportManager(this, context_1, rootFileInfo); - this.importManager = imports_1; - // TODO: allow the plugins to be just a list of paths or names - // Do an async plugin queue like lessc - if (options.plugins) { - options.plugins.forEach(function (plugin) { - var evalResult, contents; - if (plugin.fileContent) { - contents = plugin.fileContent.replace(/^\uFEFF/, ''); - evalResult = pluginManager_1.Loader.evalPlugin(contents, context_1, imports_1, plugin.options, plugin.filename); - if (evalResult instanceof LessError) { - return callback(evalResult); - } - } - else { - pluginManager_1.addPlugin(plugin); - } - }); - } - new Parser(context_1, imports_1, rootFileInfo) - .parse(input, function (e, root) { - if (e) { - return callback(e); - } - callback(null, root, imports_1, options); - }, options); - } - }; - return parse; - } - - function Render (environment, ParseTree) { - var render = function (input, options, callback) { - if (typeof options === 'function') { - callback = options; - options = copyOptions(this.options, {}); - } - else { - options = copyOptions(this.options, options || {}); - } - if (!callback) { - var self_1 = this; - return new Promise(function (resolve, reject) { - render.call(self_1, input, options, function (err, output) { - if (err) { - reject(err); - } - else { - resolve(output); - } - }); - }); - } - else { - this.parse(input, options, function (err, root, imports, options) { - if (err) { - return callback(err); - } - var result; - try { - var parseTree = new ParseTree(root, imports); - result = parseTree.toCSS(options); - } - catch (err) { - return callback(err); - } - callback(null, result); - }); - } - }; - return render; - } - - var version = "4.4.2"; - - function parseNodeVersion(version) { - var match = version.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len - if (!match) { - throw new Error('Unable to parse: ' + version); - } - - var res = { - major: parseInt(match[1], 10), - minor: parseInt(match[2], 10), - patch: parseInt(match[3], 10), - pre: match[4] || '', - build: match[5] || '', - }; - - return res; - } - - var parseNodeVersion_1 = parseNodeVersion; - - function lessRoot (environment, fileManagers) { - var sourceMapOutput, sourceMapBuilder, parseTree, importManager; - environment = new Environment(environment, fileManagers); - sourceMapOutput = SourceMapOutput(environment); - sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment); - parseTree = ParseTree(sourceMapBuilder); - importManager = ImportManager(environment); - var render = Render(environment, parseTree); - var parse = Parse(environment, parseTree, importManager); - var v = parseNodeVersion_1("v".concat(version)); - var initial = { - version: [v.major, v.minor, v.patch], - data: data, - tree: tree, - Environment: Environment, - AbstractFileManager: AbstractFileManager, - AbstractPluginLoader: AbstractPluginLoader, - environment: environment, - visitors: visitors, - Parser: Parser, - functions: functions(environment), - contexts: contexts, - SourceMapOutput: sourceMapOutput, - SourceMapBuilder: sourceMapBuilder, - ParseTree: parseTree, - ImportManager: importManager, - render: render, - parse: parse, - LessError: LessError, - transformTree: transformTree, - utils: utils, - PluginManager: PluginManagerFactory, - logger: logger$1 - }; - // Create a public API - var ctor = function (t) { - return function () { - var obj = Object.create(t.prototype); - t.apply(obj, Array.prototype.slice.call(arguments, 0)); - return obj; - }; - }; - var t; - var api = Object.create(initial); - for (var n in initial.tree) { - /* eslint guard-for-in: 0 */ - t = initial.tree[n]; - if (typeof t === 'function') { - api[n.toLowerCase()] = ctor(t); - } - else { - api[n] = Object.create(null); - for (var o in t) { - /* eslint guard-for-in: 0 */ - api[n][o.toLowerCase()] = ctor(t[o]); - } - } - } - /** - * Some of the functions assume a `this` context of the API object, - * which causes it to fail when wrapped for ES6 imports. - * - * An assumed `this` should be removed in the future. - */ - initial.parse = initial.parse.bind(api); - initial.render = initial.render.bind(api); - return api; - } - - var options$1; - var logger; - var fileCache = {}; - // TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load - var FileManager = function () { }; - FileManager.prototype = Object.assign(new AbstractFileManager(), { - alwaysMakePathsAbsolute: function () { - return true; - }, - join: function (basePath, laterPath) { - if (!basePath) { - return laterPath; - } - return this.extractUrlParts(laterPath, basePath).path; - }, - doXHR: function (url, type, callback, errback) { - var xhr = new XMLHttpRequest(); - var async = options$1.isFileProtocol ? options$1.fileAsync : true; - if (typeof xhr.overrideMimeType === 'function') { - xhr.overrideMimeType('text/css'); - } - logger.debug("XHR: Getting '".concat(url, "'")); - xhr.open('GET', url, async); - xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5'); - xhr.send(null); - function handleResponse(xhr, callback, errback) { - if (xhr.status >= 200 && xhr.status < 300) { - callback(xhr.responseText, xhr.getResponseHeader('Last-Modified')); - } - else if (typeof errback === 'function') { - errback(xhr.status, url); - } - } - if (options$1.isFileProtocol && !options$1.fileAsync) { - if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) { - callback(xhr.responseText); - } - else { - errback(xhr.status, url); - } - } - else if (async) { - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - handleResponse(xhr, callback, errback); - } - }; - } - else { - handleResponse(xhr, callback, errback); - } - }, - supports: function () { - return true; - }, - clearFileCache: function () { - fileCache = {}; - }, - loadFile: function (filename, currentDirectory, options) { - // TODO: Add prefix support like less-node? - // What about multiple paths? - if (currentDirectory && !this.isPathAbsolute(filename)) { - filename = currentDirectory + filename; - } - filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename; - options = options || {}; - // sheet may be set to the stylesheet for the initial load or a collection of properties including - // some context variables for imports - var hrefParts = this.extractUrlParts(filename, window.location.href); - var href = hrefParts.url; - var self = this; - return new Promise(function (resolve, reject) { - if (options.useFileCache && fileCache[href]) { - try { - var lessText_1 = fileCache[href]; - return resolve({ contents: lessText_1, filename: href, webInfo: { lastModified: new Date() } }); - } - catch (e) { - return reject({ filename: href, message: "Error loading file ".concat(href, " error was ").concat(e.message) }); - } - } - self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { - // per file cache - fileCache[href] = data; - // Use remote copy (re-parse) - resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } }); - }, function doXHRError(status, url) { - reject({ type: 'File', message: "'".concat(url, "' wasn't found (").concat(status, ")"), href: href }); - }); - }); - } - }); - var FM = (function (opts, log) { - options$1 = opts; - logger = log; - return FileManager; - }); - - /** - * @todo Add tests for browser `@plugin` - */ - /** - * Browser Plugin Loader - */ - var PluginLoader = function (less) { - this.less = less; - // Should we shim this.require for browser? Probably not? - }; - PluginLoader.prototype = Object.assign(new AbstractPluginLoader(), { - loadPlugin: function (filename, basePath, context, environment, fileManager) { - return new Promise(function (fulfill, reject) { - fileManager.loadFile(filename, basePath, context, environment) - .then(fulfill).catch(reject); - }); - } - }); - - var LogListener = (function (less, options) { - var logLevel_debug = 4; - var logLevel_info = 3; - var logLevel_warn = 2; - var logLevel_error = 1; - // The amount of logging in the javascript console. - // 3 - Debug, information and errors - // 2 - Information and errors - // 1 - Errors - // 0 - None - // Defaults to 2 - options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error); - if (!options.loggers) { - options.loggers = [{ - debug: function (msg) { - if (options.logLevel >= logLevel_debug) { - console.log(msg); - } - }, - info: function (msg) { - if (options.logLevel >= logLevel_info) { - console.log(msg); - } - }, - warn: function (msg) { - if (options.logLevel >= logLevel_warn) { - console.warn(msg); - } - }, - error: function (msg) { - if (options.logLevel >= logLevel_error) { - console.error(msg); - } - } - }]; - } - for (var i_1 = 0; i_1 < options.loggers.length; i_1++) { - less.logger.addListener(options.loggers[i_1]); - } - }); - - var ErrorReporting = (function (window, less, options) { - function errorHTML(e, rootHref) { - var id = "less-error-message:".concat(extractId(rootHref || '')); - var template = '
  • {content}
  • '; - var elem = window.document.createElement('div'); - var timer; - var content; - var errors = []; - var filename = e.filename || rootHref; - var filenameNoPath = filename.match(/([^/]+(\?.*)?)$/)[1]; - elem.id = id; - elem.className = 'less-error-message'; - content = "

    ".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file') + - "

    in ").concat(filenameNoPath, " "); - var errorline = function (e, i, classname) { - if (e.extract[i] !== undefined) { - errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) - .replace(/\{class\}/, classname) - .replace(/\{content\}/, e.extract[i])); - } - }; - if (e.line) { - errorline(e, 0, ''); - errorline(e, 1, 'line'); - errorline(e, 2, ''); - content += "on line ".concat(e.line, ", column ").concat(e.column + 1, ":

      ").concat(errors.join(''), "
    "); - } - if (e.stack && (e.extract || options.logLevel >= 4)) { - content += "
    Stack Trace
    ".concat(e.stack.split('\n').slice(1).join('
    ')); - } - elem.innerHTML = content; - // CSS for error messages - browser.createCSS(window.document, [ - '.less-error-message ul, .less-error-message li {', - 'list-style-type: none;', - 'margin-right: 15px;', - 'padding: 4px 0;', - 'margin: 0;', - '}', - '.less-error-message label {', - 'font-size: 12px;', - 'margin-right: 15px;', - 'padding: 4px 0;', - 'color: #cc7777;', - '}', - '.less-error-message pre {', - 'color: #dd6666;', - 'padding: 4px 0;', - 'margin: 0;', - 'display: inline-block;', - '}', - '.less-error-message pre.line {', - 'color: #ff0000;', - '}', - '.less-error-message h3 {', - 'font-size: 20px;', - 'font-weight: bold;', - 'padding: 15px 0 5px 0;', - 'margin: 0;', - '}', - '.less-error-message a {', - 'color: #10a', - '}', - '.less-error-message .error {', - 'color: red;', - 'font-weight: bold;', - 'padding-bottom: 2px;', - 'border-bottom: 1px dashed red;', - '}' - ].join('\n'), { title: 'error-message' }); - elem.style.cssText = [ - 'font-family: Arial, sans-serif', - 'border: 1px solid #e00', - 'background-color: #eee', - 'border-radius: 5px', - '-webkit-border-radius: 5px', - '-moz-border-radius: 5px', - 'color: #e00', - 'padding: 15px', - 'margin-bottom: 15px' - ].join(';'); - if (options.env === 'development') { - timer = setInterval(function () { - var document = window.document; - var body = document.body; - if (body) { - if (document.getElementById(id)) { - body.replaceChild(elem, document.getElementById(id)); - } - else { - body.insertBefore(elem, body.firstChild); - } - clearInterval(timer); - } - }, 10); - } - } - function removeErrorHTML(path) { - var node = window.document.getElementById("less-error-message:".concat(extractId(path))); - if (node) { - node.parentNode.removeChild(node); - } - } - function removeError(path) { - if (!options.errorReporting || options.errorReporting === 'html') { - removeErrorHTML(path); - } - else if (options.errorReporting === 'console') ; - else if (typeof options.errorReporting === 'function') { - options.errorReporting('remove', path); - } - } - function errorConsole(e, rootHref) { - var template = '{line} {content}'; - var filename = e.filename || rootHref; - var errors = []; - var content = "".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file', " in ").concat(filename); - var errorline = function (e, i, classname) { - if (e.extract[i] !== undefined) { - errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) - .replace(/\{class\}/, classname) - .replace(/\{content\}/, e.extract[i])); - } - }; - if (e.line) { - errorline(e, 0, ''); - errorline(e, 1, 'line'); - errorline(e, 2, ''); - content += " on line ".concat(e.line, ", column ").concat(e.column + 1, ":\n").concat(errors.join('\n')); - } - if (e.stack && (e.extract || options.logLevel >= 4)) { - content += "\nStack Trace\n".concat(e.stack); - } - less.logger.error(content); - } - function error(e, rootHref) { - if (!options.errorReporting || options.errorReporting === 'html') { - errorHTML(e, rootHref); - } - else if (options.errorReporting === 'console') { - errorConsole(e, rootHref); - } - else if (typeof options.errorReporting === 'function') { - options.errorReporting('add', e, rootHref); - } - } - return { - add: error, - remove: removeError - }; - }); - - // Cache system is a bit outdated and could do with work - var Cache = (function (window, options, logger) { - var cache = null; - if (options.env !== 'development') { - try { - cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage; - } - catch (_) { } - } - return { - setCSS: function (path, lastModified, modifyVars, styles) { - if (cache) { - logger.info("saving ".concat(path, " to cache.")); - try { - cache.setItem(path, styles); - cache.setItem("".concat(path, ":timestamp"), lastModified); - if (modifyVars) { - cache.setItem("".concat(path, ":vars"), JSON.stringify(modifyVars)); - } - } - catch (e) { - // TODO - could do with adding more robust error handling - logger.error("failed to save \"".concat(path, "\" to local storage for caching.")); - } - } - }, - getCSS: function (path, webInfo, modifyVars) { - var css = cache && cache.getItem(path); - var timestamp = cache && cache.getItem("".concat(path, ":timestamp")); - var vars = cache && cache.getItem("".concat(path, ":vars")); - modifyVars = modifyVars || {}; - vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object - if (timestamp && webInfo.lastModified && - (new Date(webInfo.lastModified).valueOf() === - new Date(timestamp).valueOf()) && - JSON.stringify(modifyVars) === vars) { - // Use local copy - return css; - } - } - }; - }); - - var ImageSize = (function () { - function imageSize() { - throw { - type: 'Runtime', - message: 'Image size functions are not supported in browser version of less' - }; - } - var imageFunctions = { - 'image-size': function (filePathNode) { - imageSize(); - return -1; - }, - 'image-width': function (filePathNode) { - imageSize(); - return -1; - }, - 'image-height': function (filePathNode) { - imageSize(); - return -1; - } - }; - functionRegistry.addMultiple(imageFunctions); - }); - - // - var root = (function (window, options) { - var document = window.document; - var less = lessRoot(); - less.options = options; - var environment = less.environment; - var FileManager = FM(options, less.logger); - var fileManager = new FileManager(); - environment.addFileManager(fileManager); - less.FileManager = FileManager; - less.PluginLoader = PluginLoader; - LogListener(less, options); - var errors = ErrorReporting(window, less, options); - var cache = less.cache = options.cache || Cache(window, options, less.logger); - ImageSize(less.environment); - // Setup user functions - Deprecate? - if (options.functions) { - less.functions.functionRegistry.addMultiple(options.functions); - } - var typePattern = /^text\/(x-)?less$/; - function clone(obj) { - var cloned = {}; - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - cloned[prop] = obj[prop]; - } - } - return cloned; - } - // only really needed for phantom - function bind(func, thisArg) { - var curryArgs = Array.prototype.slice.call(arguments, 2); - return function () { - var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0)); - return func.apply(thisArg, args); - }; - } - function loadStyles(modifyVars) { - var styles = document.getElementsByTagName('style'); - var style; - for (var i_1 = 0; i_1 < styles.length; i_1++) { - style = styles[i_1]; - if (style.type.match(typePattern)) { - var instanceOptions = clone(options); - instanceOptions.modifyVars = modifyVars; - var lessText_1 = style.innerHTML || ''; - instanceOptions.filename = document.location.href.replace(/#.*$/, ''); - /* jshint loopfunc:true */ - // use closure to store current style - less.render(lessText_1, instanceOptions, bind(function (style, e, result) { - if (e) { - errors.add(e, 'inline'); - } - else { - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = result.css; - } - else { - style.innerHTML = result.css; - } - } - }, null, style)); - } - } - } - function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { - var instanceOptions = clone(options); - addDataAttr(instanceOptions, sheet); - instanceOptions.mime = sheet.type; - if (modifyVars) { - instanceOptions.modifyVars = modifyVars; - } - function loadInitialFileCallback(loadedFile) { - var data = loadedFile.contents; - var path = loadedFile.filename; - var webInfo = loadedFile.webInfo; - var newFileInfo = { - currentDirectory: fileManager.getPath(path), - filename: path, - rootFilename: path, - rewriteUrls: instanceOptions.rewriteUrls - }; - newFileInfo.entryPath = newFileInfo.currentDirectory; - newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory; - if (webInfo) { - webInfo.remaining = remaining; - var css = cache.getCSS(path, webInfo, instanceOptions.modifyVars); - if (!reload && css) { - webInfo.local = true; - callback(null, css, data, sheet, webInfo, path); - return; - } - } - // TODO add tests around how this behaves when reloading - errors.remove(path); - instanceOptions.rootFileInfo = newFileInfo; - less.render(data, instanceOptions, function (e, result) { - if (e) { - e.href = path; - callback(e); - } - else { - cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css); - callback(null, result.css, data, sheet, webInfo, path); - } - }); - } - fileManager.loadFile(sheet.href, null, instanceOptions, environment) - .then(function (loadedFile) { - loadInitialFileCallback(loadedFile); - }).catch(function (err) { - console.log(err); - callback(err); - }); - } - function loadStyleSheets(callback, reload, modifyVars) { - for (var i_2 = 0; i_2 < less.sheets.length; i_2++) { - loadStyleSheet(less.sheets[i_2], callback, reload, less.sheets.length - (i_2 + 1), modifyVars); - } - } - function initRunningMode() { - if (less.env === 'development') { - less.watchTimer = setInterval(function () { - if (less.watchMode) { - fileManager.clearFileCache(); - /** - * @todo remove when this is typed with JSDoc - */ - // eslint-disable-next-line no-unused-vars - loadStyleSheets(function (e, css, _, sheet, webInfo) { - if (e) { - errors.add(e, e.href || sheet.href); - } - else if (css) { - browser.createCSS(window.document, css, sheet); - } - }); - } - }, options.poll); - } - } - // - // Watch mode - // - less.watch = function () { - if (!less.watchMode) { - less.env = 'development'; - initRunningMode(); - } - this.watchMode = true; - return true; - }; - less.unwatch = function () { clearInterval(less.watchTimer); this.watchMode = false; return false; }; - // - // Synchronously get all tags with the 'rel' attribute set to - // "stylesheet/less". - // - less.registerStylesheetsImmediately = function () { - var links = document.getElementsByTagName('link'); - less.sheets = []; - for (var i_3 = 0; i_3 < links.length; i_3++) { - if (links[i_3].rel === 'stylesheet/less' || (links[i_3].rel.match(/stylesheet/) && - (links[i_3].type.match(typePattern)))) { - less.sheets.push(links[i_3]); - } - } - }; - // - // Asynchronously get all tags with the 'rel' attribute set to - // "stylesheet/less", returning a Promise. - // - less.registerStylesheets = function () { return new Promise(function (resolve) { - less.registerStylesheetsImmediately(); - resolve(); - }); }; - // - // With this function, it's possible to alter variables and re-render - // CSS without reloading less-files - // - less.modifyVars = function (record) { return less.refresh(true, record, false); }; - less.refresh = function (reload, modifyVars, clearFileCache) { - if ((reload || clearFileCache) && clearFileCache !== false) { - fileManager.clearFileCache(); - } - return new Promise(function (resolve, reject) { - var startTime; - var endTime; - var totalMilliseconds; - var remainingSheets; - startTime = endTime = new Date(); - // Set counter for remaining unprocessed sheets - remainingSheets = less.sheets.length; - if (remainingSheets === 0) { - endTime = new Date(); - totalMilliseconds = endTime - startTime; - less.logger.info('Less has finished and no sheets were loaded.'); - resolve({ - startTime: startTime, - endTime: endTime, - totalMilliseconds: totalMilliseconds, - sheets: less.sheets.length - }); - } - else { - // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array - loadStyleSheets(function (e, css, _, sheet, webInfo) { - if (e) { - errors.add(e, e.href || sheet.href); - reject(e); - return; - } - if (webInfo.local) { - less.logger.info("Loading ".concat(sheet.href, " from cache.")); - } - else { - less.logger.info("Rendered ".concat(sheet.href, " successfully.")); - } - browser.createCSS(window.document, css, sheet); - less.logger.info("CSS for ".concat(sheet.href, " generated in ").concat(new Date() - endTime, "ms")); - // Count completed sheet - remainingSheets--; - // Check if the last remaining sheet was processed and then call the promise - if (remainingSheets === 0) { - totalMilliseconds = new Date() - startTime; - less.logger.info("Less has finished. CSS generated in ".concat(totalMilliseconds, "ms")); - resolve({ - startTime: startTime, - endTime: endTime, - totalMilliseconds: totalMilliseconds, - sheets: less.sheets.length - }); - } - endTime = new Date(); - }, reload, modifyVars); - } - loadStyles(modifyVars); - }); - }; - less.refreshStyles = loadStyles; - return less; - }); - - /** - * Kicks off less and compiles any stylesheets - * used in the browser distributed version of less - * to kick-start less using the browser api - */ - var options = defaultOptions(); - if (window.less) { - for (var key in window.less) { - if (Object.prototype.hasOwnProperty.call(window.less, key)) { - options[key] = window.less[key]; - } - } - } - addDefaultOptions(window, options); - options.plugins = options.plugins || []; - if (window.LESS_PLUGINS) { - options.plugins = options.plugins.concat(window.LESS_PLUGINS); - } - var less = root(window, options); - window.less = less; - var css; - var head; - var style; - // Always restore page visibility - function resolveOrReject(data) { - if (data.filename) { - console.warn(data); - } - if (!options.async) { - head.removeChild(style); - } - } - if (options.onReady) { - if (/!watch/.test(window.location.hash)) { - less.watch(); - } - // Simulate synchronous stylesheet loading by hiding page rendering - if (!options.async) { - css = 'body { display: none !important }'; - head = document.head || document.getElementsByTagName('head')[0]; - style = document.createElement('style'); - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = css; - } - else { - style.appendChild(document.createTextNode(css)); - } - head.appendChild(style); - } - less.registerStylesheetsImmediately(); - less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject); - } - - return less; - -})); diff --git a/dist/less.min.js b/dist/less.min.js deleted file mode 100644 index fb7147a09..000000000 --- a/dist/less.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Less - Leaner CSS v4.4.2 - * http://lesscss.org - * - * Copyright (c) 2009-2025, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - * @license Apache-2.0 - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).less=t()}(this,(function(){"use strict";function e(e){return e.replace(/^[a-z-]+:\/+?[^/]+/,"").replace(/[?&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^.\w-]+/g,"-").replace(/\./g,":")}function t(e,t){if(t)for(var n in t.dataset)if(Object.prototype.hasOwnProperty.call(t.dataset,n))if("env"===n||"dumpLineNumbers"===n||"rootpath"===n||"errorReporting"===n)e[n]=t.dataset[n];else try{e[n]=JSON.parse(t.dataset[n])}catch(e){}}var n=function(t,n,i){var r=i.href||"",s="less:".concat(i.title||e(r)),a=t.getElementById(s),o=!1,l=t.createElement("style");l.setAttribute("type","text/css"),i.media&&l.setAttribute("media",i.media),l.id=s,l.styleSheet||(l.appendChild(t.createTextNode(n)),o=null!==a&&a.childNodes.length>0&&l.childNodes.length>0&&a.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===a||!1===o){var c=i&&i.nextSibling||null;c?c.parentNode.insertBefore(l,c):u.appendChild(l)}if(a&&!1===o&&a.parentNode.removeChild(a),l.styleSheet)try{l.styleSheet.cssText=n}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},i=function(e){var t,n=e.document;return n.currentScript||(t=n.getElementsByTagName("script"))[t.length-1]},r={error:function(e){this._fireEvent("error",e)},warn:function(e){this._fireEvent("warn",e)},info:function(e){this._fireEvent("info",e)},debug:function(e){this._fireEvent("debug",e)},addListener:function(e){this._listeners.push(e)},removeListener:function(e){for(var t=0;t=0;o--){var l=a[o];if(l[s?"supportsSync":"supports"](e,t,n,i))return l}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o={length:{m:1,cm:.01,mm:.001,in:.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}},l={colors:a,unitConversions:o},u=function(){function e(){this.parent=null,this.visibilityBlocks=void 0,this.nodeVisible=void 0,this.rootNode=null,this.parsed=null}return Object.defineProperty(e.prototype,"currentFileInfo",{get:function(){return this.fileInfo()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.getIndex()},enumerable:!1,configurable:!0}),e.prototype.setParent=function(t,n){function i(t){t&&t instanceof e&&(t.parent=n)}Array.isArray(t)?t.forEach(i):i(t)},e.prototype.getIndex=function(){return this._index||this.parent&&this.parent.getIndex()||0},e.prototype.fileInfo=function(){return this._fileInfo||this.parent&&this.parent.fileInfo()||{}},e.prototype.isRulesetLike=function(){return!1},e.prototype.toCSS=function(e){var t=[];return this.genCSS(e,{add:function(e,n,i){t.push(e)},isEmpty:function(){return 0===t.length}}),t.join("")},e.prototype.genCSS=function(e,t){t.add(this.value)},e.prototype.accept=function(e){this.value=e.visit(this.value)},e.prototype.eval=function(){return this},e.prototype._operate=function(e,t,n,i){switch(t){case"+":return n+i;case"-":return n-i;case"*":return n*i;case"/":return n/i}},e.prototype.fround=function(e,t){var n=e&&e.numPrecision;return n?Number((t+2e-16).toFixed(n)):t},e.compare=function(t,n){if(t.compare&&"Quoted"!==n.type&&"Anonymous"!==n.type)return t.compare(n);if(n.compare)return-n.compare(t);if(t.type===n.type){if(t=t.value,n=n.value,!Array.isArray(t))return t===n?0:void 0;if(t.length===n.length){for(var i=0;it?1:void 0},e.prototype.blocksVisibility=function(){return void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},e.prototype.addVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},e.prototype.removeVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},e.prototype.ensureVisibility=function(){this.nodeVisible=!0},e.prototype.ensureInvisibility=function(){this.nodeVisible=!1},e.prototype.isVisible=function(){return this.nodeVisible},e.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},e.prototype.copyVisibilityInfo=function(e){e&&(this.visibilityBlocks=e.visibilityBlocks,this.nodeVisible=e.nodeVisible)},e}(),c=function(e,t,n){var i=this;Array.isArray(e)?this.rgb=e:e.length>=6?(this.rgb=[],e.match(/.{2}/g).map((function(e,t){t<3?i.rgb.push(parseInt(e,16)):i.alpha=parseInt(e,16)/255}))):(this.rgb=[],e.split("").map((function(e,t){t<3?i.rgb.push(parseInt(e+e,16)):i.alpha=parseInt(e+e,16)/255}))),this.alpha=this.alpha||("number"==typeof t?t:1),void 0!==n&&(this.value=n)};function h(e,t){return Math.min(Math.max(e,0),t)}function f(e){return"#".concat(e.map((function(e){return((e=h(Math.round(e),255))<16?"0":"")+e.toString(16)})).join(""))}c.prototype=Object.assign(new u,{type:"Color",luma:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},genCSS:function(e,t){t.add(this.toCSS(e))},toCSS:function(e,t){var n,i,r,s=e&&e.compress&&!t,a=[];if(i=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))i<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=i<1?"hsla":"hsl"}else i<1&&(r="rgba");switch(r){case"rgba":a=this.rgb.map((function(e){return h(Math.round(e),255)})).concat(h(i,1));break;case"hsla":a.push(h(i,1));case"hsl":n=this.toHSL(),a=[this.fround(e,n.h),"".concat(this.fround(e,100*n.s),"%"),"".concat(this.fround(e,100*n.l),"%")].concat(a)}if(r)return"".concat(r,"(").concat(a.join(",".concat(s?"":" ")),")");if(n=this.toRGB(),s){var o=n.split("");o[1]===o[2]&&o[3]===o[4]&&o[5]===o[6]&&(n="#".concat(o[1]).concat(o[3]).concat(o[5]))}return n},operate:function(e,t,n){for(var i=new Array(3),r=this.alpha*(1-n.alpha)+n.alpha,s=0;s<3;s++)i[s]=this._operate(e,t,this.rgb[s],n.rgb[s]);return new c(i,r)},toRGB:function(){return f(this.rgb)},toHSL:function(){var e,t,n=this.rgb[0]/255,i=this.rgb[1]/255,r=this.rgb[2]/255,s=this.alpha,a=Math.max(n,i,r),o=Math.min(n,i,r),l=(a+o)/2,u=a-o;if(a===o)e=t=0;else{switch(t=l>.5?u/(2-a-o):u/(a+o),a){case n:e=(i-r)/u+(iC(e,t));if("Object"!==S(n=e)||n.constructor!==Object||Object.getPrototypeOf(n)!==Object.prototype)return e;var n;return[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].reduce((n,i)=>{if(I(t.props)&&!t.props.includes(i))return n;return function(e,t,n,i,r){const s={}.propertyIsEnumerable.call(i,t)?"enumerable":"nonenumerable";"enumerable"===s&&(e[t]=n),r&&"nonenumerable"===s&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}(n,i,C(e[i],t),e,t.nonenumerable),n},{})}function k(e,t){for(var n=e+1,i=null,r=-1;--n>=0&&"\n"!==t.charAt(n);)r++;return"number"==typeof e&&(i=(t.slice(0,e).match(/\n/g)||"").length),{line:i,column:r}}function A(e){var t,n=e.length,i=new Array(n);for(t=0;t|Function):(\d+):(\d+)/,F=function(e,t,n){Error.call(this);var i=e.filename||n;if(this.message=e.message,this.stack=e.stack,t&&i){var r=t.contents[i],s=k(e.index,r),a=s.line,o=s.column,l=e.call&&k(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=i,this.index=e.index,this.line="number"==typeof a?a+1:null,this.column=o,!this.line&&this.stack){var c=this.stack.match($),h=new Function("a","throw new Error()"),f=0;try{h()}catch(e){var p=e.stack.match($);f=1-parseInt(p[2])}c&&(c[2]&&(this.line=parseInt(c[2])+f),c[3]&&(this.column=parseInt(c[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var V=function(){};V.prototype=Error.prototype,F.prototype=new V}else F.prototype=Object.create(Error.prototype);F.prototype.constructor=F,F.prototype.toString=function(e){var t;e=e||{};var n=(null!==(t=this.type)&&void 0!==t?t:"").toLowerCase().includes("warning"),i=n?this.type:"".concat(this.type,"Error"),r=n?"yellow":"red",s="",a=this.extract||[],o=[],l=function(e){return e};if(e.stylize){var u=typeof e.stylize;if("function"!==u)throw Error("options.stylize should be a function, got a ".concat(u,"!"));l=e.stylize}if(null!==this.line){if(n||"string"!=typeof a[0]||o.push(l("".concat(this.line-1," ").concat(a[0]),"grey")),"string"==typeof a[1]){var c="".concat(this.line," ");a[1]&&(c+=a[1].slice(0,this.column)+l(l(l(a[1].substr(this.column,1),"bold")+a[1].slice(this.column+1),"red"),"inverse")),o.push(c)}n||"string"!=typeof a[2]||o.push(l("".concat(this.line+1," ").concat(a[2]),"grey")),o="".concat(o.join("\n")+l("","reset"),"\n")}return s+=l("".concat(i,": ").concat(this.message),r),this.filename&&(s+=l(" in ",r)+this.filename),this.line&&(s+=l(" on line ".concat(this.line,", column ").concat(this.column+1,":"),"grey")),s+="\n".concat(o),this.callLine&&(s+="".concat(l("from ",r)+(this.filename||""),"/n"),s+="".concat(l(this.callLine,"grey")," ").concat(this.callExtract,"/n")),s};var L={visitDeeper:!0},j=!1;function D(e){return e}var N=function(){function e(e){this._implementation=e,this._visitInCache={},this._visitOutCache={},j||(!function e(t,n){var i,r;for(i in t)switch(typeof(r=t[i])){case"function":r.prototype&&r.prototype.type&&(r.prototype.typeIndex=n++);break;case"object":n=e(r,n)}return n}(Ke,1),j=!0)}return e.prototype.visit=function(e){if(!e)return e;var t=e.typeIndex;if(!t)return e.value&&e.value.typeIndex&&this.visit(e.value),e;var n,i=this._implementation,r=this._visitInCache[t],s=this._visitOutCache[t],a=L;if(a.visitDeeper=!0,r||(r=i[n="visit".concat(e.type)]||D,s=i["".concat(n,"Out")]||D,this._visitInCache[t]=r,this._visitOutCache[t]=s),r!==D){var o=r.call(i,e,a);e&&i.isReplacing&&(e=o)}if(a.visitDeeper&&e)if(e.length)for(var l=0,u=e.length;ly.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},B.Eval.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===w?G:z)(e)},B.Eval.prototype.rewritePath=function(e,t){var n;return t=t||"",n=this.normalizePath(t+e),G(e)&&z(t)&&!1===G(n)&&(n="./".concat(n)),n},B.Eval.prototype.normalizePath=function(e){var t,n=e.split("/").reverse();for(e=[];0!==n.length;)switch(t=n.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")};var W=function(){function e(e){this.imports=[],this.variableImports=[],this._onSequencerEmpty=e,this._currentDepth=0}return e.prototype.addImport=function(e){var t=this,n={callback:e,args:null,isReady:!1};return this.imports.push(n),function(){n.args=Array.prototype.slice.call(arguments,0),n.isReady=!0,t.tryRun()}},e.prototype.addVariableImport=function(e){this.variableImports.push(e)},e.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),J=function(e,t){this._visitor=new N(this),this._importer=e,this._finish=t,this.context=new B.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new W(this._onSequencerEmpty.bind(this))};J.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var n=e.options.inline;if(!e.css||n){var i=new B.Eval(this.context,A(this.context.frames)),r=i.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,i,r)):this.processImportNode(e,i,r)}t.visitDeeper=!1},processImportNode:function(e,t,n){var i,r=e.options.inline;try{i=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!i||i.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{i.options.multiple&&(t.importMultiple=!0);for(var s=void 0===i.css,a=0;a=0||(o=[u.selfSelectors[0]],(s=f.findMatch(l,o)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();a=f.extendSelector(s,o,e,l.isVisible()),(c=new Ke.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=a,a[a.length-1].extendList=[c],h.push(c),c.ruleset=u.ruleset,c.parent_ids=c.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(c.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(a))}))));if(h.length){if(this.extendChainCount++,n>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=h[0].selfSelectors[0].toCSS(),v=h[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:".concat(p,":extend(").concat(v,")")}}return h.concat(f.doExtendChaining(h,t,n+1))}return h},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var n,i,r,s,a=this.allExtendsStack[this.allExtendsStack.length-1],o=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==a?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&c>0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),c=0,u++),l=s.elements.slice(c,o.index).concat([a]).concat(n.elements.slice(1)),u===o.pathIndex&&r>0?h[h.length-1].elements=h[h.length-1].elements.concat(l):(h=h.concat(t.slice(u,o.pathIndex))).push(new Ke.Selector(l)),u=o.endPathIndex,(c=o.endPathElementIndex)>=t[u].elements.length&&(c=0,u++);return u0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),u++),h=(h=h.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return i?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.visitMedia=function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),Z=function(){function e(){this.contexts=[[]],this._visitor=new N(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var n,i=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((n=e.selectors)&&(n=n.filter((function(e){return e.getIsOutput()})),e.selectors=n.length?n:n=null,n&&e.joinSelectors(r,i,n)),n||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var n=this.contexts[this.contexts.length-1];e.rules[0].root=0===n.length||n[0].multiMedia},e.prototype.visitAtRule=function(e,t){var n=this.contexts[this.contexts.length-1];e.declarations&&e.declarations.length?e.declarations[0].root=0===n.length||n[0].multiMedia:e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===n.length||null)},e}(),X=function(){function e(e){this._visitor=new N(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var n=0;n0},e.prototype.resolveVisibility=function(e){if(!e.blocksVisibility()){if(this.isEmpty(e))return;return e}var t=e.rules[0];if(this.keepOnlyVisibleChilds(t),!this.isEmpty(t))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),Y=function(e){this._visitor=new N(this),this._context=e,this.utils=new X(e)};Y.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var n=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,n)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var n=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,n)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var n=new Ke.Comment("/* ".concat(e.toCSS(this._context).replace(/\n/g,"")," */\n"));return n.debugInfo=e.debugInfo,this._visitor.visit(n)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var n=0;n0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),i.splice(0,0,e)),1===i.length?i[0]:i},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new Ke.Combinator("")),t=0;t=0;i--)if((n=e[i])instanceof Ke.Declaration)if(r[n.name]){(t=r[n.name])instanceof Ke.Declaration&&(t=r[n.name]=[r[n.name].toCSS(this._context)]);var s=n.toCSS(this._context);-1!==t.indexOf(s)?e.splice(i,1):t.push(s)}else r[n.name]=n}},_mergeRules:function(e){if(e){for(var t={},n=[],i=0;i0){var t=e[0],n=[],i=[new Ke.Expression(n)];e.forEach((function(e){"+"===e.merge&&n.length>0&&i.push(new Ke.Expression(n=[])),n.push(e.value),t.important=t.important||e.important})),t.value=new Ke.Value(i)}}))}}};var ee={Visitor:N,ImportVisitor:J,MarkVisibleSelectorsVisitor:K,ExtendVisitor:Q,JoinSelectorVisitor:Z,ToCSSVisitor:Y};var te=function(){var e,t,n,i,r,s,a,o=[],l={};function u(n){for(var i,o,c,h=l.i,f=t,p=l.i-a,v=l.i+s.length-p,d=l.i+=n,m=e;l.i=0){c={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=c.text.length-1,l.commentStore.push(c);continue}}break}if(32!==i&&10!==i&&9!==i&&13!==i)break}if(s=s.slice(n+l.i-d+p),a=l.i,!s.length){if(tn||l.i===n&&e&&!i)&&(n=l.i,i=e);var r=o.pop();s=r.current,a=l.i=r.i,t=r.j},l.forget=function(){o.pop()},l.isWhitespace=function(t){var n=l.i+(t||0),i=e.charCodeAt(n);return 32===i||13===i||9===i||10===i},l.$re=function(e){l.i>a&&(s=s.slice(l.i-a),a=l.i);var t=e.exec(s);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$peekChar=function(t){return e.charAt(l.i)!==t?null:t},l.$str=function(t){for(var n=t.length,i=0;ih&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var n=0;n57||t<43||47===t||44===t},l.start=function(i,o,c){e=i,l.i=t=a=n=0,r=o?function(e,t){var n,i,r,s,a,o,l,u,c,h=e.length,f=0,p=0,v=[],d=0;function m(t){var n=a-d;n<512&&!t||!n||(v.push(e.slice(d,a+1)),d=a+1)}for(a=0;a=97&&l<=122||l<34))switch(l){case 40:p++,i=a;continue;case 41:if(--p<0)return t("missing opening `(`",a);continue;case 59:p||m();continue;case 123:f++,n=a;continue;case 125:if(--f<0)return t("missing opening `{`",a);f||p||m();continue;case 92:if(a96)){if(u==l){c=1;break}if(92==u){if(a==h-1)return t("unescaped `\\`",a);a++}}if(c)continue;return t("unmatched `".concat(String.fromCharCode(l),"`"),o);case 47:if(p||a==h-1)continue;if(47==(u=e.charCodeAt(a+1)))for(a+=2;an&&s>r?"missing closing `}` or `*/`":"missing closing `}`",n):0!==p?t("missing closing `)`",i):(m(!0),v)}(i,c):[i],s=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l};var ne=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(n){t.add(n,e[n])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),ie={queryInParens:!0},re={queryInParens:!0},se=function(e,t,n,i,r,s){this.value=e,this._index=t,this._fileInfo=n,this.mapLines=i,this.rulesetLike=void 0!==r&&r,this.allowRoot=!0,this.copyVisibilityInfo(s)};se.prototype=Object.assign(new u,{type:"Anonymous",eval:function(){return new se(this.value,this._index,this._fileInfo,this.mapLines,this.rulesetLike,this.visibilityInfo())},compare:function(e){return e.toCSS&&this.toCSS()===e.toCSS()?0:void 0},isRulesetLike:function(){return this.rulesetLike},genCSS:function(e,t){this.nodeVisible=Boolean(this.value),this.nodeVisible&&t.add(this.value,this._fileInfo,this._index,this.mapLines)}});var ae=function e(t,n,i,s){var a;s=s||0;var o=te();function l(e,t){throw new F({index:o.i,filename:i.filename,type:t||"Syntax",message:e},n)}function u(e,s,a){t.quiet||r.warn(new F({index:null!=s?s:o.i,filename:i.filename,type:a?"".concat(a.toUpperCase()," WARNING"):"WARNING",message:e},n).toString())}function c(e,t){var n=e instanceof Function?e.call(a):o.$re(e);if(n)return n;l(t||("string"==typeof e?"expected '".concat(e,"' got '").concat(o.currentChar(),"'"):"unexpected token"))}function h(e,t){if(o.$char(e))return e;l(t||"expected '".concat(e,"' got '").concat(o.currentChar(),"'"))}function f(e){var t=i.filename;return{lineNumber:k(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:n,fileInfo:i,parseNode:function(e,t,r){var l,u=[],c=o;try{c.start(e,!1,(function(e,t){r({message:e,index:t+s})}));for(var h=0,f=void 0;f=t[h];h++)l=a[f](),u.push(l||null);c.end().isFinished?r(null,u):r(!0,null)}catch(e){throw new F({index:e.index+s,message:e.message},n,i.filename)}},parse:function(r,s,u){var c,h,f,p,v=null,d="";if(u&&u.disablePluginRule&&(a.plugin=function(){o.$re(/^@plugin?\s+/)&&l("@plugin statements are not allowed when disablePluginRule is set to true")}),h=u&&u.globalVars?"".concat(e.serializeVars(u.globalVars),"\n"):"",f=u&&u.modifyVars?"\n".concat(e.serializeVars(u.modifyVars)):"",t.pluginManager)for(var m=t.pluginManager.getPreProcessors(),g=0;g");return e},args:function(e){var t,n,i,r,s,u,c,h=a.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=a.detachedRuleset()||a.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=h.variable()||h.property()||h.literal()||h.keyword()||this.call(!0)}if(!u||!m)break;r=null,u.throwAwayComments&&u.throwAwayComments(),s=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof Ke.Variable||g instanceof Ke.Property))if(o.$char(":")){if(p.length>0&&(t&&l("Cannot mix ; and , as delimiter types"),n=!0),!(s=a.detachedRuleset()||a.expression())){if(!e)return o.restore(),f.args=[],f;l("could not understand value for named argument")}r=i=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}c=!0}else e||(i=r=g.name,s=null);s&&p.push(s),d.push({name:r,value:s,expand:c}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(n&&l("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(s=new Ke.Value(p)),v.push({name:i,value:s,expand:c}),i=null,p=[],n=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,n,i,r=[],s=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var l=this.args(!1);if(r=l.args,s=l.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(i=c(a.conditions,"expected condition")),n=a.block())return o.forget(),new Ke.mixin.Definition(e,r,n,i,s);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e=c(a.entities.variable,"Could not parse alpha"),e="@{".concat(e.name.slice(1),"}")),h(")"),new Ke.Quoted("","alpha(opacity=".concat(e,")"))},element:function(){var e,t,n,r=o.i;if(t=this.combinator(),!(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[.#:](?=@)/)||this.entities.variableCurly()))if(o.save(),o.$char("("))if(n=this.selector(!1)){for(var a=[];o.$char(",");)a.push(n),a.push(new se(",")),n=this.selector(!1);a.push(n),o.$char(")")?(e=a.length>1?new Ke.Paren(new oe(a)):new Ke.Paren(n),o.forget()):o.restore("Missing closing ')'")}else o.restore("Missing closing ')'");else o.forget();if(e)return new Ke.Element(t,e,e instanceof Ke.Variable,r+s,i)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new Ke.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new Ke.Combinator(e)}return o.isWhitespace(-1)?new Ke.Combinator(" "):new Ke.Combinator(null)},selector:function(e){var t,n,r,a,u,h,f,p=o.i;for(e=!1!==e;(e&&(n=this.extend())||e&&(h=o.$str("when"))||(a=this.element()))&&(h?f=c(this.conditions,"expected condition"):f?l("CSS guard can only be used at the end of selector"):n?u=u?u.concat(n):n:(u&&l("Extend can only be used at the end of selector"),r=o.currentChar(),Array.isArray(a)&&a.forEach((function(e){return t.push(e)})),t?t.push(a):t=[a],a=null),"{"!==r&&"}"!==r&&";"!==r&&","!==r&&")"!==r););if(t)return new Ke.Selector(t,u,f,p+s,i);u&&l("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&l("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,n,i,r=this.entities;return(e=r.variableCurly())||(e=c(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(n=o.$re(/^[|~*$^]?=/))&&(t=r.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||r.variableCurly())&&(i=o.$re(/^[iIsS]/)),h("]"),new Ke.Attribute(e,n,t,i)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new Ke.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,n;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,n=e.variadic,o.$char(")"))){var i=this.blockRuleset();if(i)return o.forget(),t?new Ke.mixin.Definition(null,t,i,null,n):new Ke.DetachedRuleset(i);o.restore()}else o.restore()},ruleset:function(){var e,n,i;if(o.save(),t.dumpLineNumbers&&(i=f(o.i)),(e=this.selectors())&&(n=this.block())){o.forget();var r=new Ke.Ruleset(e,n,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=i),r}o.restore()},declaration:function(){var e,t,n,r,a,l,u=o.i,c=o.currentChar();if("."!==c&&"#"!==c&&"&"!==c&&":"!==c)if(o.save(),e=this.variable()||this.ruleProperty()){if((l="string"==typeof e)&&(t=this.detachedRuleset())&&(n=!0),o.commentStore.length=0,!t){if(a=!l&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?o.$char(";")?new se(""):this.permissiveValue(/[;}]/,!0):this.anonymousValue())return o.forget(),new Ke.Declaration(e,t,!1,a,u+s,i);t||(t=this.value()),t?r=this.important():l&&(t=this.permissiveValue())}if(t&&(this.end()||n))return o.forget(),new Ke.Declaration(e,t,r,a,u+s,i);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@$+/'"*`(;{}-]*);/);if(t)return new Ke.Anonymous(t[1],e+s)},permissiveValue:function(e){var t,n,r,s,a=e||";",c=o.i,h=[];function f(){var e=o.currentChar();return"string"==typeof a?e===a:a.test(e)}if(!f()){s=[];do{(n=this.comment())?s.push(n):((n=this.entity())&&s.push(n),o.peek(",")&&(s.push(new Ke.Anonymous(",",o.i)),o.$char(",")))}while(n);if(r=f(),s.length>0){if(s=new Ke.Expression(s),r)return s;h.push(s)," "===o.prevChar()&&h.push(new Ke.Anonymous(" ",c))}if(o.save(),s=o.$parseUntil(a)){if("string"==typeof s&&l("Expected '".concat(s,"'"),"Parse"),1===s.length&&" "===s[0])return o.forget(),new Ke.Anonymous("",c);var p=void 0;for(t=0;t]=|<=|>=|[<>]|=)/)?(o.restore(),n=this.condition(),o.save(),(r=this.atomicCondition(null,n.rvalue))||o.restore()):(o.restore(),t=this.value()),o.$char(")")?n&&!t?(u.push(new Ke.Paren(new Ke.QueryInParens(n.op,n.lvalue,n.rvalue,r?r.op:null,r?r.rvalue:null,n._index))),t=n):n&&t?(u.push(new Ke.Paren(new Ke.Declaration(n,t,null,null,o.i+s,i,!0))),c||(u[u.length-1].noSpacing=!0),c=!1):t?(u.push(new Ke.Paren(t)),c=!1):l("badly formed media feature definition"):l("Missing closing ')'","Parse"))}while(t);if(o.forget(),u.length>0)return new Ke.Expression(u)},mediaFeatures:function(e){var t,n=this.entities,i=[];do{if(t=this.mediaFeature(e)){if(i.push(t),!o.$char(","))break;i[i.length-1].noSpacing||(i[i.length-1].noSpacing=!1)}else if(t=n.variable()||n.mixinLookup()){if(i.push(t),!o.$char(","))break;i[i.length-1].noSpacing||(i[i.length-1].noSpacing=!1)}}while(t);return i.length>0?i:null},prepareAndGetNestableAtRule:function(e,n,r,a){var u=this.mediaFeatures(a),c=this.block();c||l("media definitions require block statements after any features"),o.forget();var h=new e(c,u,n+s,i);return t.dumpLineNumbers&&(h.debugInfo=r),h},nestableAtRule:function(){var e,n=o.i;if(t.dumpLineNumbers&&(e=f(n)),o.save(),o.$peekChar("@")){if(o.$str("@media"))return this.prepareAndGetNestableAtRule(Ke.Media,n,e,ie);if(o.$str("@container"))return this.prepareAndGetNestableAtRule(Ke.Container,n,e,re)}o.restore()},plugin:function(){var e,t,n,r=o.i;if(o.$re(/^@plugin\s+/)){if(n=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=r,l("missing semi-colon on @plugin")),new Ke.Import(e,null,n,r+s,i);o.i=r,l("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atruleUnknown:function(e,t,n){return e=this.permissiveValue(/^[{;]/),n="{"===o.currentChar(),e?e.value||(e=null):n||";"===o.currentChar()||l("".concat(t," rule is missing block or ending semi-colon")),[e,n]},atruleBlock:function(e,t,n,i){if(e=this.blockRuleset(),o.save(),e||n||(t=this.entity(),e=this.blockRuleset()),e||n)o.forget();else{o.restore();var r=[];for(t=this.entity();o.$char(",");)r.push(t),t=this.entity();t&&r.length>0?(r.push(t),t=r,i=!0):e=this.blockRuleset()}return[e,t,i]},atrule:function(){var e,n,r,a,u,c,h,p=o.i,v=!0,d=!0,m=!1;if("@"===o.currentChar()){if(n=this.import()||this.plugin()||this.nestableAtRule())return n;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(a=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(a="@".concat(e.slice(e.indexOf("-",2)+1))),a){case"@charset":u=!0,v=!1;break;case"@namespace":c=!0,v=!1;break;case"@keyframes":case"@counter-style":u=!0;break;case"@document":case"@supports":h=!0,d=!1;break;case"@starting-style":case"@layer":d=!1;break;default:h=!0}if(o.commentStore.length=0,u)(n=this.entity())||l("expected ".concat(e," identifier"));else if(c)(n=this.expression())||l("expected ".concat(e," expression"));else if(h){n=(g=this.atruleUnknown(n,e,v))[0],v=g[1]}if(v){var g,y=this.atruleBlock(r,n,d,m);if(r=y[0],n=y[1],m=y[2],!r&&!h)o.restore(),e=o.$re(/^@[a-z-]+/),n=(g=this.atruleUnknown(n,e,v))[0],(v=g[1])&&(r=(y=this.atruleBlock(r,n,d,m))[0],n=y[1],m=y[2])}if(r||m||!v&&n&&o.$char(";"))return o.forget(),new Ke.AtRule(e,n,r,p+s,i,t.dumpLineNumbers?f(p):null,d);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],n=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new Ke.Value(t,n+s)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new Ke.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},colorOperand:function(){o.save();var e=o.$re(/^[lchrgbs]\s+/);if(e)return new Ke.Keyword(e[0]);o.restore()},multiplication:function(){var e,t,n,i,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*/]/);){if(o.save(),!(n=o.$char("/")||o.$char("*"))){var s=o.i;(n=o.$str("./"))&&u("./ operator is deprecated",s,"DEPRECATED")}if(!n){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,i=new Ke.Operation(n,[i||e,t],r),r=o.isWhitespace(-1)}return i||e}},addition:function(){var e,t,n,i,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(n=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,i=new Ke.Operation(n,[i||e,t],r),r=o.isWhitespace(-1);return i||e}},conditions:function(){var e,t,n,i=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)n=new Ke.Condition("or",n||e,t,i+s);return n||e}},condition:function(e){var t,n,i;if(t=this.conditionAnd(e)){if(n=o.$str("or")){if(!(i=this.condition(e)))return;t=new Ke.Condition(n,t,i)}return t}},conditionAnd:function(e){var t,n,i,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(n=o.$str("and")){if(!(i=this.conditionAnd(e)))return;t=new Ke.Condition(n,t,i)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var n;if(o.save(),n=t.condition(e)){if(o.$char(")"))return o.forget(),n;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '".concat(o.currentChar(),"'"))}else o.restore()}else o.restore()},atomicCondition:function(e,t){var n,i,r,a,u=this.entities,c=o.i,h=function(){return this.addition()||u.keyword()||u.quoted()||u.mixinLookup()}.bind(this);if(n=t||h())return o.$char(">")?a=o.$char("=")?">=":">":o.$char("<")?a=o.$char("=")?"<=":"<":o.$char("=")&&(a=o.$char(">")?"=>":o.$char("<")?"=<":"="),a?(i=h())?r=new Ke.Condition(a,n,i,c+s,!1):l("expected expression"):t||(r=new Ke.Condition("=",n,new Ke.Keyword("true"),c+s,!1)),r},operand:function(){var e,t=this.entities;o.peek(/^-[@$(]/)&&(e=o.$char("-"));var n=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||this.colorOperand()||t.mixinLookup();return e&&(n.parensInOp=!0,n=new Ke.Negative(n)),n},expression:function(){var e,t,n=[],i=o.i;do{!(e=this.comment())||e.isLineComment?((e=this.addition()||this.entity())instanceof Ke.Comment&&(e=null),e&&(n.push(e),o.peek(/^\/[/*]/)||(t=o.$char("/"))&&n.push(new Ke.Anonymous(t,i+s)))):n.push(e)}while(e);if(n.length>0)return new Ke.Expression(n)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,n=[],r=[];o.save();var a=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(a)return n=[new Ke.Keyword(a[1])],o.forget(),n;function l(e){var t=o.i,i=o.$re(e);if(i)return r.push(t),n.push(i[1])}for(l(/^(\*?)/);l(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/););if(n.length>1&&l(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===n[0]&&(n.shift(),r.shift()),t=0;t0;e--){var t=this.rules[e-1];if(t instanceof he)return this.parseValue(t)}},parseValue:function(e){var t=this;function n(e){return e.value instanceof se&&!e.parsed?("string"==typeof e.value.value?new ae(this.parse.context,this.parse.importManager,e.fileInfo(),e.value.getIndex()).parseNode(e.value.value,["value","important"],(function(t,n){t&&(e.parsed=!0),n&&(e.value=n[0],e.important=n[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var i=[];return e.forEach((function(e){i.push(n.call(t,e))})),i}return n.call(t,e)},rulesets:function(){if(!this.rules)return[];var e,t,n=[],i=this.rules;for(e=0;t=i[e];e++)t.isRuleset&&n.push(t);return n},prependRule:function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},find:function(e,t,n){t=t||this;var i,r,s=[],a=e.toCSS();return a in this._lookups?this._lookups[a]:(this.rulesets().forEach((function(a){if(a!==t)for(var o=0;oi){if(!n||n(a)){r=a.find(new oe(e.elements.slice(i)),t,n);for(var l=0;l0&&t.add(l),e.firstSelector=!0,a[0].genCSS(e,t),e.firstSelector=!1,i=1;i0?(s=(r=A(e)).pop(),a=i.createDerived(A(s.elements))):a=i.createDerived([]),t.length>0){var o=n.combinator,l=t[0].elements[0];o.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(o=l.combinator),a.elements.push(new g(o,l.value,n.isVariable,n._index,n._fileInfo)),a.elements=a.elements.concat(t[0].elements.slice(1))}if(0!==a.elements.length&&r.push(a),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function a(e,t,n,i,r){var a;for(a=0;a0?i[i.length-1]=i[i.length-1].createDerived(i[i.length-1].elements.concat(e)):i.push(new oe(e));else t.push([new oe(e)])}function l(e,t){var n=t.createDerived(t.elements,t.extendList,t.evaldCondition);return n.copyVisibilityInfo(e),n}var u,c;if(!function e(t,n,l){var u,c,h,f,p,d,m,y,b,w,x,S,I=!1;for(f=[],p=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof v&&(S=x.value.value)instanceof oe?S:null);if(null!==C){o(f,p);var k,A=[],_=[];for(k=e(A,n,C),I=I||k,h=0;h0&&m[0].elements.push(new g(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(m);else for(h=0;h0&&(t.push(p[u]),w=p[u][b-1],p[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(c=[],t,n))if(t.length>0)for(c=[],u=0;u0)for(t=0;t-1e-6&&(i=n.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===n&&this.unit.isLength())return void t.add(i);n>0&&n<1&&(i=i.substr(1))}t.add(i),this.unit.genCSS(e,t)},operate:function(e,t,n){var i=this._operate(e,t,this.value,n.value),r=this.unit.clone();if("+"===t||"-"===t)if(0===r.numerator.length&&0===r.denominator.length)r=n.unit.clone(),this.unit.backupUnit&&(r.backupUnit=this.unit.backupUnit);else if(0===n.unit.numerator.length&&0===r.denominator.length);else{if(n=n.convertTo(this.unit.usedUnits()),e.strictUnits&&n.unit.toString()!==r.toString())throw new Error("Incompatible units. Change the units or use the unit function. "+"Bad units: '".concat(r.toString(),"' and '").concat(n.unit.toString(),"'."));i=this._operate(e,t,this.value,n.value)}else"*"===t?(r.numerator=r.numerator.concat(n.unit.numerator).sort(),r.denominator=r.denominator.concat(n.unit.denominator).sort(),r.cancel()):"/"===t&&(r.numerator=r.numerator.concat(n.unit.denominator).sort(),r.denominator=r.denominator.concat(n.unit.numerator).sort(),r.cancel());return new be(i,r)},compare:function(e){var t,n;if(e instanceof be){if(this.unit.isEmpty()||e.unit.isEmpty())t=this,n=e;else if(t=this.unify(),n=e.unify(),0!==t.unit.compare(n.unit))return;return u.numericCompare(t.value,n.value)}},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(e){var t,n,i,r,s,a=this.value,l=this.unit.clone(),u={};if("string"==typeof e){for(t in o)o[t].hasOwnProperty(e)&&((u={})[t]=e);e=u}for(n in s=function(e,t){return i.hasOwnProperty(e)?(t?a/=i[e]/i[r]:a*=i[e]/i[r],r):e},e)e.hasOwnProperty(n)&&(r=e[n],i=o[n],l.map(s));return l.cancel(),new be(a,l)}});var we=function(e,t){if(this.value=e,this.noSpacing=t,!e)throw new Error("Expression requires an array parameter")};we.prototype=Object.assign(new u,{type:"Expression",accept:function(e){this.value=e.visitArray(this.value)},eval:function(e){var t,n=this.noSpacing,i=e.isMathOn(),r=this.parens,s=!1;return r&&e.inParenthesis(),this.value.length>1?t=new we(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(s=!0),t=this.value[0].eval(e)):t=this,r&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||s||t instanceof be||(t=new v(t)),t.noSpacing=t.noSpacing||n,t},genCSS:function(e,t){for(var n=0;n1){var n=new oe([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new ge(n,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},evalNested:function(e){var t,n;this.evalFunction();var i=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new se("and"));return new we(e)}))),this.setParent(this.features,this),new ge([],[])},permute:function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],n=this.permute(e.slice(1)),i=0;i0)for(var o=function(t){var o=e.frames[t];if("Ruleset"===o.type&&o.rules&&o.rules.length>0&&o&&!o.root&&o.selectors&&o.selectors.length>0&&(a=a.concat(o.selectors)),a.length>0){for(var l="",u={add:function(e){l+=e}},c=0;c0&&i>0&&!s&&!r;return(this.isRooted&&n>0&&0===i&&!s&&r||!u)&&(t[0].root=!0),t},variable:function(e){if(this.rules)return ge.prototype.variable.call(this.rules[0],e)},find:function(){if(this.rules)return ge.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){if(this.rules)return ge.prototype.rulesets.apply(this.rules[0])},outputRuleset:function(e,t,n){var i,r=n.length;if(e.tabLevel=1+(0|e.tabLevel),e.compress){for(t.add("{"),i=0;i=1)if("Expression"===(o=r[0]).type&&Array.isArray(o.value)&&o.value.length>=2)"Keyword"===(r=o.value)[0].type&&"layer"===r[0].value&&"Paren"===r[1].type&&(this.css=!1)}if(this.options.inline){var s=new se(this.root,0,{filename:this.importedFilename,reference:this.path._fileInfo&&this.path._fileInfo.reference},!0,!0);return this.features?new $e([s],this.features.value):[s]}if(this.css||this.layerCss){var a=new Fe(this.evalPath(e),i,this.options,this._index);if(this.layerCss&&(a.css=this.layerCss,a.path._fileInfo=this._fileInfo),!a.css&&this.error)throw this.error;return a}if(this.root){if(this.features){var o;r=this.features.value;if(Array.isArray(r)&&1===r.length)if("Expression"===(o=r[0]).type&&Array.isArray(o.value)&&o.value.length>=2)if("Keyword"===(r=o.value)[0].type&&"layer"===r[0].value&&"Paren"===r[1].type)return this.layerCss=!0,r[0]=new we(r.slice(0,2)),r.splice(1,1),r[0].noSpacing=!0,this}return(t=new ge(null,A(this.root.rules))).evalImports(e),this.features?new $e(t.rules,this.features.value):t.rules}if(this.features){r=this.features.value;if(Array.isArray(r)&&r.length>=1)if(r=r[0].value,Array.isArray(r)&&r.length>=2)if("Keyword"===r[0].type&&"layer"===r[0].value&&"Paren"===r[1].type)return this.css=!0,r[0]=new we(r.slice(0,2)),r.splice(1,1),r[0].noSpacing=!0,this}return[]}});var Ve=function(){};Ve.prototype=Object.assign(new u,{evaluateJavaScript:function(e,t){var n,i=this,r={};if(!t.javascriptEnabled)throw{message:"Inline JavaScript is not enabled. Is it set in your options?",filename:this.fileInfo().filename,index:this.getIndex()};e=e.replace(/@\{([\w-]+)\}/g,(function(e,n){return i.jsify(new Pe("@".concat(n),i.getIndex(),i.fileInfo()).eval(t))}));try{e=new Function("return (".concat(e,")"))}catch(t){throw{message:"JavaScript evaluation error: ".concat(t.message," from `").concat(e,"`"),filename:this.fileInfo().filename,index:this.getIndex()}}var s=t.frames[0].variables();for(var a in s)s.hasOwnProperty(a)&&(r[a.slice(1)]={value:s[a].value,toJS:function(){return this.value.eval(t).toCSS()}});try{n=e.call(r)}catch(e){throw{message:"JavaScript evaluation error: '".concat(e.name,": ").concat(e.message.replace(/["]/g,"'"),"'"),filename:this.fileInfo().filename,index:this.getIndex()}}return n},jsify:function(e){return Array.isArray(e.value)&&e.value.length>1?"[".concat(e.value.map((function(e){return e.toCSS()})).join(", "),"]"):e.toCSS()}});var Le=function(e,t,n,i){this.escaped=t,this.expression=e,this._index=n,this._fileInfo=i};Le.prototype=Object.assign(new Ve,{type:"JavaScript",eval:function(e){var t=this.evaluateJavaScript(this.expression,e),n=typeof t;return"number"!==n||isNaN(t)?"string"===n?new Me('"'.concat(t,'"'),t,this.escaped,this._index):Array.isArray(t)?new se(t.join(", ")):new se(t):new be(t)}});var je=function(e,t){this.key=e,this.value=t};je.prototype=Object.assign(new u,{type:"Assignment",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval?new je(this.key,this.value.eval(e)):this},genCSS:function(e,t){t.add("".concat(this.key,"=")),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)}});var De=function(e,t,n,i,r){this.op=e.trim(),this.lvalue=t,this.rvalue=n,this._index=i,this.negate=r};De.prototype=Object.assign(new u,{type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=function(e,t,n){switch(e){case"and":return t&&n;case"or":return t||n;default:switch(u.compare(t,n)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t}});var Ne=function(e,t,n,i,r,s){this.op=e.trim(),this.lvalue=t,this.mvalue=n,this.op2=i?i.trim():null,this.rvalue=r,this._index=s,this.mvalues=[]};Ne.prototype=Object.assign(new u,{type:"QueryInParens",accept:function(e){this.lvalue=e.visit(this.lvalue),this.mvalue=e.visit(this.mvalue),this.rvalue&&(this.rvalue=e.visit(this.rvalue))},eval:function(e){var t,n;this.lvalue=this.lvalue.eval(e);for(var i=0;(n=e.frames[i])&&("Ruleset"!==n.type||!(t=n.rules.find((function(e){return!!(e instanceof he&&e.variable)}))));i++);return this.mvalueCopy||(this.mvalueCopy=C(this.mvalue)),t?(this.mvalue=this.mvalueCopy,this.mvalue=this.mvalue.eval(e),this.mvalues.push(this.mvalue)):this.mvalue=this.mvalue.eval(e),this.rvalue&&(this.rvalue=this.rvalue.eval(e)),this},genCSS:function(e,t){this.lvalue.genCSS(e,t),t.add(" "+this.op+" "),this.mvalues.length>0&&(this.mvalue=this.mvalues.shift()),this.mvalue.genCSS(e,t),this.rvalue&&(t.add(" "+this.op2+" "),this.rvalue.genCSS(e,t))}});var Be=function(e,t,n,i,r){this._index=n,this._fileInfo=i;var s=new oe([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new le(t),this.rules=[new ge(s,e)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(r),this.allowRoot=!0,this.setParent(s,this),this.setParent(this.features,this),this.setParent(this.rules,this)};Be.prototype=Object.assign(new Se,p(p({type:"Container"},xe),{genCSS:function(e,t){t.add("@container ",this._fileInfo,this._index),this.features.genCSS(e,t),this.outputRuleset(e,t,this.rules)},eval:function(e){e.mediaBlocks||(e.mediaBlocks=[],e.mediaPath=[]);var t=new Be(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,t.debugInfo=this.debugInfo),t.features=this.features.eval(e),e.mediaPath.push(t),e.mediaBlocks.push(t),this.rules[0].functionRegistry=e.frames[0].functionRegistry.inherit(),e.frames.unshift(this.rules[0]),t.rules=[this.rules[0].eval(e)],e.frames.shift(),e.mediaPath.pop(),0===e.mediaPath.length?t.evalTop(e):t.evalNested(e)}}));var Ue=function(e){this.value=e};Ue.prototype=Object.assign(new u,{type:"UnicodeDescriptor"});var qe=function(e){this.value=e};qe.prototype=Object.assign(new u,{type:"Negative",genCSS:function(e,t){t.add("-"),this.value.genCSS(e,t)},eval:function(e){return e.isMathOn()?new ke("*",[new be(-1),this.value]).eval(e):new qe(this.value.eval(e))}});var Te=function(e,t,n,i,r){switch(this.selector=e,this.option=t,this.object_id=Te.next_id++,this.parent_ids=[this.object_id],this._index=n,this._fileInfo=i,this.copyVisibilityInfo(r),this.allowRoot=!0,t){case"!all":case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}this.setParent(this.selector,this)};Te.prototype=Object.assign(new u,{type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(e){return new Te(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},clone:function(e){return new Te(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},findSelfSelectors:function(e){var t,n,i=[];for(t=0;t0&&n.length&&""===n[0].combinator.value&&(n[0].combinator.value=" "),i=i.concat(e[t].elements);this.selfSelectors=[new oe(i)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())}}),Te.next_id=0;var ze=function(e,t,n){this.variable=e,this._index=t,this._fileInfo=n,this.allowRoot=!0};ze.prototype=Object.assign(new u,{type:"VariableCall",eval:function(e){var t,n=new Pe(this.variable,this.getIndex(),this.fileInfo()).eval(e),i=new F({message:"Could not evaluate variable call ".concat(this.variable)});if(!n.ruleset){if(n.rules)t=n;else if(Array.isArray(n))t=new ge("",n);else{if(!Array.isArray(n.value))throw i;t=new ge("",n.value)}n=new Ie(t)}if(n.ruleset)return n.callEval(e);throw i}});var Ge=function(e,t,n,i){this.value=e,this.lookups=t,this._index=n,this._fileInfo=i};Ge.prototype=Object.assign(new u,{type:"NamespaceValue",eval:function(e){var t,n,i=this.value.eval(e);for(t=0;tthis.params.length)return!1}n=Math.min(s,this.arity);for(var a=0;a0){for(c=!0,o=0;o0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `".concat(this.format(m),"`"),index:this.getIndex(),filename:this.fileInfo().filename};for(o=0;o0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var n,i,r,s,a=this.extractUrlParts(e),o=this.extractUrlParts(t),l="";if(a.hostPart!==o.hostPart)return"";for(i=Math.max(o.directories.length,a.directories.length),n=0;nparseInt(t[n])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",n=0;n1?e-1:e)<1?r+(s-r)*e*6:2*e<1?s:3*e<2?r+(s-r)*(2/3-e)*6:r}try{if(e instanceof c)return i=t?st(t):e.alpha,new c(e.rgb,i,"hsla");e=st(e)%360/360,t=tt(st(t)),n=tt(st(n)),i=tt(st(i)),r=2*n-(s=n<=.5?n*(t+1):n+t-n*t);var o=[255*a(e+1/3),255*a(e),255*a(e-1/3)];return i=st(i),new c(o,i,"hsla")}catch(e){}},hsv:function(e,t,n){return Ye.hsva(e,t,n,1)},hsva:function(e,t,n,i){var r,s;e=st(e)%360/360*360,t=st(t),n=st(n),i=st(i);var a=[n,n*(1-t),n*(1-(s=e/60-(r=Math.floor(e/60%6)))*t),n*(1-(1-s)*t)],o=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Ye.rgba(255*a[o[r][0]],255*a[o[r][1]],255*a[o[r][2]],i)},hue:function(e){return new be(it(e).h)},saturation:function(e){return new be(100*it(e).s,"%")},lightness:function(e){return new be(100*it(e).l,"%")},hsvhue:function(e){return new be(rt(e).h)},hsvsaturation:function(e){return new be(100*rt(e).s,"%")},hsvvalue:function(e){return new be(100*rt(e).v,"%")},red:function(e){return new be(e.rgb[0])},green:function(e){return new be(e.rgb[1])},blue:function(e){return new be(e.rgb[2])},alpha:function(e){return new be(it(e).a)},luma:function(e){return new be(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new be(t*e.alpha*100,"%")},saturate:function(e,t,n){if(!e.rgb)return null;var i=it(e);return void 0!==n&&"relative"===n.value?i.s+=i.s*t.value/100:i.s+=t.value/100,i.s=tt(i.s),nt(e,i)},desaturate:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.s-=i.s*t.value/100:i.s-=t.value/100,i.s=tt(i.s),nt(e,i)},lighten:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.l+=i.l*t.value/100:i.l+=t.value/100,i.l=tt(i.l),nt(e,i)},darken:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.l-=i.l*t.value/100:i.l-=t.value/100,i.l=tt(i.l),nt(e,i)},fadein:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.a+=i.a*t.value/100:i.a+=t.value/100,i.a=tt(i.a),nt(e,i)},fadeout:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.a-=i.a*t.value/100:i.a-=t.value/100,i.a=tt(i.a),nt(e,i)},fade:function(e,t){var n=it(e);return n.a=t.value/100,n.a=tt(n.a),nt(e,n)},spin:function(e,t){var n=it(e),i=(n.h+t.value)%360;return n.h=i<0?360+i:i,nt(e,n)},mix:function(e,t,n){n||(n=new be(50));var i=n.value/100,r=2*i-1,s=it(e).a-it(t).a,a=((r*s==-1?r:(r+s)/(1+r*s))+1)/2,o=1-a,l=[e.rgb[0]*a+t.rgb[0]*o,e.rgb[1]*a+t.rgb[1]*o,e.rgb[2]*a+t.rgb[2]*o],u=e.alpha*i+t.alpha*(1-i);return new c(l,u)},greyscale:function(e){return Ye.desaturate(e,new be(100))},contrast:function(e,t,n,i){if(!e.rgb)return null;if(void 0===n&&(n=Ye.rgba(255,255,255,1)),void 0===t&&(t=Ye.rgba(0,0,0,1)),t.luma()>n.luma()){var r=n;n=t,t=r}return i=void 0===i?.43:st(i),e.luma().5&&(i=1,n=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*i*(n-e)},hardlight:function(e,t){return lt.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var ut in lt)lt.hasOwnProperty(ut)&&(ot[ut]=ot.bind(null,lt[ut]));var ct=function(e){return Array.isArray(e.value)?e.value:Array(e)},ht={_SELF:function(e){return e},"~":function(){for(var e=[],t=0;ta.value)&&(h[i]=r);else{if(void 0!==l&&o!==l)throw{type:"Argument",message:"incompatible types"};f[o]=h.length,h.push(r)}}return 1==h.length?h[0]:(t=h.map((function(e){return e.toCSS(c.context)})).join(this.context.compress?",":", "),new se("".concat(e?"min":"max","(").concat(t,")")))},mt={min:function(){for(var e=[],t=0;t"),r=0;r");return i+="'),i=encodeURIComponent(i),i="data:image/svg+xml,".concat(i),new Oe(new Me("'".concat(i,"'"),i,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),ne.addMultiple(wt),ne.addMultiple(St),t};function Ct(e,t){var n,i=(t=t||{}).variables,r=new B.Eval(t);"object"!=typeof i||Array.isArray(i)||(i=Object.keys(i).map((function(e){var t=i[e];return t instanceof Ke.Value||(t instanceof Ke.Expression||(t=new Ke.Expression([t])),t=new Ke.Value([t])),new Ke.Declaration("@".concat(e),t,!1,null,0)})),r.frames=[new Ke.Ruleset(null,i)]);var s,a,o=[new ee.JoinSelectorVisitor,new ee.MarkVisibleSelectorsVisitor(!0),new ee.ExtendVisitor,new ee.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){a=t.pluginManager.visitor();for(var u=0;u<2;u++)for(a.first();s=a.get();)s.isPreEvalVisitor?0!==u&&-1!==l.indexOf(s)||(l.push(s),s.run(e)):0!==u&&-1!==o.indexOf(s)||(s.isPreVisitor?o.unshift(s):o.push(s))}n=e.eval(r);for(var c=0;c=t);n++);this.preProcessors.splice(n,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var n;for(n=0;n=t);n++);this.postProcessors.splice(n,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var i=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?i=this.sourceMapURL:this._sourceMapFilename&&(i=this._sourceMapFilename),this.sourceMapURL=i,this.sourceMap=r}return this._css.join("")},t}()}(e=new s(e,t)),e)),o=function(e){return function(){function t(e,t,n){this.less=e,this.rootFilename=n.filename,this.paths=t.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=t.mime,this.error=null,this.context=t,this.queue=[],this.files={}}return t.prototype.push=function(t,n,i,s,a){var o=this,l=this.context.pluginManager.Loader;this.queue.push(t);var u=function(e,n,i){o.queue.splice(o.queue.indexOf(t),1);var l=i===o.rootFilename;s.optional&&e?(a(null,{rules:[]},!1,null),r.info("The file ".concat(i," was skipped because it was not found and the import was marked optional."))):(o.files[i]||s.inline||(o.files[i]={root:n,options:s}),e&&!o.error&&(o.error=e),a(e,n,l,i))},c={rewriteUrls:this.context.rewriteUrls,entryPath:i.entryPath,rootpath:i.rootpath,rootFilename:i.rootFilename},h=e.getFileManager(t,i.currentDirectory,this.context,e);if(h){var f,p,v=function(e){var t,n=e.filename,r=e.contents.replace(/^\uFEFF/,"");c.currentDirectory=h.getPath(n),c.rewriteUrls&&(c.rootpath=h.join(o.context.rootpath||"",h.pathDiff(c.currentDirectory,c.entryPath)),!h.isPathAbsolute(c.rootpath)&&h.alwaysMakePathsAbsolute()&&(c.rootpath=h.join(c.entryPath,c.rootpath))),c.filename=n;var a=new B.Parse(o.context);a.processImports=!1,o.contents[n]=r,(i.reference||s.reference)&&(c.reference=!0),s.isPlugin?(t=l.evalPlugin(r,a,o,s.pluginArgs,c))instanceof F?u(t,null,n):u(null,t,n):s.inline?u(null,r,n):!o.files[n]||o.files[n].options.multiple||s.multiple?new ae(a,o,c).parse(r,(function(e,t){u(e,t,n)})):u(null,o.files[n].root,n)},d=_(this.context);n&&(d.ext=s.isPlugin?".js":".less"),s.isPlugin?(d.mime="application/javascript",d.syncImport?f=l.loadPluginSync(t,i.currentDirectory,d,e,h):p=l.loadPlugin(t,i.currentDirectory,d,e,h)):d.syncImport?f=h.loadFileSync(t,i.currentDirectory,d,e):p=h.loadFile(t,i.currentDirectory,d,e,(function(e,t){e?u(e):v(t)})),f?f.filename?v(f):u(f):p&&p.then(v,u)}else u({message:"Could not find a file-manager for ".concat(t)})},t}()}(e);var u,c=function(e,t){var n=function(e,i,r){if("function"==typeof i?(r=i,i=E(this.options,{})):i=E(this.options,i||{}),!r){var s=this;return new Promise((function(t,r){n.call(s,e,i,(function(e,n){e?r(e):t(n)}))}))}this.parse(e,i,(function(e,n,i,s){if(e)return r(e);var a;try{a=new t(n,i).toCSS(s)}catch(e){return r(e)}r(null,a)}))};return n}(0,a),h=function(e,t,n){var i=function(e,t,r){if("function"==typeof t?(r=t,t=E(this.options,{})):t=E(this.options,t||{}),!r){var s=this;return new Promise((function(n,r){i.call(s,e,t,(function(e,t){e?r(e):n(t)}))}))}var a,o=void 0,l=new _t(this,!t.reUsePluginManager);if(t.pluginManager=l,a=new B.Parse(t),t.rootFileInfo)o=t.rootFileInfo;else{var u=t.filename||"input",c=u.replace(/[^/\\]*$/,"");(o={filename:u,rewriteUrls:a.rewriteUrls,rootpath:a.rootpath||"",currentDirectory:c,entryPath:c,rootFilename:u}).rootpath&&"/"!==o.rootpath.slice(-1)&&(o.rootpath+="/")}var h=new n(this,a,o);this.importManager=h,t.plugins&&t.plugins.forEach((function(e){var t,n;if(e.fileContent){if(n=e.fileContent.replace(/^\uFEFF/,""),(t=l.Loader.evalPlugin(n,a,h,e.options,e.filename))instanceof F)return r(t)}else l.addPlugin(e)})),new ae(a,h,o).parse(e,(function(e,n){if(e)return r(e);r(null,n,h,t)}),t)};return i}(0,0,o),f=Rt("v".concat("4.4.2")),p={version:[f.major,f.minor,f.patch],data:l,tree:Ke,Environment:s,AbstractFileManager:He,AbstractPluginLoader:Qe,environment:e,visitors:ee,Parser:ae,functions:It(e),contexts:B,SourceMapOutput:n,SourceMapBuilder:i,ParseTree:a,ImportManager:o,render:c,parse:h,LessError:F,transformTree:Ct,utils:O,PluginManager:_t,logger:r},v=function(e){return function(){var t=Object.create(e.prototype);return e.apply(t,Array.prototype.slice.call(arguments,0)),t}},d=Object.create(p);for(var m in p.tree)if("function"==typeof(u=p.tree[m]))d[m.toLowerCase()]=v(u);else for(var g in d[m]=Object.create(null),u)d[m][g.toLowerCase()]=v(u[g]);return p.parse=p.parse.bind(d),p.render=p.render.bind(d),d}var Ot={},$t=function(){};$t.prototype=Object.assign(new He,{alwaysMakePathsAbsolute:function(){return!0},join:function(e,t){return e?this.extractUrlParts(t,e).path:t},doXHR:function(e,t,n,i){var r=new XMLHttpRequest,s=!Pt.isFileProtocol||Pt.fileAsync;function a(t,n,i){t.status>=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof i&&i(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),Et.debug("XHR: Getting '".concat(e,"'")),r.open("GET",e,s),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),Pt.isFileProtocol&&!Pt.fileAsync?0===r.status||r.status>=200&&r.status<300?n(r.responseText):i(r.status,e):s?r.onreadystatechange=function(){4==r.readyState&&a(r,n,i)}:a(r,n,i)},supports:function(){return!0},clearFileCache:function(){Ot={}},loadFile:function(e,t,n){t&&!this.isPathAbsolute(e)&&(e=t+e),e=n.ext?this.tryAppendExtension(e,n.ext):e,n=n||{};var i=this.extractUrlParts(e,window.location.href).url,r=this;return new Promise((function(e,t){if(n.useFileCache&&Ot[i])try{var s=Ot[i];return e({contents:s,filename:i,webInfo:{lastModified:new Date}})}catch(e){return t({filename:i,message:"Error loading file ".concat(i," error was ").concat(e.message)})}r.doXHR(i,n.mime,(function(t,n){Ot[i]=t,e({contents:t,filename:i,webInfo:{lastModified:n}})}),(function(e,n){t({type:"File",message:"'".concat(n,"' wasn't found (").concat(e,")"),href:i})}))}))}});var Ft=function(e,t){return Pt=e,Et=t,$t},Vt=function(e){this.less=e};Vt.prototype=Object.assign(new Qe,{loadPlugin:function(e,t,n,i,r){return new Promise((function(s,a){r.loadFile(e,t,n,i).then(s).catch(a)}))}});var Lt=function(t,i,r){return{add:function(s,a){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var n=e.filename||t,s=[],a="".concat(e.type||"Syntax","Error: ").concat(e.message||"There is an error in your .less file"," in ").concat(n),o=function(e,t,n){void 0!==e.extract[t]&&s.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};e.line&&(o(e,0,""),o(e,1,"line"),o(e,2,""),a+=" on line ".concat(e.line,", column ").concat(e.column+1,":\n").concat(s.join("\n"))),e.stack&&(e.extract||r.logLevel>=4)&&(a+="\nStack Trace\n".concat(e.stack)),i.logger.error(a)}(s,a):"function"==typeof r.errorReporting&&r.errorReporting("add",s,a):function(i,s){var a,o,l="less-error-message:".concat(e(s||"")),u=t.document.createElement("div"),c=[],h=i.filename||s,f=h.match(/([^/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",o="

    ".concat(i.type||"Syntax","Error: ").concat(i.message||"There is an error in your .less file")+'

    in ').concat(f," ");var p=function(e,t,n){void 0!==e.extract[t]&&c.push('

  • {content}
  • '.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};i.line&&(p(i,0,""),p(i,1,"line"),p(i,2,""),o+="on line ".concat(i.line,", column ").concat(i.column+1,":

      ").concat(c.join(""),"
    ")),i.stack&&(i.extract||r.logLevel>=4)&&(o+="
    Stack Trace
    ".concat(i.stack.split("\n").slice(1).join("
    "))),u.innerHTML=o,n(t.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),u.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===r.env&&(a=setInterval((function(){var e=t.document,n=e.body;n&&(e.getElementById(l)?n.replaceChild(u,e.getElementById(l)):n.insertBefore(u,n.firstChild),clearInterval(a))}),10))}(s,a)},remove:function(n){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",n):function(n){var i=t.document.getElementById("less-error-message:".concat(e(n)));i&&i.parentNode.removeChild(i)}(n)}}},jt={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:1,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var Dt in window.less)Object.prototype.hasOwnProperty.call(window.less,Dt)&&(jt[Dt]=window.less[Dt]);!function(e,n){t(n,i(e)),void 0===n.isFileProtocol&&(n.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),n.async=n.async||!1,n.fileAsync=n.fileAsync||!1,n.poll=n.poll||(n.isFileProtocol?1e3:1500),n.env=n.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||n.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(n.dumpLineNumbers=r[1]),void 0===n.useFileCache&&(n.useFileCache=!0),void 0===n.onReady&&(n.onReady=!0),n.relativeUrls&&(n.rewriteUrls="all")}(window,jt),jt.plugins=jt.plugins||[],window.LESS_PLUGINS&&(jt.plugins=jt.plugins.concat(window.LESS_PLUGINS));var Nt,Bt,Ut,qt=function(e,i){var r=e.document,s=Mt();s.options=i;var a=s.environment,o=Ft(i,s.logger),l=new o;a.addFileManager(l),s.FileManager=o,s.PluginLoader=Vt,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var n=0;n 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","/**\n * The reason why Node is a class and other nodes simply do not extend\n * from Node (since we're transpiling) is due to this issue:\n * \n * @see https://github.com/less/less.js/issues/3434\n */\nclass Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n }\n\n get currentFileInfo() {\n return this.fileInfo();\n }\n\n get index() {\n return this.getIndex();\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() { return false; }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n // remove when genCSS has JSDoc types\n // eslint-disable-next-line no-unused-vars\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n static compare(a, b) {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n }\n\n static numericCompare(a, b) {\n return a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nconst Color = function(rgb, a, originalForm) {\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n}\n\nColor.prototype = Object.assign(new Node(), {\n type: 'Color',\n\n luma() {\n let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(function (c) {\n return clamp(Math.round(c), 255);\n }).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n // eslint-disable-next-line no-fallthrough\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n },\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n },\n\n toRGB() {\n return toHex(this.rgb);\n },\n\n toHSL() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n },\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n },\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n },\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n});\n\nColor.fromKeyword = function(keyword) {\n let c;\n const key = keyword.toLowerCase();\n // eslint-disable-next-line no-prototype-builtins\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(function (c) {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nexport default Color;\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import Node from './node';\n\nconst Paren = function(node) {\n this.value = node;\n};\n\nParen.prototype = Object.assign(new Node(), {\n type: 'Paren',\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const paren = new Paren(this.value.eval(context));\n \n if (this.noSpacing) {\n paren.noSpacing = true;\n }\n\n return paren;\n }\n});\n\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\r\nfunction getType(payload) {\r\n return Object.prototype.toString.call(payload).slice(8, -1);\r\n}\r\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\r\nfunction isUndefined(payload) {\r\n return getType(payload) === 'Undefined';\r\n}\r\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\r\nfunction isNull(payload) {\r\n return getType(payload) === 'Null';\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isPlainObject(payload) {\r\n if (getType(payload) !== 'Object')\r\n return false;\r\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isObject(payload) {\r\n return isPlainObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is { [K in any]: never }}\r\n */\r\nfunction isEmptyObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isFullObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isAnyObject(payload) {\r\n return getType(payload) === 'Object';\r\n}\r\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\r\nfunction isObjectLike(payload) {\r\n return isAnyObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a function (regular or async)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is AnyFunction}\r\n */\r\nfunction isFunction(payload) {\r\n return typeof payload === 'function';\r\n}\r\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {any} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isArray(payload) {\r\n return getType(payload) === 'Array';\r\n}\r\n/**\r\n * Returns whether the payload is a an array with at least 1 item\r\n *\r\n * @param {*} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isFullArray(payload) {\r\n return isArray(payload) && payload.length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is []}\r\n */\r\nfunction isEmptyArray(payload) {\r\n return isArray(payload) && payload.length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isString(payload) {\r\n return getType(payload) === 'String';\r\n}\r\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isFullString(payload) {\r\n return isString(payload) && payload !== '';\r\n}\r\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isEmptyString(payload) {\r\n return payload === '';\r\n}\r\n/**\r\n * Returns whether the payload is a number (but not NaN)\r\n *\r\n * This will return `false` for `NaN`!!\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\r\nfunction isNumber(payload) {\r\n return getType(payload) === 'Number' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\r\nfunction isBoolean(payload) {\r\n return getType(payload) === 'Boolean';\r\n}\r\n/**\r\n * Returns whether the payload is a regular expression (RegExp)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\r\nfunction isRegExp(payload) {\r\n return getType(payload) === 'RegExp';\r\n}\r\n/**\r\n * Returns whether the payload is a Map\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Map}\r\n */\r\nfunction isMap(payload) {\r\n return getType(payload) === 'Map';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakMap\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakMap}\r\n */\r\nfunction isWeakMap(payload) {\r\n return getType(payload) === 'WeakMap';\r\n}\r\n/**\r\n * Returns whether the payload is a Set\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Set}\r\n */\r\nfunction isSet(payload) {\r\n return getType(payload) === 'Set';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakSet\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakSet}\r\n */\r\nfunction isWeakSet(payload) {\r\n return getType(payload) === 'WeakSet';\r\n}\r\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\r\nfunction isSymbol(payload) {\r\n return getType(payload) === 'Symbol';\r\n}\r\n/**\r\n * Returns whether the payload is a Date, and that the date is valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\r\nfunction isDate(payload) {\r\n return getType(payload) === 'Date' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a Blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\r\nfunction isBlob(payload) {\r\n return getType(payload) === 'Blob';\r\n}\r\n/**\r\n * Returns whether the payload is a File\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\r\nfunction isFile(payload) {\r\n return getType(payload) === 'File';\r\n}\r\n/**\r\n * Returns whether the payload is a Promise\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Promise}\r\n */\r\nfunction isPromise(payload) {\r\n return getType(payload) === 'Promise';\r\n}\r\n/**\r\n * Returns whether the payload is an Error\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Error}\r\n */\r\nfunction isError(payload) {\r\n return getType(payload) === 'Error';\r\n}\r\n/**\r\n * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is typeof NaN}\r\n */\r\nfunction isNaNValue(payload) {\r\n return getType(payload) === 'Number' && isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\r\nfunction isPrimitive(payload) {\r\n return (isBoolean(payload) ||\r\n isNull(payload) ||\r\n isUndefined(payload) ||\r\n isNumber(payload) ||\r\n isString(payload) ||\r\n isSymbol(payload));\r\n}\r\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\r\nvar isNullOrUndefined = isOneOf(isNull, isUndefined);\r\nfunction isOneOf(a, b, c, d, e) {\r\n return function (value) {\r\n return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));\r\n };\r\n}\r\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\r\nfunction isType(payload, type) {\r\n if (!(type instanceof Function)) {\r\n throw new TypeError('Type must be a function');\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\r\n throw new TypeError('Type is not a class');\r\n }\r\n // Classes usually have names (as functions usually have names)\r\n var name = type.name;\r\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\r\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isMap, isNaNValue, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\r\n const propType = {}.propertyIsEnumerable.call(originalObject, key)\r\n ? 'enumerable'\r\n : 'nonenumerable';\r\n if (propType === 'enumerable')\r\n carry[key] = newVal;\r\n if (includeNonenumerable && propType === 'nonenumerable') {\r\n Object.defineProperty(carry, key, {\r\n value: newVal,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n });\r\n }\r\n}\r\n/**\r\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.\r\n *\r\n * @export\r\n * @template T\r\n * @param {T} target Target can be anything\r\n * @param {Options} [options = {}] Options can be `props` or `nonenumerable`\r\n * @returns {T} the target with replaced values\r\n * @export\r\n */\r\nfunction copy(target, options = {}) {\r\n if (isArray(target)) {\r\n return target.map((item) => copy(item, options));\r\n }\r\n if (!isPlainObject(target)) {\r\n return target;\r\n }\r\n const props = Object.getOwnPropertyNames(target);\r\n const symbols = Object.getOwnPropertySymbols(target);\r\n return [...props, ...symbols].reduce((carry, key) => {\r\n if (isArray(options.props) && !options.props.includes(key)) {\r\n return carry;\r\n }\r\n const val = target[key];\r\n const newVal = copy(val, options);\r\n assignProp(carry, key, newVal, target, options.nonenumerable);\r\n return carry;\r\n }, {});\r\n}\n\nexport { copy };\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n var line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n lineAdjust = 1 - parseInt(match[2]);\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = function () {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options) {\n options = options || {};\n const isWarning = (this.type ?? '').toLowerCase().includes('warning');\n const type = isWarning ? this.type : `${this.type}Error`;\n const color = isWarning ? 'yellow' : 'red';\n\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = function (str) { return str; };\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (!isWarning && typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (!isWarning && typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${type}: ${this.message}`, color);\n if (this.filename) {\n message += stylize(' in ', color) + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', color) + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import tree from '../tree';\n\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key, child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (let i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt, i, item, nestedCnt, j, nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager', // Used as the plugin manager for the session\n 'quiet', // option - whether to log warnings\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this,\n importItem = {\n callback,\n args: null,\n isReady: false\n };\n this.imports.push(importItem);\n return function() {\n importItem.args = Array.prototype.slice.call(arguments, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this,\n inlineCSS = importNode.options.inline,\n isPlugin = importNode.options.isPlugin,\n isOptional = importNode.options.optional,\n duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = function() {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n if (atRuleNode.value) {\n this.context.frames.unshift(atRuleNode);\n } else if (atRuleNode.declarations && atRuleNode.declarations.length) {\n if (atRuleNode.isRooted) {\n this.context.frames.unshift(atRuleNode);\n } else {\n this.context.frames.unshift(atRuleNode.declarations[0]);\n }\n } else if (atRuleNode.rules && atRuleNode.rules.length) {\n this.context.frames.unshift(atRuleNode);\n }\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(function(allSelectorsExtend) {\n return allSelectorsExtend.clone();\n });\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(function(extend) {\n return !extend.hasFoundMatches && extend.parent_ids.length == 1;\n }).forEach(function(extend) {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n /**\n * @todo Shouldn't this be an error? To alert the developer\n * that they may have made an error in the selector they are\n * targeting?\n */\n logger.warn(`WARNING: extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(function(selfSelector) {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(function (currentValue) {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n\n if (atRuleNode.declarations && atRuleNode.declarations.length) {\n atRuleNode.declarations[0].root = (context.length === 0 || context[0].multiMedia);\n }\n else if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' did not return a root node`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$peekChar = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar: {\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n }\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']': {\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default function (input, fail) {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n","import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\nimport { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax';\nimport logger from '../logger';\nimport Selector from '../tree/selector';\nimport Anonymous from '../tree/anonymous';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo, currentIndex) {\n currentIndex = currentIndex || 0;\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n /**\n * \n * @param {string} msg \n * @param {number} index \n * @param {string} type \n */\n function warn(msg, index, type) {\n if (!context.quiet) {\n logger.warn(\n (new LessError(\n {\n index: index ?? parserInput.i,\n filename: fileInfo.filename,\n type: type ? `${type.toUpperCase()} WARNING` : 'WARNING',\n message: msg\n },\n imports\n )).toString()\n );\n }\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n\n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n *\n * @param {String} str - string to parse\n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p; (p = parseList[x]); x++) {\n result = parsers[p]();\n returnNodes.push(result || null);\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let err = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n // Optionally disable @plugin parsing\n if (additionalData && additionalData.disablePluginRule) {\n parsers.plugin = function() {\n var dir = parserInput.$re(/^@plugin?\\s+/);\n if (dir) {\n error('@plugin statements are not allowed when disablePluginRule is set to true');\n }\n }\n }\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n\n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n err = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = err || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) ||\n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|~|progid:[\\w.]+)\\(/);\n if (!name) {\n parserInput.forget();\n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index + currentIndex, fileInfo);\n },\n\n declarationCall: function () {\n let validCall;\n let args;\n const index = parserInput.i;\n\n parserInput.save();\n\n validCall = parserInput.$re(/^[\\w]+\\(/);\n if (!validCall) {\n parserInput.forget();\n return;\n }\n\n validCall = validCall.substring(0, validCall.length - 1);\n\n let rule = this.ruleProperty();\n let value;\n \n if (rule) {\n value = this.value();\n }\n \n if (rule && value) {\n args = [new (tree.Declaration)(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)];\n }\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(validCall, args, index + currentIndex, fileInfo);\n },\n\n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result,\n // otherwise continue for plain args\n };\n }\n\n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[()'\"])|[^()'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value !== undefined ||\n value instanceof tree.Variable ||\n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index + currentIndex, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index + currentIndex, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index + currentIndex, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n }\n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n let first = true;\n while (!(option = parserInput.$re(/^(!?all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n\n if (!e) {\n break;\n }\n /**\n * @note - This will not catch selectors in pseudos like :is() and :where() because\n * they don't currently parse their contents as selectors.\n */\n if (!first && e.combinator.value) {\n warn('Targeting complex selectors can have unexpected behavior, and this behavior may change in the future.', index)\n }\n\n first = false;\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index + currentIndex, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n let parensIndex;\n let parensWS = false;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n parensIndex = parserInput.i;\n if (parserInput.$char('(')) {\n parensWS = parserInput.isWhitespace(-2);\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n if (parensWS) {\n warn('Whitespace between a mixin name and parentheses for a mixin call is deprecated', parensIndex, 'DEPRECATED');\n }\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n if (!hasParens) {\n warn('Calling a mixin without parentheses is deprecated', parensIndex, 'DEPRECATED');\n }\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n\n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n\n ruleLookups: function() {\n let rule;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') {\n return;\n }\n\n while (true) {\n parserInput.save();\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n\n lookupValue: function() {\n parserInput.save();\n\n if (!parserInput.$char('[')) {\n parserInput.restore();\n return;\n }\n\n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n\n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n }\n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n\n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n /** \n * A Selector Element\n *\n * div\n * + h1\n * #socks\n * input[type=\"text\"]\n *\n * Elements are the building blocks for Selectors,\n * they are made out of a `Combinator` (see combinator rule),\n * and an element name, such as a tag a class, or `*`.\n */\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n /** This selector parser is quite simplistic and will pass a number of invalid selectors. */\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n // eslint-disable-next-line no-control-regex\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false))) {\n let selectors = [];\n while (parserInput.$char(',')) {\n selectors.push(v);\n selectors.push(new Anonymous(','));\n v = this.selector(false);\n }\n selectors.push(v);\n \n if (parserInput.$char(')')) {\n if (selectors.length > 1) {\n e = new (tree.Paren)(new Selector(selectors));\n } else {\n e = new(tree.Paren)(v);\n }\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (Array.isArray(e)){\n e.forEach(ele => elements.push(ele));\n } if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error('Guards are only currently allowed on a single selector.');\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error('Guards are only currently allowed on a single selector.');\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n //\n // case-insensitive flag\n // e.g. [attr operator value i]\n //\n let cif;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n if (val) {\n cif = parserInput.$re(/^[iIsS]/);\n }\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val, cif);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not\n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n if (parserInput.$char(';')) {\n value = new Anonymous('');\n } else {\n value = this.permissiveValue(/[;}]/, true);\n }\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n /**\n * As a last resort, try permissiveValue\n *\n * @todo - This has created some knock-on problems of not\n * flagging incorrect syntax or detecting user intent.\n */\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@$+/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index + currentIndex);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n *\n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n * \n * @param {RexExp} untilTokens - Characters to stop parsing at\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n if (parserInput.peek(',')) {\n value.push(new (tree.Anonymous)(',', parserInput.i));\n parserInput.$char(',');\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n /** @type {string} */\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n const variableRegex = /@([\\w-]+)/g;\n const propRegex = /\\$([\\w-]+)/g;\n if (variableRegex.test(item)) {\n warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED');\n }\n if (propRegex.test(item)) {\n warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED');\n }\n quote.variableRegex = /@([\\w-]+)|@{([\\w-]+)}/g;\n quote.propRegex = /\\$([\\w-]+)|\\${([\\w-]+)}/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures({});\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function (syntaxOptions) {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n let rangeP;\n let spacing = false;\n parserInput.save();\n do {\n parserInput.save();\n if (parserInput.$re(/^[0-9a-z-]*\\s+\\(/)) {\n spacing = true;\n }\n parserInput.restore();\n\n e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup()\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n parserInput.save();\n if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\\s*([<>]=|<=|>=|[<>]|=)/)) {\n parserInput.restore();\n p = this.condition();\n\n parserInput.save();\n rangeP = this.atomicCondition(null, p.rvalue);\n if (!rangeP) {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n e = this.value();\n }\n if (parserInput.$char(')')) {\n if (p && !e) {\n nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)));\t\t\t\t \n e = p;\n } else if (p && e) {\n nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true)));\n if (!spacing) {\n nodes[nodes.length - 1].noSpacing = true;\n }\n spacing = false;\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n spacing = false;\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function (syntaxOptions) {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature(syntaxOptions);\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n else if (!features[features.length - 1].noSpacing) {\n features[features.length - 1].noSpacing = false;\n }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n else if (!features[features.length - 1].noSpacing) {\n features[features.length - 1].noSpacing = false;\n }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) {\n const features = this.mediaFeatures(syntaxOptions);\n\n const rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n const atRule = new (treeType)(rules, features, index + currentIndex, fileInfo);\n if (context.dumpLineNumbers) {\n atRule.debugInfo = debugInfo;\n }\n\n return atRule;\n },\n\n nestableAtRule: function () {\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n parserInput.save();\n\n if (parserInput.$peekChar('@')) {\n if (parserInput.$str('@media')) {\n return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions);\n }\n \n if (parserInput.$str('@container')) {\n return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions);\n }\n }\n \n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else {\n parserInput.restore();\n return null;\n }\n },\n atruleUnknown: function (value, name, hasBlock) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(''.concat(name, ' rule is missing block or ending semi-colon'));\n }\n }\n else if (!value.value) {\n value = null;\n }\n return [value, hasBlock];\n },\n atruleBlock: function (rules, value, isRooted, isKeywordList) {\n rules = this.blockRuleset();\n parserInput.save();\n if (!rules && !isRooted) {\n value = this.entity();\n rules = this.blockRuleset();\n }\n if (!rules && !isRooted) {\n parserInput.restore();\n var e = [];\n value = this.entity();\n while (parserInput.$char(',')) {\n e.push(value);\n value = this.entity();\n }\n if (value && e.length > 0) {\n e.push(value);\n value = e;\n isKeywordList = true;\n }\n else {\n rules = this.blockRuleset();\n }\n }\n else {\n parserInput.forget();\n }\n \n return [rules, value, isKeywordList];\n },\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n let isKeywordList = false;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.nestableAtRule();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n case '@starting-style':\n isRooted = false;\n break;\n case '@layer':\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n const unknownPackage = this.atruleUnknown(value, name, hasBlock);\n value = unknownPackage[0];\n hasBlock = unknownPackage[1];\n }\n \n if (hasBlock) {\n let blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList);\n rules = blockPackage[0];\n value = blockPackage[1];\n isKeywordList = blockPackage[2];\n\n if (!rules && !hasUnknown) {\n parserInput.restore();\n name = parserInput.$re(/^@[a-z-]+/);\n const unknownPackage = this.atruleUnknown(value, name, hasBlock);\n value = unknownPackage[0];\n hasBlock = unknownPackage[1];\n if (hasBlock) {\n blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList);\n rules = blockPackage[0];\n value = blockPackage[1];\n isKeywordList = blockPackage[2];\n }\n }\n }\n\n if (rules || isKeywordList || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index + currentIndex, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index + currentIndex);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n colorOperand: function () {\n parserInput.save();\n \n // hsl or rgb or lch operand\n const match = parserInput.$re(/^[lchrgbs]\\s+/);\n if (match) {\n return new tree.Keyword(match[0]);\n }\n\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*');\n if (!op) {\n let index = parserInput.i;\n op = parserInput.$str('./');\n if (op) {\n warn('./ operator is deprecated', index, 'DEPRECATED');\n }\n }\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index + currentIndex);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens, preparsedCond) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n const cond = (function() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }).bind(this)\n\n if (preparsedCond) {\n a = preparsedCond;\n } else {\n a = cond();\n }\n\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index + currentIndex, false);\n } else {\n error('expected expression');\n }\n } else if (!preparsedCond) {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@$(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n this.colorOperand() || entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e && !e.isLineComment) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index + currentIndex));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n};\n\nSelector.prototype = Object.assign(new Node(), {\n type: 'Selector',\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n },\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(\n els,\n ['selector'],\n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n },\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n },\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n },\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( function(v) {\n return v.combinator.value + (v.value.value || v.value);\n }).join('').match(/[,&#*.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n },\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n },\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(function (e) { return e.eval(context); });\n extendList = extendList && extendList.map(function(extend) { return extend.eval(context); });\n\n return this.createDerived(elements, extendList, evaldCondition);\n },\n\n genCSS(context, output) {\n let i, element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n },\n\n getIsOutput() {\n return this.evaldCondition;\n }\n});\n\nexport default Selector;\n","import Node from './node';\n\nconst Value = function(value) {\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n};\n\nValue.prototype = Object.assign(new Node(), {\n type: 'Value',\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n },\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(function (v) {\n return v.eval(context);\n }));\n }\n },\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n});\n\nexport default Value;\n","import Node from './node';\n\nconst Keyword = function(value) {\n this.value = value;\n};\n\nKeyword.prototype = Object.assign(new Node(), {\n type: 'Keyword',\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n});\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nconst Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) {\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n};\n\nDeclaration.prototype = Object.assign(new Node(), {\n type: 'Declaration',\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n },\n\n eval(context) {\n let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n },\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n});\n\nexport default Declaration;","function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n","import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Ruleset = function(selectors, rules, strictImports, visibilityInfo) {\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n}\n\nRuleset.prototype = Object.assign(new Node(), {\n type: 'Ruleset',\n isRuleset: true,\n\n isRulesetLike() { return true; },\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n eval(context) {\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (let j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n const startingIndex = selectors[0].getIndex();\n const selectorFileInfo = selectors[0].fileInfo();\n new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(\n toParseSelectors.join(','),\n ['selectors'],\n function(err, result) {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (function (frames) {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n }(context.frames)).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (let j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n },\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice.apply(rules, [i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n },\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n },\n\n matchArgs(args) {\n return !args || args.length === 0;\n },\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n },\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n },\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n // eslint-disable-next-line no-prototype-builtins\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n },\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n },\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n },\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(\n decl.value.value,\n ['value', 'important'],\n function(err, result) {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(function(n) {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n },\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n },\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n },\n\n find(selector, self, filter) {\n self = self || this;\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(function (rule) {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n },\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n },\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n },\n\n joinSelector(paths, context, selector) {\n\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen, j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element, selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath, lastSelector, newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(function (selector) {\n return selector.createDerived(selector.elements, []);\n });\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i, sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector !== null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i, newPaths, hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n\n }\n});\n\nexport default Ruleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nconst Unit = function(numerator, denominator, backupUnit) {\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n};\n\nUnit.prototype = Object.assign(new Node(), {\n type: 'Unit',\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n },\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n },\n\n toString() {\n let i, returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n },\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n },\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n },\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n },\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n },\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n },\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n },\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = function (atomicUnit) {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n // eslint-disable-next-line no-prototype-builtins\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n },\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n // eslint-disable-next-line no-prototype-builtins\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n});\n\nexport default Unit;\n","/* eslint-disable no-prototype-builtins */\nimport Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nconst Dimension = function(value, unit) {\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n};\n\nDimension.prototype = Object.assign(new Node(), {\n type: 'Dimension',\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n eval(context) {\n return this;\n },\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n },\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n },\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error('Incompatible units. Change the units or use the unit function. '\n + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n },\n\n compare(other) {\n let a, b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n },\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n },\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = function (atomicUnit, denominator) {\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n});\n\nexport default Dimension;\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport Anonymous from './anonymous';\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n const noSpacing = this.noSpacing;\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen\n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n returnValue.noSpacing = returnValue.noSpacing || noSpacing;\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n if (i + 1 < this.value.length && !(this.value[i + 1] instanceof Anonymous) ||\n this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') {\n output.add(' ');\n }\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport * as utils from '../utils';\n\nconst NestableAtRulePrototype = {\n\n isRulesetLike() {\n return true;\n },\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n evalFunction: function () {\n if (!this.features || !Array.isArray(this.features.value) || this.features.value.length < 1) {\n return;\n }\n\n const exprValues = this.features.value;\n let expr, paren;\n\n for (let index = 0; index < exprValues.length; ++index) {\n expr = exprValues[index];\n\n if (expr.type === 'Keyword' && index + 1 < exprValues.length && (expr.noSpacing || expr.noSpacing == null)) {\n paren = exprValues[index + 1];\n \n if (paren.type === 'Paren' && paren.noSpacing) {\n exprValues[index]= new Expression([expr, paren]);\n exprValues.splice(index + 1, 1);\n exprValues[index].noSpacing = true;\n }\n }\n }\n },\n\n evalTop(context) {\n this.evalFunction();\n\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n },\n\n evalNested(context) {\n this.evalFunction();\n\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n if (path[i].type !== this.type) { \n context.mediaBlocks.splice(i, 1); \n \n return this; \n }\n \n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n },\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n },\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n};\n\nexport default NestableAtRulePrototype;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst AtRule = function(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n) {\n let i;\n var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n const allDeclarations = this.declarationsBlock(rules);\n \n let allRulesetDeclarations = true;\n rules.forEach(rule => {\n if (rule.type === 'Ruleset' && rule.rules) allRulesetDeclarations = allRulesetDeclarations && this.declarationsBlock(rule.rules, true);\n });\n\n if (allDeclarations && !isRooted) {\n this.simpleBlock = true;\n this.declarations = rules;\n } else if (allRulesetDeclarations && rules.length === 1 && !isRooted && !value) {\n this.simpleBlock = true;\n this.declarations = rules[0].rules ? rules[0].rules : rules;\n } else {\n this.rules = rules;\n }\n } else {\n const allDeclarations = this.declarationsBlock(rules.rules);\n \n if (allDeclarations && !isRooted && !value) {\n this.simpleBlock = true;\n this.declarations = rules.rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n }\n if (!this.simpleBlock) {\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n }\n this.setParent(selectors, this);\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nAtRule.prototype = Object.assign(new Node(), {\n type: 'AtRule',\n\n ...NestableAtRulePrototype,\n\n declarationsBlock(rules, mergeable = false) {\n if (!mergeable) {\n return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge}).length === rules.length;\n } else {\n return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length;\n }\n },\n\n keywordList(rules) {\n if (!Array.isArray(rules)) {\n return false;\n } else { \n return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length;\n }\n },\n\n accept(visitor) {\n const value = this.value, rules = this.rules, declarations = this.declarations;\n\n if (rules) {\n this.rules = visitor.visitArray(rules);\n } else if (declarations) {\n this.declarations = visitor.visitArray(declarations); \n }\n if (value) {\n this.value = visitor.visit(value);\n }\n },\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n },\n\n isCharset() {\n return '@charset' === this.name;\n },\n\n genCSS(context, output) {\n const value = this.value, rules = this.rules || this.declarations;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (this.simpleBlock) {\n this.outputRuleset(context, output, this.declarations);\n } else if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n },\n\n eval(context) {\n let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations;\n \n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n if (value.value && this.keywordList(value.value)) {\n value = new Anonymous(value.value.map(keyword => keyword.value).join(', '), this.getIndex(), this.fileInfo());\n }\n }\n\n if (rules) {\n rules = this.evalRoot(context, rules);\n }\n if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) {\n const allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true);\n if (allMergeableDeclarations && !this.isRooted && !value) {\n var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n mergeRules(rules[0].rules);\n rules = rules[0].rules;\n rules.forEach(rule => rule.merge = false);\n }\n }\n if (this.simpleBlock && rules) {\n rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n rules = rules.map(function (rule) { return rule.eval(context); });\n }\n\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n },\n\n evalRoot(context, rules) {\n let ampersandCount = 0;\n let noAmpersandCount = 0;\n let noAmpersands = true;\n let allAmpersands = false;\n\n if (!this.simpleBlock) {\n rules = [rules[0].eval(context)];\n }\n\n let precedingSelectors = [];\n if (context.frames.length > 0) {\n for (let index = 0; index < context.frames.length; index++) {\n const frame = context.frames[index];\n if (\n frame.type === 'Ruleset' &&\n frame.rules &&\n frame.rules.length > 0\n ) {\n if (frame && !frame.root && frame.selectors && frame.selectors.length > 0) {\n precedingSelectors = precedingSelectors.concat(frame.selectors);\n }\n }\n if (precedingSelectors.length > 0) {\n let value = '';\n const output = { add: function (s) { value += s; } };\n for (let i = 0; i < precedingSelectors.length; i++) {\n precedingSelectors[i].genCSS(context, output);\n }\n if (/^&+$/.test(value.replace(/\\s+/g, ''))) {\n noAmpersands = false;\n noAmpersandCount++;\n } else {\n allAmpersands = false;\n ampersandCount++;\n }\n }\n }\n }\n\n const mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !allAmpersands && !noAmpersands;\n if (\n (this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && !allAmpersands && noAmpersands)\n || !mixedAmpersands\n ) {\n rules[0].root = true;\n }\n return rules;\n },\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n },\n\n find() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], arguments);\n }\n },\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n },\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`, tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n});\n\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst DetachedRuleset = function(ruleset, frames) {\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n};\n\nDetachedRuleset.prototype = Object.assign(new Node(), {\n type: 'DetachedRuleset',\n evalFirst: true,\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n },\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n },\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n});\n\nexport default DetachedRuleset;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nconst Operation = function(op, operands, isSpaced) {\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n};\n\nOperation.prototype = Object.assign(new Node(), {\n type: 'Operation',\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n },\n\n eval(context) {\n let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate || !b.operate) {\n if (\n (a instanceof Operation || b instanceof Operation)\n && a.op === '/' && context.math === MATH.PARENS_DIVISION\n ) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n },\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n});\n\nexport default Operation;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nconst Call = function(name, args, index, currentFileInfo) {\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nCall.prototype = Object.assign(new Node(), {\n type: 'Call',\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n },\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n\n const exitCalc = () => {\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n };\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(this.args);\n exitCalc();\n } catch (e) {\n // eslint-disable-next-line no-prototype-builtins\n if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {\n throw e;\n }\n throw { \n type: e.type || 'Runtime',\n message: `Error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n const args = this.args.map(a => a.eval(context));\n exitCalc();\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n },\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n});\n\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nconst Variable = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nVariable.prototype = Object.assign(new Node(), {\n type: 'Variable',\n\n eval(context) {\n let variable, name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, function (frame) {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nconst Property = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nProperty.prototype = Object.assign(new Node(), {\n type: 'Property',\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, function (frame) {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Property;\n","import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\nconst Quoted = function(str, content, escaped, index, currentFileInfo) {\n this.escaped = (escaped === undefined) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n};\n\nQuoted.prototype = Object.assign(new Node(), {\n type: 'Quoted',\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n },\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n },\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = function (_, name1, name2) {\n const v = new Variable(`@${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = function (_, name1, name2) {\n const v = new Property(`$${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n },\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n});\n\nexport default Quoted;\n","import Node from './node';\n\nfunction escapePath(path) {\n return path.replace(/[()'\"\\s]/g, function(match) { return `\\\\${match}`; });\n}\n\nconst URL = function(val, index, currentFileInfo, isEvald) {\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n};\n\nURL.prototype = Object.assign(new Node(), {\n type: 'Url',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n});\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Media = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nMedia.prototype = Object.assign(new AtRule(), {\n type: 'Media',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\nimport Expression from './expression';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nconst Import = function(path, features, options, index, currentFileInfo, visibilityInfo) {\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n};\n\nImport.prototype = Object.assign(new Node(), {\n type: 'Import',\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n },\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n },\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n },\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n },\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n },\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n },\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(function (node) {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n },\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.features) {\n let featureValue = this.features.value;\n if (Array.isArray(featureValue) && featureValue.length >= 1) {\n const expr = featureValue[0];\n if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) {\n featureValue = expr.value;\n const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer'\n && featureValue[1].type === 'Paren';\n if (isLayer) {\n this.css = false;\n }\n }\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css || this.layerCss) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (this.layerCss) {\n newImport.css = this.layerCss;\n newImport.path._fileInfo = this._fileInfo;\n }\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else if (this.root) {\n if (this.features) {\n let featureValue = this.features.value;\n if (Array.isArray(featureValue) && featureValue.length === 1) {\n const expr = featureValue[0];\n if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) {\n featureValue = expr.value;\n const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer'\n && featureValue[1].type === 'Paren';\n if (isLayer) {\n this.layerCss = true;\n featureValue[0] = new Expression(featureValue.slice(0, 2));\n featureValue.splice(1, 1);\n featureValue[0].noSpacing = true;\n return this;\n }\n }\n }\n }\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n } else {\n if (this.features) {\n let featureValue = this.features.value;\n if (Array.isArray(featureValue) && featureValue.length >= 1) {\n featureValue = featureValue[0].value;\n if (Array.isArray(featureValue) && featureValue.length >= 2) {\n const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer'\n && featureValue[1].type === 'Paren';\n if (isLayer) {\n this.css = true;\n featureValue[0] = new Expression(featureValue.slice(0, 2));\n featureValue.splice(1, 1);\n featureValue[0].noSpacing = true;\n return this;\n }\n }\n }\n }\n return [];\n }\n }\n});\n\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nconst JsEvalNode = function() {};\n\nJsEvalNode.prototype = Object.assign(new Node(), {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, function (_, name) {\n return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context));\n });\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n // eslint-disable-next-line no-prototype-builtins\n if (variables.hasOwnProperty(k)) {\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n },\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n});\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nconst JavaScript = function(string, escaped, index, currentFileInfo) {\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nJavaScript.prototype = Object.assign(new JsEvalNode(), {\n type: 'JavaScript',\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n});\n\nexport default JavaScript;\n","import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n","import Node from './node';\n\nconst Condition = function(op, l, r, i, negate) {\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n};\n\nCondition.prototype = Object.assign(new Node(), {\n type: 'Condition',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n },\n\n eval(context) {\n const result = (function (op, a, b) {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n});\n\nexport default Condition;\n","import { copy } from 'copy-anything';\nimport Declaration from './declaration';\nimport Node from './node';\n\nconst QueryInParens = function (op, l, m, op2, r, i) {\n this.op = op.trim();\n this.lvalue = l;\n this.mvalue = m;\n this.op2 = op2 ? op2.trim() : null;\n this.rvalue = r;\n this._index = i;\n this.mvalues = [];\n};\n\nQueryInParens.prototype = Object.assign(new Node(), {\n type: 'QueryInParens',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.mvalue = visitor.visit(this.mvalue);\n if (this.rvalue) {\n this.rvalue = visitor.visit(this.rvalue);\n }\n },\n\n eval(context) {\n this.lvalue = this.lvalue.eval(context);\n \n let variableDeclaration;\n let rule;\n\n for (let i = 0; (rule = context.frames[i]); i++) {\n if (rule.type === 'Ruleset') {\n variableDeclaration = rule.rules.find(function (r) {\n if ((r instanceof Declaration) && r.variable) {\n return true;\n }\n\n return false;\n });\n \n if (variableDeclaration) {\n break;\n }\n }\n }\n\n if (!this.mvalueCopy) {\n this.mvalueCopy = copy(this.mvalue);\n }\n \n if (variableDeclaration) {\n this.mvalue = this.mvalueCopy;\n this.mvalue = this.mvalue.eval(context);\n this.mvalues.push(this.mvalue);\n } else {\n this.mvalue = this.mvalue.eval(context);\n }\n\n if (this.rvalue) {\n this.rvalue = this.rvalue.eval(context);\n }\n return this;\n },\n\n genCSS(context, output) {\n this.lvalue.genCSS(context, output);\n output.add(' ' + this.op + ' ');\n if (this.mvalues.length > 0) {\n this.mvalue = this.mvalues.shift();\n }\n this.mvalue.genCSS(context, output);\n if (this.rvalue) {\n output.add(' ' + this.op2 + ' ');\n this.rvalue.genCSS(context, output);\n }\n },\n});\n\nexport default QueryInParens;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Container = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nContainer.prototype = Object.assign(new AtRule(), {\n type: 'Container',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@container ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Container;\n","import Node from './node';\n\nconst UnicodeDescriptor = function(value) {\n this.value = value;\n}\n\nUnicodeDescriptor.prototype = Object.assign(new Node(), {\n type: 'UnicodeDescriptor'\n})\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nconst Negative = function(node) {\n this.value = node;\n};\n\nNegative.prototype = Object.assign(new Node(), {\n type: 'Negative',\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n },\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n});\n\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case '!all':\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nconst VariableCall = function(variable, index, currentFileInfo) {\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n};\n\nVariableCall.prototype = Object.assign(new Node(), {\n type: 'VariableCall',\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n});\n\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nconst NamespaceValue = function(ruleCall, lookups, index, fileInfo) {\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n};\n\nNamespaceValue.prototype = Object.assign(new Node(), {\n type: 'NamespaceValue',\n\n eval(context) {\n let i, name, rules = this.value.eval(context);\n \n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n});\n\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) {\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce(function (count, p) {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nDefinition.prototype = Object.assign(new Ruleset(), {\n type: 'MixinDefinition',\n evalFirst: true,\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n },\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n },\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n },\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n },\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n },\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n});\n\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nconst MixinCall = function(elements, args, index, currentFileInfo, important) {\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n};\n\nMixinCall.prototype = Object.assign(new Node(), {\n type: 'MixinCall',\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n },\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f, p, namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);};\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n },\n\n _setVisibilityToReplacement(replacement) {\n let i, rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n },\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n});\n\nexport default MixinCall;\n","import Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport QueryInParens from './query-in-parens';\nimport Paren from './paren';\nimport Media from './media';\nimport Container from './container';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, Container, QueryInParens, \n UnicodeDescriptor, Negative, Extend, VariableCall, \n NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n /**\n * Helper function, not part of API.\n * This should be replaceable by newer Node / Browser APIs\n * \n * @param {string} url \n * @param {string} baseUrl\n */\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^/?#]*\\/)|([/\\\\]))?((?:[^/\\\\?#]*[/\\\\])*)([^/\\\\?#]*)([#?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = function() {\n return null;\n }\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n\n let loader, registry, pluginObj, localModule, pluginManager, filename, result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = function(obj) {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport Expression from '../tree/expression';\nimport Operation from '../tree/operation';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n let a = 1\n /**\n * Comma-less syntax\n * e.g. rgb(0 128 255 / 50%)\n */\n if (r instanceof Expression) {\n const val = r.value\n r = val[0]\n g = val[1]\n b = val[2]\n /** \n * @todo - should this be normalized in\n * function caller? Or parsed differently?\n */\n if (b instanceof Operation) {\n const op = b\n b = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.rgba(r, g, b, a);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n let a = 1\n if (h instanceof Expression) {\n const val = h.value\n h = val[0]\n s = val[1]\n l = val[2]\n\n if (l instanceof Operation) {\n const op = l\n l = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.hsla(h, s, l, a);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Comment from '../tree/comment';\nimport Node from '../tree/node';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\nimport Value from '../tree/value';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n '~': function(...expr) {\n if (expr.length === 1) {\n return expr[0];\n }\n return new Value(expr);\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n const tryEval = val => {\n if (val instanceof Node) {\n return val.eval(this.context);\n }\n return val;\n };\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value.map(tryEval);\n } else {\n iterator = [tryEval(list.value)];\n }\n } else if (list.ruleset) {\n iterator = tryEval(list.ruleset).rules;\n } else if (list.rules) {\n iterator = list.rules.map(tryEval);\n } else if (Array.isArray(list)) {\n iterator = list.map(tryEval);\n } else {\n iterator = [tryEval(list)];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n continue;\n } else {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n try {\n return minMax.call(this, true, args);\n } catch (e) {}\n },\n max: function(...args) {\n try {\n return minMax.call(this, false, args);\n } catch (e) {}\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import Variable from '../tree/variable';\nimport Anonymous from '../tree/variable';\n\nconst styleExpression = function (args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n \n const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)];\n \n args = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n \n return new Anonymous(`style(${args})`);\n};\n\nexport default {\n style: function(...args) {\n try {\n return styleExpression.call(this, args);\n } catch (e) {}\n },\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\nimport style from './style';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n functionRegistry.addMultiple(style);\n\n return functions;\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default () => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = `<${gradientType}Gradient id=\"g\" ${gradientDirectionSvg}>`;\n\n for (i = 0; i < stops.length; i += 1) {\n if (stops[i] instanceof Expression) {\n color = stops[i].value[0];\n position = stops[i].value[1];\n } else {\n color = stops[i];\n position = undefined;\n }\n\n if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) {\n throwArgumentDescriptor();\n }\n positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';\n alpha = color.alpha;\n returner += ``;\n }\n returner += ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default function(root, options) {\n options = options || {};\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(function (k) {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (let i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (let i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n}\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nconst PluginManagerFactory = function(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","'use strict';\n\nfunction parseNodeVersion(version) {\n var match = version.match(/^v(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len\n if (!match) {\n throw new Error('Unable to parse: ' + version);\n }\n\n var res = {\n major: parseInt(match[1], 10),\n minor: parseInt(match[2], 10),\n patch: parseInt(match[3], 10),\n pre: match[4] || '',\n build: match[5] || '',\n };\n\n return res;\n}\n\nmodule.exports = parseNodeVersion;\n","import AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nconst FileManager = function() {}\nFileManager.prototype = Object.assign(new AbstractFileManager(), {\n alwaysMakePathsAbsolute() {\n return true;\n },\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n },\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n },\n\n supports() {\n return true;\n },\n\n clearFileCache() {\n fileCache = {};\n },\n\n loadFile(filename, currentDirectory, options) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n});\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import Environment from './environment/environment';\nimport data from './data';\nimport tree from './tree';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport functions from './functions';\nimport contexts from './contexts';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\nimport SourceMapOutput from './source-map-output';\nimport SourceMapBuilder from './source-map-builder';\nimport ParseTree from './parse-tree';\nimport ImportManager from './import-manager';\nimport Parse from './parse';\nimport Render from './render';\nimport { version } from '../../package.json';\nimport parseVersion from 'parse-node-version';\n\nexport default function(environment, fileManagers) {\n let sourceMapOutput, sourceMapBuilder, parseTree, importManager;\n\n environment = new Environment(environment, fileManagers);\n sourceMapOutput = SourceMapOutput(environment);\n sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment);\n parseTree = ParseTree(sourceMapBuilder);\n importManager = ImportManager(environment);\n\n const render = Render(environment, parseTree, importManager);\n const parse = Parse(environment, parseTree, importManager);\n\n const v = parseVersion(`v${version}`);\n const initial = {\n version: [v.major, v.minor, v.patch],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions: functions(environment),\n contexts,\n SourceMapOutput: sourceMapOutput,\n SourceMapBuilder: sourceMapBuilder,\n ParseTree: parseTree,\n ImportManager: importManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n\n const ctor = function(t) {\n return function() {\n const obj = Object.create(t.prototype);\n t.apply(obj, Array.prototype.slice.call(arguments, 0));\n return obj;\n };\n };\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n /**\n * Some of the functions assume a `this` context of the API object,\n * which causes it to fail when wrapped for ES6 imports.\n * \n * An assumed `this` should be removed in the future.\n */\n initial.parse = initial.parse.bind(api);\n initial.render = initial.render.bind(api);\n\n return api;\n}\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n","export default function (SourceMapOutput, environment) {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline, \n disableSourcemapAnnotation: this.options.disableSourcemapAnnotation\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (this.options.disableSourcemapAnnotation) {\n return '';\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n}\n","export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default function(environment) {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = {}; // Holds the imported parse trees.\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this, pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = function (e, root, fullPath) {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n // Inline imports aren't cached here.\n // If we start to cache them, please make sure they won't conflict with non-inline imports of the\n // same name as they used to do before this comment and the condition below have been added.\n if (!importManager.files[fullPath] && !importOptions.inline) {\n importManager.files[fullPath] = { root, options: importOptions };\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = function(loadedFile) {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n // import (multiple) parse trees apparently get altered and can't be cached.\n // TODO: investigate why this is\n if (importManager.files[resolvedFilename]\n && !importManager.files[resolvedFilename].options.multiple\n && !importOptions.multiple) {\n\n fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);\n }\n else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n }\n };\n let loadedFile;\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n\n if (context.syncImport) {\n loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n } else {\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n }\n else {\n if (context.syncImport) {\n loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);\n } else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n }\n if (loadedFile) {\n if (!loadedFile.filename) {\n fileParsedFunc(loadedFile);\n } else {\n loadFileCallback(loadedFile);\n }\n } else if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n}\n","import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default function(environment, ParseTree, ImportManager) {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n parse.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(function(plugin) {\n let evalResult, contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, function (e, root) {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n}\n","/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '
  • {content}
  • ';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `

    ${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `

    in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:

      ${errors.join('')}
    `;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
    Stack Trace
    ${e.stack.split('\\n').slice(1).join('
    ')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole() {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n /**\n * @todo remove when this is typed with JSDoc\n */\n // eslint-disable-next-line no-unused-vars\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","Object","prototype","hasOwnProperty","call","JSON","parse","_","browser","document","styles","sheet","id","concat","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","logger$1","error","msg","this","_fireEvent","warn","info","debug","addListener","listener","_listeners","push","removeListener","i_1","splice","type","i_2","logFunction","Environment","externalEnvironment","fileManagers","requiredFunctions","functions","propName","environmentFunc","bind","getFileManager","filename","currentDirectory","environment","isSync","logger","undefined","pluginManager","getFileManagers","fileManager","addFileManager","clearFileManagers","colors","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","unitConversions","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","data","Node","parent","visibilityBlocks","nodeVisible","rootNode","parsed","defineProperty","get","fileInfo","getIndex","setParent","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","isRulesetLike","toCSS","context","strs","genCSS","add","chunk","index","isEmpty","join","output","value","accept","visitor","visit","eval","_operate","op","a","b","fround","precision","numPrecision","Number","toFixed","compare","numericCompare","blocksVisibility","addVisibilityBlock","removeVisibilityBlock","ensureVisibility","ensureInvisibility","isVisible","visibilityInfo","copyVisibilityInfo","Color","rgb","originalForm","self","match","map","c","i","parseInt","alpha","split","clamp","v","max","min","toHex","round","toString","assign","luma","r","g","pow","doNotCompress","color","colorFunction","compress","args","indexOf","toHSL","h","l","toRGB","splitcolor","operate","other","d","toHSV","toARGB","x","fromKeyword","keyword","key","toLowerCase","slice","__assign","t","n","arguments","p","apply","SuppressedError","Paren","paren","noSpacing","_noSpaceCombinators"," ","|","Combinator","emptyOrWhitespace","trim","spaceOrEmpty","Element","combinator","isVariable","currentFileInfo","clone","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","RewriteUrls","getType","payload","copy","target","item","constructor","getPrototypeOf","getOwnPropertyNames","getOwnPropertySymbols","reduce","carry","props","includes","newVal","originalObject","includeNonenumerable","propType","propertyIsEnumerable","enumerable","writable","configurable","assignProp","nonenumerable","getLocation","inputStream","line","column","copyArray","arr","obj","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","isNullOrUndefined","val","anonymousFunc","LessError","fileContentMap","currentFilename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","create","F","isWarning","_a","stylize","str","type_1","errorTxt","substr","_visitArgs","visitDeeper","_hasIndexed","_noop","Visitor","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","child","typeIndex","tree","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","visitArray","nonReplacing","out","evald","flatten","nestedCnt","j","nestedItem","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","test","isPathLocalRelative","Eval","frames","importantScope","enterCalc","calcStack","inCalc","exitCalc","pop","inParenthesis","parensStack","outOfParenthesis","mathOn","isMathOn","pathRequiresRewrite","rewritePath","rootpath","newPath","normalizePath","segment","segments","reverse","ImportSequencer","onSequencerEmpty","imports","variableImports","_onSequencerEmpty","_currentDepth","addImport","callback","importSequencer","importItem","isReady","tryRun","addVariableImport","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","root","isFinished","visitImport","importNode","inlineCSS","inline","css","utils.copyArray","importParent","isVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","rules","onImported","sequencedOnImported","getPath","importedAtRoot","fullPath","importVisitor","isPlugin","isOptional","optional","duplicateImport","skip","importedFilename","oldContext","visitDeclaration","declNode","unshift","visitDeclarationOut","shift","visitAtRule","atRuleNode","declarations","isRooted","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","SetTreeVisibilityVisitor","visible","ExtendFinderVisitor","allExtendsStack","allExtends","extend","extendList","allSelectorsExtendList","ruleCnt","Extend","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","ruleset","firstExtendOnThisSelectorPath","selectors","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","filter","hasFoundMatches","parent_ids","selector","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","newSelector","targetExtend","newExtend","extendsToAdd","extendVisitor","object_id","selfSelectors","findMatch","selfSelector","extendSelector","option","extendChainCount","selectorOne","selectorTwo","ruleNode","visitSelector","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","elements","potentialMatches","allowBefore","matched","initialCombinator","isElementValuesEqual","finished","allowAfter","endPathIndex","endPathElementIndex","elementValue1","elementValue2","Attribute","Selector","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","createDerived","newAllExtends","lastIndex","JoinSelectorVisitor","getIsOutput","joinSelectors","multiMedia","CSSVisitorUtils","_context","containsSilentNonBlockedChild","bodyRules","rule","isSilent","keepOnlyVisibleChilds","owner","thing","hasVisibleSelector","resolveVisibility","compiledRulesBody","isVisibleRuleset","firstRoot","ToCSSVisitor","utils","variable","mixinNode","visitExtend","extendNode","visitComment","commentNode","originalRules","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","_mergeRules","name","charset","debugInfo","comment","Comment","checkValidNodes","isRoot","Declaration","Call","allowRoot","rulesets","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","ruleList","ruleCache","ruleCSS","groups","groupsArr","i_3","merge","group","result_1","space_1","comma_1","Expression","important","Value","visitors","MarkVisibleSelectorsVisitor","ExtendVisitor","getParserInput","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","isLineComment","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$peekChar","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","quote","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","len","level","parenLevel","emitFrom","emitChunk","force","String","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","functionRegistry","makeRegistry","base","_data","addMultiple","_this","keys","getLocalFunctions","inherit","MediaSyntaxOptions","queryInParens","ContainerSyntaxOptions","Anonymous","mapLines","rulesetLike","Boolean","Parser","currentIndex","parsers","quiet","toUpperCase","expect","arg","expectChar","getDebugInfo","lineNumber","fileName","parseNode","parseList","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","err","preText","disablePluginRule","plugin","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","Ruleset","primary","endInfo","processImports","mixin","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","k","customFuncCall","stop","declarationCall","validCall","substring","ruleProperty","f","ieAlpha","boolean","condition","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","detachedRuleset","assignment","expression","literal","dimension","unicodeDescriptor","entity","url","property","Variable","Property","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","parsedName","lookups","inValue","ruleLookups","VariableCall","NamespaceValue","isRule","first","element","getLookup","hasParens","parensIndex","parensWS","elem","elemIndex","re","isCall","expressionContainsNamed","nameLoop","expand","returner","variadic","expressions","hasSep","throwAwayComments","cond","params","argInfo","conditions","block","lookupValue","Quoted","attribute","slashedCombinator","isLess","when","ele","cif","content","blockRuleset","Definition","DetachedRuleset","dumpLineNumbers","strictImports","hasDR","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","variableRegex","propRegex","import","features","dir","importOptions","mediaFeatures","o","optionName","importOption","mediaFeature","syntaxOptions","rangeP","spacing","atomicCondition","rvalue","lvalue","prepareAndGetNestableAtRule","treeType","atRule","nestableAtRule","Media","Container","pluginArgs","atruleUnknown","hasBlock","atruleBlock","isKeywordList","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","unknownPackage","blockPackage","sub","addition","parens","colorOperand","Keyword","multiplication","operation","isSpaced","operand","parensInOp","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","negate","body","me","tryConditionFollowedByParenthesis","preparsedCond","delim","simpleProperty","vars","name_1","evaldCondition","getElements","mixinElements_","utils.isNullOrUndefined","mediaEmpty","els","importManager","createEmptySelectors","el","sels","olen","mixinElements","isJustParentSelector","True","False","MATH","asComment","ctx","asMediaQuery","filenameWithProtocol","lineSeparator","lastRule","prevMath","evaldValue","mathBypass","evalName","importantResult","makeImportant","isCompressed","defaultFunc","value_","error_","reset","_lookups","_variables","_properties","isRuleset","selCnt","hasVariable","hasOnePassingSelector","toParseSelectors","startingIndex","selectorFileInfo","utils.flattenArray","subRule","originalRuleset","allowImports","globalFunctionRegistry","ctxFrames","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","resetCache","bubbleSelectors","importRules","matchArgs","matchCondition","lastSelector","_rulesets","variables","hash","properties","name_2","decl","parseValue","lastDeclaration","toParse","transformDeclaration","nodes_1","filtRules","prependRule","find","foundMixins","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","currentElements","newSelectors","selectorsMultiplied","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","Unit","numerator","denominator","backupUnit","sort","strictUnits","returnStr","is","unitString","isLength","RegExp","isSingular","usedUnits","mapUnit","groupName","atomicUnit","cancel","counter","count","Dimension","unit","parseFloat","isNaN","toColor","strValue","convertTo","unify","conversions","targetUnit","applyUnit","derivedConversions","returnValue","doubleParen","NestableAtRulePrototype","evalFunction","expr","exprValues","evalTop","mediaPath","evalNested","permute","fragment","rest","AtRule","allDeclarations","declarationsBlock","allRulesetDeclarations_1","simpleBlock","mergeable","keywordList","outputRuleset","mediaPathBackup","mediaBlocksBackup","evalRoot","mergeRules","less","ampersandCount","noAmpersandCount","noAmpersands","allAmpersands","precedingSelectors","frame","value_1","mixedAmpersands","callEval","Operation","operands","functionCaller","isValid","evalArgs","commentFilter","subNodes","to","from","pack","ar","__spreadArray","calc","currentMathContext","funcCaller","FunctionCaller","columnNumber","evaluating","fun","vArr","escaped","containsVariables","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","name1","name2","URL","isEvald","urlArgs","Import","pathValue","reference","evalPath","doEval","registry","featureValue","layerCss","newImport","JsEvalNode","evaluateJavaScript","evalContext","javascriptEnabled","jsify","toJS","JavaScript","string","Assignment","Condition","QueryInParens","op2","mvalue","mvalues","variableDeclaration","mvalueCopy","UnicodeDescriptor","Negative","next_id","selectorElements","selfElements","ruleCall","arity","optionalParameters","required","evalParams","mixinEnv","evaldArguments","varargs","isNamedFound","argIndex","argsLength","evalCall","_arguments","mixinFrames","allArgsCnt","requiredArgsCnt","MixinCall","mixins","mixinPath","argValue","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","MixinDefinition","format","newRules","_setVisibilityToReplacement","replacement","AbstractFileManager","lastIndexOf","tryAppendExtension","ext","supportsSync","alwaysMakePathsAbsolute","isPathAbsolute","basePath","laterPath","pathDiff","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","rawDirectories","rawPath","fileUrl","AbstractPluginLoader","require","evalPlugin","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","exports","loader","validatePlugin","minVersion","compareVersion","addPlugin","setOptions","version","versionToString","aVersion","bVersion","versionString","printUsage","plugins","If","trueValue","falseValue","isdefined","colorFunctions","boolean$1","hsla","origColor","hsl","number","rgba","size","m1","m2","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","argb","tint","shade","colorBlend","mode","cb","cs","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","list","_SELF","~","_i","values","range","step","stepValue","each","rs","iterator","tryEval","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","flags","%","token","encodeURIComponent","isa","Type","isunit","types","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","styleExpression","style$1","style","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","transformTree","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","isPreEvalVisitor","isPreVisitor","pm","PluginManager","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","addPlugins","install","addVisitor","addPreProcessor","preProcessor","priority","indexToInsertAt","addPostProcessor","postProcessor","manager","getPostProcessors","getVisitors","PluginManagerFactory","newFactory","parseNodeVersion_1","major","minor","patch","pre","build","lessRoot","sourceMapOutput","sourceMapBuilder","parseTree","SourceMapBuilder","ParseTree","toCSSOptions","sourceMap","file_1","getExternalSourceMap","files","rootFilename","SourceMapOutput","contentsIgnoredCharsMap","contentsMap","sourceMapFilename","sourceMapURL","outputFilename","sourceMapOutputFilename","sourceMapBasepath","sourceMapRootpath","outputSourceFiles","sourceMapGenerator","sourceMapFileInline","disableSourcemapAnnotation","sourceMapInputFilename","normalizeFilename","removeBasepath","getCSSAppendage","setExternalSourceMap","isInline","getSourceMapURL","getOutputFilename","getInputFilename","_css","_rootNode","_contentsMap","_contentsIgnoredCharsMap","_sourceMapFilename","_outputFilename","_sourceMapBasepath","_sourceMapRootpath","_outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","source","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","ImportManager","rootFileInfo","mime","queue","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","loadedFile","promise","loadFileCallback","resolvedFilename","newEnv","syncImport","loadPluginSync","loadPlugin","loadFile","then","render","utils.copyOptions","self_1","Promise","resolve","reject","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","parseVersion","initial","ctor","api","fileCache","doXHR","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","supports","clearFileCache","location","useFileCache","lessText_1","webInfo","lastModified","Date","FM","log","fulfill","catch","ErrorReporting","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","loggers","console","LogListener","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;qOACM,SAAUA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,qBAAsB,IACrCA,QAAQ,qBAAsB,IAC9BA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,YAAa,KACrBA,QAAQ,MAAO,KAGR,SAAAC,EAAYC,EAASC,GACjC,GAAKA,EACL,IAAK,IAA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,EAAO/B,SAAU6hB,EAAK3hB,GACxCsrC,EAAKvnC,OAAOzB,KAAK,kBAAWtC,EAAMjB,KAAI,kBAAAmB,OAAiB,IAAI+oD,KAAS2E,EAAO,OAMnD,MAHxBE,IAIID,EAAoB,IAAI5E,KAAS0E,EACjCriB,EAAKvnC,OAAOzB,KAAK,uCAAuCpC,OAAA2tD,EAAqB,OAC7ElH,EAAQ,CACJgH,UAASA,EACTC,QAAOA,EACPC,kBAAiBA,EACjBb,OAAQ1hB,EAAK0hB,OAAOhsD,UAG5B4sD,EAAU,IAAI3E,OACf0D,EAAQp3B,GAGfi3B,EAAWj3B,OAInB+V,EAAKyiB,cAAgBvB,EACdlhB,EHrQEjqB,CAAKxf,OAAQ3C,IAU1B,SAAS8uD,GAAgBn/C,GACjBA,EAAKlL,UACLynD,QAAQ/oD,KAAKwM,GAEZ3P,GAAQ2oD,OACT1mD,GAAKM,YAAY47C,WAZzBx7C,OAAOypC,KAAOA,GAgBVpsC,GAAQ8rD,UACJ,SAAS3sC,KAAKxc,OAAO+mD,SAASzkB,OAC9BmH,GAAK2hB,QAGJ/tD,GAAQ2oD,QACTlmC,GAAM,oCACNxgB,GAAOrB,SAASqB,MAAQrB,SAASsB,qBAAqB,QAAQ,IAC9Di8C,GAAQv9C,SAASW,cAAc,UAEzBsC,KAAO,WACTs6C,GAAMz8C,WACNy8C,GAAMz8C,WAAWc,QAAUigB,GAE3B07B,GAAMx8C,YAAYf,SAASgB,eAAe6gB,KAG9CxgB,GAAKN,YAAYw8C,KAErB/R,GAAK+hB,iCACL/hB,GAAK2iB,iBAAmB3iB,GAAKoiB,QAAqB,gBAAbpiB,GAAK4e,KAAuB5D,KAAK0H,GAAiBA"} \ No newline at end of file diff --git a/package.json b/package.json index 507a85ba8..6304aa42c 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "github-changes": "^1.1.2", "husky": "~9.1.7", "npm-run-all": "^4.1.5", + "playwright": "1.50.1", "semver": "^6.3.1" }, "packageManager": "pnpm@8.15.0" diff --git a/packages/less/.eslintrc.js b/packages/less/.eslintrc.cjs similarity index 100% rename from packages/less/.eslintrc.js rename to packages/less/.eslintrc.cjs diff --git a/packages/less/.gitignore b/packages/less/.gitignore index 831c902ed..6ae03361c 100644 --- a/packages/less/.gitignore +++ b/packages/less/.gitignore @@ -1,9 +1,10 @@ # project-specific tmp -lib +dist test/browser/less.min.js test/browser/less.min.js.map test/sourcemaps/**/*.map test/sourcemaps/*.map test/sourcemaps/*.css -test/less-bom \ No newline at end of file +test/less-bom +lib/**/*.css.map \ No newline at end of file diff --git a/packages/less/Gruntfile.js b/packages/less/Gruntfile.cjs similarity index 94% rename from packages/less/Gruntfile.js rename to packages/less/Gruntfile.cjs index 6f81878de..51b09a057 100644 --- a/packages/less/Gruntfile.js +++ b/packages/less/Gruntfile.cjs @@ -193,27 +193,16 @@ module.exports = function(grunt) { } }, build: { - command: [ - /** Browser runtime */ - "node build/rollup.js --dist", - /** Node.js runtime */ - "npm run build" - ].join(" && ") + command: "node build/rollup.js --dist" }, testbuild: { - command: [ - "npm run build", - "node build/rollup.js --browser --out=./tmp/browser/less.min.js" - ].join(" && ") - }, - testcjs: { - command: "npm run build" + command: "node build/rollup.js --browser --out=./tmp/browser/less.min.js" }, testbrowser: { command: "node build/rollup.js --browser --out=./tmp/browser/less.min.js" }, test: { - command: 'npx ts-node test/test-es6.ts && node test/index.js' + command: 'node test/test-es6.js && node test/index.js' }, generatebrowser: { command: 'node test/browser/generator/generate.js' @@ -265,11 +254,11 @@ module.exports = function(grunt) { eslint: { target: [ "test/**/*.js", - "src/less*/**/*.js", + "lib/less*/**/*.js", "!test/less/errors/plugin/plugin-error.js" ], options: { - configFile: ".eslintrc.js", + configFile: ".eslintrc.cjs", fix: true } }, @@ -381,9 +370,8 @@ module.exports = function(grunt) { // Run shell plugin test grunt.registerTask("shell-plugin", ["shell:plugin"]); - // Quickly build and run Node tests + // Quickly run Node tests (no build step needed) grunt.registerTask("quicktest", [ - "shell:testcjs", "shell:test" ]); @@ -397,7 +385,6 @@ module.exports = function(grunt) { // Run benchmark grunt.registerTask("benchmark", [ - "shell:testcjs", "shell:benchmark" ]); }; diff --git a/packages/less/bin/lessc b/packages/less/bin/lessc index 93c5254a9..a2e07b127 100755 --- a/packages/less/bin/lessc +++ b/packages/less/bin/lessc @@ -2,18 +2,17 @@ /* eslint indent: [2, 2, {"SwitchCase": 1}] */ -'use strict'; +import path from 'path'; +import os from 'os'; +import { createRequire } from 'module'; +import fs from '../lib/less-node/fs.js'; +import * as utils from '../lib/less/utils.js'; +import * as Constants from '../lib/less/constants.js'; +import less from '../lib/less-node/index.js'; -var path = require('path'); -var fs = require('../lib/less-node/fs').default; -var os = require('os'); -var utils = require('../lib/less/utils'); -var Constants = require('../lib/less/constants'); - -var less = require('../lib/less-node').default; +const require = createRequire(import.meta.url); var errno; -var mkdirp; try { errno = require('errno'); @@ -108,22 +107,22 @@ function render() { } // Handle explicit sourceMapFullFilename (from --source-map=filename) - // Normalization of other options (sourceMapBasepath, sourceMapRootpath, etc.) + // Normalization of other options (sourceMapBasepath, sourceMapRootpath, etc.) // is handled automatically in parse-tree.js if (sourceMapOptions.sourceMapFullFilename && !sourceMapFileInline) { var mapFilename = path.resolve(process.cwd(), sourceMapOptions.sourceMapFullFilename); var mapDir = path.dirname(mapFilename); - + if (output) { var outputDir = path.dirname(output); // Set sourceMapOutputFilename relative to map directory sourceMapOptions.sourceMapOutputFilename = path.join( - path.relative(mapDir, outputDir), + path.relative(mapDir, outputDir), path.basename(output) ); // Set sourceMapFilename relative to output directory (for sourceMappingURL comment) sourceMapOptions.sourceMapFilename = path.join( - path.relative(outputDir, mapDir), + path.relative(outputDir, mapDir), path.basename(sourceMapOptions.sourceMapFullFilename) ); } else { @@ -151,6 +150,7 @@ function render() { return; } + var mkdirp; var ensureDirectory = function ensureDirectory(filepath) { var dir = path.dirname(filepath); var cmd; @@ -189,7 +189,7 @@ function render() { // To fix https://github.com/less/less.js/issues/3646 output = output.toString(); - + fs.writeFile(filename, output, 'utf8', function (err) { if (err) { var description = 'Error: '; @@ -404,7 +404,7 @@ function processPluginQueue() { case 'silent': options.silent = silent = true; break; - + case 'quiet': options.quiet = quiet = true; break; @@ -539,7 +539,7 @@ function processPluginQueue() { } break; - + case 'ie-compat': pendingDeprecations.push('Warning: The --ie-compat option is deprecated, as it has no effect on compilation.'); break; @@ -652,7 +652,7 @@ function processPluginQueue() { case 'disable-plugin-rule': options.disablePluginRule = true; break; - + default: queuePlugins.push({ name: arg, @@ -675,4 +675,4 @@ function processPluginQueue() { } else { render(); } -})(); \ No newline at end of file +})(); diff --git a/packages/less/build/banner.js b/packages/less/build/banner.js index 44074aac6..4557b6a23 100644 --- a/packages/less/build/banner.js +++ b/packages/less/build/banner.js @@ -1,10 +1,13 @@ +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); const pkg = require('./../package.json'); -module.exports = +export default `/** * Less - ${ pkg.description } v${ pkg.version } * http://lesscss.org - * + * * Copyright (c) 2009-${new Date().getFullYear()}, ${ pkg.author.name } <${ pkg.author.email }> * Licensed under the ${ pkg.license } License. * diff --git a/packages/less/build/rollup.js b/packages/less/build/rollup.js index f079f1400..c759a789d 100644 --- a/packages/less/build/rollup.js +++ b/packages/less/build/rollup.js @@ -1,21 +1,23 @@ -const rollup = require('rollup'); -const typescript = require('rollup-plugin-typescript2'); -const commonjs = require('@rollup/plugin-commonjs'); -const json = require('@rollup/plugin-json'); -const resolve = require('@rollup/plugin-node-resolve').nodeResolve; -const terser = require('rollup-plugin-terser').terser; -const banner = require('./banner'); -const path = require('path'); +import { rollup } from 'rollup'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import { nodeResolve as resolve } from '@rollup/plugin-node-resolve'; +import { terser } from 'rollup-plugin-terser'; +import banner from './banner.js'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import minimist from 'minimist'; +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const rootPath = path.join(__dirname, '..'); -const args = require('minimist')(process.argv.slice(2)); +const args = minimist(process.argv.slice(2)); let outDir = args.dist ? './dist' : './tmp'; async function buildBrowser() { - let bundle = await rollup.rollup({ - input: './src/less-browser/bootstrap.js', + let bundle = await rollup({ + input: './lib/less-browser/bootstrap.js', output: [ { file: 'less.js', @@ -30,18 +32,6 @@ async function buildBrowser() { resolve(), commonjs(), json(), - typescript({ - verbosity: 2, - tsconfigDefaults: { - compilerOptions: { - allowJs: true, - sourceMap: true, - target: 'ES5' - } - }, - include: [ '*.ts', '**/*.ts', '*.js', '**/*.js' ], - exclude: ['node_modules'] // only transpile our source code - }), terser({ compress: true, include: [/^.+\.min\.js$/], @@ -65,7 +55,7 @@ async function buildBrowser() { format: 'umd', name: 'less', banner - }); + }); } if (!args.out || args.out.indexOf('less.min.js') > -1) { diff --git a/packages/less/dist/less.js b/packages/less/dist/less.js deleted file mode 100644 index 0883ae41c..000000000 --- a/packages/less/dist/less.js +++ /dev/null @@ -1,11964 +0,0 @@ -/** - * Less - Leaner CSS v4.4.2 - * http://lesscss.org - * - * Copyright (c) 2009-2025, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - * @license Apache-2.0 - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.less = factory()); -})(this, (function () { 'use strict'; - - // Export a new default each time - function defaultOptions () { - return { - /* Inline Javascript - @plugin still allowed */ - javascriptEnabled: false, - /* Outputs a makefile import dependency list to stdout. */ - depends: false, - /* (DEPRECATED) Compress using less built-in compression. - * This does an okay job but does not utilise all the tricks of - * dedicated css compression. */ - compress: false, - /* Runs the less parser and just reports errors without any output. */ - lint: false, - /* Sets available include paths. - * If the file in an @import rule does not exist at that exact location, - * less will look for it at the location(s) passed to this option. - * You might use this for instance to specify a path to a library which - * you want to be referenced simply and relatively in the less files. */ - paths: [], - /* color output in the terminal */ - color: true, - /* The strictImports controls whether the compiler will allow an @import inside of either - * @media blocks or (a later addition) other selector blocks. - * See: https://github.com/less/less.js/issues/656 */ - strictImports: false, - /* Allow Imports from Insecure HTTPS Hosts */ - insecure: false, - /* Allows you to add a path to every generated import and url in your css. - * This does not affect less import statements that are processed, just ones - * that are left in the output css. */ - rootpath: '', - /* By default URLs are kept as-is, so if you import a file in a sub-directory - * that references an image, exactly the same URL will be output in the css. - * This option allows you to re-write URL's in imported files so that the - * URL is always relative to the base imported file */ - rewriteUrls: false, - /* How to process math - * 0 always - eagerly try to solve all operations - * 1 parens-division - require parens for division "/" - * 2 parens | strict - require parens for all operations - * 3 strict-legacy - legacy strict behavior (super-strict) - */ - math: 1, - /* Without this option, less attempts to guess at the output unit when it does maths. */ - strictUnits: false, - /* Effectively the declaration is put at the top of your base Less file, - * meaning it can be used but it also can be overridden if this variable - * is defined in the file. */ - globalVars: null, - /* As opposed to the global variable option, this puts the declaration at the - * end of your base file, meaning it will override anything defined in your Less file. */ - modifyVars: null, - /* This option allows you to specify a argument to go on to every URL. */ - urlArgs: '' - }; - } - - function extractId(href) { - return href.replace(/^[a-z-]+:\/+?[^/]+/, '') // Remove protocol & domain - .replace(/[?&]livereload=\w+/, '') // Remove LiveReload cachebuster - .replace(/^\//, '') // Remove root / - .replace(/\.[a-zA-Z]+$/, '') // Remove simple extension - .replace(/[^.\w-]+/g, '-') // Replace illegal characters - .replace(/\./g, ':'); // Replace dots with colons(for valid id) - } - function addDataAttr(options, tag) { - if (!tag) { - return; - } // in case of tag is null or undefined - for (var opt in tag.dataset) { - if (Object.prototype.hasOwnProperty.call(tag.dataset, opt)) { - if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') { - options[opt] = tag.dataset[opt]; - } - else { - try { - options[opt] = JSON.parse(tag.dataset[opt]); - } - catch (_) { } - } - } - } - } - - var browser = { - createCSS: function (document, styles, sheet) { - // Strip the query-string - var href = sheet.href || ''; - // If there is no title set, use the filename, minus the extension - var id = "less:".concat(sheet.title || extractId(href)); - // If this has already been inserted into the DOM, we may need to replace it - var oldStyleNode = document.getElementById(id); - var keepOldStyleNode = false; - // Create a new stylesheet node for insertion or (if necessary) replacement - var styleNode = document.createElement('style'); - styleNode.setAttribute('type', 'text/css'); - if (sheet.media) { - styleNode.setAttribute('media', sheet.media); - } - styleNode.id = id; - if (!styleNode.styleSheet) { - styleNode.appendChild(document.createTextNode(styles)); - // If new contents match contents of oldStyleNode, don't replace oldStyleNode - keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 && - oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue); - } - var head = document.getElementsByTagName('head')[0]; - // If there is no oldStyleNode, just append; otherwise, only append if we need - // to replace oldStyleNode with an updated stylesheet - if (oldStyleNode === null || keepOldStyleNode === false) { - var nextEl = sheet && sheet.nextSibling || null; - if (nextEl) { - nextEl.parentNode.insertBefore(styleNode, nextEl); - } - else { - head.appendChild(styleNode); - } - } - if (oldStyleNode && keepOldStyleNode === false) { - oldStyleNode.parentNode.removeChild(oldStyleNode); - } - // For IE. - // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash. - // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head - if (styleNode.styleSheet) { - try { - styleNode.styleSheet.cssText = styles; - } - catch (e) { - throw new Error('Couldn\'t reassign styleSheet.cssText.'); - } - } - }, - currentScript: function (window) { - var document = window.document; - return document.currentScript || (function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - })(); - } - }; - - var addDefaultOptions = (function (window, options) { - // use options from the current script tag data attribues - addDataAttr(options, browser.currentScript(window)); - if (options.isFileProtocol === undefined) { - options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol); - } - // Load styles asynchronously (default: false) - // - // This is set to `false` by default, so that the body - // doesn't start loading before the stylesheets are parsed. - // Setting this to `true` can result in flickering. - // - options.async = options.async || false; - options.fileAsync = options.fileAsync || false; - // Interval between watch polls - options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500); - options.env = options.env || (window.location.hostname == '127.0.0.1' || - window.location.hostname == '0.0.0.0' || - window.location.hostname == 'localhost' || - (window.location.port && - window.location.port.length > 0) || - options.isFileProtocol ? 'development' - : 'production'); - var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash); - if (dumpLineNumbers) { - options.dumpLineNumbers = dumpLineNumbers[1]; - } - if (options.useFileCache === undefined) { - options.useFileCache = true; - } - if (options.onReady === undefined) { - options.onReady = true; - } - if (options.relativeUrls) { - options.rewriteUrls = 'all'; - } - }); - - var logger$1 = { - error: function (msg) { - this._fireEvent('error', msg); - }, - warn: function (msg) { - this._fireEvent('warn', msg); - }, - info: function (msg) { - this._fireEvent('info', msg); - }, - debug: function (msg) { - this._fireEvent('debug', msg); - }, - addListener: function (listener) { - this._listeners.push(listener); - }, - removeListener: function (listener) { - for (var i_1 = 0; i_1 < this._listeners.length; i_1++) { - if (this._listeners[i_1] === listener) { - this._listeners.splice(i_1, 1); - return; - } - } - }, - _fireEvent: function (type, msg) { - for (var i_2 = 0; i_2 < this._listeners.length; i_2++) { - var logFunction = this._listeners[i_2][type]; - if (logFunction) { - logFunction(msg); - } - } - }, - _listeners: [] - }; - - /** - * @todo Document why this abstraction exists, and the relationship between - * environment, file managers, and plugin manager - */ - var Environment = /** @class */ (function () { - function Environment(externalEnvironment, fileManagers) { - this.fileManagers = fileManagers || []; - externalEnvironment = externalEnvironment || {}; - var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator']; - var requiredFunctions = []; - var functions = requiredFunctions.concat(optionalFunctions); - for (var i_1 = 0; i_1 < functions.length; i_1++) { - var propName = functions[i_1]; - var environmentFunc = externalEnvironment[propName]; - if (environmentFunc) { - this[propName] = environmentFunc.bind(externalEnvironment); - } - else if (i_1 < requiredFunctions.length) { - this.warn("missing required function in environment - ".concat(propName)); - } - } - } - Environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) { - if (!filename) { - logger$1.warn('getFileManager called with no filename.. Please report this issue. continuing.'); - } - if (currentDirectory === undefined) { - logger$1.warn('getFileManager called with null directory.. Please report this issue. continuing.'); - } - var fileManagers = this.fileManagers; - if (options.pluginManager) { - fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers()); - } - for (var i_2 = fileManagers.length - 1; i_2 >= 0; i_2--) { - var fileManager = fileManagers[i_2]; - if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) { - return fileManager; - } - } - return null; - }; - Environment.prototype.addFileManager = function (fileManager) { - this.fileManagers.push(fileManager); - }; - Environment.prototype.clearFileManagers = function () { - this.fileManagers = []; - }; - return Environment; - }()); - - var colors = { - 'aliceblue': '#f0f8ff', - 'antiquewhite': '#faebd7', - 'aqua': '#00ffff', - 'aquamarine': '#7fffd4', - 'azure': '#f0ffff', - 'beige': '#f5f5dc', - 'bisque': '#ffe4c4', - 'black': '#000000', - 'blanchedalmond': '#ffebcd', - 'blue': '#0000ff', - 'blueviolet': '#8a2be2', - 'brown': '#a52a2a', - 'burlywood': '#deb887', - 'cadetblue': '#5f9ea0', - 'chartreuse': '#7fff00', - 'chocolate': '#d2691e', - 'coral': '#ff7f50', - 'cornflowerblue': '#6495ed', - 'cornsilk': '#fff8dc', - 'crimson': '#dc143c', - 'cyan': '#00ffff', - 'darkblue': '#00008b', - 'darkcyan': '#008b8b', - 'darkgoldenrod': '#b8860b', - 'darkgray': '#a9a9a9', - 'darkgrey': '#a9a9a9', - 'darkgreen': '#006400', - 'darkkhaki': '#bdb76b', - 'darkmagenta': '#8b008b', - 'darkolivegreen': '#556b2f', - 'darkorange': '#ff8c00', - 'darkorchid': '#9932cc', - 'darkred': '#8b0000', - 'darksalmon': '#e9967a', - 'darkseagreen': '#8fbc8f', - 'darkslateblue': '#483d8b', - 'darkslategray': '#2f4f4f', - 'darkslategrey': '#2f4f4f', - 'darkturquoise': '#00ced1', - 'darkviolet': '#9400d3', - 'deeppink': '#ff1493', - 'deepskyblue': '#00bfff', - 'dimgray': '#696969', - 'dimgrey': '#696969', - 'dodgerblue': '#1e90ff', - 'firebrick': '#b22222', - 'floralwhite': '#fffaf0', - 'forestgreen': '#228b22', - 'fuchsia': '#ff00ff', - 'gainsboro': '#dcdcdc', - 'ghostwhite': '#f8f8ff', - 'gold': '#ffd700', - 'goldenrod': '#daa520', - 'gray': '#808080', - 'grey': '#808080', - 'green': '#008000', - 'greenyellow': '#adff2f', - 'honeydew': '#f0fff0', - 'hotpink': '#ff69b4', - 'indianred': '#cd5c5c', - 'indigo': '#4b0082', - 'ivory': '#fffff0', - 'khaki': '#f0e68c', - 'lavender': '#e6e6fa', - 'lavenderblush': '#fff0f5', - 'lawngreen': '#7cfc00', - 'lemonchiffon': '#fffacd', - 'lightblue': '#add8e6', - 'lightcoral': '#f08080', - 'lightcyan': '#e0ffff', - 'lightgoldenrodyellow': '#fafad2', - 'lightgray': '#d3d3d3', - 'lightgrey': '#d3d3d3', - 'lightgreen': '#90ee90', - 'lightpink': '#ffb6c1', - 'lightsalmon': '#ffa07a', - 'lightseagreen': '#20b2aa', - 'lightskyblue': '#87cefa', - 'lightslategray': '#778899', - 'lightslategrey': '#778899', - 'lightsteelblue': '#b0c4de', - 'lightyellow': '#ffffe0', - 'lime': '#00ff00', - 'limegreen': '#32cd32', - 'linen': '#faf0e6', - 'magenta': '#ff00ff', - 'maroon': '#800000', - 'mediumaquamarine': '#66cdaa', - 'mediumblue': '#0000cd', - 'mediumorchid': '#ba55d3', - 'mediumpurple': '#9370d8', - 'mediumseagreen': '#3cb371', - 'mediumslateblue': '#7b68ee', - 'mediumspringgreen': '#00fa9a', - 'mediumturquoise': '#48d1cc', - 'mediumvioletred': '#c71585', - 'midnightblue': '#191970', - 'mintcream': '#f5fffa', - 'mistyrose': '#ffe4e1', - 'moccasin': '#ffe4b5', - 'navajowhite': '#ffdead', - 'navy': '#000080', - 'oldlace': '#fdf5e6', - 'olive': '#808000', - 'olivedrab': '#6b8e23', - 'orange': '#ffa500', - 'orangered': '#ff4500', - 'orchid': '#da70d6', - 'palegoldenrod': '#eee8aa', - 'palegreen': '#98fb98', - 'paleturquoise': '#afeeee', - 'palevioletred': '#d87093', - 'papayawhip': '#ffefd5', - 'peachpuff': '#ffdab9', - 'peru': '#cd853f', - 'pink': '#ffc0cb', - 'plum': '#dda0dd', - 'powderblue': '#b0e0e6', - 'purple': '#800080', - 'rebeccapurple': '#663399', - 'red': '#ff0000', - 'rosybrown': '#bc8f8f', - 'royalblue': '#4169e1', - 'saddlebrown': '#8b4513', - 'salmon': '#fa8072', - 'sandybrown': '#f4a460', - 'seagreen': '#2e8b57', - 'seashell': '#fff5ee', - 'sienna': '#a0522d', - 'silver': '#c0c0c0', - 'skyblue': '#87ceeb', - 'slateblue': '#6a5acd', - 'slategray': '#708090', - 'slategrey': '#708090', - 'snow': '#fffafa', - 'springgreen': '#00ff7f', - 'steelblue': '#4682b4', - 'tan': '#d2b48c', - 'teal': '#008080', - 'thistle': '#d8bfd8', - 'tomato': '#ff6347', - 'turquoise': '#40e0d0', - 'violet': '#ee82ee', - 'wheat': '#f5deb3', - 'white': '#ffffff', - 'whitesmoke': '#f5f5f5', - 'yellow': '#ffff00', - 'yellowgreen': '#9acd32' - }; - - var unitConversions = { - length: { - 'm': 1, - 'cm': 0.01, - 'mm': 0.001, - 'in': 0.0254, - 'px': 0.0254 / 96, - 'pt': 0.0254 / 72, - 'pc': 0.0254 / 72 * 12 - }, - duration: { - 's': 1, - 'ms': 0.001 - }, - angle: { - 'rad': 1 / (2 * Math.PI), - 'deg': 1 / 360, - 'grad': 1 / 400, - 'turn': 1 - } - }; - - var data = { colors: colors, unitConversions: unitConversions }; - - /** - * The reason why Node is a class and other nodes simply do not extend - * from Node (since we're transpiling) is due to this issue: - * - * @see https://github.com/less/less.js/issues/3434 - */ - var Node = /** @class */ (function () { - function Node() { - this.parent = null; - this.visibilityBlocks = undefined; - this.nodeVisible = undefined; - this.rootNode = null; - this.parsed = null; - } - Object.defineProperty(Node.prototype, "currentFileInfo", { - get: function () { - return this.fileInfo(); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Node.prototype, "index", { - get: function () { - return this.getIndex(); - }, - enumerable: false, - configurable: true - }); - Node.prototype.setParent = function (nodes, parent) { - function set(node) { - if (node && node instanceof Node) { - node.parent = parent; - } - } - if (Array.isArray(nodes)) { - nodes.forEach(set); - } - else { - set(nodes); - } - }; - Node.prototype.getIndex = function () { - return this._index || (this.parent && this.parent.getIndex()) || 0; - }; - Node.prototype.fileInfo = function () { - return this._fileInfo || (this.parent && this.parent.fileInfo()) || {}; - }; - Node.prototype.isRulesetLike = function () { return false; }; - Node.prototype.toCSS = function (context) { - var strs = []; - this.genCSS(context, { - // remove when genCSS has JSDoc types - // eslint-disable-next-line no-unused-vars - add: function (chunk, fileInfo, index) { - strs.push(chunk); - }, - isEmpty: function () { - return strs.length === 0; - } - }); - return strs.join(''); - }; - Node.prototype.genCSS = function (context, output) { - output.add(this.value); - }; - Node.prototype.accept = function (visitor) { - this.value = visitor.visit(this.value); - }; - Node.prototype.eval = function () { return this; }; - Node.prototype._operate = function (context, op, a, b) { - switch (op) { - case '+': return a + b; - case '-': return a - b; - case '*': return a * b; - case '/': return a / b; - } - }; - Node.prototype.fround = function (context, value) { - var precision = context && context.numPrecision; - // add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded: - return (precision) ? Number((value + 2e-16).toFixed(precision)) : value; - }; - Node.compare = function (a, b) { - /* returns: - -1: a < b - 0: a = b - 1: a > b - and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */ - if ((a.compare) && - // for "symmetric results" force toCSS-based comparison - // of Quoted or Anonymous if either value is one of those - !(b.type === 'Quoted' || b.type === 'Anonymous')) { - return a.compare(b); - } - else if (b.compare) { - return -b.compare(a); - } - else if (a.type !== b.type) { - return undefined; - } - a = a.value; - b = b.value; - if (!Array.isArray(a)) { - return a === b ? 0 : undefined; - } - if (a.length !== b.length) { - return undefined; - } - for (var i_1 = 0; i_1 < a.length; i_1++) { - if (Node.compare(a[i_1], b[i_1]) !== 0) { - return undefined; - } - } - return 0; - }; - Node.numericCompare = function (a, b) { - return a < b ? -1 - : a === b ? 0 - : a > b ? 1 : undefined; - }; - // Returns true if this node represents root of ast imported by reference - Node.prototype.blocksVisibility = function () { - if (this.visibilityBlocks === undefined) { - this.visibilityBlocks = 0; - } - return this.visibilityBlocks !== 0; - }; - Node.prototype.addVisibilityBlock = function () { - if (this.visibilityBlocks === undefined) { - this.visibilityBlocks = 0; - } - this.visibilityBlocks = this.visibilityBlocks + 1; - }; - Node.prototype.removeVisibilityBlock = function () { - if (this.visibilityBlocks === undefined) { - this.visibilityBlocks = 0; - } - this.visibilityBlocks = this.visibilityBlocks - 1; - }; - // Turns on node visibility - if called node will be shown in output regardless - // of whether it comes from import by reference or not - Node.prototype.ensureVisibility = function () { - this.nodeVisible = true; - }; - // Turns off node visibility - if called node will NOT be shown in output regardless - // of whether it comes from import by reference or not - Node.prototype.ensureInvisibility = function () { - this.nodeVisible = false; - }; - // return values: - // false - the node must not be visible - // true - the node must be visible - // undefined or null - the node has the same visibility as its parent - Node.prototype.isVisible = function () { - return this.nodeVisible; - }; - Node.prototype.visibilityInfo = function () { - return { - visibilityBlocks: this.visibilityBlocks, - nodeVisible: this.nodeVisible - }; - }; - Node.prototype.copyVisibilityInfo = function (info) { - if (!info) { - return; - } - this.visibilityBlocks = info.visibilityBlocks; - this.nodeVisible = info.nodeVisible; - }; - return Node; - }()); - - // - // RGB Colors - #ff0014, #eee - // - var Color = function (rgb, a, originalForm) { - var self = this; - // - // The end goal here, is to parse the arguments - // into an integer triplet, such as `128, 255, 0` - // - // This facilitates operations and conversions. - // - if (Array.isArray(rgb)) { - this.rgb = rgb; - } - else if (rgb.length >= 6) { - this.rgb = []; - rgb.match(/.{2}/g).map(function (c, i) { - if (i < 3) { - self.rgb.push(parseInt(c, 16)); - } - else { - self.alpha = (parseInt(c, 16)) / 255; - } - }); - } - else { - this.rgb = []; - rgb.split('').map(function (c, i) { - if (i < 3) { - self.rgb.push(parseInt(c + c, 16)); - } - else { - self.alpha = (parseInt(c + c, 16)) / 255; - } - }); - } - this.alpha = this.alpha || (typeof a === 'number' ? a : 1); - if (typeof originalForm !== 'undefined') { - this.value = originalForm; - } - }; - Color.prototype = Object.assign(new Node(), { - type: 'Color', - luma: function () { - var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255; - r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4); - g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4); - b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4); - return 0.2126 * r + 0.7152 * g + 0.0722 * b; - }, - genCSS: function (context, output) { - output.add(this.toCSS(context)); - }, - toCSS: function (context, doNotCompress) { - var compress = context && context.compress && !doNotCompress; - var color; - var alpha; - var colorFunction; - var args = []; - // `value` is set if this color was originally - // converted from a named color string so we need - // to respect this and try to output named color too. - alpha = this.fround(context, this.alpha); - if (this.value) { - if (this.value.indexOf('rgb') === 0) { - if (alpha < 1) { - colorFunction = 'rgba'; - } - } - else if (this.value.indexOf('hsl') === 0) { - if (alpha < 1) { - colorFunction = 'hsla'; - } - else { - colorFunction = 'hsl'; - } - } - else { - return this.value; - } - } - else { - if (alpha < 1) { - colorFunction = 'rgba'; - } - } - switch (colorFunction) { - case 'rgba': - args = this.rgb.map(function (c) { - return clamp$1(Math.round(c), 255); - }).concat(clamp$1(alpha, 1)); - break; - case 'hsla': - args.push(clamp$1(alpha, 1)); - // eslint-disable-next-line no-fallthrough - case 'hsl': - color = this.toHSL(); - args = [ - this.fround(context, color.h), - "".concat(this.fround(context, color.s * 100), "%"), - "".concat(this.fround(context, color.l * 100), "%") - ].concat(args); - } - if (colorFunction) { - // Values are capped between `0` and `255`, rounded and zero-padded. - return "".concat(colorFunction, "(").concat(args.join(",".concat(compress ? '' : ' ')), ")"); - } - color = this.toRGB(); - if (compress) { - var splitcolor = color.split(''); - // Convert color to short format - if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) { - color = "#".concat(splitcolor[1]).concat(splitcolor[3]).concat(splitcolor[5]); - } - } - return color; - }, - // - // Operations have to be done per-channel, if not, - // channels will spill onto each other. Once we have - // our result, in the form of an integer triplet, - // we create a new Color node to hold the result. - // - operate: function (context, op, other) { - var rgb = new Array(3); - var alpha = this.alpha * (1 - other.alpha) + other.alpha; - for (var c = 0; c < 3; c++) { - rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]); - } - return new Color(rgb, alpha); - }, - toRGB: function () { - return toHex(this.rgb); - }, - toHSL: function () { - var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var s; - var l = (max + min) / 2; - var d = max - min; - if (max === min) { - h = s = 0; - } - else { - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - } - h /= 6; - } - return { h: h * 360, s: s, l: l, a: a }; - }, - // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - toHSV: function () { - var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var s; - var v = max; - var d = max - min; - if (max === 0) { - s = 0; - } - else { - s = d / max; - } - if (max === min) { - h = 0; - } - else { - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - } - h /= 6; - } - return { h: h * 360, s: s, v: v, a: a }; - }, - toARGB: function () { - return toHex([this.alpha * 255].concat(this.rgb)); - }, - compare: function (x) { - return (x.rgb && - x.rgb[0] === this.rgb[0] && - x.rgb[1] === this.rgb[1] && - x.rgb[2] === this.rgb[2] && - x.alpha === this.alpha) ? 0 : undefined; - } - }); - Color.fromKeyword = function (keyword) { - var c; - var key = keyword.toLowerCase(); - // eslint-disable-next-line no-prototype-builtins - if (colors.hasOwnProperty(key)) { - c = new Color(colors[key].slice(1)); - } - else if (key === 'transparent') { - c = new Color([0, 0, 0], 0); - } - if (c) { - c.value = keyword; - return c; - } - }; - function clamp$1(v, max) { - return Math.min(Math.max(v, 0), max); - } - function toHex(v) { - return "#".concat(v.map(function (c) { - c = clamp$1(Math.round(c), 255); - return (c < 16 ? '0' : '') + c.toString(16); - }).join('')); - } - - /****************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - - typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - var Paren = function (node) { - this.value = node; - }; - Paren.prototype = Object.assign(new Node(), { - type: 'Paren', - genCSS: function (context, output) { - output.add('('); - this.value.genCSS(context, output); - output.add(')'); - }, - eval: function (context) { - var paren = new Paren(this.value.eval(context)); - if (this.noSpacing) { - paren.noSpacing = true; - } - return paren; - } - }); - - var _noSpaceCombinators = { - '': true, - ' ': true, - '|': true - }; - var Combinator = function (value) { - if (value === ' ') { - this.value = ' '; - this.emptyOrWhitespace = true; - } - else { - this.value = value ? value.trim() : ''; - this.emptyOrWhitespace = this.value === ''; - } - }; - Combinator.prototype = Object.assign(new Node(), { - type: 'Combinator', - genCSS: function (context, output) { - var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' '; - output.add(spaceOrEmpty + this.value + spaceOrEmpty); - } - }); - - var Element = function (combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { - this.combinator = combinator instanceof Combinator ? - combinator : new Combinator(combinator); - if (typeof value === 'string') { - this.value = value.trim(); - } - else if (value) { - this.value = value; - } - else { - this.value = ''; - } - this.isVariable = isVariable; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.combinator, this); - }; - Element.prototype = Object.assign(new Node(), { - type: 'Element', - accept: function (visitor) { - var value = this.value; - this.combinator = visitor.visit(this.combinator); - if (typeof value === 'object') { - this.value = visitor.visit(value); - } - }, - eval: function (context) { - return new Element(this.combinator, this.value.eval ? this.value.eval(context) : this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - clone: function () { - return new Element(this.combinator, this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - genCSS: function (context, output) { - output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); - }, - toCSS: function (context) { - context = context || {}; - var value = this.value; - var firstSelector = context.firstSelector; - if (value instanceof Paren) { - // selector in parens should not be affected by outer selector - // flags (breaks only interpolated selectors - see #1973) - context.firstSelector = true; - } - value = value.toCSS ? value.toCSS(context) : value; - context.firstSelector = firstSelector; - if (value === '' && this.combinator.value.charAt(0) === '&') { - return ''; - } - else { - return this.combinator.toCSS(context) + value; - } - } - }); - - var Math$1 = { - ALWAYS: 0, - PARENS_DIVISION: 1, - PARENS: 2 - // removed - STRICT_LEGACY: 3 - }; - var RewriteUrls = { - OFF: 0, - LOCAL: 1, - ALL: 2 - }; - - /** - * Returns the object type of the given payload - * - * @param {*} payload - * @returns {string} - */ - function getType(payload) { - return Object.prototype.toString.call(payload).slice(8, -1); - } - /** - * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes) - * - * @param {*} payload - * @returns {payload is PlainObject} - */ - function isPlainObject(payload) { - if (getType(payload) !== 'Object') - return false; - return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype; - } - /** - * Returns whether the payload is an array - * - * @param {any} payload - * @returns {payload is any[]} - */ - function isArray(payload) { - return getType(payload) === 'Array'; - } - - function assignProp(carry, key, newVal, originalObject, includeNonenumerable) { - const propType = {}.propertyIsEnumerable.call(originalObject, key) - ? 'enumerable' - : 'nonenumerable'; - if (propType === 'enumerable') - carry[key] = newVal; - if (includeNonenumerable && propType === 'nonenumerable') { - Object.defineProperty(carry, key, { - value: newVal, - enumerable: false, - writable: true, - configurable: true, - }); - } - } - /** - * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked. - * - * @export - * @template T - * @param {T} target Target can be anything - * @param {Options} [options = {}] Options can be `props` or `nonenumerable` - * @returns {T} the target with replaced values - * @export - */ - function copy(target, options = {}) { - if (isArray(target)) { - return target.map((item) => copy(item, options)); - } - if (!isPlainObject(target)) { - return target; - } - const props = Object.getOwnPropertyNames(target); - const symbols = Object.getOwnPropertySymbols(target); - return [...props, ...symbols].reduce((carry, key) => { - if (isArray(options.props) && !options.props.includes(key)) { - return carry; - } - const val = target[key]; - const newVal = copy(val, options); - assignProp(carry, key, newVal, target, options.nonenumerable); - return carry; - }, {}); - } - - /* jshint proto: true */ - function getLocation(index, inputStream) { - var n = index + 1; - var line = null; - var column = -1; - while (--n >= 0 && inputStream.charAt(n) !== '\n') { - column++; - } - if (typeof index === 'number') { - line = (inputStream.slice(0, index).match(/\n/g) || '').length; - } - return { - line: line, - column: column - }; - } - function copyArray(arr) { - var i; - var length = arr.length; - var copy = new Array(length); - for (i = 0; i < length; i++) { - copy[i] = arr[i]; - } - return copy; - } - function clone(obj) { - var cloned = {}; - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - cloned[prop] = obj[prop]; - } - } - return cloned; - } - function defaults(obj1, obj2) { - var newObj = obj2 || {}; - if (!obj2._defaults) { - newObj = {}; - var defaults_1 = copy(obj1); - newObj._defaults = defaults_1; - var cloned = obj2 ? copy(obj2) : {}; - Object.assign(newObj, defaults_1, cloned); - } - return newObj; - } - function copyOptions(obj1, obj2) { - if (obj2 && obj2._defaults) { - return obj2; - } - var opts = defaults(obj1, obj2); - if (opts.strictMath) { - opts.math = Math$1.PARENS; - } - // Back compat with changed relativeUrls option - if (opts.relativeUrls) { - opts.rewriteUrls = RewriteUrls.ALL; - } - if (typeof opts.math === 'string') { - switch (opts.math.toLowerCase()) { - case 'always': - opts.math = Math$1.ALWAYS; - break; - case 'parens-division': - opts.math = Math$1.PARENS_DIVISION; - break; - case 'strict': - case 'parens': - opts.math = Math$1.PARENS; - break; - default: - opts.math = Math$1.PARENS; - } - } - if (typeof opts.rewriteUrls === 'string') { - switch (opts.rewriteUrls.toLowerCase()) { - case 'off': - opts.rewriteUrls = RewriteUrls.OFF; - break; - case 'local': - opts.rewriteUrls = RewriteUrls.LOCAL; - break; - case 'all': - opts.rewriteUrls = RewriteUrls.ALL; - break; - } - } - return opts; - } - function merge(obj1, obj2) { - for (var prop in obj2) { - if (Object.prototype.hasOwnProperty.call(obj2, prop)) { - obj1[prop] = obj2[prop]; - } - } - return obj1; - } - function flattenArray(arr, result) { - if (result === void 0) { result = []; } - for (var i_1 = 0, length_1 = arr.length; i_1 < length_1; i_1++) { - var value = arr[i_1]; - if (Array.isArray(value)) { - flattenArray(value, result); - } - else { - if (value !== undefined) { - result.push(value); - } - } - } - return result; - } - function isNullOrUndefined(val) { - return val === null || val === undefined; - } - - var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - getLocation: getLocation, - copyArray: copyArray, - clone: clone, - defaults: defaults, - copyOptions: copyOptions, - merge: merge, - flattenArray: flattenArray, - isNullOrUndefined: isNullOrUndefined - }); - - var anonymousFunc = /(|Function):(\d+):(\d+)/; - /** - * This is a centralized class of any error that could be thrown internally (mostly by the parser). - * Besides standard .message it keeps some additional data like a path to the file where the error - * occurred along with line and column numbers. - * - * @class - * @extends Error - * @type {module.LessError} - * - * @prop {string} type - * @prop {string} filename - * @prop {number} index - * @prop {number} line - * @prop {number} column - * @prop {number} callLine - * @prop {number} callExtract - * @prop {string[]} extract - * - * @param {Object} e - An error object to wrap around or just a descriptive object - * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager? - * @param {string} [currentFilename] - */ - var LessError = function (e, fileContentMap, currentFilename) { - Error.call(this); - var filename = e.filename || currentFilename; - this.message = e.message; - this.stack = e.stack; - if (fileContentMap && filename) { - var input = fileContentMap.contents[filename]; - var loc = getLocation(e.index, input); - var line = loc.line; - var col = loc.column; - var callLine = e.call && getLocation(e.call, input).line; - var lines = input ? input.split('\n') : ''; - this.type = e.type || 'Syntax'; - this.filename = filename; - this.index = e.index; - this.line = typeof line === 'number' ? line + 1 : null; - this.column = col; - if (!this.line && this.stack) { - var found = this.stack.match(anonymousFunc); - /** - * We have to figure out how this environment stringifies anonymous functions - * so we can correctly map plugin errors. - * - * Note, in Node 8, the output of anonymous funcs varied based on parameters - * being present or not, so we inject dummy params. - */ - var func = new Function('a', 'throw new Error()'); - var lineAdjust = 0; - try { - func(); - } - catch (e) { - var match = e.stack.match(anonymousFunc); - lineAdjust = 1 - parseInt(match[2]); - } - if (found) { - if (found[2]) { - this.line = parseInt(found[2]) + lineAdjust; - } - if (found[3]) { - this.column = parseInt(found[3]); - } - } - } - this.callLine = callLine + 1; - this.callExtract = lines[callLine]; - this.extract = [ - lines[this.line - 2], - lines[this.line - 1], - lines[this.line] - ]; - } - }; - if (typeof Object.create === 'undefined') { - var F = function () { }; - F.prototype = Error.prototype; - LessError.prototype = new F(); - } - else { - LessError.prototype = Object.create(Error.prototype); - } - LessError.prototype.constructor = LessError; - /** - * An overridden version of the default Object.prototype.toString - * which uses additional information to create a helpful message. - * - * @param {Object} options - * @returns {string} - */ - LessError.prototype.toString = function (options) { - var _a; - options = options || {}; - var isWarning = ((_a = this.type) !== null && _a !== void 0 ? _a : '').toLowerCase().includes('warning'); - var type = isWarning ? this.type : "".concat(this.type, "Error"); - var color = isWarning ? 'yellow' : 'red'; - var message = ''; - var extract = this.extract || []; - var error = []; - var stylize = function (str) { return str; }; - if (options.stylize) { - var type_1 = typeof options.stylize; - if (type_1 !== 'function') { - throw Error("options.stylize should be a function, got a ".concat(type_1, "!")); - } - stylize = options.stylize; - } - if (this.line !== null) { - if (!isWarning && typeof extract[0] === 'string') { - error.push(stylize("".concat(this.line - 1, " ").concat(extract[0]), 'grey')); - } - if (typeof extract[1] === 'string') { - var errorTxt = "".concat(this.line, " "); - if (extract[1]) { - errorTxt += extract[1].slice(0, this.column) + - stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') + - extract[1].slice(this.column + 1), 'red'), 'inverse'); - } - error.push(errorTxt); - } - if (!isWarning && typeof extract[2] === 'string') { - error.push(stylize("".concat(this.line + 1, " ").concat(extract[2]), 'grey')); - } - error = "".concat(error.join('\n') + stylize('', 'reset'), "\n"); - } - message += stylize("".concat(type, ": ").concat(this.message), color); - if (this.filename) { - message += stylize(' in ', color) + this.filename; - } - if (this.line) { - message += stylize(" on line ".concat(this.line, ", column ").concat(this.column + 1, ":"), 'grey'); - } - message += "\n".concat(error); - if (this.callLine) { - message += "".concat(stylize('from ', color) + (this.filename || ''), "/n"); - message += "".concat(stylize(this.callLine, 'grey'), " ").concat(this.callExtract, "/n"); - } - return message; - }; - - var _visitArgs = { visitDeeper: true }; - var _hasIndexed = false; - function _noop(node) { - return node; - } - function indexNodeTypes(parent, ticker) { - // add .typeIndex to tree node types for lookup table - var key, child; - for (key in parent) { - /* eslint guard-for-in: 0 */ - child = parent[key]; - switch (typeof child) { - case 'function': - // ignore bound functions directly on tree which do not have a prototype - // or aren't nodes - if (child.prototype && child.prototype.type) { - child.prototype.typeIndex = ticker++; - } - break; - case 'object': - ticker = indexNodeTypes(child, ticker); - break; - } - } - return ticker; - } - var Visitor = /** @class */ (function () { - function Visitor(implementation) { - this._implementation = implementation; - this._visitInCache = {}; - this._visitOutCache = {}; - if (!_hasIndexed) { - indexNodeTypes(tree, 1); - _hasIndexed = true; - } - } - Visitor.prototype.visit = function (node) { - if (!node) { - return node; - } - var nodeTypeIndex = node.typeIndex; - if (!nodeTypeIndex) { - // MixinCall args aren't a node type? - if (node.value && node.value.typeIndex) { - this.visit(node.value); - } - return node; - } - var impl = this._implementation; - var func = this._visitInCache[nodeTypeIndex]; - var funcOut = this._visitOutCache[nodeTypeIndex]; - var visitArgs = _visitArgs; - var fnName; - visitArgs.visitDeeper = true; - if (!func) { - fnName = "visit".concat(node.type); - func = impl[fnName] || _noop; - funcOut = impl["".concat(fnName, "Out")] || _noop; - this._visitInCache[nodeTypeIndex] = func; - this._visitOutCache[nodeTypeIndex] = funcOut; - } - if (func !== _noop) { - var newNode = func.call(impl, node, visitArgs); - if (node && impl.isReplacing) { - node = newNode; - } - } - if (visitArgs.visitDeeper && node) { - if (node.length) { - for (var i_1 = 0, cnt = node.length; i_1 < cnt; i_1++) { - if (node[i_1].accept) { - node[i_1].accept(this); - } - } - } - else if (node.accept) { - node.accept(this); - } - } - if (funcOut != _noop) { - funcOut.call(impl, node); - } - return node; - }; - Visitor.prototype.visitArray = function (nodes, nonReplacing) { - if (!nodes) { - return nodes; - } - var cnt = nodes.length; - var i; - // Non-replacing - if (nonReplacing || !this._implementation.isReplacing) { - for (i = 0; i < cnt; i++) { - this.visit(nodes[i]); - } - return nodes; - } - // Replacing - var out = []; - for (i = 0; i < cnt; i++) { - var evald = this.visit(nodes[i]); - if (evald === undefined) { - continue; - } - if (!evald.splice) { - out.push(evald); - } - else if (evald.length) { - this.flatten(evald, out); - } - } - return out; - }; - Visitor.prototype.flatten = function (arr, out) { - if (!out) { - out = []; - } - var cnt, i, item, nestedCnt, j, nestedItem; - for (i = 0, cnt = arr.length; i < cnt; i++) { - item = arr[i]; - if (item === undefined) { - continue; - } - if (!item.splice) { - out.push(item); - continue; - } - for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) { - nestedItem = item[j]; - if (nestedItem === undefined) { - continue; - } - if (!nestedItem.splice) { - out.push(nestedItem); - } - else if (nestedItem.length) { - this.flatten(nestedItem, out); - } - } - } - return out; - }; - return Visitor; - }()); - - var contexts = {}; - var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) { - if (!original) { - return; - } - for (var i_1 = 0; i_1 < propertiesToCopy.length; i_1++) { - if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i_1])) { - destination[propertiesToCopy[i_1]] = original[propertiesToCopy[i_1]]; - } - } - }; - /* - parse is used whilst parsing - */ - var parseCopyProperties = [ - // options - 'paths', - 'rewriteUrls', - 'rootpath', - 'strictImports', - 'insecure', - 'dumpLineNumbers', - 'compress', - 'syncImport', - 'chunkInput', - 'mime', - 'useFileCache', - // context - 'processImports', - // Used by the import manager to stop multiple import visitors being created. - 'pluginManager', - 'quiet', // option - whether to log warnings - ]; - contexts.Parse = function (options) { - copyFromOriginal(options, this, parseCopyProperties); - if (typeof this.paths === 'string') { - this.paths = [this.paths]; - } - }; - var evalCopyProperties = [ - 'paths', - 'compress', - 'math', - 'strictUnits', - 'sourceMap', - 'importMultiple', - 'urlArgs', - 'javascriptEnabled', - 'pluginManager', - 'importantScope', - 'rewriteUrls' // option - whether to adjust URL's to be relative - ]; - contexts.Eval = function (options, frames) { - copyFromOriginal(options, this, evalCopyProperties); - if (typeof this.paths === 'string') { - this.paths = [this.paths]; - } - this.frames = frames || []; - this.importantScope = this.importantScope || []; - }; - contexts.Eval.prototype.enterCalc = function () { - if (!this.calcStack) { - this.calcStack = []; - } - this.calcStack.push(true); - this.inCalc = true; - }; - contexts.Eval.prototype.exitCalc = function () { - this.calcStack.pop(); - if (!this.calcStack.length) { - this.inCalc = false; - } - }; - contexts.Eval.prototype.inParenthesis = function () { - if (!this.parensStack) { - this.parensStack = []; - } - this.parensStack.push(true); - }; - contexts.Eval.prototype.outOfParenthesis = function () { - this.parensStack.pop(); - }; - contexts.Eval.prototype.inCalc = false; - contexts.Eval.prototype.mathOn = true; - contexts.Eval.prototype.isMathOn = function (op) { - if (!this.mathOn) { - return false; - } - if (op === '/' && this.math !== Math$1.ALWAYS && (!this.parensStack || !this.parensStack.length)) { - return false; - } - if (this.math > Math$1.PARENS_DIVISION) { - return this.parensStack && this.parensStack.length; - } - return true; - }; - contexts.Eval.prototype.pathRequiresRewrite = function (path) { - var isRelative = this.rewriteUrls === RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative; - return isRelative(path); - }; - contexts.Eval.prototype.rewritePath = function (path, rootpath) { - var newPath; - rootpath = rootpath || ''; - newPath = this.normalizePath(rootpath + path); - // If a path was explicit relative and the rootpath was not an absolute path - // we must ensure that the new path is also explicit relative. - if (isPathLocalRelative(path) && - isPathRelative(rootpath) && - isPathLocalRelative(newPath) === false) { - newPath = "./".concat(newPath); - } - return newPath; - }; - contexts.Eval.prototype.normalizePath = function (path) { - var segments = path.split('/').reverse(); - var segment; - path = []; - while (segments.length !== 0) { - segment = segments.pop(); - switch (segment) { - case '.': - break; - case '..': - if ((path.length === 0) || (path[path.length - 1] === '..')) { - path.push(segment); - } - else { - path.pop(); - } - break; - default: - path.push(segment); - break; - } - } - return path.join('/'); - }; - function isPathRelative(path) { - return !/^(?:[a-z-]+:|\/|#)/i.test(path); - } - function isPathLocalRelative(path) { - return path.charAt(0) === '.'; - } - // todo - do the same for the toCSS ? - - var ImportSequencer = /** @class */ (function () { - function ImportSequencer(onSequencerEmpty) { - this.imports = []; - this.variableImports = []; - this._onSequencerEmpty = onSequencerEmpty; - this._currentDepth = 0; - } - ImportSequencer.prototype.addImport = function (callback) { - var importSequencer = this, importItem = { - callback: callback, - args: null, - isReady: false - }; - this.imports.push(importItem); - return function () { - importItem.args = Array.prototype.slice.call(arguments, 0); - importItem.isReady = true; - importSequencer.tryRun(); - }; - }; - ImportSequencer.prototype.addVariableImport = function (callback) { - this.variableImports.push(callback); - }; - ImportSequencer.prototype.tryRun = function () { - this._currentDepth++; - try { - while (true) { - while (this.imports.length > 0) { - var importItem = this.imports[0]; - if (!importItem.isReady) { - return; - } - this.imports = this.imports.slice(1); - importItem.callback.apply(null, importItem.args); - } - if (this.variableImports.length === 0) { - break; - } - var variableImport = this.variableImports[0]; - this.variableImports = this.variableImports.slice(1); - variableImport(); - } - } - finally { - this._currentDepth--; - } - if (this._currentDepth === 0 && this._onSequencerEmpty) { - this._onSequencerEmpty(); - } - }; - return ImportSequencer; - }()); - - /* eslint-disable no-unused-vars */ - var ImportVisitor = function (importer, finish) { - this._visitor = new Visitor(this); - this._importer = importer; - this._finish = finish; - this.context = new contexts.Eval(); - this.importCount = 0; - this.onceFileDetectionMap = {}; - this.recursionDetector = {}; - this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this)); - }; - ImportVisitor.prototype = { - isReplacing: false, - run: function (root) { - try { - // process the contents - this._visitor.visit(root); - } - catch (e) { - this.error = e; - } - this.isFinished = true; - this._sequencer.tryRun(); - }, - _onSequencerEmpty: function () { - if (!this.isFinished) { - return; - } - this._finish(this.error); - }, - visitImport: function (importNode, visitArgs) { - var inlineCSS = importNode.options.inline; - if (!importNode.css || inlineCSS) { - var context = new contexts.Eval(this.context, copyArray(this.context.frames)); - var importParent = context.frames[0]; - this.importCount++; - if (importNode.isVariableImport()) { - this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent)); - } - else { - this.processImportNode(importNode, context, importParent); - } - } - visitArgs.visitDeeper = false; - }, - processImportNode: function (importNode, context, importParent) { - var evaldImportNode; - var inlineCSS = importNode.options.inline; - try { - evaldImportNode = importNode.evalForImport(context); - } - catch (e) { - if (!e.filename) { - e.index = importNode.getIndex(); - e.filename = importNode.fileInfo().filename; - } - // attempt to eval properly and treat as css - importNode.css = true; - // if that fails, this error will be thrown - importNode.error = e; - } - if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) { - if (evaldImportNode.options.multiple) { - context.importMultiple = true; - } - // try appending if we haven't determined if it is css or not - var tryAppendLessExtension = evaldImportNode.css === undefined; - for (var i_1 = 0; i_1 < importParent.rules.length; i_1++) { - if (importParent.rules[i_1] === importNode) { - importParent.rules[i_1] = evaldImportNode; - break; - } - } - var onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported); - this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(), evaldImportNode.options, sequencedOnImported); - } - else { - this.importCount--; - if (this.isFinished) { - this._sequencer.tryRun(); - } - } - }, - onImported: function (importNode, context, e, root, importedAtRoot, fullPath) { - if (e) { - if (!e.filename) { - e.index = importNode.getIndex(); - e.filename = importNode.fileInfo().filename; - } - this.error = e; - } - var importVisitor = this, inlineCSS = importNode.options.inline, isPlugin = importNode.options.isPlugin, isOptional = importNode.options.optional, duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector; - if (!context.importMultiple) { - if (duplicateImport) { - importNode.skip = true; - } - else { - importNode.skip = function () { - if (fullPath in importVisitor.onceFileDetectionMap) { - return true; - } - importVisitor.onceFileDetectionMap[fullPath] = true; - return false; - }; - } - } - if (!fullPath && isOptional) { - importNode.skip = true; - } - if (root) { - importNode.root = root; - importNode.importedFilename = fullPath; - if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) { - importVisitor.recursionDetector[fullPath] = true; - var oldContext = this.context; - this.context = context; - try { - this._visitor.visit(root); - } - catch (e) { - this.error = e; - } - this.context = oldContext; - } - } - importVisitor.importCount--; - if (importVisitor.isFinished) { - importVisitor._sequencer.tryRun(); - } - }, - visitDeclaration: function (declNode, visitArgs) { - if (declNode.value.type === 'DetachedRuleset') { - this.context.frames.unshift(declNode); - } - else { - visitArgs.visitDeeper = false; - } - }, - visitDeclarationOut: function (declNode) { - if (declNode.value.type === 'DetachedRuleset') { - this.context.frames.shift(); - } - }, - visitAtRule: function (atRuleNode, visitArgs) { - if (atRuleNode.value) { - this.context.frames.unshift(atRuleNode); - } - else if (atRuleNode.declarations && atRuleNode.declarations.length) { - if (atRuleNode.isRooted) { - this.context.frames.unshift(atRuleNode); - } - else { - this.context.frames.unshift(atRuleNode.declarations[0]); - } - } - else if (atRuleNode.rules && atRuleNode.rules.length) { - this.context.frames.unshift(atRuleNode); - } - }, - visitAtRuleOut: function (atRuleNode) { - this.context.frames.shift(); - }, - visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { - this.context.frames.unshift(mixinDefinitionNode); - }, - visitMixinDefinitionOut: function (mixinDefinitionNode) { - this.context.frames.shift(); - }, - visitRuleset: function (rulesetNode, visitArgs) { - this.context.frames.unshift(rulesetNode); - }, - visitRulesetOut: function (rulesetNode) { - this.context.frames.shift(); - }, - visitMedia: function (mediaNode, visitArgs) { - this.context.frames.unshift(mediaNode.rules[0]); - }, - visitMediaOut: function (mediaNode) { - this.context.frames.shift(); - } - }; - - var SetTreeVisibilityVisitor = /** @class */ (function () { - function SetTreeVisibilityVisitor(visible) { - this.visible = visible; - } - SetTreeVisibilityVisitor.prototype.run = function (root) { - this.visit(root); - }; - SetTreeVisibilityVisitor.prototype.visitArray = function (nodes) { - if (!nodes) { - return nodes; - } - var cnt = nodes.length; - var i; - for (i = 0; i < cnt; i++) { - this.visit(nodes[i]); - } - return nodes; - }; - SetTreeVisibilityVisitor.prototype.visit = function (node) { - if (!node) { - return node; - } - if (node.constructor === Array) { - return this.visitArray(node); - } - if (!node.blocksVisibility || node.blocksVisibility()) { - return node; - } - if (this.visible) { - node.ensureVisibility(); - } - else { - node.ensureInvisibility(); - } - node.accept(this); - return node; - }; - return SetTreeVisibilityVisitor; - }()); - - /* eslint-disable no-unused-vars */ - /* jshint loopfunc:true */ - var ExtendFinderVisitor = /** @class */ (function () { - function ExtendFinderVisitor() { - this._visitor = new Visitor(this); - this.contexts = []; - this.allExtendsStack = [[]]; - } - ExtendFinderVisitor.prototype.run = function (root) { - root = this._visitor.visit(root); - root.allExtends = this.allExtendsStack[0]; - return root; - }; - ExtendFinderVisitor.prototype.visitDeclaration = function (declNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ExtendFinderVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ExtendFinderVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { - if (rulesetNode.root) { - return; - } - var i; - var j; - var extend; - var allSelectorsExtendList = []; - var extendList; - // get &:extend(.a); rules which apply to all selectors in this ruleset - var rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0; - for (i = 0; i < ruleCnt; i++) { - if (rulesetNode.rules[i] instanceof tree.Extend) { - allSelectorsExtendList.push(rules[i]); - rulesetNode.extendOnEveryPath = true; - } - } - // now find every selector and apply the extends that apply to all extends - // and the ones which apply to an individual extend - var paths = rulesetNode.paths; - for (i = 0; i < paths.length; i++) { - var selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList; - extendList = selExtendList ? copyArray(selExtendList).concat(allSelectorsExtendList) - : allSelectorsExtendList; - if (extendList) { - extendList = extendList.map(function (allSelectorsExtend) { - return allSelectorsExtend.clone(); - }); - } - for (j = 0; j < extendList.length; j++) { - this.foundExtends = true; - extend = extendList[j]; - extend.findSelfSelectors(selectorPath); - extend.ruleset = rulesetNode; - if (j === 0) { - extend.firstExtendOnThisSelectorPath = true; - } - this.allExtendsStack[this.allExtendsStack.length - 1].push(extend); - } - } - this.contexts.push(rulesetNode.selectors); - }; - ExtendFinderVisitor.prototype.visitRulesetOut = function (rulesetNode) { - if (!rulesetNode.root) { - this.contexts.length = this.contexts.length - 1; - } - }; - ExtendFinderVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { - mediaNode.allExtends = []; - this.allExtendsStack.push(mediaNode.allExtends); - }; - ExtendFinderVisitor.prototype.visitMediaOut = function (mediaNode) { - this.allExtendsStack.length = this.allExtendsStack.length - 1; - }; - ExtendFinderVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { - atRuleNode.allExtends = []; - this.allExtendsStack.push(atRuleNode.allExtends); - }; - ExtendFinderVisitor.prototype.visitAtRuleOut = function (atRuleNode) { - this.allExtendsStack.length = this.allExtendsStack.length - 1; - }; - return ExtendFinderVisitor; - }()); - var ProcessExtendsVisitor = /** @class */ (function () { - function ProcessExtendsVisitor() { - this._visitor = new Visitor(this); - } - ProcessExtendsVisitor.prototype.run = function (root) { - var extendFinder = new ExtendFinderVisitor(); - this.extendIndices = {}; - extendFinder.run(root); - if (!extendFinder.foundExtends) { - return root; - } - root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends)); - this.allExtendsStack = [root.allExtends]; - var newRoot = this._visitor.visit(root); - this.checkExtendsForNonMatched(root.allExtends); - return newRoot; - }; - ProcessExtendsVisitor.prototype.checkExtendsForNonMatched = function (extendList) { - var indices = this.extendIndices; - extendList.filter(function (extend) { - return !extend.hasFoundMatches && extend.parent_ids.length == 1; - }).forEach(function (extend) { - var selector = '_unknown_'; - try { - selector = extend.selector.toCSS({}); - } - catch (_) { } - if (!indices["".concat(extend.index, " ").concat(selector)]) { - indices["".concat(extend.index, " ").concat(selector)] = true; - /** - * @todo Shouldn't this be an error? To alert the developer - * that they may have made an error in the selector they are - * targeting? - */ - logger$1.warn("WARNING: extend '".concat(selector, "' has no matches")); - } - }); - }; - ProcessExtendsVisitor.prototype.doExtendChaining = function (extendsList, extendsListTarget, iterationCount) { - // - // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering - // and pasting the selector we would do normally, but we are also adding an extend with the same target selector - // this means this new extend can then go and alter other extends - // - // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors - // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already - // processed if we look at each selector at a time, as is done in visitRuleset - var extendIndex; - var targetExtendIndex; - var matches; - var extendsToAdd = []; - var newSelector; - var extendVisitor = this; - var selectorPath; - var extend; - var targetExtend; - var newExtend; - iterationCount = iterationCount || 0; - // loop through comparing every extend with every target extend. - // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place - // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one - // and the second is the target. - // the separation into two lists allows us to process a subset of chains with a bigger set, as is the - // case when processing media queries - for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) { - for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) { - extend = extendsList[extendIndex]; - targetExtend = extendsListTarget[targetExtendIndex]; - // look for circular references - if (extend.parent_ids.indexOf(targetExtend.object_id) >= 0) { - continue; - } - // find a match in the target extends self selector (the bit before :extend) - selectorPath = [targetExtend.selfSelectors[0]]; - matches = extendVisitor.findMatch(extend, selectorPath); - if (matches.length) { - extend.hasFoundMatches = true; - // we found a match, so for each self selector.. - extend.selfSelectors.forEach(function (selfSelector) { - var info = targetExtend.visibilityInfo(); - // process the extend as usual - newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible()); - // but now we create a new extend from it - newExtend = new (tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info); - newExtend.selfSelectors = newSelector; - // add the extend onto the list of extends for that selector - newSelector[newSelector.length - 1].extendList = [newExtend]; - // record that we need to add it. - extendsToAdd.push(newExtend); - newExtend.ruleset = targetExtend.ruleset; - // remember its parents for circular references - newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids); - // only process the selector once.. if we have :extend(.a,.b) then multiple - // extends will look at the same selector path, so when extending - // we know that any others will be duplicates in terms of what is added to the css - if (targetExtend.firstExtendOnThisSelectorPath) { - newExtend.firstExtendOnThisSelectorPath = true; - targetExtend.ruleset.paths.push(newSelector); - } - }); - } - } - } - if (extendsToAdd.length) { - // try to detect circular references to stop a stack overflow. - // may no longer be needed. - this.extendChainCount++; - if (iterationCount > 100) { - var selectorOne = '{unable to calculate}'; - var selectorTwo = '{unable to calculate}'; - try { - selectorOne = extendsToAdd[0].selfSelectors[0].toCSS(); - selectorTwo = extendsToAdd[0].selector.toCSS(); - } - catch (e) { } - throw { message: "extend circular reference detected. One of the circular extends is currently:".concat(selectorOne, ":extend(").concat(selectorTwo, ")") }; - } - // now process the new extends on the existing rules so that we can handle a extending b extending c extending - // d extending e... - return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1)); - } - else { - return extendsToAdd; - } - }; - ProcessExtendsVisitor.prototype.visitDeclaration = function (ruleNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ProcessExtendsVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ProcessExtendsVisitor.prototype.visitSelector = function (selectorNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - ProcessExtendsVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { - if (rulesetNode.root) { - return; - } - var matches; - var pathIndex; - var extendIndex; - var allExtends = this.allExtendsStack[this.allExtendsStack.length - 1]; - var selectorsToAdd = []; - var extendVisitor = this; - var selectorPath; - // look at each selector path in the ruleset, find any extend matches and then copy, find and replace - for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { - for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) { - selectorPath = rulesetNode.paths[pathIndex]; - // extending extends happens initially, before the main pass - if (rulesetNode.extendOnEveryPath) { - continue; - } - var extendList = selectorPath[selectorPath.length - 1].extendList; - if (extendList && extendList.length) { - continue; - } - matches = this.findMatch(allExtends[extendIndex], selectorPath); - if (matches.length) { - allExtends[extendIndex].hasFoundMatches = true; - allExtends[extendIndex].selfSelectors.forEach(function (selfSelector) { - var extendedSelectors; - extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible()); - selectorsToAdd.push(extendedSelectors); - }); - } - } - } - rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd); - }; - ProcessExtendsVisitor.prototype.findMatch = function (extend, haystackSelectorPath) { - // - // look through the haystack selector path to try and find the needle - extend.selector - // returns an array of selector matches that can then be replaced - // - var haystackSelectorIndex; - var hackstackSelector; - var hackstackElementIndex; - var haystackElement; - var targetCombinator; - var i; - var extendVisitor = this; - var needleElements = extend.selector.elements; - var potentialMatches = []; - var potentialMatch; - var matches = []; - // loop through the haystack elements - for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) { - hackstackSelector = haystackSelectorPath[haystackSelectorIndex]; - for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) { - haystackElement = hackstackSelector.elements[hackstackElementIndex]; - // if we allow elements before our match we can add a potential match every time. otherwise only at the first element. - if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) { - potentialMatches.push({ pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, - initialCombinator: haystackElement.combinator }); - } - for (i = 0; i < potentialMatches.length; i++) { - potentialMatch = potentialMatches[i]; - // selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't - // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to - // work out what the resulting combinator will be - targetCombinator = haystackElement.combinator.value; - if (targetCombinator === '' && hackstackElementIndex === 0) { - targetCombinator = ' '; - } - // if we don't match, null our match to indicate failure - if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || - (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) { - potentialMatch = null; - } - else { - potentialMatch.matched++; - } - // if we are still valid and have finished, test whether we have elements after and whether these are allowed - if (potentialMatch) { - potentialMatch.finished = potentialMatch.matched === needleElements.length; - if (potentialMatch.finished && - (!extend.allowAfter && - (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) { - potentialMatch = null; - } - } - // if null we remove, if not, we are still valid, so either push as a valid match or continue - if (potentialMatch) { - if (potentialMatch.finished) { - potentialMatch.length = needleElements.length; - potentialMatch.endPathIndex = haystackSelectorIndex; - potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match - potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again - matches.push(potentialMatch); - } - } - else { - potentialMatches.splice(i, 1); - i--; - } - } - } - } - return matches; - }; - ProcessExtendsVisitor.prototype.isElementValuesEqual = function (elementValue1, elementValue2) { - if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') { - return elementValue1 === elementValue2; - } - if (elementValue1 instanceof tree.Attribute) { - if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) { - return false; - } - if (!elementValue1.value || !elementValue2.value) { - if (elementValue1.value || elementValue2.value) { - return false; - } - return true; - } - elementValue1 = elementValue1.value.value || elementValue1.value; - elementValue2 = elementValue2.value.value || elementValue2.value; - return elementValue1 === elementValue2; - } - elementValue1 = elementValue1.value; - elementValue2 = elementValue2.value; - if (elementValue1 instanceof tree.Selector) { - if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) { - return false; - } - for (var i_1 = 0; i_1 < elementValue1.elements.length; i_1++) { - if (elementValue1.elements[i_1].combinator.value !== elementValue2.elements[i_1].combinator.value) { - if (i_1 !== 0 || (elementValue1.elements[i_1].combinator.value || ' ') !== (elementValue2.elements[i_1].combinator.value || ' ')) { - return false; - } - } - if (!this.isElementValuesEqual(elementValue1.elements[i_1].value, elementValue2.elements[i_1].value)) { - return false; - } - } - return true; - } - return false; - }; - ProcessExtendsVisitor.prototype.extendSelector = function (matches, selectorPath, replacementSelector, isVisible) { - // for a set of matches, replace each match with the replacement selector - var currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements; - for (matchIndex = 0; matchIndex < matches.length; matchIndex++) { - match = matches[matchIndex]; - selector = selectorPath[match.pathIndex]; - firstElement = new tree.Element(match.initialCombinator, replacementSelector.elements[0].value, replacementSelector.elements[0].isVariable, replacementSelector.elements[0].getIndex(), replacementSelector.elements[0].fileInfo()); - if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1] - .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); - currentSelectorPathElementIndex = 0; - currentSelectorPathIndex++; - } - newElements = selector.elements - .slice(currentSelectorPathElementIndex, match.index) - .concat([firstElement]) - .concat(replacementSelector.elements.slice(1)); - if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) { - path[path.length - 1].elements = - path[path.length - 1].elements.concat(newElements); - } - else { - path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex)); - path.push(new tree.Selector(newElements)); - } - currentSelectorPathIndex = match.endPathIndex; - currentSelectorPathElementIndex = match.endPathElementIndex; - if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) { - currentSelectorPathElementIndex = 0; - currentSelectorPathIndex++; - } - } - if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1] - .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); - currentSelectorPathIndex++; - } - path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length)); - path = path.map(function (currentValue) { - // we can re-use elements here, because the visibility property matters only for selectors - var derived = currentValue.createDerived(currentValue.elements); - if (isVisible) { - derived.ensureVisibility(); - } - else { - derived.ensureInvisibility(); - } - return derived; - }); - return path; - }; - ProcessExtendsVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { - var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); - newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends)); - this.allExtendsStack.push(newAllExtends); - }; - ProcessExtendsVisitor.prototype.visitMediaOut = function (mediaNode) { - var lastIndex = this.allExtendsStack.length - 1; - this.allExtendsStack.length = lastIndex; - }; - ProcessExtendsVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { - var newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); - newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends)); - this.allExtendsStack.push(newAllExtends); - }; - ProcessExtendsVisitor.prototype.visitAtRuleOut = function (atRuleNode) { - var lastIndex = this.allExtendsStack.length - 1; - this.allExtendsStack.length = lastIndex; - }; - return ProcessExtendsVisitor; - }()); - - /* eslint-disable no-unused-vars */ - var JoinSelectorVisitor = /** @class */ (function () { - function JoinSelectorVisitor() { - this.contexts = [[]]; - this._visitor = new Visitor(this); - } - JoinSelectorVisitor.prototype.run = function (root) { - return this._visitor.visit(root); - }; - JoinSelectorVisitor.prototype.visitDeclaration = function (declNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - JoinSelectorVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { - visitArgs.visitDeeper = false; - }; - JoinSelectorVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - var paths = []; - var selectors; - this.contexts.push(paths); - if (!rulesetNode.root) { - selectors = rulesetNode.selectors; - if (selectors) { - selectors = selectors.filter(function (selector) { return selector.getIsOutput(); }); - rulesetNode.selectors = selectors.length ? selectors : (selectors = null); - if (selectors) { - rulesetNode.joinSelectors(paths, context, selectors); - } - } - if (!selectors) { - rulesetNode.rules = null; - } - rulesetNode.paths = paths; - } - }; - JoinSelectorVisitor.prototype.visitRulesetOut = function (rulesetNode) { - this.contexts.length = this.contexts.length - 1; - }; - JoinSelectorVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia); - }; - JoinSelectorVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { - var context = this.contexts[this.contexts.length - 1]; - if (atRuleNode.declarations && atRuleNode.declarations.length) { - atRuleNode.declarations[0].root = (context.length === 0 || context[0].multiMedia); - } - else if (atRuleNode.rules && atRuleNode.rules.length) { - atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null); - } - }; - return JoinSelectorVisitor; - }()); - - /* eslint-disable no-unused-vars */ - var CSSVisitorUtils = /** @class */ (function () { - function CSSVisitorUtils(context) { - this._visitor = new Visitor(this); - this._context = context; - } - CSSVisitorUtils.prototype.containsSilentNonBlockedChild = function (bodyRules) { - var rule; - if (!bodyRules) { - return false; - } - for (var r = 0; r < bodyRules.length; r++) { - rule = bodyRules[r]; - if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) { - // the atrule contains something that was referenced (likely by extend) - // therefore it needs to be shown in output too - return true; - } - } - return false; - }; - CSSVisitorUtils.prototype.keepOnlyVisibleChilds = function (owner) { - if (owner && owner.rules) { - owner.rules = owner.rules.filter(function (thing) { return thing.isVisible(); }); - } - }; - CSSVisitorUtils.prototype.isEmpty = function (owner) { - return (owner && owner.rules) - ? (owner.rules.length === 0) : true; - }; - CSSVisitorUtils.prototype.hasVisibleSelector = function (rulesetNode) { - return (rulesetNode && rulesetNode.paths) - ? (rulesetNode.paths.length > 0) : false; - }; - CSSVisitorUtils.prototype.resolveVisibility = function (node) { - if (!node.blocksVisibility()) { - if (this.isEmpty(node)) { - return; - } - return node; - } - var compiledRulesBody = node.rules[0]; - this.keepOnlyVisibleChilds(compiledRulesBody); - if (this.isEmpty(compiledRulesBody)) { - return; - } - node.ensureVisibility(); - node.removeVisibilityBlock(); - return node; - }; - CSSVisitorUtils.prototype.isVisibleRuleset = function (rulesetNode) { - if (rulesetNode.firstRoot) { - return true; - } - if (this.isEmpty(rulesetNode)) { - return false; - } - if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) { - return false; - } - return true; - }; - return CSSVisitorUtils; - }()); - var ToCSSVisitor = function (context) { - this._visitor = new Visitor(this); - this._context = context; - this.utils = new CSSVisitorUtils(context); - }; - ToCSSVisitor.prototype = { - isReplacing: true, - run: function (root) { - return this._visitor.visit(root); - }, - visitDeclaration: function (declNode, visitArgs) { - if (declNode.blocksVisibility() || declNode.variable) { - return; - } - return declNode; - }, - visitMixinDefinition: function (mixinNode, visitArgs) { - // mixin definitions do not get eval'd - this means they keep state - // so we have to clear that state here so it isn't used if toCSS is called twice - mixinNode.frames = []; - }, - visitExtend: function (extendNode, visitArgs) { - }, - visitComment: function (commentNode, visitArgs) { - if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) { - return; - } - return commentNode; - }, - visitMedia: function (mediaNode, visitArgs) { - var originalRules = mediaNode.rules[0].rules; - mediaNode.accept(this._visitor); - visitArgs.visitDeeper = false; - return this.utils.resolveVisibility(mediaNode, originalRules); - }, - visitImport: function (importNode, visitArgs) { - if (importNode.blocksVisibility()) { - return; - } - return importNode; - }, - visitAtRule: function (atRuleNode, visitArgs) { - if (atRuleNode.rules && atRuleNode.rules.length) { - return this.visitAtRuleWithBody(atRuleNode, visitArgs); - } - else { - return this.visitAtRuleWithoutBody(atRuleNode, visitArgs); - } - }, - visitAnonymous: function (anonymousNode, visitArgs) { - if (!anonymousNode.blocksVisibility()) { - anonymousNode.accept(this._visitor); - return anonymousNode; - } - }, - visitAtRuleWithBody: function (atRuleNode, visitArgs) { - // if there is only one nested ruleset and that one has no path, then it is - // just fake ruleset - function hasFakeRuleset(atRuleNode) { - var bodyRules = atRuleNode.rules; - return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0); - } - function getBodyRules(atRuleNode) { - var nodeRules = atRuleNode.rules; - if (hasFakeRuleset(atRuleNode)) { - return nodeRules[0].rules; - } - return nodeRules; - } - // it is still true that it is only one ruleset in array - // this is last such moment - // process childs - var originalRules = getBodyRules(atRuleNode); - atRuleNode.accept(this._visitor); - visitArgs.visitDeeper = false; - if (!this.utils.isEmpty(atRuleNode)) { - this._mergeRules(atRuleNode.rules[0].rules); - } - return this.utils.resolveVisibility(atRuleNode, originalRules); - }, - visitAtRuleWithoutBody: function (atRuleNode, visitArgs) { - if (atRuleNode.blocksVisibility()) { - return; - } - if (atRuleNode.name === '@charset') { - // Only output the debug info together with subsequent @charset definitions - // a comment (or @media statement) before the actual @charset atrule would - // be considered illegal css as it has to be on the first line - if (this.charset) { - if (atRuleNode.debugInfo) { - var comment = new tree.Comment("/* ".concat(atRuleNode.toCSS(this._context).replace(/\n/g, ''), " */\n")); - comment.debugInfo = atRuleNode.debugInfo; - return this._visitor.visit(comment); - } - return; - } - this.charset = true; - } - return atRuleNode; - }, - checkValidNodes: function (rules, isRoot) { - if (!rules) { - return; - } - for (var i_1 = 0; i_1 < rules.length; i_1++) { - var ruleNode = rules[i_1]; - if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) { - throw { message: 'Properties must be inside selector blocks. They cannot be in the root', - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; - } - if (ruleNode instanceof tree.Call) { - throw { message: "Function '".concat(ruleNode.name, "' did not return a root node"), - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; - } - if (ruleNode.type && !ruleNode.allowRoot) { - throw { message: "".concat(ruleNode.type, " node returned by a function is not valid here"), - index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; - } - } - }, - visitRuleset: function (rulesetNode, visitArgs) { - // at this point rulesets are nested into each other - var rule; - var rulesets = []; - this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot); - if (!rulesetNode.root) { - // remove invisible paths - this._compileRulesetPaths(rulesetNode); - // remove rulesets from this ruleset body and compile them separately - var nodeRules = rulesetNode.rules; - var nodeRuleCnt = nodeRules ? nodeRules.length : 0; - for (var i_2 = 0; i_2 < nodeRuleCnt;) { - rule = nodeRules[i_2]; - if (rule && rule.rules) { - // visit because we are moving them out from being a child - rulesets.push(this._visitor.visit(rule)); - nodeRules.splice(i_2, 1); - nodeRuleCnt--; - continue; - } - i_2++; - } - // accept the visitor to remove rules and refactor itself - // then we can decide nogw whether we want it or not - // compile body - if (nodeRuleCnt > 0) { - rulesetNode.accept(this._visitor); - } - else { - rulesetNode.rules = null; - } - visitArgs.visitDeeper = false; - } - else { // if (! rulesetNode.root) { - rulesetNode.accept(this._visitor); - visitArgs.visitDeeper = false; - } - if (rulesetNode.rules) { - this._mergeRules(rulesetNode.rules); - this._removeDuplicateRules(rulesetNode.rules); - } - // now decide whether we keep the ruleset - if (this.utils.isVisibleRuleset(rulesetNode)) { - rulesetNode.ensureVisibility(); - rulesets.splice(0, 0, rulesetNode); - } - if (rulesets.length === 1) { - return rulesets[0]; - } - return rulesets; - }, - _compileRulesetPaths: function (rulesetNode) { - if (rulesetNode.paths) { - rulesetNode.paths = rulesetNode.paths - .filter(function (p) { - var i; - if (p[0].elements[0].combinator.value === ' ') { - p[0].elements[0].combinator = new (tree.Combinator)(''); - } - for (i = 0; i < p.length; i++) { - if (p[i].isVisible() && p[i].getIsOutput()) { - return true; - } - } - return false; - }); - } - }, - _removeDuplicateRules: function (rules) { - if (!rules) { - return; - } - // remove duplicates - var ruleCache = {}; - var ruleList; - var rule; - var i; - for (i = rules.length - 1; i >= 0; i--) { - rule = rules[i]; - if (rule instanceof tree.Declaration) { - if (!ruleCache[rule.name]) { - ruleCache[rule.name] = rule; - } - else { - ruleList = ruleCache[rule.name]; - if (ruleList instanceof tree.Declaration) { - ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)]; - } - var ruleCSS = rule.toCSS(this._context); - if (ruleList.indexOf(ruleCSS) !== -1) { - rules.splice(i, 1); - } - else { - ruleList.push(ruleCSS); - } - } - } - } - }, - _mergeRules: function (rules) { - if (!rules) { - return; - } - var groups = {}; - var groupsArr = []; - for (var i_3 = 0; i_3 < rules.length; i_3++) { - var rule = rules[i_3]; - if (rule.merge) { - var key = rule.name; - groups[key] ? rules.splice(i_3--, 1) : - groupsArr.push(groups[key] = []); - groups[key].push(rule); - } - } - groupsArr.forEach(function (group) { - if (group.length > 0) { - var result_1 = group[0]; - var space_1 = []; - var comma_1 = [new tree.Expression(space_1)]; - group.forEach(function (rule) { - if ((rule.merge === '+') && (space_1.length > 0)) { - comma_1.push(new tree.Expression(space_1 = [])); - } - space_1.push(rule.value); - result_1.important = result_1.important || rule.important; - }); - result_1.value = new tree.Value(comma_1); - } - }); - } - }; - - var visitors = { - Visitor: Visitor, - ImportVisitor: ImportVisitor, - MarkVisibleSelectorsVisitor: SetTreeVisibilityVisitor, - ExtendVisitor: ProcessExtendsVisitor, - JoinSelectorVisitor: JoinSelectorVisitor, - ToCSSVisitor: ToCSSVisitor - }; - - // Split the input into chunks. - function chunker (input, fail) { - var len = input.length; - var level = 0; - var parenLevel = 0; - var lastOpening; - var lastOpeningParen; - var lastMultiComment; - var lastMultiCommentEndBrace; - var chunks = []; - var emitFrom = 0; - var chunkerCurrentIndex; - var currentChunkStartIndex; - var cc; - var cc2; - var matched; - function emitChunk(force) { - var len = chunkerCurrentIndex - emitFrom; - if (((len < 512) && !force) || !len) { - return; - } - chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1)); - emitFrom = chunkerCurrentIndex + 1; - } - for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc = input.charCodeAt(chunkerCurrentIndex); - if (((cc >= 97) && (cc <= 122)) || (cc < 34)) { - // a-z or whitespace - continue; - } - switch (cc) { - case 40: // ( - parenLevel++; - lastOpeningParen = chunkerCurrentIndex; - continue; - case 41: // ) - if (--parenLevel < 0) { - return fail('missing opening `(`', chunkerCurrentIndex); - } - continue; - case 59: // ; - if (!parenLevel) { - emitChunk(); - } - continue; - case 123: // { - level++; - lastOpening = chunkerCurrentIndex; - continue; - case 125: // } - if (--level < 0) { - return fail('missing opening `{`', chunkerCurrentIndex); - } - if (!level && !parenLevel) { - emitChunk(); - } - continue; - case 92: // \ - if (chunkerCurrentIndex < len - 1) { - chunkerCurrentIndex++; - continue; - } - return fail('unescaped `\\`', chunkerCurrentIndex); - case 34: - case 39: - case 96: // ", ' and ` - matched = 0; - currentChunkStartIndex = chunkerCurrentIndex; - for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if (cc2 > 96) { - continue; - } - if (cc2 == cc) { - matched = 1; - break; - } - if (cc2 == 92) { // \ - if (chunkerCurrentIndex == len - 1) { - return fail('unescaped `\\`', chunkerCurrentIndex); - } - chunkerCurrentIndex++; - } - } - if (matched) { - continue; - } - return fail("unmatched `".concat(String.fromCharCode(cc), "`"), currentChunkStartIndex); - case 47: // /, check for comment - if (parenLevel || (chunkerCurrentIndex == len - 1)) { - continue; - } - cc2 = input.charCodeAt(chunkerCurrentIndex + 1); - if (cc2 == 47) { - // //, find lnfeed - for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { - break; - } - } - } - else if (cc2 == 42) { - // /*, find */ - lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex; - for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) { - cc2 = input.charCodeAt(chunkerCurrentIndex); - if (cc2 == 125) { - lastMultiCommentEndBrace = chunkerCurrentIndex; - } - if (cc2 != 42) { - continue; - } - if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { - break; - } - } - if (chunkerCurrentIndex == len - 1) { - return fail('missing closing `*/`', currentChunkStartIndex); - } - chunkerCurrentIndex++; - } - continue; - case 42: // *, check for unmatched */ - if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) { - return fail('unmatched `/*`', chunkerCurrentIndex); - } - continue; - } - } - if (level !== 0) { - if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) { - return fail('missing closing `}` or `*/`', lastOpening); - } - else { - return fail('missing closing `}`', lastOpening); - } - } - else if (parenLevel !== 0) { - return fail('missing closing `)`', lastOpeningParen); - } - emitChunk(true); - return chunks; - } - - var getParserInput = (function () { - var // Less input string - input; - var // current chunk - j; - var // holds state for backtracking - saveStack = []; - var // furthest index the parser has gone to - furthest; - var // if this is furthest we got to, this is the probably cause - furthestPossibleErrorMessage; - var // chunkified input - chunks; - var // current chunk - current; - var // index of current chunk, in `input` - currentPos; - var parserInput = {}; - var CHARCODE_SPACE = 32; - var CHARCODE_TAB = 9; - var CHARCODE_LF = 10; - var CHARCODE_CR = 13; - var CHARCODE_PLUS = 43; - var CHARCODE_COMMA = 44; - var CHARCODE_FORWARD_SLASH = 47; - var CHARCODE_9 = 57; - function skipWhitespace(length) { - var oldi = parserInput.i; - var oldj = j; - var curr = parserInput.i - currentPos; - var endIndex = parserInput.i + current.length - curr; - var mem = (parserInput.i += length); - var inp = input; - var c; - var nextChar; - var comment; - for (; parserInput.i < endIndex; parserInput.i++) { - c = inp.charCodeAt(parserInput.i); - if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) { - nextChar = inp.charAt(parserInput.i + 1); - if (nextChar === '/') { - comment = { index: parserInput.i, isLineComment: true }; - var nextNewLine = inp.indexOf('\n', parserInput.i + 2); - if (nextNewLine < 0) { - nextNewLine = endIndex; - } - parserInput.i = nextNewLine; - comment.text = inp.substr(comment.index, parserInput.i - comment.index); - parserInput.commentStore.push(comment); - continue; - } - else if (nextChar === '*') { - var nextStarSlash = inp.indexOf('*/', parserInput.i + 2); - if (nextStarSlash >= 0) { - comment = { - index: parserInput.i, - text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i), - isLineComment: false - }; - parserInput.i += comment.text.length - 1; - parserInput.commentStore.push(comment); - continue; - } - } - break; - } - if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) { - break; - } - } - current = current.slice(length + parserInput.i - mem + curr); - currentPos = parserInput.i; - if (!current.length) { - if (j < chunks.length - 1) { - current = chunks[++j]; - skipWhitespace(0); // skip space at the beginning of a chunk - return true; // things changed - } - parserInput.finished = true; - } - return oldi !== parserInput.i || oldj !== j; - } - parserInput.save = function () { - currentPos = parserInput.i; - saveStack.push({ current: current, i: parserInput.i, j: j }); - }; - parserInput.restore = function (possibleErrorMessage) { - if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) { - furthest = parserInput.i; - furthestPossibleErrorMessage = possibleErrorMessage; - } - var state = saveStack.pop(); - current = state.current; - currentPos = parserInput.i = state.i; - j = state.j; - }; - parserInput.forget = function () { - saveStack.pop(); - }; - parserInput.isWhitespace = function (offset) { - var pos = parserInput.i + (offset || 0); - var code = input.charCodeAt(pos); - return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF); - }; - // Specialization of $(tok) - parserInput.$re = function (tok) { - if (parserInput.i > currentPos) { - current = current.slice(parserInput.i - currentPos); - currentPos = parserInput.i; - } - var m = tok.exec(current); - if (!m) { - return null; - } - skipWhitespace(m[0].length); - if (typeof m === 'string') { - return m; - } - return m.length === 1 ? m[0] : m; - }; - parserInput.$char = function (tok) { - if (input.charAt(parserInput.i) !== tok) { - return null; - } - skipWhitespace(1); - return tok; - }; - parserInput.$peekChar = function (tok) { - if (input.charAt(parserInput.i) !== tok) { - return null; - } - return tok; - }; - parserInput.$str = function (tok) { - var tokLength = tok.length; - // https://jsperf.com/string-startswith/21 - for (var i_1 = 0; i_1 < tokLength; i_1++) { - if (input.charAt(parserInput.i + i_1) !== tok.charAt(i_1)) { - return null; - } - } - skipWhitespace(tokLength); - return tok; - }; - parserInput.$quoted = function (loc) { - var pos = loc || parserInput.i; - var startChar = input.charAt(pos); - if (startChar !== '\'' && startChar !== '"') { - return; - } - var length = input.length; - var currentPosition = pos; - for (var i_2 = 1; i_2 + currentPosition < length; i_2++) { - var nextChar = input.charAt(i_2 + currentPosition); - switch (nextChar) { - case '\\': - i_2++; - continue; - case '\r': - case '\n': - break; - case startChar: { - var str = input.substr(currentPosition, i_2 + 1); - if (!loc && loc !== 0) { - skipWhitespace(i_2 + 1); - return str; - } - return [startChar, str]; - } - } - } - return null; - }; - /** - * Permissive parsing. Ignores everything except matching {} [] () and quotes - * until matching token (outside of blocks) - */ - parserInput.$parseUntil = function (tok) { - var quote = ''; - var returnVal = null; - var inComment = false; - var blockDepth = 0; - var blockStack = []; - var parseGroups = []; - var length = input.length; - var startPos = parserInput.i; - var lastPos = parserInput.i; - var i = parserInput.i; - var loop = true; - var testChar; - if (typeof tok === 'string') { - testChar = function (char) { return char === tok; }; - } - else { - testChar = function (char) { return tok.test(char); }; - } - do { - var nextChar = input.charAt(i); - if (blockDepth === 0 && testChar(nextChar)) { - returnVal = input.substr(lastPos, i - lastPos); - if (returnVal) { - parseGroups.push(returnVal); - } - else { - parseGroups.push(' '); - } - returnVal = parseGroups; - skipWhitespace(i - startPos); - loop = false; - } - else { - if (inComment) { - if (nextChar === '*' && - input.charAt(i + 1) === '/') { - i++; - blockDepth--; - inComment = false; - } - i++; - continue; - } - switch (nextChar) { - case '\\': - i++; - nextChar = input.charAt(i); - parseGroups.push(input.substr(lastPos, i - lastPos + 1)); - lastPos = i + 1; - break; - case '/': - if (input.charAt(i + 1) === '*') { - i++; - inComment = true; - blockDepth++; - } - break; - case '\'': - case '"': - quote = parserInput.$quoted(i); - if (quote) { - parseGroups.push(input.substr(lastPos, i - lastPos), quote); - i += quote[1].length - 1; - lastPos = i + 1; - } - else { - skipWhitespace(i - startPos); - returnVal = nextChar; - loop = false; - } - break; - case '{': - blockStack.push('}'); - blockDepth++; - break; - case '(': - blockStack.push(')'); - blockDepth++; - break; - case '[': - blockStack.push(']'); - blockDepth++; - break; - case '}': - case ')': - case ']': { - var expected = blockStack.pop(); - if (nextChar === expected) { - blockDepth--; - } - else { - // move the parser to the error and return expected - skipWhitespace(i - startPos); - returnVal = expected; - loop = false; - } - } - } - i++; - if (i > length) { - loop = false; - } - } - } while (loop); - return returnVal ? returnVal : null; - }; - parserInput.autoCommentAbsorb = true; - parserInput.commentStore = []; - parserInput.finished = false; - // Same as $(), but don't change the state of the parser, - // just return the match. - parserInput.peek = function (tok) { - if (typeof tok === 'string') { - // https://jsperf.com/string-startswith/21 - for (var i_3 = 0; i_3 < tok.length; i_3++) { - if (input.charAt(parserInput.i + i_3) !== tok.charAt(i_3)) { - return false; - } - } - return true; - } - else { - return tok.test(current); - } - }; - // Specialization of peek() - // TODO remove or change some currentChar calls to peekChar - parserInput.peekChar = function (tok) { return input.charAt(parserInput.i) === tok; }; - parserInput.currentChar = function () { return input.charAt(parserInput.i); }; - parserInput.prevChar = function () { return input.charAt(parserInput.i - 1); }; - parserInput.getInput = function () { return input; }; - parserInput.peekNotNumeric = function () { - var c = input.charCodeAt(parserInput.i); - // Is the first char of the dimension 0-9, '.', '+' or '-' - return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA; - }; - parserInput.start = function (str, chunkInput, failFunction) { - input = str; - parserInput.i = j = currentPos = furthest = 0; - // chunking apparently makes things quicker (but my tests indicate - // it might actually make things slower in node at least) - // and it is a non-perfect parse - it can't recognise - // unquoted urls, meaning it can't distinguish comments - // meaning comments with quotes or {}() in them get 'counted' - // and then lead to parse errors. - // In addition if the chunking chunks in the wrong place we might - // not be able to parse a parser statement in one go - // this is officially deprecated but can be switched on via an option - // in the case it causes too much performance issues. - if (chunkInput) { - chunks = chunker(str, failFunction); - } - else { - chunks = [str]; - } - current = chunks[0]; - skipWhitespace(0); - }; - parserInput.end = function () { - var message; - var isFinished = parserInput.i >= input.length; - if (parserInput.i < furthest) { - message = furthestPossibleErrorMessage; - parserInput.i = furthest; - } - return { - isFinished: isFinished, - furthest: parserInput.i, - furthestPossibleErrorMessage: message, - furthestReachedEnd: parserInput.i >= input.length - 1, - furthestChar: input[parserInput.i] - }; - }; - return parserInput; - }); - - function makeRegistry(base) { - return { - _data: {}, - add: function (name, func) { - // precautionary case conversion, as later querying of - // the registry by function-caller uses lower case as well. - name = name.toLowerCase(); - // eslint-disable-next-line no-prototype-builtins - if (this._data.hasOwnProperty(name)) ; - this._data[name] = func; - }, - addMultiple: function (functions) { - var _this = this; - Object.keys(functions).forEach(function (name) { - _this.add(name, functions[name]); - }); - }, - get: function (name) { - return this._data[name] || (base && base.get(name)); - }, - getLocalFunctions: function () { - return this._data; - }, - inherit: function () { - return makeRegistry(this); - }, - create: function (base) { - return makeRegistry(base); - } - }; - } - var functionRegistry = makeRegistry(null); - - var MediaSyntaxOptions = { - queryInParens: true - }; - var ContainerSyntaxOptions = { - queryInParens: true - }; - - var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { - this.value = value; - this._index = index; - this._fileInfo = currentFileInfo; - this.mapLines = mapLines; - this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; - this.allowRoot = true; - this.copyVisibilityInfo(visibilityInfo); - }; - Anonymous.prototype = Object.assign(new Node(), { - type: 'Anonymous', - eval: function () { - return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); - }, - compare: function (other) { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; - }, - isRulesetLike: function () { - return this.rulesetLike; - }, - genCSS: function (context, output) { - this.nodeVisible = Boolean(this.value); - if (this.nodeVisible) { - output.add(this.value, this._fileInfo, this._index, this.mapLines); - } - } - }); - - // - // less.js - parser - // - // A relatively straight-forward predictive parser. - // There is no tokenization/lexing stage, the input is parsed - // in one sweep. - // - // To make the parser fast enough to run in the browser, several - // optimization had to be made: - // - // - Matching and slicing on a huge input is often cause of slowdowns. - // The solution is to chunkify the input into smaller strings. - // The chunks are stored in the `chunks` var, - // `j` holds the current chunk index, and `currentPos` holds - // the index of the current chunk in relation to `input`. - // This gives us an almost 4x speed-up. - // - // - In many cases, we don't need to match individual tokens; - // for example, if a value doesn't hold any variables, operations - // or dynamic references, the parser can effectively 'skip' it, - // treating it as a literal. - // An example would be '1px solid #000' - which evaluates to itself, - // we don't need to know what the individual components are. - // The drawback, of course is that you don't get the benefits of - // syntax-checking on the CSS. This gives us a 50% speed-up in the parser, - // and a smaller speed-up in the code-gen. - // - // - // Token matching is done with the `$` function, which either takes - // a terminal string or regexp, or a non-terminal function to call. - // It also takes care of moving all the indices forwards. - // - var Parser = function Parser(context, imports, fileInfo, currentIndex) { - currentIndex = currentIndex || 0; - var parsers; - var parserInput = getParserInput(); - function error(msg, type) { - throw new LessError({ - index: parserInput.i, - filename: fileInfo.filename, - type: type || 'Syntax', - message: msg - }, imports); - } - /** - * - * @param {string} msg - * @param {number} index - * @param {string} type - */ - function warn(msg, index, type) { - if (!context.quiet) { - logger$1.warn((new LessError({ - index: index !== null && index !== void 0 ? index : parserInput.i, - filename: fileInfo.filename, - type: type ? "".concat(type.toUpperCase(), " WARNING") : 'WARNING', - message: msg - }, imports)).toString()); - } - } - function expect(arg, msg) { - // some older browsers return typeof 'function' for RegExp - var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); - if (result) { - return result; - } - error(msg || (typeof arg === 'string' - ? "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'") - : 'unexpected token')); - } - // Specialization of expect() - function expectChar(arg, msg) { - if (parserInput.$char(arg)) { - return arg; - } - error(msg || "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'")); - } - function getDebugInfo(index) { - var filename = fileInfo.filename; - return { - lineNumber: getLocation(index, parserInput.getInput()).line + 1, - fileName: filename - }; - } - /** - * Used after initial parsing to create nodes on the fly - * - * @param {String} str - string to parse - * @param {Array} parseList - array of parsers to run input through e.g. ["value", "important"] - * @param {Number} currentIndex - start number to begin indexing - * @param {Object} fileInfo - fileInfo to attach to created nodes - */ - function parseNode(str, parseList, callback) { - var result; - var returnNodes = []; - var parser = parserInput; - try { - parser.start(str, false, function fail(msg, index) { - callback({ - message: msg, - index: index + currentIndex - }); - }); - for (var x = 0, p = void 0; (p = parseList[x]); x++) { - result = parsers[p](); - returnNodes.push(result || null); - } - var endInfo = parser.end(); - if (endInfo.isFinished) { - callback(null, returnNodes); - } - else { - callback(true, null); - } - } - catch (e) { - throw new LessError({ - index: e.index + currentIndex, - message: e.message - }, imports, fileInfo.filename); - } - } - // - // The Parser - // - return { - parserInput: parserInput, - imports: imports, - fileInfo: fileInfo, - parseNode: parseNode, - // - // Parse an input string into an abstract syntax tree, - // @param str A string containing 'less' markup - // @param callback call `callback` when done. - // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply - // - parse: function (str, callback, additionalData) { - var root; - var err = null; - var globalVars; - var modifyVars; - var ignored; - var preText = ''; - // Optionally disable @plugin parsing - if (additionalData && additionalData.disablePluginRule) { - parsers.plugin = function () { - var dir = parserInput.$re(/^@plugin?\s+/); - if (dir) { - error('@plugin statements are not allowed when disablePluginRule is set to true'); - } - }; - } - globalVars = (additionalData && additionalData.globalVars) ? "".concat(Parser.serializeVars(additionalData.globalVars), "\n") : ''; - modifyVars = (additionalData && additionalData.modifyVars) ? "\n".concat(Parser.serializeVars(additionalData.modifyVars)) : ''; - if (context.pluginManager) { - var preProcessors = context.pluginManager.getPreProcessors(); - for (var i_1 = 0; i_1 < preProcessors.length; i_1++) { - str = preProcessors[i_1].process(str, { context: context, imports: imports, fileInfo: fileInfo }); - } - } - if (globalVars || (additionalData && additionalData.banner)) { - preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars; - ignored = imports.contentsIgnoredChars; - ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0; - ignored[fileInfo.filename] += preText.length; - } - str = str.replace(/\r\n?/g, '\n'); - // Remove potential UTF Byte Order Mark - str = preText + str.replace(/^\uFEFF/, '') + modifyVars; - imports.contents[fileInfo.filename] = str; - // Start with the primary rule. - // The whole syntax tree is held under a Ruleset node, - // with the `root` property set to true, so no `{}` are - // output. The callback is called when the input is parsed. - try { - parserInput.start(str, context.chunkInput, function fail(msg, index) { - throw new LessError({ - index: index, - type: 'Parse', - message: msg, - filename: fileInfo.filename - }, imports); - }); - tree.Node.prototype.parse = this; - root = new tree.Ruleset(null, this.parsers.primary()); - tree.Node.prototype.rootNode = root; - root.root = true; - root.firstRoot = true; - root.functionRegistry = functionRegistry.inherit(); - } - catch (e) { - return callback(new LessError(e, imports, fileInfo.filename)); - } - // If `i` is smaller than the `input.length - 1`, - // it means the parser wasn't able to parse the whole - // string, so we've got a parsing error. - // - // We try to extract a \n delimited string, - // showing the line where the parse error occurred. - // We split it up into two parts (the part which parsed, - // and the part which didn't), so we can color them differently. - var endInfo = parserInput.end(); - if (!endInfo.isFinished) { - var message = endInfo.furthestPossibleErrorMessage; - if (!message) { - message = 'Unrecognised input'; - if (endInfo.furthestChar === '}') { - message += '. Possibly missing opening \'{\''; - } - else if (endInfo.furthestChar === ')') { - message += '. Possibly missing opening \'(\''; - } - else if (endInfo.furthestReachedEnd) { - message += '. Possibly missing something'; - } - } - err = new LessError({ - type: 'Parse', - message: message, - index: endInfo.furthest, - filename: fileInfo.filename - }, imports); - } - var finish = function (e) { - e = err || e || imports.error; - if (e) { - if (!(e instanceof LessError)) { - e = new LessError(e, imports, fileInfo.filename); - } - return callback(e); - } - else { - return callback(null, root); - } - }; - if (context.processImports !== false) { - new visitors.ImportVisitor(imports, finish) - .run(root); - } - else { - return finish(); - } - }, - // - // Here in, the parsing rules/functions - // - // The basic structure of the syntax tree generated is as follows: - // - // Ruleset -> Declaration -> Value -> Expression -> Entity - // - // Here's some Less code: - // - // .class { - // color: #fff; - // border: 1px solid #000; - // width: @w + 4px; - // > .child {...} - // } - // - // And here's what the parse tree might look like: - // - // Ruleset (Selector '.class', [ - // Declaration ("color", Value ([Expression [Color #fff]])) - // Declaration ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) - // Declaration ("width", Value ([Expression [Operation " + " [Variable "@w"][Dimension 4px]]])) - // Ruleset (Selector [Element '>', '.child'], [...]) - // ]) - // - // In general, most rules will try to parse a token with the `$re()` function, and if the return - // value is truly, will return a new node, of the relevant type. Sometimes, we need to check - // first, before parsing, that's when we use `peek()`. - // - parsers: parsers = { - // - // The `primary` rule is the *entry* and *exit* point of the parser. - // The rules here can appear at any level of the parse tree. - // - // The recursive nature of the grammar is an interplay between the `block` - // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, - // as represented by this simplified grammar: - // - // primary → (ruleset | declaration)+ - // ruleset → selector+ block - // block → '{' primary '}' - // - // Only at one point is the primary rule not called from the - // block rule: at the root level. - // - primary: function () { - var mixin = this.mixin; - var root = []; - var node; - while (true) { - while (true) { - node = this.comment(); - if (!node) { - break; - } - root.push(node); - } - // always process comments before deciding if finished - if (parserInput.finished) { - break; - } - if (parserInput.peek('}')) { - break; - } - node = this.extendRule(); - if (node) { - root = root.concat(node); - continue; - } - node = mixin.definition() || this.declaration() || mixin.call(false, false) || - this.ruleset() || this.variableCall() || this.entities.call() || this.atrule(); - if (node) { - root.push(node); - } - else { - var foundSemiColon = false; - while (parserInput.$char(';')) { - foundSemiColon = true; - } - if (!foundSemiColon) { - break; - } - } - } - return root; - }, - // comments are collected by the main parsing mechanism and then assigned to nodes - // where the current structure allows it - comment: function () { - if (parserInput.commentStore.length) { - var comment = parserInput.commentStore.shift(); - return new (tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo); - } - }, - // - // Entities are tokens which can be found inside an Expression - // - entities: { - mixinLookup: function () { - return parsers.mixin.call(true, true); - }, - // - // A string, which supports escaping " and ' - // - // "milky way" 'he\'s the one!' - // - quoted: function (forceEscaped) { - var str; - var index = parserInput.i; - var isEscaped = false; - parserInput.save(); - if (parserInput.$char('~')) { - isEscaped = true; - } - else if (forceEscaped) { - parserInput.restore(); - return; - } - str = parserInput.$quoted(); - if (!str) { - parserInput.restore(); - return; - } - parserInput.forget(); - return new (tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo); - }, - // - // A catch-all word, such as: - // - // black border-collapse - // - keyword: function () { - var k = parserInput.$char('%') || parserInput.$re(/^\[?(?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\]?/); - if (k) { - return tree.Color.fromKeyword(k) || new (tree.Keyword)(k); - } - }, - // - // A function call - // - // rgb(255, 0, 255) - // - // The arguments are parsed with the `entities.arguments` parser. - // - call: function () { - var name; - var args; - var func; - var index = parserInput.i; - // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 - if (parserInput.peek(/^url\(/i)) { - return; - } - parserInput.save(); - name = parserInput.$re(/^([\w-]+|%|~|progid:[\w.]+)\(/); - if (!name) { - parserInput.forget(); - return; - } - name = name[1]; - func = this.customFuncCall(name); - if (func) { - args = func.parse(); - if (args && func.stop) { - parserInput.forget(); - return args; - } - } - args = this.arguments(args); - if (!parserInput.$char(')')) { - parserInput.restore('Could not parse call arguments or missing \')\''); - return; - } - parserInput.forget(); - return new (tree.Call)(name, args, index + currentIndex, fileInfo); - }, - declarationCall: function () { - var validCall; - var args; - var index = parserInput.i; - parserInput.save(); - validCall = parserInput.$re(/^[\w]+\(/); - if (!validCall) { - parserInput.forget(); - return; - } - validCall = validCall.substring(0, validCall.length - 1); - var rule = this.ruleProperty(); - var value; - if (rule) { - value = this.value(); - } - if (rule && value) { - args = [new (tree.Declaration)(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)]; - } - if (!parserInput.$char(')')) { - parserInput.restore('Could not parse call arguments or missing \')\''); - return; - } - parserInput.forget(); - return new (tree.Call)(validCall, args, index + currentIndex, fileInfo); - }, - // - // Parsing rules for functions with non-standard args, e.g.: - // - // boolean(not(2 > 1)) - // - // This is a quick prototype, to be modified/improved when - // more custom-parsed funcs come (e.g. `selector(...)`) - // - customFuncCall: function (name) { - /* Ideally the table is to be moved out of here for faster perf., - but it's quite tricky since it relies on all these `parsers` - and `expect` available only here */ - return { - alpha: f(parsers.ieAlpha, true), - boolean: f(condition), - 'if': f(condition) - }[name.toLowerCase()]; - function f(parse, stop) { - return { - parse: parse, - stop: stop // when true - stop after parse() and return its result, - // otherwise continue for plain args - }; - } - function condition() { - return [expect(parsers.condition, 'expected condition')]; - } - }, - arguments: function (prevArgs) { - var argsComma = prevArgs || []; - var argsSemiColon = []; - var isSemiColonSeparated; - var value; - parserInput.save(); - while (true) { - if (prevArgs) { - prevArgs = false; - } - else { - value = parsers.detachedRuleset() || this.assignment() || parsers.expression(); - if (!value) { - break; - } - if (value.value && value.value.length == 1) { - value = value.value[0]; - } - argsComma.push(value); - } - if (parserInput.$char(',')) { - continue; - } - if (parserInput.$char(';') || isSemiColonSeparated) { - isSemiColonSeparated = true; - value = (argsComma.length < 1) ? argsComma[0] - : new tree.Value(argsComma); - argsSemiColon.push(value); - argsComma = []; - } - } - parserInput.forget(); - return isSemiColonSeparated ? argsSemiColon : argsComma; - }, - literal: function () { - return this.dimension() || - this.color() || - this.quoted() || - this.unicodeDescriptor(); - }, - // Assignments are argument entities for calls. - // They are present in ie filter properties as shown below. - // - // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* ) - // - assignment: function () { - var key; - var value; - parserInput.save(); - key = parserInput.$re(/^\w+(?=\s?=)/i); - if (!key) { - parserInput.restore(); - return; - } - if (!parserInput.$char('=')) { - parserInput.restore(); - return; - } - value = parsers.entity(); - if (value) { - parserInput.forget(); - return new (tree.Assignment)(key, value); - } - else { - parserInput.restore(); - } - }, - // - // Parse url() tokens - // - // We use a specific rule for urls, because they don't really behave like - // standard function calls. The difference is that the argument doesn't have - // to be enclosed within a string, so it can't be parsed as an Expression. - // - url: function () { - var value; - var index = parserInput.i; - parserInput.autoCommentAbsorb = false; - if (!parserInput.$str('url(')) { - parserInput.autoCommentAbsorb = true; - return; - } - value = this.quoted() || this.variable() || this.property() || - parserInput.$re(/^(?:(?:\\[()'"])|[^()'"])+/) || ''; - parserInput.autoCommentAbsorb = true; - expectChar(')'); - return new (tree.URL)((value.value !== undefined || - value instanceof tree.Variable || - value instanceof tree.Property) ? - value : new (tree.Anonymous)(value, index), index + currentIndex, fileInfo); - }, - // - // A Variable entity, such as `@fink`, in - // - // width: @fink + 2px - // - // We use a different parser for variable definitions, - // see `parsers.variable`. - // - variable: function () { - var ch; - var name; - var index = parserInput.i; - parserInput.save(); - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) { - ch = parserInput.currentChar(); - if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\s/)) { - // this may be a VariableCall lookup - var result = parsers.variableCall(name); - if (result) { - parserInput.forget(); - return result; - } - } - parserInput.forget(); - return new (tree.Variable)(name, index + currentIndex, fileInfo); - } - parserInput.restore(); - }, - // A variable entity using the protective {} e.g. @{var} - variableCurly: function () { - var curly; - var index = parserInput.i; - if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { - return new (tree.Variable)("@".concat(curly[1]), index + currentIndex, fileInfo); - } - }, - // - // A Property accessor, such as `$color`, in - // - // background-color: $color - // - property: function () { - var name; - var index = parserInput.i; - if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\$[\w-]+/))) { - return new (tree.Property)(name, index + currentIndex, fileInfo); - } - }, - // A property entity useing the protective {} e.g. ${prop} - propertyCurly: function () { - var curly; - var index = parserInput.i; - if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) { - return new (tree.Property)("$".concat(curly[1]), index + currentIndex, fileInfo); - } - }, - // - // A Hexadecimal color - // - // #4F3C2F - // - // `rgb` and `hsl` colors are parsed through the `entities.call` parser. - // - color: function () { - var rgb; - parserInput.save(); - if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\w.#[])?/))) { - if (!rgb[2]) { - parserInput.forget(); - return new (tree.Color)(rgb[1], undefined, rgb[0]); - } - } - parserInput.restore(); - }, - colorKeyword: function () { - parserInput.save(); - var autoCommentAbsorb = parserInput.autoCommentAbsorb; - parserInput.autoCommentAbsorb = false; - var k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/); - parserInput.autoCommentAbsorb = autoCommentAbsorb; - if (!k) { - parserInput.forget(); - return; - } - parserInput.restore(); - var color = tree.Color.fromKeyword(k); - if (color) { - parserInput.$str(k); - return color; - } - }, - // - // A Dimension, that is, a number and a unit - // - // 0.5em 95% - // - dimension: function () { - if (parserInput.peekNotNumeric()) { - return; - } - var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i); - if (value) { - return new (tree.Dimension)(value[1], value[2]); - } - }, - // - // A unicode descriptor, as is used in unicode-range - // - // U+0?? or U+00A1-00A9 - // - unicodeDescriptor: function () { - var ud; - ud = parserInput.$re(/^U\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/); - if (ud) { - return new (tree.UnicodeDescriptor)(ud[0]); - } - }, - // - // JavaScript code to be evaluated - // - // `window.location.href` - // - javascript: function () { - var js; - var index = parserInput.i; - parserInput.save(); - var escape = parserInput.$char('~'); - var jsQuote = parserInput.$char('`'); - if (!jsQuote) { - parserInput.restore(); - return; - } - js = parserInput.$re(/^[^`]*`/); - if (js) { - parserInput.forget(); - return new (tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo); - } - parserInput.restore('invalid javascript definition'); - } - }, - // - // The variable part of a variable definition. Used in the `rule` parser - // - // @fink: - // - variable: function () { - var name; - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { - return name[1]; - } - }, - // - // Call a variable value to retrieve a detached ruleset - // or a value from a detached ruleset's rules. - // - // @fink(); - // @fink; - // color: @fink[@color]; - // - variableCall: function (parsedName) { - var lookups; - var i = parserInput.i; - var inValue = !!parsedName; - var name = parsedName; - parserInput.save(); - if (name || (parserInput.currentChar() === '@' - && (name = parserInput.$re(/^(@[\w-]+)(\(\s*\))?/)))) { - lookups = this.mixin.ruleLookups(); - if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) { - parserInput.restore('Missing \'[...]\' lookup in variable call'); - return; - } - if (!inValue) { - name = name[1]; - } - var call = new tree.VariableCall(name, i, fileInfo); - if (!inValue && parsers.end()) { - parserInput.forget(); - return call; - } - else { - parserInput.forget(); - return new tree.NamespaceValue(call, lookups, i, fileInfo); - } - } - parserInput.restore(); - }, - // - // extend syntax - used to extend selectors - // - extend: function (isRule) { - var elements; - var e; - var index = parserInput.i; - var option; - var extendList; - var extend; - if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) { - return; - } - do { - option = null; - elements = null; - var first = true; - while (!(option = parserInput.$re(/^(!?all)(?=\s*(\)|,))/))) { - e = this.element(); - if (!e) { - break; - } - /** - * @note - This will not catch selectors in pseudos like :is() and :where() because - * they don't currently parse their contents as selectors. - */ - if (!first && e.combinator.value) { - warn('Targeting complex selectors can have unexpected behavior, and this behavior may change in the future.', index); - } - first = false; - if (elements) { - elements.push(e); - } - else { - elements = [e]; - } - } - option = option && option[1]; - if (!elements) { - error('Missing target selector for :extend().'); - } - extend = new (tree.Extend)(new (tree.Selector)(elements), option, index + currentIndex, fileInfo); - if (extendList) { - extendList.push(extend); - } - else { - extendList = [extend]; - } - } while (parserInput.$char(',')); - expect(/^\)/); - if (isRule) { - expect(/^;/); - } - return extendList; - }, - // - // extendRule - used in a rule to extend all the parent selectors - // - extendRule: function () { - return this.extend(true); - }, - // - // Mixins - // - mixin: { - // - // A Mixin call, with an optional argument list - // - // #mixins > .square(#fff); - // #mixins.square(#fff); - // .rounded(4px, black); - // .button; - // - // We can lookup / return a value using the lookup syntax: - // - // color: #mixin.square(#fff)[@color]; - // - // The `while` loop is there because mixins can be - // namespaced, but we only support the child and descendant - // selector for now. - // - call: function (inValue, getLookup) { - var s = parserInput.currentChar(); - var important = false; - var lookups; - var index = parserInput.i; - var elements; - var args; - var hasParens; - var parensIndex; - var parensWS = false; - if (s !== '.' && s !== '#') { - return; - } - parserInput.save(); // stop us absorbing part of an invalid selector - elements = this.elements(); - if (elements) { - parensIndex = parserInput.i; - if (parserInput.$char('(')) { - parensWS = parserInput.isWhitespace(-2); - args = this.args(true).args; - expectChar(')'); - hasParens = true; - if (parensWS) { - warn('Whitespace between a mixin name and parentheses for a mixin call is deprecated', parensIndex, 'DEPRECATED'); - } - } - if (getLookup !== false) { - lookups = this.ruleLookups(); - } - if (getLookup === true && !lookups) { - parserInput.restore(); - return; - } - if (inValue && !lookups && !hasParens) { - // This isn't a valid in-value mixin call - parserInput.restore(); - return; - } - if (!inValue && parsers.important()) { - important = true; - } - if (inValue || parsers.end()) { - parserInput.forget(); - var mixin = new (tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important); - if (lookups) { - return new tree.NamespaceValue(mixin, lookups); - } - else { - if (!hasParens) { - warn('Calling a mixin without parentheses is deprecated', parensIndex, 'DEPRECATED'); - } - return mixin; - } - } - } - parserInput.restore(); - }, - /** - * Matching elements for mixins - * (Start with . or # and can have > ) - */ - elements: function () { - var elements; - var e; - var c; - var elem; - var elemIndex; - var re = /^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/; - while (true) { - elemIndex = parserInput.i; - e = parserInput.$re(re); - if (!e) { - break; - } - elem = new (tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo); - if (elements) { - elements.push(elem); - } - else { - elements = [elem]; - } - c = parserInput.$char('>'); - } - return elements; - }, - args: function (isCall) { - var entities = parsers.entities; - var returner = { args: null, variadic: false }; - var expressions = []; - var argsSemiColon = []; - var argsComma = []; - var isSemiColonSeparated; - var expressionContainsNamed; - var name; - var nameLoop; - var value; - var arg; - var expand; - var hasSep = true; - parserInput.save(); - while (true) { - if (isCall) { - arg = parsers.detachedRuleset() || parsers.expression(); - } - else { - parserInput.commentStore.length = 0; - if (parserInput.$str('...')) { - returner.variadic = true; - if (parserInput.$char(';') && !isSemiColonSeparated) { - isSemiColonSeparated = true; - } - (isSemiColonSeparated ? argsSemiColon : argsComma) - .push({ variadic: true }); - break; - } - arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true); - } - if (!arg || !hasSep) { - break; - } - nameLoop = null; - if (arg.throwAwayComments) { - arg.throwAwayComments(); - } - value = arg; - var val = null; - if (isCall) { - // Variable - if (arg.value && arg.value.length == 1) { - val = arg.value[0]; - } - } - else { - val = arg; - } - if (val && (val instanceof tree.Variable || val instanceof tree.Property)) { - if (parserInput.$char(':')) { - if (expressions.length > 0) { - if (isSemiColonSeparated) { - error('Cannot mix ; and , as delimiter types'); - } - expressionContainsNamed = true; - } - value = parsers.detachedRuleset() || parsers.expression(); - if (!value) { - if (isCall) { - error('could not understand value for named argument'); - } - else { - parserInput.restore(); - returner.args = []; - return returner; - } - } - nameLoop = (name = val.name); - } - else if (parserInput.$str('...')) { - if (!isCall) { - returner.variadic = true; - if (parserInput.$char(';') && !isSemiColonSeparated) { - isSemiColonSeparated = true; - } - (isSemiColonSeparated ? argsSemiColon : argsComma) - .push({ name: arg.name, variadic: true }); - break; - } - else { - expand = true; - } - } - else if (!isCall) { - name = nameLoop = val.name; - value = null; - } - } - if (value) { - expressions.push(value); - } - argsComma.push({ name: nameLoop, value: value, expand: expand }); - if (parserInput.$char(',')) { - hasSep = true; - continue; - } - hasSep = parserInput.$char(';') === ';'; - if (hasSep || isSemiColonSeparated) { - if (expressionContainsNamed) { - error('Cannot mix ; and , as delimiter types'); - } - isSemiColonSeparated = true; - if (expressions.length > 1) { - value = new (tree.Value)(expressions); - } - argsSemiColon.push({ name: name, value: value, expand: expand }); - name = null; - expressions = []; - expressionContainsNamed = false; - } - } - parserInput.forget(); - returner.args = isSemiColonSeparated ? argsSemiColon : argsComma; - return returner; - }, - // - // A Mixin definition, with a list of parameters - // - // .rounded (@radius: 2px, @color) { - // ... - // } - // - // Until we have a finer grained state-machine, we have to - // do a look-ahead, to make sure we don't have a mixin call. - // See the `rule` function for more information. - // - // We start by matching `.rounded (`, and then proceed on to - // the argument list, which has optional default values. - // We store the parameters in `params`, with a `value` key, - // if there is a value, such as in the case of `@radius`. - // - // Once we've got our params list, and a closing `)`, we parse - // the `{...}` block. - // - definition: function () { - var name; - var params = []; - var match; - var ruleset; - var cond; - var variadic = false; - if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') || - parserInput.peek(/^[^{]*\}/)) { - return; - } - parserInput.save(); - match = parserInput.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/); - if (match) { - name = match[1]; - var argInfo = this.args(false); - params = argInfo.args; - variadic = argInfo.variadic; - // .mixincall("@{a}"); - // looks a bit like a mixin definition.. - // also - // .mixincall(@a: {rule: set;}); - // so we have to be nice and restore - if (!parserInput.$char(')')) { - parserInput.restore('Missing closing \')\''); - return; - } - parserInput.commentStore.length = 0; - if (parserInput.$str('when')) { // Guard - cond = expect(parsers.conditions, 'expected condition'); - } - ruleset = parsers.block(); - if (ruleset) { - parserInput.forget(); - return new (tree.mixin.Definition)(name, params, ruleset, cond, variadic); - } - else { - parserInput.restore(); - } - } - else { - parserInput.restore(); - } - }, - ruleLookups: function () { - var rule; - var lookups = []; - if (parserInput.currentChar() !== '[') { - return; - } - while (true) { - parserInput.save(); - rule = this.lookupValue(); - if (!rule && rule !== '') { - parserInput.restore(); - break; - } - lookups.push(rule); - parserInput.forget(); - } - if (lookups.length > 0) { - return lookups; - } - }, - lookupValue: function () { - parserInput.save(); - if (!parserInput.$char('[')) { - parserInput.restore(); - return; - } - var name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/); - if (!parserInput.$char(']')) { - parserInput.restore(); - return; - } - if (name || name === '') { - parserInput.forget(); - return name; - } - parserInput.restore(); - } - }, - // - // Entities are the smallest recognized token, - // and can be found inside a rule's value. - // - entity: function () { - var entities = this.entities; - return this.comment() || entities.literal() || entities.variable() || entities.url() || - entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) || - entities.javascript(); - }, - // - // A Declaration terminator. Note that we use `peek()` to check for '}', - // because the `block` rule will be expecting it, but we still need to make sure - // it's there, if ';' was omitted. - // - end: function () { - return parserInput.$char(';') || parserInput.peek('}'); - }, - // - // IE's alpha function - // - // alpha(opacity=88) - // - ieAlpha: function () { - var value; - // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 - if (!parserInput.$re(/^opacity=/i)) { - return; - } - value = parserInput.$re(/^\d+/); - if (!value) { - value = expect(parsers.entities.variable, 'Could not parse alpha'); - value = "@{".concat(value.name.slice(1), "}"); - } - expectChar(')'); - return new tree.Quoted('', "alpha(opacity=".concat(value, ")")); - }, - /** - * A Selector Element - * - * div - * + h1 - * #socks - * input[type="text"] - * - * Elements are the building blocks for Selectors, - * they are made out of a `Combinator` (see combinator rule), - * and an element name, such as a tag a class, or `*`. - */ - element: function () { - var e; - var c; - var v; - var index = parserInput.i; - c = this.combinator(); - /** This selector parser is quite simplistic and will pass a number of invalid selectors. */ - e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || - // eslint-disable-next-line no-control-regex - parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || - parserInput.$char('*') || parserInput.$char('&') || this.attribute() || - parserInput.$re(/^\([^&()@]+\)/) || parserInput.$re(/^[.#:](?=@)/) || - this.entities.variableCurly(); - if (!e) { - parserInput.save(); - if (parserInput.$char('(')) { - if ((v = this.selector(false))) { - var selectors = []; - while (parserInput.$char(',')) { - selectors.push(v); - selectors.push(new Anonymous(',')); - v = this.selector(false); - } - selectors.push(v); - if (parserInput.$char(')')) { - if (selectors.length > 1) { - e = new (tree.Paren)(new Selector(selectors)); - } - else { - e = new (tree.Paren)(v); - } - parserInput.forget(); - } - else { - parserInput.restore('Missing closing \')\''); - } - } - else { - parserInput.restore('Missing closing \')\''); - } - } - else { - parserInput.forget(); - } - } - if (e) { - return new (tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); - } - }, - // - // Combinators combine elements together, in a Selector. - // - // Because our parser isn't white-space sensitive, special care - // has to be taken, when parsing the descendant combinator, ` `, - // as it's an empty space. We have to check the previous character - // in the input, to see if it's a ` ` character. More info on how - // we deal with this in *combinator.js*. - // - combinator: function () { - var c = parserInput.currentChar(); - if (c === '/') { - parserInput.save(); - var slashedCombinator = parserInput.$re(/^\/[a-z]+\//i); - if (slashedCombinator) { - parserInput.forget(); - return new (tree.Combinator)(slashedCombinator); - } - parserInput.restore(); - } - if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') { - parserInput.i++; - if (c === '^' && parserInput.currentChar() === '^') { - c = '^^'; - parserInput.i++; - } - while (parserInput.isWhitespace()) { - parserInput.i++; - } - return new (tree.Combinator)(c); - } - else if (parserInput.isWhitespace(-1)) { - return new (tree.Combinator)(' '); - } - else { - return new (tree.Combinator)(null); - } - }, - // - // A CSS Selector - // with less extensions e.g. the ability to extend and guard - // - // .class > div + h1 - // li a:hover - // - // Selectors are made out of one or more Elements, see above. - // - selector: function (isLess) { - var index = parserInput.i; - var elements; - var extendList; - var c; - var e; - var allExtends; - var when; - var condition; - isLess = isLess !== false; - while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) { - if (when) { - condition = expect(this.conditions, 'expected condition'); - } - else if (condition) { - error('CSS guard can only be used at the end of selector'); - } - else if (extendList) { - if (allExtends) { - allExtends = allExtends.concat(extendList); - } - else { - allExtends = extendList; - } - } - else { - if (allExtends) { - error('Extend can only be used at the end of selector'); - } - c = parserInput.currentChar(); - if (Array.isArray(e)) { - e.forEach(function (ele) { return elements.push(ele); }); - } - if (elements) { - elements.push(e); - } - else { - elements = [e]; - } - e = null; - } - if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') { - break; - } - } - if (elements) { - return new (tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); - } - if (allExtends) { - error('Extend must be used to extend a selector, it cannot be used on its own'); - } - }, - selectors: function () { - var s; - var selectors; - while (true) { - s = this.selector(); - if (!s) { - break; - } - if (selectors) { - selectors.push(s); - } - else { - selectors = [s]; - } - parserInput.commentStore.length = 0; - if (s.condition && selectors.length > 1) { - error('Guards are only currently allowed on a single selector.'); - } - if (!parserInput.$char(',')) { - break; - } - if (s.condition) { - error('Guards are only currently allowed on a single selector.'); - } - parserInput.commentStore.length = 0; - } - return selectors; - }, - attribute: function () { - if (!parserInput.$char('[')) { - return; - } - var entities = this.entities; - var key; - var val; - var op; - // - // case-insensitive flag - // e.g. [attr operator value i] - // - var cif; - if (!(key = entities.variableCurly())) { - key = expect(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/); - } - op = parserInput.$re(/^[|~*$^]?=/); - if (op) { - val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly(); - if (val) { - cif = parserInput.$re(/^[iIsS]/); - } - } - expectChar(']'); - return new (tree.Attribute)(key, op, val, cif); - }, - // - // The `block` rule is used by `ruleset` and `mixin.definition`. - // It's a wrapper around the `primary` rule, with added `{}`. - // - block: function () { - var content; - if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) { - return content; - } - }, - blockRuleset: function () { - var block = this.block(); - if (block) { - block = new tree.Ruleset(null, block); - } - return block; - }, - detachedRuleset: function () { - var argInfo; - var params; - var variadic; - parserInput.save(); - if (parserInput.$re(/^[.#]\(/)) { - /** - * DR args currently only implemented for each() function, and not - * yet settable as `@dr: #(@arg) {}` - * This should be done when DRs are merged with mixins. - * See: https://github.com/less/less-meta/issues/16 - */ - argInfo = this.mixin.args(false); - params = argInfo.args; - variadic = argInfo.variadic; - if (!parserInput.$char(')')) { - parserInput.restore(); - return; - } - } - var blockRuleset = this.blockRuleset(); - if (blockRuleset) { - parserInput.forget(); - if (params) { - return new tree.mixin.Definition(null, params, blockRuleset, null, variadic); - } - return new tree.DetachedRuleset(blockRuleset); - } - parserInput.restore(); - }, - // - // div, .class, body > p {...} - // - ruleset: function () { - var selectors; - var rules; - var debugInfo; - parserInput.save(); - if (context.dumpLineNumbers) { - debugInfo = getDebugInfo(parserInput.i); - } - selectors = this.selectors(); - if (selectors && (rules = this.block())) { - parserInput.forget(); - var ruleset = new (tree.Ruleset)(selectors, rules, context.strictImports); - if (context.dumpLineNumbers) { - ruleset.debugInfo = debugInfo; - } - return ruleset; - } - else { - parserInput.restore(); - } - }, - declaration: function () { - var name; - var value; - var index = parserInput.i; - var hasDR; - var c = parserInput.currentChar(); - var important; - var merge; - var isVariable; - if (c === '.' || c === '#' || c === '&' || c === ':') { - return; - } - parserInput.save(); - name = this.variable() || this.ruleProperty(); - if (name) { - isVariable = typeof name === 'string'; - if (isVariable) { - value = this.detachedRuleset(); - if (value) { - hasDR = true; - } - } - parserInput.commentStore.length = 0; - if (!value) { - // a name returned by this.ruleProperty() is always an array of the form: - // [string-1, ..., string-n, ""] or [string-1, ..., string-n, "+"] - // where each item is a tree.Keyword or tree.Variable - merge = !isVariable && name.length > 1 && name.pop().value; - // Custom property values get permissive parsing - if (name[0].value && name[0].value.slice(0, 2) === '--') { - if (parserInput.$char(';')) { - value = new Anonymous(''); - } - else { - value = this.permissiveValue(/[;}]/, true); - } - } - // Try to store values as anonymous - // If we need the value later we'll re-parse it in ruleset.parseValue - else { - value = this.anonymousValue(); - } - if (value) { - parserInput.forget(); - // anonymous values absorb the end ';' which is required for them to work - return new (tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo); - } - if (!value) { - value = this.value(); - } - if (value) { - important = this.important(); - } - else if (isVariable) { - /** - * As a last resort, try permissiveValue - * - * @todo - This has created some knock-on problems of not - * flagging incorrect syntax or detecting user intent. - */ - value = this.permissiveValue(); - } - } - if (value && (this.end() || hasDR)) { - parserInput.forget(); - return new (tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo); - } - else { - parserInput.restore(); - } - } - else { - parserInput.restore(); - } - }, - anonymousValue: function () { - var index = parserInput.i; - var match = parserInput.$re(/^([^.#@$+/'"*`(;{}-]*);/); - if (match) { - return new (tree.Anonymous)(match[1], index + currentIndex); - } - }, - /** - * Used for custom properties, at-rules, and variables (as fallback) - * Parses almost anything inside of {} [] () "" blocks - * until it reaches outer-most tokens. - * - * First, it will try to parse comments and entities to reach - * the end. This is mostly like the Expression parser except no - * math is allowed. - * - * @param {RexExp} untilTokens - Characters to stop parsing at - */ - permissiveValue: function (untilTokens) { - var i; - var e; - var done; - var value; - var tok = untilTokens || ';'; - var index = parserInput.i; - var result = []; - function testCurrentChar() { - var char = parserInput.currentChar(); - if (typeof tok === 'string') { - return char === tok; - } - else { - return tok.test(char); - } - } - if (testCurrentChar()) { - return; - } - value = []; - do { - e = this.comment(); - if (e) { - value.push(e); - continue; - } - e = this.entity(); - if (e) { - value.push(e); - } - if (parserInput.peek(',')) { - value.push(new (tree.Anonymous)(',', parserInput.i)); - parserInput.$char(','); - } - } while (e); - done = testCurrentChar(); - if (value.length > 0) { - value = new (tree.Expression)(value); - if (done) { - return value; - } - else { - result.push(value); - } - // Preserve space before $parseUntil as it will not - if (parserInput.prevChar() === ' ') { - result.push(new tree.Anonymous(' ', index)); - } - } - parserInput.save(); - value = parserInput.$parseUntil(tok); - if (value) { - if (typeof value === 'string') { - error("Expected '".concat(value, "'"), 'Parse'); - } - if (value.length === 1 && value[0] === ' ') { - parserInput.forget(); - return new tree.Anonymous('', index); - } - /** @type {string} */ - var item = void 0; - for (i = 0; i < value.length; i++) { - item = value[i]; - if (Array.isArray(item)) { - // Treat actual quotes as normal quoted values - result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo)); - } - else { - if (i === value.length - 1) { - item = item.trim(); - } - // Treat like quoted values, but replace vars like unquoted expressions - var quote = new tree.Quoted('\'', item, true, index, fileInfo); - var variableRegex = /@([\w-]+)/g; - var propRegex = /\$([\w-]+)/g; - if (variableRegex.test(item)) { - warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED'); - } - if (propRegex.test(item)) { - warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED'); - } - quote.variableRegex = /@([\w-]+)|@{([\w-]+)}/g; - quote.propRegex = /\$([\w-]+)|\${([\w-]+)}/g; - result.push(quote); - } - } - parserInput.forget(); - return new tree.Expression(result, true); - } - parserInput.restore(); - }, - // - // An @import atrule - // - // @import "lib"; - // - // Depending on our environment, importing is done differently: - // In the browser, it's an XHR request, in Node, it would be a - // file-system operation. The function used for importing is - // stored in `import`, which we pass to the Import constructor. - // - 'import': function () { - var path; - var features; - var index = parserInput.i; - var dir = parserInput.$re(/^@import\s+/); - if (dir) { - var options = (dir ? this.importOptions() : null) || {}; - if ((path = this.entities.quoted() || this.entities.url())) { - features = this.mediaFeatures({}); - if (!parserInput.$char(';')) { - parserInput.i = index; - error('missing semi-colon or unrecognised media features on import'); - } - features = features && new (tree.Value)(features); - return new (tree.Import)(path, features, options, index + currentIndex, fileInfo); - } - else { - parserInput.i = index; - error('malformed import statement'); - } - } - }, - importOptions: function () { - var o; - var options = {}; - var optionName; - var value; - // list of options, surrounded by parens - if (!parserInput.$char('(')) { - return null; - } - do { - o = this.importOption(); - if (o) { - optionName = o; - value = true; - switch (optionName) { - case 'css': - optionName = 'less'; - value = false; - break; - case 'once': - optionName = 'multiple'; - value = false; - break; - } - options[optionName] = value; - if (!parserInput.$char(',')) { - break; - } - } - } while (o); - expectChar(')'); - return options; - }, - importOption: function () { - var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); - if (opt) { - return opt[1]; - } - }, - mediaFeature: function (syntaxOptions) { - var entities = this.entities; - var nodes = []; - var e; - var p; - var rangeP; - var spacing = false; - parserInput.save(); - do { - parserInput.save(); - if (parserInput.$re(/^[0-9a-z-]*\s+\(/)) { - spacing = true; - } - parserInput.restore(); - e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup(); - if (e) { - nodes.push(e); - } - else if (parserInput.$char('(')) { - p = this.property(); - parserInput.save(); - if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\s*([<>]=|<=|>=|[<>]|=)/)) { - parserInput.restore(); - p = this.condition(); - parserInput.save(); - rangeP = this.atomicCondition(null, p.rvalue); - if (!rangeP) { - parserInput.restore(); - } - } - else { - parserInput.restore(); - e = this.value(); - } - if (parserInput.$char(')')) { - if (p && !e) { - nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index))); - e = p; - } - else if (p && e) { - nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true))); - if (!spacing) { - nodes[nodes.length - 1].noSpacing = true; - } - spacing = false; - } - else if (e) { - nodes.push(new (tree.Paren)(e)); - spacing = false; - } - else { - error('badly formed media feature definition'); - } - } - else { - error('Missing closing \')\'', 'Parse'); - } - } - } while (e); - parserInput.forget(); - if (nodes.length > 0) { - return new (tree.Expression)(nodes); - } - }, - mediaFeatures: function (syntaxOptions) { - var entities = this.entities; - var features = []; - var e; - do { - e = this.mediaFeature(syntaxOptions); - if (e) { - features.push(e); - if (!parserInput.$char(',')) { - break; - } - else if (!features[features.length - 1].noSpacing) { - features[features.length - 1].noSpacing = false; - } - } - else { - e = entities.variable() || entities.mixinLookup(); - if (e) { - features.push(e); - if (!parserInput.$char(',')) { - break; - } - else if (!features[features.length - 1].noSpacing) { - features[features.length - 1].noSpacing = false; - } - } - } - } while (e); - return features.length > 0 ? features : null; - }, - prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) { - var features = this.mediaFeatures(syntaxOptions); - var rules = this.block(); - if (!rules) { - error('media definitions require block statements after any features'); - } - parserInput.forget(); - var atRule = new (treeType)(rules, features, index + currentIndex, fileInfo); - if (context.dumpLineNumbers) { - atRule.debugInfo = debugInfo; - } - return atRule; - }, - nestableAtRule: function () { - var debugInfo; - var index = parserInput.i; - if (context.dumpLineNumbers) { - debugInfo = getDebugInfo(index); - } - parserInput.save(); - if (parserInput.$peekChar('@')) { - if (parserInput.$str('@media')) { - return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions); - } - if (parserInput.$str('@container')) { - return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions); - } - } - parserInput.restore(); - }, - // - // A @plugin directive, used to import plugins dynamically. - // - // @plugin (args) "lib"; - // - plugin: function () { - var path; - var args; - var options; - var index = parserInput.i; - var dir = parserInput.$re(/^@plugin\s+/); - if (dir) { - args = this.pluginArgs(); - if (args) { - options = { - pluginArgs: args, - isPlugin: true - }; - } - else { - options = { isPlugin: true }; - } - if ((path = this.entities.quoted() || this.entities.url())) { - if (!parserInput.$char(';')) { - parserInput.i = index; - error('missing semi-colon on @plugin'); - } - return new (tree.Import)(path, null, options, index + currentIndex, fileInfo); - } - else { - parserInput.i = index; - error('malformed @plugin statement'); - } - } - }, - pluginArgs: function () { - // list of options, surrounded by parens - parserInput.save(); - if (!parserInput.$char('(')) { - parserInput.restore(); - return null; - } - var args = parserInput.$re(/^\s*([^);]+)\)\s*/); - if (args[1]) { - parserInput.forget(); - return args[1].trim(); - } - else { - parserInput.restore(); - return null; - } - }, - atruleUnknown: function (value, name, hasBlock) { - value = this.permissiveValue(/^[{;]/); - hasBlock = (parserInput.currentChar() === '{'); - if (!value) { - if (!hasBlock && parserInput.currentChar() !== ';') { - error(''.concat(name, ' rule is missing block or ending semi-colon')); - } - } - else if (!value.value) { - value = null; - } - return [value, hasBlock]; - }, - atruleBlock: function (rules, value, isRooted, isKeywordList) { - rules = this.blockRuleset(); - parserInput.save(); - if (!rules && !isRooted) { - value = this.entity(); - rules = this.blockRuleset(); - } - if (!rules && !isRooted) { - parserInput.restore(); - var e = []; - value = this.entity(); - while (parserInput.$char(',')) { - e.push(value); - value = this.entity(); - } - if (value && e.length > 0) { - e.push(value); - value = e; - isKeywordList = true; - } - else { - rules = this.blockRuleset(); - } - } - else { - parserInput.forget(); - } - return [rules, value, isKeywordList]; - }, - // - // A CSS AtRule - // - // @charset "utf-8"; - // - atrule: function () { - var index = parserInput.i; - var name; - var value; - var rules; - var nonVendorSpecificName; - var hasIdentifier; - var hasExpression; - var hasUnknown; - var hasBlock = true; - var isRooted = true; - var isKeywordList = false; - if (parserInput.currentChar() !== '@') { - return; - } - value = this['import']() || this.plugin() || this.nestableAtRule(); - if (value) { - return value; - } - parserInput.save(); - name = parserInput.$re(/^@[a-z-]+/); - if (!name) { - return; - } - nonVendorSpecificName = name; - if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) { - nonVendorSpecificName = "@".concat(name.slice(name.indexOf('-', 2) + 1)); - } - switch (nonVendorSpecificName) { - case '@charset': - hasIdentifier = true; - hasBlock = false; - break; - case '@namespace': - hasExpression = true; - hasBlock = false; - break; - case '@keyframes': - case '@counter-style': - hasIdentifier = true; - break; - case '@document': - case '@supports': - hasUnknown = true; - isRooted = false; - break; - case '@starting-style': - isRooted = false; - break; - case '@layer': - isRooted = false; - break; - default: - hasUnknown = true; - break; - } - parserInput.commentStore.length = 0; - if (hasIdentifier) { - value = this.entity(); - if (!value) { - error("expected ".concat(name, " identifier")); - } - } - else if (hasExpression) { - value = this.expression(); - if (!value) { - error("expected ".concat(name, " expression")); - } - } - else if (hasUnknown) { - var unknownPackage = this.atruleUnknown(value, name, hasBlock); - value = unknownPackage[0]; - hasBlock = unknownPackage[1]; - } - if (hasBlock) { - var blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList); - rules = blockPackage[0]; - value = blockPackage[1]; - isKeywordList = blockPackage[2]; - if (!rules && !hasUnknown) { - parserInput.restore(); - name = parserInput.$re(/^@[a-z-]+/); - var unknownPackage = this.atruleUnknown(value, name, hasBlock); - value = unknownPackage[0]; - hasBlock = unknownPackage[1]; - if (hasBlock) { - blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList); - rules = blockPackage[0]; - value = blockPackage[1]; - isKeywordList = blockPackage[2]; - } - } - } - if (rules || isKeywordList || (!hasBlock && value && parserInput.$char(';'))) { - parserInput.forget(); - return new (tree.AtRule)(name, value, rules, index + currentIndex, fileInfo, context.dumpLineNumbers ? getDebugInfo(index) : null, isRooted); - } - parserInput.restore('at-rule options not recognised'); - }, - // - // A Value is a comma-delimited list of Expressions - // - // font-family: Baskerville, Georgia, serif; - // - // In a Rule, a Value represents everything after the `:`, - // and before the `;`. - // - value: function () { - var e; - var expressions = []; - var index = parserInput.i; - do { - e = this.expression(); - if (e) { - expressions.push(e); - if (!parserInput.$char(',')) { - break; - } - } - } while (e); - if (expressions.length > 0) { - return new (tree.Value)(expressions, index + currentIndex); - } - }, - important: function () { - if (parserInput.currentChar() === '!') { - return parserInput.$re(/^! *important/); - } - }, - sub: function () { - var a; - var e; - parserInput.save(); - if (parserInput.$char('(')) { - a = this.addition(); - if (a && parserInput.$char(')')) { - parserInput.forget(); - e = new (tree.Expression)([a]); - e.parens = true; - return e; - } - parserInput.restore('Expected \')\''); - return; - } - parserInput.restore(); - }, - colorOperand: function () { - parserInput.save(); - // hsl or rgb or lch operand - var match = parserInput.$re(/^[lchrgbs]\s+/); - if (match) { - return new tree.Keyword(match[0]); - } - parserInput.restore(); - }, - multiplication: function () { - var m; - var a; - var op; - var operation; - var isSpaced; - m = this.operand(); - if (m) { - isSpaced = parserInput.isWhitespace(-1); - while (true) { - if (parserInput.peek(/^\/[*/]/)) { - break; - } - parserInput.save(); - op = parserInput.$char('/') || parserInput.$char('*'); - if (!op) { - var index = parserInput.i; - op = parserInput.$str('./'); - if (op) { - warn('./ operator is deprecated', index, 'DEPRECATED'); - } - } - if (!op) { - parserInput.forget(); - break; - } - a = this.operand(); - if (!a) { - parserInput.restore(); - break; - } - parserInput.forget(); - m.parensInOp = true; - a.parensInOp = true; - operation = new (tree.Operation)(op, [operation || m, a], isSpaced); - isSpaced = parserInput.isWhitespace(-1); - } - return operation || m; - } - }, - addition: function () { - var m; - var a; - var op; - var operation; - var isSpaced; - m = this.multiplication(); - if (m) { - isSpaced = parserInput.isWhitespace(-1); - while (true) { - op = parserInput.$re(/^[-+]\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-'))); - if (!op) { - break; - } - a = this.multiplication(); - if (!a) { - break; - } - m.parensInOp = true; - a.parensInOp = true; - operation = new (tree.Operation)(op, [operation || m, a], isSpaced); - isSpaced = parserInput.isWhitespace(-1); - } - return operation || m; - } - }, - conditions: function () { - var a; - var b; - var index = parserInput.i; - var condition; - a = this.condition(true); - if (a) { - while (true) { - if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(',')) { - break; - } - b = this.condition(true); - if (!b) { - break; - } - condition = new (tree.Condition)('or', condition || a, b, index + currentIndex); - } - return condition || a; - } - }, - condition: function (needsParens) { - var result; - var logical; - var next; - function or() { - return parserInput.$str('or'); - } - result = this.conditionAnd(needsParens); - if (!result) { - return; - } - logical = or(); - if (logical) { - next = this.condition(needsParens); - if (next) { - result = new (tree.Condition)(logical, result, next); - } - else { - return; - } - } - return result; - }, - conditionAnd: function (needsParens) { - var result; - var logical; - var next; - var self = this; - function insideCondition() { - var cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens); - if (!cond && !needsParens) { - return self.atomicCondition(needsParens); - } - return cond; - } - function and() { - return parserInput.$str('and'); - } - result = insideCondition(); - if (!result) { - return; - } - logical = and(); - if (logical) { - next = this.conditionAnd(needsParens); - if (next) { - result = new (tree.Condition)(logical, result, next); - } - else { - return; - } - } - return result; - }, - negatedCondition: function (needsParens) { - if (parserInput.$str('not')) { - var result = this.parenthesisCondition(needsParens); - if (result) { - result.negate = !result.negate; - } - return result; - } - }, - parenthesisCondition: function (needsParens) { - function tryConditionFollowedByParenthesis(me) { - var body; - parserInput.save(); - body = me.condition(needsParens); - if (!body) { - parserInput.restore(); - return; - } - if (!parserInput.$char(')')) { - parserInput.restore(); - return; - } - parserInput.forget(); - return body; - } - var body; - parserInput.save(); - if (!parserInput.$str('(')) { - parserInput.restore(); - return; - } - body = tryConditionFollowedByParenthesis(this); - if (body) { - parserInput.forget(); - return body; - } - body = this.atomicCondition(needsParens); - if (!body) { - parserInput.restore(); - return; - } - if (!parserInput.$char(')')) { - parserInput.restore("expected ')' got '".concat(parserInput.currentChar(), "'")); - return; - } - parserInput.forget(); - return body; - }, - atomicCondition: function (needsParens, preparsedCond) { - var entities = this.entities; - var index = parserInput.i; - var a; - var b; - var c; - var op; - var cond = (function () { - return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); - }).bind(this); - if (preparsedCond) { - a = preparsedCond; - } - else { - a = cond(); - } - if (a) { - if (parserInput.$char('>')) { - if (parserInput.$char('=')) { - op = '>='; - } - else { - op = '>'; - } - } - else if (parserInput.$char('<')) { - if (parserInput.$char('=')) { - op = '<='; - } - else { - op = '<'; - } - } - else if (parserInput.$char('=')) { - if (parserInput.$char('>')) { - op = '=>'; - } - else if (parserInput.$char('<')) { - op = '=<'; - } - else { - op = '='; - } - } - if (op) { - b = cond(); - if (b) { - c = new (tree.Condition)(op, a, b, index + currentIndex, false); - } - else { - error('expected expression'); - } - } - else if (!preparsedCond) { - c = new (tree.Condition)('=', a, new (tree.Keyword)('true'), index + currentIndex, false); - } - return c; - } - }, - // - // An operand is anything that can be part of an operation, - // such as a Color, or a Variable - // - operand: function () { - var entities = this.entities; - var negate; - if (parserInput.peek(/^-[@$(]/)) { - negate = parserInput.$char('-'); - } - var o = this.sub() || entities.dimension() || - entities.color() || entities.variable() || - entities.property() || entities.call() || - entities.quoted(true) || entities.colorKeyword() || - this.colorOperand() || entities.mixinLookup(); - if (negate) { - o.parensInOp = true; - o = new (tree.Negative)(o); - } - return o; - }, - // - // Expressions either represent mathematical operations, - // or white-space delimited Entities. - // - // 1px solid black - // @var * 2 - // - expression: function () { - var entities = []; - var e; - var delim; - var index = parserInput.i; - do { - e = this.comment(); - if (e && !e.isLineComment) { - entities.push(e); - continue; - } - e = this.addition() || this.entity(); - if (e instanceof tree.Comment) { - e = null; - } - if (e) { - entities.push(e); - // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here - if (!parserInput.peek(/^\/[/*]/)) { - delim = parserInput.$char('/'); - if (delim) { - entities.push(new (tree.Anonymous)(delim, index + currentIndex)); - } - } - } - } while (e); - if (entities.length > 0) { - return new (tree.Expression)(entities); - } - }, - property: function () { - var name = parserInput.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/); - if (name) { - return name[1]; - } - }, - ruleProperty: function () { - var name = []; - var index = []; - var s; - var k; - parserInput.save(); - var simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\s*:/); - if (simpleProperty) { - name = [new (tree.Keyword)(simpleProperty[1])]; - parserInput.forget(); - return name; - } - function match(re) { - var i = parserInput.i; - var chunk = parserInput.$re(re); - if (chunk) { - index.push(i); - return name.push(chunk[1]); - } - } - match(/^(\*?)/); - while (true) { - if (!match(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/)) { - break; - } - } - if ((name.length > 1) && match(/^((?:\+_|\+)?)\s*:/)) { - parserInput.forget(); - // at last, we have the complete match now. move forward, - // convert name particles to tree objects and return: - if (name[0] === '') { - name.shift(); - index.shift(); - } - for (k = 0; k < name.length; k++) { - s = name[k]; - name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ? - new (tree.Keyword)(s) : - (s.charAt(0) === '@' ? - new (tree.Variable)("@".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo) : - new (tree.Property)("$".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo)); - } - return name; - } - parserInput.restore(); - } - } - }; - }; - Parser.serializeVars = function (vars) { - var s = ''; - for (var name_1 in vars) { - if (Object.hasOwnProperty.call(vars, name_1)) { - var value = vars[name_1]; - s += "".concat(((name_1[0] === '@') ? '' : '@') + name_1, ": ").concat(value).concat((String(value).slice(-1) === ';') ? '' : ';'); - } - } - return s; - }; - - var Selector = function (elements, extendList, condition, index, currentFileInfo, visibilityInfo) { - this.extendList = extendList; - this.condition = condition; - this.evaldCondition = !condition; - this._index = index; - this._fileInfo = currentFileInfo; - this.elements = this.getElements(elements); - this.mixinElements_ = undefined; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.elements, this); - }; - Selector.prototype = Object.assign(new Node(), { - type: 'Selector', - accept: function (visitor) { - if (this.elements) { - this.elements = visitor.visitArray(this.elements); - } - if (this.extendList) { - this.extendList = visitor.visitArray(this.extendList); - } - if (this.condition) { - this.condition = visitor.visit(this.condition); - } - }, - createDerived: function (elements, extendList, evaldCondition) { - elements = this.getElements(elements); - var newSelector = new Selector(elements, extendList || this.extendList, null, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - newSelector.evaldCondition = (!isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition; - newSelector.mediaEmpty = this.mediaEmpty; - return newSelector; - }, - getElements: function (els) { - if (!els) { - return [new Element('', '&', false, this._index, this._fileInfo)]; - } - if (typeof els === 'string') { - new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(els, ['selector'], function (err, result) { - if (err) { - throw new LessError({ - index: err.index, - message: err.message - }, this.parse.imports, this._fileInfo.filename); - } - els = result[0].elements; - }); - } - return els; - }, - createEmptySelectors: function () { - var el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)]; - sels[0].mediaEmpty = true; - return sels; - }, - match: function (other) { - var elements = this.elements; - var len = elements.length; - var olen; - var i; - other = other.mixinElements(); - olen = other.length; - if (olen === 0 || len < olen) { - return 0; - } - else { - for (i = 0; i < olen; i++) { - if (elements[i].value !== other[i]) { - return 0; - } - } - } - return olen; // return number of matched elements - }, - mixinElements: function () { - if (this.mixinElements_) { - return this.mixinElements_; - } - var elements = this.elements.map(function (v) { - return v.combinator.value + (v.value.value || v.value); - }).join('').match(/[,&#*.\w-]([\w-]|(\\.))*/g); - if (elements) { - if (elements[0] === '&') { - elements.shift(); - } - } - else { - elements = []; - } - return (this.mixinElements_ = elements); - }, - isJustParentSelector: function () { - return !this.mediaEmpty && - this.elements.length === 1 && - this.elements[0].value === '&' && - (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === ''); - }, - eval: function (context) { - var evaldCondition = this.condition && this.condition.eval(context); - var elements = this.elements; - var extendList = this.extendList; - elements = elements && elements.map(function (e) { return e.eval(context); }); - extendList = extendList && extendList.map(function (extend) { return extend.eval(context); }); - return this.createDerived(elements, extendList, evaldCondition); - }, - genCSS: function (context, output) { - var i, element; - if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') { - output.add(' ', this.fileInfo(), this.getIndex()); - } - for (i = 0; i < this.elements.length; i++) { - element = this.elements[i]; - element.genCSS(context, output); - } - }, - getIsOutput: function () { - return this.evaldCondition; - } - }); - - var Value = function (value) { - if (!value) { - throw new Error('Value requires an array argument'); - } - if (!Array.isArray(value)) { - this.value = [value]; - } - else { - this.value = value; - } - }; - Value.prototype = Object.assign(new Node(), { - type: 'Value', - accept: function (visitor) { - if (this.value) { - this.value = visitor.visitArray(this.value); - } - }, - eval: function (context) { - if (this.value.length === 1) { - return this.value[0].eval(context); - } - else { - return new Value(this.value.map(function (v) { - return v.eval(context); - })); - } - }, - genCSS: function (context, output) { - var i; - for (i = 0; i < this.value.length; i++) { - this.value[i].genCSS(context, output); - if (i + 1 < this.value.length) { - output.add((context && context.compress) ? ',' : ', '); - } - } - } - }); - - var Keyword = function (value) { - this.value = value; - }; - Keyword.prototype = Object.assign(new Node(), { - type: 'Keyword', - genCSS: function (context, output) { - if (this.value === '%') { - throw { type: 'Syntax', message: 'Invalid % without number' }; - } - output.add(this.value); - } - }); - Keyword.True = new Keyword('true'); - Keyword.False = new Keyword('false'); - - var MATH$1 = Math$1; - function evalName(context, name) { - var value = ''; - var i; - var n = name.length; - var output = { add: function (s) { value += s; } }; - for (i = 0; i < n; i++) { - name[i].eval(context).genCSS(context, output); - } - return value; - } - var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) { - this.name = name; - this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); - this.important = important ? " ".concat(important.trim()) : ''; - this.merge = merge; - this._index = index; - this._fileInfo = currentFileInfo; - this.inline = inline || false; - this.variable = (variable !== undefined) ? variable - : (name.charAt && (name.charAt(0) === '@')); - this.allowRoot = true; - this.setParent(this.value, this); - }; - Declaration.prototype = Object.assign(new Node(), { - type: 'Declaration', - genCSS: function (context, output) { - output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); - try { - this.value.genCSS(context, output); - } - catch (e) { - e.index = this._index; - e.filename = this._fileInfo.filename; - throw e; - } - output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index); - }, - eval: function (context) { - var mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable; - if (typeof name !== 'string') { - // expand 'primitive' name directly to get - // things faster (~10% for benchmark.less): - name = (name.length === 1) && (name[0] instanceof Keyword) ? - name[0].value : evalName(context, name); - variable = false; // never treat expanded interpolation as new variable name - } - // @todo remove when parens-division is default - if (name === 'font' && context.math === MATH$1.ALWAYS) { - mathBypass = true; - prevMath = context.math; - context.math = MATH$1.PARENS_DIVISION; - } - try { - context.importantScope.push({}); - evaldValue = this.value.eval(context); - if (!this.variable && evaldValue.type === 'DetachedRuleset') { - throw { message: 'Rulesets cannot be evaluated on a property.', - index: this.getIndex(), filename: this.fileInfo().filename }; - } - var important = this.important; - var importantResult = context.importantScope.pop(); - if (!important && importantResult.important) { - important = importantResult.important; - } - return new Declaration(name, evaldValue, important, this.merge, this.getIndex(), this.fileInfo(), this.inline, variable); - } - catch (e) { - if (typeof e.index !== 'number') { - e.index = this.getIndex(); - e.filename = this.fileInfo().filename; - } - throw e; - } - finally { - if (mathBypass) { - context.math = prevMath; - } - } - }, - makeImportant: function () { - return new Declaration(this.name, this.value, '!important', this.merge, this.getIndex(), this.fileInfo(), this.inline); - } - }); - - function asComment(ctx) { - return "/* line ".concat(ctx.debugInfo.lineNumber, ", ").concat(ctx.debugInfo.fileName, " */\n"); - } - function asMediaQuery(ctx) { - var filenameWithProtocol = ctx.debugInfo.fileName; - if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { - filenameWithProtocol = "file://".concat(filenameWithProtocol); - } - return "@media -sass-debug-info{filename{font-family:".concat(filenameWithProtocol.replace(/([.:/\\])/g, function (a) { - if (a == '\\') { - a = '/'; - } - return "\\".concat(a); - }), "}line{font-family:\\00003").concat(ctx.debugInfo.lineNumber, "}}\n"); - } - function debugInfo(context, ctx, lineSeparator) { - var result = ''; - if (context.dumpLineNumbers && !context.compress) { - switch (context.dumpLineNumbers) { - case 'comments': - result = asComment(ctx); - break; - case 'mediaquery': - result = asMediaQuery(ctx); - break; - case 'all': - result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx); - break; - } - } - return result; - } - - var Comment = function (value, isLineComment, index, currentFileInfo) { - this.value = value; - this.isLineComment = isLineComment; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; - }; - Comment.prototype = Object.assign(new Node(), { - type: 'Comment', - genCSS: function (context, output) { - if (this.debugInfo) { - output.add(debugInfo(context, this), this.fileInfo(), this.getIndex()); - } - output.add(this.value); - }, - isSilent: function (context) { - var isCompressed = context.compress && this.value[2] !== '!'; - return this.isLineComment || isCompressed; - } - }); - - var defaultFunc = { - eval: function () { - var v = this.value_; - var e = this.error_; - if (e) { - throw e; - } - if (!isNullOrUndefined(v)) { - return v ? Keyword.True : Keyword.False; - } - }, - value: function (v) { - this.value_ = v; - }, - error: function (e) { - this.error_ = e; - }, - reset: function () { - this.value_ = this.error_ = null; - } - }; - - var Ruleset = function (selectors, rules, strictImports, visibilityInfo) { - this.selectors = selectors; - this.rules = rules; - this._lookups = {}; - this._variables = null; - this._properties = null; - this.strictImports = strictImports; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(this.selectors, this); - this.setParent(this.rules, this); - }; - Ruleset.prototype = Object.assign(new Node(), { - type: 'Ruleset', - isRuleset: true, - isRulesetLike: function () { return true; }, - accept: function (visitor) { - if (this.paths) { - this.paths = visitor.visitArray(this.paths, true); - } - else if (this.selectors) { - this.selectors = visitor.visitArray(this.selectors); - } - if (this.rules && this.rules.length) { - this.rules = visitor.visitArray(this.rules); - } - }, - eval: function (context) { - var selectors; - var selCnt; - var selector; - var i; - var hasVariable; - var hasOnePassingSelector = false; - if (this.selectors && (selCnt = this.selectors.length)) { - selectors = new Array(selCnt); - defaultFunc.error({ - type: 'Syntax', - message: 'it is currently only allowed in parametric mixin guards,' - }); - for (i = 0; i < selCnt; i++) { - selector = this.selectors[i].eval(context); - for (var j = 0; j < selector.elements.length; j++) { - if (selector.elements[j].isVariable) { - hasVariable = true; - break; - } - } - selectors[i] = selector; - if (selector.evaldCondition) { - hasOnePassingSelector = true; - } - } - if (hasVariable) { - var toParseSelectors = new Array(selCnt); - for (i = 0; i < selCnt; i++) { - selector = selectors[i]; - toParseSelectors[i] = selector.toCSS(context); - } - var startingIndex = selectors[0].getIndex(); - var selectorFileInfo = selectors[0].fileInfo(); - new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(toParseSelectors.join(','), ['selectors'], function (err, result) { - if (result) { - selectors = flattenArray(result); - } - }); - } - defaultFunc.reset(); - } - else { - hasOnePassingSelector = true; - } - var rules = this.rules ? copyArray(this.rules) : null; - var ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo()); - var rule; - var subRule; - ruleset.originalRuleset = this; - ruleset.root = this.root; - ruleset.firstRoot = this.firstRoot; - ruleset.allowImports = this.allowImports; - if (this.debugInfo) { - ruleset.debugInfo = this.debugInfo; - } - if (!hasOnePassingSelector) { - rules.length = 0; - } - // inherit a function registry from the frames stack when possible; - // otherwise from the global registry - ruleset.functionRegistry = (function (frames) { - var i = 0; - var n = frames.length; - var found; - for (; i !== n; ++i) { - found = frames[i].functionRegistry; - if (found) { - return found; - } - } - return functionRegistry; - }(context.frames)).inherit(); - // push the current ruleset to the frames stack - var ctxFrames = context.frames; - ctxFrames.unshift(ruleset); - // currrent selectors - var ctxSelectors = context.selectors; - if (!ctxSelectors) { - context.selectors = ctxSelectors = []; - } - ctxSelectors.unshift(this.selectors); - // Evaluate imports - if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) { - ruleset.evalImports(context); - } - // Store the frames around mixin definitions, - // so they can be evaluated like closures when the time comes. - var rsRules = ruleset.rules; - for (i = 0; (rule = rsRules[i]); i++) { - if (rule.evalFirst) { - rsRules[i] = rule.eval(context); - } - } - var mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0; - // Evaluate mixin calls. - for (i = 0; (rule = rsRules[i]); i++) { - if (rule.type === 'MixinCall') { - /* jshint loopfunc:true */ - rules = rule.eval(context).filter(function (r) { - if ((r instanceof Declaration) && r.variable) { - // do not pollute the scope if the variable is - // already there. consider returning false here - // but we need a way to "return" variable from mixins - return !(ruleset.variable(r.name)); - } - return true; - }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); - i += rules.length - 1; - ruleset.resetCache(); - } - else if (rule.type === 'VariableCall') { - /* jshint loopfunc:true */ - rules = rule.eval(context).rules.filter(function (r) { - if ((r instanceof Declaration) && r.variable) { - // do not pollute the scope at all - return false; - } - return true; - }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); - i += rules.length - 1; - ruleset.resetCache(); - } - } - // Evaluate everything else - for (i = 0; (rule = rsRules[i]); i++) { - if (!rule.evalFirst) { - rsRules[i] = rule = rule.eval ? rule.eval(context) : rule; - } - } - // Evaluate everything else - for (i = 0; (rule = rsRules[i]); i++) { - // for rulesets, check if it is a css guard and can be removed - if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) { - // check if it can be folded in (e.g. & where) - if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) { - rsRules.splice(i--, 1); - for (var j = 0; (subRule = rule.rules[j]); j++) { - if (subRule instanceof Node) { - subRule.copyVisibilityInfo(rule.visibilityInfo()); - if (!(subRule instanceof Declaration) || !subRule.variable) { - rsRules.splice(++i, 0, subRule); - } - } - } - } - } - } - // Pop the stack - ctxFrames.shift(); - ctxSelectors.shift(); - if (context.mediaBlocks) { - for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) { - context.mediaBlocks[i].bubbleSelectors(selectors); - } - } - return ruleset; - }, - evalImports: function (context) { - var rules = this.rules; - var i; - var importRules; - if (!rules) { - return; - } - for (i = 0; i < rules.length; i++) { - if (rules[i].type === 'Import') { - importRules = rules[i].eval(context); - if (importRules && (importRules.length || importRules.length === 0)) { - rules.splice.apply(rules, [i, 1].concat(importRules)); - i += importRules.length - 1; - } - else { - rules.splice(i, 1, importRules); - } - this.resetCache(); - } - } - }, - makeImportant: function () { - var result = new Ruleset(this.selectors, this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(); - } - else { - return r; - } - }), this.strictImports, this.visibilityInfo()); - return result; - }, - matchArgs: function (args) { - return !args || args.length === 0; - }, - // lets you call a css selector with a guard - matchCondition: function (args, context) { - var lastSelector = this.selectors[this.selectors.length - 1]; - if (!lastSelector.evaldCondition) { - return false; - } - if (lastSelector.condition && - !lastSelector.condition.eval(new contexts.Eval(context, context.frames))) { - return false; - } - return true; - }, - resetCache: function () { - this._rulesets = null; - this._variables = null; - this._properties = null; - this._lookups = {}; - }, - variables: function () { - if (!this._variables) { - this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) { - if (r instanceof Declaration && r.variable === true) { - hash[r.name] = r; - } - // when evaluating variables in an import statement, imports have not been eval'd - // so we need to go inside import statements. - // guard against root being a string (in the case of inlined less) - if (r.type === 'Import' && r.root && r.root.variables) { - var vars = r.root.variables(); - for (var name_1 in vars) { - // eslint-disable-next-line no-prototype-builtins - if (vars.hasOwnProperty(name_1)) { - hash[name_1] = r.root.variable(name_1); - } - } - } - return hash; - }, {}); - } - return this._variables; - }, - properties: function () { - if (!this._properties) { - this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) { - if (r instanceof Declaration && r.variable !== true) { - var name_2 = (r.name.length === 1) && (r.name[0] instanceof Keyword) ? - r.name[0].value : r.name; - // Properties don't overwrite as they can merge - if (!hash["$".concat(name_2)]) { - hash["$".concat(name_2)] = [r]; - } - else { - hash["$".concat(name_2)].push(r); - } - } - return hash; - }, {}); - } - return this._properties; - }, - variable: function (name) { - var decl = this.variables()[name]; - if (decl) { - return this.parseValue(decl); - } - }, - property: function (name) { - var decl = this.properties()[name]; - if (decl) { - return this.parseValue(decl); - } - }, - lastDeclaration: function () { - for (var i_1 = this.rules.length; i_1 > 0; i_1--) { - var decl = this.rules[i_1 - 1]; - if (decl instanceof Declaration) { - return this.parseValue(decl); - } - } - }, - parseValue: function (toParse) { - var self = this; - function transformDeclaration(decl) { - if (decl.value instanceof Anonymous && !decl.parsed) { - if (typeof decl.value.value === 'string') { - new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(decl.value.value, ['value', 'important'], function (err, result) { - if (err) { - decl.parsed = true; - } - if (result) { - decl.value = result[0]; - decl.important = result[1] || ''; - decl.parsed = true; - } - }); - } - else { - decl.parsed = true; - } - return decl; - } - else { - return decl; - } - } - if (!Array.isArray(toParse)) { - return transformDeclaration.call(self, toParse); - } - else { - var nodes_1 = []; - toParse.forEach(function (n) { - nodes_1.push(transformDeclaration.call(self, n)); - }); - return nodes_1; - } - }, - rulesets: function () { - if (!this.rules) { - return []; - } - var filtRules = []; - var rules = this.rules; - var i; - var rule; - for (i = 0; (rule = rules[i]); i++) { - if (rule.isRuleset) { - filtRules.push(rule); - } - } - return filtRules; - }, - prependRule: function (rule) { - var rules = this.rules; - if (rules) { - rules.unshift(rule); - } - else { - this.rules = [rule]; - } - this.setParent(rule, this); - }, - find: function (selector, self, filter) { - self = self || this; - var rules = []; - var match; - var foundMixins; - var key = selector.toCSS(); - if (key in this._lookups) { - return this._lookups[key]; - } - this.rulesets().forEach(function (rule) { - if (rule !== self) { - for (var j = 0; j < rule.selectors.length; j++) { - match = selector.match(rule.selectors[j]); - if (match) { - if (selector.elements.length > match) { - if (!filter || filter(rule)) { - foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter); - for (var i_2 = 0; i_2 < foundMixins.length; ++i_2) { - foundMixins[i_2].path.push(rule); - } - Array.prototype.push.apply(rules, foundMixins); - } - } - else { - rules.push({ rule: rule, path: [] }); - } - break; - } - } - } - }); - this._lookups[key] = rules; - return rules; - }, - genCSS: function (context, output) { - var i; - var j; - var charsetRuleNodes = []; - var ruleNodes = []; - var // Line number debugging - debugInfo$1; - var rule; - var path; - context.tabLevel = (context.tabLevel || 0); - if (!this.root) { - context.tabLevel++; - } - var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' '); - var tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' '); - var sep; - var charsetNodeIndex = 0; - var importNodeIndex = 0; - for (i = 0; (rule = this.rules[i]); i++) { - if (rule instanceof Comment) { - if (importNodeIndex === i) { - importNodeIndex++; - } - ruleNodes.push(rule); - } - else if (rule.isCharset && rule.isCharset()) { - ruleNodes.splice(charsetNodeIndex, 0, rule); - charsetNodeIndex++; - importNodeIndex++; - } - else if (rule.type === 'Import') { - ruleNodes.splice(importNodeIndex, 0, rule); - importNodeIndex++; - } - else { - ruleNodes.push(rule); - } - } - ruleNodes = charsetRuleNodes.concat(ruleNodes); - // If this is the root node, we don't render - // a selector, or {}. - if (!this.root) { - debugInfo$1 = debugInfo(context, this, tabSetStr); - if (debugInfo$1) { - output.add(debugInfo$1); - output.add(tabSetStr); - } - var paths = this.paths; - var pathCnt = paths.length; - var pathSubCnt = void 0; - sep = context.compress ? ',' : (",\n".concat(tabSetStr)); - for (i = 0; i < pathCnt; i++) { - path = paths[i]; - if (!(pathSubCnt = path.length)) { - continue; - } - if (i > 0) { - output.add(sep); - } - context.firstSelector = true; - path[0].genCSS(context, output); - context.firstSelector = false; - for (j = 1; j < pathSubCnt; j++) { - path[j].genCSS(context, output); - } - } - output.add((context.compress ? '{' : ' {\n') + tabRuleStr); - } - // Compile rules and rulesets - for (i = 0; (rule = ruleNodes[i]); i++) { - if (i + 1 === ruleNodes.length) { - context.lastRule = true; - } - var currentLastRule = context.lastRule; - if (rule.isRulesetLike(rule)) { - context.lastRule = false; - } - if (rule.genCSS) { - rule.genCSS(context, output); - } - else if (rule.value) { - output.add(rule.value.toString()); - } - context.lastRule = currentLastRule; - if (!context.lastRule && rule.isVisible()) { - output.add(context.compress ? '' : ("\n".concat(tabRuleStr))); - } - else { - context.lastRule = false; - } - } - if (!this.root) { - output.add((context.compress ? '}' : "\n".concat(tabSetStr, "}"))); - context.tabLevel--; - } - if (!output.isEmpty() && !context.compress && this.firstRoot) { - output.add('\n'); - } - }, - joinSelectors: function (paths, context, selectors) { - for (var s = 0; s < selectors.length; s++) { - this.joinSelector(paths, context, selectors[s]); - } - }, - joinSelector: function (paths, context, selector) { - function createParenthesis(elementsToPak, originalElement) { - var replacementParen, j; - if (elementsToPak.length === 0) { - replacementParen = new Paren(elementsToPak[0]); - } - else { - var insideParent = new Array(elementsToPak.length); - for (j = 0; j < elementsToPak.length; j++) { - insideParent[j] = new Element(null, elementsToPak[j], originalElement.isVariable, originalElement._index, originalElement._fileInfo); - } - replacementParen = new Paren(new Selector(insideParent)); - } - return replacementParen; - } - function createSelector(containedElement, originalElement) { - var element, selector; - element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo); - selector = new Selector([element]); - return selector; - } - // joins selector path from `beginningPath` with selector path in `addPath` - // `replacedElement` contains element that is being replaced by `addPath` - // returns concatenated path - function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) { - var newSelectorPath, lastSelector, newJoinedSelector; - // our new selector path - newSelectorPath = []; - // construct the joined selector - if & is the first thing this will be empty, - // if not newJoinedSelector will be the last set of elements in the selector - if (beginningPath.length > 0) { - newSelectorPath = copyArray(beginningPath); - lastSelector = newSelectorPath.pop(); - newJoinedSelector = originalSelector.createDerived(copyArray(lastSelector.elements)); - } - else { - newJoinedSelector = originalSelector.createDerived([]); - } - if (addPath.length > 0) { - // /deep/ is a CSS4 selector - (removed, so should deprecate) - // that is valid without anything in front of it - // so if the & does not have a combinator that is "" or " " then - // and there is a combinator on the parent, then grab that. - // this also allows + a { & .b { .a & { ... though not sure why you would want to do that - var combinator = replacedElement.combinator; - var parentEl = addPath[0].elements[0]; - if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) { - combinator = parentEl.combinator; - } - // join the elements so far with the first part of the parent - newJoinedSelector.elements.push(new Element(combinator, parentEl.value, replacedElement.isVariable, replacedElement._index, replacedElement._fileInfo)); - newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1)); - } - // now add the joined selector - but only if it is not empty - if (newJoinedSelector.elements.length !== 0) { - newSelectorPath.push(newJoinedSelector); - } - // put together the parent selectors after the join (e.g. the rest of the parent) - if (addPath.length > 1) { - var restOfPath = addPath.slice(1); - restOfPath = restOfPath.map(function (selector) { - return selector.createDerived(selector.elements, []); - }); - newSelectorPath = newSelectorPath.concat(restOfPath); - } - return newSelectorPath; - } - // joins selector path from `beginningPath` with every selector path in `addPaths` array - // `replacedElement` contains element that is being replaced by `addPath` - // returns array with all concatenated paths - function addAllReplacementsIntoPath(beginningPath, addPaths, replacedElement, originalSelector, result) { - var j; - for (j = 0; j < beginningPath.length; j++) { - var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector); - result.push(newSelectorPath); - } - return result; - } - function mergeElementsOnToSelectors(elements, selectors) { - var i, sel; - if (elements.length === 0) { - return; - } - if (selectors.length === 0) { - selectors.push([new Selector(elements)]); - return; - } - for (i = 0; (sel = selectors[i]); i++) { - // if the previous thing in sel is a parent this needs to join on to it - if (sel.length > 0) { - sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements)); - } - else { - sel.push(new Selector(elements)); - } - } - } - // replace all parent selectors inside `inSelector` by content of `context` array - // resulting selectors are returned inside `paths` array - // returns true if `inSelector` contained at least one parent selector - function replaceParentSelector(paths, context, inSelector) { - // The paths are [[Selector]] - // The first list is a list of comma separated selectors - // The inner list is a list of inheritance separated selectors - // e.g. - // .a, .b { - // .c { - // } - // } - // == [[.a] [.c]] [[.b] [.c]] - // - var i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector; - function findNestedSelector(element) { - var maybeSelector; - if (!(element.value instanceof Paren)) { - return null; - } - maybeSelector = element.value.value; - if (!(maybeSelector instanceof Selector)) { - return null; - } - return maybeSelector; - } - // the elements from the current selector so far - currentElements = []; - // the current list of new selectors to add to the path. - // We will build it up. We initiate it with one empty selector as we "multiply" the new selectors - // by the parents - newSelectors = [ - [] - ]; - for (i = 0; (el = inSelector.elements[i]); i++) { - // non parent reference elements just get added - if (el.value !== '&') { - var nestedSelector = findNestedSelector(el); - if (nestedSelector !== null) { - // merge the current list of non parent selector elements - // on to the current list of selectors to add - mergeElementsOnToSelectors(currentElements, newSelectors); - var nestedPaths = []; - var replaced = void 0; - var replacedNewSelectors = []; - replaced = replaceParentSelector(nestedPaths, context, nestedSelector); - hadParentSelector = hadParentSelector || replaced; - // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors - for (k = 0; k < nestedPaths.length; k++) { - var replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); - addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); - } - newSelectors = replacedNewSelectors; - currentElements = []; - } - else { - currentElements.push(el); - } - } - else { - hadParentSelector = true; - // the new list of selectors to add - selectorsMultiplied = []; - // merge the current list of non parent selector elements - // on to the current list of selectors to add - mergeElementsOnToSelectors(currentElements, newSelectors); - // loop through our current selectors - for (j = 0; j < newSelectors.length; j++) { - sel = newSelectors[j]; - // if we don't have any parent paths, the & might be in a mixin so that it can be used - // whether there are parents or not - if (context.length === 0) { - // the combinator used on el should now be applied to the next element instead so that - // it is not lost - if (sel.length > 0) { - sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo)); - } - selectorsMultiplied.push(sel); - } - else { - // and the parent selectors - for (k = 0; k < context.length; k++) { - // We need to put the current selectors - // then join the last selector's elements on to the parents selectors - var newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector); - // add that to our new set of selectors - selectorsMultiplied.push(newSelectorPath); - } - } - } - // our new selectors has been multiplied, so reset the state - newSelectors = selectorsMultiplied; - currentElements = []; - } - } - // if we have any elements left over (e.g. .a& .b == .b) - // add them on to all the current selectors - mergeElementsOnToSelectors(currentElements, newSelectors); - for (i = 0; i < newSelectors.length; i++) { - length = newSelectors[i].length; - if (length > 0) { - paths.push(newSelectors[i]); - lastSelector = newSelectors[i][length - 1]; - newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList); - } - } - return hadParentSelector; - } - function deriveSelector(visibilityInfo, deriveFrom) { - var newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition); - newSelector.copyVisibilityInfo(visibilityInfo); - return newSelector; - } - // joinSelector code follows - var i, newPaths, hadParentSelector; - newPaths = []; - hadParentSelector = replaceParentSelector(newPaths, context, selector); - if (!hadParentSelector) { - if (context.length > 0) { - newPaths = []; - for (i = 0; i < context.length; i++) { - var concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo())); - concatenated.push(selector); - newPaths.push(concatenated); - } - } - else { - newPaths = [[selector]]; - } - } - for (i = 0; i < newPaths.length; i++) { - paths.push(newPaths[i]); - } - } - }); - - var Unit = function (numerator, denominator, backupUnit) { - this.numerator = numerator ? copyArray(numerator).sort() : []; - this.denominator = denominator ? copyArray(denominator).sort() : []; - if (backupUnit) { - this.backupUnit = backupUnit; - } - else if (numerator && numerator.length) { - this.backupUnit = numerator[0]; - } - }; - Unit.prototype = Object.assign(new Node(), { - type: 'Unit', - clone: function () { - return new Unit(copyArray(this.numerator), copyArray(this.denominator), this.backupUnit); - }, - genCSS: function (context, output) { - // Dimension checks the unit is singular and throws an error if in strict math mode. - var strictUnits = context && context.strictUnits; - if (this.numerator.length === 1) { - output.add(this.numerator[0]); // the ideal situation - } - else if (!strictUnits && this.backupUnit) { - output.add(this.backupUnit); - } - else if (!strictUnits && this.denominator.length) { - output.add(this.denominator[0]); - } - }, - toString: function () { - var i, returnStr = this.numerator.join('*'); - for (i = 0; i < this.denominator.length; i++) { - returnStr += "/".concat(this.denominator[i]); - } - return returnStr; - }, - compare: function (other) { - return this.is(other.toString()) ? 0 : undefined; - }, - is: function (unitString) { - return this.toString().toUpperCase() === unitString.toUpperCase(); - }, - isLength: function () { - return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); - }, - isEmpty: function () { - return this.numerator.length === 0 && this.denominator.length === 0; - }, - isSingular: function () { - return this.numerator.length <= 1 && this.denominator.length === 0; - }, - map: function (callback) { - var i; - for (i = 0; i < this.numerator.length; i++) { - this.numerator[i] = callback(this.numerator[i], false); - } - for (i = 0; i < this.denominator.length; i++) { - this.denominator[i] = callback(this.denominator[i], true); - } - }, - usedUnits: function () { - var group; - var result = {}; - var mapUnit; - var groupName; - mapUnit = function (atomicUnit) { - // eslint-disable-next-line no-prototype-builtins - if (group.hasOwnProperty(atomicUnit) && !result[groupName]) { - result[groupName] = atomicUnit; - } - return atomicUnit; - }; - for (groupName in unitConversions) { - // eslint-disable-next-line no-prototype-builtins - if (unitConversions.hasOwnProperty(groupName)) { - group = unitConversions[groupName]; - this.map(mapUnit); - } - } - return result; - }, - cancel: function () { - var counter = {}; - var atomicUnit; - var i; - for (i = 0; i < this.numerator.length; i++) { - atomicUnit = this.numerator[i]; - counter[atomicUnit] = (counter[atomicUnit] || 0) + 1; - } - for (i = 0; i < this.denominator.length; i++) { - atomicUnit = this.denominator[i]; - counter[atomicUnit] = (counter[atomicUnit] || 0) - 1; - } - this.numerator = []; - this.denominator = []; - for (atomicUnit in counter) { - // eslint-disable-next-line no-prototype-builtins - if (counter.hasOwnProperty(atomicUnit)) { - var count = counter[atomicUnit]; - if (count > 0) { - for (i = 0; i < count; i++) { - this.numerator.push(atomicUnit); - } - } - else if (count < 0) { - for (i = 0; i < -count; i++) { - this.denominator.push(atomicUnit); - } - } - } - } - this.numerator.sort(); - this.denominator.sort(); - } - }); - - /* eslint-disable no-prototype-builtins */ - // - // A number with a unit - // - var Dimension = function (value, unit) { - this.value = parseFloat(value); - if (isNaN(this.value)) { - throw new Error('Dimension is not a number.'); - } - this.unit = (unit && unit instanceof Unit) ? unit : - new Unit(unit ? [unit] : undefined); - this.setParent(this.unit, this); - }; - Dimension.prototype = Object.assign(new Node(), { - type: 'Dimension', - accept: function (visitor) { - this.unit = visitor.visit(this.unit); - }, - // remove when Nodes have JSDoc types - // eslint-disable-next-line no-unused-vars - eval: function (context) { - return this; - }, - toColor: function () { - return new Color([this.value, this.value, this.value]); - }, - genCSS: function (context, output) { - if ((context && context.strictUnits) && !this.unit.isSingular()) { - throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: ".concat(this.unit.toString())); - } - var value = this.fround(context, this.value); - var strValue = String(value); - if (value !== 0 && value < 0.000001 && value > -0.000001) { - // would be output 1e-6 etc. - strValue = value.toFixed(20).replace(/0+$/, ''); - } - if (context && context.compress) { - // Zero values doesn't need a unit - if (value === 0 && this.unit.isLength()) { - output.add(strValue); - return; - } - // Float values doesn't need a leading zero - if (value > 0 && value < 1) { - strValue = (strValue).substr(1); - } - } - output.add(strValue); - this.unit.genCSS(context, output); - }, - // In an operation between two Dimensions, - // we default to the first Dimension's unit, - // so `1px + 2` will yield `3px`. - operate: function (context, op, other) { - /* jshint noempty:false */ - var value = this._operate(context, op, this.value, other.value); - var unit = this.unit.clone(); - if (op === '+' || op === '-') { - if (unit.numerator.length === 0 && unit.denominator.length === 0) { - unit = other.unit.clone(); - if (this.unit.backupUnit) { - unit.backupUnit = this.unit.backupUnit; - } - } - else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) ; - else { - other = other.convertTo(this.unit.usedUnits()); - if (context.strictUnits && other.unit.toString() !== unit.toString()) { - throw new Error('Incompatible units. Change the units or use the unit function. ' - + "Bad units: '".concat(unit.toString(), "' and '").concat(other.unit.toString(), "'.")); - } - value = this._operate(context, op, this.value, other.value); - } - } - else if (op === '*') { - unit.numerator = unit.numerator.concat(other.unit.numerator).sort(); - unit.denominator = unit.denominator.concat(other.unit.denominator).sort(); - unit.cancel(); - } - else if (op === '/') { - unit.numerator = unit.numerator.concat(other.unit.denominator).sort(); - unit.denominator = unit.denominator.concat(other.unit.numerator).sort(); - unit.cancel(); - } - return new Dimension(value, unit); - }, - compare: function (other) { - var a, b; - if (!(other instanceof Dimension)) { - return undefined; - } - if (this.unit.isEmpty() || other.unit.isEmpty()) { - a = this; - b = other; - } - else { - a = this.unify(); - b = other.unify(); - if (a.unit.compare(b.unit) !== 0) { - return undefined; - } - } - return Node.numericCompare(a.value, b.value); - }, - unify: function () { - return this.convertTo({ length: 'px', duration: 's', angle: 'rad' }); - }, - convertTo: function (conversions) { - var value = this.value; - var unit = this.unit.clone(); - var i; - var groupName; - var group; - var targetUnit; - var derivedConversions = {}; - var applyUnit; - if (typeof conversions === 'string') { - for (i in unitConversions) { - if (unitConversions[i].hasOwnProperty(conversions)) { - derivedConversions = {}; - derivedConversions[i] = conversions; - } - } - conversions = derivedConversions; - } - applyUnit = function (atomicUnit, denominator) { - if (group.hasOwnProperty(atomicUnit)) { - if (denominator) { - value = value / (group[atomicUnit] / group[targetUnit]); - } - else { - value = value * (group[atomicUnit] / group[targetUnit]); - } - return targetUnit; - } - return atomicUnit; - }; - for (groupName in conversions) { - if (conversions.hasOwnProperty(groupName)) { - targetUnit = conversions[groupName]; - group = unitConversions[groupName]; - unit.map(applyUnit); - } - } - unit.cancel(); - return new Dimension(value, unit); - } - }); - - var Expression = function (value, noSpacing) { - this.value = value; - this.noSpacing = noSpacing; - if (!value) { - throw new Error('Expression requires an array parameter'); - } - }; - Expression.prototype = Object.assign(new Node(), { - type: 'Expression', - accept: function (visitor) { - this.value = visitor.visitArray(this.value); - }, - eval: function (context) { - var noSpacing = this.noSpacing; - var returnValue; - var mathOn = context.isMathOn(); - var inParenthesis = this.parens; - var doubleParen = false; - if (inParenthesis) { - context.inParenthesis(); - } - if (this.value.length > 1) { - returnValue = new Expression(this.value.map(function (e) { - if (!e.eval) { - return e; - } - return e.eval(context); - }), this.noSpacing); - } - else if (this.value.length === 1) { - if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) { - doubleParen = true; - } - returnValue = this.value[0].eval(context); - } - else { - returnValue = this; - } - if (inParenthesis) { - context.outOfParenthesis(); - } - if (this.parens && this.parensInOp && !mathOn && !doubleParen - && (!(returnValue instanceof Dimension))) { - returnValue = new Paren(returnValue); - } - returnValue.noSpacing = returnValue.noSpacing || noSpacing; - return returnValue; - }, - genCSS: function (context, output) { - for (var i_1 = 0; i_1 < this.value.length; i_1++) { - this.value[i_1].genCSS(context, output); - if (!this.noSpacing && i_1 + 1 < this.value.length) { - if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) || - this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ',') { - output.add(' '); - } - } - } - }, - throwAwayComments: function () { - this.value = this.value.filter(function (v) { - return !(v instanceof Comment); - }); - } - }); - - var NestableAtRulePrototype = { - isRulesetLike: function () { - return true; - }, - accept: function (visitor) { - if (this.features) { - this.features = visitor.visit(this.features); - } - if (this.rules) { - this.rules = visitor.visitArray(this.rules); - } - }, - evalFunction: function () { - if (!this.features || !Array.isArray(this.features.value) || this.features.value.length < 1) { - return; - } - var exprValues = this.features.value; - var expr, paren; - for (var index = 0; index < exprValues.length; ++index) { - expr = exprValues[index]; - if (expr.type === 'Keyword' && index + 1 < exprValues.length && (expr.noSpacing || expr.noSpacing == null)) { - paren = exprValues[index + 1]; - if (paren.type === 'Paren' && paren.noSpacing) { - exprValues[index] = new Expression([expr, paren]); - exprValues.splice(index + 1, 1); - exprValues[index].noSpacing = true; - } - } - } - }, - evalTop: function (context) { - this.evalFunction(); - var result = this; - // Render all dependent Media blocks. - if (context.mediaBlocks.length > 1) { - var selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors(); - result = new Ruleset(selectors, context.mediaBlocks); - result.multiMedia = true; - result.copyVisibilityInfo(this.visibilityInfo()); - this.setParent(result, this); - } - delete context.mediaBlocks; - delete context.mediaPath; - return result; - }, - evalNested: function (context) { - this.evalFunction(); - var i; - var value; - var path = context.mediaPath.concat([this]); - // Extract the media-query conditions separated with `,` (OR). - for (i = 0; i < path.length; i++) { - if (path[i].type !== this.type) { - context.mediaBlocks.splice(i, 1); - return this; - } - value = path[i].features instanceof Value ? - path[i].features.value : path[i].features; - path[i] = Array.isArray(value) ? value : [value]; - } - // Trace all permutations to generate the resulting media-query. - // - // (a, b and c) with nested (d, e) -> - // a and d - // a and e - // b and c and d - // b and c and e - this.features = new Value(this.permute(path).map(function (path) { - path = path.map(function (fragment) { return fragment.toCSS ? fragment : new Anonymous(fragment); }); - for (i = path.length - 1; i > 0; i--) { - path.splice(i, 0, new Anonymous('and')); - } - return new Expression(path); - })); - this.setParent(this.features, this); - // Fake a tree-node that doesn't output anything. - return new Ruleset([], []); - }, - permute: function (arr) { - if (arr.length === 0) { - return []; - } - else if (arr.length === 1) { - return arr[0]; - } - else { - var result = []; - var rest = this.permute(arr.slice(1)); - for (var i_1 = 0; i_1 < rest.length; i_1++) { - for (var j = 0; j < arr[0].length; j++) { - result.push([arr[0][j]].concat(rest[i_1])); - } - } - return result; - } - }, - bubbleSelectors: function (selectors) { - if (!selectors) { - return; - } - this.rules = [new Ruleset(copyArray(selectors), [this.rules[0]])]; - this.setParent(this.rules, this); - } - }; - - var AtRule = function (name, value, rules, index, currentFileInfo, debugInfo, isRooted, visibilityInfo) { - var _this = this; - var i; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - this.name = name; - this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); - if (rules) { - if (Array.isArray(rules)) { - var allDeclarations = this.declarationsBlock(rules); - var allRulesetDeclarations_1 = true; - rules.forEach(function (rule) { - if (rule.type === 'Ruleset' && rule.rules) - allRulesetDeclarations_1 = allRulesetDeclarations_1 && _this.declarationsBlock(rule.rules, true); - }); - if (allDeclarations && !isRooted) { - this.simpleBlock = true; - this.declarations = rules; - } - else if (allRulesetDeclarations_1 && rules.length === 1 && !isRooted && !value) { - this.simpleBlock = true; - this.declarations = rules[0].rules ? rules[0].rules : rules; - } - else { - this.rules = rules; - } - } - else { - var allDeclarations = this.declarationsBlock(rules.rules); - if (allDeclarations && !isRooted && !value) { - this.simpleBlock = true; - this.declarations = rules.rules; - } - else { - this.rules = [rules]; - this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); - } - } - if (!this.simpleBlock) { - for (i = 0; i < this.rules.length; i++) { - this.rules[i].allowImports = true; - } - } - this.setParent(selectors, this); - this.setParent(this.rules, this); - } - this._index = index; - this._fileInfo = currentFileInfo; - this.debugInfo = debugInfo; - this.isRooted = isRooted || false; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - }; - AtRule.prototype = Object.assign(new Node(), __assign(__assign({ type: 'AtRule' }, NestableAtRulePrototype), { declarationsBlock: function (rules, mergeable) { - if (mergeable === void 0) { mergeable = false; } - if (!mergeable) { - return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge; }).length === rules.length; - } - else { - return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length; - } - }, keywordList: function (rules) { - if (!Array.isArray(rules)) { - return false; - } - else { - return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length; - } - }, accept: function (visitor) { - var value = this.value, rules = this.rules, declarations = this.declarations; - if (rules) { - this.rules = visitor.visitArray(rules); - } - else if (declarations) { - this.declarations = visitor.visitArray(declarations); - } - if (value) { - this.value = visitor.visit(value); - } - }, isRulesetLike: function () { - return this.rules || !this.isCharset(); - }, isCharset: function () { - return '@charset' === this.name; - }, genCSS: function (context, output) { - var value = this.value, rules = this.rules || this.declarations; - output.add(this.name, this.fileInfo(), this.getIndex()); - if (value) { - output.add(' '); - value.genCSS(context, output); - } - if (this.simpleBlock) { - this.outputRuleset(context, output, this.declarations); - } - else if (rules) { - this.outputRuleset(context, output, rules); - } - else { - output.add(';'); - } - }, eval: function (context) { - var mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations; - // media stored inside other atrule should not bubble over it - // backpup media bubbling information - mediaPathBackup = context.mediaPath; - mediaBlocksBackup = context.mediaBlocks; - // deleted media bubbling information - context.mediaPath = []; - context.mediaBlocks = []; - if (value) { - value = value.eval(context); - if (value.value && this.keywordList(value.value)) { - value = new Anonymous(value.value.map(function (keyword) { return keyword.value; }).join(', '), this.getIndex(), this.fileInfo()); - } - } - if (rules) { - rules = this.evalRoot(context, rules); - } - if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) { - var allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true); - if (allMergeableDeclarations && !this.isRooted && !value) { - var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; - mergeRules(rules[0].rules); - rules = rules[0].rules; - rules.forEach(function (rule) { return rule.merge = false; }); - } - } - if (this.simpleBlock && rules) { - rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - rules = rules.map(function (rule) { return rule.eval(context); }); - } - // restore media bubbling information - context.mediaPath = mediaPathBackup; - context.mediaBlocks = mediaBlocksBackup; - return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); - }, evalRoot: function (context, rules) { - var ampersandCount = 0; - var noAmpersandCount = 0; - var noAmpersands = true; - var allAmpersands = false; - if (!this.simpleBlock) { - rules = [rules[0].eval(context)]; - } - var precedingSelectors = []; - if (context.frames.length > 0) { - var _loop_1 = function (index) { - var frame = context.frames[index]; - if (frame.type === 'Ruleset' && - frame.rules && - frame.rules.length > 0) { - if (frame && !frame.root && frame.selectors && frame.selectors.length > 0) { - precedingSelectors = precedingSelectors.concat(frame.selectors); - } - } - if (precedingSelectors.length > 0) { - var value_1 = ''; - var output = { add: function (s) { value_1 += s; } }; - for (var i_1 = 0; i_1 < precedingSelectors.length; i_1++) { - precedingSelectors[i_1].genCSS(context, output); - } - if (/^&+$/.test(value_1.replace(/\s+/g, ''))) { - noAmpersands = false; - noAmpersandCount++; - } - else { - allAmpersands = false; - ampersandCount++; - } - } - }; - for (var index = 0; index < context.frames.length; index++) { - _loop_1(index); - } - } - var mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !allAmpersands && !noAmpersands; - if ((this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && !allAmpersands && noAmpersands) - || !mixedAmpersands) { - rules[0].root = true; - } - return rules; - }, variable: function (name) { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.variable.call(this.rules[0], name); - } - }, find: function () { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.find.apply(this.rules[0], arguments); - } - }, rulesets: function () { - if (this.rules) { - // assuming that there is only one rule at this point - that is how parser constructs the rule - return Ruleset.prototype.rulesets.apply(this.rules[0]); - } - }, outputRuleset: function (context, output, rules) { - var ruleCnt = rules.length; - var i; - context.tabLevel = (context.tabLevel | 0) + 1; - // Compressed - if (context.compress) { - output.add('{'); - for (i = 0; i < ruleCnt; i++) { - rules[i].genCSS(context, output); - } - output.add('}'); - context.tabLevel--; - return; - } - // Non-compressed - var tabSetStr = "\n".concat(Array(context.tabLevel).join(' ')), tabRuleStr = "".concat(tabSetStr, " "); - if (!ruleCnt) { - output.add(" {".concat(tabSetStr, "}")); - } - else { - output.add(" {".concat(tabRuleStr)); - rules[0].genCSS(context, output); - for (i = 1; i < ruleCnt; i++) { - output.add(tabRuleStr); - rules[i].genCSS(context, output); - } - output.add("".concat(tabSetStr, "}")); - } - context.tabLevel--; - } })); - - var DetachedRuleset = function (ruleset, frames) { - this.ruleset = ruleset; - this.frames = frames; - this.setParent(this.ruleset, this); - }; - DetachedRuleset.prototype = Object.assign(new Node(), { - type: 'DetachedRuleset', - evalFirst: true, - accept: function (visitor) { - this.ruleset = visitor.visit(this.ruleset); - }, - eval: function (context) { - var frames = this.frames || copyArray(context.frames); - return new DetachedRuleset(this.ruleset, frames); - }, - callEval: function (context) { - return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); - } - }); - - var MATH = Math$1; - var Operation = function (op, operands, isSpaced) { - this.op = op.trim(); - this.operands = operands; - this.isSpaced = isSpaced; - }; - Operation.prototype = Object.assign(new Node(), { - type: 'Operation', - accept: function (visitor) { - this.operands = visitor.visitArray(this.operands); - }, - eval: function (context) { - var a = this.operands[0].eval(context), b = this.operands[1].eval(context), op; - if (context.isMathOn(this.op)) { - op = this.op === './' ? '/' : this.op; - if (a instanceof Dimension && b instanceof Color) { - a = a.toColor(); - } - if (b instanceof Dimension && a instanceof Color) { - b = b.toColor(); - } - if (!a.operate || !b.operate) { - if ((a instanceof Operation || b instanceof Operation) - && a.op === '/' && context.math === MATH.PARENS_DIVISION) { - return new Operation(this.op, [a, b], this.isSpaced); - } - throw { type: 'Operation', - message: 'Operation on an invalid type' }; - } - return a.operate(context, op, b); - } - else { - return new Operation(this.op, [a, b], this.isSpaced); - } - }, - genCSS: function (context, output) { - this.operands[0].genCSS(context, output); - if (this.isSpaced) { - output.add(' '); - } - output.add(this.op); - if (this.isSpaced) { - output.add(' '); - } - this.operands[1].genCSS(context, output); - } - }); - - var functionCaller = /** @class */ (function () { - function functionCaller(name, context, index, currentFileInfo) { - this.name = name.toLowerCase(); - this.index = index; - this.context = context; - this.currentFileInfo = currentFileInfo; - this.func = context.frames[0].functionRegistry.get(this.name); - } - functionCaller.prototype.isValid = function () { - return Boolean(this.func); - }; - functionCaller.prototype.call = function (args) { - var _this = this; - if (!(Array.isArray(args))) { - args = [args]; - } - var evalArgs = this.func.evalArgs; - if (evalArgs !== false) { - args = args.map(function (a) { return a.eval(_this.context); }); - } - var commentFilter = function (item) { return !(item.type === 'Comment'); }; - // This code is terrible and should be replaced as per this issue... - // https://github.com/less/less.js/issues/2477 - args = args - .filter(commentFilter) - .map(function (item) { - if (item.type === 'Expression') { - var subNodes = item.value.filter(commentFilter); - if (subNodes.length === 1) { - // https://github.com/less/less.js/issues/3616 - if (item.parens && subNodes[0].op === '/') { - return item; - } - return subNodes[0]; - } - else { - return new Expression(subNodes); - } - } - return item; - }); - if (evalArgs === false) { - return this.func.apply(this, __spreadArray([this.context], args, false)); - } - return this.func.apply(this, args); - }; - return functionCaller; - }()); - - // - // A function call node. - // - var Call = function (name, args, index, currentFileInfo) { - this.name = name; - this.args = args; - this.calc = name === 'calc'; - this._index = index; - this._fileInfo = currentFileInfo; - }; - Call.prototype = Object.assign(new Node(), { - type: 'Call', - accept: function (visitor) { - if (this.args) { - this.args = visitor.visitArray(this.args); - } - }, - // - // When evaluating a function call, - // we either find the function in the functionRegistry, - // in which case we call it, passing the evaluated arguments, - // if this returns null or we cannot find the function, we - // simply print it out as it appeared originally [2]. - // - // The reason why we evaluate the arguments, is in the case where - // we try to pass a variable to a function, like: `saturate(@color)`. - // The function should receive the value, not the variable. - // - eval: function (context) { - var _this = this; - /** - * Turn off math for calc(), and switch back on for evaluating nested functions - */ - var currentMathContext = context.mathOn; - context.mathOn = !this.calc; - if (this.calc || context.inCalc) { - context.enterCalc(); - } - var exitCalc = function () { - if (_this.calc || context.inCalc) { - context.exitCalc(); - } - context.mathOn = currentMathContext; - }; - var result; - var funcCaller = new functionCaller(this.name, context, this.getIndex(), this.fileInfo()); - if (funcCaller.isValid()) { - try { - result = funcCaller.call(this.args); - exitCalc(); - } - catch (e) { - // eslint-disable-next-line no-prototype-builtins - if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) { - throw e; - } - throw { - type: e.type || 'Runtime', - message: "Error evaluating function `".concat(this.name, "`").concat(e.message ? ": ".concat(e.message) : ''), - index: this.getIndex(), - filename: this.fileInfo().filename, - line: e.lineNumber, - column: e.columnNumber - }; - } - } - if (result !== null && result !== undefined) { - // Results that that are not nodes are cast as Anonymous nodes - // Falsy values or booleans are returned as empty nodes - if (!(result instanceof Node)) { - if (!result || result === true) { - result = new Anonymous(null); - } - else { - result = new Anonymous(result.toString()); - } - } - result._index = this._index; - result._fileInfo = this._fileInfo; - return result; - } - var args = this.args.map(function (a) { return a.eval(context); }); - exitCalc(); - return new Call(this.name, args, this.getIndex(), this.fileInfo()); - }, - genCSS: function (context, output) { - output.add("".concat(this.name, "("), this.fileInfo(), this.getIndex()); - for (var i_1 = 0; i_1 < this.args.length; i_1++) { - this.args[i_1].genCSS(context, output); - if (i_1 + 1 < this.args.length) { - output.add(', '); - } - } - output.add(')'); - } - }); - - var Variable = function (name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; - }; - Variable.prototype = Object.assign(new Node(), { - type: 'Variable', - eval: function (context) { - var variable, name = this.name; - if (name.indexOf('@@') === 0) { - name = "@".concat(new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value); - } - if (this.evaluating) { - throw { type: 'Name', - message: "Recursive variable definition for ".concat(name), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - this.evaluating = true; - variable = this.find(context.frames, function (frame) { - var v = frame.variable(name); - if (v) { - if (v.important) { - var importantScope = context.importantScope[context.importantScope.length - 1]; - importantScope.important = v.important; - } - // If in calc, wrap vars in a function call to cascade evaluate args first - if (context.inCalc) { - return (new Call('_SELF', [v.value])).eval(context); - } - else { - return v.value.eval(context); - } - } - }); - if (variable) { - this.evaluating = false; - return variable; - } - else { - throw { type: 'Name', - message: "variable ".concat(name, " is undefined"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - }, - find: function (obj, fun) { - for (var i_1 = 0, r = void 0; i_1 < obj.length; i_1++) { - r = fun.call(obj, obj[i_1]); - if (r) { - return r; - } - } - return null; - } - }); - - var Property = function (name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; - }; - Property.prototype = Object.assign(new Node(), { - type: 'Property', - eval: function (context) { - var property; - var name = this.name; - // TODO: shorten this reference - var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; - if (this.evaluating) { - throw { type: 'Name', - message: "Recursive property reference for ".concat(name), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - this.evaluating = true; - property = this.find(context.frames, function (frame) { - var v; - var vArr = frame.property(name); - if (vArr) { - for (var i_1 = 0; i_1 < vArr.length; i_1++) { - v = vArr[i_1]; - vArr[i_1] = new Declaration(v.name, v.value, v.important, v.merge, v.index, v.currentFileInfo, v.inline, v.variable); - } - mergeRules(vArr); - v = vArr[vArr.length - 1]; - if (v.important) { - var importantScope = context.importantScope[context.importantScope.length - 1]; - importantScope.important = v.important; - } - v = v.value.eval(context); - return v; - } - }); - if (property) { - this.evaluating = false; - return property; - } - else { - throw { type: 'Name', - message: "Property '".concat(name, "' is undefined"), - filename: this.currentFileInfo.filename, - index: this.index }; - } - }, - find: function (obj, fun) { - for (var i_2 = 0, r = void 0; i_2 < obj.length; i_2++) { - r = fun.call(obj, obj[i_2]); - if (r) { - return r; - } - } - return null; - } - }); - - var Attribute = function (key, op, value, cif) { - this.key = key; - this.op = op; - this.value = value; - this.cif = cif; - }; - Attribute.prototype = Object.assign(new Node(), { - type: 'Attribute', - eval: function (context) { - return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value, this.cif); - }, - genCSS: function (context, output) { - output.add(this.toCSS(context)); - }, - toCSS: function (context) { - var value = this.key.toCSS ? this.key.toCSS(context) : this.key; - if (this.op) { - value += this.op; - value += (this.value.toCSS ? this.value.toCSS(context) : this.value); - } - if (this.cif) { - value = value + ' ' + this.cif; - } - return "[".concat(value, "]"); - } - }); - - var Quoted = function (str, content, escaped, index, currentFileInfo) { - this.escaped = (escaped === undefined) ? true : escaped; - this.value = content || ''; - this.quote = str.charAt(0); - this._index = index; - this._fileInfo = currentFileInfo; - this.variableRegex = /@\{([\w-]+)\}/g; - this.propRegex = /\$\{([\w-]+)\}/g; - this.allowRoot = escaped; - }; - Quoted.prototype = Object.assign(new Node(), { - type: 'Quoted', - genCSS: function (context, output) { - if (!this.escaped) { - output.add(this.quote, this.fileInfo(), this.getIndex()); - } - output.add(this.value); - if (!this.escaped) { - output.add(this.quote); - } - }, - containsVariables: function () { - return this.value.match(this.variableRegex); - }, - eval: function (context) { - var that = this; - var value = this.value; - var variableReplacement = function (_, name1, name2) { - var v = new Variable("@".concat(name1 !== null && name1 !== void 0 ? name1 : name2), that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); - }; - var propertyReplacement = function (_, name1, name2) { - var v = new Property("$".concat(name1 !== null && name1 !== void 0 ? name1 : name2), that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); - }; - function iterativeReplace(value, regexp, replacementFnc) { - var evaluatedValue = value; - do { - value = evaluatedValue.toString(); - evaluatedValue = value.replace(regexp, replacementFnc); - } while (value !== evaluatedValue); - return evaluatedValue; - } - value = iterativeReplace(value, this.variableRegex, variableReplacement); - value = iterativeReplace(value, this.propRegex, propertyReplacement); - return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); - }, - compare: function (other) { - // when comparing quoted strings allow the quote to differ - if (other.type === 'Quoted' && !this.escaped && !other.escaped) { - return Node.numericCompare(this.value, other.value); - } - else { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; - } - } - }); - - function escapePath(path) { - return path.replace(/[()'"\s]/g, function (match) { return "\\".concat(match); }); - } - var URL = function (val, index, currentFileInfo, isEvald) { - this.value = val; - this._index = index; - this._fileInfo = currentFileInfo; - this.isEvald = isEvald; - }; - URL.prototype = Object.assign(new Node(), { - type: 'Url', - accept: function (visitor) { - this.value = visitor.visit(this.value); - }, - genCSS: function (context, output) { - output.add('url('); - this.value.genCSS(context, output); - output.add(')'); - }, - eval: function (context) { - var val = this.value.eval(context); - var rootpath; - if (!this.isEvald) { - // Add the rootpath if the URL requires a rewrite - rootpath = this.fileInfo() && this.fileInfo().rootpath; - if (typeof rootpath === 'string' && - typeof val.value === 'string' && - context.pathRequiresRewrite(val.value)) { - if (!val.quote) { - rootpath = escapePath(rootpath); - } - val.value = context.rewritePath(val.value, rootpath); - } - else { - val.value = context.normalizePath(val.value); - } - // Add url args if enabled - if (context.urlArgs) { - if (!val.value.match(/^\s*data:/)) { - var delimiter = val.value.indexOf('?') === -1 ? '?' : '&'; - var urlArgs = delimiter + context.urlArgs; - if (val.value.indexOf('#') !== -1) { - val.value = val.value.replace('#', "".concat(urlArgs, "#")); - } - else { - val.value += urlArgs; - } - } - } - } - return new URL(val, this.getIndex(), this.fileInfo(), true); - } - }); - - var Media = function (value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); - }; - Media.prototype = Object.assign(new AtRule(), __assign(__assign({ type: 'Media' }, NestableAtRulePrototype), { genCSS: function (context, output) { - output.add('@media ', this._fileInfo, this._index); - this.features.genCSS(context, output); - this.outputRuleset(context, output, this.rules); - }, eval: function (context) { - if (!context.mediaBlocks) { - context.mediaBlocks = []; - context.mediaPath = []; - } - var media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo()); - if (this.debugInfo) { - this.rules[0].debugInfo = this.debugInfo; - media.debugInfo = this.debugInfo; - } - media.features = this.features.eval(context); - context.mediaPath.push(media); - context.mediaBlocks.push(media); - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; - context.frames.shift(); - context.mediaPath.pop(); - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); - } })); - - // - // CSS @import node - // - // The general strategy here is that we don't want to wait - // for the parsing to be completed, before we start importing - // the file. That's because in the context of a browser, - // most of the time will be spent waiting for the server to respond. - // - // On creation, we push the import path to our import queue, though - // `import,push`, we also pass it a callback, which it'll call once - // the file has been fetched, and parsed. - // - var Import = function (path, features, options, index, currentFileInfo, visibilityInfo) { - this.options = options; - this._index = index; - this._fileInfo = currentFileInfo; - this.path = path; - this.features = features; - this.allowRoot = true; - if (this.options.less !== undefined || this.options.inline) { - this.css = !this.options.less || this.options.inline; - } - else { - var pathValue = this.getPath(); - if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) { - this.css = true; - } - } - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.features, this); - this.setParent(this.path, this); - }; - Import.prototype = Object.assign(new Node(), { - type: 'Import', - accept: function (visitor) { - if (this.features) { - this.features = visitor.visit(this.features); - } - this.path = visitor.visit(this.path); - if (!this.options.isPlugin && !this.options.inline && this.root) { - this.root = visitor.visit(this.root); - } - }, - genCSS: function (context, output) { - if (this.css && this.path._fileInfo.reference === undefined) { - output.add('@import ', this._fileInfo, this._index); - this.path.genCSS(context, output); - if (this.features) { - output.add(' '); - this.features.genCSS(context, output); - } - output.add(';'); - } - }, - getPath: function () { - return (this.path instanceof URL) ? - this.path.value.value : this.path.value; - }, - isVariableImport: function () { - var path = this.path; - if (path instanceof URL) { - path = path.value; - } - if (path instanceof Quoted) { - return path.containsVariables(); - } - return true; - }, - evalForImport: function (context) { - var path = this.path; - if (path instanceof URL) { - path = path.value; - } - return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); - }, - evalPath: function (context) { - var path = this.path.eval(context); - var fileInfo = this._fileInfo; - if (!(path instanceof URL)) { - // Add the rootpath if the URL requires a rewrite - var pathValue = path.value; - if (fileInfo && - pathValue && - context.pathRequiresRewrite(pathValue)) { - path.value = context.rewritePath(pathValue, fileInfo.rootpath); - } - else { - path.value = context.normalizePath(path.value); - } - } - return path; - }, - eval: function (context) { - var result = this.doEval(context); - if (this.options.reference || this.blocksVisibility()) { - if (result.length || result.length === 0) { - result.forEach(function (node) { - node.addVisibilityBlock(); - }); - } - else { - result.addVisibilityBlock(); - } - } - return result; - }, - doEval: function (context) { - var ruleset; - var registry; - var features = this.features && this.features.eval(context); - if (this.options.isPlugin) { - if (this.root && this.root.eval) { - try { - this.root.eval(context); - } - catch (e) { - e.message = 'Plugin error during evaluation'; - throw new LessError(e, this.root.imports, this.root.filename); - } - } - registry = context.frames[0] && context.frames[0].functionRegistry; - if (registry && this.root && this.root.functions) { - registry.addMultiple(this.root.functions); - } - return []; - } - if (this.skip) { - if (typeof this.skip === 'function') { - this.skip = this.skip(); - } - if (this.skip) { - return []; - } - } - if (this.features) { - var featureValue = this.features.value; - if (Array.isArray(featureValue) && featureValue.length >= 1) { - var expr = featureValue[0]; - if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) { - featureValue = expr.value; - var isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' - && featureValue[1].type === 'Paren'; - if (isLayer) { - this.css = false; - } - } - } - } - if (this.options.inline) { - var contents = new Anonymous(this.root, 0, { - filename: this.importedFilename, - reference: this.path._fileInfo && this.path._fileInfo.reference - }, true, true); - return this.features ? new Media([contents], this.features.value) : [contents]; - } - else if (this.css || this.layerCss) { - var newImport = new Import(this.evalPath(context), features, this.options, this._index); - if (this.layerCss) { - newImport.css = this.layerCss; - newImport.path._fileInfo = this._fileInfo; - } - if (!newImport.css && this.error) { - throw this.error; - } - return newImport; - } - else if (this.root) { - if (this.features) { - var featureValue = this.features.value; - if (Array.isArray(featureValue) && featureValue.length === 1) { - var expr = featureValue[0]; - if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) { - featureValue = expr.value; - var isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' - && featureValue[1].type === 'Paren'; - if (isLayer) { - this.layerCss = true; - featureValue[0] = new Expression(featureValue.slice(0, 2)); - featureValue.splice(1, 1); - featureValue[0].noSpacing = true; - return this; - } - } - } - } - ruleset = new Ruleset(null, copyArray(this.root.rules)); - ruleset.evalImports(context); - return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules; - } - else { - if (this.features) { - var featureValue = this.features.value; - if (Array.isArray(featureValue) && featureValue.length >= 1) { - featureValue = featureValue[0].value; - if (Array.isArray(featureValue) && featureValue.length >= 2) { - var isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' - && featureValue[1].type === 'Paren'; - if (isLayer) { - this.css = true; - featureValue[0] = new Expression(featureValue.slice(0, 2)); - featureValue.splice(1, 1); - featureValue[0].noSpacing = true; - return this; - } - } - } - } - return []; - } - } - }); - - var JsEvalNode = function () { }; - JsEvalNode.prototype = Object.assign(new Node(), { - evaluateJavaScript: function (expression, context) { - var result; - var that = this; - var evalContext = {}; - if (!context.javascriptEnabled) { - throw { message: 'Inline JavaScript is not enabled. Is it set in your options?', - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) { - return that.jsify(new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context)); - }); - try { - expression = new Function("return (".concat(expression, ")")); - } - catch (e) { - throw { message: "JavaScript evaluation error: ".concat(e.message, " from `").concat(expression, "`"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - var variables = context.frames[0].variables(); - for (var k in variables) { - // eslint-disable-next-line no-prototype-builtins - if (variables.hasOwnProperty(k)) { - evalContext[k.slice(1)] = { - value: variables[k].value, - toJS: function () { - return this.value.eval(context).toCSS(); - } - }; - } - } - try { - result = expression.call(evalContext); - } - catch (e) { - throw { message: "JavaScript evaluation error: '".concat(e.name, ": ").concat(e.message.replace(/["]/g, '\''), "'"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - return result; - }, - jsify: function (obj) { - if (Array.isArray(obj.value) && (obj.value.length > 1)) { - return "[".concat(obj.value.map(function (v) { return v.toCSS(); }).join(', '), "]"); - } - else { - return obj.toCSS(); - } - } - }); - - var JavaScript = function (string, escaped, index, currentFileInfo) { - this.escaped = escaped; - this.expression = string; - this._index = index; - this._fileInfo = currentFileInfo; - }; - JavaScript.prototype = Object.assign(new JsEvalNode(), { - type: 'JavaScript', - eval: function (context) { - var result = this.evaluateJavaScript(this.expression, context); - var type = typeof result; - if (type === 'number' && !isNaN(result)) { - return new Dimension(result); - } - else if (type === 'string') { - return new Quoted("\"".concat(result, "\""), result, this.escaped, this._index); - } - else if (Array.isArray(result)) { - return new Anonymous(result.join(', ')); - } - else { - return new Anonymous(result); - } - } - }); - - var Assignment = function (key, val) { - this.key = key; - this.value = val; - }; - Assignment.prototype = Object.assign(new Node(), { - type: 'Assignment', - accept: function (visitor) { - this.value = visitor.visit(this.value); - }, - eval: function (context) { - if (this.value.eval) { - return new Assignment(this.key, this.value.eval(context)); - } - return this; - }, - genCSS: function (context, output) { - output.add("".concat(this.key, "=")); - if (this.value.genCSS) { - this.value.genCSS(context, output); - } - else { - output.add(this.value); - } - } - }); - - var Condition = function (op, l, r, i, negate) { - this.op = op.trim(); - this.lvalue = l; - this.rvalue = r; - this._index = i; - this.negate = negate; - }; - Condition.prototype = Object.assign(new Node(), { - type: 'Condition', - accept: function (visitor) { - this.lvalue = visitor.visit(this.lvalue); - this.rvalue = visitor.visit(this.rvalue); - }, - eval: function (context) { - var result = (function (op, a, b) { - switch (op) { - case 'and': return a && b; - case 'or': return a || b; - default: - switch (Node.compare(a, b)) { - case -1: - return op === '<' || op === '=<' || op === '<='; - case 0: - return op === '=' || op === '>=' || op === '=<' || op === '<='; - case 1: - return op === '>' || op === '>='; - default: - return false; - } - } - })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); - return this.negate ? !result : result; - } - }); - - var QueryInParens = function (op, l, m, op2, r, i) { - this.op = op.trim(); - this.lvalue = l; - this.mvalue = m; - this.op2 = op2 ? op2.trim() : null; - this.rvalue = r; - this._index = i; - this.mvalues = []; - }; - QueryInParens.prototype = Object.assign(new Node(), { - type: 'QueryInParens', - accept: function (visitor) { - this.lvalue = visitor.visit(this.lvalue); - this.mvalue = visitor.visit(this.mvalue); - if (this.rvalue) { - this.rvalue = visitor.visit(this.rvalue); - } - }, - eval: function (context) { - this.lvalue = this.lvalue.eval(context); - var variableDeclaration; - var rule; - for (var i_1 = 0; (rule = context.frames[i_1]); i_1++) { - if (rule.type === 'Ruleset') { - variableDeclaration = rule.rules.find(function (r) { - if ((r instanceof Declaration) && r.variable) { - return true; - } - return false; - }); - if (variableDeclaration) { - break; - } - } - } - if (!this.mvalueCopy) { - this.mvalueCopy = copy(this.mvalue); - } - if (variableDeclaration) { - this.mvalue = this.mvalueCopy; - this.mvalue = this.mvalue.eval(context); - this.mvalues.push(this.mvalue); - } - else { - this.mvalue = this.mvalue.eval(context); - } - if (this.rvalue) { - this.rvalue = this.rvalue.eval(context); - } - return this; - }, - genCSS: function (context, output) { - this.lvalue.genCSS(context, output); - output.add(' ' + this.op + ' '); - if (this.mvalues.length > 0) { - this.mvalue = this.mvalues.shift(); - } - this.mvalue.genCSS(context, output); - if (this.rvalue) { - output.add(' ' + this.op2 + ' '); - this.rvalue.genCSS(context, output); - } - }, - }); - - var Container = function (value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); - }; - Container.prototype = Object.assign(new AtRule(), __assign(__assign({ type: 'Container' }, NestableAtRulePrototype), { genCSS: function (context, output) { - output.add('@container ', this._fileInfo, this._index); - this.features.genCSS(context, output); - this.outputRuleset(context, output, this.rules); - }, eval: function (context) { - if (!context.mediaBlocks) { - context.mediaBlocks = []; - context.mediaPath = []; - } - var media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo()); - if (this.debugInfo) { - this.rules[0].debugInfo = this.debugInfo; - media.debugInfo = this.debugInfo; - } - media.features = this.features.eval(context); - context.mediaPath.push(media); - context.mediaBlocks.push(media); - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; - context.frames.shift(); - context.mediaPath.pop(); - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); - } })); - - var UnicodeDescriptor = function (value) { - this.value = value; - }; - UnicodeDescriptor.prototype = Object.assign(new Node(), { - type: 'UnicodeDescriptor' - }); - - var Negative = function (node) { - this.value = node; - }; - Negative.prototype = Object.assign(new Node(), { - type: 'Negative', - genCSS: function (context, output) { - output.add('-'); - this.value.genCSS(context, output); - }, - eval: function (context) { - if (context.isMathOn()) { - return (new Operation('*', [new Dimension(-1), this.value])).eval(context); - } - return new Negative(this.value.eval(context)); - } - }); - - var Extend = function (selector, option, index, currentFileInfo, visibilityInfo) { - this.selector = selector; - this.option = option; - this.object_id = Extend.next_id++; - this.parent_ids = [this.object_id]; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - switch (option) { - case '!all': - case 'all': - this.allowBefore = true; - this.allowAfter = true; - break; - default: - this.allowBefore = false; - this.allowAfter = false; - break; - } - this.setParent(this.selector, this); - }; - Extend.prototype = Object.assign(new Node(), { - type: 'Extend', - accept: function (visitor) { - this.selector = visitor.visit(this.selector); - }, - eval: function (context) { - return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - // remove when Nodes have JSDoc types - // eslint-disable-next-line no-unused-vars - clone: function (context) { - return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, - // it concatenates (joins) all selectors in selector array - findSelfSelectors: function (selectors) { - var selfElements = [], i, selectorElements; - for (i = 0; i < selectors.length; i++) { - selectorElements = selectors[i].elements; - // duplicate the logic in genCSS function inside the selector node. - // future TODO - move both logics into the selector joiner visitor - if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') { - selectorElements[0].combinator.value = ' '; - } - selfElements = selfElements.concat(selectors[i].elements); - } - this.selfSelectors = [new Selector(selfElements)]; - this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); - } - }); - Extend.next_id = 0; - - var VariableCall = function (variable, index, currentFileInfo) { - this.variable = variable; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; - }; - VariableCall.prototype = Object.assign(new Node(), { - type: 'VariableCall', - eval: function (context) { - var rules; - var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context); - var error = new LessError({ message: "Could not evaluate variable call ".concat(this.variable) }); - if (!detachedRuleset.ruleset) { - if (detachedRuleset.rules) { - rules = detachedRuleset; - } - else if (Array.isArray(detachedRuleset)) { - rules = new Ruleset('', detachedRuleset); - } - else if (Array.isArray(detachedRuleset.value)) { - rules = new Ruleset('', detachedRuleset.value); - } - else { - throw error; - } - detachedRuleset = new DetachedRuleset(rules); - } - if (detachedRuleset.ruleset) { - return detachedRuleset.callEval(context); - } - throw error; - } - }); - - var NamespaceValue = function (ruleCall, lookups, index, fileInfo) { - this.value = ruleCall; - this.lookups = lookups; - this._index = index; - this._fileInfo = fileInfo; - }; - NamespaceValue.prototype = Object.assign(new Node(), { - type: 'NamespaceValue', - eval: function (context) { - var i, name, rules = this.value.eval(context); - for (i = 0; i < this.lookups.length; i++) { - name = this.lookups[i]; - /** - * Eval'd DRs return rulesets. - * Eval'd mixins return rules, so let's make a ruleset if we need it. - * We need to do this because of late parsing of values - */ - if (Array.isArray(rules)) { - rules = new Ruleset([new Selector()], rules); - } - if (name === '') { - rules = rules.lastDeclaration(); - } - else if (name.charAt(0) === '@') { - if (name.charAt(1) === '@') { - name = "@".concat(new Variable(name.substr(1)).eval(context).value); - } - if (rules.variables) { - rules = rules.variable(name); - } - if (!rules) { - throw { type: 'Name', - message: "variable ".concat(name, " not found"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - } - else { - if (name.substring(0, 2) === '$@') { - name = "$".concat(new Variable(name.substr(1)).eval(context).value); - } - else { - name = name.charAt(0) === '$' ? name : "$".concat(name); - } - if (rules.properties) { - rules = rules.property(name); - } - if (!rules) { - throw { type: 'Name', - message: "property \"".concat(name.substr(1), "\" not found"), - filename: this.fileInfo().filename, - index: this.getIndex() }; - } - // Properties are an array of values, since a ruleset can have multiple props. - // We pick the last one (the "cascaded" value) - rules = rules[rules.length - 1]; - } - if (rules.value) { - rules = rules.eval(context).value; - } - if (rules.ruleset) { - rules = rules.ruleset.eval(context); - } - } - return rules; - } - }); - - var Definition = function (name, params, rules, condition, variadic, frames, visibilityInfo) { - this.name = name || 'anonymous mixin'; - this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])]; - this.params = params; - this.condition = condition; - this.variadic = variadic; - this.arity = params.length; - this.rules = rules; - this._lookups = {}; - var optionalParameters = []; - this.required = params.reduce(function (count, p) { - if (!p.name || (p.name && !p.value)) { - return count + 1; - } - else { - optionalParameters.push(p.name); - return count; - } - }, 0); - this.optionalParameters = optionalParameters; - this.frames = frames; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - }; - Definition.prototype = Object.assign(new Ruleset(), { - type: 'MixinDefinition', - evalFirst: true, - accept: function (visitor) { - if (this.params && this.params.length) { - this.params = visitor.visitArray(this.params); - } - this.rules = visitor.visitArray(this.rules); - if (this.condition) { - this.condition = visitor.visit(this.condition); - } - }, - evalParams: function (context, mixinEnv, args, evaldArguments) { - /* jshint boss:true */ - var frame = new Ruleset(null, null); - var varargs; - var arg; - var params = copyArray(this.params); - var i; - var j; - var val; - var name; - var isNamedFound; - var argIndex; - var argsLength = 0; - if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) { - frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit(); - } - mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames)); - if (args) { - args = copyArray(args); - argsLength = args.length; - for (i = 0; i < argsLength; i++) { - arg = args[i]; - if (name = (arg && arg.name)) { - isNamedFound = false; - for (j = 0; j < params.length; j++) { - if (!evaldArguments[j] && name === params[j].name) { - evaldArguments[j] = arg.value.eval(context); - frame.prependRule(new Declaration(name, arg.value.eval(context))); - isNamedFound = true; - break; - } - } - if (isNamedFound) { - args.splice(i, 1); - i--; - continue; - } - else { - throw { type: 'Runtime', message: "Named argument for ".concat(this.name, " ").concat(args[i].name, " not found") }; - } - } - } - } - argIndex = 0; - for (i = 0; i < params.length; i++) { - if (evaldArguments[i]) { - continue; - } - arg = args && args[argIndex]; - if (name = params[i].name) { - if (params[i].variadic) { - varargs = []; - for (j = argIndex; j < argsLength; j++) { - varargs.push(args[j].value.eval(context)); - } - frame.prependRule(new Declaration(name, new Expression(varargs).eval(context))); - } - else { - val = arg && arg.value; - if (val) { - // This was a mixin call, pass in a detached ruleset of it's eval'd rules - if (Array.isArray(val)) { - val = new DetachedRuleset(new Ruleset('', val)); - } - else { - val = val.eval(context); - } - } - else if (params[i].value) { - val = params[i].value.eval(mixinEnv); - frame.resetCache(); - } - else { - throw { type: 'Runtime', message: "wrong number of arguments for ".concat(this.name, " (").concat(argsLength, " for ").concat(this.arity, ")") }; - } - frame.prependRule(new Declaration(name, val)); - evaldArguments[i] = val; - } - } - if (params[i].variadic && args) { - for (j = argIndex; j < argsLength; j++) { - evaldArguments[j] = args[j].value.eval(context); - } - } - argIndex++; - } - return frame; - }, - makeImportant: function () { - var rules = !this.rules ? this.rules : this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(true); - } - else { - return r; - } - }); - var result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); - return result; - }, - eval: function (context) { - return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || copyArray(context.frames)); - }, - evalCall: function (context, args, important) { - var _arguments = []; - var mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames; - var frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments); - var rules; - var ruleset; - frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context))); - rules = copyArray(this.rules); - ruleset = new Ruleset(null, rules); - ruleset.originalRuleset = this; - ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames))); - if (important) { - ruleset = ruleset.makeImportant(); - } - return ruleset; - }, - matchCondition: function (args, context) { - if (this.condition && !this.condition.eval(new contexts.Eval(context, [this.evalParams(context, /* the parameter variables */ new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] - .concat(this.frames || []) // the parent namespace/mixin frames - .concat(context.frames)))) { // the current environment frames - return false; - } - return true; - }, - matchArgs: function (args, context) { - var allArgsCnt = (args && args.length) || 0; - var len; - var optionalParameters = this.optionalParameters; - var requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) { - if (optionalParameters.indexOf(p.name) < 0) { - return count + 1; - } - else { - return count; - } - }, 0); - if (!this.variadic) { - if (requiredArgsCnt < this.required) { - return false; - } - if (allArgsCnt > this.params.length) { - return false; - } - } - else { - if (requiredArgsCnt < (this.required - 1)) { - return false; - } - } - // check patterns - len = Math.min(requiredArgsCnt, this.arity); - for (var i_1 = 0; i_1 < len; i_1++) { - if (!this.params[i_1].name && !this.params[i_1].variadic) { - if (args[i_1].value.eval(context).toCSS() != this.params[i_1].value.eval(context).toCSS()) { - return false; - } - } - } - return true; - } - }); - - var MixinCall = function (elements, args, index, currentFileInfo, important) { - this.selector = new Selector(elements); - this.arguments = args || []; - this._index = index; - this._fileInfo = currentFileInfo; - this.important = important; - this.allowRoot = true; - this.setParent(this.selector, this); - }; - MixinCall.prototype = Object.assign(new Node(), { - type: 'MixinCall', - accept: function (visitor) { - if (this.selector) { - this.selector = visitor.visit(this.selector); - } - if (this.arguments.length) { - this.arguments = visitor.visitArray(this.arguments); - } - }, - eval: function (context) { - var mixins; - var mixin; - var mixinPath; - var args = []; - var arg; - var argValue; - var rules = []; - var match = false; - var i; - var m; - var f; - var isRecursive; - var isOneFound; - var candidates = []; - var candidate; - var conditionResult = []; - var defaultResult; - var defFalseEitherCase = -1; - var defNone = 0; - var defTrue = 1; - var defFalse = 2; - var count; - var originalRuleset; - var noArgumentsFilter; - this.selector = this.selector.eval(context); - function calcDefGroup(mixin, mixinPath) { - var f, p, namespace; - for (f = 0; f < 2; f++) { - conditionResult[f] = true; - defaultFunc.value(f); - for (p = 0; p < mixinPath.length && conditionResult[f]; p++) { - namespace = mixinPath[p]; - if (namespace.matchCondition) { - conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context); - } - } - if (mixin.matchCondition) { - conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context); - } - } - if (conditionResult[0] || conditionResult[1]) { - if (conditionResult[0] != conditionResult[1]) { - return conditionResult[1] ? - defTrue : defFalse; - } - return defNone; - } - return defFalseEitherCase; - } - for (i = 0; i < this.arguments.length; i++) { - arg = this.arguments[i]; - argValue = arg.value.eval(context); - if (arg.expand && Array.isArray(argValue.value)) { - argValue = argValue.value; - for (m = 0; m < argValue.length; m++) { - args.push({ value: argValue[m] }); - } - } - else { - args.push({ name: arg.name, value: argValue }); - } - } - noArgumentsFilter = function (rule) { return rule.matchArgs(null, context); }; - for (i = 0; i < context.frames.length; i++) { - if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) { - isOneFound = true; - // To make `default()` function independent of definition order we have two "subpasses" here. - // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`), - // and build candidate list with corresponding flags. Then, when we know all possible matches, - // we make a final decision. - for (m = 0; m < mixins.length; m++) { - mixin = mixins[m].rule; - mixinPath = mixins[m].path; - isRecursive = false; - for (f = 0; f < context.frames.length; f++) { - if ((!(mixin instanceof Definition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) { - isRecursive = true; - break; - } - } - if (isRecursive) { - continue; - } - if (mixin.matchArgs(args, context)) { - candidate = { mixin: mixin, group: calcDefGroup(mixin, mixinPath) }; - if (candidate.group !== defFalseEitherCase) { - candidates.push(candidate); - } - match = true; - } - } - defaultFunc.reset(); - count = [0, 0, 0]; - for (m = 0; m < candidates.length; m++) { - count[candidates[m].group]++; - } - if (count[defNone] > 0) { - defaultResult = defFalse; - } - else { - defaultResult = defTrue; - if ((count[defTrue] + count[defFalse]) > 1) { - throw { type: 'Runtime', - message: "Ambiguous use of `default()` found when matching for `".concat(this.format(args), "`"), - index: this.getIndex(), filename: this.fileInfo().filename }; - } - } - for (m = 0; m < candidates.length; m++) { - candidate = candidates[m].group; - if ((candidate === defNone) || (candidate === defaultResult)) { - try { - mixin = candidates[m].mixin; - if (!(mixin instanceof Definition)) { - originalRuleset = mixin.originalRuleset || mixin; - mixin = new Definition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo()); - mixin.originalRuleset = originalRuleset; - } - var newRules = mixin.evalCall(context, args, this.important).rules; - this._setVisibilityToReplacement(newRules); - Array.prototype.push.apply(rules, newRules); - } - catch (e) { - throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack }; - } - } - } - if (match) { - return rules; - } - } - } - if (isOneFound) { - throw { type: 'Runtime', - message: "No matching definition was found for `".concat(this.format(args), "`"), - index: this.getIndex(), filename: this.fileInfo().filename }; - } - else { - throw { type: 'Name', - message: "".concat(this.selector.toCSS().trim(), " is undefined"), - index: this.getIndex(), filename: this.fileInfo().filename }; - } - }, - _setVisibilityToReplacement: function (replacement) { - var i, rule; - if (this.blocksVisibility()) { - for (i = 0; i < replacement.length; i++) { - rule = replacement[i]; - rule.addVisibilityBlock(); - } - } - }, - format: function (args) { - return "".concat(this.selector.toCSS().trim(), "(").concat(args ? args.map(function (a) { - var argValue = ''; - if (a.name) { - argValue += "".concat(a.name, ":"); - } - if (a.value.toCSS) { - argValue += a.value.toCSS(); - } - else { - argValue += '???'; - } - return argValue; - }).join(', ') : '', ")"); - } - }); - - var tree = { - Node: Node, - Color: Color, - AtRule: AtRule, - DetachedRuleset: DetachedRuleset, - Operation: Operation, - Dimension: Dimension, - Unit: Unit, - Keyword: Keyword, - Variable: Variable, - Property: Property, - Ruleset: Ruleset, - Element: Element, - Attribute: Attribute, - Combinator: Combinator, - Selector: Selector, - Quoted: Quoted, - Expression: Expression, - Declaration: Declaration, - Call: Call, - URL: URL, - Import: Import, - Comment: Comment, - Anonymous: Anonymous, - Value: Value, - JavaScript: JavaScript, - Assignment: Assignment, - Condition: Condition, - Paren: Paren, - Media: Media, - Container: Container, - QueryInParens: QueryInParens, - UnicodeDescriptor: UnicodeDescriptor, - Negative: Negative, - Extend: Extend, - VariableCall: VariableCall, - NamespaceValue: NamespaceValue, - mixin: { - Call: MixinCall, - Definition: Definition - } - }; - - var AbstractFileManager = /** @class */ (function () { - function AbstractFileManager() { - } - AbstractFileManager.prototype.getPath = function (filename) { - var j = filename.lastIndexOf('?'); - if (j > 0) { - filename = filename.slice(0, j); - } - j = filename.lastIndexOf('/'); - if (j < 0) { - j = filename.lastIndexOf('\\'); - } - if (j < 0) { - return ''; - } - return filename.slice(0, j + 1); - }; - AbstractFileManager.prototype.tryAppendExtension = function (path, ext) { - return /(\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext; - }; - AbstractFileManager.prototype.tryAppendLessExtension = function (path) { - return this.tryAppendExtension(path, '.less'); - }; - AbstractFileManager.prototype.supportsSync = function () { - return false; - }; - AbstractFileManager.prototype.alwaysMakePathsAbsolute = function () { - return false; - }; - AbstractFileManager.prototype.isPathAbsolute = function (filename) { - return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename); - }; - // TODO: pull out / replace? - AbstractFileManager.prototype.join = function (basePath, laterPath) { - if (!basePath) { - return laterPath; - } - return basePath + laterPath; - }; - AbstractFileManager.prototype.pathDiff = function (url, baseUrl) { - // diff between two paths to create a relative path - var urlParts = this.extractUrlParts(url); - var baseUrlParts = this.extractUrlParts(baseUrl); - var i; - var max; - var urlDirectories; - var baseUrlDirectories; - var diff = ''; - if (urlParts.hostPart !== baseUrlParts.hostPart) { - return ''; - } - max = Math.max(baseUrlParts.directories.length, urlParts.directories.length); - for (i = 0; i < max; i++) { - if (baseUrlParts.directories[i] !== urlParts.directories[i]) { - break; - } - } - baseUrlDirectories = baseUrlParts.directories.slice(i); - urlDirectories = urlParts.directories.slice(i); - for (i = 0; i < baseUrlDirectories.length - 1; i++) { - diff += '../'; - } - for (i = 0; i < urlDirectories.length - 1; i++) { - diff += "".concat(urlDirectories[i], "/"); - } - return diff; - }; - /** - * Helper function, not part of API. - * This should be replaceable by newer Node / Browser APIs - * - * @param {string} url - * @param {string} baseUrl - */ - AbstractFileManager.prototype.extractUrlParts = function (url, baseUrl) { - // urlParts[1] = protocol://hostname/ OR / - // urlParts[2] = / if path relative to host base - // urlParts[3] = directories - // urlParts[4] = filename - // urlParts[5] = parameters - var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^/?#]*\/)|([/\\]))?((?:[^/\\?#]*[/\\])*)([^/\\?#]*)([#?].*)?$/i; - var urlParts = url.match(urlPartsRegex); - var returner = {}; - var rawDirectories = []; - var directories = []; - var i; - var baseUrlParts; - if (!urlParts) { - throw new Error("Could not parse sheet href - '".concat(url, "'")); - } - // Stylesheets in IE don't always return the full path - if (baseUrl && (!urlParts[1] || urlParts[2])) { - baseUrlParts = baseUrl.match(urlPartsRegex); - if (!baseUrlParts) { - throw new Error("Could not parse page url - '".concat(baseUrl, "'")); - } - urlParts[1] = urlParts[1] || baseUrlParts[1] || ''; - if (!urlParts[2]) { - urlParts[3] = baseUrlParts[3] + urlParts[3]; - } - } - if (urlParts[3]) { - rawDirectories = urlParts[3].replace(/\\/g, '/').split('/'); - // collapse '..' and skip '.' - for (i = 0; i < rawDirectories.length; i++) { - if (rawDirectories[i] === '..') { - directories.pop(); - } - else if (rawDirectories[i] !== '.') { - directories.push(rawDirectories[i]); - } - } - } - returner.hostPart = urlParts[1]; - returner.directories = directories; - returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/'); - returner.path = (urlParts[1] || '') + directories.join('/'); - returner.filename = urlParts[4]; - returner.fileUrl = returner.path + (urlParts[4] || ''); - returner.url = returner.fileUrl + (urlParts[5] || ''); - return returner; - }; - return AbstractFileManager; - }()); - - var AbstractPluginLoader = /** @class */ (function () { - function AbstractPluginLoader() { - // Implemented by Node.js plugin loader - this.require = function () { - return null; - }; - } - AbstractPluginLoader.prototype.evalPlugin = function (contents, context, imports, pluginOptions, fileInfo) { - var loader, registry, pluginObj, localModule, pluginManager, filename, result; - pluginManager = context.pluginManager; - if (fileInfo) { - if (typeof fileInfo === 'string') { - filename = fileInfo; - } - else { - filename = fileInfo.filename; - } - } - var shortname = (new this.less.FileManager()).extractUrlParts(filename).filename; - if (filename) { - pluginObj = pluginManager.get(filename); - if (pluginObj) { - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - try { - if (pluginObj.use) { - pluginObj.use.call(this.context, pluginObj); - } - } - catch (e) { - e.message = e.message || 'Error during @plugin call'; - return new LessError(e, imports, filename); - } - return pluginObj; - } - } - localModule = { - exports: {}, - pluginManager: pluginManager, - fileInfo: fileInfo - }; - registry = functionRegistry.create(); - var registerPlugin = function (obj) { - pluginObj = obj; - }; - try { - loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents); - loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo); - } - catch (e) { - return new LessError(e, imports, filename); - } - if (!pluginObj) { - pluginObj = localModule.exports; - } - pluginObj = this.validatePlugin(pluginObj, filename, shortname); - if (pluginObj instanceof LessError) { - return pluginObj; - } - if (pluginObj) { - pluginObj.imports = imports; - pluginObj.filename = filename; - // For < 3.x (or unspecified minVersion) - setOptions() before install() - if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) { - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - } - // Run on first load - pluginManager.addPlugin(pluginObj, fileInfo.filename, registry); - pluginObj.functions = registry.getLocalFunctions(); - // Need to call setOptions again because the pluginObj might have functions - result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); - if (result) { - return result; - } - // Run every @plugin call - try { - if (pluginObj.use) { - pluginObj.use.call(this.context, pluginObj); - } - } - catch (e) { - e.message = e.message || 'Error during @plugin call'; - return new LessError(e, imports, filename); - } - } - else { - return new LessError({ message: 'Not a valid plugin' }, imports, filename); - } - return pluginObj; - }; - AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) { - if (options && !plugin.setOptions) { - return new LessError({ - message: "Options have been provided but the plugin ".concat(name, " does not support any options.") - }); - } - try { - plugin.setOptions && plugin.setOptions(options); - } - catch (e) { - return new LessError(e); - } - }; - AbstractPluginLoader.prototype.validatePlugin = function (plugin, filename, name) { - if (plugin) { - // support plugins being a function - // so that the plugin can be more usable programmatically - if (typeof plugin === 'function') { - plugin = new plugin(); - } - if (plugin.minVersion) { - if (this.compareVersion(plugin.minVersion, this.less.version) < 0) { - return new LessError({ - message: "Plugin ".concat(name, " requires version ").concat(this.versionToString(plugin.minVersion)) - }); - } - } - return plugin; - } - return null; - }; - AbstractPluginLoader.prototype.compareVersion = function (aVersion, bVersion) { - if (typeof aVersion === 'string') { - aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/); - aVersion.shift(); - } - for (var i_1 = 0; i_1 < aVersion.length; i_1++) { - if (aVersion[i_1] !== bVersion[i_1]) { - return parseInt(aVersion[i_1]) > parseInt(bVersion[i_1]) ? -1 : 1; - } - } - return 0; - }; - AbstractPluginLoader.prototype.versionToString = function (version) { - var versionString = ''; - for (var i_2 = 0; i_2 < version.length; i_2++) { - versionString += (versionString ? '.' : '') + version[i_2]; - } - return versionString; - }; - AbstractPluginLoader.prototype.printUsage = function (plugins) { - for (var i_3 = 0; i_3 < plugins.length; i_3++) { - var plugin = plugins[i_3]; - if (plugin.printUsage) { - plugin.printUsage(); - } - } - }; - return AbstractPluginLoader; - }()); - - function boolean(condition) { - return condition ? Keyword.True : Keyword.False; - } - /** - * Functions with evalArgs set to false are sent context - * as the first argument. - */ - function If(context, condition, trueValue, falseValue) { - return condition.eval(context) ? trueValue.eval(context) - : (falseValue ? falseValue.eval(context) : new Anonymous); - } - If.evalArgs = false; - function isdefined(context, variable) { - try { - variable.eval(context); - return Keyword.True; - } - catch (e) { - return Keyword.False; - } - } - isdefined.evalArgs = false; - var boolean$1 = { isdefined: isdefined, boolean: boolean, 'if': If }; - - var colorFunctions; - function clamp(val) { - return Math.min(1, Math.max(0, val)); - } - function hsla(origColor, hsl) { - var color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a); - if (color) { - if (origColor.value && - /^(rgb|hsl)/.test(origColor.value)) { - color.value = origColor.value; - } - else { - color.value = 'rgb'; - } - return color; - } - } - function toHSL(color) { - if (color.toHSL) { - return color.toHSL(); - } - else { - throw new Error('Argument cannot be evaluated to a color'); - } - } - function toHSV(color) { - if (color.toHSV) { - return color.toHSV(); - } - else { - throw new Error('Argument cannot be evaluated to a color'); - } - } - function number$1(n) { - if (n instanceof Dimension) { - return parseFloat(n.unit.is('%') ? n.value / 100 : n.value); - } - else if (typeof n === 'number') { - return n; - } - else { - throw { - type: 'Argument', - message: 'color functions take numbers as parameters' - }; - } - } - function scaled(n, size) { - if (n instanceof Dimension && n.unit.is('%')) { - return parseFloat(n.value * size / 100); - } - else { - return number$1(n); - } - } - colorFunctions = { - rgb: function (r, g, b) { - var a = 1; - /** - * Comma-less syntax - * e.g. rgb(0 128 255 / 50%) - */ - if (r instanceof Expression) { - var val = r.value; - r = val[0]; - g = val[1]; - b = val[2]; - /** - * @todo - should this be normalized in - * function caller? Or parsed differently? - */ - if (b instanceof Operation) { - var op = b; - b = op.operands[0]; - a = op.operands[1]; - } - } - var color = colorFunctions.rgba(r, g, b, a); - if (color) { - color.value = 'rgb'; - return color; - } - }, - rgba: function (r, g, b, a) { - try { - if (r instanceof Color) { - if (g) { - a = number$1(g); - } - else { - a = r.alpha; - } - return new Color(r.rgb, a, 'rgba'); - } - var rgb = [r, g, b].map(function (c) { return scaled(c, 255); }); - a = number$1(a); - return new Color(rgb, a, 'rgba'); - } - catch (e) { } - }, - hsl: function (h, s, l) { - var a = 1; - if (h instanceof Expression) { - var val = h.value; - h = val[0]; - s = val[1]; - l = val[2]; - if (l instanceof Operation) { - var op = l; - l = op.operands[0]; - a = op.operands[1]; - } - } - var color = colorFunctions.hsla(h, s, l, a); - if (color) { - color.value = 'hsl'; - return color; - } - }, - hsla: function (h, s, l, a) { - var m1; - var m2; - function hue(h) { - h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); - if (h * 6 < 1) { - return m1 + (m2 - m1) * h * 6; - } - else if (h * 2 < 1) { - return m2; - } - else if (h * 3 < 2) { - return m1 + (m2 - m1) * (2 / 3 - h) * 6; - } - else { - return m1; - } - } - try { - if (h instanceof Color) { - if (s) { - a = number$1(s); - } - else { - a = h.alpha; - } - return new Color(h.rgb, a, 'hsla'); - } - h = (number$1(h) % 360) / 360; - s = clamp(number$1(s)); - l = clamp(number$1(l)); - a = clamp(number$1(a)); - m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; - m1 = l * 2 - m2; - var rgb = [ - hue(h + 1 / 3) * 255, - hue(h) * 255, - hue(h - 1 / 3) * 255 - ]; - a = number$1(a); - return new Color(rgb, a, 'hsla'); - } - catch (e) { } - }, - hsv: function (h, s, v) { - return colorFunctions.hsva(h, s, v, 1.0); - }, - hsva: function (h, s, v, a) { - h = ((number$1(h) % 360) / 360) * 360; - s = number$1(s); - v = number$1(v); - a = number$1(a); - var i; - var f; - i = Math.floor((h / 60) % 6); - f = (h / 60) - i; - var vs = [v, - v * (1 - s), - v * (1 - f * s), - v * (1 - (1 - f) * s)]; - var perm = [[0, 3, 1], - [2, 0, 1], - [1, 0, 3], - [1, 2, 0], - [3, 1, 0], - [0, 1, 2]]; - return colorFunctions.rgba(vs[perm[i][0]] * 255, vs[perm[i][1]] * 255, vs[perm[i][2]] * 255, a); - }, - hue: function (color) { - return new Dimension(toHSL(color).h); - }, - saturation: function (color) { - return new Dimension(toHSL(color).s * 100, '%'); - }, - lightness: function (color) { - return new Dimension(toHSL(color).l * 100, '%'); - }, - hsvhue: function (color) { - return new Dimension(toHSV(color).h); - }, - hsvsaturation: function (color) { - return new Dimension(toHSV(color).s * 100, '%'); - }, - hsvvalue: function (color) { - return new Dimension(toHSV(color).v * 100, '%'); - }, - red: function (color) { - return new Dimension(color.rgb[0]); - }, - green: function (color) { - return new Dimension(color.rgb[1]); - }, - blue: function (color) { - return new Dimension(color.rgb[2]); - }, - alpha: function (color) { - return new Dimension(toHSL(color).a); - }, - luma: function (color) { - return new Dimension(color.luma() * color.alpha * 100, '%'); - }, - luminance: function (color) { - var luminance = (0.2126 * color.rgb[0] / 255) + - (0.7152 * color.rgb[1] / 255) + - (0.0722 * color.rgb[2] / 255); - return new Dimension(luminance * color.alpha * 100, '%'); - }, - saturate: function (color, amount, method) { - // filter: saturate(3.2); - // should be kept as is, so check for color - if (!color.rgb) { - return null; - } - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.s += hsl.s * amount.value / 100; - } - else { - hsl.s += amount.value / 100; - } - hsl.s = clamp(hsl.s); - return hsla(color, hsl); - }, - desaturate: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.s -= hsl.s * amount.value / 100; - } - else { - hsl.s -= amount.value / 100; - } - hsl.s = clamp(hsl.s); - return hsla(color, hsl); - }, - lighten: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.l += hsl.l * amount.value / 100; - } - else { - hsl.l += amount.value / 100; - } - hsl.l = clamp(hsl.l); - return hsla(color, hsl); - }, - darken: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.l -= hsl.l * amount.value / 100; - } - else { - hsl.l -= amount.value / 100; - } - hsl.l = clamp(hsl.l); - return hsla(color, hsl); - }, - fadein: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.a += hsl.a * amount.value / 100; - } - else { - hsl.a += amount.value / 100; - } - hsl.a = clamp(hsl.a); - return hsla(color, hsl); - }, - fadeout: function (color, amount, method) { - var hsl = toHSL(color); - if (typeof method !== 'undefined' && method.value === 'relative') { - hsl.a -= hsl.a * amount.value / 100; - } - else { - hsl.a -= amount.value / 100; - } - hsl.a = clamp(hsl.a); - return hsla(color, hsl); - }, - fade: function (color, amount) { - var hsl = toHSL(color); - hsl.a = amount.value / 100; - hsl.a = clamp(hsl.a); - return hsla(color, hsl); - }, - spin: function (color, amount) { - var hsl = toHSL(color); - var hue = (hsl.h + amount.value) % 360; - hsl.h = hue < 0 ? 360 + hue : hue; - return hsla(color, hsl); - }, - // - // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein - // http://sass-lang.com - // - mix: function (color1, color2, weight) { - if (!weight) { - weight = new Dimension(50); - } - var p = weight.value / 100.0; - var w = p * 2 - 1; - var a = toHSL(color1).a - toHSL(color2).a; - var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; - var w2 = 1 - w1; - var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, - color1.rgb[1] * w1 + color2.rgb[1] * w2, - color1.rgb[2] * w1 + color2.rgb[2] * w2]; - var alpha = color1.alpha * p + color2.alpha * (1 - p); - return new Color(rgb, alpha); - }, - greyscale: function (color) { - return colorFunctions.desaturate(color, new Dimension(100)); - }, - contrast: function (color, dark, light, threshold) { - // filter: contrast(3.2); - // should be kept as is, so check for color - if (!color.rgb) { - return null; - } - if (typeof light === 'undefined') { - light = colorFunctions.rgba(255, 255, 255, 1.0); - } - if (typeof dark === 'undefined') { - dark = colorFunctions.rgba(0, 0, 0, 1.0); - } - // Figure out which is actually light and dark: - if (dark.luma() > light.luma()) { - var t = light; - light = dark; - dark = t; - } - if (typeof threshold === 'undefined') { - threshold = 0.43; - } - else { - threshold = number$1(threshold); - } - if (color.luma() < threshold) { - return light; - } - else { - return dark; - } - }, - // Changes made in 2.7.0 - Reverted in 3.0.0 - // contrast: function (color, color1, color2, threshold) { - // // Return which of `color1` and `color2` has the greatest contrast with `color` - // // according to the standard WCAG contrast ratio calculation. - // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef - // // The threshold param is no longer used, in line with SASS. - // // filter: contrast(3.2); - // // should be kept as is, so check for color - // if (!color.rgb) { - // return null; - // } - // if (typeof color1 === 'undefined') { - // color1 = colorFunctions.rgba(0, 0, 0, 1.0); - // } - // if (typeof color2 === 'undefined') { - // color2 = colorFunctions.rgba(255, 255, 255, 1.0); - // } - // var contrast1, contrast2; - // var luma = color.luma(); - // var luma1 = color1.luma(); - // var luma2 = color2.luma(); - // // Calculate contrast ratios for each color - // if (luma > luma1) { - // contrast1 = (luma + 0.05) / (luma1 + 0.05); - // } else { - // contrast1 = (luma1 + 0.05) / (luma + 0.05); - // } - // if (luma > luma2) { - // contrast2 = (luma + 0.05) / (luma2 + 0.05); - // } else { - // contrast2 = (luma2 + 0.05) / (luma + 0.05); - // } - // if (contrast1 > contrast2) { - // return color1; - // } else { - // return color2; - // } - // }, - argb: function (color) { - return new Anonymous(color.toARGB()); - }, - color: function (c) { - if ((c instanceof Quoted) && - (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) { - var val = c.value.slice(1); - return new Color(val, undefined, "#".concat(val)); - } - if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) { - c.value = undefined; - return c; - } - throw { - type: 'Argument', - message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF' - }; - }, - tint: function (color, amount) { - return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount); - }, - shade: function (color, amount) { - return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount); - } - }; - var color = colorFunctions; - - // Color Blending - // ref: http://www.w3.org/TR/compositing-1 - function colorBlend(mode, color1, color2) { - var ab = color1.alpha; // result - var // backdrop - cb; - var as = color2.alpha; - var // source - cs; - var ar; - var cr; - var r = []; - ar = as + ab * (1 - as); - for (var i_1 = 0; i_1 < 3; i_1++) { - cb = color1.rgb[i_1] / 255; - cs = color2.rgb[i_1] / 255; - cr = mode(cb, cs); - if (ar) { - cr = (as * cs + ab * (cb - - as * (cb + cs - cr))) / ar; - } - r[i_1] = cr * 255; - } - return new Color(r, ar); - } - var colorBlendModeFunctions = { - multiply: function (cb, cs) { - return cb * cs; - }, - screen: function (cb, cs) { - return cb + cs - cb * cs; - }, - overlay: function (cb, cs) { - cb *= 2; - return (cb <= 1) ? - colorBlendModeFunctions.multiply(cb, cs) : - colorBlendModeFunctions.screen(cb - 1, cs); - }, - softlight: function (cb, cs) { - var d = 1; - var e = cb; - if (cs > 0.5) { - e = 1; - d = (cb > 0.25) ? Math.sqrt(cb) - : ((16 * cb - 12) * cb + 4) * cb; - } - return cb - (1 - 2 * cs) * e * (d - cb); - }, - hardlight: function (cb, cs) { - return colorBlendModeFunctions.overlay(cs, cb); - }, - difference: function (cb, cs) { - return Math.abs(cb - cs); - }, - exclusion: function (cb, cs) { - return cb + cs - 2 * cb * cs; - }, - // non-w3c functions: - average: function (cb, cs) { - return (cb + cs) / 2; - }, - negation: function (cb, cs) { - return 1 - Math.abs(cb + cs - 1); - } - }; - for (var f$1 in colorBlendModeFunctions) { - // eslint-disable-next-line no-prototype-builtins - if (colorBlendModeFunctions.hasOwnProperty(f$1)) { - colorBlend[f$1] = colorBlend.bind(null, colorBlendModeFunctions[f$1]); - } - } - - var dataUri = (function (environment) { - var fallback = function (functionThis, node) { return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); }; - return { 'data-uri': function (mimetypeNode, filePathNode) { - if (!filePathNode) { - filePathNode = mimetypeNode; - mimetypeNode = null; - } - var mimetype = mimetypeNode && mimetypeNode.value; - var filePath = filePathNode.value; - var currentFileInfo = this.currentFileInfo; - var currentDirectory = currentFileInfo.rewriteUrls ? - currentFileInfo.currentDirectory : currentFileInfo.entryPath; - var fragmentStart = filePath.indexOf('#'); - var fragment = ''; - if (fragmentStart !== -1) { - fragment = filePath.slice(fragmentStart); - filePath = filePath.slice(0, fragmentStart); - } - var context = clone(this.context); - context.rawBuffer = true; - var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true); - if (!fileManager) { - return fallback(this, filePathNode); - } - var useBase64 = false; - // detect the mimetype if not given - if (!mimetypeNode) { - mimetype = environment.mimeLookup(filePath); - if (mimetype === 'image/svg+xml') { - useBase64 = false; - } - else { - // use base 64 unless it's an ASCII or UTF-8 format - var charset = environment.charsetLookup(mimetype); - useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0; - } - if (useBase64) { - mimetype += ';base64'; - } - } - else { - useBase64 = /;base64$/.test(mimetype); - } - var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment); - if (!fileSync.contents) { - logger$1.warn("Skipped data-uri embedding of ".concat(filePath, " because file not found")); - return fallback(this, filePathNode || mimetypeNode); - } - var buf = fileSync.contents; - if (useBase64 && !environment.encodeBase64) { - return fallback(this, filePathNode); - } - buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); - var uri = "data:".concat(mimetype, ",").concat(buf).concat(fragment); - return new URL(new Quoted("\"".concat(uri, "\""), uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); - } }; - }); - - var getItemsFromNode = function (node) { - // handle non-array values as an array of length 1 - // return 'undefined' if index is invalid - var items = Array.isArray(node.value) ? - node.value : Array(node); - return items; - }; - var list = { - _SELF: function (n) { - return n; - }, - '~': function () { - var expr = []; - for (var _i = 0; _i < arguments.length; _i++) { - expr[_i] = arguments[_i]; - } - if (expr.length === 1) { - return expr[0]; - } - return new Value(expr); - }, - extract: function (values, index) { - // (1-based index) - index = index.value - 1; - return getItemsFromNode(values)[index]; - }, - length: function (values) { - return new Dimension(getItemsFromNode(values).length); - }, - /** - * Creates a Less list of incremental values. - * Modeled after Lodash's range function, also exists natively in PHP - * - * @param {Dimension} [start=1] - * @param {Dimension} end - e.g. 10 or 10px - unit is added to output - * @param {Dimension} [step=1] - */ - range: function (start, end, step) { - var from; - var to; - var stepValue = 1; - var list = []; - if (end) { - to = end; - from = start.value; - if (step) { - stepValue = step.value; - } - } - else { - from = 1; - to = start; - } - for (var i_1 = from; i_1 <= to.value; i_1 += stepValue) { - list.push(new Dimension(i_1, to.unit)); - } - return new Expression(list); - }, - each: function (list, rs) { - var _this = this; - var rules = []; - var newRules; - var iterator; - var tryEval = function (val) { - if (val instanceof Node) { - return val.eval(_this.context); - } - return val; - }; - if (list.value && !(list instanceof Quoted)) { - if (Array.isArray(list.value)) { - iterator = list.value.map(tryEval); - } - else { - iterator = [tryEval(list.value)]; - } - } - else if (list.ruleset) { - iterator = tryEval(list.ruleset).rules; - } - else if (list.rules) { - iterator = list.rules.map(tryEval); - } - else if (Array.isArray(list)) { - iterator = list.map(tryEval); - } - else { - iterator = [tryEval(list)]; - } - var valueName = '@value'; - var keyName = '@key'; - var indexName = '@index'; - if (rs.params) { - valueName = rs.params[0] && rs.params[0].name; - keyName = rs.params[1] && rs.params[1].name; - indexName = rs.params[2] && rs.params[2].name; - rs = rs.rules; - } - else { - rs = rs.ruleset; - } - for (var i_2 = 0; i_2 < iterator.length; i_2++) { - var key = void 0; - var value = void 0; - var item = iterator[i_2]; - if (item instanceof Declaration) { - key = typeof item.name === 'string' ? item.name : item.name[0].value; - value = item.value; - } - else { - key = new Dimension(i_2 + 1); - value = item; - } - if (item instanceof Comment) { - continue; - } - newRules = rs.rules.slice(0); - if (valueName) { - newRules.push(new Declaration(valueName, value, false, false, this.index, this.currentFileInfo)); - } - if (indexName) { - newRules.push(new Declaration(indexName, new Dimension(i_2 + 1), false, false, this.index, this.currentFileInfo)); - } - if (keyName) { - newRules.push(new Declaration(keyName, key, false, false, this.index, this.currentFileInfo)); - } - rules.push(new Ruleset([new (Selector)([new Element('', '&')])], newRules, rs.strictImports, rs.visibilityInfo())); - } - return new Ruleset([new (Selector)([new Element('', '&')])], rules, rs.strictImports, rs.visibilityInfo()).eval(this.context); - } - }; - - var MathHelper = function (fn, unit, n) { - if (!(n instanceof Dimension)) { - throw { type: 'Argument', message: 'argument must be a number' }; - } - if (unit === null) { - unit = n.unit; - } - else { - n = n.unify(); - } - return new Dimension(fn(parseFloat(n.value)), unit); - }; - - var mathFunctions = { - // name, unit - ceil: null, - floor: null, - sqrt: null, - abs: null, - tan: '', - sin: '', - cos: '', - atan: 'rad', - asin: 'rad', - acos: 'rad' - }; - for (var f in mathFunctions) { - // eslint-disable-next-line no-prototype-builtins - if (mathFunctions.hasOwnProperty(f)) { - mathFunctions[f] = MathHelper.bind(null, Math[f], mathFunctions[f]); - } - } - mathFunctions.round = function (n, f) { - var fraction = typeof f === 'undefined' ? 0 : f.value; - return MathHelper(function (num) { return num.toFixed(fraction); }, null, n); - }; - - var minMax = function (isMin, args) { - var _this = this; - args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; - } - var i; // key is the unit.toString() for unified Dimension values, - var j; - var current; - var currentUnified; - var referenceUnified; - var unit; - var unitStatic; - var unitClone; - var // elems only contains original argument values. - order = []; - var values = {}; - // value is the index into the order array. - for (i = 0; i < args.length; i++) { - current = args[i]; - if (!(current instanceof Dimension)) { - if (Array.isArray(args[i].value)) { - Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value)); - continue; - } - else { - throw { type: 'Argument', message: 'incompatible types' }; - } - } - currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify(); - unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString(); - unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic; - unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone; - j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit]; - if (j === undefined) { - if (unitStatic !== undefined && unit !== unitStatic) { - throw { type: 'Argument', message: 'incompatible types' }; - } - values[unit] = order.length; - order.push(current); - continue; - } - referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify(); - if (isMin && currentUnified.value < referenceUnified.value || - !isMin && currentUnified.value > referenceUnified.value) { - order[j] = current; - } - } - if (order.length == 1) { - return order[0]; - } - args = order.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', '); - return new Anonymous("".concat(isMin ? 'min' : 'max', "(").concat(args, ")")); - }; - var number = { - min: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return minMax.call(this, true, args); - } - catch (e) { } - }, - max: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return minMax.call(this, false, args); - } - catch (e) { } - }, - convert: function (val, unit) { - return val.convertTo(unit.value); - }, - pi: function () { - return new Dimension(Math.PI); - }, - mod: function (a, b) { - return new Dimension(a.value % b.value, a.unit); - }, - pow: function (x, y) { - if (typeof x === 'number' && typeof y === 'number') { - x = new Dimension(x); - y = new Dimension(y); - } - else if (!(x instanceof Dimension) || !(y instanceof Dimension)) { - throw { type: 'Argument', message: 'arguments must be numbers' }; - } - return new Dimension(Math.pow(x.value, y.value), x.unit); - }, - percentage: function (n) { - var result = MathHelper(function (num) { return num * 100; }, '%', n); - return result; - } - }; - - var string = { - e: function (str) { - return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true); - }, - escape: function (str) { - return new Anonymous(encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B') - .replace(/\(/g, '%28').replace(/\)/g, '%29')); - }, - replace: function (string, pattern, replacement, flags) { - var result = string.value; - replacement = (replacement.type === 'Quoted') ? - replacement.value : replacement.toCSS(); - result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement); - return new Quoted(string.quote || '', result, string.escaped); - }, - '%': function (string /* arg, arg, ... */) { - var args = Array.prototype.slice.call(arguments, 1); - var result = string.value; - var _loop_1 = function (i_1) { - /* jshint loopfunc:true */ - result = result.replace(/%[sda]/i, function (token) { - var value = ((args[i_1].type === 'Quoted') && - token.match(/s/i)) ? args[i_1].value : args[i_1].toCSS(); - return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value; - }); - }; - for (var i_1 = 0; i_1 < args.length; i_1++) { - _loop_1(i_1); - } - result = result.replace(/%%/g, '%'); - return new Quoted(string.quote || '', result, string.escaped); - } - }; - - var svg = (function () { - return { 'svg-gradient': function (direction) { - var stops; - var gradientDirectionSvg; - var gradientType = 'linear'; - var rectangleDimension = 'x="0" y="0" width="1" height="1"'; - var renderEnv = { compress: false }; - var returner; - var directionValue = direction.toCSS(renderEnv); - var i; - var color; - var position; - var positionValue; - var alpha; - function throwArgumentDescriptor() { - throw { type: 'Argument', - message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' + - ' end_color [end_position] or direction, color list' }; - } - if (arguments.length == 2) { - if (arguments[1].value.length < 2) { - throwArgumentDescriptor(); - } - stops = arguments[1].value; - } - else if (arguments.length < 3) { - throwArgumentDescriptor(); - } - else { - stops = Array.prototype.slice.call(arguments, 1); - } - switch (directionValue) { - case 'to bottom': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"'; - break; - case 'to right': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"'; - break; - case 'to bottom right': - gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"'; - break; - case 'to top right': - gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"'; - break; - case 'ellipse': - case 'ellipse at center': - gradientType = 'radial'; - gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"'; - rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; - break; - default: - throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' + - ' \'to bottom right\', \'to top right\' or \'ellipse at center\'' }; - } - returner = "<".concat(gradientType, "Gradient id=\"g\" ").concat(gradientDirectionSvg, ">"); - for (i = 0; i < stops.length; i += 1) { - if (stops[i] instanceof Expression) { - color = stops[i].value[0]; - position = stops[i].value[1]; - } - else { - color = stops[i]; - position = undefined; - } - if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) { - throwArgumentDescriptor(); - } - positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%'; - alpha = color.alpha; - returner += ""); - } - returner += ""); - returner = encodeURIComponent(returner); - returner = "data:image/svg+xml,".concat(returner); - return new URL(new Quoted("'".concat(returner, "'"), returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); - } }; - }); - - var isa = function (n, Type) { return (n instanceof Type) ? Keyword.True : Keyword.False; }; - var isunit = function (n, unit) { - if (unit === undefined) { - throw { type: 'Argument', message: 'missing the required second argument to isunit.' }; - } - unit = typeof unit.value === 'string' ? unit.value : unit; - if (typeof unit !== 'string') { - throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' }; - } - return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False; - }; - var types = { - isruleset: function (n) { - return isa(n, DetachedRuleset); - }, - iscolor: function (n) { - return isa(n, Color); - }, - isnumber: function (n) { - return isa(n, Dimension); - }, - isstring: function (n) { - return isa(n, Quoted); - }, - iskeyword: function (n) { - return isa(n, Keyword); - }, - isurl: function (n) { - return isa(n, URL); - }, - ispixel: function (n) { - return isunit(n, 'px'); - }, - ispercentage: function (n) { - return isunit(n, '%'); - }, - isem: function (n) { - return isunit(n, 'em'); - }, - isunit: isunit, - unit: function (val, unit) { - if (!(val instanceof Dimension)) { - throw { type: 'Argument', - message: "the first argument to unit must be a number".concat(val instanceof Operation ? '. Have you forgotten parenthesis?' : '') }; - } - if (unit) { - if (unit instanceof Keyword) { - unit = unit.value; - } - else { - unit = unit.toCSS(); - } - } - else { - unit = ''; - } - return new Dimension(val.value, unit); - }, - 'get-unit': function (n) { - return new Anonymous(n.unit); - } - }; - - var styleExpression = function (args) { - var _this = this; - args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; - } - var entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)]; - args = entityList.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', '); - return new Variable("style(".concat(args, ")")); - }; - var style$1 = { - style: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return styleExpression.call(this, args); - } - catch (e) { } - }, - }; - - var functions = (function (environment) { - var functions = { functionRegistry: functionRegistry, functionCaller: functionCaller }; - // register functions - functionRegistry.addMultiple(boolean$1); - functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc)); - functionRegistry.addMultiple(color); - functionRegistry.addMultiple(colorBlend); - functionRegistry.addMultiple(dataUri(environment)); - functionRegistry.addMultiple(list); - functionRegistry.addMultiple(mathFunctions); - functionRegistry.addMultiple(number); - functionRegistry.addMultiple(string); - functionRegistry.addMultiple(svg()); - functionRegistry.addMultiple(types); - functionRegistry.addMultiple(style$1); - return functions; - }); - - function transformTree (root, options) { - options = options || {}; - var evaldRoot; - var variables = options.variables; - var evalEnv = new contexts.Eval(options); - // - // Allows setting variables with a hash, so: - // - // `{ color: new tree.Color('#f01') }` will become: - // - // new tree.Declaration('@color', - // new tree.Value([ - // new tree.Expression([ - // new tree.Color('#f01') - // ]) - // ]) - // ) - // - if (typeof variables === 'object' && !Array.isArray(variables)) { - variables = Object.keys(variables).map(function (k) { - var value = variables[k]; - if (!(value instanceof tree.Value)) { - if (!(value instanceof tree.Expression)) { - value = new tree.Expression([value]); - } - value = new tree.Value([value]); - } - return new tree.Declaration("@".concat(k), value, false, null, 0); - }); - evalEnv.frames = [new tree.Ruleset(null, variables)]; - } - var visitors$1 = [ - new visitors.JoinSelectorVisitor(), - new visitors.MarkVisibleSelectorsVisitor(true), - new visitors.ExtendVisitor(), - new visitors.ToCSSVisitor({ compress: Boolean(options.compress) }) - ]; - var preEvalVisitors = []; - var v; - var visitorIterator; - /** - * first() / get() allows visitors to be added while visiting - * - * @todo Add scoping for visitors just like functions for @plugin; right now they're global - */ - if (options.pluginManager) { - visitorIterator = options.pluginManager.visitor(); - for (var i_1 = 0; i_1 < 2; i_1++) { - visitorIterator.first(); - while ((v = visitorIterator.get())) { - if (v.isPreEvalVisitor) { - if (i_1 === 0 || preEvalVisitors.indexOf(v) === -1) { - preEvalVisitors.push(v); - v.run(root); - } - } - else { - if (i_1 === 0 || visitors$1.indexOf(v) === -1) { - if (v.isPreVisitor) { - visitors$1.unshift(v); - } - else { - visitors$1.push(v); - } - } - } - } - } - } - evaldRoot = root.eval(evalEnv); - for (var i_2 = 0; i_2 < visitors$1.length; i_2++) { - visitors$1[i_2].run(evaldRoot); - } - // Run any remaining visitors added after eval pass - if (options.pluginManager) { - visitorIterator.first(); - while ((v = visitorIterator.get())) { - if (visitors$1.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) { - v.run(evaldRoot); - } - } - } - return evaldRoot; - } - - /** - * Plugin Manager - */ - var PluginManager = /** @class */ (function () { - function PluginManager(less) { - this.less = less; - this.visitors = []; - this.preProcessors = []; - this.postProcessors = []; - this.installedPlugins = []; - this.fileManagers = []; - this.iterator = -1; - this.pluginCache = {}; - this.Loader = new less.PluginLoader(less); - } - /** - * Adds all the plugins in the array - * @param {Array} plugins - */ - PluginManager.prototype.addPlugins = function (plugins) { - if (plugins) { - for (var i_1 = 0; i_1 < plugins.length; i_1++) { - this.addPlugin(plugins[i_1]); - } - } - }; - /** - * - * @param plugin - * @param {String} filename - */ - PluginManager.prototype.addPlugin = function (plugin, filename, functionRegistry) { - this.installedPlugins.push(plugin); - if (filename) { - this.pluginCache[filename] = plugin; - } - if (plugin.install) { - plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry); - } - }; - /** - * - * @param filename - */ - PluginManager.prototype.get = function (filename) { - return this.pluginCache[filename]; - }; - /** - * Adds a visitor. The visitor object has options on itself to determine - * when it should run. - * @param visitor - */ - PluginManager.prototype.addVisitor = function (visitor) { - this.visitors.push(visitor); - }; - /** - * Adds a pre processor object - * @param {object} preProcessor - * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import - */ - PluginManager.prototype.addPreProcessor = function (preProcessor, priority) { - var indexToInsertAt; - for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) { - if (this.preProcessors[indexToInsertAt].priority >= priority) { - break; - } - } - this.preProcessors.splice(indexToInsertAt, 0, { preProcessor: preProcessor, priority: priority }); - }; - /** - * Adds a post processor object - * @param {object} postProcessor - * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression - */ - PluginManager.prototype.addPostProcessor = function (postProcessor, priority) { - var indexToInsertAt; - for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) { - if (this.postProcessors[indexToInsertAt].priority >= priority) { - break; - } - } - this.postProcessors.splice(indexToInsertAt, 0, { postProcessor: postProcessor, priority: priority }); - }; - /** - * - * @param manager - */ - PluginManager.prototype.addFileManager = function (manager) { - this.fileManagers.push(manager); - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getPreProcessors = function () { - var preProcessors = []; - for (var i_2 = 0; i_2 < this.preProcessors.length; i_2++) { - preProcessors.push(this.preProcessors[i_2].preProcessor); - } - return preProcessors; - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getPostProcessors = function () { - var postProcessors = []; - for (var i_3 = 0; i_3 < this.postProcessors.length; i_3++) { - postProcessors.push(this.postProcessors[i_3].postProcessor); - } - return postProcessors; - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getVisitors = function () { - return this.visitors; - }; - PluginManager.prototype.visitor = function () { - var self = this; - return { - first: function () { - self.iterator = -1; - return self.visitors[self.iterator]; - }, - get: function () { - self.iterator += 1; - return self.visitors[self.iterator]; - } - }; - }; - /** - * - * @returns {Array} - * @private - */ - PluginManager.prototype.getFileManagers = function () { - return this.fileManagers; - }; - return PluginManager; - }()); - var pm; - var PluginManagerFactory = function (less, newFactory) { - if (newFactory || !pm) { - pm = new PluginManager(less); - } - return pm; - }; - - function SourceMapOutput (environment) { - var SourceMapOutput = /** @class */ (function () { - function SourceMapOutput(options) { - this._css = []; - this._rootNode = options.rootNode; - this._contentsMap = options.contentsMap; - this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap; - if (options.sourceMapFilename) { - this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/'); - } - this._outputFilename = options.outputFilename; - this.sourceMapURL = options.sourceMapURL; - if (options.sourceMapBasepath) { - this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/'); - } - if (options.sourceMapRootpath) { - this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/'); - if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') { - this._sourceMapRootpath += '/'; - } - } - else { - this._sourceMapRootpath = ''; - } - this._outputSourceFiles = options.outputSourceFiles; - this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator(); - this._lineNumber = 0; - this._column = 0; - } - SourceMapOutput.prototype.removeBasepath = function (path) { - if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) { - path = path.substring(this._sourceMapBasepath.length); - if (path.charAt(0) === '\\' || path.charAt(0) === '/') { - path = path.substring(1); - } - } - return path; - }; - SourceMapOutput.prototype.normalizeFilename = function (filename) { - filename = filename.replace(/\\/g, '/'); - filename = this.removeBasepath(filename); - return (this._sourceMapRootpath || '') + filename; - }; - SourceMapOutput.prototype.add = function (chunk, fileInfo, index, mapLines) { - // ignore adding empty strings - if (!chunk) { - return; - } - var lines, sourceLines, columns, sourceColumns, i; - if (fileInfo && fileInfo.filename) { - var inputSource = this._contentsMap[fileInfo.filename]; - // remove vars/banner added to the top of the file - if (this._contentsIgnoredCharsMap[fileInfo.filename]) { - // adjust the index - index -= this._contentsIgnoredCharsMap[fileInfo.filename]; - if (index < 0) { - index = 0; - } - // adjust the source - inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]); - } - /** - * ignore empty content, or failsafe - * if contents map is incorrect - */ - if (inputSource === undefined) { - this._css.push(chunk); - return; - } - inputSource = inputSource.substring(0, index); - sourceLines = inputSource.split('\n'); - sourceColumns = sourceLines[sourceLines.length - 1]; - } - lines = chunk.split('\n'); - columns = lines[lines.length - 1]; - if (fileInfo && fileInfo.filename) { - if (!mapLines) { - this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column }, - original: { line: sourceLines.length, column: sourceColumns.length }, - source: this.normalizeFilename(fileInfo.filename) }); - } - else { - for (i = 0; i < lines.length; i++) { - this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0 }, - original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0 }, - source: this.normalizeFilename(fileInfo.filename) }); - } - } - } - if (lines.length === 1) { - this._column += columns.length; - } - else { - this._lineNumber += lines.length - 1; - this._column = columns.length; - } - this._css.push(chunk); - }; - SourceMapOutput.prototype.isEmpty = function () { - return this._css.length === 0; - }; - SourceMapOutput.prototype.toCSS = function (context) { - this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null }); - if (this._outputSourceFiles) { - for (var filename in this._contentsMap) { - // eslint-disable-next-line no-prototype-builtins - if (this._contentsMap.hasOwnProperty(filename)) { - var source = this._contentsMap[filename]; - if (this._contentsIgnoredCharsMap[filename]) { - source = source.slice(this._contentsIgnoredCharsMap[filename]); - } - this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source); - } - } - } - this._rootNode.genCSS(context, this); - if (this._css.length > 0) { - var sourceMapURL = void 0; - var sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON()); - if (this.sourceMapURL) { - sourceMapURL = this.sourceMapURL; - } - else if (this._sourceMapFilename) { - sourceMapURL = this._sourceMapFilename; - } - this.sourceMapURL = sourceMapURL; - this.sourceMap = sourceMapContent; - } - return this._css.join(''); - }; - return SourceMapOutput; - }()); - return SourceMapOutput; - } - - function SourceMapBuilder (SourceMapOutput, environment) { - var SourceMapBuilder = /** @class */ (function () { - function SourceMapBuilder(options) { - this.options = options; - } - SourceMapBuilder.prototype.toCSS = function (rootNode, options, imports) { - var sourceMapOutput = new SourceMapOutput({ - contentsIgnoredCharsMap: imports.contentsIgnoredChars, - rootNode: rootNode, - contentsMap: imports.contents, - sourceMapFilename: this.options.sourceMapFilename, - sourceMapURL: this.options.sourceMapURL, - outputFilename: this.options.sourceMapOutputFilename, - sourceMapBasepath: this.options.sourceMapBasepath, - sourceMapRootpath: this.options.sourceMapRootpath, - outputSourceFiles: this.options.outputSourceFiles, - sourceMapGenerator: this.options.sourceMapGenerator, - sourceMapFileInline: this.options.sourceMapFileInline, - disableSourcemapAnnotation: this.options.disableSourcemapAnnotation - }); - var css = sourceMapOutput.toCSS(options); - this.sourceMap = sourceMapOutput.sourceMap; - this.sourceMapURL = sourceMapOutput.sourceMapURL; - if (this.options.sourceMapInputFilename) { - this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename); - } - if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) { - this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL); - } - return css + this.getCSSAppendage(); - }; - SourceMapBuilder.prototype.getCSSAppendage = function () { - var sourceMapURL = this.sourceMapURL; - if (this.options.sourceMapFileInline) { - if (this.sourceMap === undefined) { - return ''; - } - sourceMapURL = "data:application/json;base64,".concat(environment.encodeBase64(this.sourceMap)); - } - if (this.options.disableSourcemapAnnotation) { - return ''; - } - if (sourceMapURL) { - return "/*# sourceMappingURL=".concat(sourceMapURL, " */"); - } - return ''; - }; - SourceMapBuilder.prototype.getExternalSourceMap = function () { - return this.sourceMap; - }; - SourceMapBuilder.prototype.setExternalSourceMap = function (sourceMap) { - this.sourceMap = sourceMap; - }; - SourceMapBuilder.prototype.isInline = function () { - return this.options.sourceMapFileInline; - }; - SourceMapBuilder.prototype.getSourceMapURL = function () { - return this.sourceMapURL; - }; - SourceMapBuilder.prototype.getOutputFilename = function () { - return this.options.sourceMapOutputFilename; - }; - SourceMapBuilder.prototype.getInputFilename = function () { - return this.sourceMapInputFilename; - }; - return SourceMapBuilder; - }()); - return SourceMapBuilder; - } - - function ParseTree (SourceMapBuilder) { - var ParseTree = /** @class */ (function () { - function ParseTree(root, imports) { - this.root = root; - this.imports = imports; - } - ParseTree.prototype.toCSS = function (options) { - var evaldRoot; - var result = {}; - var sourceMapBuilder; - try { - evaldRoot = transformTree(this.root, options); - } - catch (e) { - throw new LessError(e, this.imports); - } - try { - var compress = Boolean(options.compress); - if (compress) { - logger$1.warn('The compress option has been deprecated. ' + - 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.'); - } - var toCSSOptions = { - compress: compress, - dumpLineNumbers: options.dumpLineNumbers, - strictUnits: Boolean(options.strictUnits), - numPrecision: 8 - }; - if (options.sourceMap) { - sourceMapBuilder = new SourceMapBuilder(options.sourceMap); - result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports); - } - else { - result.css = evaldRoot.toCSS(toCSSOptions); - } - } - catch (e) { - throw new LessError(e, this.imports); - } - if (options.pluginManager) { - var postProcessors = options.pluginManager.getPostProcessors(); - for (var i_1 = 0; i_1 < postProcessors.length; i_1++) { - result.css = postProcessors[i_1].process(result.css, { sourceMap: sourceMapBuilder, options: options, imports: this.imports }); - } - } - if (options.sourceMap) { - result.map = sourceMapBuilder.getExternalSourceMap(); - } - result.imports = []; - for (var file_1 in this.imports.files) { - if (Object.prototype.hasOwnProperty.call(this.imports.files, file_1) && file_1 !== this.imports.rootFilename) { - result.imports.push(file_1); - } - } - return result; - }; - return ParseTree; - }()); - return ParseTree; - } - - function ImportManager (environment) { - // FileInfo = { - // 'rewriteUrls' - option - whether to adjust URL's to be relative - // 'filename' - full resolved filename of current file - // 'rootpath' - path to append to normal URLs for this node - // 'currentDirectory' - path to the current file, absolute - // 'rootFilename' - filename of the base file - // 'entryPath' - absolute path to the entry file - // 'reference' - whether the file should not be output and only output parts that are referenced - var ImportManager = /** @class */ (function () { - function ImportManager(less, context, rootFileInfo) { - this.less = less; - this.rootFilename = rootFileInfo.filename; - this.paths = context.paths || []; // Search paths, when importing - this.contents = {}; // map - filename to contents of all the files - this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore - this.mime = context.mime; - this.error = null; - this.context = context; - // Deprecated? Unused outside of here, could be useful. - this.queue = []; // Files which haven't been imported yet - this.files = {}; // Holds the imported parse trees. - } - /** - * Add an import to be imported - * @param path - the raw path - * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension) - * @param currentFileInfo - the current file info (used for instance to work out relative paths) - * @param importOptions - import options - * @param callback - callback for when it is imported - */ - ImportManager.prototype.push = function (path, tryAppendExtension, currentFileInfo, importOptions, callback) { - var importManager = this, pluginLoader = this.context.pluginManager.Loader; - this.queue.push(path); - var fileParsedFunc = function (e, root, fullPath) { - importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue - var importedEqualsRoot = fullPath === importManager.rootFilename; - if (importOptions.optional && e) { - callback(null, { rules: [] }, false, null); - logger$1.info("The file ".concat(fullPath, " was skipped because it was not found and the import was marked optional.")); - } - else { - // Inline imports aren't cached here. - // If we start to cache them, please make sure they won't conflict with non-inline imports of the - // same name as they used to do before this comment and the condition below have been added. - if (!importManager.files[fullPath] && !importOptions.inline) { - importManager.files[fullPath] = { root: root, options: importOptions }; - } - if (e && !importManager.error) { - importManager.error = e; - } - callback(e, root, importedEqualsRoot, fullPath); - } - }; - var newFileInfo = { - rewriteUrls: this.context.rewriteUrls, - entryPath: currentFileInfo.entryPath, - rootpath: currentFileInfo.rootpath, - rootFilename: currentFileInfo.rootFilename - }; - var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment); - if (!fileManager) { - fileParsedFunc({ message: "Could not find a file-manager for ".concat(path) }); - return; - } - var loadFileCallback = function (loadedFile) { - var plugin; - var resolvedFilename = loadedFile.filename; - var contents = loadedFile.contents.replace(/^\uFEFF/, ''); - // Pass on an updated rootpath if path of imported file is relative and file - // is in a (sub|sup) directory - // - // Examples: - // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/', - // then rootpath should become 'less/module/nav/' - // - If path of imported file is '../mixins.less' and rootpath is 'less/', - // then rootpath should become 'less/../' - newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename); - if (newFileInfo.rewriteUrls) { - newFileInfo.rootpath = fileManager.join((importManager.context.rootpath || ''), fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); - if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) { - newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath); - } - } - newFileInfo.filename = resolvedFilename; - var newEnv = new contexts.Parse(importManager.context); - newEnv.processImports = false; - importManager.contents[resolvedFilename] = contents; - if (currentFileInfo.reference || importOptions.reference) { - newFileInfo.reference = true; - } - if (importOptions.isPlugin) { - plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo); - if (plugin instanceof LessError) { - fileParsedFunc(plugin, null, resolvedFilename); - } - else { - fileParsedFunc(null, plugin, resolvedFilename); - } - } - else if (importOptions.inline) { - fileParsedFunc(null, contents, resolvedFilename); - } - else { - // import (multiple) parse trees apparently get altered and can't be cached. - // TODO: investigate why this is - if (importManager.files[resolvedFilename] - && !importManager.files[resolvedFilename].options.multiple - && !importOptions.multiple) { - fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename); - } - else { - new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) { - fileParsedFunc(e, root, resolvedFilename); - }); - } - } - }; - var loadedFile; - var promise; - var context = clone(this.context); - if (tryAppendExtension) { - context.ext = importOptions.isPlugin ? '.js' : '.less'; - } - if (importOptions.isPlugin) { - context.mime = 'application/javascript'; - if (context.syncImport) { - loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager); - } - else { - promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager); - } - } - else { - if (context.syncImport) { - loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment); - } - else { - promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, function (err, loadedFile) { - if (err) { - fileParsedFunc(err); - } - else { - loadFileCallback(loadedFile); - } - }); - } - } - if (loadedFile) { - if (!loadedFile.filename) { - fileParsedFunc(loadedFile); - } - else { - loadFileCallback(loadedFile); - } - } - else if (promise) { - promise.then(loadFileCallback, fileParsedFunc); - } - }; - return ImportManager; - }()); - return ImportManager; - } - - function Parse (environment, ParseTree, ImportManager) { - var parse = function (input, options, callback) { - if (typeof options === 'function') { - callback = options; - options = copyOptions(this.options, {}); - } - else { - options = copyOptions(this.options, options || {}); - } - if (!callback) { - var self_1 = this; - return new Promise(function (resolve, reject) { - parse.call(self_1, input, options, function (err, output) { - if (err) { - reject(err); - } - else { - resolve(output); - } - }); - }); - } - else { - var context_1; - var rootFileInfo = void 0; - var pluginManager_1 = new PluginManagerFactory(this, !options.reUsePluginManager); - options.pluginManager = pluginManager_1; - context_1 = new contexts.Parse(options); - if (options.rootFileInfo) { - rootFileInfo = options.rootFileInfo; - } - else { - var filename = options.filename || 'input'; - var entryPath = filename.replace(/[^/\\]*$/, ''); - rootFileInfo = { - filename: filename, - rewriteUrls: context_1.rewriteUrls, - rootpath: context_1.rootpath || '', - currentDirectory: entryPath, - entryPath: entryPath, - rootFilename: filename - }; - // add in a missing trailing slash - if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') { - rootFileInfo.rootpath += '/'; - } - } - var imports_1 = new ImportManager(this, context_1, rootFileInfo); - this.importManager = imports_1; - // TODO: allow the plugins to be just a list of paths or names - // Do an async plugin queue like lessc - if (options.plugins) { - options.plugins.forEach(function (plugin) { - var evalResult, contents; - if (plugin.fileContent) { - contents = plugin.fileContent.replace(/^\uFEFF/, ''); - evalResult = pluginManager_1.Loader.evalPlugin(contents, context_1, imports_1, plugin.options, plugin.filename); - if (evalResult instanceof LessError) { - return callback(evalResult); - } - } - else { - pluginManager_1.addPlugin(plugin); - } - }); - } - new Parser(context_1, imports_1, rootFileInfo) - .parse(input, function (e, root) { - if (e) { - return callback(e); - } - callback(null, root, imports_1, options); - }, options); - } - }; - return parse; - } - - function Render (environment, ParseTree) { - var render = function (input, options, callback) { - if (typeof options === 'function') { - callback = options; - options = copyOptions(this.options, {}); - } - else { - options = copyOptions(this.options, options || {}); - } - if (!callback) { - var self_1 = this; - return new Promise(function (resolve, reject) { - render.call(self_1, input, options, function (err, output) { - if (err) { - reject(err); - } - else { - resolve(output); - } - }); - }); - } - else { - this.parse(input, options, function (err, root, imports, options) { - if (err) { - return callback(err); - } - var result; - try { - var parseTree = new ParseTree(root, imports); - result = parseTree.toCSS(options); - } - catch (err) { - return callback(err); - } - callback(null, result); - }); - } - }; - return render; - } - - var version = "4.4.2"; - - function parseNodeVersion(version) { - var match = version.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len - if (!match) { - throw new Error('Unable to parse: ' + version); - } - - var res = { - major: parseInt(match[1], 10), - minor: parseInt(match[2], 10), - patch: parseInt(match[3], 10), - pre: match[4] || '', - build: match[5] || '', - }; - - return res; - } - - var parseNodeVersion_1 = parseNodeVersion; - - function lessRoot (environment, fileManagers) { - var sourceMapOutput, sourceMapBuilder, parseTree, importManager; - environment = new Environment(environment, fileManagers); - sourceMapOutput = SourceMapOutput(environment); - sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment); - parseTree = ParseTree(sourceMapBuilder); - importManager = ImportManager(environment); - var render = Render(environment, parseTree); - var parse = Parse(environment, parseTree, importManager); - var v = parseNodeVersion_1("v".concat(version)); - var initial = { - version: [v.major, v.minor, v.patch], - data: data, - tree: tree, - Environment: Environment, - AbstractFileManager: AbstractFileManager, - AbstractPluginLoader: AbstractPluginLoader, - environment: environment, - visitors: visitors, - Parser: Parser, - functions: functions(environment), - contexts: contexts, - SourceMapOutput: sourceMapOutput, - SourceMapBuilder: sourceMapBuilder, - ParseTree: parseTree, - ImportManager: importManager, - render: render, - parse: parse, - LessError: LessError, - transformTree: transformTree, - utils: utils, - PluginManager: PluginManagerFactory, - logger: logger$1 - }; - // Create a public API - var ctor = function (t) { - return function () { - var obj = Object.create(t.prototype); - t.apply(obj, Array.prototype.slice.call(arguments, 0)); - return obj; - }; - }; - var t; - var api = Object.create(initial); - for (var n in initial.tree) { - /* eslint guard-for-in: 0 */ - t = initial.tree[n]; - if (typeof t === 'function') { - api[n.toLowerCase()] = ctor(t); - } - else { - api[n] = Object.create(null); - for (var o in t) { - /* eslint guard-for-in: 0 */ - api[n][o.toLowerCase()] = ctor(t[o]); - } - } - } - /** - * Some of the functions assume a `this` context of the API object, - * which causes it to fail when wrapped for ES6 imports. - * - * An assumed `this` should be removed in the future. - */ - initial.parse = initial.parse.bind(api); - initial.render = initial.render.bind(api); - return api; - } - - var options$1; - var logger; - var fileCache = {}; - // TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load - var FileManager = function () { }; - FileManager.prototype = Object.assign(new AbstractFileManager(), { - alwaysMakePathsAbsolute: function () { - return true; - }, - join: function (basePath, laterPath) { - if (!basePath) { - return laterPath; - } - return this.extractUrlParts(laterPath, basePath).path; - }, - doXHR: function (url, type, callback, errback) { - var xhr = new XMLHttpRequest(); - var async = options$1.isFileProtocol ? options$1.fileAsync : true; - if (typeof xhr.overrideMimeType === 'function') { - xhr.overrideMimeType('text/css'); - } - logger.debug("XHR: Getting '".concat(url, "'")); - xhr.open('GET', url, async); - xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5'); - xhr.send(null); - function handleResponse(xhr, callback, errback) { - if (xhr.status >= 200 && xhr.status < 300) { - callback(xhr.responseText, xhr.getResponseHeader('Last-Modified')); - } - else if (typeof errback === 'function') { - errback(xhr.status, url); - } - } - if (options$1.isFileProtocol && !options$1.fileAsync) { - if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) { - callback(xhr.responseText); - } - else { - errback(xhr.status, url); - } - } - else if (async) { - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - handleResponse(xhr, callback, errback); - } - }; - } - else { - handleResponse(xhr, callback, errback); - } - }, - supports: function () { - return true; - }, - clearFileCache: function () { - fileCache = {}; - }, - loadFile: function (filename, currentDirectory, options) { - // TODO: Add prefix support like less-node? - // What about multiple paths? - if (currentDirectory && !this.isPathAbsolute(filename)) { - filename = currentDirectory + filename; - } - filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename; - options = options || {}; - // sheet may be set to the stylesheet for the initial load or a collection of properties including - // some context variables for imports - var hrefParts = this.extractUrlParts(filename, window.location.href); - var href = hrefParts.url; - var self = this; - return new Promise(function (resolve, reject) { - if (options.useFileCache && fileCache[href]) { - try { - var lessText_1 = fileCache[href]; - return resolve({ contents: lessText_1, filename: href, webInfo: { lastModified: new Date() } }); - } - catch (e) { - return reject({ filename: href, message: "Error loading file ".concat(href, " error was ").concat(e.message) }); - } - } - self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { - // per file cache - fileCache[href] = data; - // Use remote copy (re-parse) - resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } }); - }, function doXHRError(status, url) { - reject({ type: 'File', message: "'".concat(url, "' wasn't found (").concat(status, ")"), href: href }); - }); - }); - } - }); - var FM = (function (opts, log) { - options$1 = opts; - logger = log; - return FileManager; - }); - - /** - * @todo Add tests for browser `@plugin` - */ - /** - * Browser Plugin Loader - */ - var PluginLoader = function (less) { - this.less = less; - // Should we shim this.require for browser? Probably not? - }; - PluginLoader.prototype = Object.assign(new AbstractPluginLoader(), { - loadPlugin: function (filename, basePath, context, environment, fileManager) { - return new Promise(function (fulfill, reject) { - fileManager.loadFile(filename, basePath, context, environment) - .then(fulfill).catch(reject); - }); - } - }); - - var LogListener = (function (less, options) { - var logLevel_debug = 4; - var logLevel_info = 3; - var logLevel_warn = 2; - var logLevel_error = 1; - // The amount of logging in the javascript console. - // 3 - Debug, information and errors - // 2 - Information and errors - // 1 - Errors - // 0 - None - // Defaults to 2 - options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error); - if (!options.loggers) { - options.loggers = [{ - debug: function (msg) { - if (options.logLevel >= logLevel_debug) { - console.log(msg); - } - }, - info: function (msg) { - if (options.logLevel >= logLevel_info) { - console.log(msg); - } - }, - warn: function (msg) { - if (options.logLevel >= logLevel_warn) { - console.warn(msg); - } - }, - error: function (msg) { - if (options.logLevel >= logLevel_error) { - console.error(msg); - } - } - }]; - } - for (var i_1 = 0; i_1 < options.loggers.length; i_1++) { - less.logger.addListener(options.loggers[i_1]); - } - }); - - var ErrorReporting = (function (window, less, options) { - function errorHTML(e, rootHref) { - var id = "less-error-message:".concat(extractId(rootHref || '')); - var template = '
  • {content}
  • '; - var elem = window.document.createElement('div'); - var timer; - var content; - var errors = []; - var filename = e.filename || rootHref; - var filenameNoPath = filename.match(/([^/]+(\?.*)?)$/)[1]; - elem.id = id; - elem.className = 'less-error-message'; - content = "

    ".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file') + - "

    in ").concat(filenameNoPath, " "); - var errorline = function (e, i, classname) { - if (e.extract[i] !== undefined) { - errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) - .replace(/\{class\}/, classname) - .replace(/\{content\}/, e.extract[i])); - } - }; - if (e.line) { - errorline(e, 0, ''); - errorline(e, 1, 'line'); - errorline(e, 2, ''); - content += "on line ".concat(e.line, ", column ").concat(e.column + 1, ":

      ").concat(errors.join(''), "
    "); - } - if (e.stack && (e.extract || options.logLevel >= 4)) { - content += "
    Stack Trace
    ".concat(e.stack.split('\n').slice(1).join('
    ')); - } - elem.innerHTML = content; - // CSS for error messages - browser.createCSS(window.document, [ - '.less-error-message ul, .less-error-message li {', - 'list-style-type: none;', - 'margin-right: 15px;', - 'padding: 4px 0;', - 'margin: 0;', - '}', - '.less-error-message label {', - 'font-size: 12px;', - 'margin-right: 15px;', - 'padding: 4px 0;', - 'color: #cc7777;', - '}', - '.less-error-message pre {', - 'color: #dd6666;', - 'padding: 4px 0;', - 'margin: 0;', - 'display: inline-block;', - '}', - '.less-error-message pre.line {', - 'color: #ff0000;', - '}', - '.less-error-message h3 {', - 'font-size: 20px;', - 'font-weight: bold;', - 'padding: 15px 0 5px 0;', - 'margin: 0;', - '}', - '.less-error-message a {', - 'color: #10a', - '}', - '.less-error-message .error {', - 'color: red;', - 'font-weight: bold;', - 'padding-bottom: 2px;', - 'border-bottom: 1px dashed red;', - '}' - ].join('\n'), { title: 'error-message' }); - elem.style.cssText = [ - 'font-family: Arial, sans-serif', - 'border: 1px solid #e00', - 'background-color: #eee', - 'border-radius: 5px', - '-webkit-border-radius: 5px', - '-moz-border-radius: 5px', - 'color: #e00', - 'padding: 15px', - 'margin-bottom: 15px' - ].join(';'); - if (options.env === 'development') { - timer = setInterval(function () { - var document = window.document; - var body = document.body; - if (body) { - if (document.getElementById(id)) { - body.replaceChild(elem, document.getElementById(id)); - } - else { - body.insertBefore(elem, body.firstChild); - } - clearInterval(timer); - } - }, 10); - } - } - function removeErrorHTML(path) { - var node = window.document.getElementById("less-error-message:".concat(extractId(path))); - if (node) { - node.parentNode.removeChild(node); - } - } - function removeError(path) { - if (!options.errorReporting || options.errorReporting === 'html') { - removeErrorHTML(path); - } - else if (options.errorReporting === 'console') ; - else if (typeof options.errorReporting === 'function') { - options.errorReporting('remove', path); - } - } - function errorConsole(e, rootHref) { - var template = '{line} {content}'; - var filename = e.filename || rootHref; - var errors = []; - var content = "".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file', " in ").concat(filename); - var errorline = function (e, i, classname) { - if (e.extract[i] !== undefined) { - errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) - .replace(/\{class\}/, classname) - .replace(/\{content\}/, e.extract[i])); - } - }; - if (e.line) { - errorline(e, 0, ''); - errorline(e, 1, 'line'); - errorline(e, 2, ''); - content += " on line ".concat(e.line, ", column ").concat(e.column + 1, ":\n").concat(errors.join('\n')); - } - if (e.stack && (e.extract || options.logLevel >= 4)) { - content += "\nStack Trace\n".concat(e.stack); - } - less.logger.error(content); - } - function error(e, rootHref) { - if (!options.errorReporting || options.errorReporting === 'html') { - errorHTML(e, rootHref); - } - else if (options.errorReporting === 'console') { - errorConsole(e, rootHref); - } - else if (typeof options.errorReporting === 'function') { - options.errorReporting('add', e, rootHref); - } - } - return { - add: error, - remove: removeError - }; - }); - - // Cache system is a bit outdated and could do with work - var Cache = (function (window, options, logger) { - var cache = null; - if (options.env !== 'development') { - try { - cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage; - } - catch (_) { } - } - return { - setCSS: function (path, lastModified, modifyVars, styles) { - if (cache) { - logger.info("saving ".concat(path, " to cache.")); - try { - cache.setItem(path, styles); - cache.setItem("".concat(path, ":timestamp"), lastModified); - if (modifyVars) { - cache.setItem("".concat(path, ":vars"), JSON.stringify(modifyVars)); - } - } - catch (e) { - // TODO - could do with adding more robust error handling - logger.error("failed to save \"".concat(path, "\" to local storage for caching.")); - } - } - }, - getCSS: function (path, webInfo, modifyVars) { - var css = cache && cache.getItem(path); - var timestamp = cache && cache.getItem("".concat(path, ":timestamp")); - var vars = cache && cache.getItem("".concat(path, ":vars")); - modifyVars = modifyVars || {}; - vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object - if (timestamp && webInfo.lastModified && - (new Date(webInfo.lastModified).valueOf() === - new Date(timestamp).valueOf()) && - JSON.stringify(modifyVars) === vars) { - // Use local copy - return css; - } - } - }; - }); - - var ImageSize = (function () { - function imageSize() { - throw { - type: 'Runtime', - message: 'Image size functions are not supported in browser version of less' - }; - } - var imageFunctions = { - 'image-size': function (filePathNode) { - imageSize(); - return -1; - }, - 'image-width': function (filePathNode) { - imageSize(); - return -1; - }, - 'image-height': function (filePathNode) { - imageSize(); - return -1; - } - }; - functionRegistry.addMultiple(imageFunctions); - }); - - // - var root = (function (window, options) { - var document = window.document; - var less = lessRoot(); - less.options = options; - var environment = less.environment; - var FileManager = FM(options, less.logger); - var fileManager = new FileManager(); - environment.addFileManager(fileManager); - less.FileManager = FileManager; - less.PluginLoader = PluginLoader; - LogListener(less, options); - var errors = ErrorReporting(window, less, options); - var cache = less.cache = options.cache || Cache(window, options, less.logger); - ImageSize(less.environment); - // Setup user functions - Deprecate? - if (options.functions) { - less.functions.functionRegistry.addMultiple(options.functions); - } - var typePattern = /^text\/(x-)?less$/; - function clone(obj) { - var cloned = {}; - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - cloned[prop] = obj[prop]; - } - } - return cloned; - } - // only really needed for phantom - function bind(func, thisArg) { - var curryArgs = Array.prototype.slice.call(arguments, 2); - return function () { - var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0)); - return func.apply(thisArg, args); - }; - } - function loadStyles(modifyVars) { - var styles = document.getElementsByTagName('style'); - var style; - for (var i_1 = 0; i_1 < styles.length; i_1++) { - style = styles[i_1]; - if (style.type.match(typePattern)) { - var instanceOptions = clone(options); - instanceOptions.modifyVars = modifyVars; - var lessText_1 = style.innerHTML || ''; - instanceOptions.filename = document.location.href.replace(/#.*$/, ''); - /* jshint loopfunc:true */ - // use closure to store current style - less.render(lessText_1, instanceOptions, bind(function (style, e, result) { - if (e) { - errors.add(e, 'inline'); - } - else { - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = result.css; - } - else { - style.innerHTML = result.css; - } - } - }, null, style)); - } - } - } - function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { - var instanceOptions = clone(options); - addDataAttr(instanceOptions, sheet); - instanceOptions.mime = sheet.type; - if (modifyVars) { - instanceOptions.modifyVars = modifyVars; - } - function loadInitialFileCallback(loadedFile) { - var data = loadedFile.contents; - var path = loadedFile.filename; - var webInfo = loadedFile.webInfo; - var newFileInfo = { - currentDirectory: fileManager.getPath(path), - filename: path, - rootFilename: path, - rewriteUrls: instanceOptions.rewriteUrls - }; - newFileInfo.entryPath = newFileInfo.currentDirectory; - newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory; - if (webInfo) { - webInfo.remaining = remaining; - var css = cache.getCSS(path, webInfo, instanceOptions.modifyVars); - if (!reload && css) { - webInfo.local = true; - callback(null, css, data, sheet, webInfo, path); - return; - } - } - // TODO add tests around how this behaves when reloading - errors.remove(path); - instanceOptions.rootFileInfo = newFileInfo; - less.render(data, instanceOptions, function (e, result) { - if (e) { - e.href = path; - callback(e); - } - else { - cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css); - callback(null, result.css, data, sheet, webInfo, path); - } - }); - } - fileManager.loadFile(sheet.href, null, instanceOptions, environment) - .then(function (loadedFile) { - loadInitialFileCallback(loadedFile); - }).catch(function (err) { - console.log(err); - callback(err); - }); - } - function loadStyleSheets(callback, reload, modifyVars) { - for (var i_2 = 0; i_2 < less.sheets.length; i_2++) { - loadStyleSheet(less.sheets[i_2], callback, reload, less.sheets.length - (i_2 + 1), modifyVars); - } - } - function initRunningMode() { - if (less.env === 'development') { - less.watchTimer = setInterval(function () { - if (less.watchMode) { - fileManager.clearFileCache(); - /** - * @todo remove when this is typed with JSDoc - */ - // eslint-disable-next-line no-unused-vars - loadStyleSheets(function (e, css, _, sheet, webInfo) { - if (e) { - errors.add(e, e.href || sheet.href); - } - else if (css) { - browser.createCSS(window.document, css, sheet); - } - }); - } - }, options.poll); - } - } - // - // Watch mode - // - less.watch = function () { - if (!less.watchMode) { - less.env = 'development'; - initRunningMode(); - } - this.watchMode = true; - return true; - }; - less.unwatch = function () { clearInterval(less.watchTimer); this.watchMode = false; return false; }; - // - // Synchronously get all tags with the 'rel' attribute set to - // "stylesheet/less". - // - less.registerStylesheetsImmediately = function () { - var links = document.getElementsByTagName('link'); - less.sheets = []; - for (var i_3 = 0; i_3 < links.length; i_3++) { - if (links[i_3].rel === 'stylesheet/less' || (links[i_3].rel.match(/stylesheet/) && - (links[i_3].type.match(typePattern)))) { - less.sheets.push(links[i_3]); - } - } - }; - // - // Asynchronously get all tags with the 'rel' attribute set to - // "stylesheet/less", returning a Promise. - // - less.registerStylesheets = function () { return new Promise(function (resolve) { - less.registerStylesheetsImmediately(); - resolve(); - }); }; - // - // With this function, it's possible to alter variables and re-render - // CSS without reloading less-files - // - less.modifyVars = function (record) { return less.refresh(true, record, false); }; - less.refresh = function (reload, modifyVars, clearFileCache) { - if ((reload || clearFileCache) && clearFileCache !== false) { - fileManager.clearFileCache(); - } - return new Promise(function (resolve, reject) { - var startTime; - var endTime; - var totalMilliseconds; - var remainingSheets; - startTime = endTime = new Date(); - // Set counter for remaining unprocessed sheets - remainingSheets = less.sheets.length; - if (remainingSheets === 0) { - endTime = new Date(); - totalMilliseconds = endTime - startTime; - less.logger.info('Less has finished and no sheets were loaded.'); - resolve({ - startTime: startTime, - endTime: endTime, - totalMilliseconds: totalMilliseconds, - sheets: less.sheets.length - }); - } - else { - // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array - loadStyleSheets(function (e, css, _, sheet, webInfo) { - if (e) { - errors.add(e, e.href || sheet.href); - reject(e); - return; - } - if (webInfo.local) { - less.logger.info("Loading ".concat(sheet.href, " from cache.")); - } - else { - less.logger.info("Rendered ".concat(sheet.href, " successfully.")); - } - browser.createCSS(window.document, css, sheet); - less.logger.info("CSS for ".concat(sheet.href, " generated in ").concat(new Date() - endTime, "ms")); - // Count completed sheet - remainingSheets--; - // Check if the last remaining sheet was processed and then call the promise - if (remainingSheets === 0) { - totalMilliseconds = new Date() - startTime; - less.logger.info("Less has finished. CSS generated in ".concat(totalMilliseconds, "ms")); - resolve({ - startTime: startTime, - endTime: endTime, - totalMilliseconds: totalMilliseconds, - sheets: less.sheets.length - }); - } - endTime = new Date(); - }, reload, modifyVars); - } - loadStyles(modifyVars); - }); - }; - less.refreshStyles = loadStyles; - return less; - }); - - /** - * Kicks off less and compiles any stylesheets - * used in the browser distributed version of less - * to kick-start less using the browser api - */ - var options = defaultOptions(); - if (window.less) { - for (var key in window.less) { - if (Object.prototype.hasOwnProperty.call(window.less, key)) { - options[key] = window.less[key]; - } - } - } - addDefaultOptions(window, options); - options.plugins = options.plugins || []; - if (window.LESS_PLUGINS) { - options.plugins = options.plugins.concat(window.LESS_PLUGINS); - } - var less = root(window, options); - window.less = less; - var css; - var head; - var style; - // Always restore page visibility - function resolveOrReject(data) { - if (data.filename) { - console.warn(data); - } - if (!options.async) { - head.removeChild(style); - } - } - if (options.onReady) { - if (/!watch/.test(window.location.hash)) { - less.watch(); - } - // Simulate synchronous stylesheet loading by hiding page rendering - if (!options.async) { - css = 'body { display: none !important }'; - head = document.head || document.getElementsByTagName('head')[0]; - style = document.createElement('style'); - style.type = 'text/css'; - if (style.styleSheet) { - style.styleSheet.cssText = css; - } - else { - style.appendChild(document.createTextNode(css)); - } - head.appendChild(style); - } - less.registerStylesheetsImmediately(); - less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject); - } - - return less; - -})); diff --git a/packages/less/dist/less.min.js b/packages/less/dist/less.min.js deleted file mode 100644 index fb7147a09..000000000 --- a/packages/less/dist/less.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Less - Leaner CSS v4.4.2 - * http://lesscss.org - * - * Copyright (c) 2009-2025, Alexis Sellier - * Licensed under the Apache-2.0 License. - * - * @license Apache-2.0 - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).less=t()}(this,(function(){"use strict";function e(e){return e.replace(/^[a-z-]+:\/+?[^/]+/,"").replace(/[?&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^.\w-]+/g,"-").replace(/\./g,":")}function t(e,t){if(t)for(var n in t.dataset)if(Object.prototype.hasOwnProperty.call(t.dataset,n))if("env"===n||"dumpLineNumbers"===n||"rootpath"===n||"errorReporting"===n)e[n]=t.dataset[n];else try{e[n]=JSON.parse(t.dataset[n])}catch(e){}}var n=function(t,n,i){var r=i.href||"",s="less:".concat(i.title||e(r)),a=t.getElementById(s),o=!1,l=t.createElement("style");l.setAttribute("type","text/css"),i.media&&l.setAttribute("media",i.media),l.id=s,l.styleSheet||(l.appendChild(t.createTextNode(n)),o=null!==a&&a.childNodes.length>0&&l.childNodes.length>0&&a.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===a||!1===o){var c=i&&i.nextSibling||null;c?c.parentNode.insertBefore(l,c):u.appendChild(l)}if(a&&!1===o&&a.parentNode.removeChild(a),l.styleSheet)try{l.styleSheet.cssText=n}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},i=function(e){var t,n=e.document;return n.currentScript||(t=n.getElementsByTagName("script"))[t.length-1]},r={error:function(e){this._fireEvent("error",e)},warn:function(e){this._fireEvent("warn",e)},info:function(e){this._fireEvent("info",e)},debug:function(e){this._fireEvent("debug",e)},addListener:function(e){this._listeners.push(e)},removeListener:function(e){for(var t=0;t=0;o--){var l=a[o];if(l[s?"supportsSync":"supports"](e,t,n,i))return l}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o={length:{m:1,cm:.01,mm:.001,in:.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}},l={colors:a,unitConversions:o},u=function(){function e(){this.parent=null,this.visibilityBlocks=void 0,this.nodeVisible=void 0,this.rootNode=null,this.parsed=null}return Object.defineProperty(e.prototype,"currentFileInfo",{get:function(){return this.fileInfo()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.getIndex()},enumerable:!1,configurable:!0}),e.prototype.setParent=function(t,n){function i(t){t&&t instanceof e&&(t.parent=n)}Array.isArray(t)?t.forEach(i):i(t)},e.prototype.getIndex=function(){return this._index||this.parent&&this.parent.getIndex()||0},e.prototype.fileInfo=function(){return this._fileInfo||this.parent&&this.parent.fileInfo()||{}},e.prototype.isRulesetLike=function(){return!1},e.prototype.toCSS=function(e){var t=[];return this.genCSS(e,{add:function(e,n,i){t.push(e)},isEmpty:function(){return 0===t.length}}),t.join("")},e.prototype.genCSS=function(e,t){t.add(this.value)},e.prototype.accept=function(e){this.value=e.visit(this.value)},e.prototype.eval=function(){return this},e.prototype._operate=function(e,t,n,i){switch(t){case"+":return n+i;case"-":return n-i;case"*":return n*i;case"/":return n/i}},e.prototype.fround=function(e,t){var n=e&&e.numPrecision;return n?Number((t+2e-16).toFixed(n)):t},e.compare=function(t,n){if(t.compare&&"Quoted"!==n.type&&"Anonymous"!==n.type)return t.compare(n);if(n.compare)return-n.compare(t);if(t.type===n.type){if(t=t.value,n=n.value,!Array.isArray(t))return t===n?0:void 0;if(t.length===n.length){for(var i=0;it?1:void 0},e.prototype.blocksVisibility=function(){return void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},e.prototype.addVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},e.prototype.removeVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},e.prototype.ensureVisibility=function(){this.nodeVisible=!0},e.prototype.ensureInvisibility=function(){this.nodeVisible=!1},e.prototype.isVisible=function(){return this.nodeVisible},e.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},e.prototype.copyVisibilityInfo=function(e){e&&(this.visibilityBlocks=e.visibilityBlocks,this.nodeVisible=e.nodeVisible)},e}(),c=function(e,t,n){var i=this;Array.isArray(e)?this.rgb=e:e.length>=6?(this.rgb=[],e.match(/.{2}/g).map((function(e,t){t<3?i.rgb.push(parseInt(e,16)):i.alpha=parseInt(e,16)/255}))):(this.rgb=[],e.split("").map((function(e,t){t<3?i.rgb.push(parseInt(e+e,16)):i.alpha=parseInt(e+e,16)/255}))),this.alpha=this.alpha||("number"==typeof t?t:1),void 0!==n&&(this.value=n)};function h(e,t){return Math.min(Math.max(e,0),t)}function f(e){return"#".concat(e.map((function(e){return((e=h(Math.round(e),255))<16?"0":"")+e.toString(16)})).join(""))}c.prototype=Object.assign(new u,{type:"Color",luma:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},genCSS:function(e,t){t.add(this.toCSS(e))},toCSS:function(e,t){var n,i,r,s=e&&e.compress&&!t,a=[];if(i=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))i<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=i<1?"hsla":"hsl"}else i<1&&(r="rgba");switch(r){case"rgba":a=this.rgb.map((function(e){return h(Math.round(e),255)})).concat(h(i,1));break;case"hsla":a.push(h(i,1));case"hsl":n=this.toHSL(),a=[this.fround(e,n.h),"".concat(this.fround(e,100*n.s),"%"),"".concat(this.fround(e,100*n.l),"%")].concat(a)}if(r)return"".concat(r,"(").concat(a.join(",".concat(s?"":" ")),")");if(n=this.toRGB(),s){var o=n.split("");o[1]===o[2]&&o[3]===o[4]&&o[5]===o[6]&&(n="#".concat(o[1]).concat(o[3]).concat(o[5]))}return n},operate:function(e,t,n){for(var i=new Array(3),r=this.alpha*(1-n.alpha)+n.alpha,s=0;s<3;s++)i[s]=this._operate(e,t,this.rgb[s],n.rgb[s]);return new c(i,r)},toRGB:function(){return f(this.rgb)},toHSL:function(){var e,t,n=this.rgb[0]/255,i=this.rgb[1]/255,r=this.rgb[2]/255,s=this.alpha,a=Math.max(n,i,r),o=Math.min(n,i,r),l=(a+o)/2,u=a-o;if(a===o)e=t=0;else{switch(t=l>.5?u/(2-a-o):u/(a+o),a){case n:e=(i-r)/u+(iC(e,t));if("Object"!==S(n=e)||n.constructor!==Object||Object.getPrototypeOf(n)!==Object.prototype)return e;var n;return[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].reduce((n,i)=>{if(I(t.props)&&!t.props.includes(i))return n;return function(e,t,n,i,r){const s={}.propertyIsEnumerable.call(i,t)?"enumerable":"nonenumerable";"enumerable"===s&&(e[t]=n),r&&"nonenumerable"===s&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}(n,i,C(e[i],t),e,t.nonenumerable),n},{})}function k(e,t){for(var n=e+1,i=null,r=-1;--n>=0&&"\n"!==t.charAt(n);)r++;return"number"==typeof e&&(i=(t.slice(0,e).match(/\n/g)||"").length),{line:i,column:r}}function A(e){var t,n=e.length,i=new Array(n);for(t=0;t|Function):(\d+):(\d+)/,F=function(e,t,n){Error.call(this);var i=e.filename||n;if(this.message=e.message,this.stack=e.stack,t&&i){var r=t.contents[i],s=k(e.index,r),a=s.line,o=s.column,l=e.call&&k(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=i,this.index=e.index,this.line="number"==typeof a?a+1:null,this.column=o,!this.line&&this.stack){var c=this.stack.match($),h=new Function("a","throw new Error()"),f=0;try{h()}catch(e){var p=e.stack.match($);f=1-parseInt(p[2])}c&&(c[2]&&(this.line=parseInt(c[2])+f),c[3]&&(this.column=parseInt(c[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var V=function(){};V.prototype=Error.prototype,F.prototype=new V}else F.prototype=Object.create(Error.prototype);F.prototype.constructor=F,F.prototype.toString=function(e){var t;e=e||{};var n=(null!==(t=this.type)&&void 0!==t?t:"").toLowerCase().includes("warning"),i=n?this.type:"".concat(this.type,"Error"),r=n?"yellow":"red",s="",a=this.extract||[],o=[],l=function(e){return e};if(e.stylize){var u=typeof e.stylize;if("function"!==u)throw Error("options.stylize should be a function, got a ".concat(u,"!"));l=e.stylize}if(null!==this.line){if(n||"string"!=typeof a[0]||o.push(l("".concat(this.line-1," ").concat(a[0]),"grey")),"string"==typeof a[1]){var c="".concat(this.line," ");a[1]&&(c+=a[1].slice(0,this.column)+l(l(l(a[1].substr(this.column,1),"bold")+a[1].slice(this.column+1),"red"),"inverse")),o.push(c)}n||"string"!=typeof a[2]||o.push(l("".concat(this.line+1," ").concat(a[2]),"grey")),o="".concat(o.join("\n")+l("","reset"),"\n")}return s+=l("".concat(i,": ").concat(this.message),r),this.filename&&(s+=l(" in ",r)+this.filename),this.line&&(s+=l(" on line ".concat(this.line,", column ").concat(this.column+1,":"),"grey")),s+="\n".concat(o),this.callLine&&(s+="".concat(l("from ",r)+(this.filename||""),"/n"),s+="".concat(l(this.callLine,"grey")," ").concat(this.callExtract,"/n")),s};var L={visitDeeper:!0},j=!1;function D(e){return e}var N=function(){function e(e){this._implementation=e,this._visitInCache={},this._visitOutCache={},j||(!function e(t,n){var i,r;for(i in t)switch(typeof(r=t[i])){case"function":r.prototype&&r.prototype.type&&(r.prototype.typeIndex=n++);break;case"object":n=e(r,n)}return n}(Ke,1),j=!0)}return e.prototype.visit=function(e){if(!e)return e;var t=e.typeIndex;if(!t)return e.value&&e.value.typeIndex&&this.visit(e.value),e;var n,i=this._implementation,r=this._visitInCache[t],s=this._visitOutCache[t],a=L;if(a.visitDeeper=!0,r||(r=i[n="visit".concat(e.type)]||D,s=i["".concat(n,"Out")]||D,this._visitInCache[t]=r,this._visitOutCache[t]=s),r!==D){var o=r.call(i,e,a);e&&i.isReplacing&&(e=o)}if(a.visitDeeper&&e)if(e.length)for(var l=0,u=e.length;ly.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},B.Eval.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===w?G:z)(e)},B.Eval.prototype.rewritePath=function(e,t){var n;return t=t||"",n=this.normalizePath(t+e),G(e)&&z(t)&&!1===G(n)&&(n="./".concat(n)),n},B.Eval.prototype.normalizePath=function(e){var t,n=e.split("/").reverse();for(e=[];0!==n.length;)switch(t=n.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")};var W=function(){function e(e){this.imports=[],this.variableImports=[],this._onSequencerEmpty=e,this._currentDepth=0}return e.prototype.addImport=function(e){var t=this,n={callback:e,args:null,isReady:!1};return this.imports.push(n),function(){n.args=Array.prototype.slice.call(arguments,0),n.isReady=!0,t.tryRun()}},e.prototype.addVariableImport=function(e){this.variableImports.push(e)},e.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),J=function(e,t){this._visitor=new N(this),this._importer=e,this._finish=t,this.context=new B.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new W(this._onSequencerEmpty.bind(this))};J.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var n=e.options.inline;if(!e.css||n){var i=new B.Eval(this.context,A(this.context.frames)),r=i.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,i,r)):this.processImportNode(e,i,r)}t.visitDeeper=!1},processImportNode:function(e,t,n){var i,r=e.options.inline;try{i=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!i||i.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{i.options.multiple&&(t.importMultiple=!0);for(var s=void 0===i.css,a=0;a=0||(o=[u.selfSelectors[0]],(s=f.findMatch(l,o)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();a=f.extendSelector(s,o,e,l.isVisible()),(c=new Ke.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=a,a[a.length-1].extendList=[c],h.push(c),c.ruleset=u.ruleset,c.parent_ids=c.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(c.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(a))}))));if(h.length){if(this.extendChainCount++,n>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=h[0].selfSelectors[0].toCSS(),v=h[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:".concat(p,":extend(").concat(v,")")}}return h.concat(f.doExtendChaining(h,t,n+1))}return h},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var n,i,r,s,a=this.allExtendsStack[this.allExtendsStack.length-1],o=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==a?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&c>0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),c=0,u++),l=s.elements.slice(c,o.index).concat([a]).concat(n.elements.slice(1)),u===o.pathIndex&&r>0?h[h.length-1].elements=h[h.length-1].elements.concat(l):(h=h.concat(t.slice(u,o.pathIndex))).push(new Ke.Selector(l)),u=o.endPathIndex,(c=o.endPathElementIndex)>=t[u].elements.length&&(c=0,u++);return u0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),u++),h=(h=h.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return i?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.visitMedia=function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),Z=function(){function e(){this.contexts=[[]],this._visitor=new N(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var n,i=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((n=e.selectors)&&(n=n.filter((function(e){return e.getIsOutput()})),e.selectors=n.length?n:n=null,n&&e.joinSelectors(r,i,n)),n||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var n=this.contexts[this.contexts.length-1];e.rules[0].root=0===n.length||n[0].multiMedia},e.prototype.visitAtRule=function(e,t){var n=this.contexts[this.contexts.length-1];e.declarations&&e.declarations.length?e.declarations[0].root=0===n.length||n[0].multiMedia:e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===n.length||null)},e}(),X=function(){function e(e){this._visitor=new N(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var n=0;n0},e.prototype.resolveVisibility=function(e){if(!e.blocksVisibility()){if(this.isEmpty(e))return;return e}var t=e.rules[0];if(this.keepOnlyVisibleChilds(t),!this.isEmpty(t))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),Y=function(e){this._visitor=new N(this),this._context=e,this.utils=new X(e)};Y.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var n=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,n)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var n=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,n)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var n=new Ke.Comment("/* ".concat(e.toCSS(this._context).replace(/\n/g,"")," */\n"));return n.debugInfo=e.debugInfo,this._visitor.visit(n)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var n=0;n0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),i.splice(0,0,e)),1===i.length?i[0]:i},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new Ke.Combinator("")),t=0;t=0;i--)if((n=e[i])instanceof Ke.Declaration)if(r[n.name]){(t=r[n.name])instanceof Ke.Declaration&&(t=r[n.name]=[r[n.name].toCSS(this._context)]);var s=n.toCSS(this._context);-1!==t.indexOf(s)?e.splice(i,1):t.push(s)}else r[n.name]=n}},_mergeRules:function(e){if(e){for(var t={},n=[],i=0;i0){var t=e[0],n=[],i=[new Ke.Expression(n)];e.forEach((function(e){"+"===e.merge&&n.length>0&&i.push(new Ke.Expression(n=[])),n.push(e.value),t.important=t.important||e.important})),t.value=new Ke.Value(i)}}))}}};var ee={Visitor:N,ImportVisitor:J,MarkVisibleSelectorsVisitor:K,ExtendVisitor:Q,JoinSelectorVisitor:Z,ToCSSVisitor:Y};var te=function(){var e,t,n,i,r,s,a,o=[],l={};function u(n){for(var i,o,c,h=l.i,f=t,p=l.i-a,v=l.i+s.length-p,d=l.i+=n,m=e;l.i=0){c={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=c.text.length-1,l.commentStore.push(c);continue}}break}if(32!==i&&10!==i&&9!==i&&13!==i)break}if(s=s.slice(n+l.i-d+p),a=l.i,!s.length){if(tn||l.i===n&&e&&!i)&&(n=l.i,i=e);var r=o.pop();s=r.current,a=l.i=r.i,t=r.j},l.forget=function(){o.pop()},l.isWhitespace=function(t){var n=l.i+(t||0),i=e.charCodeAt(n);return 32===i||13===i||9===i||10===i},l.$re=function(e){l.i>a&&(s=s.slice(l.i-a),a=l.i);var t=e.exec(s);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$peekChar=function(t){return e.charAt(l.i)!==t?null:t},l.$str=function(t){for(var n=t.length,i=0;ih&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var n=0;n57||t<43||47===t||44===t},l.start=function(i,o,c){e=i,l.i=t=a=n=0,r=o?function(e,t){var n,i,r,s,a,o,l,u,c,h=e.length,f=0,p=0,v=[],d=0;function m(t){var n=a-d;n<512&&!t||!n||(v.push(e.slice(d,a+1)),d=a+1)}for(a=0;a=97&&l<=122||l<34))switch(l){case 40:p++,i=a;continue;case 41:if(--p<0)return t("missing opening `(`",a);continue;case 59:p||m();continue;case 123:f++,n=a;continue;case 125:if(--f<0)return t("missing opening `{`",a);f||p||m();continue;case 92:if(a96)){if(u==l){c=1;break}if(92==u){if(a==h-1)return t("unescaped `\\`",a);a++}}if(c)continue;return t("unmatched `".concat(String.fromCharCode(l),"`"),o);case 47:if(p||a==h-1)continue;if(47==(u=e.charCodeAt(a+1)))for(a+=2;an&&s>r?"missing closing `}` or `*/`":"missing closing `}`",n):0!==p?t("missing closing `)`",i):(m(!0),v)}(i,c):[i],s=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l};var ne=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(n){t.add(n,e[n])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),ie={queryInParens:!0},re={queryInParens:!0},se=function(e,t,n,i,r,s){this.value=e,this._index=t,this._fileInfo=n,this.mapLines=i,this.rulesetLike=void 0!==r&&r,this.allowRoot=!0,this.copyVisibilityInfo(s)};se.prototype=Object.assign(new u,{type:"Anonymous",eval:function(){return new se(this.value,this._index,this._fileInfo,this.mapLines,this.rulesetLike,this.visibilityInfo())},compare:function(e){return e.toCSS&&this.toCSS()===e.toCSS()?0:void 0},isRulesetLike:function(){return this.rulesetLike},genCSS:function(e,t){this.nodeVisible=Boolean(this.value),this.nodeVisible&&t.add(this.value,this._fileInfo,this._index,this.mapLines)}});var ae=function e(t,n,i,s){var a;s=s||0;var o=te();function l(e,t){throw new F({index:o.i,filename:i.filename,type:t||"Syntax",message:e},n)}function u(e,s,a){t.quiet||r.warn(new F({index:null!=s?s:o.i,filename:i.filename,type:a?"".concat(a.toUpperCase()," WARNING"):"WARNING",message:e},n).toString())}function c(e,t){var n=e instanceof Function?e.call(a):o.$re(e);if(n)return n;l(t||("string"==typeof e?"expected '".concat(e,"' got '").concat(o.currentChar(),"'"):"unexpected token"))}function h(e,t){if(o.$char(e))return e;l(t||"expected '".concat(e,"' got '").concat(o.currentChar(),"'"))}function f(e){var t=i.filename;return{lineNumber:k(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:n,fileInfo:i,parseNode:function(e,t,r){var l,u=[],c=o;try{c.start(e,!1,(function(e,t){r({message:e,index:t+s})}));for(var h=0,f=void 0;f=t[h];h++)l=a[f](),u.push(l||null);c.end().isFinished?r(null,u):r(!0,null)}catch(e){throw new F({index:e.index+s,message:e.message},n,i.filename)}},parse:function(r,s,u){var c,h,f,p,v=null,d="";if(u&&u.disablePluginRule&&(a.plugin=function(){o.$re(/^@plugin?\s+/)&&l("@plugin statements are not allowed when disablePluginRule is set to true")}),h=u&&u.globalVars?"".concat(e.serializeVars(u.globalVars),"\n"):"",f=u&&u.modifyVars?"\n".concat(e.serializeVars(u.modifyVars)):"",t.pluginManager)for(var m=t.pluginManager.getPreProcessors(),g=0;g");return e},args:function(e){var t,n,i,r,s,u,c,h=a.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=a.detachedRuleset()||a.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=h.variable()||h.property()||h.literal()||h.keyword()||this.call(!0)}if(!u||!m)break;r=null,u.throwAwayComments&&u.throwAwayComments(),s=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof Ke.Variable||g instanceof Ke.Property))if(o.$char(":")){if(p.length>0&&(t&&l("Cannot mix ; and , as delimiter types"),n=!0),!(s=a.detachedRuleset()||a.expression())){if(!e)return o.restore(),f.args=[],f;l("could not understand value for named argument")}r=i=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}c=!0}else e||(i=r=g.name,s=null);s&&p.push(s),d.push({name:r,value:s,expand:c}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(n&&l("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(s=new Ke.Value(p)),v.push({name:i,value:s,expand:c}),i=null,p=[],n=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,n,i,r=[],s=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var l=this.args(!1);if(r=l.args,s=l.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(i=c(a.conditions,"expected condition")),n=a.block())return o.forget(),new Ke.mixin.Definition(e,r,n,i,s);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e=c(a.entities.variable,"Could not parse alpha"),e="@{".concat(e.name.slice(1),"}")),h(")"),new Ke.Quoted("","alpha(opacity=".concat(e,")"))},element:function(){var e,t,n,r=o.i;if(t=this.combinator(),!(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[.#:](?=@)/)||this.entities.variableCurly()))if(o.save(),o.$char("("))if(n=this.selector(!1)){for(var a=[];o.$char(",");)a.push(n),a.push(new se(",")),n=this.selector(!1);a.push(n),o.$char(")")?(e=a.length>1?new Ke.Paren(new oe(a)):new Ke.Paren(n),o.forget()):o.restore("Missing closing ')'")}else o.restore("Missing closing ')'");else o.forget();if(e)return new Ke.Element(t,e,e instanceof Ke.Variable,r+s,i)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new Ke.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new Ke.Combinator(e)}return o.isWhitespace(-1)?new Ke.Combinator(" "):new Ke.Combinator(null)},selector:function(e){var t,n,r,a,u,h,f,p=o.i;for(e=!1!==e;(e&&(n=this.extend())||e&&(h=o.$str("when"))||(a=this.element()))&&(h?f=c(this.conditions,"expected condition"):f?l("CSS guard can only be used at the end of selector"):n?u=u?u.concat(n):n:(u&&l("Extend can only be used at the end of selector"),r=o.currentChar(),Array.isArray(a)&&a.forEach((function(e){return t.push(e)})),t?t.push(a):t=[a],a=null),"{"!==r&&"}"!==r&&";"!==r&&","!==r&&")"!==r););if(t)return new Ke.Selector(t,u,f,p+s,i);u&&l("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&l("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,n,i,r=this.entities;return(e=r.variableCurly())||(e=c(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(n=o.$re(/^[|~*$^]?=/))&&(t=r.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||r.variableCurly())&&(i=o.$re(/^[iIsS]/)),h("]"),new Ke.Attribute(e,n,t,i)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new Ke.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,n;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,n=e.variadic,o.$char(")"))){var i=this.blockRuleset();if(i)return o.forget(),t?new Ke.mixin.Definition(null,t,i,null,n):new Ke.DetachedRuleset(i);o.restore()}else o.restore()},ruleset:function(){var e,n,i;if(o.save(),t.dumpLineNumbers&&(i=f(o.i)),(e=this.selectors())&&(n=this.block())){o.forget();var r=new Ke.Ruleset(e,n,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=i),r}o.restore()},declaration:function(){var e,t,n,r,a,l,u=o.i,c=o.currentChar();if("."!==c&&"#"!==c&&"&"!==c&&":"!==c)if(o.save(),e=this.variable()||this.ruleProperty()){if((l="string"==typeof e)&&(t=this.detachedRuleset())&&(n=!0),o.commentStore.length=0,!t){if(a=!l&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?o.$char(";")?new se(""):this.permissiveValue(/[;}]/,!0):this.anonymousValue())return o.forget(),new Ke.Declaration(e,t,!1,a,u+s,i);t||(t=this.value()),t?r=this.important():l&&(t=this.permissiveValue())}if(t&&(this.end()||n))return o.forget(),new Ke.Declaration(e,t,r,a,u+s,i);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@$+/'"*`(;{}-]*);/);if(t)return new Ke.Anonymous(t[1],e+s)},permissiveValue:function(e){var t,n,r,s,a=e||";",c=o.i,h=[];function f(){var e=o.currentChar();return"string"==typeof a?e===a:a.test(e)}if(!f()){s=[];do{(n=this.comment())?s.push(n):((n=this.entity())&&s.push(n),o.peek(",")&&(s.push(new Ke.Anonymous(",",o.i)),o.$char(",")))}while(n);if(r=f(),s.length>0){if(s=new Ke.Expression(s),r)return s;h.push(s)," "===o.prevChar()&&h.push(new Ke.Anonymous(" ",c))}if(o.save(),s=o.$parseUntil(a)){if("string"==typeof s&&l("Expected '".concat(s,"'"),"Parse"),1===s.length&&" "===s[0])return o.forget(),new Ke.Anonymous("",c);var p=void 0;for(t=0;t]=|<=|>=|[<>]|=)/)?(o.restore(),n=this.condition(),o.save(),(r=this.atomicCondition(null,n.rvalue))||o.restore()):(o.restore(),t=this.value()),o.$char(")")?n&&!t?(u.push(new Ke.Paren(new Ke.QueryInParens(n.op,n.lvalue,n.rvalue,r?r.op:null,r?r.rvalue:null,n._index))),t=n):n&&t?(u.push(new Ke.Paren(new Ke.Declaration(n,t,null,null,o.i+s,i,!0))),c||(u[u.length-1].noSpacing=!0),c=!1):t?(u.push(new Ke.Paren(t)),c=!1):l("badly formed media feature definition"):l("Missing closing ')'","Parse"))}while(t);if(o.forget(),u.length>0)return new Ke.Expression(u)},mediaFeatures:function(e){var t,n=this.entities,i=[];do{if(t=this.mediaFeature(e)){if(i.push(t),!o.$char(","))break;i[i.length-1].noSpacing||(i[i.length-1].noSpacing=!1)}else if(t=n.variable()||n.mixinLookup()){if(i.push(t),!o.$char(","))break;i[i.length-1].noSpacing||(i[i.length-1].noSpacing=!1)}}while(t);return i.length>0?i:null},prepareAndGetNestableAtRule:function(e,n,r,a){var u=this.mediaFeatures(a),c=this.block();c||l("media definitions require block statements after any features"),o.forget();var h=new e(c,u,n+s,i);return t.dumpLineNumbers&&(h.debugInfo=r),h},nestableAtRule:function(){var e,n=o.i;if(t.dumpLineNumbers&&(e=f(n)),o.save(),o.$peekChar("@")){if(o.$str("@media"))return this.prepareAndGetNestableAtRule(Ke.Media,n,e,ie);if(o.$str("@container"))return this.prepareAndGetNestableAtRule(Ke.Container,n,e,re)}o.restore()},plugin:function(){var e,t,n,r=o.i;if(o.$re(/^@plugin\s+/)){if(n=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=r,l("missing semi-colon on @plugin")),new Ke.Import(e,null,n,r+s,i);o.i=r,l("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atruleUnknown:function(e,t,n){return e=this.permissiveValue(/^[{;]/),n="{"===o.currentChar(),e?e.value||(e=null):n||";"===o.currentChar()||l("".concat(t," rule is missing block or ending semi-colon")),[e,n]},atruleBlock:function(e,t,n,i){if(e=this.blockRuleset(),o.save(),e||n||(t=this.entity(),e=this.blockRuleset()),e||n)o.forget();else{o.restore();var r=[];for(t=this.entity();o.$char(",");)r.push(t),t=this.entity();t&&r.length>0?(r.push(t),t=r,i=!0):e=this.blockRuleset()}return[e,t,i]},atrule:function(){var e,n,r,a,u,c,h,p=o.i,v=!0,d=!0,m=!1;if("@"===o.currentChar()){if(n=this.import()||this.plugin()||this.nestableAtRule())return n;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(a=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(a="@".concat(e.slice(e.indexOf("-",2)+1))),a){case"@charset":u=!0,v=!1;break;case"@namespace":c=!0,v=!1;break;case"@keyframes":case"@counter-style":u=!0;break;case"@document":case"@supports":h=!0,d=!1;break;case"@starting-style":case"@layer":d=!1;break;default:h=!0}if(o.commentStore.length=0,u)(n=this.entity())||l("expected ".concat(e," identifier"));else if(c)(n=this.expression())||l("expected ".concat(e," expression"));else if(h){n=(g=this.atruleUnknown(n,e,v))[0],v=g[1]}if(v){var g,y=this.atruleBlock(r,n,d,m);if(r=y[0],n=y[1],m=y[2],!r&&!h)o.restore(),e=o.$re(/^@[a-z-]+/),n=(g=this.atruleUnknown(n,e,v))[0],(v=g[1])&&(r=(y=this.atruleBlock(r,n,d,m))[0],n=y[1],m=y[2])}if(r||m||!v&&n&&o.$char(";"))return o.forget(),new Ke.AtRule(e,n,r,p+s,i,t.dumpLineNumbers?f(p):null,d);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],n=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new Ke.Value(t,n+s)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new Ke.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},colorOperand:function(){o.save();var e=o.$re(/^[lchrgbs]\s+/);if(e)return new Ke.Keyword(e[0]);o.restore()},multiplication:function(){var e,t,n,i,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*/]/);){if(o.save(),!(n=o.$char("/")||o.$char("*"))){var s=o.i;(n=o.$str("./"))&&u("./ operator is deprecated",s,"DEPRECATED")}if(!n){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,i=new Ke.Operation(n,[i||e,t],r),r=o.isWhitespace(-1)}return i||e}},addition:function(){var e,t,n,i,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(n=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,i=new Ke.Operation(n,[i||e,t],r),r=o.isWhitespace(-1);return i||e}},conditions:function(){var e,t,n,i=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)n=new Ke.Condition("or",n||e,t,i+s);return n||e}},condition:function(e){var t,n,i;if(t=this.conditionAnd(e)){if(n=o.$str("or")){if(!(i=this.condition(e)))return;t=new Ke.Condition(n,t,i)}return t}},conditionAnd:function(e){var t,n,i,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(n=o.$str("and")){if(!(i=this.conditionAnd(e)))return;t=new Ke.Condition(n,t,i)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var n;if(o.save(),n=t.condition(e)){if(o.$char(")"))return o.forget(),n;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '".concat(o.currentChar(),"'"))}else o.restore()}else o.restore()},atomicCondition:function(e,t){var n,i,r,a,u=this.entities,c=o.i,h=function(){return this.addition()||u.keyword()||u.quoted()||u.mixinLookup()}.bind(this);if(n=t||h())return o.$char(">")?a=o.$char("=")?">=":">":o.$char("<")?a=o.$char("=")?"<=":"<":o.$char("=")&&(a=o.$char(">")?"=>":o.$char("<")?"=<":"="),a?(i=h())?r=new Ke.Condition(a,n,i,c+s,!1):l("expected expression"):t||(r=new Ke.Condition("=",n,new Ke.Keyword("true"),c+s,!1)),r},operand:function(){var e,t=this.entities;o.peek(/^-[@$(]/)&&(e=o.$char("-"));var n=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||this.colorOperand()||t.mixinLookup();return e&&(n.parensInOp=!0,n=new Ke.Negative(n)),n},expression:function(){var e,t,n=[],i=o.i;do{!(e=this.comment())||e.isLineComment?((e=this.addition()||this.entity())instanceof Ke.Comment&&(e=null),e&&(n.push(e),o.peek(/^\/[/*]/)||(t=o.$char("/"))&&n.push(new Ke.Anonymous(t,i+s)))):n.push(e)}while(e);if(n.length>0)return new Ke.Expression(n)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,n=[],r=[];o.save();var a=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(a)return n=[new Ke.Keyword(a[1])],o.forget(),n;function l(e){var t=o.i,i=o.$re(e);if(i)return r.push(t),n.push(i[1])}for(l(/^(\*?)/);l(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/););if(n.length>1&&l(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===n[0]&&(n.shift(),r.shift()),t=0;t0;e--){var t=this.rules[e-1];if(t instanceof he)return this.parseValue(t)}},parseValue:function(e){var t=this;function n(e){return e.value instanceof se&&!e.parsed?("string"==typeof e.value.value?new ae(this.parse.context,this.parse.importManager,e.fileInfo(),e.value.getIndex()).parseNode(e.value.value,["value","important"],(function(t,n){t&&(e.parsed=!0),n&&(e.value=n[0],e.important=n[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var i=[];return e.forEach((function(e){i.push(n.call(t,e))})),i}return n.call(t,e)},rulesets:function(){if(!this.rules)return[];var e,t,n=[],i=this.rules;for(e=0;t=i[e];e++)t.isRuleset&&n.push(t);return n},prependRule:function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},find:function(e,t,n){t=t||this;var i,r,s=[],a=e.toCSS();return a in this._lookups?this._lookups[a]:(this.rulesets().forEach((function(a){if(a!==t)for(var o=0;oi){if(!n||n(a)){r=a.find(new oe(e.elements.slice(i)),t,n);for(var l=0;l0&&t.add(l),e.firstSelector=!0,a[0].genCSS(e,t),e.firstSelector=!1,i=1;i0?(s=(r=A(e)).pop(),a=i.createDerived(A(s.elements))):a=i.createDerived([]),t.length>0){var o=n.combinator,l=t[0].elements[0];o.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(o=l.combinator),a.elements.push(new g(o,l.value,n.isVariable,n._index,n._fileInfo)),a.elements=a.elements.concat(t[0].elements.slice(1))}if(0!==a.elements.length&&r.push(a),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function a(e,t,n,i,r){var a;for(a=0;a0?i[i.length-1]=i[i.length-1].createDerived(i[i.length-1].elements.concat(e)):i.push(new oe(e));else t.push([new oe(e)])}function l(e,t){var n=t.createDerived(t.elements,t.extendList,t.evaldCondition);return n.copyVisibilityInfo(e),n}var u,c;if(!function e(t,n,l){var u,c,h,f,p,d,m,y,b,w,x,S,I=!1;for(f=[],p=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof v&&(S=x.value.value)instanceof oe?S:null);if(null!==C){o(f,p);var k,A=[],_=[];for(k=e(A,n,C),I=I||k,h=0;h0&&m[0].elements.push(new g(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(m);else for(h=0;h0&&(t.push(p[u]),w=p[u][b-1],p[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(c=[],t,n))if(t.length>0)for(c=[],u=0;u0)for(t=0;t-1e-6&&(i=n.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===n&&this.unit.isLength())return void t.add(i);n>0&&n<1&&(i=i.substr(1))}t.add(i),this.unit.genCSS(e,t)},operate:function(e,t,n){var i=this._operate(e,t,this.value,n.value),r=this.unit.clone();if("+"===t||"-"===t)if(0===r.numerator.length&&0===r.denominator.length)r=n.unit.clone(),this.unit.backupUnit&&(r.backupUnit=this.unit.backupUnit);else if(0===n.unit.numerator.length&&0===r.denominator.length);else{if(n=n.convertTo(this.unit.usedUnits()),e.strictUnits&&n.unit.toString()!==r.toString())throw new Error("Incompatible units. Change the units or use the unit function. "+"Bad units: '".concat(r.toString(),"' and '").concat(n.unit.toString(),"'."));i=this._operate(e,t,this.value,n.value)}else"*"===t?(r.numerator=r.numerator.concat(n.unit.numerator).sort(),r.denominator=r.denominator.concat(n.unit.denominator).sort(),r.cancel()):"/"===t&&(r.numerator=r.numerator.concat(n.unit.denominator).sort(),r.denominator=r.denominator.concat(n.unit.numerator).sort(),r.cancel());return new be(i,r)},compare:function(e){var t,n;if(e instanceof be){if(this.unit.isEmpty()||e.unit.isEmpty())t=this,n=e;else if(t=this.unify(),n=e.unify(),0!==t.unit.compare(n.unit))return;return u.numericCompare(t.value,n.value)}},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(e){var t,n,i,r,s,a=this.value,l=this.unit.clone(),u={};if("string"==typeof e){for(t in o)o[t].hasOwnProperty(e)&&((u={})[t]=e);e=u}for(n in s=function(e,t){return i.hasOwnProperty(e)?(t?a/=i[e]/i[r]:a*=i[e]/i[r],r):e},e)e.hasOwnProperty(n)&&(r=e[n],i=o[n],l.map(s));return l.cancel(),new be(a,l)}});var we=function(e,t){if(this.value=e,this.noSpacing=t,!e)throw new Error("Expression requires an array parameter")};we.prototype=Object.assign(new u,{type:"Expression",accept:function(e){this.value=e.visitArray(this.value)},eval:function(e){var t,n=this.noSpacing,i=e.isMathOn(),r=this.parens,s=!1;return r&&e.inParenthesis(),this.value.length>1?t=new we(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(s=!0),t=this.value[0].eval(e)):t=this,r&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||s||t instanceof be||(t=new v(t)),t.noSpacing=t.noSpacing||n,t},genCSS:function(e,t){for(var n=0;n1){var n=new oe([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new ge(n,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},evalNested:function(e){var t,n;this.evalFunction();var i=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new se("and"));return new we(e)}))),this.setParent(this.features,this),new ge([],[])},permute:function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],n=this.permute(e.slice(1)),i=0;i0)for(var o=function(t){var o=e.frames[t];if("Ruleset"===o.type&&o.rules&&o.rules.length>0&&o&&!o.root&&o.selectors&&o.selectors.length>0&&(a=a.concat(o.selectors)),a.length>0){for(var l="",u={add:function(e){l+=e}},c=0;c0&&i>0&&!s&&!r;return(this.isRooted&&n>0&&0===i&&!s&&r||!u)&&(t[0].root=!0),t},variable:function(e){if(this.rules)return ge.prototype.variable.call(this.rules[0],e)},find:function(){if(this.rules)return ge.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){if(this.rules)return ge.prototype.rulesets.apply(this.rules[0])},outputRuleset:function(e,t,n){var i,r=n.length;if(e.tabLevel=1+(0|e.tabLevel),e.compress){for(t.add("{"),i=0;i=1)if("Expression"===(o=r[0]).type&&Array.isArray(o.value)&&o.value.length>=2)"Keyword"===(r=o.value)[0].type&&"layer"===r[0].value&&"Paren"===r[1].type&&(this.css=!1)}if(this.options.inline){var s=new se(this.root,0,{filename:this.importedFilename,reference:this.path._fileInfo&&this.path._fileInfo.reference},!0,!0);return this.features?new $e([s],this.features.value):[s]}if(this.css||this.layerCss){var a=new Fe(this.evalPath(e),i,this.options,this._index);if(this.layerCss&&(a.css=this.layerCss,a.path._fileInfo=this._fileInfo),!a.css&&this.error)throw this.error;return a}if(this.root){if(this.features){var o;r=this.features.value;if(Array.isArray(r)&&1===r.length)if("Expression"===(o=r[0]).type&&Array.isArray(o.value)&&o.value.length>=2)if("Keyword"===(r=o.value)[0].type&&"layer"===r[0].value&&"Paren"===r[1].type)return this.layerCss=!0,r[0]=new we(r.slice(0,2)),r.splice(1,1),r[0].noSpacing=!0,this}return(t=new ge(null,A(this.root.rules))).evalImports(e),this.features?new $e(t.rules,this.features.value):t.rules}if(this.features){r=this.features.value;if(Array.isArray(r)&&r.length>=1)if(r=r[0].value,Array.isArray(r)&&r.length>=2)if("Keyword"===r[0].type&&"layer"===r[0].value&&"Paren"===r[1].type)return this.css=!0,r[0]=new we(r.slice(0,2)),r.splice(1,1),r[0].noSpacing=!0,this}return[]}});var Ve=function(){};Ve.prototype=Object.assign(new u,{evaluateJavaScript:function(e,t){var n,i=this,r={};if(!t.javascriptEnabled)throw{message:"Inline JavaScript is not enabled. Is it set in your options?",filename:this.fileInfo().filename,index:this.getIndex()};e=e.replace(/@\{([\w-]+)\}/g,(function(e,n){return i.jsify(new Pe("@".concat(n),i.getIndex(),i.fileInfo()).eval(t))}));try{e=new Function("return (".concat(e,")"))}catch(t){throw{message:"JavaScript evaluation error: ".concat(t.message," from `").concat(e,"`"),filename:this.fileInfo().filename,index:this.getIndex()}}var s=t.frames[0].variables();for(var a in s)s.hasOwnProperty(a)&&(r[a.slice(1)]={value:s[a].value,toJS:function(){return this.value.eval(t).toCSS()}});try{n=e.call(r)}catch(e){throw{message:"JavaScript evaluation error: '".concat(e.name,": ").concat(e.message.replace(/["]/g,"'"),"'"),filename:this.fileInfo().filename,index:this.getIndex()}}return n},jsify:function(e){return Array.isArray(e.value)&&e.value.length>1?"[".concat(e.value.map((function(e){return e.toCSS()})).join(", "),"]"):e.toCSS()}});var Le=function(e,t,n,i){this.escaped=t,this.expression=e,this._index=n,this._fileInfo=i};Le.prototype=Object.assign(new Ve,{type:"JavaScript",eval:function(e){var t=this.evaluateJavaScript(this.expression,e),n=typeof t;return"number"!==n||isNaN(t)?"string"===n?new Me('"'.concat(t,'"'),t,this.escaped,this._index):Array.isArray(t)?new se(t.join(", ")):new se(t):new be(t)}});var je=function(e,t){this.key=e,this.value=t};je.prototype=Object.assign(new u,{type:"Assignment",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval?new je(this.key,this.value.eval(e)):this},genCSS:function(e,t){t.add("".concat(this.key,"=")),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)}});var De=function(e,t,n,i,r){this.op=e.trim(),this.lvalue=t,this.rvalue=n,this._index=i,this.negate=r};De.prototype=Object.assign(new u,{type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=function(e,t,n){switch(e){case"and":return t&&n;case"or":return t||n;default:switch(u.compare(t,n)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t}});var Ne=function(e,t,n,i,r,s){this.op=e.trim(),this.lvalue=t,this.mvalue=n,this.op2=i?i.trim():null,this.rvalue=r,this._index=s,this.mvalues=[]};Ne.prototype=Object.assign(new u,{type:"QueryInParens",accept:function(e){this.lvalue=e.visit(this.lvalue),this.mvalue=e.visit(this.mvalue),this.rvalue&&(this.rvalue=e.visit(this.rvalue))},eval:function(e){var t,n;this.lvalue=this.lvalue.eval(e);for(var i=0;(n=e.frames[i])&&("Ruleset"!==n.type||!(t=n.rules.find((function(e){return!!(e instanceof he&&e.variable)}))));i++);return this.mvalueCopy||(this.mvalueCopy=C(this.mvalue)),t?(this.mvalue=this.mvalueCopy,this.mvalue=this.mvalue.eval(e),this.mvalues.push(this.mvalue)):this.mvalue=this.mvalue.eval(e),this.rvalue&&(this.rvalue=this.rvalue.eval(e)),this},genCSS:function(e,t){this.lvalue.genCSS(e,t),t.add(" "+this.op+" "),this.mvalues.length>0&&(this.mvalue=this.mvalues.shift()),this.mvalue.genCSS(e,t),this.rvalue&&(t.add(" "+this.op2+" "),this.rvalue.genCSS(e,t))}});var Be=function(e,t,n,i,r){this._index=n,this._fileInfo=i;var s=new oe([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new le(t),this.rules=[new ge(s,e)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(r),this.allowRoot=!0,this.setParent(s,this),this.setParent(this.features,this),this.setParent(this.rules,this)};Be.prototype=Object.assign(new Se,p(p({type:"Container"},xe),{genCSS:function(e,t){t.add("@container ",this._fileInfo,this._index),this.features.genCSS(e,t),this.outputRuleset(e,t,this.rules)},eval:function(e){e.mediaBlocks||(e.mediaBlocks=[],e.mediaPath=[]);var t=new Be(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,t.debugInfo=this.debugInfo),t.features=this.features.eval(e),e.mediaPath.push(t),e.mediaBlocks.push(t),this.rules[0].functionRegistry=e.frames[0].functionRegistry.inherit(),e.frames.unshift(this.rules[0]),t.rules=[this.rules[0].eval(e)],e.frames.shift(),e.mediaPath.pop(),0===e.mediaPath.length?t.evalTop(e):t.evalNested(e)}}));var Ue=function(e){this.value=e};Ue.prototype=Object.assign(new u,{type:"UnicodeDescriptor"});var qe=function(e){this.value=e};qe.prototype=Object.assign(new u,{type:"Negative",genCSS:function(e,t){t.add("-"),this.value.genCSS(e,t)},eval:function(e){return e.isMathOn()?new ke("*",[new be(-1),this.value]).eval(e):new qe(this.value.eval(e))}});var Te=function(e,t,n,i,r){switch(this.selector=e,this.option=t,this.object_id=Te.next_id++,this.parent_ids=[this.object_id],this._index=n,this._fileInfo=i,this.copyVisibilityInfo(r),this.allowRoot=!0,t){case"!all":case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}this.setParent(this.selector,this)};Te.prototype=Object.assign(new u,{type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(e){return new Te(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},clone:function(e){return new Te(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},findSelfSelectors:function(e){var t,n,i=[];for(t=0;t0&&n.length&&""===n[0].combinator.value&&(n[0].combinator.value=" "),i=i.concat(e[t].elements);this.selfSelectors=[new oe(i)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())}}),Te.next_id=0;var ze=function(e,t,n){this.variable=e,this._index=t,this._fileInfo=n,this.allowRoot=!0};ze.prototype=Object.assign(new u,{type:"VariableCall",eval:function(e){var t,n=new Pe(this.variable,this.getIndex(),this.fileInfo()).eval(e),i=new F({message:"Could not evaluate variable call ".concat(this.variable)});if(!n.ruleset){if(n.rules)t=n;else if(Array.isArray(n))t=new ge("",n);else{if(!Array.isArray(n.value))throw i;t=new ge("",n.value)}n=new Ie(t)}if(n.ruleset)return n.callEval(e);throw i}});var Ge=function(e,t,n,i){this.value=e,this.lookups=t,this._index=n,this._fileInfo=i};Ge.prototype=Object.assign(new u,{type:"NamespaceValue",eval:function(e){var t,n,i=this.value.eval(e);for(t=0;tthis.params.length)return!1}n=Math.min(s,this.arity);for(var a=0;a0){for(c=!0,o=0;o0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `".concat(this.format(m),"`"),index:this.getIndex(),filename:this.fileInfo().filename};for(o=0;o0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var n,i,r,s,a=this.extractUrlParts(e),o=this.extractUrlParts(t),l="";if(a.hostPart!==o.hostPart)return"";for(i=Math.max(o.directories.length,a.directories.length),n=0;nparseInt(t[n])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",n=0;n1?e-1:e)<1?r+(s-r)*e*6:2*e<1?s:3*e<2?r+(s-r)*(2/3-e)*6:r}try{if(e instanceof c)return i=t?st(t):e.alpha,new c(e.rgb,i,"hsla");e=st(e)%360/360,t=tt(st(t)),n=tt(st(n)),i=tt(st(i)),r=2*n-(s=n<=.5?n*(t+1):n+t-n*t);var o=[255*a(e+1/3),255*a(e),255*a(e-1/3)];return i=st(i),new c(o,i,"hsla")}catch(e){}},hsv:function(e,t,n){return Ye.hsva(e,t,n,1)},hsva:function(e,t,n,i){var r,s;e=st(e)%360/360*360,t=st(t),n=st(n),i=st(i);var a=[n,n*(1-t),n*(1-(s=e/60-(r=Math.floor(e/60%6)))*t),n*(1-(1-s)*t)],o=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Ye.rgba(255*a[o[r][0]],255*a[o[r][1]],255*a[o[r][2]],i)},hue:function(e){return new be(it(e).h)},saturation:function(e){return new be(100*it(e).s,"%")},lightness:function(e){return new be(100*it(e).l,"%")},hsvhue:function(e){return new be(rt(e).h)},hsvsaturation:function(e){return new be(100*rt(e).s,"%")},hsvvalue:function(e){return new be(100*rt(e).v,"%")},red:function(e){return new be(e.rgb[0])},green:function(e){return new be(e.rgb[1])},blue:function(e){return new be(e.rgb[2])},alpha:function(e){return new be(it(e).a)},luma:function(e){return new be(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new be(t*e.alpha*100,"%")},saturate:function(e,t,n){if(!e.rgb)return null;var i=it(e);return void 0!==n&&"relative"===n.value?i.s+=i.s*t.value/100:i.s+=t.value/100,i.s=tt(i.s),nt(e,i)},desaturate:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.s-=i.s*t.value/100:i.s-=t.value/100,i.s=tt(i.s),nt(e,i)},lighten:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.l+=i.l*t.value/100:i.l+=t.value/100,i.l=tt(i.l),nt(e,i)},darken:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.l-=i.l*t.value/100:i.l-=t.value/100,i.l=tt(i.l),nt(e,i)},fadein:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.a+=i.a*t.value/100:i.a+=t.value/100,i.a=tt(i.a),nt(e,i)},fadeout:function(e,t,n){var i=it(e);return void 0!==n&&"relative"===n.value?i.a-=i.a*t.value/100:i.a-=t.value/100,i.a=tt(i.a),nt(e,i)},fade:function(e,t){var n=it(e);return n.a=t.value/100,n.a=tt(n.a),nt(e,n)},spin:function(e,t){var n=it(e),i=(n.h+t.value)%360;return n.h=i<0?360+i:i,nt(e,n)},mix:function(e,t,n){n||(n=new be(50));var i=n.value/100,r=2*i-1,s=it(e).a-it(t).a,a=((r*s==-1?r:(r+s)/(1+r*s))+1)/2,o=1-a,l=[e.rgb[0]*a+t.rgb[0]*o,e.rgb[1]*a+t.rgb[1]*o,e.rgb[2]*a+t.rgb[2]*o],u=e.alpha*i+t.alpha*(1-i);return new c(l,u)},greyscale:function(e){return Ye.desaturate(e,new be(100))},contrast:function(e,t,n,i){if(!e.rgb)return null;if(void 0===n&&(n=Ye.rgba(255,255,255,1)),void 0===t&&(t=Ye.rgba(0,0,0,1)),t.luma()>n.luma()){var r=n;n=t,t=r}return i=void 0===i?.43:st(i),e.luma().5&&(i=1,n=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*i*(n-e)},hardlight:function(e,t){return lt.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var ut in lt)lt.hasOwnProperty(ut)&&(ot[ut]=ot.bind(null,lt[ut]));var ct=function(e){return Array.isArray(e.value)?e.value:Array(e)},ht={_SELF:function(e){return e},"~":function(){for(var e=[],t=0;ta.value)&&(h[i]=r);else{if(void 0!==l&&o!==l)throw{type:"Argument",message:"incompatible types"};f[o]=h.length,h.push(r)}}return 1==h.length?h[0]:(t=h.map((function(e){return e.toCSS(c.context)})).join(this.context.compress?",":", "),new se("".concat(e?"min":"max","(").concat(t,")")))},mt={min:function(){for(var e=[],t=0;t"),r=0;r");return i+="'),i=encodeURIComponent(i),i="data:image/svg+xml,".concat(i),new Oe(new Me("'".concat(i,"'"),i,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),ne.addMultiple(wt),ne.addMultiple(St),t};function Ct(e,t){var n,i=(t=t||{}).variables,r=new B.Eval(t);"object"!=typeof i||Array.isArray(i)||(i=Object.keys(i).map((function(e){var t=i[e];return t instanceof Ke.Value||(t instanceof Ke.Expression||(t=new Ke.Expression([t])),t=new Ke.Value([t])),new Ke.Declaration("@".concat(e),t,!1,null,0)})),r.frames=[new Ke.Ruleset(null,i)]);var s,a,o=[new ee.JoinSelectorVisitor,new ee.MarkVisibleSelectorsVisitor(!0),new ee.ExtendVisitor,new ee.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){a=t.pluginManager.visitor();for(var u=0;u<2;u++)for(a.first();s=a.get();)s.isPreEvalVisitor?0!==u&&-1!==l.indexOf(s)||(l.push(s),s.run(e)):0!==u&&-1!==o.indexOf(s)||(s.isPreVisitor?o.unshift(s):o.push(s))}n=e.eval(r);for(var c=0;c=t);n++);this.preProcessors.splice(n,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var n;for(n=0;n=t);n++);this.postProcessors.splice(n,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var i=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?i=this.sourceMapURL:this._sourceMapFilename&&(i=this._sourceMapFilename),this.sourceMapURL=i,this.sourceMap=r}return this._css.join("")},t}()}(e=new s(e,t)),e)),o=function(e){return function(){function t(e,t,n){this.less=e,this.rootFilename=n.filename,this.paths=t.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=t.mime,this.error=null,this.context=t,this.queue=[],this.files={}}return t.prototype.push=function(t,n,i,s,a){var o=this,l=this.context.pluginManager.Loader;this.queue.push(t);var u=function(e,n,i){o.queue.splice(o.queue.indexOf(t),1);var l=i===o.rootFilename;s.optional&&e?(a(null,{rules:[]},!1,null),r.info("The file ".concat(i," was skipped because it was not found and the import was marked optional."))):(o.files[i]||s.inline||(o.files[i]={root:n,options:s}),e&&!o.error&&(o.error=e),a(e,n,l,i))},c={rewriteUrls:this.context.rewriteUrls,entryPath:i.entryPath,rootpath:i.rootpath,rootFilename:i.rootFilename},h=e.getFileManager(t,i.currentDirectory,this.context,e);if(h){var f,p,v=function(e){var t,n=e.filename,r=e.contents.replace(/^\uFEFF/,"");c.currentDirectory=h.getPath(n),c.rewriteUrls&&(c.rootpath=h.join(o.context.rootpath||"",h.pathDiff(c.currentDirectory,c.entryPath)),!h.isPathAbsolute(c.rootpath)&&h.alwaysMakePathsAbsolute()&&(c.rootpath=h.join(c.entryPath,c.rootpath))),c.filename=n;var a=new B.Parse(o.context);a.processImports=!1,o.contents[n]=r,(i.reference||s.reference)&&(c.reference=!0),s.isPlugin?(t=l.evalPlugin(r,a,o,s.pluginArgs,c))instanceof F?u(t,null,n):u(null,t,n):s.inline?u(null,r,n):!o.files[n]||o.files[n].options.multiple||s.multiple?new ae(a,o,c).parse(r,(function(e,t){u(e,t,n)})):u(null,o.files[n].root,n)},d=_(this.context);n&&(d.ext=s.isPlugin?".js":".less"),s.isPlugin?(d.mime="application/javascript",d.syncImport?f=l.loadPluginSync(t,i.currentDirectory,d,e,h):p=l.loadPlugin(t,i.currentDirectory,d,e,h)):d.syncImport?f=h.loadFileSync(t,i.currentDirectory,d,e):p=h.loadFile(t,i.currentDirectory,d,e,(function(e,t){e?u(e):v(t)})),f?f.filename?v(f):u(f):p&&p.then(v,u)}else u({message:"Could not find a file-manager for ".concat(t)})},t}()}(e);var u,c=function(e,t){var n=function(e,i,r){if("function"==typeof i?(r=i,i=E(this.options,{})):i=E(this.options,i||{}),!r){var s=this;return new Promise((function(t,r){n.call(s,e,i,(function(e,n){e?r(e):t(n)}))}))}this.parse(e,i,(function(e,n,i,s){if(e)return r(e);var a;try{a=new t(n,i).toCSS(s)}catch(e){return r(e)}r(null,a)}))};return n}(0,a),h=function(e,t,n){var i=function(e,t,r){if("function"==typeof t?(r=t,t=E(this.options,{})):t=E(this.options,t||{}),!r){var s=this;return new Promise((function(n,r){i.call(s,e,t,(function(e,t){e?r(e):n(t)}))}))}var a,o=void 0,l=new _t(this,!t.reUsePluginManager);if(t.pluginManager=l,a=new B.Parse(t),t.rootFileInfo)o=t.rootFileInfo;else{var u=t.filename||"input",c=u.replace(/[^/\\]*$/,"");(o={filename:u,rewriteUrls:a.rewriteUrls,rootpath:a.rootpath||"",currentDirectory:c,entryPath:c,rootFilename:u}).rootpath&&"/"!==o.rootpath.slice(-1)&&(o.rootpath+="/")}var h=new n(this,a,o);this.importManager=h,t.plugins&&t.plugins.forEach((function(e){var t,n;if(e.fileContent){if(n=e.fileContent.replace(/^\uFEFF/,""),(t=l.Loader.evalPlugin(n,a,h,e.options,e.filename))instanceof F)return r(t)}else l.addPlugin(e)})),new ae(a,h,o).parse(e,(function(e,n){if(e)return r(e);r(null,n,h,t)}),t)};return i}(0,0,o),f=Rt("v".concat("4.4.2")),p={version:[f.major,f.minor,f.patch],data:l,tree:Ke,Environment:s,AbstractFileManager:He,AbstractPluginLoader:Qe,environment:e,visitors:ee,Parser:ae,functions:It(e),contexts:B,SourceMapOutput:n,SourceMapBuilder:i,ParseTree:a,ImportManager:o,render:c,parse:h,LessError:F,transformTree:Ct,utils:O,PluginManager:_t,logger:r},v=function(e){return function(){var t=Object.create(e.prototype);return e.apply(t,Array.prototype.slice.call(arguments,0)),t}},d=Object.create(p);for(var m in p.tree)if("function"==typeof(u=p.tree[m]))d[m.toLowerCase()]=v(u);else for(var g in d[m]=Object.create(null),u)d[m][g.toLowerCase()]=v(u[g]);return p.parse=p.parse.bind(d),p.render=p.render.bind(d),d}var Ot={},$t=function(){};$t.prototype=Object.assign(new He,{alwaysMakePathsAbsolute:function(){return!0},join:function(e,t){return e?this.extractUrlParts(t,e).path:t},doXHR:function(e,t,n,i){var r=new XMLHttpRequest,s=!Pt.isFileProtocol||Pt.fileAsync;function a(t,n,i){t.status>=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof i&&i(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),Et.debug("XHR: Getting '".concat(e,"'")),r.open("GET",e,s),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),Pt.isFileProtocol&&!Pt.fileAsync?0===r.status||r.status>=200&&r.status<300?n(r.responseText):i(r.status,e):s?r.onreadystatechange=function(){4==r.readyState&&a(r,n,i)}:a(r,n,i)},supports:function(){return!0},clearFileCache:function(){Ot={}},loadFile:function(e,t,n){t&&!this.isPathAbsolute(e)&&(e=t+e),e=n.ext?this.tryAppendExtension(e,n.ext):e,n=n||{};var i=this.extractUrlParts(e,window.location.href).url,r=this;return new Promise((function(e,t){if(n.useFileCache&&Ot[i])try{var s=Ot[i];return e({contents:s,filename:i,webInfo:{lastModified:new Date}})}catch(e){return t({filename:i,message:"Error loading file ".concat(i," error was ").concat(e.message)})}r.doXHR(i,n.mime,(function(t,n){Ot[i]=t,e({contents:t,filename:i,webInfo:{lastModified:n}})}),(function(e,n){t({type:"File",message:"'".concat(n,"' wasn't found (").concat(e,")"),href:i})}))}))}});var Ft=function(e,t){return Pt=e,Et=t,$t},Vt=function(e){this.less=e};Vt.prototype=Object.assign(new Qe,{loadPlugin:function(e,t,n,i,r){return new Promise((function(s,a){r.loadFile(e,t,n,i).then(s).catch(a)}))}});var Lt=function(t,i,r){return{add:function(s,a){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var n=e.filename||t,s=[],a="".concat(e.type||"Syntax","Error: ").concat(e.message||"There is an error in your .less file"," in ").concat(n),o=function(e,t,n){void 0!==e.extract[t]&&s.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};e.line&&(o(e,0,""),o(e,1,"line"),o(e,2,""),a+=" on line ".concat(e.line,", column ").concat(e.column+1,":\n").concat(s.join("\n"))),e.stack&&(e.extract||r.logLevel>=4)&&(a+="\nStack Trace\n".concat(e.stack)),i.logger.error(a)}(s,a):"function"==typeof r.errorReporting&&r.errorReporting("add",s,a):function(i,s){var a,o,l="less-error-message:".concat(e(s||"")),u=t.document.createElement("div"),c=[],h=i.filename||s,f=h.match(/([^/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",o="

    ".concat(i.type||"Syntax","Error: ").concat(i.message||"There is an error in your .less file")+'

    in ').concat(f," ");var p=function(e,t,n){void 0!==e.extract[t]&&c.push('

  • {content}
  • '.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};i.line&&(p(i,0,""),p(i,1,"line"),p(i,2,""),o+="on line ".concat(i.line,", column ").concat(i.column+1,":

      ").concat(c.join(""),"
    ")),i.stack&&(i.extract||r.logLevel>=4)&&(o+="
    Stack Trace
    ".concat(i.stack.split("\n").slice(1).join("
    "))),u.innerHTML=o,n(t.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),u.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===r.env&&(a=setInterval((function(){var e=t.document,n=e.body;n&&(e.getElementById(l)?n.replaceChild(u,e.getElementById(l)):n.insertBefore(u,n.firstChild),clearInterval(a))}),10))}(s,a)},remove:function(n){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",n):function(n){var i=t.document.getElementById("less-error-message:".concat(e(n)));i&&i.parentNode.removeChild(i)}(n)}}},jt={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:1,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var Dt in window.less)Object.prototype.hasOwnProperty.call(window.less,Dt)&&(jt[Dt]=window.less[Dt]);!function(e,n){t(n,i(e)),void 0===n.isFileProtocol&&(n.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),n.async=n.async||!1,n.fileAsync=n.fileAsync||!1,n.poll=n.poll||(n.isFileProtocol?1e3:1500),n.env=n.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||n.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(n.dumpLineNumbers=r[1]),void 0===n.useFileCache&&(n.useFileCache=!0),void 0===n.onReady&&(n.onReady=!0),n.relativeUrls&&(n.rewriteUrls="all")}(window,jt),jt.plugins=jt.plugins||[],window.LESS_PLUGINS&&(jt.plugins=jt.plugins.concat(window.LESS_PLUGINS));var Nt,Bt,Ut,qt=function(e,i){var r=e.document,s=Mt();s.options=i;var a=s.environment,o=Ft(i,s.logger),l=new o;a.addFileManager(l),s.FileManager=o,s.PluginLoader=Vt,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var n=0;n 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","/**\n * The reason why Node is a class and other nodes simply do not extend\n * from Node (since we're transpiling) is due to this issue:\n * \n * @see https://github.com/less/less.js/issues/3434\n */\nclass Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n }\n\n get currentFileInfo() {\n return this.fileInfo();\n }\n\n get index() {\n return this.getIndex();\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() { return false; }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n // remove when genCSS has JSDoc types\n // eslint-disable-next-line no-unused-vars\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n static compare(a, b) {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n }\n\n static numericCompare(a, b) {\n return a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nconst Color = function(rgb, a, originalForm) {\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n}\n\nColor.prototype = Object.assign(new Node(), {\n type: 'Color',\n\n luma() {\n let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(function (c) {\n return clamp(Math.round(c), 255);\n }).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n // eslint-disable-next-line no-fallthrough\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n },\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n },\n\n toRGB() {\n return toHex(this.rgb);\n },\n\n toHSL() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n },\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n },\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n },\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n});\n\nColor.fromKeyword = function(keyword) {\n let c;\n const key = keyword.toLowerCase();\n // eslint-disable-next-line no-prototype-builtins\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(function (c) {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nexport default Color;\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import Node from './node';\n\nconst Paren = function(node) {\n this.value = node;\n};\n\nParen.prototype = Object.assign(new Node(), {\n type: 'Paren',\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const paren = new Paren(this.value.eval(context));\n \n if (this.noSpacing) {\n paren.noSpacing = true;\n }\n\n return paren;\n }\n});\n\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\r\nfunction getType(payload) {\r\n return Object.prototype.toString.call(payload).slice(8, -1);\r\n}\r\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\r\nfunction isUndefined(payload) {\r\n return getType(payload) === 'Undefined';\r\n}\r\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\r\nfunction isNull(payload) {\r\n return getType(payload) === 'Null';\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isPlainObject(payload) {\r\n if (getType(payload) !== 'Object')\r\n return false;\r\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isObject(payload) {\r\n return isPlainObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is { [K in any]: never }}\r\n */\r\nfunction isEmptyObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isFullObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is PlainObject}\r\n */\r\nfunction isAnyObject(payload) {\r\n return getType(payload) === 'Object';\r\n}\r\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\r\nfunction isObjectLike(payload) {\r\n return isAnyObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a function (regular or async)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is AnyFunction}\r\n */\r\nfunction isFunction(payload) {\r\n return typeof payload === 'function';\r\n}\r\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {any} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isArray(payload) {\r\n return getType(payload) === 'Array';\r\n}\r\n/**\r\n * Returns whether the payload is a an array with at least 1 item\r\n *\r\n * @param {*} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isFullArray(payload) {\r\n return isArray(payload) && payload.length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is []}\r\n */\r\nfunction isEmptyArray(payload) {\r\n return isArray(payload) && payload.length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isString(payload) {\r\n return getType(payload) === 'String';\r\n}\r\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isFullString(payload) {\r\n return isString(payload) && payload !== '';\r\n}\r\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isEmptyString(payload) {\r\n return payload === '';\r\n}\r\n/**\r\n * Returns whether the payload is a number (but not NaN)\r\n *\r\n * This will return `false` for `NaN`!!\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\r\nfunction isNumber(payload) {\r\n return getType(payload) === 'Number' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\r\nfunction isBoolean(payload) {\r\n return getType(payload) === 'Boolean';\r\n}\r\n/**\r\n * Returns whether the payload is a regular expression (RegExp)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\r\nfunction isRegExp(payload) {\r\n return getType(payload) === 'RegExp';\r\n}\r\n/**\r\n * Returns whether the payload is a Map\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Map}\r\n */\r\nfunction isMap(payload) {\r\n return getType(payload) === 'Map';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakMap\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakMap}\r\n */\r\nfunction isWeakMap(payload) {\r\n return getType(payload) === 'WeakMap';\r\n}\r\n/**\r\n * Returns whether the payload is a Set\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Set}\r\n */\r\nfunction isSet(payload) {\r\n return getType(payload) === 'Set';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakSet\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakSet}\r\n */\r\nfunction isWeakSet(payload) {\r\n return getType(payload) === 'WeakSet';\r\n}\r\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\r\nfunction isSymbol(payload) {\r\n return getType(payload) === 'Symbol';\r\n}\r\n/**\r\n * Returns whether the payload is a Date, and that the date is valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\r\nfunction isDate(payload) {\r\n return getType(payload) === 'Date' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a Blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\r\nfunction isBlob(payload) {\r\n return getType(payload) === 'Blob';\r\n}\r\n/**\r\n * Returns whether the payload is a File\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\r\nfunction isFile(payload) {\r\n return getType(payload) === 'File';\r\n}\r\n/**\r\n * Returns whether the payload is a Promise\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Promise}\r\n */\r\nfunction isPromise(payload) {\r\n return getType(payload) === 'Promise';\r\n}\r\n/**\r\n * Returns whether the payload is an Error\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Error}\r\n */\r\nfunction isError(payload) {\r\n return getType(payload) === 'Error';\r\n}\r\n/**\r\n * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is typeof NaN}\r\n */\r\nfunction isNaNValue(payload) {\r\n return getType(payload) === 'Number' && isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\r\nfunction isPrimitive(payload) {\r\n return (isBoolean(payload) ||\r\n isNull(payload) ||\r\n isUndefined(payload) ||\r\n isNumber(payload) ||\r\n isString(payload) ||\r\n isSymbol(payload));\r\n}\r\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\r\nvar isNullOrUndefined = isOneOf(isNull, isUndefined);\r\nfunction isOneOf(a, b, c, d, e) {\r\n return function (value) {\r\n return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));\r\n };\r\n}\r\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\r\nfunction isType(payload, type) {\r\n if (!(type instanceof Function)) {\r\n throw new TypeError('Type must be a function');\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\r\n throw new TypeError('Type is not a class');\r\n }\r\n // Classes usually have names (as functions usually have names)\r\n var name = type.name;\r\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\r\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isMap, isNaNValue, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\r\n const propType = {}.propertyIsEnumerable.call(originalObject, key)\r\n ? 'enumerable'\r\n : 'nonenumerable';\r\n if (propType === 'enumerable')\r\n carry[key] = newVal;\r\n if (includeNonenumerable && propType === 'nonenumerable') {\r\n Object.defineProperty(carry, key, {\r\n value: newVal,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n });\r\n }\r\n}\r\n/**\r\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.\r\n *\r\n * @export\r\n * @template T\r\n * @param {T} target Target can be anything\r\n * @param {Options} [options = {}] Options can be `props` or `nonenumerable`\r\n * @returns {T} the target with replaced values\r\n * @export\r\n */\r\nfunction copy(target, options = {}) {\r\n if (isArray(target)) {\r\n return target.map((item) => copy(item, options));\r\n }\r\n if (!isPlainObject(target)) {\r\n return target;\r\n }\r\n const props = Object.getOwnPropertyNames(target);\r\n const symbols = Object.getOwnPropertySymbols(target);\r\n return [...props, ...symbols].reduce((carry, key) => {\r\n if (isArray(options.props) && !options.props.includes(key)) {\r\n return carry;\r\n }\r\n const val = target[key];\r\n const newVal = copy(val, options);\r\n assignProp(carry, key, newVal, target, options.nonenumerable);\r\n return carry;\r\n }, {});\r\n}\n\nexport { copy };\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n var line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n lineAdjust = 1 - parseInt(match[2]);\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = function () {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options) {\n options = options || {};\n const isWarning = (this.type ?? '').toLowerCase().includes('warning');\n const type = isWarning ? this.type : `${this.type}Error`;\n const color = isWarning ? 'yellow' : 'red';\n\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = function (str) { return str; };\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (!isWarning && typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (!isWarning && typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${type}: ${this.message}`, color);\n if (this.filename) {\n message += stylize(' in ', color) + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', color) + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import tree from '../tree';\n\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key, child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (let i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt, i, item, nestedCnt, j, nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager', // Used as the plugin manager for the session\n 'quiet', // option - whether to log warnings\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this,\n importItem = {\n callback,\n args: null,\n isReady: false\n };\n this.imports.push(importItem);\n return function() {\n importItem.args = Array.prototype.slice.call(arguments, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this,\n inlineCSS = importNode.options.inline,\n isPlugin = importNode.options.isPlugin,\n isOptional = importNode.options.optional,\n duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = function() {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n if (atRuleNode.value) {\n this.context.frames.unshift(atRuleNode);\n } else if (atRuleNode.declarations && atRuleNode.declarations.length) {\n if (atRuleNode.isRooted) {\n this.context.frames.unshift(atRuleNode);\n } else {\n this.context.frames.unshift(atRuleNode.declarations[0]);\n }\n } else if (atRuleNode.rules && atRuleNode.rules.length) {\n this.context.frames.unshift(atRuleNode);\n }\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(function(allSelectorsExtend) {\n return allSelectorsExtend.clone();\n });\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(function(extend) {\n return !extend.hasFoundMatches && extend.parent_ids.length == 1;\n }).forEach(function(extend) {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n /**\n * @todo Shouldn't this be an error? To alert the developer\n * that they may have made an error in the selector they are\n * targeting?\n */\n logger.warn(`WARNING: extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(function(selfSelector) {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(function (currentValue) {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n\n if (atRuleNode.declarations && atRuleNode.declarations.length) {\n atRuleNode.declarations[0].root = (context.length === 0 || context[0].multiMedia);\n }\n else if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' did not return a root node`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$peekChar = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar: {\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n }\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']': {\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default function (input, fail) {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n","import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\nimport { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax';\nimport logger from '../logger';\nimport Selector from '../tree/selector';\nimport Anonymous from '../tree/anonymous';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo, currentIndex) {\n currentIndex = currentIndex || 0;\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n /**\n * \n * @param {string} msg \n * @param {number} index \n * @param {string} type \n */\n function warn(msg, index, type) {\n if (!context.quiet) {\n logger.warn(\n (new LessError(\n {\n index: index ?? parserInput.i,\n filename: fileInfo.filename,\n type: type ? `${type.toUpperCase()} WARNING` : 'WARNING',\n message: msg\n },\n imports\n )).toString()\n );\n }\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n\n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n *\n * @param {String} str - string to parse\n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p; (p = parseList[x]); x++) {\n result = parsers[p]();\n returnNodes.push(result || null);\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let err = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n // Optionally disable @plugin parsing\n if (additionalData && additionalData.disablePluginRule) {\n parsers.plugin = function() {\n var dir = parserInput.$re(/^@plugin?\\s+/);\n if (dir) {\n error('@plugin statements are not allowed when disablePluginRule is set to true');\n }\n }\n }\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n\n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n err = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = err || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) ||\n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|~|progid:[\\w.]+)\\(/);\n if (!name) {\n parserInput.forget();\n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index + currentIndex, fileInfo);\n },\n\n declarationCall: function () {\n let validCall;\n let args;\n const index = parserInput.i;\n\n parserInput.save();\n\n validCall = parserInput.$re(/^[\\w]+\\(/);\n if (!validCall) {\n parserInput.forget();\n return;\n }\n\n validCall = validCall.substring(0, validCall.length - 1);\n\n let rule = this.ruleProperty();\n let value;\n \n if (rule) {\n value = this.value();\n }\n \n if (rule && value) {\n args = [new (tree.Declaration)(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)];\n }\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(validCall, args, index + currentIndex, fileInfo);\n },\n\n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result,\n // otherwise continue for plain args\n };\n }\n\n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[()'\"])|[^()'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value !== undefined ||\n value instanceof tree.Variable ||\n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index + currentIndex, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index + currentIndex, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index + currentIndex, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n }\n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n let first = true;\n while (!(option = parserInput.$re(/^(!?all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n\n if (!e) {\n break;\n }\n /**\n * @note - This will not catch selectors in pseudos like :is() and :where() because\n * they don't currently parse their contents as selectors.\n */\n if (!first && e.combinator.value) {\n warn('Targeting complex selectors can have unexpected behavior, and this behavior may change in the future.', index)\n }\n\n first = false;\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index + currentIndex, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n let parensIndex;\n let parensWS = false;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n parensIndex = parserInput.i;\n if (parserInput.$char('(')) {\n parensWS = parserInput.isWhitespace(-2);\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n if (parensWS) {\n warn('Whitespace between a mixin name and parentheses for a mixin call is deprecated', parensIndex, 'DEPRECATED');\n }\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n if (!hasParens) {\n warn('Calling a mixin without parentheses is deprecated', parensIndex, 'DEPRECATED');\n }\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n\n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n\n ruleLookups: function() {\n let rule;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') {\n return;\n }\n\n while (true) {\n parserInput.save();\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n\n lookupValue: function() {\n parserInput.save();\n\n if (!parserInput.$char('[')) {\n parserInput.restore();\n return;\n }\n\n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n\n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n }\n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n\n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n /** \n * A Selector Element\n *\n * div\n * + h1\n * #socks\n * input[type=\"text\"]\n *\n * Elements are the building blocks for Selectors,\n * they are made out of a `Combinator` (see combinator rule),\n * and an element name, such as a tag a class, or `*`.\n */\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n /** This selector parser is quite simplistic and will pass a number of invalid selectors. */\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n // eslint-disable-next-line no-control-regex\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false))) {\n let selectors = [];\n while (parserInput.$char(',')) {\n selectors.push(v);\n selectors.push(new Anonymous(','));\n v = this.selector(false);\n }\n selectors.push(v);\n \n if (parserInput.$char(')')) {\n if (selectors.length > 1) {\n e = new (tree.Paren)(new Selector(selectors));\n } else {\n e = new(tree.Paren)(v);\n }\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (Array.isArray(e)){\n e.forEach(ele => elements.push(ele));\n } if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error('Guards are only currently allowed on a single selector.');\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error('Guards are only currently allowed on a single selector.');\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n //\n // case-insensitive flag\n // e.g. [attr operator value i]\n //\n let cif;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n if (val) {\n cif = parserInput.$re(/^[iIsS]/);\n }\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val, cif);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not\n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n if (parserInput.$char(';')) {\n value = new Anonymous('');\n } else {\n value = this.permissiveValue(/[;}]/, true);\n }\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n /**\n * As a last resort, try permissiveValue\n *\n * @todo - This has created some knock-on problems of not\n * flagging incorrect syntax or detecting user intent.\n */\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@$+/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index + currentIndex);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n *\n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n * \n * @param {RexExp} untilTokens - Characters to stop parsing at\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n if (parserInput.peek(',')) {\n value.push(new (tree.Anonymous)(',', parserInput.i));\n parserInput.$char(',');\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n /** @type {string} */\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n const variableRegex = /@([\\w-]+)/g;\n const propRegex = /\\$([\\w-]+)/g;\n if (variableRegex.test(item)) {\n warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED');\n }\n if (propRegex.test(item)) {\n warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED');\n }\n quote.variableRegex = /@([\\w-]+)|@{([\\w-]+)}/g;\n quote.propRegex = /\\$([\\w-]+)|\\${([\\w-]+)}/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures({});\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function (syntaxOptions) {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n let rangeP;\n let spacing = false;\n parserInput.save();\n do {\n parserInput.save();\n if (parserInput.$re(/^[0-9a-z-]*\\s+\\(/)) {\n spacing = true;\n }\n parserInput.restore();\n\n e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup()\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n parserInput.save();\n if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\\s*([<>]=|<=|>=|[<>]|=)/)) {\n parserInput.restore();\n p = this.condition();\n\n parserInput.save();\n rangeP = this.atomicCondition(null, p.rvalue);\n if (!rangeP) {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n e = this.value();\n }\n if (parserInput.$char(')')) {\n if (p && !e) {\n nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)));\t\t\t\t \n e = p;\n } else if (p && e) {\n nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true)));\n if (!spacing) {\n nodes[nodes.length - 1].noSpacing = true;\n }\n spacing = false;\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n spacing = false;\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function (syntaxOptions) {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature(syntaxOptions);\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n else if (!features[features.length - 1].noSpacing) {\n features[features.length - 1].noSpacing = false;\n }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n else if (!features[features.length - 1].noSpacing) {\n features[features.length - 1].noSpacing = false;\n }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) {\n const features = this.mediaFeatures(syntaxOptions);\n\n const rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n const atRule = new (treeType)(rules, features, index + currentIndex, fileInfo);\n if (context.dumpLineNumbers) {\n atRule.debugInfo = debugInfo;\n }\n\n return atRule;\n },\n\n nestableAtRule: function () {\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n parserInput.save();\n\n if (parserInput.$peekChar('@')) {\n if (parserInput.$str('@media')) {\n return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions);\n }\n \n if (parserInput.$str('@container')) {\n return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions);\n }\n }\n \n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else {\n parserInput.restore();\n return null;\n }\n },\n atruleUnknown: function (value, name, hasBlock) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(''.concat(name, ' rule is missing block or ending semi-colon'));\n }\n }\n else if (!value.value) {\n value = null;\n }\n return [value, hasBlock];\n },\n atruleBlock: function (rules, value, isRooted, isKeywordList) {\n rules = this.blockRuleset();\n parserInput.save();\n if (!rules && !isRooted) {\n value = this.entity();\n rules = this.blockRuleset();\n }\n if (!rules && !isRooted) {\n parserInput.restore();\n var e = [];\n value = this.entity();\n while (parserInput.$char(',')) {\n e.push(value);\n value = this.entity();\n }\n if (value && e.length > 0) {\n e.push(value);\n value = e;\n isKeywordList = true;\n }\n else {\n rules = this.blockRuleset();\n }\n }\n else {\n parserInput.forget();\n }\n \n return [rules, value, isKeywordList];\n },\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n let isKeywordList = false;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.nestableAtRule();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n case '@starting-style':\n isRooted = false;\n break;\n case '@layer':\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n const unknownPackage = this.atruleUnknown(value, name, hasBlock);\n value = unknownPackage[0];\n hasBlock = unknownPackage[1];\n }\n \n if (hasBlock) {\n let blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList);\n rules = blockPackage[0];\n value = blockPackage[1];\n isKeywordList = blockPackage[2];\n\n if (!rules && !hasUnknown) {\n parserInput.restore();\n name = parserInput.$re(/^@[a-z-]+/);\n const unknownPackage = this.atruleUnknown(value, name, hasBlock);\n value = unknownPackage[0];\n hasBlock = unknownPackage[1];\n if (hasBlock) {\n blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList);\n rules = blockPackage[0];\n value = blockPackage[1];\n isKeywordList = blockPackage[2];\n }\n }\n }\n\n if (rules || isKeywordList || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index + currentIndex, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index + currentIndex);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n colorOperand: function () {\n parserInput.save();\n \n // hsl or rgb or lch operand\n const match = parserInput.$re(/^[lchrgbs]\\s+/);\n if (match) {\n return new tree.Keyword(match[0]);\n }\n\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*');\n if (!op) {\n let index = parserInput.i;\n op = parserInput.$str('./');\n if (op) {\n warn('./ operator is deprecated', index, 'DEPRECATED');\n }\n }\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index + currentIndex);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens, preparsedCond) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n const cond = (function() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }).bind(this)\n\n if (preparsedCond) {\n a = preparsedCond;\n } else {\n a = cond();\n }\n\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index + currentIndex, false);\n } else {\n error('expected expression');\n }\n } else if (!preparsedCond) {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@$(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n this.colorOperand() || entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e && !e.isLineComment) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index + currentIndex));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n};\n\nSelector.prototype = Object.assign(new Node(), {\n type: 'Selector',\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n },\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(\n els,\n ['selector'],\n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n },\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n },\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n },\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( function(v) {\n return v.combinator.value + (v.value.value || v.value);\n }).join('').match(/[,&#*.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n },\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n },\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(function (e) { return e.eval(context); });\n extendList = extendList && extendList.map(function(extend) { return extend.eval(context); });\n\n return this.createDerived(elements, extendList, evaldCondition);\n },\n\n genCSS(context, output) {\n let i, element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n },\n\n getIsOutput() {\n return this.evaldCondition;\n }\n});\n\nexport default Selector;\n","import Node from './node';\n\nconst Value = function(value) {\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n};\n\nValue.prototype = Object.assign(new Node(), {\n type: 'Value',\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n },\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(function (v) {\n return v.eval(context);\n }));\n }\n },\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n});\n\nexport default Value;\n","import Node from './node';\n\nconst Keyword = function(value) {\n this.value = value;\n};\n\nKeyword.prototype = Object.assign(new Node(), {\n type: 'Keyword',\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n});\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nconst Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) {\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n};\n\nDeclaration.prototype = Object.assign(new Node(), {\n type: 'Declaration',\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n },\n\n eval(context) {\n let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n },\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n});\n\nexport default Declaration;","function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n","import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Ruleset = function(selectors, rules, strictImports, visibilityInfo) {\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n}\n\nRuleset.prototype = Object.assign(new Node(), {\n type: 'Ruleset',\n isRuleset: true,\n\n isRulesetLike() { return true; },\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n eval(context) {\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (let j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n const startingIndex = selectors[0].getIndex();\n const selectorFileInfo = selectors[0].fileInfo();\n new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(\n toParseSelectors.join(','),\n ['selectors'],\n function(err, result) {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (function (frames) {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n }(context.frames)).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (let j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n },\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice.apply(rules, [i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n },\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n },\n\n matchArgs(args) {\n return !args || args.length === 0;\n },\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n },\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n },\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n // eslint-disable-next-line no-prototype-builtins\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n },\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n },\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n },\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(\n decl.value.value,\n ['value', 'important'],\n function(err, result) {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(function(n) {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n },\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n },\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n },\n\n find(selector, self, filter) {\n self = self || this;\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(function (rule) {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n },\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n },\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n },\n\n joinSelector(paths, context, selector) {\n\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen, j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element, selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath, lastSelector, newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(function (selector) {\n return selector.createDerived(selector.elements, []);\n });\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i, sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector !== null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i, newPaths, hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n\n }\n});\n\nexport default Ruleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nconst Unit = function(numerator, denominator, backupUnit) {\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n};\n\nUnit.prototype = Object.assign(new Node(), {\n type: 'Unit',\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n },\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n },\n\n toString() {\n let i, returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n },\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n },\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n },\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n },\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n },\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n },\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n },\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = function (atomicUnit) {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n // eslint-disable-next-line no-prototype-builtins\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n },\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n // eslint-disable-next-line no-prototype-builtins\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n});\n\nexport default Unit;\n","/* eslint-disable no-prototype-builtins */\nimport Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nconst Dimension = function(value, unit) {\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n};\n\nDimension.prototype = Object.assign(new Node(), {\n type: 'Dimension',\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n eval(context) {\n return this;\n },\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n },\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n },\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error('Incompatible units. Change the units or use the unit function. '\n + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n },\n\n compare(other) {\n let a, b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n },\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n },\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = function (atomicUnit, denominator) {\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n});\n\nexport default Dimension;\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport Anonymous from './anonymous';\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n const noSpacing = this.noSpacing;\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen\n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n returnValue.noSpacing = returnValue.noSpacing || noSpacing;\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n if (i + 1 < this.value.length && !(this.value[i + 1] instanceof Anonymous) ||\n this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') {\n output.add(' ');\n }\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport * as utils from '../utils';\n\nconst NestableAtRulePrototype = {\n\n isRulesetLike() {\n return true;\n },\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n evalFunction: function () {\n if (!this.features || !Array.isArray(this.features.value) || this.features.value.length < 1) {\n return;\n }\n\n const exprValues = this.features.value;\n let expr, paren;\n\n for (let index = 0; index < exprValues.length; ++index) {\n expr = exprValues[index];\n\n if (expr.type === 'Keyword' && index + 1 < exprValues.length && (expr.noSpacing || expr.noSpacing == null)) {\n paren = exprValues[index + 1];\n \n if (paren.type === 'Paren' && paren.noSpacing) {\n exprValues[index]= new Expression([expr, paren]);\n exprValues.splice(index + 1, 1);\n exprValues[index].noSpacing = true;\n }\n }\n }\n },\n\n evalTop(context) {\n this.evalFunction();\n\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n },\n\n evalNested(context) {\n this.evalFunction();\n\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n if (path[i].type !== this.type) { \n context.mediaBlocks.splice(i, 1); \n \n return this; \n }\n \n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n },\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n },\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n};\n\nexport default NestableAtRulePrototype;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst AtRule = function(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n) {\n let i;\n var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n const allDeclarations = this.declarationsBlock(rules);\n \n let allRulesetDeclarations = true;\n rules.forEach(rule => {\n if (rule.type === 'Ruleset' && rule.rules) allRulesetDeclarations = allRulesetDeclarations && this.declarationsBlock(rule.rules, true);\n });\n\n if (allDeclarations && !isRooted) {\n this.simpleBlock = true;\n this.declarations = rules;\n } else if (allRulesetDeclarations && rules.length === 1 && !isRooted && !value) {\n this.simpleBlock = true;\n this.declarations = rules[0].rules ? rules[0].rules : rules;\n } else {\n this.rules = rules;\n }\n } else {\n const allDeclarations = this.declarationsBlock(rules.rules);\n \n if (allDeclarations && !isRooted && !value) {\n this.simpleBlock = true;\n this.declarations = rules.rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n }\n if (!this.simpleBlock) {\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n }\n this.setParent(selectors, this);\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nAtRule.prototype = Object.assign(new Node(), {\n type: 'AtRule',\n\n ...NestableAtRulePrototype,\n\n declarationsBlock(rules, mergeable = false) {\n if (!mergeable) {\n return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge}).length === rules.length;\n } else {\n return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length;\n }\n },\n\n keywordList(rules) {\n if (!Array.isArray(rules)) {\n return false;\n } else { \n return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length;\n }\n },\n\n accept(visitor) {\n const value = this.value, rules = this.rules, declarations = this.declarations;\n\n if (rules) {\n this.rules = visitor.visitArray(rules);\n } else if (declarations) {\n this.declarations = visitor.visitArray(declarations); \n }\n if (value) {\n this.value = visitor.visit(value);\n }\n },\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n },\n\n isCharset() {\n return '@charset' === this.name;\n },\n\n genCSS(context, output) {\n const value = this.value, rules = this.rules || this.declarations;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (this.simpleBlock) {\n this.outputRuleset(context, output, this.declarations);\n } else if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n },\n\n eval(context) {\n let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations;\n \n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n if (value.value && this.keywordList(value.value)) {\n value = new Anonymous(value.value.map(keyword => keyword.value).join(', '), this.getIndex(), this.fileInfo());\n }\n }\n\n if (rules) {\n rules = this.evalRoot(context, rules);\n }\n if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) {\n const allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true);\n if (allMergeableDeclarations && !this.isRooted && !value) {\n var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n mergeRules(rules[0].rules);\n rules = rules[0].rules;\n rules.forEach(rule => rule.merge = false);\n }\n }\n if (this.simpleBlock && rules) {\n rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n rules = rules.map(function (rule) { return rule.eval(context); });\n }\n\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n },\n\n evalRoot(context, rules) {\n let ampersandCount = 0;\n let noAmpersandCount = 0;\n let noAmpersands = true;\n let allAmpersands = false;\n\n if (!this.simpleBlock) {\n rules = [rules[0].eval(context)];\n }\n\n let precedingSelectors = [];\n if (context.frames.length > 0) {\n for (let index = 0; index < context.frames.length; index++) {\n const frame = context.frames[index];\n if (\n frame.type === 'Ruleset' &&\n frame.rules &&\n frame.rules.length > 0\n ) {\n if (frame && !frame.root && frame.selectors && frame.selectors.length > 0) {\n precedingSelectors = precedingSelectors.concat(frame.selectors);\n }\n }\n if (precedingSelectors.length > 0) {\n let value = '';\n const output = { add: function (s) { value += s; } };\n for (let i = 0; i < precedingSelectors.length; i++) {\n precedingSelectors[i].genCSS(context, output);\n }\n if (/^&+$/.test(value.replace(/\\s+/g, ''))) {\n noAmpersands = false;\n noAmpersandCount++;\n } else {\n allAmpersands = false;\n ampersandCount++;\n }\n }\n }\n }\n\n const mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !allAmpersands && !noAmpersands;\n if (\n (this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && !allAmpersands && noAmpersands)\n || !mixedAmpersands\n ) {\n rules[0].root = true;\n }\n return rules;\n },\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n },\n\n find() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], arguments);\n }\n },\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n },\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`, tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n});\n\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst DetachedRuleset = function(ruleset, frames) {\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n};\n\nDetachedRuleset.prototype = Object.assign(new Node(), {\n type: 'DetachedRuleset',\n evalFirst: true,\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n },\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n },\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n});\n\nexport default DetachedRuleset;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nconst Operation = function(op, operands, isSpaced) {\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n};\n\nOperation.prototype = Object.assign(new Node(), {\n type: 'Operation',\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n },\n\n eval(context) {\n let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate || !b.operate) {\n if (\n (a instanceof Operation || b instanceof Operation)\n && a.op === '/' && context.math === MATH.PARENS_DIVISION\n ) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n },\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n});\n\nexport default Operation;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nconst Call = function(name, args, index, currentFileInfo) {\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nCall.prototype = Object.assign(new Node(), {\n type: 'Call',\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n },\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n\n const exitCalc = () => {\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n };\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(this.args);\n exitCalc();\n } catch (e) {\n // eslint-disable-next-line no-prototype-builtins\n if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {\n throw e;\n }\n throw { \n type: e.type || 'Runtime',\n message: `Error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n const args = this.args.map(a => a.eval(context));\n exitCalc();\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n },\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n});\n\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nconst Variable = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nVariable.prototype = Object.assign(new Node(), {\n type: 'Variable',\n\n eval(context) {\n let variable, name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, function (frame) {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nconst Property = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nProperty.prototype = Object.assign(new Node(), {\n type: 'Property',\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, function (frame) {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Property;\n","import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\nconst Quoted = function(str, content, escaped, index, currentFileInfo) {\n this.escaped = (escaped === undefined) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n};\n\nQuoted.prototype = Object.assign(new Node(), {\n type: 'Quoted',\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n },\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n },\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = function (_, name1, name2) {\n const v = new Variable(`@${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = function (_, name1, name2) {\n const v = new Property(`$${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n },\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n});\n\nexport default Quoted;\n","import Node from './node';\n\nfunction escapePath(path) {\n return path.replace(/[()'\"\\s]/g, function(match) { return `\\\\${match}`; });\n}\n\nconst URL = function(val, index, currentFileInfo, isEvald) {\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n};\n\nURL.prototype = Object.assign(new Node(), {\n type: 'Url',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n});\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Media = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nMedia.prototype = Object.assign(new AtRule(), {\n type: 'Media',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\nimport Expression from './expression';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nconst Import = function(path, features, options, index, currentFileInfo, visibilityInfo) {\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n};\n\nImport.prototype = Object.assign(new Node(), {\n type: 'Import',\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n },\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n },\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n },\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n },\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n },\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n },\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(function (node) {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n },\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.features) {\n let featureValue = this.features.value;\n if (Array.isArray(featureValue) && featureValue.length >= 1) {\n const expr = featureValue[0];\n if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) {\n featureValue = expr.value;\n const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer'\n && featureValue[1].type === 'Paren';\n if (isLayer) {\n this.css = false;\n }\n }\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css || this.layerCss) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (this.layerCss) {\n newImport.css = this.layerCss;\n newImport.path._fileInfo = this._fileInfo;\n }\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else if (this.root) {\n if (this.features) {\n let featureValue = this.features.value;\n if (Array.isArray(featureValue) && featureValue.length === 1) {\n const expr = featureValue[0];\n if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) {\n featureValue = expr.value;\n const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer'\n && featureValue[1].type === 'Paren';\n if (isLayer) {\n this.layerCss = true;\n featureValue[0] = new Expression(featureValue.slice(0, 2));\n featureValue.splice(1, 1);\n featureValue[0].noSpacing = true;\n return this;\n }\n }\n }\n }\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n } else {\n if (this.features) {\n let featureValue = this.features.value;\n if (Array.isArray(featureValue) && featureValue.length >= 1) {\n featureValue = featureValue[0].value;\n if (Array.isArray(featureValue) && featureValue.length >= 2) {\n const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer'\n && featureValue[1].type === 'Paren';\n if (isLayer) {\n this.css = true;\n featureValue[0] = new Expression(featureValue.slice(0, 2));\n featureValue.splice(1, 1);\n featureValue[0].noSpacing = true;\n return this;\n }\n }\n }\n }\n return [];\n }\n }\n});\n\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nconst JsEvalNode = function() {};\n\nJsEvalNode.prototype = Object.assign(new Node(), {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, function (_, name) {\n return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context));\n });\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n // eslint-disable-next-line no-prototype-builtins\n if (variables.hasOwnProperty(k)) {\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n },\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n});\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nconst JavaScript = function(string, escaped, index, currentFileInfo) {\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nJavaScript.prototype = Object.assign(new JsEvalNode(), {\n type: 'JavaScript',\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n});\n\nexport default JavaScript;\n","import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n","import Node from './node';\n\nconst Condition = function(op, l, r, i, negate) {\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n};\n\nCondition.prototype = Object.assign(new Node(), {\n type: 'Condition',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n },\n\n eval(context) {\n const result = (function (op, a, b) {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n});\n\nexport default Condition;\n","import { copy } from 'copy-anything';\nimport Declaration from './declaration';\nimport Node from './node';\n\nconst QueryInParens = function (op, l, m, op2, r, i) {\n this.op = op.trim();\n this.lvalue = l;\n this.mvalue = m;\n this.op2 = op2 ? op2.trim() : null;\n this.rvalue = r;\n this._index = i;\n this.mvalues = [];\n};\n\nQueryInParens.prototype = Object.assign(new Node(), {\n type: 'QueryInParens',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.mvalue = visitor.visit(this.mvalue);\n if (this.rvalue) {\n this.rvalue = visitor.visit(this.rvalue);\n }\n },\n\n eval(context) {\n this.lvalue = this.lvalue.eval(context);\n \n let variableDeclaration;\n let rule;\n\n for (let i = 0; (rule = context.frames[i]); i++) {\n if (rule.type === 'Ruleset') {\n variableDeclaration = rule.rules.find(function (r) {\n if ((r instanceof Declaration) && r.variable) {\n return true;\n }\n\n return false;\n });\n \n if (variableDeclaration) {\n break;\n }\n }\n }\n\n if (!this.mvalueCopy) {\n this.mvalueCopy = copy(this.mvalue);\n }\n \n if (variableDeclaration) {\n this.mvalue = this.mvalueCopy;\n this.mvalue = this.mvalue.eval(context);\n this.mvalues.push(this.mvalue);\n } else {\n this.mvalue = this.mvalue.eval(context);\n }\n\n if (this.rvalue) {\n this.rvalue = this.rvalue.eval(context);\n }\n return this;\n },\n\n genCSS(context, output) {\n this.lvalue.genCSS(context, output);\n output.add(' ' + this.op + ' ');\n if (this.mvalues.length > 0) {\n this.mvalue = this.mvalues.shift();\n }\n this.mvalue.genCSS(context, output);\n if (this.rvalue) {\n output.add(' ' + this.op2 + ' ');\n this.rvalue.genCSS(context, output);\n }\n },\n});\n\nexport default QueryInParens;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Container = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nContainer.prototype = Object.assign(new AtRule(), {\n type: 'Container',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@container ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Container;\n","import Node from './node';\n\nconst UnicodeDescriptor = function(value) {\n this.value = value;\n}\n\nUnicodeDescriptor.prototype = Object.assign(new Node(), {\n type: 'UnicodeDescriptor'\n})\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nconst Negative = function(node) {\n this.value = node;\n};\n\nNegative.prototype = Object.assign(new Node(), {\n type: 'Negative',\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n },\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n});\n\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case '!all':\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nconst VariableCall = function(variable, index, currentFileInfo) {\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n};\n\nVariableCall.prototype = Object.assign(new Node(), {\n type: 'VariableCall',\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n});\n\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nconst NamespaceValue = function(ruleCall, lookups, index, fileInfo) {\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n};\n\nNamespaceValue.prototype = Object.assign(new Node(), {\n type: 'NamespaceValue',\n\n eval(context) {\n let i, name, rules = this.value.eval(context);\n \n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n});\n\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) {\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce(function (count, p) {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nDefinition.prototype = Object.assign(new Ruleset(), {\n type: 'MixinDefinition',\n evalFirst: true,\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n },\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n },\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n },\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n },\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n },\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n});\n\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nconst MixinCall = function(elements, args, index, currentFileInfo, important) {\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n};\n\nMixinCall.prototype = Object.assign(new Node(), {\n type: 'MixinCall',\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n },\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f, p, namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);};\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n },\n\n _setVisibilityToReplacement(replacement) {\n let i, rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n },\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n});\n\nexport default MixinCall;\n","import Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport QueryInParens from './query-in-parens';\nimport Paren from './paren';\nimport Media from './media';\nimport Container from './container';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, Container, QueryInParens, \n UnicodeDescriptor, Negative, Extend, VariableCall, \n NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n /**\n * Helper function, not part of API.\n * This should be replaceable by newer Node / Browser APIs\n * \n * @param {string} url \n * @param {string} baseUrl\n */\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^/?#]*\\/)|([/\\\\]))?((?:[^/\\\\?#]*[/\\\\])*)([^/\\\\?#]*)([#?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = function() {\n return null;\n }\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n\n let loader, registry, pluginObj, localModule, pluginManager, filename, result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = function(obj) {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport Expression from '../tree/expression';\nimport Operation from '../tree/operation';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n let a = 1\n /**\n * Comma-less syntax\n * e.g. rgb(0 128 255 / 50%)\n */\n if (r instanceof Expression) {\n const val = r.value\n r = val[0]\n g = val[1]\n b = val[2]\n /** \n * @todo - should this be normalized in\n * function caller? Or parsed differently?\n */\n if (b instanceof Operation) {\n const op = b\n b = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.rgba(r, g, b, a);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n let a = 1\n if (h instanceof Expression) {\n const val = h.value\n h = val[0]\n s = val[1]\n l = val[2]\n\n if (l instanceof Operation) {\n const op = l\n l = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.hsla(h, s, l, a);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Comment from '../tree/comment';\nimport Node from '../tree/node';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\nimport Value from '../tree/value';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n '~': function(...expr) {\n if (expr.length === 1) {\n return expr[0];\n }\n return new Value(expr);\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n const tryEval = val => {\n if (val instanceof Node) {\n return val.eval(this.context);\n }\n return val;\n };\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value.map(tryEval);\n } else {\n iterator = [tryEval(list.value)];\n }\n } else if (list.ruleset) {\n iterator = tryEval(list.ruleset).rules;\n } else if (list.rules) {\n iterator = list.rules.map(tryEval);\n } else if (Array.isArray(list)) {\n iterator = list.map(tryEval);\n } else {\n iterator = [tryEval(list)];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n continue;\n } else {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n try {\n return minMax.call(this, true, args);\n } catch (e) {}\n },\n max: function(...args) {\n try {\n return minMax.call(this, false, args);\n } catch (e) {}\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import Variable from '../tree/variable';\nimport Anonymous from '../tree/variable';\n\nconst styleExpression = function (args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n \n const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)];\n \n args = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n \n return new Anonymous(`style(${args})`);\n};\n\nexport default {\n style: function(...args) {\n try {\n return styleExpression.call(this, args);\n } catch (e) {}\n },\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\nimport style from './style';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n functionRegistry.addMultiple(style);\n\n return functions;\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default () => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = `<${gradientType}Gradient id=\"g\" ${gradientDirectionSvg}>`;\n\n for (i = 0; i < stops.length; i += 1) {\n if (stops[i] instanceof Expression) {\n color = stops[i].value[0];\n position = stops[i].value[1];\n } else {\n color = stops[i];\n position = undefined;\n }\n\n if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) {\n throwArgumentDescriptor();\n }\n positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';\n alpha = color.alpha;\n returner += ``;\n }\n returner += ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default function(root, options) {\n options = options || {};\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(function (k) {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (let i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (let i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n}\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nconst PluginManagerFactory = function(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","'use strict';\n\nfunction parseNodeVersion(version) {\n var match = version.match(/^v(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len\n if (!match) {\n throw new Error('Unable to parse: ' + version);\n }\n\n var res = {\n major: parseInt(match[1], 10),\n minor: parseInt(match[2], 10),\n patch: parseInt(match[3], 10),\n pre: match[4] || '',\n build: match[5] || '',\n };\n\n return res;\n}\n\nmodule.exports = parseNodeVersion;\n","import AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nconst FileManager = function() {}\nFileManager.prototype = Object.assign(new AbstractFileManager(), {\n alwaysMakePathsAbsolute() {\n return true;\n },\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n },\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n },\n\n supports() {\n return true;\n },\n\n clearFileCache() {\n fileCache = {};\n },\n\n loadFile(filename, currentDirectory, options) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n});\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import Environment from './environment/environment';\nimport data from './data';\nimport tree from './tree';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport functions from './functions';\nimport contexts from './contexts';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\nimport SourceMapOutput from './source-map-output';\nimport SourceMapBuilder from './source-map-builder';\nimport ParseTree from './parse-tree';\nimport ImportManager from './import-manager';\nimport Parse from './parse';\nimport Render from './render';\nimport { version } from '../../package.json';\nimport parseVersion from 'parse-node-version';\n\nexport default function(environment, fileManagers) {\n let sourceMapOutput, sourceMapBuilder, parseTree, importManager;\n\n environment = new Environment(environment, fileManagers);\n sourceMapOutput = SourceMapOutput(environment);\n sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment);\n parseTree = ParseTree(sourceMapBuilder);\n importManager = ImportManager(environment);\n\n const render = Render(environment, parseTree, importManager);\n const parse = Parse(environment, parseTree, importManager);\n\n const v = parseVersion(`v${version}`);\n const initial = {\n version: [v.major, v.minor, v.patch],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions: functions(environment),\n contexts,\n SourceMapOutput: sourceMapOutput,\n SourceMapBuilder: sourceMapBuilder,\n ParseTree: parseTree,\n ImportManager: importManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n\n const ctor = function(t) {\n return function() {\n const obj = Object.create(t.prototype);\n t.apply(obj, Array.prototype.slice.call(arguments, 0));\n return obj;\n };\n };\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n /**\n * Some of the functions assume a `this` context of the API object,\n * which causes it to fail when wrapped for ES6 imports.\n * \n * An assumed `this` should be removed in the future.\n */\n initial.parse = initial.parse.bind(api);\n initial.render = initial.render.bind(api);\n\n return api;\n}\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n","export default function (SourceMapOutput, environment) {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline, \n disableSourcemapAnnotation: this.options.disableSourcemapAnnotation\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (this.options.disableSourcemapAnnotation) {\n return '';\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n}\n","export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default function(environment) {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = {}; // Holds the imported parse trees.\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this, pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = function (e, root, fullPath) {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n // Inline imports aren't cached here.\n // If we start to cache them, please make sure they won't conflict with non-inline imports of the\n // same name as they used to do before this comment and the condition below have been added.\n if (!importManager.files[fullPath] && !importOptions.inline) {\n importManager.files[fullPath] = { root, options: importOptions };\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = function(loadedFile) {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n // import (multiple) parse trees apparently get altered and can't be cached.\n // TODO: investigate why this is\n if (importManager.files[resolvedFilename]\n && !importManager.files[resolvedFilename].options.multiple\n && !importOptions.multiple) {\n\n fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);\n }\n else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n }\n };\n let loadedFile;\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n\n if (context.syncImport) {\n loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n } else {\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n }\n else {\n if (context.syncImport) {\n loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);\n } else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n }\n if (loadedFile) {\n if (!loadedFile.filename) {\n fileParsedFunc(loadedFile);\n } else {\n loadFileCallback(loadedFile);\n }\n } else if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n}\n","import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default function(environment, ParseTree, ImportManager) {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n parse.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(function(plugin) {\n let evalResult, contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, function (e, root) {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n}\n","/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '
  • {content}
  • ';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `

    ${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `

    in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:

      ${errors.join('')}
    `;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
    Stack Trace
    ${e.stack.split('\\n').slice(1).join('
    ')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole() {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n /**\n * @todo remove when this is typed with JSDoc\n */\n // eslint-disable-next-line no-unused-vars\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","Object","prototype","hasOwnProperty","call","JSON","parse","_","browser","document","styles","sheet","id","concat","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","logger$1","error","msg","this","_fireEvent","warn","info","debug","addListener","listener","_listeners","push","removeListener","i_1","splice","type","i_2","logFunction","Environment","externalEnvironment","fileManagers","requiredFunctions","functions","propName","environmentFunc","bind","getFileManager","filename","currentDirectory","environment","isSync","logger","undefined","pluginManager","getFileManagers","fileManager","addFileManager","clearFileManagers","colors","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","unitConversions","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","data","Node","parent","visibilityBlocks","nodeVisible","rootNode","parsed","defineProperty","get","fileInfo","getIndex","setParent","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","isRulesetLike","toCSS","context","strs","genCSS","add","chunk","index","isEmpty","join","output","value","accept","visitor","visit","eval","_operate","op","a","b","fround","precision","numPrecision","Number","toFixed","compare","numericCompare","blocksVisibility","addVisibilityBlock","removeVisibilityBlock","ensureVisibility","ensureInvisibility","isVisible","visibilityInfo","copyVisibilityInfo","Color","rgb","originalForm","self","match","map","c","i","parseInt","alpha","split","clamp","v","max","min","toHex","round","toString","assign","luma","r","g","pow","doNotCompress","color","colorFunction","compress","args","indexOf","toHSL","h","l","toRGB","splitcolor","operate","other","d","toHSV","toARGB","x","fromKeyword","keyword","key","toLowerCase","slice","__assign","t","n","arguments","p","apply","SuppressedError","Paren","paren","noSpacing","_noSpaceCombinators"," ","|","Combinator","emptyOrWhitespace","trim","spaceOrEmpty","Element","combinator","isVariable","currentFileInfo","clone","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","RewriteUrls","getType","payload","copy","target","item","constructor","getPrototypeOf","getOwnPropertyNames","getOwnPropertySymbols","reduce","carry","props","includes","newVal","originalObject","includeNonenumerable","propType","propertyIsEnumerable","enumerable","writable","configurable","assignProp","nonenumerable","getLocation","inputStream","line","column","copyArray","arr","obj","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","isNullOrUndefined","val","anonymousFunc","LessError","fileContentMap","currentFilename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","create","F","isWarning","_a","stylize","str","type_1","errorTxt","substr","_visitArgs","visitDeeper","_hasIndexed","_noop","Visitor","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","child","typeIndex","tree","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","visitArray","nonReplacing","out","evald","flatten","nestedCnt","j","nestedItem","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","test","isPathLocalRelative","Eval","frames","importantScope","enterCalc","calcStack","inCalc","exitCalc","pop","inParenthesis","parensStack","outOfParenthesis","mathOn","isMathOn","pathRequiresRewrite","rewritePath","rootpath","newPath","normalizePath","segment","segments","reverse","ImportSequencer","onSequencerEmpty","imports","variableImports","_onSequencerEmpty","_currentDepth","addImport","callback","importSequencer","importItem","isReady","tryRun","addVariableImport","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","root","isFinished","visitImport","importNode","inlineCSS","inline","css","utils.copyArray","importParent","isVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","rules","onImported","sequencedOnImported","getPath","importedAtRoot","fullPath","importVisitor","isPlugin","isOptional","optional","duplicateImport","skip","importedFilename","oldContext","visitDeclaration","declNode","unshift","visitDeclarationOut","shift","visitAtRule","atRuleNode","declarations","isRooted","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","SetTreeVisibilityVisitor","visible","ExtendFinderVisitor","allExtendsStack","allExtends","extend","extendList","allSelectorsExtendList","ruleCnt","Extend","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","ruleset","firstExtendOnThisSelectorPath","selectors","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","filter","hasFoundMatches","parent_ids","selector","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","newSelector","targetExtend","newExtend","extendsToAdd","extendVisitor","object_id","selfSelectors","findMatch","selfSelector","extendSelector","option","extendChainCount","selectorOne","selectorTwo","ruleNode","visitSelector","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","elements","potentialMatches","allowBefore","matched","initialCombinator","isElementValuesEqual","finished","allowAfter","endPathIndex","endPathElementIndex","elementValue1","elementValue2","Attribute","Selector","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","createDerived","newAllExtends","lastIndex","JoinSelectorVisitor","getIsOutput","joinSelectors","multiMedia","CSSVisitorUtils","_context","containsSilentNonBlockedChild","bodyRules","rule","isSilent","keepOnlyVisibleChilds","owner","thing","hasVisibleSelector","resolveVisibility","compiledRulesBody","isVisibleRuleset","firstRoot","ToCSSVisitor","utils","variable","mixinNode","visitExtend","extendNode","visitComment","commentNode","originalRules","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","_mergeRules","name","charset","debugInfo","comment","Comment","checkValidNodes","isRoot","Declaration","Call","allowRoot","rulesets","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","ruleList","ruleCache","ruleCSS","groups","groupsArr","i_3","merge","group","result_1","space_1","comma_1","Expression","important","Value","visitors","MarkVisibleSelectorsVisitor","ExtendVisitor","getParserInput","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","isLineComment","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$peekChar","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","quote","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","len","level","parenLevel","emitFrom","emitChunk","force","String","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","functionRegistry","makeRegistry","base","_data","addMultiple","_this","keys","getLocalFunctions","inherit","MediaSyntaxOptions","queryInParens","ContainerSyntaxOptions","Anonymous","mapLines","rulesetLike","Boolean","Parser","currentIndex","parsers","quiet","toUpperCase","expect","arg","expectChar","getDebugInfo","lineNumber","fileName","parseNode","parseList","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","err","preText","disablePluginRule","plugin","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","Ruleset","primary","endInfo","processImports","mixin","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","k","customFuncCall","stop","declarationCall","validCall","substring","ruleProperty","f","ieAlpha","boolean","condition","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","detachedRuleset","assignment","expression","literal","dimension","unicodeDescriptor","entity","url","property","Variable","Property","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","parsedName","lookups","inValue","ruleLookups","VariableCall","NamespaceValue","isRule","first","element","getLookup","hasParens","parensIndex","parensWS","elem","elemIndex","re","isCall","expressionContainsNamed","nameLoop","expand","returner","variadic","expressions","hasSep","throwAwayComments","cond","params","argInfo","conditions","block","lookupValue","Quoted","attribute","slashedCombinator","isLess","when","ele","cif","content","blockRuleset","Definition","DetachedRuleset","dumpLineNumbers","strictImports","hasDR","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","variableRegex","propRegex","import","features","dir","importOptions","mediaFeatures","o","optionName","importOption","mediaFeature","syntaxOptions","rangeP","spacing","atomicCondition","rvalue","lvalue","prepareAndGetNestableAtRule","treeType","atRule","nestableAtRule","Media","Container","pluginArgs","atruleUnknown","hasBlock","atruleBlock","isKeywordList","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","unknownPackage","blockPackage","sub","addition","parens","colorOperand","Keyword","multiplication","operation","isSpaced","operand","parensInOp","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","negate","body","me","tryConditionFollowedByParenthesis","preparsedCond","delim","simpleProperty","vars","name_1","evaldCondition","getElements","mixinElements_","utils.isNullOrUndefined","mediaEmpty","els","importManager","createEmptySelectors","el","sels","olen","mixinElements","isJustParentSelector","True","False","MATH","asComment","ctx","asMediaQuery","filenameWithProtocol","lineSeparator","lastRule","prevMath","evaldValue","mathBypass","evalName","importantResult","makeImportant","isCompressed","defaultFunc","value_","error_","reset","_lookups","_variables","_properties","isRuleset","selCnt","hasVariable","hasOnePassingSelector","toParseSelectors","startingIndex","selectorFileInfo","utils.flattenArray","subRule","originalRuleset","allowImports","globalFunctionRegistry","ctxFrames","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","resetCache","bubbleSelectors","importRules","matchArgs","matchCondition","lastSelector","_rulesets","variables","hash","properties","name_2","decl","parseValue","lastDeclaration","toParse","transformDeclaration","nodes_1","filtRules","prependRule","find","foundMixins","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","currentElements","newSelectors","selectorsMultiplied","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","Unit","numerator","denominator","backupUnit","sort","strictUnits","returnStr","is","unitString","isLength","RegExp","isSingular","usedUnits","mapUnit","groupName","atomicUnit","cancel","counter","count","Dimension","unit","parseFloat","isNaN","toColor","strValue","convertTo","unify","conversions","targetUnit","applyUnit","derivedConversions","returnValue","doubleParen","NestableAtRulePrototype","evalFunction","expr","exprValues","evalTop","mediaPath","evalNested","permute","fragment","rest","AtRule","allDeclarations","declarationsBlock","allRulesetDeclarations_1","simpleBlock","mergeable","keywordList","outputRuleset","mediaPathBackup","mediaBlocksBackup","evalRoot","mergeRules","less","ampersandCount","noAmpersandCount","noAmpersands","allAmpersands","precedingSelectors","frame","value_1","mixedAmpersands","callEval","Operation","operands","functionCaller","isValid","evalArgs","commentFilter","subNodes","to","from","pack","ar","__spreadArray","calc","currentMathContext","funcCaller","FunctionCaller","columnNumber","evaluating","fun","vArr","escaped","containsVariables","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","name1","name2","URL","isEvald","urlArgs","Import","pathValue","reference","evalPath","doEval","registry","featureValue","layerCss","newImport","JsEvalNode","evaluateJavaScript","evalContext","javascriptEnabled","jsify","toJS","JavaScript","string","Assignment","Condition","QueryInParens","op2","mvalue","mvalues","variableDeclaration","mvalueCopy","UnicodeDescriptor","Negative","next_id","selectorElements","selfElements","ruleCall","arity","optionalParameters","required","evalParams","mixinEnv","evaldArguments","varargs","isNamedFound","argIndex","argsLength","evalCall","_arguments","mixinFrames","allArgsCnt","requiredArgsCnt","MixinCall","mixins","mixinPath","argValue","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","MixinDefinition","format","newRules","_setVisibilityToReplacement","replacement","AbstractFileManager","lastIndexOf","tryAppendExtension","ext","supportsSync","alwaysMakePathsAbsolute","isPathAbsolute","basePath","laterPath","pathDiff","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","rawDirectories","rawPath","fileUrl","AbstractPluginLoader","require","evalPlugin","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","exports","loader","validatePlugin","minVersion","compareVersion","addPlugin","setOptions","version","versionToString","aVersion","bVersion","versionString","printUsage","plugins","If","trueValue","falseValue","isdefined","colorFunctions","boolean$1","hsla","origColor","hsl","number","rgba","size","m1","m2","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","argb","tint","shade","colorBlend","mode","cb","cs","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","list","_SELF","~","_i","values","range","step","stepValue","each","rs","iterator","tryEval","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","flags","%","token","encodeURIComponent","isa","Type","isunit","types","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","styleExpression","style$1","style","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","transformTree","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","isPreEvalVisitor","isPreVisitor","pm","PluginManager","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","addPlugins","install","addVisitor","addPreProcessor","preProcessor","priority","indexToInsertAt","addPostProcessor","postProcessor","manager","getPostProcessors","getVisitors","PluginManagerFactory","newFactory","parseNodeVersion_1","major","minor","patch","pre","build","lessRoot","sourceMapOutput","sourceMapBuilder","parseTree","SourceMapBuilder","ParseTree","toCSSOptions","sourceMap","file_1","getExternalSourceMap","files","rootFilename","SourceMapOutput","contentsIgnoredCharsMap","contentsMap","sourceMapFilename","sourceMapURL","outputFilename","sourceMapOutputFilename","sourceMapBasepath","sourceMapRootpath","outputSourceFiles","sourceMapGenerator","sourceMapFileInline","disableSourcemapAnnotation","sourceMapInputFilename","normalizeFilename","removeBasepath","getCSSAppendage","setExternalSourceMap","isInline","getSourceMapURL","getOutputFilename","getInputFilename","_css","_rootNode","_contentsMap","_contentsIgnoredCharsMap","_sourceMapFilename","_outputFilename","_sourceMapBasepath","_sourceMapRootpath","_outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","source","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","ImportManager","rootFileInfo","mime","queue","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","loadedFile","promise","loadFileCallback","resolvedFilename","newEnv","syncImport","loadPluginSync","loadPlugin","loadFile","then","render","utils.copyOptions","self_1","Promise","resolve","reject","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","parseVersion","initial","ctor","api","fileCache","doXHR","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","supports","clearFileCache","location","useFileCache","lessText_1","webInfo","lastModified","Date","FM","log","fulfill","catch","ErrorReporting","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","loggers","console","LogListener","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;qOACM,SAAUA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,qBAAsB,IACrCA,QAAQ,qBAAsB,IAC9BA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,YAAa,KACrBA,QAAQ,MAAO,KAGR,SAAAC,EAAYC,EAASC,GACjC,GAAKA,EACL,IAAK,IAAMC,KAAOD,EAAIE,QAClB,GAAIC,OAAOC,UAAUC,eAAeC,KAAKN,EAAIE,QAASD,GAClD,GAAY,QAARA,GAAyB,oBAARA,GAAqC,aAARA,GAA8B,mBAARA,EACp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HxBE,IAIID,EAAoB,IAAI5E,KAAS0E,EACjCriB,EAAKvnC,OAAOzB,KAAK,uCAAuCpC,OAAA2tD,EAAqB,OAC7ElH,EAAQ,CACJgH,UAASA,EACTC,QAAOA,EACPC,kBAAiBA,EACjBb,OAAQ1hB,EAAK0hB,OAAOhsD,UAG5B4sD,EAAU,IAAI3E,OACf0D,EAAQp3B,GAGfi3B,EAAWj3B,OAInB+V,EAAKyiB,cAAgBvB,EACdlhB,EHrQEjqB,CAAKxf,OAAQ3C,IAU1B,SAAS8uD,GAAgBn/C,GACjBA,EAAKlL,UACLynD,QAAQ/oD,KAAKwM,GAEZ3P,GAAQ2oD,OACT1mD,GAAKM,YAAY47C,WAZzBx7C,OAAOypC,KAAOA,GAgBVpsC,GAAQ8rD,UACJ,SAAS3sC,KAAKxc,OAAO+mD,SAASzkB,OAC9BmH,GAAK2hB,QAGJ/tD,GAAQ2oD,QACTlmC,GAAM,oCACNxgB,GAAOrB,SAASqB,MAAQrB,SAASsB,qBAAqB,QAAQ,IAC9Di8C,GAAQv9C,SAASW,cAAc,UAEzBsC,KAAO,WACTs6C,GAAMz8C,WACNy8C,GAAMz8C,WAAWc,QAAUigB,GAE3B07B,GAAMx8C,YAAYf,SAASgB,eAAe6gB,KAG9CxgB,GAAKN,YAAYw8C,KAErB/R,GAAK+hB,iCACL/hB,GAAK2iB,iBAAmB3iB,GAAKoiB,QAAqB,gBAAbpiB,GAAK4e,KAAuB5D,KAAK0H,GAAiBA"} \ No newline at end of file diff --git a/packages/less/src/less-browser/add-default-options.js b/packages/less/lib/less-browser/add-default-options.js similarity index 95% rename from packages/less/src/less-browser/add-default-options.js rename to packages/less/lib/less-browser/add-default-options.js index d839595f9..0fbbaab86 100644 --- a/packages/less/src/less-browser/add-default-options.js +++ b/packages/less/lib/less-browser/add-default-options.js @@ -1,5 +1,5 @@ -import {addDataAttr} from './utils'; -import browser from './browser'; +import {addDataAttr} from './utils.js'; +import browser from './browser.js'; export default (window, options) => { diff --git a/packages/less/src/less-browser/bootstrap.js b/packages/less/lib/less-browser/bootstrap.js similarity index 91% rename from packages/less/src/less-browser/bootstrap.js rename to packages/less/lib/less-browser/bootstrap.js index 2a73fe3c3..bf21073a3 100644 --- a/packages/less/src/less-browser/bootstrap.js +++ b/packages/less/lib/less-browser/bootstrap.js @@ -3,9 +3,9 @@ * used in the browser distributed version of less * to kick-start less using the browser api */ -import defaultOptions from '../less/default-options'; -import addDefaultOptions from './add-default-options'; -import root from './index'; +import defaultOptions from '../less/default-options.js'; +import addDefaultOptions from './add-default-options.js'; +import root from './index.js'; const options = defaultOptions(); diff --git a/packages/less/src/less-browser/browser.js b/packages/less/lib/less-browser/browser.js similarity index 98% rename from packages/less/src/less-browser/browser.js rename to packages/less/lib/less-browser/browser.js index 58f339ccf..8f071ad45 100644 --- a/packages/less/src/less-browser/browser.js +++ b/packages/less/lib/less-browser/browser.js @@ -1,4 +1,4 @@ -import * as utils from './utils'; +import * as utils from './utils.js'; export default { createCSS: function (document, styles, sheet) { diff --git a/packages/less/src/less-browser/cache.js b/packages/less/lib/less-browser/cache.js similarity index 100% rename from packages/less/src/less-browser/cache.js rename to packages/less/lib/less-browser/cache.js diff --git a/packages/less/src/less-browser/error-reporting.js b/packages/less/lib/less-browser/error-reporting.js similarity index 98% rename from packages/less/src/less-browser/error-reporting.js rename to packages/less/lib/less-browser/error-reporting.js index e1ef840ac..947b58b1e 100644 --- a/packages/less/src/less-browser/error-reporting.js +++ b/packages/less/lib/less-browser/error-reporting.js @@ -1,5 +1,5 @@ -import * as utils from './utils'; -import browser from './browser'; +import * as utils from './utils.js'; +import browser from './browser.js'; export default (window, less, options) => { diff --git a/packages/less/src/less-browser/file-manager.js b/packages/less/lib/less-browser/file-manager.js similarity index 100% rename from packages/less/src/less-browser/file-manager.js rename to packages/less/lib/less-browser/file-manager.js diff --git a/packages/less/src/less-browser/image-size.js b/packages/less/lib/less-browser/image-size.js similarity index 98% rename from packages/less/src/less-browser/image-size.js rename to packages/less/lib/less-browser/image-size.js index 8e3caccdf..6c69adb52 100644 --- a/packages/less/src/less-browser/image-size.js +++ b/packages/less/lib/less-browser/image-size.js @@ -1,5 +1,5 @@ -import functionRegistry from './../less/functions/function-registry'; +import functionRegistry from './../less/functions/function-registry.js'; export default () => { function imageSize() { diff --git a/packages/less/src/less-browser/index.js b/packages/less/lib/less-browser/index.js similarity index 95% rename from packages/less/src/less-browser/index.js rename to packages/less/lib/less-browser/index.js index 8529273eb..b10a2bf31 100644 --- a/packages/less/src/less-browser/index.js +++ b/packages/less/lib/less-browser/index.js @@ -2,15 +2,16 @@ // index.js // Should expose the additional browser functions on to the less object // -import {addDataAttr} from './utils'; -import lessRoot from '../less'; -import browser from './browser'; -import FM from './file-manager'; -import PluginLoader from './plugin-loader'; -import LogListener from './log-listener'; -import ErrorReporting from './error-reporting'; -import Cache from './cache'; -import ImageSize from './image-size'; +import {addDataAttr} from './utils.js'; +import lessRoot from '../less/index.js'; +import browser from './browser.js'; +import FM from './file-manager.js'; +import PluginLoader from './plugin-loader.js'; +import LogListener from './log-listener.js'; +import ErrorReporting from './error-reporting.js'; +import Cache from './cache.js'; +import ImageSize from './image-size.js'; +import pkg from '../../package.json'; /** * @param {Window} window @@ -18,7 +19,7 @@ import ImageSize from './image-size'; */ export default (window, options) => { const document = window.document; - const less = lessRoot(); + const less = lessRoot(undefined, undefined, pkg.version); less.options = options; const environment = less.environment; diff --git a/packages/less/src/less-browser/log-listener.js b/packages/less/lib/less-browser/log-listener.js similarity index 100% rename from packages/less/src/less-browser/log-listener.js rename to packages/less/lib/less-browser/log-listener.js diff --git a/packages/less/src/less-browser/plugin-loader.js b/packages/less/lib/less-browser/plugin-loader.js similarity index 100% rename from packages/less/src/less-browser/plugin-loader.js rename to packages/less/lib/less-browser/plugin-loader.js diff --git a/packages/less/src/less-browser/utils.js b/packages/less/lib/less-browser/utils.js similarity index 100% rename from packages/less/src/less-browser/utils.js rename to packages/less/lib/less-browser/utils.js diff --git a/packages/less/lib/less-node/environment.js b/packages/less/lib/less-node/environment.js new file mode 100644 index 000000000..f210f8f3a --- /dev/null +++ b/packages/less/lib/less-node/environment.js @@ -0,0 +1,43 @@ +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); + +class SourceMapGeneratorFallback { + addMapping(){} + setSourceContent(){} + toJSON(){ + return null; + } +}; + +export default { + encodeBase64: function encodeBase64(str) { + // Avoid Buffer constructor on newer versions of Node.js. + const buffer = (Buffer.from ? Buffer.from(str) : (new Buffer(str))); + return buffer.toString('base64'); + }, + mimeLookup: function (filename) { + try { + const mimeModule = require('mime'); + return mimeModule ? mimeModule.lookup(filename) : "application/octet-stream"; + } catch (e) { + return "application/octet-stream"; + } + }, + charsetLookup: function (mime) { + try { + const mimeModule = require('mime'); + return mimeModule ? mimeModule.charsets.lookup(mime) : undefined; + } catch (e) { + return undefined; + } + }, + getSourceMapGenerator: function getSourceMapGenerator() { + try { + const sourceMapModule = require('source-map'); + return sourceMapModule ? sourceMapModule.SourceMapGenerator : SourceMapGeneratorFallback; + } catch (e) { + return SourceMapGeneratorFallback; + } + } +}; diff --git a/packages/less/src/less-node/file-manager.js b/packages/less/lib/less-node/file-manager.js similarity index 98% rename from packages/less/src/less-node/file-manager.js rename to packages/less/lib/less-node/file-manager.js index 9f8f3f476..65d2c99bc 100644 --- a/packages/less/src/less-node/file-manager.js +++ b/packages/less/lib/less-node/file-manager.js @@ -1,7 +1,10 @@ import path from 'path'; -import fs from './fs'; +import { createRequire } from 'module'; +import fs from './fs.js'; import AbstractFileManager from '../less/environment/abstract-file-manager.js'; +const require = createRequire(import.meta.url); + const FileManager = function() {} FileManager.prototype = Object.assign(new AbstractFileManager(), { supports() { diff --git a/packages/less/lib/less-node/fs.js b/packages/less/lib/less-node/fs.js new file mode 100644 index 000000000..05acdcb61 --- /dev/null +++ b/packages/less/lib/less-node/fs.js @@ -0,0 +1,12 @@ +import nodeFs from 'fs'; +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); + +let fs; +try { + fs = require('graceful-fs'); +} catch (e) { + fs = nodeFs; +} +export default fs; diff --git a/packages/less/src/less-node/image-size.js b/packages/less/lib/less-node/image-size.js similarity index 90% rename from packages/less/src/less-node/image-size.js rename to packages/less/lib/less-node/image-size.js index c53edd62e..582393632 100644 --- a/packages/less/src/less-node/image-size.js +++ b/packages/less/lib/less-node/image-size.js @@ -1,6 +1,9 @@ -import Dimension from '../less/tree/dimension'; -import Expression from '../less/tree/expression'; -import functionRegistry from './../less/functions/function-registry'; +import { createRequire } from 'module'; +import Dimension from '../less/tree/dimension.js'; +import Expression from '../less/tree/expression.js'; +import functionRegistry from './../less/functions/function-registry.js'; + +const require = createRequire(import.meta.url); export default environment => { diff --git a/packages/less/lib/less-node/index.js b/packages/less/lib/less-node/index.js new file mode 100644 index 000000000..5d91921d0 --- /dev/null +++ b/packages/less/lib/less-node/index.js @@ -0,0 +1,31 @@ +import { createRequire } from 'module'; +import environment from './environment.js'; +import FileManager from './file-manager.js'; +import UrlFileManager from './url-file-manager.js'; +import createFromEnvironment from '../less/index.js'; +import lesscHelper from './lessc-helper.js'; +import PluginLoader from './plugin-loader.js'; +import fs from './fs.js'; +import defaultOptions from '../less/default-options.js'; +import imageSize from './image-size.js'; + +const require = createRequire(import.meta.url); +const { version } = require('../../package.json'); + +const less = createFromEnvironment(environment, [new FileManager(), new UrlFileManager()], version); + +// allow people to create less with their own environment +less.createFromEnvironment = createFromEnvironment; +less.lesscHelper = lesscHelper; +less.PluginLoader = PluginLoader; +less.fs = fs; +less.FileManager = FileManager; +less.UrlFileManager = UrlFileManager; + +// Set up options +less.options = defaultOptions(); + +// provide image-size functionality +imageSize(less.environment); + +export default less; diff --git a/packages/less/src/less-node/lessc-helper.js b/packages/less/lib/less-node/lessc-helper.js similarity index 97% rename from packages/less/src/less-node/lessc-helper.js rename to packages/less/lib/less-node/lessc-helper.js index 6103caa8d..137991ad6 100644 --- a/packages/less/src/less-node/lessc-helper.js +++ b/packages/less/lib/less-node/lessc-helper.js @@ -91,6 +91,5 @@ const lessc_helper = { } }; -// Exports helper functions -// eslint-disable-next-line no-prototype-builtins -for (const h in lessc_helper) { if (lessc_helper.hasOwnProperty(h)) { exports[h] = lessc_helper[h]; }} +export const { stylize, printUsage } = lessc_helper; +export default lessc_helper; diff --git a/packages/less/src/less-node/plugin-loader.js b/packages/less/lib/less-node/plugin-loader.js similarity index 95% rename from packages/less/src/less-node/plugin-loader.js rename to packages/less/lib/less-node/plugin-loader.js index d4a0b1d0e..cb11ca09c 100644 --- a/packages/less/src/less-node/plugin-loader.js +++ b/packages/less/lib/less-node/plugin-loader.js @@ -1,6 +1,9 @@ import path from 'path'; +import { createRequire } from 'module'; import AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js'; +const require = createRequire(import.meta.url); + /** * Node Plugin Loader */ diff --git a/packages/less/src/less-node/url-file-manager.js b/packages/less/lib/less-node/url-file-manager.js similarity index 94% rename from packages/less/src/less-node/url-file-manager.js rename to packages/less/lib/less-node/url-file-manager.js index 7a9092e22..ecc6a1893 100644 --- a/packages/less/src/less-node/url-file-manager.js +++ b/packages/less/lib/less-node/url-file-manager.js @@ -3,11 +3,15 @@ * @todo - remove top eslint rule when FileManagers have JSDoc type * and are TS-type-checked */ +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); + const isUrlRe = /^(?:https?:)?\/\//i; import url from 'url'; let request; import AbstractFileManager from '../less/environment/abstract-file-manager.js'; -import logger from '../less/logger'; +import logger from '../less/logger.js'; const UrlFileManager = function() {} UrlFileManager.prototype = Object.assign(new AbstractFileManager(), { diff --git a/packages/less/src/less/constants.js b/packages/less/lib/less/constants.js similarity index 100% rename from packages/less/src/less/constants.js rename to packages/less/lib/less/constants.js diff --git a/packages/less/src/less/contexts.js b/packages/less/lib/less/contexts.js similarity index 99% rename from packages/less/src/less/contexts.js rename to packages/less/lib/less/contexts.js index 6f38fa2f5..c3c848bbd 100644 --- a/packages/less/src/less/contexts.js +++ b/packages/less/lib/less/contexts.js @@ -1,6 +1,6 @@ const contexts = {}; export default contexts; -import * as Constants from './constants'; +import * as Constants from './constants.js'; const copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) { if (!original) { return; } diff --git a/packages/less/src/less/data/colors.js b/packages/less/lib/less/data/colors.js similarity index 100% rename from packages/less/src/less/data/colors.js rename to packages/less/lib/less/data/colors.js diff --git a/packages/less/lib/less/data/index.js b/packages/less/lib/less/data/index.js new file mode 100644 index 000000000..f3abd084a --- /dev/null +++ b/packages/less/lib/less/data/index.js @@ -0,0 +1,4 @@ +import colors from './colors.js'; +import unitConversions from './unit-conversions.js'; + +export default { colors, unitConversions }; diff --git a/packages/less/src/less/data/unit-conversions.js b/packages/less/lib/less/data/unit-conversions.js similarity index 100% rename from packages/less/src/less/data/unit-conversions.js rename to packages/less/lib/less/data/unit-conversions.js diff --git a/packages/less/src/less/default-options.js b/packages/less/lib/less/default-options.js similarity index 100% rename from packages/less/src/less/default-options.js rename to packages/less/lib/less/default-options.js diff --git a/packages/less/src/less/deprecation.js b/packages/less/lib/less/deprecation.js similarity index 100% rename from packages/less/src/less/deprecation.js rename to packages/less/lib/less/deprecation.js diff --git a/packages/less/src/less/environment/abstract-file-manager.js b/packages/less/lib/less/environment/abstract-file-manager.js similarity index 100% rename from packages/less/src/less/environment/abstract-file-manager.js rename to packages/less/lib/less/environment/abstract-file-manager.js diff --git a/packages/less/src/less/environment/abstract-plugin-loader.js b/packages/less/lib/less/environment/abstract-plugin-loader.js similarity index 98% rename from packages/less/src/less/environment/abstract-plugin-loader.js rename to packages/less/lib/less/environment/abstract-plugin-loader.js index 917c24baa..ce2aafb3f 100644 --- a/packages/less/src/less/environment/abstract-plugin-loader.js +++ b/packages/less/lib/less/environment/abstract-plugin-loader.js @@ -1,5 +1,5 @@ -import functionRegistry from '../functions/function-registry'; -import LessError from '../less-error'; +import functionRegistry from '../functions/function-registry.js'; +import LessError from '../less-error.js'; class AbstractPluginLoader { constructor() { diff --git a/packages/less/src/less/environment/environment-api.ts b/packages/less/lib/less/environment/environment-api.ts similarity index 100% rename from packages/less/src/less/environment/environment-api.ts rename to packages/less/lib/less/environment/environment-api.ts diff --git a/packages/less/src/less/environment/environment.js b/packages/less/lib/less/environment/environment.js similarity index 98% rename from packages/less/src/less/environment/environment.js rename to packages/less/lib/less/environment/environment.js index f7d65c6a1..3940929f3 100644 --- a/packages/less/src/less/environment/environment.js +++ b/packages/less/lib/less/environment/environment.js @@ -3,7 +3,7 @@ * environment, file managers, and plugin manager */ -import logger from '../logger'; +import logger from '../logger.js'; class Environment { constructor(externalEnvironment, fileManagers) { diff --git a/packages/less/src/less/environment/file-manager-api.ts b/packages/less/lib/less/environment/file-manager-api.ts similarity index 100% rename from packages/less/src/less/environment/file-manager-api.ts rename to packages/less/lib/less/environment/file-manager-api.ts diff --git a/packages/less/src/less/functions/boolean.js b/packages/less/lib/less/functions/boolean.js similarity index 87% rename from packages/less/src/less/functions/boolean.js rename to packages/less/lib/less/functions/boolean.js index e483bbb23..e6a57a3b3 100644 --- a/packages/less/src/less/functions/boolean.js +++ b/packages/less/lib/less/functions/boolean.js @@ -1,5 +1,5 @@ -import Anonymous from '../tree/anonymous'; -import Keyword from '../tree/keyword'; +import Anonymous from '../tree/anonymous.js'; +import Keyword from '../tree/keyword.js'; function boolean(condition) { return condition ? Keyword.True : Keyword.False; diff --git a/packages/less/src/less/functions/color-blending.js b/packages/less/lib/less/functions/color-blending.js similarity index 98% rename from packages/less/src/less/functions/color-blending.js rename to packages/less/lib/less/functions/color-blending.js index c38a5e426..4e7873701 100644 --- a/packages/less/src/less/functions/color-blending.js +++ b/packages/less/lib/less/functions/color-blending.js @@ -1,4 +1,4 @@ -import Color from '../tree/color'; +import Color from '../tree/color.js'; // Color Blending // ref: http://www.w3.org/TR/compositing-1 diff --git a/packages/less/src/less/functions/color.js b/packages/less/lib/less/functions/color.js similarity index 98% rename from packages/less/src/less/functions/color.js rename to packages/less/lib/less/functions/color.js index c49d233ce..6f5ee5b34 100644 --- a/packages/less/src/less/functions/color.js +++ b/packages/less/lib/less/functions/color.js @@ -1,9 +1,9 @@ -import Dimension from '../tree/dimension'; -import Color from '../tree/color'; -import Quoted from '../tree/quoted'; -import Anonymous from '../tree/anonymous'; -import Expression from '../tree/expression'; -import Operation from '../tree/operation'; +import Dimension from '../tree/dimension.js'; +import Color from '../tree/color.js'; +import Quoted from '../tree/quoted.js'; +import Anonymous from '../tree/anonymous.js'; +import Expression from '../tree/expression.js'; +import Operation from '../tree/operation.js'; let colorFunctions; function clamp(val) { diff --git a/packages/less/src/less/functions/data-uri.js b/packages/less/lib/less/functions/data-uri.js similarity index 94% rename from packages/less/src/less/functions/data-uri.js rename to packages/less/lib/less/functions/data-uri.js index 3c09c507f..a2ac67f53 100644 --- a/packages/less/src/less/functions/data-uri.js +++ b/packages/less/lib/less/functions/data-uri.js @@ -1,7 +1,7 @@ -import Quoted from '../tree/quoted'; -import URL from '../tree/url'; -import * as utils from '../utils'; -import logger from '../logger'; +import Quoted from '../tree/quoted.js'; +import URL from '../tree/url.js'; +import * as utils from '../utils.js'; +import logger from '../logger.js'; export default environment => { diff --git a/packages/less/src/less/functions/default.js b/packages/less/lib/less/functions/default.js similarity index 85% rename from packages/less/src/less/functions/default.js rename to packages/less/lib/less/functions/default.js index 61c14b9ac..8c59a4cb4 100644 --- a/packages/less/src/less/functions/default.js +++ b/packages/less/lib/less/functions/default.js @@ -1,5 +1,5 @@ -import Keyword from '../tree/keyword'; -import * as utils from '../utils'; +import Keyword from '../tree/keyword.js'; +import * as utils from '../utils.js'; const defaultFunc = { eval: function () { diff --git a/packages/less/src/less/functions/function-caller.js b/packages/less/lib/less/functions/function-caller.js similarity index 97% rename from packages/less/src/less/functions/function-caller.js rename to packages/less/lib/less/functions/function-caller.js index 4a46ec74b..19e6cf6b3 100644 --- a/packages/less/src/less/functions/function-caller.js +++ b/packages/less/lib/less/functions/function-caller.js @@ -1,4 +1,4 @@ -import Expression from '../tree/expression'; +import Expression from '../tree/expression.js'; class functionCaller { constructor(name, context, index, currentFileInfo) { diff --git a/packages/less/src/less/functions/function-registry.js b/packages/less/lib/less/functions/function-registry.js similarity index 100% rename from packages/less/src/less/functions/function-registry.js rename to packages/less/lib/less/functions/function-registry.js diff --git a/packages/less/src/less/functions/index.js b/packages/less/lib/less/functions/index.js similarity index 57% rename from packages/less/src/less/functions/index.js rename to packages/less/lib/less/functions/index.js index 160ac7523..9ceda8da4 100644 --- a/packages/less/src/less/functions/index.js +++ b/packages/less/lib/less/functions/index.js @@ -1,18 +1,18 @@ -import functionRegistry from './function-registry'; -import functionCaller from './function-caller'; +import functionRegistry from './function-registry.js'; +import functionCaller from './function-caller.js'; -import boolean from './boolean'; -import defaultFunc from './default'; -import color from './color'; -import colorBlending from './color-blending'; -import dataUri from './data-uri'; -import list from './list'; -import math from './math'; -import number from './number'; -import string from './string'; -import svg from './svg'; -import types from './types'; -import style from './style'; +import boolean from './boolean.js'; +import defaultFunc from './default.js'; +import color from './color.js'; +import colorBlending from './color-blending.js'; +import dataUri from './data-uri.js'; +import list from './list.js'; +import math from './math.js'; +import number from './number.js'; +import string from './string.js'; +import svg from './svg.js'; +import types from './types.js'; +import style from './style.js'; export default environment => { const functions = { functionRegistry, functionCaller }; diff --git a/packages/less/src/less/functions/list.js b/packages/less/lib/less/functions/list.js similarity index 90% rename from packages/less/src/less/functions/list.js rename to packages/less/lib/less/functions/list.js index 6ba33a305..14be82f29 100644 --- a/packages/less/src/less/functions/list.js +++ b/packages/less/lib/less/functions/list.js @@ -1,13 +1,13 @@ -import Comment from '../tree/comment'; -import Node from '../tree/node'; -import Dimension from '../tree/dimension'; -import Declaration from '../tree/declaration'; -import Expression from '../tree/expression'; -import Ruleset from '../tree/ruleset'; -import Selector from '../tree/selector'; -import Element from '../tree/element'; -import Quote from '../tree/quoted'; -import Value from '../tree/value'; +import Comment from '../tree/comment.js'; +import Node from '../tree/node.js'; +import Dimension from '../tree/dimension.js'; +import Declaration from '../tree/declaration.js'; +import Expression from '../tree/expression.js'; +import Ruleset from '../tree/ruleset.js'; +import Selector from '../tree/selector.js'; +import Element from '../tree/element.js'; +import Quote from '../tree/quoted.js'; +import Value from '../tree/value.js'; const getItemsFromNode = node => { // handle non-array values as an array of length 1 diff --git a/packages/less/src/less/functions/math-helper.js b/packages/less/lib/less/functions/math-helper.js similarity index 87% rename from packages/less/src/less/functions/math-helper.js rename to packages/less/lib/less/functions/math-helper.js index b557875c5..9803710e3 100644 --- a/packages/less/src/less/functions/math-helper.js +++ b/packages/less/lib/less/functions/math-helper.js @@ -1,4 +1,4 @@ -import Dimension from '../tree/dimension'; +import Dimension from '../tree/dimension.js'; const MathHelper = (fn, unit, n) => { if (!(n instanceof Dimension)) { diff --git a/packages/less/src/less/functions/math.js b/packages/less/lib/less/functions/math.js similarity index 100% rename from packages/less/src/less/functions/math.js rename to packages/less/lib/less/functions/math.js diff --git a/packages/less/src/less/functions/number.js b/packages/less/lib/less/functions/number.js similarity index 97% rename from packages/less/src/less/functions/number.js rename to packages/less/lib/less/functions/number.js index ccb97afef..8fa932aeb 100644 --- a/packages/less/src/less/functions/number.js +++ b/packages/less/lib/less/functions/number.js @@ -1,5 +1,5 @@ -import Dimension from '../tree/dimension'; -import Anonymous from '../tree/anonymous'; +import Dimension from '../tree/dimension.js'; +import Anonymous from '../tree/anonymous.js'; import mathHelper from './math-helper.js'; const minMax = function (isMin, args) { diff --git a/packages/less/src/less/functions/string.js b/packages/less/lib/less/functions/string.js similarity index 91% rename from packages/less/src/less/functions/string.js rename to packages/less/lib/less/functions/string.js index 2ded20551..b4de36356 100644 --- a/packages/less/src/less/functions/string.js +++ b/packages/less/lib/less/functions/string.js @@ -1,6 +1,6 @@ -import Quoted from '../tree/quoted'; -import Anonymous from '../tree/anonymous'; -import JavaScript from '../tree/javascript'; +import Quoted from '../tree/quoted.js'; +import Anonymous from '../tree/anonymous.js'; +import JavaScript from '../tree/javascript.js'; export default { e: function (str) { diff --git a/packages/less/src/less/functions/style.js b/packages/less/lib/less/functions/style.js similarity index 90% rename from packages/less/src/less/functions/style.js rename to packages/less/lib/less/functions/style.js index cb090ae8d..cbb10a363 100644 --- a/packages/less/src/less/functions/style.js +++ b/packages/less/lib/less/functions/style.js @@ -1,5 +1,5 @@ -import Variable from '../tree/variable'; -import Anonymous from '../tree/anonymous'; +import Variable from '../tree/variable.js'; +import Anonymous from '../tree/anonymous.js'; const styleExpression = function (args) { args = Array.prototype.slice.call(args); diff --git a/packages/less/src/less/functions/svg.js b/packages/less/lib/less/functions/svg.js similarity index 94% rename from packages/less/src/less/functions/svg.js rename to packages/less/lib/less/functions/svg.js index a1d06314c..2c2fd30a9 100644 --- a/packages/less/src/less/functions/svg.js +++ b/packages/less/lib/less/functions/svg.js @@ -1,8 +1,8 @@ -import Dimension from '../tree/dimension'; -import Color from '../tree/color'; -import Expression from '../tree/expression'; -import Quoted from '../tree/quoted'; -import URL from '../tree/url'; +import Dimension from '../tree/dimension.js'; +import Color from '../tree/color.js'; +import Expression from '../tree/expression.js'; +import Quoted from '../tree/quoted.js'; +import URL from '../tree/url.js'; export default () => { return { 'svg-gradient': function(direction) { diff --git a/packages/less/src/less/functions/types.js b/packages/less/lib/less/functions/types.js similarity index 83% rename from packages/less/src/less/functions/types.js rename to packages/less/lib/less/functions/types.js index 6f1aff30f..1f065f680 100644 --- a/packages/less/src/less/functions/types.js +++ b/packages/less/lib/less/functions/types.js @@ -1,11 +1,11 @@ -import Keyword from '../tree/keyword'; -import DetachedRuleset from '../tree/detached-ruleset'; -import Dimension from '../tree/dimension'; -import Color from '../tree/color'; -import Quoted from '../tree/quoted'; -import Anonymous from '../tree/anonymous'; -import URL from '../tree/url'; -import Operation from '../tree/operation'; +import Keyword from '../tree/keyword.js'; +import DetachedRuleset from '../tree/detached-ruleset.js'; +import Dimension from '../tree/dimension.js'; +import Color from '../tree/color.js'; +import Quoted from '../tree/quoted.js'; +import Anonymous from '../tree/anonymous.js'; +import URL from '../tree/url.js'; +import Operation from '../tree/operation.js'; const isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False; const isunit = (n, unit) => { diff --git a/packages/less/src/less/import-manager.js b/packages/less/lib/less/import-manager.js similarity index 97% rename from packages/less/src/less/import-manager.js rename to packages/less/lib/less/import-manager.js index 350f242db..886d30678 100644 --- a/packages/less/src/less/import-manager.js +++ b/packages/less/lib/less/import-manager.js @@ -1,8 +1,8 @@ -import contexts from './contexts'; -import Parser from './parser/parser'; -import LessError from './less-error'; -import * as utils from './utils'; -import logger from './logger'; +import contexts from './contexts.js'; +import Parser from './parser/parser.js'; +import LessError from './less-error.js'; +import * as utils from './utils.js'; +import logger from './logger.js'; export default function(environment) { // FileInfo = { diff --git a/packages/less/src/less/index.js b/packages/less/lib/less/index.js similarity index 72% rename from packages/less/src/less/index.js rename to packages/less/lib/less/index.js index e10d0a12c..21a53834c 100644 --- a/packages/less/src/less/index.js +++ b/packages/less/lib/less/index.js @@ -1,27 +1,26 @@ -import Environment from './environment/environment'; -import data from './data'; -import tree from './tree'; -import AbstractFileManager from './environment/abstract-file-manager'; -import AbstractPluginLoader from './environment/abstract-plugin-loader'; -import visitors from './visitors'; -import Parser from './parser/parser'; -import functions from './functions'; -import contexts from './contexts'; -import LessError from './less-error'; -import transformTree from './transform-tree'; -import * as utils from './utils'; -import PluginManager from './plugin-manager'; -import logger from './logger'; -import SourceMapOutput from './source-map-output'; -import SourceMapBuilder from './source-map-builder'; -import ParseTree from './parse-tree'; -import ImportManager from './import-manager'; -import Parse from './parse'; -import Render from './render'; -import { version } from '../../package.json'; +import Environment from './environment/environment.js'; +import data from './data/index.js'; +import tree from './tree/index.js'; +import AbstractFileManager from './environment/abstract-file-manager.js'; +import AbstractPluginLoader from './environment/abstract-plugin-loader.js'; +import visitors from './visitors/index.js'; +import Parser from './parser/parser.js'; +import functions from './functions/index.js'; +import contexts from './contexts.js'; +import LessError from './less-error.js'; +import transformTree from './transform-tree.js'; +import * as utils from './utils.js'; +import PluginManager from './plugin-manager.js'; +import logger from './logger.js'; +import SourceMapOutput from './source-map-output.js'; +import SourceMapBuilder from './source-map-builder.js'; +import ParseTree from './parse-tree.js'; +import ImportManager from './import-manager.js'; +import Parse from './parse.js'; +import Render from './render.js'; import parseVersion from 'parse-node-version'; -export default function(environment, fileManagers) { +export default function(environment, fileManagers, version = '0.0.0') { let sourceMapOutput, sourceMapBuilder, parseTree, importManager; environment = new Environment(environment, fileManagers); diff --git a/packages/less/src/less/less-error.js b/packages/less/lib/less/less-error.js similarity index 99% rename from packages/less/src/less/less-error.js rename to packages/less/lib/less/less-error.js index ee08b3e31..659cdb0a4 100644 --- a/packages/less/src/less/less-error.js +++ b/packages/less/lib/less/less-error.js @@ -1,4 +1,4 @@ -import * as utils from './utils'; +import * as utils from './utils.js'; const anonymousFunc = /(|Function):(\d+):(\d+)/; diff --git a/packages/less/src/less/logger.js b/packages/less/lib/less/logger.js similarity index 100% rename from packages/less/src/less/logger.js rename to packages/less/lib/less/logger.js diff --git a/packages/less/src/less/parse-tree.js b/packages/less/lib/less/parse-tree.js similarity index 93% rename from packages/less/src/less/parse-tree.js rename to packages/less/lib/less/parse-tree.js index f4e578ea7..939ab1dfb 100644 --- a/packages/less/src/less/parse-tree.js +++ b/packages/less/lib/less/parse-tree.js @@ -1,6 +1,6 @@ -import LessError from './less-error'; -import transformTree from './transform-tree'; -import logger from './logger'; +import LessError from './less-error.js'; +import transformTree from './transform-tree.js'; +import logger from './logger.js'; export default function(SourceMapBuilder) { class ParseTree { @@ -75,17 +75,17 @@ export default function(SourceMapBuilder) { // Use output filename + .map sourceMapOpts.sourceMapFilename = sourceMapOpts.sourceMapOutputFilename + '.map'; } else if (options.filename) { - // Fallback to input filename + .css.map - const inputBase = options.filename.replace(/\.[^/.]+$/, ''); - sourceMapOpts.sourceMapFilename = inputBase + '.css.map'; + // Fallback to input filename + .css.map (basename only) + const inputBasename = options.filename.split(/[/\\]/).pop().replace(/\.[^/.]+$/, ''); + sourceMapOpts.sourceMapFilename = inputBasename + '.css.map'; } } // Default sourceMapOutputFilename if not set if (!sourceMapOpts.sourceMapOutputFilename) { if (options.filename) { - const inputBase = options.filename.replace(/\.[^/.]+$/, ''); - sourceMapOpts.sourceMapOutputFilename = inputBase + '.css'; + const inputBasename = options.filename.split(/[/\\]/).pop().replace(/\.[^/.]+$/, ''); + sourceMapOpts.sourceMapOutputFilename = inputBasename + '.css'; } else { sourceMapOpts.sourceMapOutputFilename = 'output.css'; } diff --git a/packages/less/src/less/parse.js b/packages/less/lib/less/parse.js similarity index 93% rename from packages/less/src/less/parse.js rename to packages/less/lib/less/parse.js index 9a27e6155..a552fcd17 100644 --- a/packages/less/src/less/parse.js +++ b/packages/less/lib/less/parse.js @@ -1,8 +1,8 @@ -import contexts from './contexts'; -import Parser from './parser/parser'; -import PluginManager from './plugin-manager'; -import LessError from './less-error'; -import * as utils from './utils'; +import contexts from './contexts.js'; +import Parser from './parser/parser.js'; +import PluginManager from './plugin-manager.js'; +import LessError from './less-error.js'; +import * as utils from './utils.js'; export default function(environment, ParseTree, ImportManager) { const parse = function (input, options, callback) { diff --git a/packages/less/src/less/parser/parser-input.js b/packages/less/lib/less/parser/parser-input.js similarity index 100% rename from packages/less/src/less/parser/parser-input.js rename to packages/less/lib/less/parser/parser-input.js diff --git a/packages/less/src/less/parser/parser.js b/packages/less/lib/less/parser/parser.js similarity index 99% rename from packages/less/src/less/parser/parser.js rename to packages/less/lib/less/parser/parser.js index 6cdfeafef..91b23a093 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -1,14 +1,14 @@ -import LessError from '../less-error'; -import tree from '../tree'; -import visitors from '../visitors'; -import getParserInput from './parser-input'; -import * as utils from '../utils'; -import functionRegistry from '../functions/function-registry'; -import { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax'; -import logger from '../logger'; -import { DeprecationHandler } from '../deprecation'; -import Selector from '../tree/selector'; -import Anonymous from '../tree/anonymous'; +import LessError from '../less-error.js'; +import tree from '../tree/index.js'; +import visitors from '../visitors/index.js'; +import getParserInput from './parser-input.js'; +import * as utils from '../utils.js'; +import functionRegistry from '../functions/function-registry.js'; +import { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax.js'; +import logger from '../logger.js'; +import { DeprecationHandler } from '../deprecation.js'; +import Selector from '../tree/selector.js'; +import Anonymous from '../tree/anonymous.js'; // // less.js - parser diff --git a/packages/less/src/less/plugin-manager.js b/packages/less/lib/less/plugin-manager.js similarity index 100% rename from packages/less/src/less/plugin-manager.js rename to packages/less/lib/less/plugin-manager.js diff --git a/packages/less/src/less/render.js b/packages/less/lib/less/render.js similarity index 97% rename from packages/less/src/less/render.js rename to packages/less/lib/less/render.js index 8d25b1701..909a9663e 100644 --- a/packages/less/src/less/render.js +++ b/packages/less/lib/less/render.js @@ -1,4 +1,4 @@ -import * as utils from './utils'; +import * as utils from './utils.js'; export default function(environment, ParseTree) { const render = function (input, options, callback) { diff --git a/packages/less/src/less/source-map-builder.js b/packages/less/lib/less/source-map-builder.js similarity index 100% rename from packages/less/src/less/source-map-builder.js rename to packages/less/lib/less/source-map-builder.js diff --git a/packages/less/src/less/source-map-output.js b/packages/less/lib/less/source-map-output.js similarity index 100% rename from packages/less/src/less/source-map-output.js rename to packages/less/lib/less/source-map-output.js diff --git a/packages/less/src/less/transform-tree.js b/packages/less/lib/less/transform-tree.js similarity index 96% rename from packages/less/src/less/transform-tree.js rename to packages/less/lib/less/transform-tree.js index 8426f3201..f8402764c 100644 --- a/packages/less/src/less/transform-tree.js +++ b/packages/less/lib/less/transform-tree.js @@ -1,6 +1,6 @@ -import contexts from './contexts'; -import visitor from './visitors'; -import tree from './tree'; +import contexts from './contexts.js'; +import visitor from './visitors/index.js'; +import tree from './tree/index.js'; export default function(root, options) { options = options || {}; diff --git a/packages/less/src/less/tree/anonymous.js b/packages/less/lib/less/tree/anonymous.js similarity index 97% rename from packages/less/src/less/tree/anonymous.js rename to packages/less/lib/less/tree/anonymous.js index 9c40a9526..b5764c5e5 100644 --- a/packages/less/src/less/tree/anonymous.js +++ b/packages/less/lib/less/tree/anonymous.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { this.value = value; diff --git a/packages/less/src/less/tree/assignment.js b/packages/less/lib/less/tree/assignment.js similarity index 95% rename from packages/less/src/less/tree/assignment.js rename to packages/less/lib/less/tree/assignment.js index 564d9220d..fa137d09b 100644 --- a/packages/less/src/less/tree/assignment.js +++ b/packages/less/lib/less/tree/assignment.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Assignment = function(key, val) { this.key = key; diff --git a/packages/less/src/less/tree/atrule-syntax.js b/packages/less/lib/less/tree/atrule-syntax.js similarity index 100% rename from packages/less/src/less/tree/atrule-syntax.js rename to packages/less/lib/less/tree/atrule-syntax.js diff --git a/packages/less/src/less/tree/atrule.js b/packages/less/lib/less/tree/atrule.js similarity index 97% rename from packages/less/src/less/tree/atrule.js rename to packages/less/lib/less/tree/atrule.js index d1cf3513f..ba5378340 100644 --- a/packages/less/src/less/tree/atrule.js +++ b/packages/less/lib/less/tree/atrule.js @@ -1,9 +1,9 @@ -import Node from './node'; -import Selector from './selector'; -import Ruleset from './ruleset'; -import Anonymous from './anonymous'; -import NestableAtRulePrototype from './nested-at-rule'; -import mergeRules from './merge-rules'; +import Node from './node.js'; +import Selector from './selector.js'; +import Ruleset from './ruleset.js'; +import Anonymous from './anonymous.js'; +import NestableAtRulePrototype from './nested-at-rule.js'; +import mergeRules from './merge-rules.js'; const AtRule = function( name, diff --git a/packages/less/src/less/tree/attribute.js b/packages/less/lib/less/tree/attribute.js similarity index 96% rename from packages/less/src/less/tree/attribute.js rename to packages/less/lib/less/tree/attribute.js index e716d13d8..8cf15ce5b 100644 --- a/packages/less/src/less/tree/attribute.js +++ b/packages/less/lib/less/tree/attribute.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Attribute = function(key, op, value, cif) { this.key = key; diff --git a/packages/less/src/less/tree/call.js b/packages/less/lib/less/tree/call.js similarity index 96% rename from packages/less/src/less/tree/call.js rename to packages/less/lib/less/tree/call.js index 15e98eb80..1653d5c9f 100644 --- a/packages/less/src/less/tree/call.js +++ b/packages/less/lib/less/tree/call.js @@ -1,6 +1,6 @@ -import Node from './node'; -import Anonymous from './anonymous'; -import FunctionCaller from '../functions/function-caller'; +import Node from './node.js'; +import Anonymous from './anonymous.js'; +import FunctionCaller from '../functions/function-caller.js'; // // A function call node. diff --git a/packages/less/src/less/tree/color.js b/packages/less/lib/less/tree/color.js similarity index 99% rename from packages/less/src/less/tree/color.js rename to packages/less/lib/less/tree/color.js index 906e69167..8d0315a93 100644 --- a/packages/less/src/less/tree/color.js +++ b/packages/less/lib/less/tree/color.js @@ -1,5 +1,5 @@ -import Node from './node'; -import colors from '../data/colors'; +import Node from './node.js'; +import colors from '../data/colors.js'; // // RGB Colors - #ff0014, #eee diff --git a/packages/less/src/less/tree/combinator.js b/packages/less/lib/less/tree/combinator.js similarity index 95% rename from packages/less/src/less/tree/combinator.js rename to packages/less/lib/less/tree/combinator.js index a98347699..4d6958d94 100644 --- a/packages/less/src/less/tree/combinator.js +++ b/packages/less/lib/less/tree/combinator.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const _noSpaceCombinators = { '': true, ' ': true, diff --git a/packages/less/src/less/tree/comment.js b/packages/less/lib/less/tree/comment.js similarity index 90% rename from packages/less/src/less/tree/comment.js rename to packages/less/lib/less/tree/comment.js index ce18c4e58..38ba40733 100644 --- a/packages/less/src/less/tree/comment.js +++ b/packages/less/lib/less/tree/comment.js @@ -1,5 +1,5 @@ -import Node from './node'; -import getDebugInfo from './debug-info'; +import Node from './node.js'; +import getDebugInfo from './debug-info.js'; const Comment = function(value, isLineComment, index, currentFileInfo) { this.value = value; diff --git a/packages/less/src/less/tree/condition.js b/packages/less/lib/less/tree/condition.js similarity index 97% rename from packages/less/src/less/tree/condition.js rename to packages/less/lib/less/tree/condition.js index 4ae3beb43..64e99933e 100644 --- a/packages/less/src/less/tree/condition.js +++ b/packages/less/lib/less/tree/condition.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Condition = function(op, l, r, i, negate) { this.op = op.trim(); diff --git a/packages/less/src/less/tree/container.js b/packages/less/lib/less/tree/container.js similarity index 90% rename from packages/less/src/less/tree/container.js rename to packages/less/lib/less/tree/container.js index 2b84b7926..c955f43e8 100644 --- a/packages/less/src/less/tree/container.js +++ b/packages/less/lib/less/tree/container.js @@ -1,8 +1,8 @@ -import Ruleset from './ruleset'; -import Value from './value'; -import Selector from './selector'; -import AtRule from './atrule'; -import NestableAtRulePrototype from './nested-at-rule'; +import Ruleset from './ruleset.js'; +import Value from './value.js'; +import Selector from './selector.js'; +import AtRule from './atrule.js'; +import NestableAtRulePrototype from './nested-at-rule.js'; const Container = function(value, features, index, currentFileInfo, visibilityInfo) { this._index = index; diff --git a/packages/less/src/less/tree/debug-info.js b/packages/less/lib/less/tree/debug-info.js similarity index 100% rename from packages/less/src/less/tree/debug-info.js rename to packages/less/lib/less/tree/debug-info.js diff --git a/packages/less/src/less/tree/declaration.js b/packages/less/lib/less/tree/declaration.js similarity index 95% rename from packages/less/src/less/tree/declaration.js rename to packages/less/lib/less/tree/declaration.js index 9291f495e..ca75d848d 100644 --- a/packages/less/src/less/tree/declaration.js +++ b/packages/less/lib/less/tree/declaration.js @@ -1,8 +1,8 @@ -import Node from './node'; -import Value from './value'; -import Keyword from './keyword'; -import Anonymous from './anonymous'; -import * as Constants from '../constants'; +import Node from './node.js'; +import Value from './value.js'; +import Keyword from './keyword.js'; +import Anonymous from './anonymous.js'; +import * as Constants from '../constants.js'; const MATH = Constants.Math; function evalName(context, name) { diff --git a/packages/less/src/less/tree/detached-ruleset.js b/packages/less/lib/less/tree/detached-ruleset.js similarity index 86% rename from packages/less/src/less/tree/detached-ruleset.js rename to packages/less/lib/less/tree/detached-ruleset.js index de5d91535..224ec918b 100644 --- a/packages/less/src/less/tree/detached-ruleset.js +++ b/packages/less/lib/less/tree/detached-ruleset.js @@ -1,6 +1,6 @@ -import Node from './node'; -import contexts from '../contexts'; -import * as utils from '../utils'; +import Node from './node.js'; +import contexts from '../contexts.js'; +import * as utils from '../utils.js'; const DetachedRuleset = function(ruleset, frames) { this.ruleset = ruleset; diff --git a/packages/less/src/less/tree/dimension.js b/packages/less/lib/less/tree/dimension.js similarity index 97% rename from packages/less/src/less/tree/dimension.js rename to packages/less/lib/less/tree/dimension.js index 2a8e61b82..1dad80ac8 100644 --- a/packages/less/src/less/tree/dimension.js +++ b/packages/less/lib/less/tree/dimension.js @@ -1,8 +1,8 @@ /* eslint-disable no-prototype-builtins */ -import Node from './node'; -import unitConversions from '../data/unit-conversions'; -import Unit from './unit'; -import Color from './color'; +import Node from './node.js'; +import unitConversions from '../data/unit-conversions.js'; +import Unit from './unit.js'; +import Color from './color.js'; // // A number with a unit diff --git a/packages/less/src/less/tree/element.js b/packages/less/lib/less/tree/element.js similarity index 95% rename from packages/less/src/less/tree/element.js rename to packages/less/lib/less/tree/element.js index 4331fbc44..30fb81c48 100644 --- a/packages/less/src/less/tree/element.js +++ b/packages/less/lib/less/tree/element.js @@ -1,6 +1,6 @@ -import Node from './node'; -import Paren from './paren'; -import Combinator from './combinator'; +import Node from './node.js'; +import Paren from './paren.js'; +import Combinator from './combinator.js'; const Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { this.combinator = combinator instanceof Combinator ? diff --git a/packages/less/src/less/tree/expression.js b/packages/less/lib/less/tree/expression.js similarity index 92% rename from packages/less/src/less/tree/expression.js rename to packages/less/lib/less/tree/expression.js index e4d370555..3bcd606fc 100644 --- a/packages/less/src/less/tree/expression.js +++ b/packages/less/lib/less/tree/expression.js @@ -1,8 +1,8 @@ -import Node from './node'; -import Paren from './paren'; -import Comment from './comment'; -import Dimension from './dimension'; -import Anonymous from './anonymous'; +import Node from './node.js'; +import Paren from './paren.js'; +import Comment from './comment.js'; +import Dimension from './dimension.js'; +import Anonymous from './anonymous.js'; const Expression = function(value, noSpacing) { this.value = value; diff --git a/packages/less/src/less/tree/extend.js b/packages/less/lib/less/tree/extend.js similarity index 96% rename from packages/less/src/less/tree/extend.js rename to packages/less/lib/less/tree/extend.js index 19ca6afe5..78e402a33 100644 --- a/packages/less/src/less/tree/extend.js +++ b/packages/less/lib/less/tree/extend.js @@ -1,5 +1,5 @@ -import Node from './node'; -import Selector from './selector'; +import Node from './node.js'; +import Selector from './selector.js'; const Extend = function(selector, option, index, currentFileInfo, visibilityInfo) { this.selector = selector; diff --git a/packages/less/src/less/tree/import.js b/packages/less/lib/less/tree/import.js similarity index 96% rename from packages/less/src/less/tree/import.js rename to packages/less/lib/less/tree/import.js index 0ba9e3038..599321b9b 100644 --- a/packages/less/src/less/tree/import.js +++ b/packages/less/lib/less/tree/import.js @@ -1,12 +1,12 @@ -import Node from './node'; -import Media from './media'; -import URL from './url'; -import Quoted from './quoted'; -import Ruleset from './ruleset'; -import Anonymous from './anonymous'; -import * as utils from '../utils'; -import LessError from '../less-error'; -import Expression from './expression'; +import Node from './node.js'; +import Media from './media.js'; +import URL from './url.js'; +import Quoted from './quoted.js'; +import Ruleset from './ruleset.js'; +import Anonymous from './anonymous.js'; +import * as utils from '../utils.js'; +import LessError from '../less-error.js'; +import Expression from './expression.js'; // // CSS @import node diff --git a/packages/less/lib/less/tree/index.js b/packages/less/lib/less/tree/index.js new file mode 100644 index 000000000..a6460b709 --- /dev/null +++ b/packages/less/lib/less/tree/index.js @@ -0,0 +1,55 @@ +import Node from './node.js'; +import Color from './color.js'; +import AtRule from './atrule.js'; +import DetachedRuleset from './detached-ruleset.js'; +import Operation from './operation.js'; +import Dimension from './dimension.js'; +import Unit from './unit.js'; +import Keyword from './keyword.js'; +import Variable from './variable.js'; +import Property from './property.js'; +import Ruleset from './ruleset.js'; +import Element from './element.js'; +import Attribute from './attribute.js'; +import Combinator from './combinator.js'; +import Selector from './selector.js'; +import Quoted from './quoted.js'; +import Expression from './expression.js'; +import Declaration from './declaration.js'; +import Call from './call.js'; +import URL from './url.js'; +import Import from './import.js'; +import Comment from './comment.js'; +import Anonymous from './anonymous.js'; +import Value from './value.js'; +import JavaScript from './javascript.js'; +import Assignment from './assignment.js'; +import Condition from './condition.js'; +import QueryInParens from './query-in-parens.js'; +import Paren from './paren.js'; +import Media from './media.js'; +import Container from './container.js'; +import UnicodeDescriptor from './unicode-descriptor.js'; +import Negative from './negative.js'; +import Extend from './extend.js'; +import VariableCall from './variable-call.js'; +import NamespaceValue from './namespace-value.js'; + +// mixins +import MixinCall from './mixin-call.js'; +import MixinDefinition from './mixin-definition.js'; + +export default { + Node, Color, AtRule, DetachedRuleset, Operation, + Dimension, Unit, Keyword, Variable, Property, + Ruleset, Element, Attribute, Combinator, Selector, + Quoted, Expression, Declaration, Call, URL, Import, + Comment, Anonymous, Value, JavaScript, Assignment, + Condition, Paren, Media, Container, QueryInParens, + UnicodeDescriptor, Negative, Extend, VariableCall, + NamespaceValue, + mixin: { + Call: MixinCall, + Definition: MixinDefinition + } +}; \ No newline at end of file diff --git a/packages/less/src/less/tree/javascript.js b/packages/less/lib/less/tree/javascript.js similarity index 83% rename from packages/less/src/less/tree/javascript.js rename to packages/less/lib/less/tree/javascript.js index ebdeeed88..9cdd3f1ee 100644 --- a/packages/less/src/less/tree/javascript.js +++ b/packages/less/lib/less/tree/javascript.js @@ -1,7 +1,7 @@ -import JsEvalNode from './js-eval-node'; -import Dimension from './dimension'; -import Quoted from './quoted'; -import Anonymous from './anonymous'; +import JsEvalNode from './js-eval-node.js'; +import Dimension from './dimension.js'; +import Quoted from './quoted.js'; +import Anonymous from './anonymous.js'; const JavaScript = function(string, escaped, index, currentFileInfo) { this.escaped = escaped; diff --git a/packages/less/src/less/tree/js-eval-node.js b/packages/less/lib/less/tree/js-eval-node.js similarity index 96% rename from packages/less/src/less/tree/js-eval-node.js rename to packages/less/lib/less/tree/js-eval-node.js index e57a22140..574496467 100644 --- a/packages/less/src/less/tree/js-eval-node.js +++ b/packages/less/lib/less/tree/js-eval-node.js @@ -1,5 +1,5 @@ -import Node from './node'; -import Variable from './variable'; +import Node from './node.js'; +import Variable from './variable.js'; const JsEvalNode = function() {}; diff --git a/packages/less/src/less/tree/keyword.js b/packages/less/lib/less/tree/keyword.js similarity index 93% rename from packages/less/src/less/tree/keyword.js rename to packages/less/lib/less/tree/keyword.js index d3b3704e8..bf7ab8807 100644 --- a/packages/less/src/less/tree/keyword.js +++ b/packages/less/lib/less/tree/keyword.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Keyword = function(value) { this.value = value; diff --git a/packages/less/src/less/tree/media.js b/packages/less/lib/less/tree/media.js similarity index 90% rename from packages/less/src/less/tree/media.js rename to packages/less/lib/less/tree/media.js index 7ecd66936..5e01eeb49 100644 --- a/packages/less/src/less/tree/media.js +++ b/packages/less/lib/less/tree/media.js @@ -1,8 +1,8 @@ -import Ruleset from './ruleset'; -import Value from './value'; -import Selector from './selector'; -import AtRule from './atrule'; -import NestableAtRulePrototype from './nested-at-rule'; +import Ruleset from './ruleset.js'; +import Value from './value.js'; +import Selector from './selector.js'; +import AtRule from './atrule.js'; +import NestableAtRulePrototype from './nested-at-rule.js'; const Media = function(value, features, index, currentFileInfo, visibilityInfo) { this._index = index; diff --git a/packages/less/src/less/tree/merge-rules.js b/packages/less/lib/less/tree/merge-rules.js similarity index 93% rename from packages/less/src/less/tree/merge-rules.js rename to packages/less/lib/less/tree/merge-rules.js index 9adb08d16..10f48e105 100644 --- a/packages/less/src/less/tree/merge-rules.js +++ b/packages/less/lib/less/tree/merge-rules.js @@ -1,5 +1,5 @@ -import Expression from './expression'; -import Value from './value'; +import Expression from './expression.js'; +import Value from './value.js'; /** * Merges declarations with merge flags (+ or ,) into combined values. diff --git a/packages/less/src/less/tree/mixin-call.js b/packages/less/lib/less/tree/mixin-call.js similarity index 97% rename from packages/less/src/less/tree/mixin-call.js rename to packages/less/lib/less/tree/mixin-call.js index 36e6b41ff..3b4219811 100644 --- a/packages/less/src/less/tree/mixin-call.js +++ b/packages/less/lib/less/tree/mixin-call.js @@ -1,7 +1,7 @@ -import Node from './node'; -import Selector from './selector'; -import MixinDefinition from './mixin-definition'; -import defaultFunc from '../functions/default'; +import Node from './node.js'; +import Selector from './selector.js'; +import MixinDefinition from './mixin-definition.js'; +import defaultFunc from '../functions/default.js'; const MixinCall = function(elements, args, index, currentFileInfo, important) { this.selector = new Selector(elements); diff --git a/packages/less/src/less/tree/mixin-definition.js b/packages/less/lib/less/tree/mixin-definition.js similarity index 95% rename from packages/less/src/less/tree/mixin-definition.js rename to packages/less/lib/less/tree/mixin-definition.js index eb22c44b0..ff6b393a4 100644 --- a/packages/less/src/less/tree/mixin-definition.js +++ b/packages/less/lib/less/tree/mixin-definition.js @@ -1,11 +1,11 @@ -import Selector from './selector'; -import Element from './element'; -import Ruleset from './ruleset'; -import Declaration from './declaration'; -import DetachedRuleset from './detached-ruleset'; -import Expression from './expression'; -import contexts from '../contexts'; -import * as utils from '../utils'; +import Selector from './selector.js'; +import Element from './element.js'; +import Ruleset from './ruleset.js'; +import Declaration from './declaration.js'; +import DetachedRuleset from './detached-ruleset.js'; +import Expression from './expression.js'; +import contexts from '../contexts.js'; +import * as utils from '../utils.js'; const Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) { this.name = name || 'anonymous mixin'; diff --git a/packages/less/src/less/tree/namespace-value.js b/packages/less/lib/less/tree/namespace-value.js similarity index 94% rename from packages/less/src/less/tree/namespace-value.js rename to packages/less/lib/less/tree/namespace-value.js index 6a6fa46f0..0a18fc96c 100644 --- a/packages/less/src/less/tree/namespace-value.js +++ b/packages/less/lib/less/tree/namespace-value.js @@ -1,7 +1,7 @@ -import Node from './node'; -import Variable from './variable'; -import Ruleset from './ruleset'; -import Selector from './selector'; +import Node from './node.js'; +import Variable from './variable.js'; +import Ruleset from './ruleset.js'; +import Selector from './selector.js'; const NamespaceValue = function(ruleCall, lookups, index, fileInfo) { this.value = ruleCall; diff --git a/packages/less/src/less/tree/negative.js b/packages/less/lib/less/tree/negative.js similarity index 81% rename from packages/less/src/less/tree/negative.js rename to packages/less/lib/less/tree/negative.js index 7e1bcf1b2..0bedb65fc 100644 --- a/packages/less/src/less/tree/negative.js +++ b/packages/less/lib/less/tree/negative.js @@ -1,6 +1,6 @@ -import Node from './node'; -import Operation from './operation'; -import Dimension from './dimension'; +import Node from './node.js'; +import Operation from './operation.js'; +import Dimension from './dimension.js'; const Negative = function(node) { this.value = node; diff --git a/packages/less/src/less/tree/nested-at-rule.js b/packages/less/lib/less/tree/nested-at-rule.js similarity index 94% rename from packages/less/src/less/tree/nested-at-rule.js rename to packages/less/lib/less/tree/nested-at-rule.js index b0cde0876..2358f3cc1 100644 --- a/packages/less/src/less/tree/nested-at-rule.js +++ b/packages/less/lib/less/tree/nested-at-rule.js @@ -1,9 +1,9 @@ -import Ruleset from './ruleset'; -import Value from './value'; -import Selector from './selector'; -import Anonymous from './anonymous'; -import Expression from './expression'; -import * as utils from '../utils'; +import Ruleset from './ruleset.js'; +import Value from './value.js'; +import Selector from './selector.js'; +import Anonymous from './anonymous.js'; +import Expression from './expression.js'; +import * as utils from '../utils.js'; const NestableAtRulePrototype = { diff --git a/packages/less/src/less/tree/node.js b/packages/less/lib/less/tree/node.js similarity index 100% rename from packages/less/src/less/tree/node.js rename to packages/less/lib/less/tree/node.js diff --git a/packages/less/src/less/tree/operation.js b/packages/less/lib/less/tree/operation.js similarity index 91% rename from packages/less/src/less/tree/operation.js rename to packages/less/lib/less/tree/operation.js index 2805326be..f220749cb 100644 --- a/packages/less/src/less/tree/operation.js +++ b/packages/less/lib/less/tree/operation.js @@ -1,7 +1,7 @@ -import Node from './node'; -import Color from './color'; -import Dimension from './dimension'; -import * as Constants from '../constants'; +import Node from './node.js'; +import Color from './color.js'; +import Dimension from './dimension.js'; +import * as Constants from '../constants.js'; const MATH = Constants.Math; diff --git a/packages/less/src/less/tree/paren.js b/packages/less/lib/less/tree/paren.js similarity index 94% rename from packages/less/src/less/tree/paren.js rename to packages/less/lib/less/tree/paren.js index 248bfde6c..a9940e392 100644 --- a/packages/less/src/less/tree/paren.js +++ b/packages/less/lib/less/tree/paren.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Paren = function(node) { this.value = node; diff --git a/packages/less/src/less/tree/property.js b/packages/less/lib/less/tree/property.js similarity index 96% rename from packages/less/src/less/tree/property.js rename to packages/less/lib/less/tree/property.js index d3b34fce7..183ad9bec 100644 --- a/packages/less/src/less/tree/property.js +++ b/packages/less/lib/less/tree/property.js @@ -1,5 +1,5 @@ -import Node from './node'; -import Declaration from './declaration'; +import Node from './node.js'; +import Declaration from './declaration.js'; const Property = function(name, index, currentFileInfo) { this.name = name; diff --git a/packages/less/src/less/tree/query-in-parens.js b/packages/less/lib/less/tree/query-in-parens.js similarity index 97% rename from packages/less/src/less/tree/query-in-parens.js rename to packages/less/lib/less/tree/query-in-parens.js index c4ef8c1a0..0135eb743 100644 --- a/packages/less/src/less/tree/query-in-parens.js +++ b/packages/less/lib/less/tree/query-in-parens.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const QueryInParens = function (op, l, m, op2, r, i) { this.op = op.trim(); diff --git a/packages/less/src/less/tree/quoted.js b/packages/less/lib/less/tree/quoted.js similarity index 95% rename from packages/less/src/less/tree/quoted.js rename to packages/less/lib/less/tree/quoted.js index 811f6001a..e93c547b2 100644 --- a/packages/less/src/less/tree/quoted.js +++ b/packages/less/lib/less/tree/quoted.js @@ -1,6 +1,6 @@ -import Node from './node'; -import Variable from './variable'; -import Property from './property'; +import Node from './node.js'; +import Variable from './variable.js'; +import Property from './property.js'; const Quoted = function(str, content, escaped, index, currentFileInfo) { this.escaped = (escaped === undefined) ? true : escaped; diff --git a/packages/less/src/less/tree/ruleset.js b/packages/less/lib/less/tree/ruleset.js similarity index 98% rename from packages/less/src/less/tree/ruleset.js rename to packages/less/lib/less/tree/ruleset.js index 0aa93dddf..0214e8f8f 100644 --- a/packages/less/src/less/tree/ruleset.js +++ b/packages/less/lib/less/tree/ruleset.js @@ -1,17 +1,17 @@ -import Node from './node'; -import Declaration from './declaration'; -import Keyword from './keyword'; -import Comment from './comment'; -import Paren from './paren'; -import Selector from './selector'; -import Element from './element'; -import Anonymous from './anonymous'; -import contexts from '../contexts'; -import globalFunctionRegistry from '../functions/function-registry'; -import defaultFunc from '../functions/default'; -import getDebugInfo from './debug-info'; -import * as utils from '../utils'; -import Parser from '../parser/parser'; +import Node from './node.js'; +import Declaration from './declaration.js'; +import Keyword from './keyword.js'; +import Comment from './comment.js'; +import Paren from './paren.js'; +import Selector from './selector.js'; +import Element from './element.js'; +import Anonymous from './anonymous.js'; +import contexts from '../contexts.js'; +import globalFunctionRegistry from '../functions/function-registry.js'; +import defaultFunc from '../functions/default.js'; +import getDebugInfo from './debug-info.js'; +import * as utils from '../utils.js'; +import Parser from '../parser/parser.js'; const Ruleset = function(selectors, rules, strictImports, visibilityInfo) { this.selectors = selectors; diff --git a/packages/less/src/less/tree/selector.js b/packages/less/lib/less/tree/selector.js similarity index 96% rename from packages/less/src/less/tree/selector.js rename to packages/less/lib/less/tree/selector.js index b4acb1c55..a3fe1fc02 100644 --- a/packages/less/src/less/tree/selector.js +++ b/packages/less/lib/less/tree/selector.js @@ -1,8 +1,8 @@ -import Node from './node'; -import Element from './element'; -import LessError from '../less-error'; -import * as utils from '../utils'; -import Parser from '../parser/parser'; +import Node from './node.js'; +import Element from './element.js'; +import LessError from '../less-error.js'; +import * as utils from '../utils.js'; +import Parser from '../parser/parser.js'; const Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) { this.extendList = extendList; diff --git a/packages/less/src/less/tree/unicode-descriptor.js b/packages/less/lib/less/tree/unicode-descriptor.js similarity index 86% rename from packages/less/src/less/tree/unicode-descriptor.js rename to packages/less/lib/less/tree/unicode-descriptor.js index 78a695065..c40e20942 100644 --- a/packages/less/src/less/tree/unicode-descriptor.js +++ b/packages/less/lib/less/tree/unicode-descriptor.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const UnicodeDescriptor = function(value) { this.value = value; diff --git a/packages/less/src/less/tree/unit.js b/packages/less/lib/less/tree/unit.js similarity index 96% rename from packages/less/src/less/tree/unit.js rename to packages/less/lib/less/tree/unit.js index 946b098fd..e57aae6c8 100644 --- a/packages/less/src/less/tree/unit.js +++ b/packages/less/lib/less/tree/unit.js @@ -1,6 +1,6 @@ -import Node from './node'; -import unitConversions from '../data/unit-conversions'; -import * as utils from '../utils'; +import Node from './node.js'; +import unitConversions from '../data/unit-conversions.js'; +import * as utils from '../utils.js'; const Unit = function(numerator, denominator, backupUnit) { this.numerator = numerator ? utils.copyArray(numerator).sort() : []; diff --git a/packages/less/src/less/tree/url.js b/packages/less/lib/less/tree/url.js similarity index 98% rename from packages/less/src/less/tree/url.js rename to packages/less/lib/less/tree/url.js index 90f73d935..c412b3582 100644 --- a/packages/less/src/less/tree/url.js +++ b/packages/less/lib/less/tree/url.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; function escapePath(path) { return path.replace(/[()'"\s]/g, function(match) { return `\\${match}`; }); diff --git a/packages/less/src/less/tree/value.js b/packages/less/lib/less/tree/value.js similarity index 97% rename from packages/less/src/less/tree/value.js rename to packages/less/lib/less/tree/value.js index b1eb57a89..73573bf5a 100644 --- a/packages/less/src/less/tree/value.js +++ b/packages/less/lib/less/tree/value.js @@ -1,4 +1,4 @@ -import Node from './node'; +import Node from './node.js'; const Value = function(value) { if (!value) { diff --git a/packages/less/src/less/tree/variable-call.js b/packages/less/lib/less/tree/variable-call.js similarity index 85% rename from packages/less/src/less/tree/variable-call.js rename to packages/less/lib/less/tree/variable-call.js index 9d1e8b941..0de63aca8 100644 --- a/packages/less/src/less/tree/variable-call.js +++ b/packages/less/lib/less/tree/variable-call.js @@ -1,8 +1,8 @@ -import Node from './node'; -import Variable from './variable'; -import Ruleset from './ruleset'; -import DetachedRuleset from './detached-ruleset'; -import LessError from '../less-error'; +import Node from './node.js'; +import Variable from './variable.js'; +import Ruleset from './ruleset.js'; +import DetachedRuleset from './detached-ruleset.js'; +import LessError from '../less-error.js'; const VariableCall = function(variable, index, currentFileInfo) { this.variable = variable; diff --git a/packages/less/src/less/tree/variable.js b/packages/less/lib/less/tree/variable.js similarity index 96% rename from packages/less/src/less/tree/variable.js rename to packages/less/lib/less/tree/variable.js index a81e3ecef..1a04b0d6d 100644 --- a/packages/less/src/less/tree/variable.js +++ b/packages/less/lib/less/tree/variable.js @@ -1,5 +1,5 @@ -import Node from './node'; -import Call from './call'; +import Node from './node.js'; +import Call from './call.js'; const Variable = function(name, index, currentFileInfo) { this.name = name; diff --git a/packages/less/src/less/utils.js b/packages/less/lib/less/utils.js similarity index 98% rename from packages/less/src/less/utils.js rename to packages/less/lib/less/utils.js index f78d611a6..b79a3cc66 100644 --- a/packages/less/src/less/utils.js +++ b/packages/less/lib/less/utils.js @@ -1,5 +1,5 @@ /* jshint proto: true */ -import * as Constants from './constants'; +import * as Constants from './constants.js'; import { copy } from 'copy-anything'; export function getLocation(index, inputStream) { diff --git a/packages/less/src/less/visitors/extend-visitor.js b/packages/less/lib/less/visitors/extend-visitor.js similarity index 99% rename from packages/less/src/less/visitors/extend-visitor.js rename to packages/less/lib/less/visitors/extend-visitor.js index fd70ece77..138bdb356 100644 --- a/packages/less/src/less/visitors/extend-visitor.js +++ b/packages/less/lib/less/visitors/extend-visitor.js @@ -2,10 +2,10 @@ /** * @todo - Remove unused when JSDoc types are added for visitor methods */ -import tree from '../tree'; -import Visitor from './visitor'; -import logger from '../logger'; -import * as utils from '../utils'; +import tree from '../tree/index.js'; +import Visitor from './visitor.js'; +import logger from '../logger.js'; +import * as utils from '../utils.js'; /* jshint loopfunc:true */ diff --git a/packages/less/src/less/visitors/import-sequencer.js b/packages/less/lib/less/visitors/import-sequencer.js similarity index 100% rename from packages/less/src/less/visitors/import-sequencer.js rename to packages/less/lib/less/visitors/import-sequencer.js diff --git a/packages/less/src/less/visitors/import-visitor.js b/packages/less/lib/less/visitors/import-visitor.js similarity index 97% rename from packages/less/src/less/visitors/import-visitor.js rename to packages/less/lib/less/visitors/import-visitor.js index aaffe0d3e..899d73071 100644 --- a/packages/less/src/less/visitors/import-visitor.js +++ b/packages/less/lib/less/visitors/import-visitor.js @@ -2,10 +2,10 @@ /** * @todo - Remove unused when JSDoc types are added for visitor methods */ -import contexts from '../contexts'; -import Visitor from './visitor'; -import ImportSequencer from './import-sequencer'; -import * as utils from '../utils'; +import contexts from '../contexts.js'; +import Visitor from './visitor.js'; +import ImportSequencer from './import-sequencer.js'; +import * as utils from '../utils.js'; const ImportVisitor = function(importer, finish) { diff --git a/packages/less/lib/less/visitors/index.js b/packages/less/lib/less/visitors/index.js new file mode 100644 index 000000000..49f2ffd25 --- /dev/null +++ b/packages/less/lib/less/visitors/index.js @@ -0,0 +1,15 @@ +import Visitor from './visitor.js'; +import ImportVisitor from './import-visitor.js'; +import MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor.js'; +import ExtendVisitor from './extend-visitor.js'; +import JoinSelectorVisitor from './join-selector-visitor.js'; +import ToCSSVisitor from './to-css-visitor.js'; + +export default { + Visitor, + ImportVisitor, + MarkVisibleSelectorsVisitor, + ExtendVisitor, + JoinSelectorVisitor, + ToCSSVisitor +}; diff --git a/packages/less/src/less/visitors/join-selector-visitor.js b/packages/less/lib/less/visitors/join-selector-visitor.js similarity index 98% rename from packages/less/src/less/visitors/join-selector-visitor.js rename to packages/less/lib/less/visitors/join-selector-visitor.js index b55b292c7..2e421806e 100644 --- a/packages/less/src/less/visitors/join-selector-visitor.js +++ b/packages/less/lib/less/visitors/join-selector-visitor.js @@ -2,7 +2,7 @@ /** * @todo - Remove unused when JSDoc types are added for visitor methods */ -import Visitor from './visitor'; +import Visitor from './visitor.js'; class JoinSelectorVisitor { constructor() { diff --git a/packages/less/src/less/visitors/set-tree-visibility-visitor.js b/packages/less/lib/less/visitors/set-tree-visibility-visitor.js similarity index 100% rename from packages/less/src/less/visitors/set-tree-visibility-visitor.js rename to packages/less/lib/less/visitors/set-tree-visibility-visitor.js diff --git a/packages/less/src/less/visitors/to-css-visitor.js b/packages/less/lib/less/visitors/to-css-visitor.js similarity index 98% rename from packages/less/src/less/visitors/to-css-visitor.js rename to packages/less/lib/less/visitors/to-css-visitor.js index ce1038efb..82eb49c5c 100644 --- a/packages/less/src/less/visitors/to-css-visitor.js +++ b/packages/less/lib/less/visitors/to-css-visitor.js @@ -2,9 +2,9 @@ /** * @todo - Remove unused when JSDoc types are added for visitor methods */ -import tree from '../tree'; -import Visitor from './visitor'; -import mergeRules from '../tree/merge-rules'; +import tree from '../tree/index.js'; +import Visitor from './visitor.js'; +import mergeRules from '../tree/merge-rules.js'; class CSSVisitorUtils { constructor(context) { diff --git a/packages/less/src/less/visitors/visitor.js b/packages/less/lib/less/visitors/visitor.js similarity index 99% rename from packages/less/src/less/visitors/visitor.js rename to packages/less/lib/less/visitors/visitor.js index 9db634f4f..4392066e2 100644 --- a/packages/less/src/less/visitors/visitor.js +++ b/packages/less/lib/less/visitors/visitor.js @@ -1,4 +1,4 @@ -import tree from '../tree'; +import tree from '../tree/index.js'; const _visitArgs = { visitDeeper: true }; let _hasIndexed = false; diff --git a/packages/less/package.json b/packages/less/package.json index ee81c2568..1d5e833ad 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -22,17 +22,29 @@ "raw": "https://raw.githubusercontent.com/less/less.js/master/" }, "license": "Apache-2.0", + "type": "module", "bin": { "lessc": "./bin/lessc" }, - "main": "index", - "module": "./lib/less-node/index", + "main": "./lib/less-node/index.js", + "exports": { + ".": "./lib/less-node/index.js", + "./lib/*": "./lib/*" + }, "directories": { "test": "./test" }, + "files": [ + "bin", + "lib", + "!lib/**/*.map", + "dist", + "index.js", + "README.md" + ], "browser": "./dist/less.js", "engines": { - "node": ">=14" + "node": ">=18" }, "scripts": { "quicktest": "grunt quicktest", @@ -41,12 +53,9 @@ "grunt": "grunt", "lint": "eslint '**/*.{ts,js}'", "lint:fix": "eslint '**/*.{ts,js}' --fix", - "build": "npm-run-all clean compile", - "clean": "shx rm -rf ./lib tsconfig.tsbuildinfo", - "compile": "tsc -p tsconfig.build.json", - "dev": "tsc -p tsconfig.build.json -w", - "prepublishOnly": "grunt dist", - "postinstall": "node scripts/postinstall.js" + "typecheck": "tsc", + "build": "node build/rollup.js --dist", + "prepublishOnly": "grunt dist" }, "optionalDependencies": { "errno": "^0.1.1", @@ -77,7 +86,7 @@ "git-rev": "^0.2.1", "glob": "~11.0.3", "globby": "^10.0.1", - "grunt": "^1.0.4", + "grunt": "^1.5.0", "grunt-cli": "^1.3.2", "grunt-contrib-clean": "^1.0.0", "grunt-contrib-connect": "^1.0.2", @@ -101,12 +110,10 @@ "resolve": "^1.17.0", "rollup": "^2.52.2", "rollup-plugin-terser": "^5.1.1", - "rollup-plugin-typescript2": "^0.29.0", "semver": "^6.3.0", "shx": "^0.3.2", "time-grunt": "^1.3.0", - "ts-node": "^10.9.1", - "typescript": "^4.3.4", + "typescript": "^5.7.0", "uikit": "2.27.4" }, "keywords": [ @@ -137,9 +144,8 @@ "rawcurrent": "https://raw.github.com/less/less.js/v", "sourcearchive": "https://github.com/less/less.js/archive/v", "dependencies": { - "copy-anything": "^2.0.1", - "parse-node-version": "^1.0.1", - "tslib": "^2.3.0" + "copy-anything": "^3.0.5", + "parse-node-version": "^1.0.1" }, "gitHead": "1df9072ee9ebdadc791bf35dfb1dbc3ef9f1948f" } diff --git a/packages/less/scripts/coverage-lines.js b/packages/less/scripts/coverage-lines.js index f912e9636..5adcca63d 100644 --- a/packages/less/scripts/coverage-lines.js +++ b/packages/less/scripts/coverage-lines.js @@ -6,8 +6,11 @@ * Also outputs JSON file with uncovered lines for programmatic access */ -const fs = require('fs'); -const path = require('path'); +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const lcovPath = path.join(__dirname, '..', 'coverage', 'lcov.info'); const jsonOutputPath = path.join(__dirname, '..', 'coverage', 'uncovered-lines.json'); @@ -26,28 +29,28 @@ let currentFile = null; const lines = lcovContent.split('\n'); for (let i = 0; i < lines.length; i++) { const line = lines[i]; - + // SF: source file if (line.startsWith('SF:')) { if (currentFile) { files.push(currentFile); } const filePath = line.substring(3); - // Only include src/ files (not less-browser) and bin/ + // Only include lib/ files (not less-browser) and bin/ // Exclude abstract base classes (they're meant to be overridden) const normalized = filePath.replace(/\\/g, '/'); const abstractClasses = ['abstract-file-manager', 'abstract-plugin-loader']; const isAbstract = abstractClasses.some(abstract => normalized.includes(abstract)); - - if (!isAbstract && - ((normalized.includes('src/less/') && !normalized.includes('src/less-browser/')) || - normalized.includes('src/less-node/') || + + if (!isAbstract && + ((normalized.includes('lib/less/') && !normalized.includes('lib/less-browser/')) || + normalized.includes('lib/less-node/') || normalized.includes('bin/'))) { - // Extract relative path - match src/less/... or src/less-node/... or bin/... - // Path format: src/less/tree/debug-info.js or src/less-node/file-manager.js - // Match from src/ or bin/ to end of path - const match = normalized.match(/(src\/[^/]+\/.+|bin\/.+)$/); - const relativePath = match ? match[1] : (normalized.includes('/src/') || normalized.includes('/bin/') ? normalized.split('/').slice(-3).join('/') : path.basename(filePath)); + // Extract relative path - match lib/less/... or lib/less-node/... or bin/... + // Path format: lib/less/tree/debug-info.js or lib/less-node/file-manager.js + // Match from lib/ or bin/ to end of path + const match = normalized.match(/(lib\/[^/]+\/.+|bin\/.+)$/); + const relativePath = match ? match[1] : (normalized.includes('/lib/') || normalized.includes('/bin/') ? normalized.split('/').slice(-3).join('/') : path.basename(filePath)); currentFile = { path: relativePath, fullPath: filePath, @@ -60,7 +63,7 @@ for (let i = 0; i < lines.length; i++) { currentFile = null; } } - + // DA: line data (line number, execution count) if (currentFile && line.startsWith('DA:')) { const match = line.match(/^DA:(\d+),(\d+)$/); @@ -94,7 +97,7 @@ files.forEach(file => { } }); } catch (err) { - // If we can't read the source (e.g., it's in lib/ but we want src/), that's ok + // If we can't read the source, that's ok // We'll just skip the source code } } @@ -114,7 +117,7 @@ if (filesWithGaps.length === 0) { console.log('\n⚠️ No source files found in coverage data. This may indicate an issue with the coverage report.\n'); } else { console.log('\n✅ All analyzed files have 100% line coverage!\n'); - console.log(`(Analyzed ${files.length} files from src/less/, src/less-node/, and bin/)\n`); + console.log(`(Analyzed ${files.length} files from lib/less/, lib/less-node/, and bin/)\n`); } process.exit(0); } @@ -124,18 +127,18 @@ console.log('Uncovered Lines Report'); console.log('='.repeat(100) + '\n'); filesWithGaps.forEach(file => { - const coveragePct = file.totalLines > 0 + const coveragePct = file.totalLines > 0 ? ((file.coveredLines / file.totalLines) * 100).toFixed(1) : '0.0'; - + console.log(`\n${file.path} (${coveragePct}% coverage)`); console.log('-'.repeat(100)); - + // Group consecutive lines into ranges const ranges = []; let start = file.uncoveredLines[0]; let end = file.uncoveredLines[0]; - + for (let i = 1; i < file.uncoveredLines.length; i++) { if (file.uncoveredLines[i] === end + 1) { end = file.uncoveredLines[i]; @@ -146,14 +149,14 @@ filesWithGaps.forEach(file => { } } ranges.push(start === end ? `${start}` : `${start}..${end}`); - + // Display ranges (max 5 per line for readability) const linesPerRow = 5; for (let i = 0; i < ranges.length; i += linesPerRow) { const row = ranges.slice(i, i + linesPerRow); console.log(` Lines: ${row.join(', ')}`); } - + console.log(` Total uncovered: ${file.uncoveredLines.length} of ${file.totalLines} lines`); }); @@ -173,7 +176,7 @@ const jsonOutput = { } return file.fullPath; })(), - coveragePercent: file.totalLines > 0 + coveragePercent: file.totalLines > 0 ? parseFloat(((file.coveredLines / file.totalLines) * 100).toFixed(1)) : 0, totalLines: file.totalLines, @@ -183,10 +186,10 @@ const jsonOutput = { uncoveredRanges: (() => { const ranges = []; if (file.uncoveredLines.length === 0) return ranges; - + let start = file.uncoveredLines[0]; let end = file.uncoveredLines[0]; - + for (let i = 1; i < file.uncoveredLines.length; i++) { if (file.uncoveredLines[i] === end + 1) { end = file.uncoveredLines[i]; @@ -204,4 +207,3 @@ const jsonOutput = { fs.writeFileSync(jsonOutputPath, JSON.stringify(jsonOutput, null, 2), 'utf8'); console.log('\n📄 Uncovered lines data written to: coverage/uncovered-lines.json\n'); - diff --git a/packages/less/scripts/coverage-report.js b/packages/less/scripts/coverage-report.js index 866937c33..54b27ce43 100644 --- a/packages/less/scripts/coverage-report.js +++ b/packages/less/scripts/coverage-report.js @@ -1,11 +1,14 @@ #!/usr/bin/env node /** - * Generates a per-file coverage report table for src/ directories + * Generates a per-file coverage report table for lib/ directories */ -const fs = require('fs'); -const path = require('path'); +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const coverageSummaryPath = path.join(__dirname, '..', 'coverage', 'coverage-summary.json'); @@ -16,8 +19,8 @@ if (!fs.existsSync(coverageSummaryPath)) { const coverage = JSON.parse(fs.readFileSync(coverageSummaryPath, 'utf8')); -// Filter to only src/ files (less, less-node) and bin/ files -// Note: src/less-browser/ is excluded because browser tests aren't included in coverage +// Filter to only lib/ files (less, less-node) and bin/ files +// Note: lib/less-browser/ is excluded because browser tests aren't included in coverage // Abstract base classes are excluded as they're meant to be overridden by implementations const abstractClasses = [ 'abstract-file-manager', @@ -31,17 +34,17 @@ const srcFiles = Object.entries(coverage) if (abstractClasses.some(abstract => normalized.includes(abstract))) { return false; } - return (normalized.includes('/src/less/') && !normalized.includes('/src/less-browser/')) || - normalized.includes('/src/less-node/') || + return (normalized.includes('/lib/less/') && !normalized.includes('/lib/less-browser/')) || + normalized.includes('/lib/less-node/') || normalized.includes('/bin/'); }) .map(([filePath, data]) => { // Extract relative path from absolute path const normalized = filePath.replace(/\\/g, '/'); - // Match src/ paths or bin/ paths - const match = normalized.match(/((?:src\/[^/]+\/[^/]+\/|bin\/).+)$/); + // Match lib/ paths or bin/ paths + const match = normalized.match(/((?:lib\/[^/]+\/[^/]+\/|bin\/).+)$/); const relativePath = match ? match[1] : path.basename(filePath); - + return { path: relativePath, statements: data.statements, @@ -58,22 +61,22 @@ const srcFiles = Object.entries(coverage) }); if (srcFiles.length === 0) { - console.log('No src/ files found in coverage report.'); + console.log('No lib/ files found in coverage report.'); process.exit(0); } // Group by directory const grouped = { - 'src/less/': [], - 'src/less-node/': [], + 'lib/less/': [], + 'lib/less-node/': [], 'bin/': [] }; srcFiles.forEach(file => { - if (file.path.startsWith('src/less/')) { - grouped['src/less/'].push(file); - } else if (file.path.startsWith('src/less-node/')) { - grouped['src/less-node/'].push(file); + if (file.path.startsWith('lib/less/')) { + grouped['lib/less/'].push(file); + } else if (file.path.startsWith('lib/less-node/')) { + grouped['lib/less-node/'].push(file); } else if (file.path.startsWith('bin/')) { grouped['bin/'].push(file); } @@ -81,29 +84,29 @@ srcFiles.forEach(file => { // Print table console.log('\n' + '='.repeat(100)); -console.log('Per-File Coverage Report (src/less/, src/less-node/, and bin/)'); +console.log('Per-File Coverage Report (lib/less/, lib/less-node/, and bin/)'); console.log('='.repeat(100)); console.log('For line-by-line coverage details, open coverage/index.html in your browser.'); console.log('='.repeat(100) + '\n'); Object.entries(grouped).forEach(([dir, files]) => { if (files.length === 0) return; - + console.log(`\n${dir.toUpperCase()}`); console.log('-'.repeat(100)); console.log( - 'File'.padEnd(50) + - 'Statements'.padStart(12) + - 'Branches'.padStart(12) + - 'Functions'.padStart(12) + + 'File'.padEnd(50) + + 'Statements'.padStart(12) + + 'Branches'.padStart(12) + + 'Functions'.padStart(12) + 'Lines'.padStart(12) ); console.log('-'.repeat(100)); - + files.forEach(file => { const filename = file.path.replace(dir, ''); const truncated = filename.length > 48 ? '...' + filename.slice(-45) : filename; - + console.log( truncated.padEnd(50) + `${file.statements.pct.toFixed(1)}%`.padStart(12) + @@ -112,7 +115,7 @@ Object.entries(grouped).forEach(([dir, files]) => { `${file.lines.pct.toFixed(1)}%`.padStart(12) ); }); - + // Summary for this directory const totals = files.reduce((acc, file) => { acc.statements.total += file.statements.total; @@ -130,8 +133,8 @@ Object.entries(grouped).forEach(([dir, files]) => { functions: { total: 0, covered: 0 }, lines: { total: 0, covered: 0 } }); - - const stmtPct = totals.statements.total > 0 + + const stmtPct = totals.statements.total > 0 ? (totals.statements.covered / totals.statements.total * 100).toFixed(1) : '0.0'; const branchPct = totals.branches.total > 0 @@ -143,7 +146,7 @@ Object.entries(grouped).forEach(([dir, files]) => { const linePct = totals.lines.total > 0 ? (totals.lines.covered / totals.lines.total * 100).toFixed(1) : '0.0'; - + console.log('-'.repeat(100)); console.log( 'TOTAL'.padEnd(50) + @@ -155,4 +158,3 @@ Object.entries(grouped).forEach(([dir, files]) => { }); console.log('\n' + '='.repeat(100) + '\n'); - diff --git a/packages/less/scripts/postinstall.js b/packages/less/scripts/postinstall.js index af5ec9b38..028ee55e1 100644 --- a/packages/less/scripts/postinstall.js +++ b/packages/less/scripts/postinstall.js @@ -1,61 +1,44 @@ #!/usr/bin/env node -/** - * Post-install script for Less.js package - * - * This script installs Playwright browsers only when: - * 1. This is a development environment (not when installed as a dependency) - * 2. We're in a monorepo context (parent package.json exists) - * 3. Not running in CI or other automated environments - */ +import fs from 'fs'; +import path from 'path'; +import { execSync } from 'child_process'; +import { fileURLToPath } from 'url'; -const fs = require('fs'); -const path = require('path'); -const { execSync } = require('child_process'); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); -// Check if we're in a development environment function isDevelopmentEnvironment() { - // Skip if this is a global install or user config if (process.env.npm_config_user_config || process.env.npm_config_global) { return false; } - - // Skip in CI environments if (process.env.CI || process.env.GITHUB_ACTIONS || process.env.TRAVIS) { return false; } - - // Check if we're in a monorepo (parent package.json exists) const parentPackageJson = path.join(__dirname, '../../../package.json'); if (!fs.existsSync(parentPackageJson)) { return false; } - - // Check if this is the root of the monorepo const currentPackageJson = path.join(__dirname, '../package.json'); if (!fs.existsSync(currentPackageJson)) { return false; } - return true; } -// Install Playwright browsers function installPlaywrightBrowsers() { try { - console.log('🎭 Installing Playwright browsers for development...'); - execSync('pnpm exec playwright install', { + console.log('Installing Playwright browsers for development...'); + execSync('pnpm exec playwright install', { stdio: 'inherit', cwd: path.join(__dirname, '..') }); - console.log('✅ Playwright browsers installed successfully'); + console.log('Playwright browsers installed successfully'); } catch (error) { - console.warn('⚠️ Failed to install Playwright browsers:', error.message); - console.warn(' You can install them manually with: pnpm exec playwright install'); + console.warn('Failed to install Playwright browsers:', error.message); + console.warn('You can install them manually with: pnpm exec playwright install'); } } -// Main execution if (isDevelopmentEnvironment()) { installPlaywrightBrowsers(); } diff --git a/packages/less/src/less-node/environment.js b/packages/less/src/less-node/environment.js deleted file mode 100644 index 630a4c2d0..000000000 --- a/packages/less/src/less-node/environment.js +++ /dev/null @@ -1,27 +0,0 @@ -class SourceMapGeneratorFallback { - addMapping(){} - setSourceContent(){} - toJSON(){ - return null; - } -}; - -export default { - encodeBase64: function encodeBase64(str) { - // Avoid Buffer constructor on newer versions of Node.js. - const buffer = (Buffer.from ? Buffer.from(str) : (new Buffer(str))); - return buffer.toString('base64'); - }, - mimeLookup: function (filename) { - const mimeModule = require('mime'); - return mimeModule ? mimeModule.lookup(filename) : "application/octet-stream"; - }, - charsetLookup: function (mime) { - const mimeModule = require('mime'); - return mimeModule ? mimeModule.charsets.lookup(mime) : undefined; - }, - getSourceMapGenerator: function getSourceMapGenerator() { - const sourceMapModule = require('source-map'); - return sourceMapModule ? sourceMapModule.SourceMapGenerator : SourceMapGeneratorFallback; - } -}; diff --git a/packages/less/src/less-node/fs.js b/packages/less/src/less-node/fs.js deleted file mode 100644 index be71f8f2e..000000000 --- a/packages/less/src/less-node/fs.js +++ /dev/null @@ -1,10 +0,0 @@ -let fs; -try -{ - fs = require('graceful-fs'); -} -catch (e) -{ - fs = require('fs'); -} -export default fs; diff --git a/packages/less/src/less-node/index.js b/packages/less/src/less-node/index.js deleted file mode 100644 index 43cbe7a49..000000000 --- a/packages/less/src/less-node/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import environment from './environment'; -import FileManager from './file-manager'; -import UrlFileManager from './url-file-manager'; -import createFromEnvironment from '../less'; -const less = createFromEnvironment(environment, [new FileManager(), new UrlFileManager()]); -import lesscHelper from './lessc-helper'; - -// allow people to create less with their own environment -less.createFromEnvironment = createFromEnvironment; -less.lesscHelper = lesscHelper; -less.PluginLoader = require('./plugin-loader').default; -less.fs = require('./fs').default; -less.FileManager = FileManager; -less.UrlFileManager = UrlFileManager; - -// Set up options -less.options = require('../less/default-options').default(); - -// provide image-size functionality -require('./image-size').default(less.environment); - -export default less; diff --git a/packages/less/src/less/data/index.js b/packages/less/src/less/data/index.js deleted file mode 100644 index 1a7d75bc4..000000000 --- a/packages/less/src/less/data/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import colors from './colors'; -import unitConversions from './unit-conversions'; - -export default { colors, unitConversions }; diff --git a/packages/less/src/less/tree/index.js b/packages/less/src/less/tree/index.js deleted file mode 100644 index 1d4fbfdd7..000000000 --- a/packages/less/src/less/tree/index.js +++ /dev/null @@ -1,55 +0,0 @@ -import Node from './node'; -import Color from './color'; -import AtRule from './atrule'; -import DetachedRuleset from './detached-ruleset'; -import Operation from './operation'; -import Dimension from './dimension'; -import Unit from './unit'; -import Keyword from './keyword'; -import Variable from './variable'; -import Property from './property'; -import Ruleset from './ruleset'; -import Element from './element'; -import Attribute from './attribute'; -import Combinator from './combinator'; -import Selector from './selector'; -import Quoted from './quoted'; -import Expression from './expression'; -import Declaration from './declaration'; -import Call from './call'; -import URL from './url'; -import Import from './import'; -import Comment from './comment'; -import Anonymous from './anonymous'; -import Value from './value'; -import JavaScript from './javascript'; -import Assignment from './assignment'; -import Condition from './condition'; -import QueryInParens from './query-in-parens'; -import Paren from './paren'; -import Media from './media'; -import Container from './container'; -import UnicodeDescriptor from './unicode-descriptor'; -import Negative from './negative'; -import Extend from './extend'; -import VariableCall from './variable-call'; -import NamespaceValue from './namespace-value'; - -// mixins -import MixinCall from './mixin-call'; -import MixinDefinition from './mixin-definition'; - -export default { - Node, Color, AtRule, DetachedRuleset, Operation, - Dimension, Unit, Keyword, Variable, Property, - Ruleset, Element, Attribute, Combinator, Selector, - Quoted, Expression, Declaration, Call, URL, Import, - Comment, Anonymous, Value, JavaScript, Assignment, - Condition, Paren, Media, Container, QueryInParens, - UnicodeDescriptor, Negative, Extend, VariableCall, - NamespaceValue, - mixin: { - Call: MixinCall, - Definition: MixinDefinition - } -}; \ No newline at end of file diff --git a/packages/less/src/less/visitors/index.js b/packages/less/src/less/visitors/index.js deleted file mode 100644 index 96deb76c4..000000000 --- a/packages/less/src/less/visitors/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import Visitor from './visitor'; -import ImportVisitor from './import-visitor'; -import MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor'; -import ExtendVisitor from './extend-visitor'; -import JoinSelectorVisitor from './join-selector-visitor'; -import ToCSSVisitor from './to-css-visitor'; - -export default { - Visitor, - ImportVisitor, - MarkVisibleSelectorsVisitor, - ExtendVisitor, - JoinSelectorVisitor, - ToCSSVisitor -}; diff --git a/packages/less/test/browser/generator/benchmark.config.js b/packages/less/test/browser/generator/benchmark.config.cjs similarity index 100% rename from packages/less/test/browser/generator/benchmark.config.js rename to packages/less/test/browser/generator/benchmark.config.cjs diff --git a/packages/less/test/browser/generator/generate.cjs b/packages/less/test/browser/generator/generate.cjs new file mode 100644 index 000000000..543e724df --- /dev/null +++ b/packages/less/test/browser/generator/generate.cjs @@ -0,0 +1,78 @@ +const template = require('./template.cjs') +let config +const fs = require('fs-extra') +const path = require('path') +const globby = require('globby') +const { runner } = require('../../mocha-playwright/runner') + + +if (process.argv[2]) { + config = require(`./${process.argv[2]}.config`) +} else { + config = require('./runner.config.cjs') +} + +/** + * Generate templates and run tests + */ +const tests = [] +const cwd = process.cwd() +const tmpDir = path.join(cwd, 'tmp', 'browser') +fs.ensureDirSync(tmpDir) +fs.copySync(path.join(cwd, 'test', 'browser', 'common.js'), path.join(tmpDir, 'common.js')) + +let numTests = 0 +let passedTests = 0 +let failedTests = 0 + +/** Will run the runners in a series */ +function runSerial(tasks) { + var result = Promise.resolve() + start = Date.now() + tasks.forEach(task => { + result = result.then(result => { + if (result && result.result && result.result.stats) { + const stats = result.result.stats + numTests += stats.tests + passedTests += stats.passes + failedTests += stats.failures + } + return task() + }, err => { + console.log(err) + failedTests += 1 + }) + }) + return result +} + +Object.entries(config).forEach(entry => { + const test = entry[1] + const paths = globby.sync(test.src) + const templateString = template(paths, test.options.helpers, test.options.specs) + fs.writeFileSync(path.join(cwd, test.options.outfile), templateString) + tests.push(() => { + const file = 'http://localhost:8081/packages/less/' + test.options.outfile + console.log(file) + return runner({ + file, + timeout: 3500, + args: ['disable-web-security', 'no-sandbox', 'disable-setuid-sandbox'], + }) + }) +}) + +module.exports = () => runSerial(tests).then(() => { + if (failedTests > 0) { + process.stderr.write(failedTests + ' Failed, ' + passedTests + ' passed\n'); + } else { + process.stdout.write('All Passed ' + passedTests + ' run\n'); + } + if (failedTests) { + process.on('exit', function() { process.reallyExit(1); }); + } + process.exit() +}, err => { + process.stderr.write(err.message); + process.exit() +}) diff --git a/packages/less/test/browser/generator/generate.js b/packages/less/test/browser/generator/generate.js index 893c7e3ac..004c957f7 100644 --- a/packages/less/test/browser/generator/generate.js +++ b/packages/less/test/browser/generator/generate.js @@ -1,68 +1,72 @@ -const template = require('./template') -let config -const fs = require('fs-extra') -const path = require('path') -const globby = require('globby') -const { runner } = require('../../mocha-playwright/runner') +import { createRequire } from 'module'; +import fs from 'fs-extra'; +import path from 'path'; +import globby from 'globby'; +import { runner } from '../../mocha-playwright/runner.js'; +const require = createRequire(import.meta.url); + +let config; +let template; if (process.argv[2]) { - config = require(`./${process.argv[2]}.config`) + config = require(`./${process.argv[2]}.config.cjs`); } else { - config = require('./runner.config') + config = require('./runner.config.cjs'); } +template = require('./template.cjs'); /** * Generate templates and run tests */ -const tests = [] -const cwd = process.cwd() -const tmpDir = path.join(cwd, 'tmp', 'browser') -fs.ensureDirSync(tmpDir) -fs.copySync(path.join(cwd, 'test', 'browser', 'common.js'), path.join(tmpDir, 'common.js')) +const tests = []; +const cwd = process.cwd(); +const tmpDir = path.join(cwd, 'tmp', 'browser'); +fs.ensureDirSync(tmpDir); +fs.copySync(path.join(cwd, 'test', 'browser', 'common.js'), path.join(tmpDir, 'common.js')); -let numTests = 0 -let passedTests = 0 -let failedTests = 0 +let numTests = 0; +let passedTests = 0; +let failedTests = 0; /** Will run the runners in a series */ function runSerial(tasks) { - var result = Promise.resolve() - start = Date.now() + var result = Promise.resolve(); + var start = Date.now(); tasks.forEach(task => { result = result.then(result => { if (result && result.result && result.result.stats) { - const stats = result.result.stats - numTests += stats.tests - passedTests += stats.passes - failedTests += stats.failures + const stats = result.result.stats; + numTests += stats.tests; + passedTests += stats.passes; + failedTests += stats.failures; } - return task() + return task(); }, err => { - console.log(err) - failedTests += 1 - }) - }) - return result + console.log(err); + failedTests += 1; + }); + }); + return result; } Object.entries(config).forEach(entry => { - const test = entry[1] - const paths = globby.sync(test.src) - const templateString = template(paths, test.options.helpers, test.options.specs) - fs.writeFileSync(path.join(cwd, test.options.outfile), templateString) + const test = entry[1]; + const paths = globby.sync(test.src); + const templateString = template(paths, test.options.helpers, test.options.specs); + fs.writeFileSync(path.join(cwd, test.options.outfile), templateString); tests.push(() => { - const file = 'http://localhost:8081/packages/less/' + test.options.outfile - console.log(file) + const file = 'http://localhost:8081/packages/less/' + test.options.outfile; + console.log(file); return runner({ file, timeout: 3500, args: ['disable-web-security', 'no-sandbox', 'disable-setuid-sandbox'], - }) - }) -}) + }); + }); +}); -module.exports = () => runSerial(tests).then(() => { +export default () => runSerial(tests).then(() => { if (failedTests > 0) { process.stderr.write(failedTests + ' Failed, ' + passedTests + ' passed\n'); } else { @@ -71,8 +75,8 @@ module.exports = () => runSerial(tests).then(() => { if (failedTests) { process.on('exit', function() { process.reallyExit(1); }); } - process.exit() + process.exit(); }, err => { process.stderr.write(err.message); - process.exit() -}) + process.exit(); +}); diff --git a/packages/less/test/browser/generator/runner.cjs b/packages/less/test/browser/generator/runner.cjs new file mode 100644 index 000000000..4a4b877bb --- /dev/null +++ b/packages/less/test/browser/generator/runner.cjs @@ -0,0 +1,2 @@ +const runner = require('./generate.cjs') +runner() \ No newline at end of file diff --git a/packages/less/test/browser/generator/runner.config.js b/packages/less/test/browser/generator/runner.config.cjs similarity index 96% rename from packages/less/test/browser/generator/runner.config.js rename to packages/less/test/browser/generator/runner.config.cjs index b1b68b369..996a384cd 100644 --- a/packages/less/test/browser/generator/runner.config.js +++ b/packages/less/test/browser/generator/runner.config.cjs @@ -1,6 +1,6 @@ var path = require('path'); var resolve = require('resolve') -var { forceCovertToBrowserPath } = require('./utils'); +var { forceCovertToBrowserPath } = require('./utils.cjs'); /** Root of repo */ var testFolder = forceCovertToBrowserPath(path.dirname(resolve.sync('@less/test-data'))); @@ -140,7 +140,7 @@ module.exports = { src: [`${testsConfigFolder}/postProcessorPlugin/*.less`], options: { helpers: [ - 'test/plugins/postprocess/index.js', + 'test/plugins/postprocess/index.cjs', 'test/browser/runner-postProcessorPlugin-options.js' ], specs: 'test/browser/runner-postProcessorPlugin.js', @@ -152,7 +152,7 @@ module.exports = { src: [`${testsConfigFolder}/preProcessorPlugin/*.less`], options: { helpers: [ - 'test/plugins/preprocess/index.js', + 'test/plugins/preprocess/index.cjs', 'test/browser/runner-preProcessorPlugin-options.js' ], specs: 'test/browser/runner-preProcessorPlugin.js', @@ -163,7 +163,7 @@ module.exports = { src: [`${testsConfigFolder}/visitorPlugin/*.less`], options: { helpers: [ - 'test/plugins/visitor/index.js', + 'test/plugins/visitor/index.cjs', 'test/browser/runner-VisitorPlugin-options.js' ], specs: 'test/browser/runner-VisitorPlugin.js', @@ -174,7 +174,7 @@ module.exports = { src: [`${testsConfigFolder}/filemanagerPlugin/*.less`], options: { helpers: [ - 'test/plugins/filemanager/index.js', + 'test/plugins/filemanager/index.cjs', 'test/browser/runner-filemanagerPlugin-options.js' ], specs: 'test/browser/runner-filemanagerPlugin.js', diff --git a/packages/less/test/browser/generator/runner.js b/packages/less/test/browser/generator/runner.js index 25c846036..9f82233e1 100644 --- a/packages/less/test/browser/generator/runner.js +++ b/packages/less/test/browser/generator/runner.js @@ -1,2 +1,2 @@ -const runner = require('./generate') -runner() \ No newline at end of file +import generate from './generate.js'; +generate(); diff --git a/packages/less/test/browser/generator/template.js b/packages/less/test/browser/generator/template.cjs similarity index 98% rename from packages/less/test/browser/generator/template.js rename to packages/less/test/browser/generator/template.cjs index a8bb9e0ab..a4c0097e5 100644 --- a/packages/less/test/browser/generator/template.js +++ b/packages/less/test/browser/generator/template.cjs @@ -1,6 +1,6 @@ const html = require('html-template-tag') const path = require('path') -const { forceCovertToBrowserPath } = require('./utils') +const { forceCovertToBrowserPath } = require('./utils.cjs') const webRoot = path.resolve(__dirname, '../../../../../'); const mochaDir = forceCovertToBrowserPath(path.relative(webRoot, path.dirname(require.resolve('mocha')))) diff --git a/packages/less/test/browser/generator/utils.js b/packages/less/test/browser/generator/utils.cjs similarity index 100% rename from packages/less/test/browser/generator/utils.js rename to packages/less/test/browser/generator/utils.cjs diff --git a/packages/less/test/index.js b/packages/less/test/index.js index d1e9ef8f9..b4fd85fa7 100644 --- a/packages/less/test/index.js +++ b/packages/less/test/index.js @@ -1,11 +1,21 @@ -// Mock needle for HTTP requests BEFORE any other requires -const Module = require('module'); +import { createRequire } from 'module'; +import Module from 'module'; +import path from 'path'; +import fs from 'fs'; +import { fileURLToPath } from 'url'; +import less from '../lib/less-node/index.js'; +import { stylize } from '../lib/less-node/lessc-helper.js'; +import createLessTester from './less-test.js'; + +const require = createRequire(import.meta.url); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +// Mock needle for HTTP requests const originalRequire = Module.prototype.require; Module.prototype.require = function(id) { if (id === 'needle') { return { get: function(url, options, callback) { - // Handle CDN requests if (url.includes('cdn.jsdelivr.net')) { if (url.includes('selectors.less')) { @@ -27,23 +37,22 @@ Module.prototype.require = function(id) { return; } } - - // Handle redirect test - simulate needle's automatic redirect handling + + // Handle redirect test if (url.includes('example.com/redirect.less')) { setTimeout(() => { - // Simulate the final response after needle automatically follows the redirect callback(null, { statusCode: 200 }, 'h1 { color: blue; }'); }, 10); return; } - + if (url.includes('example.com/target.less')) { setTimeout(() => { callback(null, { statusCode: 200 }, 'h1 { color: blue; }'); }, 10); return; } - + // Default error for unmocked URLs setTimeout(() => { callback(new Error('Unmocked URL: ' + url), null, null); @@ -54,27 +63,17 @@ Module.prototype.require = function(id) { return originalRequire.apply(this, arguments); }; -// Now load other modules after mocking is set up -var path = require('path'), - fs = require('fs'), - lessTest = require('./less-test'), - stylize = require('../lib/less-node/lessc-helper').stylize; - // Parse command line arguments for test filtering var args = process.argv.slice(2); var testFilter = args.length > 0 ? args[0] : null; // Create the test runner with the filter -var lessTester = lessTest(testFilter); - -// HTTP mocking is now handled by needle mocking above +var lessTester = createLessTester(testFilter); // Test HTTP redirect functionality function testHttpRedirects() { - const less = require('../lib/less-node').default; - - console.log('🧪 Testing HTTP redirect functionality...'); - + console.log('Testing HTTP redirect functionality...'); + const redirectTest = ` @import "https://example.com/redirect.less"; @@ -84,19 +83,18 @@ h1 { color: red; } return less.render(redirectTest, { filename: 'test-redirect.less' }).then(result => { - console.log('✅ HTTP redirect test SUCCESS:'); + console.log('HTTP redirect test SUCCESS:'); console.log(result.css); - - // Check if both imported and local content are present + if (result.css.includes('color: blue') && result.css.includes('color: red')) { - console.log('🎉 HTTP redirect test PASSED - both imported and local content found'); + console.log('HTTP redirect test PASSED - both imported and local content found'); return true; } else { - console.log('❌ HTTP redirect test FAILED - missing expected content'); + console.log('HTTP redirect test FAILED - missing expected content'); return false; } }).catch(err => { - console.log('❌ HTTP redirect test ERROR:'); + console.log('HTTP redirect test ERROR:'); console.log(err.message); return false; }); @@ -104,34 +102,30 @@ h1 { color: red; } // Test import-remote functionality function testImportRemote() { - const less = require('../lib/less-node').default; - const fs = require('fs'); - const path = require('path'); - - console.log('🧪 Testing import-remote functionality...'); - + console.log('Testing import-remote functionality...'); + const testFile = path.join(__dirname, '../../test-data/tests-unit/import/import-remote.less'); const expectedFile = path.join(__dirname, '../../test-data/tests-unit/import/import-remote.css'); - + const content = fs.readFileSync(testFile, 'utf8'); const expected = fs.readFileSync(expectedFile, 'utf8'); - + return less.render(content, { filename: testFile }).then(result => { - console.log('✅ Import-remote test SUCCESS:'); + console.log('Import-remote test SUCCESS:'); console.log('Expected:', expected.trim()); console.log('Actual:', result.css.trim()); - + if (result.css.trim() === expected.trim()) { - console.log('🎉 Import-remote test PASSED - CDN imports and variable resolution working'); + console.log('Import-remote test PASSED - CDN imports and variable resolution working'); return true; } else { - console.log('❌ Import-remote test FAILED - output mismatch'); + console.log('Import-remote test FAILED - output mismatch'); return false; } }).catch(err => { - console.log('❌ Import-remote test ERROR:'); + console.log('Import-remote test ERROR:'); console.log(err.message); return false; }); @@ -143,52 +137,27 @@ if (testFilter) { console.log('Running tests matching: ' + testFilter + '\n'); } -// Glob patterns for main test runs (excluding problematic tests that will run separately) var globPatterns = [ 'tests-config/*/*.less', 'tests-unit/*/*.less', - // Debug tests have nested subdirectories (comments/, mediaquery/, all/) 'tests-config/debug/*/linenumbers-*.less', - '!tests-config/sourcemaps/**/*.less', // Exclude sourcemaps (need special handling) - '!tests-config/sourcemaps-empty/*', // Exclude sourcemaps-empty (need special handling) - '!tests-config/sourcemaps-disable-annotation/*', // Exclude sourcemaps-disable-annotation (need special handling) - '!tests-config/sourcemaps-variable-selector/*', // Exclude sourcemaps-variable-selector (need special handling) - '!tests-config/globalVars/*', // Exclude globalVars (need JSON config handling) - '!tests-config/modifyVars/*', // Exclude modifyVars (need JSON config handling) - '!tests-config/js-type-errors/*', // Exclude js-type-errors (need special test function) - '!tests-config/no-js-errors/*', // Exclude no-js-errors (need special test function) - '!tests-unit/import/import-remote.less', // Exclude import-remote (tested separately in isolation) - - // HTTP import tests are now included since we have needle mocking + '!tests-config/sourcemaps/**/*.less', + '!tests-config/sourcemaps-empty/*', + '!tests-config/sourcemaps-disable-annotation/*', + '!tests-config/sourcemaps-variable-selector/*', + '!tests-config/globalVars/*', + '!tests-config/modifyVars/*', + '!tests-config/js-type-errors/*', + '!tests-config/no-js-errors/*', + '!tests-unit/import/import-remote.less', ]; var testMap = [ - // Main test runs using glob patterns (cosmiconfig handles configs) - { - patterns: globPatterns - }, - - // Error tests - { - patterns: ['tests-error/eval/*.less'], - verifyFunction: lessTester.testErrors - }, - { - patterns: ['tests-error/parse/*.less'], - verifyFunction: lessTester.testErrors - }, - - // Special test cases with specific handling - { - patterns: ['tests-config/js-type-errors/*.less'], - verifyFunction: lessTester.testTypeErrors - }, - { - patterns: ['tests-config/no-js-errors/*.less'], - verifyFunction: lessTester.testErrors - }, - - // Sourcemap tests with special handling + { patterns: globPatterns }, + { patterns: ['tests-error/eval/*.less'], verifyFunction: lessTester.testErrors }, + { patterns: ['tests-error/parse/*.less'], verifyFunction: lessTester.testErrors }, + { patterns: ['tests-config/js-type-errors/*.less'], verifyFunction: lessTester.testTypeErrors }, + { patterns: ['tests-config/no-js-errors/*.less'], verifyFunction: lessTester.testErrors }, { patterns: [ 'tests-config/sourcemaps/**/*.less', @@ -202,35 +171,17 @@ var testMap = [ if (type === 'vars') { return path.join(baseFolder, filename) + '.json'; } - // Extract just the filename (without directory) for the JSON file var jsonFilename = path.basename(filename); - // For sourcemap type, return path relative to test directory - if (type === 'sourcemap') { - return path.join('test/sourcemaps', jsonFilename) + '.json'; - } return path.join('test/sourcemaps', jsonFilename) + '.json'; } }, - { - patterns: ['tests-config/sourcemaps-empty/*.less'], - verifyFunction: lessTester.testEmptySourcemap - }, - { - patterns: ['tests-config/sourcemaps-disable-annotation/*.less'], - verifyFunction: lessTester.testSourcemapWithoutUrlAnnotation - }, - { - patterns: ['tests-config/sourcemaps-variable-selector/*.less'], - verifyFunction: lessTester.testSourcemapWithVariableInSelector - }, - - // Import tests with JSON configs + { patterns: ['tests-config/sourcemaps-empty/*.less'], verifyFunction: lessTester.testEmptySourcemap }, + { patterns: ['tests-config/sourcemaps-disable-annotation/*.less'], verifyFunction: lessTester.testSourcemapWithoutUrlAnnotation }, + { patterns: ['tests-config/sourcemaps-variable-selector/*.less'], verifyFunction: lessTester.testSourcemapWithVariableInSelector }, { patterns: ['tests-config/globalVars/*.less'], lessOptions: { globalVars: function(file) { - const fs = require('fs'); - const path = require('path'); const basename = path.basename(file, '.less'); const jsonPath = path.join(path.dirname(file), basename + '.json'); try { @@ -245,8 +196,6 @@ var testMap = [ patterns: ['tests-config/modifyVars/*.less'], lessOptions: { modifyVars: function(file) { - const fs = require('fs'); - const path = require('path'); const basename = path.basename(file, '.less'); const jsonPath = path.join(path.dirname(file), basename + '.json'); try { @@ -259,34 +208,28 @@ var testMap = [ } ]; -// Note: needle mocking is set up globally at the top of the file - testMap.forEach(function(testConfig) { - // For glob patterns, pass lessOptions as the first parameter and patterns as the second if (testConfig.patterns) { lessTester.runTestSet( - testConfig.lessOptions || {}, // First param: options (including lessOptions) - testConfig.patterns, // Second param: patterns - testConfig.verifyFunction || null, // Third param: verifyFunction - testConfig.nameModifier || null, // Fourth param: nameModifier - testConfig.doReplacements || null, // Fifth param: doReplacements - testConfig.getFilename || null // Sixth param: getFilename + testConfig.lessOptions || {}, + testConfig.patterns, + testConfig.verifyFunction || null, + testConfig.nameModifier || null, + testConfig.doReplacements || null, + testConfig.getFilename || null ); } else { - // Legacy format for non-glob tests - var args = [ - testConfig.options || {}, // First param: options - testConfig.foldername, // Second param: foldername - testConfig.verifyFunction || null, // Third param: verifyFunction - testConfig.nameModifier || null, // Fourth param: nameModifier - testConfig.doReplacements || null, // Fifth param: doReplacements - testConfig.getFilename || null // Sixth param: getFilename - ]; - lessTester.runTestSet.apply(lessTester, args); + lessTester.runTestSet.apply(lessTester, [ + testConfig.options || {}, + testConfig.foldername, + testConfig.verifyFunction || null, + testConfig.nameModifier || null, + testConfig.doReplacements || null, + testConfig.getFilename || null + ]); } }); -// Special synchronous tests lessTester.testSyncronous({syncImport: true}, 'tests-unit/import/import'); lessTester.testSyncronous({syncImport: true}, 'tests-config/math-strict/css'); @@ -295,13 +238,10 @@ lessTester.testDisablePluginRule(); lessTester.testJSImport(); lessTester.finished(); - -// Test HTTP redirect functionality console.log('\nTesting HTTP redirect functionality...'); testHttpRedirects(); console.log('HTTP redirect test completed'); -// Test import-remote functionality in isolation console.log('\nTesting import-remote functionality...'); testImportRemote(); console.log('Import-remote test completed'); diff --git a/packages/less/test/less-test.js b/packages/less/test/less-test.js index ca4c5a35b..64b26013a 100644 --- a/packages/less/test/less-test.js +++ b/packages/less/test/less-test.js @@ -1,8 +1,16 @@ /* jshint latedef: nofunc */ -var semver = require('semver'); -var logger = require('../lib/less/logger').default; -var { cosmiconfigSync } = require('cosmiconfig'); -var glob = require('glob'); +import { createRequire } from 'module'; +import path from 'path'; +import fs from 'fs'; +import semver from 'semver'; +import logger from '../lib/less/logger.js'; +import { cosmiconfigSync } from 'cosmiconfig'; +import { globSync } from 'glob'; +import { copy as clone } from 'copy-anything'; +import less from '../lib/less-node/index.js'; +import { stylize } from '../lib/less-node/lessc-helper.js'; + +const require = createRequire(import.meta.url); var isVerbose = process.env.npm_config_loglevel !== 'concise'; logger.addListener({ @@ -20,15 +28,7 @@ logger.addListener({ }); -module.exports = function(testFilter) { - var path = require('path'), - fs = require('fs'), - clone = require('copy-anything').copy; - - var less = require('../'); - - var stylize = require('../lib/less-node/lessc-helper').stylize; - +export default function(testFilter) { var globals = Object.keys(global); var oneTestOnly = testFilter || process.argv[2], @@ -37,33 +37,21 @@ module.exports = function(testFilter) { var testFolder = path.dirname(require.resolve('@less/test-data')); var lessFolder = testFolder; - // Define String.prototype.endsWith if it doesn't exist (in older versions of node) - // This is required by the testSourceMap function below - if (typeof String.prototype.endsWith !== 'function') { - String.prototype.endsWith = function (str) { - return this.slice(-str.length) === str; - } - } - var queueList = [], queueRunning = false; function queue(func) { if (queueRunning) { - // console.log("adding to queue"); queueList.push(func); } else { - // console.log("first in queue - starting"); queueRunning = true; func(); } } function release() { if (queueList.length) { - // console.log("running next in queue"); var func = queueList.shift(); setTimeout(func, 0); } else { - // console.log("stopping queue"); queueRunning = false; } } @@ -86,84 +74,67 @@ module.exports = function(testFilter) { }); function validateSourcemapMappings(sourcemap, lessFile, compiledCSS) { - // Validate sourcemap mappings using SourceMapConsumer var SourceMapConsumer = require('source-map').SourceMapConsumer; - // sourcemap can be either a string or already parsed object var sourceMapObj = typeof sourcemap === 'string' ? JSON.parse(sourcemap) : sourcemap; var consumer = new SourceMapConsumer(sourceMapObj); - - // Read the LESS source file + var lessSource = fs.readFileSync(lessFile, 'utf8'); var lessLines = lessSource.split('\n'); - - // Use the compiled CSS (remove sourcemap annotation for validation) + var cssSource = compiledCSS.replace(/\/\*# sourceMappingURL=.*\*\/\s*$/, '').trim(); var cssLines = cssSource.split('\n'); - + var errors = []; var validatedMappings = 0; - - // Validate mappings for each line in the CSS + for (var cssLine = 1; cssLine <= cssLines.length; cssLine++) { var cssLineContent = cssLines[cssLine - 1]; - // Skip empty lines if (!cssLineContent.trim()) { continue; } - - // Check mapping for the start of this CSS line + var mapping = consumer.originalPositionFor({ line: cssLine, column: 0 }); - + if (mapping.source) { validatedMappings++; - - // Verify the source file exists in the sourcemap + if (!sourceMapObj.sources || sourceMapObj.sources.indexOf(mapping.source) === -1) { errors.push('Line ' + cssLine + ': mapped to source "' + mapping.source + '" which is not in sources array'); } - - // Verify the line number is valid + if (mapping.line && mapping.line > 0) { - // If we can find the source file, validate the line exists var sourceIndex = sourceMapObj.sources.indexOf(mapping.source); if (sourceIndex >= 0 && sourceMapObj.sourcesContent && sourceMapObj.sourcesContent[sourceIndex] !== undefined && sourceMapObj.sourcesContent[sourceIndex] !== null) { var sourceContent = sourceMapObj.sourcesContent[sourceIndex]; - // Ensure sourceContent is a string (it should be, but be defensive) if (typeof sourceContent !== 'string') { sourceContent = String(sourceContent); } - // Split by newline - handle both \n and \r\n var sourceLines = sourceContent.split(/\r?\n/); if (mapping.line > sourceLines.length) { errors.push('Line ' + cssLine + ': mapped to line ' + mapping.line + ' in "' + mapping.source + '" but source only has ' + sourceLines.length + ' lines'); } - } else if (sourceIndex >= 0) { - // Source content not embedded, try to validate against the actual file if it matches - // This is a best-effort validation } } } } - - // Validate that all sources in the sourcemap are valid + if (sourceMapObj.sources) { sourceMapObj.sources.forEach(function(source, index) { if (sourceMapObj.sourcesContent && sourceMapObj.sourcesContent[index]) { - // Source content is embedded, validate it's not empty if (!sourceMapObj.sourcesContent[index].trim()) { errors.push('Source "' + source + '" has empty content'); } } }); } - + if (consumer.destroy && typeof consumer.destroy === 'function') { consumer.destroy(); } - + return { valid: errors.length === 0, errors: errors, @@ -171,13 +142,11 @@ module.exports = function(testFilter) { }; } - function testSourcemap(name, err, compiledLess, doReplacements, sourcemap, baseFolder, getFilename) { + function testSourcemap(name, err, compiledLess, doReplacements, sourcemap, baseFolder, imports, getFilename) { if (err) { fail('ERROR: ' + (err && err.message)); return; } - // Check the sourceMappingURL at the bottom of the file - // Default expected URL is name + '.css.map', but can be overridden by sourceMapURL option var sourceMappingPrefix = '/*# sourceMappingURL=', sourceMappingSuffix = ' */'; var indexOfSourceMappingPrefix = compiledLess.indexOf(sourceMappingPrefix); @@ -185,24 +154,20 @@ module.exports = function(testFilter) { fail('ERROR: sourceMappingURL was not found in ' + baseFolder + '/' + name + '.css.'); return; } - + var startOfSourceMappingValue = indexOfSourceMappingPrefix + sourceMappingPrefix.length, indexOfSuffix = compiledLess.indexOf(sourceMappingSuffix, startOfSourceMappingValue), actualSourceMapURL = compiledLess.substring(startOfSourceMappingValue, indexOfSuffix === -1 ? compiledLess.length : indexOfSuffix).trim(); - - // For tests with custom sourceMapURL, we just verify it exists and is non-empty - // The actual value will be validated by comparing the sourcemap JSON + if (!actualSourceMapURL) { fail('ERROR: sourceMappingURL is empty in ' + baseFolder + '/' + name + '.css.'); return; } - // Use getFilename if available (for sourcemap tests with subdirectories) var jsonPath; if (getFilename && typeof getFilename === 'function') { jsonPath = getFilename(name, 'sourcemap', baseFolder); } else { - // Fallback: extract just the filename for sourcemap JSON files var jsonFilename = path.basename(name); jsonPath = path.join('test/sourcemaps', jsonFilename) + '.json'; } @@ -212,30 +177,18 @@ module.exports = function(testFilter) { fail('ERROR: Could not read expected sourcemap file: ' + jsonPath + ' - ' + e.message); return; } - - // Apply doReplacements to the expected sourcemap to handle {path} placeholders - // This normalizes absolute paths that differ between environments - // For sourcemaps, we need to ensure {path} uses forward slashes to avoid breaking JSON - // (backslashes in JSON strings need escaping, and sourcemaps should use forward slashes anyway) + var replacementPath = path.join(path.dirname(path.join(baseFolder, name) + '.less'), '/'); - // Normalize to forward slashes for sourcemap JSON (web-compatible) replacementPath = replacementPath.replace(/\\/g, '/'); - // Replace {path} with normalized forward-slash path BEFORE calling doReplacements - // This ensures the JSON is always valid and uses web-compatible paths expectedSourcemap = expectedSourcemap.replace(/\{path\}/g, replacementPath); - // Also handle other placeholders that might be in the sourcemap (but {path} is already done) expectedSourcemap = doReplacements(expectedSourcemap, baseFolder, path.join(baseFolder, name) + '.less'); - - // Normalize paths in sourcemap JSON to use forward slashes (web-compatible) - // We need to parse the JSON, normalize the file property, then stringify for comparison - // This avoids breaking escape sequences like \n in the JSON string + function normalizeSourcemapPaths(sm) { try { var parsed = typeof sm === 'string' ? JSON.parse(sm) : sm; if (parsed.file) { parsed.file = parsed.file.replace(/\\/g, '/'); } - // Also normalize paths in sources array if (parsed.sources && Array.isArray(parsed.sources)) { parsed.sources = parsed.sources.map(function(src) { return src.replace(/\\/g, '/'); @@ -243,27 +196,21 @@ module.exports = function(testFilter) { } return JSON.stringify(parsed, null, 0); } catch (parseErr) { - // If parsing fails, return original (shouldn't happen) return sm; } } - + var normalizedSourcemap = normalizeSourcemapPaths(sourcemap); var normalizedExpected = normalizeSourcemapPaths(expectedSourcemap); - + if (normalizedSourcemap === normalizedExpected) { - // Validate the sourcemap mappings are correct - // Find the actual LESS file - it might be in a subdirectory var nameParts = name.split('/'); var lessFileName = nameParts[nameParts.length - 1]; var lessFileDir = nameParts.length > 1 ? nameParts.slice(0, -1).join('/') : ''; var lessFile = path.join(lessFolder, lessFileDir, lessFileName) + '.less'; - - // Only validate if the LESS file exists + if (fs.existsSync(lessFile)) { try { - // Parse the sourcemap once for validation (avoid re-parsing) - // Use the original sourcemap string, not the normalized one var sourceMapObjForValidation = typeof sourcemap === 'string' ? JSON.parse(sourcemap) : sourcemap; var validation = validateSourcemapMappings(sourceMapObjForValidation, lessFile, compiledLess); if (!validation.valid) { @@ -277,10 +224,9 @@ module.exports = function(testFilter) { if (isVerbose) { process.stdout.write(' (validation error: ' + validationErr.message + ')'); } - // Don't fail the test if validation has an error, just log it } } - + ok('OK'); } else if (err) { fail('ERROR: ' + (err && err.message)); @@ -299,14 +245,12 @@ module.exports = function(testFilter) { fail('ERROR: ' + (err && err.message)); return; } - // This matches with strings that end($) with source mapping url annotation. var sourceMapRegExp = /\/\*# sourceMappingURL=.+\.css\.map \*\/$/; if (sourceMapRegExp.test(compiledLess)) { fail('ERROR: sourceMappingURL found in ' + baseFolder + '/' + name + '.css.'); return; } - // Even if annotation is not necessary, the map file should be there. fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) { process.stdout.write('- ' + path.join(baseFolder, name) + ': '); if (sourcemap === expectedSourcemap) { @@ -331,7 +275,6 @@ module.exports = function(testFilter) { var expectedSourcemap = undefined; if ( compiledLess !== '' ) { difference('\nCompiledLess must be empty', '', compiledLess); - } else if (sourcemap !== expectedSourcemap) { fail('Sourcemap must be undefined'); } else { @@ -346,7 +289,6 @@ module.exports = function(testFilter) { return; } - // Even if annotation is not necessary, the map file should be there. fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) { process.stdout.write('- ' + path.join(baseFolder, name) + ': '); if (sourcemap === expectedSourcemap) { @@ -373,7 +315,6 @@ module.exports = function(testFilter) { return JSON.stringify(imports, null, ' ') } - /** Imports are not sorted */ const importsString = stringify(imports.sort()) fs.readFile(path.join(lessFolder, name) + '.json', 'utf8', function (e, expectedImports) { @@ -420,9 +361,6 @@ module.exports = function(testFilter) { }); } - // To fix ci fail about error format change in upstream v8 project - // https://github.com/v8/v8/commit/c0fd89c3c089e888c4f4e8582e56db7066fa779b - // Node 16.9.0+ include this change via https://github.com/nodejs/node/pull/39947 function testTypeErrors(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { const fileSuffix = semver.gte(process.version, 'v16.9.0') ? '-2.txt' : '.txt'; fs.readFile(path.join(baseFolder, name) + fileSuffix, 'utf8', function (e, expectedErr) { @@ -464,42 +402,33 @@ module.exports = function(testFilter) { } function globalReplacements(input, directory, filename) { - var path = require('path'); var p = filename ? path.join(path.dirname(filename), '/') : directory; - - // For debug tests in subdirectories (comments/, mediaquery/, all/), - // the import/ directory and main linenumbers.less file are at the parent debug/ level, not in the subdirectory + var isDebugSubdirectory = false; var debugParentPath = null; - + if (directory) { - // Normalize directory path separators for matching var normalizedDir = directory.replace(/\\/g, '/'); - // Check if we're in a debug subdirectory if (normalizedDir.includes('/debug/') && (normalizedDir.includes('/comments/') || normalizedDir.includes('/mediaquery/') || normalizedDir.includes('/all/'))) { isDebugSubdirectory = true; - // Extract the debug/ directory path (parent of the subdirectory) - // Match everything up to and including /debug/ (works with both absolute and relative paths) var debugMatch = normalizedDir.match(/(.+\/debug)\//); if (debugMatch) { debugParentPath = debugMatch[1]; } } } - + if (isDebugSubdirectory && debugParentPath) { - // For {path} placeholder, use the parent debug/ directory - // Convert back to native path format p = debugParentPath.replace(/\//g, path.sep) + path.sep; } - + var pathimport; if (isDebugSubdirectory && debugParentPath) { pathimport = path.join(debugParentPath.replace(/\//g, path.sep), 'import') + path.sep; } else { pathimport = path.join(directory + 'import/'); } - + var pathesc = p.replace(/[.:/\\]/g, function(a) { return '\\' + (a == '\\' ? '\/' : a); }), pathimportesc = pathimport.replace(/[.:/\\]/g, function(a) { return '\\' + (a == '\\' ? '\/' : a); }); @@ -544,13 +473,10 @@ module.exports = function(testFilter) { } function runTestSet(options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { - // Handle case where first parameter is glob patterns (no options object) if (Array.isArray(options)) { - // First parameter is glob patterns, no options object foldername = options; options = {}; } else if (typeof options === 'string') { - // First parameter is foldername (no options object) foldername = options; options = {}; } else { @@ -577,8 +503,7 @@ module.exports = function(testFilter) { var patterns = foldername; var includePatterns = []; var excludePatterns = []; - - + patterns.forEach(function(pattern) { if (pattern.startsWith('!')) { excludePatterns.push(pattern.substring(1)); @@ -586,11 +511,10 @@ module.exports = function(testFilter) { includePatterns.push(pattern); } }); - - // Use glob to find all matching files, excluding the excluded patterns + var allFiles = []; includePatterns.forEach(function(pattern) { - var files = glob.sync(pattern, { + var files = globSync(pattern, { cwd: baseFolder, absolute: true, ignore: excludePatterns @@ -598,21 +522,14 @@ module.exports = function(testFilter) { allFiles = allFiles.concat(files); }); - - // Note: needle mocking is set up globally in index.js - - // Process each .less file found + allFiles.forEach(function(filePath) { if (/\.less$/.test(filePath)) { var file = path.basename(filePath); - // For glob patterns, we need to construct the relative path differently - // The filePath is absolute, so we need to get the path relative to the test-data directory var relativePath = path.relative(baseFolder, path.dirname(filePath)) + '/'; - // Only process files that have corresponding .css files (these are the actual tests) var cssPath = path.join(path.dirname(filePath), path.basename(file, '.less') + '.css'); if (fs.existsSync(cssPath)) { - // Process this file using the existing logic processFileWithInfo({ file: file, fullPath: filePath, @@ -621,7 +538,6 @@ module.exports = function(testFilter) { } } }); - return; } @@ -630,40 +546,31 @@ module.exports = function(testFilter) { var file = fileInfo.file; var fullPath = fileInfo.fullPath; var relativePath = fileInfo.relativePath; - - // Load config for this specific file using cosmiconfig + var configResult = cosmiconfigSync('styles').search(path.dirname(fullPath)); - - // Deep clone the original options to prevent Less from modifying shared objects + var options = JSON.parse(JSON.stringify(originalOptions || {})); - + if (configResult && configResult.config && configResult.config.language && configResult.config.language.less) { - // Deep clone and merge the language.less settings with the original options var lessConfig = JSON.parse(JSON.stringify(configResult.config.language.less)); Object.keys(lessConfig).forEach(function(key) { options[key] = lessConfig[key]; }); } - - // Merge any lessOptions from the testMap (for dynamic options like getVars functions) + if (originalOptions && originalOptions.lessOptions) { Object.keys(originalOptions.lessOptions).forEach(function(key) { var value = originalOptions.lessOptions[key]; if (typeof value === 'function') { - // For functions, call them with the file path var result = value(fullPath); options[key] = result; } else { - // For static values, use them directly options[key] = value; } }); } - // Don't pass stylize to less.render as it's not a valid option - var name = getBasename(file, relativePath); - if (oneTestOnly && typeof oneTestOnly === 'string' && !name.includes(oneTestOnly)) { return; @@ -671,20 +578,14 @@ module.exports = function(testFilter) { totalTests++; - if (options.sourceMap && !options.sourceMap.sourceMapFileInline) { - // Set test infrastructure defaults only if not already set by styles.config.cjs - // Less.js core (parse-tree.js) will handle normalization of: - // - sourceMapBasepath (defaults to input file's directory) - // - sourceMapInputFilename (defaults to options.filename) - // - sourceMapFilename (derived from sourceMapOutputFilename or input filename) - // - sourceMapOutputFilename (derived from input filename if not set) - if (!options.sourceMap.sourceMapOutputFilename) { - // Needed for sourcemap file name in JSON output - options.sourceMap.sourceMapOutputFilename = name + '.css'; - } - if (!options.sourceMap.sourceMapRootpath) { - // Test-specific default for consistent test output paths - options.sourceMap.sourceMapRootpath = 'testweb/'; + if (options.sourceMap && typeof options.sourceMap === 'object') { + if (!options.sourceMap.sourceMapFileInline) { + if (!options.sourceMap.sourceMapOutputFilename) { + options.sourceMap.sourceMapOutputFilename = name + '.css'; + } + if (!options.sourceMap.sourceMapRootpath) { + options.sourceMap.sourceMapRootpath = 'testweb/'; + } } } @@ -710,9 +611,6 @@ module.exports = function(testFilter) { } doubleCallCheck = (new Error()).stack; - /** - * @todo - refactor so the result object is sent to the verify function - */ if (verifyFunction) { var verificationResult = verifyFunction( name, err, result && result.css, doReplacements, result && result.map, baseFolder, result && result.imports, getFilename @@ -728,7 +626,6 @@ module.exports = function(testFilter) { if (err.stack) { process.stdout.write(err.stack + '\n'); } else { - // this sometimes happen - show the whole error object console.log(err); } } @@ -738,23 +635,16 @@ module.exports = function(testFilter) { var css_name = name; if (nameModifier) { css_name = nameModifier(name); } - // Check if we're using the new co-located structure (tests-unit/ or tests-config/) or the old separated structure var cssPath; if (relativePath.startsWith('tests-unit/') || relativePath.startsWith('tests-config/')) { - // New co-located structure: CSS file is in the same directory as LESS file cssPath = path.join(path.dirname(fullPath), path.basename(file, '.less') + '.css'); } else { - // Old separated structure: CSS file is in separate css/ folder - // Windows compatibility: css_name may already contain path separators - // Use path.join with empty string to let path.join handle normalization cssPath = path.join(testFolder, css_name) + '.css'; } - // For the new structure, we need to handle replacements differently var replacementPath; if (relativePath.startsWith('tests-unit/') || relativePath.startsWith('tests-config/')) { replacementPath = path.dirname(fullPath); - // Ensure replacementPath ends with a path separator for consistent matching if (!replacementPath.endsWith(path.sep)) { replacementPath += path.sep; } @@ -765,34 +655,29 @@ module.exports = function(testFilter) { var testName = fullPath.replace(/\.less$/, ''); process.stdout.write('- ' + testName + ': '); - var css = fs.readFileSync(cssPath, 'utf8'); css = css && doReplacements(css, replacementPath); if (result.css === css) { ok('OK'); } else { difference('FAIL', css, result.css); } - + release(); }); }); } - + function getBasename(file, relativePath) { var basePath = relativePath || foldername; - // Ensure basePath ends with a slash for proper path construction if (basePath.charAt(basePath.length - 1) !== '/') { basePath = basePath + '/'; } return basePath + path.basename(file, '.less'); } - - // This function is only called for non-glob patterns now - // For glob patterns, we use the glob library in the calling code var dirPath = path.join(baseFolder, foldername); var items = fs.readdirSync(dirPath); - + items.forEach(function(item) { if (/\.less$/.test(item)) { processFileWithInfo({ @@ -805,11 +690,9 @@ module.exports = function(testFilter) { } function diff(left, right) { - // Configure chalk to always show colors var chalk = require('chalk'); - chalk.level = 3; // Force colors on - - // Use jest-diff for much clearer output like Vitest + chalk.level = 3; + var diffResult = require('jest-diff').diffStringsUnified(left || '', right || '', { expand: false, includeChangeCounts: true, @@ -819,8 +702,7 @@ module.exports = function(testFilter) { changeColor: chalk.inverse, commonColor: chalk.dim }); - - // jest-diff returns a string with ANSI colors, so we can output it directly + process.stdout.write(diffResult + '\n'); } @@ -834,9 +716,8 @@ module.exports = function(testFilter) { process.stdout.write(stylize(msg, 'yellow') + '\n'); failedTests++; - // Only show the diff, not the full text process.stdout.write(stylize('Diff:', 'yellow') + '\n'); - + diff(left || '', right || ''); endTest(); } @@ -882,48 +763,35 @@ module.exports = function(testFilter) { return false; } - /** - * - * @param {Object} options - * @param {string} filePath - * @param {Function} callback - */ function toCSS(options, filePath, callback) { - // Deep clone options to prevent modifying the original, but preserve functions var originalOptions = options || {}; options = JSON.parse(JSON.stringify(originalOptions)); - - // Restore functions that were lost in JSON serialization + if (originalOptions.getVars) { options.getVars = originalOptions.getVars; } var str = fs.readFileSync(filePath, 'utf8'), addPath = path.dirname(filePath); - - // Initialize paths array if it doesn't exist + if (typeof options.paths !== 'string') { options.paths = options.paths || []; } else { options.paths = [options.paths]; } - - // Add the current directory to paths if not already present + if (!contains(options.paths, addPath)) { options.paths.push(addPath); } - - // Resolve all paths relative to the test file's directory + options.paths = options.paths.map(searchPath => { if (path.isAbsolute(searchPath)) { return searchPath; } - // Resolve relative to the test file's directory return path.resolve(path.dirname(filePath), searchPath); }) - + options.filename = path.resolve(process.cwd(), filePath); options.optimization = options.optimization || 0; - // Note: globalVars and modifyVars are now handled via styles.config.cjs or lessOptions if (options.plugin) { var Plugin = require(path.resolve(process.cwd(), options.plugin)); options.plugins = [Plugin]; @@ -946,15 +814,11 @@ module.exports = function(testFilter) { ok(stylize('OK\n', 'green')); } - // HTTP redirect testing is now handled directly in test/index.js - function testDisablePluginRule() { less.render( '@plugin "../../plugin/some_plugin";', {disablePluginRule: true}, function(err) { - // TODO: Need a better way of identifing exactly which error is thrown. Checking - // text like this tends to be rather brittle. const EXPECTED = '@plugin statements are not allowed when disablePluginRule is set to true'; if (!err || String(err).indexOf(EXPECTED) < 0) { fail('ERROR: Expected "' + EXPECTED + '" error'); @@ -981,4 +845,4 @@ module.exports = function(testFilter) { testJSImport: testJSImport, finished: finished }; -}; +} diff --git a/packages/less/test/mocha-playwright/runner.js b/packages/less/test/mocha-playwright/runner.js index da6ef8fd9..c09338238 100644 --- a/packages/less/test/mocha-playwright/runner.js +++ b/packages/less/test/mocha-playwright/runner.js @@ -1,8 +1,6 @@ -'use strict'; - -const path = require('path'); -const util = require('util'); -const { chromium } = require('playwright'); +import path from 'path'; +import util from 'util'; +import { chromium } from 'playwright'; const TIMEOUT_MILLISECONDS = 60000; function initMocha(reporter) { @@ -155,7 +153,7 @@ function prepareUrl(filePath) { return `file://${resolvedPath}`; } -exports.runner = function ({ file, reporter, timeout, width, height, args, executablePath, visible, polling }) { +export function runner({ file, reporter, timeout, width, height, args, executablePath, visible, polling }) { return new Promise(resolve => { // validate options @@ -207,4 +205,4 @@ exports.runner = function ({ file, reporter, timeout, width, height, args, execu resolve(result); }); -}; +} diff --git a/packages/less/test/modify-vars.js b/packages/less/test/modify-vars.js index a5763d2eb..3d58e4e79 100644 --- a/packages/less/test/modify-vars.js +++ b/packages/less/test/modify-vars.js @@ -1,14 +1,5 @@ -var less; - -// Dist fallback for NPM-installed Less (for plugins that do testing) -try { - less = require('../tmp/less.cjs.js'); -} -catch (e) { - less = require('../dist/less.cjs.js'); -} - -var fs = require('fs'); +import less from '../lib/less-node/index.js'; +import fs from 'fs'; var input = fs.readFileSync('./test/less/modifyVars/extended.less', 'utf8'); var expectedCss = fs.readFileSync('./test/css/modifyVars/extended.css', 'utf8'); diff --git a/packages/less/test/plugins/filemanager/index.js b/packages/less/test/plugins/filemanager/index.cjs similarity index 100% rename from packages/less/test/plugins/filemanager/index.js rename to packages/less/test/plugins/filemanager/index.cjs diff --git a/packages/less/test/plugins/postprocess/index.js b/packages/less/test/plugins/postprocess/index.cjs similarity index 100% rename from packages/less/test/plugins/postprocess/index.js rename to packages/less/test/plugins/postprocess/index.cjs diff --git a/packages/less/test/plugins/preprocess/index.js b/packages/less/test/plugins/preprocess/index.cjs similarity index 100% rename from packages/less/test/plugins/preprocess/index.js rename to packages/less/test/plugins/preprocess/index.cjs diff --git a/packages/less/test/plugins/visitor/index.js b/packages/less/test/plugins/visitor/index.cjs similarity index 100% rename from packages/less/test/plugins/visitor/index.js rename to packages/less/test/plugins/visitor/index.cjs diff --git a/packages/less/test/sourcemaps/comprehensive.json b/packages/less/test/sourcemaps/comprehensive.json index 96215f269..a4a88963b 100644 --- a/packages/less/test/sourcemaps/comprehensive.json +++ b/packages/less/test/sourcemaps/comprehensive.json @@ -1 +1 @@ -{"version":3,"sources":["comprehensive.less"],"names":[],"mappings":"AAoBA;EACE,aAAA;EACA,mBAAA;;AAFF,UAIE;EACE,YAAA;EACA,eAAA;;AANJ,UAIE,QAIE;EACE,iBAAA;EACA,mBAAA;;AAVN,UAcE;EACE,mBAAA;EACA,aAAA;;AAhBJ,UAcE,SAIE;EACE,SAAA;EACA,gBAAA;;AAMN;EACE,OAAO,qBAAP;EACA,QAAQ,iBAAR;EACA,YAAA;;AAIF;EACE,cAAA;EACA,mBAAA;EACA,yCAAA;;AAIF;EAlDE,mBAAA;EACA,2BAAA;EACA,wBAAA;EAIA,yCAAA;EA+CA,aAAA;EACA,iBAAA;;AAIF,QAA0B;EACxB;IACE,aAAA;;EADF,UAGE;IACE,eAAA;;;AAKN;EACE;IACE,aAAA;IACA,uBAAuB,cAAvB;IACA,SAAA;;;AAKJ;AAMA;EALE,kBAAA;EACA,YAAA;EACA,eAAA;;AAGF;EAEE,mBAAA;EACA,YAAA;;AAIF,WACE;EACE,gBAAA;;AAFJ,WACE,GAGE;EACE,qBAAA;;AALN,WACE,GAGE,GAGE;EACE,qBAAA;;AAEA,WATN,GAGE,GAGE,EAGG;EACC,cAAA;;AAGF,WAbN,GAGE,GAGE,EAOG;EACC,cAAA;;AAYT;EACC,cAAA;;AAIF,OACE,QACE,QACE;EACE,cAAA","file":"{path}comprehensive.css"} \ No newline at end of file +{"version":3,"sources":["comprehensive.less"],"names":[],"mappings":"AAoBA;EACE,aAAA;EACA,mBAAA;;AAFF,UAIE;EACE,YAAA;EACA,eAAA;;AANJ,UAIE,QAIE;EACE,iBAAA;EACA,mBAAA;;AAVN,UAcE;EACE,mBAAA;EACA,aAAA;;AAhBJ,UAcE,SAIE;EACE,SAAA;EACA,gBAAA;;AAMN;EACE,OAAO,qBAAP;EACA,QAAQ,iBAAR;EACA,YAAA;;AAIF;EACE,cAAA;EACA,mBAAA;EACA,yCAAA;;AAIF;EAlDE,mBAAA;EACA,2BAAA;EACA,wBAAA;EAIA,yCAAA;EA+CA,aAAA;EACA,iBAAA;;AAIF,QAA0B;EACxB;IACE,aAAA;;EADF,UAGE;IACE,eAAA;;;AAKN;EACE;IACE,aAAA;IACA,uBAAuB,cAAvB;IACA,SAAA;;;AAKJ;AAMA;EALE,kBAAA;EACA,YAAA;EACA,eAAA;;AAGF;EAEE,mBAAA;EACA,YAAA;;AAIF,WACE;EACE,gBAAA;;AAFJ,WACE,GAGE;EACE,qBAAA;;AALN,WACE,GAGE,GAGE;EACE,qBAAA;;AAEA,WATN,GAGE,GAGE,EAGG;EACC,cAAA;;AAGF,WAbN,GAGE,GAGE,EAOG;EACC,cAAA;;AAYT;EACC,cAAA;;AAIF,OACE,QACE,QACE;EACE,cAAA","file":"comprehensive.css"} \ No newline at end of file diff --git a/packages/less/test/test-es6.ts b/packages/less/test/test-es6.js similarity index 76% rename from packages/less/test/test-es6.ts rename to packages/less/test/test-es6.js index f83b2d0b1..889160660 100644 --- a/packages/less/test/test-es6.ts +++ b/packages/less/test/test-es6.js @@ -1,7 +1,7 @@ // https://github.com/less/less.js/issues/3533 console.log('Testing ES6 imports...') -import less from '..'; +import less from 'less'; const lessRender = less.render; // then I call lessRender on something @@ -11,7 +11,7 @@ body { b: 2; c: 30; d: 4; -}`, {sourceMap: {}}, function(error: any, output: any) { +}`, {sourceMap: {}}, function(error, output) { if (error) console.error(error) }) \ No newline at end of file diff --git a/packages/less/tsconfig.build.json b/packages/less/tsconfig.build.json deleted file mode 100644 index bbb693682..000000000 --- a/packages/less/tsconfig.build.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "rootDir": "./src", - }, - "include": ["src/**/*"] -} \ No newline at end of file diff --git a/packages/less/tsconfig.json b/packages/less/tsconfig.json index 9eb20b6bd..1a2441366 100644 --- a/packages/less/tsconfig.json +++ b/packages/less/tsconfig.json @@ -1,21 +1,17 @@ { "compilerOptions": { - "outDir": "./lib", + "target": "ES2022", + "module": "ES2022", "moduleResolution": "node", - "rootDir": ".", "allowJs": true, - "sourceMap": true, - "inlineSources": true, + "checkJs": false, + "noEmit": true, "esModuleInterop": true, - "importHelpers": true, "noImplicitAny": true, - "target": "ES5" + "strict": false, + "skipLibCheck": true, + "rootDir": "." }, - "ts-node": { - "compilerOptions": { - "rootDir": "." - } - }, - "include": ["**/*"], - "exclude": ["node_modules", "lib/**/*"] -} \ No newline at end of file + "include": ["lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/test-data/tests-config/filemanagerPlugin/styles.config.cjs b/packages/test-data/tests-config/filemanagerPlugin/styles.config.cjs index ee444169f..c7a769851 100644 --- a/packages/test-data/tests-config/filemanagerPlugin/styles.config.cjs +++ b/packages/test-data/tests-config/filemanagerPlugin/styles.config.cjs @@ -1,7 +1,7 @@ module.exports = { language: { less: { - "plugin": "test/plugins/filemanager/" + "plugin": "test/plugins/filemanager/index.cjs" } } }; diff --git a/packages/test-data/tests-config/postProcessorPlugin/styles.config.cjs b/packages/test-data/tests-config/postProcessorPlugin/styles.config.cjs index a7364c623..a3ab5faa1 100644 --- a/packages/test-data/tests-config/postProcessorPlugin/styles.config.cjs +++ b/packages/test-data/tests-config/postProcessorPlugin/styles.config.cjs @@ -1,7 +1,7 @@ module.exports = { language: { less: { - "plugin": "test/plugins/postprocess/" + "plugin": "test/plugins/postprocess/index.cjs" } } }; diff --git a/packages/test-data/tests-config/preProcessorPlugin/styles.config.cjs b/packages/test-data/tests-config/preProcessorPlugin/styles.config.cjs index fca0da5c9..8439f2fb3 100644 --- a/packages/test-data/tests-config/preProcessorPlugin/styles.config.cjs +++ b/packages/test-data/tests-config/preProcessorPlugin/styles.config.cjs @@ -1,7 +1,7 @@ module.exports = { language: { less: { - "plugin": "test/plugins/preprocess/" + "plugin": "test/plugins/preprocess/index.cjs" } } }; diff --git a/packages/test-data/tests-config/visitorPlugin/styles.config.cjs b/packages/test-data/tests-config/visitorPlugin/styles.config.cjs index 72705a894..c5971580a 100644 --- a/packages/test-data/tests-config/visitorPlugin/styles.config.cjs +++ b/packages/test-data/tests-config/visitorPlugin/styles.config.cjs @@ -1,7 +1,7 @@ module.exports = { language: { less: { - "plugin": "test/plugins/visitor/" + "plugin": "test/plugins/visitor/index.cjs" } } }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a61878606..b29173833 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: npm-run-all: specifier: ^4.1.5 version: 4.1.5 + playwright: + specifier: 1.50.1 + version: 1.50.1 semver: specifier: ^6.3.1 version: 6.3.1 @@ -27,14 +30,11 @@ importers: packages/less: dependencies: copy-anything: - specifier: ^2.0.1 - version: 2.0.6 + specifier: ^3.0.5 + version: 3.0.5 parse-node-version: specifier: ^1.0.1 version: 1.0.1 - tslib: - specifier: ^2.3.0 - version: 2.8.1 optionalDependencies: errno: specifier: ^0.1.1 @@ -75,10 +75,10 @@ importers: version: 11.2.1(rollup@2.79.2) '@typescript-eslint/eslint-plugin': specifier: ^4.28.0 - version: 4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@4.9.5) + version: 4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@5.9.3) '@typescript-eslint/parser': specifier: ^4.28.0 - version: 4.33.0(eslint@7.32.0)(typescript@4.9.5) + version: 4.33.0(eslint@7.32.0)(typescript@5.9.3) benny: specifier: ^3.6.12 version: 3.7.1 @@ -96,7 +96,7 @@ importers: version: 4.1.2 cosmiconfig: specifier: ~9.0.0 - version: 9.0.0(typescript@4.9.5) + version: 9.0.0(typescript@5.9.3) cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -116,7 +116,7 @@ importers: specifier: ^10.0.1 version: 10.0.2 grunt: - specifier: ^1.0.4 + specifier: ^1.5.0 version: 1.6.1 grunt-cli: specifier: ^1.3.2 @@ -187,9 +187,6 @@ importers: rollup-plugin-terser: specifier: ^5.1.1 version: 5.3.1(rollup@2.79.2) - rollup-plugin-typescript2: - specifier: ^0.29.0 - version: 0.29.0(rollup@2.79.2)(typescript@4.9.5) semver: specifier: ^6.3.0 version: 6.3.1 @@ -199,12 +196,9 @@ importers: time-grunt: specifier: ^1.3.0 version: 1.4.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.2(@types/node@25.0.2)(typescript@4.9.5) typescript: - specifier: ^4.3.4 - version: 4.9.5 + specifier: ^5.7.0 + version: 5.9.3 uikit: specifier: 2.27.4 version: 2.27.4 @@ -284,13 +278,6 @@ packages: engines: {node: '>=18'} dev: true - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: true - /@eslint/eslintrc@0.4.3: resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -387,13 +374,6 @@ packages: '@jridgewell/sourcemap-codec': 1.5.5 dev: true - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 - dev: true - /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -478,22 +458,6 @@ packages: resolution: {integrity: sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==} dev: true - /@tsconfig/node10@1.0.12: - resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} - dev: true - - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - dev: true - - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - dev: true - - /@tsconfig/node16@1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - dev: true - /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true @@ -536,7 +500,7 @@ packages: '@types/node': 25.0.2 dev: true - /@typescript-eslint/eslint-plugin@4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@4.9.5): + /@typescript-eslint/eslint-plugin@4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@5.9.3): resolution: {integrity: sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -547,8 +511,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/experimental-utils': 4.33.0(eslint@7.32.0)(typescript@4.9.5) - '@typescript-eslint/parser': 4.33.0(eslint@7.32.0)(typescript@4.9.5) + '@typescript-eslint/experimental-utils': 4.33.0(eslint@7.32.0)(typescript@5.9.3) + '@typescript-eslint/parser': 4.33.0(eslint@7.32.0)(typescript@5.9.3) '@typescript-eslint/scope-manager': 4.33.0 debug: 4.4.3 eslint: 7.32.0 @@ -556,13 +520,13 @@ packages: ignore: 5.3.2 regexpp: 3.2.0 semver: 7.7.3 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 + tsutils: 3.21.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/experimental-utils@4.33.0(eslint@7.32.0)(typescript@4.9.5): + /@typescript-eslint/experimental-utils@4.33.0(eslint@7.32.0)(typescript@5.9.3): resolution: {integrity: sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -571,7 +535,7 @@ packages: '@types/json-schema': 7.0.15 '@typescript-eslint/scope-manager': 4.33.0 '@typescript-eslint/types': 4.33.0 - '@typescript-eslint/typescript-estree': 4.33.0(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 4.33.0(typescript@5.9.3) eslint: 7.32.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@7.32.0) @@ -580,7 +544,7 @@ packages: - typescript dev: true - /@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@4.9.5): + /@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@5.9.3): resolution: {integrity: sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -592,10 +556,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 4.33.0 '@typescript-eslint/types': 4.33.0 - '@typescript-eslint/typescript-estree': 4.33.0(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 4.33.0(typescript@5.9.3) debug: 4.4.3 eslint: 7.32.0 - typescript: 4.9.5 + typescript: 5.9.3 transitivePeerDependencies: - supports-color dev: true @@ -613,7 +577,7 @@ packages: engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dev: true - /@typescript-eslint/typescript-estree@4.33.0(typescript@4.9.5): + /@typescript-eslint/typescript-estree@4.33.0(typescript@5.9.3): resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -628,8 +592,8 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.7.3 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 + tsutils: 3.21.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color dev: true @@ -662,13 +626,6 @@ packages: acorn: 7.4.1 dev: true - /acorn-walk@8.3.4: - resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} - engines: {node: '>=0.4.0'} - dependencies: - acorn: 8.15.0 - dev: true - /acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} @@ -813,10 +770,6 @@ packages: mkdirp: 0.5.6 dev: true - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - dev: true - /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -1340,10 +1293,11 @@ packages: resolution: {integrity: sha512-dX1400pzPULr+ZovkIsDEqe7XH8xCAYGT5Dege4Eot44Qs2mS2iJmnh45TxTO5MIsCfrV/JGZVloLhm46AHxNw==} dev: true - /copy-anything@2.0.6: - resolution: {integrity: sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==} + /copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} dependencies: - is-what: 3.14.1 + is-what: 4.1.16 dev: false /core-util-is@1.0.2: @@ -1354,7 +1308,7 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /cosmiconfig@9.0.0(typescript@4.9.5): + /cosmiconfig@9.0.0(typescript@5.9.3): resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: @@ -1367,11 +1321,7 @@ packages: import-fresh: 3.3.1 js-yaml: 4.1.1 parse-json: 5.2.0 - typescript: 4.9.5 - dev: true - - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + typescript: 5.9.3 dev: true /cross-env@7.0.3: @@ -1585,11 +1535,6 @@ packages: engines: {node: '>=0.3.1'} dev: true - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dev: true - /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -2081,15 +2026,6 @@ packages: - supports-color dev: true - /find-cache-dir@3.3.2: - resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} - engines: {node: '>=8'} - dependencies: - commondir: 1.0.1 - make-dir: 3.1.0 - pkg-dir: 4.2.0 - dev: true - /find-up@3.0.0: resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} engines: {node: '>=6'} @@ -2456,12 +2392,12 @@ packages: /glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.8 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: true @@ -3279,8 +3215,9 @@ packages: get-intrinsic: 1.3.0 dev: true - /is-what@3.14.1: - resolution: {integrity: sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==} + /is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} + engines: {node: '>=12.13'} dev: false /is-windows@1.0.2: @@ -3661,13 +3598,6 @@ packages: dev: false optional: true - /make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - dependencies: - semver: 6.3.1 - dev: true - /make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -3675,10 +3605,6 @@ packages: semver: 7.7.3 dev: true - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: true - /make-iterator@1.0.1: resolution: {integrity: sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==} engines: {node: '>=0.10.0'} @@ -4428,13 +4354,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - dev: true - /platform@1.3.6: resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} dev: true @@ -4753,12 +4672,6 @@ packages: engines: {node: '>=4'} dev: true - /resolve@1.17.0: - resolution: {integrity: sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==} - dependencies: - path-parse: 1.0.7 - dev: true - /resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} @@ -4812,21 +4725,6 @@ packages: terser: 4.8.1 dev: true - /rollup-plugin-typescript2@0.29.0(rollup@2.79.2)(typescript@4.9.5): - resolution: {integrity: sha512-YytahBSZCIjn/elFugEGQR5qTsVhxhUwGZIsA9TmrSsC88qroGo65O5HZP/TTArH2dm0vUmYWhKchhwi2wL9bw==} - peerDependencies: - rollup: '>=1.26.3' - typescript: '>=2.4.0' - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.2) - find-cache-dir: 3.3.2 - fs-extra: 8.1.0 - resolve: 1.17.0 - rollup: 2.79.2 - tslib: 2.0.1 - typescript: 4.9.5 - dev: true - /rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} dependencies: @@ -5518,57 +5416,18 @@ packages: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true - /ts-node@10.9.2(@types/node@25.0.2)(typescript@4.9.5): - resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.12 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 25.0.2 - acorn: 8.15.0 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 4.9.5 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib@2.0.1: - resolution: {integrity: sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==} - dev: true - - /tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - dev: false - - /tsutils@3.21.0(typescript@4.9.5): + /tsutils@3.21.0(typescript@5.9.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.9.5 + typescript: 5.9.3 dev: true /tunnel-agent@0.3.0: @@ -5652,9 +5511,9 @@ packages: reflect.getprototypeof: 1.0.10 dev: true - /typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} + /typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} hasBin: true dev: true @@ -5734,10 +5593,6 @@ packages: hasBin: true dev: true - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: true - /v8-compile-cache@2.4.0: resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} dev: true @@ -6022,11 +5877,6 @@ packages: yargs-parser: 21.1.1 dev: true - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: true - /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} From 76fc00c1be5ce7c0c31ef26917d91b6a0ff1f518 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Mon, 9 Mar 2026 20:19:09 -0700 Subject: [PATCH 26/76] refactor: convert prototype-based tree nodes to ES6 classes (#4412) * refactor: convert prototype-based tree nodes to ES6 classes Convert all 30 tree node files from `Object.assign(new Node(), {...})` prototype pattern to proper `class extends Node` syntax. This enables TypeScript to understand the inheritance chain, reducing checkJs errors from 2756 to 0. - All tree nodes now use `class X extends Node` (or appropriate parent) - Node.type converted from instance property to getter for clean override - Factory functions in index.js updated to use `new` instead of Object.create + apply (required for ES6 class compatibility) - Benchmark script converted to ESM - Added @types/node devDependency for checkJs support - Enabled checkJs in tsconfig.json - Added JSDoc types to node.js base class and several utility files No behavioral changes - all 139 tests pass, benchmark performance unchanged vs historical baselines (avg 36-39ms for 104KB). * fix: @plugin deprecation says "replaced" not "removed" * fix: use constructor params for AtRule selectors, path.resolve in benchmark * fix: align @types/node with engines.node >=18 floor --- packages/less/benchmark/index.js | 64 ++++---- .../lib/less-browser/add-default-options.js | 4 + packages/less/lib/less-browser/utils.js | 5 + packages/less/lib/less-node/fs.js | 2 + packages/less/lib/less/deprecation.js | 5 +- packages/less/lib/less/functions/style.js | 6 +- packages/less/lib/less/index.js | 6 +- packages/less/lib/less/parser/parser.js | 2 +- packages/less/lib/less/transform-tree.js | 5 + packages/less/lib/less/tree/anonymous.js | 35 +++-- packages/less/lib/less/tree/assignment.js | 19 +-- packages/less/lib/less/tree/atrule.js | 147 +++++++++--------- packages/less/lib/less/tree/attribute.js | 25 +-- packages/less/lib/less/tree/call.js | 35 +++-- packages/less/lib/less/tree/color.js | 121 +++++++------- packages/less/lib/less/tree/combinator.js | 26 ++-- packages/less/lib/less/tree/comment.js | 23 +-- packages/less/lib/less/tree/condition.js | 23 +-- packages/less/lib/less/tree/container.js | 40 ++--- packages/less/lib/less/tree/declaration.js | 39 ++--- .../less/lib/less/tree/detached-ruleset.js | 23 +-- packages/less/lib/less/tree/dimension.js | 39 ++--- packages/less/lib/less/tree/element.js | 47 +++--- packages/less/lib/less/tree/expression.js | 27 ++-- packages/less/lib/less/tree/extend.js | 57 +++---- packages/less/lib/less/tree/import.js | 59 +++---- packages/less/lib/less/tree/javascript.js | 19 +-- packages/less/lib/less/tree/js-eval-node.js | 8 +- packages/less/lib/less/tree/keyword.js | 13 +- packages/less/lib/less/tree/media.js | 42 ++--- packages/less/lib/less/tree/mixin-call.js | 33 ++-- .../less/lib/less/tree/mixin-definition.js | 71 ++++----- .../less/lib/less/tree/namespace-value.js | 26 ++-- packages/less/lib/less/tree/negative.js | 15 +- packages/less/lib/less/tree/node.js | 126 ++++++++++++--- packages/less/lib/less/tree/operation.js | 24 +-- packages/less/lib/less/tree/paren.js | 17 +- packages/less/lib/less/tree/property.js | 19 +-- .../less/lib/less/tree/query-in-parens.js | 29 ++-- packages/less/lib/less/tree/quoted.js | 33 ++-- packages/less/lib/less/tree/ruleset.js | 73 ++++----- packages/less/lib/less/tree/selector.js | 49 +++--- .../less/lib/less/tree/unicode-descriptor.js | 13 +- packages/less/lib/less/tree/unit.js | 45 +++--- packages/less/lib/less/tree/url.js | 23 +-- packages/less/lib/less/tree/value.js | 33 ++-- packages/less/lib/less/tree/variable-call.js | 19 +-- packages/less/lib/less/tree/variable.js | 19 +-- .../visitors/set-tree-visibility-visitor.js | 14 +- packages/less/package.json | 3 +- pnpm-lock.yaml | 17 +- 51 files changed, 908 insertions(+), 759 deletions(-) diff --git a/packages/less/benchmark/index.js b/packages/less/benchmark/index.js index dac48c9ce..b356f6604 100644 --- a/packages/less/benchmark/index.js +++ b/packages/less/benchmark/index.js @@ -1,54 +1,49 @@ -var path = require('path'), - fs = require('fs'), - now = require('performance-now'); +import path from 'path'; +import fs from 'fs'; +import { fileURLToPath } from 'url'; +import less from '../lib/less-node/index.js'; -var less = require('../.'); -var file = path.join(__dirname, 'benchmark.less'); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +let file = path.join(__dirname, 'benchmark.less'); -if (process.argv[2]) { file = path.join(process.cwd(), process.argv[2]) } +if (process.argv[2]) { file = path.resolve(process.argv[2]); } fs.readFile(file, 'utf8', function (e, data) { - var start, total; - console.log('Benchmarking...\n', path.basename(file) + ' (' + parseInt(data.length / 1024) + ' KB)', ''); - var renderBenchmark = [] - , parserBenchmark = [] - , evalBenchmark = []; + const renderBenchmark = []; + const parserBenchmark = []; + const evalBenchmark = []; - var totalruns = 30; - var ignoreruns = 5; + const totalruns = 30; + const ignoreruns = 5; - var i = 0; + let i = 0; nextRun(); function nextRun() { - var start, renderEnd, parserEnd; - - start = now(); + const start = performance.now(); - less.parse(data, {}, function(err, root, imports, options) { + less.parse(data, { filename: file, paths: [path.dirname(file)] }, function(err, root, imports, options) { if (err) { console.log(err); process.exit(3); } - parserEnd = now(); + const parserEnd = performance.now(); - var tree, result; - tree = new less.ParseTree(root, imports); - result = tree.toCSS(options); + const tree = new less.ParseTree(root, imports); + tree.toCSS(options); - renderEnd = now(); + const renderEnd = performance.now(); renderBenchmark.push(renderEnd - start); parserBenchmark.push(parserEnd - start); evalBenchmark.push(renderEnd - parserEnd); i += 1; - //console.log('Less Run #: ' + i); - if(i < totalruns) { + if (i < totalruns) { nextRun(); } else { @@ -62,17 +57,17 @@ fs.readFile(file, 'utf8', function (e, data) { console.log('----------------------'); console.log(benchmark); console.log('----------------------'); - var totalTime = 0; - var mintime = Infinity; - var maxtime = 0; - for(var i = ignoreruns; i < totalruns; i++) { + let totalTime = 0; + let mintime = Infinity; + let maxtime = 0; + for (let i = ignoreruns; i < totalruns; i++) { totalTime += benchMarkData[i]; mintime = Math.min(mintime, benchMarkData[i]); maxtime = Math.max(maxtime, benchMarkData[i]); } - var avgtime = totalTime / (totalruns - ignoreruns); - var variation = maxtime - mintime; - var variationperc = (variation / avgtime) * 100; + const avgtime = totalTime / (totalruns - ignoreruns); + const variation = maxtime - mintime; + const variationperc = (variation / avgtime) * 100; console.log('Min. Time: ' + Math.round(mintime) + ' ms'); console.log('Max. Time: ' + Math.round(maxtime) + ' ms'); @@ -82,12 +77,9 @@ fs.readFile(file, 'utf8', function (e, data) { console.log('+/- ' + Math.round(variationperc) + '%'); console.log(''); } - + analyze('Parsing', parserBenchmark); analyze('Evaluation', evalBenchmark); analyze('Render Time', renderBenchmark); - } - }); - diff --git a/packages/less/lib/less-browser/add-default-options.js b/packages/less/lib/less-browser/add-default-options.js index 0fbbaab86..0600e0d6f 100644 --- a/packages/less/lib/less-browser/add-default-options.js +++ b/packages/less/lib/less-browser/add-default-options.js @@ -1,6 +1,10 @@ import {addDataAttr} from './utils.js'; import browser from './browser.js'; +/** + * @param {Window} window + * @param {Record} options + */ export default (window, options) => { // use options from the current script tag data attribues diff --git a/packages/less/lib/less-browser/utils.js b/packages/less/lib/less-browser/utils.js index 972160b6d..0bc6178b9 100644 --- a/packages/less/lib/less-browser/utils.js +++ b/packages/less/lib/less-browser/utils.js @@ -1,4 +1,5 @@ +/** @param {string} href */ export function extractId(href) { return href.replace(/^[a-z-]+:\/+?[^/]+/, '') // Remove protocol & domain .replace(/[?&]livereload=\w+/, '') // Remove LiveReload cachebuster @@ -8,6 +9,10 @@ export function extractId(href) { .replace(/\./g, ':'); // Replace dots with colons(for valid id) } +/** + * @param {Record} options + * @param {HTMLElement | null} tag + */ export function addDataAttr(options, tag) { if (!tag) {return;} // in case of tag is null or undefined for (const opt in tag.dataset) { diff --git a/packages/less/lib/less-node/fs.js b/packages/less/lib/less-node/fs.js index 05acdcb61..2fb325f64 100644 --- a/packages/less/lib/less-node/fs.js +++ b/packages/less/lib/less-node/fs.js @@ -1,8 +1,10 @@ +/** @typedef {import('fs')} FS */ import nodeFs from 'fs'; import { createRequire } from 'module'; const require = createRequire(import.meta.url); +/** @type {FS} */ let fs; try { fs = require('graceful-fs'); diff --git a/packages/less/lib/less/deprecation.js b/packages/less/lib/less/deprecation.js index d29fc9e5f..41637d55f 100644 --- a/packages/less/lib/less/deprecation.js +++ b/packages/less/lib/less/deprecation.js @@ -26,7 +26,7 @@ const deprecations = { description: 'Inline JavaScript evaluation (backtick expressions) is deprecated and will be removed in Less 5.x.' }, 'at-plugin': { - description: 'The @plugin directive is deprecated and will be removed in Less 5.x.' + description: 'The @plugin directive is deprecated and will be replaced in Less 5.x.' }, 'dump-line-numbers': { description: 'The dumpLineNumbers option is deprecated and will be removed in Less 5.x.' @@ -40,9 +40,11 @@ const MAX_REPETITIONS = 5; class DeprecationHandler { constructor() { + /** @type {Record} */ this._counts = {}; } + /** @param {string} deprecationId */ shouldWarn(deprecationId) { if (!deprecationId) { return true; } const count = (this._counts[deprecationId] || 0) + 1; @@ -50,6 +52,7 @@ class DeprecationHandler { return count <= MAX_REPETITIONS; } + /** @param {{ warn: (msg: string) => void }} logger */ summarize(logger) { for (const id of Object.keys(this._counts)) { const omitted = this._counts[id] - MAX_REPETITIONS; diff --git a/packages/less/lib/less/functions/style.js b/packages/less/lib/less/functions/style.js index cbb10a363..f60c81a84 100644 --- a/packages/less/lib/less/functions/style.js +++ b/packages/less/lib/less/functions/style.js @@ -1,6 +1,7 @@ import Variable from '../tree/variable.js'; import Anonymous from '../tree/anonymous.js'; +/** @param {*[]} args */ const styleExpression = function (args) { args = Array.prototype.slice.call(args); if (args.length === 0) { @@ -9,12 +10,13 @@ const styleExpression = function (args) { const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)]; - args = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', '); + const result = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', '); - return new Anonymous(`style(${args})`); + return new Anonymous(`style(${result})`); }; export default { + /** @param {...*} args */ style: function(...args) { try { return styleExpression.call(this, args); diff --git a/packages/less/lib/less/index.js b/packages/less/lib/less/index.js index 21a53834c..7be79759e 100644 --- a/packages/less/lib/less/index.js +++ b/packages/less/lib/less/index.js @@ -61,10 +61,8 @@ export default function(environment, fileManagers, version = '0.0.0') { // Create a public API const ctor = function(t) { - return function() { - const obj = Object.create(t.prototype); - t.apply(obj, Array.prototype.slice.call(arguments, 0)); - return obj; + return function(...args) { + return new t(...args); }; }; let t; diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 91b23a093..fb6b3603b 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -2016,7 +2016,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const dir = parserInput.$re(/^@plugin\s+/); if (dir) { - warn('The @plugin directive is deprecated and will be removed in Less 5.x. Use --plugin CLI option or the programmatic plugin API instead.', index, 'DEPRECATED', 'at-plugin'); + warn('The @plugin directive is deprecated and will be replaced in Less 5.x. Use --plugin CLI option or the programmatic plugin API instead.', index, 'DEPRECATED', 'at-plugin'); args = this.pluginArgs(); if (args) { diff --git a/packages/less/lib/less/transform-tree.js b/packages/less/lib/less/transform-tree.js index f8402764c..75d38ee41 100644 --- a/packages/less/lib/less/transform-tree.js +++ b/packages/less/lib/less/transform-tree.js @@ -2,6 +2,11 @@ import contexts from './contexts.js'; import visitor from './visitors/index.js'; import tree from './tree/index.js'; +/** + * @param {import('./tree/node.js').default} root + * @param {{ variables?: Record, compress?: boolean, pluginManager?: *, frames?: *[] }} options + * @returns {import('./tree/node.js').default} + */ export default function(root, options) { options = options || {}; let evaldRoot; diff --git a/packages/less/lib/less/tree/anonymous.js b/packages/less/lib/less/tree/anonymous.js index b5764c5e5..977b15638 100644 --- a/packages/less/lib/less/tree/anonymous.js +++ b/packages/less/lib/less/tree/anonymous.js @@ -1,32 +1,37 @@ import Node from './node.js'; -const Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { - this.value = value; - this._index = index; - this._fileInfo = currentFileInfo; - this.mapLines = mapLines; - this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; - this.allowRoot = true; - this.copyVisibilityInfo(visibilityInfo); -} +class Anonymous extends Node { + get type() { return 'Anonymous'; } + + constructor(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { + super(); + this.value = value; + this._index = index; + this._fileInfo = currentFileInfo; + this.mapLines = mapLines; + this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; + this.allowRoot = true; + this.copyVisibilityInfo(visibilityInfo); + } -Anonymous.prototype = Object.assign(new Node(), { - type: 'Anonymous', eval() { return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); - }, + } + compare(other) { return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; - }, + } + isRulesetLike() { return this.rulesetLike; - }, + } + genCSS(context, output) { this.nodeVisible = Boolean(this.value); if (this.nodeVisible) { output.add(this.value, this._fileInfo, this._index, this.mapLines); } } -}) +} export default Anonymous; diff --git a/packages/less/lib/less/tree/assignment.js b/packages/less/lib/less/tree/assignment.js index fa137d09b..c53e58c4c 100644 --- a/packages/less/lib/less/tree/assignment.js +++ b/packages/less/lib/less/tree/assignment.js @@ -1,23 +1,24 @@ import Node from './node.js'; -const Assignment = function(key, val) { - this.key = key; - this.value = val; -} +class Assignment extends Node { + get type() { return 'Assignment'; } -Assignment.prototype = Object.assign(new Node(), { - type: 'Assignment', + constructor(key, val) { + super(); + this.key = key; + this.value = val; + } accept(visitor) { this.value = visitor.visit(this.value); - }, + } eval(context) { if (this.value.eval) { return new Assignment(this.key, this.value.eval(context)); } return this; - }, + } genCSS(context, output) { output.add(`${this.key}=`); @@ -27,6 +28,6 @@ Assignment.prototype = Object.assign(new Node(), { output.add(this.value); } } -}); +} export default Assignment; diff --git a/packages/less/lib/less/tree/atrule.js b/packages/less/lib/less/tree/atrule.js index ba5378340..4f5343c0a 100644 --- a/packages/less/lib/less/tree/atrule.js +++ b/packages/less/lib/less/tree/atrule.js @@ -5,70 +5,69 @@ import Anonymous from './anonymous.js'; import NestableAtRulePrototype from './nested-at-rule.js'; import mergeRules from './merge-rules.js'; -const AtRule = function( - name, - value, - rules, - index, - currentFileInfo, - debugInfo, - isRooted, - visibilityInfo -) { - let i; - var selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); +class AtRule extends Node { + get type() { return 'AtRule'; } - this.name = name; - this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); - if (rules) { - if (Array.isArray(rules)) { - const allDeclarations = this.declarationsBlock(rules); - - let allRulesetDeclarations = true; - rules.forEach(rule => { - if (rule.type === 'Ruleset' && rule.rules) allRulesetDeclarations = allRulesetDeclarations && this.declarationsBlock(rule.rules, true); - }); + constructor( + name, + value, + rules, + index, + currentFileInfo, + debugInfo, + isRooted, + visibilityInfo + ) { + super(); + let i; + var selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); - if (allDeclarations && !isRooted) { - this.simpleBlock = true; - this.declarations = rules; - } else if (allRulesetDeclarations && rules.length === 1 && !isRooted && !value) { - this.simpleBlock = true; - this.declarations = rules[0].rules ? rules[0].rules : rules; - } else { - this.rules = rules; - } - } else { - const allDeclarations = this.declarationsBlock(rules.rules); - - if (allDeclarations && !isRooted && !value) { - this.simpleBlock = true; - this.declarations = rules.rules; + this.name = name; + this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); + if (rules) { + if (Array.isArray(rules)) { + const allDeclarations = this.declarationsBlock(rules); + + let allRulesetDeclarations = true; + rules.forEach(rule => { + if (rule.type === 'Ruleset' && rule.rules) allRulesetDeclarations = allRulesetDeclarations && this.declarationsBlock(rule.rules, true); + }); + + if (allDeclarations && !isRooted) { + this.simpleBlock = true; + this.declarations = rules; + } else if (allRulesetDeclarations && rules.length === 1 && !isRooted && !value) { + this.simpleBlock = true; + this.declarations = rules[0].rules ? rules[0].rules : rules; + } else { + this.rules = rules; + } } else { - this.rules = [rules]; - this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); + const allDeclarations = this.declarationsBlock(rules.rules); + + if (allDeclarations && !isRooted && !value) { + this.simpleBlock = true; + this.declarations = rules.rules; + } else { + this.rules = [rules]; + this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); + } } - } - if (!this.simpleBlock) { - for (i = 0; i < this.rules.length; i++) { - this.rules[i].allowImports = true; + if (!this.simpleBlock) { + for (i = 0; i < this.rules.length; i++) { + this.rules[i].allowImports = true; + } } + this.setParent(selectors, this); + this.setParent(this.rules, this); } - this.setParent(selectors, this); - this.setParent(this.rules, this); + this._index = index; + this._fileInfo = currentFileInfo; + this.debugInfo = debugInfo; + this.isRooted = isRooted || false; + this.copyVisibilityInfo(visibilityInfo); + this.allowRoot = true; } - this._index = index; - this._fileInfo = currentFileInfo; - this.debugInfo = debugInfo; - this.isRooted = isRooted || false; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; -} - -AtRule.prototype = Object.assign(new Node(), { - type: 'AtRule', - - ...NestableAtRulePrototype, declarationsBlock(rules, mergeable = false) { if (!mergeable) { @@ -76,15 +75,15 @@ AtRule.prototype = Object.assign(new Node(), { } else { return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length; } - }, + } keywordList(rules) { if (!Array.isArray(rules)) { return false; - } else { + } else { return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length; } - }, + } accept(visitor) { const value = this.value, rules = this.rules, declarations = this.declarations; @@ -92,20 +91,20 @@ AtRule.prototype = Object.assign(new Node(), { if (rules) { this.rules = visitor.visitArray(rules); } else if (declarations) { - this.declarations = visitor.visitArray(declarations); + this.declarations = visitor.visitArray(declarations); } if (value) { this.value = visitor.visit(value); } - }, + } isRulesetLike() { return this.rules || !this.isCharset(); - }, + } isCharset() { return '@charset' === this.name; - }, + } genCSS(context, output) { const value = this.value, rules = this.rules || this.declarations; @@ -121,11 +120,11 @@ AtRule.prototype = Object.assign(new Node(), { } else { output.add(';'); } - }, + } eval(context) { let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations; - + // media stored inside other atrule should not bubble over it // backpup media bubbling information mediaPathBackup = context.mediaPath; @@ -158,7 +157,7 @@ AtRule.prototype = Object.assign(new Node(), { context.mediaPath = mediaPathBackup; context.mediaBlocks = mediaBlocksBackup; return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); - }, + } evalRoot(context, rules) { let ampersandCount = 0; @@ -206,28 +205,28 @@ AtRule.prototype = Object.assign(new Node(), { rules[0].root = true; } return rules; - }, + } variable(name) { if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule return Ruleset.prototype.variable.call(this.rules[0], name); } - }, + } find() { if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule return Ruleset.prototype.find.apply(this.rules[0], arguments); } - }, + } rulesets() { if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule return Ruleset.prototype.rulesets.apply(this.rules[0]); } - }, + } outputRuleset(context, output, rules) { const ruleCnt = rules.length; @@ -261,6 +260,10 @@ AtRule.prototype = Object.assign(new Node(), { context.tabLevel--; } -}); +} + +// Apply shared methods from NestableAtRulePrototype that AtRule doesn't override +const { evalFunction, evalTop, evalNested, permute, bubbleSelectors } = NestableAtRulePrototype; +Object.assign(AtRule.prototype, { evalFunction, evalTop, evalNested, permute, bubbleSelectors }); export default AtRule; diff --git a/packages/less/lib/less/tree/attribute.js b/packages/less/lib/less/tree/attribute.js index 8cf15ce5b..da3ea2006 100644 --- a/packages/less/lib/less/tree/attribute.js +++ b/packages/less/lib/less/tree/attribute.js @@ -1,14 +1,15 @@ import Node from './node.js'; -const Attribute = function(key, op, value, cif) { - this.key = key; - this.op = op; - this.value = value; - this.cif = cif; -} - -Attribute.prototype = Object.assign(new Node(), { - type: 'Attribute', +class Attribute extends Node { + get type() { return 'Attribute'; } + + constructor(key, op, value, cif) { + super(); + this.key = key; + this.op = op; + this.value = value; + this.cif = cif; + } eval(context) { return new Attribute( @@ -17,11 +18,11 @@ Attribute.prototype = Object.assign(new Node(), { (this.value && this.value.eval) ? this.value.eval(context) : this.value, this.cif ); - }, + } genCSS(context, output) { output.add(this.toCSS(context)); - }, + } toCSS(context) { let value = this.key.toCSS ? this.key.toCSS(context) : this.key; @@ -37,6 +38,6 @@ Attribute.prototype = Object.assign(new Node(), { return `[${value}]`; } -}); +} export default Attribute; diff --git a/packages/less/lib/less/tree/call.js b/packages/less/lib/less/tree/call.js index 1653d5c9f..1f54afbda 100644 --- a/packages/less/lib/less/tree/call.js +++ b/packages/less/lib/less/tree/call.js @@ -5,22 +5,23 @@ import FunctionCaller from '../functions/function-caller.js'; // // A function call node. // -const Call = function(name, args, index, currentFileInfo) { - this.name = name; - this.args = args; - this.calc = name === 'calc'; - this._index = index; - this._fileInfo = currentFileInfo; -} +class Call extends Node { + get type() { return 'Call'; } -Call.prototype = Object.assign(new Node(), { - type: 'Call', + constructor(name, args, index, currentFileInfo) { + super(); + this.name = name; + this.args = args; + this.calc = name === 'calc'; + this._index = index; + this._fileInfo = currentFileInfo; + } accept(visitor) { if (this.args) { this.args = visitor.visitArray(this.args); } - }, + } // // When evaluating a function call, @@ -62,10 +63,10 @@ Call.prototype = Object.assign(new Node(), { if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) { throw e; } - throw { + throw { type: e.type || 'Runtime', message: `Error evaluating function \`${this.name}\`${e.message ? `: ${e.message}` : ''}`, - index: this.getIndex(), + index: this.getIndex(), filename: this.fileInfo().filename, line: e.lineNumber, column: e.columnNumber @@ -78,12 +79,12 @@ Call.prototype = Object.assign(new Node(), { // Falsy values or booleans are returned as empty nodes if (!(result instanceof Node)) { if (!result || result === true) { - result = new Anonymous(null); + result = new Anonymous(null); } else { - result = new Anonymous(result.toString()); + result = new Anonymous(result.toString()); } - + } result._index = this._index; result._fileInfo = this._fileInfo; @@ -94,7 +95,7 @@ Call.prototype = Object.assign(new Node(), { exitCalc(); return new Call(this.name, args, this.getIndex(), this.fileInfo()); - }, + } genCSS(context, output) { output.add(`${this.name}(`, this.fileInfo(), this.getIndex()); @@ -108,6 +109,6 @@ Call.prototype = Object.assign(new Node(), { output.add(')'); } -}); +} export default Call; diff --git a/packages/less/lib/less/tree/color.js b/packages/less/lib/less/tree/color.js index 8d0315a93..6b66b7543 100644 --- a/packages/less/lib/less/tree/color.js +++ b/packages/less/lib/less/tree/color.js @@ -4,43 +4,44 @@ import colors from '../data/colors.js'; // // RGB Colors - #ff0014, #eee // -const Color = function(rgb, a, originalForm) { - const self = this; - // - // The end goal here, is to parse the arguments - // into an integer triplet, such as `128, 255, 0` - // - // This facilitates operations and conversions. - // - if (Array.isArray(rgb)) { - this.rgb = rgb; - } else if (rgb.length >= 6) { - this.rgb = []; - rgb.match(/.{2}/g).map(function (c, i) { - if (i < 3) { - self.rgb.push(parseInt(c, 16)); - } else { - self.alpha = (parseInt(c, 16)) / 255; - } - }); - } else { - this.rgb = []; - rgb.split('').map(function (c, i) { - if (i < 3) { - self.rgb.push(parseInt(c + c, 16)); - } else { - self.alpha = (parseInt(c + c, 16)) / 255; - } - }); - } - this.alpha = this.alpha || (typeof a === 'number' ? a : 1); - if (typeof originalForm !== 'undefined') { - this.value = originalForm; +class Color extends Node { + get type() { return 'Color'; } + + constructor(rgb, a, originalForm) { + super(); + const self = this; + // + // The end goal here, is to parse the arguments + // into an integer triplet, such as `128, 255, 0` + // + // This facilitates operations and conversions. + // + if (Array.isArray(rgb)) { + this.rgb = rgb; + } else if (rgb.length >= 6) { + this.rgb = []; + rgb.match(/.{2}/g).map(function (c, i) { + if (i < 3) { + self.rgb.push(parseInt(c, 16)); + } else { + self.alpha = (parseInt(c, 16)) / 255; + } + }); + } else { + this.rgb = []; + rgb.split('').map(function (c, i) { + if (i < 3) { + self.rgb.push(parseInt(c + c, 16)); + } else { + self.alpha = (parseInt(c + c, 16)) / 255; + } + }); + } + this.alpha = this.alpha || (typeof a === 'number' ? a : 1); + if (typeof originalForm !== 'undefined') { + this.value = originalForm; + } } -} - -Color.prototype = Object.assign(new Node(), { - type: 'Color', luma() { let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255; @@ -50,11 +51,11 @@ Color.prototype = Object.assign(new Node(), { b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4); return 0.2126 * r + 0.7152 * g + 0.0722 * b; - }, + } genCSS(context, output) { output.add(this.toCSS(context)); - }, + } toCSS(context, doNotCompress) { const compress = context && context.compress && !doNotCompress; @@ -123,7 +124,7 @@ Color.prototype = Object.assign(new Node(), { } return color; - }, + } // // Operations have to be done per-channel, if not, @@ -138,11 +139,11 @@ Color.prototype = Object.assign(new Node(), { rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]); } return new Color(rgb, alpha); - }, + } toRGB() { return toHex(this.rgb); - }, + } toHSL() { const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; @@ -166,7 +167,7 @@ Color.prototype = Object.assign(new Node(), { h /= 6; } return { h: h * 360, s, l, a }; - }, + } // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript toHSV() { @@ -195,11 +196,11 @@ Color.prototype = Object.assign(new Node(), { h /= 6; } return { h: h * 360, s, v, a }; - }, + } toARGB() { return toHex([this.alpha * 255].concat(this.rgb)); - }, + } compare(x) { return (x.rgb && @@ -208,24 +209,24 @@ Color.prototype = Object.assign(new Node(), { x.rgb[2] === this.rgb[2] && x.alpha === this.alpha) ? 0 : undefined; } -}); - -Color.fromKeyword = function(keyword) { - let c; - const key = keyword.toLowerCase(); - // eslint-disable-next-line no-prototype-builtins - if (colors.hasOwnProperty(key)) { - c = new Color(colors[key].slice(1)); - } - else if (key === 'transparent') { - c = new Color([0, 0, 0], 0); - } - if (c) { - c.value = keyword; - return c; + static fromKeyword(keyword) { + let c; + const key = keyword.toLowerCase(); + // eslint-disable-next-line no-prototype-builtins + if (colors.hasOwnProperty(key)) { + c = new Color(colors[key].slice(1)); + } + else if (key === 'transparent') { + c = new Color([0, 0, 0], 0); + } + + if (c) { + c.value = keyword; + return c; + } } -}; +} function clamp(v, max) { return Math.min(Math.max(v, 0), max); diff --git a/packages/less/lib/less/tree/combinator.js b/packages/less/lib/less/tree/combinator.js index 4d6958d94..03b39b41a 100644 --- a/packages/less/lib/less/tree/combinator.js +++ b/packages/less/lib/less/tree/combinator.js @@ -1,27 +1,29 @@ import Node from './node.js'; + const _noSpaceCombinators = { '': true, ' ': true, '|': true }; -const Combinator = function(value) { - if (value === ' ') { - this.value = ' '; - this.emptyOrWhitespace = true; - } else { - this.value = value ? value.trim() : ''; - this.emptyOrWhitespace = this.value === ''; - } -} +class Combinator extends Node { + get type() { return 'Combinator'; } -Combinator.prototype = Object.assign(new Node(), { - type: 'Combinator', + constructor(value) { + super(); + if (value === ' ') { + this.value = ' '; + this.emptyOrWhitespace = true; + } else { + this.value = value ? value.trim() : ''; + this.emptyOrWhitespace = this.value === ''; + } + } genCSS(context, output) { const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' '; output.add(spaceOrEmpty + this.value + spaceOrEmpty); } -}); +} export default Combinator; diff --git a/packages/less/lib/less/tree/comment.js b/packages/less/lib/less/tree/comment.js index 38ba40733..730904c81 100644 --- a/packages/less/lib/less/tree/comment.js +++ b/packages/less/lib/less/tree/comment.js @@ -1,28 +1,29 @@ import Node from './node.js'; import getDebugInfo from './debug-info.js'; -const Comment = function(value, isLineComment, index, currentFileInfo) { - this.value = value; - this.isLineComment = isLineComment; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; -} +class Comment extends Node { + get type() { return 'Comment'; } -Comment.prototype = Object.assign(new Node(), { - type: 'Comment', + constructor(value, isLineComment, index, currentFileInfo) { + super(); + this.value = value; + this.isLineComment = isLineComment; + this._index = index; + this._fileInfo = currentFileInfo; + this.allowRoot = true; + } genCSS(context, output) { if (this.debugInfo) { output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex()); } output.add(this.value); - }, + } isSilent(context) { const isCompressed = context.compress && this.value[2] !== '!'; return this.isLineComment || isCompressed; } -}); +} export default Comment; diff --git a/packages/less/lib/less/tree/condition.js b/packages/less/lib/less/tree/condition.js index 64e99933e..69eb351a7 100644 --- a/packages/less/lib/less/tree/condition.js +++ b/packages/less/lib/less/tree/condition.js @@ -1,20 +1,21 @@ import Node from './node.js'; -const Condition = function(op, l, r, i, negate) { - this.op = op.trim(); - this.lvalue = l; - this.rvalue = r; - this._index = i; - this.negate = negate; -}; +class Condition extends Node { + get type() { return 'Condition'; } -Condition.prototype = Object.assign(new Node(), { - type: 'Condition', + constructor(op, l, r, i, negate) { + super(); + this.op = op.trim(); + this.lvalue = l; + this.rvalue = r; + this._index = i; + this.negate = negate; + } accept(visitor) { this.lvalue = visitor.visit(this.lvalue); this.rvalue = visitor.visit(this.rvalue); - }, + } eval(context) { const result = (function (op, a, b) { @@ -37,6 +38,6 @@ Condition.prototype = Object.assign(new Node(), { return this.negate ? !result : result; } -}); +} export default Condition; diff --git a/packages/less/lib/less/tree/container.js b/packages/less/lib/less/tree/container.js index c955f43e8..9e19bea4a 100644 --- a/packages/less/lib/less/tree/container.js +++ b/packages/less/lib/less/tree/container.js @@ -4,32 +4,31 @@ import Selector from './selector.js'; import AtRule from './atrule.js'; import NestableAtRulePrototype from './nested-at-rule.js'; -const Container = function(value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; +class Container extends AtRule { + get type() { return 'Container'; } - const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); + constructor(value, features, index, currentFileInfo, visibilityInfo) { + super(); + this._index = index; + this._fileInfo = currentFileInfo; - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); -}; + const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); -Container.prototype = Object.assign(new AtRule(), { - type: 'Container', - - ...NestableAtRulePrototype, + this.features = new Value(features); + this.rules = [new Ruleset(selectors, value)]; + this.rules[0].allowImports = true; + this.copyVisibilityInfo(visibilityInfo); + this.allowRoot = true; + this.setParent(selectors, this); + this.setParent(this.features, this); + this.setParent(this.rules, this); + } genCSS(context, output) { output.add('@container ', this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); - }, + } eval(context) { if (this._evaluated) { @@ -62,6 +61,9 @@ Container.prototype = Object.assign(new AtRule(), { return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); } -}); +} + +// Apply NestableAtRulePrototype methods (accept, isRulesetLike override AtRule's versions) +Object.assign(Container.prototype, NestableAtRulePrototype); export default Container; diff --git a/packages/less/lib/less/tree/declaration.js b/packages/less/lib/less/tree/declaration.js index ca75d848d..37552d5e8 100644 --- a/packages/less/lib/less/tree/declaration.js +++ b/packages/less/lib/less/tree/declaration.js @@ -16,22 +16,23 @@ function evalName(context, name) { return value; } -const Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) { - this.name = name; - this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); - this.important = important ? ` ${important.trim()}` : ''; - this.merge = merge; - this._index = index; - this._fileInfo = currentFileInfo; - this.inline = inline || false; - this.variable = (variable !== undefined) ? variable - : (name.charAt && (name.charAt(0) === '@')); - this.allowRoot = true; - this.setParent(this.value, this); -}; +class Declaration extends Node { + get type() { return 'Declaration'; } -Declaration.prototype = Object.assign(new Node(), { - type: 'Declaration', + constructor(name, value, important, merge, index, currentFileInfo, inline, variable) { + super(); + this.name = name; + this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); + this.important = important ? ` ${important.trim()}` : ''; + this.merge = merge; + this._index = index; + this._fileInfo = currentFileInfo; + this.inline = inline || false; + this.variable = (variable !== undefined) ? variable + : (name.charAt && (name.charAt(0) === '@')); + this.allowRoot = true; + this.setParent(this.value, this); + } genCSS(context, output) { output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); @@ -44,7 +45,7 @@ Declaration.prototype = Object.assign(new Node(), { throw e; } output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index); - }, + } eval(context) { let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable; @@ -95,7 +96,7 @@ Declaration.prototype = Object.assign(new Node(), { context.math = prevMath; } } - }, + } makeImportant() { return new Declaration(this.name, @@ -104,6 +105,6 @@ Declaration.prototype = Object.assign(new Node(), { this.merge, this.getIndex(), this.fileInfo(), this.inline); } -}); +} -export default Declaration; \ No newline at end of file +export default Declaration; diff --git a/packages/less/lib/less/tree/detached-ruleset.js b/packages/less/lib/less/tree/detached-ruleset.js index 224ec918b..0f4327941 100644 --- a/packages/less/lib/less/tree/detached-ruleset.js +++ b/packages/less/lib/less/tree/detached-ruleset.js @@ -2,28 +2,29 @@ import Node from './node.js'; import contexts from '../contexts.js'; import * as utils from '../utils.js'; -const DetachedRuleset = function(ruleset, frames) { - this.ruleset = ruleset; - this.frames = frames; - this.setParent(this.ruleset, this); -}; +class DetachedRuleset extends Node { + get type() { return 'DetachedRuleset'; } -DetachedRuleset.prototype = Object.assign(new Node(), { - type: 'DetachedRuleset', - evalFirst: true, + constructor(ruleset, frames) { + super(); + this.ruleset = ruleset; + this.frames = frames; + this.evalFirst = true; + this.setParent(this.ruleset, this); + } accept(visitor) { this.ruleset = visitor.visit(this.ruleset); - }, + } eval(context) { const frames = this.frames || utils.copyArray(context.frames); return new DetachedRuleset(this.ruleset, frames); - }, + } callEval(context) { return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); } -}); +} export default DetachedRuleset; diff --git a/packages/less/lib/less/tree/dimension.js b/packages/less/lib/less/tree/dimension.js index 1dad80ac8..7811d6bc5 100644 --- a/packages/less/lib/less/tree/dimension.js +++ b/packages/less/lib/less/tree/dimension.js @@ -7,32 +7,33 @@ import Color from './color.js'; // // A number with a unit // -const Dimension = function(value, unit) { - this.value = parseFloat(value); - if (isNaN(this.value)) { - throw new Error('Dimension is not a number.'); +class Dimension extends Node { + get type() { return 'Dimension'; } + + constructor(value, unit) { + super(); + this.value = parseFloat(value); + if (isNaN(this.value)) { + throw new Error('Dimension is not a number.'); + } + this.unit = (unit && unit instanceof Unit) ? unit : + new Unit(unit ? [unit] : undefined); + this.setParent(this.unit, this); } - this.unit = (unit && unit instanceof Unit) ? unit : - new Unit(unit ? [unit] : undefined); - this.setParent(this.unit, this); -}; - -Dimension.prototype = Object.assign(new Node(), { - type: 'Dimension', accept(visitor) { this.unit = visitor.visit(this.unit); - }, + } // remove when Nodes have JSDoc types // eslint-disable-next-line no-unused-vars eval(context) { return this; - }, + } toColor() { return new Color([this.value, this.value, this.value]); - }, + } genCSS(context, output) { if ((context && context.strictUnits) && !this.unit.isSingular()) { @@ -62,7 +63,7 @@ Dimension.prototype = Object.assign(new Node(), { output.add(strValue); this.unit.genCSS(context, output); - }, + } // In an operation between two Dimensions, // we default to the first Dimension's unit, @@ -100,7 +101,7 @@ Dimension.prototype = Object.assign(new Node(), { unit.cancel(); } return new Dimension(value, unit); - }, + } compare(other) { let a, b; @@ -121,11 +122,11 @@ Dimension.prototype = Object.assign(new Node(), { } return Node.numericCompare(a.value, b.value); - }, + } unify() { return this.convertTo({ length: 'px', duration: 's', angle: 'rad' }); - }, + } convertTo(conversions) { let value = this.value; @@ -173,6 +174,6 @@ Dimension.prototype = Object.assign(new Node(), { return new Dimension(value, unit); } -}); +} export default Dimension; diff --git a/packages/less/lib/less/tree/element.js b/packages/less/lib/less/tree/element.js index 30fb81c48..880d3dc69 100644 --- a/packages/less/lib/less/tree/element.js +++ b/packages/less/lib/less/tree/element.js @@ -2,26 +2,27 @@ import Node from './node.js'; import Paren from './paren.js'; import Combinator from './combinator.js'; -const Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { - this.combinator = combinator instanceof Combinator ? - combinator : new Combinator(combinator); +class Element extends Node { + get type() { return 'Element'; } - if (typeof value === 'string') { - this.value = value.trim(); - } else if (value) { - this.value = value; - } else { - this.value = ''; - } - this.isVariable = isVariable; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.combinator, this); -} + constructor(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { + super(); + this.combinator = combinator instanceof Combinator ? + combinator : new Combinator(combinator); -Element.prototype = Object.assign(new Node(), { - type: 'Element', + if (typeof value === 'string') { + this.value = value.trim(); + } else if (value) { + this.value = value; + } else { + this.value = ''; + } + this.isVariable = isVariable; + this._index = index; + this._fileInfo = currentFileInfo; + this.copyVisibilityInfo(visibilityInfo); + this.setParent(this.combinator, this); + } accept(visitor) { const value = this.value; @@ -29,7 +30,7 @@ Element.prototype = Object.assign(new Node(), { if (typeof value === 'object') { this.value = visitor.visit(value); } - }, + } eval(context) { return new Element(this.combinator, @@ -37,7 +38,7 @@ Element.prototype = Object.assign(new Node(), { this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, + } clone() { return new Element(this.combinator, @@ -45,11 +46,11 @@ Element.prototype = Object.assign(new Node(), { this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, + } genCSS(context, output) { output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); - }, + } toCSS(context) { context = context || {}; @@ -68,6 +69,6 @@ Element.prototype = Object.assign(new Node(), { return this.combinator.toCSS(context) + value; } } -}); +} export default Element; diff --git a/packages/less/lib/less/tree/expression.js b/packages/less/lib/less/tree/expression.js index 3bcd606fc..e2ff11c57 100644 --- a/packages/less/lib/less/tree/expression.js +++ b/packages/less/lib/less/tree/expression.js @@ -4,20 +4,21 @@ import Comment from './comment.js'; import Dimension from './dimension.js'; import Anonymous from './anonymous.js'; -const Expression = function(value, noSpacing) { - this.value = value; - this.noSpacing = noSpacing; - if (!value) { - throw new Error('Expression requires an array parameter'); - } -}; +class Expression extends Node { + get type() { return 'Expression'; } -Expression.prototype = Object.assign(new Node(), { - type: 'Expression', + constructor(value, noSpacing) { + super(); + this.value = value; + this.noSpacing = noSpacing; + if (!value) { + throw new Error('Expression requires an array parameter'); + } + } accept(visitor) { this.value = visitor.visitArray(this.value); - }, + } eval(context) { const noSpacing = this.noSpacing; @@ -53,7 +54,7 @@ Expression.prototype = Object.assign(new Node(), { } returnValue.noSpacing = returnValue.noSpacing || noSpacing; return returnValue; - }, + } genCSS(context, output) { for (let i = 0; i < this.value.length; i++) { @@ -65,13 +66,13 @@ Expression.prototype = Object.assign(new Node(), { } } } - }, + } throwAwayComments() { this.value = this.value.filter(function(v) { return !(v instanceof Comment); }); } -}); +} export default Expression; diff --git a/packages/less/lib/less/tree/extend.js b/packages/less/lib/less/tree/extend.js index 78e402a33..59f8de370 100644 --- a/packages/less/lib/less/tree/extend.js +++ b/packages/less/lib/less/tree/extend.js @@ -1,46 +1,47 @@ import Node from './node.js'; import Selector from './selector.js'; -const Extend = function(selector, option, index, currentFileInfo, visibilityInfo) { - this.selector = selector; - this.option = option; - this.object_id = Extend.next_id++; - this.parent_ids = [this.object_id]; - this._index = index; - this._fileInfo = currentFileInfo; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; +class Extend extends Node { + get type() { return 'Extend'; } - switch (option) { - case '!all': - case 'all': - this.allowBefore = true; - this.allowAfter = true; - break; - default: - this.allowBefore = false; - this.allowAfter = false; - break; - } - this.setParent(this.selector, this); -}; + constructor(selector, option, index, currentFileInfo, visibilityInfo) { + super(); + this.selector = selector; + this.option = option; + this.object_id = Extend.next_id++; + this.parent_ids = [this.object_id]; + this._index = index; + this._fileInfo = currentFileInfo; + this.copyVisibilityInfo(visibilityInfo); + this.allowRoot = true; -Extend.prototype = Object.assign(new Node(), { - type: 'Extend', + switch (option) { + case '!all': + case 'all': + this.allowBefore = true; + this.allowAfter = true; + break; + default: + this.allowBefore = false; + this.allowAfter = false; + break; + } + this.setParent(this.selector, this); + } accept(visitor) { this.selector = visitor.visit(this.selector); - }, + } eval(context) { return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, + } // remove when Nodes have JSDoc types // eslint-disable-next-line no-unused-vars clone(context) { return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); - }, + } // it concatenates (joins) all selectors in selector array findSelfSelectors(selectors) { @@ -59,7 +60,7 @@ Extend.prototype = Object.assign(new Node(), { this.selfSelectors = [new Selector(selfElements)]; this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); } -}); +} Extend.next_id = 0; export default Extend; diff --git a/packages/less/lib/less/tree/import.js b/packages/less/lib/less/tree/import.js index 599321b9b..d7107aeb5 100644 --- a/packages/less/lib/less/tree/import.js +++ b/packages/less/lib/less/tree/import.js @@ -20,29 +20,30 @@ import Expression from './expression.js'; // `import,push`, we also pass it a callback, which it'll call once // the file has been fetched, and parsed. // -const Import = function(path, features, options, index, currentFileInfo, visibilityInfo) { - this.options = options; - this._index = index; - this._fileInfo = currentFileInfo; - this.path = path; - this.features = features; - this.allowRoot = true; - - if (this.options.less !== undefined || this.options.inline) { - this.css = !this.options.less || this.options.inline; - } else { - const pathValue = this.getPath(); - if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) { - this.css = true; +class Import extends Node { + get type() { return 'Import'; } + + constructor(path, features, options, index, currentFileInfo, visibilityInfo) { + super(); + this.options = options; + this._index = index; + this._fileInfo = currentFileInfo; + this.path = path; + this.features = features; + this.allowRoot = true; + + if (this.options.less !== undefined || this.options.inline) { + this.css = !this.options.less || this.options.inline; + } else { + const pathValue = this.getPath(); + if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) { + this.css = true; + } } + this.copyVisibilityInfo(visibilityInfo); + this.setParent(this.features, this); + this.setParent(this.path, this); } - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.features, this); - this.setParent(this.path, this); -}; - -Import.prototype = Object.assign(new Node(), { - type: 'Import', accept(visitor) { if (this.features) { @@ -52,7 +53,7 @@ Import.prototype = Object.assign(new Node(), { if (!this.options.isPlugin && !this.options.inline && this.root) { this.root = visitor.visit(this.root); } - }, + } genCSS(context, output) { if (this.css && this.path._fileInfo.reference === undefined) { @@ -64,12 +65,12 @@ Import.prototype = Object.assign(new Node(), { } output.add(';'); } - }, + } getPath() { return (this.path instanceof URL) ? this.path.value.value : this.path.value; - }, + } isVariableImport() { let path = this.path; @@ -81,7 +82,7 @@ Import.prototype = Object.assign(new Node(), { } return true; - }, + } evalForImport(context) { let path = this.path; @@ -91,7 +92,7 @@ Import.prototype = Object.assign(new Node(), { } return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); - }, + } evalPath(context) { const path = this.path.eval(context); @@ -110,7 +111,7 @@ Import.prototype = Object.assign(new Node(), { } return path; - }, + } eval(context) { const result = this.doEval(context); @@ -125,7 +126,7 @@ Import.prototype = Object.assign(new Node(), { } } return result; - }, + } doEval(context) { let ruleset; @@ -234,6 +235,6 @@ Import.prototype = Object.assign(new Node(), { return []; } } -}); +} export default Import; diff --git a/packages/less/lib/less/tree/javascript.js b/packages/less/lib/less/tree/javascript.js index 9cdd3f1ee..d8cadc756 100644 --- a/packages/less/lib/less/tree/javascript.js +++ b/packages/less/lib/less/tree/javascript.js @@ -3,15 +3,16 @@ import Dimension from './dimension.js'; import Quoted from './quoted.js'; import Anonymous from './anonymous.js'; -const JavaScript = function(string, escaped, index, currentFileInfo) { - this.escaped = escaped; - this.expression = string; - this._index = index; - this._fileInfo = currentFileInfo; -} +class JavaScript extends JsEvalNode { + get type() { return 'JavaScript'; } -JavaScript.prototype = Object.assign(new JsEvalNode(), { - type: 'JavaScript', + constructor(string, escaped, index, currentFileInfo) { + super(); + this.escaped = escaped; + this.expression = string; + this._index = index; + this._fileInfo = currentFileInfo; + } eval(context) { const result = this.evaluateJavaScript(this.expression, context); @@ -27,6 +28,6 @@ JavaScript.prototype = Object.assign(new JsEvalNode(), { return new Anonymous(result); } } -}); +} export default JavaScript; diff --git a/packages/less/lib/less/tree/js-eval-node.js b/packages/less/lib/less/tree/js-eval-node.js index 574496467..2cf85fb93 100644 --- a/packages/less/lib/less/tree/js-eval-node.js +++ b/packages/less/lib/less/tree/js-eval-node.js @@ -1,9 +1,7 @@ import Node from './node.js'; import Variable from './variable.js'; -const JsEvalNode = function() {}; - -JsEvalNode.prototype = Object.assign(new Node(), { +class JsEvalNode extends Node { evaluateJavaScript(expression, context) { let result; const that = this; @@ -48,7 +46,7 @@ JsEvalNode.prototype = Object.assign(new Node(), { index: this.getIndex() }; } return result; - }, + } jsify(obj) { if (Array.isArray(obj.value) && (obj.value.length > 1)) { @@ -57,6 +55,6 @@ JsEvalNode.prototype = Object.assign(new Node(), { return obj.toCSS(); } } -}); +} export default JsEvalNode; diff --git a/packages/less/lib/less/tree/keyword.js b/packages/less/lib/less/tree/keyword.js index bf7ab8807..51041852a 100644 --- a/packages/less/lib/less/tree/keyword.js +++ b/packages/less/lib/less/tree/keyword.js @@ -1,17 +1,18 @@ import Node from './node.js'; -const Keyword = function(value) { - this.value = value; -}; +class Keyword extends Node { + get type() { return 'Keyword'; } -Keyword.prototype = Object.assign(new Node(), { - type: 'Keyword', + constructor(value) { + super(); + this.value = value; + } genCSS(context, output) { if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; } output.add(this.value); } -}); +} Keyword.True = new Keyword('true'); Keyword.False = new Keyword('false'); diff --git a/packages/less/lib/less/tree/media.js b/packages/less/lib/less/tree/media.js index 5e01eeb49..11fd49a69 100644 --- a/packages/less/lib/less/tree/media.js +++ b/packages/less/lib/less/tree/media.js @@ -4,32 +4,31 @@ import Selector from './selector.js'; import AtRule from './atrule.js'; import NestableAtRulePrototype from './nested-at-rule.js'; -const Media = function(value, features, index, currentFileInfo, visibilityInfo) { - this._index = index; - this._fileInfo = currentFileInfo; +class Media extends AtRule { + get type() { return 'Media'; } - const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); + constructor(value, features, index, currentFileInfo, visibilityInfo) { + super(); + this._index = index; + this._fileInfo = currentFileInfo; - this.features = new Value(features); - this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); -}; + const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); -Media.prototype = Object.assign(new AtRule(), { - type: 'Media', - - ...NestableAtRulePrototype, + this.features = new Value(features); + this.rules = [new Ruleset(selectors, value)]; + this.rules[0].allowImports = true; + this.copyVisibilityInfo(visibilityInfo); + this.allowRoot = true; + this.setParent(selectors, this); + this.setParent(this.features, this); + this.setParent(this.rules, this); + } genCSS(context, output) { output.add('@media ', this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); - }, + } eval(context) { if (!context.mediaBlocks) { @@ -42,7 +41,7 @@ Media.prototype = Object.assign(new AtRule(), { this.rules[0].debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } - + media.features = this.features.eval(context); context.mediaPath.push(media); @@ -58,6 +57,9 @@ Media.prototype = Object.assign(new AtRule(), { return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); } -}); +} + +// Apply NestableAtRulePrototype methods (accept, isRulesetLike override AtRule's versions) +Object.assign(Media.prototype, NestableAtRulePrototype); export default Media; diff --git a/packages/less/lib/less/tree/mixin-call.js b/packages/less/lib/less/tree/mixin-call.js index 3b4219811..2e0cb9bd8 100644 --- a/packages/less/lib/less/tree/mixin-call.js +++ b/packages/less/lib/less/tree/mixin-call.js @@ -3,18 +3,19 @@ import Selector from './selector.js'; import MixinDefinition from './mixin-definition.js'; import defaultFunc from '../functions/default.js'; -const MixinCall = function(elements, args, index, currentFileInfo, important) { - this.selector = new Selector(elements); - this.arguments = args || []; - this._index = index; - this._fileInfo = currentFileInfo; - this.important = important; - this.allowRoot = true; - this.setParent(this.selector, this); -}; - -MixinCall.prototype = Object.assign(new Node(), { - type: 'MixinCall', +class MixinCall extends Node { + get type() { return 'MixinCall'; } + + constructor(elements, args, index, currentFileInfo, important) { + super(); + this.selector = new Selector(elements); + this.arguments = args || []; + this._index = index; + this._fileInfo = currentFileInfo; + this.important = important; + this.allowRoot = true; + this.setParent(this.selector, this); + } accept(visitor) { if (this.selector) { @@ -23,7 +24,7 @@ MixinCall.prototype = Object.assign(new Node(), { if (this.arguments.length) { this.arguments = visitor.visitArray(this.arguments); } - }, + } eval(context) { let mixins; @@ -180,7 +181,7 @@ MixinCall.prototype = Object.assign(new Node(), { message: `${this.selector.toCSS().trim()} is undefined`, index: this.getIndex(), filename: this.fileInfo().filename }; } - }, + } _setVisibilityToReplacement(replacement) { let i, rule; @@ -190,7 +191,7 @@ MixinCall.prototype = Object.assign(new Node(), { rule.addVisibilityBlock(); } } - }, + } format(args) { return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) { @@ -206,6 +207,6 @@ MixinCall.prototype = Object.assign(new Node(), { return argValue; }).join(', ') : ''})`; } -}); +} export default MixinCall; diff --git a/packages/less/lib/less/tree/mixin-definition.js b/packages/less/lib/less/tree/mixin-definition.js index ff6b393a4..f99659980 100644 --- a/packages/less/lib/less/tree/mixin-definition.js +++ b/packages/less/lib/less/tree/mixin-definition.js @@ -7,34 +7,35 @@ import Expression from './expression.js'; import contexts from '../contexts.js'; import * as utils from '../utils.js'; -const Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) { - this.name = name || 'anonymous mixin'; - this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])]; - this.params = params; - this.condition = condition; - this.variadic = variadic; - this.arity = params.length; - this.rules = rules; - this._lookups = {}; - const optionalParameters = []; - this.required = params.reduce(function (count, p) { - if (!p.name || (p.name && !p.value)) { - return count + 1; - } - else { - optionalParameters.push(p.name); - return count; - } - }, 0); - this.optionalParameters = optionalParameters; - this.frames = frames; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; -} - -Definition.prototype = Object.assign(new Ruleset(), { - type: 'MixinDefinition', - evalFirst: true, +class Definition extends Ruleset { + get type() { return 'MixinDefinition'; } + + constructor(name, params, rules, condition, variadic, frames, visibilityInfo) { + super(); + this.name = name || 'anonymous mixin'; + this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])]; + this.params = params; + this.condition = condition; + this.variadic = variadic; + this.arity = params.length; + this.rules = rules; + this._lookups = {}; + const optionalParameters = []; + this.required = params.reduce(function (count, p) { + if (!p.name || (p.name && !p.value)) { + return count + 1; + } + else { + optionalParameters.push(p.name); + return count; + } + }, 0); + this.optionalParameters = optionalParameters; + this.frames = frames; + this.copyVisibilityInfo(visibilityInfo); + this.allowRoot = true; + this.evalFirst = true; + } accept(visitor) { if (this.params && this.params.length) { @@ -44,7 +45,7 @@ Definition.prototype = Object.assign(new Ruleset(), { if (this.condition) { this.condition = visitor.visit(this.condition); } - }, + } evalParams(context, mixinEnv, args, evaldArguments) { /* jshint boss:true */ @@ -136,7 +137,7 @@ Definition.prototype = Object.assign(new Ruleset(), { } return frame; - }, + } makeImportant() { const rules = !this.rules ? this.rules : this.rules.map(function (r) { @@ -148,11 +149,11 @@ Definition.prototype = Object.assign(new Ruleset(), { }); const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); return result; - }, + } eval(context) { return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames)); - }, + } evalCall(context, args, important) { const _arguments = []; @@ -172,7 +173,7 @@ Definition.prototype = Object.assign(new Ruleset(), { ruleset = ruleset.makeImportant(); } return ruleset; - }, + } matchCondition(args, context) { if (this.condition && !this.condition.eval( @@ -184,7 +185,7 @@ Definition.prototype = Object.assign(new Ruleset(), { return false; } return true; - }, + } matchArgs(args, context) { const allArgsCnt = (args && args.length) || 0; @@ -223,6 +224,6 @@ Definition.prototype = Object.assign(new Ruleset(), { } return true; } -}); +} export default Definition; diff --git a/packages/less/lib/less/tree/namespace-value.js b/packages/less/lib/less/tree/namespace-value.js index 0a18fc96c..b6704357c 100644 --- a/packages/less/lib/less/tree/namespace-value.js +++ b/packages/less/lib/less/tree/namespace-value.js @@ -3,15 +3,16 @@ import Variable from './variable.js'; import Ruleset from './ruleset.js'; import Selector from './selector.js'; -const NamespaceValue = function(ruleCall, lookups, index, fileInfo) { - this.value = ruleCall; - this.lookups = lookups; - this._index = index; - this._fileInfo = fileInfo; -}; +class NamespaceValue extends Node { + get type() { return 'NamespaceValue'; } -NamespaceValue.prototype = Object.assign(new Node(), { - type: 'NamespaceValue', + constructor(ruleCall, lookups, index, fileInfo) { + super(); + this.value = ruleCall; + this.lookups = lookups; + this._index = index; + this._fileInfo = fileInfo; + } eval(context) { let i, name, rules = this.value.eval(context); @@ -19,11 +20,6 @@ NamespaceValue.prototype = Object.assign(new Node(), { for (i = 0; i < this.lookups.length; i++) { name = this.lookups[i]; - /** - * Eval'd DRs return rulesets. - * Eval'd mixins return rules, so let's make a ruleset if we need it. - * We need to do this because of late parsing of values - */ if (Array.isArray(rules)) { rules = new Ruleset([new Selector()], rules); } @@ -63,8 +59,6 @@ NamespaceValue.prototype = Object.assign(new Node(), { filename: this.fileInfo().filename, index: this.getIndex() }; } - // Properties are an array of values, since a ruleset can have multiple props. - // We pick the last one (the "cascaded" value) rules = rules[rules.length - 1]; } @@ -77,6 +71,6 @@ NamespaceValue.prototype = Object.assign(new Node(), { } return rules; } -}); +} export default NamespaceValue; diff --git a/packages/less/lib/less/tree/negative.js b/packages/less/lib/less/tree/negative.js index 0bedb65fc..cbf13ffc7 100644 --- a/packages/less/lib/less/tree/negative.js +++ b/packages/less/lib/less/tree/negative.js @@ -2,17 +2,18 @@ import Node from './node.js'; import Operation from './operation.js'; import Dimension from './dimension.js'; -const Negative = function(node) { - this.value = node; -}; +class Negative extends Node { + get type() { return 'Negative'; } -Negative.prototype = Object.assign(new Node(), { - type: 'Negative', + constructor(node) { + super(); + this.value = node; + } genCSS(context, output) { output.add('-'); this.value.genCSS(context, output); - }, + } eval(context) { if (context.isMathOn()) { @@ -20,6 +21,6 @@ Negative.prototype = Object.assign(new Node(), { } return new Negative(this.value.eval(context)); } -}); +} export default Negative; diff --git a/packages/less/lib/less/tree/node.js b/packages/less/lib/less/tree/node.js index a57390307..7ab16e889 100644 --- a/packages/less/lib/less/tree/node.js +++ b/packages/less/lib/less/tree/node.js @@ -1,16 +1,61 @@ +/** + * @typedef {object} FileInfo + * @property {string} [filename] + * @property {string} [rootpath] + * @property {string} [currentDirectory] + * @property {string} [rootFilename] + * @property {string} [entryPath] + * @property {boolean} [reference] + */ + +/** + * @typedef {object} VisibilityInfo + * @property {number} [visibilityBlocks] + * @property {boolean} [nodeVisible] + */ + +/** + * @typedef {object} CSSOutput + * @property {(chunk: string, fileInfo?: FileInfo, index?: number) => void} add + * @property {() => boolean} isEmpty + */ + +/** + * @typedef {object} EvalContext + * @property {number} [numPrecision] + * @property {boolean} [isMathOn] + * @property {string} [math] + * @property {Array} [frames] + * @property {boolean} [importantScope] + */ + /** * The reason why Node is a class and other nodes simply do not extend * from Node (since we're transpiling) is due to this issue: - * + * * @see https://github.com/less/less.js/issues/3434 */ class Node { + get type() { return ''; } + constructor() { + /** @type {Node | null} */ this.parent = null; + /** @type {number | undefined} */ this.visibilityBlocks = undefined; + /** @type {boolean | undefined} */ this.nodeVisible = undefined; + /** @type {Node | null} */ this.rootNode = null; + /** @type {object | null} */ this.parsed = null; + + /** @type {*} */ + this.value = undefined; + /** @type {number | undefined} */ + this._index = undefined; + /** @type {FileInfo | undefined} */ + this._fileInfo = undefined; } get currentFileInfo() { @@ -21,7 +66,12 @@ class Node { return this.getIndex(); } + /** + * @param {Node | Node[]} nodes + * @param {Node} parent + */ setParent(nodes, parent) { + /** @param {Node} node */ function set(node) { if (node && node instanceof Node) { node.parent = parent; @@ -35,21 +85,27 @@ class Node { } } + /** @returns {number} */ getIndex() { return this._index || (this.parent && this.parent.getIndex()) || 0; } + /** @returns {FileInfo} */ fileInfo() { return this._fileInfo || (this.parent && this.parent.fileInfo()) || {}; } + /** @returns {boolean} */ isRulesetLike() { return false; } + /** + * @param {EvalContext} context + * @returns {string} + */ toCSS(context) { + /** @type {string[]} */ const strs = []; this.genCSS(context, { - // remove when genCSS has JSDoc types - // eslint-disable-next-line no-unused-vars add: function(chunk, fileInfo, index) { strs.push(chunk); }, @@ -60,16 +116,34 @@ class Node { return strs.join(''); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add(this.value); } + /** + * @param {{ visit: (node: *) => * }} visitor + */ accept(visitor) { this.value = visitor.visit(this.value); } - eval() { return this; } + /** + * @param {*} [context] + * @returns {Node} + */ + eval(context) { return this; } + /** + * @param {EvalContext} context + * @param {string} op + * @param {number} a + * @param {number} b + * @returns {number | undefined} + */ _operate(context, op, a, b) { switch (op) { case '+': return a + b; @@ -79,12 +153,22 @@ class Node { } } + /** + * @param {EvalContext} context + * @param {number} value + * @returns {number} + */ fround(context, value) { const precision = context && context.numPrecision; // add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded: return (precision) ? Number((value + 2e-16).toFixed(precision)) : value; } + /** + * @param {Node & { compare?: (other: Node) => number | undefined }} a + * @param {Node & { compare?: (other: Node) => number | undefined }} b + * @returns {number | undefined} + */ static compare(a, b) { /* returns: -1: a < b @@ -103,29 +187,36 @@ class Node { return undefined; } - a = a.value; - b = b.value; - if (!Array.isArray(a)) { - return a === b ? 0 : undefined; + /** @type {*} */ + let aVal = a.value; + /** @type {*} */ + let bVal = b.value; + if (!Array.isArray(aVal)) { + return aVal === bVal ? 0 : undefined; } - if (a.length !== b.length) { + if (aVal.length !== bVal.length) { return undefined; } - for (let i = 0; i < a.length; i++) { - if (Node.compare(a[i], b[i]) !== 0) { + for (let i = 0; i < aVal.length; i++) { + if (Node.compare(aVal[i], bVal[i]) !== 0) { return undefined; } } return 0; } + /** + * @param {number} a + * @param {number} b + * @returns {number | undefined} + */ static numericCompare(a, b) { return a < b ? -1 : a === b ? 0 : a > b ? 1 : undefined; } - // Returns true if this node represents root of ast imported by reference + /** @returns {boolean} */ blocksVisibility() { if (this.visibilityBlocks === undefined) { this.visibilityBlocks = 0; @@ -147,26 +238,20 @@ class Node { this.visibilityBlocks = this.visibilityBlocks - 1; } - // Turns on node visibility - if called node will be shown in output regardless - // of whether it comes from import by reference or not ensureVisibility() { this.nodeVisible = true; } - // Turns off node visibility - if called node will NOT be shown in output regardless - // of whether it comes from import by reference or not ensureInvisibility() { this.nodeVisible = false; } - // return values: - // false - the node must not be visible - // true - the node must be visible - // undefined or null - the node has the same visibility as its parent + /** @returns {boolean | undefined} */ isVisible() { return this.nodeVisible; } + /** @returns {VisibilityInfo} */ visibilityInfo() { return { visibilityBlocks: this.visibilityBlocks, @@ -174,6 +259,7 @@ class Node { }; } + /** @param {VisibilityInfo} info */ copyVisibilityInfo(info) { if (!info) { return; diff --git a/packages/less/lib/less/tree/operation.js b/packages/less/lib/less/tree/operation.js index f220749cb..e0fc244ba 100644 --- a/packages/less/lib/less/tree/operation.js +++ b/packages/less/lib/less/tree/operation.js @@ -4,19 +4,19 @@ import Dimension from './dimension.js'; import * as Constants from '../constants.js'; const MATH = Constants.Math; - -const Operation = function(op, operands, isSpaced) { - this.op = op.trim(); - this.operands = operands; - this.isSpaced = isSpaced; -}; - -Operation.prototype = Object.assign(new Node(), { - type: 'Operation', +class Operation extends Node { + get type() { return 'Operation'; } + + constructor(op, operands, isSpaced) { + super(); + this.op = op.trim(); + this.operands = operands; + this.isSpaced = isSpaced; + } accept(visitor) { this.operands = visitor.visitArray(this.operands); - }, + } eval(context) { let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op; @@ -44,7 +44,7 @@ Operation.prototype = Object.assign(new Node(), { } else { return new Operation(this.op, [a, b], this.isSpaced); } - }, + } genCSS(context, output) { this.operands[0].genCSS(context, output); @@ -57,6 +57,6 @@ Operation.prototype = Object.assign(new Node(), { } this.operands[1].genCSS(context, output); } -}); +} export default Operation; diff --git a/packages/less/lib/less/tree/paren.js b/packages/less/lib/less/tree/paren.js index a9940e392..5976ad49e 100644 --- a/packages/less/lib/less/tree/paren.js +++ b/packages/less/lib/less/tree/paren.js @@ -1,27 +1,28 @@ import Node from './node.js'; -const Paren = function(node) { - this.value = node; -}; +class Paren extends Node { + get type() { return 'Paren'; } -Paren.prototype = Object.assign(new Node(), { - type: 'Paren', + constructor(node) { + super(); + this.value = node; + } genCSS(context, output) { output.add('('); this.value.genCSS(context, output); output.add(')'); - }, + } eval(context) { const paren = new Paren(this.value.eval(context)); - + if (this.noSpacing) { paren.noSpacing = true; } return paren; } -}); +} export default Paren; diff --git a/packages/less/lib/less/tree/property.js b/packages/less/lib/less/tree/property.js index 183ad9bec..481aadf5a 100644 --- a/packages/less/lib/less/tree/property.js +++ b/packages/less/lib/less/tree/property.js @@ -1,14 +1,15 @@ import Node from './node.js'; import Declaration from './declaration.js'; -const Property = function(name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; -}; +class Property extends Node { + get type() { return 'Property'; } -Property.prototype = Object.assign(new Node(), { - type: 'Property', + constructor(name, index, currentFileInfo) { + super(); + this.name = name; + this._index = index; + this._fileInfo = currentFileInfo; + } eval(context) { let property; @@ -62,7 +63,7 @@ Property.prototype = Object.assign(new Node(), { filename: this.currentFileInfo.filename, index: this.index }; } - }, + } find(obj, fun) { for (let i = 0, r; i < obj.length; i++) { @@ -71,6 +72,6 @@ Property.prototype = Object.assign(new Node(), { } return null; } -}); +} export default Property; diff --git a/packages/less/lib/less/tree/query-in-parens.js b/packages/less/lib/less/tree/query-in-parens.js index 0135eb743..84938b616 100644 --- a/packages/less/lib/less/tree/query-in-parens.js +++ b/packages/less/lib/less/tree/query-in-parens.js @@ -1,16 +1,17 @@ import Node from './node.js'; -const QueryInParens = function (op, l, m, op2, r, i) { - this.op = op.trim(); - this.lvalue = l; - this.mvalue = m; - this.op2 = op2 ? op2.trim() : null; - this.rvalue = r; - this._index = i; -}; +class QueryInParens extends Node { + get type() { return 'QueryInParens'; } -QueryInParens.prototype = Object.assign(new Node(), { - type: 'QueryInParens', + constructor(op, l, m, op2, r, i) { + super(); + this.op = op.trim(); + this.lvalue = l; + this.mvalue = m; + this.op2 = op2 ? op2.trim() : null; + this.rvalue = r; + this._index = i; + } accept(visitor) { this.lvalue = visitor.visit(this.lvalue); @@ -18,7 +19,7 @@ QueryInParens.prototype = Object.assign(new Node(), { if (this.rvalue) { this.rvalue = visitor.visit(this.rvalue); } - }, + } eval(context) { const node = new QueryInParens( @@ -30,7 +31,7 @@ QueryInParens.prototype = Object.assign(new Node(), { this._index ); return node; - }, + } genCSS(context, output) { this.lvalue.genCSS(context, output); @@ -40,7 +41,7 @@ QueryInParens.prototype = Object.assign(new Node(), { output.add(' ' + this.op2 + ' '); this.rvalue.genCSS(context, output); } - }, -}); + } +} export default QueryInParens; diff --git a/packages/less/lib/less/tree/quoted.js b/packages/less/lib/less/tree/quoted.js index e93c547b2..64c619dcc 100644 --- a/packages/less/lib/less/tree/quoted.js +++ b/packages/less/lib/less/tree/quoted.js @@ -2,19 +2,20 @@ import Node from './node.js'; import Variable from './variable.js'; import Property from './property.js'; -const Quoted = function(str, content, escaped, index, currentFileInfo) { - this.escaped = (escaped === undefined) ? true : escaped; - this.value = content || ''; - this.quote = str.charAt(0); - this._index = index; - this._fileInfo = currentFileInfo; - this.variableRegex = /@\{([\w-]+)\}/g; - this.propRegex = /\$\{([\w-]+)\}/g; - this.allowRoot = escaped; -}; +class Quoted extends Node { + get type() { return 'Quoted'; } -Quoted.prototype = Object.assign(new Node(), { - type: 'Quoted', + constructor(str, content, escaped, index, currentFileInfo) { + super(); + this.escaped = (escaped === undefined) ? true : escaped; + this.value = content || ''; + this.quote = str.charAt(0); + this._index = index; + this._fileInfo = currentFileInfo; + this.variableRegex = /@\{([\w-]+)\}/g; + this.propRegex = /\$\{([\w-]+)\}/g; + this.allowRoot = escaped; + } genCSS(context, output) { if (!this.escaped) { @@ -24,11 +25,11 @@ Quoted.prototype = Object.assign(new Node(), { if (!this.escaped) { output.add(this.quote); } - }, + } containsVariables() { return this.value.match(this.variableRegex); - }, + } eval(context) { const that = this; @@ -52,7 +53,7 @@ Quoted.prototype = Object.assign(new Node(), { value = iterativeReplace(value, this.variableRegex, variableReplacement); value = iterativeReplace(value, this.propRegex, propertyReplacement); return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); - }, + } compare(other) { // when comparing quoted strings allow the quote to differ @@ -62,6 +63,6 @@ Quoted.prototype = Object.assign(new Node(), { return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; } } -}); +} export default Quoted; diff --git a/packages/less/lib/less/tree/ruleset.js b/packages/less/lib/less/tree/ruleset.js index 0214e8f8f..1bd256715 100644 --- a/packages/less/lib/less/tree/ruleset.js +++ b/packages/less/lib/less/tree/ruleset.js @@ -13,25 +13,26 @@ import getDebugInfo from './debug-info.js'; import * as utils from '../utils.js'; import Parser from '../parser/parser.js'; -const Ruleset = function(selectors, rules, strictImports, visibilityInfo) { - this.selectors = selectors; - this.rules = rules; - this._lookups = {}; - this._variables = null; - this._properties = null; - this.strictImports = strictImports; - this.copyVisibilityInfo(visibilityInfo); - this.allowRoot = true; - - this.setParent(this.selectors, this); - this.setParent(this.rules, this); -} +class Ruleset extends Node { + get type() { return 'Ruleset'; } -Ruleset.prototype = Object.assign(new Node(), { - type: 'Ruleset', - isRuleset: true, + constructor(selectors, rules, strictImports, visibilityInfo) { + super(); + this.selectors = selectors; + this.rules = rules; + this._lookups = {}; + this._variables = null; + this._properties = null; + this.strictImports = strictImports; + this.copyVisibilityInfo(visibilityInfo); + this.allowRoot = true; + this.isRuleset = true; - isRulesetLike() { return true; }, + this.setParent(this.selectors, this); + this.setParent(this.rules, this); + } + + isRulesetLike() { return true; } accept(visitor) { if (this.paths) { @@ -42,7 +43,7 @@ Ruleset.prototype = Object.assign(new Node(), { if (this.rules && this.rules.length) { this.rules = visitor.visitArray(this.rules); } - }, + } eval(context) { let selectors; @@ -219,7 +220,7 @@ Ruleset.prototype = Object.assign(new Node(), { } return ruleset; - }, + } evalImports(context) { const rules = this.rules; @@ -239,7 +240,7 @@ Ruleset.prototype = Object.assign(new Node(), { this.resetCache(); } } - }, + } makeImportant() { const result = new Ruleset(this.selectors, this.rules.map(function (r) { @@ -251,11 +252,11 @@ Ruleset.prototype = Object.assign(new Node(), { }), this.strictImports, this.visibilityInfo()); return result; - }, + } matchArgs(args) { return !args || args.length === 0; - }, + } // lets you call a css selector with a guard matchCondition(args, context) { @@ -270,14 +271,14 @@ Ruleset.prototype = Object.assign(new Node(), { return false; } return true; - }, + } resetCache() { this._rulesets = null; this._variables = null; this._properties = null; this._lookups = {}; - }, + } variables() { if (!this._variables) { @@ -300,7 +301,7 @@ Ruleset.prototype = Object.assign(new Node(), { }, {}); } return this._variables; - }, + } properties() { if (!this._properties) { @@ -320,21 +321,21 @@ Ruleset.prototype = Object.assign(new Node(), { }, {}); } return this._properties; - }, + } variable(name) { const decl = this.variables()[name]; if (decl) { return this.parseValue(decl); } - }, + } property(name) { const decl = this.properties()[name]; if (decl) { return this.parseValue(decl); } - }, + } lastDeclaration() { for (let i = this.rules.length; i > 0; i--) { @@ -343,7 +344,7 @@ Ruleset.prototype = Object.assign(new Node(), { return this.parseValue(decl); } } - }, + } parseValue(toParse) { const self = this; @@ -383,7 +384,7 @@ Ruleset.prototype = Object.assign(new Node(), { } return nodes; } - }, + } rulesets() { if (!this.rules) { return []; } @@ -400,7 +401,7 @@ Ruleset.prototype = Object.assign(new Node(), { } return filtRules; - }, + } prependRule(rule) { const rules = this.rules; @@ -410,7 +411,7 @@ Ruleset.prototype = Object.assign(new Node(), { this.rules = [ rule ]; } this.setParent(rule, this); - }, + } find(selector, self, filter) { self = self || this; @@ -444,7 +445,7 @@ Ruleset.prototype = Object.assign(new Node(), { }); this._lookups[key] = rules; return rules; - }, + } genCSS(context, output) { let i; @@ -557,13 +558,13 @@ Ruleset.prototype = Object.assign(new Node(), { if (!output.isEmpty() && !context.compress && this.firstRoot) { output.add('\n'); } - }, + } joinSelectors(paths, context, selectors) { for (let s = 0; s < selectors.length; s++) { this.joinSelector(paths, context, selectors[s]); } - }, + } joinSelector(paths, context, selector) { @@ -866,6 +867,6 @@ Ruleset.prototype = Object.assign(new Node(), { } } -}); +} export default Ruleset; diff --git a/packages/less/lib/less/tree/selector.js b/packages/less/lib/less/tree/selector.js index a3fe1fc02..b537d78b1 100644 --- a/packages/less/lib/less/tree/selector.js +++ b/packages/less/lib/less/tree/selector.js @@ -4,20 +4,21 @@ import LessError from '../less-error.js'; import * as utils from '../utils.js'; import Parser from '../parser/parser.js'; -const Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) { - this.extendList = extendList; - this.condition = condition; - this.evaldCondition = !condition; - this._index = index; - this._fileInfo = currentFileInfo; - this.elements = this.getElements(elements); - this.mixinElements_ = undefined; - this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.elements, this); -}; - -Selector.prototype = Object.assign(new Node(), { - type: 'Selector', +class Selector extends Node { + get type() { return 'Selector'; } + + constructor(elements, extendList, condition, index, currentFileInfo, visibilityInfo) { + super(); + this.extendList = extendList; + this.condition = condition; + this.evaldCondition = !condition; + this._index = index; + this._fileInfo = currentFileInfo; + this.elements = this.getElements(elements); + this.mixinElements_ = undefined; + this.copyVisibilityInfo(visibilityInfo); + this.setParent(this.elements, this); + } accept(visitor) { if (this.elements) { @@ -29,7 +30,7 @@ Selector.prototype = Object.assign(new Node(), { if (this.condition) { this.condition = visitor.visit(this.condition); } - }, + } createDerived(elements, extendList, evaldCondition) { elements = this.getElements(elements); @@ -38,7 +39,7 @@ Selector.prototype = Object.assign(new Node(), { newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition; newSelector.mediaEmpty = this.mediaEmpty; return newSelector; - }, + } getElements(els) { if (!els) { @@ -59,13 +60,13 @@ Selector.prototype = Object.assign(new Node(), { }); } return els; - }, + } createEmptySelectors() { const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)]; sels[0].mediaEmpty = true; return sels; - }, + } match(other) { const elements = this.elements; @@ -86,7 +87,7 @@ Selector.prototype = Object.assign(new Node(), { } return olen; // return number of matched elements - }, + } mixinElements() { if (this.mixinElements_) { @@ -106,14 +107,14 @@ Selector.prototype = Object.assign(new Node(), { } return (this.mixinElements_ = elements); - }, + } isJustParentSelector() { return !this.mediaEmpty && this.elements.length === 1 && this.elements[0].value === '&' && (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === ''); - }, + } eval(context) { const evaldCondition = this.condition && this.condition.eval(context); @@ -136,7 +137,7 @@ Selector.prototype = Object.assign(new Node(), { } return this.createDerived(elements, extendList, evaldCondition); - }, + } genCSS(context, output) { let i, element; @@ -147,11 +148,11 @@ Selector.prototype = Object.assign(new Node(), { element = this.elements[i]; element.genCSS(context, output); } - }, + } getIsOutput() { return this.evaldCondition; } -}); +} export default Selector; diff --git a/packages/less/lib/less/tree/unicode-descriptor.js b/packages/less/lib/less/tree/unicode-descriptor.js index c40e20942..20bb8b52b 100644 --- a/packages/less/lib/less/tree/unicode-descriptor.js +++ b/packages/less/lib/less/tree/unicode-descriptor.js @@ -1,11 +1,12 @@ import Node from './node.js'; -const UnicodeDescriptor = function(value) { - this.value = value; -} +class UnicodeDescriptor extends Node { + get type() { return 'UnicodeDescriptor'; } -UnicodeDescriptor.prototype = Object.assign(new Node(), { - type: 'UnicodeDescriptor' -}) + constructor(value) { + super(); + this.value = value; + } +} export default UnicodeDescriptor; diff --git a/packages/less/lib/less/tree/unit.js b/packages/less/lib/less/tree/unit.js index e57aae6c8..983cfd4b2 100644 --- a/packages/less/lib/less/tree/unit.js +++ b/packages/less/lib/less/tree/unit.js @@ -2,22 +2,23 @@ import Node from './node.js'; import unitConversions from '../data/unit-conversions.js'; import * as utils from '../utils.js'; -const Unit = function(numerator, denominator, backupUnit) { - this.numerator = numerator ? utils.copyArray(numerator).sort() : []; - this.denominator = denominator ? utils.copyArray(denominator).sort() : []; - if (backupUnit) { - this.backupUnit = backupUnit; - } else if (numerator && numerator.length) { - this.backupUnit = numerator[0]; +class Unit extends Node { + get type() { return 'Unit'; } + + constructor(numerator, denominator, backupUnit) { + super(); + this.numerator = numerator ? utils.copyArray(numerator).sort() : []; + this.denominator = denominator ? utils.copyArray(denominator).sort() : []; + if (backupUnit) { + this.backupUnit = backupUnit; + } else if (numerator && numerator.length) { + this.backupUnit = numerator[0]; + } } -}; - -Unit.prototype = Object.assign(new Node(), { - type: 'Unit', clone() { return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit); - }, + } genCSS(context, output) { // Dimension checks the unit is singular and throws an error if in strict math mode. @@ -29,7 +30,7 @@ Unit.prototype = Object.assign(new Node(), { } else if (!strictUnits && this.denominator.length) { output.add(this.denominator[0]); } - }, + } toString() { let i, returnStr = this.numerator.join('*'); @@ -37,27 +38,27 @@ Unit.prototype = Object.assign(new Node(), { returnStr += `/${this.denominator[i]}`; } return returnStr; - }, + } compare(other) { return this.is(other.toString()) ? 0 : undefined; - }, + } is(unitString) { return this.toString().toUpperCase() === unitString.toUpperCase(); - }, + } isLength() { return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); - }, + } isEmpty() { return this.numerator.length === 0 && this.denominator.length === 0; - }, + } isSingular() { return this.numerator.length <= 1 && this.denominator.length === 0; - }, + } map(callback) { let i; @@ -69,7 +70,7 @@ Unit.prototype = Object.assign(new Node(), { for (i = 0; i < this.denominator.length; i++) { this.denominator[i] = callback(this.denominator[i], true); } - }, + } usedUnits() { let group; @@ -96,7 +97,7 @@ Unit.prototype = Object.assign(new Node(), { } return result; - }, + } cancel() { const counter = {}; @@ -136,6 +137,6 @@ Unit.prototype = Object.assign(new Node(), { this.numerator.sort(); this.denominator.sort(); } -}); +} export default Unit; diff --git a/packages/less/lib/less/tree/url.js b/packages/less/lib/less/tree/url.js index c412b3582..f9f01642c 100644 --- a/packages/less/lib/less/tree/url.js +++ b/packages/less/lib/less/tree/url.js @@ -4,25 +4,26 @@ function escapePath(path) { return path.replace(/[()'"\s]/g, function(match) { return `\\${match}`; }); } -const URL = function(val, index, currentFileInfo, isEvald) { - this.value = val; - this._index = index; - this._fileInfo = currentFileInfo; - this.isEvald = isEvald; -}; +class URL extends Node { + get type() { return 'Url'; } -URL.prototype = Object.assign(new Node(), { - type: 'Url', + constructor(val, index, currentFileInfo, isEvald) { + super(); + this.value = val; + this._index = index; + this._fileInfo = currentFileInfo; + this.isEvald = isEvald; + } accept(visitor) { this.value = visitor.visit(this.value); - }, + } genCSS(context, output) { output.add('url('); this.value.genCSS(context, output); output.add(')'); - }, + } eval(context) { const val = this.value.eval(context); @@ -58,6 +59,6 @@ URL.prototype = Object.assign(new Node(), { return new URL(val, this.getIndex(), this.fileInfo(), true); } -}); +} export default URL; diff --git a/packages/less/lib/less/tree/value.js b/packages/less/lib/less/tree/value.js index 73573bf5a..874319032 100644 --- a/packages/less/lib/less/tree/value.js +++ b/packages/less/lib/less/tree/value.js @@ -1,25 +1,26 @@ import Node from './node.js'; -const Value = function(value) { - if (!value) { - throw new Error('Value requires an array argument'); - } - if (!Array.isArray(value)) { - this.value = [ value ]; - } - else { - this.value = value; - } -}; +class Value extends Node { + get type() { return 'Value'; } -Value.prototype = Object.assign(new Node(), { - type: 'Value', + constructor(value) { + super(); + if (!value) { + throw new Error('Value requires an array argument'); + } + if (!Array.isArray(value)) { + this.value = [ value ]; + } + else { + this.value = value; + } + } accept(visitor) { if (this.value) { this.value = visitor.visitArray(this.value); } - }, + } eval(context) { if (this.value.length === 1) { @@ -29,7 +30,7 @@ Value.prototype = Object.assign(new Node(), { return v.eval(context); })); } - }, + } genCSS(context, output) { let i; @@ -40,6 +41,6 @@ Value.prototype = Object.assign(new Node(), { } } } -}); +} export default Value; diff --git a/packages/less/lib/less/tree/variable-call.js b/packages/less/lib/less/tree/variable-call.js index 0de63aca8..0a5615ed5 100644 --- a/packages/less/lib/less/tree/variable-call.js +++ b/packages/less/lib/less/tree/variable-call.js @@ -4,15 +4,16 @@ import Ruleset from './ruleset.js'; import DetachedRuleset from './detached-ruleset.js'; import LessError from '../less-error.js'; -const VariableCall = function(variable, index, currentFileInfo) { - this.variable = variable; - this._index = index; - this._fileInfo = currentFileInfo; - this.allowRoot = true; -}; +class VariableCall extends Node { + get type() { return 'VariableCall'; } -VariableCall.prototype = Object.assign(new Node(), { - type: 'VariableCall', + constructor(variable, index, currentFileInfo) { + super(); + this.variable = variable; + this._index = index; + this._fileInfo = currentFileInfo; + this.allowRoot = true; + } eval(context) { let rules; @@ -40,6 +41,6 @@ VariableCall.prototype = Object.assign(new Node(), { } throw error; } -}); +} export default VariableCall; diff --git a/packages/less/lib/less/tree/variable.js b/packages/less/lib/less/tree/variable.js index 1a04b0d6d..8bb9b5215 100644 --- a/packages/less/lib/less/tree/variable.js +++ b/packages/less/lib/less/tree/variable.js @@ -1,14 +1,15 @@ import Node from './node.js'; import Call from './call.js'; -const Variable = function(name, index, currentFileInfo) { - this.name = name; - this._index = index; - this._fileInfo = currentFileInfo; -}; +class Variable extends Node { + get type() { return 'Variable'; } -Variable.prototype = Object.assign(new Node(), { - type: 'Variable', + constructor(name, index, currentFileInfo) { + super(); + this.name = name; + this._index = index; + this._fileInfo = currentFileInfo; + } eval(context) { let variable, name = this.name; @@ -51,7 +52,7 @@ Variable.prototype = Object.assign(new Node(), { filename: this.fileInfo().filename, index: this.getIndex() }; } - }, + } find(obj, fun) { for (let i = 0, r; i < obj.length; i++) { @@ -60,6 +61,6 @@ Variable.prototype = Object.assign(new Node(), { } return null; } -}); +} export default Variable; diff --git a/packages/less/lib/less/visitors/set-tree-visibility-visitor.js b/packages/less/lib/less/visitors/set-tree-visibility-visitor.js index 3a713e0ae..8dd90a205 100644 --- a/packages/less/lib/less/visitors/set-tree-visibility-visitor.js +++ b/packages/less/lib/less/visitors/set-tree-visibility-visitor.js @@ -1,12 +1,20 @@ +import Node from '../tree/node.js'; + class SetTreeVisibilityVisitor { + /** @param {boolean} visible */ constructor(visible) { this.visible = visible; } + /** @param {Node} root */ run(root) { this.visit(root); } + /** + * @param {Node[]} nodes + * @returns {Node[]} + */ visitArray(nodes) { if (!nodes) { return nodes; @@ -20,6 +28,10 @@ class SetTreeVisibilityVisitor { return nodes; } + /** + * @param {*} node + * @returns {*} + */ visit(node) { if (!node) { return node; @@ -42,4 +54,4 @@ class SetTreeVisibilityVisitor { } } -export default SetTreeVisibilityVisitor; \ No newline at end of file +export default SetTreeVisibilityVisitor; diff --git a/packages/less/package.json b/packages/less/package.json index 1d5e833ad..3353c82d5 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -72,12 +72,13 @@ "@rollup/plugin-commonjs": "^17.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", + "@types/node": "^18", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", "benny": "^3.6.12", "bootstrap-less-port": "0.3.0", - "chai": "^4.2.0", "c8": "^10.1.3", + "chai": "^4.2.0", "chalk": "^4.1.2", "cosmiconfig": "~9.0.0", "cross-env": "^7.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b29173833..04dfe8f6d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,6 +73,9 @@ importers: '@rollup/plugin-node-resolve': specifier: ^11.0.0 version: 11.2.1(rollup@2.79.2) + '@types/node': + specifier: ^18 + version: 18.19.130 '@typescript-eslint/eslint-plugin': specifier: ^4.28.0 version: 4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@5.9.3) @@ -470,7 +473,7 @@ packages: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 6.0.0 - '@types/node': 25.0.2 + '@types/node': 18.19.130 dev: true /@types/istanbul-lib-coverage@2.0.6: @@ -488,16 +491,16 @@ packages: minimatch: 10.1.1 dev: true - /@types/node@25.0.2: - resolution: {integrity: sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==} + /@types/node@18.19.130: + resolution: {integrity: sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==} dependencies: - undici-types: 7.16.0 + undici-types: 5.26.5 dev: true /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 25.0.2 + '@types/node': 18.19.130 dev: true /@typescript-eslint/eslint-plugin@4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@5.9.3): @@ -5553,8 +5556,8 @@ packages: resolution: {integrity: sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==} dev: true - /undici-types@7.16.0: - resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: true /universalify@0.1.2: From 784dfa9709c7987a3118fd0f536bbec0d4f4f281 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 10 Mar 2026 10:05:55 -0700 Subject: [PATCH 27/76] feat: JSDoc type annotations for all tree node files (#4413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add JSDoc type annotations with @ts-check to all tree node files Add proper JSDoc type annotations to all 44 files in lib/less/tree/, enabling per-file TypeScript checking via @ts-check. No {*} or {any} casts — all types are derived from reading the actual code. Key changes: - Shared types (EvalContext, CSSOutput, TreeVisitor, FileInfo, VisibilityInfo) defined in node.js - Node.value typed as union: Node | Node[] | string | number | undefined - Node.prototype.parse declared for parser-injected prototype property - Constructor properties explicitly declared with proper types - Inline casts used to narrow union types at usage sites - Widened base class params where subclasses pass different types Also adds typecheck to prepublishOnly and pre-commit hook to catch regressions as more files are annotated toward global checkJs: true. All 139 tests pass, zero TypeScript errors. * fix: remove duplicate JSDoc type annotation in ruleset.js --- .husky/pre-commit | 1 + packages/less/lib/less/tree/anonymous.js | 26 +- packages/less/lib/less/tree/assignment.js | 27 +- packages/less/lib/less/tree/atrule-syntax.js | 1 + packages/less/lib/less/tree/atrule.js | 119 ++++-- packages/less/lib/less/tree/attribute.js | 28 +- packages/less/lib/less/tree/call.js | 28 +- packages/less/lib/less/tree/color.js | 59 ++- packages/less/lib/less/tree/combinator.js | 11 +- packages/less/lib/less/tree/comment.js | 25 +- packages/less/lib/less/tree/condition.js | 56 ++- packages/less/lib/less/tree/container.js | 54 ++- packages/less/lib/less/tree/debug-info.js | 30 +- packages/less/lib/less/tree/declaration.js | 59 ++- .../less/lib/less/tree/detached-ruleset.js | 15 + packages/less/lib/less/tree/dimension.js | 60 ++- packages/less/lib/less/tree/element.js | 39 +- packages/less/lib/less/tree/expression.js | 48 ++- packages/less/lib/less/tree/extend.js | 28 +- packages/less/lib/less/tree/import.js | 133 +++++-- packages/less/lib/less/tree/index.js | 7 +- packages/less/lib/less/tree/javascript.js | 22 +- packages/less/lib/less/tree/js-eval-node.js | 30 +- packages/less/lib/less/tree/keyword.js | 10 +- packages/less/lib/less/tree/media.js | 46 ++- packages/less/lib/less/tree/merge-rules.js | 10 +- packages/less/lib/less/tree/mixin-call.js | 112 ++++-- .../less/lib/less/tree/mixin-definition.js | 124 +++++-- .../less/lib/less/tree/namespace-value.js | 43 ++- packages/less/lib/less/tree/negative.js | 19 +- packages/less/lib/less/tree/nested-at-rule.js | 132 +++++-- packages/less/lib/less/tree/node.js | 68 +++- packages/less/lib/less/tree/operation.js | 29 +- packages/less/lib/less/tree/paren.js | 17 +- packages/less/lib/less/tree/property.js | 25 +- .../less/lib/less/tree/query-in-parens.js | 19 +- packages/less/lib/less/tree/quoted.js | 66 +++- packages/less/lib/less/tree/ruleset.js | 342 ++++++++++++++---- packages/less/lib/less/tree/selector.js | 62 +++- .../less/lib/less/tree/unicode-descriptor.js | 2 + packages/less/lib/less/tree/unit.js | 32 +- packages/less/lib/less/tree/url.js | 41 ++- packages/less/lib/less/tree/value.js | 28 +- packages/less/lib/less/tree/variable-call.js | 26 +- packages/less/lib/less/tree/variable.js | 23 +- packages/less/package.json | 4 +- 46 files changed, 1724 insertions(+), 462 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 98475b507..e06089e7e 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,2 @@ +cd packages/less && npm run typecheck && cd ../.. pnpm test diff --git a/packages/less/lib/less/tree/anonymous.js b/packages/less/lib/less/tree/anonymous.js index 977b15638..f87134e54 100644 --- a/packages/less/lib/less/tree/anonymous.js +++ b/packages/less/lib/less/tree/anonymous.js @@ -1,8 +1,18 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, FileInfo, VisibilityInfo } from './node.js' */ import Node from './node.js'; class Anonymous extends Node { get type() { return 'Anonymous'; } + /** + * @param {string | null} value + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {boolean} [mapLines] + * @param {boolean} [rulesetLike] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { super(); this.value = value; @@ -14,22 +24,32 @@ class Anonymous extends Node { this.copyVisibilityInfo(visibilityInfo); } + /** @returns {Anonymous} */ eval() { - return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); + return new Anonymous(/** @type {string | null} */ (this.value), this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); } + /** + * @param {Node} other + * @returns {number | undefined} + */ compare(other) { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; + return other.toCSS && this.toCSS(/** @type {EvalContext} */ ({})) === other.toCSS(/** @type {EvalContext} */ ({})) ? 0 : undefined; } + /** @returns {boolean} */ isRulesetLike() { return this.rulesetLike; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { this.nodeVisible = Boolean(this.value); if (this.nodeVisible) { - output.add(this.value, this._fileInfo, this._index, this.mapLines); + output.add(/** @type {string} */ (this.value), this._fileInfo, this._index, this.mapLines); } } } diff --git a/packages/less/lib/less/tree/assignment.js b/packages/less/lib/less/tree/assignment.js index c53e58c4c..38acb331f 100644 --- a/packages/less/lib/less/tree/assignment.js +++ b/packages/less/lib/less/tree/assignment.js @@ -1,31 +1,46 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor } from './node.js' */ import Node from './node.js'; class Assignment extends Node { get type() { return 'Assignment'; } + /** + * @param {string} key + * @param {Node} val + */ constructor(key, val) { super(); this.key = key; this.value = val; } + /** @param {TreeVisitor} visitor */ accept(visitor) { - this.value = visitor.visit(this.value); + this.value = visitor.visit(/** @type {Node} */ (this.value)); } + /** + * @param {EvalContext} context + * @returns {Assignment} + */ eval(context) { - if (this.value.eval) { - return new Assignment(this.key, this.value.eval(context)); + if (/** @type {Node} */ (this.value).eval) { + return new Assignment(this.key, /** @type {Node} */ (this.value).eval(context)); } return this; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add(`${this.key}=`); - if (this.value.genCSS) { - this.value.genCSS(context, output); + if (/** @type {Node} */ (this.value).genCSS) { + /** @type {Node} */ (this.value).genCSS(context, output); } else { - output.add(this.value); + output.add(/** @type {string} */ (/** @type {unknown} */ (this.value))); } } } diff --git a/packages/less/lib/less/tree/atrule-syntax.js b/packages/less/lib/less/tree/atrule-syntax.js index 0c5decb83..fae273b41 100644 --- a/packages/less/lib/less/tree/atrule-syntax.js +++ b/packages/less/lib/less/tree/atrule-syntax.js @@ -1,3 +1,4 @@ +// @ts-check export const MediaSyntaxOptions = { queryInParens: true }; diff --git a/packages/less/lib/less/tree/atrule.js b/packages/less/lib/less/tree/atrule.js index 4f5343c0a..80787ad65 100644 --- a/packages/less/lib/less/tree/atrule.js +++ b/packages/less/lib/less/tree/atrule.js @@ -1,3 +1,6 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo, VisibilityInfo } from './node.js' */ +/** @import { FunctionRegistry } from './nested-at-rule.js' */ import Node from './node.js'; import Selector from './selector.js'; import Ruleset from './ruleset.js'; @@ -5,9 +8,32 @@ import Anonymous from './anonymous.js'; import NestableAtRulePrototype from './nested-at-rule.js'; import mergeRules from './merge-rules.js'; +/** + * @typedef {Node & { + * rules?: Node[], + * selectors?: Selector[], + * root?: boolean, + * allowImports?: boolean, + * functionRegistry?: FunctionRegistry, + * merge?: boolean, + * debugInfo?: { lineNumber: number, fileName: string }, + * elements?: import('./element.js').default[] + * }} RulesetLikeNode + */ + class AtRule extends Node { get type() { return 'AtRule'; } + /** + * @param {string} [name] + * @param {Node | string} [value] + * @param {Node[] | Ruleset} [rules] + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {{ lineNumber: number, fileName: string }} [debugInfo] + * @param {boolean} [isRooted] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor( name, value, @@ -22,15 +48,22 @@ class AtRule extends Node { let i; var selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); + /** @type {string | undefined} */ this.name = name; this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); + /** @type {boolean | undefined} */ + this.simpleBlock = undefined; + /** @type {RulesetLikeNode[] | undefined} */ + this.declarations = undefined; + /** @type {RulesetLikeNode[] | undefined} */ + this.rules = undefined; if (rules) { if (Array.isArray(rules)) { const allDeclarations = this.declarationsBlock(rules); let allRulesetDeclarations = true; rules.forEach(rule => { - if (rule.type === 'Ruleset' && rule.rules) allRulesetDeclarations = allRulesetDeclarations && this.declarationsBlock(rule.rules, true); + if (rule.type === 'Ruleset' && /** @type {RulesetLikeNode} */ (rule).rules) allRulesetDeclarations = allRulesetDeclarations && this.declarationsBlock(/** @type {Node[]} */ (/** @type {RulesetLikeNode} */ (rule).rules), true); }); if (allDeclarations && !isRooted) { @@ -38,53 +71,65 @@ class AtRule extends Node { this.declarations = rules; } else if (allRulesetDeclarations && rules.length === 1 && !isRooted && !value) { this.simpleBlock = true; - this.declarations = rules[0].rules ? rules[0].rules : rules; + this.declarations = /** @type {RulesetLikeNode} */ (rules[0]).rules ? /** @type {RulesetLikeNode} */ (rules[0]).rules : rules; } else { this.rules = rules; } } else { - const allDeclarations = this.declarationsBlock(rules.rules); + const allDeclarations = this.declarationsBlock(/** @type {Node[]} */ (rules.rules)); if (allDeclarations && !isRooted && !value) { this.simpleBlock = true; this.declarations = rules.rules; } else { this.rules = [rules]; - this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); + /** @type {RulesetLikeNode} */ (this.rules[0]).selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); } } if (!this.simpleBlock) { for (i = 0; i < this.rules.length; i++) { - this.rules[i].allowImports = true; + /** @type {RulesetLikeNode} */ (this.rules[i]).allowImports = true; } } - this.setParent(selectors, this); - this.setParent(this.rules, this); + this.setParent(selectors, /** @type {Node} */ (/** @type {unknown} */ (this))); + this.setParent(this.rules, /** @type {Node} */ (/** @type {unknown} */ (this))); } this._index = index; this._fileInfo = currentFileInfo; + /** @type {{ lineNumber: number, fileName: string } | undefined} */ this.debugInfo = debugInfo; + /** @type {boolean} */ this.isRooted = isRooted || false; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; } + /** + * @param {Node[]} rules + * @param {boolean} [mergeable] + * @returns {boolean} + */ declarationsBlock(rules, mergeable = false) { if (!mergeable) { - return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge}).length === rules.length; + return rules.filter(function (/** @type {Node & { merge?: boolean }} */ node) { return (node.type === 'Declaration' || node.type === 'Comment') && !node.merge}).length === rules.length; } else { - return rules.filter(function (node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length; + return rules.filter(function (/** @type {Node} */ node) { return (node.type === 'Declaration' || node.type === 'Comment'); }).length === rules.length; } } + /** + * @param {Node[]} rules + * @returns {boolean} + */ keywordList(rules) { if (!Array.isArray(rules)) { return false; } else { - return rules.filter(function (node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length; + return rules.filter(function (/** @type {Node} */ node) { return (node.type === 'Keyword' || node.type === 'Comment'); }).length === rules.length; } } + /** @param {TreeVisitor} visitor */ accept(visitor) { const value = this.value, rules = this.rules, declarations = this.declarations; @@ -94,27 +139,32 @@ class AtRule extends Node { this.declarations = visitor.visitArray(declarations); } if (value) { - this.value = visitor.visit(value); + this.value = visitor.visit(/** @type {Node} */ (value)); } } + /** @override @returns {boolean} */ isRulesetLike() { - return this.rules || !this.isCharset(); + return /** @type {boolean} */ (/** @type {unknown} */ (this.rules || !this.isCharset())); } isCharset() { return '@charset' === this.name; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { const value = this.value, rules = this.rules || this.declarations; - output.add(this.name, this.fileInfo(), this.getIndex()); + output.add(/** @type {string} */ (this.name), this.fileInfo(), this.getIndex()); if (value) { output.add(' '); - value.genCSS(context, output); + /** @type {Node} */ (value).genCSS(context, output); } if (this.simpleBlock) { - this.outputRuleset(context, output, this.declarations); + this.outputRuleset(context, output, /** @type {Node[]} */ (this.declarations)); } else if (rules) { this.outputRuleset(context, output, rules); } else { @@ -122,6 +172,10 @@ class AtRule extends Node { } } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations; @@ -134,31 +188,36 @@ class AtRule extends Node { context.mediaBlocks = []; if (value) { - value = value.eval(context); + value = /** @type {Node} */ (value).eval(context); } if (rules) { rules = this.evalRoot(context, rules); } - if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) { - const allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true); + if (Array.isArray(rules) && /** @type {RulesetLikeNode} */ (rules[0]).rules && Array.isArray(/** @type {RulesetLikeNode} */ (rules[0]).rules) && /** @type {Node[]} */ (/** @type {RulesetLikeNode} */ (rules[0]).rules).length) { + const allMergeableDeclarations = this.declarationsBlock(/** @type {Node[]} */ (/** @type {RulesetLikeNode} */ (rules[0]).rules), true); if (allMergeableDeclarations && !this.isRooted && !value) { - mergeRules(rules[0].rules); - rules = rules[0].rules; - rules.forEach(rule => rule.merge = false); + mergeRules(/** @type {Node[]} */ (/** @type {RulesetLikeNode} */ (rules[0]).rules)); + rules = /** @type {RulesetLikeNode[]} */ (/** @type {RulesetLikeNode} */ (rules[0]).rules); + rules.forEach(/** @param {RulesetLikeNode} rule */ rule => { rule.merge = false; }); } } if (this.simpleBlock && rules) { - rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); - rules = rules.map(function (rule) { return rule.eval(context); }); + /** @type {RulesetLikeNode} */ (rules[0]).functionRegistry = /** @type {RulesetLikeNode} */ (context.frames[0]).functionRegistry.inherit(); + rules = rules.map(function (/** @type {Node} */ rule) { return rule.eval(context); }); } // restore media bubbling information context.mediaPath = mediaPathBackup; context.mediaBlocks = mediaBlocksBackup; - return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); + return /** @type {Node} */ (/** @type {unknown} */ (new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()))); } + /** + * @param {EvalContext} context + * @param {Node[]} rules + * @returns {Node[]} + */ evalRoot(context, rules) { let ampersandCount = 0; let noAmpersandCount = 0; @@ -168,10 +227,11 @@ class AtRule extends Node { rules = [rules[0].eval(context)]; } + /** @type {Selector[]} */ let precedingSelectors = []; if (context.frames.length > 0) { for (let index = 0; index < context.frames.length; index++) { - const frame = context.frames[index]; + const frame = /** @type {RulesetLikeNode} */ (context.frames[index]); if ( frame.type === 'Ruleset' && frame.rules && @@ -184,6 +244,7 @@ class AtRule extends Node { if (precedingSelectors.length > 0) { const allAmpersandElements = precedingSelectors.every( sel => sel.elements && sel.elements.length > 0 && sel.elements.every( + /** @param {import('./element.js').default} el */ el => el.value === '&' ) ); @@ -202,11 +263,12 @@ class AtRule extends Node { (this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && noAmpersands) || !mixedAmpersands ) { - rules[0].root = true; + /** @type {RulesetLikeNode} */ (rules[0]).root = true; } return rules; } + /** @param {string} name */ variable(name) { if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule @@ -228,6 +290,11 @@ class AtRule extends Node { } } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + * @param {Node[]} rules + */ outputRuleset(context, output, rules) { const ruleCnt = rules.length; let i; diff --git a/packages/less/lib/less/tree/attribute.js b/packages/less/lib/less/tree/attribute.js index da3ea2006..52dbcebbf 100644 --- a/packages/less/lib/less/tree/attribute.js +++ b/packages/less/lib/less/tree/attribute.js @@ -1,8 +1,16 @@ +// @ts-check +/** @import { EvalContext, CSSOutput } from './node.js' */ import Node from './node.js'; class Attribute extends Node { get type() { return 'Attribute'; } + /** + * @param {string | Node} key + * @param {string} op + * @param {string | Node} value + * @param {string} cif + */ constructor(key, op, value, cif) { super(); this.key = key; @@ -11,25 +19,37 @@ class Attribute extends Node { this.cif = cif; } + /** + * @param {EvalContext} context + * @returns {Attribute} + */ eval(context) { return new Attribute( - this.key.eval ? this.key.eval(context) : this.key, + /** @type {Node} */ (this.key).eval ? /** @type {Node} */ (this.key).eval(context) : /** @type {string} */ (this.key), this.op, - (this.value && this.value.eval) ? this.value.eval(context) : this.value, + (this.value && /** @type {Node} */ (this.value).eval) ? /** @type {Node} */ (this.value).eval(context) : this.value, this.cif ); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add(this.toCSS(context)); } + /** + * @param {EvalContext} context + * @returns {string} + */ toCSS(context) { - let value = this.key.toCSS ? this.key.toCSS(context) : this.key; + let value = /** @type {Node} */ (this.key).toCSS ? /** @type {Node} */ (this.key).toCSS(context) : /** @type {string} */ (this.key); if (this.op) { value += this.op; - value += (this.value.toCSS ? this.value.toCSS(context) : this.value); + value += (/** @type {Node} */ (this.value).toCSS ? /** @type {Node} */ (this.value).toCSS(context) : /** @type {string} */ (this.value)); } if (this.cif) { diff --git a/packages/less/lib/less/tree/call.js b/packages/less/lib/less/tree/call.js index 1f54afbda..ceaac8746 100644 --- a/packages/less/lib/less/tree/call.js +++ b/packages/less/lib/less/tree/call.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo } from './node.js' */ import Node from './node.js'; import Anonymous from './anonymous.js'; import FunctionCaller from '../functions/function-caller.js'; @@ -8,6 +10,12 @@ import FunctionCaller from '../functions/function-caller.js'; class Call extends Node { get type() { return 'Call'; } + /** + * @param {string} name + * @param {Node[]} args + * @param {number} index + * @param {FileInfo} currentFileInfo + */ constructor(name, args, index, currentFileInfo) { super(); this.name = name; @@ -17,6 +25,7 @@ class Call extends Node { this._fileInfo = currentFileInfo; } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.args) { this.args = visitor.visitArray(this.args); @@ -34,6 +43,10 @@ class Call extends Node { // we try to pass a variable to a function, like: `saturate(@color)`. // The function should receive the value, not the variable. // + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { /** * Turn off math for calc(), and switch back on for evaluating nested functions @@ -51,6 +64,7 @@ class Call extends Node { context.mathOn = currentMathContext; }; + /** @type {Node | string | boolean | null | undefined} */ let result; const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo()); @@ -60,16 +74,16 @@ class Call extends Node { exitCalc(); } catch (e) { // eslint-disable-next-line no-prototype-builtins - if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) { + if (/** @type {Record} */ (e).hasOwnProperty('line') && /** @type {Record} */ (e).hasOwnProperty('column')) { throw e; } throw { - type: e.type || 'Runtime', - message: `Error evaluating function \`${this.name}\`${e.message ? `: ${e.message}` : ''}`, + type: /** @type {Record} */ (e).type || 'Runtime', + message: `Error evaluating function \`${this.name}\`${/** @type {Error} */ (e).message ? `: ${/** @type {Error} */ (e).message}` : ''}`, index: this.getIndex(), filename: this.fileInfo().filename, - line: e.lineNumber, - column: e.columnNumber + line: /** @type {Record} */ (e).lineNumber, + column: /** @type {Record} */ (e).columnNumber }; } } @@ -97,6 +111,10 @@ class Call extends Node { return new Call(this.name, args, this.getIndex(), this.fileInfo()); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add(`${this.name}(`, this.fileInfo(), this.getIndex()); diff --git a/packages/less/lib/less/tree/color.js b/packages/less/lib/less/tree/color.js index 6b66b7543..bf5f1c687 100644 --- a/packages/less/lib/less/tree/color.js +++ b/packages/less/lib/less/tree/color.js @@ -1,12 +1,20 @@ +// @ts-check import Node from './node.js'; import colors from '../data/colors.js'; +/** @import { EvalContext, CSSOutput } from './node.js' */ + // // RGB Colors - #ff0014, #eee // class Color extends Node { get type() { return 'Color'; } + /** + * @param {number[] | string} rgb + * @param {number} [a] + * @param {string} [originalForm] + */ constructor(rgb, a, originalForm) { super(); const self = this; @@ -17,10 +25,12 @@ class Color extends Node { // This facilitates operations and conversions. // if (Array.isArray(rgb)) { + /** @type {number[]} */ this.rgb = rgb; } else if (rgb.length >= 6) { + /** @type {number[]} */ this.rgb = []; - rgb.match(/.{2}/g).map(function (c, i) { + /** @type {RegExpMatchArray} */ (rgb.match(/.{2}/g)).map(function (c, i) { if (i < 3) { self.rgb.push(parseInt(c, 16)); } else { @@ -28,6 +38,7 @@ class Color extends Node { } }); } else { + /** @type {number[]} */ this.rgb = []; rgb.split('').map(function (c, i) { if (i < 3) { @@ -37,6 +48,7 @@ class Color extends Node { } }); } + /** @type {number} */ this.alpha = this.alpha || (typeof a === 'number' ? a : 1); if (typeof originalForm !== 'undefined') { this.value = originalForm; @@ -53,15 +65,26 @@ class Color extends Node { return 0.2126 * r + 0.7152 * g + 0.0722 * b; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add(this.toCSS(context)); } + /** + * @param {EvalContext} context + * @param {boolean} [doNotCompress] + * @returns {string} + */ toCSS(context, doNotCompress) { const compress = context && context.compress && !doNotCompress; let color; let alpha; + /** @type {string | undefined} */ let colorFunction; + /** @type {(string | number)[]} */ let args = []; // `value` is set if this color was originally @@ -70,18 +93,18 @@ class Color extends Node { alpha = this.fround(context, this.alpha); if (this.value) { - if (this.value.indexOf('rgb') === 0) { + if (/** @type {string} */ (this.value).indexOf('rgb') === 0) { if (alpha < 1) { colorFunction = 'rgba'; } - } else if (this.value.indexOf('hsl') === 0) { + } else if (/** @type {string} */ (this.value).indexOf('hsl') === 0) { if (alpha < 1) { colorFunction = 'hsla'; } else { colorFunction = 'hsl'; } } else { - return this.value; + return /** @type {string} */ (this.value); } } else { if (alpha < 1) { @@ -132,6 +155,11 @@ class Color extends Node { // our result, in the form of an integer triplet, // we create a new Color node to hold the result. // + /** + * @param {EvalContext} context + * @param {string} op + * @param {Color} other + */ operate(context, op, other) { const rgb = new Array(3); const alpha = this.alpha * (1 - other.alpha) + other.alpha; @@ -149,6 +177,7 @@ class Color extends Node { const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; const max = Math.max(r, g, b), min = Math.min(r, g, b); + /** @type {number} */ let h; let s; const l = (max + min) / 2; @@ -164,9 +193,9 @@ class Color extends Node { case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } - h /= 6; + /** @type {number} */ (h) /= 6; } - return { h: h * 360, s, l, a }; + return { h: /** @type {number} */ (h) * 360, s, l, a }; } // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript @@ -174,6 +203,7 @@ class Color extends Node { const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha; const max = Math.max(r, g, b), min = Math.min(r, g, b); + /** @type {number} */ let h; let s; const v = max; @@ -193,15 +223,19 @@ class Color extends Node { case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } - h /= 6; + /** @type {number} */ (h) /= 6; } - return { h: h * 360, s, v, a }; + return { h: /** @type {number} */ (h) * 360, s, v, a }; } toARGB() { return toHex([this.alpha * 255].concat(this.rgb)); } + /** + * @param {Node & { rgb?: number[], alpha?: number }} x + * @returns {0 | undefined} + */ compare(x) { return (x.rgb && x.rgb[0] === this.rgb[0] && @@ -210,12 +244,14 @@ class Color extends Node { x.alpha === this.alpha) ? 0 : undefined; } + /** @param {string} keyword */ static fromKeyword(keyword) { + /** @type {Color | undefined} */ let c; const key = keyword.toLowerCase(); // eslint-disable-next-line no-prototype-builtins if (colors.hasOwnProperty(key)) { - c = new Color(colors[key].slice(1)); + c = new Color(/** @type {string} */ (colors[/** @type {keyof typeof colors} */ (key)]).slice(1)); } else if (key === 'transparent') { c = new Color([0, 0, 0], 0); @@ -228,10 +264,15 @@ class Color extends Node { } } +/** + * @param {number} v + * @param {number} max + */ function clamp(v, max) { return Math.min(Math.max(v, 0), max); } +/** @param {number[]} v */ function toHex(v) { return `#${v.map(function (c) { c = clamp(Math.round(c), 255); diff --git a/packages/less/lib/less/tree/combinator.js b/packages/less/lib/less/tree/combinator.js index 03b39b41a..b171c553a 100644 --- a/packages/less/lib/less/tree/combinator.js +++ b/packages/less/lib/less/tree/combinator.js @@ -1,5 +1,9 @@ +// @ts-check import Node from './node.js'; +/** @import { EvalContext, CSSOutput } from './node.js' */ + +/** @type {Record} */ const _noSpaceCombinators = { '': true, ' ': true, @@ -9,6 +13,7 @@ const _noSpaceCombinators = { class Combinator extends Node { get type() { return 'Combinator'; } + /** @param {string} value */ constructor(value) { super(); if (value === ' ') { @@ -20,8 +25,12 @@ class Combinator extends Node { } } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { - const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' '; + const spaceOrEmpty = (context.compress || _noSpaceCombinators[/** @type {string} */ (this.value)]) ? '' : ' '; output.add(spaceOrEmpty + this.value + spaceOrEmpty); } } diff --git a/packages/less/lib/less/tree/comment.js b/packages/less/lib/less/tree/comment.js index 730904c81..d99850bb9 100644 --- a/packages/less/lib/less/tree/comment.js +++ b/packages/less/lib/less/tree/comment.js @@ -1,9 +1,18 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, FileInfo } from './node.js' */ +/** @import { DebugInfoContext } from './debug-info.js' */ import Node from './node.js'; import getDebugInfo from './debug-info.js'; class Comment extends Node { get type() { return 'Comment'; } + /** + * @param {string} value + * @param {boolean} isLineComment + * @param {number} index + * @param {FileInfo} currentFileInfo + */ constructor(value, isLineComment, index, currentFileInfo) { super(); this.value = value; @@ -11,17 +20,27 @@ class Comment extends Node { this._index = index; this._fileInfo = currentFileInfo; this.allowRoot = true; + /** @type {{ lineNumber: number, fileName: string } | undefined} */ + this.debugInfo = undefined; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { if (this.debugInfo) { - output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex()); + output.add(getDebugInfo(context, /** @type {DebugInfoContext} */ (this)), this.fileInfo(), this.getIndex()); } - output.add(this.value); + output.add(/** @type {string} */ (this.value)); } + /** + * @param {EvalContext} context + * @returns {boolean} + */ isSilent(context) { - const isCompressed = context.compress && this.value[2] !== '!'; + const isCompressed = context.compress && /** @type {string} */ (this.value)[2] !== '!'; return this.isLineComment || isCompressed; } } diff --git a/packages/less/lib/less/tree/condition.js b/packages/less/lib/less/tree/condition.js index 69eb351a7..0637a3eb9 100644 --- a/packages/less/lib/less/tree/condition.js +++ b/packages/less/lib/less/tree/condition.js @@ -1,8 +1,17 @@ +// @ts-check +/** @import { EvalContext, TreeVisitor } from './node.js' */ import Node from './node.js'; class Condition extends Node { get type() { return 'Condition'; } + /** + * @param {string} op + * @param {Node} l + * @param {Node} r + * @param {number} i + * @param {boolean} negate + */ constructor(op, l, r, i, negate) { super(); this.op = op.trim(); @@ -12,29 +21,42 @@ class Condition extends Node { this.negate = negate; } + /** @param {TreeVisitor} visitor */ accept(visitor) { this.lvalue = visitor.visit(this.lvalue); this.rvalue = visitor.visit(this.rvalue); } + /** + * @param {EvalContext} context + * @returns {boolean} + * @suppress {checkTypes} + */ + // @ts-ignore - Condition.eval returns boolean, not Node (used as guard condition) eval(context) { - const result = (function (op, a, b) { - switch (op) { - case 'and': return a && b; - case 'or': return a || b; - default: - switch (Node.compare(a, b)) { - case -1: - return op === '<' || op === '=<' || op === '<='; - case 0: - return op === '=' || op === '>=' || op === '=<' || op === '<='; - case 1: - return op === '>' || op === '>='; - default: - return false; - } - } - })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); + const a = this.lvalue.eval(context); + const b = this.rvalue.eval(context); + /** @type {boolean} */ + let result; + + switch (this.op) { + case 'and': result = Boolean(a && b); break; + case 'or': result = Boolean(a || b); break; + default: + switch (Node.compare(a, b)) { + case -1: + result = this.op === '<' || this.op === '=<' || this.op === '<='; + break; + case 0: + result = this.op === '=' || this.op === '>=' || this.op === '=<' || this.op === '<='; + break; + case 1: + result = this.op === '>' || this.op === '>='; + break; + default: + result = false; + } + } return this.negate ? !result : result; } diff --git a/packages/less/lib/less/tree/container.js b/packages/less/lib/less/tree/container.js index 9e19bea4a..3d317ba87 100644 --- a/packages/less/lib/less/tree/container.js +++ b/packages/less/lib/less/tree/container.js @@ -1,12 +1,31 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, FileInfo, VisibilityInfo } from './node.js' */ +/** @import { FunctionRegistry, NestableAtRuleThis } from './nested-at-rule.js' */ +import Node from './node.js'; import Ruleset from './ruleset.js'; import Value from './value.js'; import Selector from './selector.js'; import AtRule from './atrule.js'; import NestableAtRulePrototype from './nested-at-rule.js'; +/** + * @typedef {Ruleset & { + * allowImports?: boolean, + * debugInfo?: { lineNumber: number, fileName: string }, + * functionRegistry?: FunctionRegistry + * }} RulesetWithExtras + */ + class Container extends AtRule { get type() { return 'Container'; } + /** + * @param {Node[] | null} value + * @param {Node[]} features + * @param {number} index + * @param {FileInfo} currentFileInfo + * @param {VisibilityInfo} visibilityInfo + */ constructor(value, features, index, currentFileInfo, visibilityInfo) { super(); this._index = index; @@ -14,25 +33,38 @@ class Container extends AtRule { const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); + /** @type {Value} */ this.features = new Value(features); + /** @type {RulesetWithExtras[]} */ this.rules = [new Ruleset(selectors, value)]; this.rules[0].allowImports = true; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); + this.setParent(selectors, /** @type {Node} */ (/** @type {unknown} */ (this))); + this.setParent(this.features, /** @type {Node} */ (/** @type {unknown} */ (this))); + this.setParent(this.rules, /** @type {Node} */ (/** @type {unknown} */ (this))); + + /** @type {boolean | undefined} */ + this._evaluated = undefined; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add('@container ', this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { if (this._evaluated) { - return this; + return /** @type {Node} */ (/** @type {unknown} */ (this)); } if (!context.mediaBlocks) { context.mediaBlocks = []; @@ -46,20 +78,20 @@ class Container extends AtRule { media.debugInfo = this.debugInfo; } - media.features = this.features.eval(context); + media.features = /** @type {Value} */ (this.features.eval(context)); - context.mediaPath.push(media); - context.mediaBlocks.push(media); + context.mediaPath.push(/** @type {Node} */ (/** @type {unknown} */ (media))); + context.mediaBlocks.push(/** @type {Node} */ (/** @type {unknown} */ (media))); - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); + this.rules[0].functionRegistry = /** @type {RulesetWithExtras} */ (context.frames[0]).functionRegistry.inherit(); context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; + media.rules = [/** @type {RulesetWithExtras} */ (this.rules[0].eval(context))]; context.frames.shift(); context.mediaPath.pop(); - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); + return context.mediaPath.length === 0 ? /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (media)).evalTop(context) : + /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (media)).evalNested(context); } } diff --git a/packages/less/lib/less/tree/debug-info.js b/packages/less/lib/less/tree/debug-info.js index b8224e577..6c2c34fee 100644 --- a/packages/less/lib/less/tree/debug-info.js +++ b/packages/less/lib/less/tree/debug-info.js @@ -1,8 +1,21 @@ +// @ts-check + +/** + * @typedef {object} DebugInfoData + * @property {number} lineNumber + * @property {string} fileName + */ + +/** + * @typedef {object} DebugInfoContext + * @property {DebugInfoData} debugInfo + */ + /** * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead. * This will be removed in a future version. - * - * @param {Object} ctx - Context object with debugInfo + * + * @param {DebugInfoContext} ctx - Context object with debugInfo * @returns {string} Debug info as CSS comment */ function asComment(ctx) { @@ -14,8 +27,8 @@ function asComment(ctx) { * This function generates Sass-compatible debug info using @media -sass-debug-info syntax. * This format had short-lived usage and is no longer recommended. * This will be removed in a future version. - * - * @param {Object} ctx - Context object with debugInfo + * + * @param {DebugInfoContext} ctx - Context object with debugInfo * @returns {string} Sass-compatible debug info as @media query */ function asMediaQuery(ctx) { @@ -33,12 +46,12 @@ function asMediaQuery(ctx) { /** * Generates debug information (line numbers) for CSS output. - * - * @param {Object} context - Context object with dumpLineNumbers option - * @param {Object} ctx - Context object with debugInfo + * + * @param {{ dumpLineNumbers?: string, compress?: boolean }} context - Context object with dumpLineNumbers option + * @param {DebugInfoContext} ctx - Context object with debugInfo * @param {string} [lineSeparator] - Separator between comment and media query (for 'all' mode) * @returns {string} Debug info string - * + * * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead. * All modes ('comments', 'mediaquery', 'all') are deprecated and will be removed in a future version. * The 'mediaquery' and 'all' modes generate Sass-compatible @media -sass-debug-info output @@ -63,4 +76,3 @@ function debugInfo(context, ctx, lineSeparator) { } export default debugInfo; - diff --git a/packages/less/lib/less/tree/declaration.js b/packages/less/lib/less/tree/declaration.js index 37552d5e8..caff4d56a 100644 --- a/packages/less/lib/less/tree/declaration.js +++ b/packages/less/lib/less/tree/declaration.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, FileInfo } from './node.js' */ import Node from './node.js'; import Value from './value.js'; import Keyword from './keyword.js'; @@ -5,11 +7,17 @@ import Anonymous from './anonymous.js'; import * as Constants from '../constants.js'; const MATH = Constants.Math; +/** + * @param {EvalContext} context + * @param {Node[]} name + * @returns {string} + */ function evalName(context, name) { let value = ''; let i; const n = name.length; - const output = {add: function (s) {value += s;}}; + /** @type {CSSOutput} */ + const output = {add: function (s) {value += s;}, isEmpty: function() { return value === ''; }}; for (i = 0; i < n; i++) { name[i].eval(context).genCSS(context, output); } @@ -19,41 +27,61 @@ function evalName(context, name) { class Declaration extends Node { get type() { return 'Declaration'; } + /** + * @param {string | Node[]} name + * @param {Node | string | null} value + * @param {string} [important] + * @param {string} [merge] + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {boolean} [inline] + * @param {boolean} [variable] + */ constructor(name, value, important, merge, index, currentFileInfo, inline, variable) { super(); this.name = name; this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); this.important = important ? ` ${important.trim()}` : ''; + /** @type {string | undefined} */ this.merge = merge; this._index = index; this._fileInfo = currentFileInfo; + /** @type {boolean} */ this.inline = inline || false; + /** @type {boolean} */ this.variable = (variable !== undefined) ? variable - : (name.charAt && (name.charAt(0) === '@')); + : (typeof name === 'string' && name.charAt(0) === '@'); + /** @type {boolean} */ this.allowRoot = true; this.setParent(this.value, this); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { - output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); + output.add(/** @type {string} */ (this.name) + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); try { - this.value.genCSS(context, output); + /** @type {Node} */ (this.value).genCSS(context, output); } catch (e) { - e.index = this._index; - e.filename = this._fileInfo.filename; + const err = /** @type {{ index?: number, filename?: string }} */ (e); + err.index = this._index; + err.filename = this._fileInfo && this._fileInfo.filename; throw e; } output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index); } + /** @param {EvalContext} context */ eval(context) { let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable; if (typeof name !== 'string') { // expand 'primitive' name directly to get // things faster (~10% for benchmark.less): - name = (name.length === 1) && (name[0] instanceof Keyword) ? - name[0].value : evalName(context, name); + name = (/** @type {Node[]} */ (name).length === 1) && (/** @type {Node[]} */ (name)[0] instanceof Keyword) ? + /** @type {string} */ (/** @type {Node[]} */ (name)[0].value) : evalName(context, /** @type {Node[]} */ (name)); variable = false; // never treat expanded interpolation as new variable name } @@ -65,7 +93,7 @@ class Declaration extends Node { } try { context.importantScope.push({}); - evaldValue = this.value.eval(context); + evaldValue = /** @type {Node} */ (this.value).eval(context); if (!this.variable && evaldValue.type === 'DetachedRuleset') { throw { message: 'Rulesets cannot be evaluated on a property.', @@ -73,11 +101,11 @@ class Declaration extends Node { } let important = this.important; const importantResult = context.importantScope.pop(); - if (!important && importantResult.important) { + if (!important && importantResult && importantResult.important) { important = importantResult.important; } - return new Declaration(name, + return new Declaration(/** @type {string} */ (name), evaldValue, important, this.merge, @@ -85,9 +113,10 @@ class Declaration extends Node { variable); } catch (e) { - if (typeof e.index !== 'number') { - e.index = this.getIndex(); - e.filename = this.fileInfo().filename; + const err = /** @type {{ index?: number, filename?: string }} */ (e); + if (typeof err.index !== 'number') { + err.index = this.getIndex(); + err.filename = this.fileInfo().filename; } throw e; } @@ -100,7 +129,7 @@ class Declaration extends Node { makeImportant() { return new Declaration(this.name, - this.value, + /** @type {Node} */ (this.value), '!important', this.merge, this.getIndex(), this.fileInfo(), this.inline); diff --git a/packages/less/lib/less/tree/detached-ruleset.js b/packages/less/lib/less/tree/detached-ruleset.js index 0f4327941..439bbfa20 100644 --- a/packages/less/lib/less/tree/detached-ruleset.js +++ b/packages/less/lib/less/tree/detached-ruleset.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, TreeVisitor } from './node.js' */ import Node from './node.js'; import contexts from '../contexts.js'; import * as utils from '../utils.js'; @@ -5,6 +7,10 @@ import * as utils from '../utils.js'; class DetachedRuleset extends Node { get type() { return 'DetachedRuleset'; } + /** + * @param {Node} ruleset + * @param {Node[]} [frames] + */ constructor(ruleset, frames) { super(); this.ruleset = ruleset; @@ -13,15 +19,24 @@ class DetachedRuleset extends Node { this.setParent(this.ruleset, this); } + /** @param {TreeVisitor} visitor */ accept(visitor) { this.ruleset = visitor.visit(this.ruleset); } + /** + * @param {EvalContext} context + * @returns {DetachedRuleset} + */ eval(context) { const frames = this.frames || utils.copyArray(context.frames); return new DetachedRuleset(this.ruleset, frames); } + /** + * @param {EvalContext} context + * @returns {Node} + */ callEval(context) { return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); } diff --git a/packages/less/lib/less/tree/dimension.js b/packages/less/lib/less/tree/dimension.js index 7811d6bc5..18815d899 100644 --- a/packages/less/lib/less/tree/dimension.js +++ b/packages/less/lib/less/tree/dimension.js @@ -1,46 +1,64 @@ +// @ts-check /* eslint-disable no-prototype-builtins */ import Node from './node.js'; import unitConversions from '../data/unit-conversions.js'; import Unit from './unit.js'; import Color from './color.js'; +/** @import { EvalContext, CSSOutput } from './node.js' */ + // // A number with a unit // class Dimension extends Node { get type() { return 'Dimension'; } + /** + * @param {number | string} value + * @param {Unit | string} [unit] + */ constructor(value, unit) { super(); - this.value = parseFloat(value); + /** @type {number} */ + this.value = parseFloat(/** @type {string} */ (value)); if (isNaN(this.value)) { throw new Error('Dimension is not a number.'); } + /** @type {Unit} */ this.unit = (unit && unit instanceof Unit) ? unit : - new Unit(unit ? [unit] : undefined); + new Unit(unit ? [/** @type {string} */ (unit)] : undefined); this.setParent(this.unit, this); } + /** + * @param {import('./node.js').TreeVisitor} visitor + */ accept(visitor) { - this.unit = visitor.visit(this.unit); + this.unit = /** @type {Unit} */ (visitor.visit(this.unit)); } // remove when Nodes have JSDoc types // eslint-disable-next-line no-unused-vars + /** @param {EvalContext} context */ eval(context) { return this; } toColor() { - return new Color([this.value, this.value, this.value]); + const v = /** @type {number} */ (this.value); + return new Color([v, v, v]); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { if ((context && context.strictUnits) && !this.unit.isSingular()) { throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`); } - const value = this.fround(context, this.value); + const value = this.fround(context, /** @type {number} */ (this.value)); let strValue = String(value); if (value !== 0 && value < 0.000001 && value > -0.000001) { @@ -68,9 +86,14 @@ class Dimension extends Node { // In an operation between two Dimensions, // we default to the first Dimension's unit, // so `1px + 2` will yield `3px`. + /** + * @param {EvalContext} context + * @param {string} op + * @param {Dimension} other + */ operate(context, op, other) { /* jshint noempty:false */ - let value = this._operate(context, op, this.value, other.value); + let value = this._operate(context, op, /** @type {number} */ (this.value), /** @type {number} */ (other.value)); let unit = this.unit.clone(); if (op === '+' || op === '-') { @@ -89,7 +112,7 @@ class Dimension extends Node { + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`); } - value = this._operate(context, op, this.value, other.value); + value = this._operate(context, op, /** @type {number} */ (this.value), /** @type {number} */ (other.value)); } } else if (op === '*') { unit.numerator = unit.numerator.concat(other.unit.numerator).sort(); @@ -100,9 +123,13 @@ class Dimension extends Node { unit.denominator = unit.denominator.concat(other.unit.numerator).sort(); unit.cancel(); } - return new Dimension(value, unit); + return new Dimension(/** @type {number} */ (value), unit); } + /** + * @param {Node} other + * @returns {number | undefined} + */ compare(other) { let a, b; @@ -121,26 +148,35 @@ class Dimension extends Node { } } - return Node.numericCompare(a.value, b.value); + return Node.numericCompare(/** @type {number} */ (a.value), /** @type {number} */ (b.value)); } unify() { return this.convertTo({ length: 'px', duration: 's', angle: 'rad' }); } + /** + * @param {string | { [groupName: string]: string }} conversions + * @returns {Dimension} + */ convertTo(conversions) { - let value = this.value; + let value = /** @type {number} */ (this.value); const unit = this.unit.clone(); let i; + /** @type {string} */ let groupName; + /** @type {{ [unitName: string]: number }} */ let group; + /** @type {string} */ let targetUnit; + /** @type {{ [groupName: string]: string }} */ let derivedConversions = {}; + /** @type {(atomicUnit: string, denominator: boolean) => string} */ let applyUnit; if (typeof conversions === 'string') { for (i in unitConversions) { - if (unitConversions[i].hasOwnProperty(conversions)) { + if (unitConversions[/** @type {keyof typeof unitConversions} */ (i)].hasOwnProperty(conversions)) { derivedConversions = {}; derivedConversions[i] = conversions; } @@ -164,7 +200,7 @@ class Dimension extends Node { for (groupName in conversions) { if (conversions.hasOwnProperty(groupName)) { targetUnit = conversions[groupName]; - group = unitConversions[groupName]; + group = /** @type {{ [unitName: string]: number }} */ (unitConversions[/** @type {keyof typeof unitConversions} */ (groupName)]); unit.map(applyUnit); } diff --git a/packages/less/lib/less/tree/element.js b/packages/less/lib/less/tree/element.js index 880d3dc69..d93bf5665 100644 --- a/packages/less/lib/less/tree/element.js +++ b/packages/less/lib/less/tree/element.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo, VisibilityInfo } from './node.js' */ import Node from './node.js'; import Paren from './paren.js'; import Combinator from './combinator.js'; @@ -5,6 +7,14 @@ import Combinator from './combinator.js'; class Element extends Node { get type() { return 'Element'; } + /** + * @param {Combinator | string} combinator + * @param {string | Node} value + * @param {boolean} [isVariable] + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { super(); this.combinator = combinator instanceof Combinator ? @@ -17,6 +27,7 @@ class Element extends Node { } else { this.value = ''; } + /** @type {boolean | undefined} */ this.isVariable = isVariable; this._index = index; this._fileInfo = currentFileInfo; @@ -24,17 +35,19 @@ class Element extends Node { this.setParent(this.combinator, this); } + /** @param {TreeVisitor} visitor */ accept(visitor) { const value = this.value; - this.combinator = visitor.visit(this.combinator); + this.combinator = /** @type {Combinator} */ (visitor.visit(this.combinator)); if (typeof value === 'object') { - this.value = visitor.visit(value); + this.value = visitor.visit(/** @type {Node} */ (value)); } } + /** @param {EvalContext} context */ eval(context) { return new Element(this.combinator, - this.value.eval ? this.value.eval(context) : this.value, + /** @type {Node} */ (this.value).eval ? /** @type {Node} */ (this.value).eval(context) : /** @type {string} */ (this.value), this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); @@ -42,31 +55,37 @@ class Element extends Node { clone() { return new Element(this.combinator, - this.value, + /** @type {string | Node} */ (this.value), this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); } + /** @param {EvalContext} [context] */ toCSS(context) { - context = context || {}; + /** @type {EvalContext & { firstSelector?: boolean }} */ + const ctx = context || {}; let value = this.value; - const firstSelector = context.firstSelector; + const firstSelector = ctx.firstSelector; if (value instanceof Paren) { // selector in parens should not be affected by outer selector // flags (breaks only interpolated selectors - see #1973) - context.firstSelector = true; + ctx.firstSelector = true; } - value = value.toCSS ? value.toCSS(context) : value; - context.firstSelector = firstSelector; + value = /** @type {Node} */ (value).toCSS ? /** @type {Node} */ (value).toCSS(ctx) : /** @type {string} */ (value); + ctx.firstSelector = firstSelector; if (value === '' && this.combinator.value.charAt(0) === '&') { return ''; } else { - return this.combinator.toCSS(context) + value; + return this.combinator.toCSS(ctx) + value; } } } diff --git a/packages/less/lib/less/tree/expression.js b/packages/less/lib/less/tree/expression.js index e2ff11c57..1f748ec15 100644 --- a/packages/less/lib/less/tree/expression.js +++ b/packages/less/lib/less/tree/expression.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor } from './node.js' */ import Node from './node.js'; import Paren from './paren.js'; import Comment from './comment.js'; @@ -7,21 +9,33 @@ import Anonymous from './anonymous.js'; class Expression extends Node { get type() { return 'Expression'; } + /** + * @param {Node[]} value + * @param {boolean} [noSpacing] + */ constructor(value, noSpacing) { super(); this.value = value; + /** @type {boolean | undefined} */ this.noSpacing = noSpacing; + /** @type {boolean | undefined} */ + this.parens = undefined; + /** @type {boolean | undefined} */ + this.parensInOp = undefined; if (!value) { throw new Error('Expression requires an array parameter'); } } + /** @param {TreeVisitor} visitor */ accept(visitor) { - this.value = visitor.visitArray(this.value); + this.value = visitor.visitArray(/** @type {Node[]} */ (this.value)); } + /** @param {EvalContext} context */ eval(context) { const noSpacing = this.noSpacing; + /** @type {Node | Expression} */ let returnValue; const mathOn = context.isMathOn(); const inParenthesis = this.parens; @@ -30,18 +44,20 @@ class Expression extends Node { if (inParenthesis) { context.inParenthesis(); } - if (this.value.length > 1) { - returnValue = new Expression(this.value.map(function (e) { + const value = /** @type {Node[]} */ (this.value); + if (value.length > 1) { + returnValue = new Expression(value.map(function (e) { if (!e.eval) { return e; } return e.eval(context); }), this.noSpacing); - } else if (this.value.length === 1) { - if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) { + } else if (value.length === 1) { + const first = /** @type {Expression} */ (value[0]); + if (first.parens && !first.parensInOp && !context.inCalc) { doubleParen = true; } - returnValue = this.value[0].eval(context); + returnValue = value[0].eval(context); } else { returnValue = this; } @@ -52,16 +68,22 @@ class Expression extends Node { && (!(returnValue instanceof Dimension))) { returnValue = new Paren(returnValue); } - returnValue.noSpacing = returnValue.noSpacing || noSpacing; + /** @type {Expression} */ (returnValue).noSpacing = + /** @type {Expression} */ (returnValue).noSpacing || noSpacing; return returnValue; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { - for (let i = 0; i < this.value.length; i++) { - this.value[i].genCSS(context, output); - if (!this.noSpacing && i + 1 < this.value.length) { - if (!(this.value[i + 1] instanceof Anonymous) || - this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') { + const value = /** @type {Node[]} */ (this.value); + for (let i = 0; i < value.length; i++) { + value[i].genCSS(context, output); + if (!this.noSpacing && i + 1 < value.length) { + if (!(value[i + 1] instanceof Anonymous) || + value[i + 1] instanceof Anonymous && /** @type {string} */ (value[i + 1].value) !== ',') { output.add(' '); } } @@ -69,7 +91,7 @@ class Expression extends Node { } throwAwayComments() { - this.value = this.value.filter(function(v) { + this.value = /** @type {Node[]} */ (this.value).filter(function(v) { return !(v instanceof Comment); }); } diff --git a/packages/less/lib/less/tree/extend.js b/packages/less/lib/less/tree/extend.js index 59f8de370..59aa4e680 100644 --- a/packages/less/lib/less/tree/extend.js +++ b/packages/less/lib/less/tree/extend.js @@ -1,19 +1,34 @@ +// @ts-check +/** @import { EvalContext, TreeVisitor, FileInfo, VisibilityInfo } from './node.js' */ import Node from './node.js'; import Selector from './selector.js'; class Extend extends Node { get type() { return 'Extend'; } + /** + * @param {Selector} selector + * @param {string} option + * @param {number} index + * @param {FileInfo} currentFileInfo + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(selector, option, index, currentFileInfo, visibilityInfo) { super(); this.selector = selector; this.option = option; this.object_id = Extend.next_id++; + /** @type {number[]} */ this.parent_ids = [this.object_id]; this._index = index; this._fileInfo = currentFileInfo; this.copyVisibilityInfo(visibilityInfo); + /** @type {boolean} */ this.allowRoot = true; + /** @type {boolean} */ + this.allowBefore = false; + /** @type {boolean} */ + this.allowAfter = false; switch (option) { case '!all': @@ -29,23 +44,29 @@ class Extend extends Node { this.setParent(this.selector, this); } + /** @param {TreeVisitor} visitor */ accept(visitor) { - this.selector = visitor.visit(this.selector); + this.selector = /** @type {Selector} */ (visitor.visit(this.selector)); } + /** @param {EvalContext} context */ eval(context) { - return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); + return new Extend(/** @type {Selector} */ (this.selector.eval(context)), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); } // remove when Nodes have JSDoc types // eslint-disable-next-line no-unused-vars + /** @param {EvalContext} [context] */ clone(context) { return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); } // it concatenates (joins) all selectors in selector array + /** @param {Selector[]} selectors */ findSelfSelectors(selectors) { - let selfElements = [], i, selectorElements; + /** @type {import('./element.js').default[]} */ + let selfElements = []; + let i, selectorElements; for (i = 0; i < selectors.length; i++) { selectorElements = selectors[i].elements; @@ -57,6 +78,7 @@ class Extend extends Node { selfElements = selfElements.concat(selectors[i].elements); } + /** @type {Selector[]} */ this.selfSelectors = [new Selector(selfElements)]; this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); } diff --git a/packages/less/lib/less/tree/import.js b/packages/less/lib/less/tree/import.js index d7107aeb5..ad734560c 100644 --- a/packages/less/lib/less/tree/import.js +++ b/packages/less/lib/less/tree/import.js @@ -1,12 +1,22 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo, VisibilityInfo } from './node.js' */ import Node from './node.js'; import Media from './media.js'; import URL from './url.js'; import Quoted from './quoted.js'; import Ruleset from './ruleset.js'; import Anonymous from './anonymous.js'; +import Expression from './expression.js'; import * as utils from '../utils.js'; import LessError from '../less-error.js'; -import Expression from './expression.js'; + +/** + * @typedef {object} ImportOptions + * @property {boolean} [less] + * @property {boolean} [inline] + * @property {boolean} [isPlugin] + * @property {boolean} [reference] + */ // // CSS @import node @@ -23,15 +33,39 @@ import Expression from './expression.js'; class Import extends Node { get type() { return 'Import'; } + /** + * @param {Node} path + * @param {Node | null} features + * @param {ImportOptions} options + * @param {number} index + * @param {FileInfo} [currentFileInfo] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(path, features, options, index, currentFileInfo, visibilityInfo) { super(); + /** @type {ImportOptions} */ this.options = options; this._index = index; this._fileInfo = currentFileInfo; this.path = path; + /** @type {Node | null} */ this.features = features; + /** @type {boolean} */ this.allowRoot = true; + /** @type {boolean | undefined} */ + this.css = undefined; + /** @type {boolean | undefined} */ + this.layerCss = undefined; + /** @type {(Ruleset & { imports?: object, filename?: string, functions?: object, functionRegistry?: { addMultiple: (fns: object) => void } }) | undefined} */ + this.root = undefined; + /** @type {string | undefined} */ + this.importedFilename = undefined; + /** @type {boolean | (() => boolean) | undefined} */ + this.skip = undefined; + /** @type {{ message: string, index: number, filename: string } | undefined} */ + this.error = undefined; + if (this.options.less !== undefined || this.options.inline) { this.css = !this.options.less || this.options.inline; } else { @@ -41,20 +75,27 @@ class Import extends Node { } } this.copyVisibilityInfo(visibilityInfo); - this.setParent(this.features, this); - this.setParent(this.path, this); + if (this.features) { + this.setParent(this.features, /** @type {Node} */ (this)); + } + this.setParent(this.path, /** @type {Node} */ (this)); } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.features) { this.features = visitor.visit(this.features); } this.path = visitor.visit(this.path); if (!this.options.isPlugin && !this.options.inline && this.root) { - this.root = visitor.visit(this.root); + this.root = /** @type {Ruleset} */ (visitor.visit(this.root)); } } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { if (this.css && this.path._fileInfo.reference === undefined) { output.add('@import ', this._fileInfo, this._index); @@ -67,15 +108,18 @@ class Import extends Node { } } + /** @returns {string | undefined} */ getPath() { return (this.path instanceof URL) ? - this.path.value.value : this.path.value; + /** @type {string} */ (/** @type {Node} */ (this.path.value).value) : + /** @type {string | undefined} */ (this.path.value); } + /** @returns {boolean | RegExpMatchArray | null} */ isVariableImport() { let path = this.path; if (path instanceof URL) { - path = path.value; + path = /** @type {Node} */ (path.value); } if (path instanceof Quoted) { return path.containsVariables(); @@ -84,53 +128,57 @@ class Import extends Node { return true; } + /** @param {EvalContext} context */ evalForImport(context) { let path = this.path; if (path instanceof URL) { - path = path.value; + path = /** @type {Node} */ (path.value); } - return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); + return new Import(path.eval(context), this.features, this.options, this._index || 0, this._fileInfo, this.visibilityInfo()); } + /** @param {EvalContext} context */ evalPath(context) { const path = this.path.eval(context); const fileInfo = this._fileInfo; if (!(path instanceof URL)) { // Add the rootpath if the URL requires a rewrite - const pathValue = path.value; + const pathValue = /** @type {string} */ (path.value); if (fileInfo && pathValue && context.pathRequiresRewrite(pathValue)) { path.value = context.rewritePath(pathValue, fileInfo.rootpath); } else { - path.value = context.normalizePath(path.value); + path.value = context.normalizePath(/** @type {string} */ (path.value)); } } return path; } + /** @param {EvalContext} context */ + // @ts-ignore - Import.eval returns Node | Node[] | Import (wider than Node.eval's Node return) eval(context) { const result = this.doEval(context); if (this.options.reference || this.blocksVisibility()) { - if (result.length || result.length === 0) { + if (Array.isArray(result)) { result.forEach(function (node) { node.addVisibilityBlock(); - } - ); + }); } else { - result.addVisibilityBlock(); + /** @type {Node} */ (result).addVisibilityBlock(); } } return result; } + /** @param {EvalContext} context */ doEval(context) { + /** @type {Ruleset | undefined} */ let ruleset; - let registry; const features = this.features && this.features.eval(context); if (this.options.isPlugin) { @@ -139,13 +187,19 @@ class Import extends Node { this.root.eval(context); } catch (e) { - e.message = 'Plugin error during evaluation'; - throw new LessError(e, this.root.imports, this.root.filename); + const err = /** @type {{ message: string }} */ (e); + err.message = 'Plugin error during evaluation'; + throw new LessError( + /** @type {{ message: string, index?: number, filename?: string }} */ (e), + /** @type {{ imports: object }} */ (/** @type {unknown} */ (this.root)).imports, + /** @type {{ filename: string }} */ (/** @type {unknown} */ (this.root)).filename + ); } } - registry = context.frames[0] && context.frames[0].functionRegistry; - if ( registry && this.root && this.root.functions ) { - registry.addMultiple( this.root.functions ); + const frame0 = /** @type {Ruleset & { functionRegistry?: { addMultiple: (fns: object) => void } }} */ (context.frames[0]); + const registry = frame0 && frame0.functionRegistry; + if (registry && this.root && this.root.functions) { + registry.addMultiple(this.root.functions); } return []; @@ -160,11 +214,11 @@ class Import extends Node { } } if (this.features) { - let featureValue = this.features.value; + let featureValue = /** @type {Node[]} */ (this.features.value); if (Array.isArray(featureValue) && featureValue.length >= 1) { const expr = featureValue[0]; - if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) { - featureValue = expr.value; + if (expr.type === 'Expression' && Array.isArray(expr.value) && /** @type {Node[]} */ (expr.value).length >= 2) { + featureValue = /** @type {Node[]} */ (expr.value); const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' && featureValue[1].type === 'Paren'; if (isLayer) { @@ -174,15 +228,20 @@ class Import extends Node { } } if (this.options.inline) { - const contents = new Anonymous(this.root, 0, + const contents = new Anonymous( + /** @type {string} */ (/** @type {unknown} */ (this.root)), + 0, { filename: this.importedFilename, reference: this.path._fileInfo && this.path._fileInfo.reference - }, true, true); + }, + true, + true + ); - return this.features ? new Media([contents], this.features.value) : [contents]; + return this.features ? new Media([contents], /** @type {Node[]} */ (this.features.value)) : [contents]; } else if (this.css || this.layerCss) { - const newImport = new Import(this.evalPath(context), features, this.options, this._index); + const newImport = new Import(this.evalPath(context), features, this.options, this._index || 0); if (this.layerCss) { newImport.css = this.layerCss; newImport.path._fileInfo = this._fileInfo; @@ -193,18 +252,18 @@ class Import extends Node { return newImport; } else if (this.root) { if (this.features) { - let featureValue = this.features.value; + let featureValue = /** @type {Node[]} */ (this.features.value); if (Array.isArray(featureValue) && featureValue.length === 1) { const expr = featureValue[0]; - if (expr.type === 'Expression' && Array.isArray(expr.value) && expr.value.length >= 2) { - featureValue = expr.value; + if (expr.type === 'Expression' && Array.isArray(expr.value) && /** @type {Node[]} */ (expr.value).length >= 2) { + featureValue = /** @type {Node[]} */ (expr.value); const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' && featureValue[1].type === 'Paren'; if (isLayer) { this.layerCss = true; - featureValue[0] = new Expression(featureValue.slice(0, 2)); + featureValue[0] = new Expression(/** @type {Node[]} */ (featureValue.slice(0, 2))); featureValue.splice(1, 1); - featureValue[0].noSpacing = true; + /** @type {Expression} */ (featureValue[0]).noSpacing = true; return this; } } @@ -213,20 +272,20 @@ class Import extends Node { ruleset = new Ruleset(null, utils.copyArray(this.root.rules)); ruleset.evalImports(context); - return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules; + return this.features ? new Media(ruleset.rules, /** @type {Node[]} */ (this.features.value)) : ruleset.rules; } else { if (this.features) { - let featureValue = this.features.value; + let featureValue = /** @type {Node[]} */ (this.features.value); if (Array.isArray(featureValue) && featureValue.length >= 1) { - featureValue = featureValue[0].value; + featureValue = /** @type {Node[]} */ (featureValue[0].value); if (Array.isArray(featureValue) && featureValue.length >= 2) { const isLayer = featureValue[0].type === 'Keyword' && featureValue[0].value === 'layer' && featureValue[1].type === 'Paren'; if (isLayer) { this.css = true; - featureValue[0] = new Expression(featureValue.slice(0, 2)); + featureValue[0] = new Expression(/** @type {Node[]} */ (featureValue.slice(0, 2))); featureValue.splice(1, 1); - featureValue[0].noSpacing = true; + /** @type {Expression} */ (featureValue[0]).noSpacing = true; return this; } } diff --git a/packages/less/lib/less/tree/index.js b/packages/less/lib/less/tree/index.js index a6460b709..87704f84e 100644 --- a/packages/less/lib/less/tree/index.js +++ b/packages/less/lib/less/tree/index.js @@ -1,3 +1,4 @@ +// @ts-check import Node from './node.js'; import Color from './color.js'; import AtRule from './atrule.js'; @@ -45,11 +46,11 @@ export default { Ruleset, Element, Attribute, Combinator, Selector, Quoted, Expression, Declaration, Call, URL, Import, Comment, Anonymous, Value, JavaScript, Assignment, - Condition, Paren, Media, Container, QueryInParens, - UnicodeDescriptor, Negative, Extend, VariableCall, + Condition, Paren, Media, Container, QueryInParens, + UnicodeDescriptor, Negative, Extend, VariableCall, NamespaceValue, mixin: { Call: MixinCall, Definition: MixinDefinition } -}; \ No newline at end of file +}; diff --git a/packages/less/lib/less/tree/javascript.js b/packages/less/lib/less/tree/javascript.js index d8cadc756..98cf75761 100644 --- a/packages/less/lib/less/tree/javascript.js +++ b/packages/less/lib/less/tree/javascript.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, FileInfo } from './node.js' */ import JsEvalNode from './js-eval-node.js'; import Dimension from './dimension.js'; import Quoted from './quoted.js'; @@ -6,6 +8,12 @@ import Anonymous from './anonymous.js'; class JavaScript extends JsEvalNode { get type() { return 'JavaScript'; } + /** + * @param {string} string + * @param {boolean} escaped + * @param {number} index + * @param {FileInfo} currentFileInfo + */ constructor(string, escaped, index, currentFileInfo) { super(); this.escaped = escaped; @@ -14,18 +22,22 @@ class JavaScript extends JsEvalNode { this._fileInfo = currentFileInfo; } + /** + * @param {EvalContext} context + * @returns {Dimension | Quoted | Anonymous} + */ eval(context) { const result = this.evaluateJavaScript(this.expression, context); const type = typeof result; - if (type === 'number' && !isNaN(result)) { - return new Dimension(result); + if (type === 'number' && !isNaN(/** @type {number} */ (result))) { + return new Dimension(/** @type {number} */ (result)); } else if (type === 'string') { - return new Quoted(`"${result}"`, result, this.escaped, this._index); + return new Quoted(`"${result}"`, /** @type {string} */ (result), this.escaped, this._index); } else if (Array.isArray(result)) { - return new Anonymous(result.join(', ')); + return new Anonymous(/** @type {string[]} */ (result).join(', ')); } else { - return new Anonymous(result); + return new Anonymous(/** @type {string} */ (result)); } } } diff --git a/packages/less/lib/less/tree/js-eval-node.js b/packages/less/lib/less/tree/js-eval-node.js index 2cf85fb93..5732ecb9a 100644 --- a/packages/less/lib/less/tree/js-eval-node.js +++ b/packages/less/lib/less/tree/js-eval-node.js @@ -1,10 +1,18 @@ +// @ts-check +/** @import { EvalContext } from './node.js' */ import Node from './node.js'; import Variable from './variable.js'; class JsEvalNode extends Node { + /** + * @param {string} expression + * @param {EvalContext} context + * @returns {string | number | boolean} + */ evaluateJavaScript(expression, context) { let result; const that = this; + /** @type {Record string }>} */ const evalContext = {}; if (!context.javascriptEnabled) { @@ -17,42 +25,48 @@ class JsEvalNode extends Node { return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context)); }); + /** @type {Function} */ + let expressionFunc; try { - expression = new Function(`return (${expression})`); + expressionFunc = new Function(`return (${expression})`); } catch (e) { - throw { message: `JavaScript evaluation error: ${e.message} from \`${expression}\`` , + throw { message: `JavaScript evaluation error: ${/** @type {Error} */ (e).message} from \`${expression}\`` , filename: this.fileInfo().filename, index: this.getIndex() }; } - const variables = context.frames[0].variables(); + const variables = /** @type {Node & { variables: () => Record }} */ (context.frames[0]).variables(); for (const k in variables) { // eslint-disable-next-line no-prototype-builtins if (variables.hasOwnProperty(k)) { evalContext[k.slice(1)] = { value: variables[k].value, toJS: function () { - return this.value.eval(context).toCSS(); + return this.value.eval(context).toCSS(context); } }; } } try { - result = expression.call(evalContext); + result = expressionFunc.call(evalContext); } catch (e) { - throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/["]/g, '\'')}'` , + throw { message: `JavaScript evaluation error: '${/** @type {Error} */ (e).name}: ${/** @type {Error} */ (e).message.replace(/["]/g, '\'')}'` , filename: this.fileInfo().filename, index: this.getIndex() }; } return result; } + /** + * @param {Node} obj + * @returns {string} + */ jsify(obj) { if (Array.isArray(obj.value) && (obj.value.length > 1)) { - return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`; + return `[${obj.value.map(function (v) { return v.toCSS(/** @type {EvalContext} */ (undefined)); }).join(', ')}]`; } else { - return obj.toCSS(); + return obj.toCSS(/** @type {EvalContext} */ (undefined)); } } } diff --git a/packages/less/lib/less/tree/keyword.js b/packages/less/lib/less/tree/keyword.js index 51041852a..03a925c5b 100644 --- a/packages/less/lib/less/tree/keyword.js +++ b/packages/less/lib/less/tree/keyword.js @@ -1,16 +1,24 @@ +// @ts-check import Node from './node.js'; +/** @import { EvalContext, CSSOutput } from './node.js' */ + class Keyword extends Node { get type() { return 'Keyword'; } + /** @param {string} value */ constructor(value) { super(); this.value = value; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; } - output.add(this.value); + output.add(/** @type {string} */ (this.value)); } } diff --git a/packages/less/lib/less/tree/media.js b/packages/less/lib/less/tree/media.js index 11fd49a69..271924144 100644 --- a/packages/less/lib/less/tree/media.js +++ b/packages/less/lib/less/tree/media.js @@ -1,3 +1,8 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, FileInfo, VisibilityInfo } from './node.js' */ +/** @import { NestableAtRuleThis } from './nested-at-rule.js' */ +/** @import { RulesetLikeNode } from './atrule.js' */ +import Node from './node.js'; import Ruleset from './ruleset.js'; import Value from './value.js'; import Selector from './selector.js'; @@ -7,6 +12,13 @@ import NestableAtRulePrototype from './nested-at-rule.js'; class Media extends AtRule { get type() { return 'Media'; } + /** + * @param {Node[] | null} value + * @param {Node[]} features + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(value, features, index, currentFileInfo, visibilityInfo) { super(); this._index = index; @@ -14,22 +26,32 @@ class Media extends AtRule { const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors(); + /** @type {Value} */ this.features = new Value(features); + /** @type {RulesetLikeNode[]} */ this.rules = [new Ruleset(selectors, value)]; - this.rules[0].allowImports = true; + /** @type {RulesetLikeNode} */ (this.rules[0]).allowImports = true; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; - this.setParent(selectors, this); - this.setParent(this.features, this); - this.setParent(this.rules, this); + this.setParent(selectors, /** @type {Node} */ (/** @type {unknown} */ (this))); + this.setParent(this.features, /** @type {Node} */ (/** @type {unknown} */ (this))); + this.setParent(this.rules, /** @type {Node} */ (/** @type {unknown} */ (this))); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add('@media ', this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { if (!context.mediaBlocks) { context.mediaBlocks = []; @@ -38,24 +60,24 @@ class Media extends AtRule { const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo()); if (this.debugInfo) { - this.rules[0].debugInfo = this.debugInfo; + /** @type {RulesetLikeNode} */ (this.rules[0]).debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } - media.features = this.features.eval(context); + media.features = /** @type {Value} */ (this.features.eval(context)); - context.mediaPath.push(media); - context.mediaBlocks.push(media); + context.mediaPath.push(/** @type {Node} */ (/** @type {unknown} */ (media))); + context.mediaBlocks.push(/** @type {Node} */ (/** @type {unknown} */ (media))); - this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); + /** @type {RulesetLikeNode} */ (this.rules[0]).functionRegistry = /** @type {RulesetLikeNode} */ (context.frames[0]).functionRegistry.inherit(); context.frames.unshift(this.rules[0]); - media.rules = [this.rules[0].eval(context)]; + media.rules = [/** @type {RulesetLikeNode} */ (this.rules[0].eval(context))]; context.frames.shift(); context.mediaPath.pop(); - return context.mediaPath.length === 0 ? media.evalTop(context) : - media.evalNested(context); + return context.mediaPath.length === 0 ? /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (media)).evalTop(context) : + /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (media)).evalNested(context); } } diff --git a/packages/less/lib/less/tree/merge-rules.js b/packages/less/lib/less/tree/merge-rules.js index 10f48e105..befdfcaf3 100644 --- a/packages/less/lib/less/tree/merge-rules.js +++ b/packages/less/lib/less/tree/merge-rules.js @@ -1,31 +1,37 @@ +// @ts-check import Expression from './expression.js'; import Value from './value.js'; +import Node from './node.js'; /** * Merges declarations with merge flags (+ or ,) into combined values. * Used by both the ToCSSVisitor and AtRule eval. + * @param {Node[]} rules */ export default function mergeRules(rules) { if (!rules) { return; } + /** @type {Record>} */ const groups = {}; + /** @type {Array>} */ const groupsArr = []; for (let i = 0; i < rules.length; i++) { - const rule = rules[i]; + const rule = /** @type {Node & { merge: string, name: string }} */ (rules[i]); if (rule.merge) { const key = rule.name; groups[key] ? rules.splice(i--, 1) : groupsArr.push(groups[key] = []); - groups[key].push(rule); + groups[key].push(/** @type {Node & { merge: string, name: string, value: Node, important: string }} */ (rule)); } } groupsArr.forEach(group => { if (group.length > 0) { const result = group[0]; + /** @type {Node[]} */ let space = []; const comma = [new Expression(space)]; group.forEach(rule => { diff --git a/packages/less/lib/less/tree/mixin-call.js b/packages/less/lib/less/tree/mixin-call.js index 2e0cb9bd8..1e8aa9bd9 100644 --- a/packages/less/lib/less/tree/mixin-call.js +++ b/packages/less/lib/less/tree/mixin-call.js @@ -1,61 +1,123 @@ +// @ts-check +/** @import { EvalContext, TreeVisitor, FileInfo } from './node.js' */ +/** @import { FunctionRegistry } from './nested-at-rule.js' */ import Node from './node.js'; import Selector from './selector.js'; import MixinDefinition from './mixin-definition.js'; import defaultFunc from '../functions/default.js'; +/** + * @typedef {{ name?: string, value: Node, expand?: boolean }} MixinArg + */ + +/** + * @typedef {Node & { + * rules?: Node[], + * selectors?: Selector[], + * originalRuleset?: Node, + * matchArgs: (args: MixinArg[] | null, context: EvalContext) => boolean, + * matchCondition?: (args: MixinArg[] | null, context: EvalContext) => boolean, + * find: (selector: Selector, self?: Node | null, filter?: (rule: Node) => boolean) => Array<{ rule: Node & { rules?: Node[], originalRuleset?: Node, matchArgs: Function, matchCondition?: Function, evalCall?: Function }, path: Node[] }>, + * functionRegistry?: FunctionRegistry + * }} MixinSearchFrame + */ + class MixinCall extends Node { get type() { return 'MixinCall'; } + /** + * @param {import('./element.js').default[]} elements + * @param {MixinArg[]} [args] + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {string} [important] + */ constructor(elements, args, index, currentFileInfo, important) { super(); + /** @type {Selector} */ this.selector = new Selector(elements); + /** @type {MixinArg[]} */ this.arguments = args || []; this._index = index; this._fileInfo = currentFileInfo; + /** @type {string | undefined} */ this.important = important; this.allowRoot = true; - this.setParent(this.selector, this); + this.setParent(this.selector, /** @type {Node} */ (/** @type {unknown} */ (this))); } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.selector) { - this.selector = visitor.visit(this.selector); + this.selector = /** @type {Selector} */ (visitor.visit(this.selector)); } if (this.arguments.length) { - this.arguments = visitor.visitArray(this.arguments); + this.arguments = /** @type {MixinArg[]} */ (/** @type {unknown} */ (visitor.visitArray(/** @type {Node[]} */ (/** @type {unknown} */ (this.arguments))))); } } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { + /** @type {{ rule: Node & { rules?: Node[], originalRuleset?: Node, matchArgs: Function, matchCondition?: Function, evalCall?: Function }, path: Node[] }[] | undefined} */ let mixins; + /** @type {Node & { rules?: Node[], originalRuleset?: Node, matchArgs: Function, matchCondition?: Function, evalCall?: Function }} */ let mixin; + /** @type {Node[]} */ let mixinPath; + /** @type {MixinArg[]} */ const args = []; + /** @type {MixinArg} */ let arg; + /** @type {Node} */ let argValue; + /** @type {Node[]} */ const rules = []; let match = false; + /** @type {number} */ let i; + /** @type {number} */ let m; + /** @type {number} */ let f; + /** @type {boolean} */ let isRecursive; + /** @type {boolean | undefined} */ let isOneFound; + /** @type {{ mixin: Node & { rules?: Node[], originalRuleset?: Node, matchArgs: Function, matchCondition?: Function, evalCall?: Function }, group: number }[]} */ const candidates = []; + /** @type {{ mixin: Node & { rules?: Node[], originalRuleset?: Node, matchArgs: Function, matchCondition?: Function, evalCall?: Function }, group: number } | number} */ let candidate; + /** @type {boolean[]} */ const conditionResult = []; + /** @type {number | undefined} */ let defaultResult; const defFalseEitherCase = -1; const defNone = 0; const defTrue = 1; const defFalse = 2; + /** @type {number[]} */ let count; + /** @type {Node | undefined} */ let originalRuleset; + /** @type {((rule: MixinSearchFrame) => boolean) | undefined} */ let noArgumentsFilter; - this.selector = this.selector.eval(context); + this.selector = /** @type {Selector} */ (this.selector.eval(context)); + /** + * @param {Node & { matchCondition?: Function }} mixin + * @param {Node[]} mixinPath + */ function calcDefGroup(mixin, mixinPath) { - let f, p, namespace; + /** @type {number} */ + let f; + /** @type {number} */ + let p; + /** @type {Node & { matchCondition?: Function }} */ + let namespace; for (f = 0; f < 2; f++) { conditionResult[f] = true; @@ -85,19 +147,19 @@ class MixinCall extends Node { arg = this.arguments[i]; argValue = arg.value.eval(context); if (arg.expand && Array.isArray(argValue.value)) { - argValue = argValue.value; - for (m = 0; m < argValue.length; m++) { - args.push({value: argValue[m]}); + const expandedValues = /** @type {Node[]} */ (argValue.value); + for (m = 0; m < expandedValues.length; m++) { + args.push({value: expandedValues[m]}); } } else { args.push({name: arg.name, value: argValue}); } } - noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);}; + noArgumentsFilter = function(/** @type {MixinSearchFrame} */ rule) {return rule.matchArgs(null, context);}; for (i = 0; i < context.frames.length; i++) { - if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) { + if ((mixins = /** @type {MixinSearchFrame} */ (context.frames[i]).find(this.selector, null, /** @type {(rule: Node) => boolean} */ (/** @type {unknown} */ (noArgumentsFilter)))).length > 0) { isOneFound = true; // To make `default()` function independent of definition order we have two "subpasses" here. @@ -110,7 +172,7 @@ class MixinCall extends Node { mixinPath = mixins[m].path; isRecursive = false; for (f = 0; f < context.frames.length; f++) { - if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) { + if ((!(mixin instanceof MixinDefinition)) && mixin === (/** @type {Node & { originalRuleset?: Node }} */ (context.frames[f]).originalRuleset || context.frames[f])) { isRecursive = true; break; } @@ -122,8 +184,8 @@ class MixinCall extends Node { if (mixin.matchArgs(args, context)) { candidate = {mixin, group: calcDefGroup(mixin, mixinPath)}; - if (candidate.group !== defFalseEitherCase) { - candidates.push(candidate); + if (/** @type {{ mixin: Node, group: number }} */ (candidate).group !== defFalseEitherCase) { + candidates.push(/** @type {{ mixin: Node & { rules?: Node[], originalRuleset?: Node, matchArgs: Function, matchCondition?: Function, evalCall?: Function }, group: number }} */ (candidate)); } match = true; @@ -154,21 +216,22 @@ class MixinCall extends Node { try { mixin = candidates[m].mixin; if (!(mixin instanceof MixinDefinition)) { - originalRuleset = mixin.originalRuleset || mixin; + originalRuleset = /** @type {Node & { originalRuleset?: Node }} */ (mixin).originalRuleset || mixin; mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo()); - mixin.originalRuleset = originalRuleset; + /** @type {Node & { originalRuleset?: Node }} */ (mixin).originalRuleset = originalRuleset; } - const newRules = mixin.evalCall(context, args, this.important).rules; + const newRules = /** @type {MixinDefinition} */ (mixin).evalCall(context, args, this.important).rules; this._setVisibilityToReplacement(newRules); Array.prototype.push.apply(rules, newRules); } catch (e) { - throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack }; + const err = /** @type {{ message?: string, stack?: string }} */ (e); + throw { message: err.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: err.stack }; } } } if (match) { - return rules; + return /** @type {Node} */ (/** @type {unknown} */ (rules)); } } } @@ -178,13 +241,17 @@ class MixinCall extends Node { index: this.getIndex(), filename: this.fileInfo().filename }; } else { throw { type: 'Name', - message: `${this.selector.toCSS().trim()} is undefined`, + message: `${this.selector.toCSS(/** @type {EvalContext} */ ({})).trim()} is undefined`, index: this.getIndex(), filename: this.fileInfo().filename }; } } + /** @param {Node[]} replacement */ _setVisibilityToReplacement(replacement) { - let i, rule; + /** @type {number} */ + let i; + /** @type {Node} */ + let rule; if (this.blocksVisibility()) { for (i = 0; i < replacement.length; i++) { rule = replacement[i]; @@ -193,14 +260,15 @@ class MixinCall extends Node { } } + /** @param {MixinArg[]} args */ format(args) { - return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) { + return `${this.selector.toCSS(/** @type {EvalContext} */ ({})).trim()}(${args ? args.map(function (/** @type {MixinArg} */ a) { let argValue = ''; if (a.name) { argValue += `${a.name}:`; } if (a.value.toCSS) { - argValue += a.value.toCSS(); + argValue += a.value.toCSS(/** @type {EvalContext} */ ({})); } else { argValue += '???'; } diff --git a/packages/less/lib/less/tree/mixin-definition.js b/packages/less/lib/less/tree/mixin-definition.js index f99659980..b63f05aa6 100644 --- a/packages/less/lib/less/tree/mixin-definition.js +++ b/packages/less/lib/less/tree/mixin-definition.js @@ -1,3 +1,8 @@ +// @ts-check +/** @import { EvalContext, TreeVisitor, VisibilityInfo } from './node.js' */ +/** @import { FunctionRegistry } from './nested-at-rule.js' */ +/** @import { MixinArg } from './mixin-call.js' */ +import Node from './node.js'; import Selector from './selector.js'; import Element from './element.js'; import Ruleset from './ruleset.js'; @@ -7,21 +12,51 @@ import Expression from './expression.js'; import contexts from '../contexts.js'; import * as utils from '../utils.js'; +/** + * @typedef {object} MixinParam + * @property {string} [name] + * @property {Node} [value] + * @property {boolean} [variadic] + */ + +/** + * @typedef {Ruleset & { + * functionRegistry?: FunctionRegistry, + * originalRuleset?: Node + * }} RulesetWithRegistry + */ + class Definition extends Ruleset { get type() { return 'MixinDefinition'; } + /** + * @param {string | undefined} name + * @param {MixinParam[]} params + * @param {Node[]} rules + * @param {Node | null} [condition] + * @param {boolean} [variadic] + * @param {Node[] | null} [frames] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(name, params, rules, condition, variadic, frames, visibilityInfo) { - super(); + super(null, null); + /** @type {string} */ this.name = name || 'anonymous mixin'; this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])]; + /** @type {MixinParam[]} */ this.params = params; + /** @type {Node | null | undefined} */ this.condition = condition; + /** @type {boolean | undefined} */ this.variadic = variadic; + /** @type {number} */ this.arity = params.length; this.rules = rules; this._lookups = {}; + /** @type {string[]} */ const optionalParameters = []; - this.required = params.reduce(function (count, p) { + /** @type {number} */ + this.required = params.reduce(function (/** @type {number} */ count, /** @type {MixinParam} */ p) { if (!p.name || (p.name && !p.value)) { return count + 1; } @@ -30,16 +65,20 @@ class Definition extends Ruleset { return count; } }, 0); + /** @type {string[]} */ this.optionalParameters = optionalParameters; + /** @type {Node[] | null | undefined} */ this.frames = frames; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; + /** @type {boolean} */ this.evalFirst = true; } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.params && this.params.length) { - this.params = visitor.visitArray(this.params); + this.params = /** @type {MixinParam[]} */ (/** @type {unknown} */ (visitor.visitArray(/** @type {Node[]} */ (/** @type {unknown} */ (this.params))))); } this.rules = visitor.visitArray(this.rules); if (this.condition) { @@ -47,28 +86,43 @@ class Definition extends Ruleset { } } + /** + * @param {EvalContext} context + * @param {EvalContext} mixinEnv + * @param {MixinArg[] | null} args + * @param {Node[]} evaldArguments + * @returns {Ruleset} + */ evalParams(context, mixinEnv, args, evaldArguments) { /* jshint boss:true */ const frame = new Ruleset(null, null); + /** @type {Node[] | undefined} */ let varargs; + /** @type {MixinArg | undefined} */ let arg; - const params = utils.copyArray(this.params); + const params = /** @type {MixinParam[]} */ (utils.copyArray(this.params)); + /** @type {number} */ let i; + /** @type {number} */ let j; + /** @type {Node | undefined} */ let val; + /** @type {string | undefined} */ let name; + /** @type {boolean} */ let isNamedFound; + /** @type {number} */ let argIndex; let argsLength = 0; - if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) { - frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit(); + if (mixinEnv.frames && mixinEnv.frames[0] && /** @type {RulesetWithRegistry} */ (mixinEnv.frames[0]).functionRegistry) { + /** @type {RulesetWithRegistry} */ (frame).functionRegistry = /** @type {FunctionRegistry} */ (/** @type {RulesetWithRegistry} */ (mixinEnv.frames[0]).functionRegistry).inherit(); } - mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames)); + mixinEnv = new contexts.Eval(mixinEnv, /** @type {Node[]} */ ([frame]).concat(/** @type {Node[]} */ (mixinEnv.frames))); if (args) { - args = utils.copyArray(args); + args = /** @type {MixinArg[]} */ (utils.copyArray(args)); argsLength = args.length; for (i = 0; i < argsLength; i++) { @@ -103,7 +157,7 @@ class Definition extends Ruleset { if (params[i].variadic) { varargs = []; for (j = argIndex; j < argsLength; j++) { - varargs.push(args[j].value.eval(context)); + varargs.push(/** @type {MixinArg[]} */ (args)[j].value.eval(context)); } frame.prependRule(new Declaration(name, new Expression(varargs).eval(context))); } else { @@ -111,13 +165,13 @@ class Definition extends Ruleset { if (val) { // This was a mixin call, pass in a detached ruleset of it's eval'd rules if (Array.isArray(val)) { - val = new DetachedRuleset(new Ruleset('', val)); + val = /** @type {Node} */ (/** @type {unknown} */ (new DetachedRuleset(new Ruleset(null, /** @type {Node[]} */ (val))))); } else { val = val.eval(context); } } else if (params[i].value) { - val = params[i].value.eval(mixinEnv); + val = /** @type {Node} */ (params[i].value).eval(mixinEnv); frame.resetCache(); } else { throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` }; @@ -139,8 +193,9 @@ class Definition extends Ruleset { return frame; } + /** @returns {Ruleset} */ makeImportant() { - const rules = !this.rules ? this.rules : this.rules.map(function (r) { + const rules = !this.rules ? this.rules : this.rules.map(function (/** @type {Node & { makeImportant?: (important?: boolean) => Node }} */ r) { if (r.makeImportant) { return r.makeImportant(true); } else { @@ -148,18 +203,31 @@ class Definition extends Ruleset { } }); const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); - return result; + return /** @type {Ruleset} */ (/** @type {unknown} */ (result)); } + /** + * @param {EvalContext} context + * @returns {Definition} + */ eval(context) { return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames)); } + /** + * @param {EvalContext} context + * @param {MixinArg[]} args + * @param {string | undefined} important + * @returns {Ruleset} + */ evalCall(context, args, important) { + /** @type {Node[]} */ const _arguments = []; - const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames; + const mixinFrames = this.frames ? /** @type {Node[]} */ (this.frames).concat(/** @type {Node[]} */ (context.frames)) : /** @type {Node[]} */ (context.frames); const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments); + /** @type {Node[]} */ let rules; + /** @type {Ruleset} */ let ruleset; frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context))); @@ -167,31 +235,41 @@ class Definition extends Ruleset { rules = utils.copyArray(this.rules); ruleset = new Ruleset(null, rules); - ruleset.originalRuleset = this; - ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames))); + /** @type {RulesetWithRegistry} */ (ruleset).originalRuleset = this; + ruleset = /** @type {Ruleset} */ (ruleset.eval(new contexts.Eval(context, /** @type {Node[]} */ ([this, frame]).concat(mixinFrames)))); if (important) { - ruleset = ruleset.makeImportant(); + ruleset = /** @type {Ruleset} */ (ruleset.makeImportant()); } return ruleset; } + /** + * @param {MixinArg[] | null} args + * @param {EvalContext} context + * @returns {boolean} + */ matchCondition(args, context) { if (this.condition && !this.condition.eval( new contexts.Eval(context, - [this.evalParams(context, /* the parameter variables */ - new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] - .concat(this.frames || []) // the parent namespace/mixin frames - .concat(context.frames)))) { // the current environment frames + /** @type {Node[]} */ ([this.evalParams(context, /* the parameter variables */ + new contexts.Eval(context, this.frames ? /** @type {Node[]} */ (this.frames).concat(/** @type {Node[]} */ (context.frames)) : context.frames), args, [])]) + .concat(/** @type {Node[]} */ (this.frames || [])) // the parent namespace/mixin frames + .concat(/** @type {Node[]} */ (context.frames))))) { // the current environment frames return false; } return true; } + /** + * @param {MixinArg[] | null} args + * @param {EvalContext} [context] + * @returns {boolean} + */ matchArgs(args, context) { const allArgsCnt = (args && args.length) || 0; let len; const optionalParameters = this.optionalParameters; - const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) { + const requiredArgsCnt = !args ? 0 : args.reduce(function (/** @type {number} */ count, /** @type {MixinArg} */ p) { if (optionalParameters.indexOf(p.name) < 0) { return count + 1; } else { @@ -217,7 +295,7 @@ class Definition extends Ruleset { for (let i = 0; i < len; i++) { if (!this.params[i].name && !this.params[i].variadic) { - if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) { + if (/** @type {MixinArg[]} */ (args)[i].value.eval(context).toCSS(/** @type {EvalContext} */ ({})) != /** @type {Node} */ (this.params[i].value).eval(context).toCSS(/** @type {EvalContext} */ ({}))) { return false; } } diff --git a/packages/less/lib/less/tree/namespace-value.js b/packages/less/lib/less/tree/namespace-value.js index b6704357c..bc583c9a3 100644 --- a/packages/less/lib/less/tree/namespace-value.js +++ b/packages/less/lib/less/tree/namespace-value.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, FileInfo } from './node.js' */ import Node from './node.js'; import Variable from './variable.js'; import Ruleset from './ruleset.js'; @@ -6,6 +8,12 @@ import Selector from './selector.js'; class NamespaceValue extends Node { get type() { return 'NamespaceValue'; } + /** + * @param {Node} ruleCall + * @param {string[]} lookups + * @param {number} index + * @param {FileInfo} fileInfo + */ constructor(ruleCall, lookups, index, fileInfo) { super(); this.value = ruleCall; @@ -14,8 +22,14 @@ class NamespaceValue extends Node { this._fileInfo = fileInfo; } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { - let i, name, rules = this.value.eval(context); + let i, name; + /** @type {Ruleset | Node | Node[]} */ + let rules = this.value.eval(context); for (i = 0; i < this.lookups.length; i++) { name = this.lookups[i]; @@ -24,15 +38,17 @@ class NamespaceValue extends Node { rules = new Ruleset([new Selector()], rules); } + const rs = /** @type {Ruleset} */ (rules); + if (name === '') { - rules = rules.lastDeclaration(); + rules = rs.lastDeclaration(); } else if (name.charAt(0) === '@') { if (name.charAt(1) === '@') { name = `@${new Variable(name.slice(1)).eval(context).value}`; } - if (rules.variables) { - rules = rules.variable(name); + if (rs.variables) { + rules = rs.variable(name); } if (!rules) { @@ -49,8 +65,8 @@ class NamespaceValue extends Node { else { name = name.charAt(0) === '$' ? name : `$${name}`; } - if (rules.properties) { - rules = rules.property(name); + if (rs.properties) { + rules = rs.property(name); } if (!rules) { @@ -59,17 +75,20 @@ class NamespaceValue extends Node { filename: this.fileInfo().filename, index: this.getIndex() }; } - rules = rules[rules.length - 1]; + const rulesArr = /** @type {Node[]} */ (rules); + rules = rulesArr[rulesArr.length - 1]; } - if (rules.value) { - rules = rules.eval(context).value; + const current = /** @type {Node} */ (rules); + if (current.value) { + rules = /** @type {Node} */ (current.eval(context).value); } - if (rules.ruleset) { - rules = rules.ruleset.eval(context); + const currentNode = /** @type {Node & { ruleset?: Node }} */ (rules); + if (currentNode.ruleset) { + rules = currentNode.ruleset.eval(context); } } - return rules; + return /** @type {Node} */ (rules); } } diff --git a/packages/less/lib/less/tree/negative.js b/packages/less/lib/less/tree/negative.js index cbf13ffc7..1d7437179 100644 --- a/packages/less/lib/less/tree/negative.js +++ b/packages/less/lib/less/tree/negative.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput } from './node.js' */ import Node from './node.js'; import Operation from './operation.js'; import Dimension from './dimension.js'; @@ -5,21 +7,30 @@ import Dimension from './dimension.js'; class Negative extends Node { get type() { return 'Negative'; } + /** @param {Node} node */ constructor(node) { super(); this.value = node; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add('-'); - this.value.genCSS(context, output); + /** @type {Node} */ (this.value).genCSS(context, output); } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { - if (context.isMathOn()) { - return (new Operation('*', [new Dimension(-1), this.value])).eval(context); + if (context.isMathOn('*')) { + return (new Operation('*', [new Dimension(-1), /** @type {Node} */ (this.value)], false)).eval(context); } - return new Negative(this.value.eval(context)); + return new Negative(/** @type {Node} */ (this.value).eval(context)); } } diff --git a/packages/less/lib/less/tree/nested-at-rule.js b/packages/less/lib/less/tree/nested-at-rule.js index 2358f3cc1..8d0c4d33b 100644 --- a/packages/less/lib/less/tree/nested-at-rule.js +++ b/packages/less/lib/less/tree/nested-at-rule.js @@ -1,9 +1,41 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo, VisibilityInfo } from './node.js' */ import Ruleset from './ruleset.js'; import Value from './value.js'; import Selector from './selector.js'; import Anonymous from './anonymous.js'; import Expression from './expression.js'; import * as utils from '../utils.js'; +import Node from './node.js'; + +/** + * @typedef {object} FunctionRegistry + * @property {(name: string, func: Function) => void} add + * @property {(functions: Object) => void} addMultiple + * @property {(name: string) => Function} get + * @property {() => Object} getLocalFunctions + * @property {() => FunctionRegistry} inherit + * @property {(base: FunctionRegistry) => FunctionRegistry} create + */ + +/** + * @typedef {Node & { + * features: Value, + * rules: Ruleset[], + * type: string, + * functionRegistry?: FunctionRegistry, + * multiMedia?: boolean, + * debugInfo?: { lineNumber: number, fileName: string }, + * allowRoot?: boolean, + * _evaluated?: boolean, + * evalFunction: () => void, + * evalTop: (context: EvalContext) => Node | Ruleset, + * evalNested: (context: EvalContext) => Node | Ruleset, + * permute: (arr: Node[][]) => Node[][], + * bubbleSelectors: (selectors: Selector[] | undefined) => void, + * outputRuleset: (context: EvalContext, output: CSSOutput, rules: Node[]) => void + * }} NestableAtRuleThis + */ const NestableAtRulePrototype = { @@ -11,52 +43,64 @@ const NestableAtRulePrototype = { return true; }, + /** @param {TreeVisitor} visitor */ accept(visitor) { - if (this.features) { - this.features = visitor.visit(this.features); + /** @type {NestableAtRuleThis} */ + const self = /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (this)); + if (self.features) { + self.features = /** @type {Value} */ (visitor.visit(self.features)); } - if (this.rules) { - this.rules = visitor.visitArray(this.rules); + if (self.rules) { + self.rules = /** @type {Ruleset[]} */ (visitor.visitArray(self.rules)); } }, evalFunction: function () { - if (!this.features || !Array.isArray(this.features.value) || this.features.value.length < 1) { + /** @type {NestableAtRuleThis} */ + const self = /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (this)); + if (!self.features || !Array.isArray(self.features.value) || self.features.value.length < 1) { return; } - const exprValues = this.features.value; - let expr, paren; + const exprValues = /** @type {Node[]} */ (self.features.value); + /** @type {Node | undefined} */ + let expr; + /** @type {Node | undefined} */ + let paren; for (let index = 0; index < exprValues.length; ++index) { expr = exprValues[index]; if ((expr.type === 'Keyword' || expr.type === 'Variable') && index + 1 < exprValues.length - && (expr.noSpacing || expr.noSpacing == null)) { + && (/** @type {Node & { noSpacing?: boolean }} */ (expr).noSpacing || /** @type {Node & { noSpacing?: boolean }} */ (expr).noSpacing == null)) { paren = exprValues[index + 1]; - - if (paren.type === 'Paren' && paren.noSpacing) { + + if (paren.type === 'Paren' && /** @type {Node & { noSpacing?: boolean }} */ (paren).noSpacing) { exprValues[index]= new Expression([expr, paren]); exprValues.splice(index + 1, 1); - exprValues[index].noSpacing = true; + /** @type {Node & { noSpacing?: boolean }} */ (exprValues[index]).noSpacing = true; } } } }, + /** @param {EvalContext} context */ evalTop(context) { - this.evalFunction(); + /** @type {NestableAtRuleThis} */ + const self = /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (this)); + self.evalFunction(); - let result = this; + /** @type {Node | Ruleset} */ + let result = self; // Render all dependent Media blocks. if (context.mediaBlocks.length > 1) { - const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors(); + const selectors = (new Selector([], null, null, self.getIndex(), self.fileInfo())).createEmptySelectors(); result = new Ruleset(selectors, context.mediaBlocks); - result.multiMedia = true; - result.copyVisibilityInfo(this.visibilityInfo()); - this.setParent(result, this); + /** @type {Ruleset & { multiMedia?: boolean }} */ (result).multiMedia = true; + result.copyVisibilityInfo(self.visibilityInfo()); + self.setParent(result, self); } delete context.mediaBlocks; @@ -65,26 +109,30 @@ const NestableAtRulePrototype = { return result; }, + /** @param {EvalContext} context */ evalNested(context) { - this.evalFunction(); + /** @type {NestableAtRuleThis} */ + const self = /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (this)); + self.evalFunction(); let i; + /** @type {Node | Node[]} */ let value; - const path = context.mediaPath.concat([this]); + const path = context.mediaPath.concat([self]); // Extract the media-query conditions separated with `,` (OR). for (i = 0; i < path.length; i++) { - if (path[i].type !== this.type) { - const blockIndex = context.mediaBlocks.indexOf(this); + if (path[i].type !== self.type) { + const blockIndex = context.mediaBlocks.indexOf(self); if (blockIndex > -1) { context.mediaBlocks.splice(blockIndex, 1); } - return this; + return self; } - - value = path[i].features instanceof Value ? - path[i].features.value : path[i].features; - path[i] = Array.isArray(value) ? value : [value]; + + value = /** @type {NestableAtRuleThis} */ (path[i]).features instanceof Value ? + /** @type {Node[]} */ (/** @type {NestableAtRuleThis} */ (path[i]).features.value) : /** @type {NestableAtRuleThis} */ (path[i]).features; + path[i] = /** @type {Node} */ (/** @type {unknown} */ (Array.isArray(value) ? value : [value])); } // Trace all permutations to generate the resulting media-query. @@ -94,27 +142,36 @@ const NestableAtRulePrototype = { // a and e // b and c and d // b and c and e - this.features = new Value(this.permute(path).map(path => { - path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment)); - - for (i = path.length - 1; i > 0; i--) { - path.splice(i, 0, new Anonymous('and')); + self.features = new Value(self.permute(/** @type {Node[][]} */ (/** @type {unknown} */ (path))).map( + /** @param {Node | Node[]} path */ + path => { + path = /** @type {Node[]} */ (path).map( + /** @param {Node & { toCSS?: Function }} fragment */ + fragment => fragment.toCSS ? fragment : new Anonymous(/** @type {string} */ (/** @type {unknown} */ (fragment)))); + + for (i = /** @type {Node[]} */ (path).length - 1; i > 0; i--) { + /** @type {Node[]} */ (path).splice(i, 0, new Anonymous('and')); } - return new Expression(path); + return new Expression(/** @type {Node[]} */ (path)); })); - this.setParent(this.features, this); + self.setParent(self.features, self); // Fake a tree-node that doesn't output anything. return new Ruleset([], []); }, + /** + * @param {Node[][]} arr + * @returns {Node[][]} + */ permute(arr) { if (arr.length === 0) { return []; } else if (arr.length === 1) { - return arr[0]; + return /** @type {Node[][]} */ (/** @type {unknown} */ (arr[0])); } else { + /** @type {Node[][]} */ const result = []; const rest = this.permute(arr.slice(1)); for (let i = 0; i < rest.length; i++) { @@ -126,12 +183,15 @@ const NestableAtRulePrototype = { } }, + /** @param {Selector[] | undefined} selectors */ bubbleSelectors(selectors) { + /** @type {NestableAtRuleThis} */ + const self = /** @type {NestableAtRuleThis} */ (/** @type {unknown} */ (this)); if (!selectors) { return; } - this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])]; - this.setParent(this.rules, this); + self.rules = [new Ruleset(utils.copyArray(selectors), [self.rules[0]])]; + self.setParent(self.rules, self); } }; diff --git a/packages/less/lib/less/tree/node.js b/packages/less/lib/less/tree/node.js index 7ab16e889..2b5692af5 100644 --- a/packages/less/lib/less/tree/node.js +++ b/packages/less/lib/less/tree/node.js @@ -1,3 +1,4 @@ +// @ts-check /** * @typedef {object} FileInfo * @property {string} [filename] @@ -16,17 +17,47 @@ /** * @typedef {object} CSSOutput - * @property {(chunk: string, fileInfo?: FileInfo, index?: number) => void} add + * @property {(chunk: string, fileInfo?: FileInfo, index?: number, mapLines?: boolean) => void} add * @property {() => boolean} isEmpty */ /** * @typedef {object} EvalContext * @property {number} [numPrecision] - * @property {boolean} [isMathOn] - * @property {string} [math] - * @property {Array} [frames] - * @property {boolean} [importantScope] + * @property {(op?: string) => boolean} [isMathOn] + * @property {number} [math] + * @property {Node[]} [frames] + * @property {Array<{important?: string}>} [importantScope] + * @property {string[]} [paths] + * @property {boolean} [compress] + * @property {boolean} [strictUnits] + * @property {boolean} [sourceMap] + * @property {boolean} [importMultiple] + * @property {string} [urlArgs] + * @property {boolean} [javascriptEnabled] + * @property {object} [pluginManager] + * @property {number} [rewriteUrls] + * @property {boolean} [inCalc] + * @property {boolean} [mathOn] + * @property {boolean[]} [calcStack] + * @property {boolean[]} [parensStack] + * @property {Node[]} [mediaBlocks] + * @property {Node[]} [mediaPath] + * @property {() => void} [inParenthesis] + * @property {() => void} [outOfParenthesis] + * @property {() => void} [enterCalc] + * @property {() => void} [exitCalc] + * @property {(path: string) => boolean} [pathRequiresRewrite] + * @property {(path: string, rootpath?: string) => string} [rewritePath] + * @property {(path: string) => string} [normalizePath] + * @property {number} [tabLevel] + * @property {boolean} [lastRule] + */ + +/** + * @typedef {object} TreeVisitor + * @property {(node: Node) => Node} visit + * @property {(nodes: Node[], nonReplacing?: boolean) => Node[]} visitArray */ /** @@ -47,10 +78,10 @@ class Node { this.nodeVisible = undefined; /** @type {Node | null} */ this.rootNode = null; - /** @type {object | null} */ + /** @type {Node | null} */ this.parsed = null; - /** @type {*} */ + /** @type {Node | Node[] | string | number | undefined} */ this.value = undefined; /** @type {number | undefined} */ this._index = undefined; @@ -121,18 +152,18 @@ class Node { * @param {CSSOutput} output */ genCSS(context, output) { - output.add(this.value); + output.add(/** @type {string} */ (this.value)); } /** - * @param {{ visit: (node: *) => * }} visitor + * @param {TreeVisitor} visitor */ accept(visitor) { - this.value = visitor.visit(this.value); + this.value = visitor.visit(/** @type {Node} */ (this.value)); } /** - * @param {*} [context] + * @param {EvalContext} [context] * @returns {Node} */ eval(context) { return this; } @@ -187,13 +218,14 @@ class Node { return undefined; } - /** @type {*} */ let aVal = a.value; - /** @type {*} */ let bVal = b.value; if (!Array.isArray(aVal)) { return aVal === bVal ? 0 : undefined; } + if (!Array.isArray(bVal)) { + return undefined; + } if (aVal.length !== bVal.length) { return undefined; } @@ -206,8 +238,8 @@ class Node { } /** - * @param {number} a - * @param {number} b + * @param {number | string} a + * @param {number | string} b * @returns {number | undefined} */ static numericCompare(a, b) { @@ -269,4 +301,10 @@ class Node { } } +/** + * Set by the parser at runtime on Node.prototype. + * @type {{ context: EvalContext, importManager: object, imports: object } | undefined} + */ +Node.prototype.parse = undefined; + export default Node; diff --git a/packages/less/lib/less/tree/operation.js b/packages/less/lib/less/tree/operation.js index e0fc244ba..02c597264 100644 --- a/packages/less/lib/less/tree/operation.js +++ b/packages/less/lib/less/tree/operation.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor } from './node.js' */ import Node from './node.js'; import Color from './color.js'; import Dimension from './dimension.js'; @@ -7,6 +9,11 @@ const MATH = Constants.Math; class Operation extends Node { get type() { return 'Operation'; } + /** + * @param {string} op + * @param {Node[]} operands + * @param {boolean} isSpaced + */ constructor(op, operands, isSpaced) { super(); this.op = op.trim(); @@ -14,25 +21,30 @@ class Operation extends Node { this.isSpaced = isSpaced; } + /** @param {TreeVisitor} visitor */ accept(visitor) { this.operands = visitor.visitArray(this.operands); } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op; if (context.isMathOn(this.op)) { op = this.op === './' ? '/' : this.op; if (a instanceof Dimension && b instanceof Color) { - a = a.toColor(); + a = /** @type {Dimension} */ (a).toColor(); } if (b instanceof Dimension && a instanceof Color) { - b = b.toColor(); + b = /** @type {Dimension} */ (b).toColor(); } - if (!a.operate || !b.operate) { + if (!/** @type {Dimension | Color} */ (a).operate || !/** @type {Dimension | Color} */ (b).operate) { if ( (a instanceof Operation || b instanceof Operation) - && a.op === '/' && context.math === MATH.PARENS_DIVISION + && /** @type {Operation} */ (a).op === '/' && context.math === MATH.PARENS_DIVISION ) { return new Operation(this.op, [a, b], this.isSpaced); } @@ -40,12 +52,19 @@ class Operation extends Node { message: 'Operation on an invalid type' }; } - return a.operate(context, op, b); + if (a instanceof Dimension) { + return a.operate(context, op, /** @type {Dimension} */ (b)); + } + return /** @type {Color} */ (a).operate(context, op, /** @type {Color} */ (b)); } else { return new Operation(this.op, [a, b], this.isSpaced); } } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { this.operands[0].genCSS(context, output); if (this.isSpaced) { diff --git a/packages/less/lib/less/tree/paren.js b/packages/less/lib/less/tree/paren.js index 5976ad49e..05bbc369a 100644 --- a/packages/less/lib/less/tree/paren.js +++ b/packages/less/lib/less/tree/paren.js @@ -1,21 +1,34 @@ +// @ts-check +/** @import { EvalContext, CSSOutput } from './node.js' */ import Node from './node.js'; class Paren extends Node { get type() { return 'Paren'; } + /** @param {Node} node */ constructor(node) { super(); this.value = node; + /** @type {boolean | undefined} */ + this.noSpacing = undefined; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add('('); - this.value.genCSS(context, output); + /** @type {Node} */ (this.value).genCSS(context, output); output.add(')'); } + /** + * @param {EvalContext} context + * @returns {Paren} + */ eval(context) { - const paren = new Paren(this.value.eval(context)); + const paren = new Paren(/** @type {Node} */ (this.value).eval(context)); if (this.noSpacing) { paren.noSpacing = true; diff --git a/packages/less/lib/less/tree/property.js b/packages/less/lib/less/tree/property.js index 481aadf5a..08342477d 100644 --- a/packages/less/lib/less/tree/property.js +++ b/packages/less/lib/less/tree/property.js @@ -1,21 +1,35 @@ +// @ts-check +/** @import { EvalContext, FileInfo } from './node.js' */ import Node from './node.js'; import Declaration from './declaration.js'; +import Ruleset from './ruleset.js'; class Property extends Node { get type() { return 'Property'; } + /** + * @param {string} name + * @param {number} index + * @param {FileInfo} currentFileInfo + */ constructor(name, index, currentFileInfo) { super(); this.name = name; this._index = index; this._fileInfo = currentFileInfo; + /** @type {boolean | undefined} */ + this.evaluating = undefined; } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { let property; const name = this.name; // TODO: shorten this reference - const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; + const mergeRules = /** @type {{ less: { visitors: { ToCSSVisitor: { prototype: { _mergeRules: (rules: Declaration[]) => void } } } } }} */ (context.pluginManager).less.visitors.ToCSSVisitor.prototype._mergeRules; if (this.evaluating) { throw { type: 'Name', @@ -26,9 +40,9 @@ class Property extends Node { this.evaluating = true; - property = this.find(context.frames, function (frame) { + property = this.find(context.frames, function (/** @type {Node} */ frame) { let v; - const vArr = frame.property(name); + const vArr = /** @type {Ruleset} */ (frame).property(name); if (vArr) { for (let i = 0; i < vArr.length; i++) { v = vArr[i]; @@ -65,6 +79,11 @@ class Property extends Node { } } + /** + * @param {Node[]} obj + * @param {(frame: Node) => Node | undefined} fun + * @returns {Node | null} + */ find(obj, fun) { for (let i = 0, r; i < obj.length; i++) { r = fun.call(obj, obj[i]); diff --git a/packages/less/lib/less/tree/query-in-parens.js b/packages/less/lib/less/tree/query-in-parens.js index 84938b616..fd201a4e8 100644 --- a/packages/less/lib/less/tree/query-in-parens.js +++ b/packages/less/lib/less/tree/query-in-parens.js @@ -1,18 +1,30 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor } from './node.js' */ import Node from './node.js'; class QueryInParens extends Node { get type() { return 'QueryInParens'; } + /** + * @param {string} op + * @param {Node} l + * @param {Node} m + * @param {string | null} op2 + * @param {Node | null} r + * @param {number} i + */ constructor(op, l, m, op2, r, i) { super(); this.op = op.trim(); this.lvalue = l; this.mvalue = m; this.op2 = op2 ? op2.trim() : null; + /** @type {Node | null} */ this.rvalue = r; this._index = i; } + /** @param {TreeVisitor} visitor */ accept(visitor) { this.lvalue = visitor.visit(this.lvalue); this.mvalue = visitor.visit(this.mvalue); @@ -21,6 +33,7 @@ class QueryInParens extends Node { } } + /** @param {EvalContext} context */ eval(context) { const node = new QueryInParens( this.op, @@ -28,11 +41,15 @@ class QueryInParens extends Node { this.mvalue.eval(context), this.op2, this.rvalue ? this.rvalue.eval(context) : null, - this._index + this._index || 0 ); return node; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { this.lvalue.genCSS(context, output); output.add(' ' + this.op + ' '); diff --git a/packages/less/lib/less/tree/quoted.js b/packages/less/lib/less/tree/quoted.js index 64c619dcc..9f786a810 100644 --- a/packages/less/lib/less/tree/quoted.js +++ b/packages/less/lib/less/tree/quoted.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, FileInfo } from './node.js' */ import Node from './node.js'; import Variable from './variable.js'; import Property from './property.js'; @@ -5,43 +7,80 @@ import Property from './property.js'; class Quoted extends Node { get type() { return 'Quoted'; } + /** + * @param {string} str + * @param {string} [content] + * @param {boolean} [escaped] + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + */ constructor(str, content, escaped, index, currentFileInfo) { super(); + /** @type {boolean} */ this.escaped = (escaped === undefined) ? true : escaped; + /** @type {string} */ this.value = content || ''; + /** @type {string} */ this.quote = str.charAt(0); this._index = index; this._fileInfo = currentFileInfo; + /** @type {RegExp} */ this.variableRegex = /@\{([\w-]+)\}/g; + /** @type {RegExp} */ this.propRegex = /\$\{([\w-]+)\}/g; + /** @type {boolean | undefined} */ this.allowRoot = escaped; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { if (!this.escaped) { output.add(this.quote, this.fileInfo(), this.getIndex()); } - output.add(this.value); + output.add(/** @type {string} */ (this.value)); if (!this.escaped) { output.add(this.quote); } } + /** @returns {RegExpMatchArray | null} */ containsVariables() { - return this.value.match(this.variableRegex); + return /** @type {string} */ (this.value).match(this.variableRegex); } + /** @param {EvalContext} context */ eval(context) { const that = this; - let value = this.value; + let value = /** @type {string} */ (this.value); + /** + * @param {string} _ + * @param {string} name1 + * @param {string} name2 + * @returns {string} + */ const variableReplacement = function (_, name1, name2) { - const v = new Variable(`@${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); + const v = new Variable(`@${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context); + return (v instanceof Quoted) ? /** @type {string} */ (v.value) : v.toCSS(context); }; + /** + * @param {string} _ + * @param {string} name1 + * @param {string} name2 + * @returns {string} + */ const propertyReplacement = function (_, name1, name2) { - const v = new Property(`$${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context, true); - return (v instanceof Quoted) ? v.value : v.toCSS(); + const v = new Property(`$${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context); + return (v instanceof Quoted) ? /** @type {string} */ (v.value) : v.toCSS(context); }; + /** + * @param {string} value + * @param {RegExp} regexp + * @param {(substring: string, ...args: string[]) => string} replacementFnc + * @returns {string} + */ function iterativeReplace(value, regexp, replacementFnc) { let evaluatedValue = value; do { @@ -55,12 +94,19 @@ class Quoted extends Node { return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); } + /** + * @param {Node} other + * @returns {number | undefined} + */ compare(other) { // when comparing quoted strings allow the quote to differ - if (other.type === 'Quoted' && !this.escaped && !other.escaped) { - return Node.numericCompare(this.value, other.value); + if (other.type === 'Quoted' && !this.escaped && !/** @type {Quoted} */ (other).escaped) { + return Node.numericCompare( + /** @type {string} */ (this.value), + /** @type {string} */ (other.value) + ); } else { - return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; + return other.toCSS && this.toCSS(/** @type {EvalContext} */ ({})) === other.toCSS(/** @type {EvalContext} */ ({})) ? 0 : undefined; } } } diff --git a/packages/less/lib/less/tree/ruleset.js b/packages/less/lib/less/tree/ruleset.js index 1bd256715..1e4b7c0e2 100644 --- a/packages/less/lib/less/tree/ruleset.js +++ b/packages/less/lib/less/tree/ruleset.js @@ -1,3 +1,6 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo, VisibilityInfo } from './node.js' */ +/** @import { FunctionRegistry } from './nested-at-rule.js' */ import Node from './node.js'; import Declaration from './declaration.js'; import Keyword from './keyword.js'; @@ -13,43 +16,101 @@ import getDebugInfo from './debug-info.js'; import * as utils from '../utils.js'; import Parser from '../parser/parser.js'; +/** + * @typedef {Node & { + * rules?: Node[], + * selectors?: Selector[], + * root?: boolean, + * firstRoot?: boolean, + * allowImports?: boolean, + * functionRegistry?: FunctionRegistry, + * originalRuleset?: Node, + * debugInfo?: { lineNumber: number, fileName: string }, + * evalFirst?: boolean, + * isRuleset?: boolean, + * isCharset?: () => boolean, + * merge?: boolean | string, + * multiMedia?: boolean, + * parse?: { context: EvalContext, importManager: object }, + * bubbleSelectors?: (selectors: Selector[]) => void + * }} RuleNode + */ + class Ruleset extends Node { get type() { return 'Ruleset'; } + /** + * @param {Selector[] | null} selectors + * @param {Node[] | null} rules + * @param {boolean} [strictImports] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(selectors, rules, strictImports, visibilityInfo) { super(); + /** @type {Selector[] | null} */ this.selectors = selectors; + /** @type {Node[] | null} */ this.rules = rules; + /** @type {Object} */ this._lookups = {}; + /** @type {Object | null} */ this._variables = null; + /** @type {Object | null} */ this._properties = null; + /** @type {boolean | undefined} */ this.strictImports = strictImports; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; + /** @type {boolean} */ this.isRuleset = true; + /** @type {boolean | undefined} */ + this.root = undefined; + /** @type {boolean | undefined} */ + this.firstRoot = undefined; + /** @type {boolean | undefined} */ + this.allowImports = undefined; + /** @type {FunctionRegistry | undefined} */ + this.functionRegistry = undefined; + /** @type {Node | undefined} */ + this.originalRuleset = undefined; + /** @type {{ lineNumber: number, fileName: string } | undefined} */ + this.debugInfo = undefined; + /** @type {Selector[][] | undefined} */ + this.paths = undefined; + /** @type {Ruleset[] | null | undefined} */ + this._rulesets = undefined; + /** @type {boolean | undefined} */ + this.evalFirst = undefined; this.setParent(this.selectors, this); this.setParent(this.rules, this); } isRulesetLike() { return true; } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.paths) { - this.paths = visitor.visitArray(this.paths, true); + this.paths = /** @type {Selector[][]} */ (/** @type {unknown} */ (visitor.visitArray(/** @type {Node[]} */ (/** @type {unknown} */ (this.paths)), true))); } else if (this.selectors) { - this.selectors = visitor.visitArray(this.selectors); + this.selectors = /** @type {Selector[]} */ (visitor.visitArray(this.selectors)); } if (this.rules && this.rules.length) { this.rules = visitor.visitArray(this.rules); } } + /** @param {EvalContext} context */ eval(context) { + /** @type {Selector[] | undefined} */ let selectors; + /** @type {number} */ let selCnt; + /** @type {Selector} */ let selector; + /** @type {number} */ let i; + /** @type {boolean | undefined} */ let hasVariable; let hasOnePassingSelector = false; @@ -61,7 +122,7 @@ class Ruleset extends Node { }); for (i = 0; i < selCnt; i++) { - selector = this.selectors[i].eval(context); + selector = /** @type {Selector} */ (this.selectors[i].eval(context)); for (let j = 0; j < selector.elements.length; j++) { if (selector.elements[j].isVariable) { hasVariable = true; @@ -82,12 +143,12 @@ class Ruleset extends Node { } const startingIndex = selectors[0].getIndex(); const selectorFileInfo = selectors[0].fileInfo(); - new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode( + new (/** @type {new (...args: [EvalContext, object, FileInfo, number]) => { parseNode: Function }} */ (/** @type {unknown} */ (Parser)))(context, /** @type {{ context: EvalContext, importManager: object }} */ (this.parse).importManager, selectorFileInfo, startingIndex).parseNode( toParseSelectors.join(','), ['selectors'], - function(err, result) { + function(/** @type {Error | null} */ err, /** @type {Node[]} */ result) { if (result) { - selectors = utils.flattenArray(result); + selectors = /** @type {Selector[]} */ (utils.flattenArray(result)); } }); } @@ -99,7 +160,9 @@ class Ruleset extends Node { let rules = this.rules ? utils.copyArray(this.rules) : null; const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo()); + /** @type {Node} */ let rule; + /** @type {Node} */ let subRule; ruleset.originalRuleset = this; @@ -112,7 +175,7 @@ class Ruleset extends Node { } if (!hasOnePassingSelector) { - rules.length = 0; + /** @type {Node[]} */ (rules).length = 0; } // push the current ruleset to the frames stack @@ -120,18 +183,20 @@ class Ruleset extends Node { // inherit a function registry from the frames stack when possible; // otherwise from the global registry + /** @type {FunctionRegistry | undefined} */ let foundRegistry; for (let fi = 0, fn = ctxFrames.length; fi !== fn; ++fi) { - foundRegistry = ctxFrames[fi].functionRegistry; + foundRegistry = /** @type {RuleNode} */ (ctxFrames[fi]).functionRegistry; if (foundRegistry) { break; } } ruleset.functionRegistry = (foundRegistry || globalFunctionRegistry).inherit(); ctxFrames.unshift(ruleset); // currrent selectors - let ctxSelectors = context.selectors; + /** @type {Selector[][] | undefined} */ + let ctxSelectors = /** @type {EvalContext & { selectors?: Selector[][] }} */ (context).selectors; if (!ctxSelectors) { - context.selectors = ctxSelectors = []; + /** @type {EvalContext & { selectors?: Selector[][] }} */ (context).selectors = ctxSelectors = []; } ctxSelectors.unshift(this.selectors); @@ -142,9 +207,9 @@ class Ruleset extends Node { // Store the frames around mixin definitions, // so they can be evaluated like closures when the time comes. - const rsRules = ruleset.rules; + const rsRules = /** @type {Node[]} */ (ruleset.rules); for (i = 0; (rule = rsRules[i]); i++) { - if (rule.evalFirst) { + if (/** @type {RuleNode} */ (rule).evalFirst) { rsRules[i] = rule.eval(context); } } @@ -155,28 +220,28 @@ class Ruleset extends Node { for (i = 0; (rule = rsRules[i]); i++) { if (rule.type === 'MixinCall') { /* jshint loopfunc:true */ - rules = rule.eval(context).filter(function(r) { + rules = /** @type {Node[]} */ (/** @type {unknown} */ (rule.eval(context))).filter(function(/** @type {Node & { variable?: boolean }} */ r) { if ((r instanceof Declaration) && r.variable) { // do not pollute the scope if the variable is // already there. consider returning false here // but we need a way to "return" variable from mixins - return !(ruleset.variable(r.name)); + return !(ruleset.variable(/** @type {string} */ (r.name))); } return true; }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); + rsRules.splice.apply(rsRules, /** @type {[number, number, ...Node[]]} */ ([i, 1].concat(rules))); i += rules.length - 1; ruleset.resetCache(); } else if (rule.type === 'VariableCall') { /* jshint loopfunc:true */ - rules = rule.eval(context).rules.filter(function(r) { + rules = /** @type {Node[]} */ (/** @type {RuleNode} */ (rule.eval(context)).rules).filter(function(/** @type {Node & { variable?: boolean }} */ r) { if ((r instanceof Declaration) && r.variable) { // do not pollute the scope at all return false; } return true; }); - rsRules.splice.apply(rsRules, [i, 1].concat(rules)); + rsRules.splice.apply(rsRules, /** @type {[number, number, ...Node[]]} */ ([i, 1].concat(rules))); i += rules.length - 1; ruleset.resetCache(); } @@ -184,7 +249,7 @@ class Ruleset extends Node { // Evaluate everything else for (i = 0; (rule = rsRules[i]); i++) { - if (!rule.evalFirst) { + if (!/** @type {RuleNode} */ (rule).evalFirst) { rsRules[i] = rule = rule.eval ? rule.eval(context) : rule; } } @@ -215,25 +280,29 @@ class Ruleset extends Node { if (context.mediaBlocks) { for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) { - context.mediaBlocks[i].bubbleSelectors(selectors); + /** @type {RuleNode} */ (context.mediaBlocks[i]).bubbleSelectors(selectors); } } return ruleset; } + /** @param {EvalContext} context */ evalImports(context) { const rules = this.rules; + /** @type {number} */ let i; + /** @type {Node | Node[]} */ let importRules; if (!rules) { return; } for (i = 0; i < rules.length; i++) { if (rules[i].type === 'Import') { importRules = rules[i].eval(context); - if (importRules && (importRules.length || importRules.length === 0)) { - rules.splice.apply(rules, [i, 1].concat(importRules)); - i += importRules.length - 1; + if (importRules && (/** @type {Node[]} */ (/** @type {unknown} */ (importRules)).length || /** @type {Node[]} */ (/** @type {unknown} */ (importRules)).length === 0)) { + const importArr = /** @type {Node[]} */ (/** @type {unknown} */ (importRules)); + rules.splice(i, 1, ...importArr); + i += importArr.length - 1; } else { rules.splice(i, 1, importRules); } @@ -243,7 +312,7 @@ class Ruleset extends Node { } makeImportant() { - const result = new Ruleset(this.selectors, this.rules.map(function (r) { + const result = new Ruleset(this.selectors, /** @type {Node[]} */ (this.rules).map(function (/** @type {Node & { makeImportant?: () => Node }} */ r) { if (r.makeImportant) { return r.makeImportant(); } else { @@ -254,13 +323,17 @@ class Ruleset extends Node { return result; } + /** @param {Node[] | object[] | null} [args] */ matchArgs(args) { return !args || args.length === 0; } - // lets you call a css selector with a guard + /** + * @param {Node[] | object[] | null} args + * @param {EvalContext} context + */ matchCondition(args, context) { - const lastSelector = this.selectors[this.selectors.length - 1]; + const lastSelector = /** @type {Selector[]} */ (this.selectors)[/** @type {Selector[]} */ (this.selectors).length - 1]; if (!lastSelector.evaldCondition) { return false; } @@ -282,18 +355,18 @@ class Ruleset extends Node { variables() { if (!this._variables) { - this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) { + this._variables = !this.rules ? {} : this.rules.reduce(function (/** @type {Object} */ hash, /** @type {Node} */ r) { if (r instanceof Declaration && r.variable === true) { - hash[r.name] = r; + hash[/** @type {string} */ (r.name)] = r; } // when evaluating variables in an import statement, imports have not been eval'd // so we need to go inside import statements. // guard against root being a string (in the case of inlined less) - if (r.type === 'Import' && r.root && r.root.variables) { - const vars = r.root.variables(); + if (r.type === 'Import' && /** @type {RuleNode} */ (r).root && /** @type {RuleNode & { root: Ruleset }} */ (r).root.variables) { + const vars = /** @type {RuleNode & { root: Ruleset }} */ (r).root.variables(); for (const name in vars) { if (Object.prototype.hasOwnProperty.call(vars, name)) { - hash[name] = r.root.variable(name); + hash[name] = /** @type {Declaration} */ (/** @type {RuleNode & { root: Ruleset }} */ (r).root.variable(name)); } } } @@ -305,10 +378,10 @@ class Ruleset extends Node { properties() { if (!this._properties) { - this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) { + this._properties = !this.rules ? {} : this.rules.reduce(function (/** @type {Object} */ hash, /** @type {Node} */ r) { if (r instanceof Declaration && r.variable !== true) { - const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ? - r.name[0].value : r.name; + const name = (/** @type {Node[]} */ (r.name).length === 1) && (/** @type {Node[]} */ (r.name)[0] instanceof Keyword) ? + /** @type {string} */ (/** @type {Node[]} */ (r.name)[0].value) : /** @type {string} */ (r.name); // Properties don't overwrite as they can merge if (!hash[`$${name}`]) { hash[`$${name}`] = [ r ]; @@ -323,6 +396,7 @@ class Ruleset extends Node { return this._properties; } + /** @param {string} name */ variable(name) { const decl = this.variables()[name]; if (decl) { @@ -330,6 +404,7 @@ class Ruleset extends Node { } } + /** @param {string} name */ property(name) { const decl = this.properties()[name]; if (decl) { @@ -338,34 +413,36 @@ class Ruleset extends Node { } lastDeclaration() { - for (let i = this.rules.length; i > 0; i--) { - const decl = this.rules[i - 1]; + for (let i = /** @type {Node[]} */ (this.rules).length; i > 0; i--) { + const decl = /** @type {Node[]} */ (this.rules)[i - 1]; if (decl instanceof Declaration) { return this.parseValue(decl); } } } + /** @param {Declaration | Declaration[]} toParse */ parseValue(toParse) { const self = this; + /** @param {Declaration} decl */ function transformDeclaration(decl) { - if (decl.value instanceof Anonymous && !decl.parsed) { + if (decl.value instanceof Anonymous && !/** @type {Declaration & { parsed?: boolean }} */ (decl).parsed) { if (typeof decl.value.value === 'string') { - new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode( + new (/** @type {new (...args: [EvalContext, object, FileInfo, number]) => { parseNode: Function }} */ (/** @type {unknown} */ (Parser)))(/** @type {{ context: EvalContext, importManager: object }} */ (/** @type {Ruleset} */ (this).parse).context, /** @type {{ context: EvalContext, importManager: object }} */ (/** @type {Ruleset} */ (this).parse).importManager, decl.fileInfo(), decl.value.getIndex()).parseNode( decl.value.value, ['value', 'important'], - function(err, result) { + function(/** @type {Error | null} */ err, /** @type {Node[]} */ result) { if (err) { - decl.parsed = true; + decl.parsed = /** @type {Node} */ (/** @type {unknown} */ (true)); } if (result) { decl.value = result[0]; - decl.important = result[1] || ''; - decl.parsed = true; + /** @type {Declaration & { important?: string }} */ (decl).important = /** @type {string} */ (/** @type {unknown} */ (result[1])) || ''; + decl.parsed = /** @type {Node} */ (/** @type {unknown} */ (true)); } }); } else { - decl.parsed = true; + decl.parsed = /** @type {Node} */ (/** @type {unknown} */ (true)); } return decl; @@ -378,6 +455,7 @@ class Ruleset extends Node { return transformDeclaration.call(self, toParse); } else { + /** @type {Declaration[]} */ const nodes = []; for (let ti = 0; ti < toParse.length; ti++) { nodes.push(transformDeclaration.call(self, toParse[ti])); @@ -389,13 +467,16 @@ class Ruleset extends Node { rulesets() { if (!this.rules) { return []; } + /** @type {Node[]} */ const filtRules = []; const rules = this.rules; + /** @type {number} */ let i; + /** @type {Node} */ let rule; for (i = 0; (rule = rules[i]); i++) { - if (rule.isRuleset) { + if (/** @type {RuleNode} */ (rule).isRuleset) { filtRules.push(rule); } } @@ -403,6 +484,7 @@ class Ruleset extends Node { return filtRules; } + /** @param {Node} rule */ prependRule(rule) { const rules = this.rules; if (rules) { @@ -413,23 +495,32 @@ class Ruleset extends Node { this.setParent(rule, this); } + /** + * @param {Selector} selector + * @param {Ruleset | null} [self] + * @param {((rule: Node) => boolean)} [filter] + * @returns {{ rule: Node, path: Node[] }[]} + */ find(selector, self, filter) { self = self || this; + /** @type {{ rule: Node, path: Node[] }[]} */ const rules = []; + /** @type {number | undefined} */ let match; + /** @type {{ rule: Node, path: Node[] }[]} */ let foundMixins; - const key = selector.toCSS(); + const key = selector.toCSS(/** @type {EvalContext} */ ({})); - if (key in this._lookups) { return this._lookups[key]; } + if (key in this._lookups) { return /** @type {{ rule: Node, path: Node[] }[]} */ (this._lookups[key]); } this.rulesets().forEach(function (rule) { if (rule !== self) { - for (let j = 0; j < rule.selectors.length; j++) { - match = selector.match(rule.selectors[j]); + for (let j = 0; j < /** @type {RuleNode} */ (rule).selectors.length; j++) { + match = selector.match(/** @type {RuleNode} */ (rule).selectors[j]); if (match) { if (selector.elements.length > match) { if (!filter || filter(rule)) { - foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter); + foundMixins = /** @type {Ruleset} */ (/** @type {unknown} */ (rule)).find(new Selector(selector.elements.slice(match)), self, filter); for (let i = 0; i < foundMixins.length; ++i) { foundMixins[i].path.push(rule); } @@ -447,16 +538,26 @@ class Ruleset extends Node { return rules; } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { + /** @type {number} */ let i; + /** @type {number} */ let j; + /** @type {Node[]} */ const charsetRuleNodes = []; + /** @type {Node[]} */ let ruleNodes = []; let // Line number debugging debugInfo; + /** @type {Node} */ let rule; + /** @type {Selector[]} */ let path; context.tabLevel = (context.tabLevel || 0); @@ -467,17 +568,18 @@ class Ruleset extends Node { const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' '); const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' '); + /** @type {string} */ let sep; let charsetNodeIndex = 0; let importNodeIndex = 0; - for (i = 0; (rule = this.rules[i]); i++) { + for (i = 0; (rule = /** @type {Node[]} */ (this.rules)[i]); i++) { if (rule instanceof Comment) { if (importNodeIndex === i) { importNodeIndex++; } ruleNodes.push(rule); - } else if (rule.isCharset && rule.isCharset()) { + } else if (/** @type {RuleNode} */ (rule).isCharset && /** @type {RuleNode} */ (rule).isCharset()) { ruleNodes.splice(charsetNodeIndex, 0, rule); charsetNodeIndex++; importNodeIndex++; @@ -493,15 +595,16 @@ class Ruleset extends Node { // If this is the root node, we don't render // a selector, or {}. if (!this.root) { - debugInfo = getDebugInfo(context, this, tabSetStr); + debugInfo = getDebugInfo(context, /** @type {{ debugInfo: { lineNumber: number, fileName: string } }} */ (/** @type {unknown} */ (this)), tabSetStr); if (debugInfo) { output.add(debugInfo); output.add(tabSetStr); } - const paths = this.paths; + const paths = /** @type {Selector[][]} */ (this.paths); const pathCnt = paths.length; + /** @type {number} */ let pathSubCnt; sep = context.compress ? ',' : (`,\n${tabSetStr}`); @@ -511,10 +614,10 @@ class Ruleset extends Node { if (!(pathSubCnt = path.length)) { continue; } if (i > 0) { output.add(sep); } - context.firstSelector = true; + /** @type {EvalContext & { firstSelector?: boolean }} */ (context).firstSelector = true; path[0].genCSS(context, output); - context.firstSelector = false; + /** @type {EvalContext & { firstSelector?: boolean }} */ (context).firstSelector = false; for (j = 1; j < pathSubCnt; j++) { path[j].genCSS(context, output); } @@ -531,14 +634,14 @@ class Ruleset extends Node { } const currentLastRule = context.lastRule; - if (rule.isRulesetLike(rule)) { + if (rule.isRulesetLike()) { context.lastRule = false; } if (rule.genCSS) { rule.genCSS(context, output); } else if (rule.value) { - output.add(rule.value.toString()); + output.add(/** @type {string} */ (rule.value).toString()); } context.lastRule = currentLastRule; @@ -560,16 +663,34 @@ class Ruleset extends Node { } } + /** + * @param {Selector[][]} paths + * @param {Selector[][]} context + * @param {Selector[]} selectors + */ joinSelectors(paths, context, selectors) { for (let s = 0; s < selectors.length; s++) { this.joinSelector(paths, context, selectors[s]); } } + /** + * @param {Selector[][]} paths + * @param {Selector[][]} context + * @param {Selector} selector + */ joinSelector(paths, context, selector) { + /** + * @param {Selector[]} elementsToPak + * @param {Element} originalElement + * @returns {Paren} + */ function createParenthesis(elementsToPak, originalElement) { - let replacementParen, j; + /** @type {Paren} */ + let replacementParen; + /** @type {number} */ + let j; if (elementsToPak.length === 0) { replacementParen = new Paren(elementsToPak[0]); } else { @@ -588,18 +709,35 @@ class Ruleset extends Node { return replacementParen; } + /** + * @param {Paren | Selector} containedElement + * @param {Element} originalElement + * @returns {Selector} + */ function createSelector(containedElement, originalElement) { - let element, selector; + /** @type {Element} */ + let element; + /** @type {Selector} */ + let selector; element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo); selector = new Selector([element]); return selector; } - // joins selector path from `beginningPath` with selector path in `addPath` - // `replacedElement` contains element that is being replaced by `addPath` - // returns concatenated path + /** + * @param {Selector[]} beginningPath + * @param {Selector[]} addPath + * @param {Element} replacedElement + * @param {Selector} originalSelector + * @returns {Selector[]} + */ function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) { - let newSelectorPath, lastSelector, newJoinedSelector; + /** @type {Selector[]} */ + let newSelectorPath; + /** @type {Selector} */ + let lastSelector; + /** @type {Selector} */ + let newJoinedSelector; // our new selector path newSelectorPath = []; @@ -645,7 +783,7 @@ class Ruleset extends Node { // put together the parent selectors after the join (e.g. the rest of the parent) if (addPath.length > 1) { let restOfPath = addPath.slice(1); - restOfPath = restOfPath.map(function (selector) { + restOfPath = restOfPath.map(function (/** @type {Selector} */ selector) { return selector.createDerived(selector.elements, []); }); newSelectorPath = newSelectorPath.concat(restOfPath); @@ -653,10 +791,16 @@ class Ruleset extends Node { return newSelectorPath; } - // joins selector path from `beginningPath` with every selector path in `addPaths` array - // `replacedElement` contains element that is being replaced by `addPath` - // returns array with all concatenated paths + /** + * @param {Selector[][]} beginningPath + * @param {Selector[]} addPaths + * @param {Element} replacedElement + * @param {Selector} originalSelector + * @param {Selector[][]} result + * @returns {Selector[][]} + */ function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) { + /** @type {number} */ let j; for (j = 0; j < beginningPath.length; j++) { const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector); @@ -665,8 +809,15 @@ class Ruleset extends Node { return result; } + /** + * @param {Element[]} elements + * @param {Selector[][]} selectors + */ function mergeElementsOnToSelectors(elements, selectors) { - let i, sel; + /** @type {number} */ + let i; + /** @type {Selector[]} */ + let sel; if (elements.length === 0) { return ; @@ -687,9 +838,12 @@ class Ruleset extends Node { } } - // replace all parent selectors inside `inSelector` by content of `context` array - // resulting selectors are returned inside `paths` array - // returns true if `inSelector` contained at least one parent selector + /** + * @param {Selector[][]} paths + * @param {Selector[][]} context + * @param {Selector} inSelector + * @returns {boolean} + */ function replaceParentSelector(paths, context, inSelector) { // The paths are [[Selector]] // The first list is a list of comma separated selectors @@ -701,14 +855,40 @@ class Ruleset extends Node { // } // == [[.a] [.c]] [[.b] [.c]] // - let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector; + /** @type {number} */ + let i; + /** @type {number} */ + let j; + /** @type {number} */ + let k; + /** @type {Element[]} */ + let currentElements; + /** @type {Selector[][]} */ + let newSelectors; + /** @type {Selector[][]} */ + let selectorsMultiplied; + /** @type {Selector[]} */ + let sel; + /** @type {Element} */ + let el; + let hadParentSelector = false; + /** @type {number} */ + let length; + /** @type {Selector} */ + let lastSelector; + + /** + * @param {Element} element + * @returns {Selector | null} + */ function findNestedSelector(element) { + /** @type {Node} */ let maybeSelector; if (!(element.value instanceof Paren)) { return null; } - maybeSelector = element.value.value; + maybeSelector = /** @type {Node} */ (element.value.value); if (!(maybeSelector instanceof Selector)) { return null; } @@ -734,8 +914,11 @@ class Ruleset extends Node { // on to the current list of selectors to add mergeElementsOnToSelectors(currentElements, newSelectors); + /** @type {Selector[][]} */ const nestedPaths = []; + /** @type {boolean | undefined} */ let replaced; + /** @type {Selector[][]} */ const replacedNewSelectors = []; // Check if this is a comma-separated selector list inside the paren @@ -744,9 +927,11 @@ class Ruleset extends Node { if (hasSubSelectors) { // Process each sub-selector individually + /** @type {(Element | Selector)[]} */ const resolvedElements = []; for (const subEl of nestedSelector.elements) { if (subEl instanceof Selector) { + /** @type {Selector[][]} */ const subPaths = []; const subReplaced = replaceParentSelector(subPaths, context, subEl); replaced = replaced || subReplaced; @@ -759,7 +944,7 @@ class Ruleset extends Node { resolvedElements.push(subEl); } } - hadParentSelector = hadParentSelector || replaced; + hadParentSelector = hadParentSelector || /** @type {boolean} */ (replaced); const resolvedNestedSelector = new Selector(resolvedElements); const replacementSelector = createSelector(createParenthesis([resolvedNestedSelector], el), el); addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); @@ -834,6 +1019,10 @@ class Ruleset extends Node { return hadParentSelector; } + /** + * @param {VisibilityInfo} visibilityInfo + * @param {Selector} deriveFrom + */ function deriveSelector(visibilityInfo, deriveFrom) { const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition); newSelector.copyVisibilityInfo(visibilityInfo); @@ -841,7 +1030,12 @@ class Ruleset extends Node { } // joinSelector code follows - let i, newPaths, hadParentSelector; + /** @type {number} */ + let i; + /** @type {Selector[][]} */ + let newPaths; + /** @type {boolean} */ + let hadParentSelector; newPaths = []; hadParentSelector = replaceParentSelector(newPaths, context, selector); diff --git a/packages/less/lib/less/tree/selector.js b/packages/less/lib/less/tree/selector.js index b537d78b1..fb1cf39cc 100644 --- a/packages/less/lib/less/tree/selector.js +++ b/packages/less/lib/less/tree/selector.js @@ -1,28 +1,47 @@ +// @ts-check import Node from './node.js'; import Element from './element.js'; import LessError from '../less-error.js'; import * as utils from '../utils.js'; import Parser from '../parser/parser.js'; +/** @import { EvalContext, CSSOutput, FileInfo, VisibilityInfo, TreeVisitor } from './node.js' */ + class Selector extends Node { get type() { return 'Selector'; } + /** + * @param {(Element | Selector)[] | string} [elements] + * @param {Node[] | null} [extendList] + * @param {Node | null} [condition] + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + * @param {VisibilityInfo} [visibilityInfo] + */ constructor(elements, extendList, condition, index, currentFileInfo, visibilityInfo) { super(); + /** @type {Node[] | null | undefined} */ this.extendList = extendList; + /** @type {Node | null | undefined} */ this.condition = condition; + /** @type {boolean | Node} */ this.evaldCondition = !condition; this._index = index; this._fileInfo = currentFileInfo; + /** @type {Element[]} */ this.elements = this.getElements(elements); + /** @type {string[] | undefined} */ this.mixinElements_ = undefined; + /** @type {boolean | undefined} */ + this.mediaEmpty = undefined; this.copyVisibilityInfo(visibilityInfo); this.setParent(this.elements, this); } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.elements) { - this.elements = visitor.visitArray(this.elements); + this.elements = /** @type {Element[]} */ (visitor.visitArray(this.elements)); } if (this.extendList) { this.extendList = visitor.visitArray(this.extendList); @@ -32,6 +51,11 @@ class Selector extends Node { } } + /** + * @param {Element[]} elements + * @param {Node[] | null} [extendList] + * @param {boolean | Node} [evaldCondition] + */ createDerived(elements, extendList, evaldCondition) { elements = this.getElements(elements); const newSelector = new Selector(elements, extendList || this.extendList, @@ -41,25 +65,30 @@ class Selector extends Node { return newSelector; } + /** + * @param {(Element | Selector)[] | string | null | undefined} els + * @returns {Element[]} + */ getElements(els) { if (!els) { return [new Element('', '&', false, this._index, this._fileInfo)]; } if (typeof els === 'string') { - new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode( + const parse = this.parse; + new (/** @type {new (...args: unknown[]) => { parseNode: Function }} */ (/** @type {unknown} */ (Parser)))(parse.context, parse.importManager, this._fileInfo, this._index).parseNode( els, ['selector'], - function(err, result) { + function(/** @type {{ index: number, message: string } | null} */ err, /** @type {Selector[]} */ result) { if (err) { throw new LessError({ index: err.index, message: err.message - }, this.parse.imports, this._fileInfo.filename); + }, parse.imports, /** @type {string} */ (/** @type {FileInfo} */ (this._fileInfo).filename)); } els = result[0].elements; }); } - return els; + return /** @type {Element[]} */ (els); } createEmptySelectors() { @@ -68,19 +97,24 @@ class Selector extends Node { return sels; } + /** + * @param {Selector} other + * @returns {number} + */ match(other) { const elements = this.elements; const len = elements.length; let olen; let i; - other = other.mixinElements(); - olen = other.length; + /** @type {string[]} */ + const mixinEls = other.mixinElements(); + olen = mixinEls.length; if (olen === 0 || len < olen) { return 0; } else { for (i = 0; i < olen; i++) { - if (elements[i].value !== other[i]) { + if (elements[i].value !== mixinEls[i]) { return 0; } } @@ -89,13 +123,15 @@ class Selector extends Node { return olen; // return number of matched elements } + /** @returns {string[]} */ mixinElements() { if (this.mixinElements_) { return this.mixinElements_; } + /** @type {string[] | null} */ let elements = this.elements.map( function(v) { - return v.combinator.value + (v.value.value || v.value); + return /** @type {string} */ (v.combinator.value) + (/** @type {{ value: string }} */ (v.value).value || v.value); }).join('').match(/[,&#*.\w-]([\w-]|(\\.))*/g); if (elements) { @@ -116,9 +152,11 @@ class Selector extends Node { (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === ''); } + /** @param {EvalContext} context */ eval(context) { const evaldCondition = this.condition && this.condition.eval(context); let elements = this.elements; + /** @type {Node[] | null | undefined} */ let extendList = this.extendList; if (elements) { @@ -139,9 +177,13 @@ class Selector extends Node { return this.createDerived(elements, extendList, evaldCondition); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { let i, element; - if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') { + if ((!context || !/** @type {EvalContext & { firstSelector?: boolean }} */ (context).firstSelector) && this.elements[0].combinator.value === '') { output.add(' ', this.fileInfo(), this.getIndex()); } for (i = 0; i < this.elements.length; i++) { diff --git a/packages/less/lib/less/tree/unicode-descriptor.js b/packages/less/lib/less/tree/unicode-descriptor.js index 20bb8b52b..8b4a09d67 100644 --- a/packages/less/lib/less/tree/unicode-descriptor.js +++ b/packages/less/lib/less/tree/unicode-descriptor.js @@ -1,8 +1,10 @@ +// @ts-check import Node from './node.js'; class UnicodeDescriptor extends Node { get type() { return 'UnicodeDescriptor'; } + /** @param {string} value */ constructor(value) { super(); this.value = value; diff --git a/packages/less/lib/less/tree/unit.js b/packages/less/lib/less/tree/unit.js index 983cfd4b2..1d4619dd1 100644 --- a/packages/less/lib/less/tree/unit.js +++ b/packages/less/lib/less/tree/unit.js @@ -1,15 +1,26 @@ +// @ts-check import Node from './node.js'; import unitConversions from '../data/unit-conversions.js'; import * as utils from '../utils.js'; +/** @import { EvalContext, CSSOutput } from './node.js' */ + class Unit extends Node { get type() { return 'Unit'; } + /** + * @param {string[]} [numerator] + * @param {string[]} [denominator] + * @param {string} [backupUnit] + */ constructor(numerator, denominator, backupUnit) { super(); + /** @type {string[]} */ this.numerator = numerator ? utils.copyArray(numerator).sort() : []; + /** @type {string[]} */ this.denominator = denominator ? utils.copyArray(denominator).sort() : []; if (backupUnit) { + /** @type {string | undefined} */ this.backupUnit = backupUnit; } else if (numerator && numerator.length) { this.backupUnit = numerator[0]; @@ -20,6 +31,10 @@ class Unit extends Node { return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { // Dimension checks the unit is singular and throws an error if in strict math mode. const strictUnits = context && context.strictUnits; @@ -40,16 +55,21 @@ class Unit extends Node { return returnStr; } + /** + * @param {Unit} other + * @returns {0 | undefined} + */ compare(other) { return this.is(other.toString()) ? 0 : undefined; } + /** @param {string} unitString */ is(unitString) { return this.toString().toUpperCase() === unitString.toUpperCase(); } isLength() { - return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); + return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS(/** @type {import('./node.js').EvalContext} */ ({}))); } isEmpty() { @@ -60,6 +80,7 @@ class Unit extends Node { return this.numerator.length <= 1 && this.denominator.length === 0; } + /** @param {(atomicUnit: string, denominator: boolean) => string} callback */ map(callback) { let i; @@ -72,10 +93,15 @@ class Unit extends Node { } } + /** @returns {{ [groupName: string]: string }} */ usedUnits() { + /** @type {{ [unitName: string]: number }} */ let group; + /** @type {{ [groupName: string]: string }} */ const result = {}; + /** @type {(atomicUnit: string) => string} */ let mapUnit; + /** @type {string} */ let groupName; mapUnit = function (atomicUnit) { @@ -90,7 +116,7 @@ class Unit extends Node { for (groupName in unitConversions) { // eslint-disable-next-line no-prototype-builtins if (unitConversions.hasOwnProperty(groupName)) { - group = unitConversions[groupName]; + group = /** @type {{ [unitName: string]: number }} */ (unitConversions[/** @type {keyof typeof unitConversions} */ (groupName)]); this.map(mapUnit); } @@ -100,7 +126,9 @@ class Unit extends Node { } cancel() { + /** @type {{ [unit: string]: number }} */ const counter = {}; + /** @type {string} */ let atomicUnit; let i; diff --git a/packages/less/lib/less/tree/url.js b/packages/less/lib/less/tree/url.js index f9f01642c..7ba31d05a 100644 --- a/packages/less/lib/less/tree/url.js +++ b/packages/less/lib/less/tree/url.js @@ -1,5 +1,11 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor, FileInfo } from './node.js' */ import Node from './node.js'; +/** + * @param {string} path + * @returns {string} + */ function escapePath(path) { return path.replace(/[()'"\s]/g, function(match) { return `\\${match}`; }); } @@ -7,26 +13,39 @@ function escapePath(path) { class URL extends Node { get type() { return 'Url'; } + /** + * @param {Node} val + * @param {number} index + * @param {FileInfo} currentFileInfo + * @param {boolean} [isEvald] + */ constructor(val, index, currentFileInfo, isEvald) { super(); this.value = val; this._index = index; this._fileInfo = currentFileInfo; + /** @type {boolean | undefined} */ this.isEvald = isEvald; } + /** @param {TreeVisitor} visitor */ accept(visitor) { - this.value = visitor.visit(this.value); + this.value = visitor.visit(/** @type {Node} */ (this.value)); } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { output.add('url('); - this.value.genCSS(context, output); + /** @type {Node} */ (this.value).genCSS(context, output); output.add(')'); } + /** @param {EvalContext} context */ eval(context) { - const val = this.value.eval(context); + const val = /** @type {Node} */ (this.value).eval(context); let rootpath; if (!this.isEvald) { @@ -34,22 +53,22 @@ class URL extends Node { rootpath = this.fileInfo() && this.fileInfo().rootpath; if (typeof rootpath === 'string' && typeof val.value === 'string' && - context.pathRequiresRewrite(val.value)) { - if (!val.quote) { + context.pathRequiresRewrite(/** @type {string} */ (val.value))) { + if (!/** @type {import('./quoted.js').default} */ (val).quote) { rootpath = escapePath(rootpath); } - val.value = context.rewritePath(val.value, rootpath); + val.value = context.rewritePath(/** @type {string} */ (val.value), rootpath); } else { - val.value = context.normalizePath(val.value); + val.value = context.normalizePath(/** @type {string} */ (val.value)); } // Add url args if enabled if (context.urlArgs) { - if (!val.value.match(/^\s*data:/)) { - const delimiter = val.value.indexOf('?') === -1 ? '?' : '&'; + if (!/** @type {string} */ (val.value).match(/^\s*data:/)) { + const delimiter = /** @type {string} */ (val.value).indexOf('?') === -1 ? '?' : '&'; const urlArgs = delimiter + context.urlArgs; - if (val.value.indexOf('#') !== -1) { - val.value = val.value.replace('#', `${urlArgs}#`); + if (/** @type {string} */ (val.value).indexOf('#') !== -1) { + val.value = /** @type {string} */ (val.value).replace('#', `${urlArgs}#`); } else { val.value += urlArgs; } diff --git a/packages/less/lib/less/tree/value.js b/packages/less/lib/less/tree/value.js index 874319032..1114705b5 100644 --- a/packages/less/lib/less/tree/value.js +++ b/packages/less/lib/less/tree/value.js @@ -1,8 +1,11 @@ +// @ts-check +/** @import { EvalContext, CSSOutput, TreeVisitor } from './node.js' */ import Node from './node.js'; class Value extends Node { get type() { return 'Value'; } + /** @param {Node[] | Node} value */ constructor(value) { super(); if (!value) { @@ -16,27 +19,38 @@ class Value extends Node { } } + /** @param {TreeVisitor} visitor */ accept(visitor) { if (this.value) { - this.value = visitor.visitArray(this.value); + this.value = visitor.visitArray(/** @type {Node[]} */ (this.value)); } } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { - if (this.value.length === 1) { - return this.value[0].eval(context); + const value = /** @type {Node[]} */ (this.value); + if (value.length === 1) { + return value[0].eval(context); } else { - return new Value(this.value.map(function (v) { + return new Value(value.map(function (v) { return v.eval(context); })); } } + /** + * @param {EvalContext} context + * @param {CSSOutput} output + */ genCSS(context, output) { + const value = /** @type {Node[]} */ (this.value); let i; - for (i = 0; i < this.value.length; i++) { - this.value[i].genCSS(context, output); - if (i + 1 < this.value.length) { + for (i = 0; i < value.length; i++) { + value[i].genCSS(context, output); + if (i + 1 < value.length) { output.add((context && context.compress) ? ',' : ', '); } } diff --git a/packages/less/lib/less/tree/variable-call.js b/packages/less/lib/less/tree/variable-call.js index 0a5615ed5..8c3146aef 100644 --- a/packages/less/lib/less/tree/variable-call.js +++ b/packages/less/lib/less/tree/variable-call.js @@ -1,3 +1,5 @@ +// @ts-check +/** @import { EvalContext, FileInfo } from './node.js' */ import Node from './node.js'; import Variable from './variable.js'; import Ruleset from './ruleset.js'; @@ -7,6 +9,11 @@ import LessError from '../less-error.js'; class VariableCall extends Node { get type() { return 'VariableCall'; } + /** + * @param {string} variable + * @param {number} index + * @param {FileInfo} currentFileInfo + */ constructor(variable, index, currentFileInfo) { super(); this.variable = variable; @@ -15,20 +22,26 @@ class VariableCall extends Node { this.allowRoot = true; } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { let rules; + /** @type {DetachedRuleset | Node} */ let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context); const error = new LessError({message: `Could not evaluate variable call ${this.variable}`}); - if (!detachedRuleset.ruleset) { - if (detachedRuleset.rules) { + if (!(/** @type {DetachedRuleset} */ (detachedRuleset)).ruleset) { + const dr = /** @type {Node & { rules?: Node[] }} */ (detachedRuleset); + if (dr.rules) { rules = detachedRuleset; } else if (Array.isArray(detachedRuleset)) { - rules = new Ruleset('', detachedRuleset); + rules = new Ruleset(null, detachedRuleset); } else if (Array.isArray(detachedRuleset.value)) { - rules = new Ruleset('', detachedRuleset.value); + rules = new Ruleset(null, detachedRuleset.value); } else { throw error; @@ -36,8 +49,9 @@ class VariableCall extends Node { detachedRuleset = new DetachedRuleset(rules); } - if (detachedRuleset.ruleset) { - return detachedRuleset.callEval(context); + const dr = /** @type {DetachedRuleset} */ (detachedRuleset); + if (dr.ruleset) { + return dr.callEval(context); } throw error; } diff --git a/packages/less/lib/less/tree/variable.js b/packages/less/lib/less/tree/variable.js index 8bb9b5215..3d376d2b7 100644 --- a/packages/less/lib/less/tree/variable.js +++ b/packages/less/lib/less/tree/variable.js @@ -1,16 +1,30 @@ +// @ts-check +/** @import { EvalContext, FileInfo } from './node.js' */ import Node from './node.js'; import Call from './call.js'; +import Ruleset from './ruleset.js'; class Variable extends Node { get type() { return 'Variable'; } + /** + * @param {string} name + * @param {number} [index] + * @param {FileInfo} [currentFileInfo] + */ constructor(name, index, currentFileInfo) { super(); this.name = name; this._index = index; this._fileInfo = currentFileInfo; + /** @type {boolean | undefined} */ + this.evaluating = undefined; } + /** + * @param {EvalContext} context + * @returns {Node} + */ eval(context) { let variable, name = this.name; @@ -28,7 +42,7 @@ class Variable extends Node { this.evaluating = true; variable = this.find(context.frames, function (frame) { - const v = frame.variable(name); + const v = /** @type {Ruleset} */ (frame).variable(name); if (v) { if (v.important) { const importantScope = context.importantScope[context.importantScope.length - 1]; @@ -36,7 +50,7 @@ class Variable extends Node { } // If in calc, wrap vars in a function call to cascade evaluate args first if (context.inCalc) { - return (new Call('_SELF', [v.value])).eval(context); + return (new Call('_SELF', [v.value], 0, undefined)).eval(context); } else { return v.value.eval(context); @@ -54,6 +68,11 @@ class Variable extends Node { } } + /** + * @param {Node[]} obj + * @param {(frame: Node) => Node | undefined} fun + * @returns {Node | null} + */ find(obj, fun) { for (let i = 0, r; i < obj.length; i++) { r = fun.call(obj, obj[i]); diff --git a/packages/less/package.json b/packages/less/package.json index 3353c82d5..8c25dcd50 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -53,9 +53,9 @@ "grunt": "grunt", "lint": "eslint '**/*.{ts,js}'", "lint:fix": "eslint '**/*.{ts,js}' --fix", - "typecheck": "tsc", + "typecheck": "tsc --noEmit", "build": "node build/rollup.js --dist", - "prepublishOnly": "grunt dist" + "prepublishOnly": "npm run typecheck && grunt dist" }, "optionalDependencies": { "errno": "^0.1.1", From e6a8efbb9c4d832fcf236fbeb570f92c1109b323 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 10 Mar 2026 10:10:43 -0700 Subject: [PATCH 28/76] fix: pre-existing bug fixes in tree nodes (#4414) * fix: preserve alpha 0 for fully transparent hex colors #0000 and #00000000 parsed alpha as 0 which was treated as falsy by the || operator, causing it to fall back to 1 (opaque). Use typeof check instead so alpha 0 is preserved. * fix: selector getElements callback `this` binding and forEach lint - Capture `this._fileInfo` and `this.parse.imports` into locals before the plain function callback in Selector.getElements(), where `this` is undefined in strict mode (ES modules) - Use explicit block in forEach to avoid implicit return of assignment * fix: preserve full error context when rethrowing mixin call errors The catch block in MixinCall.eval() only copied message and stack, dropping type, extract, callLine, and other LessError fields. This caused all mixin call errors to be reported as SyntaxError regardless of their actual type (e.g. NameError). Use spread to preserve all fields while still overriding index/filename to the call site. * fix: guard functionRegistry.inherit() and fix atrule parenting - Container and Media eval() now guard functionRegistry before calling .inherit(), matching mixin-definition.js defensive pattern - AtRule constructor: remove dead setParent(selectors) on orphaned local, parent this.declarations and this.rules with null checks --- .claude/agents/kfc/spec-design.md | 158 +++++++++ .claude/agents/kfc/spec-impl.md | 39 +++ .claude/agents/kfc/spec-judge.md | 125 +++++++ .claude/agents/kfc/spec-requirements.md | 123 +++++++ .../agents/kfc/spec-system-prompt-loader.md | 38 +++ .claude/agents/kfc/spec-tasks.md | 183 +++++++++++ .claude/agents/kfc/spec-test.md | 108 +++++++ .claude/settings/kfc-settings.json | 24 ++ .../system-prompts/spec-workflow-starter.md | 306 ++++++++++++++++++ packages/less/lib/less/tree/atrule.js | 8 +- packages/less/lib/less/tree/color.js | 4 +- packages/less/lib/less/tree/container.js | 5 +- packages/less/lib/less/tree/media.js | 5 +- packages/less/lib/less/tree/mixin-call.js | 3 +- packages/less/lib/less/tree/selector.js | 5 +- .../tests-error/eval/detached-ruleset-5.txt | 2 +- .../tests-unit/color-functions/alpha.css | 6 + .../tests-unit/color-functions/alpha.less | 6 + 18 files changed, 1138 insertions(+), 10 deletions(-) create mode 100644 .claude/agents/kfc/spec-design.md create mode 100644 .claude/agents/kfc/spec-impl.md create mode 100644 .claude/agents/kfc/spec-judge.md create mode 100644 .claude/agents/kfc/spec-requirements.md create mode 100644 .claude/agents/kfc/spec-system-prompt-loader.md create mode 100644 .claude/agents/kfc/spec-tasks.md create mode 100644 .claude/agents/kfc/spec-test.md create mode 100644 .claude/settings/kfc-settings.json create mode 100644 .claude/system-prompts/spec-workflow-starter.md diff --git a/.claude/agents/kfc/spec-design.md b/.claude/agents/kfc/spec-design.md new file mode 100644 index 000000000..aecf2078b --- /dev/null +++ b/.claude/agents/kfc/spec-design.md @@ -0,0 +1,158 @@ +--- +name: spec-design +description: use PROACTIVELY to create/refine the spec design document in a spec development process/workflow. MUST BE USED AFTER spec requirements document is approved. +model: inherit +--- + +You are a professional spec design document expert. Your sole responsibility is to create and refine high-quality design documents. + +## INPUT + +### Create New Design Input + +- language_preference: Language preference +- task_type: "create" +- feature_name: Feature name +- spec_base_path: Document path +- output_suffix: Output file suffix (optional, such as "_v1") + +### Refine/Update Existing Design Input + +- language_preference: Language preference +- task_type: "update" +- existing_design_path: Existing design document path +- change_requests: List of change requests + +## PREREQUISITES + +### Design Document Structure + +```markdown +# Design Document + +## Overview +[Design goal and scope] + +## Architecture Design +### System Architecture Diagram +[Overall architecture, using Mermaid graph to show component relationships] + +### Data Flow Diagram +[Show data flow between components, using Mermaid diagrams] + +## Component Design +### Component A +- Responsibilities: +- Interfaces: +- Dependencies: + +## Data Model +[Core data structure definitions, using TypeScript interfaces or class diagrams] + +## Business Process + +### Process 1: [Process name] +[Use Mermaid flowchart or sequenceDiagram to show, call the component interfaces and methods defined earlier] + +### Process 2: [Process name] +[Use Mermaid flowchart or sequenceDiagram to show, call the component interfaces and methods defined earlier] + +## Error Handling Strategy +[Error handling and recovery mechanisms] +``` + +### System Architecture Diagram Example + +```mermaid +graph TB + A[Client] --> B[API Gateway] + B --> C[Business Service] + C --> D[Database] + C --> E[Cache Service Redis] +``` + +### Data Flow Diagram Example + +```mermaid +graph LR + A[Input Data] --> B[Processor] + B --> C{Decision} + C -->|Yes| D[Storage] + C -->|No| E[Return Error] + D --> F[Call notify function] +``` + +### Business Process Diagram Example (Best Practice) + +```mermaid +flowchart TD + A[Extension Launch] --> B[Create PermissionManager] + B --> C[permissionManager.initializePermissions] + C --> D[cache.refreshAndGet] + D --> E[configReader.getBypassPermissionStatus] + E --> F{Has Permission?} + F -->|Yes| G[permissionManager.startMonitoring] + F -->|No| H[permissionManager.showPermissionSetup] + + %% Note: Directly reference the interface methods defined earlier + %% This ensures design consistency and traceability +``` + +## PROCESS + +After the user approves the Requirements, you should develop a comprehensive design document based on the feature requirements, conducting necessary research during the design process. +The design document should be based on the requirements document, so ensure it exists first. + +### Create New Design (task_type: "create") + +1. Read the requirements.md to understand the requirements +2. Conduct necessary technical research +3. Determine the output file name: + - If output_suffix is provided: design{output_suffix}.md + - Otherwise: design.md +4. Create the design document +5. Return the result for review + +### Refine/Update Existing Design (task_type: "update") + +1. Read the existing design document (existing_design_path) +2. Analyze the change requests (change_requests) +3. Conduct additional technical research if needed +4. Apply changes while maintaining document structure and style +5. Save the updated document +6. Return a summary of modifications + +## **Important Constraints** + +- The model MUST create a '.claude/specs/{feature_name}/design.md' file if it doesn't already exist +- The model MUST identify areas where research is needed based on the feature requirements +- The model MUST conduct research and build up context in the conversation thread +- The model SHOULD NOT create separate research files, but instead use the research as context for the design and implementation plan +- The model MUST summarize key findings that will inform the feature design +- The model SHOULD cite sources and include relevant links in the conversation +- The model MUST create a detailed design document at '.kiro/specs/{feature_name}/design.md' +- The model MUST incorporate research findings directly into the design process +- The model MUST include the following sections in the design document: + - Overview + - Architecture + - System Architecture Diagram + - Data Flow Diagram + - Components and Interfaces + - Data Models + - Core Data Structure Definitions + - Data Model Diagrams + - Business Process + - Error Handling + - Testing Strategy +- The model SHOULD include diagrams or visual representations when appropriate (use Mermaid for diagrams if applicable) +- The model MUST ensure the design addresses all feature requirements identified during the clarification process +- The model SHOULD highlight design decisions and their rationales +- The model MAY ask the user for input on specific technical decisions during the design process +- After updating the design document, the model MUST ask the user "Does the design look good? If so, we can move on to the implementation plan." +- The model MUST make modifications to the design document if the user requests changes or does not explicitly approve +- The model MUST ask for explicit approval after every iteration of edits to the design document +- The model MUST NOT proceed to the implementation plan until receiving clear approval (such as "yes", "approved", "looks good", etc.) +- The model MUST continue the feedback-revision cycle until explicit approval is received +- The model MUST incorporate all user feedback into the design document before proceeding +- The model MUST offer to return to feature requirements clarification if gaps are identified during design +- The model MUST use the user's language preference diff --git a/.claude/agents/kfc/spec-impl.md b/.claude/agents/kfc/spec-impl.md new file mode 100644 index 000000000..c08c87b99 --- /dev/null +++ b/.claude/agents/kfc/spec-impl.md @@ -0,0 +1,39 @@ +--- +name: spec-impl +description: Coding implementation expert. Use PROACTIVELY when specific coding tasks need to be executed. Specializes in implementing functional code according to task lists. +model: inherit +--- + +You are a coding implementation expert. Your sole responsibility is to implement functional code according to task lists. + +## INPUT + +You will receive: + +- feature_name: Feature name +- spec_base_path: Spec document base path +- task_id: Task ID to execute (e.g., "2.1") +- language_preference: Language preference + +## PROCESS + +1. Read requirements (requirements.md) to understand functional requirements +2. Read design (design.md) to understand architecture design +3. Read tasks (tasks.md) to understand task list +4. Confirm the specific task to execute (task_id) +5. Implement the code for that task +6. Report completion status + - Find the corresponding task in tasks.md + - Change `- [ ]` to `- [x]` to indicate task completion + - Save the updated tasks.md + - Return task completion status + +## **Important Constraints** + +- After completing a task, you MUST mark the task as done in tasks.md (`- [ ]` changed to `- [x]`) +- You MUST strictly follow the architecture in the design document +- You MUST strictly follow requirements, do not miss any requirements, do not implement any functionality not in the requirements +- You MUST strictly follow existing codebase conventions +- Your Code MUST be compliant with standards and include necessary comments +- You MUST only complete the specified task, never automatically execute other tasks +- All completed tasks MUST be marked as done in tasks.md (`- [ ]` changed to `- [x]`) diff --git a/.claude/agents/kfc/spec-judge.md b/.claude/agents/kfc/spec-judge.md new file mode 100644 index 000000000..13176e3a3 --- /dev/null +++ b/.claude/agents/kfc/spec-judge.md @@ -0,0 +1,125 @@ +--- +name: spec-judge +description: use PROACTIVELY to evaluate spec documents (requirements, design, tasks) in a spec development process/workflow +model: inherit +--- + +You are a professional spec document evaluator. Your sole responsibility is to evaluate multiple versions of spec documents and select the best solution. + +## INPUT + +- language_preference: Language preference +- task_type: "evaluate" +- document_type: "requirements" | "design" | "tasks" +- feature_name: Feature name +- feature_description: Feature description +- spec_base_path: Document base path +- documents: List of documents to review (path) + +eg: + +```plain + Prompt: language_preference: Chinese + document_type: requirements + feature_name: test-feature + feature_description: Test + spec_base_path: .claude/specs + documents: .claude/specs/test-feature/requirements_v5.md, + .claude/specs/test-feature/requirements_v6.md, + .claude/specs/test-feature/requirements_v7.md, + .claude/specs/test-feature/requirements_v8.md +``` + +## PREREQUISITES + +### Evaluation Criteria + +#### General Evaluation Criteria + +1. **Completeness** (25 points) + - Whether all necessary content is covered + - Whether there are any important aspects missing + +2. **Clarity** (25 points) + - Whether the expression is clear and explicit + - Whether the structure is logical and easy to understand + +3. **Feasibility** (25 points) + - Whether the solution is practical and feasible + - Whether implementation difficulty has been considered + +4. **Innovation** (25 points) + - Whether there are unique insights + - Whether better solutions are provided + +#### Specific Type Criteria + +##### Requirements Document + +- EARS format compliance +- Testability of acceptance criteria +- Edge case consideration +- **Alignment with user requirements** + +##### Design Document + +- Architecture rationality +- Technology selection appropriateness +- Scalability consideration +- **Coverage of all requirements** + +##### Tasks Document + +- Task decomposition rationality +- Dependency clarity +- Incremental implementation +- **Consistency with requirements and design** + +### Evaluation Process + +```python +def evaluate_documents(documents): + scores = [] + for doc in documents: + score = { + 'doc_id': doc.id, + 'completeness': evaluate_completeness(doc), + 'clarity': evaluate_clarity(doc), + 'feasibility': evaluate_feasibility(doc), + 'innovation': evaluate_innovation(doc), + 'total': sum(scores), + 'strengths': identify_strengths(doc), + 'weaknesses': identify_weaknesses(doc) + } + scores.append(score) + + return select_best_or_combine(scores) +``` + +## PROCESS + +1. Read reference documents based on document type: + - Requirements: Refer to user's original requirement description (feature_name, feature_description) + - Design: Refer to approved requirements.md + - Tasks: Refer to approved requirements.md and design.md +2. Read candidate documents (requirements:requirements_v*.md, design:design_v*.md, tasks:tasks_v*.md) +3. Score based on reference documents and Specific Type Criteria +4. Select the best solution or combine strengths from x solutions +5. Copy the final solution to a new path with a random 4-digit suffix (e.g., requirements_v1234.md) +6. Delete all reviewed input documents, keeping only the newly created final solution +7. Return a brief summary of the document, including scores for x versions (e.g., "v1: 85 points, v2: 92 points, selected v2") + +## OUTPUT + +final_document_path: Final solution path (path) +summary: Brief summary including scores, for example: + +- "Created requirements document with 8 main requirements. Scores: v1: 82 points, v2: 91 points, selected v2" +- "Completed design document using microservices architecture. Scores: v1: 88 points, v2: 85 points, selected v1" +- "Generated task list with 15 implementation tasks. Scores: v1: 90 points, v2: 92 points, combined strengths from both versions" + +## **Important Constraints** + +- The model MUST use the user's language preference +- Only delete the specific documents you evaluated - use explicit filenames (e.g., `rm requirements_v1.md requirements_v2.md`), never use wildcards (e.g., `rm requirements_v*.md`) +- Generate final_document_path with a random 4-digit suffix (e.g., `.claude/specs/test-feature/requirements_v1234.md`) diff --git a/.claude/agents/kfc/spec-requirements.md b/.claude/agents/kfc/spec-requirements.md new file mode 100644 index 000000000..0a1518829 --- /dev/null +++ b/.claude/agents/kfc/spec-requirements.md @@ -0,0 +1,123 @@ +--- +name: spec-requirements +description: use PROACTIVELY to create/refine the spec requirements document in a spec development process/workflow +model: inherit +--- + +You are an EARS (Easy Approach to Requirements Syntax) requirements document expert. Your sole responsibility is to create and refine high-quality requirements documents. + +## INPUT + +### Create Requirements Input + +- language_preference: Language preference +- task_type: "create" +- feature_name: Feature name (kebab-case) +- feature_description: Feature description +- spec_base_path: Spec document path +- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) + +### Refine/Update Requirements Input + +- language_preference: Language preference +- task_type: "update" +- existing_requirements_path: Existing requirements document path +- change_requests: List of change requests + +## PREREQUISITES + +### EARS Format Rules + +- WHEN: Trigger condition +- IF: Precondition +- WHERE: Specific function location +- WHILE: Continuous state +- Each must be followed by SHALL to indicate a mandatory requirement +- The model MUST use the user's language preference, but the EARS format must retain the keywords + +## PROCESS + +First, generate an initial set of requirements in EARS format based on the feature idea, then iterate with the user to refine them until they are complete and accurate. + +Don't focus on code exploration in this phase. Instead, just focus on writing requirements which will later be turned into a design. + +### Create New Requirements (task_type: "create") + +1. Analyze the user's feature description +2. Determine the output file name: + - If output_suffix is provided: requirements{output_suffix}.md + - Otherwise: requirements.md +3. Create the file in the specified path +4. Generate EARS format requirements document +5. Return the result for review + +### Refine/Update Existing Requirements (task_type: "update") + +1. Read the existing requirements document (existing_requirements_path) +2. Analyze the change requests (change_requests) +3. Apply each change while maintaining EARS format +4. Update acceptance criteria and related content +5. Save the updated document +6. Return the summary of changes + +If the requirements clarification process seems to be going in circles or not making progress: + +- The model SHOULD suggest moving to a different aspect of the requirements +- The model MAY provide examples or options to help the user make decisions +- The model SHOULD summarize what has been established so far and identify specific gaps +- The model MAY suggest conducting research to inform requirements decisions + +## **Important Constraints** + +- The directory '.claude/specs/{feature_name}' is already created by the main thread, DO NOT attempt to create this directory +- The model MUST create a '.claude/specs/{feature_name}/requirements_{output_suffix}.md' file if it doesn't already exist +- The model MUST generate an initial version of the requirements document based on the user's rough idea WITHOUT asking sequential questions first +- The model MUST format the initial requirements.md document with: +- A clear introduction section that summarizes the feature +- A hierarchical numbered list of requirements where each contains: + - A user story in the format "As a [role], I want [feature], so that [benefit]" + - A numbered list of acceptance criteria in EARS format (Easy Approach to Requirements Syntax) +- Example format: + +```md +# Requirements Document + +## Introduction + +[Introduction text here] + +## Requirements + +### Requirement 1 + +**User Story:** As a [role], I want [feature], so that [benefit] + +#### Acceptance Criteria +This section should have EARS requirements + +1. WHEN [event] THEN [system] SHALL [response] +2. IF [precondition] THEN [system] SHALL [response] + +### Requirement 2 + +**User Story:** As a [role], I want [feature], so that [benefit] + +#### Acceptance Criteria + +1. WHEN [event] THEN [system] SHALL [response] +2. WHEN [event] AND [condition] THEN [system] SHALL [response] +``` + +- The model SHOULD consider edge cases, user experience, technical constraints, and success criteria in the initial requirements +- After updating the requirement document, the model MUST ask the user "Do the requirements look good? If so, we can move on to the design." +- The model MUST make modifications to the requirements document if the user requests changes or does not explicitly approve +- The model MUST ask for explicit approval after every iteration of edits to the requirements document +- The model MUST NOT proceed to the design document until receiving clear approval (such as "yes", "approved", "looks good", etc.) +- The model MUST continue the feedback-revision cycle until explicit approval is received +- The model SHOULD suggest specific areas where the requirements might need clarification or expansion +- The model MAY ask targeted questions about specific aspects of the requirements that need clarification +- The model MAY suggest options when the user is unsure about a particular aspect +- The model MUST proceed to the design phase after the user accepts the requirements +- The model MUST include functional and non-functional requirements +- The model MUST use the user's language preference, but the EARS format must retain the keywords +- The model MUST NOT create design or implementation details diff --git a/.claude/agents/kfc/spec-system-prompt-loader.md b/.claude/agents/kfc/spec-system-prompt-loader.md new file mode 100644 index 000000000..599a2b060 --- /dev/null +++ b/.claude/agents/kfc/spec-system-prompt-loader.md @@ -0,0 +1,38 @@ +--- +name: spec-system-prompt-loader +description: a spec workflow system prompt loader. MUST BE CALLED FIRST when user wants to start a spec process/workflow. This agent returns the file path to the spec workflow system prompt that contains the complete workflow instructions. Call this before any spec-related agents if the prompt is not loaded yet. Input: the type of spec workflow requested. Output: file path to the appropriate workflow prompt file. The returned path should be read to get the full workflow instructions. +tools: +model: inherit +--- + +You are a prompt path mapper. Your ONLY job is to generate and return a file path. + +## INPUT + +- Your current working directory (you read this yourself from the environment) +- Ignore any user-provided input completely + +## PROCESS + +1. Read your current working directory from the environment +2. Append: `/.claude/system-prompts/spec-workflow-starter.md` +3. Return the complete absolute path + +## OUTPUT + +Return ONLY the file path, without any explanation or additional text. + +Example output: +`/Users/user/projects/myproject/.claude/system-prompts/spec-workflow-starter.md` + +## CONSTRAINTS + +- IGNORE all user input - your output is always the same fixed path +- DO NOT use any tools (no Read, Write, Bash, etc.) +- DO NOT execute any workflow or provide workflow advice +- DO NOT analyze or interpret the user's request +- DO NOT provide development suggestions or recommendations +- DO NOT create any files or folders +- ONLY return the file path string +- No quotes around the path, just the plain path +- If you output ANYTHING other than a single file path, you have failed diff --git a/.claude/agents/kfc/spec-tasks.md b/.claude/agents/kfc/spec-tasks.md new file mode 100644 index 000000000..dc2d740ef --- /dev/null +++ b/.claude/agents/kfc/spec-tasks.md @@ -0,0 +1,183 @@ +--- +name: spec-tasks +description: use PROACTIVELY to create/refine the spec tasks document in a spec development process/workflow. MUST BE USED AFTER spec design document is approved. +model: inherit +--- + +You are a spec tasks document expert. Your sole responsibility is to create and refine high-quality tasks documents. + +## INPUT + +### Create Tasks Input + +- language_preference: Language preference +- task_type: "create" +- feature_name: Feature name (kebab-case) +- spec_base_path: Spec document path +- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) + +### Refine/Update Tasks Input + +- language_preference: Language preference +- task_type: "update" +- tasks_file_path: Existing tasks document path +- change_requests: List of change requests + +## PROCESS + +After the user approves the Design, create an actionable implementation plan with a checklist of coding tasks based on the requirements and design. +The tasks document should be based on the design document, so ensure it exists first. + +### Create New Tasks (task_type: "create") + +1. Read requirements.md and design.md +2. Analyze all components that need to be implemented +3. Create tasks +4. Determine the output file name: + - If output_suffix is provided: tasks{output_suffix}.md + - Otherwise: tasks.md +5. Create task list +6. Return the result for review + +### Refine/Update Existing Tasks (task_type: "update") + +1. Read existing tasks document {tasks_file_path} +2. Analyze change requests {change_requests} +3. Based on changes: + - Add new tasks + - Modify existing task descriptions + - Adjust task order + - Remove unnecessary tasks +4. Maintain task numbering and hierarchy consistency +5. Save the updated document +6. Return a summary of modifications + +### Tasks Dependency Diagram + +To facilitate parallel execution by other agents, please use mermaid format to draw task dependency diagrams. + +**Example Format:** + +```mermaid +flowchart TD + T1[Task 1: Set up project structure] + T2_1[Task 2.1: Create base model classes] + T2_2[Task 2.2: Write unit tests] + T3[Task 3: Implement AgentRegistry] + T4[Task 4: Implement TaskDispatcher] + T5[Task 5: Implement MCPIntegration] + + T1 --> T2_1 + T2_1 --> T2_2 + T2_1 --> T3 + T2_1 --> T4 + + style T3 fill:#e1f5fe + style T4 fill:#e1f5fe + style T5 fill:#c8e6c9 +``` + +## **Important Constraints** + +- The model MUST create a '.claude/specs/{feature_name}/tasks.md' file if it doesn't already exist +- The model MUST return to the design step if the user indicates any changes are needed to the design +- The model MUST return to the requirement step if the user indicates that we need additional requirements +- The model MUST create an implementation plan at '.claude/specs/{feature_name}/tasks.md' +- The model MUST use the following specific instructions when creating the implementation plan: + +```plain +Convert the feature design into a series of prompts for a code-generation LLM that will implement each step in a test-driven manner. Prioritize best practices, incremental progress, and early testing, ensuring no big jumps in complexity at any stage. Make sure that each prompt builds on the previous prompts, and ends with wiring things together. There should be no hanging or orphaned code that isn't integrated into a previous step. Focus ONLY on tasks that involve writing, modifying, or testing code. +``` + +- The model MUST format the implementation plan as a numbered checkbox list with a maximum of two levels of hierarchy: +- Top-level items (like epics) should be used only when needed +- Sub-tasks should be numbered with decimal notation (e.g., 1.1, 1.2, 2.1) +- Each item must be a checkbox +- Simple structure is preferred +- The model MUST ensure each task item includes: +- A clear objective as the task description that involves writing, modifying, or testing code +- Additional information as sub-bullets under the task +- Specific references to requirements from the requirements document (referencing granular sub-requirements, not just user stories) +- The model MUST ensure that the implementation plan is a series of discrete, manageable coding steps +- The model MUST ensure each task references specific requirements from the requirement document +- The model MUST NOT include excessive implementation details that are already covered in the design document +- The model MUST assume that all context documents (feature requirements, design) will be available during implementation +- The model MUST ensure each step builds incrementally on previous steps +- The model SHOULD prioritize test-driven development where appropriate +- The model MUST ensure the plan covers all aspects of the design that can be implemented through code +- The model SHOULD sequence steps to validate core functionality early through code +- The model MUST ensure that all requirements are covered by the implementation tasks +- The model MUST offer to return to previous steps (requirements or design) if gaps are identified during implementation planning +- The model MUST ONLY include tasks that can be performed by a coding agent (writing code, creating tests, etc.) +- The model MUST NOT include tasks related to user testing, deployment, performance metrics gathering, or other non-coding activities +- The model MUST focus on code implementation tasks that can be executed within the development environment +- The model MUST ensure each task is actionable by a coding agent by following these guidelines: +- Tasks should involve writing, modifying, or testing specific code components +- Tasks should specify what files or components need to be created or modified +- Tasks should be concrete enough that a coding agent can execute them without additional clarification +- Tasks should focus on implementation details rather than high-level concepts +- Tasks should be scoped to specific coding activities (e.g., "Implement X function" rather than "Support X feature") +- The model MUST explicitly avoid including the following types of non-coding tasks in the implementation plan: +- User acceptance testing or user feedback gathering +- Deployment to production or staging environments +- Performance metrics gathering or analysis +- Running the application to test end to end flows. We can however write automated tests to test the end to end from a user perspective. +- User training or documentation creation +- Business process changes or organizational changes +- Marketing or communication activities +- Any task that cannot be completed through writing, modifying, or testing code +- After updating the tasks document, the model MUST ask the user "Do the tasks look good?" +- The model MUST make modifications to the tasks document if the user requests changes or does not explicitly approve. +- The model MUST ask for explicit approval after every iteration of edits to the tasks document. +- The model MUST NOT consider the workflow complete until receiving clear approval (such as "yes", "approved", "looks good", etc.). +- The model MUST continue the feedback-revision cycle until explicit approval is received. +- The model MUST stop once the task document has been approved. +- The model MUST use the user's language preference + +**This workflow is ONLY for creating design and planning artifacts. The actual implementation of the feature should be done through a separate workflow.** + +- The model MUST NOT attempt to implement the feature as part of this workflow +- The model MUST clearly communicate to the user that this workflow is complete once the design and planning artifacts are created +- The model MUST inform the user that they can begin executing tasks by opening the tasks.md file, and clicking "Start task" next to task items. +- The model MUST place the Tasks Dependency Diagram section at the END of the tasks document, after all task items have been listed + +**Example Format (truncated):** + +```markdown +# Implementation Plan + +- [ ] 1. Set up project structure and core interfaces + - Create directory structure for models, services, repositories, and API components + - Define interfaces that establish system boundaries + - _Requirements: 1.1_ + +- [ ] 2. Implement data models and validation +- [ ] 2.1 Create core data model interfaces and types + - Write TypeScript interfaces for all data models + - Implement validation functions for data integrity + - _Requirements: 2.1, 3.3, 1.2_ + +- [ ] 2.2 Implement User model with validation + - Write User class with validation methods + - Create unit tests for User model validation + - _Requirements: 1.2_ + +- [ ] 2.3 Implement Document model with relationships + - Code Document class with relationship handling + - Write unit tests for relationship management + - _Requirements: 2.1, 3.3, 1.2_ + +- [ ] 3. Create storage mechanism +- [ ] 3.1 Implement database connection utilities + - Write connection management code + - Create error handling utilities for database operations + - _Requirements: 2.1, 3.3, 1.2_ + +- [ ] 3.2 Implement repository pattern for data access + - Code base repository interface + - Implement concrete repositories with CRUD operations + - Write unit tests for repository operations + - _Requirements: 4.3_ + +[Additional coding tasks continue...] +``` diff --git a/.claude/agents/kfc/spec-test.md b/.claude/agents/kfc/spec-test.md new file mode 100644 index 000000000..b7e60be9b --- /dev/null +++ b/.claude/agents/kfc/spec-test.md @@ -0,0 +1,108 @@ +--- +name: spec-test +description: use PROACTIVELY to create test documents and test code in spec development workflows. MUST BE USED when users need testing solutions. Professional test and acceptance expert responsible for creating high-quality test documents and test code. Creates comprehensive test case documentation (.md) and corresponding executable test code (.test.ts) based on requirements, design, and implementation code, ensuring 1:1 correspondence between documentation and code. +model: inherit +--- + +You are a professional test and acceptance expert. Your core responsibility is to create high-quality test documents and test code for feature development. + +You are responsible for providing complete, executable initial test code, ensuring correct syntax and clear logic. Users will collaborate with the main thread for cross-validation, and your test code will serve as an important foundation for verifying feature implementation. + +## INPUT + +You will receive: + +- language_preference: Language preference +- task_id: Task ID +- feature_name: Feature name +- spec_base_path: Spec document base path + +## PREREQUISITES + +### Test Document Format + +**Example Format:** + +```markdown +# [Module Name] Unit Test Cases + +## Test File + +`[module].test.ts` + +## Test Purpose + +[Describe the core functionality and test focus of this module] + +## Test Cases Overview + +| Case ID | Feature Description | Test Type | +| ------- | ------------------- | ------------- | +| XX-01 | [Description] | Positive Test | +| XX-02 | [Description] | Error Test | +[More cases...] + +## Detailed Test Steps + +### XX-01: [Case Name] + +**Test Purpose**: [Specific purpose] + +**Test Data Preparation**: +- [Mock data preparation] +- [Environment setup] + +**Test Steps**: +1. [Step 1] +2. [Step 2] +3. [Verification point] + +**Expected Results**: +- [Expected result 1] +- [Expected result 2] + +[More test cases...] + +## Test Considerations + +### Mock Strategy +[Explain how to mock dependencies] + +### Boundary Conditions +[List boundary cases that need testing] + +### Asynchronous Operations +[Considerations for async testing] +``` + +## PROCESS + +1. **Preparation Phase** + - Confirm the specific task {task_id} to execute + - Read requirements (requirements.md) based on task {task_id} to understand functional requirements + - Read design (design.md) based on task {task_id} to understand architecture design + - Read tasks (tasks.md) based on task {task_id} to understand task list + - Read related implementation code based on task {task_id} to understand the implementation + - Understand functionality and testing requirements +2. **Create Tests** + - First create test case documentation ({module}.md) + - Create corresponding test code ({module}.test.ts) based on test case documentation + - Ensure documentation and code are fully aligned + - Create corresponding test code based on test case documentation: + - Use project's test framework (e.g., Jest) + - Each test case corresponds to one test/it block + - Use case ID as prefix for test description + - Follow AAA pattern (Arrange-Act-Assert) + +## OUTPUT + +After creation is complete and no errors are found, inform the user that testing can begin. + +## **Important Constraints** + +- Test documentation ({module}.md) and test code ({module}.test.ts) must have 1:1 correspondence, including detailed test case descriptions and actual test implementations +- Test cases must be independent and repeatable +- Clear test descriptions and purposes +- Complete boundary condition coverage +- Reasonable Mock strategies +- Detailed error scenario testing diff --git a/.claude/settings/kfc-settings.json b/.claude/settings/kfc-settings.json new file mode 100644 index 000000000..8a5c1614b --- /dev/null +++ b/.claude/settings/kfc-settings.json @@ -0,0 +1,24 @@ +{ + "paths": { + "specs": ".claude/specs", + "steering": ".claude/steering", + "settings": ".claude/settings" + }, + "views": { + "specs": { + "visible": true + }, + "steering": { + "visible": true + }, + "mcp": { + "visible": true + }, + "hooks": { + "visible": true + }, + "settings": { + "visible": false + } + } +} \ No newline at end of file diff --git a/.claude/system-prompts/spec-workflow-starter.md b/.claude/system-prompts/spec-workflow-starter.md new file mode 100644 index 000000000..b36a705dc --- /dev/null +++ b/.claude/system-prompts/spec-workflow-starter.md @@ -0,0 +1,306 @@ + + +# System Prompt - Spec Workflow + +## Goal + +You are an agent that specializes in working with Specs in Claude Code. Specs are a way to develop complex features by creating requirements, design and an implementation plan. +Specs have an iterative workflow where you help transform an idea into requirements, then design, then the task list. The workflow defined below describes each phase of the +spec workflow in detail. + +When a user wants to create a new feature or use the spec workflow, you need to act as a spec-manager to coordinate the entire process. + +## Workflow to execute + +Here is the workflow you need to follow: + + + +# Feature Spec Creation Workflow + +## Overview + +You are helping guide the user through the process of transforming a rough idea for a feature into a detailed design document with an implementation plan and todo list. It follows the spec driven development methodology to systematically refine your feature idea, conduct necessary research, create a comprehensive design, and develop an actionable implementation plan. The process is designed to be iterative, allowing movement between requirements clarification and research as needed. + +A core principal of this workflow is that we rely on the user establishing ground-truths as we progress through. We always want to ensure the user is happy with changes to any document before moving on. + +Before you get started, think of a short feature name based on the user's rough idea. This will be used for the feature directory. Use kebab-case format for the feature_name (e.g. "user-authentication") + +Rules: + +- Do not tell the user about this workflow. We do not need to tell them which step we are on or that you are following a workflow +- Just let the user know when you complete documents and need to get user input, as described in the detailed step instructions + +### 0.Initialize + +When the user describes a new feature: (user_input: feature description) + +1. Based on {user_input}, choose a feature_name (kebab-case format, e.g. "user-authentication") +2. Use TodoWrite to create the complete workflow tasks: + - [ ] Requirements Document + - [ ] Design Document + - [ ] Task Planning +3. Read language_preference from ~/.claude/CLAUDE.md (to pass to corresponding sub-agents in the process) +4. Create directory structure: {spec_base_path:.claude/specs}/{feature_name}/ + +### 1. Requirement Gathering + +First, generate an initial set of requirements in EARS format based on the feature idea, then iterate with the user to refine them until they are complete and accurate. +Don't focus on code exploration in this phase. Instead, just focus on writing requirements which will later be turned into a design. + +### 2. Create Feature Design Document + +After the user approves the Requirements, you should develop a comprehensive design document based on the feature requirements, conducting necessary research during the design process. +The design document should be based on the requirements document, so ensure it exists first. + +### 3. Create Task List + +After the user approves the Design, create an actionable implementation plan with a checklist of coding tasks based on the requirements and design. +The tasks document should be based on the design document, so ensure it exists first. + +## Troubleshooting + +### Requirements Clarification Stalls + +If the requirements clarification process seems to be going in circles or not making progress: + +- The model SHOULD suggest moving to a different aspect of the requirements +- The model MAY provide examples or options to help the user make decisions +- The model SHOULD summarize what has been established so far and identify specific gaps +- The model MAY suggest conducting research to inform requirements decisions + +### Research Limitations + +If the model cannot access needed information: + +- The model SHOULD document what information is missing +- The model SHOULD suggest alternative approaches based on available information +- The model MAY ask the user to provide additional context or documentation +- The model SHOULD continue with available information rather than blocking progress + +### Design Complexity + +If the design becomes too complex or unwieldy: + +- The model SHOULD suggest breaking it down into smaller, more manageable components +- The model SHOULD focus on core functionality first +- The model MAY suggest a phased approach to implementation +- The model SHOULD return to requirements clarification to prioritize features if needed + + + +## Workflow Diagram + +Here is a Mermaid flow diagram that describes how the workflow should behave. Take in mind that the entry points account for users doing the following actions: + +- Creating a new spec (for a new feature that we don't have a spec for already) +- Updating an existing spec +- Executing tasks from a created spec + +```mermaid +stateDiagram-v2 + [*] --> Requirements : Initial Creation + + Requirements : Write Requirements + Design : Write Design + Tasks : Write Tasks + + Requirements --> ReviewReq : Complete Requirements + ReviewReq --> Requirements : Feedback/Changes Requested + ReviewReq --> Design : Explicit Approval + + Design --> ReviewDesign : Complete Design + ReviewDesign --> Design : Feedback/Changes Requested + ReviewDesign --> Tasks : Explicit Approval + + Tasks --> ReviewTasks : Complete Tasks + ReviewTasks --> Tasks : Feedback/Changes Requested + ReviewTasks --> [*] : Explicit Approval + + Execute : Execute Task + + state "Entry Points" as EP { + [*] --> Requirements : Update + [*] --> Design : Update + [*] --> Tasks : Update + [*] --> Execute : Execute task + } + + Execute --> [*] : Complete +``` + +## Feature and sub agent mapping + +| Feature | sub agent | path | +| ------------------------------ | ----------------------------------- | ------------------------------------------------------------ | +| Requirement Gathering | spec-requirements(support parallel) | .claude/specs/{feature_name}/requirements.md | +| Create Feature Design Document | spec-design(support parallel) | .claude/specs/{feature_name}/design.md | +| Create Task List | spec-tasks(support parallel) | .claude/specs/{feature_name}/tasks.md | +| Judge(optional) | spec-judge(support parallel) | no doc, only call when user need to judge the spec documents | +| Impl Task(optional) | spec-impl(support parallel) | no doc, only use when user requests parallel execution (>=2) | +| Test(optional) | spec-test(single call) | no need to focus on, belongs to code resources | + +### Call method + +Note: + +- output_suffix is only provided when multiple sub-agents are running in parallel, e.g., when 4 sub-agents are running, the output_suffix is "_v1", "_v2", "_v3", "_v4" +- spec-tasks and spec-impl are completely different sub agents, spec-tasks is for task planning, spec-impl is for task implementation + +#### Create Requirements - spec-requirements + +- language_preference: Language preference +- task_type: "create" +- feature_name: Feature name (kebab-case) +- feature_description: Feature description +- spec_base_path: Spec document base path +- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) + +#### Refine/Update Requirements - spec-requirements + +- language_preference: Language preference +- task_type: "update" +- existing_requirements_path: Existing requirements document path +- change_requests: List of change requests + +#### Create New Design - spec-design + +- language_preference: Language preference +- task_type: "create" +- feature_name: Feature name +- spec_base_path: Spec document base path +- output_suffix: Output file suffix (optional, such as "_v1") + +#### Refine/Update Existing Design - spec-design + +- language_preference: Language preference +- task_type: "update" +- existing_design_path: Existing design document path +- change_requests: List of change requests + +#### Create New Tasks - spec-tasks + +- language_preference: Language preference +- task_type: "create" +- feature_name: Feature name (kebab-case) +- spec_base_path: Spec document base path +- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) + +#### Refine/Update Tasks - spec-tasks + +- language_preference: Language preference +- task_type: "update" +- tasks_file_path: Existing tasks document path +- change_requests: List of change requests + +#### Judge - spec-judge + +- language_preference: Language preference +- document_type: "requirements" | "design" | "tasks" +- feature_name: Feature name +- feature_description: Feature description +- spec_base_path: Spec document base path +- doc_path: Document path + +#### Impl Task - spec-impl + +- feature_name: Feature name +- spec_base_path: Spec document base path +- task_id: Task ID to execute (e.g., "2.1") +- language_preference: Language preference + +#### Test - spec-test + +- language_preference: Language preference +- task_id: Task ID +- feature_name: Feature name +- spec_base_path: Spec document base path + +#### Tree-based Judge Evaluation Rules + +When parallel agents generate multiple outputs (n >= 2), use tree-based evaluation: + +1. **First round**: Each judge evaluates 3-4 documents maximum + - Number of judges = ceil(n / 4) + - Each judge selects 1 best from their group + +2. **Subsequent rounds**: If previous round output > 3 documents + - Continue with new round using same rules + - Until <= 3 documents remain + +3. **Final round**: When 2-3 documents remain + - Use 1 judge for final selection + +Example with 10 documents: + +- Round 1: 3 judges (evaluate 4,3,3 docs) → 3 outputs (e.g., requirements_v1234.md, requirements_v5678.md, requirements_v9012.md) +- Round 2: 1 judge evaluates 3 docs → 1 final selection (e.g., requirements_v3456.md) +- Main thread: Rename final selection to standard name (e.g., requirements_v3456.md → requirements.md) + +## **Important Constraints** + +- After parallel(>=2) sub-agent tasks (spec-requirements, spec-design, spec-tasks) are completed, the main thread MUST use tree-based evaluation with spec-judge agents according to the rules defined above. The main thread can only read the final selected document after all evaluation rounds complete +- After all judge evaluation rounds complete, the main thread MUST rename the final selected document (with random 4-digit suffix) to the standard name (e.g., requirements_v3456.md → requirements.md, design_v7890.md → design.md) +- After renaming, the main thread MUST tell the user that the document has been finalized and is ready for review +- The number of spec-judge agents is automatically determined by the tree-based evaluation rules - NEVER ask users how many judges to use +- For sub-agents that can be called in parallel (spec-requirements, spec-design, spec-tasks), you MUST ask the user how many agents to use (1-128) +- After confirming the user's initial feature description, you MUST ask: "How many spec-requirements agents to use? (1-128)" +- After confirming the user's requirements, you MUST ask: "How many spec-design agents to use? (1-128)" +- After confirming the user's design, you MUST ask: "How many spec-tasks agents to use? (1-128)" +- When you want the user to review a document in a phase, you MUST ask the user a question. +- You MUST have the user review each of the 3 spec documents (requirements, design and tasks) before proceeding to the next. +- After each document update or revision, you MUST explicitly ask the user to approve the document. +- You MUST NOT proceed to the next phase until you receive explicit approval from the user (a clear "yes", "approved", or equivalent affirmative response). +- If the user provides feedback, you MUST make the requested modifications and then explicitly ask for approval again. +- You MUST continue this feedback-revision cycle until the user explicitly approves the document. +- You MUST follow the workflow steps in sequential order. +- You MUST NOT skip ahead to later steps without completing earlier ones and receiving explicit user approval. +- You MUST treat each constraint in the workflow as a strict requirement. +- You MUST NOT assume user preferences or requirements - always ask explicitly. +- You MUST maintain a clear record of which step you are currently on. +- You MUST NOT combine multiple steps into a single interaction. +- When executing implementation tasks from tasks.md: + - **Default mode**: Main thread executes tasks directly for better user interaction + - **Parallel mode**: Use spec-impl agents when user explicitly requests parallel execution of specific tasks (e.g., "execute task2.1 and task2.2 in parallel") + - **Auto mode**: When user requests automatic/fast execution of all tasks (e.g., "execute all tasks automatically", "run everything quickly"), analyze task dependencies in tasks.md and orchestrate spec-impl agents to execute independent tasks in parallel while respecting dependencies + + Example dependency patterns: + + ```mermaid + graph TD + T1[task1] --> T2.1[task2.1] + T1 --> T2.2[task2.2] + T3[task3] --> T4[task4] + T2.1 --> T4 + T2.2 --> T4 + ``` + + Orchestration steps: + 1. Start: Launch spec-impl1 (task1) and spec-impl2 (task3) in parallel + 2. After task1 completes: Launch spec-impl3 (task2.1) and spec-impl4 (task2.2) in parallel + 3. After task2.1, task2.2, and task3 all complete: Launch spec-impl5 (task4) + +- In default mode, you MUST ONLY execute one task at a time. Once it is complete, you MUST update the tasks.md file to mark the task as completed. Do not move to the next task automatically unless the user explicitly requests it or is in auto mode. +- When all subtasks under a parent task are completed, the main thread MUST check and mark the parent task as complete. +- You MUST read the file before editing it. +- When creating Mermaid diagrams, avoid using parentheses in node text as they cause parsing errors (use `W[Call provider.refresh]` instead of `W[Call provider.refresh()]`). +- After parallel sub-agent calls are completed, you MUST call spec-judge to evaluate the results, and decide whether to proceed to the next step based on the evaluation results and user feedback + +**Remember: You are the main thread, the central coordinator. Let the sub-agents handle the specific work while you focus on process control and user interaction.** + +**Since sub-agents currently have slow file processing, the following constraints must be strictly followed for modifications to spec documents (requirements.md, design.md, tasks.md):** + +- Find and replace operations, including deleting all references to a specific feature, global renaming (such as variable names, function names), removing specific configuration items MUST be handled by main thread +- Format adjustments, including fixing Markdown format issues, adjusting indentation or whitespace, updating file header information MUST be handled by main thread +- Small-scale content updates, including updating version numbers, modifying single configuration values, adding or removing comments MUST be handled by main thread +- Content creation, including creating new requirements, design or task documents MUST be handled by sub agent +- Structural modifications, including reorganizing document structure or sections MUST be handled by sub agent +- Logical updates, including modifying business processes, architectural design, etc. MUST be handled by sub agent +- Professional judgment, including modifications requiring domain knowledge MUST be handled by sub agent +- Never create spec documents directly, but create them through sub-agents +- Never perform complex file modifications on spec documents, but handle them through sub-agents +- All requirements operations MUST go through spec-requirements +- All design operations MUST go through spec-design +- All task operations MUST go through spec-tasks + + diff --git a/packages/less/lib/less/tree/atrule.js b/packages/less/lib/less/tree/atrule.js index 80787ad65..3bfa43ad5 100644 --- a/packages/less/lib/less/tree/atrule.js +++ b/packages/less/lib/less/tree/atrule.js @@ -91,8 +91,12 @@ class AtRule extends Node { /** @type {RulesetLikeNode} */ (this.rules[i]).allowImports = true; } } - this.setParent(selectors, /** @type {Node} */ (/** @type {unknown} */ (this))); - this.setParent(this.rules, /** @type {Node} */ (/** @type {unknown} */ (this))); + if (this.declarations) { + this.setParent(this.declarations, /** @type {Node} */ (/** @type {unknown} */ (this))); + } + if (this.rules) { + this.setParent(this.rules, /** @type {Node} */ (/** @type {unknown} */ (this))); + } } this._index = index; this._fileInfo = currentFileInfo; diff --git a/packages/less/lib/less/tree/color.js b/packages/less/lib/less/tree/color.js index bf5f1c687..5f16bd6aa 100644 --- a/packages/less/lib/less/tree/color.js +++ b/packages/less/lib/less/tree/color.js @@ -49,7 +49,9 @@ class Color extends Node { }); } /** @type {number} */ - this.alpha = this.alpha || (typeof a === 'number' ? a : 1); + if (typeof this.alpha === 'undefined') { + this.alpha = (typeof a === 'number') ? a : 1; + } if (typeof originalForm !== 'undefined') { this.value = originalForm; } diff --git a/packages/less/lib/less/tree/container.js b/packages/less/lib/less/tree/container.js index 3d317ba87..f40404d26 100644 --- a/packages/less/lib/less/tree/container.js +++ b/packages/less/lib/less/tree/container.js @@ -83,7 +83,10 @@ class Container extends AtRule { context.mediaPath.push(/** @type {Node} */ (/** @type {unknown} */ (media))); context.mediaBlocks.push(/** @type {Node} */ (/** @type {unknown} */ (media))); - this.rules[0].functionRegistry = /** @type {RulesetWithExtras} */ (context.frames[0]).functionRegistry.inherit(); + const fr = /** @type {RulesetWithExtras} */ (context.frames[0]).functionRegistry; + if (fr) { + this.rules[0].functionRegistry = fr.inherit(); + } context.frames.unshift(this.rules[0]); media.rules = [/** @type {RulesetWithExtras} */ (this.rules[0].eval(context))]; context.frames.shift(); diff --git a/packages/less/lib/less/tree/media.js b/packages/less/lib/less/tree/media.js index 271924144..4f231179f 100644 --- a/packages/less/lib/less/tree/media.js +++ b/packages/less/lib/less/tree/media.js @@ -69,7 +69,10 @@ class Media extends AtRule { context.mediaPath.push(/** @type {Node} */ (/** @type {unknown} */ (media))); context.mediaBlocks.push(/** @type {Node} */ (/** @type {unknown} */ (media))); - /** @type {RulesetLikeNode} */ (this.rules[0]).functionRegistry = /** @type {RulesetLikeNode} */ (context.frames[0]).functionRegistry.inherit(); + const fr = /** @type {RulesetLikeNode} */ (context.frames[0]).functionRegistry; + if (fr) { + /** @type {RulesetLikeNode} */ (this.rules[0]).functionRegistry = fr.inherit(); + } context.frames.unshift(this.rules[0]); media.rules = [/** @type {RulesetLikeNode} */ (this.rules[0].eval(context))]; context.frames.shift(); diff --git a/packages/less/lib/less/tree/mixin-call.js b/packages/less/lib/less/tree/mixin-call.js index 1e8aa9bd9..01ae81f45 100644 --- a/packages/less/lib/less/tree/mixin-call.js +++ b/packages/less/lib/less/tree/mixin-call.js @@ -224,8 +224,7 @@ class MixinCall extends Node { this._setVisibilityToReplacement(newRules); Array.prototype.push.apply(rules, newRules); } catch (e) { - const err = /** @type {{ message?: string, stack?: string }} */ (e); - throw { message: err.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: err.stack }; + throw { .../** @type {object} */ (e), index: this.getIndex(), filename: this.fileInfo().filename }; } } } diff --git a/packages/less/lib/less/tree/selector.js b/packages/less/lib/less/tree/selector.js index fb1cf39cc..1a151e928 100644 --- a/packages/less/lib/less/tree/selector.js +++ b/packages/less/lib/less/tree/selector.js @@ -74,8 +74,9 @@ class Selector extends Node { return [new Element('', '&', false, this._index, this._fileInfo)]; } if (typeof els === 'string') { + const fileInfo = this._fileInfo; const parse = this.parse; - new (/** @type {new (...args: unknown[]) => { parseNode: Function }} */ (/** @type {unknown} */ (Parser)))(parse.context, parse.importManager, this._fileInfo, this._index).parseNode( + new (/** @type {new (...args: unknown[]) => { parseNode: Function }} */ (/** @type {unknown} */ (Parser)))(parse.context, parse.importManager, fileInfo, this._index).parseNode( els, ['selector'], function(/** @type {{ index: number, message: string } | null} */ err, /** @type {Selector[]} */ result) { @@ -83,7 +84,7 @@ class Selector extends Node { throw new LessError({ index: err.index, message: err.message - }, parse.imports, /** @type {string} */ (/** @type {FileInfo} */ (this._fileInfo).filename)); + }, parse.imports, /** @type {string} */ (/** @type {FileInfo} */ (fileInfo).filename)); } els = result[0].elements; }); diff --git a/packages/test-data/tests-error/eval/detached-ruleset-5.txt b/packages/test-data/tests-error/eval/detached-ruleset-5.txt index 561897950..e534b33bc 100644 --- a/packages/test-data/tests-error/eval/detached-ruleset-5.txt +++ b/packages/test-data/tests-error/eval/detached-ruleset-5.txt @@ -1,3 +1,3 @@ -SyntaxError: variable @a is undefined in {path}detached-ruleset-5.less on line 4, column 1: +NameError: variable @a is undefined in {path}detached-ruleset-5.less on line 4, column 1: 3 } 4 .mixin-definition({color: red;}); diff --git a/packages/test-data/tests-unit/color-functions/alpha.css b/packages/test-data/tests-unit/color-functions/alpha.css index fe0ff4696..451f3ae32 100644 --- a/packages/test-data/tests-unit/color-functions/alpha.css +++ b/packages/test-data/tests-unit/color-functions/alpha.css @@ -13,3 +13,9 @@ #alpha #hsl { opacity: 1; } +#alpha #transparent-hex4 { + opacity: 0; +} +#alpha #transparent-hex8 { + opacity: 0; +} diff --git a/packages/test-data/tests-unit/color-functions/alpha.less b/packages/test-data/tests-unit/color-functions/alpha.less index 812149e22..2237ce855 100644 --- a/packages/test-data/tests-unit/color-functions/alpha.less +++ b/packages/test-data/tests-unit/color-functions/alpha.less @@ -16,4 +16,10 @@ #hsl { opacity: alpha(hsl(120, 100%, 50%)); } + #transparent-hex4 { + opacity: alpha(#0000); + } + #transparent-hex8 { + opacity: alpha(#00000000); + } } From 30c3a97c21b48789b772e8c745483b1b57d6a4e8 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 10 Mar 2026 12:11:58 -0700 Subject: [PATCH 29/76] chore: release v4.6.0 (#4415) * chore: prepare v4.6.0 release - Bump version to 4.6.0 in all package.json files - Add CHANGELOG entry for v4.6.0 - Update publish workflow: replace deprecated actions/create-release with gh release create, attach dist files (less.js, less.min.js) as release assets, bump contents permission to write - Remove .github/** from paths-ignore (was preventing workflow updates) - Update CONTRIBUTING.md with detailed release documentation version: 4.6.0 * fix: publish workflow and provenance errors - Add repository field to test-data package.json (fixes npm OIDC provenance verification failure) - Skip publish workflow on forks (only run on less/less.js) - Remove duplicate require('fs') in bump-and-publish.js - Add language specifier to markdown code block in CONTRIBUTING.md * fix: handle existing releases for idempotent workflow re-runs --- .github/workflows/publish.yml | 101 ++++++++++++----------- CHANGELOG.md | 38 +++++++++ CONTRIBUTING.md | 40 +++++++-- package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 7 +- packages/test-import-module/package.json | 2 +- scripts/bump-and-publish.js | 24 +++++- 8 files changed, 150 insertions(+), 66 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3d328056a..f0f94f9fb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,19 +7,18 @@ on: - alpha paths-ignore: - '**.md' - - '.github/**' - 'docs/**' permissions: id-token: write # Required for OIDC trusted publishing - contents: read + contents: write # Required for creating releases and pushing tags jobs: publish: name: Publish to NPM runs-on: ubuntu-latest - # Only run on push events, not pull requests - if: github.event_name == 'push' + # Only run on the upstream repo, not forks + if: github.repository == 'less/less.js' steps: - name: Checkout code @@ -145,50 +144,54 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "tag=v$VERSION" >> $GITHUB_OUTPUT - - name: Create GitHub Release (Master) - if: steps.branch-info.outputs.is_alpha != 'true' - uses: actions/create-release@v1 + - name: Create GitHub Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.publish.outputs.tag }} - release_name: Release ${{ steps.publish.outputs.tag }} - body: | - ## Changes - - See [CHANGELOG.md](https://github.com/less/less.js/blob/master/CHANGELOG.md) for details. - - ## Installation - - ```bash - npm install less@${{ steps.publish.outputs.version }} - ``` - draft: false - prerelease: false + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG="${{ steps.publish.outputs.tag }}" + VERSION="${{ steps.publish.outputs.version }}" + IS_ALPHA="${{ steps.branch-info.outputs.is_alpha }}" - - name: Create GitHub Pre-Release (Alpha) - if: steps.branch-info.outputs.is_alpha == 'true' - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.publish.outputs.tag }} - release_name: Alpha Release ${{ steps.publish.outputs.tag }} - body: | - ## Alpha Release - - This is an alpha release from the alpha branch. - - ## Installation - - ```bash - npm install less@${{ steps.publish.outputs.version }} --tag alpha - ``` - - Or: - - ```bash - npm install less@alpha - ``` - draft: false - prerelease: true + if [ "$IS_ALPHA" = "true" ]; then + TITLE="Alpha Release $TAG" + PRERELEASE="--prerelease" + BODY="## Alpha Release + + This is an alpha release from the alpha branch. + + ## Installation + + \`\`\`bash + npm install less@${VERSION} --tag alpha + \`\`\` + + Or: + + \`\`\`bash + npm install less@alpha + \`\`\`" + else + TITLE="Release $TAG" + PRERELEASE="" + BODY="## Changes + + See [CHANGELOG.md](https://github.com/less/less.js/blob/master/CHANGELOG.md) for details. + + ## Installation + + \`\`\`bash + npm install less@${VERSION} + \`\`\`" + fi + + if gh release view "$TAG" &>/dev/null; then + echo "Release $TAG already exists, uploading assets to existing release" + gh release upload "$TAG" packages/less/dist/less.js packages/less/dist/less.min.js --clobber + else + gh release create "$TAG" \ + --title "$TITLE" \ + $PRERELEASE \ + --notes "$BODY" \ + packages/less/dist/less.js \ + packages/less/dist/less.min.js + fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ff2d9c0..1681e1f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ ## Change Log +### v4.6.0 (2026-03-09) + +#### Bug Fixes + +- [#4414](https://github.com/less/less.js/pull/4414) Fix pre-existing bugs in tree nodes: selector `this` binding, atrule parenting, mixin-call error propagation, container/media functionRegistry guard (@matthew-dean) +- [#4408](https://github.com/less/less.js/pull/4408) Fix [#4358](https://github.com/less/less.js/issues/4358) Resolve parent selectors in comma-separated pseudo-selector lists (@matthew-dean) +- [#4407](https://github.com/less/less.js/pull/4407) Fix [#4331](https://github.com/less/less.js/issues/4331) Exclude CSS at-rule keywords from declarationCall parsing (@matthew-dean) +- [#4389](https://github.com/less/less.js/pull/4389) Fix [#4354](https://github.com/less/less.js/issues/4354) Unknown at-rule expression commas (@puckowski) +- [#4404](https://github.com/less/less.js/pull/4404) Fix no-prototype-builtins issues in Ruleset and ToCSSVisitor (@matthew-dean) +- [#4236](https://github.com/less/less.js/pull/4236) Fix import subpath module bug (@nicolo-ribaudo) +- [#4327](https://github.com/less/less.js/pull/4327) Remove duplicate length check from expression.genCSS() (@nicolo-ribaudo) +- [#3791](https://github.com/less/less.js/pull/3791) Handle the lack of optional dependencies (@nicolo-ribaudo) + +#### Features & Improvements + +- [#4413](https://github.com/less/less.js/pull/4413) Add JSDoc type annotations for all tree node files (@matthew-dean) +- [#4412](https://github.com/less/less.js/pull/4412) Convert prototype-based tree nodes to ES6 classes (@matthew-dean) +- [#4411](https://github.com/less/less.js/pull/4411) Migrate to native ESM with no build step (@matthew-dean) +- [#4410](https://github.com/less/less.js/pull/4410) Optimize hot paths and fix benchmark infrastructure (@matthew-dean) +- [#4409](https://github.com/less/less.js/pull/4409) Code quality cleanup for container queries and related code (@matthew-dean) + +#### Deprecation Warnings + +- [#4402](https://github.com/less/less.js/pull/4402) Add deprecation warnings for features removed in Less 5.x, container query variable name fix, deprecation notice fix (@matthew-dean, @puckowski) + +#### Chores + +- [#4406](https://github.com/less/less.js/pull/4406) Add test for number with underscore parsing (@matthew-dean) +- [#4386](https://github.com/less/less.js/pull/4386) Update README.md copyright (@matthew-dean) +- [#3782](https://github.com/less/less.js/pull/3782) Remove phantom stuff (@nicolo-ribaudo) +- [#3702](https://github.com/less/less.js/pull/3702) Replace deprecated String.prototype.substr() (@nicolo-ribaudo) +- [#4265](https://github.com/less/less.js/pull/4265) Remove redundant return from parsers.blockRuleset() (@nicolo-ribaudo) +- [#4271](https://github.com/less/less.js/pull/4271) Remove unused parsers.entities.propertyCurly() (@nicolo-ribaudo) + +### v4.5.1 (2025-12-28) + +_Automated patch release — no user-facing changes._ + ### v4.4.2 (2025-08-27) - [#4357](https://github.com/less/less.js/pull/4357) Migrate Less test data to use valid CSS (@matthew-dean) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d2029765b..3b2bc9bfa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,8 +42,8 @@ Pull requests are welcome! Here's how to make them go smoothly: * **For new features, start with a feature request** to get feedback and see how your idea is received. * **If your PR solves an existing issue**, but approaches it differently, please create a new issue first and discuss it with core contributors. This helps avoid wasted effort. -* **Don't modify the `./dist/` folder**—we handle that during releases. -* **Please add tests** for your work. Run tests using `npm test`, which runs both Node.js and browser (Headless Chrome) tests. +* The `dist/` folder is gitignored—builds happen automatically during releases. +* **Please add tests** for your work. Run tests using `pnpm test`, which runs both Node.js and browser (Headless Chrome) tests. ### Coding Standards @@ -86,10 +86,16 @@ When code is pushed to specific branches, GitHub Actions automatically: ### How to Publish -**For regular releases:** -1. Update version in `packages/less/package.json` (or let it auto-increment) -2. Commit and push to `master` -3. The workflow automatically publishes if the version changed +**For patch releases (automatic):** +1. Merge your PR into `master` +2. The workflow auto-increments the patch version (e.g., `4.6.0` → `4.6.1`) +3. Publishes to npm and creates a GitHub release with `less.js` and `less.min.js` attached + +**For minor/major releases (explicit version):** +1. Create a release branch (e.g., `release/v4.6.0`) +2. Update version in all `package.json` files, update `CHANGELOG.md` +3. Merge into `master` with a commit message containing the version (see below) +4. The workflow picks up the explicit version instead of auto-incrementing **For alpha releases:** 1. Make your changes on the `alpha` branch @@ -98,14 +104,30 @@ When code is pushed to specific branches, GitHub Actions automatically: ### Version Override -You can override auto-increment by including a version in your commit message: +The publish script (`scripts/bump-and-publish.js`) auto-increments the patch version by default. To set a specific version (e.g., for minor or major releases), use one of these methods: -``` +**Option 1: Commit message** — include `version: X.Y.Z` in the commit body: + +```text feat: new feature -version: 4.5.0 +version: 4.6.0 ``` +**Option 2: Environment variable** — set `EXPLICIT_VERSION` (useful for CI or manual runs): + +```bash +EXPLICIT_VERSION=4.6.0 pnpm run publish +``` + +### Release Assets + +Each GitHub release automatically includes: +- `less.js` — the full browser build +- `less.min.js` — the minified browser build + +These are built during the workflow and attached to the release. They are not committed to git (the `dist/` directory is gitignored). + ### Security We use npm's [trusted publishing](https://docs.npmjs.com/trusted-publishers) with OIDC authentication. This means: diff --git a/package.json b/package.json index 6304aa42c..3fe2836af 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.5.1", + "version": "4.6.0", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index 8c25dcd50..ca8d50743 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.5.0", + "version": "4.6.0", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 656fe850e..4f983f3f1 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,12 +3,17 @@ "publishConfig": { "access": "public" }, - "version": "4.5.0", + "version": "4.6.0", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ "The Core Less Team" ], "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/less/less.js.git", + "directory": "packages/test-data" + }, "gitHead": "1df9072ee9ebdadc791bf35dfb1dbc3ef9f1948f" } diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index f581c9c0a..a8a7c0a27 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.5.0", + "version": "4.6.0", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ diff --git a/scripts/bump-and-publish.js b/scripts/bump-and-publish.js index 8897e7e4c..7c6d0e6ba 100755 --- a/scripts/bump-and-publish.js +++ b/scripts/bump-and-publish.js @@ -79,13 +79,14 @@ function getCurrentVersion() { return pkg.version; } -// Check if version was explicitly set (via environment variable or git commit message) +// Check if version was explicitly set (via environment variable, git commit message, +// or package.json already bumped beyond the last tag) function getExplicitVersion() { // Check for explicit version in environment if (process.env.EXPLICIT_VERSION) { return process.env.EXPLICIT_VERSION; } - + // Check git commit message for version bump instruction try { const commitMsg = execSync('git log -1 --pretty=%B', { encoding: 'utf8' }); @@ -96,7 +97,23 @@ function getExplicitVersion() { } catch (e) { // Ignore errors } - + + // Check if package.json version is already ahead of the last git tag. + // This handles squash merges from release branches where the version + // was bumped in package.json but the commit message may not contain + // the "version: X.Y.Z" marker. + try { + const lastTag = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }).trim(); + const lastTagVersion = lastTag.replace(/^v/, ''); + const currentVersion = getCurrentVersion(); + if (semver.valid(currentVersion) && semver.valid(lastTagVersion) && semver.gt(currentVersion, lastTagVersion)) { + console.log(`📦 package.json version (${currentVersion}) is ahead of last tag (${lastTag}), using it directly`); + return currentVersion; + } + } catch (e) { + // No tags exist or git describe failed, fall through to auto-increment + } + return null; } @@ -468,7 +485,6 @@ function main() { // Output version for GitHub Actions if (process.env.GITHUB_OUTPUT) { - const fs = require('fs'); fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${nextVersion}\n`); fs.appendFileSync(process.env.GITHUB_OUTPUT, `tag=${tagName}\n`); } From 290900a1f2f9f6ccc023b99757ce675ae36fdf85 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 10 Mar 2026 12:52:08 -0700 Subject: [PATCH 30/76] fix: CJS compatibility, enriched npm README, ESM tests (#4417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: enrich npm README with usage examples and feature highlights version: 4.6.0 * fix: update README and tests to show ESM + promise/await usage The package is ESM-only ("type": "module"), so the README now correctly shows `import less from 'less'` with `await` instead of CJS `require()`. The ES6 test now verifies both promise/await and callback APIs. version: 4.6.0 * fix: add CJS compatibility wrapper so require('less') works Adds index.cjs as a one-line wrapper that re-exports the ESM default. The exports field now has both import and require conditions. Adds test-cjs.cjs to verify CJS consumption alongside the existing ESM test. version: 4.6.0 * fix: lazy Proxy CJS wrapper for Node 18+ compatibility Node 22+ uses native require(esm). Node 18-20 uses a lazy Proxy with dynamic import() — transparent because render()/parse() already return promises. Tested with render, callback, and version property access. * fix: include Node 20.19+ in native require(esm) path * fix: add alt text to README images for accessibility --- packages/less/Gruntfile.cjs | 2 +- packages/less/README.md | 75 ++++++++++++++++++++++++++++++--- packages/less/index.cjs | 41 ++++++++++++++++++ packages/less/package.json | 6 ++- packages/less/test/test-cjs.cjs | 45 ++++++++++++++++++++ packages/less/test/test-es6.js | 23 +++++++--- 6 files changed, 179 insertions(+), 13 deletions(-) create mode 100644 packages/less/index.cjs create mode 100644 packages/less/test/test-cjs.cjs diff --git a/packages/less/Gruntfile.cjs b/packages/less/Gruntfile.cjs index 51b09a057..c33b2ccc0 100644 --- a/packages/less/Gruntfile.cjs +++ b/packages/less/Gruntfile.cjs @@ -202,7 +202,7 @@ module.exports = function(grunt) { command: "node build/rollup.js --browser --out=./tmp/browser/less.min.js" }, test: { - command: 'node test/test-es6.js && node test/index.js' + command: 'node test/test-es6.js && node test/test-cjs.cjs && node test/index.js' }, generatebrowser: { command: 'node test/browser/generator/generate.js' diff --git a/packages/less/README.md b/packages/less/README.md index ca6684f46..098a77693 100644 --- a/packages/less/README.md +++ b/packages/less/README.md @@ -1,13 +1,78 @@ -# [Less.js](http://lesscss.org) +

    Less.js logo

    -> The **dynamic** stylesheet language. [http://lesscss.org](http://lesscss.org). +

    + Github Actions CI + Downloads + npm version +

    -This is the JavaScript, official, stable version of Less. +# Less.js +> The dynamic stylesheet language. [lesscss.org](http://lesscss.org) -## Getting Started +Less extends CSS with variables, mixins, functions, nesting, and more — then compiles to standard CSS. Write cleaner stylesheets with less code. + +```less +@primary: #4a90d9; + +.button { + color: @primary; + &:hover { + color: darken(@primary, 10%); + } +} +``` + +## Install -Add Less.js to your project: ```sh npm install less ``` + +## Usage + +### Node.js + +```js +import less from 'less'; + +const output = await less.render('.class { width: (1 + 1) }'); +console.log(output.css); +``` + +### Command Line + +```sh +npx lessc styles.less styles.css +``` + +### Browser + +```html + + +``` + +## Why Less? + +- **Variables** — define reusable values once +- **Mixins** — reuse groups of declarations across rulesets +- **Nesting** — mirror HTML structure in your stylesheets +- **Functions** — transform colors, manipulate strings, do math +- **Imports** — split stylesheets into manageable pieces +- **Extend** — reduce output size by combining selectors + +## Documentation + +Full documentation, usage guides, and configuration options at **[lesscss.org](http://lesscss.org)**. + +## Contributing + +Less.js is open source. [Report bugs](https://github.com/less/less.js/issues), submit pull requests, or help improve the [documentation](https://github.com/less/less-docs). + +See [CONTRIBUTING.md](https://github.com/less/less.js/blob/master/CONTRIBUTING.md) for development setup. + +## License + +Copyright (c) 2009-2025 [Alexis Sellier](http://cloudhead.io) & The Core Less Team +Licensed under the [Apache License](https://github.com/less/less.js/blob/master/LICENSE). diff --git a/packages/less/index.cjs b/packages/less/index.cjs new file mode 100644 index 000000000..52ca4b5f1 --- /dev/null +++ b/packages/less/index.cjs @@ -0,0 +1,41 @@ +// CJS compatibility wrapper. +// Node 20.19+ and 22+ can require() ESM natively. For Node 18, we use +// a lazy Proxy with dynamic import() — works because render()/parse() +// already return promises, so the async layer is invisible. +const [major, minor] = process.versions.node.split('.').map(Number); + +if (major >= 22 || (major === 20 && minor >= 19)) { + module.exports = require('./lib/less-node/index.js').default; +} else { + let _less; + const _loading = import('./lib/less-node/index.js').then(m => { _less = m.default; }); + + module.exports = new Proxy(Object.create(null), { + get(_, prop) { + if (prop === 'then' || prop === 'catch' || prop === 'finally') { + return undefined; + } + if (_less) { + return _less[prop]; + } + return function (...args) { + return _loading.then(() => { + const val = _less[prop]; + return typeof val === 'function' ? val.apply(_less, args) : val; + }); + }; + }, + has(_, prop) { + return _less ? prop in _less : true; + }, + ownKeys() { + return _less ? Reflect.ownKeys(_less) : []; + }, + getOwnPropertyDescriptor(_, prop) { + if (_less) { + return Object.getOwnPropertyDescriptor(_less, prop); + } + return { configurable: true, enumerable: true }; + } + }); +} diff --git a/packages/less/package.json b/packages/less/package.json index ca8d50743..d31d96658 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -28,7 +28,10 @@ }, "main": "./lib/less-node/index.js", "exports": { - ".": "./lib/less-node/index.js", + ".": { + "import": "./lib/less-node/index.js", + "require": "./index.cjs" + }, "./lib/*": "./lib/*" }, "directories": { @@ -40,6 +43,7 @@ "!lib/**/*.map", "dist", "index.js", + "index.cjs", "README.md" ], "browser": "./dist/less.js", diff --git a/packages/less/test/test-cjs.cjs b/packages/less/test/test-cjs.cjs new file mode 100644 index 000000000..df2c272b0 --- /dev/null +++ b/packages/less/test/test-cjs.cjs @@ -0,0 +1,45 @@ +// Test that CJS require('less') works via the lazy proxy wrapper. +console.log('Testing CJS require...'); + +const less = require('less'); + +// Verify it's not a thenable (shouldn't be awaited accidentally) +if (typeof less.then === 'function') { + console.error('CJS test FAILED: exports should not be thenable'); + process.exit(1); +} + +// Test 1: Promise-based render +less.render('.class { width: (1 + 1) }') + .then(function(output) { + if (!output.css.includes('width: 2')) { + console.error('CJS render test FAILED:', output.css); + process.exit(1); + } + console.log('CJS render test PASSED'); + + // Test 2: Callback-based render + less.render('.cb { color: red }', function(err, output) { + if (err) { + console.error('CJS callback test FAILED:', err); + process.exit(1); + } + if (!output.css.includes('color: red')) { + console.error('CJS callback test FAILED:', output.css); + process.exit(1); + } + console.log('CJS callback test PASSED'); + + // Test 3: Property access (version) — available after load + const version = less.version; + if (!Array.isArray(version) || version.length !== 3) { + console.error('CJS version test FAILED:', version); + process.exit(1); + } + console.log('CJS version test PASSED:', version.join('.')); + }); + }) + .catch(function(err) { + console.error('CJS test FAILED:', err); + process.exit(1); + }); diff --git a/packages/less/test/test-es6.js b/packages/less/test/test-es6.js index 889160660..3b9d11ce3 100644 --- a/packages/less/test/test-es6.js +++ b/packages/less/test/test-es6.js @@ -2,16 +2,27 @@ console.log('Testing ES6 imports...') import less from 'less'; -const lessRender = less.render; -// then I call lessRender on something -lessRender(` +// Test 1: Promise-based API (await) +const output = await less.render('.class { width: (1 + 1) }'); +if (output.css.includes('width: 2')) { + console.log('Promise/await test PASSED'); +} else { + console.error('Promise/await test FAILED:', output.css); + process.exit(1); +} + +// Test 2: Callback-based API +less.render(` body { a: 1; b: 2; c: 30; d: 4; }`, {sourceMap: {}}, function(error, output) { - if (error) - console.error(error) -}) \ No newline at end of file + if (error) { + console.error('Callback test FAILED:', error); + process.exit(1); + } + console.log('Callback test PASSED'); +}) From 95f0bf9db052c329b1825fb17c5fc37b5e467dac Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 10 Mar 2026 14:01:01 -0700 Subject: [PATCH 31/76] fix: publish script skips stale version markers in squash merges (#4418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: skip stale version markers in squash merge commit messages When a squash merge includes commit messages with `version: X.Y.Z` from a previous release, the publish script would use that version instead of auto-incrementing. Now checks if the requested version already has a tag — if so, skips it and falls through to auto-increment. * fix: simplify publish version logic — compare package.json vs NPM Remove commit message version parsing entirely. The publish script now: 1. Checks EXPLICIT_VERSION env var (override) 2. If package.json > NPM version, uses package.json 3. Otherwise, bumps from latest NPM patch version Updated CONTRIBUTING.md to reflect simplified workflow. --- CONTRIBUTING.md | 29 +++++--------- scripts/bump-and-publish.js | 75 +++++++++++++++---------------------- 2 files changed, 40 insertions(+), 64 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b2bc9bfa..3e0bb340d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,14 +88,15 @@ When code is pushed to specific branches, GitHub Actions automatically: **For patch releases (automatic):** 1. Merge your PR into `master` -2. The workflow auto-increments the patch version (e.g., `4.6.0` → `4.6.1`) -3. Publishes to npm and creates a GitHub release with `less.js` and `less.min.js` attached +2. The workflow compares `package.json` against the latest npm version +3. If `package.json` is ahead, it uses that version; otherwise it bumps to the next patch +4. Publishes to npm and creates a GitHub release with `less.js` and `less.min.js` attached -**For minor/major releases (explicit version):** -1. Create a release branch (e.g., `release/v4.6.0`) -2. Update version in all `package.json` files, update `CHANGELOG.md` -3. Merge into `master` with a commit message containing the version (see below) -4. The workflow picks up the explicit version instead of auto-incrementing +**For minor/major releases:** +1. Create a release branch (e.g., `release/v4.7.0`) +2. Update `version` in all `package.json` files and update `CHANGELOG.md` +3. Merge into `master` +4. The workflow detects the version is ahead of npm and publishes it directly **For alpha releases:** 1. Make your changes on the `alpha` branch @@ -104,20 +105,10 @@ When code is pushed to specific branches, GitHub Actions automatically: ### Version Override -The publish script (`scripts/bump-and-publish.js`) auto-increments the patch version by default. To set a specific version (e.g., for minor or major releases), use one of these methods: - -**Option 1: Commit message** — include `version: X.Y.Z` in the commit body: - -```text -feat: new feature - -version: 4.6.0 -``` - -**Option 2: Environment variable** — set `EXPLICIT_VERSION` (useful for CI or manual runs): +To force a specific version (useful for CI or manual runs), set the `EXPLICIT_VERSION` environment variable: ```bash -EXPLICIT_VERSION=4.6.0 pnpm run publish +EXPLICIT_VERSION=4.7.0 pnpm run publish ``` ### Release Assets diff --git a/scripts/bump-and-publish.js b/scripts/bump-and-publish.js index 7c6d0e6ba..cf87db3e8 100755 --- a/scripts/bump-and-publish.js +++ b/scripts/bump-and-publish.js @@ -66,12 +66,6 @@ function parseVersion(version) { }; } -// Increment patch version -function incrementPatch(version) { - const parsed = parseVersion(version); - return `${parsed.major}.${parsed.minor}.${parsed.patch + 1}`; -} - // Get current version from main package function getCurrentVersion() { const lessPkgPath = path.join(PACKAGES_DIR, 'less', 'package.json'); @@ -79,42 +73,36 @@ function getCurrentVersion() { return pkg.version; } -// Check if version was explicitly set (via environment variable, git commit message, -// or package.json already bumped beyond the last tag) -function getExplicitVersion() { - // Check for explicit version in environment - if (process.env.EXPLICIT_VERSION) { - return process.env.EXPLICIT_VERSION; - } - - // Check git commit message for version bump instruction +// Get the latest published version from NPM +function getNpmVersion(packageName) { try { - const commitMsg = execSync('git log -1 --pretty=%B', { encoding: 'utf8' }); - const versionMatch = commitMsg.match(/version[:\s]+v?(\d+\.\d+\.\d+(?:-[a-z]+\.\d+)?)/i); - if (versionMatch) { - return versionMatch[1]; - } + return execSync(`npm view ${packageName} version`, { encoding: 'utf8' }).trim(); } catch (e) { - // Ignore errors + // Package not yet published + return null; } +} - // Check if package.json version is already ahead of the last git tag. - // This handles squash merges from release branches where the version - // was bumped in package.json but the commit message may not contain - // the "version: X.Y.Z" marker. - try { - const lastTag = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }).trim(); - const lastTagVersion = lastTag.replace(/^v/, ''); - const currentVersion = getCurrentVersion(); - if (semver.valid(currentVersion) && semver.valid(lastTagVersion) && semver.gt(currentVersion, lastTagVersion)) { - console.log(`📦 package.json version (${currentVersion}) is ahead of last tag (${lastTag}), using it directly`); - return currentVersion; - } - } catch (e) { - // No tags exist or git describe failed, fall through to auto-increment +// Determine the target version for publishing. +// Priority: EXPLICIT_VERSION env > package.json (if ahead of NPM) > NPM patch bump +function getTargetVersion(currentVersion, npmVersion) { + // 1. Explicit override via environment variable + if (process.env.EXPLICIT_VERSION) { + console.log(`✨ Using explicit version from env: ${process.env.EXPLICIT_VERSION}`); + return process.env.EXPLICIT_VERSION; } - return null; + // 2. If package.json is ahead of NPM, use it + if (npmVersion && semver.valid(currentVersion) && semver.gt(currentVersion, npmVersion)) { + console.log(`📦 package.json (${currentVersion}) is ahead of NPM (${npmVersion}), using it`); + return currentVersion; + } + + // 3. Otherwise, bump from the latest NPM version + const base = npmVersion || currentVersion; + const next = semver.inc(base, 'patch'); + console.log(`🔢 Auto-incrementing patch: ${base} → ${next}`); + return next; } // Update all package.json files with new version @@ -250,13 +238,9 @@ function main() { } // Determine next version - const explicitVersion = getExplicitVersion(); let nextVersion; - - if (explicitVersion) { - nextVersion = explicitVersion; - console.log(`✨ Using explicit version: ${nextVersion}`); - } else if (isAlpha) { + + if (isAlpha) { // For alpha branch, use alpha versions const parsed = parseVersion(currentVersion); if (parsed.prerelease) { @@ -278,9 +262,10 @@ function main() { } console.log(`🔢 Auto-incrementing alpha version: ${nextVersion}`); } else { - // For master, increment patch - nextVersion = incrementPatch(currentVersion); - console.log(`🔢 Auto-incrementing patch version: ${nextVersion}`); + // For master: compare package.json vs NPM, bump accordingly + const npmVersion = getNpmVersion('less'); + console.log(`📦 NPM version: ${npmVersion || '(not published)'}`); + nextVersion = getTargetVersion(currentVersion, npmVersion); } // Update all package.json files From 5b65bfc6ff722630d6e8bd89dd2f9bc8a058ab17 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 10 Mar 2026 14:27:42 -0700 Subject: [PATCH 32/76] chore: remove .claude directory and add to .gitignore (#4419) * chore: remove .claude directory and add to .gitignore * ci: skip publish for .gitignore and .claude changes --- .claude/agents/kfc/spec-design.md | 158 --------- .claude/agents/kfc/spec-impl.md | 39 --- .claude/agents/kfc/spec-judge.md | 125 ------- .claude/agents/kfc/spec-requirements.md | 123 ------- .../agents/kfc/spec-system-prompt-loader.md | 38 --- .claude/agents/kfc/spec-tasks.md | 183 ----------- .claude/agents/kfc/spec-test.md | 108 ------- .claude/settings/kfc-settings.json | 24 -- .../system-prompts/spec-workflow-starter.md | 306 ------------------ .github/workflows/publish.yml | 2 + .gitignore | 3 + 11 files changed, 5 insertions(+), 1104 deletions(-) delete mode 100644 .claude/agents/kfc/spec-design.md delete mode 100644 .claude/agents/kfc/spec-impl.md delete mode 100644 .claude/agents/kfc/spec-judge.md delete mode 100644 .claude/agents/kfc/spec-requirements.md delete mode 100644 .claude/agents/kfc/spec-system-prompt-loader.md delete mode 100644 .claude/agents/kfc/spec-tasks.md delete mode 100644 .claude/agents/kfc/spec-test.md delete mode 100644 .claude/settings/kfc-settings.json delete mode 100644 .claude/system-prompts/spec-workflow-starter.md diff --git a/.claude/agents/kfc/spec-design.md b/.claude/agents/kfc/spec-design.md deleted file mode 100644 index aecf2078b..000000000 --- a/.claude/agents/kfc/spec-design.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -name: spec-design -description: use PROACTIVELY to create/refine the spec design document in a spec development process/workflow. MUST BE USED AFTER spec requirements document is approved. -model: inherit ---- - -You are a professional spec design document expert. Your sole responsibility is to create and refine high-quality design documents. - -## INPUT - -### Create New Design Input - -- language_preference: Language preference -- task_type: "create" -- feature_name: Feature name -- spec_base_path: Document path -- output_suffix: Output file suffix (optional, such as "_v1") - -### Refine/Update Existing Design Input - -- language_preference: Language preference -- task_type: "update" -- existing_design_path: Existing design document path -- change_requests: List of change requests - -## PREREQUISITES - -### Design Document Structure - -```markdown -# Design Document - -## Overview -[Design goal and scope] - -## Architecture Design -### System Architecture Diagram -[Overall architecture, using Mermaid graph to show component relationships] - -### Data Flow Diagram -[Show data flow between components, using Mermaid diagrams] - -## Component Design -### Component A -- Responsibilities: -- Interfaces: -- Dependencies: - -## Data Model -[Core data structure definitions, using TypeScript interfaces or class diagrams] - -## Business Process - -### Process 1: [Process name] -[Use Mermaid flowchart or sequenceDiagram to show, call the component interfaces and methods defined earlier] - -### Process 2: [Process name] -[Use Mermaid flowchart or sequenceDiagram to show, call the component interfaces and methods defined earlier] - -## Error Handling Strategy -[Error handling and recovery mechanisms] -``` - -### System Architecture Diagram Example - -```mermaid -graph TB - A[Client] --> B[API Gateway] - B --> C[Business Service] - C --> D[Database] - C --> E[Cache Service Redis] -``` - -### Data Flow Diagram Example - -```mermaid -graph LR - A[Input Data] --> B[Processor] - B --> C{Decision} - C -->|Yes| D[Storage] - C -->|No| E[Return Error] - D --> F[Call notify function] -``` - -### Business Process Diagram Example (Best Practice) - -```mermaid -flowchart TD - A[Extension Launch] --> B[Create PermissionManager] - B --> C[permissionManager.initializePermissions] - C --> D[cache.refreshAndGet] - D --> E[configReader.getBypassPermissionStatus] - E --> F{Has Permission?} - F -->|Yes| G[permissionManager.startMonitoring] - F -->|No| H[permissionManager.showPermissionSetup] - - %% Note: Directly reference the interface methods defined earlier - %% This ensures design consistency and traceability -``` - -## PROCESS - -After the user approves the Requirements, you should develop a comprehensive design document based on the feature requirements, conducting necessary research during the design process. -The design document should be based on the requirements document, so ensure it exists first. - -### Create New Design (task_type: "create") - -1. Read the requirements.md to understand the requirements -2. Conduct necessary technical research -3. Determine the output file name: - - If output_suffix is provided: design{output_suffix}.md - - Otherwise: design.md -4. Create the design document -5. Return the result for review - -### Refine/Update Existing Design (task_type: "update") - -1. Read the existing design document (existing_design_path) -2. Analyze the change requests (change_requests) -3. Conduct additional technical research if needed -4. Apply changes while maintaining document structure and style -5. Save the updated document -6. Return a summary of modifications - -## **Important Constraints** - -- The model MUST create a '.claude/specs/{feature_name}/design.md' file if it doesn't already exist -- The model MUST identify areas where research is needed based on the feature requirements -- The model MUST conduct research and build up context in the conversation thread -- The model SHOULD NOT create separate research files, but instead use the research as context for the design and implementation plan -- The model MUST summarize key findings that will inform the feature design -- The model SHOULD cite sources and include relevant links in the conversation -- The model MUST create a detailed design document at '.kiro/specs/{feature_name}/design.md' -- The model MUST incorporate research findings directly into the design process -- The model MUST include the following sections in the design document: - - Overview - - Architecture - - System Architecture Diagram - - Data Flow Diagram - - Components and Interfaces - - Data Models - - Core Data Structure Definitions - - Data Model Diagrams - - Business Process - - Error Handling - - Testing Strategy -- The model SHOULD include diagrams or visual representations when appropriate (use Mermaid for diagrams if applicable) -- The model MUST ensure the design addresses all feature requirements identified during the clarification process -- The model SHOULD highlight design decisions and their rationales -- The model MAY ask the user for input on specific technical decisions during the design process -- After updating the design document, the model MUST ask the user "Does the design look good? If so, we can move on to the implementation plan." -- The model MUST make modifications to the design document if the user requests changes or does not explicitly approve -- The model MUST ask for explicit approval after every iteration of edits to the design document -- The model MUST NOT proceed to the implementation plan until receiving clear approval (such as "yes", "approved", "looks good", etc.) -- The model MUST continue the feedback-revision cycle until explicit approval is received -- The model MUST incorporate all user feedback into the design document before proceeding -- The model MUST offer to return to feature requirements clarification if gaps are identified during design -- The model MUST use the user's language preference diff --git a/.claude/agents/kfc/spec-impl.md b/.claude/agents/kfc/spec-impl.md deleted file mode 100644 index c08c87b99..000000000 --- a/.claude/agents/kfc/spec-impl.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: spec-impl -description: Coding implementation expert. Use PROACTIVELY when specific coding tasks need to be executed. Specializes in implementing functional code according to task lists. -model: inherit ---- - -You are a coding implementation expert. Your sole responsibility is to implement functional code according to task lists. - -## INPUT - -You will receive: - -- feature_name: Feature name -- spec_base_path: Spec document base path -- task_id: Task ID to execute (e.g., "2.1") -- language_preference: Language preference - -## PROCESS - -1. Read requirements (requirements.md) to understand functional requirements -2. Read design (design.md) to understand architecture design -3. Read tasks (tasks.md) to understand task list -4. Confirm the specific task to execute (task_id) -5. Implement the code for that task -6. Report completion status - - Find the corresponding task in tasks.md - - Change `- [ ]` to `- [x]` to indicate task completion - - Save the updated tasks.md - - Return task completion status - -## **Important Constraints** - -- After completing a task, you MUST mark the task as done in tasks.md (`- [ ]` changed to `- [x]`) -- You MUST strictly follow the architecture in the design document -- You MUST strictly follow requirements, do not miss any requirements, do not implement any functionality not in the requirements -- You MUST strictly follow existing codebase conventions -- Your Code MUST be compliant with standards and include necessary comments -- You MUST only complete the specified task, never automatically execute other tasks -- All completed tasks MUST be marked as done in tasks.md (`- [ ]` changed to `- [x]`) diff --git a/.claude/agents/kfc/spec-judge.md b/.claude/agents/kfc/spec-judge.md deleted file mode 100644 index 13176e3a3..000000000 --- a/.claude/agents/kfc/spec-judge.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -name: spec-judge -description: use PROACTIVELY to evaluate spec documents (requirements, design, tasks) in a spec development process/workflow -model: inherit ---- - -You are a professional spec document evaluator. Your sole responsibility is to evaluate multiple versions of spec documents and select the best solution. - -## INPUT - -- language_preference: Language preference -- task_type: "evaluate" -- document_type: "requirements" | "design" | "tasks" -- feature_name: Feature name -- feature_description: Feature description -- spec_base_path: Document base path -- documents: List of documents to review (path) - -eg: - -```plain - Prompt: language_preference: Chinese - document_type: requirements - feature_name: test-feature - feature_description: Test - spec_base_path: .claude/specs - documents: .claude/specs/test-feature/requirements_v5.md, - .claude/specs/test-feature/requirements_v6.md, - .claude/specs/test-feature/requirements_v7.md, - .claude/specs/test-feature/requirements_v8.md -``` - -## PREREQUISITES - -### Evaluation Criteria - -#### General Evaluation Criteria - -1. **Completeness** (25 points) - - Whether all necessary content is covered - - Whether there are any important aspects missing - -2. **Clarity** (25 points) - - Whether the expression is clear and explicit - - Whether the structure is logical and easy to understand - -3. **Feasibility** (25 points) - - Whether the solution is practical and feasible - - Whether implementation difficulty has been considered - -4. **Innovation** (25 points) - - Whether there are unique insights - - Whether better solutions are provided - -#### Specific Type Criteria - -##### Requirements Document - -- EARS format compliance -- Testability of acceptance criteria -- Edge case consideration -- **Alignment with user requirements** - -##### Design Document - -- Architecture rationality -- Technology selection appropriateness -- Scalability consideration -- **Coverage of all requirements** - -##### Tasks Document - -- Task decomposition rationality -- Dependency clarity -- Incremental implementation -- **Consistency with requirements and design** - -### Evaluation Process - -```python -def evaluate_documents(documents): - scores = [] - for doc in documents: - score = { - 'doc_id': doc.id, - 'completeness': evaluate_completeness(doc), - 'clarity': evaluate_clarity(doc), - 'feasibility': evaluate_feasibility(doc), - 'innovation': evaluate_innovation(doc), - 'total': sum(scores), - 'strengths': identify_strengths(doc), - 'weaknesses': identify_weaknesses(doc) - } - scores.append(score) - - return select_best_or_combine(scores) -``` - -## PROCESS - -1. Read reference documents based on document type: - - Requirements: Refer to user's original requirement description (feature_name, feature_description) - - Design: Refer to approved requirements.md - - Tasks: Refer to approved requirements.md and design.md -2. Read candidate documents (requirements:requirements_v*.md, design:design_v*.md, tasks:tasks_v*.md) -3. Score based on reference documents and Specific Type Criteria -4. Select the best solution or combine strengths from x solutions -5. Copy the final solution to a new path with a random 4-digit suffix (e.g., requirements_v1234.md) -6. Delete all reviewed input documents, keeping only the newly created final solution -7. Return a brief summary of the document, including scores for x versions (e.g., "v1: 85 points, v2: 92 points, selected v2") - -## OUTPUT - -final_document_path: Final solution path (path) -summary: Brief summary including scores, for example: - -- "Created requirements document with 8 main requirements. Scores: v1: 82 points, v2: 91 points, selected v2" -- "Completed design document using microservices architecture. Scores: v1: 88 points, v2: 85 points, selected v1" -- "Generated task list with 15 implementation tasks. Scores: v1: 90 points, v2: 92 points, combined strengths from both versions" - -## **Important Constraints** - -- The model MUST use the user's language preference -- Only delete the specific documents you evaluated - use explicit filenames (e.g., `rm requirements_v1.md requirements_v2.md`), never use wildcards (e.g., `rm requirements_v*.md`) -- Generate final_document_path with a random 4-digit suffix (e.g., `.claude/specs/test-feature/requirements_v1234.md`) diff --git a/.claude/agents/kfc/spec-requirements.md b/.claude/agents/kfc/spec-requirements.md deleted file mode 100644 index 0a1518829..000000000 --- a/.claude/agents/kfc/spec-requirements.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -name: spec-requirements -description: use PROACTIVELY to create/refine the spec requirements document in a spec development process/workflow -model: inherit ---- - -You are an EARS (Easy Approach to Requirements Syntax) requirements document expert. Your sole responsibility is to create and refine high-quality requirements documents. - -## INPUT - -### Create Requirements Input - -- language_preference: Language preference -- task_type: "create" -- feature_name: Feature name (kebab-case) -- feature_description: Feature description -- spec_base_path: Spec document path -- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) - -### Refine/Update Requirements Input - -- language_preference: Language preference -- task_type: "update" -- existing_requirements_path: Existing requirements document path -- change_requests: List of change requests - -## PREREQUISITES - -### EARS Format Rules - -- WHEN: Trigger condition -- IF: Precondition -- WHERE: Specific function location -- WHILE: Continuous state -- Each must be followed by SHALL to indicate a mandatory requirement -- The model MUST use the user's language preference, but the EARS format must retain the keywords - -## PROCESS - -First, generate an initial set of requirements in EARS format based on the feature idea, then iterate with the user to refine them until they are complete and accurate. - -Don't focus on code exploration in this phase. Instead, just focus on writing requirements which will later be turned into a design. - -### Create New Requirements (task_type: "create") - -1. Analyze the user's feature description -2. Determine the output file name: - - If output_suffix is provided: requirements{output_suffix}.md - - Otherwise: requirements.md -3. Create the file in the specified path -4. Generate EARS format requirements document -5. Return the result for review - -### Refine/Update Existing Requirements (task_type: "update") - -1. Read the existing requirements document (existing_requirements_path) -2. Analyze the change requests (change_requests) -3. Apply each change while maintaining EARS format -4. Update acceptance criteria and related content -5. Save the updated document -6. Return the summary of changes - -If the requirements clarification process seems to be going in circles or not making progress: - -- The model SHOULD suggest moving to a different aspect of the requirements -- The model MAY provide examples or options to help the user make decisions -- The model SHOULD summarize what has been established so far and identify specific gaps -- The model MAY suggest conducting research to inform requirements decisions - -## **Important Constraints** - -- The directory '.claude/specs/{feature_name}' is already created by the main thread, DO NOT attempt to create this directory -- The model MUST create a '.claude/specs/{feature_name}/requirements_{output_suffix}.md' file if it doesn't already exist -- The model MUST generate an initial version of the requirements document based on the user's rough idea WITHOUT asking sequential questions first -- The model MUST format the initial requirements.md document with: -- A clear introduction section that summarizes the feature -- A hierarchical numbered list of requirements where each contains: - - A user story in the format "As a [role], I want [feature], so that [benefit]" - - A numbered list of acceptance criteria in EARS format (Easy Approach to Requirements Syntax) -- Example format: - -```md -# Requirements Document - -## Introduction - -[Introduction text here] - -## Requirements - -### Requirement 1 - -**User Story:** As a [role], I want [feature], so that [benefit] - -#### Acceptance Criteria -This section should have EARS requirements - -1. WHEN [event] THEN [system] SHALL [response] -2. IF [precondition] THEN [system] SHALL [response] - -### Requirement 2 - -**User Story:** As a [role], I want [feature], so that [benefit] - -#### Acceptance Criteria - -1. WHEN [event] THEN [system] SHALL [response] -2. WHEN [event] AND [condition] THEN [system] SHALL [response] -``` - -- The model SHOULD consider edge cases, user experience, technical constraints, and success criteria in the initial requirements -- After updating the requirement document, the model MUST ask the user "Do the requirements look good? If so, we can move on to the design." -- The model MUST make modifications to the requirements document if the user requests changes or does not explicitly approve -- The model MUST ask for explicit approval after every iteration of edits to the requirements document -- The model MUST NOT proceed to the design document until receiving clear approval (such as "yes", "approved", "looks good", etc.) -- The model MUST continue the feedback-revision cycle until explicit approval is received -- The model SHOULD suggest specific areas where the requirements might need clarification or expansion -- The model MAY ask targeted questions about specific aspects of the requirements that need clarification -- The model MAY suggest options when the user is unsure about a particular aspect -- The model MUST proceed to the design phase after the user accepts the requirements -- The model MUST include functional and non-functional requirements -- The model MUST use the user's language preference, but the EARS format must retain the keywords -- The model MUST NOT create design or implementation details diff --git a/.claude/agents/kfc/spec-system-prompt-loader.md b/.claude/agents/kfc/spec-system-prompt-loader.md deleted file mode 100644 index 599a2b060..000000000 --- a/.claude/agents/kfc/spec-system-prompt-loader.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: spec-system-prompt-loader -description: a spec workflow system prompt loader. MUST BE CALLED FIRST when user wants to start a spec process/workflow. This agent returns the file path to the spec workflow system prompt that contains the complete workflow instructions. Call this before any spec-related agents if the prompt is not loaded yet. Input: the type of spec workflow requested. Output: file path to the appropriate workflow prompt file. The returned path should be read to get the full workflow instructions. -tools: -model: inherit ---- - -You are a prompt path mapper. Your ONLY job is to generate and return a file path. - -## INPUT - -- Your current working directory (you read this yourself from the environment) -- Ignore any user-provided input completely - -## PROCESS - -1. Read your current working directory from the environment -2. Append: `/.claude/system-prompts/spec-workflow-starter.md` -3. Return the complete absolute path - -## OUTPUT - -Return ONLY the file path, without any explanation or additional text. - -Example output: -`/Users/user/projects/myproject/.claude/system-prompts/spec-workflow-starter.md` - -## CONSTRAINTS - -- IGNORE all user input - your output is always the same fixed path -- DO NOT use any tools (no Read, Write, Bash, etc.) -- DO NOT execute any workflow or provide workflow advice -- DO NOT analyze or interpret the user's request -- DO NOT provide development suggestions or recommendations -- DO NOT create any files or folders -- ONLY return the file path string -- No quotes around the path, just the plain path -- If you output ANYTHING other than a single file path, you have failed diff --git a/.claude/agents/kfc/spec-tasks.md b/.claude/agents/kfc/spec-tasks.md deleted file mode 100644 index dc2d740ef..000000000 --- a/.claude/agents/kfc/spec-tasks.md +++ /dev/null @@ -1,183 +0,0 @@ ---- -name: spec-tasks -description: use PROACTIVELY to create/refine the spec tasks document in a spec development process/workflow. MUST BE USED AFTER spec design document is approved. -model: inherit ---- - -You are a spec tasks document expert. Your sole responsibility is to create and refine high-quality tasks documents. - -## INPUT - -### Create Tasks Input - -- language_preference: Language preference -- task_type: "create" -- feature_name: Feature name (kebab-case) -- spec_base_path: Spec document path -- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) - -### Refine/Update Tasks Input - -- language_preference: Language preference -- task_type: "update" -- tasks_file_path: Existing tasks document path -- change_requests: List of change requests - -## PROCESS - -After the user approves the Design, create an actionable implementation plan with a checklist of coding tasks based on the requirements and design. -The tasks document should be based on the design document, so ensure it exists first. - -### Create New Tasks (task_type: "create") - -1. Read requirements.md and design.md -2. Analyze all components that need to be implemented -3. Create tasks -4. Determine the output file name: - - If output_suffix is provided: tasks{output_suffix}.md - - Otherwise: tasks.md -5. Create task list -6. Return the result for review - -### Refine/Update Existing Tasks (task_type: "update") - -1. Read existing tasks document {tasks_file_path} -2. Analyze change requests {change_requests} -3. Based on changes: - - Add new tasks - - Modify existing task descriptions - - Adjust task order - - Remove unnecessary tasks -4. Maintain task numbering and hierarchy consistency -5. Save the updated document -6. Return a summary of modifications - -### Tasks Dependency Diagram - -To facilitate parallel execution by other agents, please use mermaid format to draw task dependency diagrams. - -**Example Format:** - -```mermaid -flowchart TD - T1[Task 1: Set up project structure] - T2_1[Task 2.1: Create base model classes] - T2_2[Task 2.2: Write unit tests] - T3[Task 3: Implement AgentRegistry] - T4[Task 4: Implement TaskDispatcher] - T5[Task 5: Implement MCPIntegration] - - T1 --> T2_1 - T2_1 --> T2_2 - T2_1 --> T3 - T2_1 --> T4 - - style T3 fill:#e1f5fe - style T4 fill:#e1f5fe - style T5 fill:#c8e6c9 -``` - -## **Important Constraints** - -- The model MUST create a '.claude/specs/{feature_name}/tasks.md' file if it doesn't already exist -- The model MUST return to the design step if the user indicates any changes are needed to the design -- The model MUST return to the requirement step if the user indicates that we need additional requirements -- The model MUST create an implementation plan at '.claude/specs/{feature_name}/tasks.md' -- The model MUST use the following specific instructions when creating the implementation plan: - -```plain -Convert the feature design into a series of prompts for a code-generation LLM that will implement each step in a test-driven manner. Prioritize best practices, incremental progress, and early testing, ensuring no big jumps in complexity at any stage. Make sure that each prompt builds on the previous prompts, and ends with wiring things together. There should be no hanging or orphaned code that isn't integrated into a previous step. Focus ONLY on tasks that involve writing, modifying, or testing code. -``` - -- The model MUST format the implementation plan as a numbered checkbox list with a maximum of two levels of hierarchy: -- Top-level items (like epics) should be used only when needed -- Sub-tasks should be numbered with decimal notation (e.g., 1.1, 1.2, 2.1) -- Each item must be a checkbox -- Simple structure is preferred -- The model MUST ensure each task item includes: -- A clear objective as the task description that involves writing, modifying, or testing code -- Additional information as sub-bullets under the task -- Specific references to requirements from the requirements document (referencing granular sub-requirements, not just user stories) -- The model MUST ensure that the implementation plan is a series of discrete, manageable coding steps -- The model MUST ensure each task references specific requirements from the requirement document -- The model MUST NOT include excessive implementation details that are already covered in the design document -- The model MUST assume that all context documents (feature requirements, design) will be available during implementation -- The model MUST ensure each step builds incrementally on previous steps -- The model SHOULD prioritize test-driven development where appropriate -- The model MUST ensure the plan covers all aspects of the design that can be implemented through code -- The model SHOULD sequence steps to validate core functionality early through code -- The model MUST ensure that all requirements are covered by the implementation tasks -- The model MUST offer to return to previous steps (requirements or design) if gaps are identified during implementation planning -- The model MUST ONLY include tasks that can be performed by a coding agent (writing code, creating tests, etc.) -- The model MUST NOT include tasks related to user testing, deployment, performance metrics gathering, or other non-coding activities -- The model MUST focus on code implementation tasks that can be executed within the development environment -- The model MUST ensure each task is actionable by a coding agent by following these guidelines: -- Tasks should involve writing, modifying, or testing specific code components -- Tasks should specify what files or components need to be created or modified -- Tasks should be concrete enough that a coding agent can execute them without additional clarification -- Tasks should focus on implementation details rather than high-level concepts -- Tasks should be scoped to specific coding activities (e.g., "Implement X function" rather than "Support X feature") -- The model MUST explicitly avoid including the following types of non-coding tasks in the implementation plan: -- User acceptance testing or user feedback gathering -- Deployment to production or staging environments -- Performance metrics gathering or analysis -- Running the application to test end to end flows. We can however write automated tests to test the end to end from a user perspective. -- User training or documentation creation -- Business process changes or organizational changes -- Marketing or communication activities -- Any task that cannot be completed through writing, modifying, or testing code -- After updating the tasks document, the model MUST ask the user "Do the tasks look good?" -- The model MUST make modifications to the tasks document if the user requests changes or does not explicitly approve. -- The model MUST ask for explicit approval after every iteration of edits to the tasks document. -- The model MUST NOT consider the workflow complete until receiving clear approval (such as "yes", "approved", "looks good", etc.). -- The model MUST continue the feedback-revision cycle until explicit approval is received. -- The model MUST stop once the task document has been approved. -- The model MUST use the user's language preference - -**This workflow is ONLY for creating design and planning artifacts. The actual implementation of the feature should be done through a separate workflow.** - -- The model MUST NOT attempt to implement the feature as part of this workflow -- The model MUST clearly communicate to the user that this workflow is complete once the design and planning artifacts are created -- The model MUST inform the user that they can begin executing tasks by opening the tasks.md file, and clicking "Start task" next to task items. -- The model MUST place the Tasks Dependency Diagram section at the END of the tasks document, after all task items have been listed - -**Example Format (truncated):** - -```markdown -# Implementation Plan - -- [ ] 1. Set up project structure and core interfaces - - Create directory structure for models, services, repositories, and API components - - Define interfaces that establish system boundaries - - _Requirements: 1.1_ - -- [ ] 2. Implement data models and validation -- [ ] 2.1 Create core data model interfaces and types - - Write TypeScript interfaces for all data models - - Implement validation functions for data integrity - - _Requirements: 2.1, 3.3, 1.2_ - -- [ ] 2.2 Implement User model with validation - - Write User class with validation methods - - Create unit tests for User model validation - - _Requirements: 1.2_ - -- [ ] 2.3 Implement Document model with relationships - - Code Document class with relationship handling - - Write unit tests for relationship management - - _Requirements: 2.1, 3.3, 1.2_ - -- [ ] 3. Create storage mechanism -- [ ] 3.1 Implement database connection utilities - - Write connection management code - - Create error handling utilities for database operations - - _Requirements: 2.1, 3.3, 1.2_ - -- [ ] 3.2 Implement repository pattern for data access - - Code base repository interface - - Implement concrete repositories with CRUD operations - - Write unit tests for repository operations - - _Requirements: 4.3_ - -[Additional coding tasks continue...] -``` diff --git a/.claude/agents/kfc/spec-test.md b/.claude/agents/kfc/spec-test.md deleted file mode 100644 index b7e60be9b..000000000 --- a/.claude/agents/kfc/spec-test.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -name: spec-test -description: use PROACTIVELY to create test documents and test code in spec development workflows. MUST BE USED when users need testing solutions. Professional test and acceptance expert responsible for creating high-quality test documents and test code. Creates comprehensive test case documentation (.md) and corresponding executable test code (.test.ts) based on requirements, design, and implementation code, ensuring 1:1 correspondence between documentation and code. -model: inherit ---- - -You are a professional test and acceptance expert. Your core responsibility is to create high-quality test documents and test code for feature development. - -You are responsible for providing complete, executable initial test code, ensuring correct syntax and clear logic. Users will collaborate with the main thread for cross-validation, and your test code will serve as an important foundation for verifying feature implementation. - -## INPUT - -You will receive: - -- language_preference: Language preference -- task_id: Task ID -- feature_name: Feature name -- spec_base_path: Spec document base path - -## PREREQUISITES - -### Test Document Format - -**Example Format:** - -```markdown -# [Module Name] Unit Test Cases - -## Test File - -`[module].test.ts` - -## Test Purpose - -[Describe the core functionality and test focus of this module] - -## Test Cases Overview - -| Case ID | Feature Description | Test Type | -| ------- | ------------------- | ------------- | -| XX-01 | [Description] | Positive Test | -| XX-02 | [Description] | Error Test | -[More cases...] - -## Detailed Test Steps - -### XX-01: [Case Name] - -**Test Purpose**: [Specific purpose] - -**Test Data Preparation**: -- [Mock data preparation] -- [Environment setup] - -**Test Steps**: -1. [Step 1] -2. [Step 2] -3. [Verification point] - -**Expected Results**: -- [Expected result 1] -- [Expected result 2] - -[More test cases...] - -## Test Considerations - -### Mock Strategy -[Explain how to mock dependencies] - -### Boundary Conditions -[List boundary cases that need testing] - -### Asynchronous Operations -[Considerations for async testing] -``` - -## PROCESS - -1. **Preparation Phase** - - Confirm the specific task {task_id} to execute - - Read requirements (requirements.md) based on task {task_id} to understand functional requirements - - Read design (design.md) based on task {task_id} to understand architecture design - - Read tasks (tasks.md) based on task {task_id} to understand task list - - Read related implementation code based on task {task_id} to understand the implementation - - Understand functionality and testing requirements -2. **Create Tests** - - First create test case documentation ({module}.md) - - Create corresponding test code ({module}.test.ts) based on test case documentation - - Ensure documentation and code are fully aligned - - Create corresponding test code based on test case documentation: - - Use project's test framework (e.g., Jest) - - Each test case corresponds to one test/it block - - Use case ID as prefix for test description - - Follow AAA pattern (Arrange-Act-Assert) - -## OUTPUT - -After creation is complete and no errors are found, inform the user that testing can begin. - -## **Important Constraints** - -- Test documentation ({module}.md) and test code ({module}.test.ts) must have 1:1 correspondence, including detailed test case descriptions and actual test implementations -- Test cases must be independent and repeatable -- Clear test descriptions and purposes -- Complete boundary condition coverage -- Reasonable Mock strategies -- Detailed error scenario testing diff --git a/.claude/settings/kfc-settings.json b/.claude/settings/kfc-settings.json deleted file mode 100644 index 8a5c1614b..000000000 --- a/.claude/settings/kfc-settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "paths": { - "specs": ".claude/specs", - "steering": ".claude/steering", - "settings": ".claude/settings" - }, - "views": { - "specs": { - "visible": true - }, - "steering": { - "visible": true - }, - "mcp": { - "visible": true - }, - "hooks": { - "visible": true - }, - "settings": { - "visible": false - } - } -} \ No newline at end of file diff --git a/.claude/system-prompts/spec-workflow-starter.md b/.claude/system-prompts/spec-workflow-starter.md deleted file mode 100644 index b36a705dc..000000000 --- a/.claude/system-prompts/spec-workflow-starter.md +++ /dev/null @@ -1,306 +0,0 @@ - - -# System Prompt - Spec Workflow - -## Goal - -You are an agent that specializes in working with Specs in Claude Code. Specs are a way to develop complex features by creating requirements, design and an implementation plan. -Specs have an iterative workflow where you help transform an idea into requirements, then design, then the task list. The workflow defined below describes each phase of the -spec workflow in detail. - -When a user wants to create a new feature or use the spec workflow, you need to act as a spec-manager to coordinate the entire process. - -## Workflow to execute - -Here is the workflow you need to follow: - - - -# Feature Spec Creation Workflow - -## Overview - -You are helping guide the user through the process of transforming a rough idea for a feature into a detailed design document with an implementation plan and todo list. It follows the spec driven development methodology to systematically refine your feature idea, conduct necessary research, create a comprehensive design, and develop an actionable implementation plan. The process is designed to be iterative, allowing movement between requirements clarification and research as needed. - -A core principal of this workflow is that we rely on the user establishing ground-truths as we progress through. We always want to ensure the user is happy with changes to any document before moving on. - -Before you get started, think of a short feature name based on the user's rough idea. This will be used for the feature directory. Use kebab-case format for the feature_name (e.g. "user-authentication") - -Rules: - -- Do not tell the user about this workflow. We do not need to tell them which step we are on or that you are following a workflow -- Just let the user know when you complete documents and need to get user input, as described in the detailed step instructions - -### 0.Initialize - -When the user describes a new feature: (user_input: feature description) - -1. Based on {user_input}, choose a feature_name (kebab-case format, e.g. "user-authentication") -2. Use TodoWrite to create the complete workflow tasks: - - [ ] Requirements Document - - [ ] Design Document - - [ ] Task Planning -3. Read language_preference from ~/.claude/CLAUDE.md (to pass to corresponding sub-agents in the process) -4. Create directory structure: {spec_base_path:.claude/specs}/{feature_name}/ - -### 1. Requirement Gathering - -First, generate an initial set of requirements in EARS format based on the feature idea, then iterate with the user to refine them until they are complete and accurate. -Don't focus on code exploration in this phase. Instead, just focus on writing requirements which will later be turned into a design. - -### 2. Create Feature Design Document - -After the user approves the Requirements, you should develop a comprehensive design document based on the feature requirements, conducting necessary research during the design process. -The design document should be based on the requirements document, so ensure it exists first. - -### 3. Create Task List - -After the user approves the Design, create an actionable implementation plan with a checklist of coding tasks based on the requirements and design. -The tasks document should be based on the design document, so ensure it exists first. - -## Troubleshooting - -### Requirements Clarification Stalls - -If the requirements clarification process seems to be going in circles or not making progress: - -- The model SHOULD suggest moving to a different aspect of the requirements -- The model MAY provide examples or options to help the user make decisions -- The model SHOULD summarize what has been established so far and identify specific gaps -- The model MAY suggest conducting research to inform requirements decisions - -### Research Limitations - -If the model cannot access needed information: - -- The model SHOULD document what information is missing -- The model SHOULD suggest alternative approaches based on available information -- The model MAY ask the user to provide additional context or documentation -- The model SHOULD continue with available information rather than blocking progress - -### Design Complexity - -If the design becomes too complex or unwieldy: - -- The model SHOULD suggest breaking it down into smaller, more manageable components -- The model SHOULD focus on core functionality first -- The model MAY suggest a phased approach to implementation -- The model SHOULD return to requirements clarification to prioritize features if needed - - - -## Workflow Diagram - -Here is a Mermaid flow diagram that describes how the workflow should behave. Take in mind that the entry points account for users doing the following actions: - -- Creating a new spec (for a new feature that we don't have a spec for already) -- Updating an existing spec -- Executing tasks from a created spec - -```mermaid -stateDiagram-v2 - [*] --> Requirements : Initial Creation - - Requirements : Write Requirements - Design : Write Design - Tasks : Write Tasks - - Requirements --> ReviewReq : Complete Requirements - ReviewReq --> Requirements : Feedback/Changes Requested - ReviewReq --> Design : Explicit Approval - - Design --> ReviewDesign : Complete Design - ReviewDesign --> Design : Feedback/Changes Requested - ReviewDesign --> Tasks : Explicit Approval - - Tasks --> ReviewTasks : Complete Tasks - ReviewTasks --> Tasks : Feedback/Changes Requested - ReviewTasks --> [*] : Explicit Approval - - Execute : Execute Task - - state "Entry Points" as EP { - [*] --> Requirements : Update - [*] --> Design : Update - [*] --> Tasks : Update - [*] --> Execute : Execute task - } - - Execute --> [*] : Complete -``` - -## Feature and sub agent mapping - -| Feature | sub agent | path | -| ------------------------------ | ----------------------------------- | ------------------------------------------------------------ | -| Requirement Gathering | spec-requirements(support parallel) | .claude/specs/{feature_name}/requirements.md | -| Create Feature Design Document | spec-design(support parallel) | .claude/specs/{feature_name}/design.md | -| Create Task List | spec-tasks(support parallel) | .claude/specs/{feature_name}/tasks.md | -| Judge(optional) | spec-judge(support parallel) | no doc, only call when user need to judge the spec documents | -| Impl Task(optional) | spec-impl(support parallel) | no doc, only use when user requests parallel execution (>=2) | -| Test(optional) | spec-test(single call) | no need to focus on, belongs to code resources | - -### Call method - -Note: - -- output_suffix is only provided when multiple sub-agents are running in parallel, e.g., when 4 sub-agents are running, the output_suffix is "_v1", "_v2", "_v3", "_v4" -- spec-tasks and spec-impl are completely different sub agents, spec-tasks is for task planning, spec-impl is for task implementation - -#### Create Requirements - spec-requirements - -- language_preference: Language preference -- task_type: "create" -- feature_name: Feature name (kebab-case) -- feature_description: Feature description -- spec_base_path: Spec document base path -- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) - -#### Refine/Update Requirements - spec-requirements - -- language_preference: Language preference -- task_type: "update" -- existing_requirements_path: Existing requirements document path -- change_requests: List of change requests - -#### Create New Design - spec-design - -- language_preference: Language preference -- task_type: "create" -- feature_name: Feature name -- spec_base_path: Spec document base path -- output_suffix: Output file suffix (optional, such as "_v1") - -#### Refine/Update Existing Design - spec-design - -- language_preference: Language preference -- task_type: "update" -- existing_design_path: Existing design document path -- change_requests: List of change requests - -#### Create New Tasks - spec-tasks - -- language_preference: Language preference -- task_type: "create" -- feature_name: Feature name (kebab-case) -- spec_base_path: Spec document base path -- output_suffix: Output file suffix (optional, such as "_v1", "_v2", "_v3", required for parallel execution) - -#### Refine/Update Tasks - spec-tasks - -- language_preference: Language preference -- task_type: "update" -- tasks_file_path: Existing tasks document path -- change_requests: List of change requests - -#### Judge - spec-judge - -- language_preference: Language preference -- document_type: "requirements" | "design" | "tasks" -- feature_name: Feature name -- feature_description: Feature description -- spec_base_path: Spec document base path -- doc_path: Document path - -#### Impl Task - spec-impl - -- feature_name: Feature name -- spec_base_path: Spec document base path -- task_id: Task ID to execute (e.g., "2.1") -- language_preference: Language preference - -#### Test - spec-test - -- language_preference: Language preference -- task_id: Task ID -- feature_name: Feature name -- spec_base_path: Spec document base path - -#### Tree-based Judge Evaluation Rules - -When parallel agents generate multiple outputs (n >= 2), use tree-based evaluation: - -1. **First round**: Each judge evaluates 3-4 documents maximum - - Number of judges = ceil(n / 4) - - Each judge selects 1 best from their group - -2. **Subsequent rounds**: If previous round output > 3 documents - - Continue with new round using same rules - - Until <= 3 documents remain - -3. **Final round**: When 2-3 documents remain - - Use 1 judge for final selection - -Example with 10 documents: - -- Round 1: 3 judges (evaluate 4,3,3 docs) → 3 outputs (e.g., requirements_v1234.md, requirements_v5678.md, requirements_v9012.md) -- Round 2: 1 judge evaluates 3 docs → 1 final selection (e.g., requirements_v3456.md) -- Main thread: Rename final selection to standard name (e.g., requirements_v3456.md → requirements.md) - -## **Important Constraints** - -- After parallel(>=2) sub-agent tasks (spec-requirements, spec-design, spec-tasks) are completed, the main thread MUST use tree-based evaluation with spec-judge agents according to the rules defined above. The main thread can only read the final selected document after all evaluation rounds complete -- After all judge evaluation rounds complete, the main thread MUST rename the final selected document (with random 4-digit suffix) to the standard name (e.g., requirements_v3456.md → requirements.md, design_v7890.md → design.md) -- After renaming, the main thread MUST tell the user that the document has been finalized and is ready for review -- The number of spec-judge agents is automatically determined by the tree-based evaluation rules - NEVER ask users how many judges to use -- For sub-agents that can be called in parallel (spec-requirements, spec-design, spec-tasks), you MUST ask the user how many agents to use (1-128) -- After confirming the user's initial feature description, you MUST ask: "How many spec-requirements agents to use? (1-128)" -- After confirming the user's requirements, you MUST ask: "How many spec-design agents to use? (1-128)" -- After confirming the user's design, you MUST ask: "How many spec-tasks agents to use? (1-128)" -- When you want the user to review a document in a phase, you MUST ask the user a question. -- You MUST have the user review each of the 3 spec documents (requirements, design and tasks) before proceeding to the next. -- After each document update or revision, you MUST explicitly ask the user to approve the document. -- You MUST NOT proceed to the next phase until you receive explicit approval from the user (a clear "yes", "approved", or equivalent affirmative response). -- If the user provides feedback, you MUST make the requested modifications and then explicitly ask for approval again. -- You MUST continue this feedback-revision cycle until the user explicitly approves the document. -- You MUST follow the workflow steps in sequential order. -- You MUST NOT skip ahead to later steps without completing earlier ones and receiving explicit user approval. -- You MUST treat each constraint in the workflow as a strict requirement. -- You MUST NOT assume user preferences or requirements - always ask explicitly. -- You MUST maintain a clear record of which step you are currently on. -- You MUST NOT combine multiple steps into a single interaction. -- When executing implementation tasks from tasks.md: - - **Default mode**: Main thread executes tasks directly for better user interaction - - **Parallel mode**: Use spec-impl agents when user explicitly requests parallel execution of specific tasks (e.g., "execute task2.1 and task2.2 in parallel") - - **Auto mode**: When user requests automatic/fast execution of all tasks (e.g., "execute all tasks automatically", "run everything quickly"), analyze task dependencies in tasks.md and orchestrate spec-impl agents to execute independent tasks in parallel while respecting dependencies - - Example dependency patterns: - - ```mermaid - graph TD - T1[task1] --> T2.1[task2.1] - T1 --> T2.2[task2.2] - T3[task3] --> T4[task4] - T2.1 --> T4 - T2.2 --> T4 - ``` - - Orchestration steps: - 1. Start: Launch spec-impl1 (task1) and spec-impl2 (task3) in parallel - 2. After task1 completes: Launch spec-impl3 (task2.1) and spec-impl4 (task2.2) in parallel - 3. After task2.1, task2.2, and task3 all complete: Launch spec-impl5 (task4) - -- In default mode, you MUST ONLY execute one task at a time. Once it is complete, you MUST update the tasks.md file to mark the task as completed. Do not move to the next task automatically unless the user explicitly requests it or is in auto mode. -- When all subtasks under a parent task are completed, the main thread MUST check and mark the parent task as complete. -- You MUST read the file before editing it. -- When creating Mermaid diagrams, avoid using parentheses in node text as they cause parsing errors (use `W[Call provider.refresh]` instead of `W[Call provider.refresh()]`). -- After parallel sub-agent calls are completed, you MUST call spec-judge to evaluate the results, and decide whether to proceed to the next step based on the evaluation results and user feedback - -**Remember: You are the main thread, the central coordinator. Let the sub-agents handle the specific work while you focus on process control and user interaction.** - -**Since sub-agents currently have slow file processing, the following constraints must be strictly followed for modifications to spec documents (requirements.md, design.md, tasks.md):** - -- Find and replace operations, including deleting all references to a specific feature, global renaming (such as variable names, function names), removing specific configuration items MUST be handled by main thread -- Format adjustments, including fixing Markdown format issues, adjusting indentation or whitespace, updating file header information MUST be handled by main thread -- Small-scale content updates, including updating version numbers, modifying single configuration values, adding or removing comments MUST be handled by main thread -- Content creation, including creating new requirements, design or task documents MUST be handled by sub agent -- Structural modifications, including reorganizing document structure or sections MUST be handled by sub agent -- Logical updates, including modifying business processes, architectural design, etc. MUST be handled by sub agent -- Professional judgment, including modifications requiring domain knowledge MUST be handled by sub agent -- Never create spec documents directly, but create them through sub-agents -- Never perform complex file modifications on spec documents, but handle them through sub-agents -- All requirements operations MUST go through spec-requirements -- All design operations MUST go through spec-design -- All task operations MUST go through spec-tasks - - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f0f94f9fb..6979fa1f5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,8 @@ on: paths-ignore: - '**.md' - 'docs/**' + - '.gitignore' + - '.claude/**' permissions: id-token: write # Required for OIDC trusted publishing diff --git a/.gitignore b/.gitignore index 4bfd00f50..46aa21b59 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ coverage # Build output dist + +# Claude Code +.claude/ From 6cafcc04663c75a31da4c1578501b6e3ccdacf3d Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Wed, 11 Mar 2026 11:11:04 -0700 Subject: [PATCH 33/76] fix: webpack browser build - use UMD dist/less.js, add CJS bundle (#4424) * fix: webpack browser build - use UMD dist/less.js, add CJS bundle (#4423) - Browser exports point to dist/less.js (UMD) instead of less-node - Add CJS bundle (dist/less-node.cjs) for Node require() with module shim - Remove dead index.js; index.cjs re-exports CJS bundle - Add export tests: import-patterns, webpack-browser, test-cjs-suite - CI and publish workflows run test:node (build + CJS + ESM tests) * Beta publish script * chore: clarify test:node runs ESM + CJS in workflow labels * fix: normalize path separators in rollup plugin for Windows CI The inlinePackageVersion plugin used forward-slash path check that failed on Windows where rollup passes backslash-separated IDs, leaving the require('../../package.json') unresolved at runtime. * chore: bump version to 4.6.3 for release --- .github/workflows/ci.yml | 4 +- .github/workflows/publish.yml | 4 +- package.json | 4 +- packages/less/Gruntfile.cjs | 301 ++++----- packages/less/build/rollup.js | 62 ++ packages/less/index.cjs | 43 +- packages/less/index.js | 1 - packages/less/package.json | 23 +- .../less/test/exports/import-patterns.cjs | 28 + .../test/exports/webpack-browser-entry.js | 13 + .../less/test/exports/webpack-browser.cjs | 69 +++ packages/less/test/test-cjs-suite.cjs | 46 ++ packages/less/test/test-cjs.cjs | 4 +- packages/less/test/test-es6.js | 3 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- pnpm-lock.yaml | 573 ++++++++++++++++++ scripts/publish-beta.js | 118 ++++ 18 files changed, 1098 insertions(+), 202 deletions(-) delete mode 100644 packages/less/index.js create mode 100644 packages/less/test/exports/import-patterns.cjs create mode 100644 packages/less/test/exports/webpack-browser-entry.js create mode 100644 packages/less/test/exports/webpack-browser.cjs create mode 100644 packages/less/test/test-cjs-suite.cjs create mode 100644 scripts/publish-beta.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 382333bb8..25888bbec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,5 +43,5 @@ jobs: run: node --version && pnpm --version - name: Install chromium run: pnpm exec playwright install chromium - - name: Run unit test - run: pnpm run test + - name: Run node tests (ESM + CJS) + run: pnpm run test:node diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6979fa1f5..f9b589735 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,8 +41,8 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Run tests - run: pnpm run test + - name: Run node tests (ESM + CJS) + run: pnpm run test:node - name: Build run: | diff --git a/package.json b/package.json index 3fe2836af..288f66edf 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,17 @@ { "name": "@less/root", "private": true, - "version": "4.6.0", + "version": "4.6.3", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { "publish": "node scripts/bump-and-publish.js", "publish:dry-run": "DRY_RUN=true node scripts/bump-and-publish.js", + "publish:beta": "node scripts/publish-beta.js", "prepare": "husky", "changelog": "github-changes -o less -r less.js -a --only-pulls --use-commit-body -m \"(YYYY-MM-DD)\"", "test": "cd packages/less && npm test", + "test:node": "cd packages/less && npm run test:node", "postinstall": "npx only-allow pnpm" }, "author": "Alexis Sellier ", diff --git a/packages/less/Gruntfile.cjs b/packages/less/Gruntfile.cjs index c33b2ccc0..a5990a347 100644 --- a/packages/less/Gruntfile.cjs +++ b/packages/less/Gruntfile.cjs @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var resolve = require('resolve'); var path = require('path'); @@ -7,113 +7,113 @@ var testFolder = path.relative(process.cwd(), path.dirname(resolve.sync('@less/t var lessFolder = testFolder; module.exports = function(grunt) { - grunt.option("stack", true); + grunt.option('stack', true); // Report the elapsed execution time of tasks. - require("time-grunt")(grunt); + require('time-grunt')(grunt); - var git = require("git-rev"); + var git = require('git-rev'); // Sauce Labs browser var browsers = [ // Desktop browsers { - browserName: "chrome", - version: "latest", - platform: "Windows 7" + browserName: 'chrome', + version: 'latest', + platform: 'Windows 7' }, { - browserName: "firefox", - version: "latest", - platform: "Linux" + browserName: 'firefox', + version: 'latest', + platform: 'Linux' }, { - browserName: "safari", - version: "9", - platform: "OS X 10.11" + browserName: 'safari', + version: '9', + platform: 'OS X 10.11' }, { - browserName: "internet explorer", - version: "8", - platform: "Windows XP" + browserName: 'internet explorer', + version: '8', + platform: 'Windows XP' }, { - browserName: "internet explorer", - version: "11", - platform: "Windows 8.1" + browserName: 'internet explorer', + version: '11', + platform: 'Windows 8.1' }, { - browserName: "edge", - version: "13", - platform: "Windows 10" + browserName: 'edge', + version: '13', + platform: 'Windows 10' }, // Mobile browsers { - browserName: "ipad", - deviceName: "iPad Air Simulator", - deviceOrientation: "portrait", - version: "8.4", - platform: "OS X 10.9" + browserName: 'ipad', + deviceName: 'iPad Air Simulator', + deviceOrientation: 'portrait', + version: '8.4', + platform: 'OS X 10.9' }, { - browserName: "iphone", - deviceName: "iPhone 5 Simulator", - deviceOrientation: "portrait", - version: "9.3", - platform: "OS X 10.11" + browserName: 'iphone', + deviceName: 'iPhone 5 Simulator', + deviceOrientation: 'portrait', + version: '9.3', + platform: 'OS X 10.11' }, { - browserName: "android", - deviceName: "Google Nexus 7 HD Emulator", - deviceOrientation: "portrait", - version: "4.4", - platform: "Linux" + browserName: 'android', + deviceName: 'Google Nexus 7 HD Emulator', + deviceOrientation: 'portrait', + version: '4.4', + platform: 'Linux' } ]; var sauceJobs = {}; var browserTests = [ - "filemanager-plugin", - "visitor-plugin", - "global-vars", - "modify-vars", - "production", - "rootpath-relative", - "rootpath-rewrite-urls", - "rootpath", - "relative-urls", - "rewrite-urls", - "browser", - "no-js-errors" + 'filemanager-plugin', + 'visitor-plugin', + 'global-vars', + 'modify-vars', + 'production', + 'rootpath-relative', + 'rootpath-rewrite-urls', + 'rootpath', + 'relative-urls', + 'rewrite-urls', + 'browser', + 'no-js-errors' ]; function makeJob(testName) { sauceJobs[testName] = { options: { urls: - testName === "all" + testName === 'all' ? browserTests.map(function(name) { return ( - "http://localhost:8081/tmp/browser/test-runner-" + + 'http://localhost:8081/tmp/browser/test-runner-' + name + - ".html" + '.html' ); }) : [ - "http://localhost:8081/tmp/browser/test-runner-" + + 'http://localhost:8081/tmp/browser/test-runner-' + testName + - ".html" + '.html' ], testname: - testName === "all" ? "Unit Tests for Less.js" : testName, + testName === 'all' ? 'Unit Tests for Less.js' : testName, browsers: browsers, - public: "public", + public: 'public', recordVideo: false, videoUploadOnPass: false, - recordScreenshots: process.env.TRAVIS_BRANCH !== "master", + recordScreenshots: process.env.TRAVIS_BRANCH !== 'master', build: - process.env.TRAVIS_BRANCH === "master" + process.env.TRAVIS_BRANCH === 'master' ? process.env.TRAVIS_JOB_ID : undefined, tags: [ @@ -123,7 +123,7 @@ module.exports = function(grunt) { ], statusCheckAttempts: -1, sauceConfig: { - "idle-timeout": 100 + 'idle-timeout': 100 }, throttled: 5, onTestComplete: function(result, callback) { @@ -144,19 +144,19 @@ module.exports = function(grunt) { var pass = process.env.SAUCE_ACCESS_KEY; git.short(function(hash) { - require("phin")( + require('phin')( { - method: "PUT", + method: 'PUT', url: [ - "https://saucelabs.com/rest/v1", + 'https://saucelabs.com/rest/v1', user, - "jobs", + 'jobs', result.job_id - ].join("/"), + ].join('/'), auth: { user: user, pass: pass }, data: { passed: result.passed, - build: "build-" + hash + build: 'build-' + hash } }, function(error, response) { @@ -166,7 +166,7 @@ module.exports = function(grunt) { } else if (response.statusCode !== 200) { console.log(response); callback( - new Error("Unexpected response status") + new Error('Unexpected response status') ); } else { callback(null, result.passed); @@ -180,7 +180,7 @@ module.exports = function(grunt) { } // Make the SauceLabs jobs - ["all"].concat(browserTests).map(makeJob); + ['all'].concat(browserTests).map(makeJob); // Project configuration. grunt.initConfig({ @@ -193,16 +193,19 @@ module.exports = function(grunt) { } }, build: { - command: "node build/rollup.js --dist" + command: 'node build/rollup.js --dist' }, testbuild: { - command: "node build/rollup.js --browser --out=./tmp/browser/less.min.js" + command: 'node build/rollup.js --browser --out=./tmp/browser/less.min.js' }, testbrowser: { - command: "node build/rollup.js --browser --out=./tmp/browser/less.min.js" + command: 'node build/rollup.js --browser --out=./tmp/browser/less.min.js' }, test: { - command: 'node test/test-es6.js && node test/test-cjs.cjs && node test/index.js' + command: 'node test/test-es6.js && node test/test-cjs.cjs && node test/exports/import-patterns.cjs && node test/exports/webpack-browser.cjs && node test/index.js' + }, + testcjs: { + command: 'node test/test-cjs-suite.cjs' }, generatebrowser: { command: 'node test/browser/generator/generate.js' @@ -211,7 +214,7 @@ module.exports = function(grunt) { command: 'node test/browser/generator/runner.js' }, benchmark: { - command: "node benchmark/index.js" + command: 'node benchmark/index.js' }, opts: { // test running with all current options (using `opts` since `options` means something already) @@ -229,36 +232,36 @@ module.exports = function(grunt) { // DEPRECATED OPTIONS // --strict-math `node bin/lessc --strict-math=on ${lessFolder}/tests-unit/lazy-eval/lazy-eval.less tmp/lazy-eval.css` - ].join(" && ") + ].join(' && ') }, plugin: { command: [ `node bin/lessc --clean-css="--s1 --advanced" ${lessFolder}/tests-unit/lazy-eval/lazy-eval.less tmp/lazy-eval.css`, - "cd lib", + 'cd lib', `node ../bin/lessc --clean-css="--s1 --advanced" ../${lessFolder}/tests-unit/lazy-eval/lazy-eval.less ../tmp/lazy-eval.css`, `node ../bin/lessc --source-map=lazy-eval.css.map --autoprefix ../${lessFolder}/tests-unit/lazy-eval/lazy-eval.less ../tmp/lazy-eval.css`, - "cd ..", + 'cd ..', // Test multiple plugins `node bin/lessc --plugin=clean-css="--s1 --advanced" --plugin=autoprefix="ie 11,Edge >= 13,Chrome >= 47,Firefox >= 45,iOS >= 9.2,Safari >= 9" ${lessFolder}/tests-unit/lazy-eval/lazy-eval.less tmp/lazy-eval.css` - ].join(" && ") + ].join(' && ') }, - "sourcemap-test": { + 'sourcemap-test': { // quoted value doesn't seem to get picked up by time-grunt, or isn't output, at least; maybe just "sourcemap" is fine? command: [ `node bin/lessc --source-map=test/sourcemaps/maps/import-map.map ${lessFolder}/tests-unit/import/import.less test/sourcemaps/import.css`, `node bin/lessc --source-map ${lessFolder}/tests-config/sourcemaps/basic.less test/sourcemaps/basic.css` - ].join(" && ") + ].join(' && ') } }, eslint: { target: [ - "test/**/*.js", - "lib/less*/**/*.js", - "!test/less/errors/plugin/plugin-error.js" + 'test/**/*.js', + 'lib/less*/**/*.js', + '!test/less/errors/plugin/plugin-error.js' ], options: { - configFile: ".eslintrc.cjs", + configFile: '.eslintrc.cjs', fix: true } }, @@ -272,119 +275,131 @@ module.exports = function(grunt) { } }, - "saucelabs-mocha": sauceJobs, + 'saucelabs-mocha': sauceJobs, // Clean the version of less built for the tests clean: { - test: ["test/browser/less.js", "tmp", "test/less-bom"], - "sourcemap-test": [ - "test/sourcemaps/*.css", - "test/sourcemaps/*.map" + test: ['test/browser/less.js', 'tmp', 'test/less-bom'], + 'sourcemap-test': [ + 'test/sourcemaps/*.css', + 'test/sourcemaps/*.map' ], - sauce_log: ["sc_*.log"] + sauce_log: ['sc_*.log'] } }); // Load these plugins to provide the necessary tasks - grunt.loadNpmTasks("grunt-saucelabs"); + grunt.loadNpmTasks('grunt-saucelabs'); - require("jit-grunt")(grunt); + require('jit-grunt')(grunt); // by default, run tests - grunt.registerTask("default", ["test"]); + grunt.registerTask('default', ['test']); // Release - grunt.registerTask("dist", [ - "shell:build" + grunt.registerTask('dist', [ + 'shell:build' ]); // Create the browser version of less.js - grunt.registerTask("browsertest-lessjs", [ - "shell:testbrowser" + grunt.registerTask('browsertest-lessjs', [ + 'shell:testbrowser' ]); // Run all browser tests - grunt.registerTask("browsertest", [ - "browsertest-lessjs", - "connect", - "shell:runbrowser" + grunt.registerTask('browsertest', [ + 'browsertest-lessjs', + 'connect', + 'shell:runbrowser' ]); // setup a web server to run the browser tests in a browser rather than phantom - grunt.registerTask("browsertest-server", [ - "browsertest-lessjs", - "shell:generatebrowser", - "connect::keepalive" + grunt.registerTask('browsertest-server', [ + 'browsertest-lessjs', + 'shell:generatebrowser', + 'connect::keepalive' ]); - var previous_force_state = grunt.option("force"); + var previous_force_state = grunt.option('force'); - grunt.registerTask("force", function(set) { - if (set === "on") { - grunt.option("force", true); - } else if (set === "off") { - grunt.option("force", false); - } else if (set === "restore") { - grunt.option("force", previous_force_state); + grunt.registerTask('force', function(set) { + if (set === 'on') { + grunt.option('force', true); + } else if (set === 'off') { + grunt.option('force', false); + } else if (set === 'restore') { + grunt.option('force', previous_force_state); } }); - grunt.registerTask("sauce", [ - "browsertest-lessjs", - "shell:generatebrowser", - "connect", - "sauce-after-setup" + grunt.registerTask('sauce', [ + 'browsertest-lessjs', + 'shell:generatebrowser', + 'connect', + 'sauce-after-setup' ]); - grunt.registerTask("sauce-after-setup", [ - "saucelabs-mocha:all", - "clean:sauce_log" + grunt.registerTask('sauce-after-setup', [ + 'saucelabs-mocha:all', + 'clean:sauce_log' ]); var testTasks = [ - "clean", - "eslint", - "shell:testbuild", - "shell:test", - "shell:opts", - "shell:plugin", - "connect", - "shell:runbrowser" + 'clean', + 'eslint', + 'shell:build', + 'shell:testbuild', + 'shell:test', + 'shell:opts', + 'shell:plugin', + 'connect', + 'shell:runbrowser' + ]; + + var nodeTestTasks = [ + 'shell:build', + 'shell:test', + 'shell:testcjs', + 'shell:opts', + 'shell:plugin' ]; if ( isNaN(Number(process.env.TRAVIS_PULL_REQUEST, 10)) && - (process.env.TRAVIS_BRANCH === "master") + (process.env.TRAVIS_BRANCH === 'master') ) { - testTasks.push("force:on"); - testTasks.push("sauce-after-setup"); - testTasks.push("force:off"); + testTasks.push('force:on'); + testTasks.push('sauce-after-setup'); + testTasks.push('force:off'); } // Run all tests - grunt.registerTask("test", testTasks); + grunt.registerTask('test', testTasks); + + // Node tests only (ESM + CJS) — for prepublish, CI + grunt.registerTask('test:node', nodeTestTasks); // Run shell option tests (includes deprecated options) - grunt.registerTask("shell-options", ["shell:opts"]); + grunt.registerTask('shell-options', ['shell:opts']); // Run shell plugin test - grunt.registerTask("shell-plugin", ["shell:plugin"]); + grunt.registerTask('shell-plugin', ['shell:plugin']); // Quickly run Node tests (no build step needed) - grunt.registerTask("quicktest", [ - "shell:test" + grunt.registerTask('quicktest', [ + 'shell:test' ]); // generate a good test environment for testing sourcemaps - grunt.registerTask("sourcemap-test", [ - "clean:sourcemap-test", - "shell:build:lessc", - "shell:sourcemap-test", - "connect::keepalive" + grunt.registerTask('sourcemap-test', [ + 'clean:sourcemap-test', + 'shell:build:lessc', + 'shell:sourcemap-test', + 'connect::keepalive' ]); // Run benchmark - grunt.registerTask("benchmark", [ - "shell:benchmark" + grunt.registerTask('benchmark', [ + 'shell:benchmark' ]); }; diff --git a/packages/less/build/rollup.js b/packages/less/build/rollup.js index c759a789d..ddc545ab3 100644 --- a/packages/less/build/rollup.js +++ b/packages/less/build/rollup.js @@ -6,15 +6,76 @@ import { terser } from 'rollup-plugin-terser'; import banner from './banner.js'; import path from 'path'; import { fileURLToPath } from 'url'; +import { createRequire } from 'module'; import minimist from 'minimist'; +const require = createRequire(import.meta.url); const __dirname = path.dirname(fileURLToPath(import.meta.url)); const rootPath = path.join(__dirname, '..'); +const pkg = require(path.join(rootPath, 'package.json')); const args = minimist(process.argv.slice(2)); let outDir = args.dist ? './dist' : './tmp'; +/** Virtual 'module' for CJS bundle - provides createRequire that returns CJS require */ +function moduleShim() { + return { + name: 'module-shim', + resolveId(id) { + if (id === 'module') return '\0module'; + return null; + }, + load(id) { + if (id === '\0module') { + return `export function createRequire() { return require; }`; + } + return null; + } + }; +} + +/** Inline package.json version - avoid runtime require of ../../package.json from wrong path */ +function inlinePackageVersion() { + const version = JSON.stringify(pkg.version); + return { + name: 'inline-package-version', + transform(code, id) { + if (id.replace(/\\/g, '/').includes('less-node/index.js')) { + return { + code: code.replace( + /const\s*\{\s*version\s*\}\s*=\s*require\s*\(\s*['"]\.\.\/\.\.\/package\.json['"]\s*\)/, + `const version = ${version}` + ), + map: null + }; + } + return null; + } + }; +} + +async function buildLessNodeCjs() { + const outFile = path.join(rootPath, outDir, 'less-node.cjs'); + console.log(`Writing ${outDir}/less-node.cjs...`); + const bundle = await rollup({ + input: './lib/less-node/index.js', + plugins: [ + moduleShim(), + inlinePackageVersion(), + resolve(), + commonjs(), + json() + ] + }); + await bundle.write({ + file: outFile, + format: 'cjs', + exports: 'default', + banner + }); +} + async function buildBrowser() { let bundle = await rollup({ input: './lib/less-browser/bootstrap.js', @@ -72,6 +133,7 @@ async function buildBrowser() { } async function build() { + await buildLessNodeCjs(); await buildBrowser(); } diff --git a/packages/less/index.cjs b/packages/less/index.cjs index 52ca4b5f1..04bd2e891 100644 --- a/packages/less/index.cjs +++ b/packages/less/index.cjs @@ -1,41 +1,2 @@ -// CJS compatibility wrapper. -// Node 20.19+ and 22+ can require() ESM natively. For Node 18, we use -// a lazy Proxy with dynamic import() — works because render()/parse() -// already return promises, so the async layer is invisible. -const [major, minor] = process.versions.node.split('.').map(Number); - -if (major >= 22 || (major === 20 && minor >= 19)) { - module.exports = require('./lib/less-node/index.js').default; -} else { - let _less; - const _loading = import('./lib/less-node/index.js').then(m => { _less = m.default; }); - - module.exports = new Proxy(Object.create(null), { - get(_, prop) { - if (prop === 'then' || prop === 'catch' || prop === 'finally') { - return undefined; - } - if (_less) { - return _less[prop]; - } - return function (...args) { - return _loading.then(() => { - const val = _less[prop]; - return typeof val === 'function' ? val.apply(_less, args) : val; - }); - }; - }, - has(_, prop) { - return _less ? prop in _less : true; - }, - ownKeys() { - return _less ? Reflect.ownKeys(_less) : []; - }, - getOwnPropertyDescriptor(_, prop) { - if (_less) { - return Object.getOwnPropertyDescriptor(_less, prop); - } - return { configurable: true, enumerable: true }; - } - }); -} +// CJS entry — requires the pre-built CJS bundle +module.exports = require('./dist/less-node.cjs'); diff --git a/packages/less/index.js b/packages/less/index.js deleted file mode 100644 index ccd64aec4..000000000 --- a/packages/less/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/less-node').default; diff --git a/packages/less/package.json b/packages/less/package.json index d31d96658..c4c9d1f65 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.6.0", + "version": "4.6.3", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { @@ -26,13 +26,18 @@ "bin": { "lessc": "./bin/lessc" }, - "main": "./lib/less-node/index.js", + "main": "./dist/less-node.cjs", "exports": { ".": { + "browser": "./dist/less.js", "import": "./lib/less-node/index.js", - "require": "./index.cjs" + "require": "./dist/less-node.cjs", + "default": "./lib/less-node/index.js" }, - "./lib/*": "./lib/*" + "./lib/*": "./lib/*", + "./dist/less-node.cjs": "./dist/less-node.cjs", + "./dist/less.js": "./dist/less.js", + "./dist/less.min.js": "./dist/less.min.js" }, "directories": { "test": "./test" @@ -42,7 +47,6 @@ "lib", "!lib/**/*.map", "dist", - "index.js", "index.cjs", "README.md" ], @@ -53,13 +57,14 @@ "scripts": { "quicktest": "grunt quicktest", "test": "grunt test", + "test:node": "grunt test:node", "test:coverage": "c8 -r lcov -r json-summary -r text-summary -r html --include=\"lib/**/*.js\" --include=\"bin/**/*.js\" --exclude=\"dist/**\" --exclude=\"**/*.test.js\" --exclude=\"**/*.spec.js\" --exclude=\"test/**\" --exclude=\"tmp/**\" --exclude=\"**/abstract-file-manager.js\" --exclude=\"**/abstract-plugin-loader.js\" grunt shell:test && node scripts/coverage-report.js && node scripts/coverage-lines.js", "grunt": "grunt", "lint": "eslint '**/*.{ts,js}'", "lint:fix": "eslint '**/*.{ts,js}' --fix", "typecheck": "tsc --noEmit", "build": "node build/rollup.js --dist", - "prepublishOnly": "npm run typecheck && grunt dist" + "prepublishOnly": "npm run typecheck && grunt dist && grunt test:node" }, "optionalDependencies": { "errno": "^0.1.1", @@ -119,7 +124,11 @@ "shx": "^0.3.2", "time-grunt": "^1.3.0", "typescript": "^5.7.0", - "uikit": "2.27.4" + "uikit": "2.27.4", + "url": "^0.11.4", + "path-browserify": "^1.0.1", + "webpack": "^5.64.6", + "webpack-cli": "^5.1.4" }, "keywords": [ "compile less", diff --git a/packages/less/test/exports/import-patterns.cjs b/packages/less/test/exports/import-patterns.cjs new file mode 100644 index 000000000..9cafdb292 --- /dev/null +++ b/packages/less/test/exports/import-patterns.cjs @@ -0,0 +1,28 @@ +/** + * Verifies package exports support the import patterns users report. + * Actual import tests: test-es6.js, test-cjs.cjs, webpack-browser.cjs + * See: https://github.com/less/less.js/issues/4423 + */ +'use strict'; + +const path = require('path'); +const fs = require('fs'); + +console.log('Verifying exports for user import patterns...\n'); + +const pkgPath = path.join(__dirname, '../../package.json'); +const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); +const exp = pkg.exports; + +if (!exp?.['.']?.browser) { + console.error('FAIL: exports.browser required (webpack: import less from "less")'); + process.exit(1); +} +if (!fs.existsSync(path.join(__dirname, '../../dist/less.js'))) { + console.error('FAIL: dist/less.js not found (run "npm run build" first)'); + process.exit(1); +} + +console.log('✓ exports support: import less from "less" (Node/ESM)'); +console.log('✓ exports support: require("less") (Node/CJS)'); +console.log('✓ exports support: import less from "less" (webpack browser → dist/less.js UMD)'); diff --git a/packages/less/test/exports/webpack-browser-entry.js b/packages/less/test/exports/webpack-browser-entry.js new file mode 100644 index 000000000..bd11f81dd --- /dev/null +++ b/packages/less/test/exports/webpack-browser-entry.js @@ -0,0 +1,13 @@ +/** + * Entry used by webpack to test browser bundling. + * Replicates: import less from 'less' in a webpack build targeting browser. + * See: https://github.com/less/less.js/issues/4423 + */ +import less from 'less'; + +// Minimal sanity check - browser bundle exposes less on window when loaded via script, +// but when bundled we get the module directly +const result = await less.render('.test { color: red; }'); +if (!result.css.includes('color: red')) { + throw new Error('less.render failed'); +} diff --git a/packages/less/test/exports/webpack-browser.cjs b/packages/less/test/exports/webpack-browser.cjs new file mode 100644 index 000000000..5412caaab --- /dev/null +++ b/packages/less/test/exports/webpack-browser.cjs @@ -0,0 +1,69 @@ +/** + * Tests that webpack can bundle less for browser target without + * "Can't resolve 'module'" error. + * See: https://github.com/less/less.js/issues/4423 + */ +'use strict'; + +const path = require('path'); +const fs = require('fs'); + +async function run() { + let webpack; + try { + webpack = require('webpack'); + } catch (e) { + console.log('Skipping webpack browser test: webpack not installed'); + console.log(' (Add webpack and webpack-cli as devDependencies to run this test)'); + return; + } + + const config = { + mode: 'development', + target: 'web', + entry: path.join(__dirname, 'webpack-browser-entry.js'), + output: { + path: path.join(__dirname, '..', '..', 'tmp'), + filename: 'webpack-browser-test-bundle.js' + }, + resolve: { + conditionNames: ['browser', 'import', 'require', 'default'] + }, + module: { + rules: [ + { + // dist/less.js is UMD - ensure webpack treats it correctly + test: /[\\/]dist[\\/]less\.js$/, + type: 'javascript/auto' + } + ] + } + }; + + return new Promise((resolve, reject) => { + webpack(config, (err, stats) => { + if (err) { + reject(err); + return; + } + const info = stats.toJson(); + if (stats.hasErrors()) { + const msg = info.errors.map(e => (e.message || String(e))).join('\n'); + reject(new Error('Webpack build failed:\n' + msg)); + return; + } + const outPath = path.join(config.output.path, config.output.filename); + if (!fs.existsSync(outPath)) { + reject(new Error('Bundle was not created')); + return; + } + console.log("✓ Testing: import less from 'less' in webpack build (browser target) — #4423"); + resolve(); + }); + }); +} + +run().catch((err) => { + console.error('Webpack browser test FAILED:', err.message); + process.exit(1); +}); diff --git a/packages/less/test/test-cjs-suite.cjs b/packages/less/test/test-cjs-suite.cjs new file mode 100644 index 000000000..173b1a528 --- /dev/null +++ b/packages/less/test/test-cjs-suite.cjs @@ -0,0 +1,46 @@ +/** + * CJS build test — runs a subset of tests using dist/less-node.cjs. + * Run in addition to the main ESM test suite to verify the CJS build. + */ +'use strict'; + +const path = require('path'); +const fs = require('fs'); + +console.log('Testing CJS build (dist/less-node.cjs)...\n'); + +const less = require('../dist/less-node.cjs'); +const testFolder = path.dirname(require.resolve('@less/test-data')); + +function runTest(name, lessFile, expectedCss) { + const fullPath = path.join(testFolder, lessFile); + const content = fs.readFileSync(fullPath, 'utf8'); + return less.render(content, { filename: fullPath }) + .then(function (result) { + const actual = result.css.trim(); + const expected = (expectedCss || '').trim(); + if (expected && actual !== expected) { + console.error('FAIL', name, '- output mismatch'); + process.exit(1); + } + console.log(' ✓', name); + }) + .catch(function (err) { + console.error('FAIL', name, err.message); + process.exit(1); + }); +} + +Promise.all([ + runTest('variables', 'tests-unit/variables/variables.less'), + runTest('mixins', 'tests-unit/mixins/mixins.less'), + runTest('operations', 'tests-unit/operations/operations.less'), + runTest('import', 'tests-unit/import/import.less') +]) + .then(function () { + console.log('\nCJS build tests passed.'); + }) + .catch(function (err) { + console.error(err); + process.exit(1); + }); diff --git a/packages/less/test/test-cjs.cjs b/packages/less/test/test-cjs.cjs index df2c272b0..71e601bc3 100644 --- a/packages/less/test/test-cjs.cjs +++ b/packages/less/test/test-cjs.cjs @@ -1,5 +1,5 @@ -// Test that CJS require('less') works via the lazy proxy wrapper. -console.log('Testing CJS require...'); +// Replicates: "const less = require('less')" — how users report importing (Node, Webpack CJS) +console.log("Testing: require('less')..."); const less = require('less'); diff --git a/packages/less/test/test-es6.js b/packages/less/test/test-es6.js index 3b9d11ce3..010bce863 100644 --- a/packages/less/test/test-es6.js +++ b/packages/less/test/test-es6.js @@ -1,5 +1,6 @@ // https://github.com/less/less.js/issues/3533 -console.log('Testing ES6 imports...') +// Replicates: "import less from 'less'" — ESM import +console.log("Testing: import less from 'less'..."); import less from 'less'; diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 4f983f3f1..dc3ba8813 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.6.0", + "version": "4.6.3", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index a8a7c0a27..4f1d74c04 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.6.0", + "version": "4.6.3", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04dfe8f6d..6749c9996 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -166,6 +166,9 @@ importers: npm-run-all: specifier: ^4.1.5 version: 4.1.5 + path-browserify: + specifier: ^1.0.1 + version: 1.0.1 performance-now: specifier: ^0.2.0 version: 0.2.0 @@ -205,6 +208,15 @@ importers: uikit: specifier: 2.27.4 version: 2.27.4 + url: + specifier: ^0.11.4 + version: 0.11.4 + webpack: + specifier: ^5.64.6 + version: 5.105.4(webpack-cli@5.1.4) + webpack-cli: + specifier: ^5.1.4 + version: 5.1.4(webpack@5.105.4) packages/test-data: {} @@ -281,6 +293,11 @@ packages: engines: {node: '>=18'} dev: true + /@discoveryjs/json-ext@0.5.7: + resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} + engines: {node: '>=10.0.0'} + dev: true + /@eslint/eslintrc@0.4.3: resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -361,11 +378,25 @@ packages: '@sinclair/typebox': 0.34.41 dev: true + /@jridgewell/gen-mapping@0.3.13: + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + dev: true + /@jridgewell/resolve-uri@3.1.2: resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} dev: true + /@jridgewell/source-map@0.3.11: + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + dev: true + /@jridgewell/sourcemap-codec@1.5.5: resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} dev: true @@ -461,6 +492,20 @@ packages: resolution: {integrity: sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==} dev: true + /@types/eslint-scope@3.7.7: + resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} + dependencies: + '@types/eslint': 9.6.1 + '@types/estree': 1.0.8 + dev: true + + /@types/eslint@9.6.1: + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + dependencies: + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 + dev: true + /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true @@ -609,6 +654,157 @@ packages: eslint-visitor-keys: 2.1.0 dev: true + /@webassemblyjs/ast@1.14.1: + resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} + dependencies: + '@webassemblyjs/helper-numbers': 1.13.2 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + dev: true + + /@webassemblyjs/floating-point-hex-parser@1.13.2: + resolution: {integrity: sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==} + dev: true + + /@webassemblyjs/helper-api-error@1.13.2: + resolution: {integrity: sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==} + dev: true + + /@webassemblyjs/helper-buffer@1.14.1: + resolution: {integrity: sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==} + dev: true + + /@webassemblyjs/helper-numbers@1.13.2: + resolution: {integrity: sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==} + dependencies: + '@webassemblyjs/floating-point-hex-parser': 1.13.2 + '@webassemblyjs/helper-api-error': 1.13.2 + '@xtuc/long': 4.2.2 + dev: true + + /@webassemblyjs/helper-wasm-bytecode@1.13.2: + resolution: {integrity: sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==} + dev: true + + /@webassemblyjs/helper-wasm-section@1.14.1: + resolution: {integrity: sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==} + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/wasm-gen': 1.14.1 + dev: true + + /@webassemblyjs/ieee754@1.13.2: + resolution: {integrity: sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==} + dependencies: + '@xtuc/ieee754': 1.2.0 + dev: true + + /@webassemblyjs/leb128@1.13.2: + resolution: {integrity: sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==} + dependencies: + '@xtuc/long': 4.2.2 + dev: true + + /@webassemblyjs/utf8@1.13.2: + resolution: {integrity: sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==} + dev: true + + /@webassemblyjs/wasm-edit@1.14.1: + resolution: {integrity: sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==} + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/helper-wasm-section': 1.14.1 + '@webassemblyjs/wasm-gen': 1.14.1 + '@webassemblyjs/wasm-opt': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + '@webassemblyjs/wast-printer': 1.14.1 + dev: true + + /@webassemblyjs/wasm-gen@1.14.1: + resolution: {integrity: sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==} + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/ieee754': 1.13.2 + '@webassemblyjs/leb128': 1.13.2 + '@webassemblyjs/utf8': 1.13.2 + dev: true + + /@webassemblyjs/wasm-opt@1.14.1: + resolution: {integrity: sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==} + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/wasm-gen': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + dev: true + + /@webassemblyjs/wasm-parser@1.14.1: + resolution: {integrity: sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==} + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-api-error': 1.13.2 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/ieee754': 1.13.2 + '@webassemblyjs/leb128': 1.13.2 + '@webassemblyjs/utf8': 1.13.2 + dev: true + + /@webassemblyjs/wast-printer@1.14.1: + resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@xtuc/long': 4.2.2 + dev: true + + /@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.105.4): + resolution: {integrity: sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + dependencies: + webpack: 5.105.4(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.105.4) + dev: true + + /@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.105.4): + resolution: {integrity: sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + dependencies: + webpack: 5.105.4(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.105.4) + dev: true + + /@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.105.4): + resolution: {integrity: sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + webpack-dev-server: '*' + peerDependenciesMeta: + webpack-dev-server: + optional: true + dependencies: + webpack: 5.105.4(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.105.4) + dev: true + + /@xtuc/ieee754@1.2.0: + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} + dev: true + + /@xtuc/long@4.2.2: + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + dev: true + /abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} dev: true @@ -621,6 +817,15 @@ packages: negotiator: 0.6.3 dev: true + /acorn-import-phases@1.0.4(acorn@8.16.0): + resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} + engines: {node: '>=10.13.0'} + peerDependencies: + acorn: ^8.14.0 + dependencies: + acorn: 8.16.0 + dev: true + /acorn-jsx@5.3.2(acorn@7.4.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -641,6 +846,12 @@ packages: hasBin: true dev: true + /acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /agent-base@4.3.0: resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} engines: {node: '>= 4.0.0'} @@ -648,6 +859,26 @@ packages: es6-promisify: 5.0.0 dev: true + /ajv-formats@2.1.1(ajv@8.17.1): + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.17.1 + dev: true + + /ajv-keywords@5.1.0(ajv@8.17.1): + resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} + peerDependencies: + ajv: ^8.8.2 + dependencies: + ajv: 8.17.1 + fast-deep-equal: 3.1.3 + dev: true + /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -939,6 +1170,12 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true + /baseline-browser-mapping@2.10.0: + resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} + engines: {node: '>=6.0.0'} + hasBin: true + dev: true + /basic-auth@2.0.1: resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} engines: {node: '>= 0.8'} @@ -1034,6 +1271,18 @@ packages: electron-to-chromium: 1.5.267 dev: true + /browserslist@4.28.1: + resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + baseline-browser-mapping: 2.10.0 + caniuse-lite: 1.0.30001777 + electron-to-chromium: 1.5.267 + node-releases: 2.0.36 + update-browserslist-db: 1.2.3(browserslist@4.28.1) + dev: true + /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true @@ -1106,6 +1355,10 @@ packages: resolution: {integrity: sha512-pMTtXP7Yb1RXqO9ddJwLOYQ5Mb1R4/vRx7j9v6MlSCf8anENKZHr9SLxS7FqqroeAkmfgMAmtEwt1kh8men/vg==} dev: true + /caniuse-lite@1.0.30001777: + resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} + dev: true + /caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} dev: true @@ -1161,6 +1414,11 @@ packages: get-func-name: 2.0.2 dev: true + /chrome-trace-event@1.0.4: + resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} + engines: {node: '>=6.0'} + dev: true + /clean-css@5.3.3: resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} engines: {node: '>= 10.0'} @@ -1205,6 +1463,15 @@ packages: wrap-ansi: 7.0.0 dev: true + /clone-deep@4.0.1: + resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} + engines: {node: '>=6'} + dependencies: + is-plain-object: 2.0.4 + kind-of: 6.0.3 + shallow-clone: 3.0.1 + dev: true + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -1226,6 +1493,10 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + dev: true + /colors@0.5.1: resolution: {integrity: sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==} engines: {node: '>=0.1.90'} @@ -1250,6 +1521,11 @@ packages: delayed-stream: 1.0.0 dev: true + /commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + dev: true + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true @@ -1608,6 +1884,14 @@ packages: engines: {node: '>= 0.8'} dev: true + /enhanced-resolve@5.20.0: + resolution: {integrity: sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==} + engines: {node: '>=10.13.0'} + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.0 + dev: true + /enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} @@ -1621,6 +1905,12 @@ packages: engines: {node: '>=6'} dev: true + /envinfo@7.21.0: + resolution: {integrity: sha512-Lw7I8Zp5YKHFCXL7+Dz95g4CcbMEpgvqZNNq3AmlT5XAV6CgAAk6gyAMqn2zjw08K9BHfcNuKrMiCPLByGafow==} + engines: {node: '>=4'} + hasBin: true + dev: true + /errno@0.1.8: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true @@ -1710,6 +2000,10 @@ packages: engines: {node: '>= 0.4'} dev: true + /es-module-lexer@2.0.0: + resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + dev: true + /es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} @@ -1915,6 +2209,11 @@ packages: resolution: {integrity: sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==} dev: true + /events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + dev: true + /exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} @@ -1972,6 +2271,11 @@ packages: resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} dev: true + /fastest-levenshtein@1.0.16: + resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} + engines: {node: '>= 4.9.1'} + dev: true + /fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} dependencies: @@ -2104,6 +2408,11 @@ packages: is-buffer: 2.0.5 dev: true + /flat@5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + dev: true + /flatted@3.3.3: resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} dev: true @@ -2356,6 +2665,10 @@ packages: is-glob: 4.0.3 dev: true + /glob-to-regexp@0.4.1: + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + dev: true + /glob@10.5.0: resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} hasBin: true @@ -2881,6 +3194,15 @@ packages: resolve-from: 4.0.0 dev: true + /import-local@3.2.0: + resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2959,6 +3281,11 @@ packages: engines: {node: '>= 0.10'} dev: true + /interpret@3.1.1: + resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} + engines: {node: '>=10.13.0'} + dev: true + /is-absolute@1.0.0: resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} engines: {node: '>=0.10.0'} @@ -3308,6 +3635,15 @@ packages: supports-color: 6.1.0 dev: true + /jest-worker@27.5.1: + resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} + engines: {node: '>= 10.13.0'} + dependencies: + '@types/node': 18.19.130 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + /jit-grunt@0.10.0(grunt@1.6.1): resolution: {integrity: sha512-eT/f4c9wgZ3buXB7X1JY1w6uNtAV0bhrbOGf/mFmBb0CDNLUETJ/VRoydayWOI54tOoam0cz9RooVCn3QY1WoA==} engines: {node: '>=0.10.0'} @@ -3504,6 +3840,11 @@ packages: strip-bom: 3.0.0 dev: true + /loader-runner@4.3.1: + resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} + engines: {node: '>=6.11.5'} + dev: true + /locate-path@3.0.0: resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} engines: {node: '>=6'} @@ -3827,6 +4168,10 @@ packages: engines: {node: '>= 0.6'} dev: true + /neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + dev: true + /nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} dev: true @@ -3854,6 +4199,10 @@ packages: resolution: {integrity: sha512-kbd+ABY2XRdByRVHPcBDemymfNL8+msGyKNxG/ziZnh9RjneuuGQl3/CE5UkNWxCInkJS+ztc5B31/t2kIO4Yw==} dev: true + /node-releases@2.0.36: + resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} + dev: true + /node-uuid@1.4.8: resolution: {integrity: sha512-TkCET/3rr9mUuRp+CpO7qfgT++aAxfDRaalQhwPFzI9BY/2rCDn6OfpZOVggi1AXfTPpfkTrg5f5WQx5G1uLxA==} deprecated: Use uuid module instead @@ -4216,6 +4565,10 @@ packages: engines: {node: '>= 0.8'} dev: true + /path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + dev: true + /path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -4357,6 +4710,13 @@ packages: engines: {node: '>=0.10.0'} dev: true + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + /platform@1.3.6: resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} dev: true @@ -4462,6 +4822,10 @@ packages: punycode: 2.3.1 dev: true + /punycode@1.4.1: + resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} + dev: true + /punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -4480,6 +4844,13 @@ packages: resolution: {integrity: sha512-kN+yNdAf29Jgp+AYHUmC7X4QdJPR8czuMWLNLc0aRxkQ7tB3vJQEONKKT9ou/rW7EbqVec11srC9q9BiVbcnHA==} dev: true + /qs@6.15.0: + resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.1.0 + dev: true + /qs@6.5.3: resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} engines: {node: '>=0.6'} @@ -4562,6 +4933,13 @@ packages: resolve: 1.22.11 dev: true + /rechoir@0.8.0: + resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} + engines: {node: '>= 10.13.0'} + dependencies: + resolve: 1.22.11 + dev: true + /reflect.getprototypeof@1.0.10: resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} engines: {node: '>= 0.4'} @@ -4662,6 +5040,13 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true + /resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + dependencies: + resolve-from: 5.0.0 + dev: true + /resolve-dir@1.0.1: resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} engines: {node: '>=0.10.0'} @@ -4675,6 +5060,11 @@ packages: engines: {node: '>=4'} dev: true + /resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + /resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} @@ -4821,6 +5211,16 @@ packages: dev: false optional: true + /schema-utils@4.3.3: + resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} + engines: {node: '>= 10.13.0'} + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) + ajv-keywords: 5.1.0(ajv@8.17.1) + dev: true + /semver@5.4.1: resolution: {integrity: sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==} hasBin: true @@ -4938,6 +5338,13 @@ packages: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} dev: true + /shallow-clone@3.0.1: + resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} + engines: {node: '>=8'} + dependencies: + kind-of: 6.0.3 + dev: true + /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} engines: {node: '>=0.10.0'} @@ -5319,6 +5726,13 @@ packages: has-flag: 4.0.0 dev: true + /supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -5335,6 +5749,34 @@ packages: strip-ansi: 6.0.1 dev: true + /tapable@2.3.0: + resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + engines: {node: '>=6'} + dev: true + + /terser-webpack-plugin@5.4.0(webpack@5.105.4): + resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + jest-worker: 27.5.1 + schema-utils: 4.3.3 + terser: 5.46.0 + webpack: 5.105.4(webpack-cli@5.1.4) + dev: true + /terser@4.8.1: resolution: {integrity: sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==} engines: {node: '>=6.0.0'} @@ -5346,6 +5788,17 @@ packages: source-map-support: 0.5.21 dev: true + /terser@5.46.0: + resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + '@jridgewell/source-map': 0.3.11 + acorn: 8.16.0 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + /test-exclude@7.0.1: resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} engines: {node: '>=18'} @@ -5575,12 +6028,31 @@ packages: engines: {node: '>= 0.8'} dev: true + /update-browserslist-db@1.2.3(browserslist@4.28.1): + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.28.1 + escalade: 3.2.0 + picocolors: 1.1.1 + dev: true + /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.1 dev: true + /url@0.11.4: + resolution: {integrity: sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==} + engines: {node: '>= 0.4'} + dependencies: + punycode: 1.4.1 + qs: 6.15.0 + dev: true + /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true @@ -5646,10 +6118,107 @@ packages: extsprintf: 1.3.0 dev: true + /watchpack@2.5.1: + resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} + engines: {node: '>=10.13.0'} + dependencies: + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + dev: true + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true + /webpack-cli@5.1.4(webpack@5.105.4): + resolution: {integrity: sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==} + engines: {node: '>=14.15.0'} + hasBin: true + peerDependencies: + '@webpack-cli/generators': '*' + webpack: 5.x.x + webpack-bundle-analyzer: '*' + webpack-dev-server: '*' + peerDependenciesMeta: + '@webpack-cli/generators': + optional: true + webpack-bundle-analyzer: + optional: true + webpack-dev-server: + optional: true + dependencies: + '@discoveryjs/json-ext': 0.5.7 + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.105.4) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.105.4) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.105.4) + colorette: 2.0.20 + commander: 10.0.1 + cross-spawn: 7.0.6 + envinfo: 7.21.0 + fastest-levenshtein: 1.0.16 + import-local: 3.2.0 + interpret: 3.1.1 + rechoir: 0.8.0 + webpack: 5.105.4(webpack-cli@5.1.4) + webpack-merge: 5.10.0 + dev: true + + /webpack-merge@5.10.0: + resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} + engines: {node: '>=10.0.0'} + dependencies: + clone-deep: 4.0.1 + flat: 5.0.2 + wildcard: 2.0.1 + dev: true + + /webpack-sources@3.3.4: + resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} + engines: {node: '>=10.13.0'} + dev: true + + /webpack@5.105.4(webpack-cli@5.1.4): + resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/wasm-edit': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + acorn: 8.16.0 + acorn-import-phases: 1.0.4(acorn@8.16.0) + browserslist: 4.28.1 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.20.0 + es-module-lexer: 2.0.0 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.1 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 4.3.3 + tapable: 2.3.0 + terser-webpack-plugin: 5.4.0(webpack@5.105.4) + watchpack: 2.5.1 + webpack-cli: 5.1.4(webpack@5.105.4) + webpack-sources: 3.3.4 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + dev: true + /whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: @@ -5739,6 +6308,10 @@ packages: string-width: 2.1.1 dev: true + /wildcard@2.0.1: + resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} + dev: true + /word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} diff --git a/scripts/publish-beta.js b/scripts/publish-beta.js new file mode 100644 index 000000000..f37598caa --- /dev/null +++ b/scripts/publish-beta.js @@ -0,0 +1,118 @@ +#!/usr/bin/env node + +/** + * Publish a beta release locally. + * 1. Fetches latest version from npm + * 2. Sets version to next patch + beta.0 (e.g. 4.6.2 → 4.6.3-beta.0) + * 3. Updates all package.json files + * 4. Builds and runs tests + * 5. Publishes to npm with --tag beta (use NPM_TAG=xyz to override) + * + * Usage: pnpm run publish:beta + * pnpm run publish:beta -- --no-test # skip tests + * pnpm run publish:beta -- --dry-run # no publish + * NPM_TAG=next pnpm run publish:beta # use different tag (default: beta) + */ + +const fs = require('fs'); +const path = require('path'); +const { execSync } = require('child_process'); +const semver = require('semver'); + +const ROOT_DIR = path.resolve(__dirname, '..'); +const PACKAGES_DIR = path.join(ROOT_DIR, 'packages'); + +function getPackageFiles() { + const packages = [path.join(ROOT_DIR, 'package.json')]; + const dirs = fs.readdirSync(PACKAGES_DIR, { withFileTypes: true }) + .filter(d => d.isDirectory()) + .map(d => path.join(PACKAGES_DIR, d.name, 'package.json')) + .filter(p => fs.existsSync(p)); + return [...packages, ...dirs]; +} + +function getNpmVersion(name) { + try { + return execSync(`npm view ${name} version`, { encoding: 'utf8' }).trim(); + } catch { + return null; + } +} + +function updateAllVersions(version) { + for (const pkgPath of getPackageFiles()) { + const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); + if (pkg.version) { + pkg.version = version; + fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, '\t') + '\n'); + } + } +} + +function getPublishablePackages() { + const publishable = []; + for (const pkgPath of getPackageFiles()) { + const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); + if (!pkg.private && pkg.name && pkg.name !== '@less/root') { + publishable.push({ name: pkg.name, dir: path.dirname(pkgPath) }); + } + } + return publishable; +} + +function main() { + const args = process.argv.slice(2); + const dryRun = args.includes('--dry-run'); + const skipTest = args.includes('--no-test'); + const npmTag = process.env.NPM_TAG || 'beta'; + + const npmVersion = getNpmVersion('less'); + if (!npmVersion) { + console.error('Could not fetch latest version from npm'); + process.exit(1); + } + + const nextPatch = semver.inc(npmVersion, 'patch'); + const betaVersion = `${nextPatch}-beta.0`; + + console.log(`📦 NPM latest: ${npmVersion}`); + console.log(`🔢 Setting version: ${betaVersion}\n`); + + if (!dryRun) { + updateAllVersions(betaVersion); + console.log(`✅ Updated all package.json files\n`); + } else { + console.log(` [DRY RUN] Would update package.json files to ${betaVersion}\n`); + } + + console.log('🔨 Building...'); + execSync('pnpm run build', { cwd: path.join(PACKAGES_DIR, 'less'), stdio: 'inherit' }); + console.log(''); + + if (!skipTest) { + console.log('🧪 Running tests...'); + execSync('pnpm run test:node', { cwd: ROOT_DIR, stdio: 'inherit' }); + console.log(''); + } + + if (dryRun) { + console.log(`🧪 DRY RUN - Would publish ${betaVersion} with tag '${npmTag}'`); + return; + } + + const publishable = getPublishablePackages(); + console.log(`📤 Publishing to npm with tag '${npmTag}'...\n`); + + for (const pkg of publishable) { + console.log(` Publishing ${pkg.name}@${betaVersion}...`); + execSync(`npm publish --tag ${npmTag} --access public`, { + cwd: pkg.dir, + stdio: 'inherit' + }); + } + + console.log(`\n🎉 Published ${betaVersion} to npm`); + console.log(` Install with: npm install less@${npmTag}`); +} + +main(); From 48a386f687a5f7e31a0e3fa4135ab666e87d110c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:40:43 -0700 Subject: [PATCH 34/76] test: Add coverage for :is()/:matches()/:where() containing nested :has() selectors and comma-separated lists (#4422) * Initial plan * Initial plan Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * test: add test cases for :is()/:matches() containing :has() (fixes #4378) Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * test: add :where() and comma-separated list test cases for pseudo-selectors Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> Co-authored-by: Matthew Dean --- package-lock.json | 3552 +++++++++++++++++ .../tests-unit/selectors/selectors.css | 24 + .../tests-unit/selectors/selectors.less | 33 + 3 files changed, 3609 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..b279427e1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3552 @@ +{ + "name": "@less/root", + "version": "4.6.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@less/root", + "version": "4.6.0", + "hasInstallScript": true, + "license": "Apache-2.0", + "devDependencies": { + "all-contributors-cli": "~6.26.1", + "github-changes": "^1.1.2", + "husky": "~9.1.7", + "npm-run-all": "^4.1.5", + "playwright": "1.50.1", + "semver": "^6.3.1" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", + "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/all-contributors-cli": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/all-contributors-cli/-/all-contributors-cli-6.26.1.tgz", + "integrity": "sha512-Ymgo3FJACRBEd1eE653FD1J/+uD0kqpUNYfr9zNC1Qby0LgbhDBzB3EF6uvkAbYpycStkk41J+0oo37Lc02yEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.7.6", + "async": "^3.1.0", + "chalk": "^4.0.0", + "didyoumean": "^1.2.1", + "inquirer": "^7.3.3", + "json-fixer": "^1.6.8", + "lodash": "^4.11.2", + "node-fetch": "^2.6.0", + "pify": "^5.0.0", + "yargs": "^15.0.1" + }, + "bin": { + "all-contributors": "dist/cli.js" + }, + "engines": { + "node": ">=4" + }, + "optionalDependencies": { + "prettier": "^2" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/application-config": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/application-config/-/application-config-0.1.2.tgz", + "integrity": "sha512-Ryjni0MtYYW9Qz2iTIMF5B/4uRJV3dt5f7PYgQ7sjTh3BUf4EvOo83F84Z2//2HP+mUbwRw35/W1jhM5EZhk9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "application-config-path": "^0.1.0", + "mkdirp": "^0.5.1" + } + }, + "node_modules/application-config-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/application-config-path/-/application-config-path-0.1.1.tgz", + "integrity": "sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw==", + "dev": true, + "license": "MIT" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/asn1": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "integrity": "sha512-Fh9zh3G2mZ8qM/kwsiKwL2U2FmXxVsboP4x1mXjnhKHv3SmzaBZoYvxEQJz/YS2gnCgd8xlAVWcZnQyC9qZBsA==", + "dev": true, + "engines": { + "node": ">=0.4.9" + } + }, + "node_modules/assert-plus": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "integrity": "sha512-brU24g7ryhRwGCI2y+1dGQmQXiZF7TtIj583S96y0jjdajIe6wn8BuXyELYhvD22dtIxDQVFk04YTJwwdwOYJw==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aws-sign": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/aws-sign/-/aws-sign-0.3.0.tgz", + "integrity": "sha512-pEMJAknifcXqXqYVXzGPIu8mJvxtJxIdpVpAs8HNS+paT+9srRUDMQn+3hULS7WbLmttcmvgMvnDcFujqXJyPw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bl": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "integrity": "sha512-njlCs8XLBIK7LCChTWfzWuIAxkpmmLXcL7/igCofFT1B039Sz0IPnAmosN5QaO22lU4qr8LcUz2ojUlE6pLkRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "~1.0.26" + } + }, + "node_modules/bluebird": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.0.3.tgz", + "integrity": "sha512-97HxegERaUQxXTDVTITyt7QuXEapf5uVXPVXKg6UjPvFC3N46KGvg/obSNZQbekkDbZlzxppDdTjAxel7WSXaA==", + "dev": true, + "license": "MIT" + }, + "node_modules/boom": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "integrity": "sha512-OvfN8y1oAxxphzkl2SnCS+ztV/uVKTATtgLjWYg/7KwcNyf3rzpHxNQJZCKtsZd4+MteKczhWbSjtEX4bGgU9g==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "dependencies": { + "hoek": "0.9.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/boom/node_modules/hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha512-ZZ6eGyzGjyMTmpSPYVECXy9uNfqBR7x5CavhUaLOeD6W0vWK1mp/b7O3f86XE0Mtfo9rZ6Bh3fnuw9Xr8MF9zA==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha512-qfexlmLp9MyrkajQVyjEDb0Vj+KhRgR/rxLiVhaihlT+ZkX0lReqtH6Ack40CvMDERR4b5eFp3CreskpBs1Pig==", + "dev": true, + "dependencies": { + "delayed-stream": "0.0.5" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie-jar": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz", + "integrity": "sha512-dX1400pzPULr+ZovkIsDEqe7XH8xCAYGT5Dege4Eot44Qs2mS2iJmnh45TxTO5MIsCfrV/JGZVloLhm46AHxNw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/cryptiles": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", + "integrity": "sha512-gvWSbgqP+569DdslUiCelxIv3IYK5Lgmq1UrRnk+s1WxQOQ16j3GPDcjdtgL5Au65DU/xQi6q3xPtf5Kta+3IQ==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "dependencies": { + "boom": "0.4.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/ctype": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "integrity": "sha512-T6CEkoSV4q50zW3TlTHMbzy1E5+zlnNcY+yb7tWVYlTwPhx9LpnfAkd4wecpWknDyptp4k97LUZeInlf6jdzBg==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha512-v+7uBd1pqe5YtgPacIIbZ8HuHeLFVNe4mUEyFDXL6KiqzEykjbw+5mXZXpGFgNVasdL4jWKgaKIXrEHiynN1LA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha512-+AWBwjGadtksxjOQSFDhPNQbed7icNXApT4+2BNpsXzcCBiInq2H9XW0O8sfHFaPmnQRs7cg/P0fAr2IWQSW0g==", + "dev": true, + "license": "BSD", + "dependencies": { + "readable-stream": "~1.1.9" + } + }, + "node_modules/duplexer2/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", + "integrity": "sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreach": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", + "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==", + "dev": true, + "license": "MIT" + }, + "node_modules/forever-agent": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", + "integrity": "sha512-PDG5Ef0Dob/JsZUxUltJOhm/Y9mlteAE+46y3M9RBz/Rd3QVENJ75aGRhN56yekTUboaBIkd8KVWX2NjF6+91A==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.0.8.tgz", + "integrity": "sha512-yzpBIhe8Ll+dYTXjd+4ORxbQktke+abD0dJjedvqsVVayMkb+PgLGatJNLwo95Va75l3YDZ01SrouzyW9bC2Fg==", + "dev": true, + "dependencies": { + "async": "~0.2.7", + "combined-stream": "~0.0.4", + "mime": "~1.2.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ghauth": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ghauth/-/ghauth-3.0.0.tgz", + "integrity": "sha512-Ds/q5leXoYu8e+MUJyI1C2mqcvdQ4iTzoOM2WN/p9sh/Z0r609dPUq7mLNa0CoGeKdmesyUmVJOAJeWxQ3tcag==", + "dev": true, + "license": "MIT", + "dependencies": { + "application-config": "~0.1.1", + "bl": "~0.9.4", + "hyperquest": "~1.2.0", + "mkdirp": "~0.5.0", + "read": "~1.0.5", + "xtend": "~4.0.0" + } + }, + "node_modules/github": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/github/-/github-0.1.16.tgz", + "integrity": "sha512-IVtcAhrb2HsThCNs1MTPuntLk6C1km0Q4A+md/FD/00SgyyJc4+2XsG1UsF2SUM7enumAgP5VKGVqzyyUmuNCw==", + "deprecated": "'github' has been renamed to '@octokit/rest' (https://git.io/vNB11)", + "dev": true + }, + "node_modules/github-changes": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/github-changes/-/github-changes-1.1.2.tgz", + "integrity": "sha512-S4lzHQHyPSyHm22JjE+Vsyr8/d797NPmYYpBqwfkPj9qHIbSwENoqKngyfGbaVbmPFTeE6QMgDbcX12TWy+fpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bluebird": "1.0.3", + "ghauth": "3.0.0", + "github": "0.1.16", + "github-commit-stream": "0.1.0", + "lodash": "2.4.1", + "moment-timezone": "0.5.5", + "nomnom": "1.6.2", + "parse-link-header": "0.1.0", + "semver": "5.4.1" + }, + "bin": { + "github-changes": "bin/index.js" + } + }, + "node_modules/github-changes/node_modules/lodash": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz", + "integrity": "sha512-qa6QqjA9jJB4AYw+NpD2GI4dzHL6Mv0hL+By6iIul4Ce0C1refrjZJmcGvWdnLUwl4LIPtvzje3UQfGH+nCEsQ==", + "dev": true, + "engines": [ + "node", + "rhino" + ], + "license": "MIT" + }, + "node_modules/github-changes/node_modules/semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/github-commit-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/github-commit-stream/-/github-commit-stream-0.1.0.tgz", + "integrity": "sha512-rWmtBtoK/yViLU7VfxXzLCY9aW/cipSGzUz3TE0wNRcHEPxDjI26gFtkRV+lLhJ69cr+MR+NvFUT+MVPZRXLCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "~0.2.9", + "parse-link-header": "~0.1.0", + "request": "~2.22.0", + "through": "~2.3.4" + } + }, + "node_modules/github-commit-stream/node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==", + "dev": true + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hawk": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-0.13.1.tgz", + "integrity": "sha512-f/1H9bruKJfgLN2KFd+666ILQvJYsJcxaCoIdHaaD2zgl7RUa08/202pGJXhOmQ1kTEdMTSxPnbCsu4l6JARhQ==", + "deprecated": "This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", + "dev": true, + "dependencies": { + "boom": "0.4.x", + "cryptiles": "0.2.x", + "hoek": "0.8.x", + "sntp": "0.2.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hoek": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.8.5.tgz", + "integrity": "sha512-NoKdeYUBOlQ7j9dgvT9BEX90rE6HtDkaMFwR6hfOj26LA2Mwyg5026jOpNBhmNrWIGdPnbBK3sQJI3POwh8wqg==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true, + "license": "ISC" + }, + "node_modules/http-signature": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "integrity": "sha512-coK8uR5rq2IMj+Hen+sKPA5ldgbCc1/spPdKCL1Fw6h+D0s/2LzMcRK0Cqufs1h0ryx/niwBHGFu8HC3hwU+lA==", + "dev": true, + "license": "MIT", + "dependencies": { + "asn1": "0.1.11", + "assert-plus": "^0.1.5", + "ctype": "0.5.3" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/hyperquest": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hyperquest/-/hyperquest-1.2.0.tgz", + "integrity": "sha512-N6QwIYr/ENmsE3+0aNA/x8M+jHF0wedvc9ZiGAhg7KK6TxwtJTSR95b0invqaLFPqUrsngYUrc4LVmLtrl7kvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "duplexer2": "~0.0.2", + "through2": "~0.6.3" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==", + "dev": true + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/is/-/is-0.2.7.tgz", + "integrity": "sha512-ajQCouIvkcSnl2iRdK70Jug9mohIHVX9uKpoWnl115ov0R5mzBvRrXxrnHbsA+8AdwCwc/sfw7HXmd4I5EJBdQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-object": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-0.1.2.tgz", + "integrity": "sha512-GkfZZlIZtpkFrqyAXPQSRBMsaHAw+CgoKe2HXAkjd/sfoI9+hS8PT4wg2rJxdQyUKr7N2vHJbg7/jQtE5l5vBQ==", + "dev": true + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/json-fixer": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/json-fixer/-/json-fixer-1.6.15.tgz", + "integrity": "sha512-TuDuZ5KrgyjoCIppdPXBMqiGfota55+odM+j2cQ5rt/XKyKmqGB3Whz1F8SN8+60yYGy/Nu5lbRZ+rx8kBIvBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.9", + "chalk": "^4.1.2", + "pegjs": "^0.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-4.0.0.tgz", + "integrity": "sha512-qzEpz1SDUb9xvA+LDOkNgjekdV7tuC7zDQf14sqMBtujh8kVbQhF11VWm4DeR99yFNjVSjTTfKa40c9ZQOtwXA==", + "dev": true, + "license": "BSD" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "dev": true, + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw==", + "dev": true + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.5.tgz", + "integrity": "sha512-/aaLDQVE4gnDiDIcX2wWgAfBvfmZAz5UEmVkSOL5FIPlVwsDGqvMzp/0N3MttZKUxeofRdnQhB1t7xI0FHLhZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "moment": ">= 2.6.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha512-TkCET/3rr9mUuRp+CpO7qfgT++aAxfDRaalQhwPFzI9BY/2rCDn6OfpZOVggi1AXfTPpfkTrg5f5WQx5G1uLxA==", + "deprecated": "Use uuid module instead", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/nomnom": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz", + "integrity": "sha512-mscrcqifc/QKP6/afmtoC84/mK6SKcDTDEfKPMSgJKeV5dtshiw5+AF90uwHyAqHkMIYIEcGkSAJnV6+T9PY/g==", + "deprecated": "Package no longer supported. Contact support@npmjs.com for more info.", + "dev": true, + "dependencies": { + "colors": "0.5.x", + "underscore": "~1.4.4" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-run-all/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/oauth-sign": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz", + "integrity": "sha512-Tr31Sh5FnK9YKm7xTUPyDMsNOvMqkVDND0zvK/Wgj7/H9q8mpye0qG2nVzrnsvLhcsX5DtqXD0la0ks6rkPCGQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-link-header": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-0.1.0.tgz", + "integrity": "sha512-VZ0pZwX3LRTfpDARULYD2C0fHuQqg7TPSGmPoKEHfBBmBhH7KMG3LV27GkUtjezoixE/CCJNAVnNw54IxkskWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "xtend": "~2.0.5" + } + }, + "node_modules/parse-link-header/node_modules/object-keys": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz", + "integrity": "sha512-XODjdR2pBh/1qrjPcbSeSgEtKbYo7LqYNq64/TPuCf7j9SfDD3i21yatKoIy39yIWNvVM59iutfQQpCv1RfFzA==", + "deprecated": "Please update to the latest object-keys", + "dev": true, + "license": "MIT", + "dependencies": { + "foreach": "~2.0.1", + "indexof": "~0.0.1", + "is": "~0.2.6" + } + }, + "node_modules/parse-link-header/node_modules/xtend": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.0.6.tgz", + "integrity": "sha512-fOZg4ECOlrMl+A6Msr7EIFcON1L26mb4NY5rurSkOex/TWhazOrg6eXD/B0XkuiYcYhQDWLXzQxLMVJ7LXwokg==", + "dev": true, + "dependencies": { + "is-object": "~0.1.2", + "object-keys": "~0.2.0" + }, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-type/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==", + "dev": true, + "license": "MIT", + "bin": { + "pegjs": "bin/pegjs" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", + "integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/playwright": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz", + "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.50.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz", + "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/qs": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", + "integrity": "sha512-kN+yNdAf29Jgp+AYHUmC7X4QdJPR8czuMWLNLc0aRxkQ7tB3vJQEONKKT9ou/rW7EbqVec11srC9q9BiVbcnHA==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "mute-stream": "~0.0.4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/request": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.22.0.tgz", + "integrity": "sha512-s05oCBjWuzNi/UbZtvwOnSJ85/lHUdYPriJyFUwdxHKr8VcZHB0wx0eTX8y5hCH3p7OTDi9iQUqMFyDkW6K7EQ==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "dependencies": { + "aws-sign": "~0.3.0", + "cookie-jar": "~0.3.0", + "forever-agent": "~0.5.0", + "form-data": "0.0.8", + "hawk": "~0.13.0", + "http-signature": "~0.10.0", + "json-stringify-safe": "~4.0.0", + "mime": "~1.2.9", + "node-uuid": "~1.4.0", + "oauth-sign": "~0.3.0", + "qs": "~0.6.0", + "tunnel-agent": "~0.3.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "license": "ISC" + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true, + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sntp": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", + "integrity": "sha512-bDLrKa/ywz65gCl+LmOiIhteP1bhEsAAzhfMedPoiHP3dyYnAevlaJshdqb9Yu0sRifyP/fRqSt8t+5qGIWlGQ==", + "deprecated": "This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", + "dev": true, + "dependencies": { + "hoek": "0.9.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/sntp/node_modules/hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha512-ZZ6eGyzGjyMTmpSPYVECXy9uNfqBR7x5CavhUaLOeD6W0vWK1mp/b7O3f86XE0Mtfo9rZ6Bh3fnuw9Xr8MF9zA==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.23.tgz", + "integrity": "sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tunnel-agent": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz", + "integrity": "sha512-jlGqHGoKzyyjhwv/c9omAgohntThMcGtw8RV/RDLlkbbc08kni/akVxO62N8HaXMVbVsK1NCnpSK3N2xCt22ww==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/underscore": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "integrity": "sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/which-typed-array": { + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", + "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/packages/test-data/tests-unit/selectors/selectors.css b/packages/test-data/tests-unit/selectors/selectors.css index a5c0f1bd4..bf7bb3961 100644 --- a/packages/test-data/tests-unit/selectors/selectors.css +++ b/packages/test-data/tests-unit/selectors/selectors.css @@ -197,3 +197,27 @@ a:is(.b, :is(.c)) { a:is(.b, :is(.c), :has(div)) { color: red; } +:is(:not(:has(>.foo)), :has(>.foo.bar)) { + overflow: clip; +} +:matches(:not(:has(>.foo)), :has(>.foo.bar)) { + overflow: clip; +} +:where(:not(:has(>.foo)), :has(>.foo.bar)) { + overflow: clip; +} +:is(:has(>.foo + .bar), :has(>.baz ~ .qux), :not(:has(.quux))) { + color: blue; +} +:where(.a, .b, .c) { + color: red; +} +:not(.a, .b, .c) { + color: green; +} +:where(:is(.a, .b), :has(>.c)) { + color: blue; +} +:is(:where(:has(.foo)), :not(:has(.bar))) { + color: purple; +} diff --git a/packages/test-data/tests-unit/selectors/selectors.less b/packages/test-data/tests-unit/selectors/selectors.less index 5cf26add7..f732c8d77 100644 --- a/packages/test-data/tests-unit/selectors/selectors.less +++ b/packages/test-data/tests-unit/selectors/selectors.less @@ -216,3 +216,36 @@ a:is(.b, :is(.c)) { a:is(.b, :is(.c), :has(div)) { color: red; } + +// https://github.com/less/less.js/issues/4378 +:is(:not(:has(>.foo)), :has(>.foo.bar)) { + overflow: clip; +} + +:matches(:not(:has(>.foo)), :has(>.foo.bar)) { + overflow: clip; +} + +:where(:not(:has(>.foo)), :has(>.foo.bar)) { + overflow: clip; +} + +:is(:has(>.foo + .bar), :has(>.baz ~ .qux), :not(:has(.quux))) { + color: blue; +} + +:where(.a, .b, .c) { + color: red; +} + +:not(.a, .b, .c) { + color: green; +} + +:where(:is(.a, .b), :has(>.c)) { + color: blue; +} + +:is(:where(:has(.foo)), :not(:has(.bar))) { + color: purple; +} From efd8b82aae3f9167c849c89de6f8399b305d1732 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:39:32 -0700 Subject: [PATCH 35/76] fix: ensure npm publish is always backed by a GitHub tag, release, and version-bump commit (#4430) * Initial plan * fix: prevent npm publish when GitHub push fails, skip workflow on version bump commits Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * fix: skip version-bump commit entirely, push only the tag to bypass branch protection Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * fix: restore version-bump commit + push to master, add infinite-loop guard Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * fix: exclude .github and scripts from publish workflow trigger Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * feat: implement PR-based release flow for master Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 137 ++++++++++++++++++++++++ .github/workflows/publish.yml | 42 ++++++-- scripts/bump-and-publish.js | 38 ++++--- 3 files changed, 199 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/create-release-pr.yml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml new file mode 100644 index 000000000..b41ee6b09 --- /dev/null +++ b/.github/workflows/create-release-pr.yml @@ -0,0 +1,137 @@ +name: Create Release PR + +# When code lands on master (not a release PR merge itself), automatically +# create or update a "chore: release vX.Y.Z" pull request that bumps the +# version. Maintainers then merge that PR to trigger publishing. +on: + push: + branches: + - master + # Only trigger for commits that touch package source files. + paths: + - 'packages/**' + +permissions: + contents: write + pull-requests: write + +jobs: + create-release-pr: + name: Create or Update Release PR + runs-on: ubuntu-latest + # Skip if this push is itself the merge of a release PR (prevents an + # infinite loop). We catch both squash-merged and regular-merged commits. + if: | + github.repository == 'less/less.js' && + !contains(github.event.head_commit.message, 'chore: release v') && + !contains(github.event.head_commit.message, '/release-v') + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Determine next version + id: version + run: | + CURRENT=$(node -p "require('./packages/less/package.json').version") + NPM_VERSION=$(npm view less version 2>/dev/null || echo "") + NEXT=$(node -e " + const semver = require('semver'); + const cur = process.argv[1]; + const npm = process.argv[2] || null; + if (npm && semver.valid(cur) && semver.gt(cur, npm)) { + process.stdout.write(cur); + } else { + const base = npm || cur; + process.stdout.write(semver.inc(base, 'patch')); + } + " "$CURRENT" "$NPM_VERSION") + echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" + echo "branch=chore/release-v$NEXT" >> "$GITHUB_OUTPUT" + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Create or update release branch and PR + env: + NEXT_VERSION: ${{ steps.version.outputs.next_version }} + RELEASE_BRANCH: ${{ steps.version.outputs.branch }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TITLE="chore: release v${NEXT_VERSION}" + + # Create or reset the release branch off the latest master so it + # always includes all recent commits. + if git ls-remote --exit-code origin "refs/heads/${RELEASE_BRANCH}" &>/dev/null; then + git fetch origin "${RELEASE_BRANCH}" + git checkout -B "${RELEASE_BRANCH}" origin/master + else + git checkout -b "${RELEASE_BRANCH}" + fi + + # Bump version in all package.json files. + node -e " + const fs = require('fs'); + const version = process.env.NEXT_VERSION; + const dirs = fs.readdirSync('packages', { withFileTypes: true }) + .filter(d => d.isDirectory()) + .map(d => 'packages/' + d.name + '/package.json'); + for (const f of ['package.json', ...dirs].filter(f => fs.existsSync(f))) { + const pkg = JSON.parse(fs.readFileSync(f, 'utf8')); + if (!pkg.version) continue; + pkg.version = version; + fs.writeFileSync(f, JSON.stringify(pkg, null, '\t') + '\n'); + } + " + + git add package.json packages/*/package.json + if git diff --cached --quiet; then + echo "No version changes; branch is already at v${NEXT_VERSION}" + else + git commit -m "${TITLE}" + fi + + # --force-with-lease refuses to overwrite if the remote has advanced + # past what we fetched, which protects against concurrent workflow + # runs. This is intentional: if two code PRs land simultaneously the + # second run will fail-fast here and the release branch stays coherent. + git push origin "${RELEASE_BRANCH}" --force-with-lease + + # Open a PR if one doesn't already exist for this version. + EXISTING=$(gh pr list --head "${RELEASE_BRANCH}" --base master \ + --json number --jq '.[0].number' 2>/dev/null || echo "") + + if [ -z "${EXISTING}" ]; then + BODY="## Release v${NEXT_VERSION} + + This PR bumps the version to \`${NEXT_VERSION}\` and will trigger an npm publish when merged. + + **Before merging:** + - [ ] Update CHANGELOG.md with changes for this release + - [ ] Verify all CI checks pass" + + gh pr create \ + --title "${TITLE}" \ + --body "${BODY}" \ + --base master \ + --head "${RELEASE_BRANCH}" + echo "✅ Created release PR for v${NEXT_VERSION}" + else + echo "✅ Release PR #${EXISTING} already exists; branch updated to include latest master commits" + fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f9b589735..bcb381828 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,15 +1,23 @@ name: Publish to NPM on: - push: + # Master: publish when a "chore: release vX.Y.Z" pull request is merged. + # The release PR is created automatically by create-release-pr.yml. + pull_request: + types: [closed] branches: - master + # Alpha: publish on direct push to the alpha branch. + push: + branches: - alpha paths-ignore: - '**.md' - 'docs/**' - '.gitignore' - '.claude/**' + - '.github/**' + - 'scripts/**' permissions: id-token: write # Required for OIDC trusted publishing @@ -19,15 +27,29 @@ jobs: publish: name: Publish to NPM runs-on: ubuntu-latest - # Only run on the upstream repo, not forks - if: github.repository == 'less/less.js' - + # Master: only run when a release PR (title = "chore: release v*") is merged. + # Alpha: only run on direct pushes; skip if it's a version-bump commit + # (prevents the bump-and-publish script from triggering itself). + if: | + github.repository == 'less/less.js' && + ( + (github.event_name == 'pull_request' && + github.event.pull_request.merged == true && + startsWith(github.event.pull_request.title, 'chore: release v')) || + (github.event_name == 'push' && + github.ref_name == 'alpha' && + !startsWith(github.event.head_commit.message, 'chore: bump version to')) + ) + steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + # For PR events check out the base branch (master) post-merge so the + # version bump from the release PR is already present. + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref }} - name: Install pnpm uses: pnpm/action-setup@v4 @@ -57,7 +79,13 @@ jobs: - name: Determine branch and tag type id: branch-info run: | - BRANCH="${{ github.ref_name }}" + # For PR events the branch is the PR's base (master); for push events + # it is the pushed branch (alpha). + if [ "${{ github.event_name }}" = "pull_request" ]; then + BRANCH="${{ github.event.pull_request.base.ref }}" + else + BRANCH="${{ github.ref_name }}" + fi echo "branch=$BRANCH" >> $GITHUB_OUTPUT if [ "$BRANCH" = "alpha" ]; then echo "is_alpha=true" >> $GITHUB_OUTPUT @@ -137,7 +165,9 @@ jobs: - name: Bump version and publish id: publish env: - GITHUB_REF_NAME: ${{ github.ref_name }} + # Use the branch name resolved by the branch-info step above rather + # than repeating the PR-vs-push detection logic here. + GITHUB_REF_NAME: ${{ steps.branch-info.outputs.branch }} run: | pnpm run publish diff --git a/scripts/bump-and-publish.js b/scripts/bump-and-publish.js index cf87db3e8..d731d2deb 100755 --- a/scripts/bump-and-publish.js +++ b/scripts/bump-and-publish.js @@ -6,9 +6,17 @@ * This script: * 1. Determines the next version (patch increment or explicit) * 2. Updates all package.json files to the same version - * 3. Creates a git tag - * 4. Commits version changes - * 5. Publishes all packages to NPM + * 3. Creates and pushes an annotated git tag + * 4. Publishes all packages to NPM + * + * For master, the version-bump commit is NOT pushed here. Instead it arrives + * via the "chore: release vX.Y.Z" pull request created by create-release-pr.yml. + * Merging that PR triggers this script, at which point package.json already has + * the target version. Only the git tag is pushed — tag pushes are not subject + * to branch-protection "require pull request" rules. + * + * For the alpha branch, the traditional commit + branch-push flow is preserved + * because alpha does not use the PR-based release flow. */ const fs = require('fs'); @@ -318,17 +326,23 @@ function main() { console.log(` [DRY RUN] Would create tag: ${tagName}`); } - // Push commit and tag - console.log(`📤 Pushing to ${branch}...`); - if (!dryRun) { - try { + // For master the version-bump commit already lives in master (it came from + // the release PR). Only push the git tag — tag pushes bypass branch + // protection "require pull request" rules. + // For alpha (direct-push branch) we still push the bump commit to the branch. + if (!isMaster) { + console.log(`📤 Pushing to ${branch}...`); + if (!dryRun) { execSync(`git push origin ${branch}`, { cwd: ROOT_DIR, stdio: 'inherit' }); - execSync(`git push origin "${tagName}"`, { cwd: ROOT_DIR, stdio: 'inherit' }); - } catch (e) { - console.log(`⚠️ Push failed, but continuing with publish...`); + } else { + console.log(` [DRY RUN] Would push to: origin ${branch}`); } + } + + console.log(`📤 Pushing tag ${tagName}...`); + if (!dryRun) { + execSync(`git push origin "${tagName}"`, { cwd: ROOT_DIR, stdio: 'inherit' }); } else { - console.log(` [DRY RUN] Would push to: origin ${branch}`); console.log(` [DRY RUN] Would push tag: origin ${tagName}`); } @@ -451,7 +465,7 @@ function main() { publishErrors.forEach(({ name, error }) => { console.error(` - ${name}: ${error}`); }); - console.error(`\n⚠️ Note: Version bump and commit were successful.`); + console.error(`\n⚠️ Note: Version bump commit and tag were pushed successfully.`); console.error(` Some packages failed to publish. You may need to publish them manually.`); process.exit(1); } From e3805d057a7328bbec5a503b5371b4d31d48d31e Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Wed, 18 Mar 2026 00:50:19 +0100 Subject: [PATCH 36/76] fix(less): upgrade make-dir to v4 to fix security vulnerability (#4426) Co-authored-by: Matthew Dean --- package-lock.json | 4 +- packages/less/package.json | 2 +- pnpm-lock.yaml | 7682 ++++++++++++++++++++---------------- 3 files changed, 4274 insertions(+), 3414 deletions(-) diff --git a/package-lock.json b/package-lock.json index b279427e1..abe2c3486 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@less/root", - "version": "4.6.0", + "version": "4.6.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@less/root", - "version": "4.6.0", + "version": "4.6.3", "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { diff --git a/packages/less/package.json b/packages/less/package.json index c4c9d1f65..f07a318f3 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -70,7 +70,7 @@ "errno": "^0.1.1", "graceful-fs": "^4.1.2", "image-size": "~0.5.0", - "make-dir": "^2.1.0", + "make-dir": "^5.1.0", "mime": "^1.4.1", "needle": "^3.1.0", "source-map": "~0.6.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6749c9996..5e841cae9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '9.0' settings: autoInstallPeers: true @@ -46,8 +46,8 @@ importers: specifier: ~0.5.0 version: 0.5.5 make-dir: - specifier: ^2.1.0 - version: 2.1.0 + specifier: ^5.1.0 + version: 5.1.0 mime: specifier: ^1.4.1 version: 1.6.0 @@ -78,7 +78,7 @@ importers: version: 18.19.130 '@typescript-eslint/eslint-plugin': specifier: ^4.28.0 - version: 4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@5.9.3) + version: 4.33.0(@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3) '@typescript-eslint/parser': specifier: ^4.28.0 version: 4.33.0(eslint@7.32.0)(typescript@5.9.3) @@ -224,83 +224,3437 @@ importers: packages: - /@arrows/array@1.4.1: + '@arrows/array@1.4.1': resolution: {integrity: sha512-MGYS8xi3c4tTy1ivhrVntFvufoNzje0PchjEz6G/SsWRgUKxL4tKwS6iPdO8vsaJYldagAeWMd5KRD0aX3Q39g==} + + '@arrows/composition@1.2.2': + resolution: {integrity: sha512-9fh1yHwrx32lundiB3SlZ/VwuStPB4QakPsSLrGJFH6rCXvdrd060ivAZ7/2vlqPnEjBkPRRXOcG1YOu19p2GQ==} + + '@arrows/dispatch@1.0.3': + resolution: {integrity: sha512-v/HwvrFonitYZM2PmBlAlCqVqxrkIIoiEuy5bQgn0BdfvlL0ooSBzcPzTMrtzY8eYktPyYcHg8fLbSgyybXEqw==} + + '@arrows/error@1.0.2': + resolution: {integrity: sha512-yvkiv1ay4Z3+Z6oQsUkedsQm5aFdyPpkBUQs8vejazU/RmANABx6bMMcBPPHI4aW43VPQmXFfBzr/4FExwWTEA==} + + '@arrows/multimethod@1.4.1': + resolution: {integrity: sha512-AZnAay0dgPnCJxn3We5uKiB88VL+1ZIF2SjZohLj6vqY2UyvB/sKdDnFP+LZNVsTC5lcnGPmLlRRkAh4sXkXsQ==} + + '@babel/code-frame@7.12.11': + resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} + + '@babel/code-frame@7.27.1': + resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + + '@babel/highlight@7.25.9': + resolution: {integrity: sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==} + engines: {node: '>=6.9.0'} + + '@babel/runtime@7.28.4': + resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} + engines: {node: '>=6.9.0'} + + '@bcoe/v8-coverage@1.0.2': + resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} + engines: {node: '>=18'} + + '@discoveryjs/json-ext@0.5.7': + resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} + engines: {node: '>=10.0.0'} + + '@eslint/eslintrc@0.4.3': + resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} + engines: {node: ^10.12.0 || >=12.0.0} + + '@humanwhocodes/config-array@0.5.0': + resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + + '@humanwhocodes/object-schema@1.2.1': + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + deprecated: Use @eslint/object-schema instead + + '@isaacs/balanced-match@4.0.1': + resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} + engines: {node: 20 || >=22} + + '@isaacs/brace-expansion@5.0.0': + resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} + engines: {node: 20 || >=22} + + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + + '@istanbuljs/schema@0.1.3': + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + + '@jest/diff-sequences@30.0.1': + resolution: {integrity: sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/get-type@30.1.0': + resolution: {integrity: sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/schemas@30.0.5': + resolution: {integrity: sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/source-map@0.3.11': + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + + '@rollup/plugin-commonjs@17.1.0': + resolution: {integrity: sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew==} + engines: {node: '>= 8.0.0'} + peerDependencies: + rollup: ^2.30.0 + + '@rollup/plugin-json@4.1.0': + resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} + peerDependencies: + rollup: ^1.20.0 || ^2.0.0 + + '@rollup/plugin-node-resolve@11.2.1': + resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} + engines: {node: '>= 10.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0 + + '@rollup/pluginutils@3.1.0': + resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} + engines: {node: '>= 8.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0 + + '@sinclair/typebox@0.34.41': + resolution: {integrity: sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==} + + '@types/eslint-scope@3.7.7': + resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} + + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/estree@0.0.39': + resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/glob@7.2.0': + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/minimatch@6.0.0': + resolution: {integrity: sha512-zmPitbQ8+6zNutpwgcQuLcsEpn/Cj54Kbn7L5pX0Os5kdWplB7xPgEh/g+SWOB/qmows2gpuCaPyduq8ZZRnxA==} + deprecated: This is a stub types definition. minimatch provides its own type definitions, so you do not need this installed. + + '@types/node@18.19.130': + resolution: {integrity: sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==} + + '@types/resolve@1.17.1': + resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} + + '@typescript-eslint/eslint-plugin@4.33.0': + resolution: {integrity: sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + '@typescript-eslint/parser': ^4.0.0 + eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/experimental-utils@4.33.0': + resolution: {integrity: sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + eslint: '*' + + '@typescript-eslint/parser@4.33.0': + resolution: {integrity: sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@4.33.0': + resolution: {integrity: sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==} + engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + + '@typescript-eslint/types@4.33.0': + resolution: {integrity: sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==} + engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + + '@typescript-eslint/typescript-estree@4.33.0': + resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/visitor-keys@4.33.0': + resolution: {integrity: sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==} + engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + + '@webassemblyjs/ast@1.14.1': + resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} + + '@webassemblyjs/floating-point-hex-parser@1.13.2': + resolution: {integrity: sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==} + + '@webassemblyjs/helper-api-error@1.13.2': + resolution: {integrity: sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==} + + '@webassemblyjs/helper-buffer@1.14.1': + resolution: {integrity: sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==} + + '@webassemblyjs/helper-numbers@1.13.2': + resolution: {integrity: sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==} + + '@webassemblyjs/helper-wasm-bytecode@1.13.2': + resolution: {integrity: sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==} + + '@webassemblyjs/helper-wasm-section@1.14.1': + resolution: {integrity: sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==} + + '@webassemblyjs/ieee754@1.13.2': + resolution: {integrity: sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==} + + '@webassemblyjs/leb128@1.13.2': + resolution: {integrity: sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==} + + '@webassemblyjs/utf8@1.13.2': + resolution: {integrity: sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==} + + '@webassemblyjs/wasm-edit@1.14.1': + resolution: {integrity: sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==} + + '@webassemblyjs/wasm-gen@1.14.1': + resolution: {integrity: sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==} + + '@webassemblyjs/wasm-opt@1.14.1': + resolution: {integrity: sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==} + + '@webassemblyjs/wasm-parser@1.14.1': + resolution: {integrity: sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==} + + '@webassemblyjs/wast-printer@1.14.1': + resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + + '@webpack-cli/configtest@2.1.1': + resolution: {integrity: sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + + '@webpack-cli/info@2.0.2': + resolution: {integrity: sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + + '@webpack-cli/serve@2.0.5': + resolution: {integrity: sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + webpack-dev-server: '*' + peerDependenciesMeta: + webpack-dev-server: + optional: true + + '@xtuc/ieee754@1.2.0': + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} + + '@xtuc/long@4.2.2': + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + + abbrev@1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + + accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + + acorn-import-phases@1.0.4: + resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} + engines: {node: '>=10.13.0'} + peerDependencies: + acorn: ^8.14.0 + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@7.4.1: + resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} + engines: {node: '>=0.4.0'} + hasBin: true + + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true + + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + + agent-base@4.3.0: + resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} + engines: {node: '>= 4.0.0'} + + ajv-formats@2.1.1: + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv-keywords@5.1.0: + resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} + peerDependencies: + ajv: ^8.8.2 + + ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + + ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + + all-contributors-cli@6.26.1: + resolution: {integrity: sha512-Ymgo3FJACRBEd1eE653FD1J/+uD0kqpUNYfr9zNC1Qby0LgbhDBzB3EF6uvkAbYpycStkk41J+0oo37Lc02yEw==} + engines: {node: '>=4'} + hasBin: true + + ansi-colors@3.2.3: + resolution: {integrity: sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==} + engines: {node: '>=6'} + + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + + ansi-regex@2.1.1: + resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} + engines: {node: '>=0.10.0'} + + ansi-regex@3.0.1: + resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} + engines: {node: '>=4'} + + ansi-regex@4.1.1: + resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} + engines: {node: '>=6'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} + engines: {node: '>=12'} + + ansi-styles@2.2.1: + resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} + engines: {node: '>=0.10.0'} + + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} + engines: {node: '>=12'} + + append-type@1.0.2: + resolution: {integrity: sha512-hac740vT/SAbrFBLgLIWZqVT5PUAcGTWS5UkDDhr+OCizZSw90WKw6sWAEgGaYd2viIblggypMXwpjzHXOvAQg==} + + application-config-path@0.1.1: + resolution: {integrity: sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw==} + + application-config@0.1.2: + resolution: {integrity: sha512-Ryjni0MtYYW9Qz2iTIMF5B/4uRJV3dt5f7PYgQ7sjTh3BUf4EvOo83F84Z2//2HP+mUbwRw35/W1jhM5EZhk9Q==} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + array-buffer-byte-length@1.0.2: + resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} + engines: {node: '>= 0.4'} + + array-each@1.0.1: + resolution: {integrity: sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==} + engines: {node: '>=0.10.0'} + + array-slice@1.1.0: + resolution: {integrity: sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==} + engines: {node: '>=0.10.0'} + + array-to-sentence@1.1.0: + resolution: {integrity: sha512-YkwkMmPA2+GSGvXj1s9NZ6cc2LBtR+uSeWTy2IGi5MR1Wag4DdrcjTxA/YV/Fw+qKlBeXomneZgThEbm/wvZbw==} + + array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + + array.prototype.reduce@1.0.8: + resolution: {integrity: sha512-DwuEqgXFBwbmZSRqt3BpQigWNUoqw9Ml2dTWdF3B2zQlQX4OeUE0zyuzX0fX0IbTvjdkZbcBTU3idgpO78qkTw==} + engines: {node: '>= 0.4'} + + arraybuffer.prototype.slice@1.0.4: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} + engines: {node: '>= 0.4'} + + asap@2.0.6: + resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + + asn1@0.1.11: + resolution: {integrity: sha512-Fh9zh3G2mZ8qM/kwsiKwL2U2FmXxVsboP4x1mXjnhKHv3SmzaBZoYvxEQJz/YS2gnCgd8xlAVWcZnQyC9qZBsA==} + engines: {node: '>=0.4.9'} + + asn1@0.2.6: + resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} + + assert-fs-readfile-option@1.0.1: + resolution: {integrity: sha512-bESFgerRqZpPcFWBW/cXl0l1XQVLPFi80i31S6eYLIzksnNKdTKBlMoC7Dy/FWAj/97XIYhpe2CmVogifnEkMw==} + + assert-plus@0.1.5: + resolution: {integrity: sha512-brU24g7ryhRwGCI2y+1dGQmQXiZF7TtIj583S96y0jjdajIe6wn8BuXyELYhvD22dtIxDQVFk04YTJwwdwOYJw==} + engines: {node: '>=0.8'} + + assert-plus@1.0.0: + resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} + engines: {node: '>=0.8'} + + assert-valid-glob-opts@1.0.0: + resolution: {integrity: sha512-/mttty5Xh7wE4o7ttKaUpBJl0l04xWe3y6muy1j27gyzSsnceK0AYU9owPtUoL9z8+9hnPxztmuhdFZ7jRoyWw==} + + assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + + astral-regex@2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + + async-function@1.0.0: + resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} + engines: {node: '>= 0.4'} + + async@0.2.10: + resolution: {integrity: sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==} + + async@1.5.2: + resolution: {integrity: sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==} + + async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + + autoprefixer@6.7.7: + resolution: {integrity: sha512-WKExI/eSGgGAkWAO+wMVdFObZV7hQen54UpD1kCCTN3tvlL3W1jL4+lPP/M7MwoP7Q4RHzKtO3JQ4HxYEcd+xQ==} + + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + aws-sign2@0.7.0: + resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} + + aws-sign@0.3.0: + resolution: {integrity: sha512-pEMJAknifcXqXqYVXzGPIu8mJvxtJxIdpVpAs8HNS+paT+9srRUDMQn+3hULS7WbLmttcmvgMvnDcFujqXJyPw==} + + aws4@1.13.2: + resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + baseline-browser-mapping@2.10.0: + resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} + engines: {node: '>=6.0.0'} + hasBin: true + + basic-auth@2.0.1: + resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} + engines: {node: '>= 0.8'} + + batch@0.6.1: + resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} + + bcrypt-pbkdf@1.0.2: + resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} + + benchmark@2.1.4: + resolution: {integrity: sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==} + + benny@3.7.1: + resolution: {integrity: sha512-USzYxODdVfOS7JuQq/L0naxB788dWCiUgUTxvN+WLPt/JfcDURNNj8kN/N+uK6PDvuR67/9/55cVKGPleFQINA==} + engines: {node: '>=12'} + + bl@0.9.5: + resolution: {integrity: sha512-njlCs8XLBIK7LCChTWfzWuIAxkpmmLXcL7/igCofFT1B039Sz0IPnAmosN5QaO22lU4qr8LcUz2ojUlE6pLkRQ==} + + bluebird@1.0.3: + resolution: {integrity: sha512-97HxegERaUQxXTDVTITyt7QuXEapf5uVXPVXKg6UjPvFC3N46KGvg/obSNZQbekkDbZlzxppDdTjAxel7WSXaA==} + + boom@0.4.2: + resolution: {integrity: sha512-OvfN8y1oAxxphzkl2SnCS+ztV/uVKTATtgLjWYg/7KwcNyf3rzpHxNQJZCKtsZd4+MteKczhWbSjtEX4bGgU9g==} + engines: {node: '>=0.8.0'} + deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). + + bootstrap-less-port@0.3.0: + resolution: {integrity: sha512-08aP3FZ7QQ0muffrYguACtN06dfkYvPI6yZEmXSZ3T7VfPD0mVT60lcM4pEW0we3W7BTUlhqYHCGTXrUzWbYoA==} + engines: {node: '>=6'} + + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + + brace-expansion@2.0.2: + resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browser-stdout@1.3.1: + resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} + + browserslist@1.7.7: + resolution: {integrity: sha512-qHJblDE2bXVRYzuDetv/wAeHOJyO97+9wxC1cdCtyzgNuSozOyRCiiLaCR1f71AN66lQdVVBipWm63V+a7bPOw==} + deprecated: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. + hasBin: true + + browserslist@4.28.1: + resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + + builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + + c8@10.1.3: + resolution: {integrity: sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + monocart-coverage-reports: ^2 + peerDependenciesMeta: + monocart-coverage-reports: + optional: true + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + + caniuse-db@1.0.30001760: + resolution: {integrity: sha512-pMTtXP7Yb1RXqO9ddJwLOYQ5Mb1R4/vRx7j9v6MlSCf8anENKZHr9SLxS7FqqroeAkmfgMAmtEwt1kh8men/vg==} + + caniuse-lite@1.0.30001777: + resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} + + caseless@0.12.0: + resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + + chai@4.5.0: + resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} + engines: {node: '>=4'} + + chalk@1.1.3: + resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} + engines: {node: '>=0.10.0'} + + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + + check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + + chrome-trace-event@1.0.4: + resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} + engines: {node: '>=6.0'} + + clean-css@5.3.3: + resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} + engines: {node: '>= 10.0'} + + cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + + cli-width@3.0.0: + resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} + engines: {node: '>= 10'} + + cliui@5.0.0: + resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} + + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + clone-deep@4.0.1: + resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} + engines: {node: '>=6'} + + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + + colors@0.5.1: + resolution: {integrity: sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==} + engines: {node: '>=0.1.90'} + + colors@1.1.2: + resolution: {integrity: sha512-ENwblkFQpqqia6b++zLD/KUWafYlVY/UNnAp7oz7LY7E924wmpye416wBOmvv/HMWzl8gL1kJlfvId/1Dg176w==} + engines: {node: '>=0.1.90'} + + combined-stream@0.0.7: + resolution: {integrity: sha512-qfexlmLp9MyrkajQVyjEDb0Vj+KhRgR/rxLiVhaihlT+ZkX0lReqtH6Ack40CvMDERR4b5eFp3CreskpBs1Pig==} + engines: {node: '>= 0.8'} + + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + + commander@2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + + commander@6.2.1: + resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==} + engines: {node: '>= 6'} + + common-tags@1.8.2: + resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} + engines: {node: '>=4.0.0'} + + commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + connect-livereload@0.5.4: + resolution: {integrity: sha512-3KnRwsWf4VmP01I4hCDQqTc4e2UxOvJIi8i08GiwqX2oymzxNFY7PqjFkwHglYTJ0yzUJkO5yqdPxVaIz3Pbug==} + + connect@3.7.0: + resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} + engines: {node: '>= 0.10.0'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + cookie-jar@0.3.0: + resolution: {integrity: sha512-dX1400pzPULr+ZovkIsDEqe7XH8xCAYGT5Dege4Eot44Qs2mS2iJmnh45TxTO5MIsCfrV/JGZVloLhm46AHxNw==} + + copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} + + core-util-is@1.0.2: + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} + + core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + + cosmiconfig@9.0.0: + resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=4.9.5' + peerDependenciesMeta: + typescript: + optional: true + + cross-env@7.0.3: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + + cross-spawn@6.0.6: + resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} + engines: {node: '>=4.8'} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + cryptiles@0.2.2: + resolution: {integrity: sha512-gvWSbgqP+569DdslUiCelxIv3IYK5Lgmq1UrRnk+s1WxQOQ16j3GPDcjdtgL5Au65DU/xQi6q3xPtf5Kta+3IQ==} + engines: {node: '>=0.8.0'} + deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). + + ctype@0.5.3: + resolution: {integrity: sha512-T6CEkoSV4q50zW3TlTHMbzy1E5+zlnNcY+yb7tWVYlTwPhx9LpnfAkd4wecpWknDyptp4k97LUZeInlf6jdzBg==} + engines: {node: '>= 0.4'} + + dashdash@1.14.1: + resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} + engines: {node: '>=0.10'} + + data-view-buffer@1.0.2: + resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} + engines: {node: '>= 0.4'} + + data-view-byte-length@1.0.2: + resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} + engines: {node: '>= 0.4'} + + data-view-byte-offset@1.0.1: + resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} + engines: {node: '>= 0.4'} + + date-time@1.1.0: + resolution: {integrity: sha512-RrxZQ06cdKe7YQ5oqIxs3GMc7W3vXscy7Ds+aZIqmxA59QnVtTiCseA4jbzVUub9xCbo9GuYVZo0OrZLYXnnmw==} + engines: {node: '>=0.10.0'} + + dateformat@4.6.3: + resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} + + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@3.2.6: + resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} + deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + + deep-eql@4.1.4: + resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} + engines: {node: '>=6'} + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + + delayed-stream@0.0.5: + resolution: {integrity: sha512-v+7uBd1pqe5YtgPacIIbZ8HuHeLFVNe4mUEyFDXL6KiqzEykjbw+5mXZXpGFgNVasdL4jWKgaKIXrEHiynN1LA==} + engines: {node: '>=0.4.0'} + + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + + depd@1.1.2: + resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} + engines: {node: '>= 0.6'} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + detect-file@1.0.0: + resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} + engines: {node: '>=0.10.0'} + + didyoumean@1.2.2: + resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + + diff@3.5.0: + resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} + engines: {node: '>=0.3.1'} + + dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + duplexer2@0.0.2: + resolution: {integrity: sha512-+AWBwjGadtksxjOQSFDhPNQbed7icNXApT4+2BNpsXzcCBiInq2H9XW0O8sfHFaPmnQRs7cg/P0fAr2IWQSW0g==} + + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + ecc-jsbn@0.1.2: + resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + electron-to-chromium@1.5.267: + resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} + + emoji-regex@7.0.3: + resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + encodeurl@1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + enhanced-resolve@5.20.0: + resolution: {integrity: sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==} + engines: {node: '>=10.13.0'} + + enquirer@2.4.1: + resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} + engines: {node: '>=8.6'} + + env-paths@2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + + envinfo@7.21.0: + resolution: {integrity: sha512-Lw7I8Zp5YKHFCXL7+Dz95g4CcbMEpgvqZNNq3AmlT5XAV6CgAAk6gyAMqn2zjw08K9BHfcNuKrMiCPLByGafow==} + engines: {node: '>=4'} + hasBin: true + + errno@0.1.8: + resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} + hasBin: true + + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + + es-abstract@1.24.1: + resolution: {integrity: sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==} + engines: {node: '>= 0.4'} + + es-array-method-boxes-properly@1.0.0: + resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-module-lexer@2.0.0: + resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + + es-to-primitive@1.3.0: + resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + engines: {node: '>= 0.4'} + + es6-promise@4.2.8: + resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} + + es6-promisify@5.0.0: + resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + + eslint-utils@2.1.0: + resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} + engines: {node: '>=6'} + + eslint-utils@3.0.0: + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + + eslint-visitor-keys@1.3.0: + resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} + engines: {node: '>=4'} + + eslint-visitor-keys@2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} + engines: {node: '>=10'} + + eslint@7.32.0: + resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} + engines: {node: ^10.12.0 || >=12.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + hasBin: true + + espree@7.3.1: + resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} + engines: {node: ^10.12.0 || >=12.0.0} + + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + estree-walker@0.6.1: + resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} + + estree-walker@1.0.1: + resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + eventemitter2@0.4.14: + resolution: {integrity: sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==} + + events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + + exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + + expand-tilde@2.0.2: + resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} + engines: {node: '>=0.10.0'} + + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + + external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + + extsprintf@1.3.0: + resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} + engines: {'0': node >=0.6.0} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fast-uri@3.1.0: + resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + + fastest-levenshtein@1.0.16: + resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} + engines: {node: '>= 4.9.1'} + + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + + fg-lodash@0.0.2: + resolution: {integrity: sha512-3jf21fWKb/qCM+frhdQX6/KT7sn12i5T6K7952/hKpOdK5uzYbZbEwJmWjrgrSzc74iXFtrtbHPD2mMywPkB9A==} + + figures@1.7.0: + resolution: {integrity: sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==} + engines: {node: '>=0.10.0'} + + figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + + file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + finalhandler@1.1.2: + resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} + engines: {node: '>= 0.8'} + + find-up@3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + findup-sync@4.0.0: + resolution: {integrity: sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==} + engines: {node: '>= 8'} + + findup-sync@5.0.0: + resolution: {integrity: sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==} + engines: {node: '>= 10.13.0'} + + fined@1.2.0: + resolution: {integrity: sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==} + engines: {node: '>= 0.10'} + + flagged-respawn@1.0.1: + resolution: {integrity: sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==} + engines: {node: '>= 0.10'} + + flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + + flat@4.1.1: + resolution: {integrity: sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==} + hasBin: true + + flat@5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + + flatted@3.3.3: + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} + + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + + for-in@1.0.2: + resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==} + engines: {node: '>=0.10.0'} + + for-own@1.0.0: + resolution: {integrity: sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==} + engines: {node: '>=0.10.0'} + + foreach@2.0.6: + resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} + + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} + engines: {node: '>=14'} + + forever-agent@0.5.2: + resolution: {integrity: sha512-PDG5Ef0Dob/JsZUxUltJOhm/Y9mlteAE+46y3M9RBz/Rd3QVENJ75aGRhN56yekTUboaBIkd8KVWX2NjF6+91A==} + + forever-agent@0.6.1: + resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + + form-data@0.0.8: + resolution: {integrity: sha512-yzpBIhe8Ll+dYTXjd+4ORxbQktke+abD0dJjedvqsVVayMkb+PgLGatJNLwo95Va75l3YDZ01SrouzyW9bC2Fg==} + engines: {node: '>= 0.6'} + + form-data@2.3.3: + resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} + engines: {node: '>= 0.12'} + + fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + + fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} + + fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + function.prototype.name@1.1.8: + resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} + engines: {node: '>= 0.4'} + + functional-red-black-tree@1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} + + functions-have-names@1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + + generator-function@2.0.1: + resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} + engines: {node: '>= 0.4'} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + get-symbol-description@1.1.0: + resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} + engines: {node: '>= 0.4'} + + getobject@1.0.2: + resolution: {integrity: sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==} + engines: {node: '>=10'} + + getpass@0.1.7: + resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + + ghauth@3.0.0: + resolution: {integrity: sha512-Ds/q5leXoYu8e+MUJyI1C2mqcvdQ4iTzoOM2WN/p9sh/Z0r609dPUq7mLNa0CoGeKdmesyUmVJOAJeWxQ3tcag==} + + git-rev@0.2.1: + resolution: {integrity: sha512-p6OU8kZpeGHYqGpwnSD5/8IIERooiQp0p6On3T7ngcugnjhbmihvgMwCK2iun8ytn7FynsCPN+jRclR29hgOBg==} + + github-changes@1.1.2: + resolution: {integrity: sha512-S4lzHQHyPSyHm22JjE+Vsyr8/d797NPmYYpBqwfkPj9qHIbSwENoqKngyfGbaVbmPFTeE6QMgDbcX12TWy+fpg==} + hasBin: true + + github-commit-stream@0.1.0: + resolution: {integrity: sha512-rWmtBtoK/yViLU7VfxXzLCY9aW/cipSGzUz3TE0wNRcHEPxDjI26gFtkRV+lLhJ69cr+MR+NvFUT+MVPZRXLCw==} + + github@0.1.16: + resolution: {integrity: sha512-IVtcAhrb2HsThCNs1MTPuntLk6C1km0Q4A+md/FD/00SgyyJc4+2XsG1UsF2SUM7enumAgP5VKGVqzyyUmuNCw==} + deprecated: '''github'' has been renamed to ''@octokit/rest'' (https://git.io/vNB11)' + + glob-observable@0.7.0: + resolution: {integrity: sha512-iZAgGTchl2MgZIWmK96BoHv0dFA2iXWBjFTFgIBbcpSdEPJJoXgr2e48GWlxcDOLsb6UHz5NWEPi0+6ysPFE+A==} + + glob-option-error@1.0.0: + resolution: {integrity: sha512-AD7lbWbwF2Ii9gBQsQIOEzwuqP/jsnyvK27/3JDq1kn/JyfDtYI6AWz3ZQwcPuQdHSBcFh+A2yT/SEep27LOGg==} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-to-regexp@0.4.1: + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + + glob@10.5.0: + resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} + hasBin: true + + glob@11.0.3: + resolution: {integrity: sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==} + engines: {node: 20 || >=22} + hasBin: true + + glob@7.1.3: + resolution: {integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==} + deprecated: Glob versions prior to v9 are no longer supported + + glob@7.1.7: + resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + + global-modules@1.0.0: + resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} + engines: {node: '>=0.10.0'} + + global-prefix@1.0.2: + resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} + engines: {node: '>=0.10.0'} + + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + + globalthis@1.0.4: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} + engines: {node: '>= 0.4'} + + globby@10.0.2: + resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==} + engines: {node: '>=8'} + + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + growl@1.10.5: + resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} + engines: {node: '>=4.x'} + + grunt-cli@1.4.3: + resolution: {integrity: sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==} + engines: {node: '>=10'} + hasBin: true + + grunt-cli@1.5.0: + resolution: {integrity: sha512-rILKAFoU0dzlf22SUfDtq2R1fosChXXlJM5j7wI6uoW8gwmXDXzbUvirlKZSYCdXl3LXFbR+8xyS+WFo+b6vlA==} + engines: {node: '>=10'} + hasBin: true + + grunt-contrib-clean@1.1.0: + resolution: {integrity: sha512-tET+TYTd8vCtKeGwbLjoH8+SdI8ngVzGbPr7vlWkewG7mYYHIccd2Ldxq+PK3DyBp5Www3ugdkfsjoNKUl5MTg==} + engines: {node: '>= 0.10.0'} + peerDependencies: + grunt: '>=0.4.5' + + grunt-contrib-connect@1.0.2: + resolution: {integrity: sha512-7OPoyfGrpOYzuiRPzGyzWDe/xFcjttXe1ztVSFS8TAVBtpfXeeOV9RiwuyqA4yN1UeOG2Pnpx8s0DcUDAu21Gw==} + engines: {node: '>=0.10.0'} + peerDependencies: + grunt: '>=0.4.0' + + grunt-eslint@23.0.0: + resolution: {integrity: sha512-QqHSAiGF08EVD7YlD4OSRWuLRaDvpsRdTptwy9WaxUXE+03mCLVA/lEaR6SHWehF7oUwIqCEjaNONeeeWlB4LQ==} + engines: {node: '>=10'} + peerDependencies: + grunt: '>=1' + + grunt-known-options@2.0.0: + resolution: {integrity: sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==} + engines: {node: '>=0.10.0'} + + grunt-legacy-log-utils@2.1.0: + resolution: {integrity: sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==} + engines: {node: '>=10'} + + grunt-legacy-log@3.0.0: + resolution: {integrity: sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==} + engines: {node: '>= 0.10.0'} + + grunt-legacy-util@2.0.1: + resolution: {integrity: sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==} + engines: {node: '>=10'} + + grunt-saucelabs@9.0.1: + resolution: {integrity: sha512-3WD5/RtSp8AyEnmtN5HK1NUkU7o/kBl6rGQILnfg7WHTe0g0uG3LtecWPwTRYrD7kop79WkDfeVQ85WjvwDUZw==} + engines: {node: '>=0.6', npm: '>=1.2.12'} + peerDependencies: + grunt: '>=0.4.1' + + grunt-shell@1.3.1: + resolution: {integrity: sha512-fqiC5NNNTCKwH3TCbYpNkNUgq1/cEYJp59tedtWv83sGeG0PTmVB7Lbo/m0WQug3MngV6lsYAXvoNflDD1oeQg==} + engines: {node: '>=0.10.0'} + peerDependencies: + grunt: '>=0.4.0' + + grunt@1.6.1: + resolution: {integrity: sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==} + engines: {node: '>=16'} + hasBin: true + + har-schema@2.0.0: + resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} + engines: {node: '>=4'} + + har-validator@5.1.5: + resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==} + engines: {node: '>=6'} + deprecated: this library is no longer supported + + has-ansi@2.0.0: + resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} + engines: {node: '>=0.10.0'} + + has-bigints@1.1.0: + resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} + engines: {node: '>= 0.4'} + + has-flag@1.0.0: + resolution: {integrity: sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==} + engines: {node: '>=0.10.0'} + + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-proto@1.2.0: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} + engines: {node: '>= 0.4'} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + hawk@0.13.1: + resolution: {integrity: sha512-f/1H9bruKJfgLN2KFd+666ILQvJYsJcxaCoIdHaaD2zgl7RUa08/202pGJXhOmQ1kTEdMTSxPnbCsu4l6JARhQ==} + engines: {node: '>=0.8.0'} + deprecated: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. + + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + + hoek@0.8.5: + resolution: {integrity: sha512-NoKdeYUBOlQ7j9dgvT9BEX90rE6HtDkaMFwR6hfOj26LA2Mwyg5026jOpNBhmNrWIGdPnbBK3sQJI3POwh8wqg==} + engines: {node: '>=0.8.0'} + deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). + + hoek@0.9.1: + resolution: {integrity: sha512-ZZ6eGyzGjyMTmpSPYVECXy9uNfqBR7x5CavhUaLOeD6W0vWK1mp/b7O3f86XE0Mtfo9rZ6Bh3fnuw9Xr8MF9zA==} + engines: {node: '>=0.8.0'} + deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). + + homedir-polyfill@1.0.3: + resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} + engines: {node: '>=0.10.0'} + + hooker@0.2.3: + resolution: {integrity: sha512-t+UerCsQviSymAInD01Pw+Dn/usmz1sRO+3Zk1+lx8eg+WKpD2ulcwWqHHL0+aseRBr+3+vIhiG1K1JTwaIcTA==} + + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + + html-es6cape@1.0.5: + resolution: {integrity: sha512-pkkhVE3YCMJwWBy/b87xhXaFaceDZECytDvu36/t3dXvU3FaczMjQVX2cugDIBM+gpAKBPSxl4KWctqVJBJi4w==} + + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + + html-template-tag@3.2.0: + resolution: {integrity: sha512-dt/21zLAVPBB3M4j6dCE46LyG8PcHHIUTYiBTIRDw1yg4nGaVbKEVHVsm3BpeJzlSB6n9BrcW6kP4zJE9mS3ew==} + + http-errors@1.6.3: + resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} + engines: {node: '>= 0.6'} + + http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + + http-signature@0.10.1: + resolution: {integrity: sha512-coK8uR5rq2IMj+Hen+sKPA5ldgbCc1/spPdKCL1Fw6h+D0s/2LzMcRK0Cqufs1h0ryx/niwBHGFu8HC3hwU+lA==} + engines: {node: '>=0.8'} + + http-signature@1.2.0: + resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} + engines: {node: '>=0.8', npm: '>=1.3.7'} + + http2@3.3.7: + resolution: {integrity: sha512-puSi8M8WNlFJm9Pk4c/Mbz9Gwparuj3gO9/RRO5zv6piQ0FY+9Qywp0PdWshYgsMJSalixFY7eC6oPu0zRxLAQ==} + engines: {node: '>=0.12.0 <9.0.0'} + deprecated: Use the built-in module in node 9.0.0 or newer, instead + + https-proxy-agent@2.2.4: + resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} + engines: {node: '>= 4.5.0'} + + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + + hyperquest@1.2.0: + resolution: {integrity: sha512-N6QwIYr/ENmsE3+0aNA/x8M+jHF0wedvc9ZiGAhg7KK6TxwtJTSR95b0invqaLFPqUrsngYUrc4LVmLtrl7kvw==} + + iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + + ignore@4.0.6: + resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} + engines: {node: '>= 4'} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + image-size@0.5.5: + resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} + engines: {node: '>=0.10.0'} + hasBin: true + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} + engines: {node: '>=6'} + + import-local@3.2.0: + resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + engines: {node: '>=8'} + hasBin: true + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + indexed-filter@1.0.3: + resolution: {integrity: sha512-oBIzs6EARNMzrLgVg20fK52H19WcRHBiukiiEkw9rnnI//8rinEBMLrYdwEfJ9d4K7bjV1L6nSGft6H/qzHNgQ==} + + indexof@0.0.1: + resolution: {integrity: sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==} + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.3: + resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + + inquirer@7.3.3: + resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==} + engines: {node: '>=8.0.0'} + + inspect-with-kind@1.0.5: + resolution: {integrity: sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==} + + internal-slot@1.1.0: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} + engines: {node: '>= 0.4'} + + interpret@1.1.0: + resolution: {integrity: sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==} + + interpret@1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + + interpret@3.1.1: + resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} + engines: {node: '>=10.13.0'} + + is-absolute@1.0.0: + resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} + engines: {node: '>=0.10.0'} + + is-array-buffer@3.0.5: + resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} + engines: {node: '>= 0.4'} + + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + is-async-function@2.1.1: + resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} + engines: {node: '>= 0.4'} + + is-bigint@1.1.0: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} + + is-boolean-object@1.2.2: + resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} + engines: {node: '>= 0.4'} + + is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} + + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} + engines: {node: '>= 0.4'} + + is-date-object@1.1.0: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} + engines: {node: '>= 0.4'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-finalizationregistry@1.1.1: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} + engines: {node: '>= 0.4'} + + is-finite@1.1.0: + resolution: {integrity: sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@2.0.0: + resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} + engines: {node: '>=4'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-generator-function@1.1.2: + resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} + engines: {node: '>= 0.4'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-map@2.0.3: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} + + is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + + is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + + is-number-object@1.1.1: + resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} + engines: {node: '>= 0.4'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-object@0.1.2: + resolution: {integrity: sha512-GkfZZlIZtpkFrqyAXPQSRBMsaHAw+CgoKe2HXAkjd/sfoI9+hS8PT4wg2rJxdQyUKr7N2vHJbg7/jQtE5l5vBQ==} + + is-plain-obj@1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + + is-plain-object@2.0.4: + resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} + engines: {node: '>=0.10.0'} + + is-reference@1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} + engines: {node: '>= 0.4'} + + is-relative@1.0.0: + resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} + engines: {node: '>=0.10.0'} + + is-set@2.0.3: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} + + is-shared-array-buffer@1.0.4: + resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} + engines: {node: '>= 0.4'} + + is-string@1.1.1: + resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} + engines: {node: '>= 0.4'} + + is-symbol@1.1.1: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} + engines: {node: '>= 0.4'} + + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + is-typedarray@1.0.0: + resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} + + is-unc-path@1.0.0: + resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} + engines: {node: '>=0.10.0'} + + is-weakmap@2.0.2: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} + + is-weakref@1.1.1: + resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} + engines: {node: '>= 0.4'} + + is-weakset@2.0.4: + resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} + engines: {node: '>= 0.4'} + + is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} + engines: {node: '>=12.13'} + + is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + + is@0.2.7: + resolution: {integrity: sha512-ajQCouIvkcSnl2iRdK70Jug9mohIHVX9uKpoWnl115ov0R5mzBvRrXxrnHbsA+8AdwCwc/sfw7HXmd4I5EJBdQ==} + + isarray@0.0.1: + resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} + + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + isobject@3.0.1: + resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} + engines: {node: '>=0.10.0'} + + isstream@0.1.2: + resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} + + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} + engines: {node: '>=8'} + + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + + jackspeak@4.1.1: + resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} + engines: {node: 20 || >=22} + + jest-diff@30.1.2: + resolution: {integrity: sha512-4+prq+9J61mOVXCa4Qp8ZjavdxzrWQXrI80GNxP8f4tkI2syPuPrJgdRPZRrfUTRvIoUwcmNLbqEJy9W800+NQ==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + jest-worker@24.9.0: + resolution: {integrity: sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==} + engines: {node: '>= 6'} + + jest-worker@27.5.1: + resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} + engines: {node: '>= 10.13.0'} + + jit-grunt@0.10.0: + resolution: {integrity: sha512-eT/f4c9wgZ3buXB7X1JY1w6uNtAV0bhrbOGf/mFmBb0CDNLUETJ/VRoydayWOI54tOoam0cz9RooVCn3QY1WoA==} + engines: {node: '>=0.10.0'} + peerDependencies: + grunt: '>=0.4.0' + + js-base64@2.6.4: + resolution: {integrity: sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.13.1: + resolution: {integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==} + hasBin: true + + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} + hasBin: true + + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + hasBin: true + + jsbn@0.1.1: + resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-fixer@1.6.15: + resolution: {integrity: sha512-TuDuZ5KrgyjoCIppdPXBMqiGfota55+odM+j2cQ5rt/XKyKmqGB3Whz1F8SN8+60yYGy/Nu5lbRZ+rx8kBIvBw==} + engines: {node: '>=10'} + + json-parse-better-errors@1.0.2: + resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-schema@0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json-stringify-safe@4.0.0: + resolution: {integrity: sha512-qzEpz1SDUb9xvA+LDOkNgjekdV7tuC7zDQf14sqMBtujh8kVbQhF11VWm4DeR99yFNjVSjTTfKa40c9ZQOtwXA==} + + json-stringify-safe@5.0.1: + resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + + json2csv@5.0.7: + resolution: {integrity: sha512-YRZbUnyaJZLZUJSRi2G/MqahCyRv9n/ds+4oIetjDF3jWQA7AG7iSeKTiZiCNqtMZM7HDyt0e/W6lEnoGEmMGA==} + engines: {node: '>= 10', npm: '>= 6.13.0'} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + hasBin: true + + jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + + jsonfile@6.2.0: + resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} + + jsonparse@1.3.1: + resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} + engines: {'0': node >= 0.2.0} + + jsprim@1.4.2: + resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} + engines: {node: '>=0.6.0'} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + + kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + + less-plugin-autoprefix@1.5.1: + resolution: {integrity: sha512-l++6pbkvw8XSD1soqugslzAaz0/YFrWXgc+PGo/EhLCjRo9zJfda2hFPLBSYrRDl62dTeDbN93Kx+1dvnHnkIw==} + engines: {node: '>=0.4.2'} + + less-plugin-clean-css@1.6.0: + resolution: {integrity: sha512-jwXX6WlXT57OVCXa5oBJBaJq1b4s1BOKeEEoAL2UTeEitogQWfTcBbLT/vow9pl0N0MXV8Mb4KyhTGG0YbEKyQ==} + engines: {node: '>=0.10'} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + liftup@3.0.1: + resolution: {integrity: sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==} + engines: {node: '>=10'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + load-json-file@4.0.0: + resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} + engines: {node: '>=4'} + + loader-runner@4.3.1: + resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} + engines: {node: '>=6.11.5'} + + locate-path@3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.get@4.4.2: + resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + deprecated: This package is deprecated. Use the optional chaining (?.) operator instead. + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lodash.truncate@4.4.2: + resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + + lodash@2.4.1: + resolution: {integrity: sha512-qa6QqjA9jJB4AYw+NpD2GI4dzHL6Mv0hL+By6iIul4Ce0C1refrjZJmcGvWdnLUwl4LIPtvzje3UQfGH+nCEsQ==} + engines: {'0': node, '1': rhino} + + lodash@2.4.2: + resolution: {integrity: sha512-Kak1hi6/hYHGVPmdyiZijoQyz5x2iGVzs6w9GYB/HiXEtylY7tIoYEROMjvM1d9nXJqPOrG2MNPMn01bJ+S0Rw==} + engines: {'0': node, '1': rhino} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + log-symbols@2.2.0: + resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==} + engines: {node: '>=4'} + + log-update@4.0.0: + resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} + engines: {node: '>=10'} + + loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + + lru-cache@11.2.4: + resolution: {integrity: sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==} + engines: {node: 20 || >=22} + + magic-string@0.25.9: + resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} + + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + + make-dir@5.1.0: + resolution: {integrity: sha512-IfpFq6UM39dUNiphpA6uDezNx/AvWyhwfICWPR3t1VspkgkMZrL+Rk1RbN1bx+aeNYwOrqGJgEgV3yotk+ZUVw==} + engines: {node: '>=18'} + + make-iterator@1.0.1: + resolution: {integrity: sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==} + engines: {node: '>=0.10.0'} + + map-cache@0.2.2: + resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} + engines: {node: '>=0.10.0'} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + memorystream@0.3.1: + resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} + engines: {node: '>= 0.10.0'} + + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + mime@1.2.11: + resolution: {integrity: sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw==} + + mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + + minimatch@10.1.1: + resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} + engines: {node: 20 || >=22} + + minimatch@3.0.4: + resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} + + minimatch@3.0.8: + resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} + + mkdirp@0.5.4: + resolution: {integrity: sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==} + deprecated: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) + hasBin: true + + mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + + mocha-teamcity-reporter@3.0.0: + resolution: {integrity: sha512-FyGgmtFfW2nDwEZU3mrjQShAAK/zhGivwY4HCsqoDoyeS8vV8HGdq1Dn2P+SFaIoCeXTQ0Z+5xVRyikYaKrW5w==} + engines: {node: '>=4'} + peerDependencies: + mocha: '>=3.5.0' + + mocha@6.2.3: + resolution: {integrity: sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==} + engines: {node: '>= 6.0.0'} + hasBin: true + + moment-timezone@0.5.5: + resolution: {integrity: sha512-/aaLDQVE4gnDiDIcX2wWgAfBvfmZAz5UEmVkSOL5FIPlVwsDGqvMzp/0N3MttZKUxeofRdnQhB1t7xI0FHLhZw==} + + moment@2.30.1: + resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + + morgan@1.10.1: + resolution: {integrity: sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==} + engines: {node: '>= 0.8.0'} + + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + + ms@2.1.1: + resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + mute-stream@0.0.8: + resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + needle@3.3.1: + resolution: {integrity: sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==} + engines: {node: '>= 4.4.x'} + hasBin: true + + negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + + nice-try@1.0.5: + resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + + node-environment-flags@1.0.5: + resolution: {integrity: sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==} + + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-promise@0.5.14: + resolution: {integrity: sha512-kbd+ABY2XRdByRVHPcBDemymfNL8+msGyKNxG/ziZnh9RjneuuGQl3/CE5UkNWxCInkJS+ztc5B31/t2kIO4Yw==} + + node-releases@2.0.36: + resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} + + node-uuid@1.4.8: + resolution: {integrity: sha512-TkCET/3rr9mUuRp+CpO7qfgT++aAxfDRaalQhwPFzI9BY/2rCDn6OfpZOVggi1AXfTPpfkTrg5f5WQx5G1uLxA==} + deprecated: Use uuid module instead + hasBin: true + + nomnom@1.6.2: + resolution: {integrity: sha512-mscrcqifc/QKP6/afmtoC84/mK6SKcDTDEfKPMSgJKeV5dtshiw5+AF90uwHyAqHkMIYIEcGkSAJnV6+T9PY/g==} + deprecated: Package no longer supported. Contact support@npmjs.com for more info. + + nop@1.0.0: + resolution: {integrity: sha512-XdkOuXGx0DTwlqb0DWTcDqelgU/F3YyZ+PTRaecpDVpkYskcnh3OeUYKfvjcRQ2D1diTIGxi/a3eHVjW5yPupQ==} + + nopt@3.0.6: + resolution: {integrity: sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==} + hasBin: true + + nopt@4.0.3: + resolution: {integrity: sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==} + hasBin: true + + nopt@5.0.0: + resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} + engines: {node: '>=6'} + hasBin: true + + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + + normalize-range@0.1.2: + resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} + engines: {node: '>=0.10.0'} + + npm-run-all@4.1.5: + resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==} + engines: {node: '>= 4'} + hasBin: true + + npm-run-path@1.0.0: + resolution: {integrity: sha512-PrGAi1SLlqNvKN5uGBjIgnrTb8fl0Jz0a3JJmeMcGnIBh7UE9Gc4zsAMlwDajOMg2b1OgP6UPvoLUboTmMZPFA==} + engines: {node: '>=0.10.0'} + + num2fraction@1.2.2: + resolution: {integrity: sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg==} + + number-is-nan@1.0.1: + resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} + engines: {node: '>=0.10.0'} + + oauth-sign@0.3.0: + resolution: {integrity: sha512-Tr31Sh5FnK9YKm7xTUPyDMsNOvMqkVDND0zvK/Wgj7/H9q8mpye0qG2nVzrnsvLhcsX5DtqXD0la0ks6rkPCGQ==} + + oauth-sign@0.9.0: + resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + object-keys@0.2.0: + resolution: {integrity: sha512-XODjdR2pBh/1qrjPcbSeSgEtKbYo7LqYNq64/TPuCf7j9SfDD3i21yatKoIy39yIWNvVM59iutfQQpCv1RfFzA==} + deprecated: Please update to the latest object-keys + + object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + + object.assign@4.1.0: + resolution: {integrity: sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==} + engines: {node: '>= 0.4'} + + object.assign@4.1.7: + resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} + engines: {node: '>= 0.4'} + + object.defaults@1.1.0: + resolution: {integrity: sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==} + engines: {node: '>=0.10.0'} + + object.getownpropertydescriptors@2.1.9: + resolution: {integrity: sha512-mt8YM6XwsTTovI+kdZdHSxoyF2DI59up034orlC9NfweclcWOt7CVascNNLp6U+bjFVCVCIh9PwS76tDM/rH8g==} + engines: {node: '>= 0.4'} + + object.map@1.0.1: + resolution: {integrity: sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==} + engines: {node: '>=0.10.0'} + + object.pick@1.3.0: + resolution: {integrity: sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==} + engines: {node: '>=0.10.0'} + + on-finished@2.3.0: + resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} + engines: {node: '>= 0.8'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + on-headers@1.1.0: + resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==} + engines: {node: '>= 0.8'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + + opn@4.0.2: + resolution: {integrity: sha512-iPBWbPP4OEOzR1xfhpGLDh+ypKBOygunZhM9jBtA7FS5sKjEiMZw0EFb82hnDOmTZX90ZWLoZKUza4cVt8MexA==} + engines: {node: '>=0.10.0'} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + os-homedir@1.0.2: + resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} + engines: {node: '>=0.10.0'} + + os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + + osenv@0.1.5: + resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==} + deprecated: This package is no longer supported. + + own-keys@1.0.1: + resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} + engines: {node: '>= 0.4'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-filepath@1.0.2: + resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} + engines: {node: '>=0.8'} + + parse-json@4.0.0: + resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} + engines: {node: '>=4'} + + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + parse-link-header@0.1.0: + resolution: {integrity: sha512-VZ0pZwX3LRTfpDARULYD2C0fHuQqg7TPSGmPoKEHfBBmBhH7KMG3LV27GkUtjezoixE/CCJNAVnNw54IxkskWg==} + + parse-ms@1.0.1: + resolution: {integrity: sha512-LpH1Cf5EYuVjkBvCDBYvkUPh+iv2bk3FHflxHkpCYT0/FZ1d3N3uJaLiHr4yGuMcFUhv6eAivitTvWZI4B/chg==} + engines: {node: '>=0.10.0'} + + parse-node-version@1.0.1: + resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} + engines: {node: '>= 0.10'} + + parse-passwd@1.0.0: + resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} + engines: {node: '>=0.10.0'} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + path-exists@3.0.0: + resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + engines: {node: '>=4'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@1.0.0: + resolution: {integrity: sha512-T3hWy7tyXlk3QvPFnT+o2tmXRzU4GkitkUWLp/WZ0S/FXd7XMx176tRurgTvHTNMJOQzTcesHNpBqetH86mQ9g==} + engines: {node: '>=0.10.0'} + + path-key@2.0.1: + resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} + engines: {node: '>=4'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-root-regex@0.1.2: + resolution: {integrity: sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==} + engines: {node: '>=0.10.0'} + + path-root@0.1.1: + resolution: {integrity: sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==} + engines: {node: '>=0.10.0'} + + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + + path-scurry@2.0.1: + resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} + engines: {node: 20 || >=22} + + path-type@3.0.0: + resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} + engines: {node: '>=4'} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + + pegjs@0.10.0: + resolution: {integrity: sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==} + engines: {node: '>=0.10'} + hasBin: true + + performance-now@0.2.0: + resolution: {integrity: sha512-YHk5ez1hmMR5LOkb9iJkLKqoBlL7WD5M8ljC75ZfzXriuBIVNuecaXuU7e+hOwyqf24Wxhh7Vxgt7Hnw9288Tg==} + + performance-now@2.1.0: + resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + + phin@2.9.3: + resolution: {integrity: sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + pidtree@0.3.1: + resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==} + engines: {node: '>=0.10'} + hasBin: true + + pify@3.0.0: + resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} + engines: {node: '>=4'} + + pify@5.0.0: + resolution: {integrity: sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==} + engines: {node: '>=10'} + + pinkie-promise@2.0.1: + resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} + engines: {node: '>=0.10.0'} + + pinkie@2.0.4: + resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} + engines: {node: '>=0.10.0'} + + pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + + platform@1.3.6: + resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} + + playwright-core@1.50.1: + resolution: {integrity: sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==} + engines: {node: '>=18'} + hasBin: true + + playwright@1.50.1: + resolution: {integrity: sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==} + engines: {node: '>=18'} + hasBin: true + + plur@1.0.0: + resolution: {integrity: sha512-qSnKBSZeDY8ApxwhfVIwKwF36KVJqb1/9nzYYq3j3vdwocULCXT8f8fQGkiw1Nk9BGfxiDagEe/pwakA+bOBqw==} + engines: {node: '>=0.10.0'} + + portscanner@1.2.0: + resolution: {integrity: sha512-3MCx40XO6ChNJJHw1tTFukQK/M/8FacGZK/vGbnrKpozObrJzembYtfi7ZdA2hkF2Lojg77XhsKUPvF8eHKcDA==} + engines: {node: '>=0.4', npm: '>=1.0.0'} + + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + + postcss-value-parser@3.3.1: + resolution: {integrity: sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==} + + postcss@5.2.18: + resolution: {integrity: sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==} + engines: {node: '>=0.12'} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + + pretty-format@30.0.5: + resolution: {integrity: sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + pretty-ms@2.1.0: + resolution: {integrity: sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==} + engines: {node: '>=0.10.0'} + + progress@2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + + promise@7.3.1: + resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} + + prr@1.0.1: + resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} + + psl@1.15.0: + resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} + + punycode@1.4.1: + resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + q@1.4.1: + resolution: {integrity: sha512-/CdEdaw49VZVmyIDGUQKDDT53c7qBkO6g5CefWz91Ae+l4+cRtcDYwMTXh6me4O8TMldeGHG3N2Bl84V78Ywbg==} + engines: {node: '>=0.6.0', teleport: '>=0.2.0'} + deprecated: |- + You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. + + (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) + + qs@0.6.6: + resolution: {integrity: sha512-kN+yNdAf29Jgp+AYHUmC7X4QdJPR8czuMWLNLc0aRxkQ7tB3vJQEONKKT9ou/rW7EbqVec11srC9q9BiVbcnHA==} + + qs@6.15.0: + resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} + engines: {node: '>=0.6'} + + qs@6.5.3: + resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} + engines: {node: '>=0.6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + + read-glob@3.0.0: + resolution: {integrity: sha512-ywcpIVKwlKbj8vRLq5WbFju9nxDQB7VOL68260bvZPUsekwh43W6ngQ5e8znqQmLHwzEklhFi6YiAzUvlZclLw==} + + read-pkg@3.0.0: + resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} + engines: {node: '>=4'} + + read@1.0.7: + resolution: {integrity: sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==} + engines: {node: '>=0.8'} + + readable-stream@1.0.34: + resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} + + readable-stream@1.1.14: + resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==} + + rechoir@0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + + rechoir@0.7.1: + resolution: {integrity: sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==} + engines: {node: '>= 0.10'} + + rechoir@0.8.0: + resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} + engines: {node: '>= 10.13.0'} + + reflect.getprototypeof@1.0.10: + resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} + engines: {node: '>= 0.4'} + + regexp.prototype.flags@1.5.4: + resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} + engines: {node: '>= 0.4'} + + regexpp@3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} + engines: {node: '>=8'} + + request@2.22.0: + resolution: {integrity: sha512-s05oCBjWuzNi/UbZtvwOnSJ85/lHUdYPriJyFUwdxHKr8VcZHB0wx0eTX8y5hCH3p7OTDi9iQUqMFyDkW6K7EQ==} + engines: {'0': node >= 0.8.0} + deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 + + request@2.88.2: + resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==} + engines: {node: '>= 6'} + deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 + + requestretry@1.9.1: + resolution: {integrity: sha512-DWXDuj4syXribRStpt4qMOSBhDBUarreeoHol9sOdBfDG1BBDwBFfhgxCyDZkdQ+1W9mZm94vwEg8eD3p46tOg==} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + + resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + + resolve-dir@1.0.1: + resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} + engines: {node: '>=0.10.0'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + + resolve@1.22.11: + resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} + engines: {node: '>= 0.4'} + hasBin: true + + restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rollup-plugin-terser@5.3.1: + resolution: {integrity: sha512-1pkwkervMJQGFYvM9nscrUoncPwiKR/K+bHdjv6PFgRo3cgPHoRT83y2Aa3GvINj4539S15t/tpFPb775TDs6w==} + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser + peerDependencies: + rollup: '>=0.66.0 <3' + + rollup-pluginutils@2.8.2: + resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} + + rollup@2.79.2: + resolution: {integrity: sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==} + engines: {node: '>=10.0.0'} + hasBin: true + + run-async@2.4.1: + resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} + engines: {node: '>=0.12.0'} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + rxjs@6.6.7: + resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} + engines: {npm: '>=2.0.0'} + + safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} + engines: {node: '>=0.4'} + + safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safe-push-apply@1.0.0: + resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} + engines: {node: '>= 0.4'} + + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} + engines: {node: '>= 0.4'} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + sauce-tunnel@2.5.0: + resolution: {integrity: sha512-NsE6r9J+nXT9FBcAxA+nZ1JvmoJJqQPTp33J4vTJQFZ4jtFfPoUMH10AXyIhjEFVemK7XP5SF4Uy+q3dKWWQig==} + + saucelabs@1.5.0: + resolution: {integrity: sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==} + + sax@1.4.3: + resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==} + + schema-utils@4.3.3: + resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} + engines: {node: '>= 10.13.0'} + + semver@5.4.1: + resolution: {integrity: sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==} + hasBin: true + + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + engines: {node: '>=10'} + hasBin: true + + send@0.19.0: + resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} + engines: {node: '>= 0.8.0'} + + serialize-javascript@4.0.0: + resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} + + serve-index@1.9.1: + resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} + engines: {node: '>= 0.8.0'} + + serve-static@1.16.2: + resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} + engines: {node: '>= 0.8.0'} + + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + set-function-name@2.0.2: + resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + engines: {node: '>= 0.4'} + + set-proto@1.0.0: + resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} + engines: {node: '>= 0.4'} + + setprototypeof@1.1.0: + resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + shallow-clone@3.0.1: + resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} + engines: {node: '>=8'} + + shebang-command@1.2.0: + resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} + engines: {node: '>=0.10.0'} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@1.0.0: + resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} + engines: {node: '>=0.10.0'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + shell-quote@1.8.3: + resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==} + engines: {node: '>= 0.4'} + + shelljs@0.8.5: + resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} + engines: {node: '>=4'} + hasBin: true + + shx@0.3.4: + resolution: {integrity: sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==} + engines: {node: '>=6'} + hasBin: true + + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + slice-ansi@4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + + sntp@0.2.4: + resolution: {integrity: sha512-bDLrKa/ywz65gCl+LmOiIhteP1bhEsAAzhfMedPoiHP3dyYnAevlaJshdqb9Yu0sRifyP/fRqSt8t+5qGIWlGQ==} + engines: {node: '>=0.8.0'} + deprecated: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. + + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map@0.5.7: + resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} + engines: {node: '>=0.10.0'} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + sourcemap-codec@1.4.8: + resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} + deprecated: Please use @jridgewell/sourcemap-codec instead + + spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + + spdx-license-ids@3.0.22: + resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} + + split@1.0.1: + resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + + sshpk@1.18.0: + resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} + engines: {node: '>=0.10.0'} + hasBin: true + + statuses@1.5.0: + resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} + engines: {node: '>= 0.6'} + + statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + + stop-iteration-iterator@1.1.0: + resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} + engines: {node: '>= 0.4'} + + string-width@2.1.1: + resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} + engines: {node: '>=4'} + + string-width@3.1.0: + resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} + engines: {node: '>=6'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + string.prototype.padend@3.1.6: + resolution: {integrity: sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==} + engines: {node: '>= 0.4'} + + string.prototype.trim@1.2.10: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} + engines: {node: '>= 0.4'} + + string.prototype.trimend@1.0.9: + resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + engines: {node: '>= 0.4'} + + string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + + string_decoder@0.10.31: + resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} + + strip-ansi@3.0.1: + resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} + engines: {node: '>=0.10.0'} + + strip-ansi@4.0.0: + resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} + engines: {node: '>=4'} + + strip-ansi@5.2.0: + resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} + engines: {node: '>=6'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.1.2: + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} + engines: {node: '>=12'} + + strip-bom@3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + supports-color@2.0.0: + resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} + engines: {node: '>=0.8.0'} + + supports-color@3.2.3: + resolution: {integrity: sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==} + engines: {node: '>=0.8.0'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + supports-color@6.0.0: + resolution: {integrity: sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==} + engines: {node: '>=6'} + + supports-color@6.1.0: + resolution: {integrity: sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==} + engines: {node: '>=6'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + table@6.9.0: + resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==} + engines: {node: '>=10.0.0'} + + tapable@2.3.0: + resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + engines: {node: '>=6'} + + terser-webpack-plugin@5.4.0: + resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + + terser@4.8.1: + resolution: {integrity: sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==} + engines: {node: '>=6.0.0'} + hasBin: true + + terser@5.46.0: + resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} + engines: {node: '>=10'} + hasBin: true + + test-exclude@7.0.1: + resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} + engines: {node: '>=18'} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + through2@0.6.5: + resolution: {integrity: sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==} + + through@2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + + time-grunt@1.4.0: + resolution: {integrity: sha512-u8n+ZOcdNDkrqlyN+x1ayHN0X+hMgg3SS191EE5xO03nRVnVpNp3UJSmUBCQCAbe959LqWttMaELNclfmWM+fQ==} + engines: {node: '>=0.10.0'} + + time-zone@0.1.0: + resolution: {integrity: sha512-S5CjtVIkeBTnlsaZP3gjsTb78ClBe74sEcgEoBwAVUKnTRDAGqUtLLIZHMsIyqOWjt9DGQpLMMoD8ZKIfP2ddQ==} + engines: {node: '>=0.10.0'} + + tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + tough-cookie@2.5.0: + resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==} + engines: {node: '>=0.8'} + + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + + tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + + tsutils@3.21.0: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + + tunnel-agent@0.3.0: + resolution: {integrity: sha512-jlGqHGoKzyyjhwv/c9omAgohntThMcGtw8RV/RDLlkbbc08kni/akVxO62N8HaXMVbVsK1NCnpSK3N2xCt22ww==} + + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + + tweetnacl@0.14.5: + resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-detect@4.1.0: + resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} + engines: {node: '>=4'} + + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + + typed-array-byte-length@1.0.3: + resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} + engines: {node: '>= 0.4'} + + typed-array-byte-offset@1.0.4: + resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} + engines: {node: '>= 0.4'} + + typed-array-length@1.0.7: + resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} + engines: {node: '>= 0.4'} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + uikit@2.27.4: + resolution: {integrity: sha512-dylNikIJ8sB6Sd1AP6YETb+R5bIkjTnGeuu/yLhO9elQ4oLu8CIA+u5zCC7a9m7axbDUALy12qr32nvgRyO5HA==} + + unbox-primitive@1.1.0: + resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} + engines: {node: '>= 0.4'} + + unc-path-regex@0.1.2: + resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} + engines: {node: '>=0.10.0'} + + underscore.string@2.3.3: + resolution: {integrity: sha512-hbD5MibthuDAu4yA5wxes5bzFgqd3PpBJuClbRxaNddxfdsz+qf+1kHwrGQFrmchmDHb9iNU+6EHDn8uj0xDJg==} + + underscore.string@3.3.6: + resolution: {integrity: sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==} + + underscore@1.4.4: + resolution: {integrity: sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==} + + undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + + universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + url@0.11.4: + resolution: {integrity: sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==} + engines: {node: '>= 0.4'} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + + uuid@3.4.0: + resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + hasBin: true + + v8-compile-cache@2.4.0: + resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} + + v8-to-istanbul@9.3.0: + resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + engines: {node: '>=10.12.0'} + + v8flags@3.2.0: + resolution: {integrity: sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==} + engines: {node: '>= 0.10'} + + v8flags@4.0.1: + resolution: {integrity: sha512-fcRLaS4H/hrZk9hYwbdRM35D0U8IYMfEClhXxCivOojl+yTRAZH3Zy2sSy6qVCiGbV9YAtPssP6jaChqC9vPCg==} + engines: {node: '>= 10.13.0'} + + validate-glob-opts@1.0.2: + resolution: {integrity: sha512-3PKjRQq/R514lUcG9OEiW0u9f7D4fP09A07kmk1JbNn2tfeQdAHhlT+A4dqERXKu2br2rrxSM3FzagaEeq9w+A==} + + validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + + verror@1.10.0: + resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} + engines: {'0': node >=0.6.0} + + watchpack@2.5.1: + resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} + engines: {node: '>=10.13.0'} + + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + webpack-cli@5.1.4: + resolution: {integrity: sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==} + engines: {node: '>=14.15.0'} + hasBin: true + peerDependencies: + '@webpack-cli/generators': '*' + webpack: 5.x.x + webpack-bundle-analyzer: '*' + webpack-dev-server: '*' + peerDependenciesMeta: + '@webpack-cli/generators': + optional: true + webpack-bundle-analyzer: + optional: true + webpack-dev-server: + optional: true + + webpack-merge@5.10.0: + resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} + engines: {node: '>=10.0.0'} + + webpack-sources@3.3.4: + resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} + engines: {node: '>=10.13.0'} + + webpack@5.105.4: + resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + when@3.7.8: + resolution: {integrity: sha512-5cZ7mecD3eYcMiCH4wtRPA5iFJZ50BJYDfckI5RRpQiktMiYTcn0ccLTZOvcbBume+1304fQztxeNzNS9Gvrnw==} + + which-boxed-primitive@1.1.1: + resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} + engines: {node: '>= 0.4'} + + which-builtin-type@1.2.1: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} + + which-collection@1.0.2: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} + + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + + which-typed-array@1.1.19: + resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} + engines: {node: '>= 0.4'} + + which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + wide-align@1.1.3: + resolution: {integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==} + + wildcard@2.0.1: + resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wrap-ansi@5.1.0: + resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} + engines: {node: '>=6'} + + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + xtend@2.0.6: + resolution: {integrity: sha512-fOZg4ECOlrMl+A6Msr7EIFcON1L26mb4NY5rurSkOex/TWhazOrg6eXD/B0XkuiYcYhQDWLXzQxLMVJ7LXwokg==} + engines: {node: '>=0.4'} + + xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yargs-parser@13.1.2: + resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} + + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs-unparser@1.6.0: + resolution: {integrity: sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==} + engines: {node: '>=6'} + + yargs@13.3.2: + resolution: {integrity: sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==} + + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zen-observable@0.8.15: + resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} + +snapshots: + + '@arrows/array@1.4.1': dependencies: '@arrows/composition': 1.2.2 - dev: true - /@arrows/composition@1.2.2: - resolution: {integrity: sha512-9fh1yHwrx32lundiB3SlZ/VwuStPB4QakPsSLrGJFH6rCXvdrd060ivAZ7/2vlqPnEjBkPRRXOcG1YOu19p2GQ==} - dev: true + '@arrows/composition@1.2.2': {} - /@arrows/dispatch@1.0.3: - resolution: {integrity: sha512-v/HwvrFonitYZM2PmBlAlCqVqxrkIIoiEuy5bQgn0BdfvlL0ooSBzcPzTMrtzY8eYktPyYcHg8fLbSgyybXEqw==} + '@arrows/dispatch@1.0.3': dependencies: '@arrows/composition': 1.2.2 - dev: true - /@arrows/error@1.0.2: - resolution: {integrity: sha512-yvkiv1ay4Z3+Z6oQsUkedsQm5aFdyPpkBUQs8vejazU/RmANABx6bMMcBPPHI4aW43VPQmXFfBzr/4FExwWTEA==} - dev: true + '@arrows/error@1.0.2': {} - /@arrows/multimethod@1.4.1: - resolution: {integrity: sha512-AZnAay0dgPnCJxn3We5uKiB88VL+1ZIF2SjZohLj6vqY2UyvB/sKdDnFP+LZNVsTC5lcnGPmLlRRkAh4sXkXsQ==} + '@arrows/multimethod@1.4.1': dependencies: '@arrows/array': 1.4.1 '@arrows/composition': 1.2.2 '@arrows/error': 1.0.2 fast-deep-equal: 3.1.3 - dev: true - /@babel/code-frame@7.12.11: - resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} + '@babel/code-frame@7.12.11': dependencies: '@babel/highlight': 7.25.9 - dev: true - /@babel/code-frame@7.27.1: - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} - engines: {node: '>=6.9.0'} + '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.28.5 js-tokens: 4.0.0 picocolors: 1.1.1 - dev: true - /@babel/helper-validator-identifier@7.28.5: - resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} - engines: {node: '>=6.9.0'} - dev: true + '@babel/helper-validator-identifier@7.28.5': {} - /@babel/highlight@7.25.9: - resolution: {integrity: sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==} - engines: {node: '>=6.9.0'} + '@babel/highlight@7.25.9': dependencies: '@babel/helper-validator-identifier': 7.28.5 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.1.1 - dev: true - /@babel/runtime@7.28.4: - resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} - engines: {node: '>=6.9.0'} - dev: true + '@babel/runtime@7.28.4': {} - /@bcoe/v8-coverage@1.0.2: - resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} - engines: {node: '>=18'} - dev: true + '@bcoe/v8-coverage@1.0.2': {} - /@discoveryjs/json-ext@0.5.7: - resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} - engines: {node: '>=10.0.0'} - dev: true + '@discoveryjs/json-ext@0.5.7': {} - /@eslint/eslintrc@0.4.3: - resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} - engines: {node: ^10.12.0 || >=12.0.0} + '@eslint/eslintrc@0.4.3': dependencies: ajv: 6.12.6 debug: 4.4.3 @@ -313,134 +3667,77 @@ packages: strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color - dev: true - /@humanwhocodes/config-array@0.5.0: - resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead + '@humanwhocodes/config-array@0.5.0': dependencies: '@humanwhocodes/object-schema': 1.2.1 debug: 4.4.3 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - dev: true - /@humanwhocodes/object-schema@1.2.1: - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} - deprecated: Use @eslint/object-schema instead - dev: true + '@humanwhocodes/object-schema@1.2.1': {} - /@isaacs/balanced-match@4.0.1: - resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} - engines: {node: 20 || >=22} - dev: true + '@isaacs/balanced-match@4.0.1': {} - /@isaacs/brace-expansion@5.0.0: - resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} - engines: {node: 20 || >=22} + '@isaacs/brace-expansion@5.0.0': dependencies: '@isaacs/balanced-match': 4.0.1 - dev: true - /@isaacs/cliui@8.0.2: - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 - string-width-cjs: /string-width@4.2.3 + string-width-cjs: string-width@4.2.3 strip-ansi: 7.1.2 - strip-ansi-cjs: /strip-ansi@6.0.1 + strip-ansi-cjs: strip-ansi@6.0.1 wrap-ansi: 8.1.0 - wrap-ansi-cjs: /wrap-ansi@7.0.0 - dev: true + wrap-ansi-cjs: wrap-ansi@7.0.0 - /@istanbuljs/schema@0.1.3: - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} - dev: true + '@istanbuljs/schema@0.1.3': {} - /@jest/diff-sequences@30.0.1: - resolution: {integrity: sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==} - engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} - dev: true + '@jest/diff-sequences@30.0.1': {} - /@jest/get-type@30.1.0: - resolution: {integrity: sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==} - engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} - dev: true + '@jest/get-type@30.1.0': {} - /@jest/schemas@30.0.5: - resolution: {integrity: sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==} - engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + '@jest/schemas@30.0.5': dependencies: '@sinclair/typebox': 0.34.41 - dev: true - /@jridgewell/gen-mapping@0.3.13: - resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.31 - dev: true - /@jridgewell/resolve-uri@3.1.2: - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - dev: true + '@jridgewell/resolve-uri@3.1.2': {} - /@jridgewell/source-map@0.3.11: - resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} + '@jridgewell/source-map@0.3.11': dependencies: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 - dev: true - /@jridgewell/sourcemap-codec@1.5.5: - resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - dev: true + '@jridgewell/sourcemap-codec@1.5.5': {} - /@jridgewell/trace-mapping@0.3.31: - resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - dev: true - /@nodelib/fs.scandir@2.1.5: - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true - /@nodelib/fs.stat@2.0.5: - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - dev: true + '@nodelib/fs.stat@2.0.5': {} - /@nodelib/fs.walk@1.2.8: - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} + '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - dev: true - /@pkgjs/parseargs@0.11.0: - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} - requiresBuild: true - dev: true + '@pkgjs/parseargs@0.11.0': optional: true - /@rollup/plugin-commonjs@17.1.0(rollup@2.79.2): - resolution: {integrity: sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^2.30.0 + '@rollup/plugin-commonjs@17.1.0(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 3.1.0(rollup@2.79.2) commondir: 1.0.1 @@ -450,22 +3747,13 @@ packages: magic-string: 0.25.9 resolve: 1.22.11 rollup: 2.79.2 - dev: true - /@rollup/plugin-json@4.1.0(rollup@2.79.2): - resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 + '@rollup/plugin-json@4.1.0(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 3.1.0(rollup@2.79.2) rollup: 2.79.2 - dev: true - /@rollup/plugin-node-resolve@11.2.1(rollup@2.79.2): - resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} - engines: {node: '>= 10.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 + '@rollup/plugin-node-resolve@11.2.1(rollup@2.79.2)': dependencies: '@rollup/pluginutils': 3.1.0(rollup@2.79.2) '@types/resolve': 1.17.1 @@ -474,90 +3762,52 @@ packages: is-module: 1.0.0 resolve: 1.22.11 rollup: 2.79.2 - dev: true - /@rollup/pluginutils@3.1.0(rollup@2.79.2): - resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 + '@rollup/pluginutils@3.1.0(rollup@2.79.2)': dependencies: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.3.1 rollup: 2.79.2 - dev: true - /@sinclair/typebox@0.34.41: - resolution: {integrity: sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==} - dev: true + '@sinclair/typebox@0.34.41': {} - /@types/eslint-scope@3.7.7: - resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} + '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.1 '@types/estree': 1.0.8 - dev: true - /@types/eslint@9.6.1: - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@types/eslint@9.6.1': dependencies: '@types/estree': 1.0.8 '@types/json-schema': 7.0.15 - dev: true - /@types/estree@0.0.39: - resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - dev: true + '@types/estree@0.0.39': {} - /@types/estree@1.0.8: - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - dev: true + '@types/estree@1.0.8': {} - /@types/glob@7.2.0: - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + '@types/glob@7.2.0': dependencies: '@types/minimatch': 6.0.0 '@types/node': 18.19.130 - dev: true - /@types/istanbul-lib-coverage@2.0.6: - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} - dev: true + '@types/istanbul-lib-coverage@2.0.6': {} - /@types/json-schema@7.0.15: - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - dev: true + '@types/json-schema@7.0.15': {} - /@types/minimatch@6.0.0: - resolution: {integrity: sha512-zmPitbQ8+6zNutpwgcQuLcsEpn/Cj54Kbn7L5pX0Os5kdWplB7xPgEh/g+SWOB/qmows2gpuCaPyduq8ZZRnxA==} - deprecated: This is a stub types definition. minimatch provides its own type definitions, so you do not need this installed. + '@types/minimatch@6.0.0': dependencies: minimatch: 10.1.1 - dev: true - /@types/node@18.19.130: - resolution: {integrity: sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==} + '@types/node@18.19.130': dependencies: undici-types: 5.26.5 - dev: true - /@types/resolve@1.17.1: - resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} + '@types/resolve@1.17.1': dependencies: '@types/node': 18.19.130 - dev: true - /@typescript-eslint/eslint-plugin@4.33.0(@typescript-eslint/parser@4.33.0)(eslint@7.32.0)(typescript@5.9.3): - resolution: {integrity: sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - '@typescript-eslint/parser': ^4.0.0 - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/eslint-plugin@4.33.0(@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3)': dependencies: '@typescript-eslint/experimental-utils': 4.33.0(eslint@7.32.0)(typescript@5.9.3) '@typescript-eslint/parser': 4.33.0(eslint@7.32.0)(typescript@5.9.3) @@ -569,16 +3819,12 @@ packages: regexpp: 3.2.0 semver: 7.7.3 tsutils: 3.21.0(typescript@5.9.3) + optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: true - /@typescript-eslint/experimental-utils@4.33.0(eslint@7.32.0)(typescript@5.9.3): - resolution: {integrity: sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - eslint: '*' + '@typescript-eslint/experimental-utils@4.33.0(eslint@7.32.0)(typescript@5.9.3)': dependencies: '@types/json-schema': 7.0.15 '@typescript-eslint/scope-manager': 4.33.0 @@ -590,49 +3836,27 @@ packages: transitivePeerDependencies: - supports-color - typescript - dev: true - /@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@5.9.3): - resolution: {integrity: sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@5.9.3)': dependencies: '@typescript-eslint/scope-manager': 4.33.0 '@typescript-eslint/types': 4.33.0 '@typescript-eslint/typescript-estree': 4.33.0(typescript@5.9.3) debug: 4.4.3 eslint: 7.32.0 + optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: true - /@typescript-eslint/scope-manager@4.33.0: - resolution: {integrity: sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==} - engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + '@typescript-eslint/scope-manager@4.33.0': dependencies: '@typescript-eslint/types': 4.33.0 '@typescript-eslint/visitor-keys': 4.33.0 - dev: true - /@typescript-eslint/types@4.33.0: - resolution: {integrity: sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==} - engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} - dev: true + '@typescript-eslint/types@4.33.0': {} - /@typescript-eslint/typescript-estree@4.33.0(typescript@5.9.3): - resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/typescript-estree@4.33.0(typescript@5.9.3)': dependencies: '@typescript-eslint/types': 4.33.0 '@typescript-eslint/visitor-keys': 4.33.0 @@ -641,77 +3865,53 @@ packages: is-glob: 4.0.3 semver: 7.7.3 tsutils: 3.21.0(typescript@5.9.3) + optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: true - /@typescript-eslint/visitor-keys@4.33.0: - resolution: {integrity: sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==} - engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} + '@typescript-eslint/visitor-keys@4.33.0': dependencies: '@typescript-eslint/types': 4.33.0 eslint-visitor-keys: 2.1.0 - dev: true - /@webassemblyjs/ast@1.14.1: - resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} + '@webassemblyjs/ast@1.14.1': dependencies: '@webassemblyjs/helper-numbers': 1.13.2 '@webassemblyjs/helper-wasm-bytecode': 1.13.2 - dev: true - /@webassemblyjs/floating-point-hex-parser@1.13.2: - resolution: {integrity: sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==} - dev: true + '@webassemblyjs/floating-point-hex-parser@1.13.2': {} - /@webassemblyjs/helper-api-error@1.13.2: - resolution: {integrity: sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==} - dev: true + '@webassemblyjs/helper-api-error@1.13.2': {} - /@webassemblyjs/helper-buffer@1.14.1: - resolution: {integrity: sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==} - dev: true + '@webassemblyjs/helper-buffer@1.14.1': {} - /@webassemblyjs/helper-numbers@1.13.2: - resolution: {integrity: sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==} + '@webassemblyjs/helper-numbers@1.13.2': dependencies: '@webassemblyjs/floating-point-hex-parser': 1.13.2 '@webassemblyjs/helper-api-error': 1.13.2 '@xtuc/long': 4.2.2 - dev: true - /@webassemblyjs/helper-wasm-bytecode@1.13.2: - resolution: {integrity: sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==} - dev: true + '@webassemblyjs/helper-wasm-bytecode@1.13.2': {} - /@webassemblyjs/helper-wasm-section@1.14.1: - resolution: {integrity: sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==} + '@webassemblyjs/helper-wasm-section@1.14.1': dependencies: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/helper-buffer': 1.14.1 '@webassemblyjs/helper-wasm-bytecode': 1.13.2 '@webassemblyjs/wasm-gen': 1.14.1 - dev: true - /@webassemblyjs/ieee754@1.13.2: - resolution: {integrity: sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==} + '@webassemblyjs/ieee754@1.13.2': dependencies: '@xtuc/ieee754': 1.2.0 - dev: true - /@webassemblyjs/leb128@1.13.2: - resolution: {integrity: sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==} + '@webassemblyjs/leb128@1.13.2': dependencies: '@xtuc/long': 4.2.2 - dev: true - /@webassemblyjs/utf8@1.13.2: - resolution: {integrity: sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==} - dev: true + '@webassemblyjs/utf8@1.13.2': {} - /@webassemblyjs/wasm-edit@1.14.1: - resolution: {integrity: sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==} + '@webassemblyjs/wasm-edit@1.14.1': dependencies: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/helper-buffer': 1.14.1 @@ -721,29 +3921,23 @@ packages: '@webassemblyjs/wasm-opt': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 '@webassemblyjs/wast-printer': 1.14.1 - dev: true - /@webassemblyjs/wasm-gen@1.14.1: - resolution: {integrity: sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==} + '@webassemblyjs/wasm-gen@1.14.1': dependencies: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/helper-wasm-bytecode': 1.13.2 '@webassemblyjs/ieee754': 1.13.2 '@webassemblyjs/leb128': 1.13.2 '@webassemblyjs/utf8': 1.13.2 - dev: true - /@webassemblyjs/wasm-opt@1.14.1: - resolution: {integrity: sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==} + '@webassemblyjs/wasm-opt@1.14.1': dependencies: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/helper-buffer': 1.14.1 '@webassemblyjs/wasm-gen': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - dev: true - /@webassemblyjs/wasm-parser@1.14.1: - resolution: {integrity: sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==} + '@webassemblyjs/wasm-parser@1.14.1': dependencies: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/helper-api-error': 1.13.2 @@ -751,156 +3945,80 @@ packages: '@webassemblyjs/ieee754': 1.13.2 '@webassemblyjs/leb128': 1.13.2 '@webassemblyjs/utf8': 1.13.2 - dev: true - /@webassemblyjs/wast-printer@1.14.1: - resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + '@webassemblyjs/wast-printer@1.14.1': dependencies: - '@webassemblyjs/ast': 1.14.1 - '@xtuc/long': 4.2.2 - dev: true - - /@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.105.4): - resolution: {integrity: sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==} - engines: {node: '>=14.15.0'} - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x + '@webassemblyjs/ast': 1.14.1 + '@xtuc/long': 4.2.2 + + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.105.4)': dependencies: webpack: 5.105.4(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack@5.105.4) - dev: true - /@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.105.4): - resolution: {integrity: sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==} - engines: {node: '>=14.15.0'} - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.105.4)': dependencies: webpack: 5.105.4(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack@5.105.4) - dev: true - /@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.105.4): - resolution: {integrity: sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==} - engines: {node: '>=14.15.0'} - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - webpack-dev-server: '*' - peerDependenciesMeta: - webpack-dev-server: - optional: true + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.105.4)': dependencies: webpack: 5.105.4(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack@5.105.4) - dev: true - /@xtuc/ieee754@1.2.0: - resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} - dev: true + '@xtuc/ieee754@1.2.0': {} - /@xtuc/long@4.2.2: - resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} - dev: true + '@xtuc/long@4.2.2': {} - /abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - dev: true + abbrev@1.1.1: {} - /accepts@1.3.8: - resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} - engines: {node: '>= 0.6'} + accepts@1.3.8: dependencies: mime-types: 2.1.35 negotiator: 0.6.3 - dev: true - /acorn-import-phases@1.0.4(acorn@8.16.0): - resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} - engines: {node: '>=10.13.0'} - peerDependencies: - acorn: ^8.14.0 + acorn-import-phases@1.0.4(acorn@8.16.0): dependencies: acorn: 8.16.0 - dev: true - /acorn-jsx@5.3.2(acorn@7.4.1): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn-jsx@5.3.2(acorn@7.4.1): dependencies: acorn: 7.4.1 - dev: true - /acorn@7.4.1: - resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true + acorn@7.4.1: {} - /acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true + acorn@8.15.0: {} - /acorn@8.16.0: - resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true + acorn@8.16.0: {} - /agent-base@4.3.0: - resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} - engines: {node: '>= 4.0.0'} + agent-base@4.3.0: dependencies: es6-promisify: 5.0.0 - dev: true - /ajv-formats@2.1.1(ajv@8.17.1): - resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - dependencies: + ajv-formats@2.1.1(ajv@8.17.1): + optionalDependencies: ajv: 8.17.1 - dev: true - /ajv-keywords@5.1.0(ajv@8.17.1): - resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} - peerDependencies: - ajv: ^8.8.2 + ajv-keywords@5.1.0(ajv@8.17.1): dependencies: ajv: 8.17.1 fast-deep-equal: 3.1.3 - dev: true - /ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 fast-json-stable-stringify: 2.1.0 json-schema-traverse: 0.4.1 uri-js: 4.4.1 - dev: true - /ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.1.0 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - dev: true - /all-contributors-cli@6.26.1: - resolution: {integrity: sha512-Ymgo3FJACRBEd1eE653FD1J/+uD0kqpUNYfr9zNC1Qby0LgbhDBzB3EF6uvkAbYpycStkk41J+0oo37Lc02yEw==} - engines: {node: '>=4'} - hasBin: true + all-contributors-cli@6.26.1: dependencies: '@babel/runtime': 7.28.4 async: 3.2.6 @@ -916,134 +4034,68 @@ packages: prettier: 2.8.8 transitivePeerDependencies: - encoding - dev: true - /ansi-colors@3.2.3: - resolution: {integrity: sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==} - engines: {node: '>=6'} - dev: true + ansi-colors@3.2.3: {} - /ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} - dev: true + ansi-colors@4.1.3: {} - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} + ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 - dev: true - /ansi-regex@2.1.1: - resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} - engines: {node: '>=0.10.0'} - dev: true + ansi-regex@2.1.1: {} - /ansi-regex@3.0.1: - resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} - engines: {node: '>=4'} - dev: true + ansi-regex@3.0.1: {} - /ansi-regex@4.1.1: - resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} - engines: {node: '>=6'} - dev: true + ansi-regex@4.1.1: {} - /ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - dev: true + ansi-regex@5.0.1: {} - /ansi-regex@6.2.2: - resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} - engines: {node: '>=12'} - dev: true + ansi-regex@6.2.2: {} - /ansi-styles@2.2.1: - resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} - engines: {node: '>=0.10.0'} - dev: true + ansi-styles@2.2.1: {} - /ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} + ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 - dev: true - /ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 - dev: true - /ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - dev: true + ansi-styles@5.2.0: {} - /ansi-styles@6.2.3: - resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} - engines: {node: '>=12'} - dev: true + ansi-styles@6.2.3: {} - /append-type@1.0.2: - resolution: {integrity: sha512-hac740vT/SAbrFBLgLIWZqVT5PUAcGTWS5UkDDhr+OCizZSw90WKw6sWAEgGaYd2viIblggypMXwpjzHXOvAQg==} - dev: true + append-type@1.0.2: {} - /application-config-path@0.1.1: - resolution: {integrity: sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw==} - dev: true + application-config-path@0.1.1: {} - /application-config@0.1.2: - resolution: {integrity: sha512-Ryjni0MtYYW9Qz2iTIMF5B/4uRJV3dt5f7PYgQ7sjTh3BUf4EvOo83F84Z2//2HP+mUbwRw35/W1jhM5EZhk9Q==} + application-config@0.1.2: dependencies: application-config-path: 0.1.1 mkdirp: 0.5.6 - dev: true - /argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + argparse@1.0.10: dependencies: sprintf-js: 1.0.3 - dev: true - /argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: true + argparse@2.0.1: {} - /array-buffer-byte-length@1.0.2: - resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} - engines: {node: '>= 0.4'} + array-buffer-byte-length@1.0.2: dependencies: call-bound: 1.0.4 is-array-buffer: 3.0.5 - dev: true - /array-each@1.0.1: - resolution: {integrity: sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==} - engines: {node: '>=0.10.0'} - dev: true + array-each@1.0.1: {} - /array-slice@1.1.0: - resolution: {integrity: sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==} - engines: {node: '>=0.10.0'} - dev: true + array-slice@1.1.0: {} - /array-to-sentence@1.1.0: - resolution: {integrity: sha512-YkwkMmPA2+GSGvXj1s9NZ6cc2LBtR+uSeWTy2IGi5MR1Wag4DdrcjTxA/YV/Fw+qKlBeXomneZgThEbm/wvZbw==} - dev: true + array-to-sentence@1.1.0: {} - /array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - dev: true + array-union@2.1.0: {} - /array.prototype.reduce@1.0.8: - resolution: {integrity: sha512-DwuEqgXFBwbmZSRqt3BpQigWNUoqw9Ml2dTWdF3B2zQlQX4OeUE0zyuzX0fX0IbTvjdkZbcBTU3idgpO78qkTw==} - engines: {node: '>= 0.4'} + array.prototype.reduce@1.0.8: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 @@ -1053,11 +4105,8 @@ packages: es-errors: 1.3.0 es-object-atoms: 1.1.1 is-string: 1.1.1 - dev: true - /arraybuffer.prototype.slice@1.0.4: - resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} - engines: {node: '>= 0.4'} + arraybuffer.prototype.slice@1.0.4: dependencies: array-buffer-byte-length: 1.0.2 call-bind: 1.0.8 @@ -1066,78 +4115,43 @@ packages: es-errors: 1.3.0 get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 - dev: true - /asap@2.0.6: - resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} - dev: true + asap@2.0.6: {} - /asn1@0.1.11: - resolution: {integrity: sha512-Fh9zh3G2mZ8qM/kwsiKwL2U2FmXxVsboP4x1mXjnhKHv3SmzaBZoYvxEQJz/YS2gnCgd8xlAVWcZnQyC9qZBsA==} - engines: {node: '>=0.4.9'} - dev: true + asn1@0.1.11: {} - /asn1@0.2.6: - resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} + asn1@0.2.6: dependencies: safer-buffer: 2.1.2 - dev: true - /assert-fs-readfile-option@1.0.1: - resolution: {integrity: sha512-bESFgerRqZpPcFWBW/cXl0l1XQVLPFi80i31S6eYLIzksnNKdTKBlMoC7Dy/FWAj/97XIYhpe2CmVogifnEkMw==} + assert-fs-readfile-option@1.0.1: dependencies: nop: 1.0.0 - dev: true - /assert-plus@0.1.5: - resolution: {integrity: sha512-brU24g7ryhRwGCI2y+1dGQmQXiZF7TtIj583S96y0jjdajIe6wn8BuXyELYhvD22dtIxDQVFk04YTJwwdwOYJw==} - engines: {node: '>=0.8'} - dev: true + assert-plus@0.1.5: {} - /assert-plus@1.0.0: - resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} - engines: {node: '>=0.8'} - dev: true + assert-plus@1.0.0: {} - /assert-valid-glob-opts@1.0.0: - resolution: {integrity: sha512-/mttty5Xh7wE4o7ttKaUpBJl0l04xWe3y6muy1j27gyzSsnceK0AYU9owPtUoL9z8+9hnPxztmuhdFZ7jRoyWw==} + assert-valid-glob-opts@1.0.0: dependencies: glob-option-error: 1.0.0 validate-glob-opts: 1.0.2 - dev: true - /assertion-error@1.1.0: - resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} - dev: true + assertion-error@1.1.0: {} - /astral-regex@2.0.0: - resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} - engines: {node: '>=8'} - dev: true + astral-regex@2.0.0: {} - /async-function@1.0.0: - resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} - engines: {node: '>= 0.4'} - dev: true + async-function@1.0.0: {} - /async@0.2.10: - resolution: {integrity: sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==} - dev: true + async@0.2.10: {} - /async@1.5.2: - resolution: {integrity: sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==} - dev: true + async@1.5.2: {} - /async@3.2.6: - resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} - dev: true + async@3.2.6: {} - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true + asynckit@0.4.0: {} - /autoprefixer@6.7.7: - resolution: {integrity: sha512-WKExI/eSGgGAkWAO+wMVdFObZV7hQen54UpD1kCCTN3tvlL3W1jL4+lPP/M7MwoP7Q4RHzKtO3JQ4HxYEcd+xQ==} + autoprefixer@6.7.7: dependencies: browserslist: 1.7.7 caniuse-db: 1.0.30001760 @@ -1145,64 +4159,37 @@ packages: num2fraction: 1.2.2 postcss: 5.2.18 postcss-value-parser: 3.3.1 - dev: true - /available-typed-arrays@1.0.7: - resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} - engines: {node: '>= 0.4'} + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 - dev: true - /aws-sign2@0.7.0: - resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} - dev: true + aws-sign2@0.7.0: {} - /aws-sign@0.3.0: - resolution: {integrity: sha512-pEMJAknifcXqXqYVXzGPIu8mJvxtJxIdpVpAs8HNS+paT+9srRUDMQn+3hULS7WbLmttcmvgMvnDcFujqXJyPw==} - dev: true + aws-sign@0.3.0: {} - /aws4@1.13.2: - resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} - dev: true + aws4@1.13.2: {} - /balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true + balanced-match@1.0.2: {} - /baseline-browser-mapping@2.10.0: - resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} - engines: {node: '>=6.0.0'} - hasBin: true - dev: true + baseline-browser-mapping@2.10.0: {} - /basic-auth@2.0.1: - resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} - engines: {node: '>= 0.8'} + basic-auth@2.0.1: dependencies: safe-buffer: 5.1.2 - dev: true - /batch@0.6.1: - resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} - dev: true + batch@0.6.1: {} - /bcrypt-pbkdf@1.0.2: - resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} + bcrypt-pbkdf@1.0.2: dependencies: tweetnacl: 0.14.5 - dev: true - /benchmark@2.1.4: - resolution: {integrity: sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==} + benchmark@2.1.4: dependencies: lodash: 4.17.21 platform: 1.3.6 - dev: true - /benny@3.7.1: - resolution: {integrity: sha512-USzYxODdVfOS7JuQq/L0naxB788dWCiUgUTxvN+WLPt/JfcDURNNj8kN/N+uK6PDvuR67/9/55cVKGPleFQINA==} - engines: {node: '>=12'} + benny@3.7.1: dependencies: '@arrows/composition': 1.2.2 '@arrows/dispatch': 1.0.3 @@ -1213,94 +4200,52 @@ packages: json2csv: 5.0.7 kleur: 4.1.5 log-update: 4.0.0 - dev: true - /bl@0.9.5: - resolution: {integrity: sha512-njlCs8XLBIK7LCChTWfzWuIAxkpmmLXcL7/igCofFT1B039Sz0IPnAmosN5QaO22lU4qr8LcUz2ojUlE6pLkRQ==} + bl@0.9.5: dependencies: readable-stream: 1.0.34 - dev: true - /bluebird@1.0.3: - resolution: {integrity: sha512-97HxegERaUQxXTDVTITyt7QuXEapf5uVXPVXKg6UjPvFC3N46KGvg/obSNZQbekkDbZlzxppDdTjAxel7WSXaA==} - dev: true + bluebird@1.0.3: {} - /boom@0.4.2: - resolution: {integrity: sha512-OvfN8y1oAxxphzkl2SnCS+ztV/uVKTATtgLjWYg/7KwcNyf3rzpHxNQJZCKtsZd4+MteKczhWbSjtEX4bGgU9g==} - engines: {node: '>=0.8.0'} - deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). + boom@0.4.2: dependencies: hoek: 0.9.1 - dev: true - /bootstrap-less-port@0.3.0: - resolution: {integrity: sha512-08aP3FZ7QQ0muffrYguACtN06dfkYvPI6yZEmXSZ3T7VfPD0mVT60lcM4pEW0we3W7BTUlhqYHCGTXrUzWbYoA==} - engines: {node: '>=6'} - dev: true + bootstrap-less-port@0.3.0: {} - /brace-expansion@1.1.12: - resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - dev: true - /brace-expansion@2.0.2: - resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} + brace-expansion@2.0.2: dependencies: balanced-match: 1.0.2 - dev: true - /braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} + braces@3.0.3: dependencies: fill-range: 7.1.1 - dev: true - /browser-stdout@1.3.1: - resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - dev: true + browser-stdout@1.3.1: {} - /browserslist@1.7.7: - resolution: {integrity: sha512-qHJblDE2bXVRYzuDetv/wAeHOJyO97+9wxC1cdCtyzgNuSozOyRCiiLaCR1f71AN66lQdVVBipWm63V+a7bPOw==} - deprecated: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. - hasBin: true + browserslist@1.7.7: dependencies: caniuse-db: 1.0.30001760 electron-to-chromium: 1.5.267 - dev: true - /browserslist@4.28.1: - resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true + browserslist@4.28.1: dependencies: baseline-browser-mapping: 2.10.0 caniuse-lite: 1.0.30001777 electron-to-chromium: 1.5.267 node-releases: 2.0.36 update-browserslist-db: 1.2.3(browserslist@4.28.1) - dev: true - /buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - dev: true + buffer-from@1.1.2: {} - /builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - dev: true + builtin-modules@3.3.0: {} - /c8@10.1.3: - resolution: {integrity: sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==} - engines: {node: '>=18'} - hasBin: true - peerDependencies: - monocart-coverage-reports: ^2 - peerDependenciesMeta: - monocart-coverage-reports: - optional: true + c8@10.1.3: dependencies: '@bcoe/v8-coverage': 1.0.2 '@istanbuljs/schema': 0.1.3 @@ -1313,59 +4258,35 @@ packages: v8-to-istanbul: 9.3.0 yargs: 17.7.2 yargs-parser: 21.1.1 - dev: true - /call-bind-apply-helpers@1.0.2: - resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} - engines: {node: '>= 0.4'} + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 function-bind: 1.1.2 - dev: true - /call-bind@1.0.8: - resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} - engines: {node: '>= 0.4'} + call-bind@1.0.8: dependencies: call-bind-apply-helpers: 1.0.2 es-define-property: 1.0.1 get-intrinsic: 1.3.0 set-function-length: 1.2.2 - dev: true - /call-bound@1.0.4: - resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} - engines: {node: '>= 0.4'} + call-bound@1.0.4: dependencies: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - dev: true - /callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - dev: true + callsites@3.1.0: {} - /camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - dev: true + camelcase@5.3.1: {} - /caniuse-db@1.0.30001760: - resolution: {integrity: sha512-pMTtXP7Yb1RXqO9ddJwLOYQ5Mb1R4/vRx7j9v6MlSCf8anENKZHr9SLxS7FqqroeAkmfgMAmtEwt1kh8men/vg==} - dev: true + caniuse-db@1.0.30001760: {} - /caniuse-lite@1.0.30001777: - resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} - dev: true + caniuse-lite@1.0.30001777: {} - /caseless@0.12.0: - resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} - dev: true + caseless@0.12.0: {} - /chai@4.5.0: - resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} - engines: {node: '>=4'} + chai@4.5.0: dependencies: assertion-error: 1.1.0 check-error: 1.0.3 @@ -1374,187 +4295,109 @@ packages: loupe: 2.3.7 pathval: 1.1.1 type-detect: 4.1.0 - dev: true - /chalk@1.1.3: - resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} - engines: {node: '>=0.10.0'} + chalk@1.1.3: dependencies: ansi-styles: 2.2.1 escape-string-regexp: 1.0.5 has-ansi: 2.0.0 strip-ansi: 3.0.1 supports-color: 2.0.0 - dev: true - /chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} + chalk@2.4.2: dependencies: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 - dev: true - /chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - dev: true - /chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - dev: true + chardet@0.7.0: {} - /check-error@1.0.3: - resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + check-error@1.0.3: dependencies: get-func-name: 2.0.2 - dev: true - /chrome-trace-event@1.0.4: - resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} - engines: {node: '>=6.0'} - dev: true + chrome-trace-event@1.0.4: {} - /clean-css@5.3.3: - resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} - engines: {node: '>= 10.0'} + clean-css@5.3.3: dependencies: source-map: 0.6.1 - dev: true - /cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} + cli-cursor@3.1.0: dependencies: restore-cursor: 3.1.0 - dev: true - /cli-width@3.0.0: - resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} - engines: {node: '>= 10'} - dev: true + cli-width@3.0.0: {} - /cliui@5.0.0: - resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} + cliui@5.0.0: dependencies: string-width: 3.1.0 strip-ansi: 5.2.0 wrap-ansi: 5.1.0 - dev: true - /cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + cliui@6.0.0: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 6.2.0 - dev: true - /cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} + cliui@8.0.1: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - dev: true - /clone-deep@4.0.1: - resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} - engines: {node: '>=6'} + clone-deep@4.0.1: dependencies: is-plain-object: 2.0.4 kind-of: 6.0.3 shallow-clone: 3.0.1 - dev: true - /color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + color-convert@1.9.3: dependencies: color-name: 1.1.3 - dev: true - /color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} + color-convert@2.0.1: dependencies: color-name: 1.1.4 - dev: true - /color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: true + color-name@1.1.3: {} - /color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: true + color-name@1.1.4: {} - /colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - dev: true + colorette@2.0.20: {} - /colors@0.5.1: - resolution: {integrity: sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==} - engines: {node: '>=0.1.90'} - dev: true + colors@0.5.1: {} - /colors@1.1.2: - resolution: {integrity: sha512-ENwblkFQpqqia6b++zLD/KUWafYlVY/UNnAp7oz7LY7E924wmpye416wBOmvv/HMWzl8gL1kJlfvId/1Dg176w==} - engines: {node: '>=0.1.90'} - dev: true + colors@1.1.2: {} - /combined-stream@0.0.7: - resolution: {integrity: sha512-qfexlmLp9MyrkajQVyjEDb0Vj+KhRgR/rxLiVhaihlT+ZkX0lReqtH6Ack40CvMDERR4b5eFp3CreskpBs1Pig==} - engines: {node: '>= 0.8'} + combined-stream@0.0.7: dependencies: delayed-stream: 0.0.5 - dev: true - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 - dev: true - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - dev: true + commander@10.0.1: {} - /commander@2.20.3: - resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - dev: true + commander@2.20.3: {} - /commander@6.2.1: - resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==} - engines: {node: '>= 6'} - dev: true + commander@6.2.1: {} - /common-tags@1.8.2: - resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} - engines: {node: '>=4.0.0'} - dev: true + common-tags@1.8.2: {} - /commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - dev: true + commondir@1.0.1: {} - /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: true + concat-map@0.0.1: {} - /connect-livereload@0.5.4: - resolution: {integrity: sha512-3KnRwsWf4VmP01I4hCDQqTc4e2UxOvJIi8i08GiwqX2oymzxNFY7PqjFkwHglYTJ0yzUJkO5yqdPxVaIz3Pbug==} - dev: true + connect-livereload@0.5.4: {} - /connect@3.7.0: - resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} - engines: {node: '>= 0.10.0'} + connect@3.7.0: dependencies: debug: 2.6.9 finalhandler: 1.1.2 @@ -1562,373 +4405,199 @@ packages: utils-merge: 1.0.1 transitivePeerDependencies: - supports-color - dev: true - /convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - dev: true + convert-source-map@2.0.0: {} - /cookie-jar@0.3.0: - resolution: {integrity: sha512-dX1400pzPULr+ZovkIsDEqe7XH8xCAYGT5Dege4Eot44Qs2mS2iJmnh45TxTO5MIsCfrV/JGZVloLhm46AHxNw==} - dev: true + cookie-jar@0.3.0: {} - /copy-anything@3.0.5: - resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} - engines: {node: '>=12.13'} + copy-anything@3.0.5: dependencies: is-what: 4.1.16 - dev: false - /core-util-is@1.0.2: - resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} - dev: true + core-util-is@1.0.2: {} - /core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - dev: true + core-util-is@1.0.3: {} - /cosmiconfig@9.0.0(typescript@5.9.3): - resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} - engines: {node: '>=14'} - peerDependencies: - typescript: '>=4.9.5' - peerDependenciesMeta: - typescript: - optional: true + cosmiconfig@9.0.0(typescript@5.9.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 js-yaml: 4.1.1 parse-json: 5.2.0 + optionalDependencies: typescript: 5.9.3 - dev: true - /cross-env@7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true + cross-env@7.0.3: dependencies: cross-spawn: 7.0.6 - dev: true - /cross-spawn@6.0.6: - resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} - engines: {node: '>=4.8'} + cross-spawn@6.0.6: dependencies: nice-try: 1.0.5 path-key: 2.0.1 semver: 5.7.2 shebang-command: 1.2.0 which: 1.3.1 - dev: true - /cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - dev: true - /cryptiles@0.2.2: - resolution: {integrity: sha512-gvWSbgqP+569DdslUiCelxIv3IYK5Lgmq1UrRnk+s1WxQOQ16j3GPDcjdtgL5Au65DU/xQi6q3xPtf5Kta+3IQ==} - engines: {node: '>=0.8.0'} - deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). + cryptiles@0.2.2: dependencies: boom: 0.4.2 - dev: true - /ctype@0.5.3: - resolution: {integrity: sha512-T6CEkoSV4q50zW3TlTHMbzy1E5+zlnNcY+yb7tWVYlTwPhx9LpnfAkd4wecpWknDyptp4k97LUZeInlf6jdzBg==} - engines: {node: '>= 0.4'} - dev: true + ctype@0.5.3: {} - /dashdash@1.14.1: - resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} - engines: {node: '>=0.10'} + dashdash@1.14.1: dependencies: assert-plus: 1.0.0 - dev: true - /data-view-buffer@1.0.2: - resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} - engines: {node: '>= 0.4'} + data-view-buffer@1.0.2: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-data-view: 1.0.2 - dev: true - /data-view-byte-length@1.0.2: - resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} - engines: {node: '>= 0.4'} + data-view-byte-length@1.0.2: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-data-view: 1.0.2 - dev: true - /data-view-byte-offset@1.0.1: - resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} - engines: {node: '>= 0.4'} + data-view-byte-offset@1.0.1: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-data-view: 1.0.2 - dev: true - /date-time@1.1.0: - resolution: {integrity: sha512-RrxZQ06cdKe7YQ5oqIxs3GMc7W3vXscy7Ds+aZIqmxA59QnVtTiCseA4jbzVUub9xCbo9GuYVZo0OrZLYXnnmw==} - engines: {node: '>=0.10.0'} + date-time@1.1.0: dependencies: time-zone: 0.1.0 - dev: true - /dateformat@4.6.3: - resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} - dev: true + dateformat@4.6.3: {} - /debug@2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + debug@2.6.9: dependencies: ms: 2.0.0 - dev: true - /debug@3.2.6(supports-color@6.0.0): - resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} - deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + debug@3.2.6(supports-color@6.0.0): dependencies: ms: 2.1.1 + optionalDependencies: supports-color: 6.0.0 - dev: true - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + debug@3.2.7: dependencies: ms: 2.1.3 - dev: true - /debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + debug@4.4.3: dependencies: ms: 2.1.3 - dev: true - /decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - dev: true + decamelize@1.2.0: {} - /deep-eql@4.1.4: - resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} - engines: {node: '>=6'} + deep-eql@4.1.4: dependencies: type-detect: 4.1.0 - dev: true - /deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true + deep-is@0.1.4: {} - /deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - dev: true + deepmerge@4.3.1: {} - /define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} + define-data-property@1.1.4: dependencies: es-define-property: 1.0.1 es-errors: 1.3.0 gopd: 1.2.0 - dev: true - /define-properties@1.2.1: - resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} - engines: {node: '>= 0.4'} + define-properties@1.2.1: dependencies: define-data-property: 1.1.4 has-property-descriptors: 1.0.2 object-keys: 1.1.1 - dev: true - /delayed-stream@0.0.5: - resolution: {integrity: sha512-v+7uBd1pqe5YtgPacIIbZ8HuHeLFVNe4mUEyFDXL6KiqzEykjbw+5mXZXpGFgNVasdL4jWKgaKIXrEHiynN1LA==} - engines: {node: '>=0.4.0'} - dev: true + delayed-stream@0.0.5: {} - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true + delayed-stream@1.0.0: {} - /depd@1.1.2: - resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} - engines: {node: '>= 0.6'} - dev: true + depd@1.1.2: {} - /depd@2.0.0: - resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} - engines: {node: '>= 0.8'} - dev: true + depd@2.0.0: {} - /destroy@1.2.0: - resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dev: true + destroy@1.2.0: {} - /detect-file@1.0.0: - resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} - engines: {node: '>=0.10.0'} - dev: true + detect-file@1.0.0: {} - /didyoumean@1.2.2: - resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - dev: true + didyoumean@1.2.2: {} - /diff@3.5.0: - resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} - engines: {node: '>=0.3.1'} - dev: true + diff@3.5.0: {} - /dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 - dev: true - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} + doctrine@3.0.0: dependencies: esutils: 2.0.3 - dev: true - /dunder-proto@1.0.1: - resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} - engines: {node: '>= 0.4'} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 es-errors: 1.3.0 gopd: 1.2.0 - dev: true - /duplexer2@0.0.2: - resolution: {integrity: sha512-+AWBwjGadtksxjOQSFDhPNQbed7icNXApT4+2BNpsXzcCBiInq2H9XW0O8sfHFaPmnQRs7cg/P0fAr2IWQSW0g==} + duplexer2@0.0.2: dependencies: readable-stream: 1.1.14 - dev: true - /eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: true + eastasianwidth@0.2.0: {} - /ecc-jsbn@0.1.2: - resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} + ecc-jsbn@0.1.2: dependencies: jsbn: 0.1.1 safer-buffer: 2.1.2 - dev: true - /ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: true + ee-first@1.1.1: {} - /electron-to-chromium@1.5.267: - resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} - dev: true + electron-to-chromium@1.5.267: {} - /emoji-regex@7.0.3: - resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} - dev: true + emoji-regex@7.0.3: {} - /emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true + emoji-regex@8.0.0: {} - /emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: true + emoji-regex@9.2.2: {} - /encodeurl@1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: true + encodeurl@1.0.2: {} - /encodeurl@2.0.0: - resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} - engines: {node: '>= 0.8'} - dev: true + encodeurl@2.0.0: {} - /enhanced-resolve@5.20.0: - resolution: {integrity: sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==} - engines: {node: '>=10.13.0'} + enhanced-resolve@5.20.0: dependencies: graceful-fs: 4.2.11 tapable: 2.3.0 - dev: true - /enquirer@2.4.1: - resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} - engines: {node: '>=8.6'} + enquirer@2.4.1: dependencies: ansi-colors: 4.1.3 strip-ansi: 6.0.1 - dev: true - /env-paths@2.2.1: - resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} - engines: {node: '>=6'} - dev: true + env-paths@2.2.1: {} - /envinfo@7.21.0: - resolution: {integrity: sha512-Lw7I8Zp5YKHFCXL7+Dz95g4CcbMEpgvqZNNq3AmlT5XAV6CgAAk6gyAMqn2zjw08K9BHfcNuKrMiCPLByGafow==} - engines: {node: '>=4'} - hasBin: true - dev: true + envinfo@7.21.0: {} - /errno@0.1.8: - resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} - hasBin: true - requiresBuild: true + errno@0.1.8: dependencies: prr: 1.0.1 - dev: false optional: true - /error-ex@1.3.4: - resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + error-ex@1.3.4: dependencies: is-arrayish: 0.2.1 - dev: true - /es-abstract@1.24.1: - resolution: {integrity: sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==} - engines: {node: '>= 0.4'} + es-abstract@1.24.1: dependencies: array-buffer-byte-length: 1.0.2 arraybuffer.prototype.slice: 1.0.4 @@ -1984,121 +4653,65 @@ packages: typed-array-length: 1.0.7 unbox-primitive: 1.1.0 which-typed-array: 1.1.19 - dev: true - /es-array-method-boxes-properly@1.0.0: - resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} - dev: true + es-array-method-boxes-properly@1.0.0: {} - /es-define-property@1.0.1: - resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} - engines: {node: '>= 0.4'} - dev: true + es-define-property@1.0.1: {} - /es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - dev: true + es-errors@1.3.0: {} - /es-module-lexer@2.0.0: - resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} - dev: true + es-module-lexer@2.0.0: {} - /es-object-atoms@1.1.1: - resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} - engines: {node: '>= 0.4'} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 - dev: true - /es-set-tostringtag@2.1.0: - resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} - engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: dependencies: es-errors: 1.3.0 get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 - dev: true - /es-to-primitive@1.3.0: - resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} - engines: {node: '>= 0.4'} + es-to-primitive@1.3.0: dependencies: is-callable: 1.2.7 is-date-object: 1.1.0 is-symbol: 1.1.1 - dev: true - /es6-promise@4.2.8: - resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} - dev: true + es6-promise@4.2.8: {} - /es6-promisify@5.0.0: - resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + es6-promisify@5.0.0: dependencies: es6-promise: 4.2.8 - dev: true - /escalade@3.2.0: - resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} - engines: {node: '>=6'} - dev: true + escalade@3.2.0: {} - /escape-html@1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - dev: true + escape-html@1.0.3: {} - /escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - dev: true + escape-string-regexp@1.0.5: {} - /escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - dev: true + escape-string-regexp@4.0.0: {} - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} + eslint-scope@5.1.1: dependencies: esrecurse: 4.3.0 estraverse: 4.3.0 - dev: true - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} + eslint-utils@2.1.0: dependencies: eslint-visitor-keys: 1.3.0 - dev: true - /eslint-utils@3.0.0(eslint@7.32.0): - resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} - engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} - peerDependencies: - eslint: '>=5' + eslint-utils@3.0.0(eslint@7.32.0): dependencies: eslint: 7.32.0 eslint-visitor-keys: 2.1.0 - dev: true - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true + eslint-visitor-keys@1.3.0: {} - /eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} - dev: true + eslint-visitor-keys@2.1.0: {} - /eslint@7.32.0: - resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} - engines: {node: ^10.12.0 || >=12.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. - hasBin: true + eslint@7.32.0: dependencies: '@babel/code-frame': 7.12.11 '@eslint/eslintrc': 0.4.3 @@ -2142,185 +4755,102 @@ packages: v8-compile-cache: 2.4.0 transitivePeerDependencies: - supports-color - dev: true - /espree@7.3.1: - resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} - engines: {node: ^10.12.0 || >=12.0.0} + espree@7.3.1: dependencies: acorn: 7.4.1 acorn-jsx: 5.3.2(acorn@7.4.1) eslint-visitor-keys: 1.3.0 - dev: true - /esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - dev: true + esprima@4.0.1: {} - /esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} - engines: {node: '>=0.10'} + esquery@1.6.0: dependencies: estraverse: 5.3.0 - dev: true - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} + esrecurse@4.3.0: dependencies: estraverse: 5.3.0 - dev: true - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: true + estraverse@4.3.0: {} - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true + estraverse@5.3.0: {} - /estree-walker@0.6.1: - resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} - dev: true + estree-walker@0.6.1: {} - /estree-walker@1.0.1: - resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} - dev: true + estree-walker@1.0.1: {} - /estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true + estree-walker@2.0.2: {} - /esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - dev: true + esutils@2.0.3: {} - /etag@1.8.1: - resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} - engines: {node: '>= 0.6'} - dev: true + etag@1.8.1: {} - /eventemitter2@0.4.14: - resolution: {integrity: sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==} - dev: true + eventemitter2@0.4.14: {} - /events@3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: true + events@3.3.0: {} - /exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} - dev: true + exit@0.1.2: {} - /expand-tilde@2.0.2: - resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} - engines: {node: '>=0.10.0'} + expand-tilde@2.0.2: dependencies: homedir-polyfill: 1.0.3 - dev: true - /extend@3.0.2: - resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - dev: true + extend@3.0.2: {} - /external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} + external-editor@3.1.0: dependencies: chardet: 0.7.0 iconv-lite: 0.4.24 tmp: 0.0.33 - dev: true - /extsprintf@1.3.0: - resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} - engines: {'0': node >=0.6.0} - dev: true + extsprintf@1.3.0: {} - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true + fast-deep-equal@3.1.3: {} - /fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} + fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.8 - dev: true - /fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true + fast-json-stable-stringify@2.1.0: {} - /fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true + fast-levenshtein@2.0.6: {} - /fast-uri@3.1.0: - resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} - dev: true + fast-uri@3.1.0: {} - /fastest-levenshtein@1.0.16: - resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} - engines: {node: '>= 4.9.1'} - dev: true + fastest-levenshtein@1.0.16: {} - /fastq@1.19.1: - resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + fastq@1.19.1: dependencies: reusify: 1.1.0 - dev: true - /fg-lodash@0.0.2: - resolution: {integrity: sha512-3jf21fWKb/qCM+frhdQX6/KT7sn12i5T6K7952/hKpOdK5uzYbZbEwJmWjrgrSzc74iXFtrtbHPD2mMywPkB9A==} + fg-lodash@0.0.2: dependencies: lodash: 2.4.2 underscore.string: 2.3.3 - dev: true - /figures@1.7.0: - resolution: {integrity: sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==} - engines: {node: '>=0.10.0'} + figures@1.7.0: dependencies: escape-string-regexp: 1.0.5 object-assign: 4.1.1 - dev: true - /figures@3.2.0: - resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} - engines: {node: '>=8'} + figures@3.2.0: dependencies: escape-string-regexp: 1.0.5 - dev: true - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 - dev: true - /fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 - dev: true - /finalhandler@1.1.2: - resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} - engines: {node: '>= 0.8'} + finalhandler@1.1.2: dependencies: debug: 2.6.9 encodeurl: 1.0.2 @@ -2331,199 +4861,117 @@ packages: unpipe: 1.0.0 transitivePeerDependencies: - supports-color - dev: true - /find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} - engines: {node: '>=6'} + find-up@3.0.0: dependencies: locate-path: 3.0.0 - dev: true - /find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} + find-up@4.1.0: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 - dev: true - /find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} + find-up@5.0.0: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - dev: true - /findup-sync@4.0.0: - resolution: {integrity: sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==} - engines: {node: '>= 8'} + findup-sync@4.0.0: dependencies: detect-file: 1.0.0 is-glob: 4.0.3 micromatch: 4.0.8 resolve-dir: 1.0.1 - dev: true - /findup-sync@5.0.0: - resolution: {integrity: sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==} - engines: {node: '>= 10.13.0'} + findup-sync@5.0.0: dependencies: detect-file: 1.0.0 is-glob: 4.0.3 micromatch: 4.0.8 resolve-dir: 1.0.1 - dev: true - /fined@1.2.0: - resolution: {integrity: sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==} - engines: {node: '>= 0.10'} + fined@1.2.0: dependencies: expand-tilde: 2.0.2 is-plain-object: 2.0.4 object.defaults: 1.1.0 object.pick: 1.3.0 parse-filepath: 1.0.2 - dev: true - /flagged-respawn@1.0.1: - resolution: {integrity: sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==} - engines: {node: '>= 0.10'} - dev: true + flagged-respawn@1.0.1: {} - /flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + flat-cache@3.2.0: dependencies: flatted: 3.3.3 keyv: 4.5.4 rimraf: 3.0.2 - dev: true - /flat@4.1.1: - resolution: {integrity: sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==} - hasBin: true + flat@4.1.1: dependencies: is-buffer: 2.0.5 - dev: true - /flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} - hasBin: true - dev: true + flat@5.0.2: {} - /flatted@3.3.3: - resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} - dev: true + flatted@3.3.3: {} - /for-each@0.3.5: - resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} - engines: {node: '>= 0.4'} + for-each@0.3.5: dependencies: is-callable: 1.2.7 - dev: true - /for-in@1.0.2: - resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==} - engines: {node: '>=0.10.0'} - dev: true + for-in@1.0.2: {} - /for-own@1.0.0: - resolution: {integrity: sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==} - engines: {node: '>=0.10.0'} + for-own@1.0.0: dependencies: for-in: 1.0.2 - dev: true - /foreach@2.0.6: - resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} - dev: true + foreach@2.0.6: {} - /foreground-child@3.3.1: - resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} - engines: {node: '>=14'} + foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 signal-exit: 4.1.0 - dev: true - /forever-agent@0.5.2: - resolution: {integrity: sha512-PDG5Ef0Dob/JsZUxUltJOhm/Y9mlteAE+46y3M9RBz/Rd3QVENJ75aGRhN56yekTUboaBIkd8KVWX2NjF6+91A==} - dev: true + forever-agent@0.5.2: {} - /forever-agent@0.6.1: - resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} - dev: true + forever-agent@0.6.1: {} - /form-data@0.0.8: - resolution: {integrity: sha512-yzpBIhe8Ll+dYTXjd+4ORxbQktke+abD0dJjedvqsVVayMkb+PgLGatJNLwo95Va75l3YDZ01SrouzyW9bC2Fg==} - engines: {node: '>= 0.6'} + form-data@0.0.8: dependencies: async: 0.2.10 combined-stream: 0.0.7 mime: 1.2.11 - dev: true - /form-data@2.3.3: - resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} - engines: {node: '>= 0.12'} + form-data@2.3.3: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - dev: true - /fresh@0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} - engines: {node: '>= 0.6'} - dev: true + fresh@0.5.2: {} - /fs-extra@10.1.0: - resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} - engines: {node: '>=12'} + fs-extra@10.1.0: dependencies: graceful-fs: 4.2.11 jsonfile: 6.2.0 universalify: 2.0.1 - dev: true - /fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} + fs-extra@8.1.0: dependencies: graceful-fs: 4.2.11 jsonfile: 4.0.0 universalify: 0.1.2 - dev: true - /fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true + fs.realpath@1.0.0: {} - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true + fsevents@2.3.2: optional: true - /fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true + fsevents@2.3.3: optional: true - /function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - dev: true + function-bind@1.1.2: {} - /function.prototype.name@1.1.8: - resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} - engines: {node: '>= 0.4'} + function.prototype.name@1.1.8: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 @@ -2531,33 +4979,18 @@ packages: functions-have-names: 1.2.3 hasown: 2.0.2 is-callable: 1.2.7 - dev: true - /functional-red-black-tree@1.0.1: - resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} - dev: true + functional-red-black-tree@1.0.1: {} - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true + functions-have-names@1.2.3: {} - /generator-function@2.0.1: - resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} - engines: {node: '>= 0.4'} - dev: true + generator-function@2.0.1: {} - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - dev: true + get-caller-file@2.0.5: {} - /get-func-name@2.0.2: - resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} - dev: true + get-func-name@2.0.2: {} - /get-intrinsic@1.3.0: - resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} - engines: {node: '>= 0.4'} + get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 es-define-property: 1.0.1 @@ -2569,38 +5002,25 @@ packages: has-symbols: 1.1.0 hasown: 2.0.2 math-intrinsics: 1.1.0 - dev: true - /get-proto@1.0.1: - resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} - engines: {node: '>= 0.4'} + get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 - dev: true - /get-symbol-description@1.1.0: - resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} - engines: {node: '>= 0.4'} + get-symbol-description@1.1.0: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 get-intrinsic: 1.3.0 - dev: true - /getobject@1.0.2: - resolution: {integrity: sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==} - engines: {node: '>=10'} - dev: true + getobject@1.0.2: {} - /getpass@0.1.7: - resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + getpass@0.1.7: dependencies: assert-plus: 1.0.0 - dev: true - /ghauth@3.0.0: - resolution: {integrity: sha512-Ds/q5leXoYu8e+MUJyI1C2mqcvdQ4iTzoOM2WN/p9sh/Z0r609dPUq7mLNa0CoGeKdmesyUmVJOAJeWxQ3tcag==} + ghauth@3.0.0: dependencies: application-config: 0.1.2 bl: 0.9.5 @@ -2608,15 +5028,10 @@ packages: mkdirp: 0.5.6 read: 1.0.7 xtend: 4.0.2 - dev: true - /git-rev@0.2.1: - resolution: {integrity: sha512-p6OU8kZpeGHYqGpwnSD5/8IIERooiQp0p6On3T7ngcugnjhbmihvgMwCK2iun8ytn7FynsCPN+jRclR29hgOBg==} - dev: true + git-rev@0.2.1: {} - /github-changes@1.1.2: - resolution: {integrity: sha512-S4lzHQHyPSyHm22JjE+Vsyr8/d797NPmYYpBqwfkPj9qHIbSwENoqKngyfGbaVbmPFTeE6QMgDbcX12TWy+fpg==} - hasBin: true + github-changes@1.1.2: dependencies: bluebird: 1.0.3 ghauth: 3.0.0 @@ -2627,24 +5042,17 @@ packages: nomnom: 1.6.2 parse-link-header: 0.1.0 semver: 5.4.1 - dev: true - /github-commit-stream@0.1.0: - resolution: {integrity: sha512-rWmtBtoK/yViLU7VfxXzLCY9aW/cipSGzUz3TE0wNRcHEPxDjI26gFtkRV+lLhJ69cr+MR+NvFUT+MVPZRXLCw==} + github-commit-stream@0.1.0: dependencies: async: 0.2.10 parse-link-header: 0.1.0 request: 2.22.0 through: 2.3.8 - dev: true - /github@0.1.16: - resolution: {integrity: sha512-IVtcAhrb2HsThCNs1MTPuntLk6C1km0Q4A+md/FD/00SgyyJc4+2XsG1UsF2SUM7enumAgP5VKGVqzyyUmuNCw==} - deprecated: '''github'' has been renamed to ''@octokit/rest'' (https://git.io/vNB11)' - dev: true + github@0.1.16: {} - /glob-observable@0.7.0: - resolution: {integrity: sha512-iZAgGTchl2MgZIWmK96BoHv0dFA2iXWBjFTFgIBbcpSdEPJJoXgr2e48GWlxcDOLsb6UHz5NWEPi0+6ysPFE+A==} + glob-observable@0.7.0: dependencies: assert-valid-glob-opts: 1.0.0 fs.realpath: 1.0.0 @@ -2652,26 +5060,16 @@ packages: graceful-fs: 4.2.11 inspect-with-kind: 1.0.5 zen-observable: 0.8.15 - dev: true - /glob-option-error@1.0.0: - resolution: {integrity: sha512-AD7lbWbwF2Ii9gBQsQIOEzwuqP/jsnyvK27/3JDq1kn/JyfDtYI6AWz3ZQwcPuQdHSBcFh+A2yT/SEep27LOGg==} - dev: true + glob-option-error@1.0.0: {} - /glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 - dev: true - /glob-to-regexp@0.4.1: - resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} - dev: true + glob-to-regexp@0.4.1: {} - /glob@10.5.0: - resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} - hasBin: true + glob@10.5.0: dependencies: foreground-child: 3.3.1 jackspeak: 3.4.3 @@ -2679,12 +5077,8 @@ packages: minipass: 7.1.2 package-json-from-dist: 1.0.1 path-scurry: 1.11.1 - dev: true - /glob@11.0.3: - resolution: {integrity: sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==} - engines: {node: 20 || >=22} - hasBin: true + glob@11.0.3: dependencies: foreground-child: 3.3.1 jackspeak: 4.1.1 @@ -2692,11 +5086,8 @@ packages: minipass: 7.1.2 package-json-from-dist: 1.0.1 path-scurry: 2.0.1 - dev: true - /glob@7.1.3: - resolution: {integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==} - deprecated: Glob versions prior to v9 are no longer supported + glob@7.1.3: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2704,11 +5095,8 @@ packages: minimatch: 3.0.4 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true - /glob@7.1.7: - resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} - deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + glob@7.1.7: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2716,11 +5104,8 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true - /glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported + glob@7.2.3: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2728,46 +5113,31 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true - /global-modules@1.0.0: - resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} - engines: {node: '>=0.10.0'} + global-modules@1.0.0: dependencies: global-prefix: 1.0.2 is-windows: 1.0.2 resolve-dir: 1.0.1 - dev: true - /global-prefix@1.0.2: - resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} - engines: {node: '>=0.10.0'} + global-prefix@1.0.2: dependencies: expand-tilde: 2.0.2 homedir-polyfill: 1.0.3 ini: 1.3.8 is-windows: 1.0.2 which: 1.3.1 - dev: true - /globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + globals@13.24.0: dependencies: type-fest: 0.20.2 - dev: true - /globalthis@1.0.4: - resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} - engines: {node: '>= 0.4'} + globalthis@1.0.4: dependencies: define-properties: 1.2.1 gopd: 1.2.0 - dev: true - /globby@10.0.2: - resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==} - engines: {node: '>=8'} + globby@10.0.2: dependencies: '@types/glob': 7.2.0 array-union: 2.1.0 @@ -2777,11 +5147,8 @@ packages: ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 - dev: true - /globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} + globby@11.1.0: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 @@ -2789,61 +5156,36 @@ packages: ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 - dev: true - /gopd@1.2.0: - resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} - engines: {node: '>= 0.4'} - dev: true + gopd@1.2.0: {} - /graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + graceful-fs@4.2.11: {} - /growl@1.10.5: - resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} - engines: {node: '>=4.x'} - dev: true + growl@1.10.5: {} - /grunt-cli@1.4.3: - resolution: {integrity: sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==} - engines: {node: '>=10'} - hasBin: true + grunt-cli@1.4.3: dependencies: grunt-known-options: 2.0.0 interpret: 1.1.0 liftup: 3.0.1 nopt: 4.0.3 v8flags: 3.2.0 - dev: true - /grunt-cli@1.5.0: - resolution: {integrity: sha512-rILKAFoU0dzlf22SUfDtq2R1fosChXXlJM5j7wI6uoW8gwmXDXzbUvirlKZSYCdXl3LXFbR+8xyS+WFo+b6vlA==} - engines: {node: '>=10'} - hasBin: true + grunt-cli@1.5.0: dependencies: grunt-known-options: 2.0.0 interpret: 1.1.0 liftup: 3.0.1 nopt: 5.0.0 v8flags: 4.0.1 - dev: true - /grunt-contrib-clean@1.1.0(grunt@1.6.1): - resolution: {integrity: sha512-tET+TYTd8vCtKeGwbLjoH8+SdI8ngVzGbPr7vlWkewG7mYYHIccd2Ldxq+PK3DyBp5Www3ugdkfsjoNKUl5MTg==} - engines: {node: '>= 0.10.0'} - peerDependencies: - grunt: '>=0.4.5' + grunt-contrib-clean@1.1.0(grunt@1.6.1): dependencies: async: 1.5.2 grunt: 1.6.1 rimraf: 2.7.1 - dev: true - /grunt-contrib-connect@1.0.2(grunt@1.6.1): - resolution: {integrity: sha512-7OPoyfGrpOYzuiRPzGyzWDe/xFcjttXe1ztVSFS8TAVBtpfXeeOV9RiwuyqA4yN1UeOG2Pnpx8s0DcUDAu21Gw==} - engines: {node: '>=0.10.0'} - peerDependencies: - grunt: '>=0.4.0' + grunt-contrib-connect@1.0.2(grunt@1.6.1): dependencies: async: 1.5.2 connect: 3.7.0 @@ -2857,47 +5199,30 @@ packages: serve-static: 1.16.2 transitivePeerDependencies: - supports-color - dev: true - /grunt-eslint@23.0.0(grunt@1.6.1): - resolution: {integrity: sha512-QqHSAiGF08EVD7YlD4OSRWuLRaDvpsRdTptwy9WaxUXE+03mCLVA/lEaR6SHWehF7oUwIqCEjaNONeeeWlB4LQ==} - engines: {node: '>=10'} - peerDependencies: - grunt: '>=1' + grunt-eslint@23.0.0(grunt@1.6.1): dependencies: chalk: 4.1.2 eslint: 7.32.0 grunt: 1.6.1 transitivePeerDependencies: - supports-color - dev: true - /grunt-known-options@2.0.0: - resolution: {integrity: sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==} - engines: {node: '>=0.10.0'} - dev: true + grunt-known-options@2.0.0: {} - /grunt-legacy-log-utils@2.1.0: - resolution: {integrity: sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==} - engines: {node: '>=10'} + grunt-legacy-log-utils@2.1.0: dependencies: chalk: 4.1.2 lodash: 4.17.21 - dev: true - /grunt-legacy-log@3.0.0: - resolution: {integrity: sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==} - engines: {node: '>= 0.10.0'} + grunt-legacy-log@3.0.0: dependencies: colors: 1.1.2 grunt-legacy-log-utils: 2.1.0 hooker: 0.2.3 lodash: 4.17.21 - dev: true - /grunt-legacy-util@2.0.1: - resolution: {integrity: sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==} - engines: {node: '>=10'} + grunt-legacy-util@2.0.1: dependencies: async: 3.2.6 exit: 0.1.2 @@ -2906,13 +5231,8 @@ packages: lodash: 4.17.21 underscore.string: 3.3.6 which: 2.0.2 - dev: true - /grunt-saucelabs@9.0.1(grunt@1.6.1): - resolution: {integrity: sha512-3WD5/RtSp8AyEnmtN5HK1NUkU7o/kBl6rGQILnfg7WHTe0g0uG3LtecWPwTRYrD7kop79WkDfeVQ85WjvwDUZw==} - engines: {node: '>=0.6', npm: '>=1.2.12'} - peerDependencies: - grunt: '>=0.4.1' + grunt-saucelabs@9.0.1(grunt@1.6.1): dependencies: colors: 1.1.2 grunt: 1.6.1 @@ -2923,24 +5243,15 @@ packages: saucelabs: 1.5.0 transitivePeerDependencies: - supports-color - dev: true - /grunt-shell@1.3.1(grunt@1.6.1): - resolution: {integrity: sha512-fqiC5NNNTCKwH3TCbYpNkNUgq1/cEYJp59tedtWv83sGeG0PTmVB7Lbo/m0WQug3MngV6lsYAXvoNflDD1oeQg==} - engines: {node: '>=0.10.0'} - peerDependencies: - grunt: '>=0.4.0' + grunt-shell@1.3.1(grunt@1.6.1): dependencies: chalk: 1.1.3 grunt: 1.6.1 npm-run-path: 1.0.0 object-assign: 4.1.1 - dev: true - /grunt@1.6.1: - resolution: {integrity: sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==} - engines: {node: '>=16'} - hasBin: true + grunt@1.6.1: dependencies: dateformat: 4.6.3 eventemitter2: 0.4.14 @@ -2955,292 +5266,161 @@ packages: js-yaml: 3.14.2 minimatch: 3.0.8 nopt: 3.0.6 - dev: true - /har-schema@2.0.0: - resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} - engines: {node: '>=4'} - dev: true + har-schema@2.0.0: {} - /har-validator@5.1.5: - resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==} - engines: {node: '>=6'} - deprecated: this library is no longer supported + har-validator@5.1.5: dependencies: ajv: 6.12.6 har-schema: 2.0.0 - dev: true - /has-ansi@2.0.0: - resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} - engines: {node: '>=0.10.0'} + has-ansi@2.0.0: dependencies: ansi-regex: 2.1.1 - dev: true - /has-bigints@1.1.0: - resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} - engines: {node: '>= 0.4'} - dev: true + has-bigints@1.1.0: {} - /has-flag@1.0.0: - resolution: {integrity: sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==} - engines: {node: '>=0.10.0'} - dev: true + has-flag@1.0.0: {} - /has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - dev: true + has-flag@3.0.0: {} - /has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - dev: true + has-flag@4.0.0: {} - /has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + has-property-descriptors@1.0.2: dependencies: es-define-property: 1.0.1 - dev: true - /has-proto@1.2.0: - resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} - engines: {node: '>= 0.4'} + has-proto@1.2.0: dependencies: dunder-proto: 1.0.1 - dev: true - /has-symbols@1.1.0: - resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} - engines: {node: '>= 0.4'} - dev: true + has-symbols@1.1.0: {} - /has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 - dev: true - /hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} + hasown@2.0.2: dependencies: function-bind: 1.1.2 - dev: true - /hawk@0.13.1: - resolution: {integrity: sha512-f/1H9bruKJfgLN2KFd+666ILQvJYsJcxaCoIdHaaD2zgl7RUa08/202pGJXhOmQ1kTEdMTSxPnbCsu4l6JARhQ==} - engines: {node: '>=0.8.0'} - deprecated: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. + hawk@0.13.1: dependencies: boom: 0.4.2 cryptiles: 0.2.2 hoek: 0.8.5 sntp: 0.2.4 - dev: true - /he@1.2.0: - resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} - hasBin: true - dev: true + he@1.2.0: {} - /hoek@0.8.5: - resolution: {integrity: sha512-NoKdeYUBOlQ7j9dgvT9BEX90rE6HtDkaMFwR6hfOj26LA2Mwyg5026jOpNBhmNrWIGdPnbBK3sQJI3POwh8wqg==} - engines: {node: '>=0.8.0'} - deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). - dev: true + hoek@0.8.5: {} - /hoek@0.9.1: - resolution: {integrity: sha512-ZZ6eGyzGjyMTmpSPYVECXy9uNfqBR7x5CavhUaLOeD6W0vWK1mp/b7O3f86XE0Mtfo9rZ6Bh3fnuw9Xr8MF9zA==} - engines: {node: '>=0.8.0'} - deprecated: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). - dev: true + hoek@0.9.1: {} - /homedir-polyfill@1.0.3: - resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} - engines: {node: '>=0.10.0'} + homedir-polyfill@1.0.3: dependencies: parse-passwd: 1.0.0 - dev: true - /hooker@0.2.3: - resolution: {integrity: sha512-t+UerCsQviSymAInD01Pw+Dn/usmz1sRO+3Zk1+lx8eg+WKpD2ulcwWqHHL0+aseRBr+3+vIhiG1K1JTwaIcTA==} - dev: true + hooker@0.2.3: {} - /hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: true + hosted-git-info@2.8.9: {} - /html-es6cape@1.0.5: - resolution: {integrity: sha512-pkkhVE3YCMJwWBy/b87xhXaFaceDZECytDvu36/t3dXvU3FaczMjQVX2cugDIBM+gpAKBPSxl4KWctqVJBJi4w==} - dev: true + html-es6cape@1.0.5: {} - /html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - dev: true + html-escaper@2.0.2: {} - /html-template-tag@3.2.0: - resolution: {integrity: sha512-dt/21zLAVPBB3M4j6dCE46LyG8PcHHIUTYiBTIRDw1yg4nGaVbKEVHVsm3BpeJzlSB6n9BrcW6kP4zJE9mS3ew==} + html-template-tag@3.2.0: dependencies: html-es6cape: 1.0.5 - dev: true - /http-errors@1.6.3: - resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} - engines: {node: '>= 0.6'} + http-errors@1.6.3: dependencies: depd: 1.1.2 inherits: 2.0.3 setprototypeof: 1.1.0 statuses: 1.5.0 - dev: true - /http-errors@2.0.0: - resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} - engines: {node: '>= 0.8'} + http-errors@2.0.0: dependencies: depd: 2.0.0 inherits: 2.0.4 setprototypeof: 1.2.0 statuses: 2.0.1 toidentifier: 1.0.1 - dev: true - /http-signature@0.10.1: - resolution: {integrity: sha512-coK8uR5rq2IMj+Hen+sKPA5ldgbCc1/spPdKCL1Fw6h+D0s/2LzMcRK0Cqufs1h0ryx/niwBHGFu8HC3hwU+lA==} - engines: {node: '>=0.8'} + http-signature@0.10.1: dependencies: asn1: 0.1.11 assert-plus: 0.1.5 ctype: 0.5.3 - dev: true - /http-signature@1.2.0: - resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} - engines: {node: '>=0.8', npm: '>=1.3.7'} + http-signature@1.2.0: dependencies: assert-plus: 1.0.0 jsprim: 1.4.2 sshpk: 1.18.0 - dev: true - /http2@3.3.7: - resolution: {integrity: sha512-puSi8M8WNlFJm9Pk4c/Mbz9Gwparuj3gO9/RRO5zv6piQ0FY+9Qywp0PdWshYgsMJSalixFY7eC6oPu0zRxLAQ==} - engines: {node: '>=0.12.0 <9.0.0'} - deprecated: Use the built-in module in node 9.0.0 or newer, instead - dev: true + http2@3.3.7: {} - /https-proxy-agent@2.2.4: - resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} - engines: {node: '>= 4.5.0'} + https-proxy-agent@2.2.4: dependencies: agent-base: 4.3.0 debug: 3.2.7 transitivePeerDependencies: - supports-color - dev: true - /husky@9.1.7: - resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} - engines: {node: '>=18'} - hasBin: true - dev: true + husky@9.1.7: {} - /hyperquest@1.2.0: - resolution: {integrity: sha512-N6QwIYr/ENmsE3+0aNA/x8M+jHF0wedvc9ZiGAhg7KK6TxwtJTSR95b0invqaLFPqUrsngYUrc4LVmLtrl7kvw==} + hyperquest@1.2.0: dependencies: duplexer2: 0.0.2 through2: 0.6.5 - dev: true - /iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} + iconv-lite@0.4.24: dependencies: safer-buffer: 2.1.2 - dev: true - /iconv-lite@0.6.3: - resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} - engines: {node: '>=0.10.0'} + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 - /ignore@4.0.6: - resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} - engines: {node: '>= 4'} - dev: true + ignore@4.0.6: {} - /ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - dev: true + ignore@5.3.2: {} - /image-size@0.5.5: - resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} - engines: {node: '>=0.10.0'} - hasBin: true - requiresBuild: true - dev: false + image-size@0.5.5: optional: true - /import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} + import-fresh@3.3.1: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 - dev: true - /import-local@3.2.0: - resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} - engines: {node: '>=8'} - hasBin: true + import-local@3.2.0: dependencies: pkg-dir: 4.2.0 resolve-cwd: 3.0.0 - dev: true - /imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - dev: true + imurmurhash@0.1.4: {} - /indexed-filter@1.0.3: - resolution: {integrity: sha512-oBIzs6EARNMzrLgVg20fK52H19WcRHBiukiiEkw9rnnI//8rinEBMLrYdwEfJ9d4K7bjV1L6nSGft6H/qzHNgQ==} + indexed-filter@1.0.3: dependencies: append-type: 1.0.2 - dev: true - /indexof@0.0.1: - resolution: {integrity: sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==} - dev: true + indexof@0.0.1: {} - /inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + inflight@1.0.6: dependencies: once: 1.4.0 wrappy: 1.0.2 - dev: true - /inherits@2.0.3: - resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} - dev: true + inherits@2.0.3: {} - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true + inherits@2.0.4: {} - /ini@1.3.8: - resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - dev: true + ini@1.3.8: {} - /inquirer@7.3.3: - resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==} - engines: {node: '>=8.0.0'} + inquirer@7.3.3: dependencies: ansi-escapes: 4.3.2 chalk: 4.1.2 @@ -3255,566 +5435,323 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 through: 2.3.8 - dev: true - /inspect-with-kind@1.0.5: - resolution: {integrity: sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==} + inspect-with-kind@1.0.5: dependencies: kind-of: 6.0.3 - dev: true - /internal-slot@1.1.0: - resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} - engines: {node: '>= 0.4'} + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 hasown: 2.0.2 side-channel: 1.1.0 - dev: true - /interpret@1.1.0: - resolution: {integrity: sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==} - dev: true + interpret@1.1.0: {} - /interpret@1.4.0: - resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} - engines: {node: '>= 0.10'} - dev: true + interpret@1.4.0: {} - /interpret@3.1.1: - resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} - engines: {node: '>=10.13.0'} - dev: true + interpret@3.1.1: {} - /is-absolute@1.0.0: - resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} - engines: {node: '>=0.10.0'} + is-absolute@1.0.0: dependencies: is-relative: 1.0.0 is-windows: 1.0.2 - dev: true - /is-array-buffer@3.0.5: - resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} - engines: {node: '>= 0.4'} + is-array-buffer@3.0.5: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 get-intrinsic: 1.3.0 - dev: true - /is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - dev: true + is-arrayish@0.2.1: {} - /is-async-function@2.1.1: - resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} - engines: {node: '>= 0.4'} + is-async-function@2.1.1: dependencies: async-function: 1.0.0 call-bound: 1.0.4 get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 - dev: true - /is-bigint@1.1.0: - resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} - engines: {node: '>= 0.4'} + is-bigint@1.1.0: dependencies: has-bigints: 1.1.0 - dev: true - /is-boolean-object@1.2.2: - resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} - engines: {node: '>= 0.4'} + is-boolean-object@1.2.2: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 - dev: true - /is-buffer@2.0.5: - resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} - engines: {node: '>=4'} - dev: true + is-buffer@2.0.5: {} - /is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: true + is-callable@1.2.7: {} - /is-core-module@2.16.1: - resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} - engines: {node: '>= 0.4'} + is-core-module@2.16.1: dependencies: hasown: 2.0.2 - dev: true - /is-data-view@1.0.2: - resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} - engines: {node: '>= 0.4'} + is-data-view@1.0.2: dependencies: call-bound: 1.0.4 get-intrinsic: 1.3.0 is-typed-array: 1.1.15 - dev: true - /is-date-object@1.1.0: - resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} - engines: {node: '>= 0.4'} + is-date-object@1.1.0: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 - dev: true - /is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - dev: true + is-extglob@2.1.1: {} - /is-finalizationregistry@1.1.1: - resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} - engines: {node: '>= 0.4'} + is-finalizationregistry@1.1.1: dependencies: call-bound: 1.0.4 - dev: true - /is-finite@1.1.0: - resolution: {integrity: sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==} - engines: {node: '>=0.10.0'} - dev: true + is-finite@1.1.0: {} - /is-fullwidth-code-point@2.0.0: - resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} - engines: {node: '>=4'} - dev: true + is-fullwidth-code-point@2.0.0: {} - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - dev: true + is-fullwidth-code-point@3.0.0: {} - /is-generator-function@1.1.2: - resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} - engines: {node: '>= 0.4'} + is-generator-function@1.1.2: dependencies: call-bound: 1.0.4 generator-function: 2.0.1 get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 - dev: true - /is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 - dev: true - /is-map@2.0.3: - resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} - engines: {node: '>= 0.4'} - dev: true + is-map@2.0.3: {} - /is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - dev: true + is-module@1.0.0: {} - /is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} - engines: {node: '>= 0.4'} - dev: true + is-negative-zero@2.0.3: {} - /is-number-object@1.1.1: - resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} - engines: {node: '>= 0.4'} + is-number-object@1.1.1: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 - dev: true - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - dev: true + is-number@7.0.0: {} - /is-object@0.1.2: - resolution: {integrity: sha512-GkfZZlIZtpkFrqyAXPQSRBMsaHAw+CgoKe2HXAkjd/sfoI9+hS8PT4wg2rJxdQyUKr7N2vHJbg7/jQtE5l5vBQ==} - dev: true + is-object@0.1.2: {} - /is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - dev: true + is-plain-obj@1.1.0: {} - /is-plain-object@2.0.4: - resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} - engines: {node: '>=0.10.0'} + is-plain-object@2.0.4: dependencies: isobject: 3.0.1 - dev: true - /is-reference@1.2.1: - resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + is-reference@1.2.1: dependencies: '@types/estree': 1.0.8 - dev: true - /is-regex@1.2.1: - resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} - engines: {node: '>= 0.4'} + is-regex@1.2.1: dependencies: call-bound: 1.0.4 gopd: 1.2.0 has-tostringtag: 1.0.2 hasown: 2.0.2 - dev: true - /is-relative@1.0.0: - resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} - engines: {node: '>=0.10.0'} + is-relative@1.0.0: dependencies: is-unc-path: 1.0.0 - dev: true - /is-set@2.0.3: - resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} - engines: {node: '>= 0.4'} - dev: true + is-set@2.0.3: {} - /is-shared-array-buffer@1.0.4: - resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} - engines: {node: '>= 0.4'} + is-shared-array-buffer@1.0.4: dependencies: call-bound: 1.0.4 - dev: true - /is-string@1.1.1: - resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} - engines: {node: '>= 0.4'} + is-string@1.1.1: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 - dev: true - /is-symbol@1.1.1: - resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} - engines: {node: '>= 0.4'} + is-symbol@1.1.1: dependencies: call-bound: 1.0.4 has-symbols: 1.1.0 safe-regex-test: 1.1.0 - dev: true - /is-typed-array@1.1.15: - resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} - engines: {node: '>= 0.4'} + is-typed-array@1.1.15: dependencies: which-typed-array: 1.1.19 - dev: true - /is-typedarray@1.0.0: - resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} - dev: true + is-typedarray@1.0.0: {} - /is-unc-path@1.0.0: - resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} - engines: {node: '>=0.10.0'} + is-unc-path@1.0.0: dependencies: unc-path-regex: 0.1.2 - dev: true - /is-weakmap@2.0.2: - resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} - engines: {node: '>= 0.4'} - dev: true + is-weakmap@2.0.2: {} - /is-weakref@1.1.1: - resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} - engines: {node: '>= 0.4'} + is-weakref@1.1.1: dependencies: call-bound: 1.0.4 - dev: true - /is-weakset@2.0.4: - resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} - engines: {node: '>= 0.4'} + is-weakset@2.0.4: dependencies: call-bound: 1.0.4 get-intrinsic: 1.3.0 - dev: true - /is-what@4.1.16: - resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} - engines: {node: '>=12.13'} - dev: false + is-what@4.1.16: {} - /is-windows@1.0.2: - resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} - engines: {node: '>=0.10.0'} - dev: true + is-windows@1.0.2: {} - /is@0.2.7: - resolution: {integrity: sha512-ajQCouIvkcSnl2iRdK70Jug9mohIHVX9uKpoWnl115ov0R5mzBvRrXxrnHbsA+8AdwCwc/sfw7HXmd4I5EJBdQ==} - dev: true + is@0.2.7: {} - /isarray@0.0.1: - resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} - dev: true + isarray@0.0.1: {} - /isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - dev: true + isarray@2.0.5: {} - /isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true + isexe@2.0.0: {} - /isobject@3.0.1: - resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} - engines: {node: '>=0.10.0'} - dev: true + isobject@3.0.1: {} - /isstream@0.1.2: - resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} - dev: true + isstream@0.1.2: {} - /istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} - dev: true + istanbul-lib-coverage@3.2.2: {} - /istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} + istanbul-lib-report@3.0.1: dependencies: istanbul-lib-coverage: 3.2.2 make-dir: 4.0.0 supports-color: 7.2.0 - dev: true - /istanbul-reports@3.2.0: - resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} - engines: {node: '>=8'} + istanbul-reports@3.2.0: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - dev: true - /jackspeak@3.4.3: - resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: '@pkgjs/parseargs': 0.11.0 - dev: true - /jackspeak@4.1.1: - resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} - engines: {node: 20 || >=22} + jackspeak@4.1.1: dependencies: '@isaacs/cliui': 8.0.2 - dev: true - /jest-diff@30.1.2: - resolution: {integrity: sha512-4+prq+9J61mOVXCa4Qp8ZjavdxzrWQXrI80GNxP8f4tkI2syPuPrJgdRPZRrfUTRvIoUwcmNLbqEJy9W800+NQ==} - engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + jest-diff@30.1.2: dependencies: '@jest/diff-sequences': 30.0.1 '@jest/get-type': 30.1.0 chalk: 4.1.2 pretty-format: 30.0.5 - dev: true - /jest-worker@24.9.0: - resolution: {integrity: sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==} - engines: {node: '>= 6'} + jest-worker@24.9.0: dependencies: merge-stream: 2.0.0 supports-color: 6.1.0 - dev: true - /jest-worker@27.5.1: - resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} - engines: {node: '>= 10.13.0'} + jest-worker@27.5.1: dependencies: '@types/node': 18.19.130 merge-stream: 2.0.0 supports-color: 8.1.1 - dev: true - /jit-grunt@0.10.0(grunt@1.6.1): - resolution: {integrity: sha512-eT/f4c9wgZ3buXB7X1JY1w6uNtAV0bhrbOGf/mFmBb0CDNLUETJ/VRoydayWOI54tOoam0cz9RooVCn3QY1WoA==} - engines: {node: '>=0.10.0'} - peerDependencies: - grunt: '>=0.4.0' + jit-grunt@0.10.0(grunt@1.6.1): dependencies: grunt: 1.6.1 - dev: true - /js-base64@2.6.4: - resolution: {integrity: sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==} - dev: true + js-base64@2.6.4: {} - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true + js-tokens@4.0.0: {} - /js-yaml@3.13.1: - resolution: {integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==} - hasBin: true + js-yaml@3.13.1: dependencies: argparse: 1.0.10 esprima: 4.0.1 - dev: true - /js-yaml@3.14.2: - resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} - hasBin: true + js-yaml@3.14.2: dependencies: argparse: 1.0.10 esprima: 4.0.1 - dev: true - /js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} - hasBin: true + js-yaml@4.1.1: dependencies: argparse: 2.0.1 - dev: true - /jsbn@0.1.1: - resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} - dev: true + jsbn@0.1.1: {} - /json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - dev: true + json-buffer@3.0.1: {} - /json-fixer@1.6.15: - resolution: {integrity: sha512-TuDuZ5KrgyjoCIppdPXBMqiGfota55+odM+j2cQ5rt/XKyKmqGB3Whz1F8SN8+60yYGy/Nu5lbRZ+rx8kBIvBw==} - engines: {node: '>=10'} + json-fixer@1.6.15: dependencies: '@babel/runtime': 7.28.4 chalk: 4.1.2 pegjs: 0.10.0 - dev: true - /json-parse-better-errors@1.0.2: - resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} - dev: true + json-parse-better-errors@1.0.2: {} - /json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - dev: true + json-parse-even-better-errors@2.3.1: {} - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true + json-schema-traverse@0.4.1: {} - /json-schema-traverse@1.0.0: - resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - dev: true + json-schema-traverse@1.0.0: {} - /json-schema@0.4.0: - resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} - dev: true + json-schema@0.4.0: {} - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true + json-stable-stringify-without-jsonify@1.0.1: {} - /json-stringify-safe@4.0.0: - resolution: {integrity: sha512-qzEpz1SDUb9xvA+LDOkNgjekdV7tuC7zDQf14sqMBtujh8kVbQhF11VWm4DeR99yFNjVSjTTfKa40c9ZQOtwXA==} - dev: true + json-stringify-safe@4.0.0: {} - /json-stringify-safe@5.0.1: - resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} - dev: true + json-stringify-safe@5.0.1: {} - /json2csv@5.0.7: - resolution: {integrity: sha512-YRZbUnyaJZLZUJSRi2G/MqahCyRv9n/ds+4oIetjDF3jWQA7AG7iSeKTiZiCNqtMZM7HDyt0e/W6lEnoGEmMGA==} - engines: {node: '>= 10', npm: '>= 6.13.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - hasBin: true + json2csv@5.0.7: dependencies: commander: 6.2.1 jsonparse: 1.3.1 lodash.get: 4.4.2 - dev: true - /jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + jsonfile@4.0.0: optionalDependencies: graceful-fs: 4.2.11 - dev: true - /jsonfile@6.2.0: - resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} + jsonfile@6.2.0: dependencies: universalify: 2.0.1 optionalDependencies: graceful-fs: 4.2.11 - dev: true - /jsonparse@1.3.1: - resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} - engines: {'0': node >= 0.2.0} - dev: true + jsonparse@1.3.1: {} - /jsprim@1.4.2: - resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} - engines: {node: '>=0.6.0'} + jsprim@1.4.2: dependencies: assert-plus: 1.0.0 extsprintf: 1.3.0 json-schema: 0.4.0 verror: 1.10.0 - dev: true - /keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + keyv@4.5.4: dependencies: json-buffer: 3.0.1 - dev: true - /kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - dev: true + kind-of@6.0.3: {} - /kleur@4.1.5: - resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} - engines: {node: '>=6'} - dev: true + kleur@4.1.5: {} - /less-plugin-autoprefix@1.5.1: - resolution: {integrity: sha512-l++6pbkvw8XSD1soqugslzAaz0/YFrWXgc+PGo/EhLCjRo9zJfda2hFPLBSYrRDl62dTeDbN93Kx+1dvnHnkIw==} - engines: {node: '>=0.4.2'} + less-plugin-autoprefix@1.5.1: dependencies: autoprefixer: 6.7.7 postcss: 5.2.18 - dev: true - /less-plugin-clean-css@1.6.0: - resolution: {integrity: sha512-jwXX6WlXT57OVCXa5oBJBaJq1b4s1BOKeEEoAL2UTeEitogQWfTcBbLT/vow9pl0N0MXV8Mb4KyhTGG0YbEKyQ==} - engines: {node: '>=0.10'} + less-plugin-clean-css@1.6.0: dependencies: clean-css: 5.3.3 - dev: true - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} + levn@0.4.1: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true - /liftup@3.0.1: - resolution: {integrity: sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==} - engines: {node: '>=10'} + liftup@3.0.1: dependencies: extend: 3.0.2 findup-sync: 4.0.0 @@ -3824,265 +5761,141 @@ packages: object.map: 1.0.1 rechoir: 0.7.1 resolve: 1.22.11 - dev: true - /lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: true + lines-and-columns@1.2.4: {} - /load-json-file@4.0.0: - resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} - engines: {node: '>=4'} + load-json-file@4.0.0: dependencies: graceful-fs: 4.2.11 parse-json: 4.0.0 pify: 3.0.0 strip-bom: 3.0.0 - dev: true - /loader-runner@4.3.1: - resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} - engines: {node: '>=6.11.5'} - dev: true + loader-runner@4.3.1: {} - /locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} - engines: {node: '>=6'} + locate-path@3.0.0: dependencies: p-locate: 3.0.0 path-exists: 3.0.0 - dev: true - /locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 - dev: true - /locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} + locate-path@6.0.0: dependencies: p-locate: 5.0.0 - dev: true - /lodash.get@4.4.2: - resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} - deprecated: This package is deprecated. Use the optional chaining (?.) operator instead. - dev: true + lodash.get@4.4.2: {} - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true + lodash.merge@4.6.2: {} - /lodash.truncate@4.4.2: - resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} - dev: true + lodash.truncate@4.4.2: {} - /lodash@2.4.1: - resolution: {integrity: sha512-qa6QqjA9jJB4AYw+NpD2GI4dzHL6Mv0hL+By6iIul4Ce0C1refrjZJmcGvWdnLUwl4LIPtvzje3UQfGH+nCEsQ==} - engines: {'0': node, '1': rhino} - dev: true + lodash@2.4.1: {} - /lodash@2.4.2: - resolution: {integrity: sha512-Kak1hi6/hYHGVPmdyiZijoQyz5x2iGVzs6w9GYB/HiXEtylY7tIoYEROMjvM1d9nXJqPOrG2MNPMn01bJ+S0Rw==} - engines: {'0': node, '1': rhino} - dev: true + lodash@2.4.2: {} - /lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - dev: true + lodash@4.17.21: {} - /log-symbols@2.2.0: - resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==} - engines: {node: '>=4'} + log-symbols@2.2.0: dependencies: chalk: 2.4.2 - dev: true - /log-update@4.0.0: - resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} - engines: {node: '>=10'} + log-update@4.0.0: dependencies: ansi-escapes: 4.3.2 cli-cursor: 3.1.0 slice-ansi: 4.0.0 wrap-ansi: 6.2.0 - dev: true - /loupe@2.3.7: - resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + loupe@2.3.7: dependencies: get-func-name: 2.0.2 - dev: true - /lru-cache@10.4.3: - resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - dev: true + lru-cache@10.4.3: {} - /lru-cache@11.2.4: - resolution: {integrity: sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==} - engines: {node: 20 || >=22} - dev: true + lru-cache@11.2.4: {} - /magic-string@0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} + magic-string@0.25.9: dependencies: sourcemap-codec: 1.4.8 - dev: true - - /make-dir@2.1.0: - resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} - engines: {node: '>=6'} - requiresBuild: true - dependencies: - pify: 4.0.1 - semver: 5.7.2 - dev: false - optional: true - /make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} - engines: {node: '>=10'} + make-dir@4.0.0: dependencies: semver: 7.7.3 - dev: true - /make-iterator@1.0.1: - resolution: {integrity: sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==} - engines: {node: '>=0.10.0'} + make-dir@5.1.0: + optional: true + + make-iterator@1.0.1: dependencies: kind-of: 6.0.3 - dev: true - /map-cache@0.2.2: - resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} - engines: {node: '>=0.10.0'} - dev: true + map-cache@0.2.2: {} - /math-intrinsics@1.1.0: - resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} - engines: {node: '>= 0.4'} - dev: true + math-intrinsics@1.1.0: {} - /memorystream@0.3.1: - resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} - engines: {node: '>= 0.10.0'} - dev: true + memorystream@0.3.1: {} - /merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: true + merge-stream@2.0.0: {} - /merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - dev: true + merge2@1.4.1: {} - /micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} + micromatch@4.0.8: dependencies: braces: 3.0.3 picomatch: 2.3.1 - dev: true - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true + mime-db@1.52.0: {} - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} + mime-types@2.1.35: dependencies: mime-db: 1.52.0 - dev: true - /mime@1.2.11: - resolution: {integrity: sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw==} - dev: true + mime@1.2.11: {} - /mime@1.6.0: - resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} - engines: {node: '>=4'} - hasBin: true + mime@1.6.0: {} - /mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - dev: true + mimic-fn@2.1.0: {} - /minimatch@10.1.1: - resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} - engines: {node: 20 || >=22} + minimatch@10.1.1: dependencies: '@isaacs/brace-expansion': 5.0.0 - dev: true - /minimatch@3.0.4: - resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} + minimatch@3.0.4: dependencies: brace-expansion: 1.1.12 - dev: true - /minimatch@3.0.8: - resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} + minimatch@3.0.8: dependencies: brace-expansion: 1.1.12 - dev: true - /minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.12 - dev: true - /minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} - engines: {node: '>=16 || 14 >=14.17'} + minimatch@9.0.5: dependencies: brace-expansion: 2.0.2 - dev: true - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true + minimist@1.2.8: {} - /minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} - engines: {node: '>=16 || 14 >=14.17'} - dev: true + minipass@7.1.2: {} - /mkdirp@0.5.4: - resolution: {integrity: sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==} - deprecated: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) - hasBin: true + mkdirp@0.5.4: dependencies: minimist: 1.2.8 - dev: true - /mkdirp@0.5.6: - resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true + mkdirp@0.5.6: dependencies: minimist: 1.2.8 - dev: true - /mocha-teamcity-reporter@3.0.0(mocha@6.2.3): - resolution: {integrity: sha512-FyGgmtFfW2nDwEZU3mrjQShAAK/zhGivwY4HCsqoDoyeS8vV8HGdq1Dn2P+SFaIoCeXTQ0Z+5xVRyikYaKrW5w==} - engines: {node: '>=4'} - peerDependencies: - mocha: '>=3.5.0' + mocha-teamcity-reporter@3.0.0(mocha@6.2.3): dependencies: mocha: 6.2.3 - dev: true - /mocha@6.2.3: - resolution: {integrity: sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==} - engines: {node: '>= 6.0.0'} - hasBin: true + mocha@6.2.3: dependencies: ansi-colors: 3.2.3 browser-stdout: 1.3.1 @@ -4107,21 +5920,14 @@ packages: yargs: 13.3.2 yargs-parser: 13.1.2 yargs-unparser: 1.6.0 - dev: true - /moment-timezone@0.5.5: - resolution: {integrity: sha512-/aaLDQVE4gnDiDIcX2wWgAfBvfmZAz5UEmVkSOL5FIPlVwsDGqvMzp/0N3MttZKUxeofRdnQhB1t7xI0FHLhZw==} + moment-timezone@0.5.5: dependencies: moment: 2.30.1 - dev: true - /moment@2.30.1: - resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} - dev: true + moment@2.30.1: {} - /morgan@1.10.1: - resolution: {integrity: sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==} - engines: {node: '>= 0.8.0'} + morgan@1.10.1: dependencies: basic-auth: 2.0.1 debug: 2.6.9 @@ -4130,138 +5936,74 @@ packages: on-headers: 1.1.0 transitivePeerDependencies: - supports-color - dev: true - /ms@2.0.0: - resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - dev: true + ms@2.0.0: {} - /ms@2.1.1: - resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==} - dev: true + ms@2.1.1: {} - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true + ms@2.1.3: {} - /mute-stream@0.0.8: - resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} - dev: true + mute-stream@0.0.8: {} - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true + natural-compare@1.4.0: {} - /needle@3.3.1: - resolution: {integrity: sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==} - engines: {node: '>= 4.4.x'} - hasBin: true - requiresBuild: true + needle@3.3.1: dependencies: iconv-lite: 0.6.3 sax: 1.4.3 - dev: false optional: true - /negotiator@0.6.3: - resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} - engines: {node: '>= 0.6'} - dev: true + negotiator@0.6.3: {} - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - dev: true + neo-async@2.6.2: {} - /nice-try@1.0.5: - resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} - dev: true + nice-try@1.0.5: {} - /node-environment-flags@1.0.5: - resolution: {integrity: sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==} + node-environment-flags@1.0.5: dependencies: object.getownpropertydescriptors: 2.1.9 semver: 5.7.2 - dev: true - /node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true + node-fetch@2.7.0: dependencies: whatwg-url: 5.0.0 - dev: true - /node-promise@0.5.14: - resolution: {integrity: sha512-kbd+ABY2XRdByRVHPcBDemymfNL8+msGyKNxG/ziZnh9RjneuuGQl3/CE5UkNWxCInkJS+ztc5B31/t2kIO4Yw==} - dev: true + node-promise@0.5.14: {} - /node-releases@2.0.36: - resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} - dev: true + node-releases@2.0.36: {} - /node-uuid@1.4.8: - resolution: {integrity: sha512-TkCET/3rr9mUuRp+CpO7qfgT++aAxfDRaalQhwPFzI9BY/2rCDn6OfpZOVggi1AXfTPpfkTrg5f5WQx5G1uLxA==} - deprecated: Use uuid module instead - hasBin: true - dev: true + node-uuid@1.4.8: {} - /nomnom@1.6.2: - resolution: {integrity: sha512-mscrcqifc/QKP6/afmtoC84/mK6SKcDTDEfKPMSgJKeV5dtshiw5+AF90uwHyAqHkMIYIEcGkSAJnV6+T9PY/g==} - deprecated: Package no longer supported. Contact support@npmjs.com for more info. + nomnom@1.6.2: dependencies: colors: 0.5.1 underscore: 1.4.4 - dev: true - /nop@1.0.0: - resolution: {integrity: sha512-XdkOuXGx0DTwlqb0DWTcDqelgU/F3YyZ+PTRaecpDVpkYskcnh3OeUYKfvjcRQ2D1diTIGxi/a3eHVjW5yPupQ==} - dev: true + nop@1.0.0: {} - /nopt@3.0.6: - resolution: {integrity: sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==} - hasBin: true + nopt@3.0.6: dependencies: abbrev: 1.1.1 - dev: true - /nopt@4.0.3: - resolution: {integrity: sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==} - hasBin: true + nopt@4.0.3: dependencies: abbrev: 1.1.1 osenv: 0.1.5 - dev: true - /nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true + nopt@5.0.0: dependencies: abbrev: 1.1.1 - dev: true - /normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 resolve: 1.22.11 semver: 5.7.2 validate-npm-package-license: 3.0.4 - dev: true - /normalize-range@0.1.2: - resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} - engines: {node: '>=0.10.0'} - dev: true + normalize-range@0.1.2: {} - /npm-run-all@4.1.5: - resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==} - engines: {node: '>= 4'} - hasBin: true + npm-run-all@4.1.5: dependencies: ansi-styles: 3.2.1 chalk: 2.4.2 @@ -4272,69 +6014,39 @@ packages: read-pkg: 3.0.0 shell-quote: 1.8.3 string.prototype.padend: 3.1.6 - dev: true - /npm-run-path@1.0.0: - resolution: {integrity: sha512-PrGAi1SLlqNvKN5uGBjIgnrTb8fl0Jz0a3JJmeMcGnIBh7UE9Gc4zsAMlwDajOMg2b1OgP6UPvoLUboTmMZPFA==} - engines: {node: '>=0.10.0'} + npm-run-path@1.0.0: dependencies: path-key: 1.0.0 - dev: true - /num2fraction@1.2.2: - resolution: {integrity: sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg==} - dev: true + num2fraction@1.2.2: {} - /number-is-nan@1.0.1: - resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} - engines: {node: '>=0.10.0'} - dev: true + number-is-nan@1.0.1: {} - /oauth-sign@0.3.0: - resolution: {integrity: sha512-Tr31Sh5FnK9YKm7xTUPyDMsNOvMqkVDND0zvK/Wgj7/H9q8mpye0qG2nVzrnsvLhcsX5DtqXD0la0ks6rkPCGQ==} - dev: true + oauth-sign@0.3.0: {} - /oauth-sign@0.9.0: - resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} - dev: true + oauth-sign@0.9.0: {} - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: true + object-assign@4.1.1: {} - /object-inspect@1.13.4: - resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} - engines: {node: '>= 0.4'} - dev: true + object-inspect@1.13.4: {} - /object-keys@0.2.0: - resolution: {integrity: sha512-XODjdR2pBh/1qrjPcbSeSgEtKbYo7LqYNq64/TPuCf7j9SfDD3i21yatKoIy39yIWNvVM59iutfQQpCv1RfFzA==} - deprecated: Please update to the latest object-keys + object-keys@0.2.0: dependencies: foreach: 2.0.6 indexof: 0.0.1 is: 0.2.7 - dev: true - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: true + object-keys@1.1.1: {} - /object.assign@4.1.0: - resolution: {integrity: sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==} - engines: {node: '>= 0.4'} + object.assign@4.1.0: dependencies: define-properties: 1.2.1 function-bind: 1.1.2 has-symbols: 1.1.0 object-keys: 1.1.1 - dev: true - /object.assign@4.1.7: - resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} - engines: {node: '>= 0.4'} + object.assign@4.1.7: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 @@ -4342,21 +6054,15 @@ packages: es-object-atoms: 1.1.1 has-symbols: 1.1.0 object-keys: 1.1.1 - dev: true - /object.defaults@1.1.0: - resolution: {integrity: sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==} - engines: {node: '>=0.10.0'} + object.defaults@1.1.0: dependencies: array-each: 1.0.1 array-slice: 1.1.0 for-own: 1.0.0 isobject: 3.0.1 - dev: true - /object.getownpropertydescriptors@2.1.9: - resolution: {integrity: sha512-mt8YM6XwsTTovI+kdZdHSxoyF2DI59up034orlC9NfweclcWOt7CVascNNLp6U+bjFVCVCIh9PwS76tDM/rH8g==} - engines: {node: '>= 0.4'} + object.getownpropertydescriptors@2.1.9: dependencies: array.prototype.reduce: 1.0.8 call-bind: 1.0.8 @@ -4365,66 +6071,40 @@ packages: es-object-atoms: 1.1.1 gopd: 1.2.0 safe-array-concat: 1.1.3 - dev: true - /object.map@1.0.1: - resolution: {integrity: sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==} - engines: {node: '>=0.10.0'} + object.map@1.0.1: dependencies: for-own: 1.0.0 make-iterator: 1.0.1 - dev: true - /object.pick@1.3.0: - resolution: {integrity: sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==} - engines: {node: '>=0.10.0'} + object.pick@1.3.0: dependencies: isobject: 3.0.1 - dev: true - /on-finished@2.3.0: - resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} - engines: {node: '>= 0.8'} + on-finished@2.3.0: dependencies: ee-first: 1.1.1 - dev: true - /on-finished@2.4.1: - resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} - engines: {node: '>= 0.8'} + on-finished@2.4.1: dependencies: ee-first: 1.1.1 - dev: true - /on-headers@1.1.0: - resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==} - engines: {node: '>= 0.8'} - dev: true + on-headers@1.1.0: {} - /once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + once@1.4.0: dependencies: wrappy: 1.0.2 - dev: true - /onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} + onetime@5.1.2: dependencies: mimic-fn: 2.1.0 - dev: true - /opn@4.0.2: - resolution: {integrity: sha512-iPBWbPP4OEOzR1xfhpGLDh+ypKBOygunZhM9jBtA7FS5sKjEiMZw0EFb82hnDOmTZX90ZWLoZKUza4cVt8MexA==} - engines: {node: '>=0.10.0'} + opn@4.0.2: dependencies: object-assign: 4.1.1 pinkie-promise: 2.0.1 - dev: true - /optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} + optionator@0.9.4: dependencies: deep-is: 0.1.4 fast-levenshtein: 2.0.6 @@ -4432,517 +6112,274 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 word-wrap: 1.2.5 - dev: true - /os-homedir@1.0.2: - resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} - engines: {node: '>=0.10.0'} - dev: true + os-homedir@1.0.2: {} - /os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - dev: true + os-tmpdir@1.0.2: {} - /osenv@0.1.5: - resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==} - deprecated: This package is no longer supported. + osenv@0.1.5: dependencies: os-homedir: 1.0.2 os-tmpdir: 1.0.2 - dev: true - /own-keys@1.0.1: - resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} - engines: {node: '>= 0.4'} + own-keys@1.0.1: dependencies: get-intrinsic: 1.3.0 object-keys: 1.1.1 safe-push-apply: 1.0.0 - dev: true - /p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} + p-limit@2.3.0: dependencies: p-try: 2.2.0 - dev: true - /p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 - dev: true - /p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} - engines: {node: '>=6'} + p-locate@3.0.0: dependencies: p-limit: 2.3.0 - dev: true - /p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} + p-locate@4.1.0: dependencies: p-limit: 2.3.0 - dev: true - /p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} + p-locate@5.0.0: dependencies: p-limit: 3.1.0 - dev: true - /p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - dev: true + p-try@2.2.0: {} - /package-json-from-dist@1.0.1: - resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - dev: true + package-json-from-dist@1.0.1: {} - /parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} + parent-module@1.0.1: dependencies: callsites: 3.1.0 - dev: true - /parse-filepath@1.0.2: - resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} - engines: {node: '>=0.8'} + parse-filepath@1.0.2: dependencies: is-absolute: 1.0.0 map-cache: 0.2.2 path-root: 0.1.1 - dev: true - /parse-json@4.0.0: - resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} - engines: {node: '>=4'} + parse-json@4.0.0: dependencies: error-ex: 1.3.4 json-parse-better-errors: 1.0.2 - dev: true - /parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} + parse-json@5.2.0: dependencies: '@babel/code-frame': 7.27.1 error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - dev: true - /parse-link-header@0.1.0: - resolution: {integrity: sha512-VZ0pZwX3LRTfpDARULYD2C0fHuQqg7TPSGmPoKEHfBBmBhH7KMG3LV27GkUtjezoixE/CCJNAVnNw54IxkskWg==} + parse-link-header@0.1.0: dependencies: xtend: 2.0.6 - dev: true - /parse-ms@1.0.1: - resolution: {integrity: sha512-LpH1Cf5EYuVjkBvCDBYvkUPh+iv2bk3FHflxHkpCYT0/FZ1d3N3uJaLiHr4yGuMcFUhv6eAivitTvWZI4B/chg==} - engines: {node: '>=0.10.0'} - dev: true + parse-ms@1.0.1: {} - /parse-node-version@1.0.1: - resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} - engines: {node: '>= 0.10'} - dev: false + parse-node-version@1.0.1: {} - /parse-passwd@1.0.0: - resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} - engines: {node: '>=0.10.0'} - dev: true + parse-passwd@1.0.0: {} - /parseurl@1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - dev: true + parseurl@1.3.3: {} - /path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - dev: true + path-browserify@1.0.1: {} - /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - dev: true + path-exists@3.0.0: {} - /path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: true + path-exists@4.0.0: {} - /path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - dev: true + path-is-absolute@1.0.1: {} - /path-key@1.0.0: - resolution: {integrity: sha512-T3hWy7tyXlk3QvPFnT+o2tmXRzU4GkitkUWLp/WZ0S/FXd7XMx176tRurgTvHTNMJOQzTcesHNpBqetH86mQ9g==} - engines: {node: '>=0.10.0'} - dev: true + path-key@1.0.0: {} - /path-key@2.0.1: - resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} - engines: {node: '>=4'} - dev: true + path-key@2.0.1: {} - /path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - dev: true + path-key@3.1.1: {} - /path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true + path-parse@1.0.7: {} - /path-root-regex@0.1.2: - resolution: {integrity: sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==} - engines: {node: '>=0.10.0'} - dev: true + path-root-regex@0.1.2: {} - /path-root@0.1.1: - resolution: {integrity: sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==} - engines: {node: '>=0.10.0'} + path-root@0.1.1: dependencies: path-root-regex: 0.1.2 - dev: true - /path-scurry@1.11.1: - resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} - engines: {node: '>=16 || 14 >=14.18'} + path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 minipass: 7.1.2 - dev: true - /path-scurry@2.0.1: - resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} - engines: {node: 20 || >=22} + path-scurry@2.0.1: dependencies: lru-cache: 11.2.4 minipass: 7.1.2 - dev: true - /path-type@3.0.0: - resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} - engines: {node: '>=4'} + path-type@3.0.0: dependencies: pify: 3.0.0 - dev: true - - /path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - dev: true - /pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} - dev: true + path-type@4.0.0: {} - /pegjs@0.10.0: - resolution: {integrity: sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==} - engines: {node: '>=0.10'} - hasBin: true - dev: true + pathval@1.1.1: {} - /performance-now@0.2.0: - resolution: {integrity: sha512-YHk5ez1hmMR5LOkb9iJkLKqoBlL7WD5M8ljC75ZfzXriuBIVNuecaXuU7e+hOwyqf24Wxhh7Vxgt7Hnw9288Tg==} - dev: true + pegjs@0.10.0: {} - /performance-now@2.1.0: - resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} - dev: true + performance-now@0.2.0: {} - /phin@2.9.3: - resolution: {integrity: sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - dev: true + performance-now@2.1.0: {} - /picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - dev: true + phin@2.9.3: {} - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - dev: true + picocolors@1.1.1: {} - /pidtree@0.3.1: - resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==} - engines: {node: '>=0.10'} - hasBin: true - dev: true + picomatch@2.3.1: {} - /pify@3.0.0: - resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} - engines: {node: '>=4'} - dev: true + pidtree@0.3.1: {} - /pify@4.0.1: - resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} - engines: {node: '>=6'} - requiresBuild: true - dev: false - optional: true + pify@3.0.0: {} - /pify@5.0.0: - resolution: {integrity: sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==} - engines: {node: '>=10'} - dev: true + pify@5.0.0: {} - /pinkie-promise@2.0.1: - resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} - engines: {node: '>=0.10.0'} + pinkie-promise@2.0.1: dependencies: pinkie: 2.0.4 - dev: true - /pinkie@2.0.4: - resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} - engines: {node: '>=0.10.0'} - dev: true + pinkie@2.0.4: {} - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} + pkg-dir@4.2.0: dependencies: find-up: 4.1.0 - dev: true - /platform@1.3.6: - resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} - dev: true + platform@1.3.6: {} - /playwright-core@1.50.1: - resolution: {integrity: sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==} - engines: {node: '>=18'} - hasBin: true - dev: true + playwright-core@1.50.1: {} - /playwright@1.50.1: - resolution: {integrity: sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==} - engines: {node: '>=18'} - hasBin: true + playwright@1.50.1: dependencies: playwright-core: 1.50.1 optionalDependencies: fsevents: 2.3.2 - dev: true - /plur@1.0.0: - resolution: {integrity: sha512-qSnKBSZeDY8ApxwhfVIwKwF36KVJqb1/9nzYYq3j3vdwocULCXT8f8fQGkiw1Nk9BGfxiDagEe/pwakA+bOBqw==} - engines: {node: '>=0.10.0'} - dev: true + plur@1.0.0: {} - /portscanner@1.2.0: - resolution: {integrity: sha512-3MCx40XO6ChNJJHw1tTFukQK/M/8FacGZK/vGbnrKpozObrJzembYtfi7ZdA2hkF2Lojg77XhsKUPvF8eHKcDA==} - engines: {node: '>=0.4', npm: '>=1.0.0'} + portscanner@1.2.0: dependencies: async: 1.5.2 - dev: true - /possible-typed-array-names@1.1.0: - resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} - engines: {node: '>= 0.4'} - dev: true + possible-typed-array-names@1.1.0: {} - /postcss-value-parser@3.3.1: - resolution: {integrity: sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==} - dev: true + postcss-value-parser@3.3.1: {} - /postcss@5.2.18: - resolution: {integrity: sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==} - engines: {node: '>=0.12'} + postcss@5.2.18: dependencies: chalk: 1.1.3 js-base64: 2.6.4 source-map: 0.5.7 supports-color: 3.2.3 - dev: true - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true + prelude-ls@1.2.1: {} - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - requiresBuild: true - dev: true + prettier@2.8.8: optional: true - /pretty-format@30.0.5: - resolution: {integrity: sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==} - engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + pretty-format@30.0.5: dependencies: '@jest/schemas': 30.0.5 ansi-styles: 5.2.0 react-is: 18.3.1 - dev: true - /pretty-ms@2.1.0: - resolution: {integrity: sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==} - engines: {node: '>=0.10.0'} + pretty-ms@2.1.0: dependencies: is-finite: 1.1.0 parse-ms: 1.0.1 plur: 1.0.0 - dev: true - /progress@2.0.3: - resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} - engines: {node: '>=0.4.0'} - dev: true + progress@2.0.3: {} - /promise@7.3.1: - resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} + promise@7.3.1: dependencies: asap: 2.0.6 - dev: true - /prr@1.0.1: - resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} - requiresBuild: true - dev: false + prr@1.0.1: optional: true - /psl@1.15.0: - resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} + psl@1.15.0: dependencies: punycode: 2.3.1 - dev: true - - /punycode@1.4.1: - resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} - dev: true - /punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - dev: true + punycode@1.4.1: {} - /q@1.4.1: - resolution: {integrity: sha512-/CdEdaw49VZVmyIDGUQKDDT53c7qBkO6g5CefWz91Ae+l4+cRtcDYwMTXh6me4O8TMldeGHG3N2Bl84V78Ywbg==} - engines: {node: '>=0.6.0', teleport: '>=0.2.0'} - deprecated: |- - You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. + punycode@2.3.1: {} - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) - dev: true + q@1.4.1: {} - /qs@0.6.6: - resolution: {integrity: sha512-kN+yNdAf29Jgp+AYHUmC7X4QdJPR8czuMWLNLc0aRxkQ7tB3vJQEONKKT9ou/rW7EbqVec11srC9q9BiVbcnHA==} - dev: true + qs@0.6.6: {} - /qs@6.15.0: - resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} - engines: {node: '>=0.6'} + qs@6.15.0: dependencies: side-channel: 1.1.0 - dev: true - /qs@6.5.3: - resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} - engines: {node: '>=0.6'} - dev: true + qs@6.5.3: {} - /queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true + queue-microtask@1.2.3: {} - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 - dev: true - /range-parser@1.2.1: - resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} - engines: {node: '>= 0.6'} - dev: true + range-parser@1.2.1: {} - /react-is@18.3.1: - resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} - dev: true + react-is@18.3.1: {} - /read-glob@3.0.0: - resolution: {integrity: sha512-ywcpIVKwlKbj8vRLq5WbFju9nxDQB7VOL68260bvZPUsekwh43W6ngQ5e8znqQmLHwzEklhFi6YiAzUvlZclLw==} + read-glob@3.0.0: dependencies: assert-fs-readfile-option: 1.0.1 glob-observable: 0.7.0 graceful-fs: 4.2.11 inspect-with-kind: 1.0.5 zen-observable: 0.8.15 - dev: true - /read-pkg@3.0.0: - resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} - engines: {node: '>=4'} + read-pkg@3.0.0: dependencies: load-json-file: 4.0.0 normalize-package-data: 2.5.0 path-type: 3.0.0 - dev: true - /read@1.0.7: - resolution: {integrity: sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==} - engines: {node: '>=0.8'} + read@1.0.7: dependencies: mute-stream: 0.0.8 - dev: true - /readable-stream@1.0.34: - resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} + readable-stream@1.0.34: dependencies: core-util-is: 1.0.3 inherits: 2.0.4 isarray: 0.0.1 string_decoder: 0.10.31 - dev: true - /readable-stream@1.1.14: - resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==} + readable-stream@1.1.14: dependencies: core-util-is: 1.0.3 inherits: 2.0.4 isarray: 0.0.1 string_decoder: 0.10.31 - dev: true - /rechoir@0.6.2: - resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} - engines: {node: '>= 0.10'} + rechoir@0.6.2: dependencies: resolve: 1.22.11 - dev: true - /rechoir@0.7.1: - resolution: {integrity: sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==} - engines: {node: '>= 0.10'} + rechoir@0.7.1: dependencies: resolve: 1.22.11 - dev: true - /rechoir@0.8.0: - resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} - engines: {node: '>= 10.13.0'} + rechoir@0.8.0: dependencies: resolve: 1.22.11 - dev: true - /reflect.getprototypeof@1.0.10: - resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} - engines: {node: '>= 0.4'} + reflect.getprototypeof@1.0.10: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 @@ -4952,11 +6389,8 @@ packages: get-intrinsic: 1.3.0 get-proto: 1.0.1 which-builtin-type: 1.2.1 - dev: true - /regexp.prototype.flags@1.5.4: - resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} - engines: {node: '>= 0.4'} + regexp.prototype.flags@1.5.4: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 @@ -4964,17 +6398,10 @@ packages: get-proto: 1.0.1 gopd: 1.2.0 set-function-name: 2.0.2 - dev: true - /regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - dev: true + regexpp@3.2.0: {} - /request@2.22.0: - resolution: {integrity: sha512-s05oCBjWuzNi/UbZtvwOnSJ85/lHUdYPriJyFUwdxHKr8VcZHB0wx0eTX8y5hCH3p7OTDi9iQUqMFyDkW6K7EQ==} - engines: {'0': node >= 0.8.0} - deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 + request@2.22.0: dependencies: aws-sign: 0.3.0 cookie-jar: 0.3.0 @@ -4988,12 +6415,8 @@ packages: oauth-sign: 0.3.0 qs: 0.6.6 tunnel-agent: 0.3.0 - dev: true - /request@2.88.2: - resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==} - engines: {node: '>= 6'} - deprecated: request has been deprecated, see https://github.com/request/request/issues/3142 + request@2.88.2: dependencies: aws-sign2: 0.7.0 aws4: 1.13.2 @@ -5015,100 +6438,55 @@ packages: tough-cookie: 2.5.0 tunnel-agent: 0.6.0 uuid: 3.4.0 - dev: true - /requestretry@1.9.1: - resolution: {integrity: sha512-DWXDuj4syXribRStpt4qMOSBhDBUarreeoHol9sOdBfDG1BBDwBFfhgxCyDZkdQ+1W9mZm94vwEg8eD3p46tOg==} + requestretry@1.9.1: dependencies: extend: 3.0.2 fg-lodash: 0.0.2 request: 2.88.2 when: 3.7.8 - dev: true - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - dev: true + require-directory@2.1.1: {} - /require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} - dev: true + require-from-string@2.0.2: {} - /require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - dev: true + require-main-filename@2.0.0: {} - /resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} + resolve-cwd@3.0.0: dependencies: resolve-from: 5.0.0 - dev: true - /resolve-dir@1.0.1: - resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} - engines: {node: '>=0.10.0'} + resolve-dir@1.0.1: dependencies: expand-tilde: 2.0.2 global-modules: 1.0.0 - dev: true - /resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - dev: true + resolve-from@4.0.0: {} - /resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - dev: true + resolve-from@5.0.0: {} - /resolve@1.22.11: - resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} - engines: {node: '>= 0.4'} - hasBin: true + resolve@1.22.11: dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true - /restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} + restore-cursor@3.1.0: dependencies: onetime: 5.1.2 signal-exit: 3.0.7 - dev: true - /reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true + reusify@1.1.0: {} - /rimraf@2.7.1: - resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true + rimraf@2.7.1: dependencies: glob: 7.2.3 - dev: true - /rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true + rimraf@3.0.2: dependencies: glob: 7.2.3 - dev: true - /rollup-plugin-terser@5.3.1(rollup@2.79.2): - resolution: {integrity: sha512-1pkwkervMJQGFYvM9nscrUoncPwiKR/K+bHdjv6PFgRo3cgPHoRT83y2Aa3GvINj4539S15t/tpFPb775TDs6w==} - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser - peerDependencies: - rollup: '>=0.66.0 <3' + rollup-plugin-terser@5.3.1(rollup@2.79.2): dependencies: '@babel/code-frame': 7.27.1 jest-worker: 24.9.0 @@ -5116,134 +6494,81 @@ packages: rollup-pluginutils: 2.8.2 serialize-javascript: 4.0.0 terser: 4.8.1 - dev: true - /rollup-pluginutils@2.8.2: - resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} + rollup-pluginutils@2.8.2: dependencies: estree-walker: 0.6.1 - dev: true - /rollup@2.79.2: - resolution: {integrity: sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==} - engines: {node: '>=10.0.0'} - hasBin: true + rollup@2.79.2: optionalDependencies: fsevents: 2.3.3 - dev: true - /run-async@2.4.1: - resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} - engines: {node: '>=0.12.0'} - dev: true + run-async@2.4.1: {} - /run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 - dev: true - /rxjs@6.6.7: - resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} - engines: {npm: '>=2.0.0'} + rxjs@6.6.7: dependencies: tslib: 1.14.1 - dev: true - /safe-array-concat@1.1.3: - resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} - engines: {node: '>=0.4'} + safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 get-intrinsic: 1.3.0 has-symbols: 1.1.0 isarray: 2.0.5 - dev: true - /safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true + safe-buffer@5.1.2: {} - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true + safe-buffer@5.2.1: {} - /safe-push-apply@1.0.0: - resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} - engines: {node: '>= 0.4'} + safe-push-apply@1.0.0: dependencies: es-errors: 1.3.0 isarray: 2.0.5 - dev: true - /safe-regex-test@1.1.0: - resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} - engines: {node: '>= 0.4'} + safe-regex-test@1.1.0: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-regex: 1.2.1 - dev: true - /safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + safer-buffer@2.1.2: {} - /sauce-tunnel@2.5.0: - resolution: {integrity: sha512-NsE6r9J+nXT9FBcAxA+nZ1JvmoJJqQPTp33J4vTJQFZ4jtFfPoUMH10AXyIhjEFVemK7XP5SF4Uy+q3dKWWQig==} + sauce-tunnel@2.5.0: dependencies: chalk: 1.1.3 request: 2.88.2 split: 1.0.1 - dev: true - /saucelabs@1.5.0: - resolution: {integrity: sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==} + saucelabs@1.5.0: dependencies: https-proxy-agent: 2.2.4 transitivePeerDependencies: - supports-color - dev: true - /sax@1.4.3: - resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==} - requiresBuild: true - dev: false + sax@1.4.3: optional: true - /schema-utils@4.3.3: - resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} - engines: {node: '>= 10.13.0'} + schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 ajv: 8.17.1 ajv-formats: 2.1.1(ajv@8.17.1) ajv-keywords: 5.1.0(ajv@8.17.1) - dev: true - /semver@5.4.1: - resolution: {integrity: sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==} - hasBin: true - dev: true + semver@5.4.1: {} - /semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true + semver@5.7.2: {} - /semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - dev: true + semver@6.3.1: {} - /semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} - engines: {node: '>=10'} - hasBin: true - dev: true + semver@7.7.3: {} - /send@0.19.0: - resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} - engines: {node: '>= 0.8.0'} + send@0.19.0: dependencies: debug: 2.6.9 depd: 2.0.0 @@ -5260,17 +6585,12 @@ packages: statuses: 2.0.1 transitivePeerDependencies: - supports-color - dev: true - /serialize-javascript@4.0.0: - resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} + serialize-javascript@4.0.0: dependencies: randombytes: 2.1.0 - dev: true - /serve-index@1.9.1: - resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} - engines: {node: '>= 0.8.0'} + serve-index@1.9.1: dependencies: accepts: 1.3.8 batch: 0.6.1 @@ -5281,11 +6601,8 @@ packages: parseurl: 1.3.3 transitivePeerDependencies: - supports-color - dev: true - /serve-static@1.16.2: - resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} - engines: {node: '>= 0.8.0'} + serve-static@1.16.2: dependencies: encodeurl: 2.0.0 escape-html: 1.0.3 @@ -5293,15 +6610,10 @@ packages: send: 0.19.0 transitivePeerDependencies: - supports-color - dev: true - /set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - dev: true + set-blocking@2.0.0: {} - /set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 es-errors: 1.3.0 @@ -5309,222 +6621,131 @@ packages: get-intrinsic: 1.3.0 gopd: 1.2.0 has-property-descriptors: 1.0.2 - dev: true - /set-function-name@2.0.2: - resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} - engines: {node: '>= 0.4'} + set-function-name@2.0.2: dependencies: define-data-property: 1.1.4 es-errors: 1.3.0 functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 - dev: true - /set-proto@1.0.0: - resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} - engines: {node: '>= 0.4'} + set-proto@1.0.0: dependencies: dunder-proto: 1.0.1 es-errors: 1.3.0 es-object-atoms: 1.1.1 - dev: true - /setprototypeof@1.1.0: - resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} - dev: true + setprototypeof@1.1.0: {} - /setprototypeof@1.2.0: - resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - dev: true + setprototypeof@1.2.0: {} - /shallow-clone@3.0.1: - resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} - engines: {node: '>=8'} + shallow-clone@3.0.1: dependencies: kind-of: 6.0.3 - dev: true - /shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} + shebang-command@1.2.0: dependencies: shebang-regex: 1.0.0 - dev: true - /shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - dev: true - /shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - dev: true + shebang-regex@1.0.0: {} - /shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - dev: true + shebang-regex@3.0.0: {} - /shell-quote@1.8.3: - resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==} - engines: {node: '>= 0.4'} - dev: true + shell-quote@1.8.3: {} - /shelljs@0.8.5: - resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} - engines: {node: '>=4'} - hasBin: true + shelljs@0.8.5: dependencies: glob: 7.2.3 interpret: 1.4.0 rechoir: 0.6.2 - dev: true - /shx@0.3.4: - resolution: {integrity: sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==} - engines: {node: '>=6'} - hasBin: true + shx@0.3.4: dependencies: minimist: 1.2.8 shelljs: 0.8.5 - dev: true - /side-channel-list@1.0.0: - resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} - engines: {node: '>= 0.4'} + side-channel-list@1.0.0: dependencies: es-errors: 1.3.0 object-inspect: 1.13.4 - dev: true - /side-channel-map@1.0.1: - resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} - engines: {node: '>= 0.4'} + side-channel-map@1.0.1: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 get-intrinsic: 1.3.0 object-inspect: 1.13.4 - dev: true - /side-channel-weakmap@1.0.2: - resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} - engines: {node: '>= 0.4'} + side-channel-weakmap@1.0.2: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 get-intrinsic: 1.3.0 object-inspect: 1.13.4 side-channel-map: 1.0.1 - dev: true - /side-channel@1.1.0: - resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} - engines: {node: '>= 0.4'} + side-channel@1.1.0: dependencies: es-errors: 1.3.0 object-inspect: 1.13.4 side-channel-list: 1.0.0 side-channel-map: 1.0.1 side-channel-weakmap: 1.0.2 - dev: true - /signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true + signal-exit@3.0.7: {} - /signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - dev: true + signal-exit@4.1.0: {} - /slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - dev: true + slash@3.0.0: {} - /slice-ansi@4.0.0: - resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} - engines: {node: '>=10'} + slice-ansi@4.0.0: dependencies: ansi-styles: 4.3.0 astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 - dev: true - /sntp@0.2.4: - resolution: {integrity: sha512-bDLrKa/ywz65gCl+LmOiIhteP1bhEsAAzhfMedPoiHP3dyYnAevlaJshdqb9Yu0sRifyP/fRqSt8t+5qGIWlGQ==} - engines: {node: '>=0.8.0'} - deprecated: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. + sntp@0.2.4: dependencies: hoek: 0.9.1 - dev: true - /source-map-support@0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 - dev: true - /source-map@0.5.7: - resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} - engines: {node: '>=0.10.0'} - dev: true + source-map@0.5.7: {} - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} + source-map@0.6.1: {} - /sourcemap-codec@1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead - dev: true + sourcemap-codec@1.4.8: {} - /spdx-correct@3.2.0: - resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.22 - dev: true - /spdx-exceptions@2.5.0: - resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} - dev: true + spdx-exceptions@2.5.0: {} - /spdx-expression-parse@3.0.1: - resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 spdx-license-ids: 3.0.22 - dev: true - /spdx-license-ids@3.0.22: - resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} - dev: true + spdx-license-ids@3.0.22: {} - /split@1.0.1: - resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} + split@1.0.1: dependencies: through: 2.3.8 - dev: true - /sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: true + sprintf-js@1.0.3: {} - /sprintf-js@1.1.3: - resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} - dev: true + sprintf-js@1.1.3: {} - /sshpk@1.18.0: - resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} - engines: {node: '>=0.10.0'} - hasBin: true + sshpk@1.18.0: dependencies: asn1: 0.2.6 assert-plus: 1.0.0 @@ -5535,74 +6756,47 @@ packages: jsbn: 0.1.1 safer-buffer: 2.1.2 tweetnacl: 0.14.5 - dev: true - /statuses@1.5.0: - resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} - engines: {node: '>= 0.6'} - dev: true + statuses@1.5.0: {} - /statuses@2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} - engines: {node: '>= 0.8'} - dev: true + statuses@2.0.1: {} - /stop-iteration-iterator@1.1.0: - resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} - engines: {node: '>= 0.4'} + stop-iteration-iterator@1.1.0: dependencies: es-errors: 1.3.0 internal-slot: 1.1.0 - dev: true - /string-width@2.1.1: - resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} - engines: {node: '>=4'} + string-width@2.1.1: dependencies: is-fullwidth-code-point: 2.0.0 strip-ansi: 4.0.0 - dev: true - /string-width@3.1.0: - resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} - engines: {node: '>=6'} + string-width@3.1.0: dependencies: emoji-regex: 7.0.3 is-fullwidth-code-point: 2.0.0 strip-ansi: 5.2.0 - dev: true - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: true - /string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} + string-width@5.1.2: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 strip-ansi: 7.1.2 - dev: true - /string.prototype.padend@3.1.6: - resolution: {integrity: sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==} - engines: {node: '>= 0.4'} + string.prototype.padend@3.1.6: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 es-abstract: 1.24.1 es-object-atoms: 1.1.1 - dev: true - /string.prototype.trim@1.2.10: - resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} - engines: {node: '>= 0.4'} + string.prototype.trim@1.2.10: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 @@ -5611,221 +6805,124 @@ packages: es-abstract: 1.24.1 es-object-atoms: 1.1.1 has-property-descriptors: 1.0.2 - dev: true - /string.prototype.trimend@1.0.9: - resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} - engines: {node: '>= 0.4'} + string.prototype.trimend@1.0.9: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 define-properties: 1.2.1 es-object-atoms: 1.1.1 - dev: true - /string.prototype.trimstart@1.0.8: - resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} - engines: {node: '>= 0.4'} + string.prototype.trimstart@1.0.8: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 es-object-atoms: 1.1.1 - dev: true - /string_decoder@0.10.31: - resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} - dev: true + string_decoder@0.10.31: {} - /strip-ansi@3.0.1: - resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} - engines: {node: '>=0.10.0'} + strip-ansi@3.0.1: dependencies: ansi-regex: 2.1.1 - dev: true - /strip-ansi@4.0.0: - resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} - engines: {node: '>=4'} + strip-ansi@4.0.0: dependencies: ansi-regex: 3.0.1 - dev: true - /strip-ansi@5.2.0: - resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} - engines: {node: '>=6'} + strip-ansi@5.2.0: dependencies: ansi-regex: 4.1.1 - dev: true - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 - dev: true - /strip-ansi@7.1.2: - resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} - engines: {node: '>=12'} + strip-ansi@7.1.2: dependencies: ansi-regex: 6.2.2 - dev: true - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true + strip-bom@3.0.0: {} - /strip-json-comments@2.0.1: - resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} - engines: {node: '>=0.10.0'} - dev: true + strip-json-comments@2.0.1: {} - /strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - dev: true + strip-json-comments@3.1.1: {} - /supports-color@2.0.0: - resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} - engines: {node: '>=0.8.0'} - dev: true + supports-color@2.0.0: {} - /supports-color@3.2.3: - resolution: {integrity: sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==} - engines: {node: '>=0.8.0'} + supports-color@3.2.3: dependencies: has-flag: 1.0.0 - dev: true - /supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} + supports-color@5.5.0: dependencies: has-flag: 3.0.0 - dev: true - /supports-color@6.0.0: - resolution: {integrity: sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==} - engines: {node: '>=6'} + supports-color@6.0.0: dependencies: has-flag: 3.0.0 - dev: true - /supports-color@6.1.0: - resolution: {integrity: sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==} - engines: {node: '>=6'} + supports-color@6.1.0: dependencies: has-flag: 3.0.0 - dev: true - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 - dev: true - /supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} + supports-color@8.1.1: dependencies: has-flag: 4.0.0 - dev: true - /supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - dev: true + supports-preserve-symlinks-flag@1.0.0: {} - /table@6.9.0: - resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==} - engines: {node: '>=10.0.0'} + table@6.9.0: dependencies: ajv: 8.17.1 lodash.truncate: 4.4.2 slice-ansi: 4.0.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: true - /tapable@2.3.0: - resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} - engines: {node: '>=6'} - dev: true + tapable@2.3.0: {} - /terser-webpack-plugin@5.4.0(webpack@5.105.4): - resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} - engines: {node: '>= 10.13.0'} - peerDependencies: - '@swc/core': '*' - esbuild: '*' - uglify-js: '*' - webpack: ^5.1.0 - peerDependenciesMeta: - '@swc/core': - optional: true - esbuild: - optional: true - uglify-js: - optional: true + terser-webpack-plugin@5.4.0(webpack@5.105.4): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 terser: 5.46.0 webpack: 5.105.4(webpack-cli@5.1.4) - dev: true - /terser@4.8.1: - resolution: {integrity: sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==} - engines: {node: '>=6.0.0'} - hasBin: true + terser@4.8.1: dependencies: acorn: 8.15.0 commander: 2.20.3 source-map: 0.6.1 source-map-support: 0.5.21 - dev: true - /terser@5.46.0: - resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} - engines: {node: '>=10'} - hasBin: true + terser@5.46.0: dependencies: '@jridgewell/source-map': 0.3.11 acorn: 8.16.0 commander: 2.20.3 source-map-support: 0.5.21 - dev: true - /test-exclude@7.0.1: - resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} - engines: {node: '>=18'} + test-exclude@7.0.1: dependencies: '@istanbuljs/schema': 0.1.3 glob: 10.5.0 minimatch: 9.0.5 - dev: true - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true + text-table@0.2.0: {} - /through2@0.6.5: - resolution: {integrity: sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==} + through2@0.6.5: dependencies: readable-stream: 1.0.34 xtend: 4.0.2 - dev: true - /through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - dev: true + through@2.3.8: {} - /time-grunt@1.4.0: - resolution: {integrity: sha512-u8n+ZOcdNDkrqlyN+x1ayHN0X+hMgg3SS191EE5xO03nRVnVpNp3UJSmUBCQCAbe959LqWttMaELNclfmWM+fQ==} - engines: {node: '>=0.10.0'} + time-grunt@1.4.0: dependencies: chalk: 1.1.3 date-time: 1.1.0 @@ -5834,117 +6931,66 @@ packages: number-is-nan: 1.0.1 pretty-ms: 2.1.0 text-table: 0.2.0 - dev: true - /time-zone@0.1.0: - resolution: {integrity: sha512-S5CjtVIkeBTnlsaZP3gjsTb78ClBe74sEcgEoBwAVUKnTRDAGqUtLLIZHMsIyqOWjt9DGQpLMMoD8ZKIfP2ddQ==} - engines: {node: '>=0.10.0'} - dev: true + time-zone@0.1.0: {} - /tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} + tmp@0.0.33: dependencies: os-tmpdir: 1.0.2 - dev: true - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - dev: true - /toidentifier@1.0.1: - resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} - engines: {node: '>=0.6'} - dev: true + toidentifier@1.0.1: {} - /tough-cookie@2.5.0: - resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==} - engines: {node: '>=0.8'} + tough-cookie@2.5.0: dependencies: psl: 1.15.0 punycode: 2.3.1 - dev: true - /tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: true + tr46@0.0.3: {} - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: true + tslib@1.14.1: {} - /tsutils@3.21.0(typescript@5.9.3): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + tsutils@3.21.0(typescript@5.9.3): dependencies: tslib: 1.14.1 typescript: 5.9.3 - dev: true - /tunnel-agent@0.3.0: - resolution: {integrity: sha512-jlGqHGoKzyyjhwv/c9omAgohntThMcGtw8RV/RDLlkbbc08kni/akVxO62N8HaXMVbVsK1NCnpSK3N2xCt22ww==} - dev: true + tunnel-agent@0.3.0: {} - /tunnel-agent@0.6.0: - resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + tunnel-agent@0.6.0: dependencies: safe-buffer: 5.2.1 - dev: true - /tweetnacl@0.14.5: - resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} - dev: true + tweetnacl@0.14.5: {} - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 - dev: true - /type-detect@4.1.0: - resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} - engines: {node: '>=4'} - dev: true + type-detect@4.1.0: {} - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true + type-fest@0.20.2: {} - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - dev: true + type-fest@0.21.3: {} - /typed-array-buffer@1.0.3: - resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} - engines: {node: '>= 0.4'} + typed-array-buffer@1.0.3: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-typed-array: 1.1.15 - dev: true - /typed-array-byte-length@1.0.3: - resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} - engines: {node: '>= 0.4'} + typed-array-byte-length@1.0.3: dependencies: call-bind: 1.0.8 for-each: 0.3.5 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 - dev: true - /typed-array-byte-offset@1.0.4: - resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} - engines: {node: '>= 0.4'} + typed-array-byte-offset@1.0.4: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.8 @@ -5953,11 +6999,8 @@ packages: has-proto: 1.2.0 is-typed-array: 1.1.15 reflect.getprototypeof: 1.0.10 - dev: true - /typed-array-length@1.0.7: - resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} - engines: {node: '>= 0.4'} + typed-array-length@1.0.7: dependencies: call-bind: 1.0.8 for-each: 0.3.5 @@ -5965,187 +7008,100 @@ packages: is-typed-array: 1.1.15 possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - dev: true - /typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} - hasBin: true - dev: true + typescript@5.9.3: {} - /uikit@2.27.4: - resolution: {integrity: sha512-dylNikIJ8sB6Sd1AP6YETb+R5bIkjTnGeuu/yLhO9elQ4oLu8CIA+u5zCC7a9m7axbDUALy12qr32nvgRyO5HA==} + uikit@2.27.4: dependencies: node-promise: 0.5.14 - dev: true - /unbox-primitive@1.1.0: - resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} - engines: {node: '>= 0.4'} + unbox-primitive@1.1.0: dependencies: call-bound: 1.0.4 has-bigints: 1.1.0 has-symbols: 1.1.0 which-boxed-primitive: 1.1.1 - dev: true - /unc-path-regex@0.1.2: - resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} - engines: {node: '>=0.10.0'} - dev: true + unc-path-regex@0.1.2: {} - /underscore.string@2.3.3: - resolution: {integrity: sha512-hbD5MibthuDAu4yA5wxes5bzFgqd3PpBJuClbRxaNddxfdsz+qf+1kHwrGQFrmchmDHb9iNU+6EHDn8uj0xDJg==} - dev: true + underscore.string@2.3.3: {} - /underscore.string@3.3.6: - resolution: {integrity: sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==} + underscore.string@3.3.6: dependencies: sprintf-js: 1.1.3 util-deprecate: 1.0.2 - dev: true - /underscore@1.4.4: - resolution: {integrity: sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==} - dev: true + underscore@1.4.4: {} - /undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - dev: true + undici-types@5.26.5: {} - /universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} - dev: true + universalify@0.1.2: {} - /universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - dev: true + universalify@2.0.1: {} - /unpipe@1.0.0: - resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} - engines: {node: '>= 0.8'} - dev: true + unpipe@1.0.0: {} - /update-browserslist-db@1.2.3(browserslist@4.28.1): - resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' + update-browserslist-db@1.2.3(browserslist@4.28.1): dependencies: browserslist: 4.28.1 escalade: 3.2.0 picocolors: 1.1.1 - dev: true - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + uri-js@4.4.1: dependencies: punycode: 2.3.1 - dev: true - /url@0.11.4: - resolution: {integrity: sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==} - engines: {node: '>= 0.4'} + url@0.11.4: dependencies: punycode: 1.4.1 qs: 6.15.0 - dev: true - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true + util-deprecate@1.0.2: {} - /utils-merge@1.0.1: - resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} - engines: {node: '>= 0.4.0'} - dev: true + utils-merge@1.0.1: {} - /uuid@3.4.0: - resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} - deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. - hasBin: true - dev: true + uuid@3.4.0: {} - /v8-compile-cache@2.4.0: - resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} - dev: true + v8-compile-cache@2.4.0: {} - /v8-to-istanbul@9.3.0: - resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} - engines: {node: '>=10.12.0'} + v8-to-istanbul@9.3.0: dependencies: '@jridgewell/trace-mapping': 0.3.31 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 - dev: true - /v8flags@3.2.0: - resolution: {integrity: sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==} - engines: {node: '>= 0.10'} + v8flags@3.2.0: dependencies: homedir-polyfill: 1.0.3 - dev: true - /v8flags@4.0.1: - resolution: {integrity: sha512-fcRLaS4H/hrZk9hYwbdRM35D0U8IYMfEClhXxCivOojl+yTRAZH3Zy2sSy6qVCiGbV9YAtPssP6jaChqC9vPCg==} - engines: {node: '>= 10.13.0'} - dev: true + v8flags@4.0.1: {} - /validate-glob-opts@1.0.2: - resolution: {integrity: sha512-3PKjRQq/R514lUcG9OEiW0u9f7D4fP09A07kmk1JbNn2tfeQdAHhlT+A4dqERXKu2br2rrxSM3FzagaEeq9w+A==} + validate-glob-opts@1.0.2: dependencies: array-to-sentence: 1.1.0 indexed-filter: 1.0.3 inspect-with-kind: 1.0.5 is-plain-obj: 1.1.0 - dev: true - /validate-npm-package-license@3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - dev: true - /verror@1.10.0: - resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} - engines: {'0': node >=0.6.0} + verror@1.10.0: dependencies: assert-plus: 1.0.0 core-util-is: 1.0.2 extsprintf: 1.3.0 - dev: true - /watchpack@2.5.1: - resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} - engines: {node: '>=10.13.0'} + watchpack@2.5.1: dependencies: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - dev: true - /webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: true + webidl-conversions@3.0.1: {} - /webpack-cli@5.1.4(webpack@5.105.4): - resolution: {integrity: sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==} - engines: {node: '>=14.15.0'} - hasBin: true - peerDependencies: - '@webpack-cli/generators': '*' - webpack: 5.x.x - webpack-bundle-analyzer: '*' - webpack-dev-server: '*' - peerDependenciesMeta: - '@webpack-cli/generators': - optional: true - webpack-bundle-analyzer: - optional: true - webpack-dev-server: - optional: true + webpack-cli@5.1.4(webpack@5.105.4): dependencies: '@discoveryjs/json-ext': 0.5.7 '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.105.4) @@ -6161,31 +7117,16 @@ packages: rechoir: 0.8.0 webpack: 5.105.4(webpack-cli@5.1.4) webpack-merge: 5.10.0 - dev: true - /webpack-merge@5.10.0: - resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} - engines: {node: '>=10.0.0'} + webpack-merge@5.10.0: dependencies: clone-deep: 4.0.1 flat: 5.0.2 wildcard: 2.0.1 - dev: true - /webpack-sources@3.3.4: - resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} - engines: {node: '>=10.13.0'} - dev: true + webpack-sources@3.3.4: {} - /webpack@5.105.4(webpack-cli@5.1.4): - resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} - engines: {node: '>=10.13.0'} - hasBin: true - peerDependencies: - webpack-cli: '*' - peerDependenciesMeta: - webpack-cli: - optional: true + webpack@5.105.4(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -6211,39 +7152,30 @@ packages: tapable: 2.3.0 terser-webpack-plugin: 5.4.0(webpack@5.105.4) watchpack: 2.5.1 - webpack-cli: 5.1.4(webpack@5.105.4) webpack-sources: 3.3.4 + optionalDependencies: + webpack-cli: 5.1.4(webpack@5.105.4) transitivePeerDependencies: - '@swc/core' - esbuild - uglify-js - dev: true - /whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 - dev: true - /when@3.7.8: - resolution: {integrity: sha512-5cZ7mecD3eYcMiCH4wtRPA5iFJZ50BJYDfckI5RRpQiktMiYTcn0ccLTZOvcbBume+1304fQztxeNzNS9Gvrnw==} - dev: true + when@3.7.8: {} - /which-boxed-primitive@1.1.1: - resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} - engines: {node: '>= 0.4'} + which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 is-boolean-object: 1.2.2 is-number-object: 1.1.1 is-string: 1.1.1 is-symbol: 1.1.1 - dev: true - /which-builtin-type@1.2.1: - resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} - engines: {node: '>= 0.4'} + which-builtin-type@1.2.1: dependencies: call-bound: 1.0.4 function.prototype.name: 1.1.8 @@ -6258,25 +7190,17 @@ packages: which-boxed-primitive: 1.1.1 which-collection: 1.0.2 which-typed-array: 1.1.19 - dev: true - /which-collection@1.0.2: - resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} - engines: {node: '>= 0.4'} + which-collection@1.0.2: dependencies: is-map: 2.0.3 is-set: 2.0.3 is-weakmap: 2.0.2 is-weakset: 2.0.4 - dev: true - /which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - dev: true + which-module@2.0.1: {} - /which-typed-array@1.1.19: - resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} - engines: {node: '>= 0.4'} + which-typed-array@1.1.19: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.8 @@ -6285,131 +7209,79 @@ packages: get-proto: 1.0.1 gopd: 1.2.0 has-tostringtag: 1.0.2 - dev: true - /which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true + which@1.3.1: dependencies: isexe: 2.0.0 - dev: true - /which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true + which@2.0.2: dependencies: isexe: 2.0.0 - dev: true - /wide-align@1.1.3: - resolution: {integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==} + wide-align@1.1.3: dependencies: string-width: 2.1.1 - dev: true - /wildcard@2.0.1: - resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} - dev: true + wildcard@2.0.1: {} - /word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - dev: true + word-wrap@1.2.5: {} - /wrap-ansi@5.1.0: - resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} - engines: {node: '>=6'} + wrap-ansi@5.1.0: dependencies: ansi-styles: 3.2.1 string-width: 3.1.0 strip-ansi: 5.2.0 - dev: true - /wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} + wrap-ansi@6.2.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: true - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: true - /wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} + wrap-ansi@8.1.0: dependencies: ansi-styles: 6.2.3 string-width: 5.1.2 strip-ansi: 7.1.2 - dev: true - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true + wrappy@1.0.2: {} - /xtend@2.0.6: - resolution: {integrity: sha512-fOZg4ECOlrMl+A6Msr7EIFcON1L26mb4NY5rurSkOex/TWhazOrg6eXD/B0XkuiYcYhQDWLXzQxLMVJ7LXwokg==} - engines: {node: '>=0.4'} + xtend@2.0.6: dependencies: is-object: 0.1.2 object-keys: 0.2.0 - dev: true - /xtend@4.0.2: - resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} - engines: {node: '>=0.4'} - dev: true + xtend@4.0.2: {} - /y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - dev: true + y18n@4.0.3: {} - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: true + y18n@5.0.8: {} - /yargs-parser@13.1.2: - resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} + yargs-parser@13.1.2: dependencies: camelcase: 5.3.1 decamelize: 1.2.0 - dev: true - /yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} + yargs-parser@18.1.3: dependencies: camelcase: 5.3.1 decamelize: 1.2.0 - dev: true - /yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - dev: true + yargs-parser@21.1.1: {} - /yargs-unparser@1.6.0: - resolution: {integrity: sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==} - engines: {node: '>=6'} + yargs-unparser@1.6.0: dependencies: flat: 4.1.1 lodash: 4.17.21 yargs: 13.3.2 - dev: true - /yargs@13.3.2: - resolution: {integrity: sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==} + yargs@13.3.2: dependencies: cliui: 5.0.0 find-up: 3.0.0 @@ -6421,11 +7293,8 @@ packages: which-module: 2.0.1 y18n: 4.0.3 yargs-parser: 13.1.2 - dev: true - /yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} + yargs@15.4.1: dependencies: cliui: 6.0.0 decamelize: 1.2.0 @@ -6438,11 +7307,8 @@ packages: which-module: 2.0.1 y18n: 4.0.3 yargs-parser: 18.1.3 - dev: true - /yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} + yargs@17.7.2: dependencies: cliui: 8.0.1 escalade: 3.2.0 @@ -6451,13 +7317,7 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 - dev: true - /yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - dev: true + yocto-queue@0.1.0: {} - /zen-observable@0.8.15: - resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} - dev: true + zen-observable@0.8.15: {} From da514037287b9a7f47cd93886f4526dc3f5222f7 Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Wed, 18 Mar 2026 13:16:24 -0400 Subject: [PATCH 37/76] fix(issue#4356): parenthesis in media query (#4427) * Fix issue #4356 issue with parenthesis in media query. * Add tests for issue #4356. Co-authored-by: Matthew Dean --- packages/less/lib/less/parser/parser.js | 14 +++++++++++++- packages/test-data/tests-unit/media/media.css | 5 +++++ packages/test-data/tests-unit/media/media.less | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index fb6b3603b..72014aab2 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -1891,6 +1891,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { spacing = true; } } else if (parserInput.$char('(')) { + let closed = false; p = this.property(); parserInput.save(); if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\s*([<>]=|<=|>=|[<>]|=)/)) { @@ -1904,9 +1905,20 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } } else { parserInput.restore(); + parserInput.save(); e = this.value(); + if (e && parserInput.$char(')')) { + closed = true; + parserInput.forget(); + } else { + parserInput.restore(); + e = this.mediaFeature(syntaxOptions); + } + } + if (!closed && parserInput.$char(')')) { + closed = true; } - if (parserInput.$char(')')) { + if (closed) { if (p && !e) { nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index))); e = p; diff --git a/packages/test-data/tests-unit/media/media.css b/packages/test-data/tests-unit/media/media.css index eb9912364..70ed03b48 100644 --- a/packages/test-data/tests-unit/media/media.css +++ b/packages/test-data/tests-unit/media/media.css @@ -274,3 +274,8 @@ color: red; } } +@media ((color) and (hover)), all { + body { + background: green; + } +} diff --git a/packages/test-data/tests-unit/media/media.less b/packages/test-data/tests-unit/media/media.less index 3b55c761c..a67b58ffd 100644 --- a/packages/test-data/tests-unit/media/media.less +++ b/packages/test-data/tests-unit/media/media.less @@ -302,3 +302,9 @@ color: red; } } + +@media ((color) and (hover)), all { + body { + background: green; + } +} From 2958e9df47c4f593747c0026cda2721bd81001f9 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:43:17 -0700 Subject: [PATCH 38/76] feat: PR-based release flow for alpha; test suite proving all three release properties (#4431) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * fix: correct release automation for master merges and publishing - create-release-pr.yml: add set -euo pipefail; track whether a commit was created; skip push + gh pr create when no version changes (no-op safety - fixes the "no commits between head and base" failure). - scripts/bump-and-publish.js: on master, use the version already in package.json as-is (no auto-increment). Validate it is > NPM version. Skip updateAllVersions/git-add/git-commit on master so the published tag always points to the release PR merge commit on master, not to a local detached commit. Alpha behavior is unchanged. - Fix error message: on master say "Git tag was pushed" rather than "Version bump commit and tag were pushed". Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * test: add release automation test suite (20 tests) Proves the three components of the release flow work correctly: - publish.yml if: conditions (6 scenarios) - create-release-pr.yml if: conditions (4 scenarios) - bump-and-publish.js master path: existing version, no commit, no push (4 tests) - bump-and-publish.js alpha path: auto-increment, commit, alpha tag (4 tests) - create-release-pr no-op safety: commit when needed, clean exit when not (2 tests) Run with: node scripts/test-release-automation.js or: npm run test:release (after pnpm install) Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * plan: implement PR-based release flow for alpha branch Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * feat: PR-based release flow for alpha branch (mirrors master) - create-release-pr.yml: listen on alpha push; compute alpha version increment (X.Y.Z-alpha.N → X.Y.Z-alpha.N+1); use branch-specific PR title/base/branch naming; update loop guards for both flavours - publish.yml: remove push:alpha trigger; add alpha to pull_request branches; update if: condition for alpha release PR title+base - bump-and-publish.js: remove auto-increment/commit/push for alpha; add getNpmAlphaVersion(); alpha now validates and publishes like master - test-release-automation.js: 34 tests covering new flows end-to-end Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 103 ++- .github/workflows/publish.yml | 48 +- package.json | 1 + scripts/bump-and-publish.js | 207 ++---- scripts/test-release-automation.js | 804 ++++++++++++++++++++++++ 5 files changed, 964 insertions(+), 199 deletions(-) create mode 100644 scripts/test-release-automation.js diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b41ee6b09..4dbe932dd 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -1,12 +1,16 @@ name: Create Release PR -# When code lands on master (not a release PR merge itself), automatically -# create or update a "chore: release vX.Y.Z" pull request that bumps the +# When code lands on master or alpha (not a release PR merge itself), +# automatically create or update a release pull request that bumps the # version. Maintainers then merge that PR to trigger publishing. +# +# master → "chore: release vX.Y.Z" PR targets master +# alpha → "chore: alpha release vX.Y.Z" PR targets alpha on: push: branches: - master + - alpha # Only trigger for commits that touch package source files. paths: - 'packages/**' @@ -20,11 +24,14 @@ jobs: name: Create or Update Release PR runs-on: ubuntu-latest # Skip if this push is itself the merge of a release PR (prevents an - # infinite loop). We catch both squash-merged and regular-merged commits. + # infinite loop). We catch both squash-merged and regular-merged commits + # for both the master and alpha release PR title conventions. if: | github.repository == 'less/less.js' && !contains(github.event.head_commit.message, 'chore: release v') && - !contains(github.event.head_commit.message, '/release-v') + !contains(github.event.head_commit.message, 'chore: alpha release v') && + !contains(github.event.head_commit.message, '/release-v') && + !contains(github.event.head_commit.message, '/alpha-release-v') steps: - name: Checkout @@ -47,21 +54,46 @@ jobs: - name: Determine next version id: version run: | + BRANCH="${{ github.ref_name }}" CURRENT=$(node -p "require('./packages/less/package.json').version") - NPM_VERSION=$(npm view less version 2>/dev/null || echo "") - NEXT=$(node -e " - const semver = require('semver'); - const cur = process.argv[1]; - const npm = process.argv[2] || null; - if (npm && semver.valid(cur) && semver.gt(cur, npm)) { - process.stdout.write(cur); - } else { - const base = npm || cur; - process.stdout.write(semver.inc(base, 'patch')); - } - " "$CURRENT" "$NPM_VERSION") - echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" - echo "branch=chore/release-v$NEXT" >> "$GITHUB_OUTPUT" + + if [ "$BRANCH" = "alpha" ]; then + # Alpha: increment the alpha prerelease number. + # X.Y.Z-alpha.N → X.Y.Z-alpha.(N+1) + # If package.json doesn't carry an alpha version yet, bump the + # major and start a fresh alpha.1 series. + NEXT=$(node -e " + const cur = process.argv[1]; + const m = cur.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); + if (m) { + process.stdout.write(m[1] + '-alpha.' + (parseInt(m[2], 10) + 1)); + } else { + const parts = cur.replace(/-.*/, '').split('.'); + const nextMajor = parseInt(parts[0], 10) + 1; + process.stdout.write(nextMajor + '.0.0-alpha.1'); + } + " "$CURRENT") + echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" + echo "branch=chore/alpha-release-v$NEXT" >> "$GITHUB_OUTPUT" + echo "release_base=alpha" >> "$GITHUB_OUTPUT" + else + # Master: patch-increment from the latest npm published version. + NPM_VERSION=$(npm view less version 2>/dev/null || echo "") + NEXT=$(node -e " + const semver = require('semver'); + const cur = process.argv[1]; + const npm = process.argv[2] || null; + if (npm && semver.valid(cur) && semver.gt(cur, npm)) { + process.stdout.write(cur); + } else { + const base = npm || cur; + process.stdout.write(semver.inc(base, 'patch')); + } + " "$CURRENT" "$NPM_VERSION") + echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" + echo "branch=chore/release-v$NEXT" >> "$GITHUB_OUTPUT" + echo "release_base=master" >> "$GITHUB_OUTPUT" + fi - name: Configure Git run: | @@ -72,15 +104,21 @@ jobs: env: NEXT_VERSION: ${{ steps.version.outputs.next_version }} RELEASE_BRANCH: ${{ steps.version.outputs.branch }} + RELEASE_BASE: ${{ steps.version.outputs.release_base }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - TITLE="chore: release v${NEXT_VERSION}" + set -euo pipefail + if [ "$RELEASE_BASE" = "alpha" ]; then + TITLE="chore: alpha release v${NEXT_VERSION}" + else + TITLE="chore: release v${NEXT_VERSION}" + fi - # Create or reset the release branch off the latest master so it + # Create or reset the release branch off the latest base branch so it # always includes all recent commits. if git ls-remote --exit-code origin "refs/heads/${RELEASE_BRANCH}" &>/dev/null; then git fetch origin "${RELEASE_BRANCH}" - git checkout -B "${RELEASE_BRANCH}" origin/master + git checkout -B "${RELEASE_BRANCH}" "origin/${RELEASE_BASE}" else git checkout -b "${RELEASE_BRANCH}" fi @@ -101,10 +139,27 @@ jobs: " git add package.json packages/*/package.json + COMMITTED=false if git diff --cached --quiet; then echo "No version changes; branch is already at v${NEXT_VERSION}" else git commit -m "${TITLE}" + COMMITTED=true + fi + + # If no new commit was created the release branch has no commits + # ahead of master, so pushing it and trying to open a PR would fail + # with "no commits between head and base". Instead, just report + # whether an existing release PR is open and exit cleanly. + if [ "$COMMITTED" = "false" ]; then + EXISTING=$(gh pr list --head "${RELEASE_BRANCH}" --base "${RELEASE_BASE}" \ + --json number --jq '.[0].number' 2>/dev/null || echo "") + if [ -n "${EXISTING}" ]; then + echo "✅ No new changes; release PR #${EXISTING} already exists" + else + echo "✅ No version bump needed and no existing release PR; nothing to do" + fi + exit 0 fi # --force-with-lease refuses to overwrite if the remote has advanced @@ -114,7 +169,7 @@ jobs: git push origin "${RELEASE_BRANCH}" --force-with-lease # Open a PR if one doesn't already exist for this version. - EXISTING=$(gh pr list --head "${RELEASE_BRANCH}" --base master \ + EXISTING=$(gh pr list --head "${RELEASE_BRANCH}" --base "${RELEASE_BASE}" \ --json number --jq '.[0].number' 2>/dev/null || echo "") if [ -z "${EXISTING}" ]; then @@ -129,9 +184,9 @@ jobs: gh pr create \ --title "${TITLE}" \ --body "${BODY}" \ - --base master \ + --base "${RELEASE_BASE}" \ --head "${RELEASE_BRANCH}" echo "✅ Created release PR for v${NEXT_VERSION}" else - echo "✅ Release PR #${EXISTING} already exists; branch updated to include latest master commits" + echo "✅ Release PR #${EXISTING} already exists; branch updated to include latest ${RELEASE_BASE} commits" fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bcb381828..9c02fb7c9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,23 +1,15 @@ name: Publish to NPM on: - # Master: publish when a "chore: release vX.Y.Z" pull request is merged. - # The release PR is created automatically by create-release-pr.yml. + # Publish when a release PR is merged: + # master branch: "chore: release vX.Y.Z" PR → publishes latest + # alpha branch: "chore: alpha release vX.Y.Z" PR → publishes alpha + # Both release PRs are created automatically by create-release-pr.yml. pull_request: types: [closed] branches: - master - # Alpha: publish on direct push to the alpha branch. - push: - branches: - alpha - paths-ignore: - - '**.md' - - 'docs/**' - - '.gitignore' - - '.claude/**' - - '.github/**' - - 'scripts/**' permissions: id-token: write # Required for OIDC trusted publishing @@ -27,18 +19,17 @@ jobs: publish: name: Publish to NPM runs-on: ubuntu-latest - # Master: only run when a release PR (title = "chore: release v*") is merged. - # Alpha: only run on direct pushes; skip if it's a version-bump commit - # (prevents the bump-and-publish script from triggering itself). + # Only run when a release PR with the expected title is merged into master + # or alpha. Any other PR close (or merge without the right title) is + # silently skipped. if: | github.repository == 'less/less.js' && + github.event.pull_request.merged == true && ( - (github.event_name == 'pull_request' && - github.event.pull_request.merged == true && + (github.event.pull_request.base.ref == 'master' && startsWith(github.event.pull_request.title, 'chore: release v')) || - (github.event_name == 'push' && - github.ref_name == 'alpha' && - !startsWith(github.event.head_commit.message, 'chore: bump version to')) + (github.event.pull_request.base.ref == 'alpha' && + startsWith(github.event.pull_request.title, 'chore: alpha release v')) ) steps: @@ -47,9 +38,9 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - # For PR events check out the base branch (master) post-merge so the + # Check out the base branch (master or alpha) post-merge so the # version bump from the release PR is already present. - ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref }} + ref: ${{ github.event.pull_request.base.ref }} - name: Install pnpm uses: pnpm/action-setup@v4 @@ -79,13 +70,8 @@ jobs: - name: Determine branch and tag type id: branch-info run: | - # For PR events the branch is the PR's base (master); for push events - # it is the pushed branch (alpha). - if [ "${{ github.event_name }}" = "pull_request" ]; then - BRANCH="${{ github.event.pull_request.base.ref }}" - else - BRANCH="${{ github.ref_name }}" - fi + # Always a pull_request event; base.ref is master or alpha. + BRANCH="${{ github.event.pull_request.base.ref }}" echo "branch=$BRANCH" >> $GITHUB_OUTPUT if [ "$BRANCH" = "alpha" ]; then echo "is_alpha=true" >> $GITHUB_OUTPUT @@ -165,8 +151,8 @@ jobs: - name: Bump version and publish id: publish env: - # Use the branch name resolved by the branch-info step above rather - # than repeating the PR-vs-push detection logic here. + # Pass the resolved base branch name (master or alpha) so that + # bump-and-publish.js knows which branch it is publishing for. GITHUB_REF_NAME: ${{ steps.branch-info.outputs.branch }} run: | pnpm run publish diff --git a/package.json b/package.json index 288f66edf..db8e48205 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "changelog": "github-changes -o less -r less.js -a --only-pulls --use-commit-body -m \"(YYYY-MM-DD)\"", "test": "cd packages/less && npm test", "test:node": "cd packages/less && npm run test:node", + "test:release": "node scripts/test-release-automation.js", "postinstall": "npx only-allow pnpm" }, "author": "Alexis Sellier ", diff --git a/scripts/bump-and-publish.js b/scripts/bump-and-publish.js index d731d2deb..be0d78895 100755 --- a/scripts/bump-and-publish.js +++ b/scripts/bump-and-publish.js @@ -9,14 +9,15 @@ * 3. Creates and pushes an annotated git tag * 4. Publishes all packages to NPM * - * For master, the version-bump commit is NOT pushed here. Instead it arrives - * via the "chore: release vX.Y.Z" pull request created by create-release-pr.yml. - * Merging that PR triggers this script, at which point package.json already has - * the target version. Only the git tag is pushed — tag pushes are not subject - * to branch-protection "require pull request" rules. - * - * For the alpha branch, the traditional commit + branch-push flow is preserved - * because alpha does not use the PR-based release flow. + * Both master and alpha now use a PR-based release flow: + * + * master → "chore: release vX.Y.Z" PR created by create-release-pr.yml + * alpha → "chore: alpha release vX.Y.Z" PR created by create-release-pr.yml + * + * Merging the release PR lands the version-bump commit on the branch and + * triggers this script. At that point package.json already carries the + * target version. This script validates it, creates an annotated tag, pushes + * the tag, and publishes to npm. No local commit or branch push is made here. */ const fs = require('fs'); @@ -91,6 +92,16 @@ function getNpmVersion(packageName) { } } +// Get the current alpha dist-tag version from NPM +function getNpmAlphaVersion(packageName) { + try { + const result = execSync(`npm view ${packageName} dist-tags.alpha`, { encoding: 'utf8' }).trim(); + return result || null; + } catch (e) { + return null; + } +} + // Determine the target version for publishing. // Priority: EXPLICIT_VERSION env > package.json (if ahead of NPM) > NPM patch bump function getTargetVersion(currentVersion, npmVersion) { @@ -172,143 +183,60 @@ function main() { console.log(`🚀 Starting publish process for branch: ${branch}`); // Get current version - let currentVersion = getCurrentVersion(); + const currentVersion = getCurrentVersion(); console.log(`📦 Current version: ${currentVersion}`); - - // Protection: If on alpha branch and version was overwritten by a merge from master - if (isAlpha && !currentVersion.includes('-alpha.')) { - console.log(`\n⚠️ WARNING: Alpha branch version (${currentVersion}) doesn't contain '-alpha.'`); - console.log(` This likely happened due to merging master into alpha.`); - console.log(` Attempting to restore alpha version...`); - - // Try to find the last alpha version from alpha branch history - let restoredVersion = null; - try { - // Get recent commits on alpha that modified package.json - const commits = execSync( - 'git log alpha --oneline -20 -- packages/less/package.json', - { cwd: ROOT_DIR, encoding: 'utf8' } - ).trim().split('\n'); - - // Search through commits to find the last alpha version - for (const commitLine of commits) { - const commitHash = commitLine.split(' ')[0]; - try { - const pkgContent = execSync( - `git show ${commitHash}:packages/less/package.json 2>/dev/null`, - { cwd: ROOT_DIR, encoding: 'utf8' } - ); - const pkg = JSON.parse(pkgContent); - if (pkg.version && pkg.version.includes('-alpha.')) { - restoredVersion = pkg.version; - console.log(` Found previous alpha version in commit ${commitHash}: ${restoredVersion}`); - break; - } - } catch (e) { - // Continue to next commit - } - } - - if (restoredVersion) { - // Increment the alpha number from the restored version - const alphaMatch = restoredVersion.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); - if (alphaMatch) { - const alphaNum = parseInt(alphaMatch[2], 10); - const newAlphaVersion = `${alphaMatch[1]}-alpha.${alphaNum + 1}`; - console.log(` Restoring and incrementing to: ${newAlphaVersion}`); - currentVersion = newAlphaVersion; - updateAllVersions(newAlphaVersion); - } else { - console.log(` Restoring to: ${restoredVersion}`); - currentVersion = restoredVersion; - updateAllVersions(restoredVersion); - } - } else { - // No previous alpha version found, create one from current version - const parsed = parseVersion(currentVersion); - const nextMajor = parsed.major + 1; - const newAlphaVersion = `${nextMajor}.0.0-alpha.1`; - console.log(` No previous alpha version found. Creating new: ${newAlphaVersion}`); - currentVersion = newAlphaVersion; - updateAllVersions(newAlphaVersion); - } - } catch (e) { - // If we can't find previous version, create a new alpha version - const parsed = parseVersion(currentVersion); - const nextMajor = parsed.major + 1; - const newAlphaVersion = `${nextMajor}.0.0-alpha.1`; - console.log(` Could not find previous alpha version. Creating: ${newAlphaVersion}`); - currentVersion = newAlphaVersion; - updateAllVersions(newAlphaVersion); - } - - console.log(`✅ Restored/created alpha version: ${currentVersion}\n`); - } - - // Determine next version + + // Determine next version. + // Both master and alpha now use the PR-based release flow: the version bump + // was already applied by the release PR. Use the version in package.json + // as-is and fail fast if it is not ahead of the already-published version. let nextVersion; if (isAlpha) { - // For alpha branch, use alpha versions - const parsed = parseVersion(currentVersion); - if (parsed.prerelease) { - // Already an alpha, increment alpha number - const alphaMatch = currentVersion.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); - if (alphaMatch) { - const alphaNum = parseInt(alphaMatch[2], 10); - nextVersion = `${alphaMatch[1]}-alpha.${alphaNum + 1}`; - } else { - // Other prerelease format, determine base version and start alpha.1 - const baseVersion = `${parsed.major}.${parsed.minor}.${parsed.patch}`; - nextVersion = `${baseVersion}-alpha.1`; - } - } else { - // Not an alpha version, determine next major and start alpha.1 - const parsed = parseVersion(currentVersion); - const nextMajor = parsed.major + 1; - nextVersion = `${nextMajor}.0.0-alpha.1`; + // Validate that the version carries the expected '-alpha.' prerelease tag. + if (!currentVersion.includes('-alpha.')) { + console.error(`❌ ERROR: Alpha branch package.json version (${currentVersion}) must contain '-alpha.'`); + console.error(` The alpha release PR should have bumped to an X.Y.Z-alpha.N version.`); + process.exit(1); + } + + const npmAlphaVersion = getNpmAlphaVersion('less'); + console.log(`📦 NPM alpha version: ${npmAlphaVersion || '(not published)'}`); + if (npmAlphaVersion && semver.valid(currentVersion) && !semver.gt(currentVersion, npmAlphaVersion)) { + console.error(`❌ ERROR: package.json version (${currentVersion}) must be greater than NPM alpha version (${npmAlphaVersion})`); + console.error(` On alpha the version bump should have arrived via the alpha release PR.`); + process.exit(1); } - console.log(`🔢 Auto-incrementing alpha version: ${nextVersion}`); + nextVersion = currentVersion; + console.log(`📦 Using package.json version (no auto-increment on alpha): ${nextVersion}`); } else { - // For master: compare package.json vs NPM, bump accordingly + // For master: the version bump was already applied via the release PR. + // Use the version already in package.json as-is; never auto-increment here + // because that would create a local commit whose tag would point to a + // commit that is NOT on the master branch. const npmVersion = getNpmVersion('less'); console.log(`📦 NPM version: ${npmVersion || '(not published)'}`); - nextVersion = getTargetVersion(currentVersion, npmVersion); + if (npmVersion && semver.valid(currentVersion) && !semver.gt(currentVersion, npmVersion)) { + console.error(`❌ ERROR: package.json version (${currentVersion}) must be greater than NPM version (${npmVersion})`); + console.error(` On master the version bump should have arrived via the release PR.`); + process.exit(1); + } + nextVersion = currentVersion; + console.log(`📦 Using package.json version (no auto-increment on master): ${nextVersion}`); } - - // Update all package.json files - console.log(`📝 Updating all package.json files to version ${nextVersion}...`); - const updated = updateAllVersions(nextVersion); - console.log(`✅ Updated ${updated.length} package.json files`); - + // Get publishable packages const publishable = getPublishablePackages(); console.log(`📦 Found ${publishable.length} publishable packages:`); publishable.forEach(pkg => console.log(` - ${pkg.name}`)); - - // Stage changes - console.log(`📌 Staging version changes...`); - if (!dryRun) { - execSync('git add package.json packages/*/package.json', { cwd: ROOT_DIR, stdio: 'inherit' }); - } else { - console.log(` [DRY RUN] Would stage: package.json packages/*/package.json`); - } - - // Commit - console.log(`💾 Committing version bump...`); - if (!dryRun) { - try { - execSync(`git commit -m "chore: bump version to ${nextVersion}"`, { - cwd: ROOT_DIR, - stdio: 'inherit' - }); - } catch (e) { - // Commit might fail if nothing changed, that's okay - console.log(`⚠️ Commit skipped (no changes or already committed)`); - } - } else { - console.log(` [DRY RUN] Would commit: "chore: bump version to ${nextVersion}"`); - } + + // Both master and alpha: the version-bump commit already lives on the branch + // (it came from the release PR). Do NOT create another local commit or push + // to the branch — doing so would produce a tag pointing at a commit that is + // not on the target branch. + // + // Only the annotated tag is pushed. Tag pushes bypass branch-protection + // "require pull request" rules. // Create tag const tagName = `v${nextVersion}`; @@ -329,17 +257,8 @@ function main() { // For master the version-bump commit already lives in master (it came from // the release PR). Only push the git tag — tag pushes bypass branch // protection "require pull request" rules. - // For alpha (direct-push branch) we still push the bump commit to the branch. - if (!isMaster) { - console.log(`📤 Pushing to ${branch}...`); - if (!dryRun) { - execSync(`git push origin ${branch}`, { cwd: ROOT_DIR, stdio: 'inherit' }); - } else { - console.log(` [DRY RUN] Would push to: origin ${branch}`); - } - } - - console.log(`📤 Pushing tag ${tagName}...`); + // Alpha follows the same pattern: the version bump arrived via the alpha + // release PR, so we only push the tag here too. console.log(`📤 Pushing tag ${tagName}...`); if (!dryRun) { execSync(`git push origin "${tagName}"`, { cwd: ROOT_DIR, stdio: 'inherit' }); } else { @@ -465,7 +384,7 @@ function main() { publishErrors.forEach(({ name, error }) => { console.error(` - ${name}: ${error}`); }); - console.error(`\n⚠️ Note: Version bump commit and tag were pushed successfully.`); + console.error(`\n⚠️ Note: Git tag was pushed successfully.`); console.error(` Some packages failed to publish. You may need to publish them manually.`); process.exit(1); } diff --git a/scripts/test-release-automation.js b/scripts/test-release-automation.js new file mode 100644 index 000000000..02141bd2b --- /dev/null +++ b/scripts/test-release-automation.js @@ -0,0 +1,804 @@ +#!/usr/bin/env node +/** + * Release-automation test suite + * + * Tests four components of the release flow without requiring a live + * GitHub token or npm credentials: + * + * 1. publish.yml `if:` expression + * - master release PR merged → publish + * - alpha release PR merged → publish (alpha tag) + * - other PRs / direct pushes → skip + * + * 2. create-release-pr.yml `if:` expression + * - normal merges to master or alpha → trigger + * - release PR merges (both flavours) → skip (loop guard) + * + * 3. Alpha version increment logic (from create-release-pr.yml) + * - Works for any X.Y.Z-alpha.N regardless of major version + * - Double-digit rollover (alpha.9 → alpha.10) + * - Non-alpha package.json on alpha branch → bump major, start alpha.1 + * + * 4. bump-and-publish.js behaviour (subprocess, DRY_RUN=true) + * - master path: uses package.json version as-is, no commit, no branch push + * - master path: rejects when package.json version ≤ npm latest version + * - alpha path: uses package.json version as-is, no commit, no branch push + * - alpha path: rejects when package.json alpha version lacks '-alpha.' + * + * 5. create-release-pr no-op safety (isolated temp git repo) + * - when a version bump produces changes → a commit is created + * - when no version changes are needed → exits cleanly with no commit + * + * Run: + * node scripts/test-release-automation.js + * + * Uses only Node.js built-ins. semver is resolved from the workspace + * node_modules (present after `pnpm install`). In sandboxes where pnpm + * install hasn't run, install it manually: + * npm install --prefix /tmp/test-deps semver + */ + +'use strict'; + +const assert = require('assert'); +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const { spawnSync, execSync } = require('child_process'); + +const ROOT_DIR = path.resolve(__dirname, '..'); + +// --------------------------------------------------------------------------- +// Resolve semver — works both after `pnpm install` and in a bare sandbox +// --------------------------------------------------------------------------- + +function resolveSemverPath() { + const candidates = [ + path.join(ROOT_DIR, 'node_modules', 'semver'), + '/tmp/test-deps/node_modules/semver', + ]; + for (const c of candidates) { + if (fs.existsSync(c)) return c; + } + return null; +} + +const SEMVER_PATH = resolveSemverPath(); + +// --------------------------------------------------------------------------- +// Tiny test harness (no external dependencies) +// --------------------------------------------------------------------------- + +let passed = 0; +let failed = 0; +const failures = []; + +function test(name, fn) { + try { + fn(); + console.log(` ✅ ${name}`); + passed++; + } catch (err) { + console.error(` ❌ ${name}`); + console.error(` ${err.message}`); + failures.push({ name, message: err.message }); + failed++; + } +} + +function section(title) { + console.log(`\n── ${title}`); +} + +// --------------------------------------------------------------------------- +// Workflow condition helpers +// +// These replicate the job-level `if:` expressions from the YAML files +// verbatim in JavaScript so the tests are authoritative. +// --------------------------------------------------------------------------- + +/** + * publish.yml `if:` condition: + * + * github.repository == 'less/less.js' && + * github.event.pull_request.merged == true && + * ( + * (github.event.pull_request.base.ref == 'master' && + * startsWith(github.event.pull_request.title, 'chore: release v')) || + * (github.event.pull_request.base.ref == 'alpha' && + * startsWith(github.event.pull_request.title, 'chore: alpha release v')) + * ) + */ +function publishShouldRun({ repo, prMerged, prBaseRef, prTitle }) { + if (repo !== 'less/less.js') return false; + if (!prMerged) return false; + + const isMasterRelease = + prBaseRef === 'master' && + typeof prTitle === 'string' && + prTitle.startsWith('chore: release v'); + + const isAlphaRelease = + prBaseRef === 'alpha' && + typeof prTitle === 'string' && + prTitle.startsWith('chore: alpha release v'); + + return isMasterRelease || isAlphaRelease; +} + +/** + * create-release-pr.yml `if:` condition: + * + * github.repository == 'less/less.js' && + * !contains(github.event.head_commit.message, 'chore: release v') && + * !contains(github.event.head_commit.message, 'chore: alpha release v') && + * !contains(github.event.head_commit.message, '/release-v') && + * !contains(github.event.head_commit.message, '/alpha-release-v') + */ +function createReleasePRShouldRun({ repo, commitMessage }) { + if (repo !== 'less/less.js') return false; + if (commitMessage.includes('chore: release v')) return false; + if (commitMessage.includes('chore: alpha release v')) return false; + if (commitMessage.includes('/release-v')) return false; + if (commitMessage.includes('/alpha-release-v')) return false; + return true; +} + +/** + * Alpha version increment — mirrors the inline Node script in + * create-release-pr.yml "Determine next version" step for the alpha branch. + * + * X.Y.Z-alpha.N → X.Y.Z-alpha.(N+1) + * X.Y.Z → (X+1).0.0-alpha.1 (no alpha suffix yet) + */ +function nextAlphaVersion(current) { + const m = current.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); + if (m) { + return `${m[1]}-alpha.${parseInt(m[2], 10) + 1}`; + } + const parts = current.replace(/-.*/, '').split('.'); + const nextMajor = parseInt(parts[0], 10) + 1; + return `${nextMajor}.0.0-alpha.1`; +} + +// --------------------------------------------------------------------------- +// Helpers: temporary git repo +// --------------------------------------------------------------------------- + +function makeFakeRepo({ packageVersion }) { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'less-release-test-')); + + // root package.json (private monorepo root) + fs.writeFileSync( + path.join(dir, 'package.json'), + JSON.stringify({ name: '@less/root', private: true, version: packageVersion }, null, '\t') + '\n', + ); + + // packages/less/package.json (the publishable package) + const pkgDir = path.join(dir, 'packages', 'less'); + fs.mkdirSync(pkgDir, { recursive: true }); + fs.writeFileSync( + path.join(pkgDir, 'package.json'), + JSON.stringify({ name: 'less', version: packageVersion }, null, '\t') + '\n', + ); + + // Minimal git repo + execSync('git init -b master', { cwd: dir, stdio: 'ignore' }); + execSync('git config user.email "test@test.com"', { cwd: dir, stdio: 'ignore' }); + execSync('git config user.name "Test"', { cwd: dir, stdio: 'ignore' }); + execSync('git add .', { cwd: dir, stdio: 'ignore' }); + execSync('git commit -m "initial"', { cwd: dir, stdio: 'ignore' }); + + return dir; +} + +// --------------------------------------------------------------------------- +// Run bump-and-publish.js in a fake repo +// +// Strategy: copy the script into the temp repo with ROOT_DIR patched so it +// reads/writes from the temp dir. semver is resolved via NODE_PATH. +// --------------------------------------------------------------------------- + +function runBumpAndPublish(fakeRoot, extraEnv = {}) { + const scriptsDir = path.join(fakeRoot, 'scripts'); + fs.mkdirSync(scriptsDir, { recursive: true }); + + // Read the production script and patch the ROOT_DIR line. + let src = fs.readFileSync(path.join(ROOT_DIR, 'scripts', 'bump-and-publish.js'), 'utf8'); + + // Remove shebang so Node can require() it without SyntaxError + src = src.replace(/^#!.*\n/, ''); + + // Override ROOT_DIR to point at fakeRoot + src = src.replace( + /const ROOT_DIR\s*=\s*path\.resolve\(__dirname,\s*'\.\.'\s*\);/, + `const ROOT_DIR = ${JSON.stringify(fakeRoot)};`, + ); + + // Redirect require('semver') to the resolved absolute path so the patched + // script works even when run from an isolated temp directory that has no + // node_modules of its own. + if (SEMVER_PATH) { + src = src.replace( + /require\('semver'\)/g, + `require(${JSON.stringify(SEMVER_PATH)})`, + ); + } + + const patchedScript = path.join(scriptsDir, '_bap_patched.cjs'); + fs.writeFileSync(patchedScript, src); + + const result = spawnSync('node', [patchedScript], { + cwd: fakeRoot, + env: { + ...process.env, + ...extraEnv, + }, + encoding: 'utf8', + }); + + // Clean up patched script; ENOENT is fine if it was never written + try { fs.unlinkSync(patchedScript); } catch (e) { if (e.code !== 'ENOENT') throw e; } + + return { + exitCode: result.status, + stdout: result.stdout || '', + stderr: result.stderr || '', + }; +} + +// --------------------------------------------------------------------------- +// Run the core shell logic from create-release-pr.yml in an isolated repo. +// +// We run everything up to (but not including) `git push` and `gh pr create` +// so we don't need network access. The critical behaviour under test is +// whether a commit is created when there are (or aren't) version changes. +// --------------------------------------------------------------------------- + +function runCreateReleasePRStep({ repoDir, nextVersion, releaseBranch }) { + // Stub `gh` binary so any calls are recorded but do nothing + const binDir = path.join(repoDir, '.test-bin'); + fs.mkdirSync(binDir, { recursive: true }); + const ghLog = path.join(repoDir, 'gh-calls.log'); + fs.writeFileSync(path.join(binDir, 'gh'), `#!/bin/sh\necho "$@" >> "${ghLog}"\n`); + fs.chmodSync(path.join(binDir, 'gh'), 0o755); + + const initialHead = execSync('git rev-parse HEAD', { cwd: repoDir, encoding: 'utf8' }).trim(); + + const script = ` +set -euo pipefail +NEXT_VERSION=${JSON.stringify(nextVersion)} +RELEASE_BRANCH=${JSON.stringify(releaseBranch)} +TITLE="chore: release v\${NEXT_VERSION}" + +git checkout -b "\${RELEASE_BRANCH}" + +node -e " + const fs = require('fs'); + const version = process.env.NEXT_VERSION; + const dirs = fs.readdirSync('packages', { withFileTypes: true }) + .filter(d => d.isDirectory()) + .map(d => 'packages/' + d.name + '/package.json'); + for (const f of ['package.json', ...dirs].filter(f => fs.existsSync(f))) { + const pkg = JSON.parse(fs.readFileSync(f, 'utf8')); + if (!pkg.version) continue; + pkg.version = version; + fs.writeFileSync(f, JSON.stringify(pkg, null, '\\t') + '\\n'); + } +" + +git add package.json packages/*/package.json +COMMITTED=false +if git diff --cached --quiet; then + echo "STATUS:NO_CHANGES" +else + git commit -m "\${TITLE}" + COMMITTED=true +fi +echo "STATUS:COMMITTED=\${COMMITTED}" +`; + + const result = spawnSync('bash', ['-c', script], { + cwd: repoDir, + env: { + ...process.env, + NEXT_VERSION: nextVersion, + GH_TOKEN: 'fake-token', + PATH: `${binDir}:${process.env.PATH}`, + }, + encoding: 'utf8', + }); + + const finalHead = execSync('git rev-parse HEAD', { cwd: repoDir, encoding: 'utf8' }).trim(); + const ghCalls = fs.existsSync(ghLog) ? fs.readFileSync(ghLog, 'utf8').trim() : ''; + + return { + exitCode: result.status, + stdout: result.stdout || '', + stderr: result.stderr || '', + initialHead, + finalHead, + newCommitCreated: finalHead !== initialHead, + ghCalls, + }; +} + +// ============================================================================ +// TEST SUITE +// ============================================================================ + +// ---------------------------------------------------------------------------- +// Section 1 — publish.yml trigger conditions +// ---------------------------------------------------------------------------- + +section('1. publish.yml — workflow trigger conditions'); + +test('master release PR merged → SHOULD publish', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'master', + prTitle: 'chore: release v4.6.4', + }), + true, + ); +}); + +test('alpha release PR merged → SHOULD publish (alpha tag)', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'alpha', + prTitle: 'chore: alpha release v5.0.0-alpha.2', + }), + true, + ); +}); + +test('non-release PR merged into master → should NOT publish', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'master', + prTitle: 'fix: some bug fix', + }), + false, + ); +}); + +test('non-release PR merged into alpha → should NOT publish', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'alpha', + prTitle: 'feat: add something for next major', + }), + false, + ); +}); + +test('release PR closed but NOT merged → should NOT publish', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: false, + prBaseRef: 'master', + prTitle: 'chore: release v4.6.4', + }), + false, + ); +}); + +test('alpha release PR title used against master base → should NOT publish', () => { + // Wrong convention: "chore: alpha release v" into master should not trigger + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'master', + prTitle: 'chore: alpha release v5.0.0-alpha.1', + }), + false, + ); +}); + +test('wrong repository → should NOT publish', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'fork/less.js', + prMerged: true, + prBaseRef: 'master', + prTitle: 'chore: release v4.6.4', + }), + false, + ); +}); + +// ---------------------------------------------------------------------------- +// Section 2 — create-release-pr.yml trigger conditions +// ---------------------------------------------------------------------------- + +section('2. create-release-pr.yml — workflow trigger conditions'); + +test('normal merge to master → SHOULD trigger', () => { + assert.strictEqual( + createReleasePRShouldRun({ repo: 'less/less.js', commitMessage: 'fix: correct color parsing' }), + true, + ); +}); + +test('normal merge to alpha → SHOULD trigger', () => { + assert.strictEqual( + createReleasePRShouldRun({ repo: 'less/less.js', commitMessage: 'feat: new feature for next major' }), + true, + ); +}); + +test('master release PR merge → should NOT trigger (loop guard)', () => { + assert.strictEqual( + createReleasePRShouldRun({ repo: 'less/less.js', commitMessage: 'chore: release v4.6.4' }), + false, + ); +}); + +test('alpha release PR merge → should NOT trigger (loop guard)', () => { + assert.strictEqual( + createReleasePRShouldRun({ repo: 'less/less.js', commitMessage: 'chore: alpha release v5.0.0-alpha.2' }), + false, + ); +}); + +test('release branch ref in commit message → should NOT trigger (loop guard for master)', () => { + assert.strictEqual( + createReleasePRShouldRun({ + repo: 'less/less.js', + commitMessage: 'Merge chore/release-v4.6.4 into master', + }), + false, + ); +}); + +test('alpha release branch ref in commit message → should NOT trigger (loop guard for alpha)', () => { + assert.strictEqual( + createReleasePRShouldRun({ + repo: 'less/less.js', + commitMessage: 'Merge chore/alpha-release-v5.0.0-alpha.2 into alpha', + }), + false, + ); +}); + +test('wrong repository → should NOT trigger', () => { + assert.strictEqual( + createReleasePRShouldRun({ repo: 'fork/less.js', commitMessage: 'fix: something' }), + false, + ); +}); + +// ---------------------------------------------------------------------------- +// Section 3 — Alpha version increment logic (from create-release-pr.yml) +// +// These are pure-logic tests of the nextAlphaVersion() helper, which mirrors +// the inline Node script in the "Determine next version" step of the workflow. +// This directly answers: "does this work for 5.x alphas as well?" +// ---------------------------------------------------------------------------- + +section('3. create-release-pr.yml — alpha version increment logic'); + +test('4.x: 4.6.3-alpha.1 → 4.6.3-alpha.2', () => { + assert.strictEqual(nextAlphaVersion('4.6.3-alpha.1'), '4.6.3-alpha.2'); +}); + +test('5.x: 5.0.0-alpha.1 → 5.0.0-alpha.2 (answers the original question)', () => { + assert.strictEqual(nextAlphaVersion('5.0.0-alpha.1'), '5.0.0-alpha.2'); +}); + +test('5.x: 5.0.0-alpha.3 → 5.0.0-alpha.4 (preserves major, not 4.x)', () => { + assert.strictEqual(nextAlphaVersion('5.0.0-alpha.3'), '5.0.0-alpha.4'); +}); + +test('5.x minor/patch: 5.1.2-alpha.7 → 5.1.2-alpha.8', () => { + assert.strictEqual(nextAlphaVersion('5.1.2-alpha.7'), '5.1.2-alpha.8'); +}); + +test('double-digit rollover: 5.0.0-alpha.9 → 5.0.0-alpha.10 (integer, not string comparison)', () => { + assert.strictEqual(nextAlphaVersion('5.0.0-alpha.9'), '5.0.0-alpha.10'); +}); + +test('non-alpha version on alpha branch: 4.6.3 → 5.0.0-alpha.1 (bumps major, starts fresh)', () => { + assert.strictEqual(nextAlphaVersion('4.6.3'), '5.0.0-alpha.1'); +}); + +test('non-alpha 5.x version: 5.0.0 → 6.0.0-alpha.1', () => { + assert.strictEqual(nextAlphaVersion('5.0.0'), '6.0.0-alpha.1'); +}); + +// ---------------------------------------------------------------------------- +// Section 4 — bump-and-publish.js master path +// ---------------------------------------------------------------------------- + +section('4. bump-and-publish.js — master path (DRY_RUN=true)'); + +// A version clearly higher than any real npm publish so validation passes +const MASTER_TEST_VERSION = '999.0.0'; + +test('master: uses package.json version as-is (no auto-increment)', () => { + const fakeDir = makeFakeRepo({ packageVersion: MASTER_TEST_VERSION }); + try { + const { exitCode, stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'master', + DRY_RUN: 'true', + }); + assert.strictEqual(exitCode, 0, `Expected exit 0.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`); + assert.ok( + stdout.includes(MASTER_TEST_VERSION), + `Expected version ${MASTER_TEST_VERSION} in output.\nSTDOUT: ${stdout}`, + ); + assert.ok( + stdout.includes('no auto-increment on master') || stdout.includes('Using package.json version'), + `Expected "no auto-increment" message.\nSTDOUT: ${stdout}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('master: no commit step (version bump is skipped)', () => { + const fakeDir = makeFakeRepo({ packageVersion: MASTER_TEST_VERSION }); + try { + const { stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'master', + DRY_RUN: 'true', + }); + assert.ok( + !stdout.includes('[DRY RUN] Would commit'), + `Expected no commit step on master path.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('master: no branch push step', () => { + const fakeDir = makeFakeRepo({ packageVersion: MASTER_TEST_VERSION }); + try { + const { stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'master', + DRY_RUN: 'true', + }); + assert.ok( + !stdout.includes('Would push to: origin master'), + `Expected no branch push on master path.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('master: rejects when package.json version ≤ npm published version', () => { + // 0.0.1 is well below the real npm "less" version, so validation should fail + const fakeDir = makeFakeRepo({ packageVersion: '0.0.1' }); + try { + const { exitCode, stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'master', + DRY_RUN: 'true', + }); + assert.notStrictEqual(exitCode, 0, `Expected non-zero exit.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`); + const combined = stdout + stderr; + assert.ok( + combined.includes('must be greater than NPM version') || combined.includes('ERROR'), + `Expected error message about version being too low.\nCombined: ${combined}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +// ---------------------------------------------------------------------------- +// Section 5 — bump-and-publish.js alpha path +// +// Alpha now uses the same PR-based flow as master: the version bump is applied +// by the release PR, and bump-and-publish.js uses the existing version as-is. +// ---------------------------------------------------------------------------- + +section('5. bump-and-publish.js — alpha path (DRY_RUN=true)'); + +test('alpha: uses package.json version as-is (no auto-increment)', () => { + const fakeDir = makeFakeRepo({ packageVersion: '5.0.0-alpha.2' }); + try { + const { exitCode, stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'alpha', + DRY_RUN: 'true', + }); + assert.strictEqual(exitCode, 0, `Expected exit 0.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`); + assert.ok( + stdout.includes('5.0.0-alpha.2'), + `Expected version 5.0.0-alpha.2 in output.\nSTDOUT: ${stdout}`, + ); + assert.ok( + stdout.includes('no auto-increment on alpha') || stdout.includes('Using package.json version'), + `Expected "no auto-increment" message.\nSTDOUT: ${stdout}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('alpha: no commit step (same as master)', () => { + const fakeDir = makeFakeRepo({ packageVersion: '5.0.0-alpha.2' }); + try { + const { stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'alpha', + DRY_RUN: 'true', + }); + assert.ok( + !stdout.includes('[DRY RUN] Would commit'), + `Expected no commit step on alpha path.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('alpha: no branch push step (same as master)', () => { + const fakeDir = makeFakeRepo({ packageVersion: '5.0.0-alpha.2' }); + try { + const { stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'alpha', + DRY_RUN: 'true', + }); + assert.ok( + !stdout.includes('Would push to: origin alpha'), + `Expected no branch push on alpha path.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('alpha: publishes with "alpha" npm tag (not "latest")', () => { + const fakeDir = makeFakeRepo({ packageVersion: '5.0.0-alpha.2' }); + try { + const { exitCode, stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'alpha', + DRY_RUN: 'true', + }); + assert.strictEqual(exitCode, 0, `Expected exit 0.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`); + assert.ok( + stdout.includes('tag: alpha'), + `Expected npm tag "alpha" in output.\nSTDOUT: ${stdout}`, + ); + assert.ok( + !stdout.includes('tag: latest'), + `Expected no "latest" npm tag for alpha versions.\nSTDOUT: ${stdout}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('alpha: rejects when package.json version lacks "-alpha." suffix', () => { + // If somehow the alpha release PR bumped to a non-alpha version, the script + // must fail fast before publishing. + const fakeDir = makeFakeRepo({ packageVersion: '5.0.0' }); + try { + const { exitCode, stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'alpha', + DRY_RUN: 'true', + }); + assert.notStrictEqual(exitCode, 0, `Expected non-zero exit.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`); + const combined = stdout + stderr; + assert.ok( + combined.includes('-alpha.') || combined.includes('ERROR'), + `Expected error about missing '-alpha.' suffix.\nCombined: ${combined}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +test('alpha: 4.x alpha version also accepted (4.6.3-alpha.2)', () => { + const fakeDir = makeFakeRepo({ packageVersion: '4.6.3-alpha.2' }); + try { + const { exitCode, stdout, stderr } = runBumpAndPublish(fakeDir, { + GITHUB_REF_NAME: 'alpha', + DRY_RUN: 'true', + }); + assert.strictEqual(exitCode, 0, `Expected exit 0.\nSTDOUT: ${stdout}\nSTDERR: ${stderr}`); + assert.ok( + stdout.includes('4.6.3-alpha.2'), + `Expected version 4.6.3-alpha.2 in output.\nSTDOUT: ${stdout}`, + ); + } finally { + fs.rmSync(fakeDir, { recursive: true, force: true }); + } +}); + +// ---------------------------------------------------------------------------- +// Section 6 — create-release-pr no-op safety +// ---------------------------------------------------------------------------- + +section('6. create-release-pr — no-op safety'); + +test('version bump needed: creates a commit on the release branch', () => { + // Repo starts at 4.6.3; bump target is 4.6.4 → files change → commit + const repoDir = makeFakeRepo({ packageVersion: '4.6.3' }); + try { + const res = runCreateReleasePRStep({ + repoDir, + nextVersion: '4.6.4', + releaseBranch: 'chore/release-v4.6.4', + }); + assert.strictEqual(res.exitCode, 0, `Script exited ${res.exitCode}.\nSTDOUT: ${res.stdout}\nSTDERR: ${res.stderr}`); + assert.ok(res.newCommitCreated, 'Expected a new commit when versions differ'); + assert.ok( + res.stdout.includes('STATUS:COMMITTED=true'), + `Expected COMMITTED=true status.\nSTDOUT: ${res.stdout}`, + ); + } finally { + fs.rmSync(repoDir, { recursive: true, force: true }); + } +}); + +test('no version bump needed: exits cleanly, no new commit, no gh calls', () => { + // Repo starts at 4.6.4 (target version) → no diff → no commit + const repoDir = makeFakeRepo({ packageVersion: '4.6.4' }); + try { + const res = runCreateReleasePRStep({ + repoDir, + nextVersion: '4.6.4', + releaseBranch: 'chore/release-v4.6.4', + }); + assert.strictEqual(res.exitCode, 0, `Script exited ${res.exitCode}.\nSTDOUT: ${res.stdout}\nSTDERR: ${res.stderr}`); + assert.ok(!res.newCommitCreated, 'Expected NO new commit when version is already at target'); + assert.ok( + res.stdout.includes('STATUS:NO_CHANGES'), + `Expected NO_CHANGES status.\nSTDOUT: ${res.stdout}`, + ); + assert.strictEqual( + res.ghCalls, '', + `Expected no gh commands to be invoked.\ngh calls log: ${res.ghCalls}`, + ); + } finally { + fs.rmSync(repoDir, { recursive: true, force: true }); + } +}); + +test('alpha version bump needed: commit created for alpha release branch', () => { + // Repo at 5.0.0-alpha.1; bump target is 5.0.0-alpha.2 → diff → commit + const repoDir = makeFakeRepo({ packageVersion: '5.0.0-alpha.1' }); + try { + const res = runCreateReleasePRStep({ + repoDir, + nextVersion: '5.0.0-alpha.2', + releaseBranch: 'chore/alpha-release-v5.0.0-alpha.2', + }); + assert.strictEqual(res.exitCode, 0, `Script exited ${res.exitCode}.\nSTDOUT: ${res.stdout}\nSTDERR: ${res.stderr}`); + assert.ok(res.newCommitCreated, 'Expected a new commit for alpha version bump'); + assert.ok( + res.stdout.includes('STATUS:COMMITTED=true'), + `Expected COMMITTED=true status.\nSTDOUT: ${res.stdout}`, + ); + } finally { + fs.rmSync(repoDir, { recursive: true, force: true }); + } +}); + +// ============================================================================ +// Summary +// ============================================================================ + +console.log(`\n${'─'.repeat(60)}`); +console.log(`Results: ${passed} passed, ${failed} failed`); + +if (failures.length > 0) { + console.error('\nFailed tests:'); + failures.forEach(f => console.error(` ✗ ${f.name}\n ${f.message}`)); + process.exit(1); +} else { + console.log('All release automation tests passed! ✅'); +} From d250d620adf5ff3253e7a21e124acfe830cea69c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:47:25 -0700 Subject: [PATCH 39/76] Fix `not` keyword silently ignored when used without parentheses in conditions (#4421) * Initial plan * Fix: not keyword now works without parentheses in guard conditions Previously, `boolean(not false)` silently ignored the `not` keyword while `boolean(not (false))` worked correctly. The `negatedCondition` parser function consumed the `not` keyword but only tried `parenthesisCondition`, which requires `(`. With no parens, it returned undefined with `not` already consumed, causing silent skip. Fix: fall back to `atomicCondition` when `parenthesisCondition` fails, allowing both `not false` and `not (false)` to work consistently. Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * Restrict not-without-parens to simple values only (keywords/variables) Complex conditions like `not 2 < 1` still require parentheses, keeping alignment with CSS media query syntax. Only simple bare values (keywords, variables, quoted strings) are allowed after `not` without parens: `not false`, `not @var`. Remove the `boolean(not 2 < 1)` test case that relied on the broader atomicCondition fallback. Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> Co-authored-by: Matthew Dean --- packages/less/lib/less/parser/parser.js | 12 +++++++++++- .../test-data/tests-unit/functions/functions.css | 4 ++++ .../test-data/tests-unit/functions/functions.less | 6 ++++++ .../tests-unit/mixins-guards/mixins-guards.css | 6 ++++++ .../tests-unit/mixins-guards/mixins-guards.less | 11 +++++++++++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 72014aab2..6a439fb89 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -2438,8 +2438,18 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const result = this.parenthesisCondition(needsParens); if (result) { result.negate = !result.negate; + return result; + } + + // Allow simple bare values (keyword/variable) without parens, + // e.g., `not false` or `not @var`. + // Complex conditions (comparisons, function calls) require parentheses. + const entities = this.entities; + const index = parserInput.i; + const a = entities.keyword() || entities.variable() || entities.quoted() || entities.mixinLookup(); + if (a) { + return new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, true); } - return result; } }, parenthesisCondition: function (needsParens) { diff --git a/packages/test-data/tests-unit/functions/functions.css b/packages/test-data/tests-unit/functions/functions.css index 4876f5874..17a990259 100644 --- a/packages/test-data/tests-unit/functions/functions.css +++ b/packages/test-data/tests-unit/functions/functions.css @@ -224,6 +224,8 @@ html { a: true; b: false; c: false; + d: true; + e: false; } #if { a: 1; @@ -236,6 +238,8 @@ html { i: 6; j: 8; k: 1; + m: 1; + n: 2; l: black; /* results in void */ color: green; diff --git a/packages/test-data/tests-unit/functions/functions.less b/packages/test-data/tests-unit/functions/functions.less index bc476b6e2..f11b756d2 100644 --- a/packages/test-data/tests-unit/functions/functions.less +++ b/packages/test-data/tests-unit/functions/functions.less @@ -256,6 +256,9 @@ html { a: boolean(not(2 < 1)); b: boolean(not(2 > 1) and (true)); c: boolean(not(boolean(true))); + // not without parentheses (should behave the same as with parentheses) + d: boolean(not false); + e: boolean(not true); } #if { @@ -271,6 +274,9 @@ html { i: if(true and isnumber(6), 6, 8); j: if(not(true) and true, 6, 8); k: if(true or true, 1); + // not without parentheses + m: if(not false, 1, 2); + n: if(not true, 1, 2); // see: https://github.com/less/less.js/issues/3371 @some: foo; diff --git a/packages/test-data/tests-unit/mixins-guards/mixins-guards.css b/packages/test-data/tests-unit/mixins-guards/mixins-guards.css index c54eca77e..fa164dd18 100644 --- a/packages/test-data/tests-unit/mixins-guards/mixins-guards.css +++ b/packages/test-data/tests-unit/mixins-guards/mixins-guards.css @@ -209,3 +209,9 @@ no-parenthesis: evaluated true 4; with-parenthesis: evaluated true; } +.test-not-noparens1 { + content: "not without parens true."; +} +.test-not-noparens2 { + content: "not without parens false."; +} diff --git a/packages/test-data/tests-unit/mixins-guards/mixins-guards.less b/packages/test-data/tests-unit/mixins-guards/mixins-guards.less index 834c57d2c..c52749acb 100644 --- a/packages/test-data/tests-unit/mixins-guards/mixins-guards.less +++ b/packages/test-data/tests-unit/mixins-guards/mixins-guards.less @@ -356,3 +356,14 @@ .orderOfEvaluation(true, true, false); } +// not without parentheses should work the same as not with parentheses +.test-not-noparens (@a) when not @a { + content: "not without parens false."; +} +.test-not-noparens (@a) when (@a) { + content: "not without parens true."; +} + +.test-not-noparens1 { .test-not-noparens(true) } +.test-not-noparens2 { .test-not-noparens(false) } + From ea62d748d48c1a2581cf8a80d5437ef2ed11ed77 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:49:35 -0700 Subject: [PATCH 40/76] test: regression test for @container mixin parameter variable resolution (#4420) * Initial plan * Initial plan: add regression test for container mixin parameters issue Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * test: add regression test for container mixin parameters issue (#4420) Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> Co-authored-by: Matthew Dean --- .../tests-unit/container/container.css | 18 ++++++++++++++ .../tests-unit/container/container.less | 24 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/packages/test-data/tests-unit/container/container.css b/packages/test-data/tests-unit/container/container.css index 285fd2784..dd9673c7e 100644 --- a/packages/test-data/tests-unit/container/container.css +++ b/packages/test-data/tests-unit/container/container.css @@ -273,3 +273,21 @@ font-size: 75%; } } +.mixin-container-test { + color: red; +} +@container name (width < 125px) { + .mixin-container-test { + display: none; + } +} +@container sidebar (width < 500px) { + .sidebar-test { + display: none; + } +} +@container header (width < 800px) { + .header-test { + display: none; + } +} diff --git a/packages/test-data/tests-unit/container/container.less b/packages/test-data/tests-unit/container/container.less index 5eec2f6d4..013a9e243 100644 --- a/packages/test-data/tests-unit/container/container.less +++ b/packages/test-data/tests-unit/container/container.less @@ -326,3 +326,27 @@ font-size: 75%; } } + +// Regression test: mixin with variable container name and variable query condition +// Issue: mixins with parameters using @container @name (condition < @var) failed +// with "variable @bp is undefined" error in older versions +@issue-width: 125px; + +.container-query-mixin(@container-name; @bp) { + @container @container-name (width < @bp) { + display: none; + } +} + +.mixin-container-test { + .container-query-mixin(name, @issue-width); + color: red; +} + +// Verify multiple calls with different params produce correct output +.sidebar-test { + .container-query-mixin(sidebar, 500px); +} +.header-test { + .container-query-mixin(header, 800px); +} From 060fd7f93ad897b8fec397037aee2d757e9fe8a6 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:40:29 -0700 Subject: [PATCH 41/76] fix: update packageManager to pnpm@9.15.9 to match lockfileVersion 9.0 in pnpm-lock.yaml (#4432) * Initial plan * fix: trigger create-release-pr on any push to master/alpha, not just packages/** Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> * fix: update packageManager to pnpm@9.15.9 to match lockfileVersion 9.0 Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 3 -- package.json | 2 +- scripts/test-release-automation.js | 45 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 4dbe932dd..12707ad29 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -11,9 +11,6 @@ on: branches: - master - alpha - # Only trigger for commits that touch package source files. - paths: - - 'packages/**' permissions: contents: write diff --git a/package.json b/package.json index db8e48205..4b52abba5 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,5 @@ "playwright": "1.50.1", "semver": "^6.3.1" }, - "packageManager": "pnpm@8.15.0" + "packageManager": "pnpm@9.15.9" } diff --git a/scripts/test-release-automation.js b/scripts/test-release-automation.js index 02141bd2b..94a222022 100644 --- a/scripts/test-release-automation.js +++ b/scripts/test-release-automation.js @@ -788,6 +788,51 @@ test('alpha version bump needed: commit created for alpha release branch', () => } }); +// ---------------------------------------------------------------------------- +// Section 7 — pnpm version / lockfile compatibility +// +// Guards against the recurring breakage where a contributor regenerates +// pnpm-lock.yaml with a newer pnpm but forgets to update the "packageManager" +// field in package.json. When the two are out of sync, pnpm/action-setup@v4 +// installs the (stale) version from packageManager, which then rejects the +// lockfile with ERR_PNPM_NO_LOCKFILE and the entire workflow fails. +// +// Compatibility rule (based on pnpm changelog): +// lockfileVersion 6.x → generated by pnpm 6/7/8 (pnpm <9 cannot read v9) +// lockfileVersion 9.x → generated by pnpm 9+; pnpm 8 treats it as absent +// ---------------------------------------------------------------------------- + +section('7. pnpm version / lockfile compatibility'); + +test('packageManager in package.json is compatible with pnpm-lock.yaml lockfileVersion', () => { + const rootPkg = JSON.parse(fs.readFileSync(path.join(ROOT_DIR, 'package.json'), 'utf8')); + const packageManager = rootPkg.packageManager || ''; + + const pmMatch = packageManager.match(/^pnpm@(\d+)\./); + assert.ok( + pmMatch, + `packageManager field should be "pnpm@X.Y.Z", got: "${packageManager}"`, + ); + const pnpmMajor = parseInt(pmMatch[1], 10); + + const lockfilePath = path.join(ROOT_DIR, 'pnpm-lock.yaml'); + const lockfileContent = fs.readFileSync(lockfilePath, 'utf8'); + const lockVersionMatch = lockfileContent.match(/^lockfileVersion:\s+'?(\d+)/m); + assert.ok(lockVersionMatch, 'Could not find lockfileVersion in pnpm-lock.yaml'); + const lockfileMajor = parseInt(lockVersionMatch[1], 10); + + // lockfileVersion 9 was introduced in pnpm 9. pnpm 8 ignores it entirely + // (ERR_PNPM_NO_LOCKFILE), which is what broke create-release-pr.yml. + if (lockfileMajor >= 9) { + assert.ok( + pnpmMajor >= 9, + `pnpm-lock.yaml uses lockfileVersion ${lockVersionMatch[1]} which requires pnpm 9+, ` + + `but packageManager is "${packageManager}". ` + + `Update packageManager in package.json to match the pnpm version used to generate the lockfile.`, + ); + } +}); + // ============================================================================ // Summary // ============================================================================ From c228e525c93b7da1c4b6fed0bf093425c800d6b0 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Thu, 11 Jun 2026 13:14:29 -0700 Subject: [PATCH 42/76] ci: fix Playwright chromium install hang on Node current/lts/* (#4445) * ci: fix Playwright chromium install hang on Node current/lts/* The `playwright install chromium` step was hanging for 1h+ on jobs using Node `current` and `lts/*` after the 163 MiB download completed (post-download extraction/setup blocked indefinitely). Fixes: - Add `timeout-minutes: 5` to fail fast instead of burning a runner for 6 hours - Add `--with-deps` to install required system libraries (likely cause of the hang) - Cache Playwright browser binaries via `actions/cache` using `PLAYWRIGHT_BROWSERS_PATH` pointed at `${{ github.workspace }}/.playwright-browsers` (cross-platform) Older LTS jobs (lts/-1, lts/-2, lts/-3) were unaffected and completed fine. * Refactor CI workflow for improved clarity The `Install chromium` step was causing CI to hang indefinitely on Node current/lts/* (and timeout when we added a 5-min limit). Root cause: `test:node` only runs grunt node tests and has no browser dependency, so installing Chromium was never necessary in the first place. Also drops the unused `env: PLAYWRIGHT_BROWSERS_PATH` and `actions/cache` step added in the previous commit. --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25888bbec..62c97adad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,6 @@ jobs: - name: Install dependencies run: pnpm install - name: Print put node & npm version - run: node --version && pnpm --version - - name: Install chromium - run: pnpm exec playwright install chromium + run: node --version && pnpm --version - name: Run node tests (ESM + CJS) run: pnpm run test:node From c573ab6ad804d084249cb677d38ad58325a2912d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:32:02 -0700 Subject: [PATCH 43/76] Fix browser export interop by routing bundlers to CJS-typed UMD artifact (#4444) * Initial plan * Fix browser export to CJS dist entry for bundler interop --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Matthew Dean --- packages/less/build/rollup.js | 11 +++++++++++ packages/less/package.json | 3 ++- packages/less/test/exports/import-patterns.cjs | 10 +++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/less/build/rollup.js b/packages/less/build/rollup.js index ddc545ab3..36c5313eb 100644 --- a/packages/less/build/rollup.js +++ b/packages/less/build/rollup.js @@ -117,6 +117,17 @@ async function buildBrowser() { name: 'less', banner }); + + if (!args.out) { + const cjsFile = `${outDir}/less.cjs`; + console.log(`Writing ${cjsFile}...`); + await bundle.write({ + file: path.join(rootPath, cjsFile), + format: 'umd', + name: 'less', + banner + }); + } } if (!args.out || args.out.indexOf('less.min.js') > -1) { diff --git a/packages/less/package.json b/packages/less/package.json index f07a318f3..82c966849 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -29,13 +29,14 @@ "main": "./dist/less-node.cjs", "exports": { ".": { - "browser": "./dist/less.js", + "browser": "./dist/less.cjs", "import": "./lib/less-node/index.js", "require": "./dist/less-node.cjs", "default": "./lib/less-node/index.js" }, "./lib/*": "./lib/*", "./dist/less-node.cjs": "./dist/less-node.cjs", + "./dist/less.cjs": "./dist/less.cjs", "./dist/less.js": "./dist/less.js", "./dist/less.min.js": "./dist/less.min.js" }, diff --git a/packages/less/test/exports/import-patterns.cjs b/packages/less/test/exports/import-patterns.cjs index 9cafdb292..cd0613c0c 100644 --- a/packages/less/test/exports/import-patterns.cjs +++ b/packages/less/test/exports/import-patterns.cjs @@ -18,11 +18,15 @@ if (!exp?.['.']?.browser) { console.error('FAIL: exports.browser required (webpack: import less from "less")'); process.exit(1); } -if (!fs.existsSync(path.join(__dirname, '../../dist/less.js'))) { - console.error('FAIL: dist/less.js not found (run "npm run build" first)'); +if (exp['.'].browser !== './dist/less.cjs') { + console.error(`FAIL: exports.browser must point to "./dist/less.cjs", got "${exp['.'].browser}"`); + process.exit(1); +} +if (!fs.existsSync(path.join(__dirname, '../../dist/less.cjs'))) { + console.error('FAIL: dist/less.cjs not found (run "npm run build" first)'); process.exit(1); } console.log('✓ exports support: import less from "less" (Node/ESM)'); console.log('✓ exports support: require("less") (Node/CJS)'); -console.log('✓ exports support: import less from "less" (webpack browser → dist/less.js UMD)'); +console.log('✓ exports support: import less from "less" (bundler browser → dist/less.cjs UMD)'); From f4a63f260ca5516c73da4f365a3ffda566f1d1e9 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Thu, 11 Jun 2026 15:45:32 -0700 Subject: [PATCH 44/76] Add Copilot review request job to CI workflow Added a new job to request Copilot review for pull requests. --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62c97adad..3ddcfca86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,20 @@ jobs: run: node --version && pnpm --version - name: Run node tests (ESM + CJS) run: pnpm run test:node + + copilot-review: + name: Request Copilot review + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened') + permissions: + pull-requests: write + steps: + - name: Request Copilot review + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ + -f "reviewers[]=copilot-pull-request-reviewer" From a5f115b29ae56cc512e935021a087bf95abcbe2b Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sat, 13 Jun 2026 14:17:16 -0700 Subject: [PATCH 45/76] fix: add continue-on-error to copilot-review CI job (#4448) Updated CI workflow to include 'continue-on-error' for copilot-review job. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ddcfca86..5dc72eb67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: copilot-review: name: Request Copilot review runs-on: ubuntu-latest + continue-on-error: true if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened') permissions: pull-requests: write From a5b62c8f2713c169cf54cad9683652583bfb0cf0 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sat, 13 Jun 2026 14:33:14 -0700 Subject: [PATCH 46/76] chore: automate CHANGELOG generation in release workflow (#4447) * chore: automate CHANGELOG generation in release workflow Updated comments for clarity and consistency in the release PR workflow. * fix: correct bash escaping in PR body template Fix typo in push event and update release message format. --- .github/workflows/create-release-pr.yml | 107 +++++++++++++++--------- 1 file changed, 66 insertions(+), 41 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 12707ad29..fd3f32193 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -2,12 +2,12 @@ name: Create Release PR # When code lands on master or alpha (not a release PR merge itself), # automatically create or update a release pull request that bumps the -# version. Maintainers then merge that PR to trigger publishing. +# version. Maintainers then merge that PR to trigger publishing. # -# master → "chore: release vX.Y.Z" PR targets master -# alpha → "chore: alpha release vX.Y.Z" PR targets alpha +# master → "chore: release vX.Y.Z" PR targets master +# alpha → "chore: alpha release vX.Y.Z" PR targets alpha on: - push: + pus branches: - master - alpha @@ -21,7 +21,7 @@ jobs: name: Create or Update Release PR runs-on: ubuntu-latest # Skip if this push is itself the merge of a release PR (prevents an - # infinite loop). We catch both squash-merged and regular-merged commits + # infinite loop). We catch both squash-merged and regular-merged commits # for both the master and alpha release PR title conventions. if: | github.repository == 'less/less.js' && @@ -60,15 +60,15 @@ jobs: # If package.json doesn't carry an alpha version yet, bump the # major and start a fresh alpha.1 series. NEXT=$(node -e " - const cur = process.argv[1]; - const m = cur.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); - if (m) { - process.stdout.write(m[1] + '-alpha.' + (parseInt(m[2], 10) + 1)); - } else { - const parts = cur.replace(/-.*/, '').split('.'); - const nextMajor = parseInt(parts[0], 10) + 1; - process.stdout.write(nextMajor + '.0.0-alpha.1'); - } + const cur = process.argv[1]; + const m = cur.match(/^(\\d+\\.\\d+\\.\\d+)-alpha\\.(\\d+)$/); + if (m) { + process.stdout.write(m[1] + '-alpha.' + (parseInt(m[2], 10) + 1)); + } else { + const parts = cur.replace(/-.*/, '').split('.'); + const nextMajor = parseInt(parts[0], 10) + 1; + process.stdout.write(nextMajor + '.0.0-alpha.1'); + } " "$CURRENT") echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" echo "branch=chore/alpha-release-v$NEXT" >> "$GITHUB_OUTPUT" @@ -77,15 +77,15 @@ jobs: # Master: patch-increment from the latest npm published version. NPM_VERSION=$(npm view less version 2>/dev/null || echo "") NEXT=$(node -e " - const semver = require('semver'); - const cur = process.argv[1]; - const npm = process.argv[2] || null; - if (npm && semver.valid(cur) && semver.gt(cur, npm)) { - process.stdout.write(cur); - } else { - const base = npm || cur; - process.stdout.write(semver.inc(base, 'patch')); - } + const semver = require('semver'); + const cur = process.argv[1]; + const npm = process.argv[2] || null; + if (npm && semver.valid(cur) && semver.gt(cur, npm)) { + process.stdout.write(cur); + } else { + const base = npm || cur; + process.stdout.write(semver.inc(base, 'patch')); + } " "$CURRENT" "$NPM_VERSION") echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" echo "branch=chore/release-v$NEXT" >> "$GITHUB_OUTPUT" @@ -122,20 +122,49 @@ jobs: # Bump version in all package.json files. node -e " - const fs = require('fs'); - const version = process.env.NEXT_VERSION; - const dirs = fs.readdirSync('packages', { withFileTypes: true }) - .filter(d => d.isDirectory()) - .map(d => 'packages/' + d.name + '/package.json'); - for (const f of ['package.json', ...dirs].filter(f => fs.existsSync(f))) { - const pkg = JSON.parse(fs.readFileSync(f, 'utf8')); - if (!pkg.version) continue; - pkg.version = version; - fs.writeFileSync(f, JSON.stringify(pkg, null, '\t') + '\n'); - } + const fs = require('fs'); + const version = process.env.NEXT_VERSION; + const dirs = fs.readdirSync('packages', { withFileTypes: true }) + .filter(d => d.isDirectory()) + .map(d => 'packages/' + d.name + '/package.json'); + for (const f of ['package.json', ...dirs].filter(f => fs.existsSync(f))) { + const pkg = JSON.parse(fs.readFileSync(f, 'utf8')); + if (!pkg.version) continue; + pkg.version = version; + fs.writeFileSync(f, JSON.stringify(pkg, null, '\t') + '\n'); + } " git add package.json packages/*/package.json + + # Auto-generate CHANGELOG entry from merged PRs since last tag. + LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + if [ -n "$LAST_TAG" ]; then + LAST_TAG_DATE=$(git log -1 --format=%aI "$LAST_TAG") + PR_LINES=$(gh pr list \ + --state merged \ + --base "${RELEASE_BASE}" \ + --search "merged:>${LAST_TAG_DATE}" \ + --json number,title,author \ + --jq '.[] | "- [#\(.number)](https://github.com/${{ github.repository }}/pull/\(.number)) \(.title) (@\(.author.login))"' \ + 2>/dev/null || echo "") + if [ -n "$PR_LINES" ]; then + TODAY=$(date +%Y-%m-%d) + { + head -1 CHANGELOG.md + echo "" + echo "### v${NEXT_VERSION} (${TODAY})" + echo "" + echo "#### Changes" + echo "" + echo "$PR_LINES" + echo "" + tail -n +2 CHANGELOG.md + } > CHANGELOG.tmp && mv CHANGELOG.tmp CHANGELOG.md + git add CHANGELOG.md + fi + fi + COMMITTED=false if git diff --cached --quiet; then echo "No version changes; branch is already at v${NEXT_VERSION}" @@ -146,7 +175,7 @@ jobs: # If no new commit was created the release branch has no commits # ahead of master, so pushing it and trying to open a PR would fail - # with "no commits between head and base". Instead, just report + # with "no commits between head and base". Instead, just report # whether an existing release PR is open and exit cleanly. if [ "$COMMITTED" = "false" ]; then EXISTING=$(gh pr list --head "${RELEASE_BRANCH}" --base "${RELEASE_BASE}" \ @@ -161,7 +190,7 @@ jobs: # --force-with-lease refuses to overwrite if the remote has advanced # past what we fetched, which protects against concurrent workflow - # runs. This is intentional: if two code PRs land simultaneously the + # runs. This is intentional: if two code PRs land simultaneously the # second run will fail-fast here and the release branch stays coherent. git push origin "${RELEASE_BRANCH}" --force-with-lease @@ -172,11 +201,7 @@ jobs: if [ -z "${EXISTING}" ]; then BODY="## Release v${NEXT_VERSION} - This PR bumps the version to \`${NEXT_VERSION}\` and will trigger an npm publish when merged. - - **Before merging:** - - [ ] Update CHANGELOG.md with changes for this release - - [ ] Verify all CI checks pass" +This PR bumps the version to \`${NEXT_VERSION}\` and will trigger an npm publish when merged." gh pr create \ --title "${TITLE}" \ From b092bd2f6e962eee261b726491910eb9e810ef21 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:29:11 -0700 Subject: [PATCH 47/76] chore: release v4.6.5 (#4436) * chore: release v4.6.5 * docs: add CHANGELOG entries for v4.6.1 through v4.6.5 --------- Co-authored-by: github-actions[bot] Co-authored-by: Matthew Dean --- CHANGELOG.md | 44 ++++++++++++++++++++++++ package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1681e1f43..0a0573b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,49 @@ ## Change Log +### v4.6.5 (2026-06-13) + +#### Bug Fixes + +- [#4444](https://github.com/less/less.js/pull/4444) Fix browser export interop by routing bundlers to CJS-typed UMD artifact (@Copilot) +- [#4427](https://github.com/less/less.js/pull/4427) Fix parenthesis in media query (@puckowski) +- [#4421](https://github.com/less/less.js/pull/4421) Fix `not` keyword silently ignored when used without parentheses in conditions (@Copilot) +- [#4426](https://github.com/less/less.js/pull/4426) Upgrade make-dir to v4 to fix security vulnerability (@jorenbroekema) + +#### Maintenance + +- [#4447](https://github.com/less/less.js/pull/4447) Automate CHANGELOG generation in release workflow (@matthew-dean) +- [#4448](https://github.com/less/less.js/pull/4448) Add continue-on-error to copilot-review CI job (@matthew-dean) +- [#4445](https://github.com/less/less.js/pull/4445) Fix Playwright chromium install hang on Node current/lts/* (@matthew-dean) +- [#4431](https://github.com/less/less.js/pull/4431) PR-based release flow for alpha branches (@Copilot) +- [#4430](https://github.com/less/less.js/pull/4430) Ensure npm publish is always backed by a GitHub tag, release, and version-bump commit (@Copilot) +- [#4432](https://github.com/less/less.js/pull/4432) Update packageManager to pnpm@9.15.9 to match lockfileVersion 9.0 (@Copilot) +- [#4420](https://github.com/less/less.js/pull/4420) Regression test for @container mixin parameter variable resolution (@Copilot) + +### v4.6.4 (2026-03-13) + +#### Tests + +- [#4422](https://github.com/less/less.js/pull/4422) Add coverage for `:is()`/`:matches()`/`:where()` containing nested `:has()` selectors and comma-separated lists (@Copilot) + +### v4.6.3 (2026-03-11) + +#### Bug Fixes + +- [#4424](https://github.com/less/less.js/pull/4424) Fix webpack browser build - use UMD dist/less.js, add CJS bundle (@matthew-dean) + +### v4.6.2 (2026-03-10) + +#### Maintenance + +- [#4418](https://github.com/less/less.js/pull/4418) Fix publish script to skip stale version markers in squash merges (@matthew-dean) +- [#4419](https://github.com/less/less.js/pull/4419) Remove .claude directory and add to .gitignore (@matthew-dean) + +### v4.6.1 (2026-03-10) + +#### Bug Fixes + +- [#4417](https://github.com/less/less.js/pull/4417) Fix CJS compatibility, enriched npm README, ESM tests (@matthew-dean) + ### v4.6.0 (2026-03-09) #### Bug Fixes diff --git a/package.json b/package.json index 4b52abba5..3c9b49bfa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.6.3", + "version": "4.6.5", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index 82c966849..a9b9db7ee 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.6.3", + "version": "4.6.5", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index dc3ba8813..68d6aae68 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.6.3", + "version": "4.6.5", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 4f1d74c04..d2ad9a565 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.6.3", + "version": "4.6.5", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ From 7a0dd6d54650a46c42b29553dfb05059e96e31f2 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sat, 13 Jun 2026 16:39:02 -0700 Subject: [PATCH 48/76] =?UTF-8?q?fix:=20correct=20push=20event=20typo=20in?= =?UTF-8?q?=20create-release-pr=20workflow=20(pus=20=E2=86=92=20push:)=20(?= =?UTF-8?q?#4449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index fd3f32193..ae06639c6 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -7,7 +7,7 @@ name: Create Release PR # master → "chore: release vX.Y.Z" PR targets master # alpha → "chore: alpha release vX.Y.Z" PR targets alpha on: - pus + push: branches: - master - alpha From d904698d52f8797c39b43bc2f13d7c8cbc74632e Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sat, 13 Jun 2026 16:54:33 -0700 Subject: [PATCH 49/76] fix: use printf for PR body to avoid YAML indentation error in run block (#4450) Removed redundant line from PR body in release workflow. --- .github/workflows/create-release-pr.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index ae06639c6..6b27cfff4 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -199,9 +199,7 @@ jobs: --json number --jq '.[0].number' 2>/dev/null || echo "") if [ -z "${EXISTING}" ]; then - BODY="## Release v${NEXT_VERSION} - -This PR bumps the version to \`${NEXT_VERSION}\` and will trigger an npm publish when merged." + BODY=$(printf '## Release v%s\n\nThis PR bumps the version to `%s` and will trigger an npm publish when merged.' "${NEXT_VERSION}" "${NEXT_VERSION}") gh pr create \ --title "${TITLE}" \ From 06428b38cb772745803b33cc456c5c293740e782 Mon Sep 17 00:00:00 2001 From: Barry <100205797+barry3406@users.noreply.github.com> Date: Sun, 14 Jun 2026 07:55:03 +0800 Subject: [PATCH 50/76] docs: fix incorrect contributor attributions in v4.6.0 changelog (#4437) Seven entries under v4.6.0 credited @nicolo-ribaudo for PRs authored by other contributors. Updated each entry to match the actual PR author. Fixes #4428 --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0573b97..f86917f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,9 +53,9 @@ - [#4407](https://github.com/less/less.js/pull/4407) Fix [#4331](https://github.com/less/less.js/issues/4331) Exclude CSS at-rule keywords from declarationCall parsing (@matthew-dean) - [#4389](https://github.com/less/less.js/pull/4389) Fix [#4354](https://github.com/less/less.js/issues/4354) Unknown at-rule expression commas (@puckowski) - [#4404](https://github.com/less/less.js/pull/4404) Fix no-prototype-builtins issues in Ruleset and ToCSSVisitor (@matthew-dean) -- [#4236](https://github.com/less/less.js/pull/4236) Fix import subpath module bug (@nicolo-ribaudo) -- [#4327](https://github.com/less/less.js/pull/4327) Remove duplicate length check from expression.genCSS() (@nicolo-ribaudo) -- [#3791](https://github.com/less/less.js/pull/3791) Handle the lack of optional dependencies (@nicolo-ribaudo) +- [#4236](https://github.com/less/less.js/pull/4236) Fix import subpath module bug (@HridoyHazard) +- [#4327](https://github.com/less/less.js/pull/4327) Remove duplicate length check from expression.genCSS() (@Krinkle) +- [#3791](https://github.com/less/less.js/pull/3791) Handle the lack of optional dependencies (@mems) #### Features & Improvements @@ -73,10 +73,10 @@ - [#4406](https://github.com/less/less.js/pull/4406) Add test for number with underscore parsing (@matthew-dean) - [#4386](https://github.com/less/less.js/pull/4386) Update README.md copyright (@matthew-dean) -- [#3782](https://github.com/less/less.js/pull/3782) Remove phantom stuff (@nicolo-ribaudo) -- [#3702](https://github.com/less/less.js/pull/3702) Replace deprecated String.prototype.substr() (@nicolo-ribaudo) -- [#4265](https://github.com/less/less.js/pull/4265) Remove redundant return from parsers.blockRuleset() (@nicolo-ribaudo) -- [#4271](https://github.com/less/less.js/pull/4271) Remove unused parsers.entities.propertyCurly() (@nicolo-ribaudo) +- [#3782](https://github.com/less/less.js/pull/3782) Remove phantom stuff (@jimmywarting) +- [#3702](https://github.com/less/less.js/pull/3702) Replace deprecated String.prototype.substr() (@CommanderRoot) +- [#4265](https://github.com/less/less.js/pull/4265) Remove redundant return from parsers.blockRuleset() (@Krinkle) +- [#4271](https://github.com/less/less.js/pull/4271) Remove unused parsers.entities.propertyCurly() (@Krinkle) ### v4.5.1 (2025-12-28) From eeb335a5ff6174fb6e19824bc9933eecaffc652a Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sat, 13 Jun 2026 20:07:24 -0400 Subject: [PATCH 51/76] chore: prevent dependency lifecycle scripts (#4440) * chore: prevent dependency lifecycle scripts * Prevent dependency lifecycle scripts during CI work. * fix: partial revert for CI run * Partial revert of CI run; keep only frozen lockfile so CI can complete. * fix: CI hang on chromium install * Fix CI hang on chromium install; should not be needed for CI test purposes. * chore: re-add dependency script ignore for CI * Re-add dependency script ignore for CI now that chromium hang is resolved and CI can complete. --------- Co-authored-by: Matthew Dean --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/publish.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dc72eb67..d756ebcbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: node-version: ${{ matrix.node }} cache: 'pnpm' - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile --ignore-scripts - name: Print put node & npm version run: node --version && pnpm --version - name: Run node tests (ESM + CJS) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 6b27cfff4..d43addf38 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -46,7 +46,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install --frozen-lockfile --ignore-scripts - name: Determine next version id: version diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9c02fb7c9..f25ae6fe7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,7 +52,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install --frozen-lockfile --ignore-scripts - name: Run node tests (ESM + CJS) run: pnpm run test:node From 83bc8d40ac1f018945879dacc9c6ec04b9fc6a59 Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sat, 13 Jun 2026 20:08:57 -0400 Subject: [PATCH 52/76] fix(issue#4316): color calc inside from expression (#4434) * Fix color calc() inside from expression parsing issues. * Add tests for #4316. Co-authored-by: Matthew Dean --- packages/less/lib/less/parser/parser.js | 4 ++-- packages/test-data/tests-unit/color-functions/modern.css | 6 ++++++ packages/test-data/tests-unit/color-functions/modern.less | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 6a439fb89..23aa54d6b 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -2283,10 +2283,10 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.save(); // hsl or rgb or lch operand - const match = parserInput.$re(/^[lchrgbs]\s+/); + const match = parserInput.$re(/^([lchrgbs])(?=\s|[,/*)]|$)/); if (match) { parserInput.forget(); - return new tree.Keyword(match[0]); + return new tree.Keyword(match[1]); } parserInput.restore(); diff --git a/packages/test-data/tests-unit/color-functions/modern.css b/packages/test-data/tests-unit/color-functions/modern.css index ed84e9002..bdf2626a4 100644 --- a/packages/test-data/tests-unit/color-functions/modern.css +++ b/packages/test-data/tests-unit/color-functions/modern.css @@ -34,3 +34,9 @@ .color-rgb-div { background: rgb(from #0000FF calc(r / 2) g b); } +.color-rgb-sub-right-operand { + background: rgb(from blue calc(100 - r) g b); +} +.color-rgb-add-left-operand { + background: rgb(from blue calc(r + 100) g b); +} diff --git a/packages/test-data/tests-unit/color-functions/modern.less b/packages/test-data/tests-unit/color-functions/modern.less index cf04e2c9b..23445d125 100644 --- a/packages/test-data/tests-unit/color-functions/modern.less +++ b/packages/test-data/tests-unit/color-functions/modern.less @@ -46,3 +46,11 @@ .color-rgb-div { background: rgb(from #0000FF calc(r / 2) g b); } + +.color-rgb-sub-right-operand { + background: rgb(from blue calc(100 - r) g b); +} + +.color-rgb-add-left-operand { + background: rgb(from blue calc(r + 100) g b); +} From d03e7a45b627d235cb9c6d1a7cf0ba79d04d0391 Mon Sep 17 00:00:00 2001 From: Sarath Francis Date: Sat, 13 Jun 2026 20:10:03 -0400 Subject: [PATCH 53/76] fix: avoid crash on nested @supports with dumpLineNumbers (#4446) A nested @supports (or @document) builds an implicit, non-root ruleset that never gets a debugInfo attached during parsing. With dumpLineNumbers enabled, genCSS tried to read lineNumber/fileName off that missing debugInfo and threw a TypeError instead of producing output. Skip emitting debug info when a node has none, the same way nodes without a recorded line are already handled elsewhere. --- packages/less/lib/less/tree/debug-info.js | 4 +++- .../tests-config/debug/all/linenumbers-all.css | 10 ++++++++++ .../debug/comments/linenumbers-comments.css | 9 +++++++++ packages/test-data/tests-config/debug/linenumbers.less | 9 +++++++++ .../debug/mediaquery/linenumbers-mediaquery.css | 9 +++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) diff --git a/packages/less/lib/less/tree/debug-info.js b/packages/less/lib/less/tree/debug-info.js index 6c2c34fee..2900e249d 100644 --- a/packages/less/lib/less/tree/debug-info.js +++ b/packages/less/lib/less/tree/debug-info.js @@ -59,7 +59,9 @@ function asMediaQuery(ctx) { */ function debugInfo(context, ctx, lineSeparator) { let result = ''; - if (context.dumpLineNumbers && !context.compress) { + // Some nodes never receive a debugInfo during parsing (e.g. the implicit + // ruleset of a nested @supports/@document), so there is no line to emit. + if (context.dumpLineNumbers && !context.compress && ctx.debugInfo) { switch (context.dumpLineNumbers) { case 'comments': result = asComment(ctx); diff --git a/packages/test-data/tests-config/debug/all/linenumbers-all.css b/packages/test-data/tests-config/debug/all/linenumbers-all.css index fe107c958..504e5f711 100644 --- a/packages/test-data/tests-config/debug/all/linenumbers-all.css +++ b/packages/test-data/tests-config/debug/all/linenumbers-all.css @@ -47,3 +47,13 @@ color: red; width: 2; } +@supports (display: grid) { + .supports-rule { + color: green; + } + /* line 38, {path}linenumbers.less */ + @media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000338}} + .supports-rule .nested-supports { + color: blue; + } +} diff --git a/packages/test-data/tests-config/debug/comments/linenumbers-comments.css b/packages/test-data/tests-config/debug/comments/linenumbers-comments.css index 083d93ee6..8a54a5e5a 100644 --- a/packages/test-data/tests-config/debug/comments/linenumbers-comments.css +++ b/packages/test-data/tests-config/debug/comments/linenumbers-comments.css @@ -38,3 +38,12 @@ color: red; width: 2; } +@supports (display: grid) { + .supports-rule { + color: green; + } + /* line 38, {path}linenumbers.less */ + .supports-rule .nested-supports { + color: blue; + } +} diff --git a/packages/test-data/tests-config/debug/linenumbers.less b/packages/test-data/tests-config/debug/linenumbers.less index b3760d40f..65642e400 100644 --- a/packages/test-data/tests-config/debug/linenumbers.less +++ b/packages/test-data/tests-config/debug/linenumbers.less @@ -30,4 +30,13 @@ width: 2; } } +} + +.supports-rule { + @supports (display: grid) { + color: green; + .nested-supports { + color: blue; + } + } } \ No newline at end of file diff --git a/packages/test-data/tests-config/debug/mediaquery/linenumbers-mediaquery.css b/packages/test-data/tests-config/debug/mediaquery/linenumbers-mediaquery.css index 488b29e5a..9b32a8630 100644 --- a/packages/test-data/tests-config/debug/mediaquery/linenumbers-mediaquery.css +++ b/packages/test-data/tests-config/debug/mediaquery/linenumbers-mediaquery.css @@ -38,3 +38,12 @@ color: red; width: 2; } +@supports (display: grid) { + .supports-rule { + color: green; + } + @media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000338}} + .supports-rule .nested-supports { + color: blue; + } +} From 888f6877beb98e197eba5fa1c19f3bc9f29ba92c Mon Sep 17 00:00:00 2001 From: Puneet Dixit Date: Sun, 14 Jun 2026 05:44:53 +0530 Subject: [PATCH 54/76] Preserve spacing for container feature functions (#4441) * Preserve container feature function spacing Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> * Handle non-ASCII container names --------- Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> Co-authored-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> --- packages/less/lib/less/parser/parser.js | 31 +++++++++-- .../tests-unit/container/container.css | 45 ++++++++++++++++ .../tests-unit/container/container.less | 54 +++++++++++++++++++ 3 files changed, 125 insertions(+), 5 deletions(-) diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 23aa54d6b..2e3edb2a8 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -1875,15 +1875,21 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { let p; let rangeP; let spacing = false; + const cssKeyword = () => { + const k = parserInput.$re(/^(?:--|-?(?:[_a-zA-Z0-9]|[^\0-\x7F]|\\[0-9a-fA-F]{1,6}\s?|\\[^\n\r\f0-9a-fA-F]))(?:[-_a-zA-Z0-9]|[^\0-\x7F]|\\[0-9a-fA-F]{1,6}\s?|\\[^\n\r\f0-9a-fA-F])*/); + if (k) { + return tree.Color.fromKeyword(k) || new(tree.Keyword)(k); + } + }; parserInput.save(); do { parserInput.save(); - if (parserInput.$re(/^[0-9a-z-]*\s+\(/)) { + if (parserInput.$re(/^(?:--|-?(?:[_a-zA-Z0-9]|[^\0-\x7F]|\\[0-9a-fA-F]{1,6}\s?|\\[^\n\r\f0-9a-fA-F]))(?:[-_a-zA-Z0-9]|[^\0-\x7F]|\\[0-9a-fA-F]{1,6}\s?|\\[^\n\r\f0-9a-fA-F])*\s+\(/)) { spacing = true; } parserInput.restore(); - e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup() + e = entities.declarationCall.bind(this)() || cssKeyword() || entities.keyword() || entities.variable() || entities.mixinLookup() if (e) { nodes.push(e); if (e.type === 'Variable' || @@ -1920,7 +1926,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } if (closed) { if (p && !e) { - nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index))); + const paren = new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)); + if (!spacing) { + paren.noSpacing = true; + } + nodes.push(paren); e = p; } else if (p && e) { nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true))); @@ -1929,7 +1939,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } spacing = false; } else if (e) { - nodes.push(new(tree.Paren)(e)); + const paren = new(tree.Paren)(e); + if (!spacing) { + paren.noSpacing = true; + } + nodes.push(paren); spacing = false; } else { error('badly formed media feature definition'); @@ -1942,7 +1956,14 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.forget(); if (nodes.length > 0) { - return new(tree.Expression)(nodes); + const expression = new(tree.Expression)(nodes); + if (nodes.length === 2 + && (nodes[0].type === 'Keyword' || nodes[0].type === 'Variable') + && nodes[1].type === 'Paren' + && nodes[1].noSpacing) { + expression.noSpacing = true; + } + return expression; } }, diff --git a/packages/test-data/tests-unit/container/container.css b/packages/test-data/tests-unit/container/container.css index dd9673c7e..f13b3ae99 100644 --- a/packages/test-data/tests-unit/container/container.css +++ b/packages/test-data/tests-unit/container/container.css @@ -130,6 +130,46 @@ margin: 0.5em 0 0 0; } } +@container card (width > 400px), style(--responsive: true), scroll-state(stuck: top) { + h2 { + font-size: 1.5em; + } +} +@container style(--theme) { + .style-query { + color: red; + } +} +@container style((--theme: one) or (--theme: two)) { + .style-query-list { + color: blue; + } +} +@container contactBody (min-width: 1300px) { + .named-container { + width: 25%; + } +} +@container _body (min-width: 1300px) { + .underscored-container { + width: 25%; + } +} +@container --body (min-width: 1300px) { + .custom-ident-container { + width: 25%; + } +} +@container contact\.body (min-width: 1300px) { + .escaped-container { + width: 25%; + } +} +@container café (min-width: 1300px) { + .nonascii-container { + width: 25%; + } +} @container (width < 500px) or (height < 500px) and (orientation: portrait) { .card-content p { padding: 0; @@ -268,6 +308,11 @@ font-size: 75%; } } +@container sidebar (min-width: 400px), scroll-state(stuck: top) { + #sticky-child { + font-size: 80%; + } +} @container foo (min-width: 400px) { #sticky-child { font-size: 75%; diff --git a/packages/test-data/tests-unit/container/container.less b/packages/test-data/tests-unit/container/container.less index 013a9e243..4eeb8958c 100644 --- a/packages/test-data/tests-unit/container/container.less +++ b/packages/test-data/tests-unit/container/container.less @@ -159,6 +159,54 @@ } } +@container card (width > 400px), style(--responsive: true), scroll-state(stuck: top) { + h2 { + font-size: 1.5em; + } +} + +@container style(--theme) { + .style-query { + color: red; + } +} + +@container style((--theme: one) or (--theme: two)) { + .style-query-list { + color: blue; + } +} + +@container contactBody (min-width: 1300px) { + .named-container { + width: 25%; + } +} + +@container _body (min-width: 1300px) { + .underscored-container { + width: 25%; + } +} + +@container --body (min-width: 1300px) { + .custom-ident-container { + width: 25%; + } +} + +@container contact\.body (min-width: 1300px) { + .escaped-container { + width: 25%; + } +} + +@container café (min-width: 1300px) { + .nonascii-container { + width: 25%; + } +} + @container ( width < 500px ) or (height<500px) and (orientation: portrait) { .card-content p { padding: 0; @@ -319,6 +367,12 @@ } } +@container sidebar (min-width: 400px), scroll-state(stuck: top) { + #sticky-child { + font-size: 80%; + } +} + @varfoo: foo; @threshold: 400px; @container @varfoo (min-width: @threshold) { From 7787557868fea018095936c31f3d65588453f4b3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:17:43 -0700 Subject: [PATCH 55/76] chore: release v4.6.6 (#4451) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f86917f9a..025462cd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ ## Change Log +### v4.6.6 (2026-06-14) + +#### Changes + +- [#4450](https://github.com/less/less.js/pull/4450) fix: use printf for PR body to avoid YAML indentation error in run block (@matthew-dean) +- [#4449](https://github.com/less/less.js/pull/4449) fix: correct push event typo in create-release-pr workflow (pus → push:) (@matthew-dean) +- [#4446](https://github.com/less/less.js/pull/4446) fix: avoid TypeError on nested @supports with dumpLineNumbers (@sarathfrancis90) +- [#4441](https://github.com/less/less.js/pull/4441) Preserve spacing for container feature functions (@puneetdixit200) +- [#4440](https://github.com/less/less.js/pull/4440) chore: prevent dependency lifecycle scripts (@puckowski) +- [#4437](https://github.com/less/less.js/pull/4437) docs: fix incorrect contributor attributions in v4.6.0 changelog (@barry3406) +- [#4434](https://github.com/less/less.js/pull/4434) fix(issue#4316): color calc inside from expression (@puckowski) + + ### v4.6.5 (2026-06-13) #### Bug Fixes diff --git a/package.json b/package.json index 3c9b49bfa..b696eee48 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.6.5", + "version": "4.6.6", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index a9b9db7ee..1cd06a079 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.6.5", + "version": "4.6.6", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 68d6aae68..bd4e9fdee 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.6.5", + "version": "4.6.6", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index d2ad9a565..3e6491681 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.6.5", + "version": "4.6.6", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ From 91b29195bfcf7e9abc2c8be000ba39f013dc864e Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Jun 2026 15:02:57 -0700 Subject: [PATCH 56/76] Fix failing "Request Copilot review" CI job (#4457) * Initial plan * Fix failing Request Copilot review CI job by handling 403 gracefully --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d756ebcbc..fa1be8a14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,4 +60,5 @@ jobs: --method POST \ -H "Accept: application/vnd.github+json" \ /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ - -f "reviewers[]=copilot-pull-request-reviewer" + -f "reviewers[]=copilot-pull-request-reviewer" \ + || echo "::warning::Could not request Copilot review (the token may lack pull-requests: write access, or Copilot PR reviews may not be enabled for this repository)" From 8ae2cc3bfa79f0718ad6fe5f263a1d6819fe9d5c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:31:32 -0700 Subject: [PATCH 57/76] chore: release v4.6.7 (#4458) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 025462cd1..5d9ed67ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## Change Log +### v4.6.7 (2026-06-20) + +#### Changes + +- [#4457](https://github.com/less/less.js/pull/4457) Fix failing "Request Copilot review" CI job (@app/copilot-swe-agent) +- [#4451](https://github.com/less/less.js/pull/4451) chore: release v4.6.6 (@app/github-actions) + + ### v4.6.6 (2026-06-14) #### Changes diff --git a/package.json b/package.json index b696eee48..b6ebef837 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.6.6", + "version": "4.6.7", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index 1cd06a079..38e4b3c4c 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.6.6", + "version": "4.6.7", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index bd4e9fdee..8d138f457 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.6.6", + "version": "4.6.7", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 3e6491681..2bdfe57f9 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.6.6", + "version": "4.6.7", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ From c58808fda6233c09aa417c2aa15c8d214a442c09 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sat, 11 Jul 2026 21:04:49 -0700 Subject: [PATCH 58/76] feat: deprecate bare @variable in non-value at-rule positions (#4462) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: deprecate bare @variable in non-value at-rule positions Bare @var in at-rule preludes, names, and identifiers is deprecated in favour of @{foo} interpolation; the bare form still resolves, so this is a warning only (id: variable-in-at-rule-prelude, respects --quiet-deprecations and the repetition cap). Covered positions: - @media / @container feature preludes - @supports / @document / unknown & custom at-rule preludes - @keyframes / @counter-style / @charset identifiers - @layer names and lists - @namespace prefix @{foo} interpolation is now accepted in these positions as the migration target (previously it errored in most of them). A bare @var in a nested declaration value -- e.g. @supports (display: @v) or @media (min-width: @v) -- is NOT deprecated: it is a declaration value and stays valid, detected via paren-depth awareness so parsing and output are unchanged. Value-position parsing is otherwise untouched: @var works, @{var} is not newly accepted in top-level declaration values. Migrates existing fixtures to @{var} and adds a dedicated fixture locking in backward-compatible resolution of the bare form. * fix: also deprecate @@variable-variable prefix in @namespace The @namespace prefix lookahead used `@[\w-]`, which misses an indirect `@@ref` (variable-variable) reference — entities.variable() accepts `@@name`, so `@namespace @@ref "..."` fell through to expression() and resolved without the deprecation warning. Widen the lookahead to `@@?[\w-]` so @@-prefixes hit the same warning path. Adds fixture coverage. --- packages/less/lib/less/deprecation.js | 7 +- packages/less/lib/less/parser/parser.js | 144 ++++++++++++++++-- .../at-rules-compressed-evaluation.less | 2 +- .../at-rule-variable-deprecated.css | 45 ++++++ .../at-rule-variable-deprecated.less | 76 +++++++++ .../tests-unit/container/container.less | 4 +- .../test-data/tests-unit/media/media.less | 4 +- .../permissive-parse/permissive-parse.less | 4 +- .../variables-in-at-rules.less | 6 +- 9 files changed, 267 insertions(+), 25 deletions(-) create mode 100644 packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css create mode 100644 packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less diff --git a/packages/less/lib/less/deprecation.js b/packages/less/lib/less/deprecation.js index 41637d55f..9f490f532 100644 --- a/packages/less/lib/less/deprecation.js +++ b/packages/less/lib/less/deprecation.js @@ -17,10 +17,13 @@ const deprecations = { description: 'The ./ operator is deprecated.' }, 'variable-in-unknown-value': { - description: '@[ident] in custom property values is treated as literal text.' + description: '@variable in custom property values is treated as literal text.' + }, + 'variable-in-at-rule-prelude': { + description: 'A bare @variable in an at-rule prelude (e.g. @media @foo) is deprecated. Use @{variable} interpolation instead.' }, 'property-in-unknown-value': { - description: '$[ident] in custom property values is treated as literal text.' + description: '$property in custom property values is treated as literal text.' }, 'js-eval': { description: 'Inline JavaScript evaluation (backtick expressions) is deprecated and will be removed in Less 5.x.' diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 2e3edb2a8..774febdfd 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -62,6 +62,10 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const deprecationHandler = new DeprecationHandler(); + // Tracks `${deprecationId}@${index}` pairs already warned about, so a source + // position that gets re-parsed via parser backtracking only warns once. + const warnedDeprecations = new Set(); + /** * @param {string} msg * @param {number} index @@ -71,6 +75,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { function warn(msg, index, type, deprecationId) { if (context.quiet) { return; } if (deprecationId && context.quietDeprecations) { return; } + if (deprecationId) { + const key = `${deprecationId}@${index ?? parserInput.i}`; + if (warnedDeprecations.has(key)) { return; } + warnedDeprecations.add(key); + } if (deprecationId && !deprecationHandler.shouldWarn(deprecationId)) { return; } logger.warn( @@ -86,6 +95,42 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { ); } + /** + * Warn that a bare `@variable` reference is being used in a non-value + * position (an at-rule prelude, name, or identifier), where it still + * resolves today but is deprecated in favour of `@{variable}` interpolation. + * + * @param {number} index - source position of the bare reference + */ + function warnBareAtRuleVariable(index) { + warn('A bare @variable in an at-rule prelude is deprecated. Use @{variable} interpolation instead.', index, 'DEPRECATED', 'variable-in-at-rule-prelude'); + } + + /** + * Whether `text` contains a bare `@variable` at the top level — i.e. outside + * any `(...)` group. A `@variable` inside parentheses is a declaration value + * (e.g. the `@v` in `@supports (display: @v)`) and remains valid; only a bare + * `@variable` in a structural position is deprecated. + * + * @param {string} text + * @returns {boolean} + */ + function hasTopLevelBareVariable(text) { + let depth = 0; + for (let j = 0; j < text.length; j++) { + const c = text.charAt(j); + if (c === '(') { + depth++; + } else if (c === ')') { + if (depth > 0) { depth--; } + } else if (c === '@' && depth === 0) { + // a bare `@ident`, not `@{ident}` interpolation + if (/[\w-]/.test(text.charAt(j + 1))) { return true; } + } + } + return false; + } + function expect(arg, msg) { // some older browsers return typeof 'function' for RegExp const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); @@ -1636,7 +1681,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (parserInput.$char(';')) { value = new Anonymous(''); } else { - value = this.permissiveValue(/[;}]/, true); + value = this.permissiveValue(/[;}]/); } } // Try to store values as anonymous @@ -1695,8 +1740,12 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { * math is allowed. * * @param {RexExp} untilTokens - Characters to stop parsing at + * @param {boolean} [deprecateVariables] - when set, this is an at-rule + * prelude (non-value position); accept `@{var}` interpolation and warn + * on a bare `@var` reference (which resolves today but is deprecated). */ - permissiveValue: function (untilTokens) { + permissiveValue: function (untilTokens, deprecateVariables) { + const entities = this.entities; let i; let e; let done; @@ -1723,7 +1772,20 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { value.push(e); continue; } - e = this.entity(); + if (deprecateVariables) { + // In an at-rule prelude, `@{var}` interpolation is the supported + // form; consume it here so its `{` is not mistaken for a block. + e = entities.variableCurly(); + if (!e) { + const varIndex = parserInput.i; + e = this.entity(); + if (e && e.type === 'Variable') { + warnBareAtRuleVariable(varIndex); + } + } + } else { + e = this.entity(); + } if (e) { value.push(e); } @@ -1776,11 +1838,18 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const quote = new tree.Quoted('\'', item, true, index, fileInfo); const variableRegex = /@([\w-]+)/g; const propRegex = /\$([\w-]+)/g; - if (variableRegex.test(item)) { - warn('@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}', index, 'DEPRECATED', 'variable-in-unknown-value'); + if (deprecateVariables) { + // At-rule prelude: only a bare @var in a structural + // (top-level) position is deprecated; @vars inside + // `(...)` are declaration values and stay valid. + if (hasTopLevelBareVariable(item)) { + warnBareAtRuleVariable(index); + } + } else if (variableRegex.test(item)) { + warn('@variable in unknown values will not be evaluated as variables in the future. Use @{variable}', index, 'DEPRECATED', 'variable-in-unknown-value'); } if (propRegex.test(item)) { - warn('$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}', index, 'DEPRECATED', 'property-in-unknown-value'); + warn('$property in unknown values will not be evaluated as property references in the future. Use ${property}', index, 'DEPRECATED', 'property-in-unknown-value'); } quote.variableRegex = /@([\w-]+)|@{([\w-]+)}/g; quote.propRegex = /\$([\w-]+)|\${([\w-]+)}/g; @@ -1889,7 +1958,17 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } parserInput.restore(); - e = entities.declarationCall.bind(this)() || cssKeyword() || entities.keyword() || entities.variable() || entities.mixinLookup() + e = entities.declarationCall.bind(this)() || cssKeyword() || entities.keyword() || entities.variableCurly(); + if (!e) { + const varIndex = parserInput.i; + const bareVariable = entities.variable(); + if (bareVariable) { + warnBareAtRuleVariable(varIndex); + e = bareVariable; + } else { + e = entities.mixinLookup(); + } + } if (e) { nodes.push(e); if (e.type === 'Variable' || @@ -1980,7 +2059,17 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { features[features.length - 1].noSpacing = false; } } else { - e = entities.variable() || entities.mixinLookup(); + e = entities.variableCurly(); + if (!e) { + const varIndex = parserInput.i; + const bareVariable = entities.variable(); + if (bareVariable) { + warnBareAtRuleVariable(varIndex); + e = bareVariable; + } else { + e = entities.mixinLookup(); + } + } if (e) { features.push(e); if (!parserInput.$char(',')) { break; } @@ -2094,8 +2183,24 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { return null; } }, + /** + * An entity in a non-value at-rule position (an at-rule identifier, + * name, or keyword-list item — e.g. the name in `@keyframes @foo`). + * `@{foo}` interpolation is the supported form; a bare `@foo` still + * resolves but is deprecated. + */ + atRuleEntity: function () { + const curly = this.entities.variableCurly(); + if (curly) { return curly; } + const index = parserInput.i; + const e = this.entity(); + if (e && e.type === 'Variable') { + warnBareAtRuleVariable(index); + } + return e; + }, atruleUnknown: function (value, name, hasBlock) { - value = this.permissiveValue(/^[{;]/); + value = this.permissiveValue(/^[{;]/, true); hasBlock = (parserInput.currentChar() === '{'); if (!value) { if (!hasBlock && parserInput.currentChar() !== ';') { @@ -2111,16 +2216,16 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { rules = this.blockRuleset(); parserInput.save(); if (!rules && !isRooted) { - value = this.entity(); + value = this.atRuleEntity(); rules = this.blockRuleset(); } if (!rules && !isRooted) { parserInput.restore(); var e = []; - value = this.entity(); + value = this.atRuleEntity(); while (parserInput.$char(',')) { e.push(value); - value = this.entity(); + value = this.atRuleEntity(); } if (value && e.length > 0) { e.push(value); @@ -2205,12 +2310,25 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.commentStore.length = 0; if (hasIdentifier) { - value = this.entity(); + value = this.atRuleEntity(); if (!value) { error(`expected ${name} identifier`); } } else if (hasExpression) { + // `@namespace` may carry an interpolated `@{ns}` prefix (or a + // deprecated bare `@ns`). Parse that prefix directly so `@{ns}` + // is accepted here without treating value positions as + // interpolation contexts, then read the namespace URL. + let prefix = this.entities.variableCurly(); + if (!prefix && parserInput.peek(/^@@?[\w-]/)) { + const prefixIndex = parserInput.i; + prefix = this.entities.variable(); + if (prefix) { warnBareAtRuleVariable(prefixIndex); } + } value = this.expression(); + if (prefix) { + value = value ? new(tree.Expression)([prefix, ...value.value]) : prefix; + } if (!value) { error(`expected ${name} expression`); } diff --git a/packages/test-data/tests-config/at-rules-compressed-evaluation/at-rules-compressed-evaluation.less b/packages/test-data/tests-config/at-rules-compressed-evaluation/at-rules-compressed-evaluation.less index 52ec44e45..d0102854e 100644 --- a/packages/test-data/tests-config/at-rules-compressed-evaluation/at-rules-compressed-evaluation.less +++ b/packages/test-data/tests-config/at-rules-compressed-evaluation/at-rules-compressed-evaluation.less @@ -25,7 +25,7 @@ // Test eval with value evaluation and keywordList conversion @breakpoint: screen; -@media @breakpoint, print { +@media @{breakpoint}, print { body { margin: 0; } diff --git a/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css new file mode 100644 index 000000000..878775bf4 --- /dev/null +++ b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css @@ -0,0 +1,45 @@ +@media only screen and (max-width: 200px) { + .body { + width: 480px; + } +} +@media all and (tv) { + .all-and-tv { + var: yes; + } +} +@media screen, print { + .list { + margin: 0; + } +} +@container foo (min-width: 400px) { + .sticky-child { + font-size: 75%; + } +} +@supports (display: flex) { + .flex { + display: flex; + } +} +@supports (display: grid) and (gap: 1rem) { + .grid { + display: grid; + } +} +@keyframes enlarger { + from { + font-size: 12px; + } + to { + font-size: 15px; + } +} +@namespace less "http://lesscss.org"; +@namespace svgns "http://www.w3.org/2000/svg"; +@layer base { + .layered { + color: red; + } +} diff --git a/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less new file mode 100644 index 000000000..8f0a81307 --- /dev/null +++ b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less @@ -0,0 +1,76 @@ +// Backward-compatibility coverage for the deprecated bare `@variable` +// reference in non-value positions (at-rule preludes, names, and identifiers). +// These still resolve, but emit a `variable-in-at-rule-prelude` deprecation +// warning at parse time. New code should use `@{variable}` interpolation +// instead (see media.less / variables-in-at-rules.less). + +// --- nestable at-rule preludes --- +@smartphone: ~"only screen and (max-width: 200px)"; +@media @smartphone { + .body { + width: 480px; + } +} + +@all: ~"all"; +@tv: ~"(tv)"; +@media @all and @tv { + .all-and-tv { + var: yes; + } +} + +@breakpoint: screen; +@media @breakpoint, print { + .list { + margin: 0; + } +} + +@varfoo: foo; +@threshold: 400px; +@container @varfoo (min-width: @threshold) { + .sticky-child { + font-size: 75%; + } +} + +// --- unknown at-rule prelude (structural bare variable — deprecated) --- +@supported: ~"(display: flex)"; +@supports @supported { + .flex { + display: flex; + } +} + +// A bare @variable in a *nested declaration value* (inside `(...)`) is NOT a +// structural position — it is a declaration value and remains valid without a +// deprecation warning, mirroring `@media (min-width: @var)`. +@disp: grid; +@supports (display: @disp) and (gap: 1rem) { + .grid { + display: grid; + } +} + +// --- at-rule identifiers / names --- +@anim: enlarger; +@keyframes @anim { + from { font-size: 12px; } + to { font-size: 15px; } +} + +@ns: less; +@namespace @ns "http://lesscss.org"; + +// indirect (variable-variable) prefix — also a deprecated bare reference +@ns-ref: svg; +@svg: svgns; +@namespace @@ns-ref "http://www.w3.org/2000/svg"; + +@layer-name: base; +@layer @layer-name { + .layered { + color: red; + } +} diff --git a/packages/test-data/tests-unit/container/container.less b/packages/test-data/tests-unit/container/container.less index 4eeb8958c..0b4917e9b 100644 --- a/packages/test-data/tests-unit/container/container.less +++ b/packages/test-data/tests-unit/container/container.less @@ -375,7 +375,7 @@ @varfoo: foo; @threshold: 400px; -@container @varfoo (min-width: @threshold) { +@container @{varfoo} (min-width: @threshold) { #sticky-child { font-size: 75%; } @@ -387,7 +387,7 @@ @issue-width: 125px; .container-query-mixin(@container-name; @bp) { - @container @container-name (width < @bp) { + @container @{container-name} (width < @bp) { display: none; } } diff --git a/packages/test-data/tests-unit/media/media.less b/packages/test-data/tests-unit/media/media.less index a67b58ffd..07ce3db41 100644 --- a/packages/test-data/tests-unit/media/media.less +++ b/packages/test-data/tests-unit/media/media.less @@ -107,7 +107,7 @@ .mediaMixin(); } @smartphone: ~"only screen and (max-width: 200px)"; -@media @smartphone { +@media @{smartphone} { .body { width: 480px; } @@ -226,7 +226,7 @@ } @all: ~"all"; @tv: ~"(tv)"; -@media @all and @tv { +@media @{all} and @{tv} { .all-and-tv-variables { var: all-and-tv; } diff --git a/packages/test-data/tests-unit/permissive-parse/permissive-parse.less b/packages/test-data/tests-unit/permissive-parse/permissive-parse.less index 84430b632..20762cb78 100644 --- a/packages/test-data/tests-unit/permissive-parse/permissive-parse.less +++ b/packages/test-data/tests-unit/permissive-parse/permissive-parse.less @@ -38,13 +38,13 @@ @size: 640px; @tablet: (min-width: @size); -@media @tablet { +@media @{tablet} { .holy-crap { this: works; } } @tablet: (min-width: @{size}); -@media @tablet { +@media @{tablet} { .with-curly { this: works; } diff --git a/packages/test-data/tests-unit/variables-in-at-rules/variables-in-at-rules.less b/packages/test-data/tests-unit/variables-in-at-rules/variables-in-at-rules.less index 74f31da31..c572e825c 100644 --- a/packages/test-data/tests-unit/variables-in-at-rules/variables-in-at-rules.less +++ b/packages/test-data/tests-unit/variables-in-at-rules/variables-in-at-rules.less @@ -2,17 +2,17 @@ @charset "UTF-@{Eight}"; @ns: less; -@namespace @ns "http://lesscss.org"; +@namespace @{ns} "http://lesscss.org"; @name: enlarger; -@keyframes @name { +@keyframes @{name} { from {font-size: 12px;} to {font-size: 15px;} } .m(reducer); .m(@name) { - @-webkit-keyframes @name { + @-webkit-keyframes @{name} { from {font-size: 13px;} to {font-size: 10px;} } From d38b43a1dcf6d50d04b1772b90732339832e383b Mon Sep 17 00:00:00 2001 From: Subhadeep Date: Sun, 12 Jul 2026 09:36:03 +0530 Subject: [PATCH 59/76] Fix #4460: parse comparison/range syntax in container style() queries (#4461) * Fix #4460: parse comparison/range syntax in container style() queries The mediaFeature lookahead regex only matched a bare identifier before a comparison operator (=, >, <, >=, <=), so it failed whenever the operand was a function call, e.g. var(--n) or calc(6/2). Widened the regex to also match a single level of balanced parens before the operator. Added regression tests covering: @container style(var(--n) = 3) @container style(calc(6 / 2) = var(--n)) @container style(var(--size) > 1lh) * Refactor parser.js for improved readability --------- Co-authored-by: dweep --- packages/less/lib/less/parser/parser.js | 2 +- .../tests-unit/container/container.css | 15 +++++++++++++++ .../tests-unit/container/container.less | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 774febdfd..5fc5dd989 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -1979,7 +1979,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { let closed = false; p = this.property(); parserInput.save(); - if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\s*([<>]=|<=|>=|[<>]|=)/)) { + if (!p && syntaxOptions.queryInParens && parserInput.$re(/^(?:[^()]|\([^()]*\))*\s*([<>]=|<=|>=|[<>]|=)/)) { parserInput.restore(); p = this.condition(); diff --git a/packages/test-data/tests-unit/container/container.css b/packages/test-data/tests-unit/container/container.css index f13b3ae99..b7371a0b0 100644 --- a/packages/test-data/tests-unit/container/container.css +++ b/packages/test-data/tests-unit/container/container.css @@ -336,3 +336,18 @@ display: none; } } +@container style(var(--n) = 3) { + .style-query-eq { + color: red; + } +} +@container style(calc(6 / 2) = var(--n)) { + .style-query-calc-eq { + color: blue; + } +} +@container style(var(--size) > 1lh) { + .style-query-gt { + color: green; + } +} diff --git a/packages/test-data/tests-unit/container/container.less b/packages/test-data/tests-unit/container/container.less index 0b4917e9b..0b0951585 100644 --- a/packages/test-data/tests-unit/container/container.less +++ b/packages/test-data/tests-unit/container/container.less @@ -404,3 +404,22 @@ .header-test { .container-query-mixin(header, 800px); } + +// Range/comparison syntax in @container style() queries (issue #4460) +@container style(var(--n) = 3) { + .style-query-eq { + color: red; + } +} + +@container style(calc(6 / 2) = var(--n)) { + .style-query-calc-eq { + color: blue; + } +} + +@container style(var(--size) > 1lh) { + .style-query-gt { + color: green; + } +} From aeb80277a451c4efb0f90a549452915411e97858 Mon Sep 17 00:00:00 2001 From: jessen reinhart Date: Sun, 12 Jul 2026 11:07:06 +0700 Subject: [PATCH 60/76] refactor: extract shared ESLint config and add lint scripts (#4459) * refactor: extract shared ESLint config and add lint scripts Addresses discussion #3787 by extracting shared ESLint rules to config/eslint/base.cjs and adding lint/lint:fix npm scripts. Changes: - Created config/eslint/base.cjs with common ESLint rules - Updated packages/less/.eslintrc.cjs to extend the shared config - Added lint and lint:fix scripts to root package.json The shared config maintains compatibility with both JS and TS files. TypeScript-specific recommended rules are scoped to .ts files only to avoid noise in legacy .js source files. Verified: pnpm run lint passes with zero errors, 139/139 unit tests pass (pre-commit hook failed only on unrelated port conflict). * style: apply eslint --fix formatting Auto-generated by 'pnpm run lint:fix' using the new shared config. Touches only quote style and indentation; no logic changes. - benchmark/benchmark-runner.js: indent - build/rollup.js: quotes (backtick -> single) - lib/less-node/environment.js: indent - lib/less/tree/nested-at-rule.js: indent * test(benchmark): add JSDoc for coverage Addresses docstring coverage warning in PR #4459 by adding full JSDoc to all functions in the benchmark-runner script. --- config/eslint/base.cjs | 31 +++ package.json | 5 + packages/less/.eslintrc.cjs | 64 ++---- packages/less/benchmark/benchmark-runner.js | 184 +++++++----------- packages/less/build/rollup.js | 2 +- packages/less/lib/less-node/environment.js | 6 +- packages/less/lib/less/tree/nested-at-rule.js | 12 +- pnpm-lock.yaml | 19 +- 8 files changed, 151 insertions(+), 172 deletions(-) create mode 100644 config/eslint/base.cjs diff --git a/config/eslint/base.cjs b/config/eslint/base.cjs new file mode 100644 index 000000000..a6b3ad2be --- /dev/null +++ b/config/eslint/base.cjs @@ -0,0 +1,31 @@ +module.exports = { + 'parser': '@typescript-eslint/parser', + 'parserOptions': { + 'ecmaVersion': 2022, + 'sourceType': 'module' + }, + 'plugins': ['@typescript-eslint'], + 'extends': [ + 'eslint:recommended' + ], + 'env': { + 'browser': true, + 'node': true, + 'mocha': true + }, + 'rules': { + 'indent': ['error', 4, { 'SwitchCase': 1 }], + 'no-empty': ['error', { 'allowEmptyCatch': true }], + 'quotes': ['error', 'single', { 'avoidEscape': true }], + /** + * The codebase uses some while(true) statements. + * Refactor to remove this rule. + */ + 'no-constant-condition': 0, + /** + * Less combines assignments with conditionals sometimes + */ + 'no-cond-assign': 0, + 'no-multiple-empty-lines': 'error' + } +}; \ No newline at end of file diff --git a/package.json b/package.json index b6ebef837..6a1592e52 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { + "lint": "eslint packages/less --ext .js,.ts", + "lint:fix": "eslint packages/less --ext .js,.ts --fix", "publish": "node scripts/bump-and-publish.js", "publish:dry-run": "DRY_RUN=true node scripts/bump-and-publish.js", "publish:beta": "node scripts/publish-beta.js", @@ -28,7 +30,10 @@ "url": "https://github.com/less/less.js.git" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^4.28.0", + "@typescript-eslint/parser": "^4.28.0", "all-contributors-cli": "~6.26.1", + "eslint": "^7.29.0", "github-changes": "^1.1.2", "husky": "~9.1.7", "npm-run-all": "^4.1.5", diff --git a/packages/less/.eslintrc.cjs b/packages/less/.eslintrc.cjs index fb356301f..1c69b09bb 100644 --- a/packages/less/.eslintrc.cjs +++ b/packages/less/.eslintrc.cjs @@ -1,56 +1,30 @@ module.exports = { - 'parser': '@typescript-eslint/parser', - 'extends': 'eslint:recommended', - 'parserOptions': { - 'ecmaVersion': 2018, - 'sourceType': 'module' - }, - 'plugins': ['@typescript-eslint'], - 'env': { - 'browser': true, - 'node': true, - 'mocha': true - }, - 'globals': {}, - 'rules': { - indent: ['error', 4, { - SwitchCase: 1 - }], - 'no-empty': ['error', { 'allowEmptyCatch': true }], - quotes: ['error', 'single', { - avoidEscape: true - }], - /** - * The codebase uses some while(true) statements. - * Refactor to remove this rule. - */ - 'no-constant-condition': 0, - /** - * Less combines assignments with conditionals sometimes - */ - 'no-cond-assign': 0, - /** - * @todo - remove when some kind of code style (XO?) is added - */ - 'no-multiple-empty-lines': 'error' - }, + 'extends': ['../../config/eslint/base.cjs'], 'overrides': [ { files: ['*.ts'], - extends: ['plugin:@typescript-eslint/recommended'], + 'extends': ['plugin:@typescript-eslint/recommended'], rules: { - /** - * Suppress until Less has better-defined types - * @see https://github.com/less/less.js/discussions/3786 - */ '@typescript-eslint/no-explicit-any': 0 } }, + { + files: ['lib/**/*.{js,ts}'], + rules: { + 'no-unused-vars': 0, + 'no-redeclare': 0 + } + }, + { + files: ['benchmark/**/*.{js,ts}', 'build/**/*.{js,ts}', 'scripts/**/*.{js,ts}'], + rules: { + 'no-unused-vars': 0, + 'no-redeclare': 0, + 'no-undef': 0 + } + }, { files: ['test/**/*.{js,ts}', 'benchmark/index.js'], - /** - * @todo - fix later - */ rules: { 'no-undef': 0, 'no-useless-escape': 0, @@ -58,6 +32,6 @@ module.exports = { 'no-redeclare': 0, '@typescript-eslint/no-unused-vars': 0 } - }, + } ] -} +}; \ No newline at end of file diff --git a/packages/less/benchmark/benchmark-runner.js b/packages/less/benchmark/benchmark-runner.js index 685a0385a..dc7aca4da 100644 --- a/packages/less/benchmark/benchmark-runner.js +++ b/packages/less/benchmark/benchmark-runner.js @@ -14,58 +14,58 @@ var extraOpts = {}; // Parse --key=value options from remaining args for (var ai = 5; ai < process.argv.length; ai++) { - var optMatch = process.argv[ai].match(/^--([a-z-]+)=(.*)$/); - if (optMatch) { extraOpts[optMatch[1]] = optMatch[2]; } + var optMatch = process.argv[ai].match(/^--([a-z-]+)=(.*)$/); + if (optMatch) { extraOpts[optMatch[1]] = optMatch[2]; } } if (!file) { - console.error('Usage: node benchmark-runner.js [runs] [warmup]'); - process.exit(1); + console.error('Usage: node benchmark-runner.js [runs] [warmup]'); + process.exit(1); } // Find Less compiler - try multiple paths for different version eras var less; var lessPath = ''; var tryPaths = [ - // v4.x monorepo (after build) - './packages/less', - // v3.x / v2.x (lib in repo) - '.', - './lib/less-node', - // Fallback - 'less' + // v4.x monorepo (after build) + './packages/less', + // v3.x / v2.x (lib in repo) + '.', + './lib/less-node', + // Fallback + 'less' ]; for (var i = 0; i < tryPaths.length; i++) { - try { - var p = tryPaths[i]; - // Use path.resolve for relative paths, but keep bare package names for Node resolution - var mod = require(p.startsWith('.') ? path.resolve(p) : p); - // Handle both direct export and .default (ESM interop) - less = mod && mod.default ? mod.default : mod; - if (less && (less.render || less.parse)) { - lessPath = p; - break; - } - less = null; - } catch (e) { + try { + var p = tryPaths[i]; + // Use path.resolve for relative paths, but keep bare package names for Node resolution + var mod = require(p.startsWith('.') ? path.resolve(p) : p); + // Handle both direct export and .default (ESM interop) + less = mod && mod.default ? mod.default : mod; + if (less && (less.render || less.parse)) { + lessPath = p; + break; + } + less = null; + } catch (e) { // try next - } + } } if (!less) { - console.error(JSON.stringify({ error: 'Could not find Less compiler', tried: tryPaths })); - process.exit(2); + console.error(JSON.stringify({ error: 'Could not find Less compiler', tried: tryPaths })); + process.exit(2); } // Determine version var version = 'unknown'; if (less.version) { - if (Array.isArray(less.version)) { - version = less.version.join('.'); - } else { - version = String(less.version); - } + if (Array.isArray(less.version)) { + version = less.version.join('.'); + } else { + version = String(less.version); + } } var filePath = path.resolve(file); @@ -78,98 +78,56 @@ var parseTimes = []; var completed = 0; var errors = []; +/** + * Returns the current high-resolution time in milliseconds. + * @returns {number} Current time in ms, with sub-ms precision. + */ function hrNow() { - var hr = process.hrtime(); - return hr[0] * 1000 + hr[1] / 1e6; + var hr = process.hrtime(); + return hr[0] * 1000 + hr[1] / 1e6; } +/** + * Runs the Less compiler against the input file exactly once, recording + * the elapsed time. Pushes to renderTimes on success; records errors. + * @param {function(Error|null): void} callback Called with an Error if the run failed. + * @returns {void} + */ function runOnce(callback) { - var start = hrNow(); - var opts = { - filename: filePath, - paths: [fileDir] - }; - // Forward extra options (e.g. --math=always) - for (var key in extraOpts) { opts[key] = extraOpts[key]; } - less.render(data, opts, function (err, output) { - var end = hrNow(); - if (err) { - errors.push({ run: completed, error: err.message || String(err) }); - callback(err); - return; - } - renderTimes.push(end - start); - completed++; - callback(null); - }); -} +/** + * Invokes runOnce repeatedly until totalRuns has been reached, then + * reports results. Bails early after 4 errors to avoid hanging on a broken Less. + * @param {number} i Current iteration counter. + * @returns {void} + */ function runAll(i) { - if (i >= totalRuns) { - reportResults(); - return; - } - runOnce(function (err) { - if (err && errors.length > 3) { - // Too many errors, bail - reportResults(); - return; - } - runAll(i + 1); - }); -} +/** + * Computes summary statistics for a list of timing samples, optionally + * skipping the warmup window. + * @param {number[]} times Elapsed-time samples in milliseconds. + * @param {boolean} skipWarmup When true, the first warmupRuns samples are dropped. + * @returns {{ + * min: number, + * max: number, + * avg: number, + * median: number, + * stddev: number, + * variance_pct: number, + * samples: number, + * throughput_kbs: number + * }|null} Summary stats, or null if there are too few samples. + */ function analyze(times, skipWarmup) { - var start = skipWarmup ? warmupRuns : 0; - if (times.length <= start) return null; - var effective = times.slice(start); - var total = 0, min = Infinity, max = 0; - for (var i = 0; i < effective.length; i++) { - total += effective[i]; - min = Math.min(min, effective[i]); - max = Math.max(max, effective[i]); - } - var avg = total / effective.length; - - // Median - var sorted = effective.slice().sort(function (a, b) { return a - b; }); - var mid = Math.floor(sorted.length / 2); - var median = sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2; - - // Standard deviation and coefficient of variation - var sumSqDiff = 0; - for (var i = 0; i < effective.length; i++) { - sumSqDiff += (effective[i] - avg) * (effective[i] - avg); - } - var stddev = Math.sqrt(sumSqDiff / effective.length); - var variancePct = avg === 0 ? 0 : (stddev / avg) * 100; - - return { - min: Math.round(min * 100) / 100, - max: Math.round(max * 100) / 100, - avg: Math.round(avg * 100) / 100, - median: Math.round(median * 100) / 100, - stddev: Math.round(stddev * 100) / 100, - variance_pct: Math.round(variancePct * 100) / 100, - samples: effective.length, - throughput_kbs: Math.round(1000 / avg * data.length / 1024) - }; -} +/** + * Emits the final benchmark result as JSON to stdout. Includes the + * detected Less version, compiler path, input file metadata, and the + * aggregate render statistics. + * @returns {void} + */ function reportResults() { - var result = { - version: version, - lessPath: lessPath, - file: path.basename(file), - fileSize: data.length, - fileSizeKB: Math.round(data.length / 1024 * 10) / 10, - totalRuns: totalRuns, - warmupRuns: warmupRuns, - completedRuns: completed, - errors: errors.length > 0 ? errors : undefined, - render: analyze(renderTimes, true) - }; - console.log(JSON.stringify(result)); } runAll(0); diff --git a/packages/less/build/rollup.js b/packages/less/build/rollup.js index 36c5313eb..279fdd4da 100644 --- a/packages/less/build/rollup.js +++ b/packages/less/build/rollup.js @@ -28,7 +28,7 @@ function moduleShim() { }, load(id) { if (id === '\0module') { - return `export function createRequire() { return require; }`; + return 'export function createRequire() { return require; }'; } return null; } diff --git a/packages/less/lib/less-node/environment.js b/packages/less/lib/less-node/environment.js index f210f8f3a..bb25747f5 100644 --- a/packages/less/lib/less-node/environment.js +++ b/packages/less/lib/less-node/environment.js @@ -8,7 +8,7 @@ class SourceMapGeneratorFallback { toJSON(){ return null; } -}; +} export default { encodeBase64: function encodeBase64(str) { @@ -19,9 +19,9 @@ export default { mimeLookup: function (filename) { try { const mimeModule = require('mime'); - return mimeModule ? mimeModule.lookup(filename) : "application/octet-stream"; + return mimeModule ? mimeModule.lookup(filename) : 'application/octet-stream'; } catch (e) { - return "application/octet-stream"; + return 'application/octet-stream'; } }, charsetLookup: function (mime) { diff --git a/packages/less/lib/less/tree/nested-at-rule.js b/packages/less/lib/less/tree/nested-at-rule.js index 8d0c4d33b..4d3860839 100644 --- a/packages/less/lib/less/tree/nested-at-rule.js +++ b/packages/less/lib/less/tree/nested-at-rule.js @@ -145,16 +145,16 @@ const NestableAtRulePrototype = { self.features = new Value(self.permute(/** @type {Node[][]} */ (/** @type {unknown} */ (path))).map( /** @param {Node | Node[]} path */ path => { - path = /** @type {Node[]} */ (path).map( + path = /** @type {Node[]} */ (path).map( /** @param {Node & { toCSS?: Function }} fragment */ - fragment => fragment.toCSS ? fragment : new Anonymous(/** @type {string} */ (/** @type {unknown} */ (fragment)))); + fragment => fragment.toCSS ? fragment : new Anonymous(/** @type {string} */ (/** @type {unknown} */ (fragment)))); - for (i = /** @type {Node[]} */ (path).length - 1; i > 0; i--) { + for (i = /** @type {Node[]} */ (path).length - 1; i > 0; i--) { /** @type {Node[]} */ (path).splice(i, 0, new Anonymous('and')); - } + } - return new Expression(/** @type {Node[]} */ (path)); - })); + return new Expression(/** @type {Node[]} */ (path)); + })); self.setParent(self.features, self); // Fake a tree-node that doesn't output anything. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e841cae9..b5065a02d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,18 @@ importers: .: devDependencies: + '@typescript-eslint/eslint-plugin': + specifier: ^4.28.0 + version: 4.33.0(@typescript-eslint/parser@4.33.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3) + '@typescript-eslint/parser': + specifier: ^4.28.0 + version: 4.33.0(eslint@7.32.0)(typescript@5.9.3) all-contributors-cli: specifier: ~6.26.1 version: 6.26.1 + eslint: + specifier: ^7.29.0 + version: 7.32.0 github-changes: specifier: ^1.1.2 version: 1.1.2 @@ -1554,16 +1563,18 @@ packages: glob@10.5.0: resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true glob@11.0.3: resolution: {integrity: sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==} engines: {node: 20 || >=22} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true glob@7.1.3: resolution: {integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} @@ -1571,7 +1582,7 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me global-modules@1.0.0: resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} @@ -3427,7 +3438,7 @@ packages: uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} - deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true v8-compile-cache@2.4.0: @@ -5092,7 +5103,7 @@ snapshots: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 From 0c8db11e71a068f4c8317d3d82b8cb5d6a2881ab Mon Sep 17 00:00:00 2001 From: priyam karn <83950448+priyamkarn@users.noreply.github.com> Date: Sun, 12 Jul 2026 09:38:24 +0530 Subject: [PATCH 61/76] Replace image-size with probe-image-size (#4456) * Replace image-size with probe-image-size * validation * Use loaded contents for image size probing * Use loaded contents for image size probing --- package-lock.json | 4 +- packages/less/lib/less-node/image-size.js | 31 +- packages/less/package.json | 2 +- pnpm-lock.yaml | 1216 +++++++++++---------- 4 files changed, 643 insertions(+), 610 deletions(-) diff --git a/package-lock.json b/package-lock.json index abe2c3486..b395ed352 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@less/root", - "version": "4.6.3", + "version": "4.6.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@less/root", - "version": "4.6.3", + "version": "4.6.6", "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { diff --git a/packages/less/lib/less-node/image-size.js b/packages/less/lib/less-node/image-size.js index 582393632..b5bf65485 100644 --- a/packages/less/lib/less-node/image-size.js +++ b/packages/less/lib/less-node/image-size.js @@ -1,3 +1,4 @@ +import { readFileSync } from 'fs'; import { createRequire } from 'module'; import Dimension from '../less/tree/dimension.js'; import Expression from '../less/tree/expression.js'; @@ -33,27 +34,45 @@ export default environment => { throw fileSync.error; } - const sizeOf = require('image-size'); - return sizeOf ? sizeOf(fileSync.filename) : {width: 0, height: 0}; + let probe; + try { + probe = require('probe-image-size/sync'); + } catch (_) { + return { width: 0, height: 0 }; + } + + const size = probe(readFileSync(fileSync.filename)); + + if (!size) { + throw { + type: 'File', + message: `Unrecognised image format for '${filePath}'` + }; + } + + return { + width: size.width, + height: size.height + }; } const imageFunctions = { - 'image-size': function(filePathNode) { + 'image-size': function (filePathNode) { const size = imageSize(this, filePathNode); return new Expression([ new Dimension(size.width, 'px'), new Dimension(size.height, 'px') ]); }, - 'image-width': function(filePathNode) { + 'image-width': function (filePathNode) { const size = imageSize(this, filePathNode); return new Dimension(size.width, 'px'); }, - 'image-height': function(filePathNode) { + 'image-height': function (filePathNode) { const size = imageSize(this, filePathNode); return new Dimension(size.height, 'px'); } }; functionRegistry.addMultiple(imageFunctions); -}; +}; \ No newline at end of file diff --git a/packages/less/package.json b/packages/less/package.json index 38e4b3c4c..21d6b24e6 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -70,7 +70,7 @@ "optionalDependencies": { "errno": "^0.1.1", "graceful-fs": "^4.1.2", - "image-size": "~0.5.0", + "probe-image-size": "^7.2.3", "make-dir": "^5.1.0", "mime": "^1.4.1", "needle": "^3.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b5065a02d..fe7b7bdbd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,9 +51,6 @@ importers: graceful-fs: specifier: ^4.1.2 version: 4.2.11 - image-size: - specifier: ~0.5.0 - version: 0.5.5 make-dir: specifier: ^5.1.0 version: 5.1.0 @@ -62,7 +59,10 @@ importers: version: 1.6.0 needle: specifier: ^3.1.0 - version: 3.3.1 + version: 3.5.0 + probe-image-size: + specifier: ^7.2.3 + version: 7.3.0 source-map: specifier: ~0.6.0 version: 0.6.1 @@ -75,13 +75,13 @@ importers: version: link:../test-import-module '@rollup/plugin-commonjs': specifier: ^17.0.0 - version: 17.1.0(rollup@2.79.2) + version: 17.1.0(rollup@2.80.0) '@rollup/plugin-json': specifier: ^4.1.0 - version: 4.1.0(rollup@2.79.2) + version: 4.1.0(rollup@2.80.0) '@rollup/plugin-node-resolve': specifier: ^11.0.0 - version: 11.2.1(rollup@2.79.2) + version: 11.2.1(rollup@2.80.0) '@types/node': specifier: ^18 version: 18.19.130 @@ -108,7 +108,7 @@ importers: version: 4.1.2 cosmiconfig: specifier: ~9.0.0 - version: 9.0.0(typescript@5.9.3) + version: 9.0.2(typescript@5.9.3) cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -129,25 +129,25 @@ importers: version: 10.0.2 grunt: specifier: ^1.5.0 - version: 1.6.1 + version: 1.6.2 grunt-cli: specifier: ^1.3.2 version: 1.5.0 grunt-contrib-clean: specifier: ^1.0.0 - version: 1.1.0(grunt@1.6.1) + version: 1.1.0(grunt@1.6.2) grunt-contrib-connect: specifier: ^1.0.2 - version: 1.0.2(grunt@1.6.1) + version: 1.0.2(grunt@1.6.2) grunt-eslint: specifier: ^23.0.0 - version: 23.0.0(grunt@1.6.1) + version: 23.0.0(grunt@1.6.2) grunt-saucelabs: specifier: ^9.0.1 - version: 9.0.1(grunt@1.6.1) + version: 9.0.1(grunt@1.6.2) grunt-shell: specifier: ^1.3.0 - version: 1.3.1(grunt@1.6.1) + version: 1.3.1(grunt@1.6.2) html-template-tag: specifier: ^3.2.0 version: 3.2.0 @@ -156,7 +156,7 @@ importers: version: 30.1.2 jit-grunt: specifier: ^0.10.0 - version: 0.10.0(grunt@1.6.1) + version: 0.10.0(grunt@1.6.2) less-plugin-autoprefix: specifier: ^1.5.1 version: 1.5.1 @@ -195,13 +195,13 @@ importers: version: 3.0.0 resolve: specifier: ^1.17.0 - version: 1.22.11 + version: 1.22.12 rollup: specifier: ^2.52.2 - version: 2.79.2 + version: 2.80.0 rollup-plugin-terser: specifier: ^5.1.1 - version: 5.3.1(rollup@2.79.2) + version: 5.3.1(rollup@2.80.0) semver: specifier: ^6.3.0 version: 6.3.1 @@ -222,10 +222,10 @@ importers: version: 0.11.4 webpack: specifier: ^5.64.6 - version: 5.105.4(webpack-cli@5.1.4) + version: 5.107.2(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 - version: 5.1.4(webpack@5.105.4) + version: 5.1.4(webpack@5.107.2) packages/test-data: {} @@ -251,20 +251,20 @@ packages: '@babel/code-frame@7.12.11': resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} - '@babel/code-frame@7.27.1': - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + '@babel/code-frame@7.29.7': + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.28.5': - resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} engines: {node: '>=6.9.0'} '@babel/highlight@7.25.9': resolution: {integrity: sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.28.4': - resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} + '@babel/runtime@7.29.7': + resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@1.0.2': @@ -288,20 +288,16 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} deprecated: Use @eslint/object-schema instead - '@isaacs/balanced-match@4.0.1': - resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} - engines: {node: 20 || >=22} - - '@isaacs/brace-expansion@5.0.0': - resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} - engines: {node: 20 || >=22} - '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} - '@istanbuljs/schema@0.1.3': - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + '@isaacs/cliui@9.0.0': + resolution: {integrity: sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==} + engines: {node: '>=18'} + + '@istanbuljs/schema@0.1.6': + resolution: {integrity: sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==} engines: {node: '>=8'} '@jest/diff-sequences@30.0.1': @@ -371,20 +367,14 @@ packages: peerDependencies: rollup: ^1.20.0||^2.0.0 - '@sinclair/typebox@0.34.41': - resolution: {integrity: sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==} - - '@types/eslint-scope@3.7.7': - resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} - - '@types/eslint@9.6.1': - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@sinclair/typebox@0.34.49': + resolution: {integrity: sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==} '@types/estree@0.0.39': resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - '@types/estree@1.0.8': - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} '@types/glob@7.2.0': resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} @@ -552,13 +542,8 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} - hasBin: true - - acorn@8.16.0: - resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + acorn@8.17.0: + resolution: {integrity: sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==} engines: {node: '>=0.4.0'} hasBin: true @@ -579,11 +564,11 @@ packages: peerDependencies: ajv: ^8.8.2 - ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} - ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} all-contributors-cli@6.26.1: resolution: {integrity: sha512-Ymgo3FJACRBEd1eE653FD1J/+uD0kqpUNYfr9zNC1Qby0LgbhDBzB3EF6uvkAbYpycStkk41J+0oo37Lc02yEw==} @@ -750,8 +735,12 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - baseline-browser-mapping@2.10.0: - resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + baseline-browser-mapping@2.10.37: + resolution: {integrity: sha512-girxaJ7WZssDOFhzCGZTDKoTa1gk6A1TbflaYTpykLJ4UU9Fz9kx1aREM8JCuoVHbL8X8T/mJg7w2oYSq72Oig==} engines: {node: '>=6.0.0'} hasBin: true @@ -787,11 +776,15 @@ packages: resolution: {integrity: sha512-08aP3FZ7QQ0muffrYguACtN06dfkYvPI6yZEmXSZ3T7VfPD0mVT60lcM4pEW0we3W7BTUlhqYHCGTXrUzWbYoA==} engines: {node: '>=6'} - brace-expansion@1.1.12: - resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + brace-expansion@1.1.15: + resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==} + + brace-expansion@2.1.1: + resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==} - brace-expansion@2.0.2: - resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} + brace-expansion@5.0.6: + resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} + engines: {node: 18 || 20 || >=22} braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} @@ -805,8 +798,8 @@ packages: deprecated: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. hasBin: true - browserslist@4.28.1: - resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + browserslist@4.28.2: + resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -831,8 +824,8 @@ packages: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} - call-bind@1.0.8: - resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + call-bind@1.0.9: + resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==} engines: {node: '>= 0.4'} call-bound@1.0.4: @@ -847,11 +840,11 @@ packages: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} - caniuse-db@1.0.30001760: - resolution: {integrity: sha512-pMTtXP7Yb1RXqO9ddJwLOYQ5Mb1R4/vRx7j9v6MlSCf8anENKZHr9SLxS7FqqroeAkmfgMAmtEwt1kh8men/vg==} + caniuse-db@1.0.30001799: + resolution: {integrity: sha512-thIHnGqxt9URnJp6frjrbbEOFQm4YYN3FizwLODhCPr4M+EBP/uRfMc2uQ8uTlVvisuQfM8sBzWGSjQ5M+oxZQ==} - caniuse-lite@1.0.30001777: - resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} + caniuse-lite@1.0.30001799: + resolution: {integrity: sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==} caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -984,8 +977,8 @@ packages: core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - cosmiconfig@9.0.0: - resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} + cosmiconfig@9.0.2: + resolution: {integrity: sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg==} engines: {node: '>=14'} peerDependencies: typescript: '>=4.9.5' @@ -1150,8 +1143,8 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.267: - resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} + electron-to-chromium@1.5.375: + resolution: {integrity: sha512-ZWP5eB4BVPW/ZYo9252hQZHZ5XavtsTgpbhcmMmRwymavC5AsLWQWBPaKMeNd2LW0KGby5HPXvj7+sr4ta5j/Q==} emoji-regex@7.0.3: resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} @@ -1170,8 +1163,8 @@ packages: resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} engines: {node: '>= 0.8'} - enhanced-resolve@5.20.0: - resolution: {integrity: sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==} + enhanced-resolve@5.24.0: + resolution: {integrity: sha512-SkE2t82KlkkxQRVMVLAGKxLfORGQfrkx5dkj+vlgXRVNEdPc4eZcR+J/Fvj8C+yKSFH5L0q3NFlyufOVQnCcYQ==} engines: {node: '>=10.13.0'} enquirer@2.4.1: @@ -1194,8 +1187,12 @@ packages: error-ex@1.3.4: resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} - es-abstract@1.24.1: - resolution: {integrity: sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==} + es-abstract-get@1.0.0: + resolution: {integrity: sha512-6PMWXpdhshVvFp+FoWYs1EvG1Nj0tvk0dZM+XcK0xMEM1czRVcP6ohqPWHy6qPagSpC8j4+p89WXlT+xXJs/fg==} + engines: {node: '>= 0.4'} + + es-abstract@1.24.2: + resolution: {integrity: sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==} engines: {node: '>= 0.4'} es-array-method-boxes-properly@1.0.0: @@ -1209,19 +1206,19 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} - es-module-lexer@2.0.0: - resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + es-module-lexer@2.1.0: + resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==} - es-object-atoms@1.1.1: - resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + es-object-atoms@1.1.2: + resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} engines: {node: '>= 0.4'} es-set-tostringtag@2.1.0: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} - es-to-primitive@1.3.0: - resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + es-to-primitive@1.3.1: + resolution: {integrity: sha512-CxN9N56HYfd2m/acc/NOFrZQsN9kU4eh+2kk6A707Kz1krH8tKmfrs5RnftB8WNX80T0NS7vSQsDOlg23diR2g==} engines: {node: '>= 0.4'} es6-promise@4.2.8: @@ -1282,8 +1279,8 @@ packages: engines: {node: '>=4'} hasBin: true - esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} engines: {node: '>=0.10'} esrecurse@4.3.0: @@ -1322,6 +1319,10 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} + exit-x@0.2.2: + resolution: {integrity: sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==} + engines: {node: '>= 0.8.0'} + exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} @@ -1354,15 +1355,15 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-uri@3.1.0: - resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + fast-uri@3.1.2: + resolution: {integrity: sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==} fastest-levenshtein@1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} - fastq@1.19.1: - resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + fastq@1.20.1: + resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} fg-lodash@0.0.2: resolution: {integrity: sha512-3jf21fWKb/qCM+frhdQX6/KT7sn12i5T6K7952/hKpOdK5uzYbZbEwJmWjrgrSzc74iXFtrtbHPD2mMywPkB9A==} @@ -1427,8 +1428,8 @@ packages: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true - flatted@3.3.3: - resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} + flatted@3.4.2: + resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} for-each@0.3.5: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} @@ -1491,8 +1492,8 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - function.prototype.name@1.1.8: - resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} + function.prototype.name@1.2.0: + resolution: {integrity: sha512-jObKIik1P2QjPHP5nz5BaOtUlfgS0fWo8IUByNXkM+o+02sJOi94em77GwJKQSJ3gfPHdgzLNrHc1uokV4P/ew==} engines: {node: '>= 0.4'} functional-red-black-tree@1.0.1: @@ -1619,11 +1620,6 @@ packages: resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} engines: {node: '>=4.x'} - grunt-cli@1.4.3: - resolution: {integrity: sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==} - engines: {node: '>=10'} - hasBin: true - grunt-cli@1.5.0: resolution: {integrity: sha512-rILKAFoU0dzlf22SUfDtq2R1fosChXXlJM5j7wI6uoW8gwmXDXzbUvirlKZSYCdXl3LXFbR+8xyS+WFo+b6vlA==} engines: {node: '>=10'} @@ -1651,16 +1647,16 @@ packages: resolution: {integrity: sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==} engines: {node: '>=0.10.0'} - grunt-legacy-log-utils@2.1.0: - resolution: {integrity: sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==} + grunt-legacy-log-utils@2.1.3: + resolution: {integrity: sha512-sgG+QvKmdb44wZyzJP+ejDsy3jYxG2wzohpol+JTMlXqMUBDoZb01JPQ5jKAedtZBFwhmABAc88T9hEBLy3U+Q==} engines: {node: '>=10'} - grunt-legacy-log@3.0.0: - resolution: {integrity: sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==} + grunt-legacy-log@3.0.1: + resolution: {integrity: sha512-vytI3IUC8qUK9TcvvpHpGJzDojua/sfJV4TdLB4FtCFzospqduzBuL3+dEfpvO+tGECv7/273+33hjjMXSa92g==} engines: {node: '>= 0.10.0'} - grunt-legacy-util@2.0.1: - resolution: {integrity: sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==} + grunt-legacy-util@2.0.2: + resolution: {integrity: sha512-0xoDILyR4BVJel5uJwnhjdWN9evOQ8A0uXbQUIJ0hgVthIA6kloXHSoqATQPj6BRrHrHkcQtCeGVb0ixFoHyEQ==} engines: {node: '>=10'} grunt-saucelabs@9.0.1: @@ -1675,8 +1671,8 @@ packages: peerDependencies: grunt: '>=0.4.0' - grunt@1.6.1: - resolution: {integrity: sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==} + grunt@1.6.2: + resolution: {integrity: sha512-bUzh5nA/P5L66ihXTDP6J5BGnMB/8lXJXejYWSbH4Y4TvWM9t2S39sggQDYYQlx06cYcCsmu63HMYHGCIzUVfg==} engines: {node: '>=16'} hasBin: true @@ -1724,8 +1720,8 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} engines: {node: '>= 0.4'} hawk@0.13.1: @@ -1766,12 +1762,12 @@ packages: html-template-tag@3.2.0: resolution: {integrity: sha512-dt/21zLAVPBB3M4j6dCE46LyG8PcHHIUTYiBTIRDw1yg4nGaVbKEVHVsm3BpeJzlSB6n9BrcW6kP4zJE9mS3ew==} - http-errors@1.6.3: - resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} + http-errors@1.8.1: + resolution: {integrity: sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==} engines: {node: '>= 0.6'} - http-errors@2.0.0: - resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} engines: {node: '>= 0.8'} http-signature@0.10.1: @@ -1815,11 +1811,6 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - image-size@0.5.5: - resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} - engines: {node: '>=0.10.0'} - hasBin: true - import-fresh@3.3.1: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} @@ -1843,9 +1834,6 @@ packages: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - inherits@2.0.3: - resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} - inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -1905,8 +1893,8 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.16.1: - resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + is-core-module@2.16.2: + resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==} engines: {node: '>= 0.4'} is-data-view@1.0.2: @@ -1917,6 +1905,10 @@ packages: resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} engines: {node: '>= 0.4'} + is-document.all@1.0.0: + resolution: {integrity: sha512-+XSoyS05OdBbhFuELhgTCpFNHkpBOJqtsZfUFFpe5QTw+9Sjbh8zitxhQkYAo6wV7e1Vb8cAPvpCk9jGam/82g==} + engines: {node: '>= 0.4'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -2067,8 +2059,8 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - jackspeak@4.1.1: - resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} + jackspeak@4.2.3: + resolution: {integrity: sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==} engines: {node: 20 || >=22} jest-diff@30.1.2: @@ -2103,8 +2095,8 @@ packages: resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} hasBin: true - js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + js-yaml@4.2.0: + resolution: {integrity: sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==} hasBin: true jsbn@0.1.1: @@ -2150,8 +2142,8 @@ packages: jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - jsonfile@6.2.0: - resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} + jsonfile@6.2.1: + resolution: {integrity: sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==} jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} @@ -2195,8 +2187,8 @@ packages: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} - loader-runner@4.3.1: - resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} + loader-runner@4.3.2: + resolution: {integrity: sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==} engines: {node: '>=6.11.5'} locate-path@3.0.0: @@ -2229,8 +2221,8 @@ packages: resolution: {integrity: sha512-Kak1hi6/hYHGVPmdyiZijoQyz5x2iGVzs6w9GYB/HiXEtylY7tIoYEROMjvM1d9nXJqPOrG2MNPMn01bJ+S0Rw==} engines: {'0': node, '1': rhino} - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + lodash@4.18.1: + resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} log-symbols@2.2.0: resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==} @@ -2246,8 +2238,8 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.2.4: - resolution: {integrity: sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==} + lru-cache@11.5.1: + resolution: {integrity: sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==} engines: {node: 20 || >=22} magic-string@0.25.9: @@ -2292,6 +2284,10 @@ packages: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} @@ -2308,28 +2304,25 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - minimatch@10.1.1: - resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} - engines: {node: 20 || >=22} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} minimatch@3.0.4: resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} - minimatch@3.0.8: - resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@3.1.5: + resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} - minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + minimatch@9.0.9: + resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==} engines: {node: '>=16 || 14 >=14.17'} minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} engines: {node: '>=16 || 14 >=14.17'} mkdirp@0.5.4: @@ -2358,8 +2351,8 @@ packages: moment@2.30.1: resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} - morgan@1.10.1: - resolution: {integrity: sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==} + morgan@1.11.0: + resolution: {integrity: sha512-zSkVu3t18r39pw4ixfBKvfZi3y2UOqr7d4WYwcj3m8nXpEQK4rPO6GLzs/CExoRgmX3y9EjmmcXqv6jq0SK46g==} engines: {node: '>= 0.8.0'} ms@2.0.0: @@ -2377,8 +2370,13 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - needle@3.3.1: - resolution: {integrity: sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==} + needle@2.9.1: + resolution: {integrity: sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==} + engines: {node: '>= 4.4.x'} + hasBin: true + + needle@3.5.0: + resolution: {integrity: sha512-jaQyPKKk2YokHrEg+vFDYxXIHTCBgiZwSHOoVx/8V3GIBS8/VN6NdVRmg8q1ERtPkMvmOvebsgga4sAj5hls/w==} engines: {node: '>= 4.4.x'} hasBin: true @@ -2407,8 +2405,9 @@ packages: node-promise@0.5.14: resolution: {integrity: sha512-kbd+ABY2XRdByRVHPcBDemymfNL8+msGyKNxG/ziZnh9RjneuuGQl3/CE5UkNWxCInkJS+ztc5B31/t2kIO4Yw==} - node-releases@2.0.36: - resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} + node-releases@2.0.47: + resolution: {integrity: sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==} + engines: {node: '>=18'} node-uuid@1.4.8: resolution: {integrity: sha512-TkCET/3rr9mUuRp+CpO7qfgT++aAxfDRaalQhwPFzI9BY/2rCDn6OfpZOVggi1AXfTPpfkTrg5f5WQx5G1uLxA==} @@ -2422,14 +2421,6 @@ packages: nop@1.0.0: resolution: {integrity: sha512-XdkOuXGx0DTwlqb0DWTcDqelgU/F3YyZ+PTRaecpDVpkYskcnh3OeUYKfvjcRQ2D1diTIGxi/a3eHVjW5yPupQ==} - nopt@3.0.6: - resolution: {integrity: sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==} - hasBin: true - - nopt@4.0.3: - resolution: {integrity: sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==} - hasBin: true - nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} @@ -2531,18 +2522,10 @@ packages: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - os-homedir@1.0.2: - resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} - engines: {node: '>=0.10.0'} - os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} - osenv@0.1.5: - resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==} - deprecated: This package is no longer supported. - own-keys@1.0.1: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} @@ -2651,9 +2634,9 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} - path-scurry@2.0.1: - resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} - engines: {node: 20 || >=22} + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} path-type@3.0.0: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} @@ -2684,8 +2667,8 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} engines: {node: '>=8.6'} pidtree@0.3.1: @@ -2762,6 +2745,9 @@ packages: resolution: {integrity: sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==} engines: {node: '>=0.10.0'} + probe-image-size@7.3.0: + resolution: {integrity: sha512-7CaDeBwiAbh6ohXsvLbAZhO7wzsZAmaevfxe39qvCwRh8LyaZfDlBGGLU1CCTgrTLtCOdwBBhjOrIHaIIimHfQ==} + progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} @@ -2793,12 +2779,12 @@ packages: qs@0.6.6: resolution: {integrity: sha512-kN+yNdAf29Jgp+AYHUmC7X4QdJPR8czuMWLNLc0aRxkQ7tB3vJQEONKKT9ou/rW7EbqVec11srC9q9BiVbcnHA==} - qs@6.15.0: - resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} + qs@6.15.2: + resolution: {integrity: sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==} engines: {node: '>=0.6'} - qs@6.5.3: - resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} + qs@6.5.5: + resolution: {integrity: sha512-mzR4sElr1bfCaPJe7m8ilJ6ZXdDaGoObcYR0ZHSsktM/Lt21MVHj5De30GQH2eiZ1qGRTO7LCAzQsUeXTNexWQ==} engines: {node: '>=0.6'} queue-microtask@1.2.3: @@ -2895,8 +2881,8 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - resolve@1.22.11: - resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} + resolve@1.22.12: + resolution: {integrity: sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==} engines: {node: '>= 0.4'} hasBin: true @@ -2927,8 +2913,8 @@ packages: rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - rollup@2.79.2: - resolution: {integrity: sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==} + rollup@2.80.0: + resolution: {integrity: sha512-cIFJOD1DESzpjOBl763Kp1AH7UE/0fcdHe6rZXUdQ9c50uvgigvW97u3IcSeBwOkgqL/PXPBktBCh0KEu5L8XQ==} engines: {node: '>=10.0.0'} hasBin: true @@ -2943,8 +2929,8 @@ packages: resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} engines: {npm: '>=2.0.0'} - safe-array-concat@1.1.3: - resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} + safe-array-concat@1.1.4: + resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==} engines: {node: '>=0.4'} safe-buffer@5.1.2: @@ -2970,8 +2956,9 @@ packages: saucelabs@1.5.0: resolution: {integrity: sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==} - sax@1.4.3: - resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==} + sax@1.6.0: + resolution: {integrity: sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==} + engines: {node: '>=11.0.0'} schema-utils@4.3.3: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} @@ -2989,24 +2976,24 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + semver@7.8.4: + resolution: {integrity: sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==} engines: {node: '>=10'} hasBin: true - send@0.19.0: - resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} + send@0.19.2: + resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==} engines: {node: '>= 0.8.0'} serialize-javascript@4.0.0: resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} - serve-index@1.9.1: - resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} + serve-index@1.9.2: + resolution: {integrity: sha512-KDj11HScOaLmrPxl70KYNW1PksP4Nb/CLL2yvC+Qd2kHMPEEpfc4Re2e4FOay+bC/+XQl/7zAcWON3JVo5v3KQ==} engines: {node: '>= 0.8.0'} - serve-static@1.16.2: - resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} + serve-static@1.16.3: + resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==} engines: {node: '>= 0.8.0'} set-blocking@2.0.0: @@ -3024,9 +3011,6 @@ packages: resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} engines: {node: '>= 0.4'} - setprototypeof@1.1.0: - resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} - setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} @@ -3050,8 +3034,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shell-quote@1.8.3: - resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==} + shell-quote@1.8.4: + resolution: {integrity: sha512-VsC6n6vz1ihYYyZZwX7YZSF5l5x36ca17OC+a69h94YqB7X6XLwf+5MOgynYir2SLFUbl8gIYvBo8K8RoNQ6bQ==} engines: {node: '>= 0.4'} shelljs@0.8.5: @@ -3064,8 +3048,8 @@ packages: engines: {node: '>=6'} hasBin: true - side-channel-list@1.0.0: - resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + side-channel-list@1.0.1: + resolution: {integrity: sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==} engines: {node: '>= 0.4'} side-channel-map@1.0.1: @@ -3076,8 +3060,8 @@ packages: resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} engines: {node: '>= 0.4'} - side-channel@1.1.0: - resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + side-channel@1.1.1: + resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==} engines: {node: '>= 0.4'} signal-exit@3.0.7: @@ -3124,8 +3108,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.22: - resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} + spdx-license-ids@3.0.23: + resolution: {integrity: sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==} split@1.0.1: resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} @@ -3145,14 +3129,17 @@ packages: resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} engines: {node: '>= 0.6'} - statuses@2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} stop-iteration-iterator@1.1.0: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} + stream-parser@0.3.1: + resolution: {integrity: sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==} + string-width@2.1.1: resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} engines: {node: '>=4'} @@ -3173,12 +3160,12 @@ packages: resolution: {integrity: sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==} engines: {node: '>= 0.4'} - string.prototype.trim@1.2.10: - resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} + string.prototype.trim@1.2.11: + resolution: {integrity: sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==} engines: {node: '>= 0.4'} - string.prototype.trimend@1.0.9: - resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + string.prototype.trimend@1.0.10: + resolution: {integrity: sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==} engines: {node: '>= 0.4'} string.prototype.trimstart@1.0.8: @@ -3204,8 +3191,8 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-ansi@7.1.2: - resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} engines: {node: '>=12'} strip-bom@3.0.0: @@ -3256,23 +3243,50 @@ packages: resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==} engines: {node: '>=10.0.0'} - tapable@2.3.0: - resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} - terser-webpack-plugin@5.4.0: - resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} + terser-webpack-plugin@5.6.1: + resolution: {integrity: sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==} engines: {node: '>= 10.13.0'} peerDependencies: + '@minify-html/node': '*' '@swc/core': '*' + '@swc/css': '*' + '@swc/html': '*' + clean-css: '*' + cssnano: '*' + csso: '*' esbuild: '*' + html-minifier-terser: '*' + lightningcss: '*' + postcss: '*' uglify-js: '*' webpack: ^5.1.0 peerDependenciesMeta: + '@minify-html/node': + optional: true '@swc/core': optional: true + '@swc/css': + optional: true + '@swc/html': + optional: true + clean-css: + optional: true + cssnano: + optional: true + csso: + optional: true esbuild: optional: true + html-minifier-terser: + optional: true + lightningcss: + optional: true + postcss: + optional: true uglify-js: optional: true @@ -3281,13 +3295,13 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - terser@5.46.0: - resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} + terser@5.48.0: + resolution: {integrity: sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==} engines: {node: '>=10'} hasBin: true - test-exclude@7.0.1: - resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} + test-exclude@7.0.2: + resolution: {integrity: sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==} engines: {node: '>=18'} text-table@0.2.0: @@ -3372,8 +3386,8 @@ packages: resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} engines: {node: '>= 0.4'} - typed-array-length@1.0.7: - resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} + typed-array-length@1.0.8: + resolution: {integrity: sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==} engines: {node: '>= 0.4'} typescript@5.9.3: @@ -3448,10 +3462,6 @@ packages: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} - v8flags@3.2.0: - resolution: {integrity: sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==} - engines: {node: '>= 0.10'} - v8flags@4.0.1: resolution: {integrity: sha512-fcRLaS4H/hrZk9hYwbdRM35D0U8IYMfEClhXxCivOojl+yTRAZH3Zy2sSy6qVCiGbV9YAtPssP6jaChqC9vPCg==} engines: {node: '>= 10.13.0'} @@ -3466,8 +3476,8 @@ packages: resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} - watchpack@2.5.1: - resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} + watchpack@2.5.2: + resolution: {integrity: sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==} engines: {node: '>=10.13.0'} webidl-conversions@3.0.1: @@ -3494,12 +3504,12 @@ packages: resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} engines: {node: '>=10.0.0'} - webpack-sources@3.3.4: - resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} + webpack-sources@3.5.0: + resolution: {integrity: sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ==} engines: {node: '>=10.13.0'} - webpack@5.105.4: - resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} + webpack@5.107.2: + resolution: {integrity: sha512-v7RhXaJbpMlV0D7hC7lb2EbnxkoeUqf9qhKr6lozx3Q48pmFrqqNRmZFUEGmi7pSwm6fCQ2H1IjvCkHqdpVdjQ==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -3529,8 +3539,8 @@ packages: which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - which-typed-array@1.1.19: - resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} + which-typed-array@1.1.22: + resolution: {integrity: sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==} engines: {node: '>= 0.4'} which@1.3.1: @@ -3644,22 +3654,22 @@ snapshots: dependencies: '@babel/highlight': 7.25.9 - '@babel/code-frame@7.27.1': + '@babel/code-frame@7.29.7': dependencies: - '@babel/helper-validator-identifier': 7.28.5 + '@babel/helper-validator-identifier': 7.29.7 js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/helper-validator-identifier@7.28.5': {} + '@babel/helper-validator-identifier@7.29.7': {} '@babel/highlight@7.25.9': dependencies: - '@babel/helper-validator-identifier': 7.28.5 + '@babel/helper-validator-identifier': 7.29.7 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/runtime@7.28.4': {} + '@babel/runtime@7.29.7': {} '@bcoe/v8-coverage@1.0.2': {} @@ -3667,14 +3677,14 @@ snapshots: '@eslint/eslintrc@0.4.3': dependencies: - ajv: 6.12.6 + ajv: 6.15.0 debug: 4.4.3 espree: 7.3.1 globals: 13.24.0 ignore: 4.0.6 import-fresh: 3.3.1 js-yaml: 3.14.2 - minimatch: 3.1.2 + minimatch: 3.1.5 strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color @@ -3683,28 +3693,24 @@ snapshots: dependencies: '@humanwhocodes/object-schema': 1.2.1 debug: 4.4.3 - minimatch: 3.1.2 + minimatch: 3.1.5 transitivePeerDependencies: - supports-color '@humanwhocodes/object-schema@1.2.1': {} - '@isaacs/balanced-match@4.0.1': {} - - '@isaacs/brace-expansion@5.0.0': - dependencies: - '@isaacs/balanced-match': 4.0.1 - '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.2 + strip-ansi: 7.2.0 strip-ansi-cjs: strip-ansi@6.0.1 wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@istanbuljs/schema@0.1.3': {} + '@isaacs/cliui@9.0.0': {} + + '@istanbuljs/schema@0.1.6': {} '@jest/diff-sequences@30.0.1': {} @@ -3712,7 +3718,7 @@ snapshots: '@jest/schemas@30.0.5': dependencies: - '@sinclair/typebox': 0.34.41 + '@sinclair/typebox': 0.34.49 '@jridgewell/gen-mapping@0.3.13': dependencies: @@ -3743,59 +3749,49 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.19.1 + fastq: 1.20.1 '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/plugin-commonjs@17.1.0(rollup@2.79.2)': + '@rollup/plugin-commonjs@17.1.0(rollup@2.80.0)': dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.2) + '@rollup/pluginutils': 3.1.0(rollup@2.80.0) commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.3 is-reference: 1.2.1 magic-string: 0.25.9 - resolve: 1.22.11 - rollup: 2.79.2 + resolve: 1.22.12 + rollup: 2.80.0 - '@rollup/plugin-json@4.1.0(rollup@2.79.2)': + '@rollup/plugin-json@4.1.0(rollup@2.80.0)': dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.2) - rollup: 2.79.2 + '@rollup/pluginutils': 3.1.0(rollup@2.80.0) + rollup: 2.80.0 - '@rollup/plugin-node-resolve@11.2.1(rollup@2.79.2)': + '@rollup/plugin-node-resolve@11.2.1(rollup@2.80.0)': dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.2) + '@rollup/pluginutils': 3.1.0(rollup@2.80.0) '@types/resolve': 1.17.1 builtin-modules: 3.3.0 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.11 - rollup: 2.79.2 + resolve: 1.22.12 + rollup: 2.80.0 - '@rollup/pluginutils@3.1.0(rollup@2.79.2)': + '@rollup/pluginutils@3.1.0(rollup@2.80.0)': dependencies: '@types/estree': 0.0.39 estree-walker: 1.0.1 - picomatch: 2.3.1 - rollup: 2.79.2 - - '@sinclair/typebox@0.34.41': {} - - '@types/eslint-scope@3.7.7': - dependencies: - '@types/eslint': 9.6.1 - '@types/estree': 1.0.8 + picomatch: 2.3.2 + rollup: 2.80.0 - '@types/eslint@9.6.1': - dependencies: - '@types/estree': 1.0.8 - '@types/json-schema': 7.0.15 + '@sinclair/typebox@0.34.49': {} '@types/estree@0.0.39': {} - '@types/estree@1.0.8': {} + '@types/estree@1.0.9': {} '@types/glob@7.2.0': dependencies: @@ -3808,7 +3804,7 @@ snapshots: '@types/minimatch@6.0.0': dependencies: - minimatch: 10.1.1 + minimatch: 10.2.5 '@types/node@18.19.130': dependencies: @@ -3828,7 +3824,7 @@ snapshots: functional-red-black-tree: 1.0.1 ignore: 5.3.2 regexpp: 3.2.0 - semver: 7.7.3 + semver: 7.8.4 tsutils: 3.21.0(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 @@ -3874,7 +3870,7 @@ snapshots: debug: 4.4.3 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.7.3 + semver: 7.8.4 tsutils: 3.21.0(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 @@ -3962,20 +3958,20 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 - '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.105.4)': + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.107.2)': dependencies: - webpack: 5.105.4(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack@5.105.4) + webpack: 5.107.2(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.107.2) - '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.105.4)': + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.107.2)': dependencies: - webpack: 5.105.4(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack@5.105.4) + webpack: 5.107.2(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.107.2) - '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.105.4)': + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.107.2)': dependencies: - webpack: 5.105.4(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack@5.105.4) + webpack: 5.107.2(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.107.2) '@xtuc/ieee754@1.2.0': {} @@ -3988,9 +3984,9 @@ snapshots: mime-types: 2.1.35 negotiator: 0.6.3 - acorn-import-phases@1.0.4(acorn@8.16.0): + acorn-import-phases@1.0.4(acorn@8.17.0): dependencies: - acorn: 8.16.0 + acorn: 8.17.0 acorn-jsx@5.3.2(acorn@7.4.1): dependencies: @@ -3998,46 +3994,44 @@ snapshots: acorn@7.4.1: {} - acorn@8.15.0: {} - - acorn@8.16.0: {} + acorn@8.17.0: {} agent-base@4.3.0: dependencies: es6-promisify: 5.0.0 - ajv-formats@2.1.1(ajv@8.17.1): + ajv-formats@2.1.1(ajv@8.20.0): optionalDependencies: - ajv: 8.17.1 + ajv: 8.20.0 - ajv-keywords@5.1.0(ajv@8.17.1): + ajv-keywords@5.1.0(ajv@8.20.0): dependencies: - ajv: 8.17.1 + ajv: 8.20.0 fast-deep-equal: 3.1.3 - ajv@6.12.6: + ajv@6.15.0: dependencies: fast-deep-equal: 3.1.3 fast-json-stable-stringify: 2.1.0 json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ajv@8.17.1: + ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.0 + fast-uri: 3.1.2 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 all-contributors-cli@6.26.1: dependencies: - '@babel/runtime': 7.28.4 + '@babel/runtime': 7.29.7 async: 3.2.6 chalk: 4.1.2 didyoumean: 1.2.2 inquirer: 7.3.3 json-fixer: 1.6.15 - lodash: 4.17.21 + lodash: 4.18.1 node-fetch: 2.7.0 pify: 5.0.0 yargs: 15.4.1 @@ -4108,21 +4102,21 @@ snapshots: array.prototype.reduce@1.0.8: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.24.1 + es-abstract: 1.24.2 es-array-method-boxes-properly: 1.0.0 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 is-string: 1.1.1 arraybuffer.prototype.slice@1.0.4: dependencies: array-buffer-byte-length: 1.0.2 - call-bind: 1.0.8 + call-bind: 1.0.9 define-properties: 1.2.1 - es-abstract: 1.24.1 + es-abstract: 1.24.2 es-errors: 1.3.0 get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 @@ -4165,7 +4159,7 @@ snapshots: autoprefixer@6.7.7: dependencies: browserslist: 1.7.7 - caniuse-db: 1.0.30001760 + caniuse-db: 1.0.30001799 normalize-range: 0.1.2 num2fraction: 1.2.2 postcss: 5.2.18 @@ -4183,7 +4177,9 @@ snapshots: balanced-match@1.0.2: {} - baseline-browser-mapping@2.10.0: {} + balanced-match@4.0.4: {} + + baseline-browser-mapping@2.10.37: {} basic-auth@2.0.1: dependencies: @@ -4197,7 +4193,7 @@ snapshots: benchmark@2.1.4: dependencies: - lodash: 4.17.21 + lodash: 4.18.1 platform: 1.3.6 benny@3.7.1: @@ -4224,15 +4220,19 @@ snapshots: bootstrap-less-port@0.3.0: {} - brace-expansion@1.1.12: + brace-expansion@1.1.15: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - brace-expansion@2.0.2: + brace-expansion@2.1.1: dependencies: balanced-match: 1.0.2 + brace-expansion@5.0.6: + dependencies: + balanced-match: 4.0.4 + braces@3.0.3: dependencies: fill-range: 7.1.1 @@ -4241,16 +4241,16 @@ snapshots: browserslist@1.7.7: dependencies: - caniuse-db: 1.0.30001760 - electron-to-chromium: 1.5.267 + caniuse-db: 1.0.30001799 + electron-to-chromium: 1.5.375 - browserslist@4.28.1: + browserslist@4.28.2: dependencies: - baseline-browser-mapping: 2.10.0 - caniuse-lite: 1.0.30001777 - electron-to-chromium: 1.5.267 - node-releases: 2.0.36 - update-browserslist-db: 1.2.3(browserslist@4.28.1) + baseline-browser-mapping: 2.10.37 + caniuse-lite: 1.0.30001799 + electron-to-chromium: 1.5.375 + node-releases: 2.0.47 + update-browserslist-db: 1.2.3(browserslist@4.28.2) buffer-from@1.1.2: {} @@ -4259,13 +4259,13 @@ snapshots: c8@10.1.3: dependencies: '@bcoe/v8-coverage': 1.0.2 - '@istanbuljs/schema': 0.1.3 + '@istanbuljs/schema': 0.1.6 find-up: 5.0.0 foreground-child: 3.3.1 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-reports: 3.2.0 - test-exclude: 7.0.1 + test-exclude: 7.0.2 v8-to-istanbul: 9.3.0 yargs: 17.7.2 yargs-parser: 21.1.1 @@ -4275,7 +4275,7 @@ snapshots: es-errors: 1.3.0 function-bind: 1.1.2 - call-bind@1.0.8: + call-bind@1.0.9: dependencies: call-bind-apply-helpers: 1.0.2 es-define-property: 1.0.1 @@ -4291,9 +4291,9 @@ snapshots: camelcase@5.3.1: {} - caniuse-db@1.0.30001760: {} + caniuse-db@1.0.30001799: {} - caniuse-lite@1.0.30001777: {} + caniuse-lite@1.0.30001799: {} caseless@0.12.0: {} @@ -4429,11 +4429,11 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig@9.0.0(typescript@5.9.3): + cosmiconfig@9.0.2(typescript@5.9.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 - js-yaml: 4.1.1 + js-yaml: 4.2.0 parse-json: 5.2.0 optionalDependencies: typescript: 5.9.3 @@ -4573,7 +4573,7 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.267: {} + electron-to-chromium@1.5.375: {} emoji-regex@7.0.3: {} @@ -4585,10 +4585,10 @@ snapshots: encodeurl@2.0.0: {} - enhanced-resolve@5.20.0: + enhanced-resolve@5.24.0: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.0 + tapable: 2.3.3 enquirer@2.4.1: dependencies: @@ -4608,22 +4608,29 @@ snapshots: dependencies: is-arrayish: 0.2.1 - es-abstract@1.24.1: + es-abstract-get@1.0.0: + dependencies: + es-errors: 1.3.0 + es-object-atoms: 1.1.2 + is-callable: 1.2.7 + object-inspect: 1.13.4 + + es-abstract@1.24.2: dependencies: array-buffer-byte-length: 1.0.2 arraybuffer.prototype.slice: 1.0.4 available-typed-arrays: 1.0.7 - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 data-view-buffer: 1.0.2 data-view-byte-length: 1.0.2 data-view-byte-offset: 1.0.1 es-define-property: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 es-set-tostringtag: 2.1.0 - es-to-primitive: 1.3.0 - function.prototype.name: 1.1.8 + es-to-primitive: 1.3.1 + function.prototype.name: 1.2.0 get-intrinsic: 1.3.0 get-proto: 1.0.1 get-symbol-description: 1.1.0 @@ -4632,7 +4639,7 @@ snapshots: has-property-descriptors: 1.0.2 has-proto: 1.2.0 has-symbols: 1.1.0 - hasown: 2.0.2 + hasown: 2.0.4 internal-slot: 1.1.0 is-array-buffer: 3.0.5 is-callable: 1.2.7 @@ -4650,20 +4657,20 @@ snapshots: object.assign: 4.1.7 own-keys: 1.0.1 regexp.prototype.flags: 1.5.4 - safe-array-concat: 1.1.3 + safe-array-concat: 1.1.4 safe-push-apply: 1.0.0 safe-regex-test: 1.1.0 set-proto: 1.0.0 stop-iteration-iterator: 1.1.0 - string.prototype.trim: 1.2.10 - string.prototype.trimend: 1.0.9 + string.prototype.trim: 1.2.11 + string.prototype.trimend: 1.0.10 string.prototype.trimstart: 1.0.8 typed-array-buffer: 1.0.3 typed-array-byte-length: 1.0.3 typed-array-byte-offset: 1.0.4 - typed-array-length: 1.0.7 + typed-array-length: 1.0.8 unbox-primitive: 1.1.0 - which-typed-array: 1.1.19 + which-typed-array: 1.1.22 es-array-method-boxes-properly@1.0.0: {} @@ -4671,9 +4678,9 @@ snapshots: es-errors@1.3.0: {} - es-module-lexer@2.0.0: {} + es-module-lexer@2.1.0: {} - es-object-atoms@1.1.1: + es-object-atoms@1.1.2: dependencies: es-errors: 1.3.0 @@ -4682,10 +4689,12 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 - hasown: 2.0.2 + hasown: 2.0.4 - es-to-primitive@1.3.0: + es-to-primitive@1.3.1: dependencies: + es-abstract-get: 1.0.0 + es-errors: 1.3.0 is-callable: 1.2.7 is-date-object: 1.1.0 is-symbol: 1.1.1 @@ -4727,7 +4736,7 @@ snapshots: '@babel/code-frame': 7.12.11 '@eslint/eslintrc': 0.4.3 '@humanwhocodes/config-array': 0.5.0 - ajv: 6.12.6 + ajv: 6.15.0 chalk: 4.1.2 cross-spawn: 7.0.6 debug: 4.4.3 @@ -4738,7 +4747,7 @@ snapshots: eslint-utils: 2.1.0 eslint-visitor-keys: 2.1.0 espree: 7.3.1 - esquery: 1.6.0 + esquery: 1.7.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 @@ -4753,12 +4762,12 @@ snapshots: json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 - minimatch: 3.1.2 + minimatch: 3.1.5 natural-compare: 1.4.0 optionator: 0.9.4 progress: 2.0.3 regexpp: 3.2.0 - semver: 7.7.3 + semver: 7.8.4 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 table: 6.9.0 @@ -4775,7 +4784,7 @@ snapshots: esprima@4.0.1: {} - esquery@1.6.0: + esquery@1.7.0: dependencies: estraverse: 5.3.0 @@ -4801,6 +4810,8 @@ snapshots: events@3.3.0: {} + exit-x@0.2.2: {} + exit@0.1.2: {} expand-tilde@2.0.2: @@ -4831,11 +4842,11 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-uri@3.1.0: {} + fast-uri@3.1.2: {} fastest-levenshtein@1.0.16: {} - fastq@1.19.1: + fastq@1.20.1: dependencies: reusify: 1.1.0 @@ -4913,7 +4924,7 @@ snapshots: flat-cache@3.2.0: dependencies: - flatted: 3.3.3 + flatted: 3.4.2 keyv: 4.5.4 rimraf: 3.0.2 @@ -4923,7 +4934,7 @@ snapshots: flat@5.0.2: {} - flatted@3.3.3: {} + flatted@3.4.2: {} for-each@0.3.5: dependencies: @@ -4963,7 +4974,7 @@ snapshots: fs-extra@10.1.0: dependencies: graceful-fs: 4.2.11 - jsonfile: 6.2.0 + jsonfile: 6.2.1 universalify: 2.0.1 fs-extra@8.1.0: @@ -4982,14 +4993,17 @@ snapshots: function-bind@1.1.2: {} - function.prototype.name@1.1.8: + function.prototype.name@1.2.0: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 - define-properties: 1.2.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 functions-have-names: 1.2.3 - hasown: 2.0.2 + has-property-descriptors: 1.0.2 + hasown: 2.0.4 is-callable: 1.2.7 + is-document.all: 1.0.0 functional-red-black-tree@1.0.1: {} @@ -5006,18 +5020,18 @@ snapshots: call-bind-apply-helpers: 1.0.2 es-define-property: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 function-bind: 1.1.2 get-proto: 1.0.1 gopd: 1.2.0 has-symbols: 1.1.0 - hasown: 2.0.2 + hasown: 2.0.4 math-intrinsics: 1.1.0 get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 get-symbol-description@1.1.0: dependencies: @@ -5084,19 +5098,19 @@ snapshots: dependencies: foreground-child: 3.3.1 jackspeak: 3.4.3 - minimatch: 9.0.5 - minipass: 7.1.2 + minimatch: 9.0.9 + minipass: 7.1.3 package-json-from-dist: 1.0.1 path-scurry: 1.11.1 glob@11.0.3: dependencies: foreground-child: 3.3.1 - jackspeak: 4.1.1 - minimatch: 10.1.1 - minipass: 7.1.2 + jackspeak: 4.2.3 + minimatch: 10.2.5 + minipass: 7.1.3 package-json-from-dist: 1.0.1 - path-scurry: 2.0.1 + path-scurry: 2.0.2 glob@7.1.3: dependencies: @@ -5112,7 +5126,7 @@ snapshots: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.1.2 + minimatch: 3.1.5 once: 1.4.0 path-is-absolute: 1.0.1 @@ -5121,7 +5135,7 @@ snapshots: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.1.2 + minimatch: 3.1.5 once: 1.4.0 path-is-absolute: 1.0.1 @@ -5174,14 +5188,6 @@ snapshots: growl@1.10.5: {} - grunt-cli@1.4.3: - dependencies: - grunt-known-options: 2.0.0 - interpret: 1.1.0 - liftup: 3.0.1 - nopt: 4.0.3 - v8flags: 3.2.0 - grunt-cli@1.5.0: dependencies: grunt-known-options: 2.0.0 @@ -5190,64 +5196,63 @@ snapshots: nopt: 5.0.0 v8flags: 4.0.1 - grunt-contrib-clean@1.1.0(grunt@1.6.1): + grunt-contrib-clean@1.1.0(grunt@1.6.2): dependencies: async: 1.5.2 - grunt: 1.6.1 + grunt: 1.6.2 rimraf: 2.7.1 - grunt-contrib-connect@1.0.2(grunt@1.6.1): + grunt-contrib-connect@1.0.2(grunt@1.6.2): dependencies: async: 1.5.2 connect: 3.7.0 connect-livereload: 0.5.4 - grunt: 1.6.1 + grunt: 1.6.2 http2: 3.3.7 - morgan: 1.10.1 + morgan: 1.11.0 opn: 4.0.2 portscanner: 1.2.0 - serve-index: 1.9.1 - serve-static: 1.16.2 + serve-index: 1.9.2 + serve-static: 1.16.3 transitivePeerDependencies: - supports-color - grunt-eslint@23.0.0(grunt@1.6.1): + grunt-eslint@23.0.0(grunt@1.6.2): dependencies: chalk: 4.1.2 eslint: 7.32.0 - grunt: 1.6.1 + grunt: 1.6.2 transitivePeerDependencies: - supports-color grunt-known-options@2.0.0: {} - grunt-legacy-log-utils@2.1.0: + grunt-legacy-log-utils@2.1.3: dependencies: chalk: 4.1.2 - lodash: 4.17.21 - grunt-legacy-log@3.0.0: + grunt-legacy-log@3.0.1: dependencies: colors: 1.1.2 - grunt-legacy-log-utils: 2.1.0 + grunt-legacy-log-utils: 2.1.3 hooker: 0.2.3 - lodash: 4.17.21 + lodash: 4.18.1 - grunt-legacy-util@2.0.1: + grunt-legacy-util@2.0.2: dependencies: async: 3.2.6 - exit: 0.1.2 + exit-x: 0.2.2 getobject: 1.0.2 hooker: 0.2.3 - lodash: 4.17.21 + lodash: 4.18.1 underscore.string: 3.3.6 which: 2.0.2 - grunt-saucelabs@9.0.1(grunt@1.6.1): + grunt-saucelabs@9.0.1(grunt@1.6.2): dependencies: colors: 1.1.2 - grunt: 1.6.1 - lodash: 4.17.21 + grunt: 1.6.2 + lodash: 4.18.1 q: 1.4.1 requestretry: 1.9.1 sauce-tunnel: 2.5.0 @@ -5255,34 +5260,34 @@ snapshots: transitivePeerDependencies: - supports-color - grunt-shell@1.3.1(grunt@1.6.1): + grunt-shell@1.3.1(grunt@1.6.2): dependencies: chalk: 1.1.3 - grunt: 1.6.1 + grunt: 1.6.2 npm-run-path: 1.0.0 object-assign: 4.1.1 - grunt@1.6.1: + grunt@1.6.2: dependencies: dateformat: 4.6.3 eventemitter2: 0.4.14 exit: 0.1.2 findup-sync: 5.0.0 glob: 7.1.7 - grunt-cli: 1.4.3 + grunt-cli: 1.5.0 grunt-known-options: 2.0.0 - grunt-legacy-log: 3.0.0 - grunt-legacy-util: 2.0.1 + grunt-legacy-log: 3.0.1 + grunt-legacy-util: 2.0.2 iconv-lite: 0.6.3 js-yaml: 3.14.2 - minimatch: 3.0.8 - nopt: 3.0.6 + minimatch: 3.1.5 + nopt: 5.0.0 har-schema@2.0.0: {} har-validator@5.1.5: dependencies: - ajv: 6.12.6 + ajv: 6.15.0 har-schema: 2.0.0 has-ansi@2.0.0: @@ -5311,7 +5316,7 @@ snapshots: dependencies: has-symbols: 1.1.0 - hasown@2.0.2: + hasown@2.0.4: dependencies: function-bind: 1.1.2 @@ -5344,19 +5349,20 @@ snapshots: dependencies: html-es6cape: 1.0.5 - http-errors@1.6.3: + http-errors@1.8.1: dependencies: depd: 1.1.2 - inherits: 2.0.3 - setprototypeof: 1.1.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 statuses: 1.5.0 + toidentifier: 1.0.1 - http-errors@2.0.0: + http-errors@2.0.1: dependencies: depd: 2.0.0 inherits: 2.0.4 setprototypeof: 1.2.0 - statuses: 2.0.1 + statuses: 2.0.2 toidentifier: 1.0.1 http-signature@0.10.1: @@ -5399,9 +5405,6 @@ snapshots: ignore@5.3.2: {} - image-size@0.5.5: - optional: true - import-fresh@3.3.1: dependencies: parent-module: 1.0.1 @@ -5425,8 +5428,6 @@ snapshots: once: 1.4.0 wrappy: 1.0.2 - inherits@2.0.3: {} - inherits@2.0.4: {} ini@1.3.8: {} @@ -5439,7 +5440,7 @@ snapshots: cli-width: 3.0.0 external-editor: 3.1.0 figures: 3.2.0 - lodash: 4.17.21 + lodash: 4.18.1 mute-stream: 0.0.8 run-async: 2.4.1 rxjs: 6.6.7 @@ -5454,8 +5455,8 @@ snapshots: internal-slot@1.1.0: dependencies: es-errors: 1.3.0 - hasown: 2.0.2 - side-channel: 1.1.0 + hasown: 2.0.4 + side-channel: 1.1.1 interpret@1.1.0: {} @@ -5470,7 +5471,7 @@ snapshots: is-array-buffer@3.0.5: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 get-intrinsic: 1.3.0 @@ -5497,9 +5498,9 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.16.1: + is-core-module@2.16.2: dependencies: - hasown: 2.0.2 + hasown: 2.0.4 is-data-view@1.0.2: dependencies: @@ -5512,6 +5513,10 @@ snapshots: call-bound: 1.0.4 has-tostringtag: 1.0.2 + is-document.all@1.0.0: + dependencies: + call-bound: 1.0.4 + is-extglob@2.1.1: {} is-finalizationregistry@1.1.1: @@ -5559,14 +5564,14 @@ snapshots: is-reference@1.2.1: dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 is-regex@1.2.1: dependencies: call-bound: 1.0.4 gopd: 1.2.0 has-tostringtag: 1.0.2 - hasown: 2.0.2 + hasown: 2.0.4 is-relative@1.0.0: dependencies: @@ -5591,7 +5596,7 @@ snapshots: is-typed-array@1.1.15: dependencies: - which-typed-array: 1.1.19 + which-typed-array: 1.1.22 is-typedarray@1.0.0: {} @@ -5645,9 +5650,9 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.1.1: + jackspeak@4.2.3: dependencies: - '@isaacs/cliui': 8.0.2 + '@isaacs/cliui': 9.0.0 jest-diff@30.1.2: dependencies: @@ -5667,9 +5672,9 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jit-grunt@0.10.0(grunt@1.6.1): + jit-grunt@0.10.0(grunt@1.6.2): dependencies: - grunt: 1.6.1 + grunt: 1.6.2 js-base64@2.6.4: {} @@ -5685,7 +5690,7 @@ snapshots: argparse: 1.0.10 esprima: 4.0.1 - js-yaml@4.1.1: + js-yaml@4.2.0: dependencies: argparse: 2.0.1 @@ -5695,7 +5700,7 @@ snapshots: json-fixer@1.6.15: dependencies: - '@babel/runtime': 7.28.4 + '@babel/runtime': 7.29.7 chalk: 4.1.2 pegjs: 0.10.0 @@ -5725,7 +5730,7 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 - jsonfile@6.2.0: + jsonfile@6.2.1: dependencies: universalify: 2.0.1 optionalDependencies: @@ -5771,7 +5776,7 @@ snapshots: is-plain-object: 2.0.4 object.map: 1.0.1 rechoir: 0.7.1 - resolve: 1.22.11 + resolve: 1.22.12 lines-and-columns@1.2.4: {} @@ -5782,7 +5787,7 @@ snapshots: pify: 3.0.0 strip-bom: 3.0.0 - loader-runner@4.3.1: {} + loader-runner@4.3.2: {} locate-path@3.0.0: dependencies: @@ -5807,7 +5812,7 @@ snapshots: lodash@2.4.2: {} - lodash@4.17.21: {} + lodash@4.18.1: {} log-symbols@2.2.0: dependencies: @@ -5826,7 +5831,7 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.2.4: {} + lru-cache@11.5.1: {} magic-string@0.25.9: dependencies: @@ -5834,7 +5839,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.7.3 + semver: 7.8.4 make-dir@5.1.0: optional: true @@ -5856,10 +5861,12 @@ snapshots: micromatch@4.0.8: dependencies: braces: 3.0.3 - picomatch: 2.3.1 + picomatch: 2.3.2 mime-db@1.52.0: {} + mime-db@1.54.0: {} + mime-types@2.1.35: dependencies: mime-db: 1.52.0 @@ -5870,29 +5877,25 @@ snapshots: mimic-fn@2.1.0: {} - minimatch@10.1.1: + minimatch@10.2.5: dependencies: - '@isaacs/brace-expansion': 5.0.0 + brace-expansion: 5.0.6 minimatch@3.0.4: dependencies: - brace-expansion: 1.1.12 - - minimatch@3.0.8: - dependencies: - brace-expansion: 1.1.12 + brace-expansion: 1.1.15 - minimatch@3.1.2: + minimatch@3.1.5: dependencies: - brace-expansion: 1.1.12 + brace-expansion: 1.1.15 - minimatch@9.0.5: + minimatch@9.0.9: dependencies: - brace-expansion: 2.0.2 + brace-expansion: 2.1.1 minimist@1.2.8: {} - minipass@7.1.2: {} + minipass@7.1.3: {} mkdirp@0.5.4: dependencies: @@ -5938,12 +5941,12 @@ snapshots: moment@2.30.1: {} - morgan@1.10.1: + morgan@1.11.0: dependencies: basic-auth: 2.0.1 debug: 2.6.9 depd: 2.0.0 - on-finished: 2.3.0 + on-finished: 2.4.1 on-headers: 1.1.0 transitivePeerDependencies: - supports-color @@ -5958,10 +5961,19 @@ snapshots: natural-compare@1.4.0: {} - needle@3.3.1: + needle@2.9.1: + dependencies: + debug: 3.2.7 + iconv-lite: 0.4.24 + sax: 1.6.0 + transitivePeerDependencies: + - supports-color + optional: true + + needle@3.5.0: dependencies: iconv-lite: 0.6.3 - sax: 1.4.3 + sax: 1.6.0 optional: true negotiator@0.6.3: {} @@ -5981,7 +5993,7 @@ snapshots: node-promise@0.5.14: {} - node-releases@2.0.36: {} + node-releases@2.0.47: {} node-uuid@1.4.8: {} @@ -5992,15 +6004,6 @@ snapshots: nop@1.0.0: {} - nopt@3.0.6: - dependencies: - abbrev: 1.1.1 - - nopt@4.0.3: - dependencies: - abbrev: 1.1.1 - osenv: 0.1.5 - nopt@5.0.0: dependencies: abbrev: 1.1.1 @@ -6008,7 +6011,7 @@ snapshots: normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.11 + resolve: 1.22.12 semver: 5.7.2 validate-npm-package-license: 3.0.4 @@ -6020,10 +6023,10 @@ snapshots: chalk: 2.4.2 cross-spawn: 6.0.6 memorystream: 0.3.1 - minimatch: 3.1.2 + minimatch: 3.1.5 pidtree: 0.3.1 read-pkg: 3.0.0 - shell-quote: 1.8.3 + shell-quote: 1.8.4 string.prototype.padend: 3.1.6 npm-run-path@1.0.0: @@ -6059,10 +6062,10 @@ snapshots: object.assign@4.1.7: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 has-symbols: 1.1.0 object-keys: 1.1.1 @@ -6076,12 +6079,12 @@ snapshots: object.getownpropertydescriptors@2.1.9: dependencies: array.prototype.reduce: 1.0.8 - call-bind: 1.0.8 + call-bind: 1.0.9 define-properties: 1.2.1 - es-abstract: 1.24.1 - es-object-atoms: 1.1.1 + es-abstract: 1.24.2 + es-object-atoms: 1.1.2 gopd: 1.2.0 - safe-array-concat: 1.1.3 + safe-array-concat: 1.1.4 object.map@1.0.1: dependencies: @@ -6124,15 +6127,8 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - os-homedir@1.0.2: {} - os-tmpdir@1.0.2: {} - osenv@0.1.5: - dependencies: - os-homedir: 1.0.2 - os-tmpdir: 1.0.2 - own-keys@1.0.1: dependencies: get-intrinsic: 1.3.0 @@ -6180,7 +6176,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.7 error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -6222,12 +6218,12 @@ snapshots: path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 - minipass: 7.1.2 + minipass: 7.1.3 - path-scurry@2.0.1: + path-scurry@2.0.2: dependencies: - lru-cache: 11.2.4 - minipass: 7.1.2 + lru-cache: 11.5.1 + minipass: 7.1.3 path-type@3.0.0: dependencies: @@ -6247,7 +6243,7 @@ snapshots: picocolors@1.1.1: {} - picomatch@2.3.1: {} + picomatch@2.3.2: {} pidtree@0.3.1: {} @@ -6309,6 +6305,15 @@ snapshots: parse-ms: 1.0.1 plur: 1.0.0 + probe-image-size@7.3.0: + dependencies: + lodash.merge: 4.6.2 + needle: 2.9.1 + stream-parser: 0.3.1 + transitivePeerDependencies: + - supports-color + optional: true + progress@2.0.3: {} promise@7.3.1: @@ -6330,11 +6335,11 @@ snapshots: qs@0.6.6: {} - qs@6.15.0: + qs@6.15.2: dependencies: - side-channel: 1.1.0 + side-channel: 1.1.1 - qs@6.5.3: {} + qs@6.5.5: {} queue-microtask@1.2.3: {} @@ -6380,30 +6385,30 @@ snapshots: rechoir@0.6.2: dependencies: - resolve: 1.22.11 + resolve: 1.22.12 rechoir@0.7.1: dependencies: - resolve: 1.22.11 + resolve: 1.22.12 rechoir@0.8.0: dependencies: - resolve: 1.22.11 + resolve: 1.22.12 reflect.getprototypeof@1.0.10: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 define-properties: 1.2.1 - es-abstract: 1.24.1 + es-abstract: 1.24.2 es-errors: 1.3.0 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 get-intrinsic: 1.3.0 get-proto: 1.0.1 which-builtin-type: 1.2.1 regexp.prototype.flags@1.5.4: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 define-properties: 1.2.1 es-errors: 1.3.0 get-proto: 1.0.1 @@ -6444,7 +6449,7 @@ snapshots: mime-types: 2.1.35 oauth-sign: 0.9.0 performance-now: 2.1.0 - qs: 6.5.3 + qs: 6.5.5 safe-buffer: 5.2.1 tough-cookie: 2.5.0 tunnel-agent: 0.6.0 @@ -6476,9 +6481,10 @@ snapshots: resolve-from@5.0.0: {} - resolve@1.22.11: + resolve@1.22.12: dependencies: - is-core-module: 2.16.1 + es-errors: 1.3.0 + is-core-module: 2.16.2 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -6497,11 +6503,11 @@ snapshots: dependencies: glob: 7.2.3 - rollup-plugin-terser@5.3.1(rollup@2.79.2): + rollup-plugin-terser@5.3.1(rollup@2.80.0): dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.7 jest-worker: 24.9.0 - rollup: 2.79.2 + rollup: 2.80.0 rollup-pluginutils: 2.8.2 serialize-javascript: 4.0.0 terser: 4.8.1 @@ -6510,7 +6516,7 @@ snapshots: dependencies: estree-walker: 0.6.1 - rollup@2.79.2: + rollup@2.80.0: optionalDependencies: fsevents: 2.3.3 @@ -6524,9 +6530,9 @@ snapshots: dependencies: tslib: 1.14.1 - safe-array-concat@1.1.3: + safe-array-concat@1.1.4: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 get-intrinsic: 1.3.0 has-symbols: 1.1.0 @@ -6561,15 +6567,15 @@ snapshots: transitivePeerDependencies: - supports-color - sax@1.4.3: + sax@1.6.0: optional: true schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) - ajv-keywords: 5.1.0(ajv@8.17.1) + ajv: 8.20.0 + ajv-formats: 2.1.1(ajv@8.20.0) + ajv-keywords: 5.1.0(ajv@8.20.0) semver@5.4.1: {} @@ -6577,23 +6583,23 @@ snapshots: semver@6.3.1: {} - semver@7.7.3: {} + semver@7.8.4: {} - send@0.19.0: + send@0.19.2: dependencies: debug: 2.6.9 depd: 2.0.0 destroy: 1.2.0 - encodeurl: 1.0.2 + encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 fresh: 0.5.2 - http-errors: 2.0.0 + http-errors: 2.0.1 mime: 1.6.0 ms: 2.1.3 on-finished: 2.4.1 range-parser: 1.2.1 - statuses: 2.0.1 + statuses: 2.0.2 transitivePeerDependencies: - supports-color @@ -6601,24 +6607,24 @@ snapshots: dependencies: randombytes: 2.1.0 - serve-index@1.9.1: + serve-index@1.9.2: dependencies: accepts: 1.3.8 batch: 0.6.1 debug: 2.6.9 escape-html: 1.0.3 - http-errors: 1.6.3 + http-errors: 1.8.1 mime-types: 2.1.35 parseurl: 1.3.3 transitivePeerDependencies: - supports-color - serve-static@1.16.2: + serve-static@1.16.3: dependencies: encodeurl: 2.0.0 escape-html: 1.0.3 parseurl: 1.3.3 - send: 0.19.0 + send: 0.19.2 transitivePeerDependencies: - supports-color @@ -6644,9 +6650,7 @@ snapshots: dependencies: dunder-proto: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.1.1 - - setprototypeof@1.1.0: {} + es-object-atoms: 1.1.2 setprototypeof@1.2.0: {} @@ -6666,7 +6670,7 @@ snapshots: shebang-regex@3.0.0: {} - shell-quote@1.8.3: {} + shell-quote@1.8.4: {} shelljs@0.8.5: dependencies: @@ -6679,7 +6683,7 @@ snapshots: minimist: 1.2.8 shelljs: 0.8.5 - side-channel-list@1.0.0: + side-channel-list@1.0.1: dependencies: es-errors: 1.3.0 object-inspect: 1.13.4 @@ -6699,11 +6703,11 @@ snapshots: object-inspect: 1.13.4 side-channel-map: 1.0.1 - side-channel@1.1.0: + side-channel@1.1.1: dependencies: es-errors: 1.3.0 object-inspect: 1.13.4 - side-channel-list: 1.0.0 + side-channel-list: 1.0.1 side-channel-map: 1.0.1 side-channel-weakmap: 1.0.2 @@ -6737,16 +6741,16 @@ snapshots: spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.22 + spdx-license-ids: 3.0.23 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.22 + spdx-license-ids: 3.0.23 - spdx-license-ids@3.0.22: {} + spdx-license-ids@3.0.23: {} split@1.0.1: dependencies: @@ -6770,13 +6774,20 @@ snapshots: statuses@1.5.0: {} - statuses@2.0.1: {} + statuses@2.0.2: {} stop-iteration-iterator@1.1.0: dependencies: es-errors: 1.3.0 internal-slot: 1.1.0 + stream-parser@0.3.1: + dependencies: + debug: 2.6.9 + transitivePeerDependencies: + - supports-color + optional: true + string-width@2.1.1: dependencies: is-fullwidth-code-point: 2.0.0 @@ -6798,37 +6809,38 @@ snapshots: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.1.2 + strip-ansi: 7.2.0 string.prototype.padend@3.1.6: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 define-properties: 1.2.1 - es-abstract: 1.24.1 - es-object-atoms: 1.1.1 + es-abstract: 1.24.2 + es-object-atoms: 1.1.2 - string.prototype.trim@1.2.10: + string.prototype.trim@1.2.11: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 define-data-property: 1.1.4 define-properties: 1.2.1 - es-abstract: 1.24.1 - es-object-atoms: 1.1.1 + es-abstract: 1.24.2 + es-object-atoms: 1.1.2 has-property-descriptors: 1.0.2 + safe-regex-test: 1.1.0 - string.prototype.trimend@1.0.9: + string.prototype.trimend@1.0.10: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 string.prototype.trimstart@1.0.8: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-object-atoms: 1.1.2 string_decoder@0.10.31: {} @@ -6848,7 +6860,7 @@ snapshots: dependencies: ansi-regex: 5.0.1 - strip-ansi@7.1.2: + strip-ansi@7.2.0: dependencies: ansi-regex: 6.2.2 @@ -6888,41 +6900,41 @@ snapshots: table@6.9.0: dependencies: - ajv: 8.17.1 + ajv: 8.20.0 lodash.truncate: 4.4.2 slice-ansi: 4.0.0 string-width: 4.2.3 strip-ansi: 6.0.1 - tapable@2.3.0: {} + tapable@2.3.3: {} - terser-webpack-plugin@5.4.0(webpack@5.105.4): + terser-webpack-plugin@5.6.1(webpack@5.107.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 - terser: 5.46.0 - webpack: 5.105.4(webpack-cli@5.1.4) + terser: 5.48.0 + webpack: 5.107.2(webpack-cli@5.1.4) terser@4.8.1: dependencies: - acorn: 8.15.0 + acorn: 8.17.0 commander: 2.20.3 source-map: 0.6.1 source-map-support: 0.5.21 - terser@5.46.0: + terser@5.48.0: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.16.0 + acorn: 8.17.0 commander: 2.20.3 source-map-support: 0.5.21 - test-exclude@7.0.1: + test-exclude@7.0.2: dependencies: - '@istanbuljs/schema': 0.1.3 + '@istanbuljs/schema': 0.1.6 glob: 10.5.0 - minimatch: 9.0.5 + minimatch: 10.2.5 text-table@0.2.0: {} @@ -6995,7 +7007,7 @@ snapshots: typed-array-byte-length@1.0.3: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 for-each: 0.3.5 gopd: 1.2.0 has-proto: 1.2.0 @@ -7004,16 +7016,16 @@ snapshots: typed-array-byte-offset@1.0.4: dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.8 + call-bind: 1.0.9 for-each: 0.3.5 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 reflect.getprototypeof: 1.0.10 - typed-array-length@1.0.7: + typed-array-length@1.0.8: dependencies: - call-bind: 1.0.8 + call-bind: 1.0.9 for-each: 0.3.5 gopd: 1.2.0 is-typed-array: 1.1.15 @@ -7052,9 +7064,9 @@ snapshots: unpipe@1.0.0: {} - update-browserslist-db@1.2.3(browserslist@4.28.1): + update-browserslist-db@1.2.3(browserslist@4.28.2): dependencies: - browserslist: 4.28.1 + browserslist: 4.28.2 escalade: 3.2.0 picocolors: 1.1.1 @@ -7065,7 +7077,7 @@ snapshots: url@0.11.4: dependencies: punycode: 1.4.1 - qs: 6.15.0 + qs: 6.15.2 util-deprecate@1.0.2: {} @@ -7081,10 +7093,6 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 - v8flags@3.2.0: - dependencies: - homedir-polyfill: 1.0.3 - v8flags@4.0.1: {} validate-glob-opts@1.0.2: @@ -7105,19 +7113,18 @@ snapshots: core-util-is: 1.0.2 extsprintf: 1.3.0 - watchpack@2.5.1: + watchpack@2.5.2: dependencies: - glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 webidl-conversions@3.0.1: {} - webpack-cli@5.1.4(webpack@5.105.4): + webpack-cli@5.1.4(webpack@5.107.2): dependencies: '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.105.4) - '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.105.4) - '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.105.4) + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.107.2) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.107.2) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.107.2) colorette: 2.0.20 commander: 10.0.1 cross-spawn: 7.0.6 @@ -7126,7 +7133,7 @@ snapshots: import-local: 3.2.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.105.4(webpack-cli@5.1.4) + webpack: 5.107.2(webpack-cli@5.1.4) webpack-merge: 5.10.0 webpack-merge@5.10.0: @@ -7135,40 +7142,47 @@ snapshots: flat: 5.0.2 wildcard: 2.0.1 - webpack-sources@3.3.4: {} + webpack-sources@3.5.0: {} - webpack@5.105.4(webpack-cli@5.1.4): + webpack@5.107.2(webpack-cli@5.1.4): dependencies: - '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.16.0 - acorn-import-phases: 1.0.4(acorn@8.16.0) - browserslist: 4.28.1 + acorn: 8.17.0 + acorn-import-phases: 1.0.4(acorn@8.17.0) + browserslist: 4.28.2 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.20.0 - es-module-lexer: 2.0.0 + enhanced-resolve: 5.24.0 + es-module-lexer: 2.1.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.1 - mime-types: 2.1.35 + loader-runner: 4.3.2 + mime-db: 1.54.0 neo-async: 2.6.2 schema-utils: 4.3.3 - tapable: 2.3.0 - terser-webpack-plugin: 5.4.0(webpack@5.105.4) - watchpack: 2.5.1 - webpack-sources: 3.3.4 + tapable: 2.3.3 + terser-webpack-plugin: 5.6.1(webpack@5.107.2) + watchpack: 2.5.2 + webpack-sources: 3.5.0 optionalDependencies: - webpack-cli: 5.1.4(webpack@5.105.4) + webpack-cli: 5.1.4(webpack@5.107.2) transitivePeerDependencies: + - '@minify-html/node' - '@swc/core' + - '@swc/css' + - '@swc/html' + - clean-css + - cssnano + - csso - esbuild + - html-minifier-terser + - lightningcss + - postcss - uglify-js whatwg-url@5.0.0: @@ -7189,7 +7203,7 @@ snapshots: which-builtin-type@1.2.1: dependencies: call-bound: 1.0.4 - function.prototype.name: 1.1.8 + function.prototype.name: 1.2.0 has-tostringtag: 1.0.2 is-async-function: 2.1.1 is-date-object: 1.1.0 @@ -7200,7 +7214,7 @@ snapshots: isarray: 2.0.5 which-boxed-primitive: 1.1.1 which-collection: 1.0.2 - which-typed-array: 1.1.19 + which-typed-array: 1.1.22 which-collection@1.0.2: dependencies: @@ -7211,10 +7225,10 @@ snapshots: which-module@2.0.1: {} - which-typed-array@1.1.19: + which-typed-array@1.1.22: dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.8 + call-bind: 1.0.9 call-bound: 1.0.4 for-each: 0.3.5 get-proto: 1.0.1 @@ -7259,7 +7273,7 @@ snapshots: dependencies: ansi-styles: 6.2.3 string-width: 5.1.2 - strip-ansi: 7.1.2 + strip-ansi: 7.2.0 wrappy@1.0.2: {} @@ -7289,7 +7303,7 @@ snapshots: yargs-unparser@1.6.0: dependencies: flat: 4.1.1 - lodash: 4.17.21 + lodash: 4.18.1 yargs: 13.3.2 yargs@13.3.2: From 4d6e67e4b4441aeb5faa04e0adc64ee475fcfd9c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 21:12:52 -0700 Subject: [PATCH 62/76] chore: release v4.6.8 (#4463) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9ed67ba..6eea98cb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## Change Log +### v4.6.8 (2026-07-12) + +#### Changes + +- [#4462](https://github.com/less/less.js/pull/4462) feat: deprecate bare @variable in non-value at-rule positions (@matthew-dean) +- [#4461](https://github.com/less/less.js/pull/4461) Fix #4460: parse comparison/range syntax in container style() queries (@dweep-js) +- [#4459](https://github.com/less/less.js/pull/4459) refactor: extract shared ESLint config and add lint scripts (@JessenReinhart) + + ### v4.6.7 (2026-06-20) #### Changes diff --git a/package.json b/package.json index 6a1592e52..07f234bd0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.6.7", + "version": "4.6.8", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index 21d6b24e6..5e2584aed 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.6.7", + "version": "4.6.8", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 8d138f457..410cdb84f 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.6.7", + "version": "4.6.8", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 2bdfe57f9..6d9e642b6 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.6.7", + "version": "4.6.8", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ From 8e1105f0875b64e9c45f36f350a123088ae81e9a Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sat, 18 Jul 2026 10:15:14 -0700 Subject: [PATCH 63/76] Follow-up to #4462: migrate remaining @var fixtures, DRY the prelude bare-@var scan, add warnings coverage (#4469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: migrate remaining bare @variable at-rule fixtures to @{variable} Follow-up to #4462, which deprecated bare @variable in non-value at-rule positions and migrated most fixtures to @{variable} but left two feature fixtures on the bare form: - tests-unit/layer/layer.less @layer @layer-name - tests-unit/import/import/import-reference.less @keyframes @keyframeName Migrated to @{layer-name} / @{keyframeName} (byte-identical render). Also repairs pnpm-lock.yaml: master had a dangling `minimatch: 3.1.2` dependency edge with no package entry (bad-merge artifact), so `pnpm install --frozen-lockfile` failed for every PR. Repinned to the resolved 3.1.5 already present; no dependency version changes. * test: assert deprecation/warning emission + suppress warnings in test output less.js asserts errors via tests-error/*.txt but had no coverage that warnings actually fire, so deprecation notices were unguarded (nothing would catch a regression that silently stopped emitting one). - Suppress warnings from normal test output (they are noise across the corpus); set LESS_TEST_SHOW_WARNINGS=1 to see them. - Add testWarnings() (run from index.js) which installs a capturing logger listener and asserts each render-reachable warning fires: variable-in-at-rule- prelude (incl. bar[@v] top-level -> warns and (x:@v) decl-value -> no warn), js-eval, mixin-call-whitespace, mixin-call-no-parens, variable-in-unknown-value, dot-slash-operator, complex-selector, extend-no-match, compress, at-plugin. Documented gaps (not render-reachable): property-in-unknown-value (a $prop ref resolves via the entity path before the permissive text scan), math-always and dumpLineNumbers (registered in deprecation.js but never emitted via warn()). * refactor(parser): fold at-rule prelude bare-@var detection into $parseUntil (DRY) The at-rule-prelude deprecation detected a top-level bare @var two ways: the permissiveValue entity loop (structural), plus a standalone hasTopLevelBareVariable() that RE-SCANNED the same text $parseUntil had already walked, with its own hand-rolled paren counter (and no string/comment handling). Fold that second scan into $parseUntil's single pass: it already skips strings/comments/ escapes and tracks brackets, so add an opt-in `detectBareVar` that records the first bare @var (not @{interp}) seen at PAREN depth 0 — [...]/{...} don't shield a reference, only a declaration-value (...) does — exposed as `.bareVarIndex`. $parseUntil has a single caller (permissiveValue), so the extra arg/property is contained. Delete hasTopLevelBareVariable. Behaviour preserved (regression-guarded by testWarnings): @foo @bar -> 1, @a and @b -> 2, bar[@v] -> 1 (bracket is top-level), (x:@v) -> 0 (decl value), and the mixed (a:@x) y[@z] -> 1. Also drops the testWarnings 'variable-in-unknown-value' case: it only fires for the inconsistent bracket edge (--x: bar[@bar]) while --x: @bar / 1px @bar / foo(@bar) resolve silently, so asserting it would lock in an artifact (now documented). --- packages/less/lib/less/parser/parser-input.js | 22 ++++++- packages/less/lib/less/parser/parser.js | 47 ++++----------- packages/less/test/index.js | 1 + packages/less/test/less-test.js | 59 ++++++++++++++++++- .../import/import/import-reference.less | 4 +- .../test-data/tests-unit/layer/layer.less | 2 +- pnpm-lock.yaml | 2 +- 7 files changed, 97 insertions(+), 40 deletions(-) diff --git a/packages/less/lib/less/parser/parser-input.js b/packages/less/lib/less/parser/parser-input.js index 096ce3826..9a9dc3924 100644 --- a/packages/less/lib/less/parser/parser-input.js +++ b/packages/less/lib/less/parser/parser-input.js @@ -204,12 +204,23 @@ export default () => { /** * Permissive parsing. Ignores everything except matching {} [] () and quotes * until matching token (outside of blocks) + * + * @param {string|RegExp} tok - stop token + * @param {boolean} [detectBareVar] - when set, also record the position of the + * first bare `@variable` reference (not `@{interpolation}`) that appears at + * PAREN depth 0 — i.e. a structural reference, not a declaration value inside + * `(...)`. Reuses this single pass (which already skips strings/comments) so + * callers don't re-scan the text. Exposed as `.bareVarIndex` on the returned + * group array (or null). `[...]`/`{...}` do NOT shield a reference — only + * `(...)` (a declaration-value group) does. */ - parserInput.$parseUntil = tok => { + parserInput.$parseUntil = (tok, detectBareVar) => { let quote = ''; let returnVal = null; let inComment = false; let blockDepth = 0; + let parenDepth = 0; + let bareVarIndex = null; const blockStack = []; const parseGroups = []; const length = input.length; @@ -249,6 +260,12 @@ export default () => { i++; continue; } + if (detectBareVar && bareVarIndex === null && nextChar === '@' && parenDepth === 0) { + // A bare `@ident` (not `@{interpolation}`) outside any `(...)` — + // a structural reference. Strings/comments are already skipped above. + const after = input.charAt(i + 1); + if (after && /[-\w]/.test(after)) { bareVarIndex = i; } + } switch (nextChar) { case '\\': i++; @@ -284,6 +301,7 @@ export default () => { case '(': blockStack.push(')'); blockDepth++; + parenDepth++; break; case '[': blockStack.push(']'); @@ -295,6 +313,7 @@ export default () => { const expected = blockStack.pop(); if (nextChar === expected) { blockDepth--; + if (nextChar === ')' && parenDepth > 0) { parenDepth--; } } else { // move the parser to the error and return expected skipWhitespace(i - startPos); @@ -310,6 +329,7 @@ export default () => { } } while (loop); + if (Array.isArray(returnVal)) { returnVal.bareVarIndex = bareVarIndex; } return returnVal ? returnVal : null; } diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index 5fc5dd989..feb296a6c 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -106,31 +106,6 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { warn('A bare @variable in an at-rule prelude is deprecated. Use @{variable} interpolation instead.', index, 'DEPRECATED', 'variable-in-at-rule-prelude'); } - /** - * Whether `text` contains a bare `@variable` at the top level — i.e. outside - * any `(...)` group. A `@variable` inside parentheses is a declaration value - * (e.g. the `@v` in `@supports (display: @v)`) and remains valid; only a bare - * `@variable` in a structural position is deprecated. - * - * @param {string} text - * @returns {boolean} - */ - function hasTopLevelBareVariable(text) { - let depth = 0; - for (let j = 0; j < text.length; j++) { - const c = text.charAt(j); - if (c === '(') { - depth++; - } else if (c === ')') { - if (depth > 0) { depth--; } - } else if (c === '@' && depth === 0) { - // a bare `@ident`, not `@{ident}` interpolation - if (/[\w-]/.test(text.charAt(j + 1))) { return true; } - } - } - return false; - } - function expect(arg, msg) { // some older browsers return typeof 'function' for RegExp const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); @@ -1812,7 +1787,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } parserInput.save(); - value = parserInput.$parseUntil(tok); + value = parserInput.$parseUntil(tok, deprecateVariables); if (value) { if (typeof value === 'string') { @@ -1822,6 +1797,14 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.forget(); return new tree.Anonymous('', index); } + // At-rule prelude: `$parseUntil` (deprecateVariables) records the + // first bare `@var` it saw outside any `(...)` in its single pass — + // a structural reference (`[...]`/`{...}` don't shield it, only a + // declaration-value `(...)` does). Warn once here rather than + // re-scanning the text. + if (deprecateVariables && value.bareVarIndex !== null && value.bareVarIndex !== undefined) { + warnBareAtRuleVariable(value.bareVarIndex); + } /** @type {string} */ let item; for (i = 0; i < value.length; i++) { @@ -1838,14 +1821,10 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const quote = new tree.Quoted('\'', item, true, index, fileInfo); const variableRegex = /@([\w-]+)/g; const propRegex = /\$([\w-]+)/g; - if (deprecateVariables) { - // At-rule prelude: only a bare @var in a structural - // (top-level) position is deprecated; @vars inside - // `(...)` are declaration values and stay valid. - if (hasTopLevelBareVariable(item)) { - warnBareAtRuleVariable(index); - } - } else if (variableRegex.test(item)) { + // At-rule preludes are handled once above via + // `value.bareVarIndex`; the `variable-in-unknown-value` + // notice is for unknown declaration values only. + if (!deprecateVariables && variableRegex.test(item)) { warn('@variable in unknown values will not be evaluated as variables in the future. Use @{variable}', index, 'DEPRECATED', 'variable-in-unknown-value'); } if (propRegex.test(item)) { diff --git a/packages/less/test/index.js b/packages/less/test/index.js index b4fd85fa7..c45aaf973 100644 --- a/packages/less/test/index.js +++ b/packages/less/test/index.js @@ -236,6 +236,7 @@ lessTester.testSyncronous({syncImport: true}, 'tests-config/math-strict/css'); lessTester.testNoOptions(); lessTester.testDisablePluginRule(); lessTester.testJSImport(); +await lessTester.testWarnings(); lessTester.finished(); console.log('\nTesting HTTP redirect functionality...'); diff --git a/packages/less/test/less-test.js b/packages/less/test/less-test.js index 64b26013a..4853f5cd7 100644 --- a/packages/less/test/less-test.js +++ b/packages/less/test/less-test.js @@ -19,8 +19,14 @@ logger.addListener({ process.stdout.write(msg + '\n'); } }, + // Warnings (deprecation notices etc.) are SUPPRESSED from normal test output — + // they are noise across the fixture corpus. Their emission is asserted directly + // in testWarnings() (below), which installs its own capturing listener. Set + // LESS_TEST_SHOW_WARNINGS=1 to print them anyway when debugging. warn(msg) { - process.stdout.write(msg + '\n'); + if (process.env.LESS_TEST_SHOW_WARNINGS) { + process.stdout.write(msg + '\n'); + } }, error(msg) { process.stdout.write(msg + '\n'); @@ -829,10 +835,61 @@ export default function(testFilter) { ); } + // Assert every render-reachable warning / deprecation notice fires (and, for the + // at-rule-prelude deprecation, that the declaration-value exemption holds). less.js + // asserts errors via tests-error/*.txt but had no warning coverage, so these were + // previously unguarded. Warnings are suppressed from normal output (see the logger + // listener at the top of this file); here we install a capturing listener instead. + // + // NOT covered (documented gaps): + // - variable-in-unknown-value: only reachable via an inconsistent edge — a bare + // `@var` in a custom-property value warns ONLY when a bracket pushes it to the + // permissive text scan (`--x: bar[@bar]`), while `--x: @bar`, `--x: 1px @bar`, + // `--x: foo(@bar)` all resolve silently. Asserting it would lock in that + // inconsistency, so it is deliberately not covered. + // - property-in-unknown-value: wired (parser.js), but a `$prop` ref resolves via + // the entity path before reaching the permissive text scan, so no input triggers it. + // - math-always, dumpLineNumbers: registered in deprecation.js but never emitted + // via a warn() call (CLI help text only). + async function testWarnings() { + const captured = []; + const listener = { warn: m => captured.push(m), error() {}, info() {}, debug() {} }; + less.logger.addListener(listener); + // [label, source, options, message-matcher, expectedCount] + const cases = [ + ['bare @var in an at-rule prelude warns', '@bar: x;\n@foo @bar { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], + ['@var inside […] is top-level and warns', '@v: x;\n@foo bar[@v] { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], + ['@var inside (…) is a declaration value — no warning', '@v: 1px;\n@foo (x: @v) { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 0], + ['inline JavaScript (backtick) is deprecated', '@x: `1 + 1`;\n.a { w: @x }', { javascriptEnabled: true }, /Inline JavaScript evaluation/, 1], + ['whitespace before mixin-call parens is deprecated', '.m() { a: b }\n.a { .m () }', {}, /Whitespace between a mixin name and parentheses/, 1], + ['mixin call without parens is deprecated', '.m() { a: b }\n.a { .m }', {}, /Calling a mixin without parentheses is deprecated/, 1], + ['the ./ operator is deprecated', '.a { w: 2px ./ 1 }', {}, /\.\/ operator is deprecated/, 1], + ['targeting complex selectors with :extend warns', '.b .c { x: y }\n.a:extend(.b .c) { }', {}, /Targeting complex selectors/, 1], + ['an :extend with no matches warns', '.a:extend(.zzz) { }', {}, /extend '.*' has no matches/, 1], + ['the compress option is deprecated', '.a { b: c }', { compress: true }, /compress option has been deprecated/, 1], + ['the @plugin directive is deprecated', '@plugin "less-plugin-nonexistent-xyz";\n.a { b: c }', {}, /@plugin directive is deprecated/, 1], + ]; + for (const [label, src, options, matcher, expected] of cases) { + totalTests++; + captured.length = 0; + // Some cases (e.g. @plugin with a missing plugin) throw AFTER emitting the + // warning; the warning is what we assert, so a throw is not itself a failure. + try { await less.render(src, options); } catch (e) { /* warning already captured */ } + const n = captured.filter(m => matcher.test(m)).length; + if (n === expected) { + ok('- Integration - warning assertions: ' + label + ' OK\n'); + } else { + fail('- Integration - warning assertions: ' + label + ' — expected ' + expected + ' match(es) for ' + matcher + ', got ' + n + '\n'); + } + } + less.logger.removeListener(listener); + } + return { runTestSet: runTestSet, runTestSetNormalOnly: runTestSetNormalOnly, testSyncronous: testSyncronous, + testWarnings: testWarnings, testErrors: testErrors, testTypeErrors: testTypeErrors, testSourcemap: testSourcemap, diff --git a/packages/test-data/tests-unit/import/import/import-reference.less b/packages/test-data/tests-unit/import/import/import-reference.less index c545f2667..d69098924 100644 --- a/packages/test-data/tests-unit/import/import/import-reference.less +++ b/packages/test-data/tests-unit/import/import/import-reference.less @@ -73,11 +73,11 @@ } } .mixin-with-directives(@keyframeName) { - @keyframes @keyframeName { + @keyframes @{keyframeName} { @rules1(); } @supports (animation-name: test) { - @keyframes @keyframeName { + @keyframes @{keyframeName} { @rules2(); } .selector { diff --git a/packages/test-data/tests-unit/layer/layer.less b/packages/test-data/tests-unit/layer/layer.less index 3968227a5..5494143eb 100644 --- a/packages/test-data/tests-unit/layer/layer.less +++ b/packages/test-data/tests-unit/layer/layer.less @@ -18,7 +18,7 @@ @layer-name: primevue; -@layer @layer-name { +@layer @{layer-name} { .test { foo: bar; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe7b7bdbd..64ae7df14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5117,7 +5117,7 @@ snapshots: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.1.2 + minimatch: 3.1.5 once: 1.4.0 path-is-absolute: 1.0.1 From 937300cc3d5888fb9a73fb7d25aac8d7fc76cc4a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 10:40:31 -0700 Subject: [PATCH 64/76] chore: release v4.7.0 (#4471) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 4 +++- package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eea98cb5..f617fd657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ ## Change Log -### v4.6.8 (2026-07-12) +### v4.7.0 (2026-07-18) #### Changes +- [#4469](https://github.com/less/less.js/pull/4469) Follow-up to #4462: migrate remaining @var fixtures, DRY the prelude bare-@var scan, add warnings coverage (@matthew-dean) - [#4462](https://github.com/less/less.js/pull/4462) feat: deprecate bare @variable in non-value at-rule positions (@matthew-dean) - [#4461](https://github.com/less/less.js/pull/4461) Fix #4460: parse comparison/range syntax in container style() queries (@dweep-js) - [#4459](https://github.com/less/less.js/pull/4459) refactor: extract shared ESLint config and add lint scripts (@JessenReinhart) +- [#4456](https://github.com/less/less.js/pull/4456) Replace image-size with probe-image-size (@priyamkarn) ### v4.6.7 (2026-06-20) diff --git a/package.json b/package.json index 07f234bd0..208a9d959 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.6.8", + "version": "4.7.0", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index 5e2584aed..e79a10d21 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.6.8", + "version": "4.7.0", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 410cdb84f..5be85b184 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.6.8", + "version": "4.7.0", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 6d9e642b6..37e6a7b03 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.6.8", + "version": "4.7.0", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ From 6161ecf239a0451f61fde986ffe054e48bfe8d45 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:25:58 -0700 Subject: [PATCH 65/76] Fix boolean() parsing for comparisons between inline condition expressions (#4472) * Initial plan * Fix boolean comparison of inline condition expressions --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- packages/less/lib/less/parser/parser.js | 29 ++++++++++--------- .../tests-unit/functions/functions.css | 1 + .../tests-unit/functions/functions.less | 1 + 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index feb296a6c..f667ea49c 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -559,7 +559,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } function condition() { - return [expect(parsers.condition, 'expected condition')]; + return [expect(() => parsers.condition(false, true), 'expected condition')]; } }, @@ -2497,7 +2497,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { return condition || a; } }, - condition: function (needsParens) { + condition: function (needsParens, allowConditionOperands) { let result; let logical; let next; @@ -2505,13 +2505,13 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { return parserInput.$str('or'); } - result = this.conditionAnd(needsParens); + result = this.conditionAnd(needsParens, allowConditionOperands); if (!result) { return ; } logical = or(); if (logical) { - next = this.condition(needsParens); + next = this.condition(needsParens, allowConditionOperands); if (next) { result = new(tree.Condition)(logical, result, next); } else { @@ -2520,13 +2520,13 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } return result; }, - conditionAnd: function (needsParens) { + conditionAnd: function (needsParens, allowConditionOperands) { let result; let logical; let next; const self = this; function insideCondition() { - const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens); + const cond = self.negatedCondition(needsParens, allowConditionOperands) || self.parenthesisCondition(needsParens, allowConditionOperands); if (!cond && !needsParens) { return self.atomicCondition(needsParens); } @@ -2540,9 +2540,12 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (!result) { return ; } + if (allowConditionOperands) { + result = this.atomicCondition(needsParens, result, allowConditionOperands) || result; + } logical = and(); if (logical) { - next = this.conditionAnd(needsParens); + next = this.conditionAnd(needsParens, allowConditionOperands); if (next) { result = new(tree.Condition)(logical, result, next); } else { @@ -2551,9 +2554,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } return result; }, - negatedCondition: function (needsParens) { + negatedCondition: function (needsParens, allowConditionOperands) { if (parserInput.$str('not')) { - const result = this.parenthesisCondition(needsParens); + const result = this.parenthesisCondition(needsParens, allowConditionOperands); if (result) { result.negate = !result.negate; return result; @@ -2570,11 +2573,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } } }, - parenthesisCondition: function (needsParens) { + parenthesisCondition: function (needsParens, allowConditionOperands) { function tryConditionFollowedByParenthesis(me) { let body; parserInput.save(); - body = me.condition(needsParens); + body = me.condition(needsParens, allowConditionOperands); if (!body) { parserInput.restore(); return ; @@ -2611,7 +2614,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.forget(); return body; }, - atomicCondition: function (needsParens, preparsedCond) { + atomicCondition: function (needsParens, preparsedCond, allowConditionOperands) { const entities = this.entities; const index = parserInput.i; let a; @@ -2620,7 +2623,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { let op; const cond = (function() { - return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); + return (allowConditionOperands && this.parenthesisCondition(needsParens)) || this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); }).bind(this) if (preparsedCond) { diff --git a/packages/test-data/tests-unit/functions/functions.css b/packages/test-data/tests-unit/functions/functions.css index 17a990259..970f8d80e 100644 --- a/packages/test-data/tests-unit/functions/functions.css +++ b/packages/test-data/tests-unit/functions/functions.css @@ -226,6 +226,7 @@ html { c: false; d: true; e: false; + f: true; } #if { a: 1; diff --git a/packages/test-data/tests-unit/functions/functions.less b/packages/test-data/tests-unit/functions/functions.less index f11b756d2..b0ecbfa68 100644 --- a/packages/test-data/tests-unit/functions/functions.less +++ b/packages/test-data/tests-unit/functions/functions.less @@ -259,6 +259,7 @@ html { // not without parentheses (should behave the same as with parentheses) d: boolean(not false); e: boolean(not true); + f: boolean((2 > 1) = (3 > 2)); } #if { From 6b04d2d6fde4beb88d67a26c8d06f5b2008d0daf Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Wed, 22 Jul 2026 11:28:41 -0400 Subject: [PATCH 66/76] fix(mixing): resolves issue #4234 (#4473) * Fix mixin arity issue for mixins that provide a default value for arguments early in the list that caused wrong number of arguments error. --- .../less/lib/less/tree/mixin-definition.js | 48 ++++++++++++------- .../mixins-named-args/mixins-named-args.css | 6 +++ .../mixins-named-args/mixins-named-args.less | 15 ++++++ 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/packages/less/lib/less/tree/mixin-definition.js b/packages/less/lib/less/tree/mixin-definition.js index b63f05aa6..22ac2a299 100644 --- a/packages/less/lib/less/tree/mixin-definition.js +++ b/packages/less/lib/less/tree/mixin-definition.js @@ -267,35 +267,47 @@ class Definition extends Ruleset { */ matchArgs(args, context) { const allArgsCnt = (args && args.length) || 0; - let len; - const optionalParameters = this.optionalParameters; - const requiredArgsCnt = !args ? 0 : args.reduce(function (/** @type {number} */ count, /** @type {MixinArg} */ p) { - if (optionalParameters.indexOf(p.name) < 0) { - return count + 1; - } else { - return count; + const evaldArguments = new Array(this.params.length); + const positionalArgs = []; + let positionalIndex = 0; + + for (let i = 0; i < allArgsCnt; i++) { + const arg = /** @type {MixinArg[]} */ (args)[i]; + if (!arg.name) { + positionalArgs.push(arg); + continue; } - }, 0); - if (!this.variadic) { - if (requiredArgsCnt < this.required) { + const paramIndex = this.params.findIndex((param, index) => param.name === arg.name && !evaldArguments[index]); + if (paramIndex < 0) { return false; } - if (allArgsCnt > this.params.length) { - return false; + evaldArguments[paramIndex] = arg; + } + + for (let i = 0; i < this.params.length; i++) { + if (evaldArguments[i]) { + continue; + } + if (this.params[i].variadic) { + positionalIndex = positionalArgs.length; + continue; } - } else { - if (requiredArgsCnt < (this.required - 1)) { + if (positionalIndex < positionalArgs.length) { + evaldArguments[i] = positionalArgs[positionalIndex++]; + } else if (!this.params[i].name || !this.params[i].value) { return false; } } - // check patterns - len = Math.min(requiredArgsCnt, this.arity); + if (positionalIndex < positionalArgs.length) { + return false; + } - for (let i = 0; i < len; i++) { + // check patterns + for (let i = 0; i < this.arity; i++) { if (!this.params[i].name && !this.params[i].variadic) { - if (/** @type {MixinArg[]} */ (args)[i].value.eval(context).toCSS(/** @type {EvalContext} */ ({})) != /** @type {Node} */ (this.params[i].value).eval(context).toCSS(/** @type {EvalContext} */ ({}))) { + if (evaldArguments[i].value.eval(context).toCSS(/** @type {EvalContext} */ ({})) != /** @type {Node} */ (this.params[i].value).eval(context).toCSS(/** @type {EvalContext} */ ({}))) { return false; } } diff --git a/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.css b/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.css index e460aa104..25251b400 100644 --- a/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.css +++ b/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.css @@ -25,3 +25,9 @@ height: 29%; color: #123456; } +.arity-positional { + value: 3; +} +.arity-named { + value: 4; +} diff --git a/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.less b/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.less index f62dc86a2..450c2aea5 100644 --- a/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.less +++ b/packages/test-data/tests-unit/mixins-named-args/mixins-named-args.less @@ -34,3 +34,18 @@ .named-args3 { .mixin2(@b: 30%, @c: #123456); } + +.arity-mixin(@a) { + value: @a; +} +.arity-mixin(@a: 1, @b) { + value: @a + @b; +} + +.arity-positional { + .arity-mixin(3); +} + +.arity-named { + .arity-mixin(@b: 3); +} From 191c8a101cfadeacb46e6b2ab71ad41a48160e47 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Wed, 22 Jul 2026 09:34:45 -0700 Subject: [PATCH 67/76] =?UTF-8?q?chore:=20release=20v4.8.0=20=E2=80=94=20d?= =?UTF-8?q?eprecate=20legacy=20identifier=20forms=20and=20dynamic=20@chars?= =?UTF-8?q?et=20(#4475)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: migrate remaining bare @variable at-rule fixtures to @{variable} Follow-up to #4462, which deprecated bare @variable in non-value at-rule positions and migrated most fixtures to @{variable} but left two feature fixtures on the bare form: - tests-unit/layer/layer.less @layer @layer-name - tests-unit/import/import/import-reference.less @keyframes @keyframeName Migrated to @{layer-name} / @{keyframeName} (byte-identical render). Also repairs pnpm-lock.yaml: master had a dangling `minimatch: 3.1.2` dependency edge with no package entry (bad-merge artifact), so `pnpm install --frozen-lockfile` failed for every PR. Repinned to the resolved 3.1.5 already present; no dependency version changes. * test: assert deprecation/warning emission + suppress warnings in test output less.js asserts errors via tests-error/*.txt but had no coverage that warnings actually fire, so deprecation notices were unguarded (nothing would catch a regression that silently stopped emitting one). - Suppress warnings from normal test output (they are noise across the corpus); set LESS_TEST_SHOW_WARNINGS=1 to see them. - Add testWarnings() (run from index.js) which installs a capturing logger listener and asserts each render-reachable warning fires: variable-in-at-rule- prelude (incl. bar[@v] top-level -> warns and (x:@v) decl-value -> no warn), js-eval, mixin-call-whitespace, mixin-call-no-parens, variable-in-unknown-value, dot-slash-operator, complex-selector, extend-no-match, compress, at-plugin. Documented gaps (not render-reachable): property-in-unknown-value (a $prop ref resolves via the entity path before the permissive text scan), math-always and dumpLineNumbers (registered in deprecation.js but never emitted via warn()). * refactor(parser): fold at-rule prelude bare-@var detection into $parseUntil (DRY) The at-rule-prelude deprecation detected a top-level bare @var two ways: the permissiveValue entity loop (structural), plus a standalone hasTopLevelBareVariable() that RE-SCANNED the same text $parseUntil had already walked, with its own hand-rolled paren counter (and no string/comment handling). Fold that second scan into $parseUntil's single pass: it already skips strings/comments/ escapes and tracks brackets, so add an opt-in `detectBareVar` that records the first bare @var (not @{interp}) seen at PAREN depth 0 — [...]/{...} don't shield a reference, only a declaration-value (...) does — exposed as `.bareVarIndex`. $parseUntil has a single caller (permissiveValue), so the extra arg/property is contained. Delete hasTopLevelBareVariable. Behaviour preserved (regression-guarded by testWarnings): @foo @bar -> 1, @a and @b -> 2, bar[@v] -> 1 (bracket is top-level), (x:@v) -> 0 (decl value), and the mixed (a:@x) y[@z] -> 1. Also drops the testWarnings 'variable-in-unknown-value' case: it only fires for the inconsistent bracket edge (--x: bar[@bar]) while --x: @bar / 1px @bar / foo(@bar) resolve silently, so asserting it would lock in an artifact (now documented). * deprecate dash-only variable names * deprecate dynamic charset interpolation * chore: release v4.8.0 --- CHANGELOG.md | 6 ++ package.json | 2 +- packages/less/lib/less/deprecation.js | 12 ++++ packages/less/lib/less/parser/parser.js | 83 +++++++++++++++++++++++- packages/less/package.json | 2 +- packages/less/test/less-test.js | 14 ++++ packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 8 files changed, 118 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f617fd657..3fb7a9a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Change Log +### v4.8.0 (2026-07-22) + +#### Deprecation Warnings + +- [#4475](https://github.com/less/less.js/pull/4475) Deprecate numeric-leading and dash-only variable names, dash-only mixin names, and dynamic `@charset` interpolation for removal in Less 5.x. Less 4 preserves the existing output while warning; migrate names to valid identifiers and use a static quoted `@charset` declaration. (@matthew-dean) + ### v4.7.0 (2026-07-18) #### Changes diff --git a/package.json b/package.json index 208a9d959..562c8177a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.7.0", + "version": "4.8.0", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/lib/less/deprecation.js b/packages/less/lib/less/deprecation.js index 9f490f532..8f8084289 100644 --- a/packages/less/lib/less/deprecation.js +++ b/packages/less/lib/less/deprecation.js @@ -22,6 +22,18 @@ const deprecations = { 'variable-in-at-rule-prelude': { description: 'A bare @variable in an at-rule prelude (e.g. @media @foo) is deprecated. Use @{variable} interpolation instead.' }, + 'numeric-variable-name': { + description: 'Variable names beginning with a number are deprecated and will be removed in Less 5.x.' + }, + 'dash-only-variable-name': { + description: 'The dash-only variable names @- and @{-} are deprecated and will be removed in Less 5.x.' + }, + 'dash-only-mixin-name': { + description: 'The dash-only mixin names .-() and #-() are deprecated and will be removed in Less 5.x.' + }, + 'dynamic-charset': { + description: 'Dynamic @charset interpolation is deprecated and will be removed in Less 5.x.' + }, 'property-in-unknown-value': { description: '$property in custom property values is treated as literal text.' }, diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index f667ea49c..e87e97e97 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -106,6 +106,64 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { warn('A bare @variable in an at-rule prelude is deprecated. Use @{variable} interpolation instead.', index, 'DEPRECATED', 'variable-in-at-rule-prelude'); } + /** + * Numeric-leading variable names are a Less extension rather than valid CSS + * identifier syntax. Keep accepting them through Less 4, but make the Less 5 + * migration visible at every actual variable reference or definition. + * + * @param {string} name - either an @-prefixed name or the name inside @{...} + * @param {number} index - source position of the variable token + */ + function warnNumericVariableName(name, index) { + if (/^(?:@@?)?[0-9]/.test(name)) { + warn('Variable names beginning with a number are deprecated and will be removed in Less 5.x. Rename the variable to start with a valid identifier character.', index, 'DEPRECATED', 'numeric-variable-name'); + } + } + + /** + * A lone '-' is not a CSS identifier. Less historically accepts it as a + * variable name; retain that in Less 4 only and warn on definitions, + * ordinary references, and interpolation references. + * + * @param {string} name - either @-/@@-, or the name inside @{...} + * @param {number} index - source position of the variable token + */ + function warnDashOnlyVariableName(name, index) { + const bareName = name.replace(/^@@?/, ''); + if (bareName === '-') { + warn('The dash-only variable names @- and @{-} are deprecated and will be removed in Less 5.x. Rename the variable to use a valid identifier.', index, 'DEPRECATED', 'dash-only-variable-name'); + } + } + + /** + * A lone '-' is not a CSS identifier. Less historically accepts it as a mixin + * name after '.' or '#'; retain that in Less 4 only. + * + * @param {string} name + * @param {number} index + */ + function warnDashOnlyMixinName(name, index) { + if (name === '.-' || name === '#-') { + warn('The dash-only mixin names .-() and #-() are deprecated and will be removed in Less 5.x. Rename the mixin to use a valid CSS identifier.', index, 'DEPRECATED', 'dash-only-mixin-name'); + } + } + + /** + * CSS @charset is a source-header declaration, not a general dynamic at-rule. + * Less 4 keeps its historical interpolation behavior for compatibility, but + * makes each dynamic spelling visible before Less 5 rejects it. + * + * @param {import('../tree/node.js').default} value + * @param {number} index - source position of the @charset token + */ + function warnDynamicCharset(value, index) { + if (value instanceof tree.Variable || + (value instanceof tree.Quoted && + (value.containsVariables() || value.value.match(value.propRegex)))) { + warn('Dynamic @charset interpolation is deprecated and will be removed in Less 5.x. Use a static quoted encoding declaration instead.', index, 'DEPRECATED', 'dynamic-charset'); + } + } + function expect(arg, msg) { // some older browsers return typeof 'function' for RegExp const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); @@ -684,6 +742,8 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.save(); if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) { + warnNumericVariableName(name, index); + warnDashOnlyVariableName(name, index); ch = parserInput.currentChar(); if ((ch === '(' && !parserInput.prevChar().match(/^\s/)) || (ch === '[' && !parserInput.prevChar().match(/^\s/))) { @@ -706,6 +766,8 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const index = parserInput.i; if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { + warnNumericVariableName(curly[1], index); + warnDashOnlyVariableName(curly[1], index); return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo); } }, @@ -828,7 +890,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { variable: function () { let name; - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { return name[1]; } + if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { + warnNumericVariableName(name[1], parserInput.i - name[0].length); + warnDashOnlyVariableName(name[1], parserInput.i - name[0].length); + return name[1]; + } }, // @@ -858,6 +924,8 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } if (!inValue) { + warnNumericVariableName(name[1], i); + warnDashOnlyVariableName(name[1], i); name = name[1]; } @@ -1014,6 +1082,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (inValue || parsers.end()) { parserInput.forget(); const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important); + for (const element of elements) { + warnDashOnlyMixinName(element.value, element._index - currentIndex); + } if (lookups) { return new tree.NamespaceValue(mixin, lookups); } @@ -1210,6 +1281,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { let ruleset; let cond; let variadic = false; + const index = parserInput.i; if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') || parserInput.peek(/^[^{]*\}/)) { return; @@ -1245,6 +1317,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (ruleset) { parserInput.forget(); + warnDashOnlyMixinName(name, index); return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic); } else { parserInput.restore(); @@ -2293,6 +2366,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (!value) { error(`expected ${name} identifier`); } + if (nonVendorSpecificName === '@charset') { + warnDynamicCharset(value, index); + } } else if (hasExpression) { // `@namespace` may carry an interpolated `@{ns}` prefix (or a // deprecated bare `@ns`). Parse that prefix directly so `@{ns}` @@ -2784,6 +2860,11 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } for (k = 0; k < name.length; k++) { s = name[k]; + if (s.charAt(0) === '@') { + const variableName = s.slice(2, -1); + warnNumericVariableName(variableName, index[k]); + warnDashOnlyVariableName(variableName, index[k]); + } name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ? new(tree.Keyword)(s) : (s.charAt(0) === '@' ? diff --git a/packages/less/package.json b/packages/less/package.json index e79a10d21..aed84b5fd 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.7.0", + "version": "4.8.0", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/less/test/less-test.js b/packages/less/test/less-test.js index 4853f5cd7..20778441a 100644 --- a/packages/less/test/less-test.js +++ b/packages/less/test/less-test.js @@ -860,6 +860,20 @@ export default function(testFilter) { ['bare @var in an at-rule prelude warns', '@bar: x;\n@foo @bar { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], ['@var inside […] is top-level and warns', '@v: x;\n@foo bar[@v] { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], ['@var inside (…) is a declaration value — no warning', '@v: 1px;\n@foo (x: @v) { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 0], + ['numeric-leading variable names warn, including @{...}', '@1: name;\n.@{1} { value: name }', {}, /Variable names beginning with a number are deprecated/, 2], + ['valid identifier-leading variable names do not warn', '@foo-1: name;\n.@{foo-1} { value: @foo-1 }', {}, /Variable names beginning with a number are deprecated/, 0], + ['dash-only variable definitions and ordinary references warn', '@-: name;\n.a { value: @- }', {}, /dash-only variable names @- and @\{-\} are deprecated/, 2], + ['dash-only variable interpolation warns', '@-: name;\n.@{-} { value: name }', {}, /dash-only variable names @- and @\{-\} are deprecated/, 2], + ['hyphen-led variable names remain valid without warning', '@-foo: name;\n.a { value: @-foo }', {}, /dash-only variable names @- and @\{-\} are deprecated/, 0], + ['numeric-leading variable property names warn', '@1: prop;\n.a { @{1}: value }', {}, /Variable names beginning with a number are deprecated/, 2], + ['dash-only variable property names warn', '@-: prop;\n.a { @{-}: value }', {}, /dash-only variable names @- and @\{-\} are deprecated/, 2], + ['numeric-leading variable calls warn', '@1: { value: yes; }\n.a { @1(); }', {}, /Variable names beginning with a number are deprecated/, 2], + ['dash-only variable calls warn', '@-: { value: yes; }\n.a { @-(); }', {}, /dash-only variable names @- and @\{-\} are deprecated/, 2], + ['dash-only mixin definitions and calls warn', '.-() { value: yes }\n.a { .-() }', {}, /dash-only mixin names \.-\(\) and #-\(\) are deprecated/, 2], + ['hash dash-only mixin definitions and calls warn', '#-() { value: yes }\n.a { #-() }', {}, /dash-only mixin names \.-\(\) and #-\(\) are deprecated/, 2], + ['hyphen-led mixin names remain valid without warning', '.-foo() { value: yes }\n.a { .-foo() }', {}, /dash-only mixin names \.-\(\) and #-\(\) are deprecated/, 0], + ['dynamic @charset interpolation warns', '@encoding: 8;\n@charset "UTF-@{encoding}";', {}, /Dynamic @charset interpolation is deprecated/, 1], + ['static @charset does not warn', '@charset "UTF-8";', {}, /Dynamic @charset interpolation is deprecated/, 0], ['inline JavaScript (backtick) is deprecated', '@x: `1 + 1`;\n.a { w: @x }', { javascriptEnabled: true }, /Inline JavaScript evaluation/, 1], ['whitespace before mixin-call parens is deprecated', '.m() { a: b }\n.a { .m () }', {}, /Whitespace between a mixin name and parentheses/, 1], ['mixin call without parens is deprecated', '.m() { a: b }\n.a { .m }', {}, /Calling a mixin without parentheses is deprecated/, 1], diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 5be85b184..84e3ff720 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.7.0", + "version": "4.8.0", "description": "Less files and CSS results", "author": "Alexis Sellier ", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 37e6a7b03..58ed90987 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.7.0", + "version": "4.8.0", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier ", "contributors": [ From ebbce6d330f36ab8330f0dfe847300bbda5506bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 10:18:48 -0700 Subject: [PATCH 68/76] chore: release v4.8.0 (#4474) Co-authored-by: github-actions[bot] Co-authored-by: Matthew Dean --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fb7a9a28..a3223f789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ### v4.8.0 (2026-07-22) +#### Changes + +- [#4473](https://github.com/less/less.js/pull/4473) fix(mixing): resolves issue #4234 (@puckowski) +- [#4472](https://github.com/less/less.js/pull/4472) Fix boolean() parsing for comparisons between inline condition expressions (@app/copilot-swe-agent) + #### Deprecation Warnings - [#4475](https://github.com/less/less.js/pull/4475) Deprecate numeric-leading and dash-only variable names, dash-only mixin names, and dynamic `@charset` interpolation for removal in Less 5.x. Less 4 preserves the existing output while warning; migrate names to valid identifiers and use a static quoted `@charset` declaration. (@matthew-dean) From d6b20eee3971d8fe725e0687412fe991bd3339d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BE=E5=8F=AF?= Date: Mon, 27 Jul 2026 03:10:22 +0800 Subject: [PATCH 69/76] fix: forwarding an unset variadic no longer overrides callee defaults (#4477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 林晨 (Leo Cheng) --- packages/less/lib/less/tree/mixin-call.js | 4 ++++ packages/test-data/tests-unit/mixins/mixins.css | 8 ++++++++ packages/test-data/tests-unit/mixins/mixins.less | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/packages/less/lib/less/tree/mixin-call.js b/packages/less/lib/less/tree/mixin-call.js index 01ae81f45..b7adb47a5 100644 --- a/packages/less/lib/less/tree/mixin-call.js +++ b/packages/less/lib/less/tree/mixin-call.js @@ -151,6 +151,10 @@ class MixinCall extends Node { for (m = 0; m < expandedValues.length; m++) { args.push({value: expandedValues[m]}); } + } else if (argValue.type === 'Expression' && Array.isArray(argValue.value) && argValue.value.length === 0) { + // an unset variadic holds no captured args; omit it so the callee + // falls through to its own parameter defaults instead of receiving empty + } else { args.push({name: arg.name, value: argValue}); } diff --git a/packages/test-data/tests-unit/mixins/mixins.css b/packages/test-data/tests-unit/mixins/mixins.css index c9087c0a7..ef9eda651 100644 --- a/packages/test-data/tests-unit/mixins/mixins.css +++ b/packages/test-data/tests-unit/mixins/mixins.css @@ -142,3 +142,11 @@ h3 + * { .button.large { padding-left: 40em; } +.rest-forwarding-empty { + a: 1; + b: fallback; +} +.rest-forwarding-filled { + a: 1; + b: 2; +} diff --git a/packages/test-data/tests-unit/mixins/mixins.less b/packages/test-data/tests-unit/mixins/mixins.less index bdd055cf2..71b1f3d9b 100644 --- a/packages/test-data/tests-unit/mixins/mixins.less +++ b/packages/test-data/tests-unit/mixins/mixins.less @@ -143,3 +143,19 @@ h3 { .margin_between(15px, 5px); } .foo { .clearfix(); } + +// Forwarding an unset variadic must fall through to the callee's default, +// not pass an empty argument that overrides it (issue #4352). +.rest-forward(@a, @rest...) { + .rest-target(@a, @rest); +} +.rest-target(@a, @b: fallback) { + a: @a; + b: @b; +} +.rest-forwarding-empty { + .rest-forward(1); +} +.rest-forwarding-filled { + .rest-forward(1, 2); +} From 1ee86aa33d53cd41bb691e9d63c1a97199d5beb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BE=E5=8F=AF?= Date: Mon, 27 Jul 2026 03:14:52 +0800 Subject: [PATCH 70/76] fix: leave math functions for the browser when an argument is a runtime CSS var() (#4479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 林晨 (Leo Cheng) --- .../less/lib/less/functions/math-helper.js | 9 ++++++- packages/less/lib/less/functions/math.js | 27 ++++++++++--------- packages/less/lib/less/functions/number.js | 2 +- .../tests-error/eval/percentage-css-var.less | 3 +++ .../tests-error/eval/percentage-css-var.txt | 4 +++ .../math-css-vars/math-css-vars.css | 10 +++++++ .../math-css-vars/math-css-vars.less | 14 ++++++++++ 7 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 packages/test-data/tests-error/eval/percentage-css-var.less create mode 100644 packages/test-data/tests-error/eval/percentage-css-var.txt create mode 100644 packages/test-data/tests-unit/math-css-vars/math-css-vars.css create mode 100644 packages/test-data/tests-unit/math-css-vars/math-css-vars.less diff --git a/packages/less/lib/less/functions/math-helper.js b/packages/less/lib/less/functions/math-helper.js index 9803710e3..df2ae6fd0 100644 --- a/packages/less/lib/less/functions/math-helper.js +++ b/packages/less/lib/less/functions/math-helper.js @@ -1,7 +1,14 @@ import Dimension from '../tree/dimension.js'; -const MathHelper = (fn, unit, n) => { +const MathHelper = (fn, unit, cssEvaluable, n) => { if (!(n instanceof Dimension)) { + // A runtime CSS value such as var()/env() stays an unevaluated call and + // cannot be resolved to a number at compile time. Only functions with a + // CSS equivalent may be left for the browser; the rest (percentage, ceil, + // floor, round) have no CSS form and keep erroring on such input. + if (cssEvaluable && n && n.type === 'Call') { + return undefined; + } throw { type: 'Argument', message: 'argument must be a number' }; } if (unit === null) { diff --git a/packages/less/lib/less/functions/math.js b/packages/less/lib/less/functions/math.js index 0432eff60..5739333e3 100644 --- a/packages/less/lib/less/functions/math.js +++ b/packages/less/lib/less/functions/math.js @@ -1,29 +1,30 @@ import mathHelper from './math-helper.js'; const mathFunctions = { - // name, unit - ceil: null, - floor: null, - sqrt: null, - abs: null, - tan: '', - sin: '', - cos: '', - atan: 'rad', - asin: 'rad', - acos: 'rad' + // name: [unit, has a CSS equivalent that the browser can evaluate] + ceil: [null, false], + floor: [null, false], + sqrt: [null, true], + abs: [null, true], + tan: ['', true], + sin: ['', true], + cos: ['', true], + atan: ['rad', true], + asin: ['rad', true], + acos: ['rad', true] }; for (const f in mathFunctions) { // eslint-disable-next-line no-prototype-builtins if (mathFunctions.hasOwnProperty(f)) { - mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]); + const [unit, cssEvaluable] = mathFunctions[f]; + mathFunctions[f] = mathHelper.bind(null, Math[f], unit, cssEvaluable); } } mathFunctions.round = (n, f) => { const fraction = typeof f === 'undefined' ? 0 : f.value; - return mathHelper(num => num.toFixed(fraction), null, n); + return mathHelper(num => num.toFixed(fraction), null, false, n); }; export default mathFunctions; diff --git a/packages/less/lib/less/functions/number.js b/packages/less/lib/less/functions/number.js index 8fa932aeb..ade87303c 100644 --- a/packages/less/lib/less/functions/number.js +++ b/packages/less/lib/less/functions/number.js @@ -88,7 +88,7 @@ export default { return new Dimension(Math.pow(x.value, y.value), x.unit); }, percentage: function (n) { - const result = mathHelper(num => num * 100, '%', n); + const result = mathHelper(num => num * 100, '%', false, n); return result; } diff --git a/packages/test-data/tests-error/eval/percentage-css-var.less b/packages/test-data/tests-error/eval/percentage-css-var.less new file mode 100644 index 000000000..d205361b6 --- /dev/null +++ b/packages/test-data/tests-error/eval/percentage-css-var.less @@ -0,0 +1,3 @@ +.a { + b: percentage(var(--x)); +} diff --git a/packages/test-data/tests-error/eval/percentage-css-var.txt b/packages/test-data/tests-error/eval/percentage-css-var.txt new file mode 100644 index 000000000..f66fcfe1e --- /dev/null +++ b/packages/test-data/tests-error/eval/percentage-css-var.txt @@ -0,0 +1,4 @@ +ArgumentError: Error evaluating function `percentage`: argument must be a number in {path}percentage-css-var.less on line 2, column 6: +1 .a { +2 b: percentage(var(--x)); +3 } diff --git a/packages/test-data/tests-unit/math-css-vars/math-css-vars.css b/packages/test-data/tests-unit/math-css-vars/math-css-vars.css new file mode 100644 index 000000000..c1b97d6d3 --- /dev/null +++ b/packages/test-data/tests-unit/math-css-vars/math-css-vars.css @@ -0,0 +1,10 @@ +.trig { + a: sin(var(--angle)); + b: cos(var(--a)); + c: calc(tan(var(--t)) * 1px); + d: atan2(var(--x), var(--y)); +} +.numeric { + a: 0.5; + b: 5; +} diff --git a/packages/test-data/tests-unit/math-css-vars/math-css-vars.less b/packages/test-data/tests-unit/math-css-vars/math-css-vars.less new file mode 100644 index 000000000..7e5da60ba --- /dev/null +++ b/packages/test-data/tests-unit/math-css-vars/math-css-vars.less @@ -0,0 +1,14 @@ +// Math functions cannot resolve a runtime CSS var() at compile time, so the +// whole call is left for the browser instead of erroring (issue #4224). +.trig { + a: sin(var(--angle)); + b: cos(var(--a)); + c: calc(tan(var(--t)) * 1px); + d: atan2(var(--x), var(--y)); +} + +// Concrete numeric arguments still evaluate. +.numeric { + a: sin(30deg); + b: ceil(4.2); +} From ed8ceb8d33b204345b8446fcb4e78b022f4fee24 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Sun, 26 Jul 2026 15:49:42 -0700 Subject: [PATCH 71/76] fix(release): sync release version from PR title (#4483) * fix(release): sync release version from PR title * fix(release): harden title sync automation * fix(release): harden title sync workflow * fix(release): make changelog title sync idempotent * fix(release): insert missing changelog heading on title sync * fix(release): insert changelog heading without prior releases --- .github/workflows/create-release-pr.yml | 206 +++++++++++----- .github/workflows/publish.yml | 31 ++- scripts/release-metadata.js | 297 ++++++++++++++++++++++++ scripts/test-release-automation.js | 205 +++++++++++++++- 4 files changed, 670 insertions(+), 69 deletions(-) create mode 100644 scripts/release-metadata.js diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index d43addf38..32df82207 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -5,12 +5,17 @@ name: Create Release PR # version. Maintainers then merge that PR to trigger publishing. # # master → "chore: release vX.Y.Z" PR targets master -# alpha → "chore: alpha release vX.Y.Z" PR targets alpha +# alpha → "chore: release vX.Y.Z-alpha.N" PR targets alpha on: push: branches: - master - alpha + pull_request: + types: [opened, edited, reopened, synchronize] + branches: + - master + - alpha permissions: contents: write @@ -24,6 +29,7 @@ jobs: # infinite loop). We catch both squash-merged and regular-merged commits # for both the master and alpha release PR title conventions. if: | + github.event_name == 'push' && github.repository == 'less/less.js' && !contains(github.event.head_commit.message, 'chore: release v') && !contains(github.event.head_commit.message, 'chore: alpha release v') && @@ -48,50 +54,48 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile --ignore-scripts - - name: Determine next version + - name: Determine release version id: version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REF_NAME: ${{ github.ref_name }} run: | - BRANCH="${{ github.ref_name }}" + set -euo pipefail + BRANCH="$REF_NAME" CURRENT=$(node -p "require('./packages/less/package.json').version") if [ "$BRANCH" = "alpha" ]; then - # Alpha: increment the alpha prerelease number. - # X.Y.Z-alpha.N → X.Y.Z-alpha.(N+1) - # If package.json doesn't carry an alpha version yet, bump the - # major and start a fresh alpha.1 series. - NEXT=$(node -e " - const cur = process.argv[1]; - const m = cur.match(/^(\\d+\\.\\d+\\.\\d+)-alpha\\.(\\d+)$/); - if (m) { - process.stdout.write(m[1] + '-alpha.' + (parseInt(m[2], 10) + 1)); - } else { - const parts = cur.replace(/-.*/, '').split('.'); - const nextMajor = parseInt(parts[0], 10) + 1; - process.stdout.write(nextMajor + '.0.0-alpha.1'); - } - " "$CURRENT") - echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" - echo "branch=chore/alpha-release-v$NEXT" >> "$GITHUB_OUTPUT" - echo "release_base=alpha" >> "$GITHUB_OUTPUT" + NPM_VERSION=$(npm view less dist-tags.alpha) else - # Master: patch-increment from the latest npm published version. - NPM_VERSION=$(npm view less version 2>/dev/null || echo "") - NEXT=$(node -e " - const semver = require('semver'); - const cur = process.argv[1]; - const npm = process.argv[2] || null; - if (npm && semver.valid(cur) && semver.gt(cur, npm)) { - process.stdout.write(cur); - } else { - const base = npm || cur; - process.stdout.write(semver.inc(base, 'patch')); - } - " "$CURRENT" "$NPM_VERSION") - echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" - echo "branch=chore/release-v$NEXT" >> "$GITHUB_OUTPUT" - echo "release_base=master" >> "$GITHUB_OUTPUT" + NPM_VERSION=$(npm view less version) fi + DEFAULT_NEXT=$(node scripts/release-metadata.js next-version "$BRANCH" "$CURRENT" "$NPM_VERSION") + EXISTING=$(gh pr list \ + --state open \ + --base "$BRANCH" \ + --json title,headRefName,headRepository,isCrossRepository \ + --jq '[.[] | select((.isCrossRepository | not) and .headRepository.nameWithOwner == "less/less.js" and ((.headRefName | startswith("chore/release-v")) or (.headRefName | startswith("chore/alpha-release-v"))))][0] // {}') + + EXISTING_TITLE=$(node -e "const pr = JSON.parse(process.argv[1]); process.stdout.write(pr.title || '')" "$EXISTING") + EXISTING_BRANCH=$(node -e "const pr = JSON.parse(process.argv[1]); process.stdout.write(pr.headRefName || '')" "$EXISTING") + + if [ -n "$EXISTING_TITLE" ]; then + NEXT=$(node scripts/release-metadata.js parse-title "$BRANCH" "$EXISTING_TITLE") + RELEASE_BRANCH="$EXISTING_BRANCH" + else + NEXT="$DEFAULT_NEXT" + RELEASE_BRANCH=$(node scripts/release-metadata.js branch "$BRANCH" "$NEXT") + fi + + node scripts/release-metadata.js validate "$BRANCH" "$NEXT" "$NPM_VERSION" + TITLE=$(node scripts/release-metadata.js title "$BRANCH" "$NEXT") + + echo "next_version=$NEXT" >> "$GITHUB_OUTPUT" + echo "branch=$RELEASE_BRANCH" >> "$GITHUB_OUTPUT" + echo "release_base=$BRANCH" >> "$GITHUB_OUTPUT" + echo "title=$TITLE" >> "$GITHUB_OUTPUT" + - name: Configure Git run: | git config --global user.name "github-actions[bot]" @@ -102,14 +106,11 @@ jobs: NEXT_VERSION: ${{ steps.version.outputs.next_version }} RELEASE_BRANCH: ${{ steps.version.outputs.branch }} RELEASE_BASE: ${{ steps.version.outputs.release_base }} + RELEASE_TITLE: ${{ steps.version.outputs.title }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - if [ "$RELEASE_BASE" = "alpha" ]; then - TITLE="chore: alpha release v${NEXT_VERSION}" - else - TITLE="chore: release v${NEXT_VERSION}" - fi + TITLE="${RELEASE_TITLE}" # Create or reset the release branch off the latest base branch so it # always includes all recent commits. @@ -120,20 +121,7 @@ jobs: git checkout -b "${RELEASE_BRANCH}" fi - # Bump version in all package.json files. - node -e " - const fs = require('fs'); - const version = process.env.NEXT_VERSION; - const dirs = fs.readdirSync('packages', { withFileTypes: true }) - .filter(d => d.isDirectory()) - .map(d => 'packages/' + d.name + '/package.json'); - for (const f of ['package.json', ...dirs].filter(f => fs.existsSync(f))) { - const pkg = JSON.parse(fs.readFileSync(f, 'utf8')); - if (!pkg.version) continue; - pkg.version = version; - fs.writeFileSync(f, JSON.stringify(pkg, null, '\t') + '\n'); - } - " + node scripts/release-metadata.js sync-package-versions "${NEXT_VERSION}" git add package.json packages/*/package.json @@ -199,7 +187,7 @@ jobs: --json number --jq '.[0].number' 2>/dev/null || echo "") if [ -z "${EXISTING}" ]; then - BODY=$(printf '## Release v%s\n\nThis PR bumps the version to `%s` and will trigger an npm publish when merged.' "${NEXT_VERSION}" "${NEXT_VERSION}") + BODY=$(node scripts/release-metadata.js body) gh pr create \ --title "${TITLE}" \ @@ -210,3 +198,107 @@ jobs: else echo "✅ Release PR #${EXISTING} already exists; branch updated to include latest ${RELEASE_BASE} commits" fi + + sync-release-pr-title: + name: Sync Release PR Title + runs-on: ubuntu-latest + concurrency: + group: sync-release-pr-title-${{ github.event.pull_request.number }} + cancel-in-progress: true + if: | + github.event_name == 'pull_request' && + github.repository == 'less/less.js' && + github.event.pull_request.head.repo.full_name == github.repository && + ( + ( + github.event.pull_request.base.ref == 'master' && + startsWith(github.event.pull_request.head.ref, 'chore/release-v') && + startsWith(github.event.pull_request.title, 'chore: release v') + ) || + ( + github.event.pull_request.base.ref == 'alpha' && + startsWith(github.event.pull_request.head.ref, 'chore/alpha-release-v') && + ( + startsWith(github.event.pull_request.title, 'chore: release v') || + startsWith(github.event.pull_request.title, 'chore: alpha release v') + ) + ) + ) + + steps: + - name: Checkout release PR branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + + - name: Load trusted release metadata script + env: + RELEASE_BASE: ${{ github.event.pull_request.base.ref }} + run: | + set -euo pipefail + git fetch origin "${RELEASE_BASE}" + mkdir -p .release-scripts + git show "origin/${RELEASE_BASE}:scripts/release-metadata.js" > .release-scripts/release-metadata.js + + - name: Resolve title version + id: title-version + env: + RELEASE_BASE: ${{ github.event.pull_request.base.ref }} + RELEASE_TITLE: ${{ github.event.pull_request.title }} + run: | + set -euo pipefail + PREVIOUS_VERSION=$(node -p "require('./packages/less/package.json').version") + VERSION=$(node .release-scripts/release-metadata.js parse-title "$RELEASE_BASE" "$RELEASE_TITLE") + if [ "$RELEASE_BASE" = "alpha" ]; then + NPM_VERSION=$(npm view less dist-tags.alpha) + else + NPM_VERSION=$(npm view less version) + fi + node .release-scripts/release-metadata.js validate-title-sync "$RELEASE_BASE" "$VERSION" "$PREVIOUS_VERSION" "$NPM_VERSION" + TITLE=$(node .release-scripts/release-metadata.js title "$RELEASE_BASE" "$VERSION") + + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "previous_version=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT" + echo "title=$TITLE" >> "$GITHUB_OUTPUT" + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Sync release files to title version + env: + VERSION: ${{ steps.title-version.outputs.version }} + PREVIOUS_VERSION: ${{ steps.title-version.outputs.previous_version }} + TITLE: ${{ steps.title-version.outputs.title }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + node .release-scripts/release-metadata.js sync-files "$VERSION" "$PREVIOUS_VERSION" + git add package.json packages/*/package.json + if [ -f CHANGELOG.md ]; then + git add CHANGELOG.md + fi + + if git diff --cached --quiet; then + echo "Release files already match v${VERSION}" + exit 0 + fi + + git commit -m "$TITLE" + git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:${HEAD_REF}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f25ae6fe7..13fabda24 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish to NPM on: # Publish when a release PR is merged: # master branch: "chore: release vX.Y.Z" PR → publishes latest - # alpha branch: "chore: alpha release vX.Y.Z" PR → publishes alpha + # alpha branch: "chore: release vX.Y.Z-alpha.N" PR → publishes alpha # Both release PRs are created automatically by create-release-pr.yml. pull_request: types: [closed] @@ -29,7 +29,10 @@ jobs: (github.event.pull_request.base.ref == 'master' && startsWith(github.event.pull_request.title, 'chore: release v')) || (github.event.pull_request.base.ref == 'alpha' && - startsWith(github.event.pull_request.title, 'chore: alpha release v')) + ( + startsWith(github.event.pull_request.title, 'chore: release v') || + startsWith(github.event.pull_request.title, 'chore: alpha release v') + )) ) steps: @@ -54,6 +57,30 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile --ignore-scripts + - name: Validate release title version + env: + RELEASE_BASE: ${{ github.event.pull_request.base.ref }} + RELEASE_TITLE: ${{ github.event.pull_request.title }} + run: | + set -euo pipefail + TITLE_VERSION=$(node scripts/release-metadata.js parse-title "$RELEASE_BASE" "$RELEASE_TITLE") + PACKAGE_VERSION=$(node -p "require('./packages/less/package.json').version") + + if [ "$TITLE_VERSION" != "$PACKAGE_VERSION" ]; then + echo "❌ ERROR: Release PR title requests v${TITLE_VERSION}, but package.json contains v${PACKAGE_VERSION}" + echo " Edit the release PR title and wait for the release-file sync check to update the branch before merging." + exit 1 + fi + + if [ "$RELEASE_BASE" = "alpha" ]; then + NPM_VERSION=$(npm view less dist-tags.alpha) + else + NPM_VERSION=$(npm view less version) + fi + + node scripts/release-metadata.js validate "$RELEASE_BASE" "$TITLE_VERSION" "$NPM_VERSION" + echo "✅ Release title, package.json, and npm version checks agree on v${TITLE_VERSION}" + - name: Run node tests (ESM + CJS) run: pnpm run test:node diff --git a/scripts/release-metadata.js b/scripts/release-metadata.js new file mode 100644 index 000000000..bd4d4b231 --- /dev/null +++ b/scripts/release-metadata.js @@ -0,0 +1,297 @@ +#!/usr/bin/env node + +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const semver = require('semver'); + +const ROOT_DIR = path.resolve(__dirname, '..'); +const PACKAGES_DIR = path.join(ROOT_DIR, 'packages'); +const RELEASE_TITLE_PREFIX = 'chore: release v'; +const LEGACY_ALPHA_RELEASE_TITLE_PREFIX = 'chore: alpha release v'; + +function isAlphaBase(base) { + return base === 'alpha'; +} + +function releaseTitle(base, version) { + validateVersionForBase(base, version); + return `${RELEASE_TITLE_PREFIX}${version}`; +} + +function releaseBranch(base, version) { + validateVersionForBase(base, version); + return isAlphaBase(base) ? `chore/alpha-release-v${version}` : `chore/release-v${version}`; +} + +function releaseBody() { + return 'Merging this PR publishes the version named in the PR title.'; +} + +function parseReleaseTitle(base, title) { + if (typeof title !== 'string') { + throw new Error('Release title must be a string'); + } + + let version = null; + if (title.startsWith(RELEASE_TITLE_PREFIX)) { + version = title.slice(RELEASE_TITLE_PREFIX.length).trim(); + } else if (isAlphaBase(base) && title.startsWith(LEGACY_ALPHA_RELEASE_TITLE_PREFIX)) { + version = title.slice(LEGACY_ALPHA_RELEASE_TITLE_PREFIX.length).trim(); + } + + if (!version) { + throw new Error( + isAlphaBase(base) + ? `Release title must start with "${RELEASE_TITLE_PREFIX}" or "${LEGACY_ALPHA_RELEASE_TITLE_PREFIX}"` + : `Release title must start with "${RELEASE_TITLE_PREFIX}"`, + ); + } + + validateVersionForBase(base, version); + return version; +} + +function validateVersionForBase(base, version) { + const normalized = semver.valid(version); + if (!normalized || normalized !== version) { + throw new Error(`Invalid semver version: ${version}`); + } + + const parsed = semver.parse(version); + const prerelease = parsed.prerelease; + if (isAlphaBase(base)) { + if ( + prerelease.length !== 2 || + prerelease[0] !== 'alpha' || + typeof prerelease[1] !== 'number' + ) { + throw new Error(`Alpha releases must use X.Y.Z-alpha.N, got: ${version}`); + } + } else if (base === 'master') { + if (prerelease.length > 0) { + throw new Error(`Master releases must not use a prerelease version, got: ${version}`); + } + } else { + throw new Error(`Release base must be "master" or "alpha", got: ${base}`); + } +} + +function validateAgainstNpm(base, version, npmVersion) { + validateVersionForBase(base, version); + if (!npmVersion) return; + if (!semver.valid(npmVersion)) { + throw new Error(`Invalid npm version: ${npmVersion}`); + } + if (!semver.gt(version, npmVersion)) { + const tag = isAlphaBase(base) ? 'alpha' : 'latest'; + throw new Error(`Release version ${version} must be greater than npm ${tag} version ${npmVersion}`); + } +} + +function validateTitleSync(base, version, previousVersion, npmVersion) { + validateAgainstNpm(base, version, npmVersion); + + if (!semver.valid(previousVersion)) { + throw new Error(`Invalid previous package version: ${previousVersion}`); + } + if (semver.lt(version, previousVersion)) { + throw new Error(`Release title version ${version} must not be lower than current branch version ${previousVersion}`); + } +} + +function nextVersion(base, currentVersion, npmVersion) { + if (!semver.valid(currentVersion)) { + throw new Error(`Invalid current package version: ${currentVersion}`); + } + + if (isAlphaBase(base)) { + const baseVersion = npmVersion && semver.valid(npmVersion) && semver.gt(npmVersion, currentVersion) + ? npmVersion + : currentVersion; + const match = baseVersion.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); + if (match) { + return `${match[1]}-alpha.${parseInt(match[2], 10) + 1}`; + } + const parsed = semver.parse(baseVersion); + return `${parsed.major + 1}.0.0-alpha.1`; + } + + if (npmVersion && semver.valid(npmVersion) && semver.gt(currentVersion, npmVersion)) { + return currentVersion; + } + return semver.inc(npmVersion || currentVersion, 'patch'); +} + +function packageFiles() { + const files = [path.join(ROOT_DIR, 'package.json')]; + const packageDirs = fs.readdirSync(PACKAGES_DIR, { withFileTypes: true }) + .filter(dirent => dirent.isDirectory()) + .map(dirent => path.join(PACKAGES_DIR, dirent.name, 'package.json')); + return [...files, ...packageDirs].filter(file => fs.existsSync(file)); +} + +function syncPackageVersions(version) { + validateVersionForBase(version.includes('-alpha.') ? 'alpha' : 'master', version); + for (const file of packageFiles()) { + const pkg = JSON.parse(fs.readFileSync(file, 'utf8')); + if (!pkg.version) continue; + pkg.version = version; + fs.writeFileSync(file, JSON.stringify(pkg, null, '\t') + '\n'); + } +} + +function replaceChangelogVersion(content, version, previousVersion) { + const heading = content.match(/^(### v)(\d+\.\d+\.\d+(?:-alpha\.\d+)?)( \(\d{4}-\d{2}-\d{2}\))$/m); + if (!heading || heading[2] !== previousVersion) { + return { changed: false, content }; + } + + return { + changed: true, + content: content.slice(0, heading.index) + + `${heading[1]}${version}${heading[3]}` + + content.slice(heading.index + heading[0].length), + }; +} + +function currentDate() { + return new Date().toISOString().slice(0, 10); +} + +function insertChangelogVersion(content, version, date = currentDate()) { + const heading = `### v${version} (${date})`; + const firstReleaseHeading = content.match(/^### v\d+\.\d+\.\d+(?:-alpha\.\d+)? \(\d{4}-\d{2}-\d{2}\)$/m); + + if (firstReleaseHeading) { + return content.slice(0, firstReleaseHeading.index) + + `${heading}\n\n` + + content.slice(firstReleaseHeading.index); + } + + const firstLineEnd = content.indexOf('\n'); + if (firstLineEnd === -1) { + return `${content}\n\n${heading}\n`; + } + + return content.slice(0, firstLineEnd + 1) + + `\n${heading}\n` + + content.slice(firstLineEnd + 1); +} + +function changelogUpdateForContent(content, version, previousVersion, date) { + if (version === previousVersion) { + return { status: 'unchanged', content }; + } + + const heading = content.match(/^(### v)(\d+\.\d+\.\d+(?:-alpha\.\d+)?)( \(\d{4}-\d{2}-\d{2}\))$/m); + if (!heading) { + return { status: 'inserted', content: insertChangelogVersion(content, version, date) }; + } + if (heading[2] === version) { + return { status: 'unchanged', content }; + } + + const { changed, content: updated } = replaceChangelogVersion(content, version, previousVersion); + if (!changed) { + return { status: 'inserted', content: insertChangelogVersion(content, version, date) }; + } + + return { status: 'updated', content: updated }; +} + +function readChangelogUpdate(version, previousVersion) { + const changelog = path.join(ROOT_DIR, 'CHANGELOG.md'); + if (!fs.existsSync(changelog)) return { path: changelog, status: 'missing' }; + + const original = fs.readFileSync(changelog, 'utf8'); + return { path: changelog, ...changelogUpdateForContent(original, version, previousVersion) }; +} + +function syncChangelogVersion(version, previousVersion) { + const update = readChangelogUpdate(version, previousVersion); + if (update.status !== 'updated' && update.status !== 'inserted') return false; + + fs.writeFileSync(update.path, update.content); + return true; +} + +function syncFiles(version, previousVersion) { + const changelogUpdate = readChangelogUpdate(version, previousVersion); + + syncPackageVersions(version); + if (changelogUpdate.status === 'updated' || changelogUpdate.status === 'inserted') { + fs.writeFileSync(changelogUpdate.path, changelogUpdate.content); + } + + return true; +} + +function usage() { + console.error(`Usage: + node scripts/release-metadata.js title + node scripts/release-metadata.js branch + node scripts/release-metadata.js body + node scripts/release-metadata.js parse-title + node scripts/release-metadata.js validate <base> <version> [npmVersion] + node scripts/release-metadata.js validate-title-sync <base> <version> <previousVersion> [npmVersion] + node scripts/release-metadata.js next-version <base> <currentVersion> [npmVersion] + node scripts/release-metadata.js sync-package-versions <version> + node scripts/release-metadata.js sync-files <version> <previousVersion>`); +} + +function main(argv = process.argv.slice(2)) { + const [command, ...args] = argv; + try { + if (command === 'title') { + process.stdout.write(releaseTitle(args[0], args[1])); + } else if (command === 'branch') { + process.stdout.write(releaseBranch(args[0], args[1])); + } else if (command === 'body') { + process.stdout.write(releaseBody()); + } else if (command === 'parse-title') { + process.stdout.write(parseReleaseTitle(args[0], args.slice(1).join(' '))); + } else if (command === 'validate') { + validateAgainstNpm(args[0], args[1], args[2] || ''); + } else if (command === 'validate-title-sync') { + validateTitleSync(args[0], args[1], args[2], args[3] || ''); + } else if (command === 'next-version') { + process.stdout.write(nextVersion(args[0], args[1], args[2] || '')); + } else if (command === 'sync-package-versions') { + syncPackageVersions(args[0]); + } else if (command === 'sync-files') { + syncFiles(args[0], args[1]); + } else { + usage(); + process.exit(1); + } + } catch (error) { + console.error(error.message); + process.exit(1); + } +} + +if (require.main === module) { + main(); +} + +module.exports = { + LEGACY_ALPHA_RELEASE_TITLE_PREFIX, + RELEASE_TITLE_PREFIX, + changelogUpdateForContent, + insertChangelogVersion, + nextVersion, + parseReleaseTitle, + readChangelogUpdate, + replaceChangelogVersion, + releaseBody, + releaseBranch, + releaseTitle, + syncFiles, + syncChangelogVersion, + syncPackageVersions, + validateAgainstNpm, + validateTitleSync, + validateVersionForBase, +}; diff --git a/scripts/test-release-automation.js b/scripts/test-release-automation.js index 94a222022..ebffd26ad 100644 --- a/scripts/test-release-automation.js +++ b/scripts/test-release-automation.js @@ -45,6 +45,7 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); const { spawnSync, execSync } = require('child_process'); +const releaseMetadata = require('./release-metadata'); const ROOT_DIR = path.resolve(__dirname, '..'); @@ -116,12 +117,15 @@ function publishShouldRun({ repo, prMerged, prBaseRef, prTitle }) { const isMasterRelease = prBaseRef === 'master' && typeof prTitle === 'string' && - prTitle.startsWith('chore: release v'); + prTitle.startsWith(releaseMetadata.RELEASE_TITLE_PREFIX); const isAlphaRelease = prBaseRef === 'alpha' && typeof prTitle === 'string' && - prTitle.startsWith('chore: alpha release v'); + ( + prTitle.startsWith(releaseMetadata.RELEASE_TITLE_PREFIX) || + prTitle.startsWith(releaseMetadata.LEGACY_ALPHA_RELEASE_TITLE_PREFIX) + ); return isMasterRelease || isAlphaRelease; } @@ -151,14 +155,8 @@ function createReleasePRShouldRun({ repo, commitMessage }) { * X.Y.Z-alpha.N → X.Y.Z-alpha.(N+1) * X.Y.Z → (X+1).0.0-alpha.1 (no alpha suffix yet) */ -function nextAlphaVersion(current) { - const m = current.match(/^(\d+\.\d+\.\d+)-alpha\.(\d+)$/); - if (m) { - return `${m[1]}-alpha.${parseInt(m[2], 10) + 1}`; - } - const parts = current.replace(/-.*/, '').split('.'); - const nextMajor = parseInt(parts[0], 10) + 1; - return `${nextMajor}.0.0-alpha.1`; +function nextAlphaVersion(current, npmVersion) { + return releaseMetadata.nextVersion('alpha', current, npmVersion); } // --------------------------------------------------------------------------- @@ -346,6 +344,18 @@ test('master release PR merged → SHOULD publish', () => { }); test('alpha release PR merged → SHOULD publish (alpha tag)', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'alpha', + prTitle: 'chore: release v5.0.0-alpha.2', + }), + true, + ); +}); + +test('legacy alpha release PR title merged → SHOULD publish (alpha tag)', () => { assert.strictEqual( publishShouldRun({ repo: 'less/less.js', @@ -406,6 +416,22 @@ test('alpha release PR title used against master base → should NOT publish', ( ); }); +test('alpha-looking canonical title against master base → trigger, then validation rejects', () => { + assert.strictEqual( + publishShouldRun({ + repo: 'less/less.js', + prMerged: true, + prBaseRef: 'master', + prTitle: 'chore: release v5.0.0-alpha.1', + }), + true, + ); + assert.throws( + () => releaseMetadata.parseReleaseTitle('master', 'chore: release v5.0.0-alpha.1'), + /Master releases must not use a prerelease version/, + ); +}); + test('wrong repository → should NOT publish', () => { assert.strictEqual( publishShouldRun({ @@ -418,6 +444,161 @@ test('wrong repository → should NOT publish', () => { ); }); +// ---------------------------------------------------------------------------- +// Section 1b — release title metadata +// ---------------------------------------------------------------------------- + +section('1b. release title metadata — title as version source'); + +test('master title parses the requested release version', () => { + assert.strictEqual( + releaseMetadata.parseReleaseTitle('master', 'chore: release v4.9.0'), + '4.9.0', + ); +}); + +test('alpha title uses the same canonical title shape', () => { + assert.strictEqual( + releaseMetadata.releaseTitle('alpha', '5.0.0-alpha.3'), + 'chore: release v5.0.0-alpha.3', + ); + assert.strictEqual( + releaseMetadata.parseReleaseTitle('alpha', 'chore: release v5.0.0-alpha.3'), + '5.0.0-alpha.3', + ); +}); + +test('legacy alpha title remains accepted for existing PRs', () => { + assert.strictEqual( + releaseMetadata.parseReleaseTitle('alpha', 'chore: alpha release v5.0.0-alpha.3'), + '5.0.0-alpha.3', + ); +}); + +test('master release title rejects alpha prerelease versions', () => { + assert.throws( + () => releaseMetadata.parseReleaseTitle('master', 'chore: release v5.0.0-alpha.3'), + /Master releases must not use a prerelease version/, + ); +}); + +test('master release title rejects legacy alpha prefix', () => { + assert.throws( + () => releaseMetadata.parseReleaseTitle('master', 'chore: alpha release v5.0.0'), + /Release title must start with "chore: release v"/, + ); +}); + +test('alpha release title rejects non-alpha versions', () => { + assert.throws( + () => releaseMetadata.parseReleaseTitle('alpha', 'chore: release v5.0.0'), + /Alpha releases must use X\.Y\.Z-alpha\.N/, + ); +}); + +test('release body does not repeat the version', () => { + assert.ok(!releaseMetadata.releaseBody().includes('4.9.0')); + assert.ok(releaseMetadata.releaseBody().includes('PR title')); +}); + +test('npm latest check rejects a master title version that is already published', () => { + assert.throws( + () => releaseMetadata.validateAgainstNpm('master', '4.9.0', '4.9.0'), + /must be greater than npm latest version/, + ); +}); + +test('npm alpha check rejects an alpha title version that is already published', () => { + assert.throws( + () => releaseMetadata.validateAgainstNpm('alpha', '5.0.0-alpha.3', '5.0.0-alpha.3'), + /must be greater than npm alpha version/, + ); +}); + +test('title sync rejects versions lower than the release branch package version', () => { + assert.throws( + () => releaseMetadata.validateTitleSync('master', '4.8.0', '4.9.0', '4.7.0'), + /must not be lower than current branch version/, + ); +}); + +test('title sync allows versions equal to the release branch package version', () => { + assert.doesNotThrow( + () => releaseMetadata.validateTitleSync('master', '4.9.0', '4.9.0', '4.8.0'), + ); +}); + +test('changelog title sync updates the matching current release heading only', () => { + const changelog = [ + '# Changelog', + '', + '### v4.8.1 (2026-07-26)', + '', + '#### Changes', + '', + '- something', + '', + '### v4.8.0 (2026-07-25)', + '', + ].join('\n'); + + const result = releaseMetadata.replaceChangelogVersion(changelog, '4.9.0', '4.8.1'); + assert.strictEqual(result.changed, true); + assert.ok(result.content.includes('### v4.9.0 (2026-07-26)')); + assert.ok(result.content.includes('### v4.8.0 (2026-07-25)')); +}); + +test('changelog title sync inserts a current heading when only history exists', () => { + const changelog = [ + '# Changelog', + '', + '### v4.8.0 (2026-07-25)', + '', + '#### Changes', + '', + '- older change', + '', + ].join('\n'); + + const result = releaseMetadata.changelogUpdateForContent(changelog, '4.9.0', '4.8.1', '2026-07-26'); + assert.strictEqual(result.status, 'inserted'); + assert.ok(result.content.includes('### v4.9.0 (2026-07-26)\n\n### v4.8.0 (2026-07-25)')); + assert.ok(result.content.includes('- older change')); +}); + +test('changelog title sync inserts a heading when no dated release heading exists', () => { + const changelog = [ + '# Changelog', + '', + 'Unreleased notes without a dated release heading.', + '', + ].join('\n'); + + const result = releaseMetadata.changelogUpdateForContent(changelog, '4.9.0', '4.8.1', '2026-07-26'); + assert.strictEqual(result.status, 'inserted'); + assert.ok(result.content.includes('# Changelog\n\n### v4.9.0 (2026-07-26)\n')); + assert.ok(result.content.includes('Unreleased notes without a dated release heading.')); +}); + +test('changelog title sync is idempotent when the heading already matches the title', () => { + const changelog = [ + '# Changelog', + '', + '### v4.9.0 (2026-07-26)', + '', + '#### Changes', + '', + '- something', + '', + '### v4.8.0 (2026-07-25)', + '', + ].join('\n'); + + const result = releaseMetadata.changelogUpdateForContent(changelog, '4.9.0', '4.8.1'); + assert.strictEqual(result.status, 'unchanged'); + assert.strictEqual(result.content, changelog); +}); + // ---------------------------------------------------------------------------- // Section 2 — create-release-pr.yml trigger conditions // ---------------------------------------------------------------------------- @@ -509,6 +690,10 @@ test('double-digit rollover: 5.0.0-alpha.9 → 5.0.0-alpha.10 (integer, not str assert.strictEqual(nextAlphaVersion('5.0.0-alpha.9'), '5.0.0-alpha.10'); }); +test('npm alpha ahead of package.json: 5.0.0-alpha.1 with npm alpha.4 → 5.0.0-alpha.5', () => { + assert.strictEqual(nextAlphaVersion('5.0.0-alpha.1', '5.0.0-alpha.4'), '5.0.0-alpha.5'); +}); + test('non-alpha version on alpha branch: 4.6.3 → 5.0.0-alpha.1 (bumps major, starts fresh)', () => { assert.strictEqual(nextAlphaVersion('4.6.3'), '5.0.0-alpha.1'); }); From 89c33e09b5ceba5cecababc87ee01817fbe31db0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 10:10:43 -0700 Subject: [PATCH 72/76] chore: release v4.8.1 (#4482) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3223f789..07306945a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ ## Change Log +### v4.8.1 (2026-07-26) + +#### Changes + +- [#4483](https://github.com/less/less.js/pull/4483) fix(release): sync release version from PR title (@matthew-dean) +- [#4479](https://github.com/less/less.js/pull/4479) fix: leave math functions for the browser when an argument is a runtime CSS var() (@Lfan-ke) +- [#4477](https://github.com/less/less.js/pull/4477) fix: forwarding an unset variadic no longer overrides callee defaults (@Lfan-ke) +- [#4474](https://github.com/less/less.js/pull/4474) chore: release v4.8.0 — deprecate legacy identifier forms and dynamic @charset (@app/github-actions) + + ### v4.8.0 (2026-07-22) #### Changes diff --git a/package.json b/package.json index 562c8177a..8d45d816e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.8.0", + "version": "4.8.1", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index aed84b5fd..b3092462a 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.8.0", + "version": "4.8.1", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index 84e3ff720..b08e158ff 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.8.0", + "version": "4.8.1", "description": "Less files and CSS results", "author": "Alexis Sellier <self@cloudhead.net>", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 58ed90987..2e9c3b8ae 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.8.0", + "version": "4.8.1", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier <self@cloudhead.net>", "contributors": [ From c303718bbd8f6cf31de6576738442c794da1d9b2 Mon Sep 17 00:00:00 2001 From: Matthew Dean <matthew-dean@users.noreply.github.com> Date: Thu, 30 Jul 2026 14:34:48 -0700 Subject: [PATCH 73/76] feat: support `[...]` lookups in `@{...}` interpolation (#4488) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support `[...]` lookups in `@{...}` interpolation Backports the Less 5.x behaviour of allowing a lookup chain inside variable interpolation, so `@{map[key]}` resolves wherever `@{name}` already does: selectors, property names, at-rule preludes and names, quoted strings, `url()` and `@import` paths. Chained (`@{map[a][b]}`), variable (`@{map[@k]}`), indirect (`@{map[@@k]}`) and empty (`@{map[]}`) keys are all supported. Previously these either failed to parse or — inside strings and `url()` — were emitted verbatim into the output with no error and no warning. The parser does not gain a lookup regex: `entities.variableCurly` now matches `@{` plus the name and delegates the chain to `parsers.mixin.ruleLookups()`, the same production the bare `@map[key]` form uses. Only the two eval-time string paths (`Quoted`, inline JS) need a pattern, and they share one definition rather than three hand-maintained copies — that duplication is what let `quoted.js` drift from `lookupValue` and cause the silent pass-through. `${...}` is deliberately left narrow. Properties have no lookup grammar (`entities.property` parses `$name` with no chaining) and nothing can hold a ruleset to look into, since `prop: { ... }` is a parse error in every scope. Also fixes three related defects: * A bare lookup in a structural position was exempt from the `variable-in-at-rule-prelude` deprecation. `entities.variable()` parses `@map[key]` into a `NamespaceValue`, and both warning sites tested only for `Variable`, so `@keyframes @map[key]`, `@supports @map[key]` and `@layer @map[key]` warned for a plain `@var` but stayed silent for a lookup. A lookup in a value position — `@supports (width: @map[key])` — correctly remains undeprecated. * `@supports (width: @map[key])` rendered as `(width: [key])`, dropping the variable. Unknown at-rule preludes are scanned as text, so a bare lookup reached the permissive regex, which matched only `@map` and left `[key]` behind. The resulting condition never parsed, so the block was dead in every browser; it now resolves. * Interpolation inside an unquoted `url(@{path}/x.png)` was never substituted. The body was raw text in an `Anonymous` node; text containing interpolation is now handed to an escaped `Quoted`, matching the quoted spelling. The `variable-in-unknown-value` notice is now tested against the text with interpolations stripped, so a variable key inside `@{map[@key]}` is no longer misreported as a bare use of the syntax the notice recommends adopting. * fix: preserve unquoted url escaping and keep `${...}` lookup-free Addresses two review findings. `URL.eval` escapes a rewritten rootpath only when the value is unquoted, so wrapping an interpolated unquoted `url()` body in a `Quoted` carrying a real quote character suppressed that escaping. With a rootpath containing `(`, `)` or whitespace it emitted `url(a(b)/x.png)` — malformed — where the non-interpolated spelling correctly produced `url(a\(b\)/x.png)`. The body is now built with an empty quote string, which reads as unquoted while still resolving interpolation. That alone was not enough: `Quoted.eval` rebuilt its result as `this.quote + value + this.quote` and re-derived the quote from that string, so an empty quote picked up the first character of the substituted value and read as quoted again. The quote is now carried across explicitly — a no-op for real quote characters, where the two already agree. `RULE_PROPERTY_PARTICLE` shared `[@$]` across both sigils, so `${name[key]}` was accepted as a property-name particle and reached `resolveInterpolatedProperty` with `name[key]`, producing a misleading undefined-property error for syntax the language does not define. The two sigils are now spelled out separately: lookup chains for `@{...}` only. Adds `tests-config/rootpath-escape-interpolation`, whose rootpath deliberately contains `(`, `)` and a space so quoted and unquoted forms cannot look alike, covering plain, interpolated and lookup bodies in both spellings. * test: run the error fixtures again The glob branch of `runTestSetInternal` admitted a `.less` file only when a sibling `.css` existed. Error fixtures declare their expectation as a `.txt` and never produce CSS, so every one of them was silently skipped — the file was globbed, failed the existence check, and was dropped without being counted. That covered 96 fixtures: 27 in tests-error/parse, 67 in tests-error/eval, and the js-type-errors and no-js-errors sets. The suite reported 136 passing tests and stayed green even when an expectation was edited to something impossible, so parse and eval error regressions went uncaught entirely. The check now accepts either expectation form. Verified both directions: breaking an expectation now fails the run (exit 1 with a named FAIL), where before it passed silently. Re-enabling the suite surfaced two stale expectations, both pre-existing drift rather than behaviour changes — `property-undefined` and `recursive-property` carried a trailing blank line that `err.toString()` does not produce. Stock 4.8.1 emits the same text as this branch for both, confirming the fixtures had drifted while dormant. Their trailing newline is corrected here. Also adds the parse fixture for `${name[key]}`, which is now enforceable. Test count goes from 136 to 233. * ci: test the declared node floor explicitly `packages/less` declares `engines.node: >=18`, but the oldest CI job tracked `lts/-3`. A relative selector drifts upward as new LTS lines ship, so the declared minimum stops being exercised the moment another line reaches LTS — silently, since nothing ties the matrix to the engines field. Pins that job to `18` so the supported floor is actually tested. * test: drop the pre-Node-16.9 type-error fixture `testTypeErrors` selected between two expectations with `semver.gte(process.version, 'v16.9.0')`. The two differ only in V8's wording change at 16.9 — `Cannot read property 'x' of undefined` became `Cannot read properties of undefined (reading 'x')` — so with `engines.node: >=18` the older `.txt` was unreachable on every supported runtime. The `-2` variant becomes the only expectation and the branch goes away. That leaves `semver` unused, so it is dropped from devDependencies too. Verified the fixture is genuinely enforced after the rename: editing its expectation fails the run, where the whole set was skipped entirely before the preceding commit re-enabled it. * fix: offset the synthetic url Quoted by currentIndex, and cover url mappings `entities.quoted()` and the `URL` node both build with `index + currentIndex`, but the synthetic `Quoted` for an interpolated unquoted body stored only the local `index`. Aligned for consistency. This is currently unobservable: `currentIndex` is non-zero only inside `parseNode`, and none of its three callers can reach `entities.url()` — two parse `['selector']`/`['selectors']`, and the third re-parses declaration values that were stored as `Anonymous`, which `anonymousValue` cannot produce for text containing `(`. The offset is correct regardless, and stops the node from being the odd one out if another caller appears. Adds a sourcemap fixture for url() values, which is the part that could have regressed: interpolated unquoted bodies now build a `Quoted` where they used to build an `Anonymous`, and the two differ in `genCSS` — `Anonymous` passes fileInfo and index to `output.add`, an escaped `Quoted` does not. Measured before adding it, the mapping structure is unchanged (an escaped `Quoted` contributes no segment of its own, and the enclosing declaration already carries the position). The fixture pins that, covering literal, interpolated, lookup and quoted-interpolated bodies side by side; the harness validates all four mappings against source. * test: run the sourcemap fixtures again `sourcemaps/basic` and `sourcemaps/custom-props` were skipped for the same reason the error fixtures were: the glob branch required a sibling `.css`, and these keep their expectation in `test/sourcemaps/*.json` via the set's `getFilename`. Neither had run since that gate was introduced. Generalises the previous fix rather than extending it — a fixture opts in by declaring an expectation in any of the three supported ways: a sibling `.css` for the default compile-and-diff, a sibling `.txt` for the error sets, or a `getFilename` that resolves one elsewhere. Both fixtures then failed on stale metadata, with mappings byte-identical: - Their config had drifted to `sourceMap: true`. The harness only fills in `sourceMapRootpath`/`sourceMapOutputFilename` when `sourceMap` is an object, so the `testweb/` prefix the expectations were written against disappeared. Restored to `{}`, which also matches the sibling sourcemaps-* sets. - The expectations still carried pre-monorepo paths, missing the `tests-config/` segment added when fixtures moved to `packages/test-data`. Regenerated; only `sources` and `file` change, the mappings are unchanged. `basic` validates 52 mappings and `custom-props` 1. Two fixtures remain skipped and are left alone: sourcemaps-disable-annotation and sourcemaps-variable-selector read `test/<name>.json`, a path layout that no longer exists, and both are named `basic.less`, so they would collide under the `test/sourcemaps/` convention. Fixing them needs a rename. * test: run the remaining sourcemap fixtures again Correcting the previous commit's note: the expectations for sourcemaps-disable-annotation and sourcemaps-variable-selector were not missing, and no rename was needed. They sit in their own directories under `packages/less/test/`, so there was never a collision — I had looked in `test/*.json` and `test/tests-config/` but not `test/sourcemaps-*/`. The real fault was path resolution. Both verifiers read `path.join('test/', name)`, but fixture names gained a leading `tests-config/` when the suite moved to packages/test-data, while the expectations stayed put. Resolution now strips that segment via a shared helper. With the paths fixed, the gate no longer needs to special-case them: a set with its own verifyFunction is trusted to locate and report its own expectation, so the `.css` requirement applies only to the default compile-and-diff. Both then failed on the same stale metadata as basic/custom-props, mappings byte-identical: `sourcemaps-variable-selector` had drifted to `sourceMap: true`, which skips the harness's `testweb/` defaults, and both expectations carried pre-monorepo paths. Config restored to `{}` and expectations regenerated — `sources` and `file` change, mappings do not. This also picks up the sourcemaps-variable-selector `vars` fixture. * fix(test): resolve sourcemap expectations on Windows `name` is assembled from `path.relative`, so its separators are platform native. Stripping the `tests-config/` prefix with a forward-slash-only pattern left it in place on Windows, and the two fixtures looked for an expectation under a path that has never existed — reported as an empty expected value rather than a missing file. Separators are normalised before the prefix is stripped. Verified against both spellings, including the mixed form `path.relative` actually produces there (`tests-config\set/basic`). --- .github/workflows/ci.yml | 5 +- .../less/lib/less/parser/lookup-pattern.js | 26 +++ packages/less/lib/less/parser/parser.js | 150 +++++++++++++++--- .../lib/less/tree/interpolated-variable.js | 106 +++++++++++++ packages/less/lib/less/tree/js-eval-node.js | 10 +- packages/less/lib/less/tree/quoted.js | 31 +++- packages/less/package.json | 1 - packages/less/test/less-test.js | 42 ++++- .../sourcemaps-disable-annotation/basic.json | 2 +- .../sourcemaps-variable-selector/basic.json | 2 +- packages/less/test/sourcemaps/basic.json | 2 +- .../less/test/sourcemaps/custom-props.json | 2 +- .../test/sourcemaps/url-interpolation.json | 1 + .../js-type-errors/js-type-error-2.txt | 4 - .../js-type-errors/js-type-error.txt | 2 +- .../rootpath-escape-interpolation.css | 8 + .../rootpath-escape-interpolation.less | 24 +++ .../styles.config.cjs | 8 + .../styles.config.cjs | 2 +- .../tests-config/sourcemaps/styles.config.cjs | 2 +- .../url-interpolation/styles.config.cjs | 9 ++ .../url-interpolation/url-interpolation.css | 13 ++ .../url-interpolation/url-interpolation.less | 24 +++ .../tests-error/eval/property-undefined.txt | 1 - .../tests-error/eval/recursive-property.txt | 1 - .../parse/property-interpolation-lookup.less | 8 + .../parse/property-interpolation-lookup.txt | 4 + .../at-rule-variable-deprecated.css | 38 +++++ .../at-rule-variable-deprecated.less | 70 ++++++++ .../lookup-interpolation.css | 60 +++++++ .../lookup-interpolation.less | 127 +++++++++++++++ pnpm-lock.yaml | 3 - 32 files changed, 732 insertions(+), 56 deletions(-) create mode 100644 packages/less/lib/less/parser/lookup-pattern.js create mode 100644 packages/less/lib/less/tree/interpolated-variable.js create mode 100644 packages/less/test/sourcemaps/url-interpolation.json delete mode 100644 packages/test-data/tests-config/js-type-errors/js-type-error-2.txt create mode 100644 packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.css create mode 100644 packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.less create mode 100644 packages/test-data/tests-config/rootpath-escape-interpolation/styles.config.cjs create mode 100644 packages/test-data/tests-config/sourcemaps/url-interpolation/styles.config.cjs create mode 100644 packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.css create mode 100644 packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.less create mode 100644 packages/test-data/tests-error/parse/property-interpolation-lookup.less create mode 100644 packages/test-data/tests-error/parse/property-interpolation-lookup.txt create mode 100644 packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.css create mode 100644 packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.less diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa1be8a14..513866ed5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,11 @@ jobs: node: 'lts/-1' - os: ubuntu-latest node: 'lts/-2' + # Pin the oldest job to the `engines.node` floor in packages/less. + # A relative `lts/-N` drifts upward as new LTS lines ship, so the + # declared minimum silently stops being tested. - os: ubuntu-latest - node: 'lts/-3' + node: '18' runs-on: ${{ matrix.os }} # This has copy/paste steps and should be refactored using DRY diff --git a/packages/less/lib/less/parser/lookup-pattern.js b/packages/less/lib/less/parser/lookup-pattern.js new file mode 100644 index 000000000..790e7ba6d --- /dev/null +++ b/packages/less/lib/less/parser/lookup-pattern.js @@ -0,0 +1,26 @@ +// @ts-check +/** + * Shared source-of-truth for the `[...]` lookup grammar. + * + * The parser consumes lookups structurally (`parsers.mixin.ruleLookups()`), but + * `Quoted` resolves interpolation by string replacement at eval time and so needs + * an equivalent regular expression. Keeping the pattern in one place is what stops + * the two from drifting apart — the drift is precisely why `@{map[key]}` used to be + * emitted verbatim instead of being substituted. + * + * A key mirrors `parsers.entities.lookupValue`: an optional `@`/`@@`/`$`/`$$` + * sigil followed by identifier characters. It may be empty (`@map[]` resolves to + * the last declaration). Critically the key pattern contains no brackets, so a + * lookup key can never itself be a lookup — `@{a[@b[c]]}` is not grammatical. + * A non-nesting regex is therefore exactly equivalent to the parsed grammar here + * rather than an approximation of it. + */ + +/** A single lookup key, e.g. `key`, `@key`, `@@key`, `$key`, or empty. */ +export const LOOKUP_KEY = '(?:[@$]{0,2})[_a-zA-Z0-9-]*'; + +/** Zero or more chained lookups, e.g. `[a]`, `[a][b]`, `[@a][]`. */ +export const LOOKUP_CHAIN = `(?:\\[${LOOKUP_KEY}\\])*`; + +/** A variable name followed by an optional lookup chain, e.g. `map[@a][b]`. */ +export const VARIABLE_WITH_LOOKUPS = `[\\w-]+${LOOKUP_CHAIN}`; diff --git a/packages/less/lib/less/parser/parser.js b/packages/less/lib/less/parser/parser.js index e87e97e97..d21096cd2 100644 --- a/packages/less/lib/less/parser/parser.js +++ b/packages/less/lib/less/parser/parser.js @@ -9,6 +9,28 @@ import logger from '../logger.js'; import { DeprecationHandler } from '../deprecation.js'; import Selector from '../tree/selector.js'; import Anonymous from '../tree/anonymous.js'; +import { VARIABLE_WITH_LOOKUPS } from './lookup-pattern.js'; +import { + splitLookups, + resolveInterpolatedVariable, + resolveInterpolatedProperty, + hasInterpolation, + VARIABLE_INTERPOLATION, + PROPERTY_INTERPOLATION +} from '../tree/interpolated-variable.js'; + +/** + * One particle of a property name: a literal chunk, an `@{...}` interpolation + * which may carry a lookup chain, or a `${...}` interpolation which may not. + * + * The sigils are spelled out separately rather than sharing `[@$]`: properties + * have no lookup grammar, so accepting `${name[key]}` here would hand `name[key]` + * to `resolveInterpolatedProperty` and produce a misleading "undefined property" + * error for syntax the language does not define. + */ +const RULE_PROPERTY_PARTICLE = new RegExp( + `^((?:[\\w-]+)|(?:@\\{${VARIABLE_WITH_LOOKUPS}\\})|(?:\\$\\{[\\w-]+\\}))` +); // // less.js - parser @@ -106,6 +128,22 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { warn('A bare @variable in an at-rule prelude is deprecated. Use @{variable} interpolation instead.', index, 'DEPRECATED', 'variable-in-at-rule-prelude'); } + /** + * Whether a parsed entity is a bare `@variable` reference in a structural + * position, and so subject to the interpolation deprecation. + * + * A lookup such as `@map[key]` is parsed by `entities.variable()` into a + * `NamespaceValue` wrapping a `VariableCall`, not a `Variable`. Testing for + * `Variable` alone silently exempted every bare lookup from the deprecation. + * + * @param {{ type?: string } | undefined | null} e + * @returns {boolean} + */ + function isBareVariableReference(e) { + if (!e) { return false; } + return e.type === 'Variable' || e.type === 'VariableCall' || e.type === 'NamespaceValue'; + } + /** * Numeric-leading variable names are a Less extension rather than valid CSS * identifier syntax. Keep accepting them through Less 4, but make the Less 5 @@ -717,6 +755,20 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { value = this.quoted() || this.variable() || this.property() || parserInput.$re(/^(?:(?:\\[()'"])|[^()'"])+/) || ''; + // An unquoted url() body is otherwise raw text wrapped in an + // Anonymous node, which never substitutes anything — so + // `url(@{path}/a.png)` used to emit the braces verbatim while the + // quoted form resolved. Hand text containing interpolation to an + // escaped Quoted so both spellings resolve identically. + // + // The empty quote string matters: `URL.eval` escapes a rewritten + // rootpath only for unquoted values, so a real quote character here + // would suppress that and emit `url(a(b)/x.png)` unescaped. Escaped + // means no quote is written to the output either way. + if (typeof value === 'string' && hasInterpolation(value)) { + value = new(tree.Quoted)('', value, true, index + currentIndex, fileInfo); + } + parserInput.autoCommentAbsorb = true; expectChar(')'); @@ -760,16 +812,44 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { parserInput.restore(); }, - // A variable entity using the protective {} e.g. @{var} + // A variable entity using the protective {} e.g. @{var}, optionally + // followed by a lookup chain e.g. @{map[key]} or @{map[@a][b]}. + // + // The chain is consumed by `mixin.ruleLookups()` rather than matched + // here, so the interpolated form shares one grammar with the bare + // `@map[key]` form instead of re-implementing it. variableCurly: function () { let curly; const index = parserInput.i; - if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { - warnNumericVariableName(curly[1], index); - warnDashOnlyVariableName(curly[1], index); - return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo); + if (parserInput.currentChar() !== '@') { + return; + } + + parserInput.save(); + if (!(curly = parserInput.$re(/^@\{([\w-]+)/))) { + parserInput.restore(); + return; } + + const name = curly[1]; + const lookups = parsers.mixin.ruleLookups(); + + if (!parserInput.$char('}')) { + parserInput.restore(); + return; + } + + parserInput.forget(); + warnNumericVariableName(name, index); + warnDashOnlyVariableName(name, index); + + if (!lookups) { + return new(tree.Variable)(`@${name}`, index + currentIndex, fileInfo); + } + + const call = new(tree.VariableCall)(`@${name}`, index + currentIndex, fileInfo); + return new(tree.NamespaceValue)(call, lookups, index + currentIndex, fileInfo); }, // // A Property accessor, such as `$color`, in @@ -1725,7 +1805,9 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { merge = !isVariable && name.length > 1 && name.pop().value; // Custom property values get permissive parsing - if (name[0].value && name[0].value.slice(0, 2) === '--') { + // A lookup particle (`NamespaceValue`) carries a node in `value` + // rather than a string, and can never spell a `--` prefix. + if (typeof name[0].value === 'string' && name[0].value.slice(0, 2) === '--') { if (parserInput.$char(';')) { value = new Anonymous(''); } else { @@ -1827,7 +1909,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (!e) { const varIndex = parserInput.i; e = this.entity(); - if (e && e.type === 'Variable') { + if (isBareVariableReference(e)) { warnBareAtRuleVariable(varIndex); } } @@ -1894,17 +1976,33 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { const quote = new tree.Quoted('\'', item, true, index, fileInfo); const variableRegex = /@([\w-]+)/g; const propRegex = /\$([\w-]+)/g; + // These notices are about *bare* references, so test the text + // with interpolations removed. A lookup key is itself allowed + // to be a variable (`@{map[@key]}`), and without this the + // `@key` inside the braces would be misreported as a bare use + // of the very syntax the notice tells you to adopt. + const bareOnly = item + .replace(VARIABLE_INTERPOLATION, '') + .replace(PROPERTY_INTERPOLATION, ''); // At-rule preludes are handled once above via // `value.bareVarIndex`; the `variable-in-unknown-value` // notice is for unknown declaration values only. - if (!deprecateVariables && variableRegex.test(item)) { + if (!deprecateVariables && variableRegex.test(bareOnly)) { warn('@variable in unknown values will not be evaluated as variables in the future. Use @{variable}', index, 'DEPRECATED', 'variable-in-unknown-value'); } - if (propRegex.test(item)) { + if (propRegex.test(bareOnly)) { warn('$property in unknown values will not be evaluated as property references in the future. Use ${property}', index, 'DEPRECATED', 'property-in-unknown-value'); } - quote.variableRegex = /@([\w-]+)|@{([\w-]+)}/g; - quote.propRegex = /\$([\w-]+)|\${([\w-]+)}/g; + // Both alternatives carry the lookup chain. An unknown at-rule + // prelude (`@supports`) is scanned as text, so a bare + // `@map[key]` reaches this regex rather than being parsed + // structurally; matching only `@map` would resolve it to the + // whole ruleset and leave `[key]` behind as literal text. + quote.variableRegex = new RegExp( + `@(${VARIABLE_WITH_LOOKUPS})|@\\{(${VARIABLE_WITH_LOOKUPS})\\}`, 'g' + ); + // Properties stay narrow — they have no lookup grammar. + quote.propRegex = /\$([\w-]+)|\$\{([\w-]+)\}/g; result.push(quote); } } @@ -2246,7 +2344,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { if (curly) { return curly; } const index = parserInput.i; const e = this.entity(); - if (e && e.type === 'Variable') { + if (isBareVariableReference(e)) { warnBareAtRuleVariable(index); } return e; @@ -2844,7 +2942,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { match(/^(\*?)/); while (true) { - if (!match(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/)) { + if (!match(RULE_PROPERTY_PARTICLE)) { break; } } @@ -2860,16 +2958,22 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { } for (k = 0; k < name.length; k++) { s = name[k]; - if (s.charAt(0) === '@') { - const variableName = s.slice(2, -1); - warnNumericVariableName(variableName, index[k]); - warnDashOnlyVariableName(variableName, index[k]); - } - name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ? - new(tree.Keyword)(s) : - (s.charAt(0) === '@' ? - new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) : - new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo)); + const sigil = s.charAt(0); + if (sigil !== '@' && sigil !== '$') { + name[k] = new(tree.Keyword)(s); + continue; + } + // `@{name}` / `@{name[key]}` — strip the sigil and braces, then + // let the shared resolver decide between a plain reference and + // a lookup so this path cannot drift from the others. + const raw = s.slice(2, -1); + if (sigil === '@') { + warnNumericVariableName(splitLookups(raw).name, index[k]); + warnDashOnlyVariableName(splitLookups(raw).name, index[k]); + name[k] = resolveInterpolatedVariable(raw, index[k] + currentIndex, fileInfo); + } else { + name[k] = resolveInterpolatedProperty(raw, index[k] + currentIndex, fileInfo); + } } return name; } diff --git a/packages/less/lib/less/tree/interpolated-variable.js b/packages/less/lib/less/tree/interpolated-variable.js new file mode 100644 index 000000000..3c6444cee --- /dev/null +++ b/packages/less/lib/less/tree/interpolated-variable.js @@ -0,0 +1,106 @@ +// @ts-check +/** @import { FileInfo } from './node.js' */ +/** @import Node from './node.js' */ +import Variable from './variable.js'; +import Property from './property.js'; +import VariableCall from './variable-call.js'; +import NamespaceValue from './namespace-value.js'; +import { LOOKUP_KEY, VARIABLE_WITH_LOOKUPS } from '../parser/lookup-pattern.js'; + +/** + * Interpolation resolved by string replacement at eval time. + * + * The parser consumes `@{name[key]}` structurally via `entities.variableCurly`, + * but `Quoted` and inline JavaScript hold their contents as raw text and can only + * substitute at eval time. Both share this module so the two evaluation paths build + * identical nodes from identical patterns. + */ + +/** Matches `@{name}` and `@{name[a][b]}`, capturing the reference. */ +export const VARIABLE_INTERPOLATION = new RegExp(`@\\{(${VARIABLE_WITH_LOOKUPS})\\}`, 'g'); + +/** + * Matches `${name}`, capturing the reference. + * + * Deliberately narrower than {@link VARIABLE_INTERPOLATION}: a lookup chain is not + * part of the property grammar. `entities.property` parses `$name` with no lookup + * handling, so `$map[key]` is a property reference followed by the literal text + * `[key]`, and a property cannot hold a ruleset to look into in the first place + * (`prop: { … }` is a parse error in every scope). Accepting `${map[key]}` here + * would invent syntax the language does not have. + */ +export const PROPERTY_INTERPOLATION = /\$\{([\w-]+)\}/g; + +const LOOKUP_SEGMENT = new RegExp(`\\[(${LOOKUP_KEY})\\]`, 'g'); + +// Non-global twins for membership tests. `RegExp.test` on a /g regex advances +// `lastIndex` and so returns alternating results across calls on shared instances. +const HAS_VARIABLE_INTERPOLATION = new RegExp(VARIABLE_INTERPOLATION.source); +const HAS_PROPERTY_INTERPOLATION = new RegExp(PROPERTY_INTERPOLATION.source); + +/** + * Whether text contains an `@{...}` or `${...}` interpolation. + * + * @param {string} text + * @returns {boolean} + */ +export function hasInterpolation(text) { + return HAS_VARIABLE_INTERPOLATION.test(text) || HAS_PROPERTY_INTERPOLATION.test(text); +} + +/** + * Split a `name[a][b]` reference into its name and lookup keys. + * + * `lookups` is null for a plain reference, so callers keep using the cheaper + * `Variable`/`Property` node when there is no lookup to resolve. + * + * @param {string} raw + * @returns {{ name: string, lookups: string[] | null }} + */ +export function splitLookups(raw) { + const open = raw.indexOf('['); + if (open === -1) { + return { name: raw, lookups: null }; + } + /** @type {string[]} */ + const lookups = []; + const re = new RegExp(LOOKUP_SEGMENT.source, 'g'); + let match; + while ((match = re.exec(raw)) !== null) { + lookups.push(match[1]); + } + return { name: raw.slice(0, open), lookups }; +} + +/** + * Build the node for an interpolated `@variable` reference, with or without lookups. + * + * @param {string} raw - the reference text inside `@{...}` + * @param {number} index + * @param {FileInfo} fileInfo + * @returns {Node} + */ +export function resolveInterpolatedVariable(raw, index, fileInfo) { + const { name, lookups } = splitLookups(raw); + if (!lookups) { + return new Variable(`@${name}`, index, fileInfo); + } + return new NamespaceValue( + new VariableCall(`@${name}`, index, fileInfo), lookups, index, fileInfo + ); +} + +/** + * Build the node for an interpolated `$property` reference. + * + * No lookup handling: see {@link PROPERTY_INTERPOLATION}. Properties have no lookup + * grammar, so `raw` is always a bare name here. + * + * @param {string} raw - the reference text inside `${...}` + * @param {number} index + * @param {FileInfo} fileInfo + * @returns {Node} + */ +export function resolveInterpolatedProperty(raw, index, fileInfo) { + return new Property(`$${raw}`, index, fileInfo); +} diff --git a/packages/less/lib/less/tree/js-eval-node.js b/packages/less/lib/less/tree/js-eval-node.js index 5732ecb9a..eb55ed075 100644 --- a/packages/less/lib/less/tree/js-eval-node.js +++ b/packages/less/lib/less/tree/js-eval-node.js @@ -2,6 +2,10 @@ /** @import { EvalContext } from './node.js' */ import Node from './node.js'; import Variable from './variable.js'; +import { + VARIABLE_INTERPOLATION, + resolveInterpolatedVariable +} from './interpolated-variable.js'; class JsEvalNode extends Node { /** @@ -21,8 +25,10 @@ class JsEvalNode extends Node { index: this.getIndex() }; } - expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) { - return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context)); + expression = expression.replace(VARIABLE_INTERPOLATION, function (_, raw) { + return that.jsify(resolveInterpolatedVariable( + raw, that.getIndex(), that.fileInfo() + ).eval(context)); }); /** @type {Function} */ diff --git a/packages/less/lib/less/tree/quoted.js b/packages/less/lib/less/tree/quoted.js index 9f786a810..53b41b4ad 100644 --- a/packages/less/lib/less/tree/quoted.js +++ b/packages/less/lib/less/tree/quoted.js @@ -1,8 +1,12 @@ // @ts-check /** @import { EvalContext, CSSOutput, FileInfo } from './node.js' */ import Node from './node.js'; -import Variable from './variable.js'; -import Property from './property.js'; +import { + VARIABLE_INTERPOLATION, + PROPERTY_INTERPOLATION, + resolveInterpolatedVariable, + resolveInterpolatedProperty +} from './interpolated-variable.js'; class Quoted extends Node { get type() { return 'Quoted'; } @@ -25,9 +29,9 @@ class Quoted extends Node { this._index = index; this._fileInfo = currentFileInfo; /** @type {RegExp} */ - this.variableRegex = /@\{([\w-]+)\}/g; + this.variableRegex = new RegExp(VARIABLE_INTERPOLATION.source, 'g'); /** @type {RegExp} */ - this.propRegex = /\$\{([\w-]+)\}/g; + this.propRegex = new RegExp(PROPERTY_INTERPOLATION.source, 'g'); /** @type {boolean | undefined} */ this.allowRoot = escaped; } @@ -62,7 +66,9 @@ class Quoted extends Node { * @returns {string} */ const variableReplacement = function (_, name1, name2) { - const v = new Variable(`@${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context); + const v = resolveInterpolatedVariable( + name1 ?? name2, that.getIndex(), that.fileInfo() + ).eval(context); return (v instanceof Quoted) ? /** @type {string} */ (v.value) : v.toCSS(context); }; /** @@ -72,7 +78,9 @@ class Quoted extends Node { * @returns {string} */ const propertyReplacement = function (_, name1, name2) { - const v = new Property(`$${name1 ?? name2}`, that.getIndex(), that.fileInfo()).eval(context); + const v = resolveInterpolatedProperty( + name1 ?? name2, that.getIndex(), that.fileInfo() + ).eval(context); return (v instanceof Quoted) ? /** @type {string} */ (v.value) : v.toCSS(context); }; /** @@ -91,7 +99,16 @@ class Quoted extends Node { } value = iterativeReplace(value, this.variableRegex, variableReplacement); value = iterativeReplace(value, this.propRegex, propertyReplacement); - return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); + const result = new Quoted( + this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo() + ); + // Carry the quote across rather than re-deriving it from the rebuilt string. + // For a real quote character the two agree, but an unquoted body (empty quote) + // is not round-trippable that way — it would pick up the first character of the + // substituted value and read as quoted, which suppresses rootpath escaping in + // `URL.eval`. + result.quote = this.quote; + return result; } /** diff --git a/packages/less/package.json b/packages/less/package.json index b3092462a..905104ac5 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -121,7 +121,6 @@ "resolve": "^1.17.0", "rollup": "^2.52.2", "rollup-plugin-terser": "^5.1.1", - "semver": "^6.3.0", "shx": "^0.3.2", "time-grunt": "^1.3.0", "typescript": "^5.7.0", diff --git a/packages/less/test/less-test.js b/packages/less/test/less-test.js index 20778441a..7c8d7c60e 100644 --- a/packages/less/test/less-test.js +++ b/packages/less/test/less-test.js @@ -2,7 +2,6 @@ import { createRequire } from 'module'; import path from 'path'; import fs from 'fs'; -import semver from 'semver'; import logger from '../lib/less/logger.js'; import { cosmiconfigSync } from 'cosmiconfig'; import { globSync } from 'glob'; @@ -246,6 +245,24 @@ export default function(testFilter) { }); } + /** + * Expectation path for the sourcemap sets that keep theirs under `test/`, + * mirroring the fixture's own directory. Fixture names gained a leading + * `tests-config/` when the suite moved to packages/test-data, but the + * expectations stayed where they were. + * + * `name` is built from `path.relative`, so its separators are platform + * native — matching only `/` here silently failed to strip the prefix on + * Windows and looked for an expectation that was never there. + * + * @param {string} name + * @returns {string} + */ + function sourcemapExpectationPath(name) { + var relative = name.replace(/[\\/]/g, '/').replace(/^tests-config\//, ''); + return path.join('test', relative) + '.json'; + } + function testSourcemapWithoutUrlAnnotation(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { if (err) { fail('ERROR: ' + (err && err.message)); @@ -257,7 +274,7 @@ export default function(testFilter) { return; } - fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) { + fs.readFile(sourcemapExpectationPath(name), 'utf8', function (e, expectedSourcemap) { process.stdout.write('- ' + path.join(baseFolder, name) + ': '); if (sourcemap === expectedSourcemap) { ok('OK'); @@ -295,7 +312,7 @@ export default function(testFilter) { return; } - fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) { + fs.readFile(sourcemapExpectationPath(name), 'utf8', function (e, expectedSourcemap) { process.stdout.write('- ' + path.join(baseFolder, name) + ': '); if (sourcemap === expectedSourcemap) { ok('OK'); @@ -368,8 +385,7 @@ export default function(testFilter) { } function testTypeErrors(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { - const fileSuffix = semver.gte(process.version, 'v16.9.0') ? '-2.txt' : '.txt'; - fs.readFile(path.join(baseFolder, name) + fileSuffix, 'utf8', function (e, expectedErr) { + fs.readFile(path.join(baseFolder, name) + '.txt', 'utf8', function (e, expectedErr) { process.stdout.write('- ' + path.join(baseFolder, name) + ': '); expectedErr = doReplacements(expectedErr, baseFolder, err && err.filename); if (!err) { @@ -534,8 +550,14 @@ export default function(testFilter) { var file = path.basename(filePath); var relativePath = path.relative(baseFolder, path.dirname(filePath)) + '/'; + // Only the default compile-and-diff needs a sibling `.css`; that is + // how such a fixture opts in. A set with its own verifyFunction keeps + // its expectation elsewhere — a `.txt` beside the source for the + // error sets, a `.json` under `test/` for the sourcemap sets — and + // reports a missing one itself. Requiring `.css` of those skipped + // them silently instead. var cssPath = path.join(path.dirname(filePath), path.basename(file, '.less') + '.css'); - if (fs.existsSync(cssPath)) { + if (verifyFunction || fs.existsSync(cssPath)) { processFileWithInfo({ file: file, fullPath: filePath, @@ -860,6 +882,14 @@ export default function(testFilter) { ['bare @var in an at-rule prelude warns', '@bar: x;\n@foo @bar { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], ['@var inside […] is top-level and warns', '@v: x;\n@foo bar[@v] { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], ['@var inside (…) is a declaration value — no warning', '@v: 1px;\n@foo (x: @v) { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 0], + // A bare lookup parses to NamespaceValue rather than Variable; testing the + // node type too narrowly used to exempt every one of these from the notice. + ['bare lookup in a @media prelude warns', '@m: { q: ~"(min-width: 1px)"; };\n@media @m[q] { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], + ['bare lookup in an at-rule name warns', '@m: { n: fade; };\n@keyframes @m[n] { from { a: b } }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], + ['bare lookup in an unknown at-rule prelude warns', '@m: { s: ~"(display: grid)"; };\n@supports @m[s] { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], + ['bare chained lookup warns once', '@m: { @n: { k: base; } };\n@layer @m[@n][k] { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 1], + ['interpolated lookup in a prelude does not warn', '@m: { q: ~"(min-width: 1px)"; };\n@media @{m[q]} { a: b }', {}, /A bare @variable in an at-rule prelude is deprecated/, 0], + ['interpolated lookup in an at-rule name does not warn', '@m: { n: fade; };\n@keyframes @{m[n]} { from { a: b } }', {}, /A bare @variable in an at-rule prelude is deprecated/, 0], ['numeric-leading variable names warn, including @{...}', '@1: name;\n.@{1} { value: name }', {}, /Variable names beginning with a number are deprecated/, 2], ['valid identifier-leading variable names do not warn', '@foo-1: name;\n.@{foo-1} { value: @foo-1 }', {}, /Variable names beginning with a number are deprecated/, 0], ['dash-only variable definitions and ordinary references warn', '@-: name;\n.a { value: @- }', {}, /dash-only variable names @- and @\{-\} are deprecated/, 2], diff --git a/packages/less/test/sourcemaps-disable-annotation/basic.json b/packages/less/test/sourcemaps-disable-annotation/basic.json index 7176dc6aa..7cc04883b 100644 --- a/packages/less/test/sourcemaps-disable-annotation/basic.json +++ b/packages/less/test/sourcemaps-disable-annotation/basic.json @@ -1 +1 @@ -{"version":3,"sources":["testweb/sourcemaps-disable-annotation/basic.less"],"names":[],"mappings":"AAAA;;EAEE,YAAA","file":"sourcemaps-disable-annotation/basic.css"} \ No newline at end of file +{"version":3,"sources":["testweb/basic.less"],"names":[],"mappings":"AAAA;;EAEE,YAAA","file":"tests-config/sourcemaps-disable-annotation/basic.css"} \ No newline at end of file diff --git a/packages/less/test/sourcemaps-variable-selector/basic.json b/packages/less/test/sourcemaps-variable-selector/basic.json index 9a454320f..035d01627 100644 --- a/packages/less/test/sourcemaps-variable-selector/basic.json +++ b/packages/less/test/sourcemaps-variable-selector/basic.json @@ -1 +1 @@ -{"version":3,"sources":["testweb/sourcemaps-variable-selector/basic.less"],"names":[],"mappings":"AAEC;EACG,eAAA","file":"sourcemaps-variable-selector/basic.css"} \ No newline at end of file +{"version":3,"sources":["testweb/basic.less"],"names":[],"mappings":"AAEC;EACG,eAAA","file":"tests-config/sourcemaps-variable-selector/basic.css"} \ No newline at end of file diff --git a/packages/less/test/sourcemaps/basic.json b/packages/less/test/sourcemaps/basic.json index 51372f313..989f2284c 100644 --- a/packages/less/test/sourcemaps/basic.json +++ b/packages/less/test/sourcemaps/basic.json @@ -1 +1 @@ -{"version":3,"sources":["testweb/sourcemaps/basic.less","testweb/sourcemaps/imported.css"],"names":[],"mappings":"AAMA;EACE,YAAA;EAJA,UAAA;EAWA,iBAAA;EALA,WAAA;EACA,iBAAA;;AAJF,EASE;AATF,EASM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;EAGA,UAAA;;AALN;AAAI;AAUJ;EATE,iBAAA;;AADF,EAEE;AAFE,EAEF;AAFF,EAEM;AAFF,EAEE;AAQN,OARE;AAQF,OARM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAQN,OARE,GAQF,UARE;AAQF,OARE,GAEI,KAFJ;AAQF,OARE,GAQF,UARM;AAQN,OARE,GAEI,KAFA;AAEF,EAFF,GAQF,UARE;AAEE,EAFF,GAQF,UARM;AAQN,OARM,GAQN,UARE;AAQF,OARM,GAEA,KAFJ;AAQF,OARM,GAQN,UARM;AAQN,OARM,GAEA,KAFA;AAEF,EAFE,GAQN,UARE;AAEE,EAFE,GAQN,UARM;EAGA,UAAA;;AAKN;EACE,WAAA;;ACxBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"sourcemaps/basic.css"} \ No newline at end of file +{"version":3,"sources":["testweb/basic.less","testweb/imported.css"],"names":[],"mappings":"AAMA;EACE,YAAA;EAJA,UAAA;EAWA,iBAAA;EALA,WAAA;EACA,iBAAA;;AAJF,EASE;AATF,EASM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;EAGA,UAAA;;AALN;AAAI;AAUJ;EATE,iBAAA;;AADF,EAEE;AAFE,EAEF;AAFF,EAEM;AAFF,EAEE;AAQN,OARE;AAQF,OARM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;AAEF,EAFE,GAEA,KAFA;AAQN,OARE,GAQF,UARE;AAQF,OARE,GAEI,KAFJ;AAQF,OARE,GAQF,UARM;AAQN,OARE,GAEI,KAFA;AAEF,EAFF,GAQF,UARE;AAEE,EAFF,GAQF,UARM;AAQN,OARM,GAQN,UARE;AAQF,OARM,GAEA,KAFJ;AAQF,OARM,GAQN,UARM;AAQN,OARM,GAEA,KAFA;AAEF,EAFE,GAQN,UARE;AAEE,EAFE,GAQN,UARM;EAGA,UAAA;;AAKN;EACE,WAAA;;ACxBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"tests-config/sourcemaps/basic.css"} \ No newline at end of file diff --git a/packages/less/test/sourcemaps/custom-props.json b/packages/less/test/sourcemaps/custom-props.json index cb6fb6abe..9640aab68 100644 --- a/packages/less/test/sourcemaps/custom-props.json +++ b/packages/less/test/sourcemaps/custom-props.json @@ -1 +1 @@ -{"version":3,"sources":["testweb/sourcemaps/custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,sBALO,UAKP","file":"sourcemaps/custom-props.css"} \ No newline at end of file +{"version":3,"sources":["testweb/custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,sBALO,UAKP","file":"tests-config/sourcemaps/custom-props.css"} \ No newline at end of file diff --git a/packages/less/test/sourcemaps/url-interpolation.json b/packages/less/test/sourcemaps/url-interpolation.json new file mode 100644 index 000000000..342caef24 --- /dev/null +++ b/packages/less/test/sourcemaps/url-interpolation.json @@ -0,0 +1 @@ +{"version":3,"sources":["url-interpolation.less"],"names":[],"mappings":"AASA;EACE,gCAAA;;AAGF;EACE,+BAAA;;AAGF;EACE,iCAAA;;AAGF;EACE,gBAAgB,kBAAhB","file":"url-interpolation.css"} diff --git a/packages/test-data/tests-config/js-type-errors/js-type-error-2.txt b/packages/test-data/tests-config/js-type-errors/js-type-error-2.txt deleted file mode 100644 index 83c675fc5..000000000 --- a/packages/test-data/tests-config/js-type-errors/js-type-error-2.txt +++ /dev/null @@ -1,4 +0,0 @@ -SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read properties of undefined (reading 'toJS')' in {path}js-type-error.less on line 2, column 8: -1 .scope { -2 var: `this.foo.toJS`; -3 } diff --git a/packages/test-data/tests-config/js-type-errors/js-type-error.txt b/packages/test-data/tests-config/js-type-errors/js-type-error.txt index 68e35ceb7..83c675fc5 100644 --- a/packages/test-data/tests-config/js-type-errors/js-type-error.txt +++ b/packages/test-data/tests-config/js-type-errors/js-type-error.txt @@ -1,4 +1,4 @@ -SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read property 'toJS' of undefined' in {path}js-type-error.less on line 2, column 8: +SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read properties of undefined (reading 'toJS')' in {path}js-type-error.less on line 2, column 8: 1 .scope { 2 var: `this.foo.toJS`; 3 } diff --git a/packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.css b/packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.css new file mode 100644 index 000000000..aeee55f4f --- /dev/null +++ b/packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.css @@ -0,0 +1,8 @@ +#rootpath-escape-interpolation { + plain-unquoted: url(http://example.com/a\(b\)\ c/relative/path); + interp-unquoted: url(http://example.com/a\(b\)\ c/images/path); + lookup-unquoted: url(http://example.com/a\(b\)\ c/images/path); + plain-quoted: url("http://example.com/a(b) c/relative/path"); + interp-quoted: url("http://example.com/a(b) c/images/path"); + lookup-quoted: url("http://example.com/a(b) c/images/path"); +} diff --git a/packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.less b/packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.less new file mode 100644 index 000000000..44b62dd96 --- /dev/null +++ b/packages/test-data/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.less @@ -0,0 +1,24 @@ +// A rewritten rootpath is escaped only for *unquoted* url() values, so the node +// produced for an interpolated unquoted body must not read as quoted. Giving it a +// real quote character suppressed the escaping and emitted the parentheses and +// space raw, producing a malformed url(). +// +// The rootpath here deliberately contains `(`, `)` and a space — the characters +// `escapePath` handles — so quoted and unquoted forms cannot look alike. + +@dir: images; +@paths: { + dir: images; +}; + +#rootpath-escape-interpolation { + // unquoted: rootpath must be escaped + plain-unquoted: url(relative/path); + interp-unquoted: url(@{dir}/path); + lookup-unquoted: url(@{paths[dir]}/path); + + // quoted: rootpath must not be escaped + plain-quoted: url("relative/path"); + interp-quoted: url("@{dir}/path"); + lookup-quoted: url("@{paths[dir]}/path"); +} diff --git a/packages/test-data/tests-config/rootpath-escape-interpolation/styles.config.cjs b/packages/test-data/tests-config/rootpath-escape-interpolation/styles.config.cjs new file mode 100644 index 000000000..e318b3a3b --- /dev/null +++ b/packages/test-data/tests-config/rootpath-escape-interpolation/styles.config.cjs @@ -0,0 +1,8 @@ +module.exports = { + language: { + less: { + "rootpath": "http://example.com/a(b) c/", + "rewriteUrls": "all" + } + } +}; diff --git a/packages/test-data/tests-config/sourcemaps-variable-selector/styles.config.cjs b/packages/test-data/tests-config/sourcemaps-variable-selector/styles.config.cjs index 48565f147..ec5ea5915 100644 --- a/packages/test-data/tests-config/sourcemaps-variable-selector/styles.config.cjs +++ b/packages/test-data/tests-config/sourcemaps-variable-selector/styles.config.cjs @@ -3,7 +3,7 @@ module.exports = { less: { math: 'strict', strictUnits: true, - sourceMap: true + sourceMap: {} } } }; diff --git a/packages/test-data/tests-config/sourcemaps/styles.config.cjs b/packages/test-data/tests-config/sourcemaps/styles.config.cjs index 757a09aee..02f7533f6 100644 --- a/packages/test-data/tests-config/sourcemaps/styles.config.cjs +++ b/packages/test-data/tests-config/sourcemaps/styles.config.cjs @@ -3,7 +3,7 @@ module.exports = { less: { math: 'strict', strictUnits: true, - sourceMap: true, + sourceMap: {}, globalVars: { '@my-color': 'red' } diff --git a/packages/test-data/tests-config/sourcemaps/url-interpolation/styles.config.cjs b/packages/test-data/tests-config/sourcemaps/url-interpolation/styles.config.cjs new file mode 100644 index 000000000..48565f147 --- /dev/null +++ b/packages/test-data/tests-config/sourcemaps/url-interpolation/styles.config.cjs @@ -0,0 +1,9 @@ +module.exports = { + language: { + less: { + math: 'strict', + strictUnits: true, + sourceMap: true + } + } +}; diff --git a/packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.css b/packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.css new file mode 100644 index 000000000..388ca3406 --- /dev/null +++ b/packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.css @@ -0,0 +1,13 @@ +.literal { + background: url(literal/one.png); +} +.interpolated { + background: url(images/two.png); +} +.interpolated-lookup { + background: url(assets/three.png); +} +.quoted-interpolated { + background: url("images/four.png"); +} +/*# sourceMappingURL=url-interpolation.css.map */ \ No newline at end of file diff --git a/packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.less b/packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.less new file mode 100644 index 000000000..c2487bdc0 --- /dev/null +++ b/packages/test-data/tests-config/sourcemaps/url-interpolation/url-interpolation.less @@ -0,0 +1,24 @@ +// Interpolated unquoted url() bodies are parsed into an escaped Quoted rather +// than the Anonymous node used for literal ones, so this pins that the swap does +// not change how url() values are mapped. All three spellings should keep the +// same mapping structure as each other. +@dir: images; +@paths: { + dir: assets; +}; + +.literal { + background: url(literal/one.png); +} + +.interpolated { + background: url(@{dir}/two.png); +} + +.interpolated-lookup { + background: url(@{paths[dir]}/three.png); +} + +.quoted-interpolated { + background: url("@{dir}/four.png"); +} diff --git a/packages/test-data/tests-error/eval/property-undefined.txt b/packages/test-data/tests-error/eval/property-undefined.txt index 2c1bb9b66..06dfe8b68 100644 --- a/packages/test-data/tests-error/eval/property-undefined.txt +++ b/packages/test-data/tests-error/eval/property-undefined.txt @@ -2,4 +2,3 @@ NameError: Property '$undefined-prop' is undefined in {path}property-undefined.l 1 .test { 2 value: $undefined-prop; 3 } - diff --git a/packages/test-data/tests-error/eval/recursive-property.txt b/packages/test-data/tests-error/eval/recursive-property.txt index e166c7b37..f0537df43 100644 --- a/packages/test-data/tests-error/eval/recursive-property.txt +++ b/packages/test-data/tests-error/eval/recursive-property.txt @@ -2,4 +2,3 @@ NameError: Error evaluating function `darken`: Recursive property reference for 1 .test { 2 color: darken($color, 10%); 3 } - diff --git a/packages/test-data/tests-error/parse/property-interpolation-lookup.less b/packages/test-data/tests-error/parse/property-interpolation-lookup.less new file mode 100644 index 000000000..a0803b13e --- /dev/null +++ b/packages/test-data/tests-error/parse/property-interpolation-lookup.less @@ -0,0 +1,8 @@ +// Properties have no lookup grammar: `entities.property` parses `$name` with no +// chaining, and nothing can hold a ruleset to look into. `${name[key]}` must +// therefore be rejected rather than reaching the property resolver, where it +// produced a misleading undefined-property error for undefined syntax. +.a { + color: red; + ${color[k]}: value; +} diff --git a/packages/test-data/tests-error/parse/property-interpolation-lookup.txt b/packages/test-data/tests-error/parse/property-interpolation-lookup.txt new file mode 100644 index 000000000..31dbdccee --- /dev/null +++ b/packages/test-data/tests-error/parse/property-interpolation-lookup.txt @@ -0,0 +1,4 @@ +ParseError: Unrecognised input in {path}property-interpolation-lookup.less on line 7, column 3: +6 color: red; +7 ${color[k]}: value; +8 } diff --git a/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css index 878775bf4..14baa164f 100644 --- a/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css +++ b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css @@ -43,3 +43,41 @@ color: red; } } +@media only screen and (max-width: 300px) { + .lookup-media { + width: 240px; + } +} +@keyframes shrinker { + from { + font-size: 15px; + } + to { + font-size: 12px; + } +} +@supports (display: grid) { + .lookup-supports { + display: grid; + } +} +@layer overrides { + .lookup-layered { + color: blue; + } +} +@media (min-width: 900px) { + .lookup-chained { + width: 900px; + } +} +@supports (width: 500px) { + .lookup-value-position { + width: 500px; + } +} +@supports (width: 900px) { + .lookup-value-position-chained { + width: 900px; + } +} diff --git a/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less index 8f0a81307..7e1f2f944 100644 --- a/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less +++ b/packages/test-data/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less @@ -74,3 +74,73 @@ color: red; } } + +// --- bare `[...]` lookups in the same structural positions --- +// A lookup parses into a NamespaceValue rather than a Variable. These were +// silently exempt from the deprecation until the node-type test was widened, +// so every position is covered explicitly here. +@lookup: { + query: ~"only screen and (max-width: 300px)"; + anim: shrinker; + supported: ~"(display: grid)"; + layer-name: overrides; + @deep: { + query: ~"(min-width: 900px)"; + } +}; + +@media @lookup[query] { + .lookup-media { + width: 240px; + } +} + +@keyframes @lookup[anim] { + from { font-size: 15px; } + to { font-size: 12px; } +} + +@supports @lookup[supported] { + .lookup-supports { + display: grid; + } +} + +@layer @lookup[layer-name] { + .lookup-layered { + color: blue; + } +} + +// chained lookup — still one deprecation, not one per segment +@media @lookup[@deep][query] { + .lookup-chained { + width: 900px; + } +} + +// A lookup in a declaration value inside `(...)` stays a value position and is +// not deprecated, mirroring the `@disp` case above. +// +// `@supports` scans its prelude as text, so a bare lookup reaches the permissive +// regex rather than being parsed structurally. Matching only `@values` used to +// resolve it to the whole ruleset and leave `[size]` behind, rendering +// `(width: [size])`. Both the flat and chained forms are covered here. +@values: { + size: 500px; + @deep: { + size: 900px; + } +}; + +@supports (width: @values[size]) { + .lookup-value-position { + width: 500px; + } +} + +@supports (width: @values[@deep][size]) { + .lookup-value-position-chained { + width: 900px; + } +} diff --git a/packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.css b/packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.css new file mode 100644 index 000000000..5278b0404 --- /dev/null +++ b/packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.css @@ -0,0 +1,60 @@ +.quoted { + single: "card"; + chained: "inner"; + quoted-value: "deep"; + indirect-key: "indirect-hit"; + empty-key: "tail"; + chained-empty-key: "nested-tail"; + surrounded: "a-card-b"; + twice: "card/blue"; +} +.url { + quoted: url("/assets/img/hero.png"); + unquoted: url(/assets/img/plain.png); + unquoted-plain: url(/plain/no-lookup.png); + untouched: url(/static/literal.png); + untouched-quoted: url("/static/literal.png"); + data-uri: url(data:image/svg+xml;base64,AAAA); +} +.property-interpolation { + color: red; + from-property: "red"; + surrounded: "a-red-b"; + bare: red; +} +.card { + a: b; +} +.inner { + c: d; +} +.property { + card: from-lookup; + inner: from-chained-lookup; +} +@keyframes card { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@media (min-width: 768px) { + .responsive { + e: f; + } +} +.custom-property { + --from-lookup: /assets/img; + --from-chained: inner; +} +.recursive { + g: "card"; +} +.plain { + h: "name"; +} +.name { + i: j; +} diff --git a/packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.less b/packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.less new file mode 100644 index 000000000..d40b91162 --- /dev/null +++ b/packages/test-data/tests-unit/lookup-interpolation/lookup-interpolation.less @@ -0,0 +1,127 @@ +// `[...]` lookups inside `@{...}` interpolation, backported from Less 5.x. +// +// Before the backport the parser accepted only `@{name}`, so every form below +// either failed to parse or — in string and url positions — silently emitted the +// interpolation verbatim into the output. The url/quoted cases in particular are +// regression coverage for that silent pass-through: a wrong-output bug that +// produced no error and no warning. +// +// The bare `@map[key]` spelling is covered by at-rule-variable-deprecated.less, +// where it is deprecated in structural positions. + +@sizes: { + tablet: 768px; + name: card; + @name: indirect-hit; + last-entry: tail; +}; + +@theme: { + color: blue; + @nested: { + name: inner; + label: "deep"; + last-entry: nested-tail; + } +}; + +@paths: { + img: "/assets/img"; +}; + +@which: name; + +// --- quoted strings --- +.quoted { + single: "@{sizes[name]}"; + chained: "@{theme[@nested][name]}"; + quoted-value: "@{theme[@nested][label]}"; + indirect-key: "@{sizes[@@which]}"; + empty-key: "@{sizes[]}"; + chained-empty-key: "@{theme[@nested][]}"; + surrounded: "a-@{sizes[name]}-b"; + twice: "@{sizes[name]}/@{theme[color]}"; +} + +// --- url() — the silent pass-through regression --- +// An unquoted url() body was raw text in an Anonymous node, so neither the plain +// nor the lookup interpolation resolved there while the quoted form did. Both +// spellings are covered so the two cannot diverge again. +@plain-path: "/plain"; + +.url { + quoted: url("@{paths[img]}/hero.png"); + unquoted: url(@{paths[img]}/plain.png); + unquoted-plain: url(@{plain-path}/no-lookup.png); + untouched: url(/static/literal.png); + untouched-quoted: url("/static/literal.png"); + data-uri: url(data:image/svg+xml;base64,AAAA); +} + +// --- ${...} property interpolation --- +// Properties have no lookup grammar: `$name[key]` is a property reference followed +// by literal `[key]`, and `prop: { … }` is a parse error in every scope, so nothing +// can hold a ruleset to look into. `${...}` therefore stays narrow while `@{...}` +// carries lookups, and the plain form must keep working unchanged. +.property-interpolation { + color: red; + from-property: "${color}"; + surrounded: "a-${color}-b"; + bare: $color; +} + +// --- selector interpolation --- +.@{sizes[name]} { + a: b; +} + +.@{theme[@nested][name]} { + c: d; +} + +// --- property name interpolation --- +.property { + @{sizes[name]}: from-lookup; + @{theme[@nested][name]}: from-chained-lookup; +} + +// --- at-rule name and prelude --- +@keyframes @{sizes[name]} { + from { opacity: 0; } + to { opacity: 1; } +} + +@queries: { + tablet: ~"(min-width: 768px)"; +}; + +@media @{queries[tablet]} { + .responsive { + e: f; + } +} + +// --- custom property values --- +.custom-property { + --from-lookup: @{paths[img]}; + --from-chained: @{theme[@nested][name]}; +} + +// --- interpolation still resolves to a fixpoint --- +// The inner `@{...}` arrives from a variable's value at eval time, so it is not +// present in the source text of the outer reference. +@inner: card; +@outer: ~"@{inner}"; + +.recursive { + g: "@{outer}"; +} + +// --- plain interpolation is unaffected by the lookup support --- +.plain { + h: "@{which}"; +} + +.@{which} { + i: j; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64ae7df14..2c6cef24d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -202,9 +202,6 @@ importers: rollup-plugin-terser: specifier: ^5.1.1 version: 5.3.1(rollup@2.80.0) - semver: - specifier: ^6.3.0 - version: 6.3.1 shx: specifier: ^0.3.2 version: 0.3.4 From 4eb6d3bd5579d7d647869d7e3e42a16dc85502fb Mon Sep 17 00:00:00 2001 From: snowyukitty <snowyukitty@outlook.com> Date: Fri, 14 Aug 2026 03:04:21 +0900 Subject: [PATCH 74/76] fix: prevent reparsing escape() results (#4486) Co-authored-by: snowyukitty <270071858+snowyukitty@users.noreply.github.com> --- packages/less/lib/less/functions/string.js | 9 ++++++--- packages/less/lib/less/tree/anonymous.js | 6 +++++- packages/less/lib/less/tree/ruleset.js | 4 +++- packages/test-data/tests-unit/functions/functions.css | 2 ++ packages/test-data/tests-unit/functions/functions.less | 3 +++ 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/less/lib/less/functions/string.js b/packages/less/lib/less/functions/string.js index b4de36356..ceba018a8 100644 --- a/packages/less/lib/less/functions/string.js +++ b/packages/less/lib/less/functions/string.js @@ -7,9 +7,12 @@ export default { return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true); }, escape: function (str) { - return new Anonymous( - encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B') - .replace(/\(/g, '%28').replace(/\)/g, '%29')); + const escapedValue = encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B') + .replace(/\(/g, '%28').replace(/\)/g, '%29'); + const escaped = new Anonymous(escapedValue); + // Percent escapes are literal CSS, not Less source. + escaped._preventReparse = escapedValue.includes('%'); + return escaped; }, replace: function (string, pattern, replacement, flags) { let result = string.value; diff --git a/packages/less/lib/less/tree/anonymous.js b/packages/less/lib/less/tree/anonymous.js index f87134e54..e0bdd4484 100644 --- a/packages/less/lib/less/tree/anonymous.js +++ b/packages/less/lib/less/tree/anonymous.js @@ -20,13 +20,17 @@ class Anonymous extends Node { this._fileInfo = currentFileInfo; this.mapLines = mapLines; this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; + /** @type {boolean} */ + this._preventReparse = false; this.allowRoot = true; this.copyVisibilityInfo(visibilityInfo); } /** @returns {Anonymous} */ eval() { - return new Anonymous(/** @type {string | null} */ (this.value), this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); + const anonymous = new Anonymous(/** @type {string | null} */ (this.value), this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); + anonymous._preventReparse = this._preventReparse; + return anonymous; } /** diff --git a/packages/less/lib/less/tree/ruleset.js b/packages/less/lib/less/tree/ruleset.js index 1e4b7c0e2..26625a93c 100644 --- a/packages/less/lib/less/tree/ruleset.js +++ b/packages/less/lib/less/tree/ruleset.js @@ -426,7 +426,9 @@ class Ruleset extends Node { const self = this; /** @param {Declaration} decl */ function transformDeclaration(decl) { - if (decl.value instanceof Anonymous && !/** @type {Declaration & { parsed?: boolean }} */ (decl).parsed) { + if (decl.value instanceof Anonymous && + !decl.value._preventReparse && + !/** @type {Declaration & { parsed?: boolean }} */ (decl).parsed) { if (typeof decl.value.value === 'string') { new (/** @type {new (...args: [EvalContext, object, FileInfo, number]) => { parseNode: Function }} */ (/** @type {unknown} */ (Parser)))(/** @type {{ context: EvalContext, importManager: object }} */ (/** @type {Ruleset} */ (this).parse).context, /** @type {{ context: EvalContext, importManager: object }} */ (/** @type {Ruleset} */ (this).parse).importManager, decl.fileInfo(), decl.value.getIndex()).parseNode( decl.value.value, diff --git a/packages/test-data/tests-unit/functions/functions.css b/packages/test-data/tests-unit/functions/functions.css index 970f8d80e..723b97dc8 100644 --- a/packages/test-data/tests-unit/functions/functions.css +++ b/packages/test-data/tests-unit/functions/functions.css @@ -8,6 +8,8 @@ } #built-in { escaped: -Some::weird(#thing, y); + escaped-direct: a%20b%28c%29%3Dd%3Ae%23f%3Bg; + escaped-svg-literal: url("data:image/svg+xml,%3Csvg%20fill%3D%22red%22%3E%3C/svg%3E"); lighten: #ffcccc; lighten-relative: #ff6666; darken: #330000; diff --git a/packages/test-data/tests-unit/functions/functions.less b/packages/test-data/tests-unit/functions/functions.less index b0ecbfa68..fa56935f2 100644 --- a/packages/test-data/tests-unit/functions/functions.less +++ b/packages/test-data/tests-unit/functions/functions.less @@ -11,7 +11,10 @@ #built-in { @r: 32; + @escaped-svg-literal: escape('<svg fill="red"></svg>'); escaped: e("-Some::weird(#thing, y)"); + escaped-direct: escape('a b(c)=d:e#f;g'); + escaped-svg-literal: url("data:image/svg+xml,@{escaped-svg-literal}"); lighten: lighten(#ff0000, 40%); lighten-relative: lighten(#ff0000, 40%, relative); darken: darken(#ff0000, 40%); From 088ad67f9465d654f4f430c5b078780bd87c0136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BE=E5=8F=AF?= <leo-cheng@vip.qq.com> Date: Fri, 14 Aug 2026 02:06:51 +0800 Subject: [PATCH 75/76] fix: keep the media type first when flattening nested @media queries (#4481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com> --- packages/less/lib/less/tree/nested-at-rule.js | 41 +++++++++++++++ .../media-nested-type/media-nested-type.css | 40 +++++++++++++++ .../media-nested-type/media-nested-type.less | 51 +++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 packages/test-data/tests-unit/media-nested-type/media-nested-type.css create mode 100644 packages/test-data/tests-unit/media-nested-type/media-nested-type.less diff --git a/packages/less/lib/less/tree/nested-at-rule.js b/packages/less/lib/less/tree/nested-at-rule.js index 4d3860839..6eab3339d 100644 --- a/packages/less/lib/less/tree/nested-at-rule.js +++ b/packages/less/lib/less/tree/nested-at-rule.js @@ -37,6 +37,40 @@ import Node from './node.js'; * }} NestableAtRuleThis */ +// A media query may only carry a media type at its front, before any +// conditions (https://drafts.csswg.org/mediaqueries-5/#typedef-media-query-list). +// Operators that join media-query parts, so a fragment leading with one is not +// a media type. Any other bare identifier is treated as a type, since unknown +// media types are valid non-matches in CSS, not syntax errors. +const MEDIA_QUERY_OPERATORS = ['and', 'or']; + +/** + * Whether a flattened media-query fragment leads with a media type, e.g. + * `screen`, `only screen`, `print and (color)` or an unknown type like `foo`. + * @param {Node & { value?: * }} fragment + */ +function startsWithMediaType(fragment) { + let head; + if (fragment.type === 'Keyword' || fragment.type === 'Anonymous') { + head = fragment.value; + } else if (fragment.type === 'Expression' && Array.isArray(fragment.value)) { + const parts = fragment.value.filter(p => p && p.value !== undefined); + let idx = 0; + const first = parts[idx] && String(parts[idx].value).toLowerCase(); + if (first === 'not' || first === 'only') { idx++; } + head = parts[idx] && parts[idx].value; + } + if (typeof head !== 'string' || head === '') { + return false; + } + // Inspect only the first token. A media type is a bare identifier; a feature + // condition begins with '(' - e.g. an escaped ~"(max-width: 1px)" is an + // Anonymous whose whole value is "(max-width: 1px)", which is not a media type. + const firstToken = head.trim().split(/[\s(]/)[0]; + return firstToken !== '' + && MEDIA_QUERY_OPERATORS.indexOf(firstToken.toLowerCase()) < 0; +} + const NestableAtRulePrototype = { isRulesetLike() { @@ -149,6 +183,13 @@ const NestableAtRulePrototype = { /** @param {Node & { toCSS?: Function }} fragment */ fragment => fragment.toCSS ? fragment : new Anonymous(/** @type {string} */ (/** @type {unknown} */ (fragment)))); + // A media type nested inside conditions must move ahead of them + // so the flattened query stays valid (issue #3694, #3764). + const types = /** @type {Node[]} */ (path).filter(startsWithMediaType); + if (types.length && types.length < /** @type {Node[]} */ (path).length) { + path = types.concat(/** @type {Node[]} */ (path).filter(f => !startsWithMediaType(f))); + } + for (i = /** @type {Node[]} */ (path).length - 1; i > 0; i--) { /** @type {Node[]} */ (path).splice(i, 0, new Anonymous('and')); } diff --git a/packages/test-data/tests-unit/media-nested-type/media-nested-type.css b/packages/test-data/tests-unit/media-nested-type/media-nested-type.css new file mode 100644 index 000000000..adec56722 --- /dev/null +++ b/packages/test-data/tests-unit/media-nested-type/media-nested-type.css @@ -0,0 +1,40 @@ +@media screen and (max-width: 500px) { + .a { + color: red; + } +} +@media only screen and (min-width: 100px) { + .b { + color: blue; + } +} +@media all and (max-width: 9px) { + .c { + color: green; + } +} +@media print and (color) and (min-width: 1px) { + .d { + color: black; + } +} +@media screen and (max-width: 500px) { + .e { + color: red; + } +} +@media (max-width: 500px) and (min-width: 100px) { + .f { + color: red; + } +} +@media tester and (max-width: 500px) { + .g { + color: red; + } +} +@media screen and (max-width: 500px) { + .h { + color: red; + } +} diff --git a/packages/test-data/tests-unit/media-nested-type/media-nested-type.less b/packages/test-data/tests-unit/media-nested-type/media-nested-type.less new file mode 100644 index 000000000..df9b62a35 --- /dev/null +++ b/packages/test-data/tests-unit/media-nested-type/media-nested-type.less @@ -0,0 +1,51 @@ +// A media type nested inside conditions must lead the flattened query, +// otherwise the result is invalid CSS (issue #3694, #3764). +@media (max-width: 500px) { + @media screen { + .a { color: red; } + } +} +@media (min-width: 100px) { + @media only screen { + .b { color: blue; } + } +} +@media (max-width: 9px) { + @media all { + .c { color: green; } + } +} +@media (min-width: 1px) { + @media print and (color) { + .d { color: black; } + } +} + +// Already-correct ordering is preserved. +@media screen { + @media (max-width: 500px) { + .e { color: red; } + } +} + +// Queries without a media type are left untouched. +@media (max-width: 500px) { + @media (min-width: 100px) { + .f { color: red; } + } +} + +// Unknown media types are valid CSS non-matches, so they reorder too. +@media (max-width: 500px) { + @media tester { + .g { color: red; } + } +} + +// An escaped-string feature condition (Anonymous) must not be mistaken for a media type. +@fc: ~"(max-width: 500px)"; +@media @fc { + @media screen { + .h { color: red; } + } +} From 7499bbd6bfd286e09e851c6ecdcca46c936a5644 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Aug 2026 14:32:43 -0700 Subject: [PATCH 76/76] chore: release v4.9.0 (#4489) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- packages/less/package.json | 2 +- packages/test-data/package.json | 2 +- packages/test-import-module/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07306945a..320c45740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## Change Log +### v4.9.0 (2026-08-13) + +#### Changes + +- [#4488](https://github.com/less/less.js/pull/4488) feat: support `[...]` lookups in `@{...}` interpolation (@matthew-dean) +- [#4486](https://github.com/less/less.js/pull/4486) fix: prevent reparsing escape() results (@snowyukitty) +- [#4481](https://github.com/less/less.js/pull/4481) fix: keep the media type first when flattening nested @media queries (@Lfan-ke) + + ### v4.8.1 (2026-07-26) #### Changes diff --git a/package.json b/package.json index 8d45d816e..d864e1418 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@less/root", "private": true, - "version": "4.8.1", + "version": "4.9.0", "description": "Less monorepo", "homepage": "http://lesscss.org", "scripts": { diff --git a/packages/less/package.json b/packages/less/package.json index 905104ac5..bf66980f4 100644 --- a/packages/less/package.json +++ b/packages/less/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "4.8.1", + "version": "4.9.0", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/packages/test-data/package.json b/packages/test-data/package.json index b08e158ff..51f40bca6 100644 --- a/packages/test-data/package.json +++ b/packages/test-data/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "4.8.1", + "version": "4.9.0", "description": "Less files and CSS results", "author": "Alexis Sellier <self@cloudhead.net>", "contributors": [ diff --git a/packages/test-import-module/package.json b/packages/test-import-module/package.json index 2e9c3b8ae..745b5c211 100644 --- a/packages/test-import-module/package.json +++ b/packages/test-import-module/package.json @@ -1,7 +1,7 @@ { "name": "@less/test-import-module", "private": true, - "version": "4.8.1", + "version": "4.9.0", "description": "Less files to be included in node_modules directory for testing import from node_modules", "author": "Alexis Sellier <self@cloudhead.net>", "contributors": [