@stylable/core
Version:
CSS for Components
4 lines • 1.59 MB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../node_modules/picocolors/picocolors.browser.js", "../../../node_modules/postcss/lib/css-syntax-error.js", "../../../node_modules/postcss/lib/symbols.js", "../../../node_modules/postcss/lib/stringifier.js", "../../../node_modules/postcss/lib/stringify.js", "../../../node_modules/postcss/lib/node.js", "../../../node_modules/postcss/lib/declaration.js", "../../../node_modules/@file-services/path/browser-path.js", "../../../node_modules/nanoid/non-secure/index.cjs", "../../../node_modules/postcss/lib/previous-map.js", "../../../node_modules/postcss/lib/input.js", "../../../node_modules/postcss/lib/map-generator.js", "../../../node_modules/postcss/lib/comment.js", "../../../node_modules/postcss/lib/container.js", "../../../node_modules/postcss/lib/document.js", "../../../node_modules/postcss/lib/warn-once.js", "../../../node_modules/postcss/lib/warning.js", "../../../node_modules/postcss/lib/result.js", "../../../node_modules/postcss/lib/tokenize.js", "../../../node_modules/postcss/lib/at-rule.js", "../../../node_modules/postcss/lib/root.js", "../../../node_modules/postcss/lib/list.js", "../../../node_modules/postcss/lib/rule.js", "../../../node_modules/postcss/lib/parser.js", "../../../node_modules/postcss/lib/parse.js", "../../../node_modules/postcss/lib/lazy-result.js", "../../../node_modules/postcss/lib/no-work-result.js", "../../../node_modules/postcss/lib/processor.js", "../../../node_modules/postcss/lib/fromJSON.js", "../../../node_modules/postcss/lib/postcss.js", "../../../node_modules/postcss-selector-parser/dist/util/unesc.js", "../../../node_modules/postcss-selector-parser/dist/util/getProp.js", "../../../node_modules/postcss-selector-parser/dist/util/ensureObject.js", "../../../node_modules/postcss-selector-parser/dist/util/stripComments.js", "../../../node_modules/postcss-selector-parser/dist/util/index.js", "../../../node_modules/postcss-selector-parser/dist/selectors/node.js", "../../../node_modules/postcss-selector-parser/dist/selectors/types.js", "../../../node_modules/postcss-selector-parser/dist/selectors/container.js", "../../../node_modules/postcss-selector-parser/dist/selectors/root.js", "../../../node_modules/postcss-selector-parser/dist/selectors/selector.js", "../../../node_modules/cssesc/cssesc.js", "../../../node_modules/postcss-selector-parser/dist/selectors/className.js", "../../../node_modules/postcss-selector-parser/dist/selectors/comment.js", "../../../node_modules/postcss-selector-parser/dist/selectors/id.js", "../../../node_modules/postcss-selector-parser/dist/selectors/namespace.js", "../../../node_modules/postcss-selector-parser/dist/selectors/tag.js", "../../../node_modules/postcss-selector-parser/dist/selectors/string.js", "../../../node_modules/postcss-selector-parser/dist/selectors/pseudo.js", "../../../node_modules/util-deprecate/browser.js", "../../../node_modules/postcss-selector-parser/dist/selectors/attribute.js", "../../../node_modules/postcss-selector-parser/dist/selectors/universal.js", "../../../node_modules/postcss-selector-parser/dist/selectors/combinator.js", "../../../node_modules/postcss-selector-parser/dist/selectors/nesting.js", "../../../node_modules/postcss-selector-parser/dist/sortAscending.js", "../../../node_modules/postcss-selector-parser/dist/tokenTypes.js", "../../../node_modules/postcss-selector-parser/dist/tokenize.js", "../../../node_modules/postcss-selector-parser/dist/parser.js", "../../../node_modules/postcss-selector-parser/dist/processor.js", "../../../node_modules/postcss-selector-parser/dist/selectors/constructors.js", "../../../node_modules/postcss-selector-parser/dist/selectors/guards.js", "../../../node_modules/postcss-selector-parser/dist/selectors/index.js", "../../../node_modules/postcss-selector-parser/dist/index.js", "../../../node_modules/postcss-nested/index.js", "../../../node_modules/camelcase-css/index-es5.js", "../../../node_modules/postcss-js/objectifier.js", "../../../node_modules/postcss-js/parser.js", "../../../node_modules/postcss-js/process-result.js", "../../../node_modules/postcss-js/async.js", "../../../node_modules/postcss-js/sync.js", "../../../node_modules/postcss-js/index.js", "../../../node_modules/postcss-safe-parser/lib/safe-parser.js", "../../../node_modules/postcss-safe-parser/lib/safe-parse.js", "../../../node_modules/@tokey/core/dist/types.js", "../../../node_modules/@tokey/core/src/core.ts", "../../../node_modules/@tokey/core/src/helpers.ts", "../../../node_modules/@tokey/core/src/seeker.ts", "../../../node_modules/@tokey/core/src/index.ts", "../../../node_modules/@tokey/css-selector-parser/src/tokenizer.ts", "../../../node_modules/@tokey/css-selector-parser/src/helpers.ts", "../../../node_modules/@tokey/css-selector-parser/src/nth-parser.ts", "../../../node_modules/@tokey/css-selector-parser/src/selector-parser.ts", "../../../node_modules/@tokey/css-selector-parser/dist/ast-types.js", "../../../node_modules/@tokey/css-selector-parser/src/stringify.ts", "../../../node_modules/@tokey/css-selector-parser/src/ast-tools/walk.ts", "../../../node_modules/@tokey/css-selector-parser/src/ast-tools/compound.ts", "../../../node_modules/@tokey/css-selector-parser/src/ast-tools/specificity.ts", "../../../node_modules/@tokey/css-selector-parser/src/index.ts", "../../../node_modules/lodash.clonedeep/index.js", "../../../node_modules/@tokey/imports-parser/src/imports-parser.ts", "../../../node_modules/postcss-value-parser/lib/parse.js", "../../../node_modules/postcss-value-parser/lib/walk.js", "../../../node_modules/postcss-value-parser/lib/stringify.js", "../../../node_modules/postcss-value-parser/lib/unit.js", "../../../node_modules/postcss-value-parser/lib/index.js", "../../../node_modules/lodash.clonedeepwith/index.js", "../../../node_modules/fastparse/lib/Parser.js", "../../../node_modules/css-selector-tokenizer/lib/uni-regexp.js", "../../../node_modules/css-selector-tokenizer/lib/parse.js", "../../../node_modules/css-selector-tokenizer/lib/stringify.js", "../../../node_modules/css-selector-tokenizer/lib/parseValues.js", "../../../node_modules/css-selector-tokenizer/lib/stringifyValues.js", "../../../node_modules/css-selector-tokenizer/lib/index.js", "../../../node_modules/@tokey/css-value-parser/src/ast-types.ts", "../../../node_modules/@tokey/css-value-parser/src/units.ts", "../../../node_modules/@tokey/css-value-parser/src/tokenizer.ts", "../../../node_modules/@tokey/css-value-parser/src/value-stringify.ts", "../../../node_modules/@tokey/css-value-parser/src/value-parser.ts", "../../../node_modules/@tokey/css-value-parser/src/define-property.ts", "../../../node_modules/@tokey/css-value-parser/src/properties/background.ts", "../../../node_modules/@tokey/css-value-parser/src/properties/margin.ts", "../../../node_modules/@tokey/css-value-parser/src/value-syntax-parser.ts", "../../../node_modules/@tokey/css-value-parser/src/index.ts", "../../../node_modules/vendor-prefixes/index.js", "../../../node_modules/is-vendor-prefixed/index.js", "../src/cached-process-file.ts", "../../../node_modules/postcss/lib/postcss.mjs", "../src/parser.ts", "../../../node_modules/postcss-js/index.mjs", "../src/diagnostics.ts", "../src/native-reserved-lists.ts", "../src/stylable-utils.ts", "../src/helpers/selector.ts", "../src/helpers/rule.ts", "../src/helpers/custom-selector.ts", "../src/features/st-symbol.ts", "../src/features/feature.ts", "../src/helpers/plugable-record.ts", "../src/features/st-import.ts", "../src/features/diagnostics.ts", "../src/helpers/import.ts", "../src/helpers/string.ts", "../src/helpers/css-custom-property.ts", "../src/features/st-namespace.ts", "../src/murmurhash.ts", "../src/features/st-global.ts", "../src/features/st-scope.ts", "../src/features/st-var.ts", "../src/custom-values.ts", "../src/helpers/value.ts", "../src/stylable-resolver.ts", "../src/functions.ts", "../src/stylable-assets.ts", "../src/process-declaration-functions.ts", "../src/helpers/escape.ts", "../src/features/st-custom-selector.ts", "../src/features/st-custom-state.ts", "../src/helpers/custom-state.ts", "../src/helpers/css-value-seeker.ts", "../src/features/st-mixin.ts", "../src/helpers/mixin.ts", "../src/features/css-class.ts", "../src/helpers/resolve.ts", "../src/helpers/namespace.ts", "../src/features/css-type.ts", "../src/features/css-pseudo-class.ts", "../src/features/css-custom-property.ts", "../src/helpers/global.ts", "../src/features/css-keyframes.ts", "../src/features/css-layer.ts", "../src/features/css-contains.ts", "../src/features/css-media.ts", "../src/features/st-structure.ts", "../src/helpers/deprecation.ts", "../src/stylable-meta.ts", "../src/stylable-processor.ts", "../src/create-stylable-processor.ts", "../src/stylable-transformer.ts", "../src/helpers/eql.ts", "../src/deprecated/postcss-ast-extension.ts", "../../../node_modules/@file-services/resolve/src/dependency-resolver.ts", "../../../node_modules/@file-services/resolve/src/request-resolver.ts", "../src/module-resolver.ts", "../src/visit-meta-css-dependencies.ts", "../src/stylable.ts", "../src/resolve-namespace-factories.ts", "../src/stylable-js-module-source.ts"],
"sourcesContent": ["var x=String;\nvar create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};\nmodule.exports=create();\nmodule.exports.createColors = create;\n", "'use strict'\n\nlet pico = require('picocolors')\n\nlet terminalHighlight = require('./terminal-highlight')\n\nclass CssSyntaxError extends Error {\n constructor(message, line, column, source, file, plugin) {\n super(message)\n this.name = 'CssSyntaxError'\n this.reason = message\n\n if (file) {\n this.file = file\n }\n if (source) {\n this.source = source\n }\n if (plugin) {\n this.plugin = plugin\n }\n if (typeof line !== 'undefined' && typeof column !== 'undefined') {\n if (typeof line === 'number') {\n this.line = line\n this.column = column\n } else {\n this.line = line.line\n this.column = line.column\n this.endLine = column.line\n this.endColumn = column.column\n }\n }\n\n this.setMessage()\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CssSyntaxError)\n }\n }\n\n setMessage() {\n this.message = this.plugin ? this.plugin + ': ' : ''\n this.message += this.file ? this.file : '<css input>'\n if (typeof this.line !== 'undefined') {\n this.message += ':' + this.line + ':' + this.column\n }\n this.message += ': ' + this.reason\n }\n\n showSourceCode(color) {\n if (!this.source) return ''\n\n let css = this.source\n if (color == null) color = pico.isColorSupported\n if (terminalHighlight) {\n if (color) css = terminalHighlight(css)\n }\n\n let lines = css.split(/\\r?\\n/)\n let start = Math.max(this.line - 3, 0)\n let end = Math.min(this.line + 2, lines.length)\n\n let maxWidth = String(end).length\n\n let mark, aside\n if (color) {\n let { bold, gray, red } = pico.createColors(true)\n mark = text => bold(red(text))\n aside = text => gray(text)\n } else {\n mark = aside = str => str\n }\n\n return lines\n .slice(start, end)\n .map((line, index) => {\n let number = start + 1 + index\n let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '\n if (number === this.line) {\n let spacing =\n aside(gutter.replace(/\\d/g, ' ')) +\n line.slice(0, this.column - 1).replace(/[^\\t]/g, ' ')\n return mark('>') + aside(gutter) + line + '\\n ' + spacing + mark('^')\n }\n return ' ' + aside(gutter) + line\n })\n .join('\\n')\n }\n\n toString() {\n let code = this.showSourceCode()\n if (code) {\n code = '\\n\\n' + code + '\\n'\n }\n return this.name + ': ' + this.message + code\n }\n}\n\nmodule.exports = CssSyntaxError\nCssSyntaxError.default = CssSyntaxError\n", "'use strict'\n\nmodule.exports.isClean = Symbol('isClean')\n\nmodule.exports.my = Symbol('my')\n", "'use strict'\n\nconst DEFAULT_RAW = {\n after: '\\n',\n beforeClose: '\\n',\n beforeComment: '\\n',\n beforeDecl: '\\n',\n beforeOpen: ' ',\n beforeRule: '\\n',\n colon: ': ',\n commentLeft: ' ',\n commentRight: ' ',\n emptyBody: '',\n indent: ' ',\n semicolon: false\n}\n\nfunction capitalize(str) {\n return str[0].toUpperCase() + str.slice(1)\n}\n\nclass Stringifier {\n constructor(builder) {\n this.builder = builder\n }\n\n atrule(node, semicolon) {\n let name = '@' + node.name\n let params = node.params ? this.rawValue(node, 'params') : ''\n\n if (typeof node.raws.afterName !== 'undefined') {\n name += node.raws.afterName\n } else if (params) {\n name += ' '\n }\n\n if (node.nodes) {\n this.block(node, name + params)\n } else {\n let end = (node.raws.between || '') + (semicolon ? ';' : '')\n this.builder(name + params + end, node)\n }\n }\n\n beforeAfter(node, detect) {\n let value\n if (node.type === 'decl') {\n value = this.raw(node, null, 'beforeDecl')\n } else if (node.type === 'comment') {\n value = this.raw(node, null, 'beforeComment')\n } else if (detect === 'before') {\n value = this.raw(node, null, 'beforeRule')\n } else {\n value = this.raw(node, null, 'beforeClose')\n }\n\n let buf = node.parent\n let depth = 0\n while (buf && buf.type !== 'root') {\n depth += 1\n buf = buf.parent\n }\n\n if (value.includes('\\n')) {\n let indent = this.raw(node, null, 'indent')\n if (indent.length) {\n for (let step = 0; step < depth; step++) value += indent\n }\n }\n\n return value\n }\n\n block(node, start) {\n let between = this.raw(node, 'between', 'beforeOpen')\n this.builder(start + between + '{', node, 'start')\n\n let after\n if (node.nodes && node.nodes.length) {\n this.body(node)\n after = this.raw(node, 'after')\n } else {\n after = this.raw(node, 'after', 'emptyBody')\n }\n\n if (after) this.builder(after)\n this.builder('}', node, 'end')\n }\n\n body(node) {\n let last = node.nodes.length - 1\n while (last > 0) {\n if (node.nodes[last].type !== 'comment') break\n last -= 1\n }\n\n let semicolon = this.raw(node, 'semicolon')\n for (let i = 0; i < node.nodes.length; i++) {\n let child = node.nodes[i]\n let before = this.raw(child, 'before')\n if (before) this.builder(before)\n this.stringify(child, last !== i || semicolon)\n }\n }\n\n comment(node) {\n let left = this.raw(node, 'left', 'commentLeft')\n let right = this.raw(node, 'right', 'commentRight')\n this.builder('/*' + left + node.text + right + '*/', node)\n }\n\n decl(node, semicolon) {\n let between = this.raw(node, 'between', 'colon')\n let string = node.prop + between + this.rawValue(node, 'value')\n\n if (node.important) {\n string += node.raws.important || ' !important'\n }\n\n if (semicolon) string += ';'\n this.builder(string, node)\n }\n\n document(node) {\n this.body(node)\n }\n\n raw(node, own, detect) {\n let value\n if (!detect) detect = own\n\n // Already had\n if (own) {\n value = node.raws[own]\n if (typeof value !== 'undefined') return value\n }\n\n let parent = node.parent\n\n if (detect === 'before') {\n // Hack for first rule in CSS\n if (!parent || (parent.type === 'root' && parent.first === node)) {\n return ''\n }\n\n // `root` nodes in `document` should use only their own raws\n if (parent && parent.type === 'document') {\n return ''\n }\n }\n\n // Floating child without parent\n if (!parent) return DEFAULT_RAW[detect]\n\n // Detect style by other nodes\n let root = node.root()\n if (!root.rawCache) root.rawCache = {}\n if (typeof root.rawCache[detect] !== 'undefined') {\n return root.rawCache[detect]\n }\n\n if (detect === 'before' || detect === 'after') {\n return this.beforeAfter(node, detect)\n } else {\n let method = 'raw' + capitalize(detect)\n if (this[method]) {\n value = this[method](root, node)\n } else {\n root.walk(i => {\n value = i.raws[own]\n if (typeof value !== 'undefined') return false\n })\n }\n }\n\n if (typeof value === 'undefined') value = DEFAULT_RAW[detect]\n\n root.rawCache[detect] = value\n return value\n }\n\n rawBeforeClose(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length > 0) {\n if (typeof i.raws.after !== 'undefined') {\n value = i.raws.after\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n }\n })\n if (value) value = value.replace(/\\S/g, '')\n return value\n }\n\n rawBeforeComment(root, node) {\n let value\n root.walkComments(i => {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n })\n if (typeof value === 'undefined') {\n value = this.raw(node, null, 'beforeDecl')\n } else if (value) {\n value = value.replace(/\\S/g, '')\n }\n return value\n }\n\n rawBeforeDecl(root, node) {\n let value\n root.walkDecls(i => {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n })\n if (typeof value === 'undefined') {\n value = this.raw(node, null, 'beforeRule')\n } else if (value) {\n value = value.replace(/\\S/g, '')\n }\n return value\n }\n\n rawBeforeOpen(root) {\n let value\n root.walk(i => {\n if (i.type !== 'decl') {\n value = i.raws.between\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawBeforeRule(root) {\n let value\n root.walk(i => {\n if (i.nodes && (i.parent !== root || root.first !== i)) {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n }\n })\n if (value) value = value.replace(/\\S/g, '')\n return value\n }\n\n rawColon(root) {\n let value\n root.walkDecls(i => {\n if (typeof i.raws.between !== 'undefined') {\n value = i.raws.between.replace(/[^\\s:]/g, '')\n return false\n }\n })\n return value\n }\n\n rawEmptyBody(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length === 0) {\n value = i.raws.after\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawIndent(root) {\n if (root.raws.indent) return root.raws.indent\n let value\n root.walk(i => {\n let p = i.parent\n if (p && p !== root && p.parent && p.parent === root) {\n if (typeof i.raws.before !== 'undefined') {\n let parts = i.raws.before.split('\\n')\n value = parts[parts.length - 1]\n value = value.replace(/\\S/g, '')\n return false\n }\n }\n })\n return value\n }\n\n rawSemicolon(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length && i.last.type === 'decl') {\n value = i.raws.semicolon\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawValue(node, prop) {\n let value = node[prop]\n let raw = node.raws[prop]\n if (raw && raw.value === value) {\n return raw.raw\n }\n\n return value\n }\n\n root(node) {\n this.body(node)\n if (node.raws.after) this.builder(node.raws.after)\n }\n\n rule(node) {\n this.block(node, this.rawValue(node, 'selector'))\n if (node.raws.ownSemicolon) {\n this.builder(node.raws.ownSemicolon, node, 'end')\n }\n }\n\n stringify(node, semicolon) {\n /* c8 ignore start */\n if (!this[node.type]) {\n throw new Error(\n 'Unknown AST node type ' +\n node.type +\n '. ' +\n 'Maybe you need to change PostCSS stringifier.'\n )\n }\n /* c8 ignore stop */\n this[node.type](node, semicolon)\n }\n}\n\nmodule.exports = Stringifier\nStringifier.default = Stringifier\n", "'use strict'\n\nlet Stringifier = require('./stringifier')\n\nfunction stringify(node, builder) {\n let str = new Stringifier(builder)\n str.stringify(node)\n}\n\nmodule.exports = stringify\nstringify.default = stringify\n", "'use strict'\n\nlet { isClean, my } = require('./symbols')\nlet CssSyntaxError = require('./css-syntax-error')\nlet Stringifier = require('./stringifier')\nlet stringify = require('./stringify')\n\nfunction cloneNode(obj, parent) {\n let cloned = new obj.constructor()\n\n for (let i in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, i)) {\n /* c8 ignore next 2 */\n continue\n }\n if (i === 'proxyCache') continue\n let value = obj[i]\n let type = typeof value\n\n if (i === 'parent' && type === 'object') {\n if (parent) cloned[i] = parent\n } else if (i === 'source') {\n cloned[i] = value\n } else if (Array.isArray(value)) {\n cloned[i] = value.map(j => cloneNode(j, cloned))\n } else {\n if (type === 'object' && value !== null) value = cloneNode(value)\n cloned[i] = value\n }\n }\n\n return cloned\n}\n\nclass Node {\n constructor(defaults = {}) {\n this.raws = {}\n this[isClean] = false\n this[my] = true\n\n for (let name in defaults) {\n if (name === 'nodes') {\n this.nodes = []\n for (let node of defaults[name]) {\n if (typeof node.clone === 'function') {\n this.append(node.clone())\n } else {\n this.append(node)\n }\n }\n } else {\n this[name] = defaults[name]\n }\n }\n }\n\n addToError(error) {\n error.postcssNode = this\n if (error.stack && this.source && /\\n\\s{4}at /.test(error.stack)) {\n let s = this.source\n error.stack = error.stack.replace(\n /\\n\\s{4}at /,\n `$&${s.input.from}:${s.start.line}:${s.start.column}$&`\n )\n }\n return error\n }\n\n after(add) {\n this.parent.insertAfter(this, add)\n return this\n }\n\n assign(overrides = {}) {\n for (let name in overrides) {\n this[name] = overrides[name]\n }\n return this\n }\n\n before(add) {\n this.parent.insertBefore(this, add)\n return this\n }\n\n cleanRaws(keepBetween) {\n delete this.raws.before\n delete this.raws.after\n if (!keepBetween) delete this.raws.between\n }\n\n clone(overrides = {}) {\n let cloned = cloneNode(this)\n for (let name in overrides) {\n cloned[name] = overrides[name]\n }\n return cloned\n }\n\n cloneAfter(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertAfter(this, cloned)\n return cloned\n }\n\n cloneBefore(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertBefore(this, cloned)\n return cloned\n }\n\n error(message, opts = {}) {\n if (this.source) {\n let { end, start } = this.rangeBy(opts)\n return this.source.input.error(\n message,\n { column: start.column, line: start.line },\n { column: end.column, line: end.line },\n opts\n )\n }\n return new CssSyntaxError(message)\n }\n\n getProxyProcessor() {\n return {\n get(node, prop) {\n if (prop === 'proxyOf') {\n return node\n } else if (prop === 'root') {\n return () => node.root().toProxy()\n } else {\n return node[prop]\n }\n },\n\n set(node, prop, value) {\n if (node[prop] === value) return true\n node[prop] = value\n if (\n prop === 'prop' ||\n prop === 'value' ||\n prop === 'name' ||\n prop === 'params' ||\n prop === 'important' ||\n /* c8 ignore next */\n prop === 'text'\n ) {\n node.markDirty()\n }\n return true\n }\n }\n }\n\n markDirty() {\n if (this[isClean]) {\n this[isClean] = false\n let next = this\n while ((next = next.parent)) {\n next[isClean] = false\n }\n }\n }\n\n next() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index + 1]\n }\n\n positionBy(opts, stringRepresentation) {\n let pos = this.source.start\n if (opts.index) {\n pos = this.positionInside(opts.index, stringRepresentation)\n } else if (opts.word) {\n stringRepresentation = this.toString()\n let index = stringRepresentation.indexOf(opts.word)\n if (index !== -1) pos = this.positionInside(index, stringRepresentation)\n }\n return pos\n }\n\n positionInside(index, stringRepresentation) {\n let string = stringRepresentation || this.toString()\n let column = this.source.start.column\n let line = this.source.start.line\n\n for (let i = 0; i < index; i++) {\n if (string[i] === '\\n') {\n column = 1\n line += 1\n } else {\n column += 1\n }\n }\n\n return { column, line }\n }\n\n prev() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index - 1]\n }\n\n rangeBy(opts) {\n let start = {\n column: this.source.start.column,\n line: this.source.start.line\n }\n let end = this.source.end\n ? {\n column: this.source.end.column + 1,\n line: this.source.end.line\n }\n : {\n column: start.column + 1,\n line: start.line\n }\n\n if (opts.word) {\n let stringRepresentation = this.toString()\n let index = stringRepresentation.indexOf(opts.word)\n if (index !== -1) {\n start = this.positionInside(index, stringRepresentation)\n end = this.positionInside(index + opts.word.length, stringRepresentation)\n }\n } else {\n if (opts.start) {\n start = {\n column: opts.start.column,\n line: opts.start.line\n }\n } else if (opts.index) {\n start = this.positionInside(opts.index)\n }\n\n if (opts.end) {\n end = {\n column: opts.end.column,\n line: opts.end.line\n }\n } else if (typeof opts.endIndex === 'number') {\n end = this.positionInside(opts.endIndex)\n } else if (opts.index) {\n end = this.positionInside(opts.index + 1)\n }\n }\n\n if (\n end.line < start.line ||\n (end.line === start.line && end.column <= start.column)\n ) {\n end = { column: start.column + 1, line: start.line }\n }\n\n return { end, start }\n }\n\n raw(prop, defaultType) {\n let str = new Stringifier()\n return str.raw(this, prop, defaultType)\n }\n\n remove() {\n if (this.parent) {\n this.parent.removeChild(this)\n }\n this.parent = undefined\n return this\n }\n\n replaceWith(...nodes) {\n if (this.parent) {\n let bookmark = this\n let foundSelf = false\n for (let node of nodes) {\n if (node === this) {\n foundSelf = true\n } else if (foundSelf) {\n this.parent.insertAfter(bookmark, node)\n bookmark = node\n } else {\n this.parent.insertBefore(bookmark, node)\n }\n }\n\n if (!foundSelf) {\n this.remove()\n }\n }\n\n return this\n }\n\n root() {\n let result = this\n while (result.parent && result.parent.type !== 'document') {\n result = result.parent\n }\n return result\n }\n\n toJSON(_, inputs) {\n let fixed = {}\n let emitInputs = inputs == null\n inputs = inputs || new Map()\n let inputsNextIndex = 0\n\n for (let name in this) {\n if (!Object.prototype.hasOwnProperty.call(this, name)) {\n /* c8 ignore next 2 */\n continue\n }\n if (name === 'parent' || name === 'proxyCache') continue\n let value = this[name]\n\n if (Array.isArray(value)) {\n fixed[name] = value.map(i => {\n if (typeof i === 'object' && i.toJSON) {\n return i.toJSON(null, inputs)\n } else {\n return i\n }\n })\n } else if (typeof value === 'object' && value.toJSON) {\n fixed[name] = value.toJSON(null, inputs)\n } else if (name === 'source') {\n let inputId = inputs.get(value.input)\n if (inputId == null) {\n inputId = inputsNextIndex\n inputs.set(value.input, inputsNextIndex)\n inputsNextIndex++\n }\n fixed[name] = {\n end: value.end,\n inputId,\n start: value.start\n }\n } else {\n fixed[name] = value\n }\n }\n\n if (emitInputs) {\n fixed.inputs = [...inputs.keys()].map(input => input.toJSON())\n }\n\n return fixed\n }\n\n toProxy() {\n if (!this.proxyCache) {\n this.proxyCache = new Proxy(this, this.getProxyProcessor())\n }\n return this.proxyCache\n }\n\n toString(stringifier = stringify) {\n if (stringifier.stringify) stringifier = stringifier.stringify\n let result = ''\n stringifier(this, i => {\n result += i\n })\n return result\n }\n\n warn(result, text, opts) {\n let data = { node: this }\n for (let i in opts) data[i] = opts[i]\n return result.warn(text, data)\n }\n\n get proxyOf() {\n return this\n }\n}\n\nmodule.exports = Node\nNode.default = Node\n", "'use strict'\n\nlet Node = require('./node')\n\nclass Declaration extends Node {\n constructor(defaults) {\n if (\n defaults &&\n typeof defaults.value !== 'undefined' &&\n typeof defaults.value !== 'string'\n ) {\n defaults = { ...defaults, value: String(defaults.value) }\n }\n super(defaults)\n this.type = 'decl'\n }\n\n get variable() {\n return this.prop.startsWith('--') || this.prop[0] === '$'\n }\n}\n\nmodule.exports = Declaration\nDeclaration.default = Declaration\n", "const CHAR_UPPERCASE_A = 65; /* A */\nconst CHAR_LOWERCASE_A = 97; /* a */\nconst CHAR_UPPERCASE_Z = 90; /* Z */\nconst CHAR_LOWERCASE_Z = 122; /* z */\nconst CHAR_DOT = 46; /* . */\nconst CHAR_FORWARD_SLASH = 47; /* / */\nconst CHAR_BACKWARD_SLASH = 92; /* \\ */\nconst CHAR_COLON = 58; /* : */\nconst CHAR_QUESTION_MARK = 63; /* ? */\n\nconst _process = {\n cwd: function () {\n return \"/\";\n },\n env: {},\n};\n\nfunction valueType(value) {\n const valueType = typeof value;\n return valueType === \"object\" && value === null ? \"null\" : valueType;\n}\n\nfunction validateString(value, paramName) {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `[ERR_INVALID_ARG_TYPE]: The \"${paramName}\" argument must be of type string. Received ${valueType(value)}`,\n );\n }\n}\n\nfunction isPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n}\n\nfunction isPosixPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH;\n}\n\nfunction isWindowsDeviceRoot(code) {\n return (\n (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) || (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z)\n );\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code = 0;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);\n else if (isPathSeparator(code)) break;\n else code = CHAR_FORWARD_SLASH;\n\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (dots === 2) {\n if (\n res.length < 2 ||\n lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== CHAR_DOT ||\n res.charCodeAt(res.length - 2) !== CHAR_DOT\n ) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n } else if (res.length !== 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? `${separator}..` : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) res += `${separator}${path.slice(lastSlash + 1, i)}`;\n else res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === CHAR_DOT && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n if (pathObject === null || typeof pathObject !== \"object\") {\n throw new TypeError(\n `[ERR_INVALID_ARG_TYPE]: The \"pathObject\" argument must be of type object. Received ${valueType(pathObject)}`,\n );\n }\n const dir = pathObject.dir || pathObject.root;\n const base = pathObject.base || `${pathObject.name || \"\"}${pathObject.ext || \"\"}`;\n if (!dir) {\n return base;\n }\n return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`;\n}\n\nconst win32 = {\n // path.resolve([from ...], to)\n resolve(...args) {\n let resolvedDevice = \"\";\n let resolvedTail = \"\";\n let resolvedAbsolute = false;\n\n for (let i = args.length - 1; i >= -1; i--) {\n let path;\n if (i >= 0) {\n path = args[i];\n validateString(path, \"path\");\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n } else if (resolvedDevice.length === 0) {\n path = _process.cwd();\n } else {\n // Windows has the concept of drive-specific current working\n // directories. If we've resolved a drive letter but not yet an\n // absolute path, get cwd for that drive, or the process cwd if\n // the drive cwd is not available. We're sure the device is not\n // a UNC path at this points, because UNC paths are always absolute.\n path = _process.env[`=${resolvedDevice}`] || _process.cwd();\n\n // Verify that a cwd was found and that it actually points\n // to our drive. If not, default to the drive's root.\n if (\n path === undefined ||\n (path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&\n path.charCodeAt(2) === CHAR_BACKWARD_SLASH)\n ) {\n path = `${resolvedDevice}\\\\`;\n }\n }\n\n const len = path.length;\n let rootEnd = 0;\n let device = \"\";\n let isAbsolute = false;\n const code = path.charCodeAt(0);\n\n // Try to match a root\n if (len === 1) {\n if (isPathSeparator(code)) {\n // `path` contains just a path separator\n rootEnd = 1;\n isAbsolute = true;\n }\n } else if (isPathSeparator(code)) {\n // Possible UNC root\n\n // If we started with a separator, we know we at least have an\n // absolute path of some kind (UNC or otherwise)\n isAbsolute = true;\n\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n const firstPart = path.slice(last, j);\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len || j !== last) {\n // We matched a UNC root\n device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n rootEnd = j;\n }\n }\n }\n } else {\n rootEnd = 1;\n }\n } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n device = path.slice(0, 2);\n rootEnd = 2;\n if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n // Treat separator following drive name as an absolute path\n // indicator\n isAbsolute = true;\n rootEnd = 3;\n }\n }\n\n if (device.length > 0) {\n if (resolvedDevice.length > 0) {\n if (device.toLowerCase() !== resolvedDevice.toLowerCase())\n // This path points to another device so it is not applicable\n continue;\n } else {\n resolvedDevice = device;\n }\n }\n\n if (resolvedAbsolute) {\n if (resolvedDevice.length > 0) break;\n } else {\n resolvedTail = `${path.slice(rootEnd)}\\\\${resolvedTail}`;\n resolvedAbsolute = isAbsolute;\n if (isAbsolute && resolvedDevice.length > 0) {\n break;\n }\n }\n }\n\n // At this point the path should be resolved to a full absolute path,\n // but handle relative paths to be safe (might happen when process.cwd()\n // fails)\n\n // Normalize the tail path\n resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, \"\\\\\", isPathSeparator);\n\n return resolvedAbsolute ? `${resolvedDevice}\\\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || \".\";\n },\n\n normalize(path) {\n validateString(path, \"path\");\n const len = path.length;\n if (len === 0) return \".\";\n let rootEnd = 0;\n let device;\n let isAbsolute = false;\n const code = path.charCodeAt(0);\n\n // Try to match a root\n if (len === 1) {\n // `path` contains just a single char, exit early to avoid\n // unnecessary work\n return isPosixPathSeparator(code) ? \"\\\\\" : path;\n }\n if (isPathSeparator(code)) {\n // Possible UNC root\n\n // If we started with a separator, we know we at least have an absolute\n // path of some kind (UNC or otherwise)\n isAbsolute = true;\n\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n const firstPart = path.slice(last, j);\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n // Return the normalized version of the UNC root since there\n // is nothing left to process\n return `\\\\\\\\${firstPart}\\\\${path.slice(last)}\\\\`;\n }\n if (j !== last) {\n // We matched a UNC root with leftovers\n device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n rootEnd = j;\n }\n }\n }\n } else {\n rootEnd = 1;\n }\n } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n device = path.slice(0, 2);\n rootEnd = 2;\n if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n // Treat separator following drive name as an absolute path\n // indicator\n isAbsolute = true;\n rootEnd = 3;\n }\n }\n\n let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, \"\\\\\", isPathSeparator) : \"\";\n if (tail.length === 0 && !isAbsolute) tail = \".\";\n if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) tail += \"\\\\\";\n if (device === undefined) {\n return isAbsolute ? `\\\\${tail}` : tail;\n }\n return isAbsolute ? `${device}\\\\${tail}` : `${device}${tail}`;\n },\n\n isAbsolute(path) {\n validateString(path, \"path\");\n const len = path.length;\n if (len === 0) return false;\n\n const code = path.charCodeAt(0);\n return (\n isPathSeparator(code) ||\n // Possible device root\n (len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2)))\n );\n },\n\n join(...args) {\n if (args.length === 0) return \".\";\n\n let joined;\n let firstPart;\n for (let i = 0; i < args.length; ++i) {\n const arg = args[i];\n validateString(arg, \"path\");\n if (arg.length > 0) {\n if (joined === undefined) joined = firstPart = arg;\n else joined += `\\\\${arg}`;\n }\n }\n\n if (joined === undefined) return \".\";\n\n // Make sure that the joined path doesn't start with two slashes, because\n // normalize() will mistake it for an UNC path then.\n //\n // This step is skipped when it is very clear that the user actually\n // intended to point at an UNC path. This is assumed when the first\n // non-empty string arguments starts with exactly two slashes followed by\n // at least one more non-slash character.\n //\n // Note that for normalize() to treat a path as an UNC path it needs to\n // have at least 2 components, so we don't filter for that here.\n // This means that the user can use join to construct UNC paths from\n // a server name and a share name; for example:\n // path.join('//server', 'share') -> '\\\\\\\\server\\\\share\\\\')\n let needsReplace = true;\n let slashCount = 0;\n if (isPathSeparator(firstPart.charCodeAt(0))) {\n ++slashCount;\n const firstLen = firstPart.length;\n if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {\n ++slashCount;\n if (firstLen > 2) {\n if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;\n else {\n // We matched a UNC path in the first part\n needsReplace = false;\n }\n }\n }\n }\n if (needsReplace) {\n // Find any more consecutive slashes we need to replace\n while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) {\n slashCount++;\n }\n\n // Replace the slashes if needed\n if (slashCount >= 2) joined = `\\\\${joined.slice(slashCount)}`;\n }\n\n return win32.normalize(joined);\n },\n\n // It will solve the relative path from `from` to `to`, for instance:\n // from = 'C:\\\\orandea\\\\test\\\\aaa'\n // to = 'C:\\\\orandea\\\\impl\\\\bbb'\n // The output of the function should be: '..\\\\..\\\\impl\\\\bbb'\n relative(from, to) {\n validateString(from, \"from\");\n validateString(to, \"to\");\n\n if (from === to) return \"\";\n\n const fromOrig = win32.resolve(from);\n const toOrig = win32.resolve(to);\n\n if (fromOrig === toOrig) return \"\";\n\n from = fromOrig.toLowerCase();\n to = toOrig.toLowerCase();\n\n if (from === to) return \"\";\n\n // Trim any leading backslashes\n let fromStart = 0;\n while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {\n fromStart++;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n let fromEnd = from.length;\n while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {\n fromEnd--;\n }\n const fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n let toStart = 0;\n while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n toStart++;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n let toEnd = to.length;\n while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {\n toEnd--;\n }\n const toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n const length = fromLen < toLen ? fromLen : toLen;\n let lastCommonSep = -1;\n let i = 0;\n for (; i < length; i++) {\n const fromCode = from.charCodeAt(fromStart + i);\n if (fromCode !== to.charCodeAt(toStart + i)) break;\n else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;\n }\n\n // We found a mismatch before the first common path separator was seen, so\n // return the original `to`.\n if (i !== length) {\n if (lastCommonSep === -1) return toOrig;\n } else {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n return toOrig.slice(toStart + i + 1);\n }\n if (i === 2) {\n // We get here if `from` is the device root.\n // For example: from='C:\\\\'; to='C:\\\\foo'\n return toOrig.slice(toStart + i);\n }\n }\n if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n lastCommonSep = i;\n } else if (i === 2) {\n // We get here if `to` is the device root.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n lastCommonSep = 3;\n }\n }\n if (lastCommonSep === -1) lastCommonSep = 0;\n }\n\n let out = \"\";\n // Generate the relative path based on the path difference between `to` and\n // `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n out += out.length === 0 ? \"..\" : \"\\\\..\";\n }\n }\n\n toStart += lastCommonSep;\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0) return `${out}${toOrig.slice(toStart, toEnd)}`;\n\n if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;\n return toOrig.slice(toStart, toEnd);\n },\n\n toNamespacedPath(path) {\n // Note: this will *probably* throw somewhere.\n if (typeof path !== \"string\") return path;\n\n if (path.length === 0) {\n return \"\";\n }\n\n const resolvedPath = win32.resolve(path);\n\n if (resolvedPath.length <= 2) return path;\n\n if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\n // Possible UNC root\n if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\n const code = resolvedPath.charCodeAt(2);\n if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\n // Matched non-long UNC root, convert the path to a long UNC path\n return `\\\\\\\\?\\\\UNC\\\\${resolvedPath.slice(2)}`;\n }\n }\n } else if (\n isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) &&\n resolvedPath.charCodeAt(1) === CHAR_COLON &&\n resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH\n ) {\n // Matched device root, convert the path to a long UNC path\n return `\\\\\\\\?\\\\${resolvedPath}`;\n }\n\n return path;\n },\n\n dirname(path) {\n validateString(path, \"path\");\n const len = path.length;\n if (len === 0) return \".\";\n let rootEnd = -1;\n let offset = 0;\n const code = path.charCodeAt(0);\n\n if (len === 1) {\n // `path` contains just a path separator, exit early to avoid\n // unnecessary work or a dot.\n return isPathSeparator(code) ? path : \".\";\n }\n\n // Try to match a root\n if (isPathSeparator(code)) {\n // Possible UNC root\n\n rootEnd = offset = 1;\n\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j <