playwright
Version:
A high-level API to automate web browsers
8,076 lines • 290 kB
JavaScript
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
try {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
} catch (e) {
throw mod = 0, e;
}
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/source-map/lib/base64.js
var require_base64 = __commonJS({
"node_modules/source-map/lib/base64.js"(exports2) {
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
exports2.encode = function(number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
throw new TypeError("Must be between 0 and 63: " + number);
};
exports2.decode = function(charCode) {
var bigA = 65;
var bigZ = 90;
var littleA = 97;
var littleZ = 122;
var zero = 48;
var nine = 57;
var plus = 43;
var slash = 47;
var littleOffset = 26;
var numberOffset = 52;
if (bigA <= charCode && charCode <= bigZ) {
return charCode - bigA;
}
if (littleA <= charCode && charCode <= littleZ) {
return charCode - littleA + littleOffset;
}
if (zero <= charCode && charCode <= nine) {
return charCode - zero + numberOffset;
}
if (charCode == plus) {
return 62;
}
if (charCode == slash) {
return 63;
}
return -1;
};
}
});
// node_modules/source-map/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
"node_modules/source-map/lib/base64-vlq.js"(exports2) {
var base64 = require_base64();
var VLQ_BASE_SHIFT = 5;
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
var VLQ_BASE_MASK = VLQ_BASE - 1;
var VLQ_CONTINUATION_BIT = VLQ_BASE;
function toVLQSigned(aValue) {
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
}
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative ? -shifted : shifted;
}
exports2.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result2 = 0;
var shift = 0;
var continuation, digit;
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result2 = result2 + (digit << shift);
shift += VLQ_BASE_SHIFT;
} while (continuation);
aOutParam.value = fromVLQSigned(result2);
aOutParam.rest = aIndex;
};
}
});
// node_modules/source-map/lib/util.js
var require_util = __commonJS({
"node_modules/source-map/lib/util.js"(exports2) {
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports2.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match2 = aUrl.match(urlRegexp);
if (!match2) {
return null;
}
return {
scheme: match2[1],
auth: match2[2],
host: match2[3],
port: match2[4],
path: match2[5]
};
}
exports2.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url4 = "";
if (aParsedUrl.scheme) {
url4 += aParsedUrl.scheme + ":";
}
url4 += "//";
if (aParsedUrl.auth) {
url4 += aParsedUrl.auth + "@";
}
if (aParsedUrl.host) {
url4 += aParsedUrl.host;
}
if (aParsedUrl.port) {
url4 += ":" + aParsedUrl.port;
}
if (aParsedUrl.path) {
url4 += aParsedUrl.path;
}
return url4;
}
exports2.urlGenerate = urlGenerate;
function normalize(aPath) {
var path7 = aPath;
var url4 = urlParse(aPath);
if (url4) {
if (!url4.path) {
return aPath;
}
path7 = url4.path;
}
var isAbsolute = exports2.isAbsolute(path7);
var parts = path7.split(/\/+/);
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === ".") {
parts.splice(i, 1);
} else if (part === "..") {
up++;
} else if (up > 0) {
if (part === "") {
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path7 = parts.join("/");
if (path7 === "") {
path7 = isAbsolute ? "/" : ".";
}
if (url4) {
url4.path = path7;
return urlGenerate(url4);
}
return path7;
}
exports2.normalize = normalize;
function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || "/";
}
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports2.join = join;
exports2.isAbsolute = function(aPath) {
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
};
function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, "");
var level = 0;
while (aPath.indexOf(aRoot + "/") !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports2.relative = relative;
var supportsNullProto = (function() {
var obj = /* @__PURE__ */ Object.create(null);
return !("__proto__" in obj);
})();
function identity(s) {
return s;
}
function toSetString(aStr) {
if (isProtoString(aStr)) {
return "$" + aStr;
}
return aStr;
}
exports2.toSetString = supportsNullProto ? identity : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports2.fromSetString = supportsNullProto ? identity : fromSetString;
function isProtoString(s) {
if (!s) {
return false;
}
var length = s.length;
if (length < 9) {
return false;
}
if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
return false;
}
for (var i = length - 10; i >= 0; i--) {
if (s.charCodeAt(i) !== 36) {
return false;
}
}
return true;
}
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports2.compareByOriginalPositions = compareByOriginalPositions;
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 === null) {
return 1;
}
if (aStr2 === null) {
return -1;
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
function parseSourceMapInput(str) {
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
}
exports2.parseSourceMapInput = parseSourceMapInput;
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
sourceURL = sourceURL || "";
if (sourceRoot) {
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
sourceRoot += "/";
}
sourceURL = sourceRoot + sourceURL;
}
if (sourceMapURL) {
var parsed = urlParse(sourceMapURL);
if (!parsed) {
throw new Error("sourceMapURL could not be parsed");
}
if (parsed.path) {
var index = parsed.path.lastIndexOf("/");
if (index >= 0) {
parsed.path = parsed.path.substring(0, index + 1);
}
}
sourceURL = join(urlGenerate(parsed), sourceURL);
}
return normalize(sourceURL);
}
exports2.computeSourceURL = computeSourceURL;
}
});
// node_modules/source-map/lib/array-set.js
var require_array_set = __commonJS({
"node_modules/source-map/lib/array-set.js"(exports2) {
var util = require_util();
var has = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";
function ArraySet() {
this._array = [];
this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
}
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
var set = new ArraySet();
for (var i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
return set;
};
ArraySet.prototype.size = function ArraySet_size() {
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
if (hasNativeMap) {
this._set.set(aStr, idx);
} else {
this._set[sStr] = idx;
}
}
};
ArraySet.prototype.has = function ArraySet_has(aStr) {
if (hasNativeMap) {
return this._set.has(aStr);
} else {
var sStr = util.toSetString(aStr);
return has.call(this._set, sStr);
}
};
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (hasNativeMap) {
var idx = this._set.get(aStr);
if (idx >= 0) {
return idx;
}
} else {
var sStr = util.toSetString(aStr);
if (has.call(this._set, sStr)) {
return this._set[sStr];
}
}
throw new Error('"' + aStr + '" is not in the set.');
};
ArraySet.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
throw new Error("No element indexed by " + aIdx);
};
ArraySet.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
exports2.ArraySet = ArraySet;
}
});
// node_modules/source-map/lib/mapping-list.js
var require_mapping_list = __commonJS({
"node_modules/source-map/lib/mapping-list.js"(exports2) {
var util = require_util();
function generatedPositionAfter(mappingA, mappingB) {
var lineA = mappingA.generatedLine;
var lineB = mappingB.generatedLine;
var columnA = mappingA.generatedColumn;
var columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}
function MappingList() {
this._array = [];
this._sorted = true;
this._last = { generatedLine: -1, generatedColumn: 0 };
}
MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
this._array.forEach(aCallback, aThisArg);
};
MappingList.prototype.add = function MappingList_add(aMapping) {
if (generatedPositionAfter(this._last, aMapping)) {
this._last = aMapping;
this._array.push(aMapping);
} else {
this._sorted = false;
this._array.push(aMapping);
}
};
MappingList.prototype.toArray = function MappingList_toArray() {
if (!this._sorted) {
this._array.sort(util.compareByGeneratedPositionsInflated);
this._sorted = true;
}
return this._array;
};
exports2.MappingList = MappingList;
}
});
// node_modules/source-map/lib/source-map-generator.js
var require_source_map_generator = __commonJS({
"node_modules/source-map/lib/source-map-generator.js"(exports2) {
var base64VLQ = require_base64_vlq();
var util = require_util();
var ArraySet = require_array_set().ArraySet;
var MappingList = require_mapping_list().MappingList;
function SourceMapGenerator(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, "file", null);
this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
this._skipValidation = util.getArg(aArgs, "skipValidation", false);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = new MappingList();
this._sourcesContents = null;
}
SourceMapGenerator.prototype._version = 3;
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator({
file: aSourceMapConsumer.file,
sourceRoot
});
aSourceMapConsumer.eachMapping(function(mapping) {
var newMapping = {
generated: {
line: mapping.generatedLine,
column: mapping.generatedColumn
}
};
if (mapping.source != null) {
newMapping.source = mapping.source;
if (sourceRoot != null) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name != null) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var sourceRelative = sourceFile;
if (sourceRoot !== null) {
sourceRelative = util.relative(sourceRoot, sourceFile);
}
if (!generator._sources.has(sourceRelative)) {
generator._sources.add(sourceRelative);
}
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, "generated");
var original = util.getArg(aArgs, "original", null);
var source = util.getArg(aArgs, "source", null);
var name = util.getArg(aArgs, "name", null);
if (!this._skipValidation) {
this._validateMapping(generated, original, source, name);
}
if (source != null) {
source = String(source);
if (!this._sources.has(source)) {
this._sources.add(source);
}
}
if (name != null) {
name = String(name);
if (!this._names.has(name)) {
this._names.add(name);
}
}
this._mappings.add({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source,
name
});
};
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
if (!this._sourcesContents) {
this._sourcesContents = /* @__PURE__ */ Object.create(null);
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else if (this._sourcesContents) {
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
if (aSourceFile == null) {
if (aSourceMapConsumer.file == null) {
throw new Error(
`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
);
}
sourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
var newSources = new ArraySet();
var newNames = new ArraySet();
this._mappings.unsortedForEach(function(mapping) {
if (mapping.source === sourceFile && mapping.originalLine != null) {
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source != null) {
mapping.source = original.source;
if (aSourceMapPath != null) {
mapping.source = util.join(aSourceMapPath, mapping.source);
}
if (sourceRoot != null) {
mapping.source = util.relative(sourceRoot, mapping.source);
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name != null) {
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source != null && !newSources.has(source)) {
newSources.add(source);
}
var name = mapping.name;
if (name != null && !newNames.has(name)) {
newNames.add(name);
}
}, this);
this._sources = newSources;
this._names = newNames;
aSourceMapConsumer.sources.forEach(function(sourceFile2) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
if (content != null) {
if (aSourceMapPath != null) {
sourceFile2 = util.join(aSourceMapPath, sourceFile2);
}
if (sourceRoot != null) {
sourceFile2 = util.relative(sourceRoot, sourceFile2);
}
this.setSourceContent(sourceFile2, content);
}
}, this);
};
SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
throw new Error(
"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
);
}
if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
return;
} else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
return;
} else {
throw new Error("Invalid mapping: " + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
}));
}
};
SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
var previousName = 0;
var previousSource = 0;
var result2 = "";
var next;
var mapping;
var nameIdx;
var sourceIdx;
var mappings = this._mappings.toArray();
for (var i = 0, len = mappings.length; i < len; i++) {
mapping = mappings[i];
next = "";
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while (mapping.generatedLine !== previousGeneratedLine) {
next += ";";
previousGeneratedLine++;
}
} else {
if (i > 0) {
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
continue;
}
next += ",";
}
}
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
sourceIdx = this._sources.indexOf(mapping.source);
next += base64VLQ.encode(sourceIdx - previousSource);
previousSource = sourceIdx;
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
nameIdx = this._names.indexOf(mapping.name);
next += base64VLQ.encode(nameIdx - previousName);
previousName = nameIdx;
}
}
result2 += next;
}
return result2;
};
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function(source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot != null) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
}, this);
};
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._file != null) {
map.file = this._file;
}
if (this._sourceRoot != null) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
exports2.SourceMapGenerator = SourceMapGenerator;
}
});
// node_modules/source-map/lib/binary-search.js
var require_binary_search = __commonJS({
"node_modules/source-map/lib/binary-search.js"(exports2) {
exports2.GREATEST_LOWER_BOUND = 1;
exports2.LEAST_UPPER_BOUND = 2;
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
var cmp = aCompare(aNeedle, aHaystack[mid], true);
if (cmp === 0) {
return mid;
} else if (cmp > 0) {
if (aHigh - mid > 1) {
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
}
if (aBias == exports2.LEAST_UPPER_BOUND) {
return aHigh < aHaystack.length ? aHigh : -1;
} else {
return mid;
}
} else {
if (mid - aLow > 1) {
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
}
if (aBias == exports2.LEAST_UPPER_BOUND) {
return mid;
} else {
return aLow < 0 ? -1 : aLow;
}
}
}
exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) {
if (aHaystack.length === 0) {
return -1;
}
var index = recursiveSearch(
-1,
aHaystack.length,
aNeedle,
aHaystack,
aCompare,
aBias || exports2.GREATEST_LOWER_BOUND
);
if (index < 0) {
return -1;
}
while (index - 1 >= 0) {
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
break;
}
--index;
}
return index;
};
}
});
// node_modules/source-map/lib/quick-sort.js
var require_quick_sort = __commonJS({
"node_modules/source-map/lib/quick-sort.js"(exports2) {
function swap(ary, x, y) {
var temp = ary[x];
ary[x] = ary[y];
ary[y] = temp;
}
function randomIntInRange(low, high) {
return Math.round(low + Math.random() * (high - low));
}
function doQuickSort(ary, comparator, p, r) {
if (p < r) {
var pivotIndex = randomIntInRange(p, r);
var i = p - 1;
swap(ary, pivotIndex, r);
var pivot = ary[r];
for (var j = p; j < r; j++) {
if (comparator(ary[j], pivot) <= 0) {
i += 1;
swap(ary, i, j);
}
}
swap(ary, i + 1, j);
var q = i + 1;
doQuickSort(ary, comparator, p, q - 1);
doQuickSort(ary, comparator, q + 1, r);
}
}
exports2.quickSort = function(ary, comparator) {
doQuickSort(ary, comparator, 0, ary.length - 1);
};
}
});
// node_modules/source-map/lib/source-map-consumer.js
var require_source_map_consumer = __commonJS({
"node_modules/source-map/lib/source-map-consumer.js"(exports2) {
var util = require_util();
var binarySearch = require_binary_search();
var ArraySet = require_array_set().ArraySet;
var base64VLQ = require_base64_vlq();
var quickSort = require_quick_sort().quickSort;
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === "string") {
sourceMap = util.parseSourceMapInput(aSourceMap);
}
return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
}
SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
};
SourceMapConsumer.prototype._version = 3;
SourceMapConsumer.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
configurable: true,
enumerable: true,
get: function() {
if (!this.__generatedMappings) {
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__generatedMappings;
}
});
SourceMapConsumer.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
configurable: true,
enumerable: true,
get: function() {
if (!this.__originalMappings) {
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__originalMappings;
}
});
SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
var c = aStr.charAt(index);
return c === ";" || c === ",";
};
SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
throw new Error("Subclasses must implement _parseMappings");
};
SourceMapConsumer.GENERATED_ORDER = 1;
SourceMapConsumer.ORIGINAL_ORDER = 2;
SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
SourceMapConsumer.LEAST_UPPER_BOUND = 2;
SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
var context = aContext || null;
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
var mappings;
switch (order) {
case SourceMapConsumer.GENERATED_ORDER:
mappings = this._generatedMappings;
break;
case SourceMapConsumer.ORIGINAL_ORDER:
mappings = this._originalMappings;
break;
default:
throw new Error("Unknown order of iteration.");
}
var sourceRoot = this.sourceRoot;
mappings.map(function(mapping) {
var source = mapping.source === null ? null : this._sources.at(mapping.source);
source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
return {
source,
generatedLine: mapping.generatedLine,
generatedColumn: mapping.generatedColumn,
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: mapping.name === null ? null : this._names.at(mapping.name)
};
}, this).forEach(aCallback, context);
};
SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
var line = util.getArg(aArgs, "line");
var needle = {
source: util.getArg(aArgs, "source"),
originalLine: line,
originalColumn: util.getArg(aArgs, "column", 0)
};
needle.source = this._findSourceIndex(needle.source);
if (needle.source < 0) {
return [];
}
var mappings = [];
var index = this._findMapping(
needle,
this._originalMappings,
"originalLine",
"originalColumn",
util.compareByOriginalPositions,
binarySearch.LEAST_UPPER_BOUND
);
if (index >= 0) {
var mapping = this._originalMappings[index];
if (aArgs.column === void 0) {
var originalLine = mapping.originalLine;
while (mapping && mapping.originalLine === originalLine) {
mappings.push({
line: util.getArg(mapping, "generatedLine", null),
column: util.getArg(mapping, "generatedColumn", null),
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
});
mapping = this._originalMappings[++index];
}
} else {
var originalColumn = mapping.originalColumn;
while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
mappings.push({
line: util.getArg(mapping, "generatedLine", null),
column: util.getArg(mapping, "generatedColumn", null),
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
});
mapping = this._originalMappings[++index];
}
}
}
return mappings;
};
exports2.SourceMapConsumer = SourceMapConsumer;
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === "string") {
sourceMap = util.parseSourceMapInput(aSourceMap);
}
var version2 = util.getArg(sourceMap, "version");
var sources = util.getArg(sourceMap, "sources");
var names = util.getArg(sourceMap, "names", []);
var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
var mappings = util.getArg(sourceMap, "mappings");
var file2 = util.getArg(sourceMap, "file", null);
if (version2 != this._version) {
throw new Error("Unsupported version: " + version2);
}
if (sourceRoot) {
sourceRoot = util.normalize(sourceRoot);
}
sources = sources.map(String).map(util.normalize).map(function(source) {
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
});
this._names = ArraySet.fromArray(names.map(String), true);
this._sources = ArraySet.fromArray(sources, true);
this._absoluteSources = this._sources.toArray().map(function(s) {
return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
});
this.sourceRoot = sourceRoot;
this.sourcesContent = sourcesContent;
this._mappings = mappings;
this._sourceMapURL = aSourceMapURL;
this.file = file2;
}
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
var relativeSource = aSource;
if (this.sourceRoot != null) {
relativeSource = util.relative(this.sourceRoot, relativeSource);
}
if (this._sources.has(relativeSource)) {
return this._sources.indexOf(relativeSource);
}
var i;
for (i = 0; i < this._absoluteSources.length; ++i) {
if (this._absoluteSources[i] == aSource) {
return i;
}
}
return -1;
};
BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
var smc = Object.create(BasicSourceMapConsumer.prototype);
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
smc.sourceRoot = aSourceMap._sourceRoot;
smc.sourcesContent = aSourceMap._generateSourcesContent(
smc._sources.toArray(),
smc.sourceRoot
);
smc.file = aSourceMap._file;
smc._sourceMapURL = aSourceMapURL;
smc._absoluteSources = smc._sources.toArray().map(function(s) {
return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
});
var generatedMappings = aSourceMap._mappings.toArray().slice();
var destGeneratedMappings = smc.__generatedMappings = [];
var destOriginalMappings = smc.__originalMappings = [];
for (var i = 0, length = generatedMappings.length; i < length; i++) {
var srcMapping = generatedMappings[i];
var destMapping = new Mapping();
destMapping.generatedLine = srcMapping.generatedLine;
destMapping.generatedColumn = srcMapping.generatedColumn;
if (srcMapping.source) {
destMapping.source = sources.indexOf(srcMapping.source);
destMapping.originalLine = srcMapping.originalLine;
destMapping.originalColumn = srcMapping.originalColumn;
if (srcMapping.name) {
destMapping.name = names.indexOf(srcMapping.name);
}
destOriginalMappings.push(destMapping);
}
destGeneratedMappings.push(destMapping);
}
quickSort(smc.__originalMappings, util.compareByOriginalPositions);
return smc;
};
BasicSourceMapConsumer.prototype._version = 3;
Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
get: function() {
return this._absoluteSources.slice();
}
});
function Mapping() {
this.generatedLine = 0;
this.generatedColumn = 0;
this.source = null;
this.originalLine = null;
this.originalColumn = null;
this.name = null;
}
BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
var generatedLine = 1;
var previousGeneratedColumn = 0;
var previousOriginalLine = 0;
var previousOriginalColumn = 0;
var previousSource = 0;
var previousName = 0;
var length = aStr.length;
var index = 0;
var cachedSegments = {};
var temp = {};
var originalMappings = [];
var generatedMappings = [];
var mapping, str, segment, end, value;
while (index < length) {
if (aStr.charAt(index) === ";") {
generatedLine++;
index++;
previousGeneratedColumn = 0;
} else if (aStr.charAt(index) === ",") {
index++;
} else {
mapping = new Mapping();
mapping.generatedLine = generatedLine;
for (end = index; end < length; end++) {
if (this._charIsMappingSeparator(aStr, end)) {
break;
}
}
str = aStr.slice(index, end);
segment = cachedSegments[str];
if (segment) {
index += str.length;
} else {
segment = [];
while (index < end) {
base64VLQ.decode(aStr, index, temp);
value = temp.value;
index = temp.rest;
segment.push(value);
}
if (segment.length === 2) {
throw new Error("Found a source, but no line and column");
}
if (segment.length === 3) {
throw new Error("Found a source and line, but no column");
}
cachedSegments[str] = segment;
}
mapping.generatedColumn = previousGeneratedColumn + segment[0];
previousGeneratedColumn = mapping.generatedColumn;
if (segment.length > 1) {
mapping.source = previousSource + segment[1];
previousSource += segment[1];
mapping.originalLine = previousOriginalLine + segment[2];
previousOriginalLine = mapping.originalLine;
mapping.originalLine += 1;
mapping.originalColumn = previousOriginalColumn + segment[3];
previousOriginalColumn = mapping.originalColumn;
if (segment.length > 4) {
mapping.name = previousName + segment[4];
previousName += segment[4];
}
}
generatedMappings.push(mapping);
if (typeof mapping.originalLine === "number") {
originalMappings.push(mapping);
}
}
}
quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
this.__generatedMappings = generatedMappings;
quickSort(originalMappings, util.compareByOriginalPositions);
this.__originalMappings = originalMappings;
};
BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
if (aNeedle[aLineName] <= 0) {
throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
}
if (aNeedle[aColumnName] < 0) {
throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
}
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
};
BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
for (var index = 0; index < this._generatedMappings.length; ++index) {
var mapping = this._generatedMappings[index];
if (index + 1 < this._generatedMappings.length) {
var nextMapping = this._generatedMappings[index + 1];
if (mapping.generatedLine === nextMapping.generatedLine) {
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
continue;
}
}
mapping.lastGeneratedColumn = Infinity;
}
};
BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, "line"),
generatedColumn: util.getArg(aArgs, "column")
};
var index = this._findMapping(
needle,
this._generatedMappings,
"generatedLine",
"generatedColumn",
util.compareByGeneratedPositionsDeflated,
util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
);
if (index >= 0) {
var mapping = this._generatedMappings[index];
if (mapping.generatedLine === needle.generatedLine) {
var source = util.getArg(mapping, "source", null);
if (source !== null) {
source = this._sources.at(source);
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
}
var name = util.getArg(mapping, "name", null);
if (name !== null) {
name = this._names.at(name);
}
return {
source,
line: util.getArg(mapping, "originalLine", null),
column: util.getArg(mapping, "originalColumn", null),
name
};
}
}
return {
source: null,
line: null,
column: null,
name: null
};
};
BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
if (!this.sourcesContent) {
return false;
}
return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
return sc == null;
});
};
BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
if (!this.sourcesContent) {
return null;
}
var index = this._findSourceIndex(aSource);
if (index >= 0) {
return this.sourcesContent[index];
}
var relativeSource = aSource;
if (this.sourceRoot != null) {
relativeSource = util.relative(this.sourceRoot, relativeSource);
}
var url4;
if (this.sourceRoot != null && (url4 = util.urlParse(this.sourceRoot))) {
var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
if (url4.scheme == "file" && this._sources.has(fileUriAbsPath)) {
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
}
if ((!url4.path || url4.path == "/") && this._sources.has("/" + relativeSource)) {
return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
}
}
if (nullOnMissing) {
return null;
} else {
throw new Error('"' + relativeSource + '" is not in the SourceMap.');
}
};
BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
var source = util.getArg(aArgs, "source");
source = this._findSourceIndex(source);
if (source < 0) {
return {
line: null,
column: null,
lastColumn: null
};
}
var needle = {
source,
originalLine: util.getArg(aArgs, "line"),
originalColumn: util.getArg(aArgs, "column")
};
var index = this._findMapping(
needle,
this._originalMappings,
"originalLine",
"originalColumn",
util.compareByOriginalPositions,
util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
);
if (index >= 0) {
var mapping = this._originalMappings[index];
if (mapping.source === needle.source) {
return {
line: util.getArg(mapping, "generatedLine", null),
column: util.getArg(mapping, "generatedColumn", null),
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
};
}
}
return {
line: null,
column: null,
lastColumn: null
};
};
exports2.BasicSourceMapConsumer = BasicSourceMapConsumer;
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === "string") {
sourceMap = util.parseSourceMapInput(aSourceMap);
}
var version2 = util.getArg(sourceMap, "version");
var sections = util.getArg(sourceMap, "sections");
if (version2 != this._version) {
throw new Error("Unsupported version: " + version2);
}
this._sources = new ArraySet();
this._names = new ArraySet();
var lastOffset = {
line: -1,
column: 0
};
this._sections = sections.map(function(s) {
if (s.url) {
throw new Error("Support for url field in sections not implemented.");
}
var offset = util.getArg(s, "offset");
var offsetLine = util.getArg(offset, "line");
var offsetColumn = util.getArg(offset, "column");
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
throw new Error("Section offsets must be ordered and non-overlapping.");
}
lastOffset = offset;
return {
generatedOffset: {
// The offset fields are 0-based, but we use 1-based indices when
// encoding/decoding from VLQ.
generatedLine: offsetLine + 1,
generatedColumn: offsetColumn + 1
},
consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
};
});
}
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
IndexedSourceMapConsumer.prototype._version = 3;
Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
get: function() {
var sources = [];
for (var i = 0; i < this._sections.length; i++) {
for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
sources.push(this._sections[i].consumer.sources[j]);
}
}
return sources;
}
});
IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, "line"),
generatedColumn: util.getArg(aArgs, "column")
};
var sectionIndex = binarySearch.search(
needle,
this._sections,
function(needle2, section2) {
var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
if (cmp) {
return cmp;
}
return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
}
);
var section = this._sections[sectionIndex];
if (!section) {
return {
source: null,
line: null,
column: null,
name: null
};
}
return section.consumer.originalPositionFor({
line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
bias: aArgs.bias
});
};
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
return this._sections.every(function(s) {
return s.consumer.hasContentsOfAllSources();
});
};
IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
for (var i = 0; i < this._sections.length; i++) {
var section = this._sections[i];
var content = section.consumer.sourceContentFor(aSource, true);
if (content) {
return content;
}
}
if (nullOnMissing) {
return null;
} else {
throw new Error('"' + aSource + '" is not in the SourceMap.');
}
};
IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
for (var i = 0; i < this._sections.length; i++) {
var section = this._sections[i];
if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
continue;
}
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
if (generatedPosition) {
var ret = {
line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
};
return ret;
}
}
return {
line: null,
column: null
};
};
IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
this.__generatedMappings = [];
this.__originalMappings = [];
for (var i = 0; i < this._sections.length; i++) {
var section = this._sections[i];
var sectionMappings = section.consumer._generatedMappings;
for (var j = 0; j < sectionMappings.length; j++) {
var mapping = sectionMappings[j];
var source = section.consumer._sources.at(mapping.source);
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
this._sources.add(source);
source = this._sources.indexOf(source);
var name = null;
if (mapping.name) {
name = section.consumer._names.at(mapping.name);
this._names.add(name);
name = this._names.indexOf(name);
}
var adjustedMapping = {
source,
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name
};
this.__generatedMappings.push(adjustedMapping);
if (typeof adjustedMapping.originalLine === "number") {
this.__originalMappings.push(adjustedMapping);
}
}
}
quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
quickSort(this.__originalMappings, util.compareByOriginalPositions);
};
exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
}
});
// node_modules/source-map/lib/source-node.js
var require_source_node = __commonJS({
"node_modules/source-map/lib/source-node.js"(exports2) {
var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
var util = require_util();
var REGEX_NEWLINE = /(\r?\n)/;
var NEWLINE_CODE = 10;
var isSourceNode = "$$$isSourceNode$$$";
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];
this.sourceContents = {};
this.line = aLine == null ? null : aLine;
this.column = aColumn == null ? null : aColumn;
this.source = aSource == null ? null : aSource;
this.name = aName == null ? null : aName;
this[isSourceNode] = true;
if (aChunks != null) this.add(aChunks);
}
SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
var node = new SourceNode();
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
var remainingLinesIndex = 0;
var shiftNextLine = function() {
var lineContents = getNextLine();
var newLine = getNextLine() || "";
return lineContents + newLine;
function getNextLine() {
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
}
};
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
var lastMapping = null;
aSourceMapConsumer.eachMapping(function(mapping) {
if (lastMapping !== null) {
if (lastGeneratedLine < mapping.generatedLine) {
addMappingWithCode(lastMapping, shiftNextLine());
lastGeneratedLine++;
lastGeneratedColumn = 0;
} else {
var nextLine = remainingLines[remainingLinesIndex] || "";
var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
lastGeneratedColumn = mapping.generatedColumn;
addMappingWithCode(lastMapping, code);
lastMapping = mapping;
return;
}
}
while (lastGeneratedLine < mapping.generatedLine) {
node.add(shiftNextLine());
lastGeneratedLine++;
}
if (lastGeneratedColumn < mapping.generatedColumn) {
var nextLine = remainingLines[remainingLinesIndex] || "";
node.add(nextLine.substr(0, mapping.generatedColumn));
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
lastGeneratedColumn = mapping.generatedColumn;
}
lastMapping = mapping;
}, this);
if (remainingLinesIndex < remainingLines.length) {
if (lastMapping) {
addMappingWithCode(lastMapping, shiftNextLine());
}
node.add(remainingLines.splice(remainingLinesIndex).join(""));
}
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aRelativePath != null) {
sourceFile = util.join(aRelativePath, sourceFile);
}
node.setSourceContent(sourceFile, content);
}
});
return node;
function addMappingWithCode(mapping, code) {
if (mapping === null || mapping.source === void 0) {
node.add(code);
} else {
var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
node.add(new SourceNode(
mapping.originalLine,
mapping.originalColumn,
source,
code,
mapping.name
));
}
}
};
SourceNode.prototype.add = function SourceNode_add(aChunk) {
if (Array.isArray(aChunk)) {
aChunk.forEach(function(chunk) {
this.add(chunk);
}, this);
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
if (aChunk) {
this.children.push(aChunk);
}
} else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
if (Array.isArray(aChunk)) {
for (var i = aChunk.length - 1; i >= 0; i--) {
this.prepend(aChunk[i]);
}
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
this.children.unshift(aChunk);
} else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
var chunk;
for (var i = 0, len = this.children.length; i < len; i++) {
chunk = this.children[i];
if (chunk[isSourceNode]) {
chunk.walk(aFn);
} else {
if (chunk !== "") {
aFn(chunk, {
source: this.source,
line: this.line,
column: this.column,
name: this.name
});
}
}
}
};
SourceNode.prototype.join = function SourceNode_join(aSep) {
var newChildren;
var i;
var len = this.children.length;
if (len > 0) {
newChildren = [];
for (i = 0; i < len - 1; i++) {
newChildren.push(this.children[i]);
newChildren.push(aSep);
}
newChildren.push(this.children[i]);
this.children = newChildren;
}
return this;
};
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
var lastChild = this.children[this.children.length - 1];
if (lastChild[isSourceNode]) {
lastChild.replaceRight(aPattern, aReplacement);
} else if (typeof lastChild === "string") {
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
} else {
this.children.push("".replace(aPattern, aReplacement));
}
return this;
};
SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
};
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
for (var i = 0, len = this.children.length; i < len; i++) {
if (this.children[i][isSourceNode]) {
this.children[i].walkSourceContents(aFn);
}
}
var sources = Object.keys(this.sourceContents);
for (var i = 0, len = sources.length; i < len; i++) {
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
}
};
SourceNode.prototype.toString = function SourceNode_toString() {
var str = "";
this.walk(function(chunk) {
str += chunk;
});
return str;
};
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: "",
line: 1,
column: 0
};
var map = new SourceMapGenerator(aArgs);
var sourceMappingActive = false;
var lastOriginalSource = null;
var lastOriginalLine = null;
var lastOriginalColumn = null;
var lastOriginalName = null;
this.walk(function(chunk, original) {
generated.code += chunk;
if (original.source !== null && original.line !== null && original.column !== null) {
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
lastOriginalSource = original.source;
lastOriginalLine = original.line;
lastOriginalColumn = original.column;
lastOriginalName = original.name;
sourceMappingActive = true;
} else if (sourceMappingActive) {
map.addMapping({
generated: {
line: generated.line,
column: generated.column
}
});
lastOriginalSource = null;
sourceMappingActive = false;
}
for (var idx = 0, length = chunk.length; idx < length; idx++) {
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
generated.line++;
generated.column = 0;
if (idx + 1 === length) {
lastOriginalSource = null;
sourceMappingActive = false;
} else if (sourceMappingActive) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
} else {
generated.column++;
}
}
});
this.walkSourceContents(function(sourceFile, sourceContent) {
map.setSourceContent(sourceFile, sourceContent);
});
return { code: generated.code, map };
};
exports2.SourceNode = SourceNode;
}
});
// node_modules/source-map/source-map.js
var require_source_map = __commonJS({
"node_modules/source-map/source-map.js"(exports2) {
exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
exports2.SourceNode = require_source_node().SourceNode;
}
});
// node_modules/buffer-from/index.js
var require_buffer_from = __commonJS({
"node_modules/buffer-from/index.js"(exports2, module2) {
var toString = Object.prototype.toString;
var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
function isArrayBuffer(input) {
return toString.call(input).slice(8, -1) === "ArrayBuffer";
}
function fromArrayBuffer(obj, byteOffset, length) {
byteOffset >>>= 0;
var maxLength = obj.byteLength - byteOffset;
if (maxLength < 0) {
throw new RangeError("'offset' is out of bounds");
}
if (length === void 0) {
length = maxLength;
} else {
length >>>= 0;
if (length > maxLength) {
throw new RangeError("'length' is out of bounds");
}
}
return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
}
function fromString(string, encoding) {
if (typeof encoding !== "string" || encoding === "") {
encoding = "utf8";
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding');
}
return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
}
function bufferFrom(value, encodingOrOffset, length) {
if (typeof value === "number") {
throw new TypeError('"value" argument must not be a number');
}
if (isArrayBuffer(value)) {
return fromArrayBuffer(value, encodingOrOffset, length);
}
if (typeof value === "string") {
return fromString(value, encodingOrOffset);
}
return isModern ? Buffer.from(value) : new Buffer(value);
}
module2.exports = bufferFrom;
}
});
// node_modules/source-map-support/source-map-support.js
var require_source_map_support = __commonJS({
"node_modules/source-map-support/source-map-support.js"(exports2, module2) {
var SourceMapConsumer = require_source_map().SourceMapConsumer;
var path7 = require("path");
var fs7;
try {
fs7 = require("fs");
if (!fs7.existsSync || !fs7.readFileSync) {
fs7 = null;
}
} catch (err) {
}
var bufferFrom = require_buffer_from();
function dynamicRequire(mod, request) {
return mod.require(request);
}
var errorFormatterInstalled = false;
var uncaughtShimInstalled = false;
var emptyCacheBetweenOperations = false;
var environment = "auto";
var fileContentsCache = {};
var sourceMapCache = {};
var reSourceMap = /^data:application\/json[^,]+base64,/;
var retrieveFileHandlers = [];
var retrieveMapHandlers = [];
function isInBrowser() {
if (environment === "browser")
return true;
if (environment === "node")
return false;
return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
}
function hasGlobalProcessEventEmitter() {
return typeof process === "object" && process !== null && typeof process.on === "function";
}
function globalProcessVersion() {
if (typeof process === "object" && process !== null) {
return process.version;
} else {
return "";
}
}
function globalProcessStderr() {
if (typeof process === "object" && process !== null) {
return process.stderr;
}
}
function globalProcessExit(code) {
if (typeof process === "object" && process !== null && typeof process.exit === "function") {
return process.exit(code);
}
}
function handlerExec(list) {
return function(arg) {
for (var i = 0; i < list.length; i++) {
var ret = list[i](arg);
if (ret) {
return ret;
}
}
return null;
};
}
var retrieveFile = handlerExec(retrieveFileHandlers);
retrieveFileHandlers.push(function(path8) {
path8 = path8.trim();
if (/^file:/.test(path8)) {
path8 = path8.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
return drive ? "" : (
// file:///C:/dir/file -> C:/dir/file
"/"
);
});
}
if (path8 in fileContentsCache) {
return fileContentsCache[path8];
}
var contents = "";
try {
if (!fs7) {
var xhr = new XMLHttpRequest();
xhr.open(
"GET",
path8,
/** async */
false
);
xhr.send(null);
if (xhr.readyState === 4 && xhr.status === 200) {
contents = xhr.responseText;
}
} else if (fs7.existsSync(path8)) {
contents = fs7.readFileSync(path8, "utf8");
}
} catch (er) {
}
return fileContentsCache[path8] = contents;
});
function supportRelativeURL(file2, url4) {
if (!file2) return url4;
var dir = path7.dirname(file2);
var match2 = /^\w+:\/\/[^\/]*/.exec(dir);
var protocol = match2 ? match2[0] : "";
var startPath = dir.slice(protocol.length);
if (protocol && /^\/\w\:/.test(startPath)) {
protocol += "/";
return protocol + path7.resolve(dir.slice(protocol.length), url4).replace(/\\/g, "/");
}
return protocol + path7.resolve(dir.slice(protocol.length), url4);
}
function retrieveSourceMapURL(source) {
var fileData;
if (isInBrowser()) {
try {
var xhr = new XMLHttpRequest();
xhr.open("GET", source, false);
xhr.send(null);
fileData = xhr.readyState === 4 ? xhr.responseText : null;
var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
if (sourceMapHeader) {
return sourceMapHeader;
}
} catch (e) {
}
}
fileData = retrieveFile(source);
var re2 = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
var lastMatch, match2;
while (match2 = re2.exec(fileData)) lastMatch = match2;
if (!lastMatch) return null;
return lastMatch[1];
}
var retrieveSourceMap = handlerExec(retrieveMapHandlers);
retrieveMapHandlers.push(function(source) {
var sourceMappingURL = retrieveSourceMapURL(source);
if (!sourceMappingURL) return null;
var sourceMapData;
if (reSourceMap.test(sourceMappingURL)) {
var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
sourceMapData = bufferFrom(rawData, "base64").toString();
sourceMappingURL = source;
} else {
sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
sourceMapData = retrieveFile(sourceMappingURL);
}
if (!sourceMapData) {
return null;
}
return {
url: sourceMappingURL,
map: sourceMapData
};
});
function mapSourcePosition(position) {
var sourceMap = sourceMapCache[position.source];
if (!sourceMap) {
var urlAndMap = retrieveSourceMap(position.source);
if (urlAndMap) {
sourceMap = sourceMapCache[position.source] = {
url: urlAndMap.url,
map: new SourceMapConsumer(urlAndMap.map)
};
if (sourceMap.map.sourcesContent) {
sourceMap.map.sources.forEach(function(source, i) {
var contents = sourceMap.map.sourcesContent[i];
if (contents) {
var url4 = supportRelativeURL(sourceMap.url, source);
fileContentsCache[url4] = contents;
}
});
}
} else {
sourceMap = sourceMapCache[position.source] = {
url: null,
map: null
};
}
}
if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
var originalPosition = sourceMap.map.originalPositionFor(position);
if (originalPosition.source !== null) {
originalPosition.source = supportRelativeURL(
sourceMap.url,
originalPosition.source
);
return originalPosition;
}
}
return position;
}
function mapEvalOrigin(origin) {
var match2 = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
if (match2) {
var position = mapSourcePosition({
source: match2[2],
line: +match2[3],
column: match2[4] - 1
});
return "eval at " + match2[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
}
match2 = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
if (match2) {
return "eval at " + match2[1] + " (" + mapEvalOrigin(match2[2]) + ")";
}
return origin;
}
function CallSiteToString() {
var fileName2;
var fileLocation = "";
if (this.isNative()) {
fileLocation = "native";
} else {
fileName2 = this.getScriptNameOrSourceURL();
if (!fileName2 && this.isEval()) {
fileLocation = this.getEvalOrigin();
fileLocation += ", ";
}
if (fileName2) {
fileLocation += fileName2;
} else {
fileLocation += "<anonymous>";
}
var lineNumber = this.getLineNumber();
if (lineNumber != null) {
fileLocation += ":" + lineNumber;
var columnNumber = this.getColumnNumber();
if (columnNumber) {
fileLocation += ":" + columnNumber;
}
}
}
var line = "";
var functionName = this.getFunctionName();
var addSuffix = true;
var isConstructor = this.isConstructor();
var isMethodCall = !(this.isToplevel() || isConstructor);
if (isMethodCall) {
var typeName = this.getTypeName();
if (typeName === "[object Object]") {
typeName = "null";
}
var methodName = this.getMethodName();
if (functionName) {
if (typeName && functionName.indexOf(typeName) != 0) {
line += typeName + ".";
}
line += functionName;
if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
line += " [as " + methodName + "]";
}
} else {
line += typeName + "." + (methodName || "<anonymous>");
}
} else if (isConstructor) {
line += "new " + (functionName || "<anonymous>");
} else if (functionName) {
line += functionName;
} else {
line += fileLocation;
addSuffix = false;
}
if (addSuffix) {
line += " (" + fileLocation + ")";
}
return line;
}
function cloneCallSite(frame) {
var object = {};
Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
object[name] = /^(?:is|get)/.test(name) ? function() {
return frame[name].call(frame);
} : frame[name];
});
object.toString = CallSiteToString;
return object;
}
function wrapCallSite(frame, state) {
if (state === void 0) {
state = { nextPosition: null, curPosition: null };
}
if (frame.isNative()) {
state.curPosition = null;
return frame;
}
var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
if (source) {
var line = frame.getLineNumber();
var column = frame.getColumnNumber() - 1;
var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
column -= headerLength;
}
var position = mapSourcePosition({
source,
line,
column
});
state.curPosition = position;
frame = cloneCallSite(frame);
var originalFunctionName = frame.getFunctionName;
frame.getFunctionName = function() {
if (state.nextPosition == null) {
return originalFunctionName();
}
return state.nextPosition.name || originalFunctionName();
};
frame.getFileName = function() {
return position.source;
};
frame.getLineNumber = function() {
return position.line;
};
frame.getColumnNumber = function() {
return position.column + 1;
};
frame.getScriptNameOrSourceURL = function() {
return position.source;
};
return frame;
}
var origin = frame.isEval() && frame.getEvalOrigin();
if (origin) {
origin = mapEvalOrigin(origin);
frame = cloneCallSite(frame);
frame.getEvalOrigin = function() {
return origin;
};
return frame;
}
return frame;
}
function prepareStackTrace(error, stack) {
if (emptyCacheBetweenOperations) {
fileContentsCache = {};
sourceMapCache = {};
}
var name = error.name || "Error";
var message = error.message || "";
var errorString = name + ": " + message;
var state = { nextPosition: null, curPosition: null };
var processedStack = [];
for (var i = stack.length - 1; i >= 0; i--) {
processedStack.push("\n at " + wrapCallSite(stack[i], state));
state.nextPosition = state.curPosition;
}
state.curPosition = state.nextPosition = null;
return errorString + processedStack.reverse().join("");
}
function getErrorSource(error) {
var match2 = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
if (match2) {
var source = match2[1];
var line = +match2[2];
var column = +match2[3];
var contents = fileContentsCache[source];
if (!contents && fs7 && fs7.existsSync(source)) {
try {
contents = fs7.readFileSync(source, "utf8");
} catch (er) {
contents = "";
}
}
if (contents) {
var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
if (code) {
return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
}
}
}
return null;
}
function printErrorAndExit(error) {
var source = getErrorSource(error);
var stderr = globalProcessStderr();
if (stderr && stderr._handle && stderr._handle.setBlocking) {
stderr._handle.setBlocking(true);
}
if (source) {
console.error();
console.error(source);
}
console.error(error.stack);
globalProcessExit(1);
}
function shimEmitUncaughtException() {
var origEmit = process.emit;
process.emit = function(type) {
if (type === "uncaughtException") {
var hasStack = arguments[1] && arguments[1].stack;
var hasListeners = this.listeners(type).length > 0;
if (hasStack && !hasListeners) {
return printErrorAndExit(arguments[1]);
}
}
return origEmit.apply(this, arguments);
};
}
var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
exports2.wrapCallSite = wrapCallSite;
exports2.getErrorSource = getErrorSource;
exports2.mapSourcePosition = mapSourcePosition;
exports2.retrieveSourceMap = retrieveSourceMap;
exports2.install = function(options) {
options = options || {};
if (options.environment) {
environment = options.environment;
if (["node", "browser", "auto"].indexOf(environment) === -1) {
throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
}
}
if (options.retrieveFile) {
if (options.overrideRetrieveFile) {
retrieveFileHandlers.length = 0;
}
retrieveFileHandlers.unshift(options.retrieveFile);
}
if (options.retrieveSourceMap) {
if (options.overrideRetrieveSourceMap) {
retrieveMapHandlers.length = 0;
}
retrieveMapHandlers.unshift(options.retrieveSourceMap);
}
if (options.hookRequire && !isInBrowser()) {
var Module3 = dynamicRequire(module2, "module");
var $compile = Module3.prototype._compile;
if (!$compile.__sourceMapSupport) {
Module3.prototype._compile = function(content, filename) {
fileContentsCache[filename] = content;
sourceMapCache[filename] = void 0;
return $compile.call(this, content, filename);
};
Module3.prototype._compile.__sourceMapSupport = true;
}
}
if (!emptyCacheBetweenOperations) {
emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
}
if (!errorFormatterInstalled) {
errorFormatterInstalled = true;
Error.prepareStackTrace = prepareStackTrace;
}
if (!uncaughtShimInstalled) {
var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
try {
var worker_threads = dynamicRequire(module2, "worker_threads");
if (worker_threads.isMainThread === false) {
installHandler = false;
}
} catch (e) {
}
if (installHandler && hasGlobalProcessEventEmitter()) {
uncaughtShimInstalled = true;
shimEmitUncaughtException();
}
}
};
exports2.resetRetrieveHandlers = function() {
retrieveFileHandlers.length = 0;
retrieveMapHandlers.length = 0;
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
retrieveSourceMap = handlerExec(retrieveMapHandlers);
retrieveFile = handlerExec(retrieveFileHandlers);
};
}
});
// node_modules/json5/lib/unicode.js
var require_unicode = __commonJS({
"node_modules/json5/lib/unicode.js"(exports2, module2) {
module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
module2.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
}
});
// node_modules/json5/lib/util.js
var require_util2 = __commonJS({
"node_modules/json5/lib/util.js"(exports2, module2) {
var unicode = require_unicode();
module2.exports = {
isSpaceSeparator(c) {
return typeof c === "string" && unicode.Space_Separator.test(c);
},
isIdStartChar(c) {
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
},
isIdContinueChar(c) {
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
},
isDigit(c) {
return typeof c === "string" && /[0-9]/.test(c);
},
isHexDigit(c) {
return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
}
};
}
});
// node_modules/json5/lib/parse.js
var require_parse = __commonJS({
"node_modules/json5/lib/parse.js"(exports2, module2) {
var util = require_util2();
var source;
var parseState;
var stack;
var pos;
var line;
var column;
var token;
var key;
var root;
module2.exports = function parse(text, reviver) {
source = String(text);
parseState = "start";
stack = [];
pos = 0;
line = 1;
column = 0;
token = void 0;
key = void 0;
root = void 0;
do {
token = lex();
parseStates[parseState]();
} while (token.type !== "eof");
if (typeof reviver === "function") {
return internalize({ "": root }, "", reviver);
}
return root;
};
function internalize(holder, name, reviver) {
const value = holder[name];
if (value != null && typeof value === "object") {
if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++) {
const key2 = String(i);
const replacement = internalize(value, key2, reviver);
if (replacement === void 0) {
delete value[key2];
} else {
Object.defineProperty(value, key2, {
value: replacement,
writable: true,
enumerable: true,
configurable: true
});
}
}
} else {
for (const key2 in value) {
const replacement = internalize(value, key2, reviver);
if (replacement === void 0) {
delete value[key2];
} else {
Object.defineProperty(value, key2, {
value: replacement,
writable: true,
enumerable: true,
configurable: true
});
}
}
}
}
return reviver.call(holder, name, value);
}
var lexState;
var buffer;
var doubleQuote;
var sign;
var c;
function lex() {
lexState = "default";
buffer = "";
doubleQuote = false;
sign = 1;
for (; ; ) {
c = peek();
const token2 = lexStates[lexState]();
if (token2) {
return token2;
}
}
}
function peek() {
if (source[pos]) {
return String.fromCodePoint(source.codePointAt(pos));
}
}
function read() {
const c2 = peek();
if (c2 === "\n") {
line++;
column = 0;
} else if (c2) {
column += c2.length;
} else {
column++;
}
if (c2) {
pos += c2.length;
}
return c2;
}
var lexStates = {
default() {
switch (c) {
case " ":
case "\v":
case "\f":
case " ":
case "\xA0":
case "\uFEFF":
case "\n":
case "\r":
case "\u2028":
case "\u2029":
read();
return;
case "/":
read();
lexState = "comment";
return;
case void 0:
read();
return newToken("eof");
}
if (util.isSpaceSeparator(c)) {
read();
return;
}
return lexStates[parseState]();
},
comment() {
switch (c) {
case "*":
read();
lexState = "multiLineComment";
return;
case "/":
read();
lexState = "singleLineComment";
return;
}
throw invalidChar(read());
},
multiLineComment() {
switch (c) {
case "*":
read();
lexState = "multiLineCommentAsterisk";
return;
case void 0:
throw invalidChar(read());
}
read();
},
multiLineCommentAsterisk() {
switch (c) {
case "*":
read();
return;
case "/":
read();
lexState = "default";
return;
case void 0:
throw invalidChar(read());
}
read();
lexState = "multiLineComment";
},
singleLineComment() {
switch (c) {
case "\n":
case "\r":
case "\u2028":
case "\u2029":
read();
lexState = "default";
return;
case void 0:
read();
return newToken("eof");
}
read();
},
value() {
switch (c) {
case "{":
case "[":
return newToken("punctuator", read());
case "n":
read();
literal("ull");
return newToken("null", null);
case "t":
read();
literal("rue");
return newToken("boolean", true);
case "f":
read();
literal("alse");
return newToken("boolean", false);
case "-":
case "+":
if (read() === "-") {
sign = -1;
}
lexState = "sign";
return;
case ".":
buffer = read();
lexState = "decimalPointLeading";
return;
case "0":
buffer = read();
lexState = "zero";
return;
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
buffer = read();
lexState = "decimalInteger";
return;
case "I":
read();
literal("nfinity");
return newToken("numeric", Infinity);
case "N":
read();
literal("aN");
return newToken("numeric", NaN);
case '"':
case "'":
doubleQuote = read() === '"';
buffer = "";
lexState = "string";
return;
}
throw invalidChar(read());
},
identifierNameStartEscape() {
if (c !== "u") {
throw invalidChar(read());
}
read();
const u = unicodeEscape();
switch (u) {
case "$":
case "_":
break;
default:
if (!util.isIdStartChar(u)) {
throw invalidIdentifier();
}
break;
}
buffer += u;
lexState = "identifierName";
},
identifierName() {
switch (c) {
case "$":
case "_":
case "\u200C":
case "\u200D":
buffer += read();
return;
case "\\":
read();
lexState = "identifierNameEscape";
return;
}
if (util.isIdContinueChar(c)) {
buffer += read();
return;
}
return newToken("identifier", buffer);
},
identifierNameEscape() {
if (c !== "u") {
throw invalidChar(read());
}
read();
const u = unicodeEscape();
switch (u) {
case "$":
case "_":
case "\u200C":
case "\u200D":
break;
default:
if (!util.isIdContinueChar(u)) {
throw invalidIdentifier();
}
break;
}
buffer += u;
lexState = "identifierName";
},
sign() {
switch (c) {
case ".":
buffer = read();
lexState = "decimalPointLeading";
return;
case "0":
buffer = read();
lexState = "zero";
return;
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
buffer = read();
lexState = "decimalInteger";
return;
case "I":
read();
literal("nfinity");
return newToken("numeric", sign * Infinity);
case "N":
read();
literal("aN");
return newToken("numeric", NaN);
}
throw invalidChar(read());
},
zero() {
switch (c) {
case ".":
buffer += read();
lexState = "decimalPoint";
return;
case "e":
case "E":
buffer += read();
lexState = "decimalExponent";
return;
case "x":
case "X":
buffer += read();
lexState = "hexadecimal";
return;
}
return newToken("numeric", sign * 0);
},
decimalInteger() {
switch (c) {
case ".":
buffer += read();
lexState = "decimalPoint";
return;
case "e":
case "E":
buffer += read();
lexState = "decimalExponent";
return;
}
if (util.isDigit(c)) {
buffer += read();
return;
}
return newToken("numeric", sign * Number(buffer));
},
decimalPointLeading() {
if (util.isDigit(c)) {
buffer += read();
lexState = "decimalFraction";
return;
}
throw invalidChar(read());
},
decimalPoint() {
switch (c) {
case "e":
case "E":
buffer += read();
lexState = "decimalExponent";
return;
}
if (util.isDigit(c)) {
buffer += read();
lexState = "decimalFraction";
return;
}
return newToken("numeric", sign * Number(buffer));
},
decimalFraction() {
switch (c) {
case "e":
case "E":
buffer += read();
lexState = "decimalExponent";
return;
}
if (util.isDigit(c)) {
buffer += read();
return;
}
return newToken("numeric", sign * Number(buffer));
},
decimalExponent() {
switch (c) {
case "+":
case "-":
buffer += read();
lexState = "decimalExponentSign";
return;
}
if (util.isDigit(c)) {
buffer += read();
lexState = "decimalExponentInteger";
return;
}
throw invalidChar(read());
},
decimalExponentSign() {
if (util.isDigit(c)) {
buffer += read();
lexState = "decimalExponentInteger";
return;
}
throw invalidChar(read());
},
decimalExponentInteger() {
if (util.isDigit(c)) {
buffer += read();
return;
}
return newToken("numeric", sign * Number(buffer));
},
hexadecimal() {
if (util.isHexDigit(c)) {
buffer += read();
lexState = "hexadecimalInteger";
return;
}
throw invalidChar(read());
},
hexadecimalInteger() {
if (util.isHexDigit(c)) {
buffer += read();
return;
}
return newToken("numeric", sign * Number(buffer));
},
string() {
switch (c) {
case "\\":
read();
buffer += escape2();
return;
case '"':
if (doubleQuote) {
read();
return newToken("string", buffer);
}
buffer += read();
return;
case "'":
if (!doubleQuote) {
read();
return newToken("string", buffer);
}
buffer += read();
return;
case "\n":
case "\r":
throw invalidChar(read());
case "\u2028":
case "\u2029":
separatorChar(c);
break;
case void 0:
throw invalidChar(read());
}
buffer += read();
},
start() {
switch (c) {
case "{":
case "[":
return newToken("punctuator", read());
}
lexState = "value";
},
beforePropertyName() {
switch (c) {
case "$":
case "_":
buffer = read();
lexState = "identifierName";
return;
case "\\":
read();
lexState = "identifierNameStartEscape";
return;
case "}":
return newToken("punctuator", read());
case '"':
case "'":
doubleQuote = read() === '"';
lexState = "string";
return;
}
if (util.isIdStartChar(c)) {
buffer += read();
lexState = "identifierName";
return;
}
throw invalidChar(read());
},
afterPropertyName() {
if (c === ":") {
return newToken("punctuator", read());
}
throw invalidChar(read());
},
beforePropertyValue() {
lexState = "value";
},
afterPropertyValue() {
switch (c) {
case ",":
case "}":
return newToken("punctuator", read());
}
throw invalidChar(read());
},
beforeArrayValue() {
if (c === "]") {
return newToken("punctuator", read());
}
lexState = "value";
},
afterArrayValue() {
switch (c) {
case ",":
case "]":
return newToken("punctuator", read());
}
throw invalidChar(read());
},
end() {
throw invalidChar(read());
}
};
function newToken(type, value) {
return {
type,
value,
line,
column
};
}
function literal(s) {
for (const c2 of s) {
const p = peek();
if (p !== c2) {
throw invalidChar(read());
}
read();
}
}
function escape2() {
const c2 = peek();
switch (c2) {
case "b":
read();
return "\b";
case "f":
read();
return "\f";
case "n":
read();
return "\n";
case "r":
read();
return "\r";
case "t":
read();
return " ";
case "v":
read();
return "\v";
case "0":
read();
if (util.isDigit(peek())) {
throw invalidChar(read());
}
return "\0";
case "x":
read();
return hexEscape();
case "u":
read();
return unicodeEscape();
case "\n":
case "\u2028":
case "\u2029":
read();
return "";
case "\r":
read();
if (peek() === "\n") {
read();
}
return "";
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
throw invalidChar(read());
case void 0:
throw invalidChar(read());
}
return read();
}
function hexEscape() {
let buffer2 = "";
let c2 = peek();
if (!util.isHexDigit(c2)) {
throw invalidChar(read());
}
buffer2 += read();
c2 = peek();
if (!util.isHexDigit(c2)) {
throw invalidChar(read());
}
buffer2 += read();
return String.fromCodePoint(parseInt(buffer2, 16));
}
function unicodeEscape() {
let buffer2 = "";
let count = 4;
while (count-- > 0) {
const c2 = peek();
if (!util.isHexDigit(c2)) {
throw invalidChar(read());
}
buffer2 += read();
}
return String.fromCodePoint(parseInt(buffer2, 16));
}
var parseStates = {
start() {
if (token.type === "eof") {
throw invalidEOF();
}
push();
},
beforePropertyName() {
switch (token.type) {
case "identifier":
case "string":
key = token.value;
parseState = "afterPropertyName";
return;
case "punctuator":
pop();
return;
case "eof":
throw invalidEOF();
}
},
afterPropertyName() {
if (token.type === "eof") {
throw invalidEOF();
}
parseState = "beforePropertyValue";
},
beforePropertyValue() {
if (token.type === "eof") {
throw invalidEOF();
}
push();
},
beforeArrayValue() {
if (token.type === "eof") {
throw invalidEOF();
}
if (token.type === "punctuator" && token.value === "]") {
pop();
return;
}
push();
},
afterPropertyValue() {
if (token.type === "eof") {
throw invalidEOF();
}
switch (token.value) {
case ",":
parseState = "beforePropertyName";
return;
case "}":
pop();
}
},
afterArrayValue() {
if (token.type === "eof") {
throw invalidEOF();
}
switch (token.value) {
case ",":
parseState = "beforeArrayValue";
return;
case "]":
pop();
}
},
end() {
}
};
function push() {
let value;
switch (token.type) {
case "punctuator":
switch (token.value) {
case "{":
value = {};
break;
case "[":
value = [];
break;
}
break;
case "null":
case "boolean":
case "numeric":
case "string":
value = token.value;
break;
}
if (root === void 0) {
root = value;
} else {
const parent = stack[stack.length - 1];
if (Array.isArray(parent)) {
parent.push(value);
} else {
Object.defineProperty(parent, key, {
value,
writable: true,
enumerable: true,
configurable: true
});
}
}
if (value !== null && typeof value === "object") {
stack.push(value);
if (Array.isArray(value)) {
parseState = "beforeArrayValue";
} else {
parseState = "beforePropertyName";
}
} else {
const current = stack[stack.length - 1];
if (current == null) {
parseState = "end";
} else if (Array.isArray(current)) {
parseState = "afterArrayValue";
} else {
parseState = "afterPropertyValue";
}
}
}
function pop() {
stack.pop();
const current = stack[stack.length - 1];
if (current == null) {
parseState = "end";
} else if (Array.isArray(current)) {
parseState = "afterArrayValue";
} else {
parseState = "afterPropertyValue";
}
}
function invalidChar(c2) {
if (c2 === void 0) {
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
}
return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
}
function invalidEOF() {
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
}
function invalidIdentifier() {
column -= 5;
return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
}
function separatorChar(c2) {
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
}
function formatChar(c2) {
const replacements = {
"'": "\\'",
'"': '\\"',
"\\": "\\\\",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
" ": "\\t",
"\v": "\\v",
"\0": "\\0",
"\u2028": "\\u2028",
"\u2029": "\\u2029"
};
if (replacements[c2]) {
return replacements[c2];
}
if (c2 < " ") {
const hexString = c2.charCodeAt(0).toString(16);
return "\\x" + ("00" + hexString).substring(hexString.length);
}
return c2;
}
function syntaxError(message) {
const err = new SyntaxError(message);
err.lineNumber = line;
err.columnNumber = column;
return err;
}
}
});
// node_modules/json5/lib/stringify.js
var require_stringify = __commonJS({
"node_modules/json5/lib/stringify.js"(exports2, module2) {
var util = require_util2();
module2.exports = function stringify(value, replacer, space) {
const stack = [];
let indent = "";
let propertyList;
let replacerFunc;
let gap = "";
let quote;
if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
space = replacer.space;
quote = replacer.quote;
replacer = replacer.replacer;
}
if (typeof replacer === "function") {
replacerFunc = replacer;
} else if (Array.isArray(replacer)) {
propertyList = [];
for (const v of replacer) {
let item;
if (typeof v === "string") {
item = v;
} else if (typeof v === "number" || v instanceof String || v instanceof Number) {
item = String(v);
}
if (item !== void 0 && propertyList.indexOf(item) < 0) {
propertyList.push(item);
}
}
}
if (space instanceof Number) {
space = Number(space);
} else if (space instanceof String) {
space = String(space);
}
if (typeof space === "number") {
if (space > 0) {
space = Math.min(10, Math.floor(space));
gap = " ".substr(0, space);
}
} else if (typeof space === "string") {
gap = space.substr(0, 10);
}
return serializeProperty("", { "": value });
function serializeProperty(key, holder) {
let value2 = holder[key];
if (value2 != null) {
if (typeof value2.toJSON5 === "function") {
value2 = value2.toJSON5(key);
} else if (typeof value2.toJSON === "function") {
value2 = value2.toJSON(key);
}
}
if (replacerFunc) {
value2 = replacerFunc.call(holder, key, value2);
}
if (value2 instanceof Number) {
value2 = Number(value2);
} else if (value2 instanceof String) {
value2 = String(value2);
} else if (value2 instanceof Boolean) {
value2 = value2.valueOf();
}
switch (value2) {
case null:
return "null";
case true:
return "true";
case false:
return "false";
}
if (typeof value2 === "string") {
return quoteString(value2, false);
}
if (typeof value2 === "number") {
return String(value2);
}
if (typeof value2 === "object") {
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
}
return void 0;
}
function quoteString(value2) {
const quotes = {
"'": 0.1,
'"': 0.2
};
const replacements = {
"'": "\\'",
'"': '\\"',
"\\": "\\\\",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
" ": "\\t",
"\v": "\\v",
"\0": "\\0",
"\u2028": "\\u2028",
"\u2029": "\\u2029"
};
let product = "";
for (let i = 0; i < value2.length; i++) {
const c = value2[i];
switch (c) {
case "'":
case '"':
quotes[c]++;
product += c;
continue;
case "\0":
if (util.isDigit(value2[i + 1])) {
product += "\\x00";
continue;
}
}
if (replacements[c]) {
product += replacements[c];
continue;
}
if (c < " ") {
let hexString = c.charCodeAt(0).toString(16);
product += "\\x" + ("00" + hexString).substring(hexString.length);
continue;
}
product += c;
}
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
return quoteChar + product + quoteChar;
}
function serializeObject(value2) {
if (stack.indexOf(value2) >= 0) {
throw TypeError("Converting circular structure to JSON5");
}
stack.push(value2);
let stepback = indent;
indent = indent + gap;
let keys = propertyList || Object.keys(value2);
let partial = [];
for (const key of keys) {
const propertyString = serializeProperty(key, value2);
if (propertyString !== void 0) {
let member = serializeKey(key) + ":";
if (gap !== "") {
member += " ";
}
member += propertyString;
partial.push(member);
}
}
let final;
if (partial.length === 0) {
final = "{}";
} else {
let properties;
if (gap === "") {
properties = partial.join(",");
final = "{" + properties + "}";
} else {
let separator = ",\n" + indent;
properties = partial.join(separator);
final = "{\n" + indent + properties + ",\n" + stepback + "}";
}
}
stack.pop();
indent = stepback;
return final;
}
function serializeKey(key) {
if (key.length === 0) {
return quoteString(key, true);
}
const firstChar = String.fromCodePoint(key.codePointAt(0));
if (!util.isIdStartChar(firstChar)) {
return quoteString(key, true);
}
for (let i = firstChar.length; i < key.length; i++) {
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
return quoteString(key, true);
}
}
return key;
}
function serializeArray(value2) {
if (stack.indexOf(value2) >= 0) {
throw TypeError("Converting circular structure to JSON5");
}
stack.push(value2);
let stepback = indent;
indent = indent + gap;
let partial = [];
for (let i = 0; i < value2.length; i++) {
const propertyString = serializeProperty(String(i), value2);
partial.push(propertyString !== void 0 ? propertyString : "null");
}
let final;
if (partial.length === 0) {
final = "[]";
} else {
if (gap === "") {
let properties = partial.join(",");
final = "[" + properties + "]";
} else {
let separator = ",\n" + indent;
let properties = partial.join(separator);
final = "[\n" + indent + properties + ",\n" + stepback + "]";
}
}
stack.pop();
indent = stepback;
return final;
}
};
}
});
// node_modules/json5/lib/index.js
var require_lib = __commonJS({
"node_modules/json5/lib/index.js"(exports2, module2) {
var parse = require_parse();
var stringify = require_stringify();
var JSON5 = {
parse,
stringify
};
module2.exports = JSON5;
}
});
// node_modules/ms/index.js
var require_ms = __commonJS({
"node_modules/ms/index.js"(exports2, module2) {
var s = 1e3;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;
module2.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === "string" && val.length > 0) {
return parse(val);
} else if (type === "number" && isFinite(val)) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
);
};
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
str
);
if (!match2) {
return;
}
var n = parseFloat(match2[1]);
var type = (match2[2] || "ms").toLowerCase();
switch (type) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return n * y;
case "weeks":
case "week":
case "w":
return n * w;
case "days":
case "day":
case "d":
return n * d;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return n * h;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return n * m;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return n * s;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return n;
default:
return void 0;
}
}
function fmtShort(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return Math.round(ms / d) + "d";
}
if (msAbs >= h) {
return Math.round(ms / h) + "h";
}
if (msAbs >= m) {
return Math.round(ms / m) + "m";
}
if (msAbs >= s) {
return Math.round(ms / s) + "s";
}
return ms + "ms";
}
function fmtLong(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return plural(ms, msAbs, d, "day");
}
if (msAbs >= h) {
return plural(ms, msAbs, h, "hour");
}
if (msAbs >= m) {
return plural(ms, msAbs, m, "minute");
}
if (msAbs >= s) {
return plural(ms, msAbs, s, "second");
}
return ms + " ms";
}
function plural(ms, msAbs, n, name) {
var isPlural = msAbs >= n * 1.5;
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
}
}
});
// node_modules/debug/src/common.js
var require_common = __commonJS({
"node_modules/debug/src/common.js"(exports2, module2) {
function setup(env) {
createDebug.debug = createDebug;
createDebug.default = createDebug;
createDebug.coerce = coerce;
createDebug.disable = disable;
createDebug.enable = enable;
createDebug.enabled = enabled;
createDebug.humanize = require_ms();
createDebug.destroy = destroy;
Object.keys(env).forEach((key) => {
createDebug[key] = env[key];
});
createDebug.names = [];
createDebug.skips = [];
createDebug.formatters = {};
function selectColor(namespace) {
let hash = 0;
for (let i = 0; i < namespace.length; i++) {
hash = (hash << 5) - hash + namespace.charCodeAt(i);
hash |= 0;
}
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
}
createDebug.selectColor = selectColor;
function createDebug(namespace) {
let prevTime;
let enableOverride = null;
let namespacesCache;
let enabledCache;
function debug2(...args) {
if (!debug2.enabled) {
return;
}
const self = debug2;
const curr = Number(/* @__PURE__ */ new Date());
const ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== "string") {
args.unshift("%O");
}
let index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format) => {
if (match2 === "%%") {
return "%";
}
index++;
const formatter = createDebug.formatters[format];
if (typeof formatter === "function") {
const val = args[index];
match2 = formatter.call(self, val);
args.splice(index, 1);
index--;
}
return match2;
});
createDebug.formatArgs.call(self, args);
const logFn = self.log || createDebug.log;
logFn.apply(self, args);
}
debug2.namespace = namespace;
debug2.useColors = createDebug.useColors();
debug2.color = createDebug.selectColor(namespace);
debug2.extend = extend;
debug2.destroy = createDebug.destroy;
Object.defineProperty(debug2, "enabled", {
enumerable: true,
configurable: false,
get: () => {
if (enableOverride !== null) {
return enableOverride;
}
if (namespacesCache !== createDebug.namespaces) {
namespacesCache = createDebug.namespaces;
enabledCache = createDebug.enabled(namespace);
}
return enabledCache;
},
set: (v) => {
enableOverride = v;
}
});
if (typeof createDebug.init === "function") {
createDebug.init(debug2);
}
return debug2;
}
function extend(namespace, delimiter) {
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
newDebug.log = this.log;
return newDebug;
}
function enable(namespaces) {
createDebug.save(namespaces);
createDebug.namespaces = namespaces;
createDebug.names = [];
createDebug.skips = [];
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
for (const ns of split) {
if (ns[0] === "-") {
createDebug.skips.push(ns.slice(1));
} else {
createDebug.names.push(ns);
}
}
}
function matchesTemplate(search, template) {
let searchIndex = 0;
let templateIndex = 0;
let starIndex = -1;
let matchIndex = 0;
while (searchIndex < search.length) {
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
if (template[templateIndex] === "*") {
starIndex = templateIndex;
matchIndex = searchIndex;
templateIndex++;
} else {
searchIndex++;
templateIndex++;
}
} else if (starIndex !== -1) {
templateIndex = starIndex + 1;
matchIndex++;
searchIndex = matchIndex;
} else {
return false;
}
}
while (templateIndex < template.length && template[templateIndex] === "*") {
templateIndex++;
}
return templateIndex === template.length;
}
function disable() {
const namespaces = [
...createDebug.names,
...createDebug.skips.map((namespace) => "-" + namespace)
].join(",");
createDebug.enable("");
return namespaces;
}
function enabled(name) {
for (const skip of createDebug.skips) {
if (matchesTemplate(name, skip)) {
return false;
}
}
for (const ns of createDebug.names) {
if (matchesTemplate(name, ns)) {
return true;
}
}
return false;
}
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
}
return val;
}
function destroy() {
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
createDebug.enable(createDebug.load());
return createDebug;
}
module2.exports = setup;
}
});
// node_modules/debug/src/browser.js
var require_browser = __commonJS({
"node_modules/debug/src/browser.js"(exports2, module2) {
exports2.formatArgs = formatArgs;
exports2.save = save;
exports2.load = load3;
exports2.useColors = useColors;
exports2.storage = localstorage();
exports2.destroy = /* @__PURE__ */ (() => {
let warned = false;
return () => {
if (!warned) {
warned = true;
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
};
})();
exports2.colors = [
"#0000CC",
"#0000FF",
"#0033CC",
"#0033FF",
"#0066CC",
"#0066FF",
"#0099CC",
"#0099FF",
"#00CC00",
"#00CC33",
"#00CC66",
"#00CC99",
"#00CCCC",
"#00CCFF",
"#3300CC",
"#3300FF",
"#3333CC",
"#3333FF",
"#3366CC",
"#3366FF",
"#3399CC",
"#3399FF",
"#33CC00",
"#33CC33",
"#33CC66",
"#33CC99",
"#33CCCC",
"#33CCFF",
"#6600CC",
"#6600FF",
"#6633CC",
"#6633FF",
"#66CC00",
"#66CC33",
"#9900CC",
"#9900FF",
"#9933CC",
"#9933FF",
"#99CC00",
"#99CC33",
"#CC0000",
"#CC0033",
"#CC0066",
"#CC0099",
"#CC00CC",
"#CC00FF",
"#CC3300",
"#CC3333",
"#CC3366",
"#CC3399",
"#CC33CC",
"#CC33FF",
"#CC6600",
"#CC6633",
"#CC9900",
"#CC9933",
"#CCCC00",
"#CCCC33",
"#FF0000",
"#FF0033",
"#FF0066",
"#FF0099",
"#FF00CC",
"#FF00FF",
"#FF3300",
"#FF3333",
"#FF3366",
"#FF3399",
"#FF33CC",
"#FF33FF",
"#FF6600",
"#FF6633",
"#FF9900",
"#FF9933",
"#FFCC00",
"#FFCC33"
];
function useColors() {
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
return true;
}
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
let m;
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
function formatArgs(args) {
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
if (!this.useColors) {
return;
}
const c = "color: " + this.color;
args.splice(1, 0, c, "color: inherit");
let index = 0;
let lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, (match2) => {
if (match2 === "%%") {
return;
}
index++;
if (match2 === "%c") {
lastC = index;
}
});
args.splice(lastC, 0, c);
}
exports2.log = console.debug || console.log || (() => {
});
function save(namespaces) {
try {
if (namespaces) {
exports2.storage.setItem("debug", namespaces);
} else {
exports2.storage.removeItem("debug");
}
} catch (error) {
}
}
function load3() {
let r;
try {
r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
} catch (error) {
}
if (!r && typeof process !== "undefined" && "env" in process) {
r = process.env.DEBUG;
}
return r;
}
function localstorage() {
try {
return localStorage;
} catch (error) {
}
}
module2.exports = require_common()(exports2);
var { formatters } = module2.exports;
formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (error) {
return "[UnexpectedJSONParseError]: " + error.message;
}
};
}
});
// node_modules/has-flag/index.js
var require_has_flag = __commonJS({
"node_modules/has-flag/index.js"(exports2, module2) {
"use strict";
module2.exports = (flag, argv = process.argv) => {
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
const position = argv.indexOf(prefix + flag);
const terminatorPosition = argv.indexOf("--");
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
};
}
});
// node_modules/supports-color/index.js
var require_supports_color = __commonJS({
"node_modules/supports-color/index.js"(exports2, module2) {
"use strict";
var os2 = require("os");
var tty = require("tty");
var hasFlag = require_has_flag();
var { env } = process;
var forceColor;
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
forceColor = 0;
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
forceColor = 1;
}
if ("FORCE_COLOR" in env) {
if (env.FORCE_COLOR === "true") {
forceColor = 1;
} else if (env.FORCE_COLOR === "false") {
forceColor = 0;
} else {
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
}
}
function translateLevel(level) {
if (level === 0) {
return false;
}
return {
level,
hasBasic: true,
has256: level >= 2,
has16m: level >= 3
};
}
function supportsColor(haveStream, streamIsTTY) {
if (forceColor === 0) {
return 0;
}
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
return 3;
}
if (hasFlag("color=256")) {
return 2;
}
if (haveStream && !streamIsTTY && forceColor === void 0) {
return 0;
}
const min = forceColor || 0;
if (env.TERM === "dumb") {
return min;
}
if (process.platform === "win32") {
const osRelease = os2.release().split(".");
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
return Number(osRelease[2]) >= 14931 ? 3 : 2;
}
return 1;
}
if ("CI" in env) {
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
return 1;
}
return min;
}
if ("TEAMCITY_VERSION" in env) {
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
}
if (env.COLORTERM === "truecolor") {
return 3;
}
if ("TERM_PROGRAM" in env) {
const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
switch (env.TERM_PROGRAM) {
case "iTerm.app":
return version2 >= 3 ? 3 : 2;
case "Apple_Terminal":
return 2;
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ("COLORTERM" in env) {
return 1;
}
return min;
}
function getSupportLevel(stream) {
const level = supportsColor(stream, stream && stream.isTTY);
return translateLevel(level);
}
module2.exports = {
supportsColor: getSupportLevel,
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
};
}
});
// node_modules/debug/src/node.js
var require_node = __commonJS({
"node_modules/debug/src/node.js"(exports2, module2) {
var tty = require("tty");
var util = require("util");
exports2.init = init;
exports2.log = log;
exports2.formatArgs = formatArgs;
exports2.save = save;
exports2.load = load3;
exports2.useColors = useColors;
exports2.destroy = util.deprecate(
() => {
},
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
);
exports2.colors = [6, 2, 3, 4, 5, 1];
try {
const supportsColor = require_supports_color();
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
exports2.colors = [
20,
21,
26,
27,
32,
33,
38,
39,
40,
41,
42,
43,
44,
45,
56,
57,
62,
63,
68,
69,
74,
75,
76,
77,
78,
79,
80,
81,
92,
93,
98,
99,
112,
113,
128,
129,
134,
135,
148,
149,
160,
161,
162,
163,
164,
165,
166,
167,
168,
169,
170,
171,
172,
173,
178,
179,
184,
185,
196,
197,
198,
199,
200,
201,
202,
203,
204,
205,
206,
207,
208,
209,
214,
215,
220,
221
];
}
} catch (error) {
}
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
return /^debug_/i.test(key);
}).reduce((obj, key) => {
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
return k.toUpperCase();
});
let val = process.env[key];
if (/^(yes|on|true|enabled)$/i.test(val)) {
val = true;
} else if (/^(no|off|false|disabled)$/i.test(val)) {
val = false;
} else if (val === "null") {
val = null;
} else {
val = Number(val);
}
obj[prop] = val;
return obj;
}, {});
function useColors() {
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
}
function formatArgs(args) {
const { namespace: name, useColors: useColors2 } = this;
if (useColors2) {
const c = this.color;
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
} else {
args[0] = getDate() + name + " " + args[0];
}
}
function getDate() {
if (exports2.inspectOpts.hideDate) {
return "";
}
return (/* @__PURE__ */ new Date()).toISOString() + " ";
}
function log(...args) {
return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
}
function save(namespaces) {
if (namespaces) {
process.env.DEBUG = namespaces;
} else {
delete process.env.DEBUG;
}
}
function load3() {
return process.env.DEBUG;
}
function init(debug2) {
debug2.inspectOpts = {};
const keys = Object.keys(exports2.inspectOpts);
for (let i = 0; i < keys.length; i++) {
debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
}
}
module2.exports = require_common()(exports2);
var { formatters } = module2.exports;
formatters.o = function(v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
};
formatters.O = function(v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts);
};
}
});
// node_modules/debug/src/index.js
var require_src = __commonJS({
"node_modules/debug/src/index.js"(exports2, module2) {
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
module2.exports = require_browser();
} else {
module2.exports = require_node();
}
}
});
// packages/playwright/src/transform/esmLoader.ts
var import_fs6 = __toESM(require("fs"));
var import_url3 = __toESM(require("url"));
// packages/playwright/src/transform/compilationCache.ts
var import_fs = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_source_map_support = __toESM(require_source_map_support());
// packages/utils/crypto.ts
var import_crypto = __toESM(require("crypto"));
function calculateSha1(buffer) {
const hash = import_crypto.default.createHash("sha1");
hash.update(buffer);
return hash.digest("hex");
}
// packages/playwright/src/transform/compilationCache.ts
var import_globals = require("../globals");
var import_package = require("../package");
var cacheDir = process.env.PWTEST_CACHE_DIR || (() => {
if (process.platform === "win32")
return import_path.default.join(import_os.default.tmpdir(), `playwright-transform-cache`);
return import_path.default.join(import_os.default.tmpdir(), `playwright-transform-cache-` + process.geteuid?.());
})();
var sourceMaps = /* @__PURE__ */ new Map();
var memoryCache = /* @__PURE__ */ new Map();
var fileDependencies = /* @__PURE__ */ new Map();
var externalDependencies = /* @__PURE__ */ new Map();
function installSourceMapSupport() {
Error.stackTraceLimit = 200;
import_source_map_support.default.install({
environment: "node",
handleUncaughtExceptions: false,
retrieveSourceMap(source) {
if (!sourceMaps.has(source))
return null;
const sourceMapPath = sourceMaps.get(source);
try {
return {
map: JSON.parse(import_fs.default.readFileSync(sourceMapPath, "utf-8")),
url: source
};
} catch {
return null;
}
}
});
}
function _innerAddToCompilationCacheAndSerialize(filename, entry) {
sourceMaps.set(entry.moduleUrl || filename, entry.sourceMapPath);
memoryCache.set(filename, entry);
return {
sourceMaps: [[entry.moduleUrl || filename, entry.sourceMapPath]],
memoryCache: [[filename, entry]],
fileDependencies: [],
externalDependencies: []
};
}
function writeCodeCache(codePath, code) {
import_fs.default.writeFileSync(codePath, `// ${calculateSha1(code)}
${code}`, "utf8");
}
function readCodeCache(codePath) {
const content = import_fs.default.readFileSync(codePath, "utf8");
const newLineIndex = content.indexOf("\n");
if (newLineIndex === -1)
throw new Error(`Cache file is missing the hash header`);
const firstLine = content.substring(0, newLineIndex);
const sha1Length = 40;
if (firstLine.length !== "// ".length + sha1Length || !firstLine.startsWith("// "))
throw new Error(`Cache file has a malformed hash header`);
const code = content.substring(newLineIndex + 1);
if (calculateSha1(code) !== firstLine.substring("// ".length))
throw new Error(`Cache file content does not match the hash header`);
return code;
}
function getFromCompilationCache(filename, contentHash, moduleUrl) {
const cache = memoryCache.get(filename);
if (cache?.codePath) {
try {
return { cachedCode: readCodeCache(cache.codePath) };
} catch {
}
}
const filePathHash = calculateFilePathHash(filename);
const hashPrefix = filePathHash + "_" + contentHash.substring(0, 7);
const cacheFolderName = filePathHash.substring(0, 2);
const cachePath = calculateCachePath(filename, cacheFolderName, hashPrefix);
const codePath = cachePath + ".js";
const sourceMapPath = cachePath + ".map";
const dataPath = cachePath + ".data";
try {
const cachedCode = readCodeCache(codePath);
const serializedCache = _innerAddToCompilationCacheAndSerialize(filename, { codePath, sourceMapPath, dataPath, moduleUrl });
return { cachedCode, serializedCache };
} catch {
}
return {
addToCache: (code, map, data) => {
if ((0, import_globals.isWorkerProcess)())
return {};
clearOldCacheEntries(cacheFolderName, filePathHash);
import_fs.default.mkdirSync(import_path.default.dirname(cachePath), { recursive: true });
if (map)
import_fs.default.writeFileSync(sourceMapPath, JSON.stringify(map), "utf8");
if (data.size)
import_fs.default.writeFileSync(dataPath, JSON.stringify(Object.fromEntries(data.entries()), void 0, 2), "utf8");
writeCodeCache(codePath, code);
const serializedCache = _innerAddToCompilationCacheAndSerialize(filename, { codePath, sourceMapPath, dataPath, moduleUrl });
return { serializedCache };
}
};
}
function serializeCompilationCache() {
return {
sourceMaps: [...sourceMaps.entries()],
memoryCache: [...memoryCache.entries()],
fileDependencies: [...fileDependencies.entries()].map(([filename, deps]) => [filename, [...deps]]),
externalDependencies: [...externalDependencies.entries()].map(([filename, deps]) => [filename, [...deps]])
};
}
function addToCompilationCache(payload) {
for (const entry of payload.sourceMaps)
sourceMaps.set(entry[0], entry[1]);
for (const entry of payload.memoryCache)
memoryCache.set(entry[0], entry[1]);
for (const entry of payload.fileDependencies) {
const existing = fileDependencies.get(entry[0]) || [];
fileDependencies.set(entry[0], /* @__PURE__ */ new Set([...entry[1], ...existing]));
}
for (const entry of payload.externalDependencies) {
const existing = externalDependencies.get(entry[0]) || [];
externalDependencies.set(entry[0], /* @__PURE__ */ new Set([...entry[1], ...existing]));
}
}
function calculateFilePathHash(filePath) {
return calculateSha1(filePath).substring(0, 10);
}
function calculateCachePath(filePath, cacheFolderName, hashPrefix) {
const fileName2 = hashPrefix + "_" + import_path.default.basename(filePath, import_path.default.extname(filePath)).replace(/\W/g, "");
return import_path.default.join(cacheDir, cacheFolderName, fileName2);
}
function clearOldCacheEntries(cacheFolderName, filePathHash) {
const cachePath = import_path.default.join(cacheDir, cacheFolderName);
try {
const cachedRelevantFiles = import_fs.default.readdirSync(cachePath).filter((file2) => file2.startsWith(filePathHash));
for (const file2 of cachedRelevantFiles)
import_fs.default.rmSync(import_path.default.join(cachePath, file2), { force: true });
} catch {
}
}
var depsCollector2;
function startCollectingFileDeps() {
depsCollector2 = /* @__PURE__ */ new Set();
}
function stopCollectingFileDeps(filename) {
if (!depsCollector2)
return;
depsCollector2.delete(filename);
for (const dep of depsCollector2) {
if (belongsToNodeModules(dep))
depsCollector2.delete(dep);
}
fileDependencies.set(filename, depsCollector2);
depsCollector2 = void 0;
}
function currentFileDepsCollector() {
return depsCollector2;
}
var kPlaywrightInternalPrefix = import_package.packageRoot;
function belongsToNodeModules(file2) {
if (file2.includes(`${import_path.default.sep}node_modules${import_path.default.sep}`))
return true;
if (file2.startsWith(kPlaywrightInternalPrefix) && (file2.endsWith(".js") || file2.endsWith(".mjs")))
return true;
return false;
}
// packages/playwright/src/transform/portTransport.ts
var PortTransport = class {
constructor(port, handler) {
this._lastId = 0;
this._callbacks = /* @__PURE__ */ new Map();
this._port = port;
port.addEventListener("message", async (event) => {
const message = event.data;
const { id, ackId, method, params, result: result2 } = message;
if (ackId) {
const callback = this._callbacks.get(ackId);
this._callbacks.delete(ackId);
this._resetRef();
callback?.(result2);
return;
}
const handlerResult = await handler(method, params);
if (id)
this._port.postMessage({ ackId: id, result: handlerResult });
});
this._resetRef();
}
post(method, params) {
this._port.postMessage({ method, params });
}
async send(method, params) {
return await new Promise((f) => {
const id = ++this._lastId;
this._callbacks.set(id, f);
this._resetRef();
this._port.postMessage({ id, method, params });
});
}
_resetRef() {
if (this._callbacks.size) {
this._port.ref();
} else {
this._port.unref();
}
}
};
// packages/playwright/src/transform/transform.ts
var import_fs5 = __toESM(require("fs"));
var import_module2 = __toESM(require("module"));
var import_path5 = __toESM(require("path"));
var import_url2 = __toESM(require("url"));
var import_crypto5 = __toESM(require("crypto"));
var import_source_map_support2 = __toESM(require_source_map_support());
// packages/playwright/src/transform/tsconfig-loader.ts
var import_path2 = __toESM(require("path"));
var import_fs2 = __toESM(require("fs"));
var import_json5 = __toESM(require_lib());
function loadTsConfig(configPath) {
try {
const references = [];
const config = innerLoadTsConfig(configPath, references);
return [config, ...references];
} catch (e) {
throw new Error(`Failed to load tsconfig file at ${configPath}:
${e.message}`);
}
}
function resolveConfigFile(baseConfigFile, referencedConfigFile) {
if (!referencedConfigFile.endsWith(".json"))
referencedConfigFile += ".json";
const currentDir = import_path2.default.dirname(baseConfigFile);
let resolvedConfigFile = import_path2.default.resolve(currentDir, referencedConfigFile);
if (referencedConfigFile.includes("/") && referencedConfigFile.includes(".") && !import_fs2.default.existsSync(resolvedConfigFile))
resolvedConfigFile = import_path2.default.join(currentDir, "node_modules", referencedConfigFile);
return resolvedConfigFile;
}
function innerLoadTsConfig(configFilePath, references, visited = /* @__PURE__ */ new Map()) {
if (visited.has(configFilePath))
return visited.get(configFilePath);
let result2 = {
tsConfigPath: configFilePath
};
visited.set(configFilePath, result2);
if (!import_fs2.default.existsSync(configFilePath))
return result2;
const configString = import_fs2.default.readFileSync(configFilePath, "utf-8");
const cleanedJson = StripBom(configString);
const parsedConfig = import_json5.default.parse(cleanedJson);
const extendsArray = Array.isArray(parsedConfig.extends) ? parsedConfig.extends : parsedConfig.extends ? [parsedConfig.extends] : [];
for (const extendedConfig of extendsArray) {
const extendedConfigPath = resolveConfigFile(configFilePath, extendedConfig);
const base = innerLoadTsConfig(extendedConfigPath, references, visited);
Object.assign(result2, base, { tsConfigPath: configFilePath });
}
if (parsedConfig.compilerOptions?.allowJs !== void 0)
result2.allowJs = parsedConfig.compilerOptions.allowJs;
if (parsedConfig.compilerOptions?.paths !== void 0) {
result2.paths = {
mapping: parsedConfig.compilerOptions.paths,
pathsBasePath: import_path2.default.dirname(configFilePath)
};
}
if (parsedConfig.compilerOptions?.baseUrl !== void 0) {
result2.absoluteBaseUrl = import_path2.default.resolve(import_path2.default.dirname(configFilePath), parsedConfig.compilerOptions.baseUrl);
}
for (const ref of parsedConfig.references || [])
references.push(innerLoadTsConfig(resolveConfigFile(configFilePath, ref.path), references, visited));
if (import_path2.default.basename(configFilePath) === "jsconfig.json" && result2.allowJs === void 0)
result2.allowJs = true;
return result2;
}
function StripBom(string) {
if (typeof string !== "string") {
throw new TypeError(`Expected a string, got ${typeof string}`);
}
if (string.charCodeAt(0) === 65279) {
return string.slice(1);
}
return string;
}
// packages/playwright/src/transform/transform.ts
var import_package2 = require("../package");
// packages/playwright/src/util.ts
var import_fs3 = __toESM(require("fs"));
var import_path3 = __toESM(require("path"));
var import_debug2 = __toESM(require_src());
// node_modules/mime/dist/types/other.js
var types = {
"application/prs.cww": ["cww"],
"application/prs.xsf+xml": ["xsf"],
"application/vnd.1000minds.decision-model+xml": ["1km"],
"application/vnd.3gpp.pic-bw-large": ["plb"],
"application/vnd.3gpp.pic-bw-small": ["psb"],
"application/vnd.3gpp.pic-bw-var": ["pvb"],
"application/vnd.3gpp2.tcap": ["tcap"],
"application/vnd.3m.post-it-notes": ["pwn"],
"application/vnd.accpac.simply.aso": ["aso"],
"application/vnd.accpac.simply.imp": ["imp"],
"application/vnd.acucobol": ["acu"],
"application/vnd.acucorp": ["atc", "acutc"],
"application/vnd.adobe.air-application-installer-package+zip": ["air"],
"application/vnd.adobe.formscentral.fcdt": ["fcdt"],
"application/vnd.adobe.fxp": ["fxp", "fxpl"],
"application/vnd.adobe.xdp+xml": ["xdp"],
"application/vnd.adobe.xfdf": ["*xfdf"],
"application/vnd.age": ["age"],
"application/vnd.ahead.space": ["ahead"],
"application/vnd.airzip.filesecure.azf": ["azf"],
"application/vnd.airzip.filesecure.azs": ["azs"],
"application/vnd.amazon.ebook": ["azw"],
"application/vnd.americandynamics.acc": ["acc"],
"application/vnd.amiga.ami": ["ami"],
"application/vnd.android.package-archive": ["apk"],
"application/vnd.anser-web-certificate-issue-initiation": ["cii"],
"application/vnd.anser-web-funds-transfer-initiation": ["fti"],
"application/vnd.antix.game-component": ["atx"],
"application/vnd.apple.installer+xml": ["mpkg"],
"application/vnd.apple.keynote": ["key"],
"application/vnd.apple.mpegurl": ["m3u8"],
"application/vnd.apple.numbers": ["numbers"],
"application/vnd.apple.pages": ["pages"],
"application/vnd.apple.pkpass": ["pkpass"],
"application/vnd.aristanetworks.swi": ["swi"],
"application/vnd.astraea-software.iota": ["iota"],
"application/vnd.audiograph": ["aep"],
"application/vnd.autodesk.fbx": ["fbx"],
"application/vnd.balsamiq.bmml+xml": ["bmml"],
"application/vnd.blueice.multipass": ["mpm"],
"application/vnd.bmi": ["bmi"],
"application/vnd.businessobjects": ["rep"],
"application/vnd.chemdraw+xml": ["cdxml"],
"application/vnd.chipnuts.karaoke-mmd": ["mmd"],
"application/vnd.cinderella": ["cdy"],
"application/vnd.citationstyles.style+xml": ["csl"],
"application/vnd.claymore": ["cla"],
"application/vnd.cloanto.rp9": ["rp9"],
"application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"],
"application/vnd.cluetrust.cartomobile-config": ["c11amc"],
"application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"],
"application/vnd.commonspace": ["csp"],
"application/vnd.contact.cmsg": ["cdbcmsg"],
"application/vnd.cosmocaller": ["cmc"],
"application/vnd.crick.clicker": ["clkx"],
"application/vnd.crick.clicker.keyboard": ["clkk"],
"application/vnd.crick.clicker.palette": ["clkp"],
"application/vnd.crick.clicker.template": ["clkt"],
"application/vnd.crick.clicker.wordbank": ["clkw"],
"application/vnd.criticaltools.wbs+xml": ["wbs"],
"application/vnd.ctc-posml": ["pml"],
"application/vnd.cups-ppd": ["ppd"],
"application/vnd.curl.car": ["car"],
"application/vnd.curl.pcurl": ["pcurl"],
"application/vnd.dart": ["dart"],
"application/vnd.data-vision.rdz": ["rdz"],
"application/vnd.dbf": ["dbf"],
"application/vnd.dcmp+xml": ["dcmp"],
"application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"],
"application/vnd.dece.ttml+xml": ["uvt", "uvvt"],
"application/vnd.dece.unspecified": ["uvx", "uvvx"],
"application/vnd.dece.zip": ["uvz", "uvvz"],
"application/vnd.denovo.fcselayout-link": ["fe_launch"],
"application/vnd.dna": ["dna"],
"application/vnd.dolby.mlp": ["mlp"],
"application/vnd.dpgraph": ["dpg"],
"application/vnd.dreamfactory": ["dfac"],
"application/vnd.ds-keypoint": ["kpxx"],
"application/vnd.dvb.ait": ["ait"],
"application/vnd.dvb.service": ["svc"],
"application/vnd.dynageo": ["geo"],
"application/vnd.ecowin.chart": ["mag"],
"application/vnd.enliven": ["nml"],
"application/vnd.epson.esf": ["esf"],
"application/vnd.epson.msf": ["msf"],
"application/vnd.epson.quickanime": ["qam"],
"application/vnd.epson.salt": ["slt"],
"application/vnd.epson.ssf": ["ssf"],
"application/vnd.eszigno3+xml": ["es3", "et3"],
"application/vnd.ezpix-album": ["ez2"],
"application/vnd.ezpix-package": ["ez3"],
"application/vnd.fdf": ["*fdf"],
"application/vnd.fdsn.mseed": ["mseed"],
"application/vnd.fdsn.seed": ["seed", "dataless"],
"application/vnd.flographit": ["gph"],
"application/vnd.fluxtime.clip": ["ftc"],
"application/vnd.framemaker": ["fm", "frame", "maker", "book"],
"application/vnd.frogans.fnc": ["fnc"],
"application/vnd.frogans.ltf": ["ltf"],
"application/vnd.fsc.weblaunch": ["fsc"],
"application/vnd.fujitsu.oasys": ["oas"],
"application/vnd.fujitsu.oasys2": ["oa2"],
"application/vnd.fujitsu.oasys3": ["oa3"],
"application/vnd.fujitsu.oasysgp": ["fg5"],
"application/vnd.fujitsu.oasysprs": ["bh2"],
"application/vnd.fujixerox.ddd": ["ddd"],
"application/vnd.fujixerox.docuworks": ["xdw"],
"application/vnd.fujixerox.docuworks.binder": ["xbd"],
"application/vnd.fuzzysheet": ["fzs"],
"application/vnd.genomatix.tuxedo": ["txd"],
"application/vnd.geogebra.file": ["ggb"],
"application/vnd.geogebra.slides": ["ggs"],
"application/vnd.geogebra.tool": ["ggt"],
"application/vnd.geometry-explorer": ["gex", "gre"],
"application/vnd.geonext": ["gxt"],
"application/vnd.geoplan": ["g2w"],
"application/vnd.geospace": ["g3w"],
"application/vnd.gmx": ["gmx"],
"application/vnd.google-apps.document": ["gdoc"],
"application/vnd.google-apps.drawing": ["gdraw"],
"application/vnd.google-apps.form": ["gform"],
"application/vnd.google-apps.jam": ["gjam"],
"application/vnd.google-apps.map": ["gmap"],
"application/vnd.google-apps.presentation": ["gslides"],
"application/vnd.google-apps.script": ["gscript"],
"application/vnd.google-apps.site": ["gsite"],
"application/vnd.google-apps.spreadsheet": ["gsheet"],
"application/vnd.google-earth.kml+xml": ["kml"],
"application/vnd.google-earth.kmz": ["kmz"],
"application/vnd.gov.sk.xmldatacontainer+xml": ["xdcf"],
"application/vnd.grafeq": ["gqf", "gqs"],
"application/vnd.groove-account": ["gac"],
"application/vnd.groove-help": ["ghf"],
"application/vnd.groove-identity-message": ["gim"],
"application/vnd.groove-injector": ["grv"],
"application/vnd.groove-tool-message": ["gtm"],
"application/vnd.groove-tool-template": ["tpl"],
"application/vnd.groove-vcard": ["vcg"],
"application/vnd.hal+xml": ["hal"],
"application/vnd.handheld-entertainment+xml": ["zmm"],
"application/vnd.hbci": ["hbci"],
"application/vnd.hhe.lesson-player": ["les"],
"application/vnd.hp-hpgl": ["hpgl"],
"application/vnd.hp-hpid": ["hpid"],
"application/vnd.hp-hps": ["hps"],
"application/vnd.hp-jlyt": ["jlt"],
"application/vnd.hp-pcl": ["pcl"],
"application/vnd.hp-pclxl": ["pclxl"],
"application/vnd.hydrostatix.sof-data": ["sfd-hdstx"],
"application/vnd.ibm.minipay": ["mpy"],
"application/vnd.ibm.modcap": ["afp", "listafp", "list3820"],
"application/vnd.ibm.rights-management": ["irm"],
"application/vnd.ibm.secure-container": ["sc"],
"application/vnd.iccprofile": ["icc", "icm"],
"application/vnd.igloader": ["igl"],
"application/vnd.immervision-ivp": ["ivp"],
"application/vnd.immervision-ivu": ["ivu"],
"application/vnd.insors.igm": ["igm"],
"application/vnd.intercon.formnet": ["xpw", "xpx"],
"application/vnd.intergeo": ["i2g"],
"application/vnd.intu.qbo": ["qbo"],
"application/vnd.intu.qfx": ["qfx"],
"application/vnd.ipunplugged.rcprofile": ["rcprofile"],
"application/vnd.irepository.package+xml": ["irp"],
"application/vnd.is-xpr": ["xpr"],
"application/vnd.isac.fcs": ["fcs"],
"application/vnd.jam": ["jam"],
"application/vnd.jcp.javame.midlet-rms": ["rms"],
"application/vnd.jisp": ["jisp"],
"application/vnd.joost.joda-archive": ["joda"],
"application/vnd.kahootz": ["ktz", "ktr"],
"application/vnd.kde.karbon": ["karbon"],
"application/vnd.kde.kchart": ["chrt"],
"application/vnd.kde.kformula": ["kfo"],
"application/vnd.kde.kivio": ["flw"],
"application/vnd.kde.kontour": ["kon"],
"application/vnd.kde.kpresenter": ["kpr", "kpt"],
"application/vnd.kde.kspread": ["ksp"],
"application/vnd.kde.kword": ["kwd", "kwt"],
"application/vnd.kenameaapp": ["htke"],
"application/vnd.kidspiration": ["kia"],
"application/vnd.kinar": ["kne", "knp"],
"application/vnd.koan": ["skp", "skd", "skt", "skm"],
"application/vnd.kodak-descriptor": ["sse"],
"application/vnd.las.las+xml": ["lasxml"],
"application/vnd.llamagraphics.life-balance.desktop": ["lbd"],
"application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"],
"application/vnd.lotus-1-2-3": ["123"],
"application/vnd.lotus-approach": ["apr"],
"application/vnd.lotus-freelance": ["pre"],
"application/vnd.lotus-notes": ["nsf"],
"application/vnd.lotus-organizer": ["org"],
"application/vnd.lotus-screencam": ["scm"],
"application/vnd.lotus-wordpro": ["lwp"],
"application/vnd.macports.portpkg": ["portpkg"],
"application/vnd.mapbox-vector-tile": ["mvt"],
"application/vnd.mcd": ["mcd"],
"application/vnd.medcalcdata": ["mc1"],
"application/vnd.mediastation.cdkey": ["cdkey"],
"application/vnd.mfer": ["mwf"],
"application/vnd.mfmp": ["mfm"],
"application/vnd.micrografx.flo": ["flo"],
"application/vnd.micrografx.igx": ["igx"],
"application/vnd.mif": ["mif"],
"application/vnd.mobius.daf": ["daf"],
"application/vnd.mobius.dis": ["dis"],
"application/vnd.mobius.mbk": ["mbk"],
"application/vnd.mobius.mqy": ["mqy"],
"application/vnd.mobius.msl": ["msl"],
"application/vnd.mobius.plc": ["plc"],
"application/vnd.mobius.txf": ["txf"],
"application/vnd.mophun.application": ["mpn"],
"application/vnd.mophun.certificate": ["mpc"],
"application/vnd.mozilla.xul+xml": ["xul"],
"application/vnd.ms-artgalry": ["cil"],
"application/vnd.ms-cab-compressed": ["cab"],
"application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"],
"application/vnd.ms-excel.addin.macroenabled.12": ["xlam"],
"application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"],
"application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"],
"application/vnd.ms-excel.template.macroenabled.12": ["xltm"],
"application/vnd.ms-fontobject": ["eot"],
"application/vnd.ms-htmlhelp": ["chm"],
"application/vnd.ms-ims": ["ims"],
"application/vnd.ms-lrm": ["lrm"],
"application/vnd.ms-officetheme": ["thmx"],
"application/vnd.ms-outlook": ["msg"],
"application/vnd.ms-pki.seccat": ["cat"],
"application/vnd.ms-pki.stl": ["*stl"],
"application/vnd.ms-powerpoint": ["ppt", "pps", "pot"],
"application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"],
"application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"],
"application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"],
"application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
"application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
"application/vnd.ms-project": ["*mpp", "mpt"],
"application/vnd.ms-visio.viewer": ["vdx"],
"application/vnd.ms-word.document.macroenabled.12": ["docm"],
"application/vnd.ms-word.template.macroenabled.12": ["dotm"],
"application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"],
"application/vnd.ms-wpl": ["wpl"],
"application/vnd.ms-xpsdocument": ["xps"],
"application/vnd.mseq": ["mseq"],
"application/vnd.musician": ["mus"],
"application/vnd.muvee.style": ["msty"],
"application/vnd.mynfc": ["taglet"],
"application/vnd.nato.bindingdataobject+xml": ["bdo"],
"application/vnd.neurolanguage.nlu": ["nlu"],
"application/vnd.nitf": ["ntf", "nitf"],
"application/vnd.noblenet-directory": ["nnd"],
"application/vnd.noblenet-sealer": ["nns"],
"application/vnd.noblenet-web": ["nnw"],
"application/vnd.nokia.n-gage.ac+xml": ["*ac"],
"application/vnd.nokia.n-gage.data": ["ngdat"],
"application/vnd.nokia.n-gage.symbian.install": ["n-gage"],
"application/vnd.nokia.radio-preset": ["rpst"],
"application/vnd.nokia.radio-presets": ["rpss"],
"application/vnd.novadigm.edm": ["edm"],
"application/vnd.novadigm.edx": ["edx"],
"application/vnd.novadigm.ext": ["ext"],
"application/vnd.oasis.opendocument.chart": ["odc"],
"application/vnd.oasis.opendocument.chart-template": ["otc"],
"application/vnd.oasis.opendocument.database": ["odb"],
"application/vnd.oasis.opendocument.formula": ["odf"],
"application/vnd.oasis.opendocument.formula-template": ["odft"],
"application/vnd.oasis.opendocument.graphics": ["odg"],
"application/vnd.oasis.opendocument.graphics-template": ["otg"],
"application/vnd.oasis.opendocument.image": ["odi"],
"application/vnd.oasis.opendocument.image-template": ["oti"],
"application/vnd.oasis.opendocument.presentation": ["odp"],
"application/vnd.oasis.opendocument.presentation-template": ["otp"],
"application/vnd.oasis.opendocument.spreadsheet": ["ods"],
"application/vnd.oasis.opendocument.spreadsheet-template": ["ots"],
"application/vnd.oasis.opendocument.text": ["odt"],
"application/vnd.oasis.opendocument.text-master": ["odm"],
"application/vnd.oasis.opendocument.text-template": ["ott"],
"application/vnd.oasis.opendocument.text-web": ["oth"],
"application/vnd.olpc-sugar": ["xo"],
"application/vnd.oma.dd2+xml": ["dd2"],
"application/vnd.openblox.game+xml": ["obgx"],
"application/vnd.openofficeorg.extension": ["oxt"],
"application/vnd.openstreetmap.data+xml": ["osm"],
"application/vnd.openxmlformats-officedocument.presentationml.presentation": [
"pptx"
],
"application/vnd.openxmlformats-officedocument.presentationml.slide": [
"sldx"
],
"application/vnd.openxmlformats-officedocument.presentationml.slideshow": [
"ppsx"
],
"application/vnd.openxmlformats-officedocument.presentationml.template": [
"potx"
],
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
"application/vnd.openxmlformats-officedocument.spreadsheetml.template": [
"xltx"
],
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
"docx"
],
"application/vnd.openxmlformats-officedocument.wordprocessingml.template": [
"dotx"
],
"application/vnd.osgeo.mapguide.package": ["mgp"],
"application/vnd.osgi.dp": ["dp"],
"application/vnd.osgi.subsystem": ["esa"],
"application/vnd.palm": ["pdb", "pqa", "oprc"],
"application/vnd.pawaafile": ["paw"],
"application/vnd.pg.format": ["str"],
"application/vnd.pg.osasli": ["ei6"],
"application/vnd.picsel": ["efif"],
"application/vnd.pmi.widget": ["wg"],
"application/vnd.pocketlearn": ["plf"],
"application/vnd.powerbuilder6": ["pbd"],
"application/vnd.previewsystems.box": ["box"],
"application/vnd.procrate.brushset": ["brushset"],
"application/vnd.procreate.brush": ["brush"],
"application/vnd.procreate.dream": ["drm"],
"application/vnd.proteus.magazine": ["mgz"],
"application/vnd.publishare-delta-tree": ["qps"],
"application/vnd.pvi.ptid1": ["ptid"],
"application/vnd.pwg-xhtml-print+xml": ["xhtm"],
"application/vnd.quark.quarkxpress": [
"qxd",
"qxt",
"qwd",
"qwt",
"qxl",
"qxb"
],
"application/vnd.rar": ["rar"],
"application/vnd.realvnc.bed": ["bed"],
"application/vnd.recordare.musicxml": ["mxl"],
"application/vnd.recordare.musicxml+xml": ["musicxml"],
"application/vnd.rig.cryptonote": ["cryptonote"],
"application/vnd.rim.cod": ["cod"],
"application/vnd.rn-realmedia": ["rm"],
"application/vnd.rn-realmedia-vbr": ["rmvb"],
"application/vnd.route66.link66+xml": ["link66"],
"application/vnd.sailingtracker.track": ["st"],
"application/vnd.seemail": ["see"],
"application/vnd.sema": ["sema"],
"application/vnd.semd": ["semd"],
"application/vnd.semf": ["semf"],
"application/vnd.shana.informed.formdata": ["ifm"],
"application/vnd.shana.informed.formtemplate": ["itp"],
"application/vnd.shana.informed.interchange": ["iif"],
"application/vnd.shana.informed.package": ["ipk"],
"application/vnd.simtech-mindmapper": ["twd", "twds"],
"application/vnd.smaf": ["mmf"],
"application/vnd.smart.teacher": ["teacher"],
"application/vnd.software602.filler.form+xml": ["fo"],
"application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"],
"application/vnd.spotfire.dxp": ["dxp"],
"application/vnd.spotfire.sfs": ["sfs"],
"application/vnd.stardivision.calc": ["sdc"],
"application/vnd.stardivision.draw": ["sda"],
"application/vnd.stardivision.impress": ["sdd"],
"application/vnd.stardivision.math": ["smf"],
"application/vnd.stardivision.writer": ["sdw", "vor"],
"application/vnd.stardivision.writer-global": ["sgl"],
"application/vnd.stepmania.package": ["smzip"],
"application/vnd.stepmania.stepchart": ["sm"],
"application/vnd.sun.wadl+xml": ["wadl"],
"application/vnd.sun.xml.calc": ["sxc"],
"application/vnd.sun.xml.calc.template": ["stc"],
"application/vnd.sun.xml.draw": ["sxd"],
"application/vnd.sun.xml.draw.template": ["std"],
"application/vnd.sun.xml.impress": ["sxi"],
"application/vnd.sun.xml.impress.template": ["sti"],
"application/vnd.sun.xml.math": ["sxm"],
"application/vnd.sun.xml.writer": ["sxw"],
"application/vnd.sun.xml.writer.global": ["sxg"],
"application/vnd.sun.xml.writer.template": ["stw"],
"application/vnd.sus-calendar": ["sus", "susp"],
"application/vnd.svd": ["svd"],
"application/vnd.symbian.install": ["sis", "sisx"],
"application/vnd.syncml+xml": ["xsm"],
"application/vnd.syncml.dm+wbxml": ["bdm"],
"application/vnd.syncml.dm+xml": ["xdm"],
"application/vnd.syncml.dmddf+xml": ["ddf"],
"application/vnd.tao.intent-module-archive": ["tao"],
"application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"],
"application/vnd.tmobile-livetv": ["tmo"],
"application/vnd.trid.tpt": ["tpt"],
"application/vnd.triscape.mxs": ["mxs"],
"application/vnd.trueapp": ["tra"],
"application/vnd.ufdl": ["ufd", "ufdl"],
"application/vnd.uiq.theme": ["utz"],
"application/vnd.umajin": ["umj"],
"application/vnd.unity": ["unityweb"],
"application/vnd.uoml+xml": ["uoml", "uo"],
"application/vnd.vcx": ["vcx"],
"application/vnd.visio": ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"],
"application/vnd.visionary": ["vis"],
"application/vnd.vsf": ["vsf"],
"application/vnd.wap.wbxml": ["wbxml"],
"application/vnd.wap.wmlc": ["wmlc"],
"application/vnd.wap.wmlscriptc": ["wmlsc"],
"application/vnd.webturbo": ["wtb"],
"application/vnd.wolfram.player": ["nbp"],
"application/vnd.wordperfect": ["wpd"],
"application/vnd.wqd": ["wqd"],
"application/vnd.wt.stf": ["stf"],
"application/vnd.xara": ["xar"],
"application/vnd.xfdl": ["xfdl"],
"application/vnd.yamaha.hv-dic": ["hvd"],
"application/vnd.yamaha.hv-script": ["hvs"],
"application/vnd.yamaha.hv-voice": ["hvp"],
"application/vnd.yamaha.openscoreformat": ["osf"],
"application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"],
"application/vnd.yamaha.smaf-audio": ["saf"],
"application/vnd.yamaha.smaf-phrase": ["spf"],
"application/vnd.yellowriver-custom-menu": ["cmp"],
"application/vnd.zul": ["zir", "zirz"],
"application/vnd.zzazz.deck+xml": ["zaz"],
"application/x-7z-compressed": ["7z"],
"application/x-abiword": ["abw"],
"application/x-ace-compressed": ["ace"],
"application/x-apple-diskimage": ["*dmg"],
"application/x-arj": ["arj"],
"application/x-authorware-bin": ["aab", "x32", "u32", "vox"],
"application/x-authorware-map": ["aam"],
"application/x-authorware-seg": ["aas"],
"application/x-bcpio": ["bcpio"],
"application/x-bdoc": ["*bdoc"],
"application/x-bittorrent": ["torrent"],
"application/x-blender": ["blend"],
"application/x-blorb": ["blb", "blorb"],
"application/x-bzip": ["bz"],
"application/x-bzip2": ["bz2", "boz"],
"application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"],
"application/x-cdlink": ["vcd"],
"application/x-cfs-compressed": ["cfs"],
"application/x-chat": ["chat"],
"application/x-chess-pgn": ["pgn"],
"application/x-chrome-extension": ["crx"],
"application/x-cocoa": ["cco"],
"application/x-compressed": ["*rar"],
"application/x-conference": ["nsc"],
"application/x-cpio": ["cpio"],
"application/x-csh": ["csh"],
"application/x-debian-package": ["*deb", "udeb"],
"application/x-dgc-compressed": ["dgc"],
"application/x-director": [
"dir",
"dcr",
"dxr",
"cst",
"cct",
"cxt",
"w3d",
"fgd",
"swa"
],
"application/x-doom": ["wad"],
"application/x-dtbncx+xml": ["ncx"],
"application/x-dtbook+xml": ["dtb"],
"application/x-dtbresource+xml": ["res"],
"application/x-dvi": ["dvi"],
"application/x-envoy": ["evy"],
"application/x-eva": ["eva"],
"application/x-font-bdf": ["bdf"],
"application/x-font-ghostscript": ["gsf"],
"application/x-font-linux-psf": ["psf"],
"application/x-font-pcf": ["pcf"],
"application/x-font-snf": ["snf"],
"application/x-font-type1": ["pfa", "pfb", "pfm", "afm"],
"application/x-freearc": ["arc"],
"application/x-futuresplash": ["spl"],
"application/x-gca-compressed": ["gca"],
"application/x-glulx": ["ulx"],
"application/x-gnumeric": ["gnumeric"],
"application/x-gramps-xml": ["gramps"],
"application/x-gtar": ["gtar"],
"application/x-hdf": ["hdf"],
"application/x-httpd-php": ["php"],
"application/x-install-instructions": ["install"],
"application/x-ipynb+json": ["ipynb"],
"application/x-iso9660-image": ["*iso"],
"application/x-iwork-keynote-sffkey": ["*key"],
"application/x-iwork-numbers-sffnumbers": ["*numbers"],
"application/x-iwork-pages-sffpages": ["*pages"],
"application/x-java-archive-diff": ["jardiff"],
"application/x-java-jnlp-file": ["jnlp"],
"application/x-keepass2": ["kdbx"],
"application/x-latex": ["latex"],
"application/x-lua-bytecode": ["luac"],
"application/x-lzh-compressed": ["lzh", "lha"],
"application/x-makeself": ["run"],
"application/x-mie": ["mie"],
"application/x-mobipocket-ebook": ["*prc", "mobi"],
"application/x-ms-application": ["application"],
"application/x-ms-shortcut": ["lnk"],
"application/x-ms-wmd": ["wmd"],
"application/x-ms-wmz": ["wmz"],
"application/x-ms-xbap": ["xbap"],
"application/x-msaccess": ["mdb"],
"application/x-msbinder": ["obd"],
"application/x-mscardfile": ["crd"],
"application/x-msclip": ["clp"],
"application/x-msdos-program": ["*exe"],
"application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"],
"application/x-msmediaview": ["mvb", "m13", "m14"],
"application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"],
"application/x-msmoney": ["mny"],
"application/x-mspublisher": ["pub"],
"application/x-msschedule": ["scd"],
"application/x-msterminal": ["trm"],
"application/x-mswrite": ["wri"],
"application/x-netcdf": ["nc", "cdf"],
"application/x-ns-proxy-autoconfig": ["pac"],
"application/x-nzb": ["nzb"],
"application/x-perl": ["pl", "pm"],
"application/x-pilot": ["*prc", "*pdb"],
"application/x-pkcs12": ["p12", "pfx"],
"application/x-pkcs7-certificates": ["p7b", "spc"],
"application/x-pkcs7-certreqresp": ["p7r"],
"application/x-rar-compressed": ["*rar"],
"application/x-redhat-package-manager": ["rpm"],
"application/x-research-info-systems": ["ris"],
"application/x-sea": ["sea"],
"application/x-sh": ["sh"],
"application/x-shar": ["shar"],
"application/x-shockwave-flash": ["swf"],
"application/x-silverlight-app": ["xap"],
"application/x-sql": ["*sql"],
"application/x-stuffit": ["sit"],
"application/x-stuffitx": ["sitx"],
"application/x-subrip": ["srt"],
"application/x-sv4cpio": ["sv4cpio"],
"application/x-sv4crc": ["sv4crc"],
"application/x-t3vm-image": ["t3"],
"application/x-tads": ["gam"],
"application/x-tar": ["tar"],
"application/x-tcl": ["tcl", "tk"],
"application/x-tex": ["tex"],
"application/x-tex-tfm": ["tfm"],
"application/x-texinfo": ["texinfo", "texi"],
"application/x-tgif": ["*obj"],
"application/x-ustar": ["ustar"],
"application/x-virtualbox-hdd": ["hdd"],
"application/x-virtualbox-ova": ["ova"],
"application/x-virtualbox-ovf": ["ovf"],
"application/x-virtualbox-vbox": ["vbox"],
"application/x-virtualbox-vbox-extpack": ["vbox-extpack"],
"application/x-virtualbox-vdi": ["vdi"],
"application/x-virtualbox-vhd": ["vhd"],
"application/x-virtualbox-vmdk": ["vmdk"],
"application/x-wais-source": ["src"],
"application/x-web-app-manifest+json": ["webapp"],
"application/x-x509-ca-cert": ["der", "crt", "pem"],
"application/x-xfig": ["fig"],
"application/x-xliff+xml": ["*xlf"],
"application/x-xpinstall": ["xpi"],
"application/x-xz": ["xz"],
"application/x-zip-compressed": ["*zip"],
"application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"],
"audio/vnd.dece.audio": ["uva", "uvva"],
"audio/vnd.digital-winds": ["eol"],
"audio/vnd.dra": ["dra"],
"audio/vnd.dts": ["dts"],
"audio/vnd.dts.hd": ["dtshd"],
"audio/vnd.lucent.voice": ["lvp"],
"audio/vnd.ms-playready.media.pya": ["pya"],
"audio/vnd.nuera.ecelp4800": ["ecelp4800"],
"audio/vnd.nuera.ecelp7470": ["ecelp7470"],
"audio/vnd.nuera.ecelp9600": ["ecelp9600"],
"audio/vnd.rip": ["rip"],
"audio/x-aac": ["*aac"],
"audio/x-aiff": ["aif", "aiff", "aifc"],
"audio/x-caf": ["caf"],
"audio/x-flac": ["flac"],
"audio/x-m4a": ["*m4a"],
"audio/x-matroska": ["mka"],
"audio/x-mpegurl": ["m3u"],
"audio/x-ms-wax": ["wax"],
"audio/x-ms-wma": ["wma"],
"audio/x-pn-realaudio": ["ram", "ra"],
"audio/x-pn-realaudio-plugin": ["rmp"],
"audio/x-realaudio": ["*ra"],
"audio/x-wav": ["*wav"],
"chemical/x-cdx": ["cdx"],
"chemical/x-cif": ["cif"],
"chemical/x-cmdf": ["cmdf"],
"chemical/x-cml": ["cml"],
"chemical/x-csml": ["csml"],
"chemical/x-xyz": ["xyz"],
"image/prs.btif": ["btif", "btf"],
"image/prs.pti": ["pti"],
"image/vnd.adobe.photoshop": ["psd"],
"image/vnd.airzip.accelerator.azv": ["azv"],
"image/vnd.blockfact.facti": ["facti"],
"image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"],
"image/vnd.djvu": ["djvu", "djv"],
"image/vnd.dvb.subtitle": ["*sub"],
"image/vnd.dwg": ["dwg"],
"image/vnd.dxf": ["dxf"],
"image/vnd.fastbidsheet": ["fbs"],
"image/vnd.fpx": ["fpx"],
"image/vnd.fst": ["fst"],
"image/vnd.fujixerox.edmics-mmr": ["mmr"],
"image/vnd.fujixerox.edmics-rlc": ["rlc"],
"image/vnd.microsoft.icon": ["ico"],
"image/vnd.ms-dds": ["dds"],
"image/vnd.ms-modi": ["mdi"],
"image/vnd.ms-photo": ["wdp"],
"image/vnd.net-fpx": ["npx"],
"image/vnd.pco.b16": ["b16"],
"image/vnd.tencent.tap": ["tap"],
"image/vnd.valve.source.texture": ["vtf"],
"image/vnd.wap.wbmp": ["wbmp"],
"image/vnd.xiff": ["xif"],
"image/vnd.zbrush.pcx": ["pcx"],
"image/x-3ds": ["3ds"],
"image/x-adobe-dng": ["dng"],
"image/x-cmu-raster": ["ras"],
"image/x-cmx": ["cmx"],
"image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"],
"image/x-icon": ["*ico"],
"image/x-jng": ["jng"],
"image/x-mrsid-image": ["sid"],
"image/x-ms-bmp": ["*bmp"],
"image/x-pcx": ["*pcx"],
"image/x-pict": ["pic", "pct"],
"image/x-portable-anymap": ["pnm"],
"image/x-portable-bitmap": ["pbm"],
"image/x-portable-graymap": ["pgm"],
"image/x-portable-pixmap": ["ppm"],
"image/x-rgb": ["rgb"],
"image/x-tga": ["tga"],
"image/x-xbitmap": ["xbm"],
"image/x-xpixmap": ["xpm"],
"image/x-xwindowdump": ["xwd"],
"message/vnd.wfa.wsc": ["wsc"],
"model/vnd.bary": ["bary"],
"model/vnd.cld": ["cld"],
"model/vnd.collada+xml": ["dae"],
"model/vnd.dwf": ["dwf"],
"model/vnd.gdl": ["gdl"],
"model/vnd.gtw": ["gtw"],
"model/vnd.mts": ["*mts"],
"model/vnd.opengex": ["ogex"],
"model/vnd.parasolid.transmit.binary": ["x_b"],
"model/vnd.parasolid.transmit.text": ["x_t"],
"model/vnd.pytha.pyox": ["pyo", "pyox"],
"model/vnd.sap.vds": ["vds"],
"model/vnd.usda": ["usda"],
"model/vnd.usdz+zip": ["usdz"],
"model/vnd.valve.source.compiled-map": ["bsp"],
"model/vnd.vtu": ["vtu"],
"text/prs.lines.tag": ["dsc"],
"text/vnd.curl": ["curl"],
"text/vnd.curl.dcurl": ["dcurl"],
"text/vnd.curl.mcurl": ["mcurl"],
"text/vnd.curl.scurl": ["scurl"],
"text/vnd.dvb.subtitle": ["sub"],
"text/vnd.familysearch.gedcom": ["ged"],
"text/vnd.fly": ["fly"],
"text/vnd.fmi.flexstor": ["flx"],
"text/vnd.graphviz": ["gv"],
"text/vnd.in3d.3dml": ["3dml"],
"text/vnd.in3d.spot": ["spot"],
"text/vnd.sun.j2me.app-descriptor": ["jad"],
"text/vnd.wap.wml": ["wml"],
"text/vnd.wap.wmlscript": ["wmls"],
"text/x-asm": ["s", "asm"],
"text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"],
"text/x-component": ["htc"],
"text/x-fortran": ["f", "for", "f77", "f90"],
"text/x-handlebars-template": ["hbs"],
"text/x-java-source": ["java"],
"text/x-lua": ["lua"],
"text/x-markdown": ["mkd"],
"text/x-nfo": ["nfo"],
"text/x-opml": ["opml"],
"text/x-org": ["*org"],
"text/x-pascal": ["p", "pas"],
"text/x-processing": ["pde"],
"text/x-sass": ["sass"],
"text/x-scss": ["scss"],
"text/x-setext": ["etx"],
"text/x-sfv": ["sfv"],
"text/x-suse-ymp": ["ymp"],
"text/x-uuencode": ["uu"],
"text/x-vcalendar": ["vcs"],
"text/x-vcard": ["vcf"],
"video/vnd.dece.hd": ["uvh", "uvvh"],
"video/vnd.dece.mobile": ["uvm", "uvvm"],
"video/vnd.dece.pd": ["uvp", "uvvp"],
"video/vnd.dece.sd": ["uvs", "uvvs"],
"video/vnd.dece.video": ["uvv", "uvvv"],
"video/vnd.dvb.file": ["dvb"],
"video/vnd.fvt": ["fvt"],
"video/vnd.mpegurl": ["mxu", "m4u"],
"video/vnd.ms-playready.media.pyv": ["pyv"],
"video/vnd.uvvu.mp4": ["uvu", "uvvu"],
"video/vnd.vivo": ["viv"],
"video/x-f4v": ["f4v"],
"video/x-fli": ["fli"],
"video/x-flv": ["flv"],
"video/x-m4v": ["m4v"],
"video/x-matroska": ["mkv", "mk3d", "mks"],
"video/x-mng": ["mng"],
"video/x-ms-asf": ["asf", "asx"],
"video/x-ms-vob": ["vob"],
"video/x-ms-wm": ["wm"],
"video/x-ms-wmv": ["wmv"],
"video/x-ms-wmx": ["wmx"],
"video/x-ms-wvx": ["wvx"],
"video/x-msvideo": ["avi"],
"video/x-sgi-movie": ["movie"],
"video/x-smv": ["smv"],
"x-conference/x-cooltalk": ["ice"]
};
Object.freeze(types);
var other_default = types;
// node_modules/mime/dist/types/standard.js
var types2 = {
"application/andrew-inset": ["ez"],
"application/appinstaller": ["appinstaller"],
"application/applixware": ["aw"],
"application/appx": ["appx"],
"application/appxbundle": ["appxbundle"],
"application/atom+xml": ["atom"],
"application/atomcat+xml": ["atomcat"],
"application/atomdeleted+xml": ["atomdeleted"],
"application/atomsvc+xml": ["atomsvc"],
"application/atsc-dwd+xml": ["dwd"],
"application/atsc-held+xml": ["held"],
"application/atsc-rsat+xml": ["rsat"],
"application/automationml-aml+xml": ["aml"],
"application/automationml-amlx+zip": ["amlx"],
"application/bdoc": ["bdoc"],
"application/calendar+xml": ["xcs"],
"application/ccxml+xml": ["ccxml"],
"application/cdfx+xml": ["cdfx"],
"application/cdmi-capability": ["cdmia"],
"application/cdmi-container": ["cdmic"],
"application/cdmi-domain": ["cdmid"],
"application/cdmi-object": ["cdmio"],
"application/cdmi-queue": ["cdmiq"],
"application/cpl+xml": ["cpl"],
"application/cu-seeme": ["cu"],
"application/cwl": ["cwl"],
"application/dash+xml": ["mpd"],
"application/dash-patch+xml": ["mpp"],
"application/davmount+xml": ["davmount"],
"application/dicom": ["dcm"],
"application/docbook+xml": ["dbk"],
"application/dssc+der": ["dssc"],
"application/dssc+xml": ["xdssc"],
"application/ecmascript": ["ecma"],
"application/emma+xml": ["emma"],
"application/emotionml+xml": ["emotionml"],
"application/epub+zip": ["epub"],
"application/exi": ["exi"],
"application/express": ["exp"],
"application/fdf": ["fdf"],
"application/fdt+xml": ["fdt"],
"application/font-tdpfr": ["pfr"],
"application/geo+json": ["geojson"],
"application/gml+xml": ["gml"],
"application/gpx+xml": ["gpx"],
"application/gxf": ["gxf"],
"application/gzip": ["gz"],
"application/hjson": ["hjson"],
"application/hyperstudio": ["stk"],
"application/inkml+xml": ["ink", "inkml"],
"application/ipfix": ["ipfix"],
"application/its+xml": ["its"],
"application/java-archive": ["jar", "war", "ear"],
"application/java-serialized-object": ["ser"],
"application/java-vm": ["class"],
"application/javascript": ["*js"],
"application/json": ["json", "map"],
"application/json5": ["json5"],
"application/jsonml+json": ["jsonml"],
"application/ld+json": ["jsonld"],
"application/lgr+xml": ["lgr"],
"application/lost+xml": ["lostxml"],
"application/mac-binhex40": ["hqx"],
"application/mac-compactpro": ["cpt"],
"application/mads+xml": ["mads"],
"application/manifest+json": ["webmanifest"],
"application/marc": ["mrc"],
"application/marcxml+xml": ["mrcx"],
"application/mathematica": ["ma", "nb", "mb"],
"application/mathml+xml": ["mathml"],
"application/mbox": ["mbox"],
"application/media-policy-dataset+xml": ["mpf"],
"application/mediaservercontrol+xml": ["mscml"],
"application/metalink+xml": ["metalink"],
"application/metalink4+xml": ["meta4"],
"application/mets+xml": ["mets"],
"application/mmt-aei+xml": ["maei"],
"application/mmt-usd+xml": ["musd"],
"application/mods+xml": ["mods"],
"application/mp21": ["m21", "mp21"],
"application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"],
"application/msix": ["msix"],
"application/msixbundle": ["msixbundle"],
"application/msword": ["doc", "dot"],
"application/mxf": ["mxf"],
"application/n-quads": ["nq"],
"application/n-triples": ["nt"],
"application/node": ["cjs"],
"application/octet-stream": [
"bin",
"dms",
"lrf",
"mar",
"so",
"dist",
"distz",
"pkg",
"bpk",
"dump",
"elc",
"deploy",
"exe",
"dll",
"deb",
"dmg",
"iso",
"img",
"msi",
"msp",
"msm",
"buffer"
],
"application/oda": ["oda"],
"application/oebps-package+xml": ["opf"],
"application/ogg": ["ogx"],
"application/omdoc+xml": ["omdoc"],
"application/onenote": [
"onetoc",
"onetoc2",
"onetmp",
"onepkg",
"one",
"onea"
],
"application/oxps": ["oxps"],
"application/p2p-overlay+xml": ["relo"],
"application/patch-ops-error+xml": ["xer"],
"application/pdf": ["pdf"],
"application/pgp-encrypted": ["pgp"],
"application/pgp-keys": ["asc"],
"application/pgp-signature": ["sig", "*asc"],
"application/pics-rules": ["prf"],
"application/pkcs10": ["p10"],
"application/pkcs7-mime": ["p7m", "p7c"],
"application/pkcs7-signature": ["p7s"],
"application/pkcs8": ["p8"],
"application/pkix-attr-cert": ["ac"],
"application/pkix-cert": ["cer"],
"application/pkix-crl": ["crl"],
"application/pkix-pkipath": ["pkipath"],
"application/pkixcmp": ["pki"],
"application/pls+xml": ["pls"],
"application/postscript": ["ai", "eps", "ps"],
"application/provenance+xml": ["provx"],
"application/pskc+xml": ["pskcxml"],
"application/raml+yaml": ["raml"],
"application/rdf+xml": ["rdf", "owl"],
"application/reginfo+xml": ["rif"],
"application/relax-ng-compact-syntax": ["rnc"],
"application/resource-lists+xml": ["rl"],
"application/resource-lists-diff+xml": ["rld"],
"application/rls-services+xml": ["rs"],
"application/route-apd+xml": ["rapd"],
"application/route-s-tsid+xml": ["sls"],
"application/route-usd+xml": ["rusd"],
"application/rpki-ghostbusters": ["gbr"],
"application/rpki-manifest": ["mft"],
"application/rpki-roa": ["roa"],
"application/rsd+xml": ["rsd"],
"application/rss+xml": ["rss"],
"application/rtf": ["rtf"],
"application/sbml+xml": ["sbml"],
"application/scvp-cv-request": ["scq"],
"application/scvp-cv-response": ["scs"],
"application/scvp-vp-request": ["spq"],
"application/scvp-vp-response": ["spp"],
"application/sdp": ["sdp"],
"application/senml+xml": ["senmlx"],
"application/sensml+xml": ["sensmlx"],
"application/set-payment-initiation": ["setpay"],
"application/set-registration-initiation": ["setreg"],
"application/shf+xml": ["shf"],
"application/sieve": ["siv", "sieve"],
"application/smil+xml": ["smi", "smil"],
"application/sparql-query": ["rq"],
"application/sparql-results+xml": ["srx"],
"application/sql": ["sql"],
"application/srgs": ["gram"],
"application/srgs+xml": ["grxml"],
"application/sru+xml": ["sru"],
"application/ssdl+xml": ["ssdl"],
"application/ssml+xml": ["ssml"],
"application/swid+xml": ["swidtag"],
"application/tei+xml": ["tei", "teicorpus"],
"application/thraud+xml": ["tfi"],
"application/timestamped-data": ["tsd"],
"application/toml": ["toml"],
"application/trig": ["trig"],
"application/ttml+xml": ["ttml"],
"application/ubjson": ["ubj"],
"application/urc-ressheet+xml": ["rsheet"],
"application/urc-targetdesc+xml": ["td"],
"application/voicexml+xml": ["vxml"],
"application/wasm": ["wasm"],
"application/watcherinfo+xml": ["wif"],
"application/widget": ["wgt"],
"application/winhlp": ["hlp"],
"application/wsdl+xml": ["wsdl"],
"application/wspolicy+xml": ["wspolicy"],
"application/xaml+xml": ["xaml"],
"application/xcap-att+xml": ["xav"],
"application/xcap-caps+xml": ["xca"],
"application/xcap-diff+xml": ["xdf"],
"application/xcap-el+xml": ["xel"],
"application/xcap-ns+xml": ["xns"],
"application/xenc+xml": ["xenc"],
"application/xfdf": ["xfdf"],
"application/xhtml+xml": ["xhtml", "xht"],
"application/xliff+xml": ["xlf"],
"application/xml": ["xml", "xsl", "xsd", "rng"],
"application/xml-dtd": ["dtd"],
"application/xop+xml": ["xop"],
"application/xproc+xml": ["xpl"],
"application/xslt+xml": ["*xsl", "xslt"],
"application/xspf+xml": ["xspf"],
"application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
"application/yang": ["yang"],
"application/yin+xml": ["yin"],
"application/zip": ["zip"],
"application/zip+dotlottie": ["lottie"],
"audio/3gpp": ["*3gpp"],
"audio/aac": ["adts", "aac"],
"audio/adpcm": ["adp"],
"audio/amr": ["amr"],
"audio/basic": ["au", "snd"],
"audio/midi": ["mid", "midi", "kar", "rmi"],
"audio/mobile-xmf": ["mxmf"],
"audio/mp3": ["*mp3"],
"audio/mp4": ["m4a", "mp4a", "m4b"],
"audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
"audio/ogg": ["oga", "ogg", "spx", "opus"],
"audio/s3m": ["s3m"],
"audio/silk": ["sil"],
"audio/wav": ["wav"],
"audio/wave": ["*wav"],
"audio/webm": ["weba"],
"audio/xm": ["xm"],
"font/collection": ["ttc"],
"font/otf": ["otf"],
"font/ttf": ["ttf"],
"font/woff": ["woff"],
"font/woff2": ["woff2"],
"image/aces": ["exr"],
"image/apng": ["apng"],
"image/avci": ["avci"],
"image/avcs": ["avcs"],
"image/avif": ["avif"],
"image/bmp": ["bmp", "dib"],
"image/cgm": ["cgm"],
"image/dicom-rle": ["drle"],
"image/dpx": ["dpx"],
"image/emf": ["emf"],
"image/fits": ["fits"],
"image/g3fax": ["g3"],
"image/gif": ["gif"],
"image/heic": ["heic"],
"image/heic-sequence": ["heics"],
"image/heif": ["heif"],
"image/heif-sequence": ["heifs"],
"image/hej2k": ["hej2"],
"image/ief": ["ief"],
"image/jaii": ["jaii"],
"image/jais": ["jais"],
"image/jls": ["jls"],
"image/jp2": ["jp2", "jpg2"],
"image/jpeg": ["jpg", "jpeg", "jpe"],
"image/jph": ["jph"],
"image/jphc": ["jhc"],
"image/jpm": ["jpm", "jpgm"],
"image/jpx": ["jpx", "jpf"],
"image/jxl": ["jxl"],
"image/jxr": ["jxr"],
"image/jxra": ["jxra"],
"image/jxrs": ["jxrs"],
"image/jxs": ["jxs"],
"image/jxsc": ["jxsc"],
"image/jxsi": ["jxsi"],
"image/jxss": ["jxss"],
"image/ktx": ["ktx"],
"image/ktx2": ["ktx2"],
"image/pjpeg": ["jfif"],
"image/png": ["png"],
"image/sgi": ["sgi"],
"image/svg+xml": ["svg", "svgz"],
"image/t38": ["t38"],
"image/tiff": ["tif", "tiff"],
"image/tiff-fx": ["tfx"],
"image/webp": ["webp"],
"image/wmf": ["wmf"],
"message/disposition-notification": ["disposition-notification"],
"message/global": ["u8msg"],
"message/global-delivery-status": ["u8dsn"],
"message/global-disposition-notification": ["u8mdn"],
"message/global-headers": ["u8hdr"],
"message/rfc822": ["eml", "mime", "mht", "mhtml"],
"model/3mf": ["3mf"],
"model/gltf+json": ["gltf"],
"model/gltf-binary": ["glb"],
"model/iges": ["igs", "iges"],
"model/jt": ["jt"],
"model/mesh": ["msh", "mesh", "silo"],
"model/mtl": ["mtl"],
"model/obj": ["obj"],
"model/prc": ["prc"],
"model/step": ["step", "stp", "stpnc", "p21", "210"],
"model/step+xml": ["stpx"],
"model/step+zip": ["stpz"],
"model/step-xml+zip": ["stpxz"],
"model/stl": ["stl"],
"model/u3d": ["u3d"],
"model/vrml": ["wrl", "vrml"],
"model/x3d+binary": ["*x3db", "x3dbz"],
"model/x3d+fastinfoset": ["x3db"],
"model/x3d+vrml": ["*x3dv", "x3dvz"],
"model/x3d+xml": ["x3d", "x3dz"],
"model/x3d-vrml": ["x3dv"],
"text/cache-manifest": ["appcache", "manifest"],
"text/calendar": ["ics", "ifb"],
"text/coffeescript": ["coffee", "litcoffee"],
"text/css": ["css"],
"text/csv": ["csv"],
"text/html": ["html", "htm", "shtml"],
"text/jade": ["jade"],
"text/javascript": ["js", "mjs"],
"text/jsx": ["jsx"],
"text/less": ["less"],
"text/markdown": ["md", "markdown"],
"text/mathml": ["mml"],
"text/mdx": ["mdx"],
"text/n3": ["n3"],
"text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
"text/richtext": ["rtx"],
"text/rtf": ["*rtf"],
"text/sgml": ["sgml", "sgm"],
"text/shex": ["shex"],
"text/slim": ["slim", "slm"],
"text/spdx": ["spdx"],
"text/stylus": ["stylus", "styl"],
"text/tab-separated-values": ["tsv"],
"text/troff": ["t", "tr", "roff", "man", "me", "ms"],
"text/turtle": ["ttl"],
"text/uri-list": ["uri", "uris", "urls"],
"text/vcard": ["vcard"],
"text/vtt": ["vtt"],
"text/wgsl": ["wgsl"],
"text/xml": ["*xml"],
"text/yaml": ["yaml", "yml"],
"video/3gpp": ["3gp", "3gpp"],
"video/3gpp2": ["3g2"],
"video/h261": ["h261"],
"video/h263": ["h263"],
"video/h264": ["h264"],
"video/iso.segment": ["m4s"],
"video/jpeg": ["jpgv"],
"video/jpm": ["*jpm", "*jpgm"],
"video/mj2": ["mj2", "mjp2"],
"video/mp2t": ["ts", "m2t", "m2ts", "mts"],
"video/mp4": ["mp4", "mp4v", "mpg4"],
"video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
"video/ogg": ["ogv"],
"video/quicktime": ["qt", "mov"],
"video/webm": ["webm"]
};
Object.freeze(types2);
var standard_default = types2;
// node_modules/mime/dist/src/Mime.js
var __classPrivateFieldGet = function(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _Mime_extensionToType;
var _Mime_typeToExtension;
var _Mime_typeToExtensions;
var Mime = class {
constructor(...args) {
_Mime_extensionToType.set(this, /* @__PURE__ */ new Map());
_Mime_typeToExtension.set(this, /* @__PURE__ */ new Map());
_Mime_typeToExtensions.set(this, /* @__PURE__ */ new Map());
for (const arg of args) {
this.define(arg);
}
}
define(typeMap, force = false) {
for (let [type, extensions] of Object.entries(typeMap)) {
type = type.toLowerCase();
extensions = extensions.map((ext2) => ext2.toLowerCase());
if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) {
__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, /* @__PURE__ */ new Set());
}
const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type);
let first = true;
for (let extension of extensions) {
const starred = extension.startsWith("*");
extension = starred ? extension.slice(1) : extension;
allExtensions?.add(extension);
if (first) {
__classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension);
}
first = false;
if (starred)
continue;
const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension);
if (currentType && currentType != type && !force) {
throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`);
}
__classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type);
}
}
return this;
}
getType(path7) {
if (typeof path7 !== "string")
return null;
const last = path7.replace(/^.*[/\\]/s, "").toLowerCase();
const ext2 = last.replace(/^.*\./s, "").toLowerCase();
const hasPath = last.length < path7.length;
const hasDot = ext2.length < last.length - 1;
if (!hasDot && hasPath)
return null;
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext2) ?? null;
}
getExtension(type) {
if (typeof type !== "string")
return null;
type = type?.split?.(";")[0];
return (type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null;
}
getAllExtensions(type) {
if (typeof type !== "string")
return null;
return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null;
}
_freeze() {
this.define = () => {
throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
};
Object.freeze(this);
for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
Object.freeze(extensions);
}
return this;
}
_getTestState() {
return {
types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f")
};
}
};
_Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtensions = /* @__PURE__ */ new WeakMap();
var Mime_default = Mime;
// node_modules/mime/dist/src/index.js
var src_default = new Mime_default(standard_default, other_default)._freeze();
// node_modules/balanced-match/dist/esm/index.js
var balanced = (a, b, str) => {
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
const r = ma !== null && mb != null && range(ma, mb, str);
return r && {
start: r[0],
end: r[1],
pre: str.slice(0, r[0]),
body: str.slice(r[0] + ma.length, r[1]),
post: str.slice(r[1] + mb.length)
};
};
var maybeMatch = (reg, str) => {
const m = str.match(reg);
return m ? m[0] : null;
};
var range = (a, b, str) => {
let begs, beg, left, right = void 0, result2;
let ai = str.indexOf(a);
let bi = str.indexOf(b, ai + 1);
let i = ai;
if (ai >= 0 && bi > 0) {
if (a === b) {
return [ai, bi];
}
begs = [];
left = str.length;
while (i >= 0 && !result2) {
if (i === ai) {
begs.push(i);
ai = str.indexOf(a, i + 1);
} else if (begs.length === 1) {
const r = begs.pop();
if (r !== void 0)
result2 = [r, bi];
} else {
beg = begs.pop();
if (beg !== void 0 && beg < left) {
left = beg;
right = bi;
}
bi = str.indexOf(b, i + 1);
}
i = ai < bi && ai >= 0 ? ai : bi;
}
if (begs.length && right !== void 0) {
result2 = [left, right];
}
}
return result2;
};
// node_modules/brace-expansion/dist/esm/index.js
var escSlash = "\0SLASH" + Math.random() + "\0";
var escOpen = "\0OPEN" + Math.random() + "\0";
var escClose = "\0CLOSE" + Math.random() + "\0";
var escComma = "\0COMMA" + Math.random() + "\0";
var escPeriod = "\0PERIOD" + Math.random() + "\0";
var escSlashPattern = new RegExp(escSlash, "g");
var escOpenPattern = new RegExp(escOpen, "g");
var escClosePattern = new RegExp(escClose, "g");
var escCommaPattern = new RegExp(escComma, "g");
var escPeriodPattern = new RegExp(escPeriod, "g");
var slashPattern = /\\\\/g;
var openPattern = /\\{/g;
var closePattern = /\\}/g;
var commaPattern = /\\,/g;
var periodPattern = /\\\./g;
var EXPANSION_MAX = 1e5;
function numeric(str) {
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
}
function escapeBraces(str) {
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
}
function unescapeBraces(str) {
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
}
function parseCommaParts(str) {
if (!str) {
return [""];
}
const parts = [];
const m = balanced("{", "}", str);
if (!m) {
return str.split(",");
}
const { pre, body, post } = m;
const p = pre.split(",");
p[p.length - 1] += "{" + body + "}";
const postParts = parseCommaParts(post);
if (post.length) {
;
p[p.length - 1] += postParts.shift();
p.push.apply(p, postParts);
}
parts.push.apply(parts, p);
return parts;
}
function expand(str, options = {}) {
if (!str) {
return [];
}
const { max = EXPANSION_MAX } = options;
if (str.slice(0, 2) === "{}") {
str = "\\{\\}" + str.slice(2);
}
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
}
function embrace(str) {
return "{" + str + "}";
}
function isPadded(el) {
return /^-?0\d/.test(el);
}
function lte(i, y) {
return i <= y;
}
function gte(i, y) {
return i >= y;
}
function expand_(str, max, isTop) {
const expansions = [];
for (; ; ) {
const m = balanced("{", "}", str);
if (!m)
return [str];
const pre = m.pre;
if (/\$$/.test(m.pre)) {
const post2 = m.post.length ? expand_(m.post, max, false) : [""];
for (let k = 0; k < post2.length && k < max; k++) {
const expansion = pre + "{" + m.body + "}" + post2[k];
expansions.push(expansion);
}
return expansions;
}
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
const isSequence = isNumericSequence || isAlphaSequence;
const isOptions = m.body.indexOf(",") >= 0;
if (!isSequence && !isOptions) {
if (m.post.match(/,(?!,).*\}/)) {
str = m.pre + "{" + m.body + escClose + m.post;
isTop = true;
continue;
}
return [str];
}
const post = m.post.length ? expand_(m.post, max, false) : [""];
let n;
if (isSequence) {
n = m.body.split(/\.\./);
} else {
n = parseCommaParts(m.body);
if (n.length === 1 && n[0] !== void 0) {
n = expand_(n[0], max, false).map(embrace);
if (n.length === 1) {
return post.map((p) => m.pre + n[0] + p);
}
}
}
let N;
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
const x = numeric(n[0]);
const y = numeric(n[1]);
const width = Math.max(n[0].length, n[1].length);
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
let test = lte;
const reverse = y < x;
if (reverse) {
incr *= -1;
test = gte;
}
const pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y) && N.length < max; i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\") {
c = "";
}
} else {
c = String(i);
if (pad) {
const need = width - c.length;
if (need > 0) {
const z = new Array(need + 1).join("0");
if (i < 0) {
c = "-" + z + c.slice(1);
} else {
c = z + c;
}
}
}
}
N.push(c);
}
} else {
N = [];
for (let j = 0; j < n.length; j++) {
N.push.apply(N, expand_(n[j], max, false));
}
}
for (let j = 0; j < N.length; j++) {
for (let k = 0; k < post.length && expansions.length < max; k++) {
const expansion = pre + N[j] + post[k];
if (!isTop || isSequence || expansion) {
expansions.push(expansion);
}
}
}
return expansions;
}
}
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
var MAX_PATTERN_LENGTH = 1024 * 64;
var assertValidPattern = (pattern) => {
if (typeof pattern !== "string") {
throw new TypeError("invalid pattern");
}
if (pattern.length > MAX_PATTERN_LENGTH) {
throw new TypeError("pattern is too long");
}
};
// node_modules/minimatch/dist/esm/brace-expressions.js
var posixClasses = {
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
"[:ascii:]": ["\\x00-\\x7f", false],
"[:blank:]": ["\\p{Zs}\\t", true],
"[:cntrl:]": ["\\p{Cc}", true],
"[:digit:]": ["\\p{Nd}", true],
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
"[:lower:]": ["\\p{Ll}", true],
"[:print:]": ["\\p{C}", true],
"[:punct:]": ["\\p{P}", true],
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
"[:upper:]": ["\\p{Lu}", true],
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
"[:xdigit:]": ["A-Fa-f0-9", false]
};
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
var rangesToString = (ranges) => ranges.join("");
var parseClass = (glob, position) => {
const pos = position;
if (glob.charAt(pos) !== "[") {
throw new Error("not in a brace expression");
}
const ranges = [];
const negs = [];
let i = pos + 1;
let sawStart = false;
let uflag = false;
let escaping = false;
let negate = false;
let endPos = pos;
let rangeStart = "";
WHILE: while (i < glob.length) {
const c = glob.charAt(i);
if ((c === "!" || c === "^") && i === pos + 1) {
negate = true;
i++;
continue;
}
if (c === "]" && sawStart && !escaping) {
endPos = i + 1;
break;
}
sawStart = true;
if (c === "\\") {
if (!escaping) {
escaping = true;
i++;
continue;
}
}
if (c === "[" && !escaping) {
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
if (glob.startsWith(cls, i)) {
if (rangeStart) {
return ["$.", false, glob.length - pos, true];
}
i += cls.length;
if (neg)
negs.push(unip);
else
ranges.push(unip);
uflag = uflag || u;
continue WHILE;
}
}
}
escaping = false;
if (rangeStart) {
if (c > rangeStart) {
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
} else if (c === rangeStart) {
ranges.push(braceEscape(c));
}
rangeStart = "";
i++;
continue;
}
if (glob.startsWith("-]", i + 1)) {
ranges.push(braceEscape(c + "-"));
i += 2;
continue;
}
if (glob.startsWith("-", i + 1)) {
rangeStart = c;
i += 2;
continue;
}
ranges.push(braceEscape(c));
i++;
}
if (endPos < i) {
return ["", false, 0, false];
}
if (!ranges.length && !negs.length) {
return ["$.", false, glob.length - pos, true];
}
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
return [regexpEscape(r), false, endPos - pos, false];
}
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
return [comb, uflag, endPos - pos, true];
};
// node_modules/minimatch/dist/esm/unescape.js
var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
if (magicalBraces) {
return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
}
return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
};
// node_modules/minimatch/dist/esm/ast.js
var _a;
var types3 = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
var isExtglobType = (c) => types3.has(c);
var isExtglobAST = (c) => isExtglobType(c.type);
var adoptionMap = /* @__PURE__ */ new Map([
["!", ["@"]],
["?", ["?", "@"]],
["@", ["@"]],
["*", ["*", "+", "?", "@"]],
["+", ["+", "@"]]
]);
var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
["!", ["?"]],
["@", ["?"]],
["+", ["?", "*"]]
]);
var adoptionAnyMap = /* @__PURE__ */ new Map([
["!", ["?", "@"]],
["?", ["?", "@"]],
["@", ["?", "@"]],
["*", ["*", "+", "?", "@"]],
["+", ["+", "@", "?", "*"]]
]);
var usurpMap = /* @__PURE__ */ new Map([
["!", /* @__PURE__ */ new Map([["!", "@"]])],
[
"?",
/* @__PURE__ */ new Map([
["*", "*"],
["+", "*"]
])
],
[
"@",
/* @__PURE__ */ new Map([
["!", "!"],
["?", "?"],
["@", "@"],
["*", "*"],
["+", "+"]
])
],
[
"+",
/* @__PURE__ */ new Map([
["?", "*"],
["*", "*"]
])
]
]);
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
var startNoDot = "(?!\\.)";
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
var justDots = /* @__PURE__ */ new Set(["..", "."]);
var reSpecials = new Set("().*{}+?[]^$\\!");
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
var qmark = "[^/]";
var star = qmark + "*?";
var starNoEmpty = qmark + "+?";
var ID = 0;
var AST = class {
type;
#root;
#hasMagic;
#uflag = false;
#parts = [];
#parent;
#parentIndex;
#negs;
#filledNegs = false;
#options;
#toString;
// set to true if it's an extglob with no children
// (which really means one child of '')
#emptyExt = false;
id = ++ID;
get depth() {
return (this.#parent?.depth ?? -1) + 1;
}
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
return {
"@@type": "AST",
id: this.id,
type: this.type,
root: this.#root.id,
parent: this.#parent?.id,
depth: this.depth,
partsLength: this.#parts.length,
parts: this.#parts
};
}
constructor(type, parent, options = {}) {
this.type = type;
if (type)
this.#hasMagic = true;
this.#parent = parent;
this.#root = this.#parent ? this.#parent.#root : this;
this.#options = this.#root === this ? options : this.#root.#options;
this.#negs = this.#root === this ? [] : this.#root.#negs;
if (type === "!" && !this.#root.#filledNegs)
this.#negs.push(this);
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
}
get hasMagic() {
if (this.#hasMagic !== void 0)
return this.#hasMagic;
for (const p of this.#parts) {
if (typeof p === "string")
continue;
if (p.type || p.hasMagic)
return this.#hasMagic = true;
}
return this.#hasMagic;
}
// reconstructs the pattern
toString() {
return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
}
#fillNegs() {
if (this !== this.#root)
throw new Error("should only call on root");
if (this.#filledNegs)
return this;
this.toString();
this.#filledNegs = true;
let n;
while (n = this.#negs.pop()) {
if (n.type !== "!")
continue;
let p = n;
let pp = p.#parent;
while (pp) {
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
for (const part of n.#parts) {
if (typeof part === "string") {
throw new Error("string part in extglob AST??");
}
part.copyIn(pp.#parts[i]);
}
}
p = pp;
pp = p.#parent;
}
}
return this;
}
push(...parts) {
for (const p of parts) {
if (p === "")
continue;
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
throw new Error("invalid part: " + p);
}
this.#parts.push(p);
}
}
toJSON() {
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
if (this.isStart() && !this.type)
ret.unshift([]);
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
ret.push({});
}
return ret;
}
isStart() {
if (this.#root === this)
return true;
if (!this.#parent?.isStart())
return false;
if (this.#parentIndex === 0)
return true;
const p = this.#parent;
for (let i = 0; i < this.#parentIndex; i++) {
const pp = p.#parts[i];
if (!(pp instanceof _a && pp.type === "!")) {
return false;
}
}
return true;
}
isEnd() {
if (this.#root === this)
return true;
if (this.#parent?.type === "!")
return true;
if (!this.#parent?.isEnd())
return false;
if (!this.type)
return this.#parent?.isEnd();
const pl = this.#parent ? this.#parent.#parts.length : 0;
return this.#parentIndex === pl - 1;
}
copyIn(part) {
if (typeof part === "string")
this.push(part);
else
this.push(part.clone(this));
}
clone(parent) {
const c = new _a(this.type, parent);
for (const p of this.#parts) {
c.copyIn(p);
}
return c;
}
static #parseAST(str, ast, pos, opt, extDepth) {
const maxDepth = opt.maxExtglobRecursion ?? 2;
let escaping = false;
let inBrace = false;
let braceStart = -1;
let braceNeg = false;
if (ast.type === null) {
let i2 = pos;
let acc2 = "";
while (i2 < str.length) {
const c = str.charAt(i2++);
if (escaping || c === "\\") {
escaping = !escaping;
acc2 += c;
continue;
}
if (inBrace) {
if (i2 === braceStart + 1) {
if (c === "^" || c === "!") {
braceNeg = true;
}
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
inBrace = false;
}
acc2 += c;
continue;
} else if (c === "[") {
inBrace = true;
braceStart = i2;
braceNeg = false;
acc2 += c;
continue;
}
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
if (doRecurse) {
ast.push(acc2);
acc2 = "";
const ext2 = new _a(c, ast);
i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1);
ast.push(ext2);
continue;
}
acc2 += c;
}
ast.push(acc2);
return i2;
}
let i = pos + 1;
let part = new _a(null, ast);
const parts = [];
let acc = "";
while (i < str.length) {
const c = str.charAt(i++);
if (escaping || c === "\\") {
escaping = !escaping;
acc += c;
continue;
}
if (inBrace) {
if (i === braceStart + 1) {
if (c === "^" || c === "!") {
braceNeg = true;
}
} else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
inBrace = false;
}
acc += c;
continue;
} else if (c === "[") {
inBrace = true;
braceStart = i;
braceNeg = false;
acc += c;
continue;
}
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
if (doRecurse) {
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
part.push(acc);
acc = "";
const ext2 = new _a(c, part);
part.push(ext2);
i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd);
continue;
}
if (c === "|") {
part.push(acc);
acc = "";
parts.push(part);
part = new _a(null, ast);
continue;
}
if (c === ")") {
if (acc === "" && ast.#parts.length === 0) {
ast.#emptyExt = true;
}
part.push(acc);
acc = "";
ast.push(...parts, part);
return i;
}
acc += c;
}
ast.type = null;
ast.#hasMagic = void 0;
ast.#parts = [str.substring(pos - 1)];
return i;
}
#canAdoptWithSpace(child) {
return this.#canAdopt(child, adoptionWithSpaceMap);
}
#canAdopt(child, map = adoptionMap) {
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
return false;
}
const gc = child.#parts[0];
if (!gc || typeof gc !== "object" || gc.type === null) {
return false;
}
return this.#canAdoptType(gc.type, map);
}
#canAdoptType(c, map = adoptionAnyMap) {
return !!map.get(this.type)?.includes(c);
}
#adoptWithSpace(child, index) {
const gc = child.#parts[0];
const blank = new _a(null, gc, this.options);
blank.#parts.push("");
gc.push(blank);
this.#adopt(child, index);
}
#adopt(child, index) {
const gc = child.#parts[0];
this.#parts.splice(index, 1, ...gc.#parts);
for (const p of gc.#parts) {
if (typeof p === "object")
p.#parent = this;
}
this.#toString = void 0;
}
#canUsurpType(c) {
const m = usurpMap.get(this.type);
return !!m?.has(c);
}
#canUsurp(child) {
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
return false;
}
const gc = child.#parts[0];
if (!gc || typeof gc !== "object" || gc.type === null) {
return false;
}
return this.#canUsurpType(gc.type);
}
#usurp(child) {
const m = usurpMap.get(this.type);
const gc = child.#parts[0];
const nt = m?.get(gc.type);
if (!nt)
return false;
this.#parts = gc.#parts;
for (const p of this.#parts) {
if (typeof p === "object") {
p.#parent = this;
}
}
this.type = nt;
this.#toString = void 0;
this.#emptyExt = false;
}
static fromGlob(pattern, options = {}) {
const ast = new _a(null, void 0, options);
_a.#parseAST(pattern, ast, 0, options, 0);
return ast;
}
// returns the regular expression if there's magic, or the unescaped
// string if not.
toMMPattern() {
if (this !== this.#root)
return this.#root.toMMPattern();
const glob = this.toString();
const [re2, body, hasMagic, uflag] = this.toRegExpSource();
const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
if (!anyMagic) {
return body;
}
const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
return Object.assign(new RegExp(`^${re2}$`, flags), {
_src: re2,
_glob: glob
});
}
get options() {
return this.#options;
}
// returns the string match, the regexp source, whether there's magic
// in the regexp (so a regular expression is required) and whether or
// not the uflag is needed for the regular expression (for posix classes)
// TODO: instead of injecting the start/end at this point, just return
// the BODY of the regexp, along with the start/end portions suitable
// for binding the start/end in either a joined full-path makeRe context
// (where we bind to (^|/), or a standalone matchPart context (where
// we bind to ^, and not /). Otherwise slashes get duped!
//
// In part-matching mode, the start is:
// - if not isStart: nothing
// - if traversal possible, but not allowed: ^(?!\.\.?$)
// - if dots allowed or not possible: ^
// - if dots possible and not allowed: ^(?!\.)
// end is:
// - if not isEnd(): nothing
// - else: $
//
// In full-path matching mode, we put the slash at the START of the
// pattern, so start is:
// - if first pattern: same as part-matching mode
// - if not isStart(): nothing
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
// - if dots allowed or not possible: /
// - if dots possible and not allowed: /(?!\.)
// end is:
// - if last pattern, same as part-matching mode
// - else nothing
//
// Always put the (?:$|/) on negated tails, though, because that has to be
// there to bind the end of the negated pattern portion, and it's easier to
// just stick it in now rather than try to inject it later in the middle of
// the pattern.
//
// We can just always return the same end, and leave it up to the caller
// to know whether it's going to be used joined or in parts.
// And, if the start is adjusted slightly, can do the same there:
// - if not isStart: nothing
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
// - if dots allowed or not possible: (?:/|^)
// - if dots possible and not allowed: (?:/|^)(?!\.)
//
// But it's better to have a simpler binding without a conditional, for
// performance, so probably better to return both start options.
//
// Then the caller just ignores the end if it's not the first pattern,
// and the start always gets applied.
//
// But that's always going to be $ if it's the ending pattern, or nothing,
// so the caller can just attach $ at the end of the pattern when building.
//
// So the todo is:
// - better detect what kind of start is needed
// - return both flavors of starting pattern
// - attach $ at the end of the pattern when creating the actual RegExp
//
// Ah, but wait, no, that all only applies to the root when the first pattern
// is not an extglob. If the first pattern IS an extglob, then we need all
// that dot prevention biz to live in the extglob portions, because eg
// +(*|.x*) can match .xy but not .yx.
//
// So, return the two flavors if it's #root and the first child is not an
// AST, otherwise leave it to the child AST to handle it, and there,
// use the (?:^|/) style of start binding.
//
// Even simplified further:
// - Since the start for a join is eg /(?!\.) and the start for a part
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
// or start or whatever) and prepend ^ or / at the Regexp construction.
toRegExpSource(allowDot) {
const dot = allowDot ?? !!this.#options.dot;
if (this.#root === this) {
this.#flatten();
this.#fillNegs();
}
if (!isExtglobAST(this)) {
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
const src = this.#parts.map((p) => {
const [re2, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
this.#hasMagic = this.#hasMagic || hasMagic;
this.#uflag = this.#uflag || uflag;
return re2;
}).join("");
let start2 = "";
if (this.isStart()) {
if (typeof this.#parts[0] === "string") {
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
if (!dotTravAllowed) {
const aps = addPatternStart;
const needNoTrav = (
// dots are allowed, and the pattern starts with [ or .
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
);
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
}
}
}
let end = "";
if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
end = "(?:$|\\/)";
}
const final2 = start2 + src + end;
return [
final2,
unescape(src),
this.#hasMagic = !!this.#hasMagic,
this.#uflag
];
}
const repeated = this.type === "*" || this.type === "+";
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
let body = this.#partsToRegExp(dot);
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
const s = this.toString();
const me = this;
me.#parts = [s];
me.type = null;
me.#hasMagic = void 0;
return [s, unescape(this.toString()), false, false];
}
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
if (bodyDotAllowed === body) {
bodyDotAllowed = "";
}
if (bodyDotAllowed) {
body = `(?:${body})(?:${bodyDotAllowed})*?`;
}
let final = "";
if (this.type === "!" && this.#emptyExt) {
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
} else {
const close = this.type === "!" ? (
// !() must match something,but !(x) can match ''
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
final = start + body + close;
}
return [
final,
unescape(body),
this.#hasMagic = !!this.#hasMagic,
this.#uflag
];
}
#flatten() {
if (!isExtglobAST(this)) {
for (const p of this.#parts) {
if (typeof p === "object") {
p.#flatten();
}
}
} else {
let iterations = 0;
let done = false;
do {
done = true;
for (let i = 0; i < this.#parts.length; i++) {
const c = this.#parts[i];
if (typeof c === "object") {
c.#flatten();
if (this.#canAdopt(c)) {
done = false;
this.#adopt(c, i);
} else if (this.#canAdoptWithSpace(c)) {
done = false;
this.#adoptWithSpace(c, i);
} else if (this.#canUsurp(c)) {
done = false;
this.#usurp(c);
}
}
}
} while (!done && ++iterations < 10);
}
this.#toString = void 0;
}
#partsToRegExp(dot) {
return this.#parts.map((p) => {
if (typeof p === "string") {
throw new Error("string type in extglob ast??");
}
const [re2, _, _hasMagic, uflag] = p.toRegExpSource(dot);
this.#uflag = this.#uflag || uflag;
return re2;
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
}
static #parseGlob(glob, hasMagic, noEmpty = false) {
let escaping = false;
let re2 = "";
let uflag = false;
let inStar = false;
for (let i = 0; i < glob.length; i++) {
const c = glob.charAt(i);
if (escaping) {
escaping = false;
re2 += (reSpecials.has(c) ? "\\" : "") + c;
continue;
}
if (c === "*") {
if (inStar)
continue;
inStar = true;
re2 += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
hasMagic = true;
continue;
} else {
inStar = false;
}
if (c === "\\") {
if (i === glob.length - 1) {
re2 += "\\\\";
} else {
escaping = true;
}
continue;
}
if (c === "[") {
const [src, needUflag, consumed, magic] = parseClass(glob, i);
if (consumed) {
re2 += src;
uflag = uflag || needUflag;
i += consumed - 1;
hasMagic = hasMagic || magic;
continue;
}
}
if (c === "?") {
re2 += qmark;
hasMagic = true;
continue;
}
re2 += regExpEscape(c);
}
return [re2, unescape(glob), !!hasMagic, uflag];
}
};
_a = AST;
// node_modules/minimatch/dist/esm/escape.js
var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
if (magicalBraces) {
return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
}
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
};
// node_modules/minimatch/dist/esm/index.js
var minimatch = (p, pattern, options = {}) => {
assertValidPattern(pattern);
if (!options.nocomment && pattern.charAt(0) === "#") {
return false;
}
return new Minimatch(pattern, options).match(p);
};
var starDotExtRE = /^\*+([^+@!?*[(]*)$/;
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
var starDotExtTestNocase = (ext2) => {
ext2 = ext2.toLowerCase();
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
};
var starDotExtTestNocaseDot = (ext2) => {
ext2 = ext2.toLowerCase();
return (f) => f.toLowerCase().endsWith(ext2);
};
var starDotStarRE = /^\*+\.\*+$/;
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
var dotStarRE = /^\.\*+$/;
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
var starRE = /^\*+$/;
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
var qmarksRE = /^\?+([^+@!?*[(]*)?$/;
var qmarksTestNocase = ([$0, ext2 = ""]) => {
const noext = qmarksTestNoExt([$0]);
if (!ext2)
return noext;
ext2 = ext2.toLowerCase();
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
};
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
const noext = qmarksTestNoExtDot([$0]);
if (!ext2)
return noext;
ext2 = ext2.toLowerCase();
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
};
var qmarksTestDot = ([$0, ext2 = ""]) => {
const noext = qmarksTestNoExtDot([$0]);
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
};
var qmarksTest = ([$0, ext2 = ""]) => {
const noext = qmarksTestNoExt([$0]);
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
};
var qmarksTestNoExt = ([$0]) => {
const len = $0.length;
return (f) => f.length === len && !f.startsWith(".");
};
var qmarksTestNoExtDot = ([$0]) => {
const len = $0.length;
return (f) => f.length === len && f !== "." && f !== "..";
};
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
var path3 = {
win32: { sep: "\\" },
posix: { sep: "/" }
};
var sep = defaultPlatform === "win32" ? path3.win32.sep : path3.posix.sep;
minimatch.sep = sep;
var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
minimatch.GLOBSTAR = GLOBSTAR;
var qmark2 = "[^/]";
var star2 = qmark2 + "*?";
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
minimatch.filter = filter;
var ext = (a, b = {}) => Object.assign({}, a, b);
var defaults = (def) => {
if (!def || typeof def !== "object" || !Object.keys(def).length) {
return minimatch;
}
const orig = minimatch;
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
return Object.assign(m, {
Minimatch: class Minimatch extends orig.Minimatch {
constructor(pattern, options = {}) {
super(pattern, ext(def, options));
}
static defaults(options) {
return orig.defaults(ext(def, options)).Minimatch;
}
},
AST: class AST extends orig.AST {
/* c8 ignore start */
constructor(type, parent, options = {}) {
super(type, parent, ext(def, options));
}
/* c8 ignore stop */
static fromGlob(pattern, options = {}) {
return orig.AST.fromGlob(pattern, ext(def, options));
}
},
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
defaults: (options) => orig.defaults(ext(def, options)),
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
sep: orig.sep,
GLOBSTAR
});
};
minimatch.defaults = defaults;
var braceExpand = (pattern, options = {}) => {
assertValidPattern(pattern);
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
return [pattern];
}
return expand(pattern, { max: options.braceExpandMax });
};
minimatch.braceExpand = braceExpand;
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
minimatch.makeRe = makeRe;
var match = (list, pattern, options = {}) => {
const mm = new Minimatch(pattern, options);
list = list.filter((f) => mm.match(f));
if (mm.options.nonull && !list.length) {
list.push(pattern);
}
return list;
};
minimatch.match = match;
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
var Minimatch = class {
options;
set;
pattern;
windowsPathsNoEscape;
nonegate;
negate;
comment;
empty;
preserveMultipleSlashes;
partial;
globSet;
globParts;
nocase;
isWindows;
platform;
windowsNoMagicRoot;
maxGlobstarRecursion;
regexp;
constructor(pattern, options = {}) {
assertValidPattern(pattern);
options = options || {};
this.options = options;
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
this.pattern = pattern;
this.platform = options.platform || defaultPlatform;
this.isWindows = this.platform === "win32";
const awe = "allowWindowsEscape";
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false;
if (this.windowsPathsNoEscape) {
this.pattern = this.pattern.replace(/\\/g, "/");
}
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
this.regexp = null;
this.negate = false;
this.nonegate = !!options.nonegate;
this.comment = false;
this.empty = false;
this.partial = !!options.partial;
this.nocase = !!this.options.nocase;
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
this.globSet = [];
this.globParts = [];
this.set = [];
this.make();
}
hasMagic() {
if (this.options.magicalBraces && this.set.length > 1) {
return true;
}
for (const pattern of this.set) {
for (const part of pattern) {
if (typeof part !== "string")
return true;
}
}
return false;
}
debug(..._) {
}
make() {
const pattern = this.pattern;
const options = this.options;
if (!options.nocomment && pattern.charAt(0) === "#") {
this.comment = true;
return;
}
if (!pattern) {
this.empty = true;
return;
}
this.parseNegate();
this.globSet = [...new Set(this.braceExpand())];
if (options.debug) {
this.debug = (...args) => console.error(...args);
}
this.debug(this.pattern, this.globSet);
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
this.globParts = this.preprocess(rawGlobParts);
this.debug(this.pattern, this.globParts);
let set = this.globParts.map((s, _, __) => {
if (this.isWindows && this.windowsNoMagicRoot) {
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
const isDrive = /^[a-z]:/i.test(s[0]);
if (isUNC) {
return [
...s.slice(0, 4),
...s.slice(4).map((ss) => this.parse(ss))
];
} else if (isDrive) {
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
}
}
return s.map((ss) => this.parse(ss));
});
this.debug(this.pattern, set);
this.set = set.filter((s) => s.indexOf(false) === -1);
if (this.isWindows) {
for (let i = 0; i < this.set.length; i++) {
const p = this.set[i];
if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
p[2] = "?";
}
}
}
this.debug(this.pattern, this.set);
}
// various transforms to equivalent pattern sets that are
// faster to process in a filesystem walk. The goal is to
// eliminate what we can, and push all ** patterns as far
// to the right as possible, even if it increases the number
// of patterns that we have to process.
preprocess(globParts) {
if (this.options.noglobstar) {
for (const partset of globParts) {
for (let j = 0; j < partset.length; j++) {
if (partset[j] === "**") {
partset[j] = "*";
}
}
}
}
const { optimizationLevel = 1 } = this.options;
if (optimizationLevel >= 2) {
globParts = this.firstPhasePreProcess(globParts);
globParts = this.secondPhasePreProcess(globParts);
} else if (optimizationLevel >= 1) {
globParts = this.levelOneOptimize(globParts);
} else {
globParts = this.adjascentGlobstarOptimize(globParts);
}
return globParts;
}
// just get rid of adjascent ** portions
adjascentGlobstarOptimize(globParts) {
return globParts.map((parts) => {
let gs = -1;
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
let i = gs;
while (parts[i + 1] === "**") {
i++;
}
if (i !== gs) {
parts.splice(gs, i - gs);
}
}
return parts;
});
}
// get rid of adjascent ** and resolve .. portions
levelOneOptimize(globParts) {
return globParts.map((parts) => {
parts = parts.reduce((set, part) => {
const prev = set[set.length - 1];
if (part === "**" && prev === "**") {
return set;
}
if (part === "..") {
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
set.pop();
return set;
}
}
set.push(part);
return set;
}, []);
return parts.length === 0 ? [""] : parts;
});
}
levelTwoFileOptimize(parts) {
if (!Array.isArray(parts)) {
parts = this.slashSplit(parts);
}
let didSomething = false;
do {
didSomething = false;
if (!this.preserveMultipleSlashes) {
for (let i = 1; i < parts.length - 1; i++) {
const p = parts[i];
if (i === 1 && p === "" && parts[0] === "")
continue;
if (p === "." || p === "") {
didSomething = true;
parts.splice(i, 1);
i--;
}
}
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
didSomething = true;
parts.pop();
}
}
let dd = 0;
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
const p = parts[dd - 1];
if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) {
didSomething = true;
parts.splice(dd - 1, 2);
dd -= 2;
}
}
} while (didSomething);
return parts.length === 0 ? [""] : parts;
}
// First phase: single-pattern processing
// <pre> is 1 or more portions
// <rest> is 1 or more portions
// <p> is any portion other than ., .., '', or **
// <e> is . or ''
//
// **/.. is *brutal* for filesystem walking performance, because
// it effectively resets the recursive walk each time it occurs,
// and ** cannot be reduced out by a .. pattern part like a regexp
// or most strings (other than .., ., and '') can be.
//
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
// <pre>/<e>/<rest> -> <pre>/<rest>
// <pre>/<p>/../<rest> -> <pre>/<rest>
// **/**/<rest> -> **/<rest>
//
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
// this WOULD be allowed if ** did follow symlinks, or * didn't
firstPhasePreProcess(globParts) {
let didSomething = false;
do {
didSomething = false;
for (let parts of globParts) {
let gs = -1;
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
let gss = gs;
while (parts[gss + 1] === "**") {
gss++;
}
if (gss > gs) {
parts.splice(gs + 1, gss - gs);
}
let next = parts[gs + 1];
const p = parts[gs + 2];
const p2 = parts[gs + 3];
if (next !== "..")
continue;
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
continue;
}
didSomething = true;
parts.splice(gs, 1);
const other = parts.slice(0);
other[gs] = "**";
globParts.push(other);
gs--;
}
if (!this.preserveMultipleSlashes) {
for (let i = 1; i < parts.length - 1; i++) {
const p = parts[i];
if (i === 1 && p === "" && parts[0] === "")
continue;
if (p === "." || p === "") {
didSomething = true;
parts.splice(i, 1);
i--;
}
}
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
didSomething = true;
parts.pop();
}
}
let dd = 0;
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
const p = parts[dd - 1];
if (p && p !== "." && p !== ".." && p !== "**") {
didSomething = true;
const needDot = dd === 1 && parts[dd + 1] === "**";
const splin = needDot ? ["."] : [];
parts.splice(dd - 1, 2, ...splin);
if (parts.length === 0)
parts.push("");
dd -= 2;
}
}
}
} while (didSomething);
return globParts;
}
// second phase: multi-pattern dedupes
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
//
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
// ^-- not valid because ** doens't follow symlinks
secondPhasePreProcess(globParts) {
for (let i = 0; i < globParts.length - 1; i++) {
for (let j = i + 1; j < globParts.length; j++) {
const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
if (matched) {
globParts[i] = [];
globParts[j] = matched;
break;
}
}
}
return globParts.filter((gs) => gs.length);
}
partsMatch(a, b, emptyGSMatch = false) {
let ai = 0;
let bi = 0;
let result2 = [];
let which = "";
while (ai < a.length && bi < b.length) {
if (a[ai] === b[bi]) {
result2.push(which === "b" ? b[bi] : a[ai]);
ai++;
bi++;
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
result2.push(a[ai]);
ai++;
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
result2.push(b[bi]);
bi++;
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
if (which === "b")
return false;
which = "a";
result2.push(a[ai]);
ai++;
bi++;
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
if (which === "a")
return false;
which = "b";
result2.push(b[bi]);
ai++;
bi++;
} else {
return false;
}
}
return a.length === b.length && result2;
}
parseNegate() {
if (this.nonegate)
return;
const pattern = this.pattern;
let negate = false;
let negateOffset = 0;
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
negate = !negate;
negateOffset++;
}
if (negateOffset)
this.pattern = pattern.slice(negateOffset);
this.negate = negate;
}
// set partial to true to test if, for example,
// "/a/b" matches the start of "/*/b/*/d"
// Partial means, if you run out of file before you run
// out of pattern, then that's fine, as long as all
// the parts match.
matchOne(file2, pattern, partial = false) {
let fileStartIndex = 0;
let patternStartIndex = 0;
if (this.isWindows) {
const fileDrive = typeof file2[0] === "string" && /^[a-z]:$/i.test(file2[0]);
const fileUNC = !fileDrive && file2[0] === "" && file2[1] === "" && file2[2] === "?" && /^[a-z]:$/i.test(file2[3]);
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
if (typeof fdi === "number" && typeof pdi === "number") {
const [fd, pd] = [
file2[fdi],
pattern[pdi]
];
if (fd.toLowerCase() === pd.toLowerCase()) {
pattern[pdi] = fd;
patternStartIndex = pdi;
fileStartIndex = fdi;
}
}
}
const { optimizationLevel = 1 } = this.options;
if (optimizationLevel >= 2) {
file2 = this.levelTwoFileOptimize(file2);
}
if (pattern.includes(GLOBSTAR)) {
return this.#matchGlobstar(file2, pattern, partial, fileStartIndex, patternStartIndex);
}
return this.#matchOne(file2, pattern, partial, fileStartIndex, patternStartIndex);
}
#matchGlobstar(file2, pattern, partial, fileIndex, patternIndex) {
const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
const lastgs = pattern.lastIndexOf(GLOBSTAR);
const [head, body, tail] = partial ? [
pattern.slice(patternIndex, firstgs),
pattern.slice(firstgs + 1),
[]
] : [
pattern.slice(patternIndex, firstgs),
pattern.slice(firstgs + 1, lastgs),
pattern.slice(lastgs + 1)
];
if (head.length) {
const fileHead = file2.slice(fileIndex, fileIndex + head.length);
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
return false;
}
fileIndex += head.length;
patternIndex += head.length;
}
let fileTailMatch = 0;
if (tail.length) {
if (tail.length + fileIndex > file2.length)
return false;
let tailStart = file2.length - tail.length;
if (this.#matchOne(file2, tail, partial, tailStart, 0)) {
fileTailMatch = tail.length;
} else {
if (file2[file2.length - 1] !== "" || fileIndex + tail.length === file2.length) {
return false;
}
tailStart--;
if (!this.#matchOne(file2, tail, partial, tailStart, 0)) {
return false;
}
fileTailMatch = tail.length + 1;
}
}
if (!body.length) {
let sawSome = !!fileTailMatch;
for (let i2 = fileIndex; i2 < file2.length - fileTailMatch; i2++) {
const f = String(file2[i2]);
sawSome = true;
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
return false;
}
}
return partial || sawSome;
}
const bodySegments = [[[], 0]];
let currentBody = bodySegments[0];
let nonGsParts = 0;
const nonGsPartsSums = [0];
for (const b of body) {
if (b === GLOBSTAR) {
nonGsPartsSums.push(nonGsParts);
currentBody = [[], 0];
bodySegments.push(currentBody);
} else {
currentBody[0].push(b);
nonGsParts++;
}
}
let i = bodySegments.length - 1;
const fileLength = file2.length - fileTailMatch;
for (const b of bodySegments) {
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
}
return !!this.#matchGlobStarBodySections(file2, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
}
// return false for "nope, not matching"
// return null for "not matching, cannot keep trying"
#matchGlobStarBodySections(file2, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
const bs = bodySegments[bodyIndex];
if (!bs) {
for (let i = fileIndex; i < file2.length; i++) {
sawTail = true;
const f = file2[i];
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
return false;
}
}
return sawTail;
}
const [body, after] = bs;
while (fileIndex <= after) {
const m = this.#matchOne(file2.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
if (m && globStarDepth < this.maxGlobstarRecursion) {
const sub = this.#matchGlobStarBodySections(file2, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
if (sub !== false) {
return sub;
}
}
const f = file2[fileIndex];
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
return false;
}
fileIndex++;
}
return partial || null;
}
#matchOne(file2, pattern, partial, fileIndex, patternIndex) {
let fi;
let pi;
let pl;
let fl;
for (fi = fileIndex, pi = patternIndex, fl = file2.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
this.debug("matchOne loop");
let p = pattern[pi];
let f = file2[fi];
this.debug(pattern, p, f);
if (p === false || p === GLOBSTAR) {
return false;
}
let hit;
if (typeof p === "string") {
hit = f === p;
this.debug("string match", p, f, hit);
} else {
hit = p.test(f);
this.debug("pattern match", p, f, hit);
}
if (!hit)
return false;
}
if (fi === fl && pi === pl) {
return true;
} else if (fi === fl) {
return partial;
} else if (pi === pl) {
return fi === fl - 1 && file2[fi] === "";
} else {
throw new Error("wtf?");
}
}
braceExpand() {
return braceExpand(this.pattern, this.options);
}
parse(pattern) {
assertValidPattern(pattern);
const options = this.options;
if (pattern === "**")
return GLOBSTAR;
if (pattern === "")
return "";
let m;
let fastTest = null;
if (m = pattern.match(starRE)) {
fastTest = options.dot ? starTestDot : starTest;
} else if (m = pattern.match(starDotExtRE)) {
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
} else if (m = pattern.match(qmarksRE)) {
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
} else if (m = pattern.match(starDotStarRE)) {
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
} else if (m = pattern.match(dotStarRE)) {
fastTest = dotStarTest;
}
const re2 = AST.fromGlob(pattern, this.options).toMMPattern();
if (fastTest && typeof re2 === "object") {
Reflect.defineProperty(re2, "test", { value: fastTest });
}
return re2;
}
makeRe() {
if (this.regexp || this.regexp === false)
return this.regexp;
const set = this.set;
if (!set.length) {
this.regexp = false;
return this.regexp;
}
const options = this.options;
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
const flags = new Set(options.nocase ? ["i"] : []);
let re2 = set.map((pattern) => {
const pp = pattern.map((p) => {
if (p instanceof RegExp) {
for (const f of p.flags.split(""))
flags.add(f);
}
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
});
pp.forEach((p, i) => {
const next = pp[i + 1];
const prev = pp[i - 1];
if (p !== GLOBSTAR || prev === GLOBSTAR) {
return;
}
if (prev === void 0) {
if (next !== void 0 && next !== GLOBSTAR) {
pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
} else {
pp[i] = twoStar;
}
} else if (next === void 0) {
pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
} else if (next !== GLOBSTAR) {
pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
pp[i + 1] = GLOBSTAR;
}
});
const filtered = pp.filter((p) => p !== GLOBSTAR);
if (this.partial && filtered.length >= 1) {
const prefixes = [];
for (let i = 1; i <= filtered.length; i++) {
prefixes.push(filtered.slice(0, i).join("/"));
}
return "(?:" + prefixes.join("|") + ")";
}
return filtered.join("/");
}).join("|");
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
re2 = "^" + open + re2 + close + "$";
if (this.partial) {
re2 = "^(?:\\/|" + open + re2.slice(1, -1) + close + ")$";
}
if (this.negate)
re2 = "^(?!" + re2 + ").+$";
try {
this.regexp = new RegExp(re2, [...flags].join(""));
} catch {
this.regexp = false;
}
return this.regexp;
}
slashSplit(p) {
if (this.preserveMultipleSlashes) {
return p.split("/");
} else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
return ["", ...p.split(/\/+/)];
} else {
return p.split(/\/+/);
}
}
match(f, partial = this.partial) {
this.debug("match", f, this.pattern);
if (this.comment) {
return false;
}
if (this.empty) {
return f === "";
}
if (f === "/" && partial) {
return true;
}
const options = this.options;
if (this.isWindows) {
f = f.split("\\").join("/");
}
const ff = this.slashSplit(f);
this.debug(this.pattern, "split", ff);
const set = this.set;
this.debug(this.pattern, "set", set);
let filename = ff[ff.length - 1];
if (!filename) {
for (let i = ff.length - 2; !filename && i >= 0; i--) {
filename = ff[i];
}
}
for (const pattern of set) {
let file2 = ff;
if (options.matchBase && pattern.length === 1) {
file2 = [filename];
}
const hit = this.matchOne(file2, pattern, partial);
if (hit) {
if (options.flipNegate) {
return true;
}
return !this.negate;
}
}
if (options.flipNegate) {
return false;
}
return this.negate;
}
static defaults(def) {
return minimatch.defaults(def).Minimatch;
}
};
minimatch.AST = AST;
minimatch.Minimatch = Minimatch;
minimatch.escape = escape;
minimatch.unescape = unescape;
// packages/isomorphic/stringUtils.ts
var ansiRegex = new RegExp("([\\u001B\\u009B][[\\]()#?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{0,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))", "g");
// packages/isomorphic/rtti.ts
function isRegExp(obj) {
return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
}
// packages/utils/env.ts
function getFromENV(name) {
let value = process.env[name];
value = value === void 0 ? process.env[`npm_config_${name.toLowerCase()}`] : value;
value = value === void 0 ? process.env[`npm_package_config_${name.toLowerCase()}`] : value;
return value;
}
function getAsBooleanFromENV(name, defaultValue) {
const value = getFromENV(name);
if (value === "false" || value === "0")
return false;
if (value)
return true;
return !!defaultValue;
}
// packages/utils/debug.ts
var _debugMode = getFromENV("PWDEBUG") || "";
var _isUnderTest = getAsBooleanFromENV("PWTEST_UNDER_TEST");
// packages/utils/stackTrace.ts
var re = new RegExp(
"^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"
);
var _showInternalStackFrames = getAsBooleanFromENV("PWDEBUGIMPL");
// packages/playwright/src/util.ts
function createFileMatcher(patterns) {
const reList = [];
const filePatterns = [];
for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
if (isRegExp(pattern)) {
reList.push(pattern);
} else {
if (!pattern.startsWith("**/"))
filePatterns.push("**/" + pattern);
else
filePatterns.push(pattern);
}
}
return (filePath) => {
for (const re2 of reList) {
re2.lastIndex = 0;
if (re2.test(filePath))
return true;
}
if (import_path3.default.sep === "\\") {
const unixPath = filePath.split(import_path3.default.sep).join("/");
for (const re2 of reList) {
re2.lastIndex = 0;
if (re2.test(unixPath))
return true;
}
}
for (const pattern of filePatterns) {
if (minimatch(filePath, pattern, { nocase: true, dot: true }))
return true;
}
return false;
};
}
var debugTest = (0, import_debug2.default)("pw:test");
var folderToPackageJsonPath = /* @__PURE__ */ new Map();
function getPackageJsonPath(folderPath) {
const cached = folderToPackageJsonPath.get(folderPath);
if (cached !== void 0)
return cached;
const packageJsonPath = import_path3.default.join(folderPath, "package.json");
if (import_fs3.default.existsSync(packageJsonPath)) {
folderToPackageJsonPath.set(folderPath, packageJsonPath);
return packageJsonPath;
}
const parentFolder = import_path3.default.dirname(folderPath);
if (folderPath === parentFolder) {
folderToPackageJsonPath.set(folderPath, "");
return "";
}
const result2 = getPackageJsonPath(parentFolder);
folderToPackageJsonPath.set(folderPath, result2);
return result2;
}
function fileIsModule(file2) {
if (file2.endsWith(".mjs") || file2.endsWith(".mts"))
return true;
if (file2.endsWith(".cjs") || file2.endsWith(".cts"))
return false;
const folder = import_path3.default.dirname(file2);
return folderIsModule(folder);
}
var packageJsonIsModuleCache = /* @__PURE__ */ new Map();
function folderIsModule(folder) {
const packageJsonPath = getPackageJsonPath(folder);
if (!packageJsonPath)
return false;
if (!packageJsonIsModuleCache.has(packageJsonPath)) {
let isModule2 = false;
try {
isModule2 = JSON.parse(import_fs3.default.readFileSync(packageJsonPath, "utf8")).type === "module";
} catch {
}
packageJsonIsModuleCache.set(packageJsonPath, isModule2);
}
return packageJsonIsModuleCache.get(packageJsonPath);
}
var packageJsonMainFieldCache = /* @__PURE__ */ new Map();
function getMainFieldFromPackageJson(packageJsonPath) {
if (!packageJsonMainFieldCache.has(packageJsonPath)) {
let mainField;
try {
mainField = JSON.parse(import_fs3.default.readFileSync(packageJsonPath, "utf8")).main;
} catch {
}
packageJsonMainFieldCache.set(packageJsonPath, mainField);
}
return packageJsonMainFieldCache.get(packageJsonPath);
}
var kExtLookups = /* @__PURE__ */ new Map([
[".js", [".jsx", ".ts", ".tsx"]],
[".jsx", [".tsx"]],
[".cjs", [".cts"]],
[".mjs", [".mts"]],
["", [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs", ".cts", ".mts"]]
]);
function resolveImportSpecifierExtension(resolved) {
if (fileExists(resolved))
return resolved;
for (const [ext2, others] of kExtLookups) {
if (!resolved.endsWith(ext2))
continue;
for (const other of others) {
const modified = resolved.substring(0, resolved.length - ext2.length) + other;
if (fileExists(modified))
return modified;
}
break;
}
}
function resolveImportSpecifierAfterMapping(resolved, afterPathMapping) {
const resolvedFile = resolveImportSpecifierExtension(resolved);
if (resolvedFile)
return resolvedFile;
if (dirExists(resolved)) {
const packageJsonPath = import_path3.default.join(resolved, "package.json");
if (afterPathMapping) {
const mainField = getMainFieldFromPackageJson(packageJsonPath);
const mainFieldResolved = mainField ? resolveImportSpecifierExtension(import_path3.default.resolve(resolved, mainField)) : void 0;
return mainFieldResolved || resolveImportSpecifierExtension(import_path3.default.join(resolved, "index"));
}
if (fileExists(packageJsonPath))
return resolved;
const dirImport = import_path3.default.join(resolved, "index");
return resolveImportSpecifierExtension(dirImport);
}
}
function fileExists(resolved) {
return import_fs3.default.statSync(resolved, { throwIfNoEntry: false })?.isFile();
}
function dirExists(resolved) {
return import_fs3.default.statSync(resolved, { throwIfNoEntry: false })?.isDirectory();
}
// packages/playwright/src/transform/esmLoaderSync.ts
var import_fs4 = __toESM(require("fs"));
var import_url = __toESM(require("url"));
function resolve(specifier, context, nextResolve) {
if (context.parentURL && context.parentURL.startsWith("file://")) {
const filename = import_url.default.fileURLToPath(context.parentURL);
const resolved = resolveHook(filename, specifier);
if (resolved !== void 0) {
specifier = new Set(context.conditions).has("import") ? import_url.default.pathToFileURL(resolved).toString() : resolved;
}
}
const result2 = nextResolve(specifier, context);
if (result2?.url && result2.url.startsWith("file://"))
currentFileDepsCollector()?.add(import_url.default.fileURLToPath(result2.url));
return result2;
}
var kSupportedFormats = /* @__PURE__ */ new Map([
["commonjs", "commonjs"],
["module", "module"],
["commonjs-typescript", "commonjs"],
["module-typescript", "module"],
["typescript", null],
[null, null],
[void 0, void 0]
]);
function load(moduleUrl, context, nextLoad) {
if (!kSupportedFormats.has(context.format))
return nextLoad(moduleUrl, context);
if (!moduleUrl.startsWith("file://"))
return nextLoad(moduleUrl, context);
const filename = import_url.default.fileURLToPath(moduleUrl);
if (!shouldTransform(filename))
return nextLoad(moduleUrl, context);
const isRequire = !new Set(context.conditions).has("import");
const format = isRequire ? "commonjs" : kSupportedFormats.get(context.format) || (fileIsModule(filename) ? "module" : "commonjs");
const code = import_fs4.default.readFileSync(filename, "utf-8");
const transformed = transformHook(code, filename, format === "module" ? moduleUrl : void 0);
return {
format,
source: transformed.code,
shortCircuit: true
};
}
// packages/playwright/src/transform/pirates.ts
var import_module = __toESM(require("module"));
var import_path4 = __toESM(require("path"));
function addHook(transformHook2, shouldTransform2, extensions) {
const extensionsToOverwrite = extensions.filter((e) => e !== ".cjs");
const allSupportedExtensions = new Set(extensions);
const loaders = import_module.default._extensions;
const jsLoader = loaders[".js"];
for (const extension of extensionsToOverwrite) {
let newLoader2 = function(mod, filename, ...loaderArgs) {
if (allSupportedExtensions.has(import_path4.default.extname(filename)) && shouldTransform2(filename)) {
let newCompile2 = function(code, file2, ...ignoredArgs) {
mod._compile = oldCompile;
return oldCompile.call(this, transformHook2(code, filename), file2);
};
var newCompile = newCompile2;
const oldCompile = mod._compile;
mod._compile = newCompile2;
}
originalLoader.call(this, mod, filename, ...loaderArgs);
};
var newLoader = newLoader2;
const originalLoader = loaders[extension] || jsLoader;
loaders[extension] = newLoader2;
}
}
// packages/playwright/src/transform/transform.ts
var version = import_package2.packageJSON.version;
var cachedTSConfigs = /* @__PURE__ */ new Map();
var _transformConfig = {
babelPlugins: [],
external: []
};
var _externalMatcher = () => false;
async function setTransformConfig(config) {
_transformConfig = config;
_externalMatcher = createFileMatcher(_transformConfig.external);
if (loaderChannel)
await loaderChannel.send("setTransformConfig", { config });
}
var _singleTSConfigPath;
var _singleTSConfig;
async function setSingleTSConfig(value) {
_singleTSConfigPath = value;
if (loaderChannel)
await loaderChannel.send("setSingleTSConfig", { tsconfig: value });
}
function validateTsConfig(tsconfig) {
const pathsBase = tsconfig.absoluteBaseUrl ?? tsconfig.paths?.pathsBasePath;
const pathsFallback = tsconfig.absoluteBaseUrl ? [{ key: "*", values: ["*"] }] : [];
return {
allowJs: !!tsconfig.allowJs,
pathsBase,
paths: Object.entries(tsconfig.paths?.mapping || {}).map(([key, values]) => ({ key, values })).concat(pathsFallback)
};
}
function loadAndValidateTsconfigsForFile(file2) {
if (_singleTSConfigPath && !_singleTSConfig)
_singleTSConfig = loadTsConfig(_singleTSConfigPath).map(validateTsConfig);
if (_singleTSConfig)
return _singleTSConfig;
return loadAndValidateTsconfigsForFolder(import_path5.default.dirname(file2));
}
function loadAndValidateTsconfigsForFolder(folder) {
const foldersWithConfig = [];
let currentFolder = import_path5.default.resolve(folder);
let result2;
while (true) {
const cached = cachedTSConfigs.get(currentFolder);
if (cached) {
result2 = cached;
break;
}
foldersWithConfig.push(currentFolder);
for (const name of ["tsconfig.json", "jsconfig.json"]) {
const configPath = import_path5.default.join(currentFolder, name);
if (import_fs5.default.existsSync(configPath)) {
const loaded = loadTsConfig(configPath);
result2 = loaded.map(validateTsConfig);
break;
}
}
if (result2)
break;
const parentFolder = import_path5.default.resolve(currentFolder, "../");
if (currentFolder === parentFolder)
break;
currentFolder = parentFolder;
}
result2 = result2 || [];
for (const folder2 of foldersWithConfig)
cachedTSConfigs.set(folder2, result2);
return result2;
}
var pathSeparator = process.platform === "win32" ? ";" : ":";
var builtins = new Set(import_module2.default.builtinModules);
function resolveHook(filename, specifier) {
if (specifier.startsWith("node:") || builtins.has(specifier))
return;
if (!shouldTransform(filename))
return;
if (isRelativeSpecifier(specifier))
return resolveImportSpecifierAfterMapping(import_path5.default.resolve(import_path5.default.dirname(filename), specifier), false);
const isTypeScript = filename.endsWith(".ts") || filename.endsWith(".tsx");
const tsconfigs = loadAndValidateTsconfigsForFile(filename);
for (const tsconfig of tsconfigs) {
if (!isTypeScript && !tsconfig.allowJs)
continue;
let longestPrefixLength = -1;
let pathMatchedByLongestPrefix;
for (const { key, values } of tsconfig.paths) {
let matchedPartOfSpecifier = specifier;
const [keyPrefix, keySuffix] = key.split("*");
if (key.includes("*")) {
if (keyPrefix) {
if (!specifier.startsWith(keyPrefix))
continue;
matchedPartOfSpecifier = matchedPartOfSpecifier.substring(keyPrefix.length, matchedPartOfSpecifier.length);
}
if (keySuffix) {
if (!specifier.endsWith(keySuffix))
continue;
matchedPartOfSpecifier = matchedPartOfSpecifier.substring(0, matchedPartOfSpecifier.length - keySuffix.length);
}
} else {
if (specifier !== key)
continue;
matchedPartOfSpecifier = specifier;
}
if (keyPrefix.length <= longestPrefixLength)
continue;
for (const value of values) {
let candidate = value;
if (value.includes("*"))
candidate = candidate.replace("*", matchedPartOfSpecifier);
candidate = import_path5.default.resolve(tsconfig.pathsBase, candidate);
const existing = resolveImportSpecifierAfterMapping(candidate, true);
if (existing) {
longestPrefixLength = keyPrefix.length;
pathMatchedByLongestPrefix = existing;
}
}
}
if (pathMatchedByLongestPrefix)
return pathMatchedByLongestPrefix;
}
if (import_path5.default.isAbsolute(specifier)) {
return resolveImportSpecifierAfterMapping(specifier, false);
}
}
function shouldTransform(filename) {
if (_externalMatcher(filename))
return false;
return !belongsToNodeModules(filename);
}
var transformData;
function setTransformData(pluginName, value) {
transformData.set(pluginName, value);
}
function transformHook(originalCode, filename, moduleUrl) {
const hasPreprocessor = process.env.PW_TEST_SOURCE_TRANSFORM && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE.split(pathSeparator).some((f) => filename.startsWith(f));
const pluginsPrologue = _transformConfig.babelPlugins;
const pluginsEpilogue = hasPreprocessor ? [[process.env.PW_TEST_SOURCE_TRANSFORM]] : [];
const hash = calculateHash(originalCode, filename, !!moduleUrl, pluginsPrologue, pluginsEpilogue);
const { cachedCode, addToCache, serializedCache } = getFromCompilationCache(filename, hash, moduleUrl);
if (cachedCode !== void 0)
return { code: cachedCode, serializedCache };
process.env.BROWSERSLIST_IGNORE_OLD_DATA = "true";
const { babelTransform } = require((0, import_package2.libPath)("transform", "babelBundle"));
transformData = /* @__PURE__ */ new Map();
const setTransformDataForPlugin = (key, value) => transformData.set(key, value);
const wrappedPrologue = pluginsPrologue.map(([name, opts]) => [
name,
{ ...opts || {}, setTransformData: setTransformDataForPlugin }
]);
const babelResult = babelTransform(originalCode, filename, !!moduleUrl, wrappedPrologue, pluginsEpilogue, _transformConfig.jsxImportSource);
if (!babelResult?.code)
return { code: originalCode, serializedCache };
const { code, map } = babelResult;
const added = addToCache(code, map, transformData);
return { code, serializedCache: added.serializedCache };
}
function calculateHash(content, filePath, isModule2, pluginsPrologue, pluginsEpilogue) {
const hash = import_crypto5.default.createHash("sha1").update(isModule2 ? "esm" : "no_esm").update(content).update(filePath).update(version).update(pluginsPrologue.map((p) => p[0]).join(",")).update(pluginsEpilogue.map((p) => p[0]).join(",")).digest("hex");
return hash;
}
async function requireOrImport(file) {
installTransformIfNeeded();
const isModule = fileIsModule(file);
if (isModule) {
const fileName = import_url2.default.pathToFileURL(file);
const esmImport = () => eval(`import(${JSON.stringify(fileName)})`);
if (loaderChannel) {
await eval(`import(${JSON.stringify(fileName + ".esm.preflight")})`).catch((error) => debugTest("Failed to load preflight for " + file + ", source maps may be missing for errors thrown during loading.", error)).finally(nextTask);
}
return await esmImport().finally(nextTask);
}
const result = require(file);
const depsCollector = currentFileDepsCollector();
if (depsCollector) {
const module2 = require.cache[file];
if (module2) {
const cjsDeps = /* @__PURE__ */ new Set();
collectCJSDependencies(module2, cjsDeps);
for (const dep of cjsDeps)
depsCollector.add(dep);
}
}
return result;
}
var transformInstalled = false;
function installTransformIfNeeded() {
if (transformInstalled)
return;
transformInstalled = true;
registerESMLoader();
installSourceMapSupport();
if (loaderChannel) {
installCJSHooks();
return;
}
const extensions = import_module2.default._extensions;
for (const ext2 of [".ts", ".cts", ".tsx", ".jsx"])
extensions[ext2] = extensions[".js"];
}
function installCJSHooks() {
const originalResolveFilename = import_module2.default._resolveFilename;
function resolveFilename(specifier, parent, ...rest) {
if (parent) {
const resolved = resolveHook(parent.filename, specifier);
if (resolved !== void 0)
specifier = resolved;
}
return originalResolveFilename.call(this, specifier, parent, ...rest);
}
import_module2.default._resolveFilename = resolveFilename;
addHook((code, filename) => {
return transformHook(code, filename).code;
}, shouldTransform, [".ts", ".tsx", ".js", ".jsx", ".mjs", ".mts", ".cjs", ".cts"]);
}
var collectCJSDependencies = (module2, dependencies) => {
module2.children.forEach((child) => {
if (!belongsToNodeModules(child.filename) && !dependencies.has(child.filename)) {
dependencies.add(child.filename);
collectCJSDependencies(child, dependencies);
}
});
};
function wrapFunctionWithLocation(func) {
return (...args) => {
const oldPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (error, stackFrames) => {
const frame = import_source_map_support2.default.wrapCallSite(stackFrames[1]);
const fileName2 = frame.getFileName();
const file2 = fileName2 && fileName2.startsWith("file://") ? import_url2.default.fileURLToPath(fileName2) : fileName2;
return {
file: file2,
line: frame.getLineNumber(),
column: frame.getColumnNumber()
};
};
const oldStackTraceLimit = Error.stackTraceLimit;
Error.stackTraceLimit = 2;
const obj = {};
Error.captureStackTrace(obj);
const location = obj.stack;
Error.stackTraceLimit = oldStackTraceLimit;
Error.prepareStackTrace = oldPrepareStackTrace;
return func(location, ...args);
};
}
function isRelativeSpecifier(specifier) {
return specifier === "." || specifier === ".." || specifier.startsWith("./") || specifier.startsWith("../");
}
async function nextTask() {
return new Promise((resolve3) => setTimeout(resolve3, 0));
}
var loaderChannel;
function registerESMLoader() {
if (process.env.PW_DISABLE_TS_ESM)
return;
if ("Bun" in globalThis)
return;
const nodeModule = require("node:module");
if (nodeModule.registerHooks && !process.env.PLAYWRIGHT_FORCE_ASYNC_LOADER) {
nodeModule.registerHooks({ resolve, load });
return;
}
if (!nodeModule.register)
return;
const { port1, port2 } = new MessageChannel();
nodeModule.register(import_url2.default.pathToFileURL(require.resolve("../transform/esmLoader.js")), {
data: { port: port2 },
transferList: [port2]
});
loaderChannel = new PortTransport(port1, async (method, params) => {
if (method === "pushToCompilationCache")
addToCompilationCache(params.cache);
});
void loaderChannel.send("setSingleTSConfig", { tsconfig: _singleTSConfigPath });
void loaderChannel.send("setTransformConfig", { config: _transformConfig });
void loaderChannel.send("addToCompilationCache", { cache: serializeCompilationCache() });
}
async function startCollectingFileDeps2() {
startCollectingFileDeps();
if (loaderChannel)
await loaderChannel.send("startCollectingFileDeps", {});
}
async function stopCollectingFileDeps2(file2) {
stopCollectingFileDeps(file2);
if (loaderChannel)
await loaderChannel.send("stopCollectingFileDeps", { file: file2 });
}
async function incorporateCompilationCache() {
if (!loaderChannel)
return;
const result2 = await loaderChannel.send("getCompilationCache", {});
addToCompilationCache(result2.cache);
}
// packages/playwright/src/transform/esmLoader.ts
var esmPreflightExtension = ".esm.preflight";
async function resolve2(originalSpecifier, context, defaultResolve) {
let specifier = originalSpecifier.replace(esmPreflightExtension, "");
if (context.parentURL && context.parentURL.startsWith("file://")) {
const filename = import_url3.default.fileURLToPath(context.parentURL);
const resolved = resolveHook(filename, specifier);
if (resolved !== void 0)
specifier = import_url3.default.pathToFileURL(resolved).toString();
}
const result2 = await defaultResolve(specifier, context, defaultResolve);
if (result2?.url && result2.url.startsWith("file://"))
currentFileDepsCollector()?.add(import_url3.default.fileURLToPath(result2.url));
if (originalSpecifier.endsWith(esmPreflightExtension))
result2.url = result2.url + esmPreflightExtension;
return result2;
}
var kSupportedFormats2 = /* @__PURE__ */ new Map([
["commonjs", "commonjs"],
["module", "module"],
["commonjs-typescript", "commonjs"],
["module-typescript", "module"],
[null, null],
[void 0, void 0]
]);
async function load2(moduleUrl, context, defaultLoad) {
if (!kSupportedFormats2.has(context.format))
return defaultLoad(moduleUrl, context, defaultLoad);
if (!moduleUrl.startsWith("file://"))
return defaultLoad(moduleUrl, context, defaultLoad);
const filename = import_url3.default.fileURLToPath(moduleUrl);
const isPreflight = moduleUrl.endsWith(esmPreflightExtension);
if (!shouldTransform(filename))
return defaultLoad(moduleUrl, context, defaultLoad);
const originalModuleUrl = isPreflight ? moduleUrl.slice(0, -esmPreflightExtension.length) : moduleUrl;
const originalFilename = isPreflight ? import_url3.default.fileURLToPath(originalModuleUrl) : filename;
const code = import_fs6.default.readFileSync(originalFilename, "utf-8");
const transformed = transformHook(code, originalFilename, originalModuleUrl);
if (transformed.serializedCache)
transport?.post("pushToCompilationCache", { cache: transformed.serializedCache });
return {
format: kSupportedFormats2.get(context.format) || (fileIsModule(originalFilename) ? "module" : "commonjs"),
source: isPreflight ? `void 0;` : transformed.code,
shortCircuit: true
};
}
var transport;
function initialize(data) {
transport = createTransport(data?.port);
}
function createTransport(port) {
return new PortTransport(port, async (method, params) => {
if (method === "setSingleTSConfig") {
await setSingleTSConfig(params.tsconfig);
return;
}
if (method === "setTransformConfig") {
await setTransformConfig(params.config);
return;
}
if (method === "addToCompilationCache") {
addToCompilationCache(params.cache);
return;
}
if (method === "getCompilationCache")
return { cache: serializeCompilationCache() };
if (method === "startCollectingFileDeps") {
startCollectingFileDeps();
return;
}
if (method === "stopCollectingFileDeps") {
stopCollectingFileDeps(params.file);
return;
}
});
}
module.exports = { initialize, load: load2, resolve: resolve2 };