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 __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __export = (all, symbols) => {
	let target = {};
	for (var name$1 in all) __defProp(target, name$1, {
		get: all[name$1],
		enumerable: true
	});
	if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
	return target;
};
var __copyProps = (to, from, except, desc$1) => {
	if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n$1 = keys.length, key; i < n$1; i++) {
		key = keys[i];
		if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
			get: ((k) => from[k]).bind(null, key),
			enumerable: !(desc$1 = __getOwnPropDesc(from, key)) || desc$1.enumerable
		});
	}
	return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
	value: mod,
	enumerable: true
}) : target, mod));
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
let util = require("util");
util = __toESM(util);
let stream = require("stream");
stream = __toESM(stream);
let http = require("http");
http = __toESM(http);
let https = require("https");
https = __toESM(https);
let url = require("url");
url = __toESM(url);
let crypto = require("crypto");
crypto = __toESM(crypto);
let http2 = require("http2");
http2 = __toESM(http2);
let zlib = require("zlib");
zlib = __toESM(zlib);
let events = require("events");
function bind(fn, thisArg) {
	return function wrap$1() {
		return fn.apply(thisArg, arguments);
	};
}
var { toString } = Object.prototype;
var { getPrototypeOf } = Object;
var { iterator, toStringTag: toStringTag$1 } = Symbol;
var kindOf = ((cache) => (thing) => {
	const str = toString.call(thing);
	return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
})(Object.create(null));
var kindOfTest = (type) => {
	type = type.toLowerCase();
	return (thing) => kindOf(thing) === type;
};
var typeOfTest = (type) => (thing) => typeof thing === type;
var { isArray: isArray$1 } = Array;
var isUndefined = typeOfTest("undefined");
function isBuffer$3(val) {
	return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
var isArrayBuffer$1 = kindOfTest("ArrayBuffer");
function isArrayBufferView(val) {
	let result;
	if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) result = ArrayBuffer.isView(val);
	else result = val && val.buffer && isArrayBuffer$1(val.buffer);
	return result;
}
var isString$1 = typeOfTest("string");
var isFunction$2 = typeOfTest("function");
var isNumber = typeOfTest("number");
var isObject = (thing) => thing !== null && typeof thing === "object";
var isBoolean = (thing) => thing === true || thing === false;
var isPlainObject = (val) => {
	if (kindOf(val) !== "object") return false;
	const prototype$1 = getPrototypeOf(val);
	return (prototype$1 === null || prototype$1 === Object.prototype || Object.getPrototypeOf(prototype$1) === null) && !(toStringTag$1 in val) && !(iterator in val);
};
var isEmptyObject = (val) => {
	if (!isObject(val) || isBuffer$3(val)) return false;
	try {
		return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
	} catch (e) {
		return false;
	}
};
var isDate = kindOfTest("Date");
var isFile = kindOfTest("File");
var isReactNativeBlob = (value) => {
	return !!(value && typeof value.uri !== "undefined");
};
var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
var isBlob = kindOfTest("Blob");
var isFileList = kindOfTest("FileList");
var isStream$2 = (val) => isObject(val) && isFunction$2(val.pipe);
function getGlobal() {
	if (typeof globalThis !== "undefined") return globalThis;
	if (typeof self !== "undefined") return self;
	if (typeof window !== "undefined") return window;
	if (typeof global !== "undefined") return global;
	return {};
}
var G = getGlobal();
var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
var isFormData = (thing) => {
	let kind;
	return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$2(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction$2(thing.toString) && thing.toString() === "[object FormData]"));
};
var isURLSearchParams = kindOfTest("URLSearchParams");
var [isReadableStream, isRequest, isResponse, isHeaders] = [
	"ReadableStream",
	"Request",
	"Response",
	"Headers"
].map(kindOfTest);
var trim = (str) => {
	return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
};
function forEach(obj, fn, { allOwnKeys = false } = {}) {
	if (obj === null || typeof obj === "undefined") return;
	let i;
	let l;
	if (typeof obj !== "object") obj = [obj];
	if (isArray$1(obj)) for (i = 0, l = obj.length; i < l; i++) fn.call(null, obj[i], i, obj);
	else {
		if (isBuffer$3(obj)) return;
		const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
		const len = keys.length;
		let key;
		for (i = 0; i < len; i++) {
			key = keys[i];
			fn.call(null, obj[key], key, obj);
		}
	}
}
function findKey(obj, key) {
	if (isBuffer$3(obj)) return null;
	key = key.toLowerCase();
	const keys = Object.keys(obj);
	let i = keys.length;
	let _key;
	while (i-- > 0) {
		_key = keys[i];
		if (key === _key.toLowerCase()) return _key;
	}
	return null;
}
var _global = (() => {
	if (typeof globalThis !== "undefined") return globalThis;
	return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
})();
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
function merge() {
	const { caseless, skipUndefined } = isContextDefined(this) && this || {};
	const result = {};
	const assignValue = (val, key) => {
		if (key === "__proto__" || key === "constructor" || key === "prototype") return;
		const targetKey = caseless && findKey(result, key) || key;
		if (isPlainObject(result[targetKey]) && isPlainObject(val)) result[targetKey] = merge(result[targetKey], val);
		else if (isPlainObject(val)) result[targetKey] = merge({}, val);
		else if (isArray$1(val)) result[targetKey] = val.slice();
		else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val;
	};
	for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach(arguments[i], assignValue);
	return result;
}
var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
	forEach(b, (val, key) => {
		if (thisArg && isFunction$2(val)) Object.defineProperty(a, key, {
			value: bind(val, thisArg),
			writable: true,
			enumerable: true,
			configurable: true
		});
		else Object.defineProperty(a, key, {
			value: val,
			writable: true,
			enumerable: true,
			configurable: true
		});
	}, { allOwnKeys });
	return a;
};
var stripBOM = (content) => {
	if (content.charCodeAt(0) === 65279) content = content.slice(1);
	return content;
};
var inherits = (constructor, superConstructor, props, descriptors) => {
	constructor.prototype = Object.create(superConstructor.prototype, descriptors);
	Object.defineProperty(constructor.prototype, "constructor", {
		value: constructor,
		writable: true,
		enumerable: false,
		configurable: true
	});
	Object.defineProperty(constructor, "super", { value: superConstructor.prototype });
	props && Object.assign(constructor.prototype, props);
};
var toFlatObject = (sourceObj, destObj, filter, propFilter) => {
	let props;
	let i;
	let prop;
	const merged = {};
	destObj = destObj || {};
	if (sourceObj == null) return destObj;
	do {
		props = Object.getOwnPropertyNames(sourceObj);
		i = props.length;
		while (i-- > 0) {
			prop = props[i];
			if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
				destObj[prop] = sourceObj[prop];
				merged[prop] = true;
			}
		}
		sourceObj = filter !== false && getPrototypeOf(sourceObj);
	} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
	return destObj;
};
var endsWith = (str, searchString, position) => {
	str = String(str);
	if (position === void 0 || position > str.length) position = str.length;
	position -= searchString.length;
	const lastIndex = str.indexOf(searchString, position);
	return lastIndex !== -1 && lastIndex === position;
};
var toArray = (thing) => {
	if (!thing) return null;
	if (isArray$1(thing)) return thing;
	let i = thing.length;
	if (!isNumber(i)) return null;
	const arr = new Array(i);
	while (i-- > 0) arr[i] = thing[i];
	return arr;
};
var isTypedArray = ((TypedArray$1) => {
	return (thing) => {
		return TypedArray$1 && thing instanceof TypedArray$1;
	};
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
var forEachEntry = (obj, fn) => {
	const _iterator = (obj && obj[iterator]).call(obj);
	let result;
	while ((result = _iterator.next()) && !result.done) {
		const pair = result.value;
		fn.call(obj, pair[0], pair[1]);
	}
};
var matchAll = (regExp, str) => {
	let matches;
	const arr = [];
	while ((matches = regExp.exec(str)) !== null) arr.push(matches);
	return arr;
};
var isHTMLForm = kindOfTest("HTMLFormElement");
var toCamelCase = (str) => {
	return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m$1, p1, p2) {
		return p1.toUpperCase() + p2;
	});
};
var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty$1 }) => (obj, prop) => hasOwnProperty$1.call(obj, prop))(Object.prototype);
var isRegExp = kindOfTest("RegExp");
var reduceDescriptors = (obj, reducer) => {
	const descriptors = Object.getOwnPropertyDescriptors(obj);
	const reducedDescriptors = {};
	forEach(descriptors, (descriptor, name$1) => {
		let ret;
		if ((ret = reducer(descriptor, name$1, obj)) !== false) reducedDescriptors[name$1] = ret || descriptor;
	});
	Object.defineProperties(obj, reducedDescriptors);
};
var freezeMethods = (obj) => {
	reduceDescriptors(obj, (descriptor, name$1) => {
		if (isFunction$2(obj) && [
			"arguments",
			"caller",
			"callee"
		].indexOf(name$1) !== -1) return false;
		const value = obj[name$1];
		if (!isFunction$2(value)) return;
		descriptor.enumerable = false;
		if ("writable" in descriptor) {
			descriptor.writable = false;
			return;
		}
		if (!descriptor.set) descriptor.set = () => {
			throw Error("Can not rewrite read-only method '" + name$1 + "'");
		};
	});
};
var toObjectSet = (arrayOrString, delimiter) => {
	const obj = {};
	const define$1 = (arr) => {
		arr.forEach((value) => {
			obj[value] = true;
		});
	};
	isArray$1(arrayOrString) ? define$1(arrayOrString) : define$1(String(arrayOrString).split(delimiter));
	return obj;
};
var noop$7 = () => {};
var toFiniteNumber = (value, defaultValue) => {
	return value != null && Number.isFinite(value = +value) ? value : defaultValue;
};
function isSpecCompliantForm(thing) {
	return !!(thing && isFunction$2(thing.append) && thing[toStringTag$1] === "FormData" && thing[iterator]);
}
var toJSONObject = (obj) => {
	const stack = new Array(10);
	const visit$1 = (source, i) => {
		if (isObject(source)) {
			if (stack.indexOf(source) >= 0) return;
			if (isBuffer$3(source)) return source;
			if (!("toJSON" in source)) {
				stack[i] = source;
				const target = isArray$1(source) ? [] : {};
				forEach(source, (value, key) => {
					const reducedValue = visit$1(value, i + 1);
					!isUndefined(reducedValue) && (target[key] = reducedValue);
				});
				stack[i] = void 0;
				return target;
			}
		}
		return source;
	};
	return visit$1(obj, 0);
};
var isAsyncFn = kindOfTest("AsyncFunction");
var isThenable = (thing) => thing && (isObject(thing) || isFunction$2(thing)) && isFunction$2(thing.then) && isFunction$2(thing.catch);
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
	if (setImmediateSupported) return setImmediate;
	return postMessageSupported ? ((token, callbacks) => {
		_global.addEventListener("message", ({ source, data: data$1 }) => {
			if (source === _global && data$1 === token) callbacks.length && callbacks.shift()();
		}, false);
		return (cb) => {
			callbacks.push(cb);
			_global.postMessage(token, "*");
		};
	})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
})(typeof setImmediate === "function", isFunction$2(_global.postMessage));
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
var isIterable$2 = (thing) => thing != null && isFunction$2(thing[iterator]);
var utils_default = {
	isArray: isArray$1,
	isArrayBuffer: isArrayBuffer$1,
	isBuffer: isBuffer$3,
	isFormData,
	isArrayBufferView,
	isString: isString$1,
	isNumber,
	isBoolean,
	isObject,
	isPlainObject,
	isEmptyObject,
	isReadableStream,
	isRequest,
	isResponse,
	isHeaders,
	isUndefined,
	isDate,
	isFile,
	isReactNativeBlob,
	isReactNative,
	isBlob,
	isRegExp,
	isFunction: isFunction$2,
	isStream: isStream$2,
	isURLSearchParams,
	isTypedArray,
	isFileList,
	forEach,
	merge,
	extend,
	trim,
	stripBOM,
	inherits,
	toFlatObject,
	kindOf,
	kindOfTest,
	endsWith,
	toArray,
	forEachEntry,
	matchAll,
	isHTMLForm,
	hasOwnProperty,
	hasOwnProp: hasOwnProperty,
	reduceDescriptors,
	freezeMethods,
	toObjectSet,
	toCamelCase,
	noop: noop$7,
	toFiniteNumber,
	findKey,
	global: _global,
	isContextDefined,
	isSpecCompliantForm,
	toJSONObject,
	isAsyncFn,
	isThenable,
	setImmediate: _setImmediate,
	asap,
	isIterable: isIterable$2
};
var AxiosError = class AxiosError extends Error {
	static from(error, code, config, request$1, response, customProps) {
		const axiosError = new AxiosError(error.message, code || error.code, config, request$1, response);
		axiosError.cause = error;
		axiosError.name = error.name;
		if (error.status != null && axiosError.status == null) axiosError.status = error.status;
		customProps && Object.assign(axiosError, customProps);
		return axiosError;
	}
	constructor(message, code, config, request$1, response) {
		super(message);
		Object.defineProperty(this, "message", {
			value: message,
			enumerable: true,
			writable: true,
			configurable: true
		});
		this.name = "AxiosError";
		this.isAxiosError = true;
		code && (this.code = code);
		config && (this.config = config);
		request$1 && (this.request = request$1);
		if (response) {
			this.response = response;
			this.status = response.status;
		}
	}
	toJSON() {
		return {
			message: this.message,
			name: this.name,
			description: this.description,
			number: this.number,
			fileName: this.fileName,
			lineNumber: this.lineNumber,
			columnNumber: this.columnNumber,
			stack: this.stack,
			config: utils_default.toJSONObject(this.config),
			code: this.code,
			status: this.status
		};
	}
};
AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
AxiosError.ECONNABORTED = "ECONNABORTED";
AxiosError.ETIMEDOUT = "ETIMEDOUT";
AxiosError.ERR_NETWORK = "ERR_NETWORK";
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
AxiosError.ERR_CANCELED = "ERR_CANCELED";
AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
var AxiosError_default = AxiosError;
var require_delayed_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var Stream$2 = require("stream").Stream;
	var util$31 = require("util");
	module.exports = DelayedStream$1;
	function DelayedStream$1() {
		this.source = null;
		this.dataSize = 0;
		this.maxDataSize = 1024 * 1024;
		this.pauseStream = true;
		this._maxDataSizeExceeded = false;
		this._released = false;
		this._bufferedEvents = [];
	}
	util$31.inherits(DelayedStream$1, Stream$2);
	DelayedStream$1.create = function(source, options) {
		var delayedStream = new this();
		options = options || {};
		for (var option in options) delayedStream[option] = options[option];
		delayedStream.source = source;
		var realEmit = source.emit;
		source.emit = function() {
			delayedStream._handleEmit(arguments);
			return realEmit.apply(source, arguments);
		};
		source.on("error", function() {});
		if (delayedStream.pauseStream) source.pause();
		return delayedStream;
	};
	Object.defineProperty(DelayedStream$1.prototype, "readable", {
		configurable: true,
		enumerable: true,
		get: function() {
			return this.source.readable;
		}
	});
	DelayedStream$1.prototype.setEncoding = function() {
		return this.source.setEncoding.apply(this.source, arguments);
	};
	DelayedStream$1.prototype.resume = function() {
		if (!this._released) this.release();
		this.source.resume();
	};
	DelayedStream$1.prototype.pause = function() {
		this.source.pause();
	};
	DelayedStream$1.prototype.release = function() {
		this._released = true;
		this._bufferedEvents.forEach(function(args) {
			this.emit.apply(this, args);
		}.bind(this));
		this._bufferedEvents = [];
	};
	DelayedStream$1.prototype.pipe = function() {
		var r = Stream$2.prototype.pipe.apply(this, arguments);
		this.resume();
		return r;
	};
	DelayedStream$1.prototype._handleEmit = function(args) {
		if (this._released) {
			this.emit.apply(this, args);
			return;
		}
		if (args[0] === "data") {
			this.dataSize += args[1].length;
			this._checkIfMaxDataSizeExceeded();
		}
		this._bufferedEvents.push(args);
	};
	DelayedStream$1.prototype._checkIfMaxDataSizeExceeded = function() {
		if (this._maxDataSizeExceeded) return;
		if (this.dataSize <= this.maxDataSize) return;
		this._maxDataSizeExceeded = true;
		var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
		this.emit("error", new Error(message));
	};
}));
var require_combined_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var util$30 = require("util");
	var Stream$1 = require("stream").Stream;
	var DelayedStream = require_delayed_stream();
	module.exports = CombinedStream$1;
	function CombinedStream$1() {
		this.writable = false;
		this.readable = true;
		this.dataSize = 0;
		this.maxDataSize = 2 * 1024 * 1024;
		this.pauseStreams = true;
		this._released = false;
		this._streams = [];
		this._currentStream = null;
		this._insideLoop = false;
		this._pendingNext = false;
	}
	util$30.inherits(CombinedStream$1, Stream$1);
	CombinedStream$1.create = function(options) {
		var combinedStream = new this();
		options = options || {};
		for (var option in options) combinedStream[option] = options[option];
		return combinedStream;
	};
	CombinedStream$1.isStreamLike = function(stream$7) {
		return typeof stream$7 !== "function" && typeof stream$7 !== "string" && typeof stream$7 !== "boolean" && typeof stream$7 !== "number" && !Buffer.isBuffer(stream$7);
	};
	CombinedStream$1.prototype.append = function(stream$7) {
		if (CombinedStream$1.isStreamLike(stream$7)) {
			if (!(stream$7 instanceof DelayedStream)) {
				var newStream = DelayedStream.create(stream$7, {
					maxDataSize: Infinity,
					pauseStream: this.pauseStreams
				});
				stream$7.on("data", this._checkDataSize.bind(this));
				stream$7 = newStream;
			}
			this._handleErrors(stream$7);
			if (this.pauseStreams) stream$7.pause();
		}
		this._streams.push(stream$7);
		return this;
	};
	CombinedStream$1.prototype.pipe = function(dest, options) {
		Stream$1.prototype.pipe.call(this, dest, options);
		this.resume();
		return dest;
	};
	CombinedStream$1.prototype._getNext = function() {
		this._currentStream = null;
		if (this._insideLoop) {
			this._pendingNext = true;
			return;
		}
		this._insideLoop = true;
		try {
			do {
				this._pendingNext = false;
				this._realGetNext();
			} while (this._pendingNext);
		} finally {
			this._insideLoop = false;
		}
	};
	CombinedStream$1.prototype._realGetNext = function() {
		var stream$7 = this._streams.shift();
		if (typeof stream$7 == "undefined") {
			this.end();
			return;
		}
		if (typeof stream$7 !== "function") {
			this._pipeNext(stream$7);
			return;
		}
		stream$7(function(stream$8) {
			if (CombinedStream$1.isStreamLike(stream$8)) {
				stream$8.on("data", this._checkDataSize.bind(this));
				this._handleErrors(stream$8);
			}
			this._pipeNext(stream$8);
		}.bind(this));
	};
	CombinedStream$1.prototype._pipeNext = function(stream$7) {
		this._currentStream = stream$7;
		if (CombinedStream$1.isStreamLike(stream$7)) {
			stream$7.on("end", this._getNext.bind(this));
			stream$7.pipe(this, { end: false });
			return;
		}
		var value = stream$7;
		this.write(value);
		this._getNext();
	};
	CombinedStream$1.prototype._handleErrors = function(stream$7) {
		var self$1 = this;
		stream$7.on("error", function(err) {
			self$1._emitError(err);
		});
	};
	CombinedStream$1.prototype.write = function(data$1) {
		this.emit("data", data$1);
	};
	CombinedStream$1.prototype.pause = function() {
		if (!this.pauseStreams) return;
		if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause();
		this.emit("pause");
	};
	CombinedStream$1.prototype.resume = function() {
		if (!this._released) {
			this._released = true;
			this.writable = true;
			this._getNext();
		}
		if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume();
		this.emit("resume");
	};
	CombinedStream$1.prototype.end = function() {
		this._reset();
		this.emit("end");
	};
	CombinedStream$1.prototype.destroy = function() {
		this._reset();
		this.emit("close");
	};
	CombinedStream$1.prototype._reset = function() {
		this.writable = false;
		this._streams = [];
		this._currentStream = null;
	};
	CombinedStream$1.prototype._checkDataSize = function() {
		this._updateDataSize();
		if (this.dataSize <= this.maxDataSize) return;
		var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
		this._emitError(new Error(message));
	};
	CombinedStream$1.prototype._updateDataSize = function() {
		this.dataSize = 0;
		var self$1 = this;
		this._streams.forEach(function(stream$7) {
			if (!stream$7.dataSize) return;
			self$1.dataSize += stream$7.dataSize;
		});
		if (this._currentStream && this._currentStream.dataSize) this.dataSize += this._currentStream.dataSize;
	};
	CombinedStream$1.prototype._emitError = function(err) {
		this._reset();
		this.emit("error", err);
	};
}));
var db_exports = /* @__PURE__ */ __export({ default: () => db_default }, 1);
var db_default;
var init_db = __esmMin((() => {
	db_default = {
		"application/1d-interleaved-parityfec": { "source": "iana" },
		"application/3gpdash-qoe-report+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/3gpp-ims+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/3gpphal+json": {
			"source": "iana",
			"compressible": true
		},
		"application/3gpphalforms+json": {
			"source": "iana",
			"compressible": true
		},
		"application/a2l": { "source": "iana" },
		"application/ace+cbor": { "source": "iana" },
		"application/activemessage": { "source": "iana" },
		"application/activity+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-costmap+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-costmapfilter+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-directory+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-endpointcost+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-endpointcostparams+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-endpointprop+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-endpointpropparams+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-error+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-networkmap+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-networkmapfilter+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-updatestreamcontrol+json": {
			"source": "iana",
			"compressible": true
		},
		"application/alto-updatestreamparams+json": {
			"source": "iana",
			"compressible": true
		},
		"application/aml": { "source": "iana" },
		"application/andrew-inset": {
			"source": "iana",
			"extensions": ["ez"]
		},
		"application/applefile": { "source": "iana" },
		"application/applixware": {
			"source": "apache",
			"extensions": ["aw"]
		},
		"application/at+jwt": { "source": "iana" },
		"application/atf": { "source": "iana" },
		"application/atfx": { "source": "iana" },
		"application/atom+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["atom"]
		},
		"application/atomcat+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["atomcat"]
		},
		"application/atomdeleted+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["atomdeleted"]
		},
		"application/atomicmail": { "source": "iana" },
		"application/atomsvc+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["atomsvc"]
		},
		"application/atsc-dwd+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["dwd"]
		},
		"application/atsc-dynamic-event-message": { "source": "iana" },
		"application/atsc-held+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["held"]
		},
		"application/atsc-rdt+json": {
			"source": "iana",
			"compressible": true
		},
		"application/atsc-rsat+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rsat"]
		},
		"application/atxml": { "source": "iana" },
		"application/auth-policy+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/bacnet-xdd+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/batch-smtp": { "source": "iana" },
		"application/bdoc": {
			"compressible": false,
			"extensions": ["bdoc"]
		},
		"application/beep+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/calendar+json": {
			"source": "iana",
			"compressible": true
		},
		"application/calendar+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xcs"]
		},
		"application/call-completion": { "source": "iana" },
		"application/cals-1840": { "source": "iana" },
		"application/captive+json": {
			"source": "iana",
			"compressible": true
		},
		"application/cbor": { "source": "iana" },
		"application/cbor-seq": { "source": "iana" },
		"application/cccex": { "source": "iana" },
		"application/ccmp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/ccxml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ccxml"]
		},
		"application/cdfx+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["cdfx"]
		},
		"application/cdmi-capability": {
			"source": "iana",
			"extensions": ["cdmia"]
		},
		"application/cdmi-container": {
			"source": "iana",
			"extensions": ["cdmic"]
		},
		"application/cdmi-domain": {
			"source": "iana",
			"extensions": ["cdmid"]
		},
		"application/cdmi-object": {
			"source": "iana",
			"extensions": ["cdmio"]
		},
		"application/cdmi-queue": {
			"source": "iana",
			"extensions": ["cdmiq"]
		},
		"application/cdni": { "source": "iana" },
		"application/cea": { "source": "iana" },
		"application/cea-2018+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/cellml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/cfw": { "source": "iana" },
		"application/city+json": {
			"source": "iana",
			"compressible": true
		},
		"application/clr": { "source": "iana" },
		"application/clue+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/clue_info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/cms": { "source": "iana" },
		"application/cnrp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/coap-group+json": {
			"source": "iana",
			"compressible": true
		},
		"application/coap-payload": { "source": "iana" },
		"application/commonground": { "source": "iana" },
		"application/conference-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/cose": { "source": "iana" },
		"application/cose-key": { "source": "iana" },
		"application/cose-key-set": { "source": "iana" },
		"application/cpl+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["cpl"]
		},
		"application/csrattrs": { "source": "iana" },
		"application/csta+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/cstadata+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/csvm+json": {
			"source": "iana",
			"compressible": true
		},
		"application/cu-seeme": {
			"source": "apache",
			"extensions": ["cu"]
		},
		"application/cwt": { "source": "iana" },
		"application/cybercash": { "source": "iana" },
		"application/dart": { "compressible": true },
		"application/dash+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mpd"]
		},
		"application/dash-patch+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mpp"]
		},
		"application/dashdelta": { "source": "iana" },
		"application/davmount+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["davmount"]
		},
		"application/dca-rft": { "source": "iana" },
		"application/dcd": { "source": "iana" },
		"application/dec-dx": { "source": "iana" },
		"application/dialog-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/dicom": { "source": "iana" },
		"application/dicom+json": {
			"source": "iana",
			"compressible": true
		},
		"application/dicom+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/dii": { "source": "iana" },
		"application/dit": { "source": "iana" },
		"application/dns": { "source": "iana" },
		"application/dns+json": {
			"source": "iana",
			"compressible": true
		},
		"application/dns-message": { "source": "iana" },
		"application/docbook+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["dbk"]
		},
		"application/dots+cbor": { "source": "iana" },
		"application/dskpp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/dssc+der": {
			"source": "iana",
			"extensions": ["dssc"]
		},
		"application/dssc+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xdssc"]
		},
		"application/dvcs": { "source": "iana" },
		"application/ecmascript": {
			"source": "iana",
			"compressible": true,
			"extensions": ["es", "ecma"]
		},
		"application/edi-consent": { "source": "iana" },
		"application/edi-x12": {
			"source": "iana",
			"compressible": false
		},
		"application/edifact": {
			"source": "iana",
			"compressible": false
		},
		"application/efi": { "source": "iana" },
		"application/elm+json": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/elm+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.cap+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/emergencycalldata.comment+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.control+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.deviceinfo+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.ecall.msd": { "source": "iana" },
		"application/emergencycalldata.providerinfo+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.serviceinfo+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.subscriberinfo+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emergencycalldata.veds+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/emma+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["emma"]
		},
		"application/emotionml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["emotionml"]
		},
		"application/encaprtp": { "source": "iana" },
		"application/epp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/epub+zip": {
			"source": "iana",
			"compressible": false,
			"extensions": ["epub"]
		},
		"application/eshop": { "source": "iana" },
		"application/exi": {
			"source": "iana",
			"extensions": ["exi"]
		},
		"application/expect-ct-report+json": {
			"source": "iana",
			"compressible": true
		},
		"application/express": {
			"source": "iana",
			"extensions": ["exp"]
		},
		"application/fastinfoset": { "source": "iana" },
		"application/fastsoap": { "source": "iana" },
		"application/fdt+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["fdt"]
		},
		"application/fhir+json": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/fhir+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/fido.trusted-apps+json": { "compressible": true },
		"application/fits": { "source": "iana" },
		"application/flexfec": { "source": "iana" },
		"application/font-sfnt": { "source": "iana" },
		"application/font-tdpfr": {
			"source": "iana",
			"extensions": ["pfr"]
		},
		"application/font-woff": {
			"source": "iana",
			"compressible": false
		},
		"application/framework-attributes+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/geo+json": {
			"source": "iana",
			"compressible": true,
			"extensions": ["geojson"]
		},
		"application/geo+json-seq": { "source": "iana" },
		"application/geopackage+sqlite3": { "source": "iana" },
		"application/geoxacml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/gltf-buffer": { "source": "iana" },
		"application/gml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["gml"]
		},
		"application/gpx+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["gpx"]
		},
		"application/gxf": {
			"source": "apache",
			"extensions": ["gxf"]
		},
		"application/gzip": {
			"source": "iana",
			"compressible": false,
			"extensions": ["gz"]
		},
		"application/h224": { "source": "iana" },
		"application/held+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/hjson": { "extensions": ["hjson"] },
		"application/http": { "source": "iana" },
		"application/hyperstudio": {
			"source": "iana",
			"extensions": ["stk"]
		},
		"application/ibe-key-request+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/ibe-pkg-reply+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/ibe-pp-data": { "source": "iana" },
		"application/iges": { "source": "iana" },
		"application/im-iscomposing+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/index": { "source": "iana" },
		"application/index.cmd": { "source": "iana" },
		"application/index.obj": { "source": "iana" },
		"application/index.response": { "source": "iana" },
		"application/index.vnd": { "source": "iana" },
		"application/inkml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ink", "inkml"]
		},
		"application/iotp": { "source": "iana" },
		"application/ipfix": {
			"source": "iana",
			"extensions": ["ipfix"]
		},
		"application/ipp": { "source": "iana" },
		"application/isup": { "source": "iana" },
		"application/its+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["its"]
		},
		"application/java-archive": {
			"source": "apache",
			"compressible": false,
			"extensions": [
				"jar",
				"war",
				"ear"
			]
		},
		"application/java-serialized-object": {
			"source": "apache",
			"compressible": false,
			"extensions": ["ser"]
		},
		"application/java-vm": {
			"source": "apache",
			"compressible": false,
			"extensions": ["class"]
		},
		"application/javascript": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["js", "mjs"]
		},
		"application/jf2feed+json": {
			"source": "iana",
			"compressible": true
		},
		"application/jose": { "source": "iana" },
		"application/jose+json": {
			"source": "iana",
			"compressible": true
		},
		"application/jrd+json": {
			"source": "iana",
			"compressible": true
		},
		"application/jscalendar+json": {
			"source": "iana",
			"compressible": true
		},
		"application/json": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["json", "map"]
		},
		"application/json-patch+json": {
			"source": "iana",
			"compressible": true
		},
		"application/json-seq": { "source": "iana" },
		"application/json5": { "extensions": ["json5"] },
		"application/jsonml+json": {
			"source": "apache",
			"compressible": true,
			"extensions": ["jsonml"]
		},
		"application/jwk+json": {
			"source": "iana",
			"compressible": true
		},
		"application/jwk-set+json": {
			"source": "iana",
			"compressible": true
		},
		"application/jwt": { "source": "iana" },
		"application/kpml-request+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/kpml-response+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/ld+json": {
			"source": "iana",
			"compressible": true,
			"extensions": ["jsonld"]
		},
		"application/lgr+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["lgr"]
		},
		"application/link-format": { "source": "iana" },
		"application/load-control+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/lost+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["lostxml"]
		},
		"application/lostsync+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/lpf+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/lxf": { "source": "iana" },
		"application/mac-binhex40": {
			"source": "iana",
			"extensions": ["hqx"]
		},
		"application/mac-compactpro": {
			"source": "apache",
			"extensions": ["cpt"]
		},
		"application/macwriteii": { "source": "iana" },
		"application/mads+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mads"]
		},
		"application/manifest+json": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["webmanifest"]
		},
		"application/marc": {
			"source": "iana",
			"extensions": ["mrc"]
		},
		"application/marcxml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mrcx"]
		},
		"application/mathematica": {
			"source": "iana",
			"extensions": [
				"ma",
				"nb",
				"mb"
			]
		},
		"application/mathml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mathml"]
		},
		"application/mathml-content+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mathml-presentation+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-associated-procedure-description+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-deregister+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-envelope+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-msk+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-msk-response+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-protection-description+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-reception-report+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-register+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-register-response+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-schedule+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbms-user-service-description+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mbox": {
			"source": "iana",
			"extensions": ["mbox"]
		},
		"application/media-policy-dataset+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mpf"]
		},
		"application/media_control+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mediaservercontrol+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mscml"]
		},
		"application/merge-patch+json": {
			"source": "iana",
			"compressible": true
		},
		"application/metalink+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["metalink"]
		},
		"application/metalink4+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["meta4"]
		},
		"application/mets+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mets"]
		},
		"application/mf4": { "source": "iana" },
		"application/mikey": { "source": "iana" },
		"application/mipc": { "source": "iana" },
		"application/missing-blocks+cbor-seq": { "source": "iana" },
		"application/mmt-aei+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["maei"]
		},
		"application/mmt-usd+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["musd"]
		},
		"application/mods+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mods"]
		},
		"application/moss-keys": { "source": "iana" },
		"application/moss-signature": { "source": "iana" },
		"application/mosskey-data": { "source": "iana" },
		"application/mosskey-request": { "source": "iana" },
		"application/mp21": {
			"source": "iana",
			"extensions": ["m21", "mp21"]
		},
		"application/mp4": {
			"source": "iana",
			"extensions": ["mp4s", "m4p"]
		},
		"application/mpeg4-generic": { "source": "iana" },
		"application/mpeg4-iod": { "source": "iana" },
		"application/mpeg4-iod-xmt": { "source": "iana" },
		"application/mrb-consumer+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/mrb-publish+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/msc-ivr+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/msc-mixer+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/msword": {
			"source": "iana",
			"compressible": false,
			"extensions": ["doc", "dot"]
		},
		"application/mud+json": {
			"source": "iana",
			"compressible": true
		},
		"application/multipart-core": { "source": "iana" },
		"application/mxf": {
			"source": "iana",
			"extensions": ["mxf"]
		},
		"application/n-quads": {
			"source": "iana",
			"extensions": ["nq"]
		},
		"application/n-triples": {
			"source": "iana",
			"extensions": ["nt"]
		},
		"application/nasdata": { "source": "iana" },
		"application/news-checkgroups": {
			"source": "iana",
			"charset": "US-ASCII"
		},
		"application/news-groupinfo": {
			"source": "iana",
			"charset": "US-ASCII"
		},
		"application/news-transmission": { "source": "iana" },
		"application/nlsml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/node": {
			"source": "iana",
			"extensions": ["cjs"]
		},
		"application/nss": { "source": "iana" },
		"application/oauth-authz-req+jwt": { "source": "iana" },
		"application/oblivious-dns-message": { "source": "iana" },
		"application/ocsp-request": { "source": "iana" },
		"application/ocsp-response": { "source": "iana" },
		"application/octet-stream": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"bin",
				"dms",
				"lrf",
				"mar",
				"so",
				"dist",
				"distz",
				"pkg",
				"bpk",
				"dump",
				"elc",
				"deploy",
				"exe",
				"dll",
				"deb",
				"dmg",
				"iso",
				"img",
				"msi",
				"msp",
				"msm",
				"buffer"
			]
		},
		"application/oda": {
			"source": "iana",
			"extensions": ["oda"]
		},
		"application/odm+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/odx": { "source": "iana" },
		"application/oebps-package+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["opf"]
		},
		"application/ogg": {
			"source": "iana",
			"compressible": false,
			"extensions": ["ogx"]
		},
		"application/omdoc+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["omdoc"]
		},
		"application/onenote": {
			"source": "apache",
			"extensions": [
				"onetoc",
				"onetoc2",
				"onetmp",
				"onepkg"
			]
		},
		"application/opc-nodeset+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/oscore": { "source": "iana" },
		"application/oxps": {
			"source": "iana",
			"extensions": ["oxps"]
		},
		"application/p21": { "source": "iana" },
		"application/p21+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/p2p-overlay+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["relo"]
		},
		"application/parityfec": { "source": "iana" },
		"application/passport": { "source": "iana" },
		"application/patch-ops-error+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xer"]
		},
		"application/pdf": {
			"source": "iana",
			"compressible": false,
			"extensions": ["pdf"]
		},
		"application/pdx": { "source": "iana" },
		"application/pem-certificate-chain": { "source": "iana" },
		"application/pgp-encrypted": {
			"source": "iana",
			"compressible": false,
			"extensions": ["pgp"]
		},
		"application/pgp-keys": {
			"source": "iana",
			"extensions": ["asc"]
		},
		"application/pgp-signature": {
			"source": "iana",
			"extensions": ["asc", "sig"]
		},
		"application/pics-rules": {
			"source": "apache",
			"extensions": ["prf"]
		},
		"application/pidf+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/pidf-diff+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/pkcs10": {
			"source": "iana",
			"extensions": ["p10"]
		},
		"application/pkcs12": { "source": "iana" },
		"application/pkcs7-mime": {
			"source": "iana",
			"extensions": ["p7m", "p7c"]
		},
		"application/pkcs7-signature": {
			"source": "iana",
			"extensions": ["p7s"]
		},
		"application/pkcs8": {
			"source": "iana",
			"extensions": ["p8"]
		},
		"application/pkcs8-encrypted": { "source": "iana" },
		"application/pkix-attr-cert": {
			"source": "iana",
			"extensions": ["ac"]
		},
		"application/pkix-cert": {
			"source": "iana",
			"extensions": ["cer"]
		},
		"application/pkix-crl": {
			"source": "iana",
			"extensions": ["crl"]
		},
		"application/pkix-pkipath": {
			"source": "iana",
			"extensions": ["pkipath"]
		},
		"application/pkixcmp": {
			"source": "iana",
			"extensions": ["pki"]
		},
		"application/pls+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["pls"]
		},
		"application/poc-settings+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/postscript": {
			"source": "iana",
			"compressible": true,
			"extensions": [
				"ai",
				"eps",
				"ps"
			]
		},
		"application/ppsp-tracker+json": {
			"source": "iana",
			"compressible": true
		},
		"application/problem+json": {
			"source": "iana",
			"compressible": true
		},
		"application/problem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/provenance+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["provx"]
		},
		"application/prs.alvestrand.titrax-sheet": { "source": "iana" },
		"application/prs.cww": {
			"source": "iana",
			"extensions": ["cww"]
		},
		"application/prs.cyn": {
			"source": "iana",
			"charset": "7-BIT"
		},
		"application/prs.hpub+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/prs.nprend": { "source": "iana" },
		"application/prs.plucker": { "source": "iana" },
		"application/prs.rdf-xml-crypt": { "source": "iana" },
		"application/prs.xsf+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/pskc+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["pskcxml"]
		},
		"application/pvd+json": {
			"source": "iana",
			"compressible": true
		},
		"application/qsig": { "source": "iana" },
		"application/raml+yaml": {
			"compressible": true,
			"extensions": ["raml"]
		},
		"application/raptorfec": { "source": "iana" },
		"application/rdap+json": {
			"source": "iana",
			"compressible": true
		},
		"application/rdf+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rdf", "owl"]
		},
		"application/reginfo+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rif"]
		},
		"application/relax-ng-compact-syntax": {
			"source": "iana",
			"extensions": ["rnc"]
		},
		"application/remote-printing": { "source": "iana" },
		"application/reputon+json": {
			"source": "iana",
			"compressible": true
		},
		"application/resource-lists+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rl"]
		},
		"application/resource-lists-diff+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rld"]
		},
		"application/rfc+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/riscos": { "source": "iana" },
		"application/rlmi+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/rls-services+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rs"]
		},
		"application/route-apd+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rapd"]
		},
		"application/route-s-tsid+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["sls"]
		},
		"application/route-usd+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rusd"]
		},
		"application/rpki-ghostbusters": {
			"source": "iana",
			"extensions": ["gbr"]
		},
		"application/rpki-manifest": {
			"source": "iana",
			"extensions": ["mft"]
		},
		"application/rpki-publication": { "source": "iana" },
		"application/rpki-roa": {
			"source": "iana",
			"extensions": ["roa"]
		},
		"application/rpki-updown": { "source": "iana" },
		"application/rsd+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["rsd"]
		},
		"application/rss+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["rss"]
		},
		"application/rtf": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rtf"]
		},
		"application/rtploopback": { "source": "iana" },
		"application/rtx": { "source": "iana" },
		"application/samlassertion+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/samlmetadata+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/sarif+json": {
			"source": "iana",
			"compressible": true
		},
		"application/sarif-external-properties+json": {
			"source": "iana",
			"compressible": true
		},
		"application/sbe": { "source": "iana" },
		"application/sbml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["sbml"]
		},
		"application/scaip+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/scim+json": {
			"source": "iana",
			"compressible": true
		},
		"application/scvp-cv-request": {
			"source": "iana",
			"extensions": ["scq"]
		},
		"application/scvp-cv-response": {
			"source": "iana",
			"extensions": ["scs"]
		},
		"application/scvp-vp-request": {
			"source": "iana",
			"extensions": ["spq"]
		},
		"application/scvp-vp-response": {
			"source": "iana",
			"extensions": ["spp"]
		},
		"application/sdp": {
			"source": "iana",
			"extensions": ["sdp"]
		},
		"application/secevent+jwt": { "source": "iana" },
		"application/senml+cbor": { "source": "iana" },
		"application/senml+json": {
			"source": "iana",
			"compressible": true
		},
		"application/senml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["senmlx"]
		},
		"application/senml-etch+cbor": { "source": "iana" },
		"application/senml-etch+json": {
			"source": "iana",
			"compressible": true
		},
		"application/senml-exi": { "source": "iana" },
		"application/sensml+cbor": { "source": "iana" },
		"application/sensml+json": {
			"source": "iana",
			"compressible": true
		},
		"application/sensml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["sensmlx"]
		},
		"application/sensml-exi": { "source": "iana" },
		"application/sep+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/sep-exi": { "source": "iana" },
		"application/session-info": { "source": "iana" },
		"application/set-payment": { "source": "iana" },
		"application/set-payment-initiation": {
			"source": "iana",
			"extensions": ["setpay"]
		},
		"application/set-registration": { "source": "iana" },
		"application/set-registration-initiation": {
			"source": "iana",
			"extensions": ["setreg"]
		},
		"application/sgml": { "source": "iana" },
		"application/sgml-open-catalog": { "source": "iana" },
		"application/shf+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["shf"]
		},
		"application/sieve": {
			"source": "iana",
			"extensions": ["siv", "sieve"]
		},
		"application/simple-filter+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/simple-message-summary": { "source": "iana" },
		"application/simplesymbolcontainer": { "source": "iana" },
		"application/sipc": { "source": "iana" },
		"application/slate": { "source": "iana" },
		"application/smil": { "source": "iana" },
		"application/smil+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["smi", "smil"]
		},
		"application/smpte336m": { "source": "iana" },
		"application/soap+fastinfoset": { "source": "iana" },
		"application/soap+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/sparql-query": {
			"source": "iana",
			"extensions": ["rq"]
		},
		"application/sparql-results+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["srx"]
		},
		"application/spdx+json": {
			"source": "iana",
			"compressible": true
		},
		"application/spirits-event+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/sql": { "source": "iana" },
		"application/srgs": {
			"source": "iana",
			"extensions": ["gram"]
		},
		"application/srgs+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["grxml"]
		},
		"application/sru+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["sru"]
		},
		"application/ssdl+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["ssdl"]
		},
		"application/ssml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ssml"]
		},
		"application/stix+json": {
			"source": "iana",
			"compressible": true
		},
		"application/swid+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["swidtag"]
		},
		"application/tamp-apex-update": { "source": "iana" },
		"application/tamp-apex-update-confirm": { "source": "iana" },
		"application/tamp-community-update": { "source": "iana" },
		"application/tamp-community-update-confirm": { "source": "iana" },
		"application/tamp-error": { "source": "iana" },
		"application/tamp-sequence-adjust": { "source": "iana" },
		"application/tamp-sequence-adjust-confirm": { "source": "iana" },
		"application/tamp-status-query": { "source": "iana" },
		"application/tamp-status-response": { "source": "iana" },
		"application/tamp-update": { "source": "iana" },
		"application/tamp-update-confirm": { "source": "iana" },
		"application/tar": { "compressible": true },
		"application/taxii+json": {
			"source": "iana",
			"compressible": true
		},
		"application/td+json": {
			"source": "iana",
			"compressible": true
		},
		"application/tei+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["tei", "teicorpus"]
		},
		"application/tetra_isi": { "source": "iana" },
		"application/thraud+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["tfi"]
		},
		"application/timestamp-query": { "source": "iana" },
		"application/timestamp-reply": { "source": "iana" },
		"application/timestamped-data": {
			"source": "iana",
			"extensions": ["tsd"]
		},
		"application/tlsrpt+gzip": { "source": "iana" },
		"application/tlsrpt+json": {
			"source": "iana",
			"compressible": true
		},
		"application/tnauthlist": { "source": "iana" },
		"application/token-introspection+jwt": { "source": "iana" },
		"application/toml": {
			"compressible": true,
			"extensions": ["toml"]
		},
		"application/trickle-ice-sdpfrag": { "source": "iana" },
		"application/trig": {
			"source": "iana",
			"extensions": ["trig"]
		},
		"application/ttml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ttml"]
		},
		"application/tve-trigger": { "source": "iana" },
		"application/tzif": { "source": "iana" },
		"application/tzif-leap": { "source": "iana" },
		"application/ubjson": {
			"compressible": false,
			"extensions": ["ubj"]
		},
		"application/ulpfec": { "source": "iana" },
		"application/urc-grpsheet+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/urc-ressheet+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rsheet"]
		},
		"application/urc-targetdesc+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["td"]
		},
		"application/urc-uisocketdesc+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vcard+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vcard+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vemmi": { "source": "iana" },
		"application/vividence.scriptfile": { "source": "apache" },
		"application/vnd.1000minds.decision-model+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["1km"]
		},
		"application/vnd.3gpp-prose+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp-prose-pc3ch+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp-v2x-local-service-information": { "source": "iana" },
		"application/vnd.3gpp.5gnas": { "source": "iana" },
		"application/vnd.3gpp.access-transfer-events+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.bsf+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.gmop+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.gtpc": { "source": "iana" },
		"application/vnd.3gpp.interworking-data": { "source": "iana" },
		"application/vnd.3gpp.lpp": { "source": "iana" },
		"application/vnd.3gpp.mc-signalling-ear": { "source": "iana" },
		"application/vnd.3gpp.mcdata-affiliation-command+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcdata-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcdata-payload": { "source": "iana" },
		"application/vnd.3gpp.mcdata-service-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcdata-signalling": { "source": "iana" },
		"application/vnd.3gpp.mcdata-ue-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcdata-user-profile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-affiliation-command+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-floor-request+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-location-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-mbms-usage-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-service-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-signed+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-ue-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-ue-init-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcptt-user-profile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-affiliation-command+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-affiliation-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-location-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-mbms-usage-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-service-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-transmission-request+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-ue-config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mcvideo-user-profile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.mid-call+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.ngap": { "source": "iana" },
		"application/vnd.3gpp.pfcp": { "source": "iana" },
		"application/vnd.3gpp.pic-bw-large": {
			"source": "iana",
			"extensions": ["plb"]
		},
		"application/vnd.3gpp.pic-bw-small": {
			"source": "iana",
			"extensions": ["psb"]
		},
		"application/vnd.3gpp.pic-bw-var": {
			"source": "iana",
			"extensions": ["pvb"]
		},
		"application/vnd.3gpp.s1ap": { "source": "iana" },
		"application/vnd.3gpp.sms": { "source": "iana" },
		"application/vnd.3gpp.sms+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.srvcc-ext+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.srvcc-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.state-and-event-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp.ussd+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp2.bcmcsinfo+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.3gpp2.sms": { "source": "iana" },
		"application/vnd.3gpp2.tcap": {
			"source": "iana",
			"extensions": ["tcap"]
		},
		"application/vnd.3lightssoftware.imagescal": { "source": "iana" },
		"application/vnd.3m.post-it-notes": {
			"source": "iana",
			"extensions": ["pwn"]
		},
		"application/vnd.accpac.simply.aso": {
			"source": "iana",
			"extensions": ["aso"]
		},
		"application/vnd.accpac.simply.imp": {
			"source": "iana",
			"extensions": ["imp"]
		},
		"application/vnd.acucobol": {
			"source": "iana",
			"extensions": ["acu"]
		},
		"application/vnd.acucorp": {
			"source": "iana",
			"extensions": ["atc", "acutc"]
		},
		"application/vnd.adobe.air-application-installer-package+zip": {
			"source": "apache",
			"compressible": false,
			"extensions": ["air"]
		},
		"application/vnd.adobe.flash.movie": { "source": "iana" },
		"application/vnd.adobe.formscentral.fcdt": {
			"source": "iana",
			"extensions": ["fcdt"]
		},
		"application/vnd.adobe.fxp": {
			"source": "iana",
			"extensions": ["fxp", "fxpl"]
		},
		"application/vnd.adobe.partial-upload": { "source": "iana" },
		"application/vnd.adobe.xdp+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xdp"]
		},
		"application/vnd.adobe.xfdf": {
			"source": "iana",
			"extensions": ["xfdf"]
		},
		"application/vnd.aether.imp": { "source": "iana" },
		"application/vnd.afpc.afplinedata": { "source": "iana" },
		"application/vnd.afpc.afplinedata-pagedef": { "source": "iana" },
		"application/vnd.afpc.cmoca-cmresource": { "source": "iana" },
		"application/vnd.afpc.foca-charset": { "source": "iana" },
		"application/vnd.afpc.foca-codedfont": { "source": "iana" },
		"application/vnd.afpc.foca-codepage": { "source": "iana" },
		"application/vnd.afpc.modca": { "source": "iana" },
		"application/vnd.afpc.modca-cmtable": { "source": "iana" },
		"application/vnd.afpc.modca-formdef": { "source": "iana" },
		"application/vnd.afpc.modca-mediummap": { "source": "iana" },
		"application/vnd.afpc.modca-objectcontainer": { "source": "iana" },
		"application/vnd.afpc.modca-overlay": { "source": "iana" },
		"application/vnd.afpc.modca-pagesegment": { "source": "iana" },
		"application/vnd.age": {
			"source": "iana",
			"extensions": ["age"]
		},
		"application/vnd.ah-barcode": { "source": "iana" },
		"application/vnd.ahead.space": {
			"source": "iana",
			"extensions": ["ahead"]
		},
		"application/vnd.airzip.filesecure.azf": {
			"source": "iana",
			"extensions": ["azf"]
		},
		"application/vnd.airzip.filesecure.azs": {
			"source": "iana",
			"extensions": ["azs"]
		},
		"application/vnd.amadeus+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.amazon.ebook": {
			"source": "apache",
			"extensions": ["azw"]
		},
		"application/vnd.amazon.mobi8-ebook": { "source": "iana" },
		"application/vnd.americandynamics.acc": {
			"source": "iana",
			"extensions": ["acc"]
		},
		"application/vnd.amiga.ami": {
			"source": "iana",
			"extensions": ["ami"]
		},
		"application/vnd.amundsen.maze+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.android.ota": { "source": "iana" },
		"application/vnd.android.package-archive": {
			"source": "apache",
			"compressible": false,
			"extensions": ["apk"]
		},
		"application/vnd.anki": { "source": "iana" },
		"application/vnd.anser-web-certificate-issue-initiation": {
			"source": "iana",
			"extensions": ["cii"]
		},
		"application/vnd.anser-web-funds-transfer-initiation": {
			"source": "apache",
			"extensions": ["fti"]
		},
		"application/vnd.antix.game-component": {
			"source": "iana",
			"extensions": ["atx"]
		},
		"application/vnd.apache.arrow.file": { "source": "iana" },
		"application/vnd.apache.arrow.stream": { "source": "iana" },
		"application/vnd.apache.thrift.binary": { "source": "iana" },
		"application/vnd.apache.thrift.compact": { "source": "iana" },
		"application/vnd.apache.thrift.json": { "source": "iana" },
		"application/vnd.api+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.aplextor.warrp+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.apothekende.reservation+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.apple.installer+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["mpkg"]
		},
		"application/vnd.apple.keynote": {
			"source": "iana",
			"extensions": ["key"]
		},
		"application/vnd.apple.mpegurl": {
			"source": "iana",
			"extensions": ["m3u8"]
		},
		"application/vnd.apple.numbers": {
			"source": "iana",
			"extensions": ["numbers"]
		},
		"application/vnd.apple.pages": {
			"source": "iana",
			"extensions": ["pages"]
		},
		"application/vnd.apple.pkpass": {
			"compressible": false,
			"extensions": ["pkpass"]
		},
		"application/vnd.arastra.swi": { "source": "iana" },
		"application/vnd.aristanetworks.swi": {
			"source": "iana",
			"extensions": ["swi"]
		},
		"application/vnd.artisan+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.artsquare": { "source": "iana" },
		"application/vnd.astraea-software.iota": {
			"source": "iana",
			"extensions": ["iota"]
		},
		"application/vnd.audiograph": {
			"source": "iana",
			"extensions": ["aep"]
		},
		"application/vnd.autopackage": { "source": "iana" },
		"application/vnd.avalon+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.avistar+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.balsamiq.bmml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["bmml"]
		},
		"application/vnd.balsamiq.bmpr": { "source": "iana" },
		"application/vnd.banana-accounting": { "source": "iana" },
		"application/vnd.bbf.usp.error": { "source": "iana" },
		"application/vnd.bbf.usp.msg": { "source": "iana" },
		"application/vnd.bbf.usp.msg+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.bekitzur-stech+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.bint.med-content": { "source": "iana" },
		"application/vnd.biopax.rdf+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.blink-idb-value-wrapper": { "source": "iana" },
		"application/vnd.blueice.multipass": {
			"source": "iana",
			"extensions": ["mpm"]
		},
		"application/vnd.bluetooth.ep.oob": { "source": "iana" },
		"application/vnd.bluetooth.le.oob": { "source": "iana" },
		"application/vnd.bmi": {
			"source": "iana",
			"extensions": ["bmi"]
		},
		"application/vnd.bpf": { "source": "iana" },
		"application/vnd.bpf3": { "source": "iana" },
		"application/vnd.businessobjects": {
			"source": "iana",
			"extensions": ["rep"]
		},
		"application/vnd.byu.uapi+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.cab-jscript": { "source": "iana" },
		"application/vnd.canon-cpdl": { "source": "iana" },
		"application/vnd.canon-lips": { "source": "iana" },
		"application/vnd.capasystems-pg+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.cendio.thinlinc.clientconf": { "source": "iana" },
		"application/vnd.century-systems.tcp_stream": { "source": "iana" },
		"application/vnd.chemdraw+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["cdxml"]
		},
		"application/vnd.chess-pgn": { "source": "iana" },
		"application/vnd.chipnuts.karaoke-mmd": {
			"source": "iana",
			"extensions": ["mmd"]
		},
		"application/vnd.ciedi": { "source": "iana" },
		"application/vnd.cinderella": {
			"source": "iana",
			"extensions": ["cdy"]
		},
		"application/vnd.cirpack.isdn-ext": { "source": "iana" },
		"application/vnd.citationstyles.style+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["csl"]
		},
		"application/vnd.claymore": {
			"source": "iana",
			"extensions": ["cla"]
		},
		"application/vnd.cloanto.rp9": {
			"source": "iana",
			"extensions": ["rp9"]
		},
		"application/vnd.clonk.c4group": {
			"source": "iana",
			"extensions": [
				"c4g",
				"c4d",
				"c4f",
				"c4p",
				"c4u"
			]
		},
		"application/vnd.cluetrust.cartomobile-config": {
			"source": "iana",
			"extensions": ["c11amc"]
		},
		"application/vnd.cluetrust.cartomobile-config-pkg": {
			"source": "iana",
			"extensions": ["c11amz"]
		},
		"application/vnd.coffeescript": { "source": "iana" },
		"application/vnd.collabio.xodocuments.document": { "source": "iana" },
		"application/vnd.collabio.xodocuments.document-template": { "source": "iana" },
		"application/vnd.collabio.xodocuments.presentation": { "source": "iana" },
		"application/vnd.collabio.xodocuments.presentation-template": { "source": "iana" },
		"application/vnd.collabio.xodocuments.spreadsheet": { "source": "iana" },
		"application/vnd.collabio.xodocuments.spreadsheet-template": { "source": "iana" },
		"application/vnd.collection+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.collection.doc+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.collection.next+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.comicbook+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.comicbook-rar": { "source": "iana" },
		"application/vnd.commerce-battelle": { "source": "iana" },
		"application/vnd.commonspace": {
			"source": "iana",
			"extensions": ["csp"]
		},
		"application/vnd.contact.cmsg": {
			"source": "iana",
			"extensions": ["cdbcmsg"]
		},
		"application/vnd.coreos.ignition+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.cosmocaller": {
			"source": "iana",
			"extensions": ["cmc"]
		},
		"application/vnd.crick.clicker": {
			"source": "iana",
			"extensions": ["clkx"]
		},
		"application/vnd.crick.clicker.keyboard": {
			"source": "iana",
			"extensions": ["clkk"]
		},
		"application/vnd.crick.clicker.palette": {
			"source": "iana",
			"extensions": ["clkp"]
		},
		"application/vnd.crick.clicker.template": {
			"source": "iana",
			"extensions": ["clkt"]
		},
		"application/vnd.crick.clicker.wordbank": {
			"source": "iana",
			"extensions": ["clkw"]
		},
		"application/vnd.criticaltools.wbs+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["wbs"]
		},
		"application/vnd.cryptii.pipe+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.crypto-shade-file": { "source": "iana" },
		"application/vnd.cryptomator.encrypted": { "source": "iana" },
		"application/vnd.cryptomator.vault": { "source": "iana" },
		"application/vnd.ctc-posml": {
			"source": "iana",
			"extensions": ["pml"]
		},
		"application/vnd.ctct.ws+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.cups-pdf": { "source": "iana" },
		"application/vnd.cups-postscript": { "source": "iana" },
		"application/vnd.cups-ppd": {
			"source": "iana",
			"extensions": ["ppd"]
		},
		"application/vnd.cups-raster": { "source": "iana" },
		"application/vnd.cups-raw": { "source": "iana" },
		"application/vnd.curl": { "source": "iana" },
		"application/vnd.curl.car": {
			"source": "apache",
			"extensions": ["car"]
		},
		"application/vnd.curl.pcurl": {
			"source": "apache",
			"extensions": ["pcurl"]
		},
		"application/vnd.cyan.dean.root+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.cybank": { "source": "iana" },
		"application/vnd.cyclonedx+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.cyclonedx+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.d2l.coursepackage1p0+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.d3m-dataset": { "source": "iana" },
		"application/vnd.d3m-problem": { "source": "iana" },
		"application/vnd.dart": {
			"source": "iana",
			"compressible": true,
			"extensions": ["dart"]
		},
		"application/vnd.data-vision.rdz": {
			"source": "iana",
			"extensions": ["rdz"]
		},
		"application/vnd.datapackage+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dataresource+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dbf": {
			"source": "iana",
			"extensions": ["dbf"]
		},
		"application/vnd.debian.binary-package": { "source": "iana" },
		"application/vnd.dece.data": {
			"source": "iana",
			"extensions": [
				"uvf",
				"uvvf",
				"uvd",
				"uvvd"
			]
		},
		"application/vnd.dece.ttml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["uvt", "uvvt"]
		},
		"application/vnd.dece.unspecified": {
			"source": "iana",
			"extensions": ["uvx", "uvvx"]
		},
		"application/vnd.dece.zip": {
			"source": "iana",
			"extensions": ["uvz", "uvvz"]
		},
		"application/vnd.denovo.fcselayout-link": {
			"source": "iana",
			"extensions": ["fe_launch"]
		},
		"application/vnd.desmume.movie": { "source": "iana" },
		"application/vnd.dir-bi.plate-dl-nosuffix": { "source": "iana" },
		"application/vnd.dm.delegation+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dna": {
			"source": "iana",
			"extensions": ["dna"]
		},
		"application/vnd.document+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dolby.mlp": {
			"source": "apache",
			"extensions": ["mlp"]
		},
		"application/vnd.dolby.mobile.1": { "source": "iana" },
		"application/vnd.dolby.mobile.2": { "source": "iana" },
		"application/vnd.doremir.scorecloud-binary-document": { "source": "iana" },
		"application/vnd.dpgraph": {
			"source": "iana",
			"extensions": ["dpg"]
		},
		"application/vnd.dreamfactory": {
			"source": "iana",
			"extensions": ["dfac"]
		},
		"application/vnd.drive+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ds-keypoint": {
			"source": "apache",
			"extensions": ["kpxx"]
		},
		"application/vnd.dtg.local": { "source": "iana" },
		"application/vnd.dtg.local.flash": { "source": "iana" },
		"application/vnd.dtg.local.html": { "source": "iana" },
		"application/vnd.dvb.ait": {
			"source": "iana",
			"extensions": ["ait"]
		},
		"application/vnd.dvb.dvbisl+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.dvbj": { "source": "iana" },
		"application/vnd.dvb.esgcontainer": { "source": "iana" },
		"application/vnd.dvb.ipdcdftnotifaccess": { "source": "iana" },
		"application/vnd.dvb.ipdcesgaccess": { "source": "iana" },
		"application/vnd.dvb.ipdcesgaccess2": { "source": "iana" },
		"application/vnd.dvb.ipdcesgpdd": { "source": "iana" },
		"application/vnd.dvb.ipdcroaming": { "source": "iana" },
		"application/vnd.dvb.iptv.alfec-base": { "source": "iana" },
		"application/vnd.dvb.iptv.alfec-enhancement": { "source": "iana" },
		"application/vnd.dvb.notif-aggregate-root+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.notif-container+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.notif-generic+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.notif-ia-msglist+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.notif-ia-registration-request+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.notif-ia-registration-response+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.notif-init+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.dvb.pfr": { "source": "iana" },
		"application/vnd.dvb.service": {
			"source": "iana",
			"extensions": ["svc"]
		},
		"application/vnd.dxr": { "source": "iana" },
		"application/vnd.dynageo": {
			"source": "iana",
			"extensions": ["geo"]
		},
		"application/vnd.dzr": { "source": "iana" },
		"application/vnd.easykaraoke.cdgdownload": { "source": "iana" },
		"application/vnd.ecdis-update": { "source": "iana" },
		"application/vnd.ecip.rlp": { "source": "iana" },
		"application/vnd.eclipse.ditto+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ecowin.chart": {
			"source": "iana",
			"extensions": ["mag"]
		},
		"application/vnd.ecowin.filerequest": { "source": "iana" },
		"application/vnd.ecowin.fileupdate": { "source": "iana" },
		"application/vnd.ecowin.series": { "source": "iana" },
		"application/vnd.ecowin.seriesrequest": { "source": "iana" },
		"application/vnd.ecowin.seriesupdate": { "source": "iana" },
		"application/vnd.efi.img": { "source": "iana" },
		"application/vnd.efi.iso": { "source": "iana" },
		"application/vnd.emclient.accessrequest+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.enliven": {
			"source": "iana",
			"extensions": ["nml"]
		},
		"application/vnd.enphase.envoy": { "source": "iana" },
		"application/vnd.eprints.data+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.epson.esf": {
			"source": "iana",
			"extensions": ["esf"]
		},
		"application/vnd.epson.msf": {
			"source": "iana",
			"extensions": ["msf"]
		},
		"application/vnd.epson.quickanime": {
			"source": "iana",
			"extensions": ["qam"]
		},
		"application/vnd.epson.salt": {
			"source": "iana",
			"extensions": ["slt"]
		},
		"application/vnd.epson.ssf": {
			"source": "iana",
			"extensions": ["ssf"]
		},
		"application/vnd.ericsson.quickcall": { "source": "iana" },
		"application/vnd.espass-espass+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.eszigno3+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["es3", "et3"]
		},
		"application/vnd.etsi.aoc+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.asic-e+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.etsi.asic-s+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.etsi.cug+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvcommand+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvdiscovery+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvprofile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvsad-bc+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvsad-cod+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvsad-npvr+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvservice+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvsync+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.iptvueprofile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.mcid+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.mheg5": { "source": "iana" },
		"application/vnd.etsi.overload-control-policy-dataset+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.pstn+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.sci+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.simservs+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.timestamp-token": { "source": "iana" },
		"application/vnd.etsi.tsl+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.etsi.tsl.der": { "source": "iana" },
		"application/vnd.eu.kasparian.car+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.eudora.data": { "source": "iana" },
		"application/vnd.evolv.ecig.profile": { "source": "iana" },
		"application/vnd.evolv.ecig.settings": { "source": "iana" },
		"application/vnd.evolv.ecig.theme": { "source": "iana" },
		"application/vnd.exstream-empower+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.exstream-package": { "source": "iana" },
		"application/vnd.ezpix-album": {
			"source": "iana",
			"extensions": ["ez2"]
		},
		"application/vnd.ezpix-package": {
			"source": "iana",
			"extensions": ["ez3"]
		},
		"application/vnd.f-secure.mobile": { "source": "iana" },
		"application/vnd.familysearch.gedcom+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.fastcopy-disk-image": { "source": "iana" },
		"application/vnd.fdf": {
			"source": "iana",
			"extensions": ["fdf"]
		},
		"application/vnd.fdsn.mseed": {
			"source": "iana",
			"extensions": ["mseed"]
		},
		"application/vnd.fdsn.seed": {
			"source": "iana",
			"extensions": ["seed", "dataless"]
		},
		"application/vnd.ffsns": { "source": "iana" },
		"application/vnd.ficlab.flb+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.filmit.zfc": { "source": "iana" },
		"application/vnd.fints": { "source": "iana" },
		"application/vnd.firemonkeys.cloudcell": { "source": "iana" },
		"application/vnd.flographit": {
			"source": "iana",
			"extensions": ["gph"]
		},
		"application/vnd.fluxtime.clip": {
			"source": "iana",
			"extensions": ["ftc"]
		},
		"application/vnd.font-fontforge-sfd": { "source": "iana" },
		"application/vnd.framemaker": {
			"source": "iana",
			"extensions": [
				"fm",
				"frame",
				"maker",
				"book"
			]
		},
		"application/vnd.frogans.fnc": {
			"source": "iana",
			"extensions": ["fnc"]
		},
		"application/vnd.frogans.ltf": {
			"source": "iana",
			"extensions": ["ltf"]
		},
		"application/vnd.fsc.weblaunch": {
			"source": "iana",
			"extensions": ["fsc"]
		},
		"application/vnd.fujifilm.fb.docuworks": { "source": "iana" },
		"application/vnd.fujifilm.fb.docuworks.binder": { "source": "iana" },
		"application/vnd.fujifilm.fb.docuworks.container": { "source": "iana" },
		"application/vnd.fujifilm.fb.jfi+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.fujitsu.oasys": {
			"source": "iana",
			"extensions": ["oas"]
		},
		"application/vnd.fujitsu.oasys2": {
			"source": "iana",
			"extensions": ["oa2"]
		},
		"application/vnd.fujitsu.oasys3": {
			"source": "iana",
			"extensions": ["oa3"]
		},
		"application/vnd.fujitsu.oasysgp": {
			"source": "iana",
			"extensions": ["fg5"]
		},
		"application/vnd.fujitsu.oasysprs": {
			"source": "iana",
			"extensions": ["bh2"]
		},
		"application/vnd.fujixerox.art-ex": { "source": "iana" },
		"application/vnd.fujixerox.art4": { "source": "iana" },
		"application/vnd.fujixerox.ddd": {
			"source": "iana",
			"extensions": ["ddd"]
		},
		"application/vnd.fujixerox.docuworks": {
			"source": "iana",
			"extensions": ["xdw"]
		},
		"application/vnd.fujixerox.docuworks.binder": {
			"source": "iana",
			"extensions": ["xbd"]
		},
		"application/vnd.fujixerox.docuworks.container": { "source": "iana" },
		"application/vnd.fujixerox.hbpl": { "source": "iana" },
		"application/vnd.fut-misnet": { "source": "iana" },
		"application/vnd.futoin+cbor": { "source": "iana" },
		"application/vnd.futoin+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.fuzzysheet": {
			"source": "iana",
			"extensions": ["fzs"]
		},
		"application/vnd.genomatix.tuxedo": {
			"source": "iana",
			"extensions": ["txd"]
		},
		"application/vnd.gentics.grd+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.geo+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.geocube+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.geogebra.file": {
			"source": "iana",
			"extensions": ["ggb"]
		},
		"application/vnd.geogebra.slides": { "source": "iana" },
		"application/vnd.geogebra.tool": {
			"source": "iana",
			"extensions": ["ggt"]
		},
		"application/vnd.geometry-explorer": {
			"source": "iana",
			"extensions": ["gex", "gre"]
		},
		"application/vnd.geonext": {
			"source": "iana",
			"extensions": ["gxt"]
		},
		"application/vnd.geoplan": {
			"source": "iana",
			"extensions": ["g2w"]
		},
		"application/vnd.geospace": {
			"source": "iana",
			"extensions": ["g3w"]
		},
		"application/vnd.gerber": { "source": "iana" },
		"application/vnd.globalplatform.card-content-mgt": { "source": "iana" },
		"application/vnd.globalplatform.card-content-mgt-response": { "source": "iana" },
		"application/vnd.gmx": {
			"source": "iana",
			"extensions": ["gmx"]
		},
		"application/vnd.google-apps.document": {
			"compressible": false,
			"extensions": ["gdoc"]
		},
		"application/vnd.google-apps.presentation": {
			"compressible": false,
			"extensions": ["gslides"]
		},
		"application/vnd.google-apps.spreadsheet": {
			"compressible": false,
			"extensions": ["gsheet"]
		},
		"application/vnd.google-earth.kml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["kml"]
		},
		"application/vnd.google-earth.kmz": {
			"source": "iana",
			"compressible": false,
			"extensions": ["kmz"]
		},
		"application/vnd.gov.sk.e-form+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.gov.sk.e-form+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.gov.sk.xmldatacontainer+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.grafeq": {
			"source": "iana",
			"extensions": ["gqf", "gqs"]
		},
		"application/vnd.gridmp": { "source": "iana" },
		"application/vnd.groove-account": {
			"source": "iana",
			"extensions": ["gac"]
		},
		"application/vnd.groove-help": {
			"source": "iana",
			"extensions": ["ghf"]
		},
		"application/vnd.groove-identity-message": {
			"source": "iana",
			"extensions": ["gim"]
		},
		"application/vnd.groove-injector": {
			"source": "iana",
			"extensions": ["grv"]
		},
		"application/vnd.groove-tool-message": {
			"source": "iana",
			"extensions": ["gtm"]
		},
		"application/vnd.groove-tool-template": {
			"source": "iana",
			"extensions": ["tpl"]
		},
		"application/vnd.groove-vcard": {
			"source": "iana",
			"extensions": ["vcg"]
		},
		"application/vnd.hal+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.hal+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["hal"]
		},
		"application/vnd.handheld-entertainment+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["zmm"]
		},
		"application/vnd.hbci": {
			"source": "iana",
			"extensions": ["hbci"]
		},
		"application/vnd.hc+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.hcl-bireports": { "source": "iana" },
		"application/vnd.hdt": { "source": "iana" },
		"application/vnd.heroku+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.hhe.lesson-player": {
			"source": "iana",
			"extensions": ["les"]
		},
		"application/vnd.hl7cda+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/vnd.hl7v2+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/vnd.hp-hpgl": {
			"source": "iana",
			"extensions": ["hpgl"]
		},
		"application/vnd.hp-hpid": {
			"source": "iana",
			"extensions": ["hpid"]
		},
		"application/vnd.hp-hps": {
			"source": "iana",
			"extensions": ["hps"]
		},
		"application/vnd.hp-jlyt": {
			"source": "iana",
			"extensions": ["jlt"]
		},
		"application/vnd.hp-pcl": {
			"source": "iana",
			"extensions": ["pcl"]
		},
		"application/vnd.hp-pclxl": {
			"source": "iana",
			"extensions": ["pclxl"]
		},
		"application/vnd.httphone": { "source": "iana" },
		"application/vnd.hydrostatix.sof-data": {
			"source": "iana",
			"extensions": ["sfd-hdstx"]
		},
		"application/vnd.hyper+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.hyper-item+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.hyperdrive+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.hzn-3d-crossword": { "source": "iana" },
		"application/vnd.ibm.afplinedata": { "source": "iana" },
		"application/vnd.ibm.electronic-media": { "source": "iana" },
		"application/vnd.ibm.minipay": {
			"source": "iana",
			"extensions": ["mpy"]
		},
		"application/vnd.ibm.modcap": {
			"source": "iana",
			"extensions": [
				"afp",
				"listafp",
				"list3820"
			]
		},
		"application/vnd.ibm.rights-management": {
			"source": "iana",
			"extensions": ["irm"]
		},
		"application/vnd.ibm.secure-container": {
			"source": "iana",
			"extensions": ["sc"]
		},
		"application/vnd.iccprofile": {
			"source": "iana",
			"extensions": ["icc", "icm"]
		},
		"application/vnd.ieee.1905": { "source": "iana" },
		"application/vnd.igloader": {
			"source": "iana",
			"extensions": ["igl"]
		},
		"application/vnd.imagemeter.folder+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.imagemeter.image+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.immervision-ivp": {
			"source": "iana",
			"extensions": ["ivp"]
		},
		"application/vnd.immervision-ivu": {
			"source": "iana",
			"extensions": ["ivu"]
		},
		"application/vnd.ims.imsccv1p1": { "source": "iana" },
		"application/vnd.ims.imsccv1p2": { "source": "iana" },
		"application/vnd.ims.imsccv1p3": { "source": "iana" },
		"application/vnd.ims.lis.v2.result+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ims.lti.v2.toolconsumerprofile+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ims.lti.v2.toolproxy+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ims.lti.v2.toolproxy.id+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ims.lti.v2.toolsettings+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ims.lti.v2.toolsettings.simple+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.informedcontrol.rms+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.informix-visionary": { "source": "iana" },
		"application/vnd.infotech.project": { "source": "iana" },
		"application/vnd.infotech.project+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.innopath.wamp.notification": { "source": "iana" },
		"application/vnd.insors.igm": {
			"source": "iana",
			"extensions": ["igm"]
		},
		"application/vnd.intercon.formnet": {
			"source": "iana",
			"extensions": ["xpw", "xpx"]
		},
		"application/vnd.intergeo": {
			"source": "iana",
			"extensions": ["i2g"]
		},
		"application/vnd.intertrust.digibox": { "source": "iana" },
		"application/vnd.intertrust.nncp": { "source": "iana" },
		"application/vnd.intu.qbo": {
			"source": "iana",
			"extensions": ["qbo"]
		},
		"application/vnd.intu.qfx": {
			"source": "iana",
			"extensions": ["qfx"]
		},
		"application/vnd.iptc.g2.catalogitem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.iptc.g2.conceptitem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.iptc.g2.knowledgeitem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.iptc.g2.newsitem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.iptc.g2.newsmessage+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.iptc.g2.packageitem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.iptc.g2.planningitem+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ipunplugged.rcprofile": {
			"source": "iana",
			"extensions": ["rcprofile"]
		},
		"application/vnd.irepository.package+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["irp"]
		},
		"application/vnd.is-xpr": {
			"source": "iana",
			"extensions": ["xpr"]
		},
		"application/vnd.isac.fcs": {
			"source": "iana",
			"extensions": ["fcs"]
		},
		"application/vnd.iso11783-10+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.jam": {
			"source": "iana",
			"extensions": ["jam"]
		},
		"application/vnd.japannet-directory-service": { "source": "iana" },
		"application/vnd.japannet-jpnstore-wakeup": { "source": "iana" },
		"application/vnd.japannet-payment-wakeup": { "source": "iana" },
		"application/vnd.japannet-registration": { "source": "iana" },
		"application/vnd.japannet-registration-wakeup": { "source": "iana" },
		"application/vnd.japannet-setstore-wakeup": { "source": "iana" },
		"application/vnd.japannet-verification": { "source": "iana" },
		"application/vnd.japannet-verification-wakeup": { "source": "iana" },
		"application/vnd.jcp.javame.midlet-rms": {
			"source": "iana",
			"extensions": ["rms"]
		},
		"application/vnd.jisp": {
			"source": "iana",
			"extensions": ["jisp"]
		},
		"application/vnd.joost.joda-archive": {
			"source": "iana",
			"extensions": ["joda"]
		},
		"application/vnd.jsk.isdn-ngn": { "source": "iana" },
		"application/vnd.kahootz": {
			"source": "iana",
			"extensions": ["ktz", "ktr"]
		},
		"application/vnd.kde.karbon": {
			"source": "iana",
			"extensions": ["karbon"]
		},
		"application/vnd.kde.kchart": {
			"source": "iana",
			"extensions": ["chrt"]
		},
		"application/vnd.kde.kformula": {
			"source": "iana",
			"extensions": ["kfo"]
		},
		"application/vnd.kde.kivio": {
			"source": "iana",
			"extensions": ["flw"]
		},
		"application/vnd.kde.kontour": {
			"source": "iana",
			"extensions": ["kon"]
		},
		"application/vnd.kde.kpresenter": {
			"source": "iana",
			"extensions": ["kpr", "kpt"]
		},
		"application/vnd.kde.kspread": {
			"source": "iana",
			"extensions": ["ksp"]
		},
		"application/vnd.kde.kword": {
			"source": "iana",
			"extensions": ["kwd", "kwt"]
		},
		"application/vnd.kenameaapp": {
			"source": "iana",
			"extensions": ["htke"]
		},
		"application/vnd.kidspiration": {
			"source": "iana",
			"extensions": ["kia"]
		},
		"application/vnd.kinar": {
			"source": "iana",
			"extensions": ["kne", "knp"]
		},
		"application/vnd.koan": {
			"source": "iana",
			"extensions": [
				"skp",
				"skd",
				"skt",
				"skm"
			]
		},
		"application/vnd.kodak-descriptor": {
			"source": "iana",
			"extensions": ["sse"]
		},
		"application/vnd.las": { "source": "iana" },
		"application/vnd.las.las+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.las.las+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["lasxml"]
		},
		"application/vnd.laszip": { "source": "iana" },
		"application/vnd.leap+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.liberty-request+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.llamagraphics.life-balance.desktop": {
			"source": "iana",
			"extensions": ["lbd"]
		},
		"application/vnd.llamagraphics.life-balance.exchange+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["lbe"]
		},
		"application/vnd.logipipe.circuit+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.loom": { "source": "iana" },
		"application/vnd.lotus-1-2-3": {
			"source": "iana",
			"extensions": ["123"]
		},
		"application/vnd.lotus-approach": {
			"source": "iana",
			"extensions": ["apr"]
		},
		"application/vnd.lotus-freelance": {
			"source": "iana",
			"extensions": ["pre"]
		},
		"application/vnd.lotus-notes": {
			"source": "iana",
			"extensions": ["nsf"]
		},
		"application/vnd.lotus-organizer": {
			"source": "iana",
			"extensions": ["org"]
		},
		"application/vnd.lotus-screencam": {
			"source": "iana",
			"extensions": ["scm"]
		},
		"application/vnd.lotus-wordpro": {
			"source": "iana",
			"extensions": ["lwp"]
		},
		"application/vnd.macports.portpkg": {
			"source": "iana",
			"extensions": ["portpkg"]
		},
		"application/vnd.mapbox-vector-tile": {
			"source": "iana",
			"extensions": ["mvt"]
		},
		"application/vnd.marlin.drm.actiontoken+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.marlin.drm.conftoken+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.marlin.drm.license+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.marlin.drm.mdcf": { "source": "iana" },
		"application/vnd.mason+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.maxar.archive.3tz+zip": {
			"source": "iana",
			"compressible": false
		},
		"application/vnd.maxmind.maxmind-db": { "source": "iana" },
		"application/vnd.mcd": {
			"source": "iana",
			"extensions": ["mcd"]
		},
		"application/vnd.medcalcdata": {
			"source": "iana",
			"extensions": ["mc1"]
		},
		"application/vnd.mediastation.cdkey": {
			"source": "iana",
			"extensions": ["cdkey"]
		},
		"application/vnd.meridian-slingshot": { "source": "iana" },
		"application/vnd.mfer": {
			"source": "iana",
			"extensions": ["mwf"]
		},
		"application/vnd.mfmp": {
			"source": "iana",
			"extensions": ["mfm"]
		},
		"application/vnd.micro+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.micrografx.flo": {
			"source": "iana",
			"extensions": ["flo"]
		},
		"application/vnd.micrografx.igx": {
			"source": "iana",
			"extensions": ["igx"]
		},
		"application/vnd.microsoft.portable-executable": { "source": "iana" },
		"application/vnd.microsoft.windows.thumbnail-cache": { "source": "iana" },
		"application/vnd.miele+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.mif": {
			"source": "iana",
			"extensions": ["mif"]
		},
		"application/vnd.minisoft-hp3000-save": { "source": "iana" },
		"application/vnd.mitsubishi.misty-guard.trustweb": { "source": "iana" },
		"application/vnd.mobius.daf": {
			"source": "iana",
			"extensions": ["daf"]
		},
		"application/vnd.mobius.dis": {
			"source": "iana",
			"extensions": ["dis"]
		},
		"application/vnd.mobius.mbk": {
			"source": "iana",
			"extensions": ["mbk"]
		},
		"application/vnd.mobius.mqy": {
			"source": "iana",
			"extensions": ["mqy"]
		},
		"application/vnd.mobius.msl": {
			"source": "iana",
			"extensions": ["msl"]
		},
		"application/vnd.mobius.plc": {
			"source": "iana",
			"extensions": ["plc"]
		},
		"application/vnd.mobius.txf": {
			"source": "iana",
			"extensions": ["txf"]
		},
		"application/vnd.mophun.application": {
			"source": "iana",
			"extensions": ["mpn"]
		},
		"application/vnd.mophun.certificate": {
			"source": "iana",
			"extensions": ["mpc"]
		},
		"application/vnd.motorola.flexsuite": { "source": "iana" },
		"application/vnd.motorola.flexsuite.adsi": { "source": "iana" },
		"application/vnd.motorola.flexsuite.fis": { "source": "iana" },
		"application/vnd.motorola.flexsuite.gotap": { "source": "iana" },
		"application/vnd.motorola.flexsuite.kmr": { "source": "iana" },
		"application/vnd.motorola.flexsuite.ttc": { "source": "iana" },
		"application/vnd.motorola.flexsuite.wem": { "source": "iana" },
		"application/vnd.motorola.iprm": { "source": "iana" },
		"application/vnd.mozilla.xul+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xul"]
		},
		"application/vnd.ms-3mfdocument": { "source": "iana" },
		"application/vnd.ms-artgalry": {
			"source": "iana",
			"extensions": ["cil"]
		},
		"application/vnd.ms-asf": { "source": "iana" },
		"application/vnd.ms-cab-compressed": {
			"source": "iana",
			"extensions": ["cab"]
		},
		"application/vnd.ms-color.iccprofile": { "source": "apache" },
		"application/vnd.ms-excel": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"xls",
				"xlm",
				"xla",
				"xlc",
				"xlt",
				"xlw"
			]
		},
		"application/vnd.ms-excel.addin.macroenabled.12": {
			"source": "iana",
			"extensions": ["xlam"]
		},
		"application/vnd.ms-excel.sheet.binary.macroenabled.12": {
			"source": "iana",
			"extensions": ["xlsb"]
		},
		"application/vnd.ms-excel.sheet.macroenabled.12": {
			"source": "iana",
			"extensions": ["xlsm"]
		},
		"application/vnd.ms-excel.template.macroenabled.12": {
			"source": "iana",
			"extensions": ["xltm"]
		},
		"application/vnd.ms-fontobject": {
			"source": "iana",
			"compressible": true,
			"extensions": ["eot"]
		},
		"application/vnd.ms-htmlhelp": {
			"source": "iana",
			"extensions": ["chm"]
		},
		"application/vnd.ms-ims": {
			"source": "iana",
			"extensions": ["ims"]
		},
		"application/vnd.ms-lrm": {
			"source": "iana",
			"extensions": ["lrm"]
		},
		"application/vnd.ms-office.activex+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ms-officetheme": {
			"source": "iana",
			"extensions": ["thmx"]
		},
		"application/vnd.ms-opentype": {
			"source": "apache",
			"compressible": true
		},
		"application/vnd.ms-outlook": {
			"compressible": false,
			"extensions": ["msg"]
		},
		"application/vnd.ms-package.obfuscated-opentype": { "source": "apache" },
		"application/vnd.ms-pki.seccat": {
			"source": "apache",
			"extensions": ["cat"]
		},
		"application/vnd.ms-pki.stl": {
			"source": "apache",
			"extensions": ["stl"]
		},
		"application/vnd.ms-playready.initiator+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ms-powerpoint": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"ppt",
				"pps",
				"pot"
			]
		},
		"application/vnd.ms-powerpoint.addin.macroenabled.12": {
			"source": "iana",
			"extensions": ["ppam"]
		},
		"application/vnd.ms-powerpoint.presentation.macroenabled.12": {
			"source": "iana",
			"extensions": ["pptm"]
		},
		"application/vnd.ms-powerpoint.slide.macroenabled.12": {
			"source": "iana",
			"extensions": ["sldm"]
		},
		"application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
			"source": "iana",
			"extensions": ["ppsm"]
		},
		"application/vnd.ms-powerpoint.template.macroenabled.12": {
			"source": "iana",
			"extensions": ["potm"]
		},
		"application/vnd.ms-printdevicecapabilities+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ms-printing.printticket+xml": {
			"source": "apache",
			"compressible": true
		},
		"application/vnd.ms-printschematicket+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ms-project": {
			"source": "iana",
			"extensions": ["mpp", "mpt"]
		},
		"application/vnd.ms-tnef": { "source": "iana" },
		"application/vnd.ms-windows.devicepairing": { "source": "iana" },
		"application/vnd.ms-windows.nwprinting.oob": { "source": "iana" },
		"application/vnd.ms-windows.printerpairing": { "source": "iana" },
		"application/vnd.ms-windows.wsd.oob": { "source": "iana" },
		"application/vnd.ms-wmdrm.lic-chlg-req": { "source": "iana" },
		"application/vnd.ms-wmdrm.lic-resp": { "source": "iana" },
		"application/vnd.ms-wmdrm.meter-chlg-req": { "source": "iana" },
		"application/vnd.ms-wmdrm.meter-resp": { "source": "iana" },
		"application/vnd.ms-word.document.macroenabled.12": {
			"source": "iana",
			"extensions": ["docm"]
		},
		"application/vnd.ms-word.template.macroenabled.12": {
			"source": "iana",
			"extensions": ["dotm"]
		},
		"application/vnd.ms-works": {
			"source": "iana",
			"extensions": [
				"wps",
				"wks",
				"wcm",
				"wdb"
			]
		},
		"application/vnd.ms-wpl": {
			"source": "iana",
			"extensions": ["wpl"]
		},
		"application/vnd.ms-xpsdocument": {
			"source": "iana",
			"compressible": false,
			"extensions": ["xps"]
		},
		"application/vnd.msa-disk-image": { "source": "iana" },
		"application/vnd.mseq": {
			"source": "iana",
			"extensions": ["mseq"]
		},
		"application/vnd.msign": { "source": "iana" },
		"application/vnd.multiad.creator": { "source": "iana" },
		"application/vnd.multiad.creator.cif": { "source": "iana" },
		"application/vnd.music-niff": { "source": "iana" },
		"application/vnd.musician": {
			"source": "iana",
			"extensions": ["mus"]
		},
		"application/vnd.muvee.style": {
			"source": "iana",
			"extensions": ["msty"]
		},
		"application/vnd.mynfc": {
			"source": "iana",
			"extensions": ["taglet"]
		},
		"application/vnd.nacamar.ybrid+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.ncd.control": { "source": "iana" },
		"application/vnd.ncd.reference": { "source": "iana" },
		"application/vnd.nearst.inv+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.nebumind.line": { "source": "iana" },
		"application/vnd.nervana": { "source": "iana" },
		"application/vnd.netfpx": { "source": "iana" },
		"application/vnd.neurolanguage.nlu": {
			"source": "iana",
			"extensions": ["nlu"]
		},
		"application/vnd.nimn": { "source": "iana" },
		"application/vnd.nintendo.nitro.rom": { "source": "iana" },
		"application/vnd.nintendo.snes.rom": { "source": "iana" },
		"application/vnd.nitf": {
			"source": "iana",
			"extensions": ["ntf", "nitf"]
		},
		"application/vnd.noblenet-directory": {
			"source": "iana",
			"extensions": ["nnd"]
		},
		"application/vnd.noblenet-sealer": {
			"source": "iana",
			"extensions": ["nns"]
		},
		"application/vnd.noblenet-web": {
			"source": "iana",
			"extensions": ["nnw"]
		},
		"application/vnd.nokia.catalogs": { "source": "iana" },
		"application/vnd.nokia.conml+wbxml": { "source": "iana" },
		"application/vnd.nokia.conml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.nokia.iptv.config+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.nokia.isds-radio-presets": { "source": "iana" },
		"application/vnd.nokia.landmark+wbxml": { "source": "iana" },
		"application/vnd.nokia.landmark+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.nokia.landmarkcollection+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.nokia.n-gage.ac+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ac"]
		},
		"application/vnd.nokia.n-gage.data": {
			"source": "iana",
			"extensions": ["ngdat"]
		},
		"application/vnd.nokia.n-gage.symbian.install": {
			"source": "iana",
			"extensions": ["n-gage"]
		},
		"application/vnd.nokia.ncd": { "source": "iana" },
		"application/vnd.nokia.pcd+wbxml": { "source": "iana" },
		"application/vnd.nokia.pcd+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.nokia.radio-preset": {
			"source": "iana",
			"extensions": ["rpst"]
		},
		"application/vnd.nokia.radio-presets": {
			"source": "iana",
			"extensions": ["rpss"]
		},
		"application/vnd.novadigm.edm": {
			"source": "iana",
			"extensions": ["edm"]
		},
		"application/vnd.novadigm.edx": {
			"source": "iana",
			"extensions": ["edx"]
		},
		"application/vnd.novadigm.ext": {
			"source": "iana",
			"extensions": ["ext"]
		},
		"application/vnd.ntt-local.content-share": { "source": "iana" },
		"application/vnd.ntt-local.file-transfer": { "source": "iana" },
		"application/vnd.ntt-local.ogw_remote-access": { "source": "iana" },
		"application/vnd.ntt-local.sip-ta_remote": { "source": "iana" },
		"application/vnd.ntt-local.sip-ta_tcp_stream": { "source": "iana" },
		"application/vnd.oasis.opendocument.chart": {
			"source": "iana",
			"extensions": ["odc"]
		},
		"application/vnd.oasis.opendocument.chart-template": {
			"source": "iana",
			"extensions": ["otc"]
		},
		"application/vnd.oasis.opendocument.database": {
			"source": "iana",
			"extensions": ["odb"]
		},
		"application/vnd.oasis.opendocument.formula": {
			"source": "iana",
			"extensions": ["odf"]
		},
		"application/vnd.oasis.opendocument.formula-template": {
			"source": "iana",
			"extensions": ["odft"]
		},
		"application/vnd.oasis.opendocument.graphics": {
			"source": "iana",
			"compressible": false,
			"extensions": ["odg"]
		},
		"application/vnd.oasis.opendocument.graphics-template": {
			"source": "iana",
			"extensions": ["otg"]
		},
		"application/vnd.oasis.opendocument.image": {
			"source": "iana",
			"extensions": ["odi"]
		},
		"application/vnd.oasis.opendocument.image-template": {
			"source": "iana",
			"extensions": ["oti"]
		},
		"application/vnd.oasis.opendocument.presentation": {
			"source": "iana",
			"compressible": false,
			"extensions": ["odp"]
		},
		"application/vnd.oasis.opendocument.presentation-template": {
			"source": "iana",
			"extensions": ["otp"]
		},
		"application/vnd.oasis.opendocument.spreadsheet": {
			"source": "iana",
			"compressible": false,
			"extensions": ["ods"]
		},
		"application/vnd.oasis.opendocument.spreadsheet-template": {
			"source": "iana",
			"extensions": ["ots"]
		},
		"application/vnd.oasis.opendocument.text": {
			"source": "iana",
			"compressible": false,
			"extensions": ["odt"]
		},
		"application/vnd.oasis.opendocument.text-master": {
			"source": "iana",
			"extensions": ["odm"]
		},
		"application/vnd.oasis.opendocument.text-template": {
			"source": "iana",
			"extensions": ["ott"]
		},
		"application/vnd.oasis.opendocument.text-web": {
			"source": "iana",
			"extensions": ["oth"]
		},
		"application/vnd.obn": { "source": "iana" },
		"application/vnd.ocf+cbor": { "source": "iana" },
		"application/vnd.oci.image.manifest.v1+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oftn.l10n+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.contentaccessdownload+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.contentaccessstreaming+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.cspg-hexbinary": { "source": "iana" },
		"application/vnd.oipf.dae.svg+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.dae.xhtml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.mippvcontrolmessage+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.pae.gem": { "source": "iana" },
		"application/vnd.oipf.spdiscovery+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.spdlist+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.ueprofile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oipf.userprofile+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.olpc-sugar": {
			"source": "iana",
			"extensions": ["xo"]
		},
		"application/vnd.oma-scws-config": { "source": "iana" },
		"application/vnd.oma-scws-http-request": { "source": "iana" },
		"application/vnd.oma-scws-http-response": { "source": "iana" },
		"application/vnd.oma.bcast.associated-procedure-parameter+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.drm-trigger+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.imd+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.ltkm": { "source": "iana" },
		"application/vnd.oma.bcast.notification+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.provisioningtrigger": { "source": "iana" },
		"application/vnd.oma.bcast.sgboot": { "source": "iana" },
		"application/vnd.oma.bcast.sgdd+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.sgdu": { "source": "iana" },
		"application/vnd.oma.bcast.simple-symbol-container": { "source": "iana" },
		"application/vnd.oma.bcast.smartcard-trigger+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.sprov+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.bcast.stkm": { "source": "iana" },
		"application/vnd.oma.cab-address-book+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.cab-feature-handler+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.cab-pcc+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.cab-subs-invite+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.cab-user-prefs+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.dcd": { "source": "iana" },
		"application/vnd.oma.dcdc": { "source": "iana" },
		"application/vnd.oma.dd2+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["dd2"]
		},
		"application/vnd.oma.drm.risd+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.group-usage-list+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.lwm2m+cbor": { "source": "iana" },
		"application/vnd.oma.lwm2m+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.lwm2m+tlv": { "source": "iana" },
		"application/vnd.oma.pal+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.poc.detailed-progress-report+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.poc.final-report+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.poc.groups+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.poc.invocation-descriptor+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.poc.optimized-progress-report+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.push": { "source": "iana" },
		"application/vnd.oma.scidm.messages+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oma.xcap-directory+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.omads-email+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/vnd.omads-file+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/vnd.omads-folder+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/vnd.omaloc-supl-init": { "source": "iana" },
		"application/vnd.onepager": { "source": "iana" },
		"application/vnd.onepagertamp": { "source": "iana" },
		"application/vnd.onepagertamx": { "source": "iana" },
		"application/vnd.onepagertat": { "source": "iana" },
		"application/vnd.onepagertatp": { "source": "iana" },
		"application/vnd.onepagertatx": { "source": "iana" },
		"application/vnd.openblox.game+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["obgx"]
		},
		"application/vnd.openblox.game-binary": { "source": "iana" },
		"application/vnd.openeye.oeb": { "source": "iana" },
		"application/vnd.openofficeorg.extension": {
			"source": "apache",
			"extensions": ["oxt"]
		},
		"application/vnd.openstreetmap.data+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["osm"]
		},
		"application/vnd.opentimestamps.ots": { "source": "iana" },
		"application/vnd.openxmlformats-officedocument.custom-properties+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawing+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.extended-properties+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.presentation": {
			"source": "iana",
			"compressible": false,
			"extensions": ["pptx"]
		},
		"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slide": {
			"source": "iana",
			"extensions": ["sldx"]
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
			"source": "iana",
			"extensions": ["ppsx"]
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.template": {
			"source": "iana",
			"extensions": ["potx"]
		},
		"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
			"source": "iana",
			"compressible": false,
			"extensions": ["xlsx"]
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
			"source": "iana",
			"extensions": ["xltx"]
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.theme+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.themeoverride+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.vmldrawing": { "source": "iana" },
		"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
			"source": "iana",
			"compressible": false,
			"extensions": ["docx"]
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
			"source": "iana",
			"extensions": ["dotx"]
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-package.core-properties+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.openxmlformats-package.relationships+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oracle.resource+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.orange.indata": { "source": "iana" },
		"application/vnd.osa.netdeploy": { "source": "iana" },
		"application/vnd.osgeo.mapguide.package": {
			"source": "iana",
			"extensions": ["mgp"]
		},
		"application/vnd.osgi.bundle": { "source": "iana" },
		"application/vnd.osgi.dp": {
			"source": "iana",
			"extensions": ["dp"]
		},
		"application/vnd.osgi.subsystem": {
			"source": "iana",
			"extensions": ["esa"]
		},
		"application/vnd.otps.ct-kip+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.oxli.countgraph": { "source": "iana" },
		"application/vnd.pagerduty+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.palm": {
			"source": "iana",
			"extensions": [
				"pdb",
				"pqa",
				"oprc"
			]
		},
		"application/vnd.panoply": { "source": "iana" },
		"application/vnd.paos.xml": { "source": "iana" },
		"application/vnd.patentdive": { "source": "iana" },
		"application/vnd.patientecommsdoc": { "source": "iana" },
		"application/vnd.pawaafile": {
			"source": "iana",
			"extensions": ["paw"]
		},
		"application/vnd.pcos": { "source": "iana" },
		"application/vnd.pg.format": {
			"source": "iana",
			"extensions": ["str"]
		},
		"application/vnd.pg.osasli": {
			"source": "iana",
			"extensions": ["ei6"]
		},
		"application/vnd.piaccess.application-licence": { "source": "iana" },
		"application/vnd.picsel": {
			"source": "iana",
			"extensions": ["efif"]
		},
		"application/vnd.pmi.widget": {
			"source": "iana",
			"extensions": ["wg"]
		},
		"application/vnd.poc.group-advertisement+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.pocketlearn": {
			"source": "iana",
			"extensions": ["plf"]
		},
		"application/vnd.powerbuilder6": {
			"source": "iana",
			"extensions": ["pbd"]
		},
		"application/vnd.powerbuilder6-s": { "source": "iana" },
		"application/vnd.powerbuilder7": { "source": "iana" },
		"application/vnd.powerbuilder7-s": { "source": "iana" },
		"application/vnd.powerbuilder75": { "source": "iana" },
		"application/vnd.powerbuilder75-s": { "source": "iana" },
		"application/vnd.preminet": { "source": "iana" },
		"application/vnd.previewsystems.box": {
			"source": "iana",
			"extensions": ["box"]
		},
		"application/vnd.proteus.magazine": {
			"source": "iana",
			"extensions": ["mgz"]
		},
		"application/vnd.psfs": { "source": "iana" },
		"application/vnd.publishare-delta-tree": {
			"source": "iana",
			"extensions": ["qps"]
		},
		"application/vnd.pvi.ptid1": {
			"source": "iana",
			"extensions": ["ptid"]
		},
		"application/vnd.pwg-multiplexed": { "source": "iana" },
		"application/vnd.pwg-xhtml-print+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.qualcomm.brew-app-res": { "source": "iana" },
		"application/vnd.quarantainenet": { "source": "iana" },
		"application/vnd.quark.quarkxpress": {
			"source": "iana",
			"extensions": [
				"qxd",
				"qxt",
				"qwd",
				"qwt",
				"qxl",
				"qxb"
			]
		},
		"application/vnd.quobject-quoxdocument": { "source": "iana" },
		"application/vnd.radisys.moml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-audit+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-audit-conf+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-audit-conn+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-audit-dialog+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-audit-stream+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-conf+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog-base+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog-fax-detect+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog-group+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog-speech+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.radisys.msml-dialog-transform+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.rainstor.data": { "source": "iana" },
		"application/vnd.rapid": { "source": "iana" },
		"application/vnd.rar": {
			"source": "iana",
			"extensions": ["rar"]
		},
		"application/vnd.realvnc.bed": {
			"source": "iana",
			"extensions": ["bed"]
		},
		"application/vnd.recordare.musicxml": {
			"source": "iana",
			"extensions": ["mxl"]
		},
		"application/vnd.recordare.musicxml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["musicxml"]
		},
		"application/vnd.renlearn.rlprint": { "source": "iana" },
		"application/vnd.resilient.logic": { "source": "iana" },
		"application/vnd.restful+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.rig.cryptonote": {
			"source": "iana",
			"extensions": ["cryptonote"]
		},
		"application/vnd.rim.cod": {
			"source": "apache",
			"extensions": ["cod"]
		},
		"application/vnd.rn-realmedia": {
			"source": "apache",
			"extensions": ["rm"]
		},
		"application/vnd.rn-realmedia-vbr": {
			"source": "apache",
			"extensions": ["rmvb"]
		},
		"application/vnd.route66.link66+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["link66"]
		},
		"application/vnd.rs-274x": { "source": "iana" },
		"application/vnd.ruckus.download": { "source": "iana" },
		"application/vnd.s3sms": { "source": "iana" },
		"application/vnd.sailingtracker.track": {
			"source": "iana",
			"extensions": ["st"]
		},
		"application/vnd.sar": { "source": "iana" },
		"application/vnd.sbm.cid": { "source": "iana" },
		"application/vnd.sbm.mid2": { "source": "iana" },
		"application/vnd.scribus": { "source": "iana" },
		"application/vnd.sealed.3df": { "source": "iana" },
		"application/vnd.sealed.csf": { "source": "iana" },
		"application/vnd.sealed.doc": { "source": "iana" },
		"application/vnd.sealed.eml": { "source": "iana" },
		"application/vnd.sealed.mht": { "source": "iana" },
		"application/vnd.sealed.net": { "source": "iana" },
		"application/vnd.sealed.ppt": { "source": "iana" },
		"application/vnd.sealed.tiff": { "source": "iana" },
		"application/vnd.sealed.xls": { "source": "iana" },
		"application/vnd.sealedmedia.softseal.html": { "source": "iana" },
		"application/vnd.sealedmedia.softseal.pdf": { "source": "iana" },
		"application/vnd.seemail": {
			"source": "iana",
			"extensions": ["see"]
		},
		"application/vnd.seis+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.sema": {
			"source": "iana",
			"extensions": ["sema"]
		},
		"application/vnd.semd": {
			"source": "iana",
			"extensions": ["semd"]
		},
		"application/vnd.semf": {
			"source": "iana",
			"extensions": ["semf"]
		},
		"application/vnd.shade-save-file": { "source": "iana" },
		"application/vnd.shana.informed.formdata": {
			"source": "iana",
			"extensions": ["ifm"]
		},
		"application/vnd.shana.informed.formtemplate": {
			"source": "iana",
			"extensions": ["itp"]
		},
		"application/vnd.shana.informed.interchange": {
			"source": "iana",
			"extensions": ["iif"]
		},
		"application/vnd.shana.informed.package": {
			"source": "iana",
			"extensions": ["ipk"]
		},
		"application/vnd.shootproof+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.shopkick+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.shp": { "source": "iana" },
		"application/vnd.shx": { "source": "iana" },
		"application/vnd.sigrok.session": { "source": "iana" },
		"application/vnd.simtech-mindmapper": {
			"source": "iana",
			"extensions": ["twd", "twds"]
		},
		"application/vnd.siren+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.smaf": {
			"source": "iana",
			"extensions": ["mmf"]
		},
		"application/vnd.smart.notebook": { "source": "iana" },
		"application/vnd.smart.teacher": {
			"source": "iana",
			"extensions": ["teacher"]
		},
		"application/vnd.snesdev-page-table": { "source": "iana" },
		"application/vnd.software602.filler.form+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["fo"]
		},
		"application/vnd.software602.filler.form-xml-zip": { "source": "iana" },
		"application/vnd.solent.sdkm+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["sdkm", "sdkd"]
		},
		"application/vnd.spotfire.dxp": {
			"source": "iana",
			"extensions": ["dxp"]
		},
		"application/vnd.spotfire.sfs": {
			"source": "iana",
			"extensions": ["sfs"]
		},
		"application/vnd.sqlite3": { "source": "iana" },
		"application/vnd.sss-cod": { "source": "iana" },
		"application/vnd.sss-dtf": { "source": "iana" },
		"application/vnd.sss-ntf": { "source": "iana" },
		"application/vnd.stardivision.calc": {
			"source": "apache",
			"extensions": ["sdc"]
		},
		"application/vnd.stardivision.draw": {
			"source": "apache",
			"extensions": ["sda"]
		},
		"application/vnd.stardivision.impress": {
			"source": "apache",
			"extensions": ["sdd"]
		},
		"application/vnd.stardivision.math": {
			"source": "apache",
			"extensions": ["smf"]
		},
		"application/vnd.stardivision.writer": {
			"source": "apache",
			"extensions": ["sdw", "vor"]
		},
		"application/vnd.stardivision.writer-global": {
			"source": "apache",
			"extensions": ["sgl"]
		},
		"application/vnd.stepmania.package": {
			"source": "iana",
			"extensions": ["smzip"]
		},
		"application/vnd.stepmania.stepchart": {
			"source": "iana",
			"extensions": ["sm"]
		},
		"application/vnd.street-stream": { "source": "iana" },
		"application/vnd.sun.wadl+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["wadl"]
		},
		"application/vnd.sun.xml.calc": {
			"source": "apache",
			"extensions": ["sxc"]
		},
		"application/vnd.sun.xml.calc.template": {
			"source": "apache",
			"extensions": ["stc"]
		},
		"application/vnd.sun.xml.draw": {
			"source": "apache",
			"extensions": ["sxd"]
		},
		"application/vnd.sun.xml.draw.template": {
			"source": "apache",
			"extensions": ["std"]
		},
		"application/vnd.sun.xml.impress": {
			"source": "apache",
			"extensions": ["sxi"]
		},
		"application/vnd.sun.xml.impress.template": {
			"source": "apache",
			"extensions": ["sti"]
		},
		"application/vnd.sun.xml.math": {
			"source": "apache",
			"extensions": ["sxm"]
		},
		"application/vnd.sun.xml.writer": {
			"source": "apache",
			"extensions": ["sxw"]
		},
		"application/vnd.sun.xml.writer.global": {
			"source": "apache",
			"extensions": ["sxg"]
		},
		"application/vnd.sun.xml.writer.template": {
			"source": "apache",
			"extensions": ["stw"]
		},
		"application/vnd.sus-calendar": {
			"source": "iana",
			"extensions": ["sus", "susp"]
		},
		"application/vnd.svd": {
			"source": "iana",
			"extensions": ["svd"]
		},
		"application/vnd.swiftview-ics": { "source": "iana" },
		"application/vnd.sycle+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.syft+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.symbian.install": {
			"source": "apache",
			"extensions": ["sis", "sisx"]
		},
		"application/vnd.syncml+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["xsm"]
		},
		"application/vnd.syncml.dm+wbxml": {
			"source": "iana",
			"charset": "UTF-8",
			"extensions": ["bdm"]
		},
		"application/vnd.syncml.dm+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["xdm"]
		},
		"application/vnd.syncml.dm.notification": { "source": "iana" },
		"application/vnd.syncml.dmddf+wbxml": { "source": "iana" },
		"application/vnd.syncml.dmddf+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["ddf"]
		},
		"application/vnd.syncml.dmtnds+wbxml": { "source": "iana" },
		"application/vnd.syncml.dmtnds+xml": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true
		},
		"application/vnd.syncml.ds.notification": { "source": "iana" },
		"application/vnd.tableschema+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.tao.intent-module-archive": {
			"source": "iana",
			"extensions": ["tao"]
		},
		"application/vnd.tcpdump.pcap": {
			"source": "iana",
			"extensions": [
				"pcap",
				"cap",
				"dmp"
			]
		},
		"application/vnd.think-cell.ppttc+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.tmd.mediaflex.api+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.tml": { "source": "iana" },
		"application/vnd.tmobile-livetv": {
			"source": "iana",
			"extensions": ["tmo"]
		},
		"application/vnd.tri.onesource": { "source": "iana" },
		"application/vnd.trid.tpt": {
			"source": "iana",
			"extensions": ["tpt"]
		},
		"application/vnd.triscape.mxs": {
			"source": "iana",
			"extensions": ["mxs"]
		},
		"application/vnd.trueapp": {
			"source": "iana",
			"extensions": ["tra"]
		},
		"application/vnd.truedoc": { "source": "iana" },
		"application/vnd.ubisoft.webplayer": { "source": "iana" },
		"application/vnd.ufdl": {
			"source": "iana",
			"extensions": ["ufd", "ufdl"]
		},
		"application/vnd.uiq.theme": {
			"source": "iana",
			"extensions": ["utz"]
		},
		"application/vnd.umajin": {
			"source": "iana",
			"extensions": ["umj"]
		},
		"application/vnd.unity": {
			"source": "iana",
			"extensions": ["unityweb"]
		},
		"application/vnd.uoml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["uoml"]
		},
		"application/vnd.uplanet.alert": { "source": "iana" },
		"application/vnd.uplanet.alert-wbxml": { "source": "iana" },
		"application/vnd.uplanet.bearer-choice": { "source": "iana" },
		"application/vnd.uplanet.bearer-choice-wbxml": { "source": "iana" },
		"application/vnd.uplanet.cacheop": { "source": "iana" },
		"application/vnd.uplanet.cacheop-wbxml": { "source": "iana" },
		"application/vnd.uplanet.channel": { "source": "iana" },
		"application/vnd.uplanet.channel-wbxml": { "source": "iana" },
		"application/vnd.uplanet.list": { "source": "iana" },
		"application/vnd.uplanet.list-wbxml": { "source": "iana" },
		"application/vnd.uplanet.listcmd": { "source": "iana" },
		"application/vnd.uplanet.listcmd-wbxml": { "source": "iana" },
		"application/vnd.uplanet.signal": { "source": "iana" },
		"application/vnd.uri-map": { "source": "iana" },
		"application/vnd.valve.source.material": { "source": "iana" },
		"application/vnd.vcx": {
			"source": "iana",
			"extensions": ["vcx"]
		},
		"application/vnd.vd-study": { "source": "iana" },
		"application/vnd.vectorworks": { "source": "iana" },
		"application/vnd.vel+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.verimatrix.vcas": { "source": "iana" },
		"application/vnd.veritone.aion+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.veryant.thin": { "source": "iana" },
		"application/vnd.ves.encrypted": { "source": "iana" },
		"application/vnd.vidsoft.vidconference": { "source": "iana" },
		"application/vnd.visio": {
			"source": "iana",
			"extensions": [
				"vsd",
				"vst",
				"vss",
				"vsw"
			]
		},
		"application/vnd.visionary": {
			"source": "iana",
			"extensions": ["vis"]
		},
		"application/vnd.vividence.scriptfile": { "source": "iana" },
		"application/vnd.vsf": {
			"source": "iana",
			"extensions": ["vsf"]
		},
		"application/vnd.wap.sic": { "source": "iana" },
		"application/vnd.wap.slc": { "source": "iana" },
		"application/vnd.wap.wbxml": {
			"source": "iana",
			"charset": "UTF-8",
			"extensions": ["wbxml"]
		},
		"application/vnd.wap.wmlc": {
			"source": "iana",
			"extensions": ["wmlc"]
		},
		"application/vnd.wap.wmlscriptc": {
			"source": "iana",
			"extensions": ["wmlsc"]
		},
		"application/vnd.webturbo": {
			"source": "iana",
			"extensions": ["wtb"]
		},
		"application/vnd.wfa.dpp": { "source": "iana" },
		"application/vnd.wfa.p2p": { "source": "iana" },
		"application/vnd.wfa.wsc": { "source": "iana" },
		"application/vnd.windows.devicepairing": { "source": "iana" },
		"application/vnd.wmc": { "source": "iana" },
		"application/vnd.wmf.bootstrap": { "source": "iana" },
		"application/vnd.wolfram.mathematica": { "source": "iana" },
		"application/vnd.wolfram.mathematica.package": { "source": "iana" },
		"application/vnd.wolfram.player": {
			"source": "iana",
			"extensions": ["nbp"]
		},
		"application/vnd.wordperfect": {
			"source": "iana",
			"extensions": ["wpd"]
		},
		"application/vnd.wqd": {
			"source": "iana",
			"extensions": ["wqd"]
		},
		"application/vnd.wrq-hp3000-labelled": { "source": "iana" },
		"application/vnd.wt.stf": {
			"source": "iana",
			"extensions": ["stf"]
		},
		"application/vnd.wv.csp+wbxml": { "source": "iana" },
		"application/vnd.wv.csp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.wv.ssp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.xacml+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.xara": {
			"source": "iana",
			"extensions": ["xar"]
		},
		"application/vnd.xfdl": {
			"source": "iana",
			"extensions": ["xfdl"]
		},
		"application/vnd.xfdl.webform": { "source": "iana" },
		"application/vnd.xmi+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/vnd.xmpie.cpkg": { "source": "iana" },
		"application/vnd.xmpie.dpkg": { "source": "iana" },
		"application/vnd.xmpie.plan": { "source": "iana" },
		"application/vnd.xmpie.ppkg": { "source": "iana" },
		"application/vnd.xmpie.xlim": { "source": "iana" },
		"application/vnd.yamaha.hv-dic": {
			"source": "iana",
			"extensions": ["hvd"]
		},
		"application/vnd.yamaha.hv-script": {
			"source": "iana",
			"extensions": ["hvs"]
		},
		"application/vnd.yamaha.hv-voice": {
			"source": "iana",
			"extensions": ["hvp"]
		},
		"application/vnd.yamaha.openscoreformat": {
			"source": "iana",
			"extensions": ["osf"]
		},
		"application/vnd.yamaha.openscoreformat.osfpvg+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["osfpvg"]
		},
		"application/vnd.yamaha.remote-setup": { "source": "iana" },
		"application/vnd.yamaha.smaf-audio": {
			"source": "iana",
			"extensions": ["saf"]
		},
		"application/vnd.yamaha.smaf-phrase": {
			"source": "iana",
			"extensions": ["spf"]
		},
		"application/vnd.yamaha.through-ngn": { "source": "iana" },
		"application/vnd.yamaha.tunnel-udpencap": { "source": "iana" },
		"application/vnd.yaoweme": { "source": "iana" },
		"application/vnd.yellowriver-custom-menu": {
			"source": "iana",
			"extensions": ["cmp"]
		},
		"application/vnd.youtube.yt": { "source": "iana" },
		"application/vnd.zul": {
			"source": "iana",
			"extensions": ["zir", "zirz"]
		},
		"application/vnd.zzazz.deck+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["zaz"]
		},
		"application/voicexml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["vxml"]
		},
		"application/voucher-cms+json": {
			"source": "iana",
			"compressible": true
		},
		"application/vq-rtcpxr": { "source": "iana" },
		"application/wasm": {
			"source": "iana",
			"compressible": true,
			"extensions": ["wasm"]
		},
		"application/watcherinfo+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["wif"]
		},
		"application/webpush-options+json": {
			"source": "iana",
			"compressible": true
		},
		"application/whoispp-query": { "source": "iana" },
		"application/whoispp-response": { "source": "iana" },
		"application/widget": {
			"source": "iana",
			"extensions": ["wgt"]
		},
		"application/winhlp": {
			"source": "apache",
			"extensions": ["hlp"]
		},
		"application/wita": { "source": "iana" },
		"application/wordperfect5.1": { "source": "iana" },
		"application/wsdl+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["wsdl"]
		},
		"application/wspolicy+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["wspolicy"]
		},
		"application/x-7z-compressed": {
			"source": "apache",
			"compressible": false,
			"extensions": ["7z"]
		},
		"application/x-abiword": {
			"source": "apache",
			"extensions": ["abw"]
		},
		"application/x-ace-compressed": {
			"source": "apache",
			"extensions": ["ace"]
		},
		"application/x-amf": { "source": "apache" },
		"application/x-apple-diskimage": {
			"source": "apache",
			"extensions": ["dmg"]
		},
		"application/x-arj": {
			"compressible": false,
			"extensions": ["arj"]
		},
		"application/x-authorware-bin": {
			"source": "apache",
			"extensions": [
				"aab",
				"x32",
				"u32",
				"vox"
			]
		},
		"application/x-authorware-map": {
			"source": "apache",
			"extensions": ["aam"]
		},
		"application/x-authorware-seg": {
			"source": "apache",
			"extensions": ["aas"]
		},
		"application/x-bcpio": {
			"source": "apache",
			"extensions": ["bcpio"]
		},
		"application/x-bdoc": {
			"compressible": false,
			"extensions": ["bdoc"]
		},
		"application/x-bittorrent": {
			"source": "apache",
			"extensions": ["torrent"]
		},
		"application/x-blorb": {
			"source": "apache",
			"extensions": ["blb", "blorb"]
		},
		"application/x-bzip": {
			"source": "apache",
			"compressible": false,
			"extensions": ["bz"]
		},
		"application/x-bzip2": {
			"source": "apache",
			"compressible": false,
			"extensions": ["bz2", "boz"]
		},
		"application/x-cbr": {
			"source": "apache",
			"extensions": [
				"cbr",
				"cba",
				"cbt",
				"cbz",
				"cb7"
			]
		},
		"application/x-cdlink": {
			"source": "apache",
			"extensions": ["vcd"]
		},
		"application/x-cfs-compressed": {
			"source": "apache",
			"extensions": ["cfs"]
		},
		"application/x-chat": {
			"source": "apache",
			"extensions": ["chat"]
		},
		"application/x-chess-pgn": {
			"source": "apache",
			"extensions": ["pgn"]
		},
		"application/x-chrome-extension": { "extensions": ["crx"] },
		"application/x-cocoa": {
			"source": "nginx",
			"extensions": ["cco"]
		},
		"application/x-compress": { "source": "apache" },
		"application/x-conference": {
			"source": "apache",
			"extensions": ["nsc"]
		},
		"application/x-cpio": {
			"source": "apache",
			"extensions": ["cpio"]
		},
		"application/x-csh": {
			"source": "apache",
			"extensions": ["csh"]
		},
		"application/x-deb": { "compressible": false },
		"application/x-debian-package": {
			"source": "apache",
			"extensions": ["deb", "udeb"]
		},
		"application/x-dgc-compressed": {
			"source": "apache",
			"extensions": ["dgc"]
		},
		"application/x-director": {
			"source": "apache",
			"extensions": [
				"dir",
				"dcr",
				"dxr",
				"cst",
				"cct",
				"cxt",
				"w3d",
				"fgd",
				"swa"
			]
		},
		"application/x-doom": {
			"source": "apache",
			"extensions": ["wad"]
		},
		"application/x-dtbncx+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["ncx"]
		},
		"application/x-dtbook+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["dtb"]
		},
		"application/x-dtbresource+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["res"]
		},
		"application/x-dvi": {
			"source": "apache",
			"compressible": false,
			"extensions": ["dvi"]
		},
		"application/x-envoy": {
			"source": "apache",
			"extensions": ["evy"]
		},
		"application/x-eva": {
			"source": "apache",
			"extensions": ["eva"]
		},
		"application/x-font-bdf": {
			"source": "apache",
			"extensions": ["bdf"]
		},
		"application/x-font-dos": { "source": "apache" },
		"application/x-font-framemaker": { "source": "apache" },
		"application/x-font-ghostscript": {
			"source": "apache",
			"extensions": ["gsf"]
		},
		"application/x-font-libgrx": { "source": "apache" },
		"application/x-font-linux-psf": {
			"source": "apache",
			"extensions": ["psf"]
		},
		"application/x-font-pcf": {
			"source": "apache",
			"extensions": ["pcf"]
		},
		"application/x-font-snf": {
			"source": "apache",
			"extensions": ["snf"]
		},
		"application/x-font-speedo": { "source": "apache" },
		"application/x-font-sunos-news": { "source": "apache" },
		"application/x-font-type1": {
			"source": "apache",
			"extensions": [
				"pfa",
				"pfb",
				"pfm",
				"afm"
			]
		},
		"application/x-font-vfont": { "source": "apache" },
		"application/x-freearc": {
			"source": "apache",
			"extensions": ["arc"]
		},
		"application/x-futuresplash": {
			"source": "apache",
			"extensions": ["spl"]
		},
		"application/x-gca-compressed": {
			"source": "apache",
			"extensions": ["gca"]
		},
		"application/x-glulx": {
			"source": "apache",
			"extensions": ["ulx"]
		},
		"application/x-gnumeric": {
			"source": "apache",
			"extensions": ["gnumeric"]
		},
		"application/x-gramps-xml": {
			"source": "apache",
			"extensions": ["gramps"]
		},
		"application/x-gtar": {
			"source": "apache",
			"extensions": ["gtar"]
		},
		"application/x-gzip": { "source": "apache" },
		"application/x-hdf": {
			"source": "apache",
			"extensions": ["hdf"]
		},
		"application/x-httpd-php": {
			"compressible": true,
			"extensions": ["php"]
		},
		"application/x-install-instructions": {
			"source": "apache",
			"extensions": ["install"]
		},
		"application/x-iso9660-image": {
			"source": "apache",
			"extensions": ["iso"]
		},
		"application/x-iwork-keynote-sffkey": { "extensions": ["key"] },
		"application/x-iwork-numbers-sffnumbers": { "extensions": ["numbers"] },
		"application/x-iwork-pages-sffpages": { "extensions": ["pages"] },
		"application/x-java-archive-diff": {
			"source": "nginx",
			"extensions": ["jardiff"]
		},
		"application/x-java-jnlp-file": {
			"source": "apache",
			"compressible": false,
			"extensions": ["jnlp"]
		},
		"application/x-javascript": { "compressible": true },
		"application/x-keepass2": { "extensions": ["kdbx"] },
		"application/x-latex": {
			"source": "apache",
			"compressible": false,
			"extensions": ["latex"]
		},
		"application/x-lua-bytecode": { "extensions": ["luac"] },
		"application/x-lzh-compressed": {
			"source": "apache",
			"extensions": ["lzh", "lha"]
		},
		"application/x-makeself": {
			"source": "nginx",
			"extensions": ["run"]
		},
		"application/x-mie": {
			"source": "apache",
			"extensions": ["mie"]
		},
		"application/x-mobipocket-ebook": {
			"source": "apache",
			"extensions": ["prc", "mobi"]
		},
		"application/x-mpegurl": { "compressible": false },
		"application/x-ms-application": {
			"source": "apache",
			"extensions": ["application"]
		},
		"application/x-ms-shortcut": {
			"source": "apache",
			"extensions": ["lnk"]
		},
		"application/x-ms-wmd": {
			"source": "apache",
			"extensions": ["wmd"]
		},
		"application/x-ms-wmz": {
			"source": "apache",
			"extensions": ["wmz"]
		},
		"application/x-ms-xbap": {
			"source": "apache",
			"extensions": ["xbap"]
		},
		"application/x-msaccess": {
			"source": "apache",
			"extensions": ["mdb"]
		},
		"application/x-msbinder": {
			"source": "apache",
			"extensions": ["obd"]
		},
		"application/x-mscardfile": {
			"source": "apache",
			"extensions": ["crd"]
		},
		"application/x-msclip": {
			"source": "apache",
			"extensions": ["clp"]
		},
		"application/x-msdos-program": { "extensions": ["exe"] },
		"application/x-msdownload": {
			"source": "apache",
			"extensions": [
				"exe",
				"dll",
				"com",
				"bat",
				"msi"
			]
		},
		"application/x-msmediaview": {
			"source": "apache",
			"extensions": [
				"mvb",
				"m13",
				"m14"
			]
		},
		"application/x-msmetafile": {
			"source": "apache",
			"extensions": [
				"wmf",
				"wmz",
				"emf",
				"emz"
			]
		},
		"application/x-msmoney": {
			"source": "apache",
			"extensions": ["mny"]
		},
		"application/x-mspublisher": {
			"source": "apache",
			"extensions": ["pub"]
		},
		"application/x-msschedule": {
			"source": "apache",
			"extensions": ["scd"]
		},
		"application/x-msterminal": {
			"source": "apache",
			"extensions": ["trm"]
		},
		"application/x-mswrite": {
			"source": "apache",
			"extensions": ["wri"]
		},
		"application/x-netcdf": {
			"source": "apache",
			"extensions": ["nc", "cdf"]
		},
		"application/x-ns-proxy-autoconfig": {
			"compressible": true,
			"extensions": ["pac"]
		},
		"application/x-nzb": {
			"source": "apache",
			"extensions": ["nzb"]
		},
		"application/x-perl": {
			"source": "nginx",
			"extensions": ["pl", "pm"]
		},
		"application/x-pilot": {
			"source": "nginx",
			"extensions": ["prc", "pdb"]
		},
		"application/x-pkcs12": {
			"source": "apache",
			"compressible": false,
			"extensions": ["p12", "pfx"]
		},
		"application/x-pkcs7-certificates": {
			"source": "apache",
			"extensions": ["p7b", "spc"]
		},
		"application/x-pkcs7-certreqresp": {
			"source": "apache",
			"extensions": ["p7r"]
		},
		"application/x-pki-message": { "source": "iana" },
		"application/x-rar-compressed": {
			"source": "apache",
			"compressible": false,
			"extensions": ["rar"]
		},
		"application/x-redhat-package-manager": {
			"source": "nginx",
			"extensions": ["rpm"]
		},
		"application/x-research-info-systems": {
			"source": "apache",
			"extensions": ["ris"]
		},
		"application/x-sea": {
			"source": "nginx",
			"extensions": ["sea"]
		},
		"application/x-sh": {
			"source": "apache",
			"compressible": true,
			"extensions": ["sh"]
		},
		"application/x-shar": {
			"source": "apache",
			"extensions": ["shar"]
		},
		"application/x-shockwave-flash": {
			"source": "apache",
			"compressible": false,
			"extensions": ["swf"]
		},
		"application/x-silverlight-app": {
			"source": "apache",
			"extensions": ["xap"]
		},
		"application/x-sql": {
			"source": "apache",
			"extensions": ["sql"]
		},
		"application/x-stuffit": {
			"source": "apache",
			"compressible": false,
			"extensions": ["sit"]
		},
		"application/x-stuffitx": {
			"source": "apache",
			"extensions": ["sitx"]
		},
		"application/x-subrip": {
			"source": "apache",
			"extensions": ["srt"]
		},
		"application/x-sv4cpio": {
			"source": "apache",
			"extensions": ["sv4cpio"]
		},
		"application/x-sv4crc": {
			"source": "apache",
			"extensions": ["sv4crc"]
		},
		"application/x-t3vm-image": {
			"source": "apache",
			"extensions": ["t3"]
		},
		"application/x-tads": {
			"source": "apache",
			"extensions": ["gam"]
		},
		"application/x-tar": {
			"source": "apache",
			"compressible": true,
			"extensions": ["tar"]
		},
		"application/x-tcl": {
			"source": "apache",
			"extensions": ["tcl", "tk"]
		},
		"application/x-tex": {
			"source": "apache",
			"extensions": ["tex"]
		},
		"application/x-tex-tfm": {
			"source": "apache",
			"extensions": ["tfm"]
		},
		"application/x-texinfo": {
			"source": "apache",
			"extensions": ["texinfo", "texi"]
		},
		"application/x-tgif": {
			"source": "apache",
			"extensions": ["obj"]
		},
		"application/x-ustar": {
			"source": "apache",
			"extensions": ["ustar"]
		},
		"application/x-virtualbox-hdd": {
			"compressible": true,
			"extensions": ["hdd"]
		},
		"application/x-virtualbox-ova": {
			"compressible": true,
			"extensions": ["ova"]
		},
		"application/x-virtualbox-ovf": {
			"compressible": true,
			"extensions": ["ovf"]
		},
		"application/x-virtualbox-vbox": {
			"compressible": true,
			"extensions": ["vbox"]
		},
		"application/x-virtualbox-vbox-extpack": {
			"compressible": false,
			"extensions": ["vbox-extpack"]
		},
		"application/x-virtualbox-vdi": {
			"compressible": true,
			"extensions": ["vdi"]
		},
		"application/x-virtualbox-vhd": {
			"compressible": true,
			"extensions": ["vhd"]
		},
		"application/x-virtualbox-vmdk": {
			"compressible": true,
			"extensions": ["vmdk"]
		},
		"application/x-wais-source": {
			"source": "apache",
			"extensions": ["src"]
		},
		"application/x-web-app-manifest+json": {
			"compressible": true,
			"extensions": ["webapp"]
		},
		"application/x-www-form-urlencoded": {
			"source": "iana",
			"compressible": true
		},
		"application/x-x509-ca-cert": {
			"source": "iana",
			"extensions": [
				"der",
				"crt",
				"pem"
			]
		},
		"application/x-x509-ca-ra-cert": { "source": "iana" },
		"application/x-x509-next-ca-cert": { "source": "iana" },
		"application/x-xfig": {
			"source": "apache",
			"extensions": ["fig"]
		},
		"application/x-xliff+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["xlf"]
		},
		"application/x-xpinstall": {
			"source": "apache",
			"compressible": false,
			"extensions": ["xpi"]
		},
		"application/x-xz": {
			"source": "apache",
			"extensions": ["xz"]
		},
		"application/x-zmachine": {
			"source": "apache",
			"extensions": [
				"z1",
				"z2",
				"z3",
				"z4",
				"z5",
				"z6",
				"z7",
				"z8"
			]
		},
		"application/x400-bp": { "source": "iana" },
		"application/xacml+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/xaml+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["xaml"]
		},
		"application/xcap-att+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xav"]
		},
		"application/xcap-caps+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xca"]
		},
		"application/xcap-diff+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xdf"]
		},
		"application/xcap-el+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xel"]
		},
		"application/xcap-error+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/xcap-ns+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xns"]
		},
		"application/xcon-conference-info+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/xcon-conference-info-diff+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/xenc+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xenc"]
		},
		"application/xhtml+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xhtml", "xht"]
		},
		"application/xhtml-voice+xml": {
			"source": "apache",
			"compressible": true
		},
		"application/xliff+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xlf"]
		},
		"application/xml": {
			"source": "iana",
			"compressible": true,
			"extensions": [
				"xml",
				"xsl",
				"xsd",
				"rng"
			]
		},
		"application/xml-dtd": {
			"source": "iana",
			"compressible": true,
			"extensions": ["dtd"]
		},
		"application/xml-external-parsed-entity": { "source": "iana" },
		"application/xml-patch+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/xmpp+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/xop+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xop"]
		},
		"application/xproc+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["xpl"]
		},
		"application/xslt+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xsl", "xslt"]
		},
		"application/xspf+xml": {
			"source": "apache",
			"compressible": true,
			"extensions": ["xspf"]
		},
		"application/xv+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": [
				"mxml",
				"xhvml",
				"xvml",
				"xvm"
			]
		},
		"application/yang": {
			"source": "iana",
			"extensions": ["yang"]
		},
		"application/yang-data+json": {
			"source": "iana",
			"compressible": true
		},
		"application/yang-data+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/yang-patch+json": {
			"source": "iana",
			"compressible": true
		},
		"application/yang-patch+xml": {
			"source": "iana",
			"compressible": true
		},
		"application/yin+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["yin"]
		},
		"application/zip": {
			"source": "iana",
			"compressible": false,
			"extensions": ["zip"]
		},
		"application/zlib": { "source": "iana" },
		"application/zstd": { "source": "iana" },
		"audio/1d-interleaved-parityfec": { "source": "iana" },
		"audio/32kadpcm": { "source": "iana" },
		"audio/3gpp": {
			"source": "iana",
			"compressible": false,
			"extensions": ["3gpp"]
		},
		"audio/3gpp2": { "source": "iana" },
		"audio/aac": { "source": "iana" },
		"audio/ac3": { "source": "iana" },
		"audio/adpcm": {
			"source": "apache",
			"extensions": ["adp"]
		},
		"audio/amr": {
			"source": "iana",
			"extensions": ["amr"]
		},
		"audio/amr-wb": { "source": "iana" },
		"audio/amr-wb+": { "source": "iana" },
		"audio/aptx": { "source": "iana" },
		"audio/asc": { "source": "iana" },
		"audio/atrac-advanced-lossless": { "source": "iana" },
		"audio/atrac-x": { "source": "iana" },
		"audio/atrac3": { "source": "iana" },
		"audio/basic": {
			"source": "iana",
			"compressible": false,
			"extensions": ["au", "snd"]
		},
		"audio/bv16": { "source": "iana" },
		"audio/bv32": { "source": "iana" },
		"audio/clearmode": { "source": "iana" },
		"audio/cn": { "source": "iana" },
		"audio/dat12": { "source": "iana" },
		"audio/dls": { "source": "iana" },
		"audio/dsr-es201108": { "source": "iana" },
		"audio/dsr-es202050": { "source": "iana" },
		"audio/dsr-es202211": { "source": "iana" },
		"audio/dsr-es202212": { "source": "iana" },
		"audio/dv": { "source": "iana" },
		"audio/dvi4": { "source": "iana" },
		"audio/eac3": { "source": "iana" },
		"audio/encaprtp": { "source": "iana" },
		"audio/evrc": { "source": "iana" },
		"audio/evrc-qcp": { "source": "iana" },
		"audio/evrc0": { "source": "iana" },
		"audio/evrc1": { "source": "iana" },
		"audio/evrcb": { "source": "iana" },
		"audio/evrcb0": { "source": "iana" },
		"audio/evrcb1": { "source": "iana" },
		"audio/evrcnw": { "source": "iana" },
		"audio/evrcnw0": { "source": "iana" },
		"audio/evrcnw1": { "source": "iana" },
		"audio/evrcwb": { "source": "iana" },
		"audio/evrcwb0": { "source": "iana" },
		"audio/evrcwb1": { "source": "iana" },
		"audio/evs": { "source": "iana" },
		"audio/flexfec": { "source": "iana" },
		"audio/fwdred": { "source": "iana" },
		"audio/g711-0": { "source": "iana" },
		"audio/g719": { "source": "iana" },
		"audio/g722": { "source": "iana" },
		"audio/g7221": { "source": "iana" },
		"audio/g723": { "source": "iana" },
		"audio/g726-16": { "source": "iana" },
		"audio/g726-24": { "source": "iana" },
		"audio/g726-32": { "source": "iana" },
		"audio/g726-40": { "source": "iana" },
		"audio/g728": { "source": "iana" },
		"audio/g729": { "source": "iana" },
		"audio/g7291": { "source": "iana" },
		"audio/g729d": { "source": "iana" },
		"audio/g729e": { "source": "iana" },
		"audio/gsm": { "source": "iana" },
		"audio/gsm-efr": { "source": "iana" },
		"audio/gsm-hr-08": { "source": "iana" },
		"audio/ilbc": { "source": "iana" },
		"audio/ip-mr_v2.5": { "source": "iana" },
		"audio/isac": { "source": "apache" },
		"audio/l16": { "source": "iana" },
		"audio/l20": { "source": "iana" },
		"audio/l24": {
			"source": "iana",
			"compressible": false
		},
		"audio/l8": { "source": "iana" },
		"audio/lpc": { "source": "iana" },
		"audio/melp": { "source": "iana" },
		"audio/melp1200": { "source": "iana" },
		"audio/melp2400": { "source": "iana" },
		"audio/melp600": { "source": "iana" },
		"audio/mhas": { "source": "iana" },
		"audio/midi": {
			"source": "apache",
			"extensions": [
				"mid",
				"midi",
				"kar",
				"rmi"
			]
		},
		"audio/mobile-xmf": {
			"source": "iana",
			"extensions": ["mxmf"]
		},
		"audio/mp3": {
			"compressible": false,
			"extensions": ["mp3"]
		},
		"audio/mp4": {
			"source": "iana",
			"compressible": false,
			"extensions": ["m4a", "mp4a"]
		},
		"audio/mp4a-latm": { "source": "iana" },
		"audio/mpa": { "source": "iana" },
		"audio/mpa-robust": { "source": "iana" },
		"audio/mpeg": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"mpga",
				"mp2",
				"mp2a",
				"mp3",
				"m2a",
				"m3a"
			]
		},
		"audio/mpeg4-generic": { "source": "iana" },
		"audio/musepack": { "source": "apache" },
		"audio/ogg": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"oga",
				"ogg",
				"spx",
				"opus"
			]
		},
		"audio/opus": { "source": "iana" },
		"audio/parityfec": { "source": "iana" },
		"audio/pcma": { "source": "iana" },
		"audio/pcma-wb": { "source": "iana" },
		"audio/pcmu": { "source": "iana" },
		"audio/pcmu-wb": { "source": "iana" },
		"audio/prs.sid": { "source": "iana" },
		"audio/qcelp": { "source": "iana" },
		"audio/raptorfec": { "source": "iana" },
		"audio/red": { "source": "iana" },
		"audio/rtp-enc-aescm128": { "source": "iana" },
		"audio/rtp-midi": { "source": "iana" },
		"audio/rtploopback": { "source": "iana" },
		"audio/rtx": { "source": "iana" },
		"audio/s3m": {
			"source": "apache",
			"extensions": ["s3m"]
		},
		"audio/scip": { "source": "iana" },
		"audio/silk": {
			"source": "apache",
			"extensions": ["sil"]
		},
		"audio/smv": { "source": "iana" },
		"audio/smv-qcp": { "source": "iana" },
		"audio/smv0": { "source": "iana" },
		"audio/sofa": { "source": "iana" },
		"audio/sp-midi": { "source": "iana" },
		"audio/speex": { "source": "iana" },
		"audio/t140c": { "source": "iana" },
		"audio/t38": { "source": "iana" },
		"audio/telephone-event": { "source": "iana" },
		"audio/tetra_acelp": { "source": "iana" },
		"audio/tetra_acelp_bb": { "source": "iana" },
		"audio/tone": { "source": "iana" },
		"audio/tsvcis": { "source": "iana" },
		"audio/uemclip": { "source": "iana" },
		"audio/ulpfec": { "source": "iana" },
		"audio/usac": { "source": "iana" },
		"audio/vdvi": { "source": "iana" },
		"audio/vmr-wb": { "source": "iana" },
		"audio/vnd.3gpp.iufp": { "source": "iana" },
		"audio/vnd.4sb": { "source": "iana" },
		"audio/vnd.audiokoz": { "source": "iana" },
		"audio/vnd.celp": { "source": "iana" },
		"audio/vnd.cisco.nse": { "source": "iana" },
		"audio/vnd.cmles.radio-events": { "source": "iana" },
		"audio/vnd.cns.anp1": { "source": "iana" },
		"audio/vnd.cns.inf1": { "source": "iana" },
		"audio/vnd.dece.audio": {
			"source": "iana",
			"extensions": ["uva", "uvva"]
		},
		"audio/vnd.digital-winds": {
			"source": "iana",
			"extensions": ["eol"]
		},
		"audio/vnd.dlna.adts": { "source": "iana" },
		"audio/vnd.dolby.heaac.1": { "source": "iana" },
		"audio/vnd.dolby.heaac.2": { "source": "iana" },
		"audio/vnd.dolby.mlp": { "source": "iana" },
		"audio/vnd.dolby.mps": { "source": "iana" },
		"audio/vnd.dolby.pl2": { "source": "iana" },
		"audio/vnd.dolby.pl2x": { "source": "iana" },
		"audio/vnd.dolby.pl2z": { "source": "iana" },
		"audio/vnd.dolby.pulse.1": { "source": "iana" },
		"audio/vnd.dra": {
			"source": "iana",
			"extensions": ["dra"]
		},
		"audio/vnd.dts": {
			"source": "iana",
			"extensions": ["dts"]
		},
		"audio/vnd.dts.hd": {
			"source": "iana",
			"extensions": ["dtshd"]
		},
		"audio/vnd.dts.uhd": { "source": "iana" },
		"audio/vnd.dvb.file": { "source": "iana" },
		"audio/vnd.everad.plj": { "source": "iana" },
		"audio/vnd.hns.audio": { "source": "iana" },
		"audio/vnd.lucent.voice": {
			"source": "iana",
			"extensions": ["lvp"]
		},
		"audio/vnd.ms-playready.media.pya": {
			"source": "iana",
			"extensions": ["pya"]
		},
		"audio/vnd.nokia.mobile-xmf": { "source": "iana" },
		"audio/vnd.nortel.vbk": { "source": "iana" },
		"audio/vnd.nuera.ecelp4800": {
			"source": "iana",
			"extensions": ["ecelp4800"]
		},
		"audio/vnd.nuera.ecelp7470": {
			"source": "iana",
			"extensions": ["ecelp7470"]
		},
		"audio/vnd.nuera.ecelp9600": {
			"source": "iana",
			"extensions": ["ecelp9600"]
		},
		"audio/vnd.octel.sbc": { "source": "iana" },
		"audio/vnd.presonus.multitrack": { "source": "iana" },
		"audio/vnd.qcelp": { "source": "iana" },
		"audio/vnd.rhetorex.32kadpcm": { "source": "iana" },
		"audio/vnd.rip": {
			"source": "iana",
			"extensions": ["rip"]
		},
		"audio/vnd.rn-realaudio": { "compressible": false },
		"audio/vnd.sealedmedia.softseal.mpeg": { "source": "iana" },
		"audio/vnd.vmx.cvsd": { "source": "iana" },
		"audio/vnd.wave": { "compressible": false },
		"audio/vorbis": {
			"source": "iana",
			"compressible": false
		},
		"audio/vorbis-config": { "source": "iana" },
		"audio/wav": {
			"compressible": false,
			"extensions": ["wav"]
		},
		"audio/wave": {
			"compressible": false,
			"extensions": ["wav"]
		},
		"audio/webm": {
			"source": "apache",
			"compressible": false,
			"extensions": ["weba"]
		},
		"audio/x-aac": {
			"source": "apache",
			"compressible": false,
			"extensions": ["aac"]
		},
		"audio/x-aiff": {
			"source": "apache",
			"extensions": [
				"aif",
				"aiff",
				"aifc"
			]
		},
		"audio/x-caf": {
			"source": "apache",
			"compressible": false,
			"extensions": ["caf"]
		},
		"audio/x-flac": {
			"source": "apache",
			"extensions": ["flac"]
		},
		"audio/x-m4a": {
			"source": "nginx",
			"extensions": ["m4a"]
		},
		"audio/x-matroska": {
			"source": "apache",
			"extensions": ["mka"]
		},
		"audio/x-mpegurl": {
			"source": "apache",
			"extensions": ["m3u"]
		},
		"audio/x-ms-wax": {
			"source": "apache",
			"extensions": ["wax"]
		},
		"audio/x-ms-wma": {
			"source": "apache",
			"extensions": ["wma"]
		},
		"audio/x-pn-realaudio": {
			"source": "apache",
			"extensions": ["ram", "ra"]
		},
		"audio/x-pn-realaudio-plugin": {
			"source": "apache",
			"extensions": ["rmp"]
		},
		"audio/x-realaudio": {
			"source": "nginx",
			"extensions": ["ra"]
		},
		"audio/x-tta": { "source": "apache" },
		"audio/x-wav": {
			"source": "apache",
			"extensions": ["wav"]
		},
		"audio/xm": {
			"source": "apache",
			"extensions": ["xm"]
		},
		"chemical/x-cdx": {
			"source": "apache",
			"extensions": ["cdx"]
		},
		"chemical/x-cif": {
			"source": "apache",
			"extensions": ["cif"]
		},
		"chemical/x-cmdf": {
			"source": "apache",
			"extensions": ["cmdf"]
		},
		"chemical/x-cml": {
			"source": "apache",
			"extensions": ["cml"]
		},
		"chemical/x-csml": {
			"source": "apache",
			"extensions": ["csml"]
		},
		"chemical/x-pdb": { "source": "apache" },
		"chemical/x-xyz": {
			"source": "apache",
			"extensions": ["xyz"]
		},
		"font/collection": {
			"source": "iana",
			"extensions": ["ttc"]
		},
		"font/otf": {
			"source": "iana",
			"compressible": true,
			"extensions": ["otf"]
		},
		"font/sfnt": { "source": "iana" },
		"font/ttf": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ttf"]
		},
		"font/woff": {
			"source": "iana",
			"extensions": ["woff"]
		},
		"font/woff2": {
			"source": "iana",
			"extensions": ["woff2"]
		},
		"image/aces": {
			"source": "iana",
			"extensions": ["exr"]
		},
		"image/apng": {
			"compressible": false,
			"extensions": ["apng"]
		},
		"image/avci": {
			"source": "iana",
			"extensions": ["avci"]
		},
		"image/avcs": {
			"source": "iana",
			"extensions": ["avcs"]
		},
		"image/avif": {
			"source": "iana",
			"compressible": false,
			"extensions": ["avif"]
		},
		"image/bmp": {
			"source": "iana",
			"compressible": true,
			"extensions": ["bmp"]
		},
		"image/cgm": {
			"source": "iana",
			"extensions": ["cgm"]
		},
		"image/dicom-rle": {
			"source": "iana",
			"extensions": ["drle"]
		},
		"image/emf": {
			"source": "iana",
			"extensions": ["emf"]
		},
		"image/fits": {
			"source": "iana",
			"extensions": ["fits"]
		},
		"image/g3fax": {
			"source": "iana",
			"extensions": ["g3"]
		},
		"image/gif": {
			"source": "iana",
			"compressible": false,
			"extensions": ["gif"]
		},
		"image/heic": {
			"source": "iana",
			"extensions": ["heic"]
		},
		"image/heic-sequence": {
			"source": "iana",
			"extensions": ["heics"]
		},
		"image/heif": {
			"source": "iana",
			"extensions": ["heif"]
		},
		"image/heif-sequence": {
			"source": "iana",
			"extensions": ["heifs"]
		},
		"image/hej2k": {
			"source": "iana",
			"extensions": ["hej2"]
		},
		"image/hsj2": {
			"source": "iana",
			"extensions": ["hsj2"]
		},
		"image/ief": {
			"source": "iana",
			"extensions": ["ief"]
		},
		"image/jls": {
			"source": "iana",
			"extensions": ["jls"]
		},
		"image/jp2": {
			"source": "iana",
			"compressible": false,
			"extensions": ["jp2", "jpg2"]
		},
		"image/jpeg": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"jpeg",
				"jpg",
				"jpe"
			]
		},
		"image/jph": {
			"source": "iana",
			"extensions": ["jph"]
		},
		"image/jphc": {
			"source": "iana",
			"extensions": ["jhc"]
		},
		"image/jpm": {
			"source": "iana",
			"compressible": false,
			"extensions": ["jpm"]
		},
		"image/jpx": {
			"source": "iana",
			"compressible": false,
			"extensions": ["jpx", "jpf"]
		},
		"image/jxr": {
			"source": "iana",
			"extensions": ["jxr"]
		},
		"image/jxra": {
			"source": "iana",
			"extensions": ["jxra"]
		},
		"image/jxrs": {
			"source": "iana",
			"extensions": ["jxrs"]
		},
		"image/jxs": {
			"source": "iana",
			"extensions": ["jxs"]
		},
		"image/jxsc": {
			"source": "iana",
			"extensions": ["jxsc"]
		},
		"image/jxsi": {
			"source": "iana",
			"extensions": ["jxsi"]
		},
		"image/jxss": {
			"source": "iana",
			"extensions": ["jxss"]
		},
		"image/ktx": {
			"source": "iana",
			"extensions": ["ktx"]
		},
		"image/ktx2": {
			"source": "iana",
			"extensions": ["ktx2"]
		},
		"image/naplps": { "source": "iana" },
		"image/pjpeg": { "compressible": false },
		"image/png": {
			"source": "iana",
			"compressible": false,
			"extensions": ["png"]
		},
		"image/prs.btif": {
			"source": "iana",
			"extensions": ["btif"]
		},
		"image/prs.pti": {
			"source": "iana",
			"extensions": ["pti"]
		},
		"image/pwg-raster": { "source": "iana" },
		"image/sgi": {
			"source": "apache",
			"extensions": ["sgi"]
		},
		"image/svg+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["svg", "svgz"]
		},
		"image/t38": {
			"source": "iana",
			"extensions": ["t38"]
		},
		"image/tiff": {
			"source": "iana",
			"compressible": false,
			"extensions": ["tif", "tiff"]
		},
		"image/tiff-fx": {
			"source": "iana",
			"extensions": ["tfx"]
		},
		"image/vnd.adobe.photoshop": {
			"source": "iana",
			"compressible": true,
			"extensions": ["psd"]
		},
		"image/vnd.airzip.accelerator.azv": {
			"source": "iana",
			"extensions": ["azv"]
		},
		"image/vnd.cns.inf2": { "source": "iana" },
		"image/vnd.dece.graphic": {
			"source": "iana",
			"extensions": [
				"uvi",
				"uvvi",
				"uvg",
				"uvvg"
			]
		},
		"image/vnd.djvu": {
			"source": "iana",
			"extensions": ["djvu", "djv"]
		},
		"image/vnd.dvb.subtitle": {
			"source": "iana",
			"extensions": ["sub"]
		},
		"image/vnd.dwg": {
			"source": "iana",
			"extensions": ["dwg"]
		},
		"image/vnd.dxf": {
			"source": "iana",
			"extensions": ["dxf"]
		},
		"image/vnd.fastbidsheet": {
			"source": "iana",
			"extensions": ["fbs"]
		},
		"image/vnd.fpx": {
			"source": "iana",
			"extensions": ["fpx"]
		},
		"image/vnd.fst": {
			"source": "iana",
			"extensions": ["fst"]
		},
		"image/vnd.fujixerox.edmics-mmr": {
			"source": "iana",
			"extensions": ["mmr"]
		},
		"image/vnd.fujixerox.edmics-rlc": {
			"source": "iana",
			"extensions": ["rlc"]
		},
		"image/vnd.globalgraphics.pgb": { "source": "iana" },
		"image/vnd.microsoft.icon": {
			"source": "iana",
			"compressible": true,
			"extensions": ["ico"]
		},
		"image/vnd.mix": { "source": "iana" },
		"image/vnd.mozilla.apng": { "source": "iana" },
		"image/vnd.ms-dds": {
			"compressible": true,
			"extensions": ["dds"]
		},
		"image/vnd.ms-modi": {
			"source": "iana",
			"extensions": ["mdi"]
		},
		"image/vnd.ms-photo": {
			"source": "apache",
			"extensions": ["wdp"]
		},
		"image/vnd.net-fpx": {
			"source": "iana",
			"extensions": ["npx"]
		},
		"image/vnd.pco.b16": {
			"source": "iana",
			"extensions": ["b16"]
		},
		"image/vnd.radiance": { "source": "iana" },
		"image/vnd.sealed.png": { "source": "iana" },
		"image/vnd.sealedmedia.softseal.gif": { "source": "iana" },
		"image/vnd.sealedmedia.softseal.jpg": { "source": "iana" },
		"image/vnd.svf": { "source": "iana" },
		"image/vnd.tencent.tap": {
			"source": "iana",
			"extensions": ["tap"]
		},
		"image/vnd.valve.source.texture": {
			"source": "iana",
			"extensions": ["vtf"]
		},
		"image/vnd.wap.wbmp": {
			"source": "iana",
			"extensions": ["wbmp"]
		},
		"image/vnd.xiff": {
			"source": "iana",
			"extensions": ["xif"]
		},
		"image/vnd.zbrush.pcx": {
			"source": "iana",
			"extensions": ["pcx"]
		},
		"image/webp": {
			"source": "apache",
			"extensions": ["webp"]
		},
		"image/wmf": {
			"source": "iana",
			"extensions": ["wmf"]
		},
		"image/x-3ds": {
			"source": "apache",
			"extensions": ["3ds"]
		},
		"image/x-cmu-raster": {
			"source": "apache",
			"extensions": ["ras"]
		},
		"image/x-cmx": {
			"source": "apache",
			"extensions": ["cmx"]
		},
		"image/x-freehand": {
			"source": "apache",
			"extensions": [
				"fh",
				"fhc",
				"fh4",
				"fh5",
				"fh7"
			]
		},
		"image/x-icon": {
			"source": "apache",
			"compressible": true,
			"extensions": ["ico"]
		},
		"image/x-jng": {
			"source": "nginx",
			"extensions": ["jng"]
		},
		"image/x-mrsid-image": {
			"source": "apache",
			"extensions": ["sid"]
		},
		"image/x-ms-bmp": {
			"source": "nginx",
			"compressible": true,
			"extensions": ["bmp"]
		},
		"image/x-pcx": {
			"source": "apache",
			"extensions": ["pcx"]
		},
		"image/x-pict": {
			"source": "apache",
			"extensions": ["pic", "pct"]
		},
		"image/x-portable-anymap": {
			"source": "apache",
			"extensions": ["pnm"]
		},
		"image/x-portable-bitmap": {
			"source": "apache",
			"extensions": ["pbm"]
		},
		"image/x-portable-graymap": {
			"source": "apache",
			"extensions": ["pgm"]
		},
		"image/x-portable-pixmap": {
			"source": "apache",
			"extensions": ["ppm"]
		},
		"image/x-rgb": {
			"source": "apache",
			"extensions": ["rgb"]
		},
		"image/x-tga": {
			"source": "apache",
			"extensions": ["tga"]
		},
		"image/x-xbitmap": {
			"source": "apache",
			"extensions": ["xbm"]
		},
		"image/x-xcf": { "compressible": false },
		"image/x-xpixmap": {
			"source": "apache",
			"extensions": ["xpm"]
		},
		"image/x-xwindowdump": {
			"source": "apache",
			"extensions": ["xwd"]
		},
		"message/cpim": { "source": "iana" },
		"message/delivery-status": { "source": "iana" },
		"message/disposition-notification": {
			"source": "iana",
			"extensions": ["disposition-notification"]
		},
		"message/external-body": { "source": "iana" },
		"message/feedback-report": { "source": "iana" },
		"message/global": {
			"source": "iana",
			"extensions": ["u8msg"]
		},
		"message/global-delivery-status": {
			"source": "iana",
			"extensions": ["u8dsn"]
		},
		"message/global-disposition-notification": {
			"source": "iana",
			"extensions": ["u8mdn"]
		},
		"message/global-headers": {
			"source": "iana",
			"extensions": ["u8hdr"]
		},
		"message/http": {
			"source": "iana",
			"compressible": false
		},
		"message/imdn+xml": {
			"source": "iana",
			"compressible": true
		},
		"message/news": { "source": "iana" },
		"message/partial": {
			"source": "iana",
			"compressible": false
		},
		"message/rfc822": {
			"source": "iana",
			"compressible": true,
			"extensions": ["eml", "mime"]
		},
		"message/s-http": { "source": "iana" },
		"message/sip": { "source": "iana" },
		"message/sipfrag": { "source": "iana" },
		"message/tracking-status": { "source": "iana" },
		"message/vnd.si.simp": { "source": "iana" },
		"message/vnd.wfa.wsc": {
			"source": "iana",
			"extensions": ["wsc"]
		},
		"model/3mf": {
			"source": "iana",
			"extensions": ["3mf"]
		},
		"model/e57": { "source": "iana" },
		"model/gltf+json": {
			"source": "iana",
			"compressible": true,
			"extensions": ["gltf"]
		},
		"model/gltf-binary": {
			"source": "iana",
			"compressible": true,
			"extensions": ["glb"]
		},
		"model/iges": {
			"source": "iana",
			"compressible": false,
			"extensions": ["igs", "iges"]
		},
		"model/mesh": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"msh",
				"mesh",
				"silo"
			]
		},
		"model/mtl": {
			"source": "iana",
			"extensions": ["mtl"]
		},
		"model/obj": {
			"source": "iana",
			"extensions": ["obj"]
		},
		"model/step": { "source": "iana" },
		"model/step+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["stpx"]
		},
		"model/step+zip": {
			"source": "iana",
			"compressible": false,
			"extensions": ["stpz"]
		},
		"model/step-xml+zip": {
			"source": "iana",
			"compressible": false,
			"extensions": ["stpxz"]
		},
		"model/stl": {
			"source": "iana",
			"extensions": ["stl"]
		},
		"model/vnd.collada+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["dae"]
		},
		"model/vnd.dwf": {
			"source": "iana",
			"extensions": ["dwf"]
		},
		"model/vnd.flatland.3dml": { "source": "iana" },
		"model/vnd.gdl": {
			"source": "iana",
			"extensions": ["gdl"]
		},
		"model/vnd.gs-gdl": { "source": "apache" },
		"model/vnd.gs.gdl": { "source": "iana" },
		"model/vnd.gtw": {
			"source": "iana",
			"extensions": ["gtw"]
		},
		"model/vnd.moml+xml": {
			"source": "iana",
			"compressible": true
		},
		"model/vnd.mts": {
			"source": "iana",
			"extensions": ["mts"]
		},
		"model/vnd.opengex": {
			"source": "iana",
			"extensions": ["ogex"]
		},
		"model/vnd.parasolid.transmit.binary": {
			"source": "iana",
			"extensions": ["x_b"]
		},
		"model/vnd.parasolid.transmit.text": {
			"source": "iana",
			"extensions": ["x_t"]
		},
		"model/vnd.pytha.pyox": { "source": "iana" },
		"model/vnd.rosette.annotated-data-model": { "source": "iana" },
		"model/vnd.sap.vds": {
			"source": "iana",
			"extensions": ["vds"]
		},
		"model/vnd.usdz+zip": {
			"source": "iana",
			"compressible": false,
			"extensions": ["usdz"]
		},
		"model/vnd.valve.source.compiled-map": {
			"source": "iana",
			"extensions": ["bsp"]
		},
		"model/vnd.vtu": {
			"source": "iana",
			"extensions": ["vtu"]
		},
		"model/vrml": {
			"source": "iana",
			"compressible": false,
			"extensions": ["wrl", "vrml"]
		},
		"model/x3d+binary": {
			"source": "apache",
			"compressible": false,
			"extensions": ["x3db", "x3dbz"]
		},
		"model/x3d+fastinfoset": {
			"source": "iana",
			"extensions": ["x3db"]
		},
		"model/x3d+vrml": {
			"source": "apache",
			"compressible": false,
			"extensions": ["x3dv", "x3dvz"]
		},
		"model/x3d+xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["x3d", "x3dz"]
		},
		"model/x3d-vrml": {
			"source": "iana",
			"extensions": ["x3dv"]
		},
		"multipart/alternative": {
			"source": "iana",
			"compressible": false
		},
		"multipart/appledouble": { "source": "iana" },
		"multipart/byteranges": { "source": "iana" },
		"multipart/digest": { "source": "iana" },
		"multipart/encrypted": {
			"source": "iana",
			"compressible": false
		},
		"multipart/form-data": {
			"source": "iana",
			"compressible": false
		},
		"multipart/header-set": { "source": "iana" },
		"multipart/mixed": { "source": "iana" },
		"multipart/multilingual": { "source": "iana" },
		"multipart/parallel": { "source": "iana" },
		"multipart/related": {
			"source": "iana",
			"compressible": false
		},
		"multipart/report": { "source": "iana" },
		"multipart/signed": {
			"source": "iana",
			"compressible": false
		},
		"multipart/vnd.bint.med-plus": { "source": "iana" },
		"multipart/voice-message": { "source": "iana" },
		"multipart/x-mixed-replace": { "source": "iana" },
		"text/1d-interleaved-parityfec": { "source": "iana" },
		"text/cache-manifest": {
			"source": "iana",
			"compressible": true,
			"extensions": ["appcache", "manifest"]
		},
		"text/calendar": {
			"source": "iana",
			"extensions": ["ics", "ifb"]
		},
		"text/calender": { "compressible": true },
		"text/cmd": { "compressible": true },
		"text/coffeescript": { "extensions": ["coffee", "litcoffee"] },
		"text/cql": { "source": "iana" },
		"text/cql-expression": { "source": "iana" },
		"text/cql-identifier": { "source": "iana" },
		"text/css": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["css"]
		},
		"text/csv": {
			"source": "iana",
			"compressible": true,
			"extensions": ["csv"]
		},
		"text/csv-schema": { "source": "iana" },
		"text/directory": { "source": "iana" },
		"text/dns": { "source": "iana" },
		"text/ecmascript": { "source": "iana" },
		"text/encaprtp": { "source": "iana" },
		"text/enriched": { "source": "iana" },
		"text/fhirpath": { "source": "iana" },
		"text/flexfec": { "source": "iana" },
		"text/fwdred": { "source": "iana" },
		"text/gff3": { "source": "iana" },
		"text/grammar-ref-list": { "source": "iana" },
		"text/html": {
			"source": "iana",
			"compressible": true,
			"extensions": [
				"html",
				"htm",
				"shtml"
			]
		},
		"text/jade": { "extensions": ["jade"] },
		"text/javascript": {
			"source": "iana",
			"compressible": true
		},
		"text/jcr-cnd": { "source": "iana" },
		"text/jsx": {
			"compressible": true,
			"extensions": ["jsx"]
		},
		"text/less": {
			"compressible": true,
			"extensions": ["less"]
		},
		"text/markdown": {
			"source": "iana",
			"compressible": true,
			"extensions": ["markdown", "md"]
		},
		"text/mathml": {
			"source": "nginx",
			"extensions": ["mml"]
		},
		"text/mdx": {
			"compressible": true,
			"extensions": ["mdx"]
		},
		"text/mizar": { "source": "iana" },
		"text/n3": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["n3"]
		},
		"text/parameters": {
			"source": "iana",
			"charset": "UTF-8"
		},
		"text/parityfec": { "source": "iana" },
		"text/plain": {
			"source": "iana",
			"compressible": true,
			"extensions": [
				"txt",
				"text",
				"conf",
				"def",
				"list",
				"log",
				"in",
				"ini"
			]
		},
		"text/provenance-notation": {
			"source": "iana",
			"charset": "UTF-8"
		},
		"text/prs.fallenstein.rst": { "source": "iana" },
		"text/prs.lines.tag": {
			"source": "iana",
			"extensions": ["dsc"]
		},
		"text/prs.prop.logic": { "source": "iana" },
		"text/raptorfec": { "source": "iana" },
		"text/red": { "source": "iana" },
		"text/rfc822-headers": { "source": "iana" },
		"text/richtext": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rtx"]
		},
		"text/rtf": {
			"source": "iana",
			"compressible": true,
			"extensions": ["rtf"]
		},
		"text/rtp-enc-aescm128": { "source": "iana" },
		"text/rtploopback": { "source": "iana" },
		"text/rtx": { "source": "iana" },
		"text/sgml": {
			"source": "iana",
			"extensions": ["sgml", "sgm"]
		},
		"text/shaclc": { "source": "iana" },
		"text/shex": {
			"source": "iana",
			"extensions": ["shex"]
		},
		"text/slim": { "extensions": ["slim", "slm"] },
		"text/spdx": {
			"source": "iana",
			"extensions": ["spdx"]
		},
		"text/strings": { "source": "iana" },
		"text/stylus": { "extensions": ["stylus", "styl"] },
		"text/t140": { "source": "iana" },
		"text/tab-separated-values": {
			"source": "iana",
			"compressible": true,
			"extensions": ["tsv"]
		},
		"text/troff": {
			"source": "iana",
			"extensions": [
				"t",
				"tr",
				"roff",
				"man",
				"me",
				"ms"
			]
		},
		"text/turtle": {
			"source": "iana",
			"charset": "UTF-8",
			"extensions": ["ttl"]
		},
		"text/ulpfec": { "source": "iana" },
		"text/uri-list": {
			"source": "iana",
			"compressible": true,
			"extensions": [
				"uri",
				"uris",
				"urls"
			]
		},
		"text/vcard": {
			"source": "iana",
			"compressible": true,
			"extensions": ["vcard"]
		},
		"text/vnd.a": { "source": "iana" },
		"text/vnd.abc": { "source": "iana" },
		"text/vnd.ascii-art": { "source": "iana" },
		"text/vnd.curl": {
			"source": "iana",
			"extensions": ["curl"]
		},
		"text/vnd.curl.dcurl": {
			"source": "apache",
			"extensions": ["dcurl"]
		},
		"text/vnd.curl.mcurl": {
			"source": "apache",
			"extensions": ["mcurl"]
		},
		"text/vnd.curl.scurl": {
			"source": "apache",
			"extensions": ["scurl"]
		},
		"text/vnd.debian.copyright": {
			"source": "iana",
			"charset": "UTF-8"
		},
		"text/vnd.dmclientscript": { "source": "iana" },
		"text/vnd.dvb.subtitle": {
			"source": "iana",
			"extensions": ["sub"]
		},
		"text/vnd.esmertec.theme-descriptor": {
			"source": "iana",
			"charset": "UTF-8"
		},
		"text/vnd.familysearch.gedcom": {
			"source": "iana",
			"extensions": ["ged"]
		},
		"text/vnd.ficlab.flt": { "source": "iana" },
		"text/vnd.fly": {
			"source": "iana",
			"extensions": ["fly"]
		},
		"text/vnd.fmi.flexstor": {
			"source": "iana",
			"extensions": ["flx"]
		},
		"text/vnd.gml": { "source": "iana" },
		"text/vnd.graphviz": {
			"source": "iana",
			"extensions": ["gv"]
		},
		"text/vnd.hans": { "source": "iana" },
		"text/vnd.hgl": { "source": "iana" },
		"text/vnd.in3d.3dml": {
			"source": "iana",
			"extensions": ["3dml"]
		},
		"text/vnd.in3d.spot": {
			"source": "iana",
			"extensions": ["spot"]
		},
		"text/vnd.iptc.newsml": { "source": "iana" },
		"text/vnd.iptc.nitf": { "source": "iana" },
		"text/vnd.latex-z": { "source": "iana" },
		"text/vnd.motorola.reflex": { "source": "iana" },
		"text/vnd.ms-mediapackage": { "source": "iana" },
		"text/vnd.net2phone.commcenter.command": { "source": "iana" },
		"text/vnd.radisys.msml-basic-layout": { "source": "iana" },
		"text/vnd.senx.warpscript": { "source": "iana" },
		"text/vnd.si.uricatalogue": { "source": "iana" },
		"text/vnd.sosi": { "source": "iana" },
		"text/vnd.sun.j2me.app-descriptor": {
			"source": "iana",
			"charset": "UTF-8",
			"extensions": ["jad"]
		},
		"text/vnd.trolltech.linguist": {
			"source": "iana",
			"charset": "UTF-8"
		},
		"text/vnd.wap.si": { "source": "iana" },
		"text/vnd.wap.sl": { "source": "iana" },
		"text/vnd.wap.wml": {
			"source": "iana",
			"extensions": ["wml"]
		},
		"text/vnd.wap.wmlscript": {
			"source": "iana",
			"extensions": ["wmls"]
		},
		"text/vtt": {
			"source": "iana",
			"charset": "UTF-8",
			"compressible": true,
			"extensions": ["vtt"]
		},
		"text/x-asm": {
			"source": "apache",
			"extensions": ["s", "asm"]
		},
		"text/x-c": {
			"source": "apache",
			"extensions": [
				"c",
				"cc",
				"cxx",
				"cpp",
				"h",
				"hh",
				"dic"
			]
		},
		"text/x-component": {
			"source": "nginx",
			"extensions": ["htc"]
		},
		"text/x-fortran": {
			"source": "apache",
			"extensions": [
				"f",
				"for",
				"f77",
				"f90"
			]
		},
		"text/x-gwt-rpc": { "compressible": true },
		"text/x-handlebars-template": { "extensions": ["hbs"] },
		"text/x-java-source": {
			"source": "apache",
			"extensions": ["java"]
		},
		"text/x-jquery-tmpl": { "compressible": true },
		"text/x-lua": { "extensions": ["lua"] },
		"text/x-markdown": {
			"compressible": true,
			"extensions": ["mkd"]
		},
		"text/x-nfo": {
			"source": "apache",
			"extensions": ["nfo"]
		},
		"text/x-opml": {
			"source": "apache",
			"extensions": ["opml"]
		},
		"text/x-org": {
			"compressible": true,
			"extensions": ["org"]
		},
		"text/x-pascal": {
			"source": "apache",
			"extensions": ["p", "pas"]
		},
		"text/x-processing": {
			"compressible": true,
			"extensions": ["pde"]
		},
		"text/x-sass": { "extensions": ["sass"] },
		"text/x-scss": { "extensions": ["scss"] },
		"text/x-setext": {
			"source": "apache",
			"extensions": ["etx"]
		},
		"text/x-sfv": {
			"source": "apache",
			"extensions": ["sfv"]
		},
		"text/x-suse-ymp": {
			"compressible": true,
			"extensions": ["ymp"]
		},
		"text/x-uuencode": {
			"source": "apache",
			"extensions": ["uu"]
		},
		"text/x-vcalendar": {
			"source": "apache",
			"extensions": ["vcs"]
		},
		"text/x-vcard": {
			"source": "apache",
			"extensions": ["vcf"]
		},
		"text/xml": {
			"source": "iana",
			"compressible": true,
			"extensions": ["xml"]
		},
		"text/xml-external-parsed-entity": { "source": "iana" },
		"text/yaml": {
			"compressible": true,
			"extensions": ["yaml", "yml"]
		},
		"video/1d-interleaved-parityfec": { "source": "iana" },
		"video/3gpp": {
			"source": "iana",
			"extensions": ["3gp", "3gpp"]
		},
		"video/3gpp-tt": { "source": "iana" },
		"video/3gpp2": {
			"source": "iana",
			"extensions": ["3g2"]
		},
		"video/av1": { "source": "iana" },
		"video/bmpeg": { "source": "iana" },
		"video/bt656": { "source": "iana" },
		"video/celb": { "source": "iana" },
		"video/dv": { "source": "iana" },
		"video/encaprtp": { "source": "iana" },
		"video/ffv1": { "source": "iana" },
		"video/flexfec": { "source": "iana" },
		"video/h261": {
			"source": "iana",
			"extensions": ["h261"]
		},
		"video/h263": {
			"source": "iana",
			"extensions": ["h263"]
		},
		"video/h263-1998": { "source": "iana" },
		"video/h263-2000": { "source": "iana" },
		"video/h264": {
			"source": "iana",
			"extensions": ["h264"]
		},
		"video/h264-rcdo": { "source": "iana" },
		"video/h264-svc": { "source": "iana" },
		"video/h265": { "source": "iana" },
		"video/iso.segment": {
			"source": "iana",
			"extensions": ["m4s"]
		},
		"video/jpeg": {
			"source": "iana",
			"extensions": ["jpgv"]
		},
		"video/jpeg2000": { "source": "iana" },
		"video/jpm": {
			"source": "apache",
			"extensions": ["jpm", "jpgm"]
		},
		"video/jxsv": { "source": "iana" },
		"video/mj2": {
			"source": "iana",
			"extensions": ["mj2", "mjp2"]
		},
		"video/mp1s": { "source": "iana" },
		"video/mp2p": { "source": "iana" },
		"video/mp2t": {
			"source": "iana",
			"extensions": ["ts"]
		},
		"video/mp4": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"mp4",
				"mp4v",
				"mpg4"
			]
		},
		"video/mp4v-es": { "source": "iana" },
		"video/mpeg": {
			"source": "iana",
			"compressible": false,
			"extensions": [
				"mpeg",
				"mpg",
				"mpe",
				"m1v",
				"m2v"
			]
		},
		"video/mpeg4-generic": { "source": "iana" },
		"video/mpv": { "source": "iana" },
		"video/nv": { "source": "iana" },
		"video/ogg": {
			"source": "iana",
			"compressible": false,
			"extensions": ["ogv"]
		},
		"video/parityfec": { "source": "iana" },
		"video/pointer": { "source": "iana" },
		"video/quicktime": {
			"source": "iana",
			"compressible": false,
			"extensions": ["qt", "mov"]
		},
		"video/raptorfec": { "source": "iana" },
		"video/raw": { "source": "iana" },
		"video/rtp-enc-aescm128": { "source": "iana" },
		"video/rtploopback": { "source": "iana" },
		"video/rtx": { "source": "iana" },
		"video/scip": { "source": "iana" },
		"video/smpte291": { "source": "iana" },
		"video/smpte292m": { "source": "iana" },
		"video/ulpfec": { "source": "iana" },
		"video/vc1": { "source": "iana" },
		"video/vc2": { "source": "iana" },
		"video/vnd.cctv": { "source": "iana" },
		"video/vnd.dece.hd": {
			"source": "iana",
			"extensions": ["uvh", "uvvh"]
		},
		"video/vnd.dece.mobile": {
			"source": "iana",
			"extensions": ["uvm", "uvvm"]
		},
		"video/vnd.dece.mp4": { "source": "iana" },
		"video/vnd.dece.pd": {
			"source": "iana",
			"extensions": ["uvp", "uvvp"]
		},
		"video/vnd.dece.sd": {
			"source": "iana",
			"extensions": ["uvs", "uvvs"]
		},
		"video/vnd.dece.video": {
			"source": "iana",
			"extensions": ["uvv", "uvvv"]
		},
		"video/vnd.directv.mpeg": { "source": "iana" },
		"video/vnd.directv.mpeg-tts": { "source": "iana" },
		"video/vnd.dlna.mpeg-tts": { "source": "iana" },
		"video/vnd.dvb.file": {
			"source": "iana",
			"extensions": ["dvb"]
		},
		"video/vnd.fvt": {
			"source": "iana",
			"extensions": ["fvt"]
		},
		"video/vnd.hns.video": { "source": "iana" },
		"video/vnd.iptvforum.1dparityfec-1010": { "source": "iana" },
		"video/vnd.iptvforum.1dparityfec-2005": { "source": "iana" },
		"video/vnd.iptvforum.2dparityfec-1010": { "source": "iana" },
		"video/vnd.iptvforum.2dparityfec-2005": { "source": "iana" },
		"video/vnd.iptvforum.ttsavc": { "source": "iana" },
		"video/vnd.iptvforum.ttsmpeg2": { "source": "iana" },
		"video/vnd.motorola.video": { "source": "iana" },
		"video/vnd.motorola.videop": { "source": "iana" },
		"video/vnd.mpegurl": {
			"source": "iana",
			"extensions": ["mxu", "m4u"]
		},
		"video/vnd.ms-playready.media.pyv": {
			"source": "iana",
			"extensions": ["pyv"]
		},
		"video/vnd.nokia.interleaved-multimedia": { "source": "iana" },
		"video/vnd.nokia.mp4vr": { "source": "iana" },
		"video/vnd.nokia.videovoip": { "source": "iana" },
		"video/vnd.objectvideo": { "source": "iana" },
		"video/vnd.radgamettools.bink": { "source": "iana" },
		"video/vnd.radgamettools.smacker": { "source": "iana" },
		"video/vnd.sealed.mpeg1": { "source": "iana" },
		"video/vnd.sealed.mpeg4": { "source": "iana" },
		"video/vnd.sealed.swf": { "source": "iana" },
		"video/vnd.sealedmedia.softseal.mov": { "source": "iana" },
		"video/vnd.uvvu.mp4": {
			"source": "iana",
			"extensions": ["uvu", "uvvu"]
		},
		"video/vnd.vivo": {
			"source": "iana",
			"extensions": ["viv"]
		},
		"video/vnd.youtube.yt": { "source": "iana" },
		"video/vp8": { "source": "iana" },
		"video/vp9": { "source": "iana" },
		"video/webm": {
			"source": "apache",
			"compressible": false,
			"extensions": ["webm"]
		},
		"video/x-f4v": {
			"source": "apache",
			"extensions": ["f4v"]
		},
		"video/x-fli": {
			"source": "apache",
			"extensions": ["fli"]
		},
		"video/x-flv": {
			"source": "apache",
			"compressible": false,
			"extensions": ["flv"]
		},
		"video/x-m4v": {
			"source": "apache",
			"extensions": ["m4v"]
		},
		"video/x-matroska": {
			"source": "apache",
			"compressible": false,
			"extensions": [
				"mkv",
				"mk3d",
				"mks"
			]
		},
		"video/x-mng": {
			"source": "apache",
			"extensions": ["mng"]
		},
		"video/x-ms-asf": {
			"source": "apache",
			"extensions": ["asf", "asx"]
		},
		"video/x-ms-vob": {
			"source": "apache",
			"extensions": ["vob"]
		},
		"video/x-ms-wm": {
			"source": "apache",
			"extensions": ["wm"]
		},
		"video/x-ms-wmv": {
			"source": "apache",
			"compressible": false,
			"extensions": ["wmv"]
		},
		"video/x-ms-wmx": {
			"source": "apache",
			"extensions": ["wmx"]
		},
		"video/x-ms-wvx": {
			"source": "apache",
			"extensions": ["wvx"]
		},
		"video/x-msvideo": {
			"source": "apache",
			"extensions": ["avi"]
		},
		"video/x-sgi-movie": {
			"source": "apache",
			"extensions": ["movie"]
		},
		"video/x-smv": {
			"source": "apache",
			"extensions": ["smv"]
		},
		"x-conference/x-cooltalk": {
			"source": "apache",
			"extensions": ["ice"]
		},
		"x-shader/x-fragment": { "compressible": true },
		"x-shader/x-vertex": { "compressible": true }
	};
}));
var require_mime_db = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = (init_db(), __toCommonJS(db_exports).default);
}));
var require_mime_types = /* @__PURE__ */ __commonJSMin(((exports) => {
	var db = require_mime_db();
	var extname = require("path").extname;
	var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
	var TEXT_TYPE_REGEXP = /^text\//i;
	exports.charset = charset;
	exports.charsets = { lookup: charset };
	exports.contentType = contentType;
	exports.extension = extension;
	exports.extensions = Object.create(null);
	exports.lookup = lookup$1;
	exports.types = Object.create(null);
	populateMaps(exports.extensions, exports.types);
	function charset(type) {
		if (!type || typeof type !== "string") return false;
		var match = EXTRACT_TYPE_REGEXP.exec(type);
		var mime$1 = match && db[match[1].toLowerCase()];
		if (mime$1 && mime$1.charset) return mime$1.charset;
		if (match && TEXT_TYPE_REGEXP.test(match[1])) return "UTF-8";
		return false;
	}
	function contentType(str) {
		if (!str || typeof str !== "string") return false;
		var mime$1 = str.indexOf("/") === -1 ? exports.lookup(str) : str;
		if (!mime$1) return false;
		if (mime$1.indexOf("charset") === -1) {
			var charset$1 = exports.charset(mime$1);
			if (charset$1) mime$1 += "; charset=" + charset$1.toLowerCase();
		}
		return mime$1;
	}
	function extension(type) {
		if (!type || typeof type !== "string") return false;
		var match = EXTRACT_TYPE_REGEXP.exec(type);
		var exts = match && exports.extensions[match[1].toLowerCase()];
		if (!exts || !exts.length) return false;
		return exts[0];
	}
	function lookup$1(path$1) {
		if (!path$1 || typeof path$1 !== "string") return false;
		var extension$1 = extname("x." + path$1).toLowerCase().substr(1);
		if (!extension$1) return false;
		return exports.types[extension$1] || false;
	}
	function populateMaps(extensions, types$4) {
		var preference = [
			"nginx",
			"apache",
			void 0,
			"iana"
		];
		Object.keys(db).forEach(function forEachMimeType(type) {
			var mime$1 = db[type];
			var exts = mime$1.extensions;
			if (!exts || !exts.length) return;
			extensions[type] = exts;
			for (var i = 0; i < exts.length; i++) {
				var extension$1 = exts[i];
				if (types$4[extension$1]) {
					var from = preference.indexOf(db[types$4[extension$1]].source);
					var to = preference.indexOf(mime$1.source);
					if (types$4[extension$1] !== "application/octet-stream" && (from > to || from === to && types$4[extension$1].substr(0, 12) === "application/")) continue;
				}
				types$4[extension$1] = type;
			}
		});
	}
}));
var require_defer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = defer$1;
	function defer$1(fn) {
		var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null;
		if (nextTick) nextTick(fn);
		else setTimeout(fn, 0);
	}
}));
var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var defer = require_defer();
	module.exports = async$2;
	function async$2(callback) {
		var isAsync = false;
		defer(function() {
			isAsync = true;
		});
		return function async_callback(err, result) {
			if (isAsync) callback(err, result);
			else defer(function nextTick_callback() {
				callback(err, result);
			});
		};
	}
}));
var require_abort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = abort$3;
	function abort$3(state$1) {
		Object.keys(state$1.jobs).forEach(clean.bind(state$1));
		state$1.jobs = {};
	}
	function clean(key) {
		if (typeof this.jobs[key] == "function") this.jobs[key]();
	}
}));
var require_iterate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var async$1 = require_async(), abort$2 = require_abort();
	module.exports = iterate$2;
	function iterate$2(list, iterator$1, state$1, callback) {
		var key = state$1["keyedList"] ? state$1["keyedList"][state$1.index] : state$1.index;
		state$1.jobs[key] = runJob(iterator$1, key, list[key], function(error, output) {
			if (!(key in state$1.jobs)) return;
			delete state$1.jobs[key];
			if (error) abort$2(state$1);
			else state$1.results[key] = output;
			callback(error, state$1.results);
		});
	}
	function runJob(iterator$1, key, item, callback) {
		var aborter;
		if (iterator$1.length == 2) aborter = iterator$1(item, async$1(callback));
		else aborter = iterator$1(item, key, async$1(callback));
		return aborter;
	}
}));
var require_state = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = state;
	function state(list, sortMethod) {
		var isNamedList = !Array.isArray(list), initState$2 = {
			index: 0,
			keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
			jobs: {},
			results: isNamedList ? {} : [],
			size: isNamedList ? Object.keys(list).length : list.length
		};
		if (sortMethod) initState$2.keyedList.sort(isNamedList ? sortMethod : function(a, b) {
			return sortMethod(list[a], list[b]);
		});
		return initState$2;
	}
}));
var require_terminator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var abort$1 = require_abort(), async = require_async();
	module.exports = terminator$2;
	function terminator$2(callback) {
		if (!Object.keys(this.jobs).length) return;
		this.index = this.size;
		abort$1(this);
		async(callback)(null, this.results);
	}
}));
var require_parallel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var iterate$1 = require_iterate(), initState$1 = require_state(), terminator$1 = require_terminator();
	module.exports = parallel;
	function parallel(list, iterator$1, callback) {
		var state$1 = initState$1(list);
		while (state$1.index < (state$1["keyedList"] || list).length) {
			iterate$1(list, iterator$1, state$1, function(error, result) {
				if (error) {
					callback(error, result);
					return;
				}
				if (Object.keys(state$1.jobs).length === 0) {
					callback(null, state$1.results);
					return;
				}
			});
			state$1.index++;
		}
		return terminator$1.bind(state$1, callback);
	}
}));
var require_serialOrdered = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var iterate = require_iterate(), initState = require_state(), terminator = require_terminator();
	module.exports = serialOrdered$1;
	module.exports.ascending = ascending;
	module.exports.descending = descending;
	function serialOrdered$1(list, iterator$1, sortMethod, callback) {
		var state$1 = initState(list, sortMethod);
		iterate(list, iterator$1, state$1, function iteratorHandler(error, result) {
			if (error) {
				callback(error, result);
				return;
			}
			state$1.index++;
			if (state$1.index < (state$1["keyedList"] || list).length) {
				iterate(list, iterator$1, state$1, iteratorHandler);
				return;
			}
			callback(null, state$1.results);
		});
		return terminator.bind(state$1, callback);
	}
	function ascending(a, b) {
		return a < b ? -1 : a > b ? 1 : 0;
	}
	function descending(a, b) {
		return -1 * ascending(a, b);
	}
}));
var require_serial = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var serialOrdered = require_serialOrdered();
	module.exports = serial;
	function serial(list, iterator$1, callback) {
		return serialOrdered(list, iterator$1, null, callback);
	}
}));
var require_asynckit = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		parallel: require_parallel(),
		serial: require_serial(),
		serialOrdered: require_serialOrdered()
	};
}));
var require_es_object_atoms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Object;
}));
var require_es_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Error;
}));
var require_eval = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = EvalError;
}));
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = RangeError;
}));
var require_ref = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = ReferenceError;
}));
var require_syntax = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = SyntaxError;
}));
var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = TypeError;
}));
var require_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = URIError;
}));
var require_abs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Math.abs;
}));
var require_floor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Math.floor;
}));
var require_max = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Math.max;
}));
var require_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Math.min;
}));
var require_pow = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Math.pow;
}));
var require_round = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Math.round;
}));
var require_isNaN = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Number.isNaN || function isNaN$1(a) {
		return a !== a;
	};
}));
var require_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var $isNaN = require_isNaN();
	module.exports = function sign$1(number) {
		if ($isNaN(number) || number === 0) return number;
		return number < 0 ? -1 : 1;
	};
}));
var require_gOPD = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Object.getOwnPropertyDescriptor;
}));
var require_gopd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var $gOPD$1 = require_gOPD();
	if ($gOPD$1) try {
		$gOPD$1([], "length");
	} catch (e) {
		$gOPD$1 = null;
	}
	module.exports = $gOPD$1;
}));
var require_es_define_property = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var $defineProperty$2 = Object.defineProperty || false;
	if ($defineProperty$2) try {
		$defineProperty$2({}, "a", { value: 1 });
	} catch (e) {
		$defineProperty$2 = false;
	}
	module.exports = $defineProperty$2;
}));
var require_shams$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = function hasSymbols$2() {
		if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") return false;
		if (typeof Symbol.iterator === "symbol") return true;
		var obj = {};
		var sym = Symbol("test");
		var symObj = Object(sym);
		if (typeof sym === "string") return false;
		if (Object.prototype.toString.call(sym) !== "[object Symbol]") return false;
		if (Object.prototype.toString.call(symObj) !== "[object Symbol]") return false;
		var symVal = 42;
		obj[sym] = symVal;
		for (var _ in obj) return false;
		if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) return false;
		if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) return false;
		var syms = Object.getOwnPropertySymbols(obj);
		if (syms.length !== 1 || syms[0] !== sym) return false;
		if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;
		if (typeof Object.getOwnPropertyDescriptor === "function") {
			var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
			if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;
		}
		return true;
	};
}));
var require_has_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var origSymbol = typeof Symbol !== "undefined" && Symbol;
	var hasSymbolSham = require_shams$1();
	module.exports = function hasNativeSymbols() {
		if (typeof origSymbol !== "function") return false;
		if (typeof Symbol !== "function") return false;
		if (typeof origSymbol("foo") !== "symbol") return false;
		if (typeof Symbol("bar") !== "symbol") return false;
		return hasSymbolSham();
	};
}));
var require_Reflect_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
}));
var require_Object_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = require_es_object_atoms().getPrototypeOf || null;
}));
var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
	var toStr = Object.prototype.toString;
	var max$1 = Math.max;
	var funcType = "[object Function]";
	var concatty = function concatty$1(a, b) {
		var arr = [];
		for (var i = 0; i < a.length; i += 1) arr[i] = a[i];
		for (var j = 0; j < b.length; j += 1) arr[j + a.length] = b[j];
		return arr;
	};
	var slicy = function slicy$1(arrLike, offset) {
		var arr = [];
		for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) arr[j] = arrLike[i];
		return arr;
	};
	var joiny = function(arr, joiner) {
		var str = "";
		for (var i = 0; i < arr.length; i += 1) {
			str += arr[i];
			if (i + 1 < arr.length) str += joiner;
		}
		return str;
	};
	module.exports = function bind$5(that) {
		var target = this;
		if (typeof target !== "function" || toStr.apply(target) !== funcType) throw new TypeError(ERROR_MESSAGE + target);
		var args = slicy(arguments, 1);
		var bound;
		var binder = function() {
			if (this instanceof bound) {
				var result = target.apply(this, concatty(args, arguments));
				if (Object(result) === result) return result;
				return this;
			}
			return target.apply(that, concatty(args, arguments));
		};
		var boundLength = max$1(0, target.length - args.length);
		var boundArgs = [];
		for (var i = 0; i < boundLength; i++) boundArgs[i] = "$" + i;
		bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
		if (target.prototype) {
			var Empty = function Empty$1() {};
			Empty.prototype = target.prototype;
			bound.prototype = new Empty();
			Empty.prototype = null;
		}
		return bound;
	};
}));
var require_function_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var implementation = require_implementation();
	module.exports = Function.prototype.bind || implementation;
}));
var require_functionCall = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Function.prototype.call;
}));
var require_functionApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = Function.prototype.apply;
}));
var require_reflectApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
}));
var require_actualApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var bind$4 = require_function_bind();
	var $apply$1 = require_functionApply();
	var $call$2 = require_functionCall();
	module.exports = require_reflectApply() || bind$4.call($call$2, $apply$1);
}));
var require_call_bind_apply_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var bind$3 = require_function_bind();
	var $TypeError$2 = require_type();
	var $call$1 = require_functionCall();
	var $actualApply = require_actualApply();
	module.exports = function callBindBasic(args) {
		if (args.length < 1 || typeof args[0] !== "function") throw new $TypeError$2("a function is required");
		return $actualApply(bind$3, $call$1, args);
	};
}));
var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var callBind = require_call_bind_apply_helpers();
	var gOPD = require_gopd();
	var hasProtoAccessor;
	try {
		hasProtoAccessor = [].__proto__ === Array.prototype;
	} catch (e) {
		if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") throw e;
	}
	var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, "__proto__");
	var $Object$1 = Object;
	var $getPrototypeOf = $Object$1.getPrototypeOf;
	module.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? function getDunder(value) {
		return $getPrototypeOf(value == null ? value : $Object$1(value));
	} : false;
}));
var require_get_proto = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var reflectGetProto = require_Reflect_getPrototypeOf();
	var originalGetProto = require_Object_getPrototypeOf();
	var getDunderProto = require_get();
	module.exports = reflectGetProto ? function getProto$1(O) {
		return reflectGetProto(O);
	} : originalGetProto ? function getProto$1(O) {
		if (!O || typeof O !== "object" && typeof O !== "function") throw new TypeError("getProto: not an object");
		return originalGetProto(O);
	} : getDunderProto ? function getProto$1(O) {
		return getDunderProto(O);
	} : null;
}));
var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var call = Function.prototype.call;
	var $hasOwn = Object.prototype.hasOwnProperty;
	module.exports = require_function_bind().call(call, $hasOwn);
}));
var require_get_intrinsic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var undefined$1;
	var $Object = require_es_object_atoms();
	var $Error = require_es_errors();
	var $EvalError = require_eval();
	var $RangeError = require_range();
	var $ReferenceError = require_ref();
	var $SyntaxError = require_syntax();
	var $TypeError$1 = require_type();
	var $URIError = require_uri();
	var abs = require_abs();
	var floor = require_floor();
	var max = require_max();
	var min = require_min();
	var pow = require_pow();
	var round = require_round();
	var sign = require_sign();
	var $Function = Function;
	var getEvalledConstructor = function(expressionSyntax) {
		try {
			return $Function("\"use strict\"; return (" + expressionSyntax + ").constructor;")();
		} catch (e) {}
	};
	var $gOPD = require_gopd();
	var $defineProperty$1 = require_es_define_property();
	var throwTypeError = function() {
		throw new $TypeError$1();
	};
	var ThrowTypeError = $gOPD ? function() {
		try {
			arguments.callee;
			return throwTypeError;
		} catch (calleeThrows) {
			try {
				return $gOPD(arguments, "callee").get;
			} catch (gOPDthrows) {
				return throwTypeError;
			}
		}
	}() : throwTypeError;
	var hasSymbols$1 = require_has_symbols()();
	var getProto = require_get_proto();
	var $ObjectGPO = require_Object_getPrototypeOf();
	var $ReflectGPO = require_Reflect_getPrototypeOf();
	var $apply = require_functionApply();
	var $call = require_functionCall();
	var needsEval = {};
	var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
	var INTRINSICS = {
		__proto__: null,
		"%AggregateError%": typeof AggregateError === "undefined" ? undefined$1 : AggregateError,
		"%Array%": Array,
		"%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined$1 : ArrayBuffer,
		"%ArrayIteratorPrototype%": hasSymbols$1 && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
		"%AsyncFromSyncIteratorPrototype%": undefined$1,
		"%AsyncFunction%": needsEval,
		"%AsyncGenerator%": needsEval,
		"%AsyncGeneratorFunction%": needsEval,
		"%AsyncIteratorPrototype%": needsEval,
		"%Atomics%": typeof Atomics === "undefined" ? undefined$1 : Atomics,
		"%BigInt%": typeof BigInt === "undefined" ? undefined$1 : BigInt,
		"%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined$1 : BigInt64Array,
		"%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined$1 : BigUint64Array,
		"%Boolean%": Boolean,
		"%DataView%": typeof DataView === "undefined" ? undefined$1 : DataView,
		"%Date%": Date,
		"%decodeURI%": decodeURI,
		"%decodeURIComponent%": decodeURIComponent,
		"%encodeURI%": encodeURI,
		"%encodeURIComponent%": encodeURIComponent,
		"%Error%": $Error,
		"%eval%": eval,
		"%EvalError%": $EvalError,
		"%Float16Array%": typeof Float16Array === "undefined" ? undefined$1 : Float16Array,
		"%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array,
		"%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array,
		"%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry,
		"%Function%": $Function,
		"%GeneratorFunction%": needsEval,
		"%Int8Array%": typeof Int8Array === "undefined" ? undefined$1 : Int8Array,
		"%Int16Array%": typeof Int16Array === "undefined" ? undefined$1 : Int16Array,
		"%Int32Array%": typeof Int32Array === "undefined" ? undefined$1 : Int32Array,
		"%isFinite%": isFinite,
		"%isNaN%": isNaN,
		"%IteratorPrototype%": hasSymbols$1 && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
		"%JSON%": typeof JSON === "object" ? JSON : undefined$1,
		"%Map%": typeof Map === "undefined" ? undefined$1 : Map,
		"%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols$1 || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
		"%Math%": Math,
		"%Number%": Number,
		"%Object%": $Object,
		"%Object.getOwnPropertyDescriptor%": $gOPD,
		"%parseFloat%": parseFloat,
		"%parseInt%": parseInt,
		"%Promise%": typeof Promise === "undefined" ? undefined$1 : Promise,
		"%Proxy%": typeof Proxy === "undefined" ? undefined$1 : Proxy,
		"%RangeError%": $RangeError,
		"%ReferenceError%": $ReferenceError,
		"%Reflect%": typeof Reflect === "undefined" ? undefined$1 : Reflect,
		"%RegExp%": RegExp,
		"%Set%": typeof Set === "undefined" ? undefined$1 : Set,
		"%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols$1 || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
		"%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined$1 : SharedArrayBuffer,
		"%String%": String,
		"%StringIteratorPrototype%": hasSymbols$1 && getProto ? getProto(""[Symbol.iterator]()) : undefined$1,
		"%Symbol%": hasSymbols$1 ? Symbol : undefined$1,
		"%SyntaxError%": $SyntaxError,
		"%ThrowTypeError%": ThrowTypeError,
		"%TypedArray%": TypedArray,
		"%TypeError%": $TypeError$1,
		"%Uint8Array%": typeof Uint8Array === "undefined" ? undefined$1 : Uint8Array,
		"%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined$1 : Uint8ClampedArray,
		"%Uint16Array%": typeof Uint16Array === "undefined" ? undefined$1 : Uint16Array,
		"%Uint32Array%": typeof Uint32Array === "undefined" ? undefined$1 : Uint32Array,
		"%URIError%": $URIError,
		"%WeakMap%": typeof WeakMap === "undefined" ? undefined$1 : WeakMap,
		"%WeakRef%": typeof WeakRef === "undefined" ? undefined$1 : WeakRef,
		"%WeakSet%": typeof WeakSet === "undefined" ? undefined$1 : WeakSet,
		"%Function.prototype.call%": $call,
		"%Function.prototype.apply%": $apply,
		"%Object.defineProperty%": $defineProperty$1,
		"%Object.getPrototypeOf%": $ObjectGPO,
		"%Math.abs%": abs,
		"%Math.floor%": floor,
		"%Math.max%": max,
		"%Math.min%": min,
		"%Math.pow%": pow,
		"%Math.round%": round,
		"%Math.sign%": sign,
		"%Reflect.getPrototypeOf%": $ReflectGPO
	};
	if (getProto) try {
		null.error;
	} catch (e) {
		INTRINSICS["%Error.prototype%"] = getProto(getProto(e));
	}
	var doEval = function doEval$1(name$1) {
		var value;
		if (name$1 === "%AsyncFunction%") value = getEvalledConstructor("async function () {}");
		else if (name$1 === "%GeneratorFunction%") value = getEvalledConstructor("function* () {}");
		else if (name$1 === "%AsyncGeneratorFunction%") value = getEvalledConstructor("async function* () {}");
		else if (name$1 === "%AsyncGenerator%") {
			var fn = doEval$1("%AsyncGeneratorFunction%");
			if (fn) value = fn.prototype;
		} else if (name$1 === "%AsyncIteratorPrototype%") {
			var gen = doEval$1("%AsyncGenerator%");
			if (gen && getProto) value = getProto(gen.prototype);
		}
		INTRINSICS[name$1] = value;
		return value;
	};
	var LEGACY_ALIASES = {
		__proto__: null,
		"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
		"%ArrayPrototype%": ["Array", "prototype"],
		"%ArrayProto_entries%": [
			"Array",
			"prototype",
			"entries"
		],
		"%ArrayProto_forEach%": [
			"Array",
			"prototype",
			"forEach"
		],
		"%ArrayProto_keys%": [
			"Array",
			"prototype",
			"keys"
		],
		"%ArrayProto_values%": [
			"Array",
			"prototype",
			"values"
		],
		"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
		"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
		"%AsyncGeneratorPrototype%": [
			"AsyncGeneratorFunction",
			"prototype",
			"prototype"
		],
		"%BooleanPrototype%": ["Boolean", "prototype"],
		"%DataViewPrototype%": ["DataView", "prototype"],
		"%DatePrototype%": ["Date", "prototype"],
		"%ErrorPrototype%": ["Error", "prototype"],
		"%EvalErrorPrototype%": ["EvalError", "prototype"],
		"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
		"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
		"%FunctionPrototype%": ["Function", "prototype"],
		"%Generator%": ["GeneratorFunction", "prototype"],
		"%GeneratorPrototype%": [
			"GeneratorFunction",
			"prototype",
			"prototype"
		],
		"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
		"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
		"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
		"%JSONParse%": ["JSON", "parse"],
		"%JSONStringify%": ["JSON", "stringify"],
		"%MapPrototype%": ["Map", "prototype"],
		"%NumberPrototype%": ["Number", "prototype"],
		"%ObjectPrototype%": ["Object", "prototype"],
		"%ObjProto_toString%": [
			"Object",
			"prototype",
			"toString"
		],
		"%ObjProto_valueOf%": [
			"Object",
			"prototype",
			"valueOf"
		],
		"%PromisePrototype%": ["Promise", "prototype"],
		"%PromiseProto_then%": [
			"Promise",
			"prototype",
			"then"
		],
		"%Promise_all%": ["Promise", "all"],
		"%Promise_reject%": ["Promise", "reject"],
		"%Promise_resolve%": ["Promise", "resolve"],
		"%RangeErrorPrototype%": ["RangeError", "prototype"],
		"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
		"%RegExpPrototype%": ["RegExp", "prototype"],
		"%SetPrototype%": ["Set", "prototype"],
		"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
		"%StringPrototype%": ["String", "prototype"],
		"%SymbolPrototype%": ["Symbol", "prototype"],
		"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
		"%TypedArrayPrototype%": ["TypedArray", "prototype"],
		"%TypeErrorPrototype%": ["TypeError", "prototype"],
		"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
		"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
		"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
		"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
		"%URIErrorPrototype%": ["URIError", "prototype"],
		"%WeakMapPrototype%": ["WeakMap", "prototype"],
		"%WeakSetPrototype%": ["WeakSet", "prototype"]
	};
	var bind$1 = require_function_bind();
	var hasOwn$6 = require_hasown();
	var $concat = bind$1.call($call, Array.prototype.concat);
	var $spliceApply = bind$1.call($apply, Array.prototype.splice);
	var $replace = bind$1.call($call, String.prototype.replace);
	var $strSlice = bind$1.call($call, String.prototype.slice);
	var $exec = bind$1.call($call, RegExp.prototype.exec);
	var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
	var reEscapeChar = /\\(\\)?/g;
	var stringToPath = function stringToPath$1(string) {
		var first = $strSlice(string, 0, 1);
		var last = $strSlice(string, -1);
		if (first === "%" && last !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
		else if (last === "%" && first !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
		var result = [];
		$replace(string, rePropName, function(match, number, quote, subString) {
			result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
		});
		return result;
	};
	var getBaseIntrinsic = function getBaseIntrinsic$1(name$1, allowMissing) {
		var intrinsicName = name$1;
		var alias;
		if (hasOwn$6(LEGACY_ALIASES, intrinsicName)) {
			alias = LEGACY_ALIASES[intrinsicName];
			intrinsicName = "%" + alias[0] + "%";
		}
		if (hasOwn$6(INTRINSICS, intrinsicName)) {
			var value = INTRINSICS[intrinsicName];
			if (value === needsEval) value = doEval(intrinsicName);
			if (typeof value === "undefined" && !allowMissing) throw new $TypeError$1("intrinsic " + name$1 + " exists, but is not available. Please file an issue!");
			return {
				alias,
				name: intrinsicName,
				value
			};
		}
		throw new $SyntaxError("intrinsic " + name$1 + " does not exist!");
	};
	module.exports = function GetIntrinsic(name$1, allowMissing) {
		if (typeof name$1 !== "string" || name$1.length === 0) throw new $TypeError$1("intrinsic name must be a non-empty string");
		if (arguments.length > 1 && typeof allowMissing !== "boolean") throw new $TypeError$1("\"allowMissing\" argument must be a boolean");
		if ($exec(/^%?[^%]*%?$/, name$1) === null) throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
		var parts = stringToPath(name$1);
		var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
		var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
		var intrinsicRealName = intrinsic.name;
		var value = intrinsic.value;
		var skipFurtherCaching = false;
		var alias = intrinsic.alias;
		if (alias) {
			intrinsicBaseName = alias[0];
			$spliceApply(parts, $concat([0, 1], alias));
		}
		for (var i = 1, isOwn = true; i < parts.length; i += 1) {
			var part = parts[i];
			var first = $strSlice(part, 0, 1);
			var last = $strSlice(part, -1);
			if ((first === "\"" || first === "'" || first === "`" || last === "\"" || last === "'" || last === "`") && first !== last) throw new $SyntaxError("property names with quotes must have matching quotes");
			if (part === "constructor" || !isOwn) skipFurtherCaching = true;
			intrinsicBaseName += "." + part;
			intrinsicRealName = "%" + intrinsicBaseName + "%";
			if (hasOwn$6(INTRINSICS, intrinsicRealName)) value = INTRINSICS[intrinsicRealName];
			else if (value != null) {
				if (!(part in value)) {
					if (!allowMissing) throw new $TypeError$1("base intrinsic for " + name$1 + " exists, but the property is not available.");
					return;
				}
				if ($gOPD && i + 1 >= parts.length) {
					var desc$1 = $gOPD(value, part);
					isOwn = !!desc$1;
					if (isOwn && "get" in desc$1 && !("originalValue" in desc$1.get)) value = desc$1.get;
					else value = value[part];
				} else {
					isOwn = hasOwn$6(value, part);
					value = value[part];
				}
				if (isOwn && !skipFurtherCaching) INTRINSICS[intrinsicRealName] = value;
			}
		}
		return value;
	};
}));
var require_shams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var hasSymbols = require_shams$1();
	module.exports = function hasToStringTagShams() {
		return hasSymbols() && !!Symbol.toStringTag;
	};
}));
var require_es_set_tostringtag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var $defineProperty = require_get_intrinsic()("%Object.defineProperty%", true);
	var hasToStringTag = require_shams()();
	var hasOwn$5 = require_hasown();
	var $TypeError = require_type();
	var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
	module.exports = function setToStringTag$1(object, value) {
		var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
		var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
		if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");
		if (toStringTag && (overrideIfSet || !hasOwn$5(object, toStringTag))) if ($defineProperty) $defineProperty(object, toStringTag, {
			configurable: !nonConfigurable,
			enumerable: false,
			value,
			writable: false
		});
		else object[toStringTag] = value;
	};
}));
var require_populate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = function(dst, src) {
		Object.keys(src).forEach(function(prop) {
			dst[prop] = dst[prop] || src[prop];
		});
		return dst;
	};
}));
var require_form_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var CombinedStream = require_combined_stream();
	var util$29 = require("util");
	var path = require("path");
	var http$9 = require("http");
	var https$7 = require("https");
	var parseUrl$3 = require("url").parse;
	var fs = require("fs");
	var Stream = require("stream").Stream;
	var crypto$6 = require("crypto");
	var mime = require_mime_types();
	var asynckit = require_asynckit();
	var setToStringTag = require_es_set_tostringtag();
	var hasOwn$4 = require_hasown();
	var populate = require_populate();
	function FormData$5(options) {
		if (!(this instanceof FormData$5)) return new FormData$5(options);
		this._overheadLength = 0;
		this._valueLength = 0;
		this._valuesToMeasure = [];
		CombinedStream.call(this);
		options = options || {};
		for (var option in options) this[option] = options[option];
	}
	util$29.inherits(FormData$5, CombinedStream);
	FormData$5.LINE_BREAK = "\r\n";
	FormData$5.DEFAULT_CONTENT_TYPE = "application/octet-stream";
	FormData$5.prototype.append = function(field, value, options) {
		options = options || {};
		if (typeof options === "string") options = { filename: options };
		var append = CombinedStream.prototype.append.bind(this);
		if (typeof value === "number" || value == null) value = String(value);
		if (Array.isArray(value)) {
			this._error(/* @__PURE__ */ new Error("Arrays are not supported."));
			return;
		}
		var header = this._multiPartHeader(field, value, options);
		var footer = this._multiPartFooter();
		append(header);
		append(value);
		append(footer);
		this._trackLength(header, value, options);
	};
	FormData$5.prototype._trackLength = function(header, value, options) {
		var valueLength = 0;
		if (options.knownLength != null) valueLength += Number(options.knownLength);
		else if (Buffer.isBuffer(value)) valueLength = value.length;
		else if (typeof value === "string") valueLength = Buffer.byteLength(value);
		this._valueLength += valueLength;
		this._overheadLength += Buffer.byteLength(header) + FormData$5.LINE_BREAK.length;
		if (!value || !value.path && !(value.readable && hasOwn$4(value, "httpVersion")) && !(value instanceof Stream)) return;
		if (!options.knownLength) this._valuesToMeasure.push(value);
	};
	FormData$5.prototype._lengthRetriever = function(value, callback) {
		if (hasOwn$4(value, "fd")) if (value.end != void 0 && value.end != Infinity && value.start != void 0) callback(null, value.end + 1 - (value.start ? value.start : 0));
		else fs.stat(value.path, function(err, stat) {
			if (err) {
				callback(err);
				return;
			}
			callback(null, stat.size - (value.start ? value.start : 0));
		});
		else if (hasOwn$4(value, "httpVersion")) callback(null, Number(value.headers["content-length"]));
		else if (hasOwn$4(value, "httpModule")) {
			value.on("response", function(response) {
				value.pause();
				callback(null, Number(response.headers["content-length"]));
			});
			value.resume();
		} else callback("Unknown stream");
	};
	FormData$5.prototype._multiPartHeader = function(field, value, options) {
		if (typeof options.header === "string") return options.header;
		var contentDisposition = this._getContentDisposition(value, options);
		var contentType$1 = this._getContentType(value, options);
		var contents = "";
		var headers = {
			"Content-Disposition": ["form-data", "name=\"" + field + "\""].concat(contentDisposition || []),
			"Content-Type": [].concat(contentType$1 || [])
		};
		if (typeof options.header === "object") populate(headers, options.header);
		var header;
		for (var prop in headers) if (hasOwn$4(headers, prop)) {
			header = headers[prop];
			if (header == null) continue;
			if (!Array.isArray(header)) header = [header];
			if (header.length) contents += prop + ": " + header.join("; ") + FormData$5.LINE_BREAK;
		}
		return "--" + this.getBoundary() + FormData$5.LINE_BREAK + contents + FormData$5.LINE_BREAK;
	};
	FormData$5.prototype._getContentDisposition = function(value, options) {
		var filename;
		if (typeof options.filepath === "string") filename = path.normalize(options.filepath).replace(/\\/g, "/");
		else if (options.filename || value && (value.name || value.path)) filename = path.basename(options.filename || value && (value.name || value.path));
		else if (value && value.readable && hasOwn$4(value, "httpVersion")) filename = path.basename(value.client._httpMessage.path || "");
		if (filename) return "filename=\"" + filename + "\"";
	};
	FormData$5.prototype._getContentType = function(value, options) {
		var contentType$1 = options.contentType;
		if (!contentType$1 && value && value.name) contentType$1 = mime.lookup(value.name);
		if (!contentType$1 && value && value.path) contentType$1 = mime.lookup(value.path);
		if (!contentType$1 && value && value.readable && hasOwn$4(value, "httpVersion")) contentType$1 = value.headers["content-type"];
		if (!contentType$1 && (options.filepath || options.filename)) contentType$1 = mime.lookup(options.filepath || options.filename);
		if (!contentType$1 && value && typeof value === "object") contentType$1 = FormData$5.DEFAULT_CONTENT_TYPE;
		return contentType$1;
	};
	FormData$5.prototype._multiPartFooter = function() {
		return function(next) {
			var footer = FormData$5.LINE_BREAK;
			if (this._streams.length === 0) footer += this._lastBoundary();
			next(footer);
		}.bind(this);
	};
	FormData$5.prototype._lastBoundary = function() {
		return "--" + this.getBoundary() + "--" + FormData$5.LINE_BREAK;
	};
	FormData$5.prototype.getHeaders = function(userHeaders) {
		var header;
		var formHeaders = { "content-type": "multipart/form-data; boundary=" + this.getBoundary() };
		for (header in userHeaders) if (hasOwn$4(userHeaders, header)) formHeaders[header.toLowerCase()] = userHeaders[header];
		return formHeaders;
	};
	FormData$5.prototype.setBoundary = function(boundary) {
		if (typeof boundary !== "string") throw new TypeError("FormData boundary must be a string");
		this._boundary = boundary;
	};
	FormData$5.prototype.getBoundary = function() {
		if (!this._boundary) this._generateBoundary();
		return this._boundary;
	};
	FormData$5.prototype.getBuffer = function() {
		var dataBuffer = new Buffer.alloc(0);
		var boundary = this.getBoundary();
		for (var i = 0, len = this._streams.length; i < len; i++) if (typeof this._streams[i] !== "function") {
			if (Buffer.isBuffer(this._streams[i])) dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
			else dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
			if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData$5.LINE_BREAK)]);
		}
		return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
	};
	FormData$5.prototype._generateBoundary = function() {
		this._boundary = "--------------------------" + crypto$6.randomBytes(12).toString("hex");
	};
	FormData$5.prototype.getLengthSync = function() {
		var knownLength = this._overheadLength + this._valueLength;
		if (this._streams.length) knownLength += this._lastBoundary().length;
		if (!this.hasKnownLength()) this._error(/* @__PURE__ */ new Error("Cannot calculate proper length in synchronous way."));
		return knownLength;
	};
	FormData$5.prototype.hasKnownLength = function() {
		var hasKnownLength = true;
		if (this._valuesToMeasure.length) hasKnownLength = false;
		return hasKnownLength;
	};
	FormData$5.prototype.getLength = function(cb) {
		var knownLength = this._overheadLength + this._valueLength;
		if (this._streams.length) knownLength += this._lastBoundary().length;
		if (!this._valuesToMeasure.length) {
			process.nextTick(cb.bind(this, null, knownLength));
			return;
		}
		asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
			if (err) {
				cb(err);
				return;
			}
			values.forEach(function(length) {
				knownLength += length;
			});
			cb(null, knownLength);
		});
	};
	FormData$5.prototype.submit = function(params, cb) {
		var request$1;
		var options;
		var defaults$1 = { method: "post" };
		if (typeof params === "string") {
			params = parseUrl$3(params);
			options = populate({
				port: params.port,
				path: params.pathname,
				host: params.hostname,
				protocol: params.protocol
			}, defaults$1);
		} else {
			options = populate(params, defaults$1);
			if (!options.port) options.port = options.protocol === "https:" ? 443 : 80;
		}
		options.headers = this.getHeaders(params.headers);
		if (options.protocol === "https:") request$1 = https$7.request(options);
		else request$1 = http$9.request(options);
		this.getLength(function(err, length) {
			if (err && err !== "Unknown stream") {
				this._error(err);
				return;
			}
			if (length) request$1.setHeader("Content-Length", length);
			this.pipe(request$1);
			if (cb) {
				var onResponse;
				var callback = function(error, responce) {
					request$1.removeListener("error", callback);
					request$1.removeListener("response", onResponse);
					return cb.call(this, error, responce);
				};
				onResponse = callback.bind(this, null);
				request$1.on("error", callback);
				request$1.on("response", onResponse);
			}
		}.bind(this));
		return request$1;
	};
	FormData$5.prototype._error = function(err) {
		if (!this.error) {
			this.error = err;
			this.pause();
			this.emit("error", err);
		}
	};
	FormData$5.prototype.toString = function() {
		return "[object FormData]";
	};
	setToStringTag(FormData$5.prototype, "FormData");
	module.exports = FormData$5;
}));
var import_form_data = /* @__PURE__ */ __toESM(require_form_data(), 1);
var FormData_default = import_form_data.default;
function isVisitable(thing) {
	return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
}
function removeBrackets(key) {
	return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
}
function renderKey(path$1, key, dots) {
	if (!path$1) return key;
	return path$1.concat(key).map(function each(token, i) {
		token = removeBrackets(token);
		return !dots && i ? "[" + token + "]" : token;
	}).join(dots ? "." : "");
}
function isFlatArray(arr) {
	return utils_default.isArray(arr) && !arr.some(isVisitable);
}
var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
	return /^is[A-Z]/.test(prop);
});
function toFormData(obj, formData, options) {
	if (!utils_default.isObject(obj)) throw new TypeError("target must be an object");
	formData = formData || new (FormData_default || FormData)();
	options = utils_default.toFlatObject(options, {
		metaTokens: true,
		dots: false,
		indexes: false
	}, false, function defined(option, source) {
		return !utils_default.isUndefined(source[option]);
	});
	const metaTokens = options.metaTokens;
	const visitor = options.visitor || defaultVisitor;
	const dots = options.dots;
	const indexes = options.indexes;
	const useBlob = (options.Blob || typeof Blob !== "undefined" && Blob) && utils_default.isSpecCompliantForm(formData);
	if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function");
	function convertValue(value) {
		if (value === null) return "";
		if (utils_default.isDate(value)) return value.toISOString();
		if (utils_default.isBoolean(value)) return value.toString();
		if (!useBlob && utils_default.isBlob(value)) throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
		if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
		return value;
	}
	function defaultVisitor(value, key, path$1) {
		let arr = value;
		if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
			formData.append(renderKey(path$1, key, dots), convertValue(value));
			return false;
		}
		if (value && !path$1 && typeof value === "object") {
			if (utils_default.endsWith(key, "{}")) {
				key = metaTokens ? key : key.slice(0, -2);
				value = JSON.stringify(value);
			} else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
				key = removeBrackets(key);
				arr.forEach(function each(el, index) {
					!(utils_default.isUndefined(el) || el === null) && formData.append(indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", convertValue(el));
				});
				return false;
			}
		}
		if (isVisitable(value)) return true;
		formData.append(renderKey(path$1, key, dots), convertValue(value));
		return false;
	}
	const stack = [];
	const exposedHelpers = Object.assign(predicates, {
		defaultVisitor,
		convertValue,
		isVisitable
	});
	function build(value, path$1) {
		if (utils_default.isUndefined(value)) return;
		if (stack.indexOf(value) !== -1) throw Error("Circular reference detected in " + path$1.join("."));
		stack.push(value);
		utils_default.forEach(value, function each(el, key) {
			if ((!(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path$1, exposedHelpers)) === true) build(el, path$1 ? path$1.concat(key) : [key]);
		});
		stack.pop();
	}
	if (!utils_default.isObject(obj)) throw new TypeError("data must be an object");
	build(obj);
	return formData;
}
var toFormData_default = toFormData;
function encode$1(str) {
	const charMap = {
		"!": "%21",
		"'": "%27",
		"(": "%28",
		")": "%29",
		"~": "%7E",
		"%20": "+",
		"%00": "\0"
	};
	return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
		return charMap[match];
	});
}
function AxiosURLSearchParams(params, options) {
	this._pairs = [];
	params && toFormData_default(params, this, options);
}
var prototype = AxiosURLSearchParams.prototype;
prototype.append = function append(name$1, value) {
	this._pairs.push([name$1, value]);
};
prototype.toString = function toString$1(encoder$1) {
	const _encode = encoder$1 ? function(value) {
		return encoder$1.call(this, value, encode$1);
	} : encode$1;
	return this._pairs.map(function each(pair) {
		return _encode(pair[0]) + "=" + _encode(pair[1]);
	}, "").join("&");
};
var AxiosURLSearchParams_default = AxiosURLSearchParams;
function encode(val) {
	return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function buildURL$4(url$3, params, options) {
	if (!params) return url$3;
	const _encode = options && options.encode || encode;
	const _options = utils_default.isFunction(options) ? { serialize: options } : options;
	const serializeFn = _options && _options.serialize;
	let serializedParams;
	if (serializeFn) serializedParams = serializeFn(params, _options);
	else serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode);
	if (serializedParams) {
		const hashmarkIndex = url$3.indexOf("#");
		if (hashmarkIndex !== -1) url$3 = url$3.slice(0, hashmarkIndex);
		url$3 += (url$3.indexOf("?") === -1 ? "?" : "&") + serializedParams;
	}
	return url$3;
}
var InterceptorManager = class {
	constructor() {
		this.handlers = [];
	}
	use(fulfilled, rejected, options) {
		this.handlers.push({
			fulfilled,
			rejected,
			synchronous: options ? options.synchronous : false,
			runWhen: options ? options.runWhen : null
		});
		return this.handlers.length - 1;
	}
	eject(id) {
		if (this.handlers[id]) this.handlers[id] = null;
	}
	clear() {
		if (this.handlers) this.handlers = [];
	}
	forEach(fn) {
		utils_default.forEach(this.handlers, function forEachHandler(h$1) {
			if (h$1 !== null) fn(h$1);
		});
	}
};
var InterceptorManager_default = InterceptorManager;
var transitional_default = {
	silentJSONParsing: true,
	forcedJSONParsing: true,
	clarifyTimeoutError: false,
	legacyInterceptorReqResOrdering: true
};
var URLSearchParams_default = url.default.URLSearchParams;
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
var DIGIT = "0123456789";
var ALPHABET = {
	DIGIT,
	ALPHA,
	ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
};
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
	let str = "";
	const { length } = alphabet;
	const randomValues = new Uint32Array(size);
	crypto.default.randomFillSync(randomValues);
	for (let i = 0; i < size; i++) str += alphabet[randomValues[i] % length];
	return str;
};
var node_default = {
	isNode: true,
	classes: {
		URLSearchParams: URLSearchParams_default,
		FormData: FormData_default,
		Blob: typeof Blob !== "undefined" && Blob || null
	},
	ALPHABET,
	generateString,
	protocols: [
		"http",
		"https",
		"file",
		"data"
	]
};
var utils_exports = /* @__PURE__ */ __export({
	hasBrowserEnv: () => hasBrowserEnv,
	hasStandardBrowserEnv: () => hasStandardBrowserEnv,
	hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
	navigator: () => _navigator,
	origin: () => origin
}, 1);
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
var _navigator = typeof navigator === "object" && navigator || void 0;
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [
	"ReactNative",
	"NativeScript",
	"NS"
].indexOf(_navigator.product) < 0);
var hasStandardBrowserWebWorkerEnv = (() => {
	return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
})();
var origin = hasBrowserEnv && window.location.href || "http://localhost";
var platform_default = {
	...utils_exports,
	...node_default
};
function toURLEncodedForm(data$1, options) {
	return toFormData_default(data$1, new platform_default.classes.URLSearchParams(), {
		visitor: function(value, key, path$1, helpers$2) {
			if (platform_default.isNode && utils_default.isBuffer(value)) {
				this.append(key, value.toString("base64"));
				return false;
			}
			return helpers$2.defaultVisitor.apply(this, arguments);
		},
		...options
	});
}
function parsePropPath(name$1) {
	return utils_default.matchAll(/\w+|\[(\w*)]/g, name$1).map((match) => {
		return match[0] === "[]" ? "" : match[1] || match[0];
	});
}
function arrayToObject(arr) {
	const obj = {};
	const keys = Object.keys(arr);
	let i;
	const len = keys.length;
	let key;
	for (i = 0; i < len; i++) {
		key = keys[i];
		obj[key] = arr[key];
	}
	return obj;
}
function formDataToJSON(formData) {
	function buildPath(path$1, value, target, index) {
		let name$1 = path$1[index++];
		if (name$1 === "__proto__") return true;
		const isNumericKey = Number.isFinite(+name$1);
		const isLast = index >= path$1.length;
		name$1 = !name$1 && utils_default.isArray(target) ? target.length : name$1;
		if (isLast) {
			if (utils_default.hasOwnProp(target, name$1)) target[name$1] = [target[name$1], value];
			else target[name$1] = value;
			return !isNumericKey;
		}
		if (!target[name$1] || !utils_default.isObject(target[name$1])) target[name$1] = [];
		if (buildPath(path$1, value, target[name$1], index) && utils_default.isArray(target[name$1])) target[name$1] = arrayToObject(target[name$1]);
		return !isNumericKey;
	}
	if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
		const obj = {};
		utils_default.forEachEntry(formData, (name$1, value) => {
			buildPath(parsePropPath(name$1), value, obj, 0);
		});
		return obj;
	}
	return null;
}
var formDataToJSON_default = formDataToJSON;
function stringifySafely(rawValue, parser, encoder$1) {
	if (utils_default.isString(rawValue)) try {
		(parser || JSON.parse)(rawValue);
		return utils_default.trim(rawValue);
	} catch (e) {
		if (e.name !== "SyntaxError") throw e;
	}
	return (encoder$1 || JSON.stringify)(rawValue);
}
var defaults = {
	transitional: transitional_default,
	adapter: [
		"xhr",
		"http",
		"fetch"
	],
	transformRequest: [function transformRequest(data$1, headers) {
		const contentType$1 = headers.getContentType() || "";
		const hasJSONContentType = contentType$1.indexOf("application/json") > -1;
		const isObjectPayload = utils_default.isObject(data$1);
		if (isObjectPayload && utils_default.isHTMLForm(data$1)) data$1 = new FormData(data$1);
		if (utils_default.isFormData(data$1)) return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data$1)) : data$1;
		if (utils_default.isArrayBuffer(data$1) || utils_default.isBuffer(data$1) || utils_default.isStream(data$1) || utils_default.isFile(data$1) || utils_default.isBlob(data$1) || utils_default.isReadableStream(data$1)) return data$1;
		if (utils_default.isArrayBufferView(data$1)) return data$1.buffer;
		if (utils_default.isURLSearchParams(data$1)) {
			headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
			return data$1.toString();
		}
		let isFileList$1;
		if (isObjectPayload) {
			if (contentType$1.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data$1, this.formSerializer).toString();
			if ((isFileList$1 = utils_default.isFileList(data$1)) || contentType$1.indexOf("multipart/form-data") > -1) {
				const _FormData = this.env && this.env.FormData;
				return toFormData_default(isFileList$1 ? { "files[]": data$1 } : data$1, _FormData && new _FormData(), this.formSerializer);
			}
		}
		if (isObjectPayload || hasJSONContentType) {
			headers.setContentType("application/json", false);
			return stringifySafely(data$1);
		}
		return data$1;
	}],
	transformResponse: [function transformResponse(data$1) {
		const transitional = this.transitional || defaults.transitional;
		const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
		const JSONRequested = this.responseType === "json";
		if (utils_default.isResponse(data$1) || utils_default.isReadableStream(data$1)) return data$1;
		if (data$1 && utils_default.isString(data$1) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
			const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested;
			try {
				return JSON.parse(data$1, this.parseReviver);
			} catch (e) {
				if (strictJSONParsing) {
					if (e.name === "SyntaxError") throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
					throw e;
				}
			}
		}
		return data$1;
	}],
	timeout: 0,
	xsrfCookieName: "XSRF-TOKEN",
	xsrfHeaderName: "X-XSRF-TOKEN",
	maxContentLength: -1,
	maxBodyLength: -1,
	env: {
		FormData: platform_default.classes.FormData,
		Blob: platform_default.classes.Blob
	},
	validateStatus: function validateStatus(status) {
		return status >= 200 && status < 300;
	},
	headers: { common: {
		Accept: "application/json, text/plain, */*",
		"Content-Type": void 0
	} }
};
utils_default.forEach([
	"delete",
	"get",
	"head",
	"post",
	"put",
	"patch"
], (method) => {
	defaults.headers[method] = {};
});
var defaults_default = defaults;
var ignoreDuplicateOf = utils_default.toObjectSet([
	"age",
	"authorization",
	"content-length",
	"content-type",
	"etag",
	"expires",
	"from",
	"host",
	"if-modified-since",
	"if-unmodified-since",
	"last-modified",
	"location",
	"max-forwards",
	"proxy-authorization",
	"referer",
	"retry-after",
	"user-agent"
]);
var parseHeaders_default = (rawHeaders) => {
	const parsed = {};
	let key;
	let val;
	let i;
	rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
		i = line.indexOf(":");
		key = line.substring(0, i).trim().toLowerCase();
		val = line.substring(i + 1).trim();
		if (!key || parsed[key] && ignoreDuplicateOf[key]) return;
		if (key === "set-cookie") if (parsed[key]) parsed[key].push(val);
		else parsed[key] = [val];
		else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
	});
	return parsed;
};
var $internals = Symbol("internals");
var isValidHeaderValue$4 = (value) => !/[\r\n]/.test(value);
function assertValidHeaderValue(value, header) {
	if (value === false || value == null) return;
	if (utils_default.isArray(value)) {
		value.forEach((v) => assertValidHeaderValue(v, header));
		return;
	}
	if (!isValidHeaderValue$4(String(value))) throw new Error(`Invalid character in header content ["${header}"]`);
}
function normalizeHeader(header) {
	return header && String(header).trim().toLowerCase();
}
function stripTrailingCRLF(str) {
	let end = str.length;
	while (end > 0) {
		const charCode = str.charCodeAt(end - 1);
		if (charCode !== 10 && charCode !== 13) break;
		end -= 1;
	}
	return end === str.length ? str : str.slice(0, end);
}
function normalizeValue(value) {
	if (value === false || value == null) return value;
	return utils_default.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
}
function parseTokens(str) {
	const tokens = Object.create(null);
	const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
	let match;
	while (match = tokensRE.exec(str)) tokens[match[1]] = match[2];
	return tokens;
}
var isValidHeaderName$3 = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
	if (utils_default.isFunction(filter)) return filter.call(this, value, header);
	if (isHeaderNameFilter) value = header;
	if (!utils_default.isString(value)) return;
	if (utils_default.isString(filter)) return value.indexOf(filter) !== -1;
	if (utils_default.isRegExp(filter)) return filter.test(value);
}
function formatHeader(header) {
	return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w$1, char, str) => {
		return char.toUpperCase() + str;
	});
}
function buildAccessors(obj, header) {
	const accessorName = utils_default.toCamelCase(" " + header);
	[
		"get",
		"set",
		"has"
	].forEach((methodName) => {
		Object.defineProperty(obj, methodName + accessorName, {
			value: function(arg1, arg2, arg3) {
				return this[methodName].call(this, header, arg1, arg2, arg3);
			},
			configurable: true
		});
	});
}
var AxiosHeaders = class {
	constructor(headers) {
		headers && this.set(headers);
	}
	set(header, valueOrRewrite, rewrite) {
		const self$1 = this;
		function setHeader(_value, _header, _rewrite) {
			const lHeader = normalizeHeader(_header);
			if (!lHeader) throw new Error("header name must be a non-empty string");
			const key = utils_default.findKey(self$1, lHeader);
			if (!key || self$1[key] === void 0 || _rewrite === true || _rewrite === void 0 && self$1[key] !== false) {
				assertValidHeaderValue(_value, _header);
				self$1[key || _header] = normalizeValue(_value);
			}
		}
		const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
		if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite);
		else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName$3(header)) setHeaders(parseHeaders_default(header), valueOrRewrite);
		else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
			let obj = {}, dest, key;
			for (const entry of header) {
				if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair");
				obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
			}
			setHeaders(obj, valueOrRewrite);
		} else header != null && setHeader(valueOrRewrite, header, rewrite);
		return this;
	}
	get(header, parser) {
		header = normalizeHeader(header);
		if (header) {
			const key = utils_default.findKey(this, header);
			if (key) {
				const value = this[key];
				if (!parser) return value;
				if (parser === true) return parseTokens(value);
				if (utils_default.isFunction(parser)) return parser.call(this, value, key);
				if (utils_default.isRegExp(parser)) return parser.exec(value);
				throw new TypeError("parser must be boolean|regexp|function");
			}
		}
	}
	has(header, matcher) {
		header = normalizeHeader(header);
		if (header) {
			const key = utils_default.findKey(this, header);
			return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
		}
		return false;
	}
	delete(header, matcher) {
		const self$1 = this;
		let deleted = false;
		function deleteHeader(_header) {
			_header = normalizeHeader(_header);
			if (_header) {
				const key = utils_default.findKey(self$1, _header);
				if (key && (!matcher || matchHeaderValue(self$1, self$1[key], key, matcher))) {
					delete self$1[key];
					deleted = true;
				}
			}
		}
		if (utils_default.isArray(header)) header.forEach(deleteHeader);
		else deleteHeader(header);
		return deleted;
	}
	clear(matcher) {
		const keys = Object.keys(this);
		let i = keys.length;
		let deleted = false;
		while (i--) {
			const key = keys[i];
			if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
				delete this[key];
				deleted = true;
			}
		}
		return deleted;
	}
	normalize(format) {
		const self$1 = this;
		const headers = {};
		utils_default.forEach(this, (value, header) => {
			const key = utils_default.findKey(headers, header);
			if (key) {
				self$1[key] = normalizeValue(value);
				delete self$1[header];
				return;
			}
			const normalized = format ? formatHeader(header) : String(header).trim();
			if (normalized !== header) delete self$1[header];
			self$1[normalized] = normalizeValue(value);
			headers[normalized] = true;
		});
		return this;
	}
	concat(...targets) {
		return this.constructor.concat(this, ...targets);
	}
	toJSON(asStrings) {
		const obj = Object.create(null);
		utils_default.forEach(this, (value, header) => {
			value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
		});
		return obj;
	}
	[Symbol.iterator]() {
		return Object.entries(this.toJSON())[Symbol.iterator]();
	}
	toString() {
		return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
	}
	getSetCookie() {
		return this.get("set-cookie") || [];
	}
	get [Symbol.toStringTag]() {
		return "AxiosHeaders";
	}
	static from(thing) {
		return thing instanceof this ? thing : new this(thing);
	}
	static concat(first, ...targets) {
		const computed = new this(first);
		targets.forEach((target) => computed.set(target));
		return computed;
	}
	static accessor(header) {
		const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors;
		const prototype$1 = this.prototype;
		function defineAccessor(_header) {
			const lHeader = normalizeHeader(_header);
			if (!accessors[lHeader]) {
				buildAccessors(prototype$1, _header);
				accessors[lHeader] = true;
			}
		}
		utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
		return this;
	}
};
AxiosHeaders.accessor([
	"Content-Type",
	"Content-Length",
	"Accept",
	"Accept-Encoding",
	"User-Agent",
	"Authorization"
]);
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
	let mapped = key[0].toUpperCase() + key.slice(1);
	return {
		get: () => value,
		set(headerValue) {
			this[mapped] = headerValue;
		}
	};
});
utils_default.freezeMethods(AxiosHeaders);
var AxiosHeaders_default = AxiosHeaders;
function transformData(fns, response) {
	const config = this || defaults_default;
	const context = response || config;
	const headers = AxiosHeaders_default.from(context.headers);
	let data$1 = context.data;
	utils_default.forEach(fns, function transform(fn) {
		data$1 = fn.call(config, data$1, headers.normalize(), response ? response.status : void 0);
	});
	headers.normalize();
	return data$1;
}
function isCancel(value) {
	return !!(value && value.__CANCEL__);
}
var CanceledError = class extends AxiosError_default {
	constructor(message, config, request$1) {
		super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request$1);
		this.name = "CanceledError";
		this.__CANCEL__ = true;
	}
};
var CanceledError_default = CanceledError;
function settle(resolve, reject, response) {
	const validateStatus = response.config.validateStatus;
	if (!response.status || !validateStatus || validateStatus(response.status)) resolve(response);
	else reject(new AxiosError_default("Request failed with status code " + response.status, [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
}
function isAbsoluteURL(url$3) {
	if (typeof url$3 !== "string") return false;
	return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url$3);
}
function combineURLs(baseURL, relativeURL) {
	return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
	let isRelativeUrl = !isAbsoluteURL(requestedURL);
	if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) return combineURLs(baseURL, requestedURL);
	return requestedURL;
}
var DEFAULT_PORTS$3 = {
	ftp: 21,
	gopher: 70,
	http: 80,
	https: 443,
	ws: 80,
	wss: 443
};
function parseUrl$2(urlString) {
	try {
		return new URL(urlString);
	} catch {
		return null;
	}
}
function getProxyForUrl$1(url$3) {
	var parsedUrl = (typeof url$3 === "string" ? parseUrl$2(url$3) : url$3) || {};
	var proto = parsedUrl.protocol;
	var hostname = parsedUrl.host;
	var port = parsedUrl.port;
	if (typeof hostname !== "string" || !hostname || typeof proto !== "string") return "";
	proto = proto.split(":", 1)[0];
	hostname = hostname.replace(/:\d*$/, "");
	port = parseInt(port) || DEFAULT_PORTS$3[proto] || 0;
	if (!shouldProxy$1(hostname, port)) return "";
	var proxy = getEnv$1(proto + "_proxy") || getEnv$1("all_proxy");
	if (proxy && proxy.indexOf("://") === -1) proxy = proto + "://" + proxy;
	return proxy;
}
function shouldProxy$1(hostname, port) {
	var NO_PROXY = getEnv$1("no_proxy").toLowerCase();
	if (!NO_PROXY) return true;
	if (NO_PROXY === "*") return false;
	return NO_PROXY.split(/[,\s]/).every(function(proxy) {
		if (!proxy) return true;
		var parsedProxy = proxy.match(/^(.+):(\d+)$/);
		var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
		var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
		if (parsedProxyPort && parsedProxyPort !== port) return true;
		if (!/^[.*]/.test(parsedProxyHostname)) return hostname !== parsedProxyHostname;
		if (parsedProxyHostname.charAt(0) === "*") parsedProxyHostname = parsedProxyHostname.slice(1);
		return !hostname.endsWith(parsedProxyHostname);
	});
}
function getEnv$1(key) {
	return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
}
var require_ms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var s = 1e3;
	var m = s * 60;
	var h = m * 60;
	var d = h * 24;
	var w = d * 7;
	var y = d * 365.25;
	module.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 match = /^(-?(?:\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 (!match) return;
		var n$1 = parseFloat(match[1]);
		switch ((match[2] || "ms").toLowerCase()) {
			case "years":
			case "year":
			case "yrs":
			case "yr":
			case "y": return n$1 * y;
			case "weeks":
			case "week":
			case "w": return n$1 * w;
			case "days":
			case "day":
			case "d": return n$1 * d;
			case "hours":
			case "hour":
			case "hrs":
			case "hr":
			case "h": return n$1 * h;
			case "minutes":
			case "minute":
			case "mins":
			case "min":
			case "m": return n$1 * m;
			case "seconds":
			case "second":
			case "secs":
			case "sec":
			case "s": return n$1 * s;
			case "milliseconds":
			case "millisecond":
			case "msecs":
			case "msec":
			case "ms": return n$1;
			default: return;
		}
	}
	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$1, name$1) {
		var isPlural = msAbs >= n$1 * 1.5;
		return Math.round(ms / n$1) + " " + name$1 + (isPlural ? "s" : "");
	}
}));
var require_common$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	function setup(env$1) {
		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$3;
		Object.keys(env$1).forEach((key) => {
			createDebug[key] = env$1[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 debug$13(...args) {
				if (!debug$13.enabled) return;
				const self$1 = debug$13;
				const curr = Number(/* @__PURE__ */ new Date());
				self$1.diff = curr - (prevTime || curr);
				self$1.prev = prevTime;
				self$1.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, (match, format) => {
					if (match === "%%") return "%";
					index++;
					const formatter = createDebug.formatters[format];
					if (typeof formatter === "function") {
						const val = args[index];
						match = formatter.call(self$1, val);
						args.splice(index, 1);
						index--;
					}
					return match;
				});
				createDebug.formatArgs.call(self$1, args);
				(self$1.log || createDebug.log).apply(self$1, args);
			}
			debug$13.namespace = namespace;
			debug$13.useColors = createDebug.useColors();
			debug$13.color = createDebug.selectColor(namespace);
			debug$13.extend = extend$1;
			debug$13.destroy = createDebug.destroy;
			Object.defineProperty(debug$13, "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(debug$13);
			return debug$13;
		}
		function extend$1(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$1) {
			for (const skip of createDebug.skips) if (matchesTemplate(name$1, skip)) return false;
			for (const ns of createDebug.names) if (matchesTemplate(name$1, ns)) return true;
			return false;
		}
		function coerce(val) {
			if (val instanceof Error) return val.stack || val.message;
			return val;
		}
		function destroy$3() {
			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;
	}
	module.exports = setup;
}));
var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	exports.formatArgs = formatArgs$1;
	exports.save = save$1;
	exports.load = load$1;
	exports.useColors = useColors$1;
	exports.storage = localstorage();
	exports.destroy = (() => {
		let warned$1 = false;
		return () => {
			if (!warned$1) {
				warned$1 = 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`.");
			}
		};
	})();
	exports.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$1() {
		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$1;
		return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m$1 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m$1[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
	}
	function formatArgs$1(args) {
		args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.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, (match) => {
			if (match === "%%") return;
			index++;
			if (match === "%c") lastC = index;
		});
		args.splice(lastC, 0, c);
	}
	exports.log = console.debug || console.log || (() => {});
	function save$1(namespaces) {
		try {
			if (namespaces) exports.storage.setItem("debug", namespaces);
			else exports.storage.removeItem("debug");
		} catch (error) {}
	}
	function load$1() {
		let r;
		try {
			r = exports.storage.getItem("debug") || exports.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) {}
	}
	module.exports = require_common$2()(exports);
	var { formatters: formatters$1 } = module.exports;
	formatters$1.j = function(v) {
		try {
			return JSON.stringify(v);
		} catch (error) {
			return "[UnexpectedJSONParseError]: " + error.message;
		}
	};
}));
var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.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);
	};
}));
var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var os = require("os");
	var tty$1 = 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$1 = forceColor || 0;
		if (env.TERM === "dumb") return min$1;
		if (process.platform === "win32") {
			const osRelease = os.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$1) => sign$1 in env) || env.CI_NAME === "codeship") return 1;
			return min$1;
		}
		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 version$1 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
			switch (env.TERM_PROGRAM) {
				case "iTerm.app": return version$1 >= 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$1;
	}
	function getSupportLevel(stream$7) {
		return translateLevel(supportsColor(stream$7, stream$7 && stream$7.isTTY));
	}
	module.exports = {
		supportsColor: getSupportLevel,
		stdout: translateLevel(supportsColor(true, tty$1.isatty(1))),
		stderr: translateLevel(supportsColor(true, tty$1.isatty(2)))
	};
}));
var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var tty = require("tty");
	var util$28 = require("util");
	exports.init = init;
	exports.log = log;
	exports.formatArgs = formatArgs;
	exports.save = save;
	exports.load = load;
	exports.useColors = useColors;
	exports.destroy = util$28.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
	exports.colors = [
		6,
		2,
		3,
		4,
		5,
		1
	];
	try {
		const supportsColor$1 = require_supports_color();
		if (supportsColor$1 && (supportsColor$1.stderr || supportsColor$1).level >= 2) exports.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) {}
	exports.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 exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
	}
	function formatArgs(args) {
		const { namespace: name$1, useColors: useColors$2 } = this;
		if (useColors$2) {
			const c = this.color;
			const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
			const prefix = `  ${colorCode};1m${name$1} \u001B[0m`;
			args[0] = prefix + args[0].split("\n").join("\n" + prefix);
			args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
		} else args[0] = getDate() + name$1 + " " + args[0];
	}
	function getDate() {
		if (exports.inspectOpts.hideDate) return "";
		return (/* @__PURE__ */ new Date()).toISOString() + " ";
	}
	function log(...args) {
		return process.stderr.write(util$28.formatWithOptions(exports.inspectOpts, ...args) + "\n");
	}
	function save(namespaces) {
		if (namespaces) process.env.DEBUG = namespaces;
		else delete process.env.DEBUG;
	}
	function load() {
		return process.env.DEBUG;
	}
	function init(debug$13) {
		debug$13.inspectOpts = {};
		const keys = Object.keys(exports.inspectOpts);
		for (let i = 0; i < keys.length; i++) debug$13.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
	}
	module.exports = require_common$2()(exports);
	var { formatters } = module.exports;
	formatters.o = function(v) {
		this.inspectOpts.colors = this.useColors;
		return util$28.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
	};
	formatters.O = function(v) {
		this.inspectOpts.colors = this.useColors;
		return util$28.inspect(v, this.inspectOpts);
	};
}));
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) module.exports = require_browser();
	else module.exports = require_node$1();
}));
var require_debug$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var debug$12;
	module.exports = function() {
		if (!debug$12) {
			try {
				debug$12 = require_src()("follow-redirects");
			} catch (error) {}
			if (typeof debug$12 !== "function") debug$12 = function() {};
		}
		debug$12.apply(null, arguments);
	};
}));
var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var url$1 = require("url");
	var URL$2 = url$1.URL;
	var http$8 = require("http");
	var https$6 = require("https");
	var Writable$1 = require("stream").Writable;
	var assert$28 = require("assert");
	var debug$11 = require_debug$1();
	// istanbul ignore next
	(function detectUnsupportedEnvironment() {
		var looksLikeNode = typeof process !== "undefined";
		var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
		var looksLikeV8 = isFunction$1(Error.captureStackTrace);
		if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) console.warn("The follow-redirects package should be excluded from browser builds.");
	})();
	var useNativeURL = false;
	try {
		assert$28(new URL$2(""));
	} catch (error) {
		useNativeURL = error.code === "ERR_INVALID_URL";
	}
	var sensitiveHeaders = [
		"Authorization",
		"Proxy-Authorization",
		"Cookie"
	];
	var preservedUrlFields = [
		"auth",
		"host",
		"hostname",
		"href",
		"path",
		"pathname",
		"port",
		"protocol",
		"query",
		"search",
		"hash"
	];
	var events$1 = [
		"abort",
		"aborted",
		"connect",
		"error",
		"socket",
		"timeout"
	];
	var eventHandlers = Object.create(null);
	events$1.forEach(function(event) {
		eventHandlers[event] = function(arg1, arg2, arg3) {
			this._redirectable.emit(event, arg1, arg2, arg3);
		};
	});
	var InvalidUrlError = createErrorType("ERR_INVALID_URL", "Invalid URL", TypeError);
	var RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "Redirected request failed");
	var TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded", RedirectionError);
	var MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit");
	var WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
	// istanbul ignore next
	var destroy$2 = Writable$1.prototype.destroy || noop$6;
	function RedirectableRequest(options, responseCallback) {
		Writable$1.call(this);
		this._sanitizeOptions(options);
		this._options = options;
		this._ended = false;
		this._ending = false;
		this._redirectCount = 0;
		this._redirects = [];
		this._requestBodyLength = 0;
		this._requestBodyBuffers = [];
		if (responseCallback) this.on("response", responseCallback);
		var self$1 = this;
		this._onNativeResponse = function(response) {
			try {
				self$1._processResponse(response);
			} catch (cause) {
				self$1.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
			}
		};
		this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i");
		this._performRequest();
	}
	RedirectableRequest.prototype = Object.create(Writable$1.prototype);
	RedirectableRequest.prototype.abort = function() {
		destroyRequest(this._currentRequest);
		this._currentRequest.abort();
		this.emit("abort");
	};
	RedirectableRequest.prototype.destroy = function(error) {
		destroyRequest(this._currentRequest, error);
		destroy$2.call(this, error);
		return this;
	};
	RedirectableRequest.prototype.write = function(data$1, encoding, callback) {
		if (this._ending) throw new WriteAfterEndError();
		if (!isString(data$1) && !isBuffer$2(data$1)) throw new TypeError("data should be a string, Buffer or Uint8Array");
		if (isFunction$1(encoding)) {
			callback = encoding;
			encoding = null;
		}
		if (data$1.length === 0) {
			if (callback) callback();
			return;
		}
		if (this._requestBodyLength + data$1.length <= this._options.maxBodyLength) {
			this._requestBodyLength += data$1.length;
			this._requestBodyBuffers.push({
				data: data$1,
				encoding
			});
			this._currentRequest.write(data$1, encoding, callback);
		} else {
			this.emit("error", new MaxBodyLengthExceededError());
			this.abort();
		}
	};
	RedirectableRequest.prototype.end = function(data$1, encoding, callback) {
		if (isFunction$1(data$1)) {
			callback = data$1;
			data$1 = encoding = null;
		} else if (isFunction$1(encoding)) {
			callback = encoding;
			encoding = null;
		}
		if (!data$1) {
			this._ended = this._ending = true;
			this._currentRequest.end(null, null, callback);
		} else {
			var self$1 = this;
			var currentRequest = this._currentRequest;
			this.write(data$1, encoding, function() {
				self$1._ended = true;
				currentRequest.end(null, null, callback);
			});
			this._ending = true;
		}
	};
	RedirectableRequest.prototype.setHeader = function(name$1, value) {
		this._options.headers[name$1] = value;
		this._currentRequest.setHeader(name$1, value);
	};
	RedirectableRequest.prototype.removeHeader = function(name$1) {
		delete this._options.headers[name$1];
		this._currentRequest.removeHeader(name$1);
	};
	RedirectableRequest.prototype.setTimeout = function(msecs, callback) {
		var self$1 = this;
		function destroyOnTimeout(socket) {
			socket.setTimeout(msecs);
			socket.removeListener("timeout", socket.destroy);
			socket.addListener("timeout", socket.destroy);
		}
		function startTimer(socket) {
			if (self$1._timeout) clearTimeout(self$1._timeout);
			self$1._timeout = setTimeout(function() {
				self$1.emit("timeout");
				clearTimer();
			}, msecs);
			destroyOnTimeout(socket);
		}
		function clearTimer() {
			if (self$1._timeout) {
				clearTimeout(self$1._timeout);
				self$1._timeout = null;
			}
			self$1.removeListener("abort", clearTimer);
			self$1.removeListener("error", clearTimer);
			self$1.removeListener("response", clearTimer);
			self$1.removeListener("close", clearTimer);
			if (callback) self$1.removeListener("timeout", callback);
			if (!self$1.socket) self$1._currentRequest.removeListener("socket", startTimer);
		}
		if (callback) this.on("timeout", callback);
		if (this.socket) startTimer(this.socket);
		else this._currentRequest.once("socket", startTimer);
		this.on("socket", destroyOnTimeout);
		this.on("abort", clearTimer);
		this.on("error", clearTimer);
		this.on("response", clearTimer);
		this.on("close", clearTimer);
		return this;
	};
	[
		"flushHeaders",
		"getHeader",
		"setNoDelay",
		"setSocketKeepAlive"
	].forEach(function(method) {
		RedirectableRequest.prototype[method] = function(a, b) {
			return this._currentRequest[method](a, b);
		};
	});
	[
		"aborted",
		"connection",
		"socket"
	].forEach(function(property) {
		Object.defineProperty(RedirectableRequest.prototype, property, { get: function() {
			return this._currentRequest[property];
		} });
	});
	RedirectableRequest.prototype._sanitizeOptions = function(options) {
		if (!options.headers) options.headers = {};
		if (!isArray(options.sensitiveHeaders)) options.sensitiveHeaders = [];
		if (options.host) {
			if (!options.hostname) options.hostname = options.host;
			delete options.host;
		}
		if (!options.pathname && options.path) {
			var searchPos = options.path.indexOf("?");
			if (searchPos < 0) options.pathname = options.path;
			else {
				options.pathname = options.path.substring(0, searchPos);
				options.search = options.path.substring(searchPos);
			}
		}
	};
	RedirectableRequest.prototype._performRequest = function() {
		var protocol = this._options.protocol;
		var nativeProtocol = this._options.nativeProtocols[protocol];
		if (!nativeProtocol) throw new TypeError("Unsupported protocol " + protocol);
		if (this._options.agents) {
			var scheme = protocol.slice(0, -1);
			this._options.agent = this._options.agents[scheme];
		}
		var request$1 = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
		request$1._redirectable = this;
		for (var event of events$1) request$1.on(event, eventHandlers[event]);
		this._currentUrl = /^\//.test(this._options.path) ? url$1.format(this._options) : this._options.path;
		if (this._isRedirect) {
			var i = 0;
			var self$1 = this;
			var buffers = this._requestBodyBuffers;
			(function writeNext(error) {
				// istanbul ignore else
				if (request$1 === self$1._currentRequest) {
					// istanbul ignore if
					if (error) self$1.emit("error", error);
					else if (i < buffers.length) {
						var buffer$1 = buffers[i++];
						// istanbul ignore else
						if (!request$1.finished) request$1.write(buffer$1.data, buffer$1.encoding, writeNext);
					} else if (self$1._ended) request$1.end();
				}
			})();
		}
	};
	RedirectableRequest.prototype._processResponse = function(response) {
		var statusCode = response.statusCode;
		if (this._options.trackRedirects) this._redirects.push({
			url: this._currentUrl,
			headers: response.headers,
			statusCode
		});
		var location = response.headers.location;
		if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) {
			response.responseUrl = this._currentUrl;
			response.redirects = this._redirects;
			this.emit("response", response);
			this._requestBodyBuffers = [];
			return;
		}
		destroyRequest(this._currentRequest);
		response.destroy();
		if (++this._redirectCount > this._options.maxRedirects) throw new TooManyRedirectsError();
		var requestHeaders;
		var beforeRedirect = this._options.beforeRedirect;
		if (beforeRedirect) requestHeaders = Object.assign({ Host: response.req.getHeader("host") }, this._options.headers);
		var method = this._options.method;
		if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) {
			this._options.method = "GET";
			this._requestBodyBuffers = [];
			removeMatchingHeaders(/^content-/i, this._options.headers);
		}
		var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
		var currentUrlParts = parseUrl$1(this._currentUrl);
		var currentHost = currentHostHeader || currentUrlParts.host;
		var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url$1.format(Object.assign(currentUrlParts, { host: currentHost }));
		var redirectUrl = resolveUrl(location, currentUrl);
		debug$11("redirecting to", redirectUrl.href);
		this._isRedirect = true;
		spreadUrlObject(redirectUrl, this._options);
		if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) removeMatchingHeaders(this._headerFilter, this._options.headers);
		if (isFunction$1(beforeRedirect)) {
			var responseDetails = {
				headers: response.headers,
				statusCode
			};
			var requestDetails = {
				url: currentUrl,
				method,
				headers: requestHeaders
			};
			beforeRedirect(this._options, responseDetails, requestDetails);
			this._sanitizeOptions(this._options);
		}
		this._performRequest();
	};
	function wrap(protocols) {
		var exports$1 = {
			maxRedirects: 21,
			maxBodyLength: 10 * 1024 * 1024
		};
		var nativeProtocols = {};
		Object.keys(protocols).forEach(function(scheme) {
			var protocol = scheme + ":";
			var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
			var wrappedProtocol = exports$1[scheme] = Object.create(nativeProtocol);
			function request$1(input, options, callback) {
				if (isURL(input)) input = spreadUrlObject(input);
				else if (isString(input)) input = spreadUrlObject(parseUrl$1(input));
				else {
					callback = options;
					options = validateUrl(input);
					input = { protocol };
				}
				if (isFunction$1(options)) {
					callback = options;
					options = null;
				}
				options = Object.assign({
					maxRedirects: exports$1.maxRedirects,
					maxBodyLength: exports$1.maxBodyLength
				}, input, options);
				options.nativeProtocols = nativeProtocols;
				if (!isString(options.host) && !isString(options.hostname)) options.hostname = "::1";
				assert$28.equal(options.protocol, protocol, "protocol mismatch");
				debug$11("options", options);
				return new RedirectableRequest(options, callback);
			}
			function get(input, options, callback) {
				var wrappedRequest = wrappedProtocol.request(input, options, callback);
				wrappedRequest.end();
				return wrappedRequest;
			}
			Object.defineProperties(wrappedProtocol, {
				request: {
					value: request$1,
					configurable: true,
					enumerable: true,
					writable: true
				},
				get: {
					value: get,
					configurable: true,
					enumerable: true,
					writable: true
				}
			});
		});
		return exports$1;
	}
	function noop$6() {}
	function parseUrl$1(input) {
		var parsed;
		// istanbul ignore else
		if (useNativeURL) parsed = new URL$2(input);
		else {
			parsed = validateUrl(url$1.parse(input));
			if (!isString(parsed.protocol)) throw new InvalidUrlError({ input });
		}
		return parsed;
	}
	function resolveUrl(relative$1, base) {
		// istanbul ignore next
		return useNativeURL ? new URL$2(relative$1, base) : parseUrl$1(url$1.resolve(base, relative$1));
	}
	function validateUrl(input) {
		if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) throw new InvalidUrlError({ input: input.href || input });
		if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) throw new InvalidUrlError({ input: input.href || input });
		return input;
	}
	function spreadUrlObject(urlObject, target) {
		var spread$1 = target || {};
		for (var key of preservedUrlFields) spread$1[key] = urlObject[key];
		if (spread$1.hostname.startsWith("[")) spread$1.hostname = spread$1.hostname.slice(1, -1);
		if (spread$1.port !== "") spread$1.port = Number(spread$1.port);
		spread$1.path = spread$1.search ? spread$1.pathname + spread$1.search : spread$1.pathname;
		return spread$1;
	}
	function removeMatchingHeaders(regex, headers) {
		var lastValue;
		for (var header in headers) if (regex.test(header)) {
			lastValue = headers[header];
			delete headers[header];
		}
		return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
	}
	function createErrorType(code, message, baseClass) {
		function CustomError(properties) {
			// istanbul ignore else
			if (isFunction$1(Error.captureStackTrace)) Error.captureStackTrace(this, this.constructor);
			Object.assign(this, properties || {});
			this.code = code;
			this.message = this.cause ? message + ": " + this.cause.message : message;
		}
		CustomError.prototype = new (baseClass || Error)();
		Object.defineProperties(CustomError.prototype, {
			constructor: {
				value: CustomError,
				enumerable: false
			},
			name: {
				value: "Error [" + code + "]",
				enumerable: false
			}
		});
		return CustomError;
	}
	function destroyRequest(request$1, error) {
		for (var event of events$1) request$1.removeListener(event, eventHandlers[event]);
		request$1.on("error", noop$6);
		request$1.destroy(error);
	}
	function isSubdomain(subdomain, domain) {
		assert$28(isString(subdomain) && isString(domain));
		var dot = subdomain.length - domain.length - 1;
		return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
	}
	function isArray(value) {
		return value instanceof Array;
	}
	function isString(value) {
		return typeof value === "string" || value instanceof String;
	}
	function isFunction$1(value) {
		return typeof value === "function";
	}
	function isBuffer$2(value) {
		return typeof value === "object" && "length" in value;
	}
	function isURL(value) {
		return URL$2 && value instanceof URL$2;
	}
	function escapeRegex(regex) {
		return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
	}
	module.exports = wrap({
		http: http$8,
		https: https$6
	});
	module.exports.wrap = wrap;
}));
const VERSION = "1.15.0";
function parseProtocol(url$3) {
	const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url$3);
	return match && match[1] || "";
}
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
function fromDataURI(uri, asBlob, options) {
	const _Blob = options && options.Blob || platform_default.classes.Blob;
	const protocol = parseProtocol(uri);
	if (asBlob === void 0 && _Blob) asBlob = true;
	if (protocol === "data") {
		uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
		const match = DATA_URL_PATTERN.exec(uri);
		if (!match) throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL);
		const mime$1 = match[1];
		const isBase64 = match[2];
		const body = match[3];
		const buffer$1 = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
		if (asBlob) {
			if (!_Blob) throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
			return new _Blob([buffer$1], { type: mime$1 });
		}
		return buffer$1;
	}
	throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
}
var kInternals = Symbol("internals");
var AxiosTransformStream = class extends stream.default.Transform {
	constructor(options) {
		options = utils_default.toFlatObject(options, {
			maxRate: 0,
			chunkSize: 64 * 1024,
			minChunkSize: 100,
			timeWindow: 500,
			ticksRate: 2,
			samplesCount: 15
		}, null, (prop, source) => {
			return !utils_default.isUndefined(source[prop]);
		});
		super({ readableHighWaterMark: options.chunkSize });
		const internals = this[kInternals] = {
			timeWindow: options.timeWindow,
			chunkSize: options.chunkSize,
			maxRate: options.maxRate,
			minChunkSize: options.minChunkSize,
			bytesSeen: 0,
			isCaptured: false,
			notifiedBytesLoaded: 0,
			ts: Date.now(),
			bytes: 0,
			onReadCallback: null
		};
		this.on("newListener", (event) => {
			if (event === "progress") {
				if (!internals.isCaptured) internals.isCaptured = true;
			}
		});
	}
	_read(size) {
		const internals = this[kInternals];
		if (internals.onReadCallback) internals.onReadCallback();
		return super._read(size);
	}
	_transform(chunk, encoding, callback) {
		const internals = this[kInternals];
		const maxRate = internals.maxRate;
		const readableHighWaterMark = this.readableHighWaterMark;
		const timeWindow = internals.timeWindow;
		const bytesThreshold = maxRate / (1e3 / timeWindow);
		const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * .01) : 0;
		const pushChunk = (_chunk, _callback) => {
			const bytes = Buffer.byteLength(_chunk);
			internals.bytesSeen += bytes;
			internals.bytes += bytes;
			internals.isCaptured && this.emit("progress", internals.bytesSeen);
			if (this.push(_chunk)) process.nextTick(_callback);
			else internals.onReadCallback = () => {
				internals.onReadCallback = null;
				process.nextTick(_callback);
			};
		};
		const transformChunk = (_chunk, _callback) => {
			const chunkSize = Buffer.byteLength(_chunk);
			let chunkRemainder = null;
			let maxChunkSize = readableHighWaterMark;
			let bytesLeft;
			let passed = 0;
			if (maxRate) {
				const now = Date.now();
				if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
					internals.ts = now;
					bytesLeft = bytesThreshold - internals.bytes;
					internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
					passed = 0;
				}
				bytesLeft = bytesThreshold - internals.bytes;
			}
			if (maxRate) {
				if (bytesLeft <= 0) return setTimeout(() => {
					_callback(null, _chunk);
				}, timeWindow - passed);
				if (bytesLeft < maxChunkSize) maxChunkSize = bytesLeft;
			}
			if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
				chunkRemainder = _chunk.subarray(maxChunkSize);
				_chunk = _chunk.subarray(0, maxChunkSize);
			}
			pushChunk(_chunk, chunkRemainder ? () => {
				process.nextTick(_callback, null, chunkRemainder);
			} : _callback);
		};
		transformChunk(chunk, function transformNextChunk(err, _chunk) {
			if (err) return callback(err);
			if (_chunk) transformChunk(_chunk, transformNextChunk);
			else callback(null);
		});
	}
};
var AxiosTransformStream_default = AxiosTransformStream;
var { asyncIterator } = Symbol;
var readBlob = async function* (blob) {
	if (blob.stream) yield* blob.stream();
	else if (blob.arrayBuffer) yield await blob.arrayBuffer();
	else if (blob[asyncIterator]) yield* blob[asyncIterator]();
	else yield blob;
};
var readBlob_default = readBlob;
var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
var textEncoder$2 = typeof TextEncoder === "function" ? new TextEncoder() : new util.default.TextEncoder();
var CRLF = "\r\n";
var CRLF_BYTES = textEncoder$2.encode(CRLF);
var CRLF_BYTES_COUNT = 2;
var FormDataPart = class {
	constructor(name$1, value) {
		const { escapeName } = this.constructor;
		const isStringValue = utils_default.isString(value);
		let headers = `Content-Disposition: form-data; name="${escapeName(name$1)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
		if (isStringValue) value = textEncoder$2.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
		else headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
		this.headers = textEncoder$2.encode(headers + CRLF);
		this.contentLength = isStringValue ? value.byteLength : value.size;
		this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
		this.name = name$1;
		this.value = value;
	}
	async *encode() {
		yield this.headers;
		const { value } = this;
		if (utils_default.isTypedArray(value)) yield value;
		else yield* readBlob_default(value);
		yield CRLF_BYTES;
	}
	static escapeName(name$1) {
		return String(name$1).replace(/[\r\n"]/g, (match) => ({
			"\r": "%0D",
			"\n": "%0A",
			"\"": "%22"
		})[match]);
	}
};
var formDataToStream = (form, headersHandler, options) => {
	const { tag = "form-data-boundary", size = 25, boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET) } = options || {};
	if (!utils_default.isFormData(form)) throw TypeError("FormData instance required");
	if (boundary.length < 1 || boundary.length > 70) throw Error("boundary must be 10-70 characters long");
	const boundaryBytes = textEncoder$2.encode("--" + boundary + CRLF);
	const footerBytes = textEncoder$2.encode("--" + boundary + "--\r\n");
	let contentLength = footerBytes.byteLength;
	const parts = Array.from(form.entries()).map(([name$1, value]) => {
		const part = new FormDataPart(name$1, value);
		contentLength += part.size;
		return part;
	});
	contentLength += boundaryBytes.byteLength * parts.length;
	contentLength = utils_default.toFiniteNumber(contentLength);
	const computedHeaders = { "Content-Type": `multipart/form-data; boundary=${boundary}` };
	if (Number.isFinite(contentLength)) computedHeaders["Content-Length"] = contentLength;
	headersHandler && headersHandler(computedHeaders);
	return stream.Readable.from((async function* () {
		for (const part of parts) {
			yield boundaryBytes;
			yield* part.encode();
		}
		yield footerBytes;
	})());
};
var formDataToStream_default = formDataToStream;
var ZlibHeaderTransformStream = class extends stream.default.Transform {
	__transform(chunk, encoding, callback) {
		this.push(chunk);
		callback();
	}
	_transform(chunk, encoding, callback) {
		if (chunk.length !== 0) {
			this._transform = this.__transform;
			if (chunk[0] !== 120) {
				const header = Buffer.alloc(2);
				header[0] = 120;
				header[1] = 156;
				this.push(header, encoding);
			}
		}
		this.__transform(chunk, encoding, callback);
	}
};
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
var callbackify = (fn, reducer) => {
	return utils_default.isAsyncFn(fn) ? function(...args) {
		const cb = args.pop();
		fn.apply(this, args).then((value) => {
			try {
				reducer ? cb(null, ...reducer(value)) : cb(null, value);
			} catch (err) {
				cb(err);
			}
		}, cb);
	} : fn;
};
var callbackify_default = callbackify;
var DEFAULT_PORTS$2 = {
	http: 80,
	https: 443,
	ws: 80,
	wss: 443,
	ftp: 21
};
var parseNoProxyEntry = (entry) => {
	let entryHost = entry;
	let entryPort = 0;
	if (entryHost.charAt(0) === "[") {
		const bracketIndex = entryHost.indexOf("]");
		if (bracketIndex !== -1) {
			const host = entryHost.slice(1, bracketIndex);
			const rest = entryHost.slice(bracketIndex + 1);
			if (rest.charAt(0) === ":" && /^\d+$/.test(rest.slice(1))) entryPort = Number.parseInt(rest.slice(1), 10);
			return [host, entryPort];
		}
	}
	const firstColon = entryHost.indexOf(":");
	const lastColon = entryHost.lastIndexOf(":");
	if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
		entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
		entryHost = entryHost.slice(0, lastColon);
	}
	return [entryHost, entryPort];
};
var normalizeNoProxyHost = (hostname) => {
	if (!hostname) return hostname;
	if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") hostname = hostname.slice(1, -1);
	return hostname.replace(/\.+$/, "");
};
function shouldBypassProxy(location) {
	let parsed;
	try {
		parsed = new URL(location);
	} catch (_err) {
		return false;
	}
	const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").toLowerCase();
	if (!noProxy) return false;
	if (noProxy === "*") return true;
	const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS$2[parsed.protocol.split(":", 1)[0]] || 0;
	const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
	return noProxy.split(/[\s,]+/).some((entry) => {
		if (!entry) return false;
		let [entryHost, entryPort] = parseNoProxyEntry(entry);
		entryHost = normalizeNoProxyHost(entryHost);
		if (!entryHost) return false;
		if (entryPort && entryPort !== port) return false;
		if (entryHost.charAt(0) === "*") entryHost = entryHost.slice(1);
		if (entryHost.charAt(0) === ".") return hostname.endsWith(entryHost);
		return hostname === entryHost;
	});
}
function speedometer(samplesCount, min$1) {
	samplesCount = samplesCount || 10;
	const bytes = new Array(samplesCount);
	const timestamps = new Array(samplesCount);
	let head = 0;
	let tail$1 = 0;
	let firstSampleTS;
	min$1 = min$1 !== void 0 ? min$1 : 1e3;
	return function push(chunkLength) {
		const now = Date.now();
		const startedAt = timestamps[tail$1];
		if (!firstSampleTS) firstSampleTS = now;
		bytes[head] = chunkLength;
		timestamps[head] = now;
		let i = tail$1;
		let bytesCount = 0;
		while (i !== head) {
			bytesCount += bytes[i++];
			i = i % samplesCount;
		}
		head = (head + 1) % samplesCount;
		if (head === tail$1) tail$1 = (tail$1 + 1) % samplesCount;
		if (now - firstSampleTS < min$1) return;
		const passed = startedAt && now - startedAt;
		return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
	};
}
var speedometer_default = speedometer;
function throttle(fn, freq) {
	let timestamp = 0;
	let threshold = 1e3 / freq;
	let lastArgs;
	let timer;
	const invoke = (args, now = Date.now()) => {
		timestamp = now;
		lastArgs = null;
		if (timer) {
			clearTimeout(timer);
			timer = null;
		}
		fn(...args);
	};
	const throttled = (...args) => {
		const now = Date.now();
		const passed = now - timestamp;
		if (passed >= threshold) invoke(args, now);
		else {
			lastArgs = args;
			if (!timer) timer = setTimeout(() => {
				timer = null;
				invoke(lastArgs);
			}, threshold - passed);
		}
	};
	const flush = () => lastArgs && invoke(lastArgs);
	return [throttled, flush];
}
var throttle_default = throttle;
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
	let bytesNotified = 0;
	const _speedometer = speedometer_default(50, 250);
	return throttle_default((e) => {
		const loaded = e.loaded;
		const total = e.lengthComputable ? e.total : void 0;
		const progressBytes = loaded - bytesNotified;
		const rate = _speedometer(progressBytes);
		const inRange = loaded <= total;
		bytesNotified = loaded;
		listener({
			loaded,
			total,
			progress: total ? loaded / total : void 0,
			bytes: progressBytes,
			rate: rate ? rate : void 0,
			estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
			event: e,
			lengthComputable: total != null,
			[isDownloadStream ? "download" : "upload"]: true
		});
	}, freq);
};
const progressEventDecorator = (total, throttled) => {
	const lengthComputable = total != null;
	return [(loaded) => throttled[0]({
		lengthComputable,
		total,
		loaded
	}), throttled[1]];
};
const asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
function estimateDataURLDecodedBytes(url$3) {
	if (!url$3 || typeof url$3 !== "string") return 0;
	if (!url$3.startsWith("data:")) return 0;
	const comma = url$3.indexOf(",");
	if (comma < 0) return 0;
	const meta = url$3.slice(5, comma);
	const body = url$3.slice(comma + 1);
	if (/;base64/i.test(meta)) {
		let effectiveLen = body.length;
		const len = body.length;
		for (let i = 0; i < len; i++) if (body.charCodeAt(i) === 37 && i + 2 < len) {
			const a = body.charCodeAt(i + 1);
			const b = body.charCodeAt(i + 2);
			if ((a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102)) {
				effectiveLen -= 2;
				i += 2;
			}
		}
		let pad = 0;
		let idx = len - 1;
		const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && body.charCodeAt(j - 1) === 51 && (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
		if (idx >= 0) {
			if (body.charCodeAt(idx) === 61) {
				pad++;
				idx--;
			} else if (tailIsPct3D(idx)) {
				pad++;
				idx -= 3;
			}
		}
		if (pad === 1 && idx >= 0) {
			if (body.charCodeAt(idx) === 61) pad++;
			else if (tailIsPct3D(idx)) pad++;
		}
		const bytes = Math.floor(effectiveLen / 4) * 3 - (pad || 0);
		return bytes > 0 ? bytes : 0;
	}
	return Buffer.byteLength(body, "utf8");
}
var import_follow_redirects = /* @__PURE__ */ __toESM(require_follow_redirects(), 1);
var zlibOptions = {
	flush: zlib.default.constants.Z_SYNC_FLUSH,
	finishFlush: zlib.default.constants.Z_SYNC_FLUSH
};
var brotliOptions = {
	flush: zlib.default.constants.BROTLI_OPERATION_FLUSH,
	finishFlush: zlib.default.constants.BROTLI_OPERATION_FLUSH
};
var isBrotliSupported = utils_default.isFunction(zlib.default.createBrotliDecompress);
var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
var isHttps = /https:?/;
var supportedProtocols = platform_default.protocols.map((protocol) => {
	return protocol + ":";
});
var flushOnFinish = (stream$7, [throttled, flush]) => {
	stream$7.on("end", flush).on("error", flush);
	return throttled;
};
var Http2Sessions = class {
	constructor() {
		this.sessions = Object.create(null);
	}
	getSession(authority, options) {
		options = Object.assign({ sessionTimeout: 1e3 }, options);
		let authoritySessions = this.sessions[authority];
		if (authoritySessions) {
			let len = authoritySessions.length;
			for (let i = 0; i < len; i++) {
				const [sessionHandle, sessionOptions] = authoritySessions[i];
				if (!sessionHandle.destroyed && !sessionHandle.closed && util.default.isDeepStrictEqual(sessionOptions, options)) return sessionHandle;
			}
		}
		const session = http2.default.connect(authority, options);
		let removed;
		const removeSession = () => {
			if (removed) return;
			removed = true;
			let entries = authoritySessions, len = entries.length, i = len;
			while (i--) if (entries[i][0] === session) {
				if (len === 1) delete this.sessions[authority];
				else entries.splice(i, 1);
				if (!session.closed) session.close();
				return;
			}
		};
		const originalRequestFn = session.request;
		const { sessionTimeout } = options;
		if (sessionTimeout != null) {
			let timer;
			let streamsCount = 0;
			session.request = function() {
				const stream$7 = originalRequestFn.apply(this, arguments);
				streamsCount++;
				if (timer) {
					clearTimeout(timer);
					timer = null;
				}
				stream$7.once("close", () => {
					if (!--streamsCount) timer = setTimeout(() => {
						timer = null;
						removeSession();
					}, sessionTimeout);
				});
				return stream$7;
			};
		}
		session.once("close", removeSession);
		let entry = [session, options];
		authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
		return session;
	}
};
var http2Sessions = new Http2Sessions();
function dispatchBeforeRedirect(options, responseDetails) {
	if (options.beforeRedirects.proxy) options.beforeRedirects.proxy(options);
	if (options.beforeRedirects.config) options.beforeRedirects.config(options, responseDetails);
}
function setProxy(options, configProxy, location) {
	let proxy = configProxy;
	if (!proxy && proxy !== false) {
		const proxyUrl = getProxyForUrl$1(location);
		if (proxyUrl) {
			if (!shouldBypassProxy(location)) proxy = new URL(proxyUrl);
		}
	}
	if (proxy) {
		if (proxy.username) proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
		if (proxy.auth) {
			if (Boolean(proxy.auth.username || proxy.auth.password)) proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
			else if (typeof proxy.auth === "object") throw new AxiosError_default("Invalid proxy authorization", AxiosError_default.ERR_BAD_OPTION, { proxy });
			const base64$1 = Buffer.from(proxy.auth, "utf8").toString("base64");
			options.headers["Proxy-Authorization"] = "Basic " + base64$1;
		}
		options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
		const proxyHost = proxy.hostname || proxy.host;
		options.hostname = proxyHost;
		options.host = proxyHost;
		options.port = proxy.port;
		options.path = location;
		if (proxy.protocol) options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
	}
	options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
		setProxy(redirectOptions, configProxy, redirectOptions.href);
	};
}
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
var wrapAsync = (asyncExecutor) => {
	return new Promise((resolve, reject) => {
		let onDone;
		let isDone;
		const done = (value, isRejected) => {
			if (isDone) return;
			isDone = true;
			onDone && onDone(value, isRejected);
		};
		const _resolve = (value) => {
			done(value);
			resolve(value);
		};
		const _reject = (reason) => {
			done(reason, true);
			reject(reason);
		};
		asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
	});
};
var resolveFamily = ({ address, family }) => {
	if (!utils_default.isString(address)) throw TypeError("address must be a string");
	return {
		address,
		family: family || (address.indexOf(".") < 0 ? 6 : 4)
	};
};
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : {
	address,
	family
});
var http2Transport = { request(options, cb) {
	const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
	const { http2Options, headers } = options;
	const session = http2Sessions.getSession(authority, http2Options);
	const { HTTP2_HEADER_SCHEME: HTTP2_HEADER_SCHEME$1, HTTP2_HEADER_METHOD: HTTP2_HEADER_METHOD$1, HTTP2_HEADER_PATH: HTTP2_HEADER_PATH$1, HTTP2_HEADER_STATUS: HTTP2_HEADER_STATUS$1 } = http2.default.constants;
	const http2Headers = {
		[HTTP2_HEADER_SCHEME$1]: options.protocol.replace(":", ""),
		[HTTP2_HEADER_METHOD$1]: options.method,
		[HTTP2_HEADER_PATH$1]: options.path
	};
	utils_default.forEach(headers, (header, name$1) => {
		name$1.charAt(0) !== ":" && (http2Headers[name$1] = header);
	});
	const req$1 = session.request(http2Headers);
	req$1.once("response", (responseHeaders) => {
		const response = req$1;
		responseHeaders = Object.assign({}, responseHeaders);
		const status = responseHeaders[HTTP2_HEADER_STATUS$1];
		delete responseHeaders[HTTP2_HEADER_STATUS$1];
		response.headers = responseHeaders;
		response.statusCode = +status;
		cb(response);
	});
	return req$1;
} };
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
	return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
		let { data: data$1, lookup: lookup$2, family, httpVersion = 1, http2Options } = config;
		const { responseType, responseEncoding } = config;
		const method = config.method.toUpperCase();
		let isDone;
		let rejected = false;
		let req$1;
		httpVersion = +httpVersion;
		if (Number.isNaN(httpVersion)) throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
		if (httpVersion !== 1 && httpVersion !== 2) throw TypeError(`Unsupported protocol version '${httpVersion}'`);
		const isHttp2 = httpVersion === 2;
		if (lookup$2) {
			const _lookup = callbackify_default(lookup$2, (value) => utils_default.isArray(value) ? value : [value]);
			lookup$2 = (hostname, opt, cb) => {
				_lookup(hostname, opt, (err, arg0, arg1) => {
					if (err) return cb(err);
					const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
					opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
				});
			};
		}
		const abortEmitter = new events.EventEmitter();
		function abort$4(reason) {
			try {
				abortEmitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req$1) : reason);
			} catch (err) {
				console.warn("emit error", err);
			}
		}
		abortEmitter.once("abort", reject);
		const onFinished = () => {
			if (config.cancelToken) config.cancelToken.unsubscribe(abort$4);
			if (config.signal) config.signal.removeEventListener("abort", abort$4);
			abortEmitter.removeAllListeners();
		};
		if (config.cancelToken || config.signal) {
			config.cancelToken && config.cancelToken.subscribe(abort$4);
			if (config.signal) config.signal.aborted ? abort$4() : config.signal.addEventListener("abort", abort$4);
		}
		onDone((response, isRejected) => {
			isDone = true;
			if (isRejected) {
				rejected = true;
				onFinished();
				return;
			}
			const { data: data$2 } = response;
			if (data$2 instanceof stream.default.Readable || data$2 instanceof stream.default.Duplex) {
				const offListeners = stream.default.finished(data$2, () => {
					offListeners();
					onFinished();
				});
			} else onFinished();
		});
		const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
		const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
		const protocol = parsed.protocol || supportedProtocols[0];
		if (protocol === "data:") {
			if (config.maxContentLength > -1) {
				if (estimateDataURLDecodedBytes(String(config.url || fullPath || "")) > config.maxContentLength) return reject(new AxiosError_default("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config));
			}
			let convertedData;
			if (method !== "GET") return settle(resolve, reject, {
				status: 405,
				statusText: "method not allowed",
				headers: {},
				config
			});
			try {
				convertedData = fromDataURI(config.url, responseType === "blob", { Blob: config.env && config.env.Blob });
			} catch (err) {
				throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config);
			}
			if (responseType === "text") {
				convertedData = convertedData.toString(responseEncoding);
				if (!responseEncoding || responseEncoding === "utf8") convertedData = utils_default.stripBOM(convertedData);
			} else if (responseType === "stream") convertedData = stream.default.Readable.from(convertedData);
			return settle(resolve, reject, {
				data: convertedData,
				status: 200,
				statusText: "OK",
				headers: new AxiosHeaders_default(),
				config
			});
		}
		if (supportedProtocols.indexOf(protocol) === -1) return reject(new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_BAD_REQUEST, config));
		const headers = AxiosHeaders_default.from(config.headers).normalize();
		headers.set("User-Agent", "axios/1.15.0", false);
		const { onUploadProgress, onDownloadProgress } = config;
		const maxRate = config.maxRate;
		let maxUploadRate = void 0;
		let maxDownloadRate = void 0;
		if (utils_default.isSpecCompliantForm(data$1)) {
			const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
			data$1 = formDataToStream_default(data$1, (formHeaders) => {
				headers.set(formHeaders);
			}, {
				tag: `axios-1.15.0-boundary`,
				boundary: userBoundary && userBoundary[1] || void 0
			});
		} else if (utils_default.isFormData(data$1) && utils_default.isFunction(data$1.getHeaders)) {
			headers.set(data$1.getHeaders());
			if (!headers.hasContentLength()) try {
				const knownLength = await util.default.promisify(data$1.getLength).call(data$1);
				Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
			} catch (e) {}
		} else if (utils_default.isBlob(data$1) || utils_default.isFile(data$1)) {
			data$1.size && headers.setContentType(data$1.type || "application/octet-stream");
			headers.setContentLength(data$1.size || 0);
			data$1 = stream.default.Readable.from(readBlob_default(data$1));
		} else if (data$1 && !utils_default.isStream(data$1)) {
			if (Buffer.isBuffer(data$1)) {} else if (utils_default.isArrayBuffer(data$1)) data$1 = Buffer.from(new Uint8Array(data$1));
			else if (utils_default.isString(data$1)) data$1 = Buffer.from(data$1, "utf-8");
			else return reject(new AxiosError_default("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError_default.ERR_BAD_REQUEST, config));
			headers.setContentLength(data$1.length, false);
			if (config.maxBodyLength > -1 && data$1.length > config.maxBodyLength) return reject(new AxiosError_default("Request body larger than maxBodyLength limit", AxiosError_default.ERR_BAD_REQUEST, config));
		}
		const contentLength = utils_default.toFiniteNumber(headers.getContentLength());
		if (utils_default.isArray(maxRate)) {
			maxUploadRate = maxRate[0];
			maxDownloadRate = maxRate[1];
		} else maxUploadRate = maxDownloadRate = maxRate;
		if (data$1 && (onUploadProgress || maxUploadRate)) {
			if (!utils_default.isStream(data$1)) data$1 = stream.default.Readable.from(data$1, { objectMode: false });
			data$1 = stream.default.pipeline([data$1, new AxiosTransformStream_default({ maxRate: utils_default.toFiniteNumber(maxUploadRate) })], utils_default.noop);
			onUploadProgress && data$1.on("progress", flushOnFinish(data$1, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
		}
		let auth = void 0;
		if (config.auth) {
			const username = config.auth.username || "";
			const password = config.auth.password || "";
			auth = username + ":" + password;
		}
		if (!auth && parsed.username) {
			const urlUsername = parsed.username;
			const urlPassword = parsed.password;
			auth = urlUsername + ":" + urlPassword;
		}
		auth && headers.delete("authorization");
		let path$1;
		try {
			path$1 = buildURL$4(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, "");
		} catch (err) {
			const customErr = new Error(err.message);
			customErr.config = config;
			customErr.url = config.url;
			customErr.exists = true;
			return reject(customErr);
		}
		headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
		const options = {
			path: path$1,
			method,
			headers: headers.toJSON(),
			agents: {
				http: config.httpAgent,
				https: config.httpsAgent
			},
			auth,
			protocol,
			family,
			beforeRedirect: dispatchBeforeRedirect,
			beforeRedirects: {},
			http2Options
		};
		!utils_default.isUndefined(lookup$2) && (options.lookup = lookup$2);
		if (config.socketPath) options.socketPath = config.socketPath;
		else {
			options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
			options.port = parsed.port;
			setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
		}
		let transport;
		const isHttpsRequest = isHttps.test(options.protocol);
		options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
		if (isHttp2) transport = http2Transport;
		else if (config.transport) transport = config.transport;
		else if (config.maxRedirects === 0) transport = isHttpsRequest ? https.default : http.default;
		else {
			if (config.maxRedirects) options.maxRedirects = config.maxRedirects;
			if (config.beforeRedirect) options.beforeRedirects.config = config.beforeRedirect;
			transport = isHttpsRequest ? httpsFollow : httpFollow;
		}
		if (config.maxBodyLength > -1) options.maxBodyLength = config.maxBodyLength;
		else options.maxBodyLength = Infinity;
		if (config.insecureHTTPParser) options.insecureHTTPParser = config.insecureHTTPParser;
		req$1 = transport.request(options, function handleResponse(res) {
			if (req$1.destroyed) return;
			const streams = [res];
			const responseLength = utils_default.toFiniteNumber(res.headers["content-length"]);
			if (onDownloadProgress || maxDownloadRate) {
				const transformStream = new AxiosTransformStream_default({ maxRate: utils_default.toFiniteNumber(maxDownloadRate) });
				onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
				streams.push(transformStream);
			}
			let responseStream = res;
			const lastRequest = res.req || req$1;
			if (config.decompress !== false && res.headers["content-encoding"]) {
				if (method === "HEAD" || res.statusCode === 204) delete res.headers["content-encoding"];
				switch ((res.headers["content-encoding"] || "").toLowerCase()) {
					case "gzip":
					case "x-gzip":
					case "compress":
					case "x-compress":
						streams.push(zlib.default.createUnzip(zlibOptions));
						delete res.headers["content-encoding"];
						break;
					case "deflate":
						streams.push(new ZlibHeaderTransformStream_default());
						streams.push(zlib.default.createUnzip(zlibOptions));
						delete res.headers["content-encoding"];
						break;
					case "br": if (isBrotliSupported) {
						streams.push(zlib.default.createBrotliDecompress(brotliOptions));
						delete res.headers["content-encoding"];
					}
				}
			}
			responseStream = streams.length > 1 ? stream.default.pipeline(streams, utils_default.noop) : streams[0];
			const response = {
				status: res.statusCode,
				statusText: res.statusMessage,
				headers: new AxiosHeaders_default(res.headers),
				config,
				request: lastRequest
			};
			if (responseType === "stream") {
				response.data = responseStream;
				settle(resolve, reject, response);
			} else {
				const responseBuffer = [];
				let totalResponseBytes = 0;
				responseStream.on("data", function handleStreamData(chunk) {
					responseBuffer.push(chunk);
					totalResponseBytes += chunk.length;
					if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
						rejected = true;
						responseStream.destroy();
						abort$4(new AxiosError_default("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config, lastRequest));
					}
				});
				responseStream.on("aborted", function handlerStreamAborted() {
					if (rejected) return;
					const err = new AxiosError_default("stream has been aborted", AxiosError_default.ERR_BAD_RESPONSE, config, lastRequest);
					responseStream.destroy(err);
					reject(err);
				});
				responseStream.on("error", function handleStreamError(err) {
					if (req$1.destroyed) return;
					reject(AxiosError_default.from(err, null, config, lastRequest));
				});
				responseStream.on("end", function handleStreamEnd() {
					try {
						let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
						if (responseType !== "arraybuffer") {
							responseData = responseData.toString(responseEncoding);
							if (!responseEncoding || responseEncoding === "utf8") responseData = utils_default.stripBOM(responseData);
						}
						response.data = responseData;
					} catch (err) {
						return reject(AxiosError_default.from(err, null, config, response.request, response));
					}
					settle(resolve, reject, response);
				});
			}
			abortEmitter.once("abort", (err) => {
				if (!responseStream.destroyed) {
					responseStream.emit("error", err);
					responseStream.destroy();
				}
			});
		});
		abortEmitter.once("abort", (err) => {
			if (req$1.close) req$1.close();
			else req$1.destroy(err);
		});
		req$1.on("error", function handleRequestError(err) {
			reject(AxiosError_default.from(err, null, config, req$1));
		});
		req$1.on("socket", function handleRequestSocket(socket) {
			socket.setKeepAlive(true, 1e3 * 60);
		});
		if (config.timeout) {
			const timeout = parseInt(config.timeout, 10);
			if (Number.isNaN(timeout)) {
				abort$4(new AxiosError_default("error trying to parse `config.timeout` to int", AxiosError_default.ERR_BAD_OPTION_VALUE, config, req$1));
				return;
			}
			req$1.setTimeout(timeout, function handleRequestTimeout() {
				if (isDone) return;
				let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
				const transitional = config.transitional || transitional_default;
				if (config.timeoutErrorMessage) timeoutErrorMessage = config.timeoutErrorMessage;
				abort$4(new AxiosError_default(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED, config, req$1));
			});
		} else req$1.setTimeout(0);
		if (utils_default.isStream(data$1)) {
			let ended = false;
			let errored = false;
			data$1.on("end", () => {
				ended = true;
			});
			data$1.once("error", (err) => {
				errored = true;
				req$1.destroy(err);
			});
			data$1.on("close", () => {
				if (!ended && !errored) abort$4(new CanceledError_default("Request stream has been aborted", config, req$1));
			});
			data$1.pipe(req$1);
		} else {
			data$1 && req$1.write(data$1);
			req$1.end();
		}
	});
};
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin$1, isMSIE) => (url$3) => {
	url$3 = new URL(url$3, platform_default.origin);
	return origin$1.protocol === url$3.protocol && origin$1.host === url$3.host && (isMSIE || origin$1.port === url$3.port);
})(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
var cookies_default = platform_default.hasStandardBrowserEnv ? {
	write(name$1, value, expires, path$1, domain, secure, sameSite) {
		if (typeof document === "undefined") return;
		const cookie = [`${name$1}=${encodeURIComponent(value)}`];
		if (utils_default.isNumber(expires)) cookie.push(`expires=${new Date(expires).toUTCString()}`);
		if (utils_default.isString(path$1)) cookie.push(`path=${path$1}`);
		if (utils_default.isString(domain)) cookie.push(`domain=${domain}`);
		if (secure === true) cookie.push("secure");
		if (utils_default.isString(sameSite)) cookie.push(`SameSite=${sameSite}`);
		document.cookie = cookie.join("; ");
	},
	read(name$1) {
		if (typeof document === "undefined") return null;
		const match = document.cookie.match(/* @__PURE__ */ new RegExp("(?:^|; )" + name$1 + "=([^;]*)"));
		return match ? decodeURIComponent(match[1]) : null;
	},
	remove(name$1) {
		this.write(name$1, "", Date.now() - 864e5, "/");
	}
} : {
	write() {},
	read() {
		return null;
	},
	remove() {}
};
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
function mergeConfig(config1, config2) {
	config2 = config2 || {};
	const config = {};
	function getMergedValue(target, source, prop, caseless) {
		if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) return utils_default.merge.call({ caseless }, target, source);
		else if (utils_default.isPlainObject(source)) return utils_default.merge({}, source);
		else if (utils_default.isArray(source)) return source.slice();
		return source;
	}
	function mergeDeepProperties(a, b, prop, caseless) {
		if (!utils_default.isUndefined(b)) return getMergedValue(a, b, prop, caseless);
		else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a, prop, caseless);
	}
	function valueFromConfig2(a, b) {
		if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b);
	}
	function defaultToConfig2(a, b) {
		if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b);
		else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a);
	}
	function mergeDirectKeys(a, b, prop) {
		if (prop in config2) return getMergedValue(a, b);
		else if (prop in config1) return getMergedValue(void 0, a);
	}
	const mergeMap = {
		url: valueFromConfig2,
		method: valueFromConfig2,
		data: valueFromConfig2,
		baseURL: defaultToConfig2,
		transformRequest: defaultToConfig2,
		transformResponse: defaultToConfig2,
		paramsSerializer: defaultToConfig2,
		timeout: defaultToConfig2,
		timeoutMessage: defaultToConfig2,
		withCredentials: defaultToConfig2,
		withXSRFToken: defaultToConfig2,
		adapter: defaultToConfig2,
		responseType: defaultToConfig2,
		xsrfCookieName: defaultToConfig2,
		xsrfHeaderName: defaultToConfig2,
		onUploadProgress: defaultToConfig2,
		onDownloadProgress: defaultToConfig2,
		decompress: defaultToConfig2,
		maxContentLength: defaultToConfig2,
		maxBodyLength: defaultToConfig2,
		beforeRedirect: defaultToConfig2,
		transport: defaultToConfig2,
		httpAgent: defaultToConfig2,
		httpsAgent: defaultToConfig2,
		cancelToken: defaultToConfig2,
		socketPath: defaultToConfig2,
		responseEncoding: defaultToConfig2,
		validateStatus: mergeDirectKeys,
		headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
	};
	utils_default.forEach(Object.keys({
		...config1,
		...config2
	}), function computeConfigValue(prop) {
		if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
		const merge$1 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
		const configValue = merge$1(config1[prop], config2[prop], prop);
		utils_default.isUndefined(configValue) && merge$1 !== mergeDirectKeys || (config[prop] = configValue);
	});
	return config;
}
var resolveConfig_default = (config) => {
	const newConfig = mergeConfig({}, config);
	let { data: data$1, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
	newConfig.headers = headers = AxiosHeaders_default.from(headers);
	newConfig.url = buildURL$4(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
	if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
	if (utils_default.isFormData(data$1)) {
		if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0);
		else if (utils_default.isFunction(data$1.getHeaders)) {
			const formHeaders = data$1.getHeaders();
			const allowedHeaders = ["content-type", "content-length"];
			Object.entries(formHeaders).forEach(([key, val]) => {
				if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val);
			});
		}
	}
	if (platform_default.hasStandardBrowserEnv) {
		withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
		if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
			const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
			if (xsrfValue) headers.set(xsrfHeaderName, xsrfValue);
		}
	}
	return newConfig;
};
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
var xhr_default = isXHRAdapterSupported && function(config) {
	return new Promise(function dispatchXhrRequest(resolve, reject) {
		const _config = resolveConfig_default(config);
		let requestData = _config.data;
		const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
		let { responseType, onUploadProgress, onDownloadProgress } = _config;
		let onCanceled;
		let uploadThrottled, downloadThrottled;
		let flushUpload, flushDownload;
		function done() {
			flushUpload && flushUpload();
			flushDownload && flushDownload();
			_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
			_config.signal && _config.signal.removeEventListener("abort", onCanceled);
		}
		let request$1 = new XMLHttpRequest();
		request$1.open(_config.method.toUpperCase(), _config.url, true);
		request$1.timeout = _config.timeout;
		function onloadend() {
			if (!request$1) return;
			const responseHeaders = AxiosHeaders_default.from("getAllResponseHeaders" in request$1 && request$1.getAllResponseHeaders());
			settle(function _resolve(value) {
				resolve(value);
				done();
			}, function _reject(err) {
				reject(err);
				done();
			}, {
				data: !responseType || responseType === "text" || responseType === "json" ? request$1.responseText : request$1.response,
				status: request$1.status,
				statusText: request$1.statusText,
				headers: responseHeaders,
				config,
				request: request$1
			});
			request$1 = null;
		}
		if ("onloadend" in request$1) request$1.onloadend = onloadend;
		else request$1.onreadystatechange = function handleLoad() {
			if (!request$1 || request$1.readyState !== 4) return;
			if (request$1.status === 0 && !(request$1.responseURL && request$1.responseURL.indexOf("file:") === 0)) return;
			setTimeout(onloadend);
		};
		request$1.onabort = function handleAbort() {
			if (!request$1) return;
			reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request$1));
			request$1 = null;
		};
		request$1.onerror = function handleError(event) {
			const err = new AxiosError_default(event && event.message ? event.message : "Network Error", AxiosError_default.ERR_NETWORK, config, request$1);
			err.event = event || null;
			reject(err);
			request$1 = null;
		};
		request$1.ontimeout = function handleTimeout() {
			let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
			const transitional = _config.transitional || transitional_default;
			if (_config.timeoutErrorMessage) timeoutErrorMessage = _config.timeoutErrorMessage;
			reject(new AxiosError_default(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED, config, request$1));
			request$1 = null;
		};
		requestData === void 0 && requestHeaders.setContentType(null);
		if ("setRequestHeader" in request$1) utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
			request$1.setRequestHeader(key, val);
		});
		if (!utils_default.isUndefined(_config.withCredentials)) request$1.withCredentials = !!_config.withCredentials;
		if (responseType && responseType !== "json") request$1.responseType = _config.responseType;
		if (onDownloadProgress) {
			[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
			request$1.addEventListener("progress", downloadThrottled);
		}
		if (onUploadProgress && request$1.upload) {
			[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
			request$1.upload.addEventListener("progress", uploadThrottled);
			request$1.upload.addEventListener("loadend", flushUpload);
		}
		if (_config.cancelToken || _config.signal) {
			onCanceled = (cancel) => {
				if (!request$1) return;
				reject(!cancel || cancel.type ? new CanceledError_default(null, config, request$1) : cancel);
				request$1.abort();
				request$1 = null;
			};
			_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
			if (_config.signal) _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
		}
		const protocol = parseProtocol(_config.url);
		if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
			reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
			return;
		}
		request$1.send(requestData || null);
	});
};
var composeSignals = (signals, timeout) => {
	const { length } = signals = signals ? signals.filter(Boolean) : [];
	if (timeout || length) {
		let controller = new AbortController();
		let aborted;
		const onabort = function(reason) {
			if (!aborted) {
				aborted = true;
				unsubscribe();
				const err = reason instanceof Error ? reason : this.reason;
				controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
			}
		};
		let timer = timeout && setTimeout(() => {
			timer = null;
			onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT));
		}, timeout);
		const unsubscribe = () => {
			if (signals) {
				timer && clearTimeout(timer);
				timer = null;
				signals.forEach((signal$1) => {
					signal$1.unsubscribe ? signal$1.unsubscribe(onabort) : signal$1.removeEventListener("abort", onabort);
				});
				signals = null;
			}
		};
		signals.forEach((signal$1) => signal$1.addEventListener("abort", onabort));
		const { signal } = controller;
		signal.unsubscribe = () => utils_default.asap(unsubscribe);
		return signal;
	}
};
var composeSignals_default = composeSignals;
const streamChunk = function* (chunk, chunkSize) {
	let len = chunk.byteLength;
	if (!chunkSize || len < chunkSize) {
		yield chunk;
		return;
	}
	let pos = 0;
	let end;
	while (pos < len) {
		end = pos + chunkSize;
		yield chunk.slice(pos, end);
		pos = end;
	}
};
const readBytes = async function* (iterable, chunkSize) {
	for await (const chunk of readStream(iterable)) yield* streamChunk(chunk, chunkSize);
};
var readStream = async function* (stream$7) {
	if (stream$7[Symbol.asyncIterator]) {
		yield* stream$7;
		return;
	}
	const reader = stream$7.getReader();
	try {
		for (;;) {
			const { done, value } = await reader.read();
			if (done) break;
			yield value;
		}
	} finally {
		await reader.cancel();
	}
};
const trackStream = (stream$7, chunkSize, onProgress, onFinish) => {
	const iterator$1 = readBytes(stream$7, chunkSize);
	let bytes = 0;
	let done;
	let _onFinish = (e) => {
		if (!done) {
			done = true;
			onFinish && onFinish(e);
		}
	};
	return new ReadableStream({
		async pull(controller) {
			try {
				const { done: done$1, value } = await iterator$1.next();
				if (done$1) {
					_onFinish();
					controller.close();
					return;
				}
				let len = value.byteLength;
				if (onProgress) onProgress(bytes += len);
				controller.enqueue(new Uint8Array(value));
			} catch (err) {
				_onFinish(err);
				throw err;
			}
		},
		cancel(reason) {
			_onFinish(reason);
			return iterator$1.return();
		}
	}, { highWaterMark: 2 });
};
var DEFAULT_CHUNK_SIZE = 64 * 1024;
var { isFunction } = utils_default;
var globalFetchAPI = (({ Request: Request$5, Response: Response$2 }) => ({
	Request: Request$5,
	Response: Response$2
}))(utils_default.global);
var { ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 } = utils_default.global;
var test = (fn, ...args) => {
	try {
		return !!fn(...args);
	} catch (e) {
		return false;
	}
};
var factory = (env$1) => {
	env$1 = utils_default.merge.call({ skipUndefined: true }, globalFetchAPI, env$1);
	const { fetch: envFetch, Request: Request$5, Response: Response$2 } = env$1;
	const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
	const isRequestSupported = isFunction(Request$5);
	const isResponseSupported = isFunction(Response$2);
	if (!isFetchSupported) return false;
	const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
	const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? ((encoder$1) => (str) => encoder$1.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request$5(str).arrayBuffer()));
	const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
		let duplexAccessed = false;
		const body = new ReadableStream$1();
		const hasContentType = new Request$5(platform_default.origin, {
			body,
			method: "POST",
			get duplex() {
				duplexAccessed = true;
				return "half";
			}
		}).headers.has("Content-Type");
		body.cancel();
		return duplexAccessed && !hasContentType;
	});
	const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response$2("").body));
	const resolvers = { stream: supportsResponseStream && ((res) => res.body) };
	isFetchSupported && [
		"text",
		"arrayBuffer",
		"blob",
		"formData",
		"stream"
	].forEach((type) => {
		!resolvers[type] && (resolvers[type] = (res, config) => {
			let method = res && res[type];
			if (method) return method.call(res);
			throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
		});
	});
	const getBodyLength = async (body) => {
		if (body == null) return 0;
		if (utils_default.isBlob(body)) return body.size;
		if (utils_default.isSpecCompliantForm(body)) return (await new Request$5(platform_default.origin, {
			method: "POST",
			body
		}).arrayBuffer()).byteLength;
		if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) return body.byteLength;
		if (utils_default.isURLSearchParams(body)) body = body + "";
		if (utils_default.isString(body)) return (await encodeText(body)).byteLength;
	};
	const resolveBodyLength = async (headers, body) => {
		const length = utils_default.toFiniteNumber(headers.getContentLength());
		return length == null ? getBodyLength(body) : length;
	};
	return async (config) => {
		let { url: url$3, method, data: data$1, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config);
		let _fetch = envFetch || fetch;
		responseType = responseType ? (responseType + "").toLowerCase() : "text";
		let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
		let request$1 = null;
		const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
			composedSignal.unsubscribe();
		});
		let requestContentLength;
		try {
			if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data$1)) !== 0) {
				let _request = new Request$5(url$3, {
					method: "POST",
					body: data$1,
					duplex: "half"
				});
				let contentTypeHeader;
				if (utils_default.isFormData(data$1) && (contentTypeHeader = _request.headers.get("content-type"))) headers.setContentType(contentTypeHeader);
				if (_request.body) {
					const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
					data$1 = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
				}
			}
			if (!utils_default.isString(withCredentials)) withCredentials = withCredentials ? "include" : "omit";
			const isCredentialsSupported = isRequestSupported && "credentials" in Request$5.prototype;
			const resolvedOptions = {
				...fetchOptions,
				signal: composedSignal,
				method: method.toUpperCase(),
				headers: headers.normalize().toJSON(),
				body: data$1,
				duplex: "half",
				credentials: isCredentialsSupported ? withCredentials : void 0
			};
			request$1 = isRequestSupported && new Request$5(url$3, resolvedOptions);
			let response = await (isRequestSupported ? _fetch(request$1, fetchOptions) : _fetch(url$3, resolvedOptions));
			const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
			if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
				const options = {};
				[
					"status",
					"statusText",
					"headers"
				].forEach((prop) => {
					options[prop] = response[prop];
				});
				const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
				const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
				response = new Response$2(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
					flush && flush();
					unsubscribe && unsubscribe();
				}), options);
			}
			responseType = responseType || "text";
			let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
			!isStreamResponse && unsubscribe && unsubscribe();
			return await new Promise((resolve, reject) => {
				settle(resolve, reject, {
					data: responseData,
					headers: AxiosHeaders_default.from(response.headers),
					status: response.status,
					statusText: response.statusText,
					config,
					request: request$1
				});
			});
		} catch (err) {
			unsubscribe && unsubscribe();
			if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) throw Object.assign(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request$1, err && err.response), { cause: err.cause || err });
			throw AxiosError_default.from(err, err && err.code, config, request$1, err && err.response);
		}
	};
};
var seedCache = /* @__PURE__ */ new Map();
const getFetch = (config) => {
	let env$1 = config && config.env || {};
	const { fetch: fetch$2, Request: Request$5, Response: Response$2 } = env$1;
	const seeds = [
		Request$5,
		Response$2,
		fetch$2
	];
	let i = seeds.length, seed, target, map = seedCache;
	while (i--) {
		seed = seeds[i];
		target = map.get(seed);
		target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env$1));
		map = target;
	}
	return target;
};
var adapter = getFetch();
var knownAdapters = {
	http: http_default,
	xhr: xhr_default,
	fetch: { get: getFetch }
};
utils_default.forEach(knownAdapters, (fn, value) => {
	if (fn) {
		try {
			Object.defineProperty(fn, "name", { value });
		} catch (e) {}
		Object.defineProperty(fn, "adapterName", { value });
	}
});
var renderReason = (reason) => `- ${reason}`;
var isResolvedHandle = (adapter$1) => utils_default.isFunction(adapter$1) || adapter$1 === null || adapter$1 === false;
function getAdapter(adapters, config) {
	adapters = utils_default.isArray(adapters) ? adapters : [adapters];
	const { length } = adapters;
	let nameOrAdapter;
	let adapter$1;
	const rejectedReasons = {};
	for (let i = 0; i < length; i++) {
		nameOrAdapter = adapters[i];
		let id;
		adapter$1 = nameOrAdapter;
		if (!isResolvedHandle(nameOrAdapter)) {
			adapter$1 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
			if (adapter$1 === void 0) throw new AxiosError_default(`Unknown adapter '${id}'`);
		}
		if (adapter$1 && (utils_default.isFunction(adapter$1) || (adapter$1 = adapter$1.get(config)))) break;
		rejectedReasons[id || "#" + i] = adapter$1;
	}
	if (!adapter$1) {
		const reasons = Object.entries(rejectedReasons).map(([id, state$1]) => `adapter ${id} ` + (state$1 === false ? "is not supported by the environment" : "is not available in the build"));
		throw new AxiosError_default(`There is no suitable adapter to dispatch the request ` + (length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT");
	}
	return adapter$1;
}
var adapters_default = {
	getAdapter,
	adapters: knownAdapters
};
function throwIfCancellationRequested(config) {
	if (config.cancelToken) config.cancelToken.throwIfRequested();
	if (config.signal && config.signal.aborted) throw new CanceledError_default(null, config);
}
function dispatchRequest(config) {
	throwIfCancellationRequested(config);
	config.headers = AxiosHeaders_default.from(config.headers);
	config.data = transformData.call(config, config.transformRequest);
	if ([
		"post",
		"put",
		"patch"
	].indexOf(config.method) !== -1) config.headers.setContentType("application/x-www-form-urlencoded", false);
	return adapters_default.getAdapter(config.adapter || defaults_default.adapter, config)(config).then(function onAdapterResolution(response) {
		throwIfCancellationRequested(config);
		response.data = transformData.call(config, config.transformResponse, response);
		response.headers = AxiosHeaders_default.from(response.headers);
		return response;
	}, function onAdapterRejection(reason) {
		if (!isCancel(reason)) {
			throwIfCancellationRequested(config);
			if (reason && reason.response) {
				reason.response.data = transformData.call(config, config.transformResponse, reason.response);
				reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
			}
		}
		return Promise.reject(reason);
	});
}
var validators$1 = {};
[
	"object",
	"boolean",
	"number",
	"function",
	"string",
	"symbol"
].forEach((type, i) => {
	validators$1[type] = function validator(thing) {
		return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
	};
});
var deprecatedWarnings = {};
validators$1.transitional = function transitional(validator, version$1, message) {
	function formatMessage(opt, desc$1) {
		return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc$1 + (message ? ". " + message : "");
	}
	return (value, opt, opts) => {
		if (validator === false) throw new AxiosError_default(formatMessage(opt, " has been removed" + (version$1 ? " in " + version$1 : "")), AxiosError_default.ERR_DEPRECATED);
		if (version$1 && !deprecatedWarnings[opt]) {
			deprecatedWarnings[opt] = true;
			console.warn(formatMessage(opt, " has been deprecated since v" + version$1 + " and will be removed in the near future"));
		}
		return validator ? validator(value, opt, opts) : true;
	};
};
validators$1.spelling = function spelling(correctSpelling) {
	return (value, opt) => {
		console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
		return true;
	};
};
function assertOptions(options, schema, allowUnknown) {
	if (typeof options !== "object") throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
	const keys = Object.keys(options);
	let i = keys.length;
	while (i-- > 0) {
		const opt = keys[i];
		const validator = schema[opt];
		if (validator) {
			const value = options[opt];
			const result = value === void 0 || validator(value, opt, options);
			if (result !== true) throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
			continue;
		}
		if (allowUnknown !== true) throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
	}
}
var validator_default = {
	assertOptions,
	validators: validators$1
};
var validators = validator_default.validators;
var Axios = class {
	constructor(instanceConfig) {
		this.defaults = instanceConfig || {};
		this.interceptors = {
			request: new InterceptorManager_default(),
			response: new InterceptorManager_default()
		};
	}
	async request(configOrUrl, config) {
		try {
			return await this._request(configOrUrl, config);
		} catch (err) {
			if (err instanceof Error) {
				let dummy = {};
				Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = /* @__PURE__ */ new Error();
				const stack = (() => {
					if (!dummy.stack) return "";
					const firstNewlineIndex = dummy.stack.indexOf("\n");
					return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
				})();
				try {
					if (!err.stack) err.stack = stack;
					else if (stack) {
						const firstNewlineIndex = stack.indexOf("\n");
						const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
						const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
						if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) err.stack += "\n" + stack;
					}
				} catch (e) {}
			}
			throw err;
		}
	}
	_request(configOrUrl, config) {
		if (typeof configOrUrl === "string") {
			config = config || {};
			config.url = configOrUrl;
		} else config = configOrUrl || {};
		config = mergeConfig(this.defaults, config);
		const { transitional, paramsSerializer, headers } = config;
		if (transitional !== void 0) validator_default.assertOptions(transitional, {
			silentJSONParsing: validators.transitional(validators.boolean),
			forcedJSONParsing: validators.transitional(validators.boolean),
			clarifyTimeoutError: validators.transitional(validators.boolean),
			legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
		}, false);
		if (paramsSerializer != null) if (utils_default.isFunction(paramsSerializer)) config.paramsSerializer = { serialize: paramsSerializer };
		else validator_default.assertOptions(paramsSerializer, {
			encode: validators.function,
			serialize: validators.function
		}, true);
		if (config.allowAbsoluteUrls !== void 0) {} else if (this.defaults.allowAbsoluteUrls !== void 0) config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
		else config.allowAbsoluteUrls = true;
		validator_default.assertOptions(config, {
			baseUrl: validators.spelling("baseURL"),
			withXsrfToken: validators.spelling("withXSRFToken")
		}, true);
		config.method = (config.method || this.defaults.method || "get").toLowerCase();
		let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
		headers && utils_default.forEach([
			"delete",
			"get",
			"head",
			"post",
			"put",
			"patch",
			"common"
		], (method) => {
			delete headers[method];
		});
		config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
		const requestInterceptorChain = [];
		let synchronousRequestInterceptors = true;
		this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
			if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) return;
			synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
			const transitional$1 = config.transitional || transitional_default;
			if (transitional$1 && transitional$1.legacyInterceptorReqResOrdering) requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
			else requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
		});
		const responseInterceptorChain = [];
		this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
			responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
		});
		let promise;
		let i = 0;
		let len;
		if (!synchronousRequestInterceptors) {
			const chain = [dispatchRequest.bind(this), void 0];
			chain.unshift(...requestInterceptorChain);
			chain.push(...responseInterceptorChain);
			len = chain.length;
			promise = Promise.resolve(config);
			while (i < len) promise = promise.then(chain[i++], chain[i++]);
			return promise;
		}
		len = requestInterceptorChain.length;
		let newConfig = config;
		while (i < len) {
			const onFulfilled = requestInterceptorChain[i++];
			const onRejected = requestInterceptorChain[i++];
			try {
				newConfig = onFulfilled(newConfig);
			} catch (error) {
				onRejected.call(this, error);
				break;
			}
		}
		try {
			promise = dispatchRequest.call(this, newConfig);
		} catch (error) {
			return Promise.reject(error);
		}
		i = 0;
		len = responseInterceptorChain.length;
		while (i < len) promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
		return promise;
	}
	getUri(config) {
		config = mergeConfig(this.defaults, config);
		return buildURL$4(buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls), config.params, config.paramsSerializer);
	}
};
utils_default.forEach([
	"delete",
	"get",
	"head",
	"options"
], function forEachMethodNoData(method) {
	Axios.prototype[method] = function(url$3, config) {
		return this.request(mergeConfig(config || {}, {
			method,
			url: url$3,
			data: (config || {}).data
		}));
	};
});
utils_default.forEach([
	"post",
	"put",
	"patch"
], function forEachMethodWithData(method) {
	function generateHTTPMethod(isForm) {
		return function httpMethod(url$3, data$1, config) {
			return this.request(mergeConfig(config || {}, {
				method,
				headers: isForm ? { "Content-Type": "multipart/form-data" } : {},
				url: url$3,
				data: data$1
			}));
		};
	}
	Axios.prototype[method] = generateHTTPMethod();
	Axios.prototype[method + "Form"] = generateHTTPMethod(true);
});
var Axios_default = Axios;
var CancelToken = class CancelToken {
	constructor(executor) {
		if (typeof executor !== "function") throw new TypeError("executor must be a function.");
		let resolvePromise;
		this.promise = new Promise(function promiseExecutor(resolve) {
			resolvePromise = resolve;
		});
		const token = this;
		this.promise.then((cancel) => {
			if (!token._listeners) return;
			let i = token._listeners.length;
			while (i-- > 0) token._listeners[i](cancel);
			token._listeners = null;
		});
		this.promise.then = (onfulfilled) => {
			let _resolve;
			const promise = new Promise((resolve) => {
				token.subscribe(resolve);
				_resolve = resolve;
			}).then(onfulfilled);
			promise.cancel = function reject() {
				token.unsubscribe(_resolve);
			};
			return promise;
		};
		executor(function cancel(message, config, request$1) {
			if (token.reason) return;
			token.reason = new CanceledError_default(message, config, request$1);
			resolvePromise(token.reason);
		});
	}
	throwIfRequested() {
		if (this.reason) throw this.reason;
	}
	subscribe(listener) {
		if (this.reason) {
			listener(this.reason);
			return;
		}
		if (this._listeners) this._listeners.push(listener);
		else this._listeners = [listener];
	}
	unsubscribe(listener) {
		if (!this._listeners) return;
		const index = this._listeners.indexOf(listener);
		if (index !== -1) this._listeners.splice(index, 1);
	}
	toAbortSignal() {
		const controller = new AbortController();
		const abort$4 = (err) => {
			controller.abort(err);
		};
		this.subscribe(abort$4);
		controller.signal.unsubscribe = () => this.unsubscribe(abort$4);
		return controller.signal;
	}
	static source() {
		let cancel;
		return {
			token: new CancelToken(function executor(c) {
				cancel = c;
			}),
			cancel
		};
	}
};
var CancelToken_default = CancelToken;
function spread(callback) {
	return function wrap$1(arr) {
		return callback.apply(null, arr);
	};
}
function isAxiosError(payload) {
	return utils_default.isObject(payload) && payload.isAxiosError === true;
}
var HttpStatusCode = {
	Continue: 100,
	SwitchingProtocols: 101,
	Processing: 102,
	EarlyHints: 103,
	Ok: 200,
	Created: 201,
	Accepted: 202,
	NonAuthoritativeInformation: 203,
	NoContent: 204,
	ResetContent: 205,
	PartialContent: 206,
	MultiStatus: 207,
	AlreadyReported: 208,
	ImUsed: 226,
	MultipleChoices: 300,
	MovedPermanently: 301,
	Found: 302,
	SeeOther: 303,
	NotModified: 304,
	UseProxy: 305,
	Unused: 306,
	TemporaryRedirect: 307,
	PermanentRedirect: 308,
	BadRequest: 400,
	Unauthorized: 401,
	PaymentRequired: 402,
	Forbidden: 403,
	NotFound: 404,
	MethodNotAllowed: 405,
	NotAcceptable: 406,
	ProxyAuthenticationRequired: 407,
	RequestTimeout: 408,
	Conflict: 409,
	Gone: 410,
	LengthRequired: 411,
	PreconditionFailed: 412,
	PayloadTooLarge: 413,
	UriTooLong: 414,
	UnsupportedMediaType: 415,
	RangeNotSatisfiable: 416,
	ExpectationFailed: 417,
	ImATeapot: 418,
	MisdirectedRequest: 421,
	UnprocessableEntity: 422,
	Locked: 423,
	FailedDependency: 424,
	TooEarly: 425,
	UpgradeRequired: 426,
	PreconditionRequired: 428,
	TooManyRequests: 429,
	RequestHeaderFieldsTooLarge: 431,
	UnavailableForLegalReasons: 451,
	InternalServerError: 500,
	NotImplemented: 501,
	BadGateway: 502,
	ServiceUnavailable: 503,
	GatewayTimeout: 504,
	HttpVersionNotSupported: 505,
	VariantAlsoNegotiates: 506,
	InsufficientStorage: 507,
	LoopDetected: 508,
	NotExtended: 510,
	NetworkAuthenticationRequired: 511,
	WebServerIsDown: 521,
	ConnectionTimedOut: 522,
	OriginIsUnreachable: 523,
	TimeoutOccurred: 524,
	SslHandshakeFailed: 525,
	InvalidSslCertificate: 526
};
Object.entries(HttpStatusCode).forEach(([key, value]) => {
	HttpStatusCode[value] = key;
});
var HttpStatusCode_default = HttpStatusCode;
function createInstance(defaultConfig) {
	const context = new Axios_default(defaultConfig);
	const instance = bind(Axios_default.prototype.request, context);
	utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
	utils_default.extend(instance, context, null, { allOwnKeys: true });
	instance.create = function create(instanceConfig) {
		return createInstance(mergeConfig(defaultConfig, instanceConfig));
	};
	return instance;
}
var axios = createInstance(defaults_default);
axios.Axios = Axios_default;
axios.CanceledError = CanceledError_default;
axios.CancelToken = CancelToken_default;
axios.isCancel = isCancel;
axios.VERSION = VERSION;
axios.toFormData = toFormData_default;
axios.AxiosError = AxiosError_default;
axios.Cancel = axios.CanceledError;
axios.all = function all(promises) {
	return Promise.all(promises);
};
axios.spread = spread;
axios.isAxiosError = isAxiosError;
axios.mergeConfig = mergeConfig;
axios.AxiosHeaders = AxiosHeaders_default;
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters_default.getAdapter;
axios.HttpStatusCode = HttpStatusCode_default;
axios.default = axios;
var axios_default = axios;
var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var buffer_1 = require("buffer");
	var ERRORS$1 = {
		INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",
		INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.",
		INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.",
		INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",
		INVALID_OFFSET: "An invalid offset value was provided.",
		INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.",
		INVALID_LENGTH: "An invalid length value was provided.",
		INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.",
		INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.",
		INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",
		INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.",
		INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data."
	};
	exports.ERRORS = ERRORS$1;
	function checkEncoding(encoding) {
		if (!buffer_1.Buffer.isEncoding(encoding)) throw new Error(ERRORS$1.INVALID_ENCODING);
	}
	exports.checkEncoding = checkEncoding;
	function isFiniteInteger(value) {
		return typeof value === "number" && isFinite(value) && isInteger(value);
	}
	exports.isFiniteInteger = isFiniteInteger;
	function checkOffsetOrLengthValue(value, offset) {
		if (typeof value === "number") {
			if (!isFiniteInteger(value) || value < 0) throw new Error(offset ? ERRORS$1.INVALID_OFFSET : ERRORS$1.INVALID_LENGTH);
		} else throw new Error(offset ? ERRORS$1.INVALID_OFFSET_NON_NUMBER : ERRORS$1.INVALID_LENGTH_NON_NUMBER);
	}
	function checkLengthValue(length) {
		checkOffsetOrLengthValue(length, false);
	}
	exports.checkLengthValue = checkLengthValue;
	function checkOffsetValue(offset) {
		checkOffsetOrLengthValue(offset, true);
	}
	exports.checkOffsetValue = checkOffsetValue;
	function checkTargetOffset(offset, buff) {
		if (offset < 0 || offset > buff.length) throw new Error(ERRORS$1.INVALID_TARGET_OFFSET);
	}
	exports.checkTargetOffset = checkTargetOffset;
	function isInteger(value) {
		return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
	}
	function bigIntAndBufferInt64Check(bufferMethod) {
		if (typeof BigInt === "undefined") throw new Error("Platform does not support JS BigInt type.");
		if (typeof buffer_1.Buffer.prototype[bufferMethod] === "undefined") throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`);
	}
	exports.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;
}));
var require_smartbuffer = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var utils_1$1 = require_utils$2();
	var DEFAULT_SMARTBUFFER_SIZE = 4096;
	var DEFAULT_SMARTBUFFER_ENCODING = "utf8";
	exports.SmartBuffer = class SmartBuffer {
		constructor(options) {
			this.length = 0;
			this._encoding = DEFAULT_SMARTBUFFER_ENCODING;
			this._writeOffset = 0;
			this._readOffset = 0;
			if (SmartBuffer.isSmartBufferOptions(options)) {
				if (options.encoding) {
					utils_1$1.checkEncoding(options.encoding);
					this._encoding = options.encoding;
				}
				if (options.size) if (utils_1$1.isFiniteInteger(options.size) && options.size > 0) this._buff = Buffer.allocUnsafe(options.size);
				else throw new Error(utils_1$1.ERRORS.INVALID_SMARTBUFFER_SIZE);
				else if (options.buff) if (Buffer.isBuffer(options.buff)) {
					this._buff = options.buff;
					this.length = options.buff.length;
				} else throw new Error(utils_1$1.ERRORS.INVALID_SMARTBUFFER_BUFFER);
				else this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
			} else {
				if (typeof options !== "undefined") throw new Error(utils_1$1.ERRORS.INVALID_SMARTBUFFER_OBJECT);
				this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
			}
		}
		static fromSize(size, encoding) {
			return new this({
				size,
				encoding
			});
		}
		static fromBuffer(buff, encoding) {
			return new this({
				buff,
				encoding
			});
		}
		static fromOptions(options) {
			return new this(options);
		}
		static isSmartBufferOptions(options) {
			const castOptions = options;
			return castOptions && (castOptions.encoding !== void 0 || castOptions.size !== void 0 || castOptions.buff !== void 0);
		}
		readInt8(offset) {
			return this._readNumberValue(Buffer.prototype.readInt8, 1, offset);
		}
		readInt16BE(offset) {
			return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset);
		}
		readInt16LE(offset) {
			return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset);
		}
		readInt32BE(offset) {
			return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset);
		}
		readInt32LE(offset) {
			return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset);
		}
		readBigInt64BE(offset) {
			utils_1$1.bigIntAndBufferInt64Check("readBigInt64BE");
			return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset);
		}
		readBigInt64LE(offset) {
			utils_1$1.bigIntAndBufferInt64Check("readBigInt64LE");
			return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset);
		}
		writeInt8(value, offset) {
			this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
			return this;
		}
		insertInt8(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
		}
		writeInt16BE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
		}
		insertInt16BE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
		}
		writeInt16LE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
		}
		insertInt16LE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
		}
		writeInt32BE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
		}
		insertInt32BE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
		}
		writeInt32LE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
		}
		insertInt32LE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
		}
		writeBigInt64BE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigInt64BE");
			return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset);
		}
		insertBigInt64BE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigInt64BE");
			return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset);
		}
		writeBigInt64LE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigInt64LE");
			return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset);
		}
		insertBigInt64LE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigInt64LE");
			return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset);
		}
		readUInt8(offset) {
			return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset);
		}
		readUInt16BE(offset) {
			return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset);
		}
		readUInt16LE(offset) {
			return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset);
		}
		readUInt32BE(offset) {
			return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset);
		}
		readUInt32LE(offset) {
			return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset);
		}
		readBigUInt64BE(offset) {
			utils_1$1.bigIntAndBufferInt64Check("readBigUInt64BE");
			return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset);
		}
		readBigUInt64LE(offset) {
			utils_1$1.bigIntAndBufferInt64Check("readBigUInt64LE");
			return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset);
		}
		writeUInt8(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
		}
		insertUInt8(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
		}
		writeUInt16BE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
		}
		insertUInt16BE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
		}
		writeUInt16LE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
		}
		insertUInt16LE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
		}
		writeUInt32BE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
		}
		insertUInt32BE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
		}
		writeUInt32LE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
		}
		insertUInt32LE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
		}
		writeBigUInt64BE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigUInt64BE");
			return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset);
		}
		insertBigUInt64BE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigUInt64BE");
			return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset);
		}
		writeBigUInt64LE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigUInt64LE");
			return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset);
		}
		insertBigUInt64LE(value, offset) {
			utils_1$1.bigIntAndBufferInt64Check("writeBigUInt64LE");
			return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset);
		}
		readFloatBE(offset) {
			return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset);
		}
		readFloatLE(offset) {
			return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset);
		}
		writeFloatBE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
		}
		insertFloatBE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
		}
		writeFloatLE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
		}
		insertFloatLE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
		}
		readDoubleBE(offset) {
			return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset);
		}
		readDoubleLE(offset) {
			return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset);
		}
		writeDoubleBE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
		}
		insertDoubleBE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
		}
		writeDoubleLE(value, offset) {
			return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
		}
		insertDoubleLE(value, offset) {
			return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
		}
		readString(arg1, encoding) {
			let lengthVal;
			if (typeof arg1 === "number") {
				utils_1$1.checkLengthValue(arg1);
				lengthVal = Math.min(arg1, this.length - this._readOffset);
			} else {
				encoding = arg1;
				lengthVal = this.length - this._readOffset;
			}
			if (typeof encoding !== "undefined") utils_1$1.checkEncoding(encoding);
			const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding);
			this._readOffset += lengthVal;
			return value;
		}
		insertString(value, offset, encoding) {
			utils_1$1.checkOffsetValue(offset);
			return this._handleString(value, true, offset, encoding);
		}
		writeString(value, arg2, encoding) {
			return this._handleString(value, false, arg2, encoding);
		}
		readStringNT(encoding) {
			if (typeof encoding !== "undefined") utils_1$1.checkEncoding(encoding);
			let nullPos = this.length;
			for (let i = this._readOffset; i < this.length; i++) if (this._buff[i] === 0) {
				nullPos = i;
				break;
			}
			const value = this._buff.slice(this._readOffset, nullPos);
			this._readOffset = nullPos + 1;
			return value.toString(encoding || this._encoding);
		}
		insertStringNT(value, offset, encoding) {
			utils_1$1.checkOffsetValue(offset);
			this.insertString(value, offset, encoding);
			this.insertUInt8(0, offset + value.length);
			return this;
		}
		writeStringNT(value, arg2, encoding) {
			this.writeString(value, arg2, encoding);
			this.writeUInt8(0, typeof arg2 === "number" ? arg2 + value.length : this.writeOffset);
			return this;
		}
		readBuffer(length) {
			if (typeof length !== "undefined") utils_1$1.checkLengthValue(length);
			const lengthVal = typeof length === "number" ? length : this.length;
			const endPoint = Math.min(this.length, this._readOffset + lengthVal);
			const value = this._buff.slice(this._readOffset, endPoint);
			this._readOffset = endPoint;
			return value;
		}
		insertBuffer(value, offset) {
			utils_1$1.checkOffsetValue(offset);
			return this._handleBuffer(value, true, offset);
		}
		writeBuffer(value, offset) {
			return this._handleBuffer(value, false, offset);
		}
		readBufferNT() {
			let nullPos = this.length;
			for (let i = this._readOffset; i < this.length; i++) if (this._buff[i] === 0) {
				nullPos = i;
				break;
			}
			const value = this._buff.slice(this._readOffset, nullPos);
			this._readOffset = nullPos + 1;
			return value;
		}
		insertBufferNT(value, offset) {
			utils_1$1.checkOffsetValue(offset);
			this.insertBuffer(value, offset);
			this.insertUInt8(0, offset + value.length);
			return this;
		}
		writeBufferNT(value, offset) {
			if (typeof offset !== "undefined") utils_1$1.checkOffsetValue(offset);
			this.writeBuffer(value, offset);
			this.writeUInt8(0, typeof offset === "number" ? offset + value.length : this._writeOffset);
			return this;
		}
		clear() {
			this._writeOffset = 0;
			this._readOffset = 0;
			this.length = 0;
			return this;
		}
		remaining() {
			return this.length - this._readOffset;
		}
		get readOffset() {
			return this._readOffset;
		}
		set readOffset(offset) {
			utils_1$1.checkOffsetValue(offset);
			utils_1$1.checkTargetOffset(offset, this);
			this._readOffset = offset;
		}
		get writeOffset() {
			return this._writeOffset;
		}
		set writeOffset(offset) {
			utils_1$1.checkOffsetValue(offset);
			utils_1$1.checkTargetOffset(offset, this);
			this._writeOffset = offset;
		}
		get encoding() {
			return this._encoding;
		}
		set encoding(encoding) {
			utils_1$1.checkEncoding(encoding);
			this._encoding = encoding;
		}
		get internalBuffer() {
			return this._buff;
		}
		toBuffer() {
			return this._buff.slice(0, this.length);
		}
		toString(encoding) {
			const encodingVal = typeof encoding === "string" ? encoding : this._encoding;
			utils_1$1.checkEncoding(encodingVal);
			return this._buff.toString(encodingVal, 0, this.length);
		}
		destroy() {
			this.clear();
			return this;
		}
		_handleString(value, isInsert, arg3, encoding) {
			let offsetVal = this._writeOffset;
			let encodingVal = this._encoding;
			if (typeof arg3 === "number") offsetVal = arg3;
			else if (typeof arg3 === "string") {
				utils_1$1.checkEncoding(arg3);
				encodingVal = arg3;
			}
			if (typeof encoding === "string") {
				utils_1$1.checkEncoding(encoding);
				encodingVal = encoding;
			}
			const byteLength = Buffer.byteLength(value, encodingVal);
			if (isInsert) this.ensureInsertable(byteLength, offsetVal);
			else this._ensureWriteable(byteLength, offsetVal);
			this._buff.write(value, offsetVal, byteLength, encodingVal);
			if (isInsert) this._writeOffset += byteLength;
			else if (typeof arg3 === "number") this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength);
			else this._writeOffset += byteLength;
			return this;
		}
		_handleBuffer(value, isInsert, offset) {
			const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
			if (isInsert) this.ensureInsertable(value.length, offsetVal);
			else this._ensureWriteable(value.length, offsetVal);
			value.copy(this._buff, offsetVal);
			if (isInsert) this._writeOffset += value.length;
			else if (typeof offset === "number") this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length);
			else this._writeOffset += value.length;
			return this;
		}
		ensureReadable(length, offset) {
			let offsetVal = this._readOffset;
			if (typeof offset !== "undefined") {
				utils_1$1.checkOffsetValue(offset);
				offsetVal = offset;
			}
			if (offsetVal < 0 || offsetVal + length > this.length) throw new Error(utils_1$1.ERRORS.INVALID_READ_BEYOND_BOUNDS);
		}
		ensureInsertable(dataLength, offset) {
			utils_1$1.checkOffsetValue(offset);
			this._ensureCapacity(this.length + dataLength);
			if (offset < this.length) this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length);
			if (offset + dataLength > this.length) this.length = offset + dataLength;
			else this.length += dataLength;
		}
		_ensureWriteable(dataLength, offset) {
			const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
			this._ensureCapacity(offsetVal + dataLength);
			if (offsetVal + dataLength > this.length) this.length = offsetVal + dataLength;
		}
		_ensureCapacity(minLength) {
			const oldLength = this._buff.length;
			if (minLength > oldLength) {
				let data$1 = this._buff;
				let newLength = oldLength * 3 / 2 + 1;
				if (newLength < minLength) newLength = minLength;
				this._buff = Buffer.allocUnsafe(newLength);
				data$1.copy(this._buff, 0, 0, oldLength);
			}
		}
		_readNumberValue(func, byteSize, offset) {
			this.ensureReadable(byteSize, offset);
			const value = func.call(this._buff, typeof offset === "number" ? offset : this._readOffset);
			if (typeof offset === "undefined") this._readOffset += byteSize;
			return value;
		}
		_insertNumberValue(func, byteSize, value, offset) {
			utils_1$1.checkOffsetValue(offset);
			this.ensureInsertable(byteSize, offset);
			func.call(this._buff, value, offset);
			this._writeOffset += byteSize;
			return this;
		}
		_writeNumberValue(func, byteSize, value, offset) {
			if (typeof offset === "number") {
				if (offset < 0) throw new Error(utils_1$1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);
				utils_1$1.checkOffsetValue(offset);
			}
			const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
			this._ensureWriteable(byteSize, offsetVal);
			func.call(this._buff, value, offsetVal);
			if (typeof offset === "number") this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize);
			else this._writeOffset += byteSize;
			return this;
		}
	};
}));
var require_constants$7 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0;
	exports.DEFAULT_TIMEOUT = 3e4;
	exports.ERRORS = {
		InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",
		InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",
		InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.",
		InvalidSocksClientOptionsDestination: "An invalid destination host was provided.",
		InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.",
		InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.",
		InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).",
		InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.",
		InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.",
		InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",
		NegotiationError: "Negotiation error",
		SocketClosed: "Socket closed",
		ProxyConnectionTimedOut: "Proxy connection timed out",
		InternalError: "SocksClient internal error (this should not happen)",
		InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response",
		Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection",
		InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response",
		Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection",
		InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response",
		InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)",
		InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)",
		InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)",
		Socks5AuthenticationFailed: "Socks5 Authentication failed",
		InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response",
		InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection",
		InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response",
		Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection"
	};
	exports.SOCKS_INCOMING_PACKET_SIZES = {
		Socks5InitialHandshakeResponse: 2,
		Socks5UserPassAuthenticationResponse: 2,
		Socks5ResponseHeader: 5,
		Socks5ResponseIPv4: 10,
		Socks5ResponseIPv6: 22,
		Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7,
		Socks4Response: 8
	};
	var SocksCommand;
	(function(SocksCommand$1) {
		SocksCommand$1[SocksCommand$1["connect"] = 1] = "connect";
		SocksCommand$1[SocksCommand$1["bind"] = 2] = "bind";
		SocksCommand$1[SocksCommand$1["associate"] = 3] = "associate";
	})(SocksCommand || (exports.SocksCommand = SocksCommand = {}));
	var Socks4Response;
	(function(Socks4Response$1) {
		Socks4Response$1[Socks4Response$1["Granted"] = 90] = "Granted";
		Socks4Response$1[Socks4Response$1["Failed"] = 91] = "Failed";
		Socks4Response$1[Socks4Response$1["Rejected"] = 92] = "Rejected";
		Socks4Response$1[Socks4Response$1["RejectedIdent"] = 93] = "RejectedIdent";
	})(Socks4Response || (exports.Socks4Response = Socks4Response = {}));
	var Socks5Auth;
	(function(Socks5Auth$1) {
		Socks5Auth$1[Socks5Auth$1["NoAuth"] = 0] = "NoAuth";
		Socks5Auth$1[Socks5Auth$1["GSSApi"] = 1] = "GSSApi";
		Socks5Auth$1[Socks5Auth$1["UserPass"] = 2] = "UserPass";
	})(Socks5Auth || (exports.Socks5Auth = Socks5Auth = {}));
	exports.SOCKS5_CUSTOM_AUTH_START = 128;
	exports.SOCKS5_CUSTOM_AUTH_END = 254;
	exports.SOCKS5_NO_ACCEPTABLE_AUTH = 255;
	var Socks5Response;
	(function(Socks5Response$1) {
		Socks5Response$1[Socks5Response$1["Granted"] = 0] = "Granted";
		Socks5Response$1[Socks5Response$1["Failure"] = 1] = "Failure";
		Socks5Response$1[Socks5Response$1["NotAllowed"] = 2] = "NotAllowed";
		Socks5Response$1[Socks5Response$1["NetworkUnreachable"] = 3] = "NetworkUnreachable";
		Socks5Response$1[Socks5Response$1["HostUnreachable"] = 4] = "HostUnreachable";
		Socks5Response$1[Socks5Response$1["ConnectionRefused"] = 5] = "ConnectionRefused";
		Socks5Response$1[Socks5Response$1["TTLExpired"] = 6] = "TTLExpired";
		Socks5Response$1[Socks5Response$1["CommandNotSupported"] = 7] = "CommandNotSupported";
		Socks5Response$1[Socks5Response$1["AddressNotSupported"] = 8] = "AddressNotSupported";
	})(Socks5Response || (exports.Socks5Response = Socks5Response = {}));
	var Socks5HostType;
	(function(Socks5HostType$1) {
		Socks5HostType$1[Socks5HostType$1["IPv4"] = 1] = "IPv4";
		Socks5HostType$1[Socks5HostType$1["Hostname"] = 3] = "Hostname";
		Socks5HostType$1[Socks5HostType$1["IPv6"] = 4] = "IPv6";
	})(Socks5HostType || (exports.Socks5HostType = Socks5HostType = {}));
	var SocksClientState;
	(function(SocksClientState$1) {
		SocksClientState$1[SocksClientState$1["Created"] = 0] = "Created";
		SocksClientState$1[SocksClientState$1["Connecting"] = 1] = "Connecting";
		SocksClientState$1[SocksClientState$1["Connected"] = 2] = "Connected";
		SocksClientState$1[SocksClientState$1["SentInitialHandshake"] = 3] = "SentInitialHandshake";
		SocksClientState$1[SocksClientState$1["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse";
		SocksClientState$1[SocksClientState$1["SentAuthentication"] = 5] = "SentAuthentication";
		SocksClientState$1[SocksClientState$1["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse";
		SocksClientState$1[SocksClientState$1["SentFinalHandshake"] = 7] = "SentFinalHandshake";
		SocksClientState$1[SocksClientState$1["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse";
		SocksClientState$1[SocksClientState$1["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection";
		SocksClientState$1[SocksClientState$1["Established"] = 10] = "Established";
		SocksClientState$1[SocksClientState$1["Disconnected"] = 11] = "Disconnected";
		SocksClientState$1[SocksClientState$1["Error"] = 99] = "Error";
	})(SocksClientState || (exports.SocksClientState = SocksClientState = {}));
}));
var require_util$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.shuffleArray = exports.SocksClientError = void 0;
	var SocksClientError = class extends Error {
		constructor(message, options) {
			super(message);
			this.options = options;
		}
	};
	exports.SocksClientError = SocksClientError;
	function shuffleArray(array) {
		for (let i = array.length - 1; i > 0; i--) {
			const j = Math.floor(Math.random() * (i + 1));
			[array[i], array[j]] = [array[j], array[i]];
		}
	}
	exports.shuffleArray = shuffleArray;
}));
var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.isInSubnet = isInSubnet;
	exports.isCorrect = isCorrect;
	exports.numberToPaddedHex = numberToPaddedHex;
	exports.stringToPaddedHex = stringToPaddedHex;
	exports.testBit = testBit;
	function isInSubnet(address) {
		if (this.subnetMask < address.subnetMask) return false;
		if (this.mask(address.subnetMask) === address.mask()) return true;
		return false;
	}
	function isCorrect(defaultBits) {
		return function() {
			if (this.addressMinusSuffix !== this.correctForm()) return false;
			if (this.subnetMask === defaultBits && !this.parsedSubnet) return true;
			return this.parsedSubnet === String(this.subnetMask);
		};
	}
	function numberToPaddedHex(number) {
		return number.toString(16).padStart(2, "0");
	}
	function stringToPaddedHex(numberString) {
		return numberToPaddedHex(parseInt(numberString, 10));
	}
	function testBit(binaryValue, position) {
		const { length } = binaryValue;
		if (position > length) return false;
		const positionInString = length - position;
		return binaryValue.substring(positionInString, positionInString + 1) === "1";
	}
}));
var require_constants$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.RE_SUBNET_STRING = exports.RE_ADDRESS = exports.GROUPS = exports.BITS = void 0;
	exports.BITS = 32;
	exports.GROUPS = 4;
	exports.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;
	exports.RE_SUBNET_STRING = /\/\d{1,2}$/;
}));
var require_address_error = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.AddressError = void 0;
	var AddressError = class extends Error {
		constructor(message, parseMessage) {
			super(message);
			this.name = "AddressError";
			this.parseMessage = parseMessage;
		}
	};
	exports.AddressError = AddressError;
}));
var require_ipv4 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$17 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$13 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$14 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$17(result, mod, k);
		}
		__setModuleDefault$13(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Address4 = void 0;
	var common$1 = __importStar$14(require_common$1());
	var constants$1 = __importStar$14(require_constants$6());
	var address_error_1$2 = require_address_error();
	exports.Address4 = class Address4 {
		constructor(address) {
			this.groups = constants$1.GROUPS;
			this.parsedAddress = [];
			this.parsedSubnet = "";
			this.subnet = "/32";
			this.subnetMask = 32;
			this.v4 = true;
			this.isCorrect = common$1.isCorrect(constants$1.BITS);
			this.isInSubnet = common$1.isInSubnet;
			this.address = address;
			const subnet = constants$1.RE_SUBNET_STRING.exec(address);
			if (subnet) {
				this.parsedSubnet = subnet[0].replace("/", "");
				this.subnetMask = parseInt(this.parsedSubnet, 10);
				this.subnet = `/${this.subnetMask}`;
				if (this.subnetMask < 0 || this.subnetMask > constants$1.BITS) throw new address_error_1$2.AddressError("Invalid subnet mask.");
				address = address.replace(constants$1.RE_SUBNET_STRING, "");
			}
			this.addressMinusSuffix = address;
			this.parsedAddress = this.parse(address);
		}
		static isValid(address) {
			try {
				new Address4(address);
				return true;
			} catch (e) {
				return false;
			}
		}
		parse(address) {
			const groups = address.split(".");
			if (!address.match(constants$1.RE_ADDRESS)) throw new address_error_1$2.AddressError("Invalid IPv4 address.");
			return groups;
		}
		correctForm() {
			return this.parsedAddress.map((part) => parseInt(part, 10)).join(".");
		}
		static fromHex(hex) {
			const padded = hex.replace(/:/g, "").padStart(8, "0");
			const groups = [];
			let i;
			for (i = 0; i < 8; i += 2) {
				const h$1 = padded.slice(i, i + 2);
				groups.push(parseInt(h$1, 16));
			}
			return new Address4(groups.join("."));
		}
		static fromInteger(integer) {
			return Address4.fromHex(integer.toString(16));
		}
		static fromArpa(arpaFormAddress) {
			return new Address4(arpaFormAddress.replace(/(\.in-addr\.arpa)?\.$/, "").split(".").reverse().join("."));
		}
		toHex() {
			return this.parsedAddress.map((part) => common$1.stringToPaddedHex(part)).join(":");
		}
		toArray() {
			return this.parsedAddress.map((part) => parseInt(part, 10));
		}
		toGroup6() {
			const output = [];
			let i;
			for (i = 0; i < constants$1.GROUPS; i += 2) output.push(`${common$1.stringToPaddedHex(this.parsedAddress[i])}${common$1.stringToPaddedHex(this.parsedAddress[i + 1])}`);
			return output.join(":");
		}
		bigInt() {
			return BigInt(`0x${this.parsedAddress.map((n$1) => common$1.stringToPaddedHex(n$1)).join("")}`);
		}
		_startAddress() {
			return BigInt(`0b${this.mask() + "0".repeat(constants$1.BITS - this.subnetMask)}`);
		}
		startAddress() {
			return Address4.fromBigInt(this._startAddress());
		}
		startAddressExclusive() {
			const adjust = BigInt("1");
			return Address4.fromBigInt(this._startAddress() + adjust);
		}
		_endAddress() {
			return BigInt(`0b${this.mask() + "1".repeat(constants$1.BITS - this.subnetMask)}`);
		}
		endAddress() {
			return Address4.fromBigInt(this._endAddress());
		}
		endAddressExclusive() {
			const adjust = BigInt("1");
			return Address4.fromBigInt(this._endAddress() - adjust);
		}
		static fromBigInt(bigInt) {
			return Address4.fromHex(bigInt.toString(16));
		}
		static fromByteArray(bytes) {
			if (bytes.length !== 4) throw new address_error_1$2.AddressError("IPv4 addresses require exactly 4 bytes");
			for (let i = 0; i < bytes.length; i++) if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) throw new address_error_1$2.AddressError("All bytes must be integers between 0 and 255");
			return this.fromUnsignedByteArray(bytes);
		}
		static fromUnsignedByteArray(bytes) {
			if (bytes.length !== 4) throw new address_error_1$2.AddressError("IPv4 addresses require exactly 4 bytes");
			return new Address4(bytes.join("."));
		}
		mask(mask) {
			if (mask === void 0) mask = this.subnetMask;
			return this.getBitsBase2(0, mask);
		}
		getBitsBase2(start, end) {
			return this.binaryZeroPad().slice(start, end);
		}
		reverseForm(options) {
			if (!options) options = {};
			const reversed = this.correctForm().split(".").reverse().join(".");
			if (options.omitSuffix) return reversed;
			return `${reversed}.in-addr.arpa.`;
		}
		isMulticast() {
			return this.isInSubnet(new Address4("224.0.0.0/4"));
		}
		binaryZeroPad() {
			return this.bigInt().toString(2).padStart(constants$1.BITS, "0");
		}
		groupForV6() {
			const segments = this.parsedAddress;
			return this.address.replace(constants$1.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments.slice(0, 2).join(".")}</span>.<span class="hover-group group-v4 group-7">${segments.slice(2, 4).join(".")}</span>`);
		}
	};
}));
var require_constants$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.RE_URL_WITH_PORT = exports.RE_URL = exports.RE_ZONE_STRING = exports.RE_SUBNET_STRING = exports.RE_BAD_ADDRESS = exports.RE_BAD_CHARACTERS = exports.TYPES = exports.SCOPES = exports.GROUPS = exports.BITS = void 0;
	exports.BITS = 128;
	exports.GROUPS = 8;
	exports.SCOPES = {
		0: "Reserved",
		1: "Interface local",
		2: "Link local",
		4: "Admin local",
		5: "Site local",
		8: "Organization local",
		14: "Global",
		15: "Reserved"
	};
	exports.TYPES = {
		"ff01::1/128": "Multicast (All nodes on this interface)",
		"ff01::2/128": "Multicast (All routers on this interface)",
		"ff02::1/128": "Multicast (All nodes on this link)",
		"ff02::2/128": "Multicast (All routers on this link)",
		"ff05::2/128": "Multicast (All routers in this site)",
		"ff02::5/128": "Multicast (OSPFv3 AllSPF routers)",
		"ff02::6/128": "Multicast (OSPFv3 AllDR routers)",
		"ff02::9/128": "Multicast (RIP routers)",
		"ff02::a/128": "Multicast (EIGRP routers)",
		"ff02::d/128": "Multicast (PIM routers)",
		"ff02::16/128": "Multicast (MLDv2 reports)",
		"ff01::fb/128": "Multicast (mDNSv6)",
		"ff02::fb/128": "Multicast (mDNSv6)",
		"ff05::fb/128": "Multicast (mDNSv6)",
		"ff02::1:2/128": "Multicast (All DHCP servers and relay agents on this link)",
		"ff05::1:2/128": "Multicast (All DHCP servers and relay agents in this site)",
		"ff02::1:3/128": "Multicast (All DHCP servers on this link)",
		"ff05::1:3/128": "Multicast (All DHCP servers in this site)",
		"::/128": "Unspecified",
		"::1/128": "Loopback",
		"ff00::/8": "Multicast",
		"fe80::/10": "Link-local unicast"
	};
	exports.RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi;
	exports.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;
	exports.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/;
	exports.RE_ZONE_STRING = /%.*$/;
	exports.RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/;
	exports.RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/;
}));
var require_helpers$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.spanAllZeroes = spanAllZeroes;
	exports.spanAll = spanAll;
	exports.spanLeadingZeroes = spanLeadingZeroes;
	exports.simpleGroup = simpleGroup;
	function spanAllZeroes(s$1) {
		return s$1.replace(/(0+)/g, "<span class=\"zero\">$1</span>");
	}
	function spanAll(s$1, offset = 0) {
		return s$1.split("").map((n$1, i) => `<span class="digit value-${n$1} position-${i + offset}">${spanAllZeroes(n$1)}</span>`).join("");
	}
	function spanLeadingZeroesSimple(group) {
		return group.replace(/^(0+)/, "<span class=\"zero\">$1</span>");
	}
	function spanLeadingZeroes(address) {
		return address.split(":").map((g) => spanLeadingZeroesSimple(g)).join(":");
	}
	function simpleGroup(addressString, offset = 0) {
		return addressString.split(":").map((g, i) => {
			if (/group-v4/.test(g)) return g;
			return `<span class="hover-group group-${i + offset}">${spanLeadingZeroesSimple(g)}</span>`;
		});
	}
}));
var require_regular_expressions = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$16 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$12 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$13 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$16(result, mod, k);
		}
		__setModuleDefault$12(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ADDRESS_BOUNDARY = void 0;
	exports.groupPossibilities = groupPossibilities;
	exports.padGroup = padGroup;
	exports.simpleRegularExpression = simpleRegularExpression;
	exports.possibleElisions = possibleElisions;
	var v6 = __importStar$13(require_constants$5());
	function groupPossibilities(possibilities) {
		return `(${possibilities.join("|")})`;
	}
	function padGroup(group) {
		if (group.length < 4) return `0{0,${4 - group.length}}${group}`;
		return group;
	}
	exports.ADDRESS_BOUNDARY = "[^A-Fa-f0-9:]";
	function simpleRegularExpression(groups) {
		const zeroIndexes = [];
		groups.forEach((group, i) => {
			if (parseInt(group, 16) === 0) zeroIndexes.push(i);
		});
		const possibilities = zeroIndexes.map((zeroIndex) => groups.map((group, i) => {
			if (i === zeroIndex) {
				const elision = i === 0 || i === v6.GROUPS - 1 ? ":" : "";
				return groupPossibilities([padGroup(group), elision]);
			}
			return padGroup(group);
		}).join(":"));
		possibilities.push(groups.map(padGroup).join(":"));
		return groupPossibilities(possibilities);
	}
	function possibleElisions(elidedGroups, moreLeft, moreRight) {
		const left = moreLeft ? "" : ":";
		const right = moreRight ? "" : ":";
		const possibilities = [];
		if (!moreLeft && !moreRight) possibilities.push("::");
		if (moreLeft && moreRight) possibilities.push("");
		if (moreRight && !moreLeft || !moreRight && moreLeft) possibilities.push(":");
		possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`);
		possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`);
		possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`);
		for (let groups = 1; groups < elidedGroups - 1; groups++) for (let position = 1; position < elidedGroups - groups; position++) possibilities.push(`(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`);
		return groupPossibilities(possibilities);
	}
}));
var require_ipv6 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$15 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$11 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$12 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$15(result, mod, k);
		}
		__setModuleDefault$11(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Address6 = void 0;
	var common = __importStar$12(require_common$1());
	var constants4 = __importStar$12(require_constants$6());
	var constants6 = __importStar$12(require_constants$5());
	var helpers$1 = __importStar$12(require_helpers$2());
	var ipv4_1$1 = require_ipv4();
	var regular_expressions_1 = require_regular_expressions();
	var address_error_1$1 = require_address_error();
	var common_1$1 = require_common$1();
	function assert$27(condition) {
		if (!condition) throw new Error("Assertion failed.");
	}
	function addCommas(number) {
		const r = /(\d+)(\d{3})/;
		while (r.test(number)) number = number.replace(r, "$1,$2");
		return number;
	}
	function spanLeadingZeroes4(n$1) {
		n$1 = n$1.replace(/^(0{1,})([1-9]+)$/, "<span class=\"parse-error\">$1</span>$2");
		n$1 = n$1.replace(/^(0{1,})(0)$/, "<span class=\"parse-error\">$1</span>$2");
		return n$1;
	}
	function compact(address, slice) {
		const s1 = [];
		const s2 = [];
		let i;
		for (i = 0; i < address.length; i++) if (i < slice[0]) s1.push(address[i]);
		else if (i > slice[1]) s2.push(address[i]);
		return s1.concat(["compact"]).concat(s2);
	}
	function paddedHex(octet) {
		return parseInt(octet, 16).toString(16).padStart(4, "0");
	}
	function unsignByte(b) {
		return b & 255;
	}
	exports.Address6 = class Address6 {
		constructor(address, optionalGroups) {
			this.addressMinusSuffix = "";
			this.parsedSubnet = "";
			this.subnet = "/128";
			this.subnetMask = 128;
			this.v4 = false;
			this.zone = "";
			this.isInSubnet = common.isInSubnet;
			this.isCorrect = common.isCorrect(constants6.BITS);
			if (optionalGroups === void 0) this.groups = constants6.GROUPS;
			else this.groups = optionalGroups;
			this.address = address;
			const subnet = constants6.RE_SUBNET_STRING.exec(address);
			if (subnet) {
				this.parsedSubnet = subnet[0].replace("/", "");
				this.subnetMask = parseInt(this.parsedSubnet, 10);
				this.subnet = `/${this.subnetMask}`;
				if (Number.isNaN(this.subnetMask) || this.subnetMask < 0 || this.subnetMask > constants6.BITS) throw new address_error_1$1.AddressError("Invalid subnet mask.");
				address = address.replace(constants6.RE_SUBNET_STRING, "");
			} else if (/\//.test(address)) throw new address_error_1$1.AddressError("Invalid subnet mask.");
			const zone = constants6.RE_ZONE_STRING.exec(address);
			if (zone) {
				this.zone = zone[0];
				address = address.replace(constants6.RE_ZONE_STRING, "");
			}
			this.addressMinusSuffix = address;
			this.parsedAddress = this.parse(this.addressMinusSuffix);
		}
		static isValid(address) {
			try {
				new Address6(address);
				return true;
			} catch (e) {
				return false;
			}
		}
		static fromBigInt(bigInt) {
			const hex = bigInt.toString(16).padStart(32, "0");
			const groups = [];
			let i;
			for (i = 0; i < constants6.GROUPS; i++) groups.push(hex.slice(i * 4, (i + 1) * 4));
			return new Address6(groups.join(":"));
		}
		static fromURL(url$3) {
			let host;
			let port = null;
			let result;
			if (url$3.indexOf("[") !== -1 && url$3.indexOf("]:") !== -1) {
				result = constants6.RE_URL_WITH_PORT.exec(url$3);
				if (result === null) return {
					error: "failed to parse address with port",
					address: null,
					port: null
				};
				host = result[1];
				port = result[2];
			} else if (url$3.indexOf("/") !== -1) {
				url$3 = url$3.replace(/^[a-z0-9]+:\/\//, "");
				result = constants6.RE_URL.exec(url$3);
				if (result === null) return {
					error: "failed to parse address from URL",
					address: null,
					port: null
				};
				host = result[1];
			} else host = url$3;
			if (port) {
				port = parseInt(port, 10);
				if (port < 0 || port > 65536) port = null;
			} else port = null;
			return {
				address: new Address6(host),
				port
			};
		}
		static fromAddress4(address) {
			const address4 = new ipv4_1$1.Address4(address);
			const mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask);
			return new Address6(`::ffff:${address4.correctForm()}/${mask6}`);
		}
		static fromArpa(arpaFormAddress) {
			let address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, "");
			const semicolonAmount = 7;
			if (address.length !== 63) throw new address_error_1$1.AddressError("Invalid 'ip6.arpa' form.");
			const parts = address.split(".").reverse();
			for (let i = semicolonAmount; i > 0; i--) {
				const insertIndex = i * 4;
				parts.splice(insertIndex, 0, ":");
			}
			address = parts.join("");
			return new Address6(address);
		}
		microsoftTranscription() {
			return `${this.correctForm().replace(/:/g, "-")}.ipv6-literal.net`;
		}
		mask(mask = this.subnetMask) {
			return this.getBitsBase2(0, mask);
		}
		possibleSubnets(subnetSize = 128) {
			const subnetPowers = constants6.BITS - this.subnetMask - Math.abs(subnetSize - constants6.BITS);
			if (subnetPowers < 0) return "0";
			return addCommas((BigInt("2") ** BigInt(subnetPowers)).toString(10));
		}
		_startAddress() {
			return BigInt(`0b${this.mask() + "0".repeat(constants6.BITS - this.subnetMask)}`);
		}
		startAddress() {
			return Address6.fromBigInt(this._startAddress());
		}
		startAddressExclusive() {
			const adjust = BigInt("1");
			return Address6.fromBigInt(this._startAddress() + adjust);
		}
		_endAddress() {
			return BigInt(`0b${this.mask() + "1".repeat(constants6.BITS - this.subnetMask)}`);
		}
		endAddress() {
			return Address6.fromBigInt(this._endAddress());
		}
		endAddressExclusive() {
			const adjust = BigInt("1");
			return Address6.fromBigInt(this._endAddress() - adjust);
		}
		getScope() {
			let scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)];
			if (this.getType() === "Global unicast" && scope !== "Link local") scope = "Global";
			return scope || "Unknown";
		}
		getType() {
			for (const subnet of Object.keys(constants6.TYPES)) if (this.isInSubnet(new Address6(subnet))) return constants6.TYPES[subnet];
			return "Global unicast";
		}
		getBits(start, end) {
			return BigInt(`0b${this.getBitsBase2(start, end)}`);
		}
		getBitsBase2(start, end) {
			return this.binaryZeroPad().slice(start, end);
		}
		getBitsBase16(start, end) {
			const length = end - start;
			if (length % 4 !== 0) throw new Error("Length of bits to retrieve must be divisible by four");
			return this.getBits(start, end).toString(16).padStart(length / 4, "0");
		}
		getBitsPastSubnet() {
			return this.getBitsBase2(this.subnetMask, constants6.BITS);
		}
		reverseForm(options) {
			if (!options) options = {};
			const characters = Math.floor(this.subnetMask / 4);
			const reversed = this.canonicalForm().replace(/:/g, "").split("").slice(0, characters).reverse().join(".");
			if (characters > 0) {
				if (options.omitSuffix) return reversed;
				return `${reversed}.ip6.arpa.`;
			}
			if (options.omitSuffix) return "";
			return "ip6.arpa.";
		}
		correctForm() {
			let i;
			let groups = [];
			let zeroCounter = 0;
			const zeroes = [];
			for (i = 0; i < this.parsedAddress.length; i++) {
				const value = parseInt(this.parsedAddress[i], 16);
				if (value === 0) zeroCounter++;
				if (value !== 0 && zeroCounter > 0) {
					if (zeroCounter > 1) zeroes.push([i - zeroCounter, i - 1]);
					zeroCounter = 0;
				}
			}
			if (zeroCounter > 1) zeroes.push([this.parsedAddress.length - zeroCounter, this.parsedAddress.length - 1]);
			const zeroLengths = zeroes.map((n$1) => n$1[1] - n$1[0] + 1);
			if (zeroes.length > 0) {
				const index = zeroLengths.indexOf(Math.max(...zeroLengths));
				groups = compact(this.parsedAddress, zeroes[index]);
			} else groups = this.parsedAddress;
			for (i = 0; i < groups.length; i++) if (groups[i] !== "compact") groups[i] = parseInt(groups[i], 16).toString(16);
			let correct = groups.join(":");
			correct = correct.replace(/^compact$/, "::");
			correct = correct.replace(/(^compact)|(compact$)/, ":");
			correct = correct.replace(/compact/, "");
			return correct;
		}
		binaryZeroPad() {
			return this.bigInt().toString(2).padStart(constants6.BITS, "0");
		}
		parse4in6(address) {
			const groups = address.split(":");
			const address4 = groups.slice(-1)[0].match(constants4.RE_ADDRESS);
			if (address4) {
				this.parsedAddress4 = address4[0];
				this.address4 = new ipv4_1$1.Address4(this.parsedAddress4);
				for (let i = 0; i < this.address4.groups; i++) if (/^0[0-9]+/.test(this.address4.parsedAddress[i])) throw new address_error_1$1.AddressError("IPv4 addresses can't have leading zeroes.", address.replace(constants4.RE_ADDRESS, this.address4.parsedAddress.map(spanLeadingZeroes4).join(".")));
				this.v4 = true;
				groups[groups.length - 1] = this.address4.toGroup6();
				address = groups.join(":");
			}
			return address;
		}
		parse(address) {
			address = this.parse4in6(address);
			const badCharacters = address.match(constants6.RE_BAD_CHARACTERS);
			if (badCharacters) throw new address_error_1$1.AddressError(`Bad character${badCharacters.length > 1 ? "s" : ""} detected in address: ${badCharacters.join("")}`, address.replace(constants6.RE_BAD_CHARACTERS, "<span class=\"parse-error\">$1</span>"));
			const badAddress = address.match(constants6.RE_BAD_ADDRESS);
			if (badAddress) throw new address_error_1$1.AddressError(`Address failed regex: ${badAddress.join("")}`, address.replace(constants6.RE_BAD_ADDRESS, "<span class=\"parse-error\">$1</span>"));
			let groups = [];
			const halves = address.split("::");
			if (halves.length === 2) {
				let first = halves[0].split(":");
				let last = halves[1].split(":");
				if (first.length === 1 && first[0] === "") first = [];
				if (last.length === 1 && last[0] === "") last = [];
				const remaining = this.groups - (first.length + last.length);
				if (!remaining) throw new address_error_1$1.AddressError("Error parsing groups");
				this.elidedGroups = remaining;
				this.elisionBegin = first.length;
				this.elisionEnd = first.length + this.elidedGroups;
				groups = groups.concat(first);
				for (let i = 0; i < remaining; i++) groups.push("0");
				groups = groups.concat(last);
			} else if (halves.length === 1) {
				groups = address.split(":");
				this.elidedGroups = 0;
			} else throw new address_error_1$1.AddressError("Too many :: groups found");
			groups = groups.map((group) => parseInt(group, 16).toString(16));
			if (groups.length !== this.groups) throw new address_error_1$1.AddressError("Incorrect number of groups found");
			return groups;
		}
		canonicalForm() {
			return this.parsedAddress.map(paddedHex).join(":");
		}
		decimal() {
			return this.parsedAddress.map((n$1) => parseInt(n$1, 16).toString(10).padStart(5, "0")).join(":");
		}
		bigInt() {
			return BigInt(`0x${this.parsedAddress.map(paddedHex).join("")}`);
		}
		to4() {
			const binary = this.binaryZeroPad().split("");
			return ipv4_1$1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16));
		}
		to4in6() {
			const address4 = this.to4();
			const correct = new Address6(this.parsedAddress.slice(0, 6).join(":"), 6).correctForm();
			let infix = "";
			if (!/:$/.test(correct)) infix = ":";
			return correct + infix + address4.address;
		}
		inspectTeredo() {
			const prefix = this.getBitsBase16(0, 32);
			const udpPort = (this.getBits(80, 96) ^ BigInt("0xffff")).toString();
			const server4 = ipv4_1$1.Address4.fromHex(this.getBitsBase16(32, 64));
			const bitsForClient4 = this.getBits(96, 128);
			const client4 = ipv4_1$1.Address4.fromHex((bitsForClient4 ^ BigInt("0xffffffff")).toString(16));
			const flagsBase2 = this.getBitsBase2(64, 80);
			const coneNat = (0, common_1$1.testBit)(flagsBase2, 15);
			const reserved = (0, common_1$1.testBit)(flagsBase2, 14);
			const groupIndividual = (0, common_1$1.testBit)(flagsBase2, 8);
			const universalLocal = (0, common_1$1.testBit)(flagsBase2, 9);
			const nonce = BigInt(`0b${flagsBase2.slice(2, 6) + flagsBase2.slice(8, 16)}`).toString(10);
			return {
				prefix: `${prefix.slice(0, 4)}:${prefix.slice(4, 8)}`,
				server4: server4.address,
				client4: client4.address,
				flags: flagsBase2,
				coneNat,
				microsoft: {
					reserved,
					universalLocal,
					groupIndividual,
					nonce
				},
				udpPort
			};
		}
		inspect6to4() {
			const prefix = this.getBitsBase16(0, 16);
			const gateway = ipv4_1$1.Address4.fromHex(this.getBitsBase16(16, 48));
			return {
				prefix: prefix.slice(0, 4),
				gateway: gateway.address
			};
		}
		to6to4() {
			if (!this.is4()) return null;
			return new Address6([
				"2002",
				this.getBitsBase16(96, 112),
				this.getBitsBase16(112, 128),
				"",
				"/16"
			].join(":"));
		}
		toByteArray() {
			const valueWithoutPadding = this.bigInt().toString(16);
			const value = `${"0".repeat(valueWithoutPadding.length % 2)}${valueWithoutPadding}`;
			const bytes = [];
			for (let i = 0, length = value.length; i < length; i += 2) bytes.push(parseInt(value.substring(i, i + 2), 16));
			return bytes;
		}
		toUnsignedByteArray() {
			return this.toByteArray().map(unsignByte);
		}
		static fromByteArray(bytes) {
			return this.fromUnsignedByteArray(bytes.map(unsignByte));
		}
		static fromUnsignedByteArray(bytes) {
			const BYTE_MAX = BigInt("256");
			let result = BigInt("0");
			let multiplier = BigInt("1");
			for (let i = bytes.length - 1; i >= 0; i--) {
				result += multiplier * BigInt(bytes[i].toString(10));
				multiplier *= BYTE_MAX;
			}
			return Address6.fromBigInt(result);
		}
		isCanonical() {
			return this.addressMinusSuffix === this.canonicalForm();
		}
		isLinkLocal() {
			if (this.getBitsBase2(0, 64) === "1111111010000000000000000000000000000000000000000000000000000000") return true;
			return false;
		}
		isMulticast() {
			return this.getType() === "Multicast";
		}
		is4() {
			return this.v4;
		}
		isTeredo() {
			return this.isInSubnet(new Address6("2001::/32"));
		}
		is6to4() {
			return this.isInSubnet(new Address6("2002::/16"));
		}
		isLoopback() {
			return this.getType() === "Loopback";
		}
		href(optionalPort) {
			if (optionalPort === void 0) optionalPort = "";
			else optionalPort = `:${optionalPort}`;
			return `http://[${this.correctForm()}]${optionalPort}/`;
		}
		link(options) {
			if (!options) options = {};
			if (options.className === void 0) options.className = "";
			if (options.prefix === void 0) options.prefix = "/#address=";
			if (options.v4 === void 0) options.v4 = false;
			let formFunction = this.correctForm;
			if (options.v4) formFunction = this.to4in6;
			const form = formFunction.call(this);
			if (options.className) return `<a href="${options.prefix}${form}" class="${options.className}">${form}</a>`;
			return `<a href="${options.prefix}${form}">${form}</a>`;
		}
		group() {
			if (this.elidedGroups === 0) return helpers$1.simpleGroup(this.address).join(":");
			assert$27(typeof this.elidedGroups === "number");
			assert$27(typeof this.elisionBegin === "number");
			const output = [];
			const [left, right] = this.address.split("::");
			if (left.length) output.push(...helpers$1.simpleGroup(left));
			else output.push("");
			const classes = ["hover-group"];
			for (let i = this.elisionBegin; i < this.elisionBegin + this.elidedGroups; i++) classes.push(`group-${i}`);
			output.push(`<span class="${classes.join(" ")}"></span>`);
			if (right.length) output.push(...helpers$1.simpleGroup(right, this.elisionEnd));
			else output.push("");
			if (this.is4()) {
				assert$27(this.address4 instanceof ipv4_1$1.Address4);
				output.pop();
				output.push(this.address4.groupForV6());
			}
			return output.join(":");
		}
		regularExpressionString(substringSearch = false) {
			let output = [];
			const address6 = new Address6(this.correctForm());
			if (address6.elidedGroups === 0) output.push((0, regular_expressions_1.simpleRegularExpression)(address6.parsedAddress));
			else if (address6.elidedGroups === constants6.GROUPS) output.push((0, regular_expressions_1.possibleElisions)(constants6.GROUPS));
			else {
				const halves = address6.address.split("::");
				if (halves[0].length) output.push((0, regular_expressions_1.simpleRegularExpression)(halves[0].split(":")));
				assert$27(typeof address6.elidedGroups === "number");
				output.push((0, regular_expressions_1.possibleElisions)(address6.elidedGroups, halves[0].length !== 0, halves[1].length !== 0));
				if (halves[1].length) output.push((0, regular_expressions_1.simpleRegularExpression)(halves[1].split(":")));
				output = [output.join(":")];
			}
			if (!substringSearch) output = [
				"(?=^|",
				regular_expressions_1.ADDRESS_BOUNDARY,
				"|[^\\w\\:])(",
				...output,
				")(?=[^\\w\\:]|",
				regular_expressions_1.ADDRESS_BOUNDARY,
				"|$)"
			];
			return output.join("");
		}
		regularExpression(substringSearch = false) {
			return new RegExp(this.regularExpressionString(substringSearch), "i");
		}
	};
}));
var require_ip_address = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$14 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$10 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$11 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$14(result, mod, k);
		}
		__setModuleDefault$10(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.v6 = exports.AddressError = exports.Address6 = exports.Address4 = void 0;
	var ipv4_1 = require_ipv4();
	Object.defineProperty(exports, "Address4", {
		enumerable: true,
		get: function() {
			return ipv4_1.Address4;
		}
	});
	var ipv6_1 = require_ipv6();
	Object.defineProperty(exports, "Address6", {
		enumerable: true,
		get: function() {
			return ipv6_1.Address6;
		}
	});
	var address_error_1 = require_address_error();
	Object.defineProperty(exports, "AddressError", {
		enumerable: true,
		get: function() {
			return address_error_1.AddressError;
		}
	});
	exports.v6 = { helpers: __importStar$11(require_helpers$2()) };
}));
var require_helpers$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ipToBuffer = exports.int32ToIpv4 = exports.ipv4ToInt32 = exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = void 0;
	var util_1$8 = require_util$10();
	var constants_1$1 = require_constants$7();
	var stream$3 = require("stream");
	var ip_address_1$1 = require_ip_address();
	var net$9 = require("net");
	function validateSocksClientOptions(options, acceptedCommands = [
		"connect",
		"bind",
		"associate"
	]) {
		if (!constants_1$1.SocksCommand[options.command]) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksCommand, options);
		if (acceptedCommands.indexOf(options.command) === -1) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksCommandForOperation, options);
		if (!isValidSocksRemoteHost(options.destination)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsDestination, options);
		if (!isValidSocksProxy(options.proxy)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsProxy, options);
		validateCustomProxyAuth(options.proxy, options);
		if (options.timeout && !isValidTimeoutValue(options.timeout)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsTimeout, options);
		if (options.existing_socket && !(options.existing_socket instanceof stream$3.Duplex)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsExistingSocket, options);
	}
	exports.validateSocksClientOptions = validateSocksClientOptions;
	function validateSocksClientChainOptions(options) {
		if (options.command !== "connect") throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksCommandChain, options);
		if (!isValidSocksRemoteHost(options.destination)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsDestination, options);
		if (!(options.proxies && Array.isArray(options.proxies) && options.proxies.length >= 2)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsProxiesLength, options);
		options.proxies.forEach((proxy) => {
			if (!isValidSocksProxy(proxy)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsProxy, options);
			validateCustomProxyAuth(proxy, options);
		});
		if (options.timeout && !isValidTimeoutValue(options.timeout)) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsTimeout, options);
	}
	exports.validateSocksClientChainOptions = validateSocksClientChainOptions;
	function validateCustomProxyAuth(proxy, options) {
		if (proxy.custom_auth_method !== void 0) {
			if (proxy.custom_auth_method < constants_1$1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1$1.SOCKS5_CUSTOM_AUTH_END) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options);
			if (proxy.custom_auth_request_handler === void 0 || typeof proxy.custom_auth_request_handler !== "function") throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options);
			if (proxy.custom_auth_response_size === void 0) throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options);
			if (proxy.custom_auth_response_handler === void 0 || typeof proxy.custom_auth_response_handler !== "function") throw new util_1$8.SocksClientError(constants_1$1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options);
		}
	}
	function isValidSocksRemoteHost(remoteHost) {
		return remoteHost && typeof remoteHost.host === "string" && Buffer.byteLength(remoteHost.host) < 256 && typeof remoteHost.port === "number" && remoteHost.port >= 0 && remoteHost.port <= 65535;
	}
	function isValidSocksProxy(proxy) {
		return proxy && (typeof proxy.host === "string" || typeof proxy.ipaddress === "string") && typeof proxy.port === "number" && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5);
	}
	function isValidTimeoutValue(value) {
		return typeof value === "number" && value > 0;
	}
	function ipv4ToInt32(ip) {
		return new ip_address_1$1.Address4(ip).toArray().reduce((acc, part) => (acc << 8) + part, 0) >>> 0;
	}
	exports.ipv4ToInt32 = ipv4ToInt32;
	function int32ToIpv4(int32) {
		return [
			int32 >>> 24 & 255,
			int32 >>> 16 & 255,
			int32 >>> 8 & 255,
			int32 & 255
		].join(".");
	}
	exports.int32ToIpv4 = int32ToIpv4;
	function ipToBuffer(ip) {
		if (net$9.isIPv4(ip)) {
			const address = new ip_address_1$1.Address4(ip);
			return Buffer.from(address.toArray());
		} else if (net$9.isIPv6(ip)) {
			const address = new ip_address_1$1.Address6(ip);
			return Buffer.from(address.canonicalForm().split(":").map((segment) => segment.padStart(4, "0")).join(""), "hex");
		} else throw new Error("Invalid IP address format");
	}
	exports.ipToBuffer = ipToBuffer;
}));
var require_receivebuffer = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ReceiveBuffer = void 0;
	var ReceiveBuffer = class {
		constructor(size = 4096) {
			this.buffer = Buffer.allocUnsafe(size);
			this.offset = 0;
			this.originalSize = size;
		}
		get length() {
			return this.offset;
		}
		append(data$1) {
			if (!Buffer.isBuffer(data$1)) throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");
			if (this.offset + data$1.length >= this.buffer.length) {
				const tmp = this.buffer;
				this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data$1.length));
				tmp.copy(this.buffer);
			}
			data$1.copy(this.buffer, this.offset);
			return this.offset += data$1.length;
		}
		peek(length) {
			if (length > this.offset) throw new Error("Attempted to read beyond the bounds of the managed internal data.");
			return this.buffer.slice(0, length);
		}
		get(length) {
			if (length > this.offset) throw new Error("Attempted to read beyond the bounds of the managed internal data.");
			const value = Buffer.allocUnsafe(length);
			this.buffer.slice(0, length).copy(value);
			this.buffer.copyWithin(0, length, length + this.offset - length);
			this.offset -= length;
			return value;
		}
	};
	exports.ReceiveBuffer = ReceiveBuffer;
}));
var require_socksclient = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __awaiter$1 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
		function adopt(value) {
			return value instanceof P ? value : new P(function(resolve) {
				resolve(value);
			});
		}
		return new (P || (P = Promise))(function(resolve, reject) {
			function fulfilled(value) {
				try {
					step(generator.next(value));
				} catch (e) {
					reject(e);
				}
			}
			function rejected(value) {
				try {
					step(generator["throw"](value));
				} catch (e) {
					reject(e);
				}
			}
			function step(result) {
				result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
			}
			step((generator = generator.apply(thisArg, _arguments || [])).next());
		});
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.SocksClientError = exports.SocksClient = void 0;
	var events_1$3 = require("events");
	var net$8 = require("net");
	var smart_buffer_1 = require_smartbuffer();
	var constants_1 = require_constants$7();
	var helpers_1 = require_helpers$1();
	var receivebuffer_1 = require_receivebuffer();
	var util_1$7 = require_util$10();
	Object.defineProperty(exports, "SocksClientError", {
		enumerable: true,
		get: function() {
			return util_1$7.SocksClientError;
		}
	});
	var ip_address_1 = require_ip_address();
	exports.SocksClient = class SocksClient extends events_1$3.EventEmitter {
		constructor(options) {
			super();
			this.options = Object.assign({}, options);
			(0, helpers_1.validateSocksClientOptions)(options);
			this.setState(constants_1.SocksClientState.Created);
		}
		static createConnection(options, callback) {
			return new Promise((resolve, reject) => {
				try {
					(0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
				} catch (err) {
					if (typeof callback === "function") {
						callback(err);
						return resolve(err);
					} else return reject(err);
				}
				const client = new SocksClient(options);
				client.connect(options.existing_socket);
				client.once("established", (info) => {
					client.removeAllListeners();
					if (typeof callback === "function") {
						callback(null, info);
						resolve(info);
					} else resolve(info);
				});
				client.once("error", (err) => {
					client.removeAllListeners();
					if (typeof callback === "function") {
						callback(err);
						resolve(err);
					} else reject(err);
				});
			});
		}
		static createConnectionChain(options, callback) {
			return new Promise((resolve, reject) => __awaiter$1(this, void 0, void 0, function* () {
				try {
					(0, helpers_1.validateSocksClientChainOptions)(options);
				} catch (err) {
					if (typeof callback === "function") {
						callback(err);
						return resolve(err);
					} else return reject(err);
				}
				if (options.randomizeChain) (0, util_1$7.shuffleArray)(options.proxies);
				try {
					let sock;
					for (let i = 0; i < options.proxies.length; i++) {
						const nextProxy = options.proxies[i];
						const nextDestination = i === options.proxies.length - 1 ? options.destination : {
							host: options.proxies[i + 1].host || options.proxies[i + 1].ipaddress,
							port: options.proxies[i + 1].port
						};
						const result = yield SocksClient.createConnection({
							command: "connect",
							proxy: nextProxy,
							destination: nextDestination,
							existing_socket: sock
						});
						sock = sock || result.socket;
					}
					if (typeof callback === "function") {
						callback(null, { socket: sock });
						resolve({ socket: sock });
					} else resolve({ socket: sock });
				} catch (err) {
					if (typeof callback === "function") {
						callback(err);
						resolve(err);
					} else reject(err);
				}
			}));
		}
		static createUDPFrame(options) {
			const buff = new smart_buffer_1.SmartBuffer();
			buff.writeUInt16BE(0);
			buff.writeUInt8(options.frameNumber || 0);
			if (net$8.isIPv4(options.remoteHost.host)) {
				buff.writeUInt8(constants_1.Socks5HostType.IPv4);
				buff.writeUInt32BE((0, helpers_1.ipv4ToInt32)(options.remoteHost.host));
			} else if (net$8.isIPv6(options.remoteHost.host)) {
				buff.writeUInt8(constants_1.Socks5HostType.IPv6);
				buff.writeBuffer((0, helpers_1.ipToBuffer)(options.remoteHost.host));
			} else {
				buff.writeUInt8(constants_1.Socks5HostType.Hostname);
				buff.writeUInt8(Buffer.byteLength(options.remoteHost.host));
				buff.writeString(options.remoteHost.host);
			}
			buff.writeUInt16BE(options.remoteHost.port);
			buff.writeBuffer(options.data);
			return buff.toBuffer();
		}
		static parseUDPFrame(data$1) {
			const buff = smart_buffer_1.SmartBuffer.fromBuffer(data$1);
			buff.readOffset = 2;
			const frameNumber = buff.readUInt8();
			const hostType = buff.readUInt8();
			let remoteHost;
			if (hostType === constants_1.Socks5HostType.IPv4) remoteHost = (0, helpers_1.int32ToIpv4)(buff.readUInt32BE());
			else if (hostType === constants_1.Socks5HostType.IPv6) remoteHost = ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm();
			else remoteHost = buff.readString(buff.readUInt8());
			const remotePort = buff.readUInt16BE();
			return {
				frameNumber,
				remoteHost: {
					host: remoteHost,
					port: remotePort
				},
				data: buff.readBuffer()
			};
		}
		setState(newState) {
			if (this.state !== constants_1.SocksClientState.Error) this.state = newState;
		}
		connect(existingSocket) {
			this.onDataReceived = (data$1) => this.onDataReceivedHandler(data$1);
			this.onClose = () => this.onCloseHandler();
			this.onError = (err) => this.onErrorHandler(err);
			this.onConnect = () => this.onConnectHandler();
			const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT);
			if (timer.unref && typeof timer.unref === "function") timer.unref();
			if (existingSocket) this.socket = existingSocket;
			else this.socket = new net$8.Socket();
			this.socket.once("close", this.onClose);
			this.socket.once("error", this.onError);
			this.socket.once("connect", this.onConnect);
			this.socket.on("data", this.onDataReceived);
			this.setState(constants_1.SocksClientState.Connecting);
			this.receiveBuffer = new receivebuffer_1.ReceiveBuffer();
			if (existingSocket) this.socket.emit("connect");
			else {
				this.socket.connect(this.getSocketOptions());
				if (this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null) this.socket.setNoDelay(!!this.options.set_tcp_nodelay);
			}
			this.prependOnceListener("established", (info) => {
				setImmediate(() => {
					if (this.receiveBuffer.length > 0) {
						const excessData = this.receiveBuffer.get(this.receiveBuffer.length);
						info.socket.emit("data", excessData);
					}
					info.socket.resume();
				});
			});
		}
		getSocketOptions() {
			return Object.assign(Object.assign({}, this.options.socket_options), {
				host: this.options.proxy.host || this.options.proxy.ipaddress,
				port: this.options.proxy.port
			});
		}
		onEstablishedTimeout() {
			if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut);
		}
		onConnectHandler() {
			this.setState(constants_1.SocksClientState.Connected);
			if (this.options.proxy.type === 4) this.sendSocks4InitialHandshake();
			else this.sendSocks5InitialHandshake();
			this.setState(constants_1.SocksClientState.SentInitialHandshake);
		}
		onDataReceivedHandler(data$1) {
			this.receiveBuffer.append(data$1);
			this.processData();
		}
		processData() {
			while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) if (this.state === constants_1.SocksClientState.SentInitialHandshake) if (this.options.proxy.type === 4) this.handleSocks4FinalHandshakeResponse();
			else this.handleInitialSocks5HandshakeResponse();
			else if (this.state === constants_1.SocksClientState.SentAuthentication) this.handleInitialSocks5AuthenticationHandshakeResponse();
			else if (this.state === constants_1.SocksClientState.SentFinalHandshake) this.handleSocks5FinalHandshakeResponse();
			else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) if (this.options.proxy.type === 4) this.handleSocks4IncomingConnectionResponse();
			else this.handleSocks5IncomingConnectionResponse();
			else {
				this.closeSocket(constants_1.ERRORS.InternalError);
				break;
			}
		}
		onCloseHandler() {
			this.closeSocket(constants_1.ERRORS.SocketClosed);
		}
		onErrorHandler(err) {
			this.closeSocket(err.message);
		}
		removeInternalSocketHandlers() {
			this.socket.pause();
			this.socket.removeListener("data", this.onDataReceived);
			this.socket.removeListener("close", this.onClose);
			this.socket.removeListener("error", this.onError);
			this.socket.removeListener("connect", this.onConnect);
		}
		closeSocket(err) {
			if (this.state !== constants_1.SocksClientState.Error) {
				this.setState(constants_1.SocksClientState.Error);
				this.socket.destroy();
				this.removeInternalSocketHandlers();
				this.emit("error", new util_1$7.SocksClientError(err, this.options));
			}
		}
		sendSocks4InitialHandshake() {
			const userId = this.options.proxy.userId || "";
			const buff = new smart_buffer_1.SmartBuffer();
			buff.writeUInt8(4);
			buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
			buff.writeUInt16BE(this.options.destination.port);
			if (net$8.isIPv4(this.options.destination.host)) {
				buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
				buff.writeStringNT(userId);
			} else {
				buff.writeUInt8(0);
				buff.writeUInt8(0);
				buff.writeUInt8(0);
				buff.writeUInt8(1);
				buff.writeStringNT(userId);
				buff.writeStringNT(this.options.destination.host);
			}
			this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response;
			this.socket.write(buff.toBuffer());
		}
		handleSocks4FinalHandshakeResponse() {
			const data$1 = this.receiveBuffer.get(8);
			if (data$1[1] !== constants_1.Socks4Response.Granted) this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data$1[1]]})`);
			else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) {
				const buff = smart_buffer_1.SmartBuffer.fromBuffer(data$1);
				buff.readOffset = 2;
				const remoteHost = {
					port: buff.readUInt16BE(),
					host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE())
				};
				if (remoteHost.host === "0.0.0.0") remoteHost.host = this.options.proxy.ipaddress;
				this.setState(constants_1.SocksClientState.BoundWaitingForConnection);
				this.emit("bound", {
					remoteHost,
					socket: this.socket
				});
			} else {
				this.setState(constants_1.SocksClientState.Established);
				this.removeInternalSocketHandlers();
				this.emit("established", { socket: this.socket });
			}
		}
		handleSocks4IncomingConnectionResponse() {
			const data$1 = this.receiveBuffer.get(8);
			if (data$1[1] !== constants_1.Socks4Response.Granted) this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data$1[1]]})`);
			else {
				const buff = smart_buffer_1.SmartBuffer.fromBuffer(data$1);
				buff.readOffset = 2;
				const remoteHost = {
					port: buff.readUInt16BE(),
					host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE())
				};
				this.setState(constants_1.SocksClientState.Established);
				this.removeInternalSocketHandlers();
				this.emit("established", {
					remoteHost,
					socket: this.socket
				});
			}
		}
		sendSocks5InitialHandshake() {
			const buff = new smart_buffer_1.SmartBuffer();
			const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth];
			if (this.options.proxy.userId || this.options.proxy.password) supportedAuthMethods.push(constants_1.Socks5Auth.UserPass);
			if (this.options.proxy.custom_auth_method !== void 0) supportedAuthMethods.push(this.options.proxy.custom_auth_method);
			buff.writeUInt8(5);
			buff.writeUInt8(supportedAuthMethods.length);
			for (const authMethod of supportedAuthMethods) buff.writeUInt8(authMethod);
			this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse;
			this.socket.write(buff.toBuffer());
			this.setState(constants_1.SocksClientState.SentInitialHandshake);
		}
		handleInitialSocks5HandshakeResponse() {
			const data$1 = this.receiveBuffer.get(2);
			if (data$1[0] !== 5) this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion);
			else if (data$1[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType);
			else if (data$1[1] === constants_1.Socks5Auth.NoAuth) {
				this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth;
				this.sendSocks5CommandRequest();
			} else if (data$1[1] === constants_1.Socks5Auth.UserPass) {
				this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass;
				this.sendSocks5UserPassAuthentication();
			} else if (data$1[1] === this.options.proxy.custom_auth_method) {
				this.socks5ChosenAuthType = this.options.proxy.custom_auth_method;
				this.sendSocks5CustomAuthentication();
			} else this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType);
		}
		sendSocks5UserPassAuthentication() {
			const userId = this.options.proxy.userId || "";
			const password = this.options.proxy.password || "";
			const buff = new smart_buffer_1.SmartBuffer();
			buff.writeUInt8(1);
			buff.writeUInt8(Buffer.byteLength(userId));
			buff.writeString(userId);
			buff.writeUInt8(Buffer.byteLength(password));
			buff.writeString(password);
			this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse;
			this.socket.write(buff.toBuffer());
			this.setState(constants_1.SocksClientState.SentAuthentication);
		}
		sendSocks5CustomAuthentication() {
			return __awaiter$1(this, void 0, void 0, function* () {
				this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size;
				this.socket.write(yield this.options.proxy.custom_auth_request_handler());
				this.setState(constants_1.SocksClientState.SentAuthentication);
			});
		}
		handleSocks5CustomAuthHandshakeResponse(data$1) {
			return __awaiter$1(this, void 0, void 0, function* () {
				return yield this.options.proxy.custom_auth_response_handler(data$1);
			});
		}
		handleSocks5AuthenticationNoAuthHandshakeResponse(data$1) {
			return __awaiter$1(this, void 0, void 0, function* () {
				return data$1[1] === 0;
			});
		}
		handleSocks5AuthenticationUserPassHandshakeResponse(data$1) {
			return __awaiter$1(this, void 0, void 0, function* () {
				return data$1[1] === 0;
			});
		}
		handleInitialSocks5AuthenticationHandshakeResponse() {
			return __awaiter$1(this, void 0, void 0, function* () {
				this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse);
				let authResult = false;
				if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2));
				else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));
				else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size));
				if (!authResult) this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed);
				else this.sendSocks5CommandRequest();
			});
		}
		sendSocks5CommandRequest() {
			const buff = new smart_buffer_1.SmartBuffer();
			buff.writeUInt8(5);
			buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
			buff.writeUInt8(0);
			if (net$8.isIPv4(this.options.destination.host)) {
				buff.writeUInt8(constants_1.Socks5HostType.IPv4);
				buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
			} else if (net$8.isIPv6(this.options.destination.host)) {
				buff.writeUInt8(constants_1.Socks5HostType.IPv6);
				buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
			} else {
				buff.writeUInt8(constants_1.Socks5HostType.Hostname);
				buff.writeUInt8(this.options.destination.host.length);
				buff.writeString(this.options.destination.host);
			}
			buff.writeUInt16BE(this.options.destination.port);
			this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;
			this.socket.write(buff.toBuffer());
			this.setState(constants_1.SocksClientState.SentFinalHandshake);
		}
		handleSocks5FinalHandshakeResponse() {
			const header = this.receiveBuffer.peek(5);
			if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`);
			else {
				const addressType = header[3];
				let remoteHost;
				let buff;
				if (addressType === constants_1.Socks5HostType.IPv4) {
					const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;
					if (this.receiveBuffer.length < dataNeeded) {
						this.nextRequiredPacketBufferSize = dataNeeded;
						return;
					}
					buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
					remoteHost = {
						host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()),
						port: buff.readUInt16BE()
					};
					if (remoteHost.host === "0.0.0.0") remoteHost.host = this.options.proxy.ipaddress;
				} else if (addressType === constants_1.Socks5HostType.Hostname) {
					const hostLength = header[4];
					const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength);
					if (this.receiveBuffer.length < dataNeeded) {
						this.nextRequiredPacketBufferSize = dataNeeded;
						return;
					}
					buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5));
					remoteHost = {
						host: buff.readString(hostLength),
						port: buff.readUInt16BE()
					};
				} else if (addressType === constants_1.Socks5HostType.IPv6) {
					const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;
					if (this.receiveBuffer.length < dataNeeded) {
						this.nextRequiredPacketBufferSize = dataNeeded;
						return;
					}
					buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
					remoteHost = {
						host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(),
						port: buff.readUInt16BE()
					};
				}
				this.setState(constants_1.SocksClientState.ReceivedFinalResponse);
				if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) {
					this.setState(constants_1.SocksClientState.Established);
					this.removeInternalSocketHandlers();
					this.emit("established", {
						remoteHost,
						socket: this.socket
					});
				} else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) {
					this.setState(constants_1.SocksClientState.BoundWaitingForConnection);
					this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;
					this.emit("bound", {
						remoteHost,
						socket: this.socket
					});
				} else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) {
					this.setState(constants_1.SocksClientState.Established);
					this.removeInternalSocketHandlers();
					this.emit("established", {
						remoteHost,
						socket: this.socket
					});
				}
			}
		}
		handleSocks5IncomingConnectionResponse() {
			const header = this.receiveBuffer.peek(5);
			if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`);
			else {
				const addressType = header[3];
				let remoteHost;
				let buff;
				if (addressType === constants_1.Socks5HostType.IPv4) {
					const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;
					if (this.receiveBuffer.length < dataNeeded) {
						this.nextRequiredPacketBufferSize = dataNeeded;
						return;
					}
					buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
					remoteHost = {
						host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()),
						port: buff.readUInt16BE()
					};
					if (remoteHost.host === "0.0.0.0") remoteHost.host = this.options.proxy.ipaddress;
				} else if (addressType === constants_1.Socks5HostType.Hostname) {
					const hostLength = header[4];
					const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength);
					if (this.receiveBuffer.length < dataNeeded) {
						this.nextRequiredPacketBufferSize = dataNeeded;
						return;
					}
					buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5));
					remoteHost = {
						host: buff.readString(hostLength),
						port: buff.readUInt16BE()
					};
				} else if (addressType === constants_1.Socks5HostType.IPv6) {
					const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;
					if (this.receiveBuffer.length < dataNeeded) {
						this.nextRequiredPacketBufferSize = dataNeeded;
						return;
					}
					buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
					remoteHost = {
						host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(),
						port: buff.readUInt16BE()
					};
				}
				this.setState(constants_1.SocksClientState.Established);
				this.removeInternalSocketHandlers();
				this.emit("established", {
					remoteHost,
					socket: this.socket
				});
			}
		}
		get socksClientOptions() {
			return Object.assign({}, this.options);
		}
	};
}));
var require_build = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$13 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __exportStar$5 = exports && exports.__exportStar || function(m$1, exports$1) {
		for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding$13(exports$1, m$1, p);
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	__exportStar$5(require_socksclient(), exports);
}));
var require_symbols$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		kClose: Symbol("close"),
		kDestroy: Symbol("destroy"),
		kDispatch: Symbol("dispatch"),
		kUrl: Symbol("url"),
		kWriting: Symbol("writing"),
		kResuming: Symbol("resuming"),
		kQueue: Symbol("queue"),
		kConnect: Symbol("connect"),
		kConnecting: Symbol("connecting"),
		kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"),
		kKeepAliveMaxTimeout: Symbol("max keep alive timeout"),
		kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"),
		kKeepAliveTimeoutValue: Symbol("keep alive timeout"),
		kKeepAlive: Symbol("keep alive"),
		kHeadersTimeout: Symbol("headers timeout"),
		kBodyTimeout: Symbol("body timeout"),
		kServerName: Symbol("server name"),
		kLocalAddress: Symbol("local address"),
		kHost: Symbol("host"),
		kNoRef: Symbol("no ref"),
		kBodyUsed: Symbol("used"),
		kBody: Symbol("abstracted request body"),
		kRunning: Symbol("running"),
		kBlocking: Symbol("blocking"),
		kPending: Symbol("pending"),
		kSize: Symbol("size"),
		kBusy: Symbol("busy"),
		kQueued: Symbol("queued"),
		kFree: Symbol("free"),
		kConnected: Symbol("connected"),
		kClosed: Symbol("closed"),
		kNeedDrain: Symbol("need drain"),
		kReset: Symbol("reset"),
		kDestroyed: Symbol.for("nodejs.stream.destroyed"),
		kResume: Symbol("resume"),
		kOnError: Symbol("on error"),
		kMaxHeadersSize: Symbol("max headers size"),
		kRunningIdx: Symbol("running index"),
		kPendingIdx: Symbol("pending index"),
		kError: Symbol("error"),
		kClients: Symbol("clients"),
		kClient: Symbol("client"),
		kParser: Symbol("parser"),
		kOnDestroyed: Symbol("destroy callbacks"),
		kPipelining: Symbol("pipelining"),
		kSocket: Symbol("socket"),
		kHostHeader: Symbol("host header"),
		kConnector: Symbol("connector"),
		kStrictContentLength: Symbol("strict content length"),
		kMaxRedirections: Symbol("maxRedirections"),
		kMaxRequests: Symbol("maxRequestsPerClient"),
		kProxy: Symbol("proxy agent options"),
		kCounter: Symbol("socket request counter"),
		kInterceptors: Symbol("dispatch interceptors"),
		kMaxResponseSize: Symbol("max response size"),
		kHTTP2Session: Symbol("http2Session"),
		kHTTP2SessionState: Symbol("http2Session state"),
		kRetryHandlerDefaultRetry: Symbol("retry agent default retry"),
		kConstruct: Symbol("constructable"),
		kListeners: Symbol("listeners"),
		kHTTPContext: Symbol("http context"),
		kMaxConcurrentStreams: Symbol("max concurrent streams"),
		kNoProxyAgent: Symbol("no proxy agent"),
		kHttpProxyAgent: Symbol("http proxy agent"),
		kHttpsProxyAgent: Symbol("https proxy agent")
	};
}));
var require_errors$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var kUndiciError = Symbol.for("undici.error.UND_ERR");
	var UndiciError$2 = class extends Error {
		constructor(message) {
			super(message);
			this.name = "UndiciError";
			this.code = "UND_ERR";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kUndiciError] === true;
		}
		[kUndiciError] = true;
	};
	var kConnectTimeoutError = Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");
	var ConnectTimeoutError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "ConnectTimeoutError";
			this.message = message || "Connect Timeout Error";
			this.code = "UND_ERR_CONNECT_TIMEOUT";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kConnectTimeoutError] === true;
		}
		[kConnectTimeoutError] = true;
	};
	var kHeadersTimeoutError = Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");
	var HeadersTimeoutError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "HeadersTimeoutError";
			this.message = message || "Headers Timeout Error";
			this.code = "UND_ERR_HEADERS_TIMEOUT";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kHeadersTimeoutError] === true;
		}
		[kHeadersTimeoutError] = true;
	};
	var kHeadersOverflowError = Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");
	var HeadersOverflowError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "HeadersOverflowError";
			this.message = message || "Headers Overflow Error";
			this.code = "UND_ERR_HEADERS_OVERFLOW";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kHeadersOverflowError] === true;
		}
		[kHeadersOverflowError] = true;
	};
	var kBodyTimeoutError = Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");
	var BodyTimeoutError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "BodyTimeoutError";
			this.message = message || "Body Timeout Error";
			this.code = "UND_ERR_BODY_TIMEOUT";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kBodyTimeoutError] === true;
		}
		[kBodyTimeoutError] = true;
	};
	var kResponseStatusCodeError = Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE");
	var ResponseStatusCodeError$1 = class extends UndiciError$2 {
		constructor(message, statusCode, headers, body) {
			super(message);
			this.name = "ResponseStatusCodeError";
			this.message = message || "Response Status Code Error";
			this.code = "UND_ERR_RESPONSE_STATUS_CODE";
			this.body = body;
			this.status = statusCode;
			this.statusCode = statusCode;
			this.headers = headers;
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kResponseStatusCodeError] === true;
		}
		[kResponseStatusCodeError] = true;
	};
	var kInvalidArgumentError = Symbol.for("undici.error.UND_ERR_INVALID_ARG");
	var InvalidArgumentError$24 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "InvalidArgumentError";
			this.message = message || "Invalid Argument Error";
			this.code = "UND_ERR_INVALID_ARG";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kInvalidArgumentError] === true;
		}
		[kInvalidArgumentError] = true;
	};
	var kInvalidReturnValueError = Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");
	var InvalidReturnValueError$2 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "InvalidReturnValueError";
			this.message = message || "Invalid Return Value Error";
			this.code = "UND_ERR_INVALID_RETURN_VALUE";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kInvalidReturnValueError] === true;
		}
		[kInvalidReturnValueError] = true;
	};
	var kAbortError = Symbol.for("undici.error.UND_ERR_ABORT");
	var AbortError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "AbortError";
			this.message = message || "The operation was aborted";
			this.code = "UND_ERR_ABORT";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kAbortError] === true;
		}
		[kAbortError] = true;
	};
	var kRequestAbortedError = Symbol.for("undici.error.UND_ERR_ABORTED");
	var RequestAbortedError$8 = class extends AbortError$1 {
		constructor(message) {
			super(message);
			this.name = "AbortError";
			this.message = message || "Request aborted";
			this.code = "UND_ERR_ABORTED";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kRequestAbortedError] === true;
		}
		[kRequestAbortedError] = true;
	};
	var kInformationalError = Symbol.for("undici.error.UND_ERR_INFO");
	var InformationalError$4 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "InformationalError";
			this.message = message || "Request information";
			this.code = "UND_ERR_INFO";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kInformationalError] === true;
		}
		[kInformationalError] = true;
	};
	var kRequestContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");
	var RequestContentLengthMismatchError$2 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "RequestContentLengthMismatchError";
			this.message = message || "Request body length does not match content-length header";
			this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kRequestContentLengthMismatchError] === true;
		}
		[kRequestContentLengthMismatchError] = true;
	};
	var kResponseContentLengthMismatchError = Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");
	var ResponseContentLengthMismatchError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "ResponseContentLengthMismatchError";
			this.message = message || "Response body length does not match content-length header";
			this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kResponseContentLengthMismatchError] === true;
		}
		[kResponseContentLengthMismatchError] = true;
	};
	var kClientDestroyedError = Symbol.for("undici.error.UND_ERR_DESTROYED");
	var ClientDestroyedError$2 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "ClientDestroyedError";
			this.message = message || "The client is destroyed";
			this.code = "UND_ERR_DESTROYED";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kClientDestroyedError] === true;
		}
		[kClientDestroyedError] = true;
	};
	var kClientClosedError = Symbol.for("undici.error.UND_ERR_CLOSED");
	var ClientClosedError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "ClientClosedError";
			this.message = message || "The client is closed";
			this.code = "UND_ERR_CLOSED";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kClientClosedError] === true;
		}
		[kClientClosedError] = true;
	};
	var kSocketError = Symbol.for("undici.error.UND_ERR_SOCKET");
	var SocketError$4 = class extends UndiciError$2 {
		constructor(message, socket) {
			super(message);
			this.name = "SocketError";
			this.message = message || "Socket error";
			this.code = "UND_ERR_SOCKET";
			this.socket = socket;
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kSocketError] === true;
		}
		[kSocketError] = true;
	};
	var kNotSupportedError = Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");
	var NotSupportedError$2 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "NotSupportedError";
			this.message = message || "Not supported error";
			this.code = "UND_ERR_NOT_SUPPORTED";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kNotSupportedError] === true;
		}
		[kNotSupportedError] = true;
	};
	var kBalancedPoolMissingUpstreamError = Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");
	var BalancedPoolMissingUpstreamError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "MissingUpstreamError";
			this.message = message || "No upstream has been added to the BalancedPool";
			this.code = "UND_ERR_BPL_MISSING_UPSTREAM";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kBalancedPoolMissingUpstreamError] === true;
		}
		[kBalancedPoolMissingUpstreamError] = true;
	};
	var kHTTPParserError = Symbol.for("undici.error.UND_ERR_HTTP_PARSER");
	var HTTPParserError$1 = class extends Error {
		constructor(message, code, data$1) {
			super(message);
			this.name = "HTTPParserError";
			this.code = code ? `HPE_${code}` : void 0;
			this.data = data$1 ? data$1.toString() : void 0;
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kHTTPParserError] === true;
		}
		[kHTTPParserError] = true;
	};
	var kResponseExceededMaxSizeError = Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");
	var ResponseExceededMaxSizeError$1 = class extends UndiciError$2 {
		constructor(message) {
			super(message);
			this.name = "ResponseExceededMaxSizeError";
			this.message = message || "Response content exceeded max size";
			this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kResponseExceededMaxSizeError] === true;
		}
		[kResponseExceededMaxSizeError] = true;
	};
	var kRequestRetryError = Symbol.for("undici.error.UND_ERR_REQ_RETRY");
	var RequestRetryError$1 = class extends UndiciError$2 {
		constructor(message, code, { headers, data: data$1 }) {
			super(message);
			this.name = "RequestRetryError";
			this.message = message || "Request retry error";
			this.code = "UND_ERR_REQ_RETRY";
			this.statusCode = code;
			this.data = data$1;
			this.headers = headers;
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kRequestRetryError] === true;
		}
		[kRequestRetryError] = true;
	};
	var kResponseError = Symbol.for("undici.error.UND_ERR_RESPONSE");
	var ResponseError = class extends UndiciError$2 {
		constructor(message, code, { headers, data: data$1 }) {
			super(message);
			this.name = "ResponseError";
			this.message = message || "Response error";
			this.code = "UND_ERR_RESPONSE";
			this.statusCode = code;
			this.data = data$1;
			this.headers = headers;
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kResponseError] === true;
		}
		[kResponseError] = true;
	};
	var kSecureProxyConnectionError = Symbol.for("undici.error.UND_ERR_PRX_TLS");
	var SecureProxyConnectionError$1 = class extends UndiciError$2 {
		constructor(cause, message, options) {
			super(message, {
				cause,
				...options ?? {}
			});
			this.name = "SecureProxyConnectionError";
			this.message = message || "Secure Proxy Connection failed";
			this.code = "UND_ERR_PRX_TLS";
			this.cause = cause;
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kSecureProxyConnectionError] === true;
		}
		[kSecureProxyConnectionError] = true;
	};
	module.exports = {
		AbortError: AbortError$1,
		HTTPParserError: HTTPParserError$1,
		UndiciError: UndiciError$2,
		HeadersTimeoutError: HeadersTimeoutError$1,
		HeadersOverflowError: HeadersOverflowError$1,
		BodyTimeoutError: BodyTimeoutError$1,
		RequestContentLengthMismatchError: RequestContentLengthMismatchError$2,
		ConnectTimeoutError: ConnectTimeoutError$1,
		ResponseStatusCodeError: ResponseStatusCodeError$1,
		InvalidArgumentError: InvalidArgumentError$24,
		InvalidReturnValueError: InvalidReturnValueError$2,
		RequestAbortedError: RequestAbortedError$8,
		ClientDestroyedError: ClientDestroyedError$2,
		ClientClosedError: ClientClosedError$1,
		InformationalError: InformationalError$4,
		SocketError: SocketError$4,
		NotSupportedError: NotSupportedError$2,
		ResponseContentLengthMismatchError: ResponseContentLengthMismatchError$1,
		BalancedPoolMissingUpstreamError: BalancedPoolMissingUpstreamError$1,
		ResponseExceededMaxSizeError: ResponseExceededMaxSizeError$1,
		RequestRetryError: RequestRetryError$1,
		ResponseError,
		SecureProxyConnectionError: SecureProxyConnectionError$1
	};
}));
var require_constants$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var headerNameLowerCasedRecord$3 = {};
	var wellknownHeaderNames$1 = [
		"Accept",
		"Accept-Encoding",
		"Accept-Language",
		"Accept-Ranges",
		"Access-Control-Allow-Credentials",
		"Access-Control-Allow-Headers",
		"Access-Control-Allow-Methods",
		"Access-Control-Allow-Origin",
		"Access-Control-Expose-Headers",
		"Access-Control-Max-Age",
		"Access-Control-Request-Headers",
		"Access-Control-Request-Method",
		"Age",
		"Allow",
		"Alt-Svc",
		"Alt-Used",
		"Authorization",
		"Cache-Control",
		"Clear-Site-Data",
		"Connection",
		"Content-Disposition",
		"Content-Encoding",
		"Content-Language",
		"Content-Length",
		"Content-Location",
		"Content-Range",
		"Content-Security-Policy",
		"Content-Security-Policy-Report-Only",
		"Content-Type",
		"Cookie",
		"Cross-Origin-Embedder-Policy",
		"Cross-Origin-Opener-Policy",
		"Cross-Origin-Resource-Policy",
		"Date",
		"Device-Memory",
		"Downlink",
		"ECT",
		"ETag",
		"Expect",
		"Expect-CT",
		"Expires",
		"Forwarded",
		"From",
		"Host",
		"If-Match",
		"If-Modified-Since",
		"If-None-Match",
		"If-Range",
		"If-Unmodified-Since",
		"Keep-Alive",
		"Last-Modified",
		"Link",
		"Location",
		"Max-Forwards",
		"Origin",
		"Permissions-Policy",
		"Pragma",
		"Proxy-Authenticate",
		"Proxy-Authorization",
		"RTT",
		"Range",
		"Referer",
		"Referrer-Policy",
		"Refresh",
		"Retry-After",
		"Sec-WebSocket-Accept",
		"Sec-WebSocket-Extensions",
		"Sec-WebSocket-Key",
		"Sec-WebSocket-Protocol",
		"Sec-WebSocket-Version",
		"Server",
		"Server-Timing",
		"Service-Worker-Allowed",
		"Service-Worker-Navigation-Preload",
		"Set-Cookie",
		"SourceMap",
		"Strict-Transport-Security",
		"Supports-Loading-Mode",
		"TE",
		"Timing-Allow-Origin",
		"Trailer",
		"Transfer-Encoding",
		"Upgrade",
		"Upgrade-Insecure-Requests",
		"User-Agent",
		"Vary",
		"Via",
		"WWW-Authenticate",
		"X-Content-Type-Options",
		"X-DNS-Prefetch-Control",
		"X-Frame-Options",
		"X-Permitted-Cross-Domain-Policies",
		"X-Powered-By",
		"X-Requested-With",
		"X-XSS-Protection"
	];
	for (let i = 0; i < wellknownHeaderNames$1.length; ++i) {
		const key = wellknownHeaderNames$1[i];
		const lowerCasedKey = key.toLowerCase();
		headerNameLowerCasedRecord$3[key] = headerNameLowerCasedRecord$3[lowerCasedKey] = lowerCasedKey;
	}
	Object.setPrototypeOf(headerNameLowerCasedRecord$3, null);
	module.exports = {
		wellknownHeaderNames: wellknownHeaderNames$1,
		headerNameLowerCasedRecord: headerNameLowerCasedRecord$3
	};
}));
var require_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { wellknownHeaderNames, headerNameLowerCasedRecord: headerNameLowerCasedRecord$2 } = require_constants$4();
	var TstNode = class TstNode {
		value = null;
		left = null;
		middle = null;
		right = null;
		code;
		constructor(key, value, index) {
			if (index === void 0 || index >= key.length) throw new TypeError("Unreachable");
			if ((this.code = key.charCodeAt(index)) > 127) throw new TypeError("key must be ascii string");
			if (key.length !== ++index) this.middle = new TstNode(key, value, index);
			else this.value = value;
		}
		add(key, value) {
			const length = key.length;
			if (length === 0) throw new TypeError("Unreachable");
			let index = 0;
			let node = this;
			while (true) {
				const code = key.charCodeAt(index);
				if (code > 127) throw new TypeError("key must be ascii string");
				if (node.code === code) if (length === ++index) {
					node.value = value;
					break;
				} else if (node.middle !== null) node = node.middle;
				else {
					node.middle = new TstNode(key, value, index);
					break;
				}
				else if (node.code < code) if (node.left !== null) node = node.left;
				else {
					node.left = new TstNode(key, value, index);
					break;
				}
				else if (node.right !== null) node = node.right;
				else {
					node.right = new TstNode(key, value, index);
					break;
				}
			}
		}
		search(key) {
			const keylength = key.length;
			let index = 0;
			let node = this;
			while (node !== null && index < keylength) {
				let code = key[index];
				if (code <= 90 && code >= 65) code |= 32;
				while (node !== null) {
					if (code === node.code) {
						if (keylength === ++index) return node;
						node = node.middle;
						break;
					}
					node = node.code < code ? node.left : node.right;
				}
			}
			return null;
		}
	};
	var TernarySearchTree = class {
		node = null;
		insert(key, value) {
			if (this.node === null) this.node = new TstNode(key, value, 0);
			else this.node.add(key, value);
		}
		lookup(key) {
			return this.node?.search(key)?.value ?? null;
		}
	};
	var tree$1 = new TernarySearchTree();
	for (let i = 0; i < wellknownHeaderNames.length; ++i) {
		const key = headerNameLowerCasedRecord$2[wellknownHeaderNames[i]];
		tree$1.insert(key, key);
	}
	module.exports = {
		TernarySearchTree,
		tree: tree$1
	};
}));
var require_util$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$26 = require("node:assert");
	var { kDestroyed: kDestroyed$2, kBodyUsed: kBodyUsed$1, kListeners, kBody: kBody$2 } = require_symbols$4();
	var { IncomingMessage } = require("node:http");
	var stream$2 = require("node:stream");
	var net$7 = require("node:net");
	var { Blob: Blob$3 } = require("node:buffer");
	var nodeUtil$3 = require("node:util");
	var { stringify: stringify$2 } = require("node:querystring");
	var { EventEmitter: EE$2 } = require("node:events");
	var { InvalidArgumentError: InvalidArgumentError$23 } = require_errors$1();
	var { headerNameLowerCasedRecord: headerNameLowerCasedRecord$1 } = require_constants$4();
	var { tree } = require_tree();
	var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v));
	var BodyAsyncIterable$1 = class {
		constructor(body) {
			this[kBody$2] = body;
			this[kBodyUsed$1] = false;
		}
		async *[Symbol.asyncIterator]() {
			assert$26(!this[kBodyUsed$1], "disturbed");
			this[kBodyUsed$1] = true;
			yield* this[kBody$2];
		}
	};
	function wrapRequestBody$1(body) {
		if (isStream$1(body)) {
			if (bodyLength(body) === 0) body.on("data", function() {
				assert$26(false);
			});
			if (typeof body.readableDidRead !== "boolean") {
				body[kBodyUsed$1] = false;
				EE$2.prototype.on.call(body, "data", function() {
					this[kBodyUsed$1] = true;
				});
			}
			return body;
		} else if (body && typeof body.pipeTo === "function") return new BodyAsyncIterable$1(body);
		else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable$1(body)) return new BodyAsyncIterable$1(body);
		else return body;
	}
	function nop() {}
	function isStream$1(obj) {
		return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function";
	}
	function isBlobLike$7(object) {
		if (object === null) return false;
		else if (object instanceof Blob$3) return true;
		else if (typeof object !== "object") return false;
		else {
			const sTag = object[Symbol.toStringTag];
			return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function");
		}
	}
	function buildURL$3(url$3, queryParams) {
		if (url$3.includes("?") || url$3.includes("#")) throw new Error("Query params cannot be passed when url already contains \"?\" or \"#\".");
		const stringified = stringify$2(queryParams);
		if (stringified) url$3 += "?" + stringified;
		return url$3;
	}
	function isValidPort(port) {
		const value = parseInt(port, 10);
		return value === Number(port) && value >= 0 && value <= 65535;
	}
	function isHttpOrHttpsPrefixed(value) {
		return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":");
	}
	function parseURL(url$3) {
		if (typeof url$3 === "string") {
			url$3 = new URL(url$3);
			if (!isHttpOrHttpsPrefixed(url$3.origin || url$3.protocol)) throw new InvalidArgumentError$23("Invalid URL protocol: the URL must start with `http:` or `https:`.");
			return url$3;
		}
		if (!url$3 || typeof url$3 !== "object") throw new InvalidArgumentError$23("Invalid URL: The URL argument must be a non-null object.");
		if (!(url$3 instanceof URL)) {
			if (url$3.port != null && url$3.port !== "" && isValidPort(url$3.port) === false) throw new InvalidArgumentError$23("Invalid URL: port must be a valid integer or a string representation of an integer.");
			if (url$3.path != null && typeof url$3.path !== "string") throw new InvalidArgumentError$23("Invalid URL path: the path must be a string or null/undefined.");
			if (url$3.pathname != null && typeof url$3.pathname !== "string") throw new InvalidArgumentError$23("Invalid URL pathname: the pathname must be a string or null/undefined.");
			if (url$3.hostname != null && typeof url$3.hostname !== "string") throw new InvalidArgumentError$23("Invalid URL hostname: the hostname must be a string or null/undefined.");
			if (url$3.origin != null && typeof url$3.origin !== "string") throw new InvalidArgumentError$23("Invalid URL origin: the origin must be a string or null/undefined.");
			if (!isHttpOrHttpsPrefixed(url$3.origin || url$3.protocol)) throw new InvalidArgumentError$23("Invalid URL protocol: the URL must start with `http:` or `https:`.");
			const port = url$3.port != null ? url$3.port : url$3.protocol === "https:" ? 443 : 80;
			let origin$1 = url$3.origin != null ? url$3.origin : `${url$3.protocol || ""}//${url$3.hostname || ""}:${port}`;
			let path$1 = url$3.path != null ? url$3.path : `${url$3.pathname || ""}${url$3.search || ""}`;
			if (origin$1[origin$1.length - 1] === "/") origin$1 = origin$1.slice(0, origin$1.length - 1);
			if (path$1 && path$1[0] !== "/") path$1 = `/${path$1}`;
			return new URL(`${origin$1}${path$1}`);
		}
		if (!isHttpOrHttpsPrefixed(url$3.origin || url$3.protocol)) throw new InvalidArgumentError$23("Invalid URL protocol: the URL must start with `http:` or `https:`.");
		return url$3;
	}
	function parseOrigin$1(url$3) {
		url$3 = parseURL(url$3);
		if (url$3.pathname !== "/" || url$3.search || url$3.hash) throw new InvalidArgumentError$23("invalid url");
		return url$3;
	}
	function getHostname(host) {
		if (host[0] === "[") {
			const idx$1 = host.indexOf("]");
			assert$26(idx$1 !== -1);
			return host.substring(1, idx$1);
		}
		const idx = host.indexOf(":");
		if (idx === -1) return host;
		return host.substring(0, idx);
	}
	function getServerName$1(host) {
		if (!host) return null;
		assert$26(typeof host === "string");
		const servername = getHostname(host);
		if (net$7.isIP(servername)) return "";
		return servername;
	}
	function deepClone(obj) {
		return JSON.parse(JSON.stringify(obj));
	}
	function isAsyncIterable(obj) {
		return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function");
	}
	function isIterable$1(obj) {
		return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function"));
	}
	function bodyLength(body) {
		if (body == null) return 0;
		else if (isStream$1(body)) {
			const state$1 = body._readableState;
			return state$1 && state$1.objectMode === false && state$1.ended === true && Number.isFinite(state$1.length) ? state$1.length : null;
		} else if (isBlobLike$7(body)) return body.size != null ? body.size : null;
		else if (isBuffer$1(body)) return body.byteLength;
		return null;
	}
	function isDestroyed(body) {
		return body && !!(body.destroyed || body[kDestroyed$2] || stream$2.isDestroyed?.(body));
	}
	function destroy$1(stream$7, err) {
		if (stream$7 == null || !isStream$1(stream$7) || isDestroyed(stream$7)) return;
		if (typeof stream$7.destroy === "function") {
			if (Object.getPrototypeOf(stream$7).constructor === IncomingMessage) stream$7.socket = null;
			stream$7.destroy(err);
		} else if (err) queueMicrotask(() => {
			stream$7.emit("error", err);
		});
		if (stream$7.destroyed !== true) stream$7[kDestroyed$2] = true;
	}
	var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
	function parseKeepAliveTimeout(val) {
		const m$1 = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);
		return m$1 ? parseInt(m$1[1], 10) * 1e3 : null;
	}
	function headerNameToString(value) {
		return typeof value === "string" ? headerNameLowerCasedRecord$1[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase();
	}
	function bufferToLowerCasedHeaderName$2(value) {
		return tree.lookup(value) ?? value.toString("latin1").toLowerCase();
	}
	function parseHeaders$1(headers, obj) {
		if (obj === void 0) obj = {};
		for (let i = 0; i < headers.length; i += 2) {
			const key = headerNameToString(headers[i]);
			let val = obj[key];
			if (val) {
				if (typeof val === "string") {
					val = [val];
					obj[key] = val;
				}
				val.push(headers[i + 1].toString("utf8"));
			} else {
				const headersValue = headers[i + 1];
				if (typeof headersValue === "string") obj[key] = headersValue;
				else obj[key] = Array.isArray(headersValue) ? headersValue.map((x) => x.toString("utf8")) : headersValue.toString("utf8");
			}
		}
		if ("content-length" in obj && "content-disposition" in obj) obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1");
		return obj;
	}
	function parseRawHeaders(headers) {
		const len = headers.length;
		const ret = new Array(len);
		let hasContentLength = false;
		let contentDispositionIdx = -1;
		let key;
		let val;
		let kLen = 0;
		for (let n$1 = 0; n$1 < headers.length; n$1 += 2) {
			key = headers[n$1];
			val = headers[n$1 + 1];
			typeof key !== "string" && (key = key.toString());
			typeof val !== "string" && (val = val.toString("utf8"));
			kLen = key.length;
			if (kLen === 14 && key[7] === "-" && (key === "content-length" || key.toLowerCase() === "content-length")) hasContentLength = true;
			else if (kLen === 19 && key[7] === "-" && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) contentDispositionIdx = n$1 + 1;
			ret[n$1] = key;
			ret[n$1 + 1] = val;
		}
		if (hasContentLength && contentDispositionIdx !== -1) ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1");
		return ret;
	}
	function isBuffer$1(buffer$1) {
		return buffer$1 instanceof Uint8Array || Buffer.isBuffer(buffer$1);
	}
	function validateHandler$1(handler, method, upgrade$1) {
		if (!handler || typeof handler !== "object") throw new InvalidArgumentError$23("handler must be an object");
		if (typeof handler.onConnect !== "function") throw new InvalidArgumentError$23("invalid onConnect method");
		if (typeof handler.onError !== "function") throw new InvalidArgumentError$23("invalid onError method");
		if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) throw new InvalidArgumentError$23("invalid onBodySent method");
		if (upgrade$1 || method === "CONNECT") {
			if (typeof handler.onUpgrade !== "function") throw new InvalidArgumentError$23("invalid onUpgrade method");
		} else {
			if (typeof handler.onHeaders !== "function") throw new InvalidArgumentError$23("invalid onHeaders method");
			if (typeof handler.onData !== "function") throw new InvalidArgumentError$23("invalid onData method");
			if (typeof handler.onComplete !== "function") throw new InvalidArgumentError$23("invalid onComplete method");
		}
	}
	function isDisturbed$3(body) {
		return !!(body && (stream$2.isDisturbed(body) || body[kBodyUsed$1]));
	}
	function isErrored$2(body) {
		return !!(body && stream$2.isErrored(body));
	}
	function isReadable$1(body) {
		return !!(body && stream$2.isReadable(body));
	}
	function getSocketInfo(socket) {
		return {
			localAddress: socket.localAddress,
			localPort: socket.localPort,
			remoteAddress: socket.remoteAddress,
			remotePort: socket.remotePort,
			remoteFamily: socket.remoteFamily,
			timeout: socket.timeout,
			bytesWritten: socket.bytesWritten,
			bytesRead: socket.bytesRead
		};
	}
	function ReadableStreamFrom$3(iterable) {
		let iterator$1;
		return new ReadableStream({
			async start() {
				iterator$1 = iterable[Symbol.asyncIterator]();
			},
			async pull(controller) {
				const { done, value } = await iterator$1.next();
				if (done) queueMicrotask(() => {
					controller.close();
					controller.byobRequest?.respond(0);
				});
				else {
					const buf = Buffer.isBuffer(value) ? value : Buffer.from(value);
					if (buf.byteLength) controller.enqueue(new Uint8Array(buf));
				}
				return controller.desiredSize > 0;
			},
			async cancel(reason) {
				await iterator$1.return();
			},
			type: "bytes"
		});
	}
	function isFormDataLike$1(object) {
		return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData";
	}
	function addAbortListener$2(signal, listener) {
		if ("addEventListener" in signal) {
			signal.addEventListener("abort", listener, { once: true });
			return () => signal.removeEventListener("abort", listener);
		}
		signal.addListener("abort", listener);
		return () => signal.removeListener("abort", listener);
	}
	var hasToWellFormed = typeof String.prototype.toWellFormed === "function";
	var hasIsWellFormed = typeof String.prototype.isWellFormed === "function";
	function toUSVString$1(val) {
		return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil$3.toUSVString(val);
	}
	function isUSVString$1(val) {
		return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString$1(val) === `${val}`;
	}
	function isTokenCharCode(c) {
		switch (c) {
			case 34:
			case 40:
			case 41:
			case 44:
			case 47:
			case 58:
			case 59:
			case 60:
			case 61:
			case 62:
			case 63:
			case 64:
			case 91:
			case 92:
			case 93:
			case 123:
			case 125: return false;
			default: return c >= 33 && c <= 126;
		}
	}
	function isValidHTTPToken$3(characters) {
		if (characters.length === 0) return false;
		for (let i = 0; i < characters.length; ++i) if (!isTokenCharCode(characters.charCodeAt(i))) return false;
		return true;
	}
	var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
	function isValidHeaderValue$3(characters) {
		return !headerCharRegex.test(characters);
	}
	function parseRangeHeader$1(range) {
		if (range == null || range === "") return {
			start: 0,
			end: null,
			size: null
		};
		const m$1 = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null;
		return m$1 ? {
			start: parseInt(m$1[1]),
			end: m$1[2] ? parseInt(m$1[2]) : null,
			size: m$1[3] ? parseInt(m$1[3]) : null
		} : null;
	}
	function addListener$1(obj, name$1, listener) {
		(obj[kListeners] ??= []).push([name$1, listener]);
		obj.on(name$1, listener);
		return obj;
	}
	function removeAllListeners$1(obj) {
		for (const [name$1, listener] of obj[kListeners] ?? []) obj.removeListener(name$1, listener);
		obj[kListeners] = null;
	}
	function errorRequest(client, request$1, err) {
		try {
			request$1.onError(err);
			assert$26(request$1.aborted);
		} catch (err$1) {
			client.emit("error", err$1);
		}
	}
	var kEnumerableProperty$10 = Object.create(null);
	kEnumerableProperty$10.enumerable = true;
	var normalizedMethodRecordsBase$2 = {
		delete: "DELETE",
		DELETE: "DELETE",
		get: "GET",
		GET: "GET",
		head: "HEAD",
		HEAD: "HEAD",
		options: "OPTIONS",
		OPTIONS: "OPTIONS",
		post: "POST",
		POST: "POST",
		put: "PUT",
		PUT: "PUT"
	};
	var normalizedMethodRecords$2 = {
		...normalizedMethodRecordsBase$2,
		patch: "patch",
		PATCH: "PATCH"
	};
	Object.setPrototypeOf(normalizedMethodRecordsBase$2, null);
	Object.setPrototypeOf(normalizedMethodRecords$2, null);
	module.exports = {
		kEnumerableProperty: kEnumerableProperty$10,
		nop,
		isDisturbed: isDisturbed$3,
		isErrored: isErrored$2,
		isReadable: isReadable$1,
		toUSVString: toUSVString$1,
		isUSVString: isUSVString$1,
		isBlobLike: isBlobLike$7,
		parseOrigin: parseOrigin$1,
		parseURL,
		getServerName: getServerName$1,
		isStream: isStream$1,
		isIterable: isIterable$1,
		isAsyncIterable,
		isDestroyed,
		headerNameToString,
		bufferToLowerCasedHeaderName: bufferToLowerCasedHeaderName$2,
		addListener: addListener$1,
		removeAllListeners: removeAllListeners$1,
		errorRequest,
		parseRawHeaders,
		parseHeaders: parseHeaders$1,
		parseKeepAliveTimeout,
		destroy: destroy$1,
		bodyLength,
		deepClone,
		ReadableStreamFrom: ReadableStreamFrom$3,
		isBuffer: isBuffer$1,
		validateHandler: validateHandler$1,
		getSocketInfo,
		isFormDataLike: isFormDataLike$1,
		buildURL: buildURL$3,
		addAbortListener: addAbortListener$2,
		isValidHTTPToken: isValidHTTPToken$3,
		isValidHeaderValue: isValidHeaderValue$3,
		isTokenCharCode,
		parseRangeHeader: parseRangeHeader$1,
		normalizedMethodRecordsBase: normalizedMethodRecordsBase$2,
		normalizedMethodRecords: normalizedMethodRecords$2,
		isValidPort,
		isHttpOrHttpsPrefixed,
		nodeMajor,
		nodeMinor,
		safeHTTPMethods: [
			"GET",
			"HEAD",
			"OPTIONS",
			"TRACE"
		],
		wrapRequestBody: wrapRequestBody$1
	};
}));
var require_diagnostics = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var diagnosticsChannel = require("node:diagnostics_channel");
	var util$25 = require("node:util");
	var undiciDebugLog = util$25.debuglog("undici");
	var fetchDebuglog = util$25.debuglog("fetch");
	var websocketDebuglog = util$25.debuglog("websocket");
	var isClientSet = false;
	var channels$5 = {
		beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"),
		connected: diagnosticsChannel.channel("undici:client:connected"),
		connectError: diagnosticsChannel.channel("undici:client:connectError"),
		sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"),
		create: diagnosticsChannel.channel("undici:request:create"),
		bodySent: diagnosticsChannel.channel("undici:request:bodySent"),
		headers: diagnosticsChannel.channel("undici:request:headers"),
		trailers: diagnosticsChannel.channel("undici:request:trailers"),
		error: diagnosticsChannel.channel("undici:request:error"),
		open: diagnosticsChannel.channel("undici:websocket:open"),
		close: diagnosticsChannel.channel("undici:websocket:close"),
		socketError: diagnosticsChannel.channel("undici:websocket:socket_error"),
		ping: diagnosticsChannel.channel("undici:websocket:ping"),
		pong: diagnosticsChannel.channel("undici:websocket:pong")
	};
	if (undiciDebugLog.enabled || fetchDebuglog.enabled) {
		const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog;
		diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => {
			const { connectParams: { version: version$1, protocol, port, host } } = evt;
			debuglog("connecting to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, version$1);
		});
		diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => {
			const { connectParams: { version: version$1, protocol, port, host } } = evt;
			debuglog("connected to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, version$1);
		});
		diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => {
			const { connectParams: { version: version$1, protocol, port, host }, error } = evt;
			debuglog("connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, version$1, error.message);
		});
		diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
			const { request: { method, path: path$1, origin: origin$1 } } = evt;
			debuglog("sending request to %s %s/%s", method, origin$1, path$1);
		});
		diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => {
			const { request: { method, path: path$1, origin: origin$1 }, response: { statusCode } } = evt;
			debuglog("received response to %s %s/%s - HTTP %d", method, origin$1, path$1, statusCode);
		});
		diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => {
			const { request: { method, path: path$1, origin: origin$1 } } = evt;
			debuglog("trailers received from %s %s/%s", method, origin$1, path$1);
		});
		diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
			const { request: { method, path: path$1, origin: origin$1 }, error } = evt;
			debuglog("request to %s %s/%s errored - %s", method, origin$1, path$1, error.message);
		});
		isClientSet = true;
	}
	if (websocketDebuglog.enabled) {
		if (!isClientSet) {
			const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog;
			diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => {
				const { connectParams: { version: version$1, protocol, port, host } } = evt;
				debuglog("connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, version$1);
			});
			diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => {
				const { connectParams: { version: version$1, protocol, port, host } } = evt;
				debuglog("connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, version$1);
			});
			diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => {
				const { connectParams: { version: version$1, protocol, port, host }, error } = evt;
				debuglog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$1, error.message);
			});
			diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
				const { request: { method, path: path$1, origin: origin$1 } } = evt;
				debuglog("sending request to %s %s/%s", method, origin$1, path$1);
			});
		}
		diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => {
			const { address: { address, port } } = evt;
			websocketDebuglog("connection opened %s%s", address, port ? `:${port}` : "");
		});
		diagnosticsChannel.channel("undici:websocket:close").subscribe((evt) => {
			const { websocket, code, reason } = evt;
			websocketDebuglog("closed connection to %s - %s %s", websocket.url, code, reason);
		});
		diagnosticsChannel.channel("undici:websocket:socket_error").subscribe((err) => {
			websocketDebuglog("connection errored - %s", err.message);
		});
		diagnosticsChannel.channel("undici:websocket:ping").subscribe((evt) => {
			websocketDebuglog("ping received");
		});
		diagnosticsChannel.channel("undici:websocket:pong").subscribe((evt) => {
			websocketDebuglog("pong received");
		});
	}
	module.exports = { channels: channels$5 };
}));
var require_request$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { InvalidArgumentError: InvalidArgumentError$22, NotSupportedError: NotSupportedError$1 } = require_errors$1();
	var assert$25 = require("node:assert");
	var { isValidHTTPToken: isValidHTTPToken$2, isValidHeaderValue: isValidHeaderValue$2, isStream, destroy, isBuffer, isFormDataLike, isIterable, isBlobLike: isBlobLike$6, buildURL: buildURL$2, validateHandler, getServerName, normalizedMethodRecords: normalizedMethodRecords$1 } = require_util$9();
	var { channels: channels$4 } = require_diagnostics();
	var { headerNameLowerCasedRecord } = require_constants$4();
	var invalidPathRegex = /[^\u0021-\u00ff]/;
	var kHandler = Symbol("handler");
	var Request$4 = class {
		constructor(origin$1, { path: path$1, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, throwOnError, expectContinue, servername }, handler) {
			if (typeof path$1 !== "string") throw new InvalidArgumentError$22("path must be a string");
			else if (path$1[0] !== "/" && !(path$1.startsWith("http://") || path$1.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$22("path must be an absolute URL or start with a slash");
			else if (invalidPathRegex.test(path$1)) throw new InvalidArgumentError$22("invalid request path");
			if (typeof method !== "string") throw new InvalidArgumentError$22("method must be a string");
			else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$2(method)) throw new InvalidArgumentError$22("invalid request method");
			if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$22("upgrade must be a string");
			if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) throw new InvalidArgumentError$22("invalid headersTimeout");
			if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) throw new InvalidArgumentError$22("invalid bodyTimeout");
			if (reset != null && typeof reset !== "boolean") throw new InvalidArgumentError$22("invalid reset");
			if (expectContinue != null && typeof expectContinue !== "boolean") throw new InvalidArgumentError$22("invalid expectContinue");
			this.headersTimeout = headersTimeout;
			this.bodyTimeout = bodyTimeout;
			this.throwOnError = throwOnError === true;
			this.method = method;
			this.abort = null;
			if (body == null) this.body = null;
			else if (isStream(body)) {
				this.body = body;
				const rState = this.body._readableState;
				if (!rState || !rState.autoDestroy) {
					this.endHandler = function autoDestroy() {
						destroy(this);
					};
					this.body.on("end", this.endHandler);
				}
				this.errorHandler = (err) => {
					if (this.abort) this.abort(err);
					else this.error = err;
				};
				this.body.on("error", this.errorHandler);
			} else if (isBuffer(body)) this.body = body.byteLength ? body : null;
			else if (ArrayBuffer.isView(body)) this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null;
			else if (body instanceof ArrayBuffer) this.body = body.byteLength ? Buffer.from(body) : null;
			else if (typeof body === "string") this.body = body.length ? Buffer.from(body) : null;
			else if (isFormDataLike(body) || isIterable(body) || isBlobLike$6(body)) this.body = body;
			else throw new InvalidArgumentError$22("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");
			this.completed = false;
			this.aborted = false;
			this.upgrade = upgrade$1 || null;
			this.path = query ? buildURL$2(path$1, query) : path$1;
			this.origin = origin$1;
			this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
			this.blocking = blocking == null ? false : blocking;
			this.reset = reset == null ? null : reset;
			this.host = null;
			this.contentLength = null;
			this.contentType = null;
			this.headers = [];
			this.expectContinue = expectContinue != null ? expectContinue : false;
			if (Array.isArray(headers)) {
				if (headers.length % 2 !== 0) throw new InvalidArgumentError$22("headers array must be even");
				for (let i = 0; i < headers.length; i += 2) processHeader(this, headers[i], headers[i + 1]);
			} else if (headers && typeof headers === "object") if (headers[Symbol.iterator]) for (const header of headers) {
				if (!Array.isArray(header) || header.length !== 2) throw new InvalidArgumentError$22("headers must be in key-value pair format");
				processHeader(this, header[0], header[1]);
			}
			else {
				const keys = Object.keys(headers);
				for (let i = 0; i < keys.length; ++i) processHeader(this, keys[i], headers[keys[i]]);
			}
			else if (headers != null) throw new InvalidArgumentError$22("headers must be an object or an array");
			validateHandler(handler, method, upgrade$1);
			this.servername = servername || getServerName(this.host);
			this[kHandler] = handler;
			if (channels$4.create.hasSubscribers) channels$4.create.publish({ request: this });
		}
		onBodySent(chunk) {
			if (this[kHandler].onBodySent) try {
				return this[kHandler].onBodySent(chunk);
			} catch (err) {
				this.abort(err);
			}
		}
		onRequestSent() {
			if (channels$4.bodySent.hasSubscribers) channels$4.bodySent.publish({ request: this });
			if (this[kHandler].onRequestSent) try {
				return this[kHandler].onRequestSent();
			} catch (err) {
				this.abort(err);
			}
		}
		onConnect(abort$4) {
			assert$25(!this.aborted);
			assert$25(!this.completed);
			if (this.error) abort$4(this.error);
			else {
				this.abort = abort$4;
				return this[kHandler].onConnect(abort$4);
			}
		}
		onResponseStarted() {
			return this[kHandler].onResponseStarted?.();
		}
		onHeaders(statusCode, headers, resume$2, statusText) {
			assert$25(!this.aborted);
			assert$25(!this.completed);
			if (channels$4.headers.hasSubscribers) channels$4.headers.publish({
				request: this,
				response: {
					statusCode,
					headers,
					statusText
				}
			});
			try {
				return this[kHandler].onHeaders(statusCode, headers, resume$2, statusText);
			} catch (err) {
				this.abort(err);
			}
		}
		onData(chunk) {
			assert$25(!this.aborted);
			assert$25(!this.completed);
			try {
				return this[kHandler].onData(chunk);
			} catch (err) {
				this.abort(err);
				return false;
			}
		}
		onUpgrade(statusCode, headers, socket) {
			assert$25(!this.aborted);
			assert$25(!this.completed);
			return this[kHandler].onUpgrade(statusCode, headers, socket);
		}
		onComplete(trailers) {
			this.onFinally();
			assert$25(!this.aborted);
			this.completed = true;
			if (channels$4.trailers.hasSubscribers) channels$4.trailers.publish({
				request: this,
				trailers
			});
			try {
				return this[kHandler].onComplete(trailers);
			} catch (err) {
				this.onError(err);
			}
		}
		onError(error) {
			this.onFinally();
			if (channels$4.error.hasSubscribers) channels$4.error.publish({
				request: this,
				error
			});
			if (this.aborted) return;
			this.aborted = true;
			return this[kHandler].onError(error);
		}
		onFinally() {
			if (this.errorHandler) {
				this.body.off("error", this.errorHandler);
				this.errorHandler = null;
			}
			if (this.endHandler) {
				this.body.off("end", this.endHandler);
				this.endHandler = null;
			}
		}
		addHeader(key, value) {
			processHeader(this, key, value);
			return this;
		}
	};
	function processHeader(request$1, key, val) {
		if (val && typeof val === "object" && !Array.isArray(val)) throw new InvalidArgumentError$22(`invalid ${key} header`);
		else if (val === void 0) return;
		let headerName = headerNameLowerCasedRecord[key];
		if (headerName === void 0) {
			headerName = key.toLowerCase();
			if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken$2(headerName)) throw new InvalidArgumentError$22("invalid header key");
		}
		if (Array.isArray(val)) {
			const arr = [];
			for (let i = 0; i < val.length; i++) if (typeof val[i] === "string") {
				if (!isValidHeaderValue$2(val[i])) throw new InvalidArgumentError$22(`invalid ${key} header`);
				arr.push(val[i]);
			} else if (val[i] === null) arr.push("");
			else if (typeof val[i] === "object") throw new InvalidArgumentError$22(`invalid ${key} header`);
			else arr.push(`${val[i]}`);
			val = arr;
		} else if (typeof val === "string") {
			if (!isValidHeaderValue$2(val)) throw new InvalidArgumentError$22(`invalid ${key} header`);
		} else if (val === null) val = "";
		else val = `${val}`;
		if (request$1.host === null && headerName === "host") {
			if (typeof val !== "string") throw new InvalidArgumentError$22("invalid host header");
			request$1.host = val;
		} else if (request$1.contentLength === null && headerName === "content-length") {
			request$1.contentLength = parseInt(val, 10);
			if (!Number.isFinite(request$1.contentLength)) throw new InvalidArgumentError$22("invalid content-length header");
		} else if (request$1.contentType === null && headerName === "content-type") {
			request$1.contentType = val;
			request$1.headers.push(key, val);
		} else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") throw new InvalidArgumentError$22(`invalid ${headerName} header`);
		else if (headerName === "connection") {
			const value = typeof val === "string" ? val.toLowerCase() : null;
			if (value !== "close" && value !== "keep-alive") throw new InvalidArgumentError$22("invalid connection header");
			if (value === "close") request$1.reset = true;
		} else if (headerName === "expect") throw new NotSupportedError$1("expect header not supported");
		else request$1.headers.push(key, val);
	}
	module.exports = Request$4;
}));
var require_dispatcher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var EventEmitter = require("node:events");
	var Dispatcher$5 = class extends EventEmitter {
		dispatch() {
			throw new Error("not implemented");
		}
		close() {
			throw new Error("not implemented");
		}
		destroy() {
			throw new Error("not implemented");
		}
		compose(...args) {
			const interceptors = Array.isArray(args[0]) ? args[0] : args;
			let dispatch = this.dispatch.bind(this);
			for (const interceptor of interceptors) {
				if (interceptor == null) continue;
				if (typeof interceptor !== "function") throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`);
				dispatch = interceptor(dispatch);
				if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) throw new TypeError("invalid interceptor");
			}
			return new ComposedDispatcher(this, dispatch);
		}
	};
	var ComposedDispatcher = class extends Dispatcher$5 {
		#dispatcher = null;
		#dispatch = null;
		constructor(dispatcher, dispatch) {
			super();
			this.#dispatcher = dispatcher;
			this.#dispatch = dispatch;
		}
		dispatch(...args) {
			this.#dispatch(...args);
		}
		close(...args) {
			return this.#dispatcher.close(...args);
		}
		destroy(...args) {
			return this.#dispatcher.destroy(...args);
		}
	};
	module.exports = Dispatcher$5;
}));
var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var Dispatcher$4 = require_dispatcher();
	var { ClientDestroyedError: ClientDestroyedError$1, ClientClosedError, InvalidArgumentError: InvalidArgumentError$21 } = require_errors$1();
	var { kDestroy: kDestroy$5, kClose: kClose$7, kClosed: kClosed$1, kDestroyed: kDestroyed$1, kDispatch: kDispatch$5, kInterceptors: kInterceptors$5 } = require_symbols$4();
	var kOnDestroyed = Symbol("onDestroyed");
	var kOnClosed = Symbol("onClosed");
	var kInterceptedDispatch = Symbol("Intercepted Dispatch");
	var DispatcherBase$5 = class extends Dispatcher$4 {
		constructor() {
			super();
			this[kDestroyed$1] = false;
			this[kOnDestroyed] = null;
			this[kClosed$1] = false;
			this[kOnClosed] = [];
		}
		get destroyed() {
			return this[kDestroyed$1];
		}
		get closed() {
			return this[kClosed$1];
		}
		get interceptors() {
			return this[kInterceptors$5];
		}
		set interceptors(newInterceptors) {
			if (newInterceptors) {
				for (let i = newInterceptors.length - 1; i >= 0; i--) if (typeof this[kInterceptors$5][i] !== "function") throw new InvalidArgumentError$21("interceptor must be an function");
			}
			this[kInterceptors$5] = newInterceptors;
		}
		close(callback) {
			if (callback === void 0) return new Promise((resolve, reject) => {
				this.close((err, data$1) => {
					return err ? reject(err) : resolve(data$1);
				});
			});
			if (typeof callback !== "function") throw new InvalidArgumentError$21("invalid callback");
			if (this[kDestroyed$1]) {
				queueMicrotask(() => callback(new ClientDestroyedError$1(), null));
				return;
			}
			if (this[kClosed$1]) {
				if (this[kOnClosed]) this[kOnClosed].push(callback);
				else queueMicrotask(() => callback(null, null));
				return;
			}
			this[kClosed$1] = true;
			this[kOnClosed].push(callback);
			const onClosed = () => {
				const callbacks = this[kOnClosed];
				this[kOnClosed] = null;
				for (let i = 0; i < callbacks.length; i++) callbacks[i](null, null);
			};
			this[kClose$7]().then(() => this.destroy()).then(() => {
				queueMicrotask(onClosed);
			});
		}
		destroy(err, callback) {
			if (typeof err === "function") {
				callback = err;
				err = null;
			}
			if (callback === void 0) return new Promise((resolve, reject) => {
				this.destroy(err, (err$1, data$1) => {
					return err$1 ? reject(err$1) : resolve(data$1);
				});
			});
			if (typeof callback !== "function") throw new InvalidArgumentError$21("invalid callback");
			if (this[kDestroyed$1]) {
				if (this[kOnDestroyed]) this[kOnDestroyed].push(callback);
				else queueMicrotask(() => callback(null, null));
				return;
			}
			if (!err) err = new ClientDestroyedError$1();
			this[kDestroyed$1] = true;
			this[kOnDestroyed] = this[kOnDestroyed] || [];
			this[kOnDestroyed].push(callback);
			const onDestroyed = () => {
				const callbacks = this[kOnDestroyed];
				this[kOnDestroyed] = null;
				for (let i = 0; i < callbacks.length; i++) callbacks[i](null, null);
			};
			this[kDestroy$5](err).then(() => {
				queueMicrotask(onDestroyed);
			});
		}
		[kInterceptedDispatch](opts, handler) {
			if (!this[kInterceptors$5] || this[kInterceptors$5].length === 0) {
				this[kInterceptedDispatch] = this[kDispatch$5];
				return this[kDispatch$5](opts, handler);
			}
			let dispatch = this[kDispatch$5].bind(this);
			for (let i = this[kInterceptors$5].length - 1; i >= 0; i--) dispatch = this[kInterceptors$5][i](dispatch);
			this[kInterceptedDispatch] = dispatch;
			return dispatch(opts, handler);
		}
		dispatch(opts, handler) {
			if (!handler || typeof handler !== "object") throw new InvalidArgumentError$21("handler must be an object");
			try {
				if (!opts || typeof opts !== "object") throw new InvalidArgumentError$21("opts must be an object.");
				if (this[kDestroyed$1] || this[kOnDestroyed]) throw new ClientDestroyedError$1();
				if (this[kClosed$1]) throw new ClientClosedError();
				return this[kInterceptedDispatch](opts, handler);
			} catch (err) {
				if (typeof handler.onError !== "function") throw new InvalidArgumentError$21("invalid onError method");
				handler.onError(err);
				return false;
			}
		}
	};
	module.exports = DispatcherBase$5;
}));
var require_timers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var fastNow = 0;
	var RESOLUTION_MS = 1e3;
	var TICK_MS = (RESOLUTION_MS >> 1) - 1;
	var fastNowTimeout;
	var kFastTimer = Symbol("kFastTimer");
	var fastTimers = [];
	var NOT_IN_LIST = -2;
	var TO_BE_CLEARED = -1;
	var PENDING = 0;
	var ACTIVE = 1;
	function onTick() {
		fastNow += TICK_MS;
		let idx = 0;
		let len = fastTimers.length;
		while (idx < len) {
			const timer = fastTimers[idx];
			if (timer._state === PENDING) {
				timer._idleStart = fastNow - TICK_MS;
				timer._state = ACTIVE;
			} else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) {
				timer._state = TO_BE_CLEARED;
				timer._idleStart = -1;
				timer._onTimeout(timer._timerArg);
			}
			if (timer._state === TO_BE_CLEARED) {
				timer._state = NOT_IN_LIST;
				if (--len !== 0) fastTimers[idx] = fastTimers[len];
			} else ++idx;
		}
		fastTimers.length = len;
		if (fastTimers.length !== 0) refreshTimeout();
	}
	function refreshTimeout() {
		if (fastNowTimeout) fastNowTimeout.refresh();
		else {
			clearTimeout(fastNowTimeout);
			fastNowTimeout = setTimeout(onTick, TICK_MS);
			if (fastNowTimeout.unref) fastNowTimeout.unref();
		}
	}
	var FastTimer = class {
		[kFastTimer] = true;
		_state = NOT_IN_LIST;
		_idleTimeout = -1;
		_idleStart = -1;
		_onTimeout;
		_timerArg;
		constructor(callback, delay$2, arg) {
			this._onTimeout = callback;
			this._idleTimeout = delay$2;
			this._timerArg = arg;
			this.refresh();
		}
		refresh() {
			if (this._state === NOT_IN_LIST) fastTimers.push(this);
			if (!fastNowTimeout || fastTimers.length === 1) refreshTimeout();
			this._state = PENDING;
		}
		clear() {
			this._state = TO_BE_CLEARED;
			this._idleStart = -1;
		}
	};
	module.exports = {
		setTimeout(callback, delay$2, arg) {
			return delay$2 <= RESOLUTION_MS ? setTimeout(callback, delay$2, arg) : new FastTimer(callback, delay$2, arg);
		},
		clearTimeout(timeout) {
			if (timeout[kFastTimer]) timeout.clear();
			else clearTimeout(timeout);
		},
		setFastTimeout(callback, delay$2, arg) {
			return new FastTimer(callback, delay$2, arg);
		},
		clearFastTimeout(timeout) {
			timeout.clear();
		},
		now() {
			return fastNow;
		},
		tick(delay$2 = 0) {
			fastNow += delay$2 - RESOLUTION_MS + 1;
			onTick();
			onTick();
		},
		reset() {
			fastNow = 0;
			fastTimers.length = 0;
			clearTimeout(fastNowTimeout);
			fastNowTimeout = null;
		},
		kFastTimer
	};
}));
var require_connect = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var net$6 = require("node:net");
	var assert$24 = require("node:assert");
	var util$24 = require_util$9();
	var { InvalidArgumentError: InvalidArgumentError$20, ConnectTimeoutError } = require_errors$1();
	var timers$1 = require_timers();
	function noop$5() {}
	var tls$4;
	var SessionCache;
	if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) SessionCache = class WeakSessionCache {
		constructor(maxCachedSessions) {
			this._maxCachedSessions = maxCachedSessions;
			this._sessionCache = /* @__PURE__ */ new Map();
			this._sessionRegistry = new global.FinalizationRegistry((key) => {
				if (this._sessionCache.size < this._maxCachedSessions) return;
				const ref = this._sessionCache.get(key);
				if (ref !== void 0 && ref.deref() === void 0) this._sessionCache.delete(key);
			});
		}
		get(sessionKey) {
			const ref = this._sessionCache.get(sessionKey);
			return ref ? ref.deref() : null;
		}
		set(sessionKey, session) {
			if (this._maxCachedSessions === 0) return;
			this._sessionCache.set(sessionKey, new WeakRef(session));
			this._sessionRegistry.register(session, sessionKey);
		}
	};
	else SessionCache = class SimpleSessionCache {
		constructor(maxCachedSessions) {
			this._maxCachedSessions = maxCachedSessions;
			this._sessionCache = /* @__PURE__ */ new Map();
		}
		get(sessionKey) {
			return this._sessionCache.get(sessionKey);
		}
		set(sessionKey, session) {
			if (this._maxCachedSessions === 0) return;
			if (this._sessionCache.size >= this._maxCachedSessions) {
				const { value: oldestKey } = this._sessionCache.keys().next();
				this._sessionCache.delete(oldestKey);
			}
			this._sessionCache.set(sessionKey, session);
		}
	};
	function buildConnector$4({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
		if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) throw new InvalidArgumentError$20("maxCachedSessions must be a positive integer or zero");
		const options = {
			path: socketPath,
			...opts
		};
		const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
		timeout = timeout == null ? 1e4 : timeout;
		allowH2 = allowH2 != null ? allowH2 : false;
		return function connect$2({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
			let socket;
			if (protocol === "https:") {
				if (!tls$4) tls$4 = require("node:tls");
				servername = servername || options.servername || util$24.getServerName(host) || null;
				const sessionKey = servername || hostname;
				assert$24(sessionKey);
				const session = customSession || sessionCache.get(sessionKey) || null;
				port = port || 443;
				socket = tls$4.connect({
					highWaterMark: 16384,
					...options,
					servername,
					session,
					localAddress,
					ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"],
					socket: httpSocket,
					port,
					host: hostname
				});
				socket.on("session", function(session$1) {
					sessionCache.set(sessionKey, session$1);
				});
			} else {
				assert$24(!httpSocket, "httpSocket can only be sent on TLS update");
				port = port || 80;
				socket = net$6.connect({
					highWaterMark: 64 * 1024,
					...options,
					localAddress,
					port,
					host: hostname
				});
			}
			if (options.keepAlive == null || options.keepAlive) {
				const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay;
				socket.setKeepAlive(true, keepAliveInitialDelay);
			}
			const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), {
				timeout,
				hostname,
				port
			});
			socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
				queueMicrotask(clearConnectTimeout);
				if (callback) {
					const cb = callback;
					callback = null;
					cb(null, this);
				}
			}).on("error", function(err) {
				queueMicrotask(clearConnectTimeout);
				if (callback) {
					const cb = callback;
					callback = null;
					cb(err);
				}
			});
			return socket;
		};
	}
	var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => {
		if (!opts.timeout) return noop$5;
		let s1 = null;
		let s2 = null;
		const fastTimer = timers$1.setFastTimeout(() => {
			s1 = setImmediate(() => {
				s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts));
			});
		}, opts.timeout);
		return () => {
			timers$1.clearFastTimeout(fastTimer);
			clearImmediate(s1);
			clearImmediate(s2);
		};
	} : (socketWeakRef, opts) => {
		if (!opts.timeout) return noop$5;
		let s1 = null;
		const fastTimer = timers$1.setFastTimeout(() => {
			s1 = setImmediate(() => {
				onConnectTimeout(socketWeakRef.deref(), opts);
			});
		}, opts.timeout);
		return () => {
			timers$1.clearFastTimeout(fastTimer);
			clearImmediate(s1);
		};
	};
	function onConnectTimeout(socket, opts) {
		if (socket == null) return;
		let message = "Connect Timeout Error";
		if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`;
		else message += ` (attempted address: ${opts.hostname}:${opts.port},`;
		message += ` timeout: ${opts.timeout}ms)`;
		util$24.destroy(socket, new ConnectTimeoutError(message));
	}
	module.exports = buildConnector$4;
}));
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.enumToMap = void 0;
	function enumToMap(obj) {
		const res = {};
		Object.keys(obj).forEach((key) => {
			const value = obj[key];
			if (typeof value === "number") res[key] = value;
		});
		return res;
	}
	exports.enumToMap = enumToMap;
}));
var require_constants$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
	var utils_1 = require_utils$1();
	(function(ERROR) {
		ERROR[ERROR["OK"] = 0] = "OK";
		ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
		ERROR[ERROR["STRICT"] = 2] = "STRICT";
		ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
		ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
		ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
		ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
		ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
		ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
		ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
		ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
		ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
		ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
		ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
		ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
		ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
		ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
		ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
		ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
		ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
		ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
		ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
		ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
		ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
		ERROR[ERROR["USER"] = 24] = "USER";
	})(exports.ERROR || (exports.ERROR = {}));
	(function(TYPE) {
		TYPE[TYPE["BOTH"] = 0] = "BOTH";
		TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
		TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
	})(exports.TYPE || (exports.TYPE = {}));
	(function(FLAGS) {
		FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
		FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
		FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
		FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
		FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
		FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
		FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
		FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
		FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
	})(exports.FLAGS || (exports.FLAGS = {}));
	(function(LENIENT_FLAGS) {
		LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
		LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
		LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
	})(exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
	var METHODS;
	(function(METHODS$1) {
		METHODS$1[METHODS$1["DELETE"] = 0] = "DELETE";
		METHODS$1[METHODS$1["GET"] = 1] = "GET";
		METHODS$1[METHODS$1["HEAD"] = 2] = "HEAD";
		METHODS$1[METHODS$1["POST"] = 3] = "POST";
		METHODS$1[METHODS$1["PUT"] = 4] = "PUT";
		METHODS$1[METHODS$1["CONNECT"] = 5] = "CONNECT";
		METHODS$1[METHODS$1["OPTIONS"] = 6] = "OPTIONS";
		METHODS$1[METHODS$1["TRACE"] = 7] = "TRACE";
		METHODS$1[METHODS$1["COPY"] = 8] = "COPY";
		METHODS$1[METHODS$1["LOCK"] = 9] = "LOCK";
		METHODS$1[METHODS$1["MKCOL"] = 10] = "MKCOL";
		METHODS$1[METHODS$1["MOVE"] = 11] = "MOVE";
		METHODS$1[METHODS$1["PROPFIND"] = 12] = "PROPFIND";
		METHODS$1[METHODS$1["PROPPATCH"] = 13] = "PROPPATCH";
		METHODS$1[METHODS$1["SEARCH"] = 14] = "SEARCH";
		METHODS$1[METHODS$1["UNLOCK"] = 15] = "UNLOCK";
		METHODS$1[METHODS$1["BIND"] = 16] = "BIND";
		METHODS$1[METHODS$1["REBIND"] = 17] = "REBIND";
		METHODS$1[METHODS$1["UNBIND"] = 18] = "UNBIND";
		METHODS$1[METHODS$1["ACL"] = 19] = "ACL";
		METHODS$1[METHODS$1["REPORT"] = 20] = "REPORT";
		METHODS$1[METHODS$1["MKACTIVITY"] = 21] = "MKACTIVITY";
		METHODS$1[METHODS$1["CHECKOUT"] = 22] = "CHECKOUT";
		METHODS$1[METHODS$1["MERGE"] = 23] = "MERGE";
		METHODS$1[METHODS$1["M-SEARCH"] = 24] = "M-SEARCH";
		METHODS$1[METHODS$1["NOTIFY"] = 25] = "NOTIFY";
		METHODS$1[METHODS$1["SUBSCRIBE"] = 26] = "SUBSCRIBE";
		METHODS$1[METHODS$1["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
		METHODS$1[METHODS$1["PATCH"] = 28] = "PATCH";
		METHODS$1[METHODS$1["PURGE"] = 29] = "PURGE";
		METHODS$1[METHODS$1["MKCALENDAR"] = 30] = "MKCALENDAR";
		METHODS$1[METHODS$1["LINK"] = 31] = "LINK";
		METHODS$1[METHODS$1["UNLINK"] = 32] = "UNLINK";
		METHODS$1[METHODS$1["SOURCE"] = 33] = "SOURCE";
		METHODS$1[METHODS$1["PRI"] = 34] = "PRI";
		METHODS$1[METHODS$1["DESCRIBE"] = 35] = "DESCRIBE";
		METHODS$1[METHODS$1["ANNOUNCE"] = 36] = "ANNOUNCE";
		METHODS$1[METHODS$1["SETUP"] = 37] = "SETUP";
		METHODS$1[METHODS$1["PLAY"] = 38] = "PLAY";
		METHODS$1[METHODS$1["PAUSE"] = 39] = "PAUSE";
		METHODS$1[METHODS$1["TEARDOWN"] = 40] = "TEARDOWN";
		METHODS$1[METHODS$1["GET_PARAMETER"] = 41] = "GET_PARAMETER";
		METHODS$1[METHODS$1["SET_PARAMETER"] = 42] = "SET_PARAMETER";
		METHODS$1[METHODS$1["REDIRECT"] = 43] = "REDIRECT";
		METHODS$1[METHODS$1["RECORD"] = 44] = "RECORD";
		METHODS$1[METHODS$1["FLUSH"] = 45] = "FLUSH";
	})(METHODS = exports.METHODS || (exports.METHODS = {}));
	exports.METHODS_HTTP = [
		METHODS.DELETE,
		METHODS.GET,
		METHODS.HEAD,
		METHODS.POST,
		METHODS.PUT,
		METHODS.CONNECT,
		METHODS.OPTIONS,
		METHODS.TRACE,
		METHODS.COPY,
		METHODS.LOCK,
		METHODS.MKCOL,
		METHODS.MOVE,
		METHODS.PROPFIND,
		METHODS.PROPPATCH,
		METHODS.SEARCH,
		METHODS.UNLOCK,
		METHODS.BIND,
		METHODS.REBIND,
		METHODS.UNBIND,
		METHODS.ACL,
		METHODS.REPORT,
		METHODS.MKACTIVITY,
		METHODS.CHECKOUT,
		METHODS.MERGE,
		METHODS["M-SEARCH"],
		METHODS.NOTIFY,
		METHODS.SUBSCRIBE,
		METHODS.UNSUBSCRIBE,
		METHODS.PATCH,
		METHODS.PURGE,
		METHODS.MKCALENDAR,
		METHODS.LINK,
		METHODS.UNLINK,
		METHODS.PRI,
		METHODS.SOURCE
	];
	exports.METHODS_ICE = [METHODS.SOURCE];
	exports.METHODS_RTSP = [
		METHODS.OPTIONS,
		METHODS.DESCRIBE,
		METHODS.ANNOUNCE,
		METHODS.SETUP,
		METHODS.PLAY,
		METHODS.PAUSE,
		METHODS.TEARDOWN,
		METHODS.GET_PARAMETER,
		METHODS.SET_PARAMETER,
		METHODS.REDIRECT,
		METHODS.RECORD,
		METHODS.FLUSH,
		METHODS.GET,
		METHODS.POST
	];
	exports.METHOD_MAP = utils_1.enumToMap(METHODS);
	exports.H_METHOD_MAP = {};
	Object.keys(exports.METHOD_MAP).forEach((key) => {
		if (/^H/.test(key)) exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
	});
	(function(FINISH) {
		FINISH[FINISH["SAFE"] = 0] = "SAFE";
		FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
		FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
	})(exports.FINISH || (exports.FINISH = {}));
	exports.ALPHA = [];
	for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) {
		exports.ALPHA.push(String.fromCharCode(i));
		exports.ALPHA.push(String.fromCharCode(i + 32));
	}
	exports.NUM_MAP = {
		0: 0,
		1: 1,
		2: 2,
		3: 3,
		4: 4,
		5: 5,
		6: 6,
		7: 7,
		8: 8,
		9: 9
	};
	exports.HEX_MAP = {
		0: 0,
		1: 1,
		2: 2,
		3: 3,
		4: 4,
		5: 5,
		6: 6,
		7: 7,
		8: 8,
		9: 9,
		A: 10,
		B: 11,
		C: 12,
		D: 13,
		E: 14,
		F: 15,
		a: 10,
		b: 11,
		c: 12,
		d: 13,
		e: 14,
		f: 15
	};
	exports.NUM = [
		"0",
		"1",
		"2",
		"3",
		"4",
		"5",
		"6",
		"7",
		"8",
		"9"
	];
	exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
	exports.MARK = [
		"-",
		"_",
		".",
		"!",
		"~",
		"*",
		"'",
		"(",
		")"
	];
	exports.USERINFO_CHARS = exports.ALPHANUM.concat(exports.MARK).concat([
		"%",
		";",
		":",
		"&",
		"=",
		"+",
		"$",
		","
	]);
	exports.STRICT_URL_CHAR = [
		"!",
		"\"",
		"$",
		"%",
		"&",
		"'",
		"(",
		")",
		"*",
		"+",
		",",
		"-",
		".",
		"/",
		":",
		";",
		"<",
		"=",
		">",
		"@",
		"[",
		"\\",
		"]",
		"^",
		"_",
		"`",
		"{",
		"|",
		"}",
		"~"
	].concat(exports.ALPHANUM);
	exports.URL_CHAR = exports.STRICT_URL_CHAR.concat(["	", "\f"]);
	for (let i = 128; i <= 255; i++) exports.URL_CHAR.push(i);
	exports.HEX = exports.NUM.concat([
		"a",
		"b",
		"c",
		"d",
		"e",
		"f",
		"A",
		"B",
		"C",
		"D",
		"E",
		"F"
	]);
	exports.STRICT_TOKEN = [
		"!",
		"#",
		"$",
		"%",
		"&",
		"'",
		"*",
		"+",
		"-",
		".",
		"^",
		"_",
		"`",
		"|",
		"~"
	].concat(exports.ALPHANUM);
	exports.TOKEN = exports.STRICT_TOKEN.concat([" "]);
	exports.HEADER_CHARS = ["	"];
	for (let i = 32; i <= 255; i++) if (i !== 127) exports.HEADER_CHARS.push(i);
	exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
	exports.MAJOR = exports.NUM_MAP;
	exports.MINOR = exports.MAJOR;
	var HEADER_STATE;
	(function(HEADER_STATE$1) {
		HEADER_STATE$1[HEADER_STATE$1["GENERAL"] = 0] = "GENERAL";
		HEADER_STATE$1[HEADER_STATE$1["CONNECTION"] = 1] = "CONNECTION";
		HEADER_STATE$1[HEADER_STATE$1["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
		HEADER_STATE$1[HEADER_STATE$1["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
		HEADER_STATE$1[HEADER_STATE$1["UPGRADE"] = 4] = "UPGRADE";
		HEADER_STATE$1[HEADER_STATE$1["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
		HEADER_STATE$1[HEADER_STATE$1["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
		HEADER_STATE$1[HEADER_STATE$1["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
		HEADER_STATE$1[HEADER_STATE$1["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
	})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
	exports.SPECIAL_HEADERS = {
		"connection": HEADER_STATE.CONNECTION,
		"content-length": HEADER_STATE.CONTENT_LENGTH,
		"proxy-connection": HEADER_STATE.CONNECTION,
		"transfer-encoding": HEADER_STATE.TRANSFER_ENCODING,
		"upgrade": HEADER_STATE.UPGRADE
	};
}));
var require_llhttp_wasm = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Buffer: Buffer$2 } = require("node:buffer");
	module.exports = Buffer$2.from("[encoded data, 64820 characters]", "base64");
}));
var require_llhttp_simd_wasm = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Buffer: Buffer$1 } = require("node:buffer");
	module.exports = Buffer$1.from("[encoded data, 64860 characters]", "base64");
}));
var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var corsSafeListedMethods = [
		"GET",
		"HEAD",
		"POST"
	];
	var corsSafeListedMethodsSet$1 = new Set(corsSafeListedMethods);
	var nullBodyStatus$2 = [
		101,
		204,
		205,
		304
	];
	var redirectStatus = [
		301,
		302,
		303,
		307,
		308
	];
	var redirectStatusSet$3 = new Set(redirectStatus);
	var badPorts = [
		"1",
		"7",
		"9",
		"11",
		"13",
		"15",
		"17",
		"19",
		"20",
		"21",
		"22",
		"23",
		"25",
		"37",
		"42",
		"43",
		"53",
		"69",
		"77",
		"79",
		"87",
		"95",
		"101",
		"102",
		"103",
		"104",
		"109",
		"110",
		"111",
		"113",
		"115",
		"117",
		"119",
		"123",
		"135",
		"137",
		"139",
		"143",
		"161",
		"179",
		"389",
		"427",
		"465",
		"512",
		"513",
		"514",
		"515",
		"526",
		"530",
		"531",
		"532",
		"540",
		"548",
		"554",
		"556",
		"563",
		"587",
		"601",
		"636",
		"989",
		"990",
		"993",
		"995",
		"1719",
		"1720",
		"1723",
		"2049",
		"3659",
		"4045",
		"4190",
		"5060",
		"5061",
		"6000",
		"6566",
		"6665",
		"6666",
		"6667",
		"6668",
		"6669",
		"6679",
		"6697",
		"10080"
	];
	var badPortsSet$1 = new Set(badPorts);
	var referrerPolicy$1 = [
		"",
		"no-referrer",
		"no-referrer-when-downgrade",
		"same-origin",
		"origin",
		"strict-origin",
		"origin-when-cross-origin",
		"strict-origin-when-cross-origin",
		"unsafe-url"
	];
	var referrerPolicySet = new Set(referrerPolicy$1);
	var requestRedirect$1 = [
		"follow",
		"manual",
		"error"
	];
	var safeMethods = [
		"GET",
		"HEAD",
		"OPTIONS",
		"TRACE"
	];
	var safeMethodsSet$1 = new Set(safeMethods);
	var requestMode$1 = [
		"navigate",
		"same-origin",
		"no-cors",
		"cors"
	];
	var requestCredentials$1 = [
		"omit",
		"same-origin",
		"include"
	];
	var requestCache$1 = [
		"default",
		"no-store",
		"reload",
		"no-cache",
		"force-cache",
		"only-if-cached"
	];
	var requestBodyHeader$1 = [
		"content-encoding",
		"content-language",
		"content-location",
		"content-type",
		"content-length"
	];
	var requestDuplex$1 = ["half"];
	var forbiddenMethods = [
		"CONNECT",
		"TRACE",
		"TRACK"
	];
	var forbiddenMethodsSet$1 = new Set(forbiddenMethods);
	var subresource = [
		"audio",
		"audioworklet",
		"font",
		"image",
		"manifest",
		"paintworklet",
		"script",
		"style",
		"track",
		"video",
		"xslt",
		""
	];
	module.exports = {
		subresource,
		forbiddenMethods,
		requestBodyHeader: requestBodyHeader$1,
		referrerPolicy: referrerPolicy$1,
		requestRedirect: requestRedirect$1,
		requestMode: requestMode$1,
		requestCredentials: requestCredentials$1,
		requestCache: requestCache$1,
		redirectStatus,
		corsSafeListedMethods,
		nullBodyStatus: nullBodyStatus$2,
		safeMethods,
		badPorts,
		requestDuplex: requestDuplex$1,
		subresourceSet: new Set(subresource),
		badPortsSet: badPortsSet$1,
		redirectStatusSet: redirectStatusSet$3,
		corsSafeListedMethodsSet: corsSafeListedMethodsSet$1,
		safeMethodsSet: safeMethodsSet$1,
		forbiddenMethodsSet: forbiddenMethodsSet$1,
		referrerPolicySet
	};
}));
var require_global$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var globalOrigin = Symbol.for("undici.globalOrigin.1");
	function getGlobalOrigin$2() {
		return globalThis[globalOrigin];
	}
	function setGlobalOrigin$1(newOrigin) {
		if (newOrigin === void 0) {
			Object.defineProperty(globalThis, globalOrigin, {
				value: void 0,
				writable: true,
				enumerable: false,
				configurable: false
			});
			return;
		}
		const parsedURL = new URL(newOrigin);
		if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`);
		Object.defineProperty(globalThis, globalOrigin, {
			value: parsedURL,
			writable: true,
			enumerable: false,
			configurable: false
		});
	}
	module.exports = {
		getGlobalOrigin: getGlobalOrigin$2,
		setGlobalOrigin: setGlobalOrigin$1
	};
}));
var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$23 = require("node:assert");
	var encoder = new TextEncoder();
	var HTTP_TOKEN_CODEPOINTS$1 = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/;
	var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/;
	var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
	var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
	function dataURLProcessor$1(dataURL) {
		assert$23(dataURL.protocol === "data:");
		let input = URLSerializer$4(dataURL, true);
		input = input.slice(5);
		const position = { position: 0 };
		let mimeType = collectASequenceOfCodePointsFast$2(",", input, position);
		const mimeTypeLength = mimeType.length;
		mimeType = removeASCIIWhitespace(mimeType, true, true);
		if (position.position >= input.length) return "failure";
		position.position++;
		let body = stringPercentDecode(input.slice(mimeTypeLength + 1));
		if (/;(\u0020){0,}base64$/i.test(mimeType)) {
			body = forgivingBase64(isomorphicDecode$1(body));
			if (body === "failure") return "failure";
			mimeType = mimeType.slice(0, -6);
			mimeType = mimeType.replace(/(\u0020)+$/, "");
			mimeType = mimeType.slice(0, -1);
		}
		if (mimeType.startsWith(";")) mimeType = "text/plain" + mimeType;
		let mimeTypeRecord = parseMIMEType$4(mimeType);
		if (mimeTypeRecord === "failure") mimeTypeRecord = parseMIMEType$4("text/plain;charset=US-ASCII");
		return {
			mimeType: mimeTypeRecord,
			body
		};
	}
	function URLSerializer$4(url$3, excludeFragment = false) {
		if (!excludeFragment) return url$3.href;
		const href = url$3.href;
		const hashLength = url$3.hash.length;
		const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength);
		if (!hashLength && href.endsWith("#")) return serialized.slice(0, -1);
		return serialized;
	}
	function collectASequenceOfCodePoints$1(condition, input, position) {
		let result = "";
		while (position.position < input.length && condition(input[position.position])) {
			result += input[position.position];
			position.position++;
		}
		return result;
	}
	function collectASequenceOfCodePointsFast$2(char, input, position) {
		const idx = input.indexOf(char, position.position);
		const start = position.position;
		if (idx === -1) {
			position.position = input.length;
			return input.slice(start);
		}
		position.position = idx;
		return input.slice(start, position.position);
	}
	function stringPercentDecode(input) {
		return percentDecode(encoder.encode(input));
	}
	function isHexCharByte(byte) {
		return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102;
	}
	function hexByteToNumber(byte) {
		return byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55;
	}
	function percentDecode(input) {
		const length = input.length;
		const output = new Uint8Array(length);
		let j = 0;
		for (let i = 0; i < length; ++i) {
			const byte = input[i];
			if (byte !== 37) output[j++] = byte;
			else if (byte === 37 && !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))) output[j++] = 37;
			else {
				output[j++] = hexByteToNumber(input[i + 1]) << 4 | hexByteToNumber(input[i + 2]);
				i += 2;
			}
		}
		return length === j ? output : output.subarray(0, j);
	}
	function parseMIMEType$4(input) {
		input = removeHTTPWhitespace$1(input, true, true);
		const position = { position: 0 };
		const type = collectASequenceOfCodePointsFast$2("/", input, position);
		if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS$1.test(type)) return "failure";
		if (position.position > input.length) return "failure";
		position.position++;
		let subtype = collectASequenceOfCodePointsFast$2(";", input, position);
		subtype = removeHTTPWhitespace$1(subtype, false, true);
		if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS$1.test(subtype)) return "failure";
		const typeLowercase = type.toLowerCase();
		const subtypeLowercase = subtype.toLowerCase();
		const mimeType = {
			type: typeLowercase,
			subtype: subtypeLowercase,
			parameters: /* @__PURE__ */ new Map(),
			essence: `${typeLowercase}/${subtypeLowercase}`
		};
		while (position.position < input.length) {
			position.position++;
			collectASequenceOfCodePoints$1((char) => HTTP_WHITESPACE_REGEX.test(char), input, position);
			let parameterName = collectASequenceOfCodePoints$1((char) => char !== ";" && char !== "=", input, position);
			parameterName = parameterName.toLowerCase();
			if (position.position < input.length) {
				if (input[position.position] === ";") continue;
				position.position++;
			}
			if (position.position > input.length) break;
			let parameterValue = null;
			if (input[position.position] === "\"") {
				parameterValue = collectAnHTTPQuotedString$1(input, position, true);
				collectASequenceOfCodePointsFast$2(";", input, position);
			} else {
				parameterValue = collectASequenceOfCodePointsFast$2(";", input, position);
				parameterValue = removeHTTPWhitespace$1(parameterValue, false, true);
				if (parameterValue.length === 0) continue;
			}
			if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS$1.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) mimeType.parameters.set(parameterName, parameterValue);
		}
		return mimeType;
	}
	function forgivingBase64(data$1) {
		data$1 = data$1.replace(ASCII_WHITESPACE_REPLACE_REGEX, "");
		let dataLength = data$1.length;
		if (dataLength % 4 === 0) {
			if (data$1.charCodeAt(dataLength - 1) === 61) {
				--dataLength;
				if (data$1.charCodeAt(dataLength - 1) === 61) --dataLength;
			}
		}
		if (dataLength % 4 === 1) return "failure";
		if (/[^+/0-9A-Za-z]/.test(data$1.length === dataLength ? data$1 : data$1.substring(0, dataLength))) return "failure";
		const buffer$1 = Buffer.from(data$1, "base64");
		return new Uint8Array(buffer$1.buffer, buffer$1.byteOffset, buffer$1.byteLength);
	}
	function collectAnHTTPQuotedString$1(input, position, extractValue) {
		const positionStart = position.position;
		let value = "";
		assert$23(input[position.position] === "\"");
		position.position++;
		while (true) {
			value += collectASequenceOfCodePoints$1((char) => char !== "\"" && char !== "\\", input, position);
			if (position.position >= input.length) break;
			const quoteOrBackslash = input[position.position];
			position.position++;
			if (quoteOrBackslash === "\\") {
				if (position.position >= input.length) {
					value += "\\";
					break;
				}
				value += input[position.position];
				position.position++;
			} else {
				assert$23(quoteOrBackslash === "\"");
				break;
			}
		}
		if (extractValue) return value;
		return input.slice(positionStart, position.position);
	}
	function serializeAMimeType$4(mimeType) {
		assert$23(mimeType !== "failure");
		const { parameters, essence } = mimeType;
		let serialization = essence;
		for (let [name$1, value] of parameters.entries()) {
			serialization += ";";
			serialization += name$1;
			serialization += "=";
			if (!HTTP_TOKEN_CODEPOINTS$1.test(value)) {
				value = value.replace(/(\\|")/g, "\\$1");
				value = "\"" + value;
				value += "\"";
			}
			serialization += value;
		}
		return serialization;
	}
	function isHTTPWhiteSpace(char) {
		return char === 13 || char === 10 || char === 9 || char === 32;
	}
	function removeHTTPWhitespace$1(str, leading = true, trailing = true) {
		return removeChars$2(str, leading, trailing, isHTTPWhiteSpace);
	}
	function isASCIIWhitespace(char) {
		return char === 13 || char === 10 || char === 9 || char === 12 || char === 32;
	}
	function removeASCIIWhitespace(str, leading = true, trailing = true) {
		return removeChars$2(str, leading, trailing, isASCIIWhitespace);
	}
	function removeChars$2(str, leading, trailing, predicate) {
		let lead = 0;
		let trail = str.length - 1;
		if (leading) while (lead < str.length && predicate(str.charCodeAt(lead))) lead++;
		if (trailing) while (trail > 0 && predicate(str.charCodeAt(trail))) trail--;
		return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1);
	}
	function isomorphicDecode$1(input) {
		const length = input.length;
		if (65535 > length) return String.fromCharCode.apply(null, input);
		let result = "";
		let i = 0;
		let addition = 65535;
		while (i < length) {
			if (i + addition > length) addition = length - i;
			result += String.fromCharCode.apply(null, input.subarray(i, i += addition));
		}
		return result;
	}
	function minimizeSupportedMimeType$1(mimeType) {
		switch (mimeType.essence) {
			case "application/ecmascript":
			case "application/javascript":
			case "application/x-ecmascript":
			case "application/x-javascript":
			case "text/ecmascript":
			case "text/javascript":
			case "text/javascript1.0":
			case "text/javascript1.1":
			case "text/javascript1.2":
			case "text/javascript1.3":
			case "text/javascript1.4":
			case "text/javascript1.5":
			case "text/jscript":
			case "text/livescript":
			case "text/x-ecmascript":
			case "text/x-javascript": return "text/javascript";
			case "application/json":
			case "text/json": return "application/json";
			case "image/svg+xml": return "image/svg+xml";
			case "text/xml":
			case "application/xml": return "application/xml";
		}
		if (mimeType.subtype.endsWith("+json")) return "application/json";
		if (mimeType.subtype.endsWith("+xml")) return "application/xml";
		return "";
	}
	module.exports = {
		dataURLProcessor: dataURLProcessor$1,
		URLSerializer: URLSerializer$4,
		collectASequenceOfCodePoints: collectASequenceOfCodePoints$1,
		collectASequenceOfCodePointsFast: collectASequenceOfCodePointsFast$2,
		stringPercentDecode,
		parseMIMEType: parseMIMEType$4,
		collectAnHTTPQuotedString: collectAnHTTPQuotedString$1,
		serializeAMimeType: serializeAMimeType$4,
		removeChars: removeChars$2,
		removeHTTPWhitespace: removeHTTPWhitespace$1,
		minimizeSupportedMimeType: minimizeSupportedMimeType$1,
		HTTP_TOKEN_CODEPOINTS: HTTP_TOKEN_CODEPOINTS$1,
		isomorphicDecode: isomorphicDecode$1
	};
}));
var require_webidl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { types: types$3, inspect } = require("node:util");
	var { markAsUncloneable } = require("node:worker_threads");
	var { toUSVString } = require_util$9();
	var webidl$16 = {};
	webidl$16.converters = {};
	webidl$16.util = {};
	webidl$16.errors = {};
	webidl$16.errors.exception = function(message) {
		return /* @__PURE__ */ new TypeError(`${message.header}: ${message.message}`);
	};
	webidl$16.errors.conversionFailed = function(context) {
		const plural$1 = context.types.length === 1 ? "" : " one of";
		const message = `${context.argument} could not be converted to${plural$1}: ${context.types.join(", ")}.`;
		return webidl$16.errors.exception({
			header: context.prefix,
			message
		});
	};
	webidl$16.errors.invalidArgument = function(context) {
		return webidl$16.errors.exception({
			header: context.prefix,
			message: `"${context.value}" is an invalid ${context.type}.`
		});
	};
	webidl$16.brandCheck = function(V, I, opts) {
		if (opts?.strict !== false) {
			if (!(V instanceof I)) {
				const err = /* @__PURE__ */ new TypeError("Illegal invocation");
				err.code = "ERR_INVALID_THIS";
				throw err;
			}
		} else if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {
			const err = /* @__PURE__ */ new TypeError("Illegal invocation");
			err.code = "ERR_INVALID_THIS";
			throw err;
		}
	};
	webidl$16.argumentLengthCheck = function({ length }, min$1, ctx) {
		if (length < min$1) throw webidl$16.errors.exception({
			message: `${min$1} argument${min$1 !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`,
			header: ctx
		});
	};
	webidl$16.illegalConstructor = function() {
		throw webidl$16.errors.exception({
			header: "TypeError",
			message: "Illegal constructor"
		});
	};
	webidl$16.util.Type = function(V) {
		switch (typeof V) {
			case "undefined": return "Undefined";
			case "boolean": return "Boolean";
			case "string": return "String";
			case "symbol": return "Symbol";
			case "number": return "Number";
			case "bigint": return "BigInt";
			case "function":
			case "object":
				if (V === null) return "Null";
				return "Object";
		}
	};
	webidl$16.util.markAsUncloneable = markAsUncloneable || (() => {});
	webidl$16.util.ConvertToInt = function(V, bitLength, signedness, opts) {
		let upperBound;
		let lowerBound;
		if (bitLength === 64) {
			upperBound = Math.pow(2, 53) - 1;
			if (signedness === "unsigned") lowerBound = 0;
			else lowerBound = Math.pow(-2, 53) + 1;
		} else if (signedness === "unsigned") {
			lowerBound = 0;
			upperBound = Math.pow(2, bitLength) - 1;
		} else {
			lowerBound = Math.pow(-2, bitLength) - 1;
			upperBound = Math.pow(2, bitLength - 1) - 1;
		}
		let x = Number(V);
		if (x === 0) x = 0;
		if (opts?.enforceRange === true) {
			if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) throw webidl$16.errors.exception({
				header: "Integer conversion",
				message: `Could not convert ${webidl$16.util.Stringify(V)} to an integer.`
			});
			x = webidl$16.util.IntegerPart(x);
			if (x < lowerBound || x > upperBound) throw webidl$16.errors.exception({
				header: "Integer conversion",
				message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
			});
			return x;
		}
		if (!Number.isNaN(x) && opts?.clamp === true) {
			x = Math.min(Math.max(x, lowerBound), upperBound);
			if (Math.floor(x) % 2 === 0) x = Math.floor(x);
			else x = Math.ceil(x);
			return x;
		}
		if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) return 0;
		x = webidl$16.util.IntegerPart(x);
		x = x % Math.pow(2, bitLength);
		if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) return x - Math.pow(2, bitLength);
		return x;
	};
	webidl$16.util.IntegerPart = function(n$1) {
		const r = Math.floor(Math.abs(n$1));
		if (n$1 < 0) return -1 * r;
		return r;
	};
	webidl$16.util.Stringify = function(V) {
		switch (webidl$16.util.Type(V)) {
			case "Symbol": return `Symbol(${V.description})`;
			case "Object": return inspect(V);
			case "String": return `"${V}"`;
			default: return `${V}`;
		}
	};
	webidl$16.sequenceConverter = function(converter) {
		return (V, prefix, argument, Iterable) => {
			if (webidl$16.util.Type(V) !== "Object") throw webidl$16.errors.exception({
				header: prefix,
				message: `${argument} (${webidl$16.util.Stringify(V)}) is not iterable.`
			});
			const method = typeof Iterable === "function" ? Iterable() : V?.[Symbol.iterator]?.();
			const seq = [];
			let index = 0;
			if (method === void 0 || typeof method.next !== "function") throw webidl$16.errors.exception({
				header: prefix,
				message: `${argument} is not iterable.`
			});
			while (true) {
				const { done, value } = method.next();
				if (done) break;
				seq.push(converter(value, prefix, `${argument}[${index++}]`));
			}
			return seq;
		};
	};
	webidl$16.recordConverter = function(keyConverter, valueConverter) {
		return (O, prefix, argument) => {
			if (webidl$16.util.Type(O) !== "Object") throw webidl$16.errors.exception({
				header: prefix,
				message: `${argument} ("${webidl$16.util.Type(O)}") is not an Object.`
			});
			const result = {};
			if (!types$3.isProxy(O)) {
				const keys$1 = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)];
				for (const key of keys$1) {
					const typedKey = keyConverter(key, prefix, argument);
					result[typedKey] = valueConverter(O[key], prefix, argument);
				}
				return result;
			}
			const keys = Reflect.ownKeys(O);
			for (const key of keys) if (Reflect.getOwnPropertyDescriptor(O, key)?.enumerable) {
				const typedKey = keyConverter(key, prefix, argument);
				result[typedKey] = valueConverter(O[key], prefix, argument);
			}
			return result;
		};
	};
	webidl$16.interfaceConverter = function(i) {
		return (V, prefix, argument, opts) => {
			if (opts?.strict !== false && !(V instanceof i)) throw webidl$16.errors.exception({
				header: prefix,
				message: `Expected ${argument} ("${webidl$16.util.Stringify(V)}") to be an instance of ${i.name}.`
			});
			return V;
		};
	};
	webidl$16.dictionaryConverter = function(converters) {
		return (dictionary, prefix, argument) => {
			const type = webidl$16.util.Type(dictionary);
			const dict = {};
			if (type === "Null" || type === "Undefined") return dict;
			else if (type !== "Object") throw webidl$16.errors.exception({
				header: prefix,
				message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
			});
			for (const options of converters) {
				const { key, defaultValue, required, converter } = options;
				if (required === true) {
					if (!Object.hasOwn(dictionary, key)) throw webidl$16.errors.exception({
						header: prefix,
						message: `Missing required key "${key}".`
					});
				}
				let value = dictionary[key];
				const hasDefault = Object.hasOwn(options, "defaultValue");
				if (hasDefault && value !== null) value ??= defaultValue();
				if (required || hasDefault || value !== void 0) {
					value = converter(value, prefix, `${argument}.${key}`);
					if (options.allowedValues && !options.allowedValues.includes(value)) throw webidl$16.errors.exception({
						header: prefix,
						message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.`
					});
					dict[key] = value;
				}
			}
			return dict;
		};
	};
	webidl$16.nullableConverter = function(converter) {
		return (V, prefix, argument) => {
			if (V === null) return V;
			return converter(V, prefix, argument);
		};
	};
	webidl$16.converters.DOMString = function(V, prefix, argument, opts) {
		if (V === null && opts?.legacyNullToEmptyString) return "";
		if (typeof V === "symbol") throw webidl$16.errors.exception({
			header: prefix,
			message: `${argument} is a symbol, which cannot be converted to a DOMString.`
		});
		return String(V);
	};
	webidl$16.converters.ByteString = function(V, prefix, argument) {
		const x = webidl$16.converters.DOMString(V, prefix, argument);
		for (let index = 0; index < x.length; index++) if (x.charCodeAt(index) > 255) throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`);
		return x;
	};
	webidl$16.converters.USVString = toUSVString;
	webidl$16.converters.boolean = function(V) {
		return Boolean(V);
	};
	webidl$16.converters.any = function(V) {
		return V;
	};
	webidl$16.converters["long long"] = function(V, prefix, argument) {
		return webidl$16.util.ConvertToInt(V, 64, "signed", void 0, prefix, argument);
	};
	webidl$16.converters["unsigned long long"] = function(V, prefix, argument) {
		return webidl$16.util.ConvertToInt(V, 64, "unsigned", void 0, prefix, argument);
	};
	webidl$16.converters["unsigned long"] = function(V, prefix, argument) {
		return webidl$16.util.ConvertToInt(V, 32, "unsigned", void 0, prefix, argument);
	};
	webidl$16.converters["unsigned short"] = function(V, prefix, argument, opts) {
		return webidl$16.util.ConvertToInt(V, 16, "unsigned", opts, prefix, argument);
	};
	webidl$16.converters.ArrayBuffer = function(V, prefix, argument, opts) {
		if (webidl$16.util.Type(V) !== "Object" || !types$3.isAnyArrayBuffer(V)) throw webidl$16.errors.conversionFailed({
			prefix,
			argument: `${argument} ("${webidl$16.util.Stringify(V)}")`,
			types: ["ArrayBuffer"]
		});
		if (opts?.allowShared === false && types$3.isSharedArrayBuffer(V)) throw webidl$16.errors.exception({
			header: "ArrayBuffer",
			message: "SharedArrayBuffer is not allowed."
		});
		if (V.resizable || V.growable) throw webidl$16.errors.exception({
			header: "ArrayBuffer",
			message: "Received a resizable ArrayBuffer."
		});
		return V;
	};
	webidl$16.converters.TypedArray = function(V, T, prefix, name$1, opts) {
		if (webidl$16.util.Type(V) !== "Object" || !types$3.isTypedArray(V) || V.constructor.name !== T.name) throw webidl$16.errors.conversionFailed({
			prefix,
			argument: `${name$1} ("${webidl$16.util.Stringify(V)}")`,
			types: [T.name]
		});
		if (opts?.allowShared === false && types$3.isSharedArrayBuffer(V.buffer)) throw webidl$16.errors.exception({
			header: "ArrayBuffer",
			message: "SharedArrayBuffer is not allowed."
		});
		if (V.buffer.resizable || V.buffer.growable) throw webidl$16.errors.exception({
			header: "ArrayBuffer",
			message: "Received a resizable ArrayBuffer."
		});
		return V;
	};
	webidl$16.converters.DataView = function(V, prefix, name$1, opts) {
		if (webidl$16.util.Type(V) !== "Object" || !types$3.isDataView(V)) throw webidl$16.errors.exception({
			header: prefix,
			message: `${name$1} is not a DataView.`
		});
		if (opts?.allowShared === false && types$3.isSharedArrayBuffer(V.buffer)) throw webidl$16.errors.exception({
			header: "ArrayBuffer",
			message: "SharedArrayBuffer is not allowed."
		});
		if (V.buffer.resizable || V.buffer.growable) throw webidl$16.errors.exception({
			header: "ArrayBuffer",
			message: "Received a resizable ArrayBuffer."
		});
		return V;
	};
	webidl$16.converters.BufferSource = function(V, prefix, name$1, opts) {
		if (types$3.isAnyArrayBuffer(V)) return webidl$16.converters.ArrayBuffer(V, prefix, name$1, {
			...opts,
			allowShared: false
		});
		if (types$3.isTypedArray(V)) return webidl$16.converters.TypedArray(V, V.constructor, prefix, name$1, {
			...opts,
			allowShared: false
		});
		if (types$3.isDataView(V)) return webidl$16.converters.DataView(V, prefix, name$1, {
			...opts,
			allowShared: false
		});
		throw webidl$16.errors.conversionFailed({
			prefix,
			argument: `${name$1} ("${webidl$16.util.Stringify(V)}")`,
			types: ["BufferSource"]
		});
	};
	webidl$16.converters["sequence<ByteString>"] = webidl$16.sequenceConverter(webidl$16.converters.ByteString);
	webidl$16.converters["sequence<sequence<ByteString>>"] = webidl$16.sequenceConverter(webidl$16.converters["sequence<ByteString>"]);
	webidl$16.converters["record<ByteString, ByteString>"] = webidl$16.recordConverter(webidl$16.converters.ByteString, webidl$16.converters.ByteString);
	module.exports = { webidl: webidl$16 };
}));
var require_util$8 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Transform: Transform$2 } = require("node:stream");
	var zlib$2 = require("node:zlib");
	var { redirectStatusSet: redirectStatusSet$2, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants$2();
	var { getGlobalOrigin: getGlobalOrigin$1 } = require_global$1();
	var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars: removeChars$1, parseMIMEType: parseMIMEType$3 } = require_data_url();
	var { performance: performance$1 } = require("node:perf_hooks");
	var { isBlobLike: isBlobLike$5, ReadableStreamFrom: ReadableStreamFrom$2, isValidHTTPToken: isValidHTTPToken$1, normalizedMethodRecordsBase: normalizedMethodRecordsBase$1 } = require_util$9();
	var assert$22 = require("node:assert");
	var { isUint8Array } = require("node:util/types");
	var { webidl: webidl$15 } = require_webidl();
	var supportedHashes = [];
	var crypto$4;
	try {
		crypto$4 = require("node:crypto");
		const possibleRelevantHashes = [
			"sha256",
			"sha384",
			"sha512"
		];
		supportedHashes = crypto$4.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
	} catch {}
	function responseURL(response) {
		const urlList = response.urlList;
		const length = urlList.length;
		return length === 0 ? null : urlList[length - 1].toString();
	}
	function responseLocationURL$1(response, requestFragment) {
		if (!redirectStatusSet$2.has(response.status)) return null;
		let location = response.headersList.get("location", true);
		if (location !== null && isValidHeaderValue$1(location)) {
			if (!isValidEncodedURL(location)) location = normalizeBinaryStringToUtf8(location);
			location = new URL(location, responseURL(response));
		}
		if (location && !location.hash) location.hash = requestFragment;
		return location;
	}
	function isValidEncodedURL(url$3) {
		for (let i = 0; i < url$3.length; ++i) {
			const code = url$3.charCodeAt(i);
			if (code > 126 || code < 32) return false;
		}
		return true;
	}
	function normalizeBinaryStringToUtf8(value) {
		return Buffer.from(value, "binary").toString("utf8");
	}
	function requestCurrentURL$1(request$1) {
		return request$1.urlList[request$1.urlList.length - 1];
	}
	function requestBadPort$1(request$1) {
		const url$3 = requestCurrentURL$1(request$1);
		if (urlIsHttpHttpsScheme$2(url$3) && badPortsSet.has(url$3.port)) return "blocked";
		return "allowed";
	}
	function isErrorLike$2(object) {
		return object instanceof Error || object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException";
	}
	function isValidReasonPhrase$1(statusText) {
		for (let i = 0; i < statusText.length; ++i) {
			const c = statusText.charCodeAt(i);
			if (!(c === 9 || c >= 32 && c <= 126 || c >= 128 && c <= 255)) return false;
		}
		return true;
	}
	var isValidHeaderName$2 = isValidHTTPToken$1;
	function isValidHeaderValue$1(potentialValue) {
		return (potentialValue[0] === "	" || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === "	" || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false;
	}
	function setRequestReferrerPolicyOnRedirect$1(request$1, actualResponse) {
		const { headersList } = actualResponse;
		const policyHeader = (headersList.get("referrer-policy", true) ?? "").split(",");
		let policy = "";
		if (policyHeader.length > 0) for (let i = policyHeader.length; i !== 0; i--) {
			const token = policyHeader[i - 1].trim();
			if (referrerPolicyTokens.has(token)) {
				policy = token;
				break;
			}
		}
		if (policy !== "") request$1.referrerPolicy = policy;
	}
	function crossOriginResourcePolicyCheck$1() {
		return "allowed";
	}
	function corsCheck$1() {
		return "success";
	}
	function TAOCheck$1() {
		return "success";
	}
	function appendFetchMetadata$1(httpRequest) {
		let header = null;
		header = httpRequest.mode;
		httpRequest.headersList.set("sec-fetch-mode", header, true);
	}
	function appendRequestOriginHeader$1(request$1) {
		let serializedOrigin = request$1.origin;
		if (serializedOrigin === "client" || serializedOrigin === void 0) return;
		if (request$1.responseTainting === "cors" || request$1.mode === "websocket") request$1.headersList.append("origin", serializedOrigin, true);
		else if (request$1.method !== "GET" && request$1.method !== "HEAD") {
			switch (request$1.referrerPolicy) {
				case "no-referrer":
					serializedOrigin = null;
					break;
				case "no-referrer-when-downgrade":
				case "strict-origin":
				case "strict-origin-when-cross-origin":
					if (request$1.origin && urlHasHttpsScheme$1(request$1.origin) && !urlHasHttpsScheme$1(requestCurrentURL$1(request$1))) serializedOrigin = null;
					break;
				case "same-origin":
					if (!sameOrigin$2(request$1, requestCurrentURL$1(request$1))) serializedOrigin = null;
					break;
				default:
			}
			request$1.headersList.append("origin", serializedOrigin, true);
		}
	}
	function coarsenTime(timestamp, crossOriginIsolatedCapability) {
		return timestamp;
	}
	function clampAndCoarsenConnectionTimingInfo$1(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {
		if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) return {
			domainLookupStartTime: defaultStartTime,
			domainLookupEndTime: defaultStartTime,
			connectionStartTime: defaultStartTime,
			connectionEndTime: defaultStartTime,
			secureConnectionStartTime: defaultStartTime,
			ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol
		};
		return {
			domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),
			domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),
			connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),
			connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),
			secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),
			ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol
		};
	}
	function coarsenedSharedCurrentTime$1(crossOriginIsolatedCapability) {
		return coarsenTime(performance$1.now(), crossOriginIsolatedCapability);
	}
	function createOpaqueTimingInfo$1(timingInfo) {
		return {
			startTime: timingInfo.startTime ?? 0,
			redirectStartTime: 0,
			redirectEndTime: 0,
			postRedirectStartTime: timingInfo.startTime ?? 0,
			finalServiceWorkerStartTime: 0,
			finalNetworkResponseStartTime: 0,
			finalNetworkRequestStartTime: 0,
			endTime: 0,
			encodedBodySize: 0,
			decodedBodySize: 0,
			finalConnectionTimingInfo: null
		};
	}
	function makePolicyContainer$1() {
		return { referrerPolicy: "strict-origin-when-cross-origin" };
	}
	function clonePolicyContainer$1(policyContainer) {
		return { referrerPolicy: policyContainer.referrerPolicy };
	}
	function determineRequestsReferrer$1(request$1) {
		const policy = request$1.referrerPolicy;
		assert$22(policy);
		let referrerSource = null;
		if (request$1.referrer === "client") {
			const globalOrigin$1 = getGlobalOrigin$1();
			if (!globalOrigin$1 || globalOrigin$1.origin === "null") return "no-referrer";
			referrerSource = new URL(globalOrigin$1);
		} else if (request$1.referrer instanceof URL) referrerSource = request$1.referrer;
		let referrerURL = stripURLForReferrer(referrerSource);
		const referrerOrigin = stripURLForReferrer(referrerSource, true);
		if (referrerURL.toString().length > 4096) referrerURL = referrerOrigin;
		const areSameOrigin = sameOrigin$2(request$1, referrerURL);
		const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request$1.url);
		switch (policy) {
			case "origin": return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true);
			case "unsafe-url": return referrerURL;
			case "same-origin": return areSameOrigin ? referrerOrigin : "no-referrer";
			case "origin-when-cross-origin": return areSameOrigin ? referrerURL : referrerOrigin;
			case "strict-origin-when-cross-origin": {
				const currentURL = requestCurrentURL$1(request$1);
				if (sameOrigin$2(referrerURL, currentURL)) return referrerURL;
				if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) return "no-referrer";
				return referrerOrigin;
			}
			case "strict-origin":
			case "no-referrer-when-downgrade":
			default: return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;
		}
	}
	function stripURLForReferrer(url$3, originOnly) {
		assert$22(url$3 instanceof URL);
		url$3 = new URL(url$3);
		if (url$3.protocol === "file:" || url$3.protocol === "about:" || url$3.protocol === "blank:") return "no-referrer";
		url$3.username = "";
		url$3.password = "";
		url$3.hash = "";
		if (originOnly) {
			url$3.pathname = "";
			url$3.search = "";
		}
		return url$3;
	}
	function isURLPotentiallyTrustworthy(url$3) {
		if (!(url$3 instanceof URL)) return false;
		if (url$3.href === "about:blank" || url$3.href === "about:srcdoc") return true;
		if (url$3.protocol === "data:") return true;
		if (url$3.protocol === "file:") return true;
		return isOriginPotentiallyTrustworthy(url$3.origin);
		function isOriginPotentiallyTrustworthy(origin$1) {
			if (origin$1 == null || origin$1 === "null") return false;
			const originAsURL = new URL(origin$1);
			if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") return true;
			if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.") || originAsURL.hostname.endsWith(".localhost")) return true;
			return false;
		}
	}
	function bytesMatch$1(bytes, metadataList) {
		/* istanbul ignore if: only if node is built with --without-ssl */
		if (crypto$4 === void 0) return true;
		const parsedMetadata = parseMetadata(metadataList);
		if (parsedMetadata === "no metadata") return true;
		if (parsedMetadata.length === 0) return true;
		const metadata = filterMetadataListByAlgorithm(parsedMetadata, getStrongestMetadata(parsedMetadata));
		for (const item of metadata) {
			const algorithm = item.algo;
			const expectedValue = item.hash;
			let actualValue = crypto$4.createHash(algorithm).update(bytes).digest("base64");
			if (actualValue[actualValue.length - 1] === "=") if (actualValue[actualValue.length - 2] === "=") actualValue = actualValue.slice(0, -2);
			else actualValue = actualValue.slice(0, -1);
			if (compareBase64Mixed(actualValue, expectedValue)) return true;
		}
		return false;
	}
	var parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;
	function parseMetadata(metadata) {
		const result = [];
		let empty = true;
		for (const token of metadata.split(" ")) {
			empty = false;
			const parsedToken = parseHashWithOptions.exec(token);
			if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) continue;
			const algorithm = parsedToken.groups.algo.toLowerCase();
			if (supportedHashes.includes(algorithm)) result.push(parsedToken.groups);
		}
		if (empty === true) return "no metadata";
		return result;
	}
	function getStrongestMetadata(metadataList) {
		let algorithm = metadataList[0].algo;
		if (algorithm[3] === "5") return algorithm;
		for (let i = 1; i < metadataList.length; ++i) {
			const metadata = metadataList[i];
			if (metadata.algo[3] === "5") {
				algorithm = "sha512";
				break;
			} else if (algorithm[3] === "3") continue;
			else if (metadata.algo[3] === "3") algorithm = "sha384";
		}
		return algorithm;
	}
	function filterMetadataListByAlgorithm(metadataList, algorithm) {
		if (metadataList.length === 1) return metadataList;
		let pos = 0;
		for (let i = 0; i < metadataList.length; ++i) if (metadataList[i].algo === algorithm) metadataList[pos++] = metadataList[i];
		metadataList.length = pos;
		return metadataList;
	}
	function compareBase64Mixed(actualValue, expectedValue) {
		if (actualValue.length !== expectedValue.length) return false;
		for (let i = 0; i < actualValue.length; ++i) if (actualValue[i] !== expectedValue[i]) {
			if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") continue;
			return false;
		}
		return true;
	}
	function tryUpgradeRequestToAPotentiallyTrustworthyURL$1(request$1) {}
	function sameOrigin$2(A, B) {
		if (A.origin === B.origin && A.origin === "null") return true;
		if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) return true;
		return false;
	}
	function createDeferredPromise$3() {
		let res;
		let rej;
		return {
			promise: new Promise((resolve, reject) => {
				res = resolve;
				rej = reject;
			}),
			resolve: res,
			reject: rej
		};
	}
	function isAborted$2(fetchParams) {
		return fetchParams.controller.state === "aborted";
	}
	function isCancelled$2(fetchParams) {
		return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
	}
	function normalizeMethod(method) {
		return normalizedMethodRecordsBase$1[method.toLowerCase()] ?? method;
	}
	function serializeJavascriptValueToJSONString$1(value) {
		const result = JSON.stringify(value);
		if (result === void 0) throw new TypeError("Value is not JSON serializable");
		assert$22(typeof result === "string");
		return result;
	}
	var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
	function createIterator(name$1, kInternalIterator, keyIndex = 0, valueIndex = 1) {
		class FastIterableIterator {
			#target;
			#kind;
			#index;
			constructor(target, kind) {
				this.#target = target;
				this.#kind = kind;
				this.#index = 0;
			}
			next() {
				if (typeof this !== "object" || this === null || !(#target in this)) throw new TypeError(`'next' called on an object that does not implement interface ${name$1} Iterator.`);
				const index = this.#index;
				const values = this.#target[kInternalIterator];
				if (index >= values.length) return {
					value: void 0,
					done: true
				};
				const { [keyIndex]: key, [valueIndex]: value } = values[index];
				this.#index = index + 1;
				let result;
				switch (this.#kind) {
					case "key":
						result = key;
						break;
					case "value":
						result = value;
						break;
					case "key+value":
						result = [key, value];
						break;
				}
				return {
					value: result,
					done: false
				};
			}
		}
		delete FastIterableIterator.prototype.constructor;
		Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype);
		Object.defineProperties(FastIterableIterator.prototype, {
			[Symbol.toStringTag]: {
				writable: false,
				enumerable: false,
				configurable: true,
				value: `${name$1} Iterator`
			},
			next: {
				writable: true,
				enumerable: true,
				configurable: true
			}
		});
		return function(target, kind) {
			return new FastIterableIterator(target, kind);
		};
	}
	function iteratorMixin$2(name$1, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {
		const makeIterator = createIterator(name$1, kInternalIterator, keyIndex, valueIndex);
		const properties = {
			keys: {
				writable: true,
				enumerable: true,
				configurable: true,
				value: function keys() {
					webidl$15.brandCheck(this, object);
					return makeIterator(this, "key");
				}
			},
			values: {
				writable: true,
				enumerable: true,
				configurable: true,
				value: function values() {
					webidl$15.brandCheck(this, object);
					return makeIterator(this, "value");
				}
			},
			entries: {
				writable: true,
				enumerable: true,
				configurable: true,
				value: function entries() {
					webidl$15.brandCheck(this, object);
					return makeIterator(this, "key+value");
				}
			},
			forEach: {
				writable: true,
				enumerable: true,
				configurable: true,
				value: function forEach$1(callbackfn, thisArg = globalThis) {
					webidl$15.brandCheck(this, object);
					webidl$15.argumentLengthCheck(arguments, 1, `${name$1}.forEach`);
					if (typeof callbackfn !== "function") throw new TypeError(`Failed to execute 'forEach' on '${name$1}': parameter 1 is not of type 'Function'.`);
					for (const { 0: key, 1: value } of makeIterator(this, "key+value")) callbackfn.call(thisArg, value, key, this);
				}
			}
		};
		return Object.defineProperties(object.prototype, {
			...properties,
			[Symbol.iterator]: {
				writable: true,
				enumerable: false,
				configurable: true,
				value: properties.entries.value
			}
		});
	}
	async function fullyReadBody$2(body, processBody, processBodyError) {
		const successSteps = processBody;
		const errorSteps = processBodyError;
		let reader;
		try {
			reader = body.stream.getReader();
		} catch (e) {
			errorSteps(e);
			return;
		}
		try {
			successSteps(await readAllBytes$1(reader));
		} catch (e) {
			errorSteps(e);
		}
	}
	function isReadableStreamLike$1(stream$7) {
		return stream$7 instanceof ReadableStream || stream$7[Symbol.toStringTag] === "ReadableStream" && typeof stream$7.tee === "function";
	}
	function readableStreamClose$2(controller) {
		try {
			controller.close();
			controller.byobRequest?.respond(0);
		} catch (err) {
			if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) throw err;
		}
	}
	var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
	function isomorphicEncode$2(input) {
		assert$22(!invalidIsomorphicEncodeValueRegex.test(input));
		return input;
	}
	async function readAllBytes$1(reader) {
		const bytes = [];
		let byteLength = 0;
		while (true) {
			const { done, value: chunk } = await reader.read();
			if (done) return Buffer.concat(bytes, byteLength);
			if (!isUint8Array(chunk)) throw new TypeError("Received non-Uint8Array chunk");
			bytes.push(chunk);
			byteLength += chunk.length;
		}
	}
	function urlIsLocal$1(url$3) {
		assert$22("protocol" in url$3);
		const protocol = url$3.protocol;
		return protocol === "about:" || protocol === "blob:" || protocol === "data:";
	}
	function urlHasHttpsScheme$1(url$3) {
		return typeof url$3 === "string" && url$3[5] === ":" && url$3[0] === "h" && url$3[1] === "t" && url$3[2] === "t" && url$3[3] === "p" && url$3[4] === "s" || url$3.protocol === "https:";
	}
	function urlIsHttpHttpsScheme$2(url$3) {
		assert$22("protocol" in url$3);
		const protocol = url$3.protocol;
		return protocol === "http:" || protocol === "https:";
	}
	function simpleRangeHeaderValue$1(value, allowWhitespace) {
		const data$1 = value;
		if (!data$1.startsWith("bytes")) return "failure";
		const position = { position: 5 };
		if (allowWhitespace) collectASequenceOfCodePoints((char) => char === "	" || char === " ", data$1, position);
		if (data$1.charCodeAt(position.position) !== 61) return "failure";
		position.position++;
		if (allowWhitespace) collectASequenceOfCodePoints((char) => char === "	" || char === " ", data$1, position);
		const rangeStart = collectASequenceOfCodePoints((char) => {
			const code = char.charCodeAt(0);
			return code >= 48 && code <= 57;
		}, data$1, position);
		const rangeStartValue = rangeStart.length ? Number(rangeStart) : null;
		if (allowWhitespace) collectASequenceOfCodePoints((char) => char === "	" || char === " ", data$1, position);
		if (data$1.charCodeAt(position.position) !== 45) return "failure";
		position.position++;
		if (allowWhitespace) collectASequenceOfCodePoints((char) => char === "	" || char === " ", data$1, position);
		const rangeEnd = collectASequenceOfCodePoints((char) => {
			const code = char.charCodeAt(0);
			return code >= 48 && code <= 57;
		}, data$1, position);
		const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null;
		if (position.position < data$1.length) return "failure";
		if (rangeEndValue === null && rangeStartValue === null) return "failure";
		if (rangeStartValue > rangeEndValue) return "failure";
		return {
			rangeStartValue,
			rangeEndValue
		};
	}
	function buildContentRange$1(rangeStart, rangeEnd, fullLength) {
		let contentRange = "bytes ";
		contentRange += isomorphicEncode$2(`${rangeStart}`);
		contentRange += "-";
		contentRange += isomorphicEncode$2(`${rangeEnd}`);
		contentRange += "/";
		contentRange += isomorphicEncode$2(`${fullLength}`);
		return contentRange;
	}
	var InflateStream = class extends Transform$2 {
		#zlibOptions;
		constructor(zlibOptions$1) {
			super();
			this.#zlibOptions = zlibOptions$1;
		}
		_transform(chunk, encoding, callback) {
			if (!this._inflateStream) {
				if (chunk.length === 0) {
					callback();
					return;
				}
				this._inflateStream = (chunk[0] & 15) === 8 ? zlib$2.createInflate(this.#zlibOptions) : zlib$2.createInflateRaw(this.#zlibOptions);
				this._inflateStream.on("data", this.push.bind(this));
				this._inflateStream.on("end", () => this.push(null));
				this._inflateStream.on("error", (err) => this.destroy(err));
			}
			this._inflateStream.write(chunk, encoding, callback);
		}
		_final(callback) {
			if (this._inflateStream) {
				this._inflateStream.end();
				this._inflateStream = null;
			}
			callback();
		}
	};
	function createInflate$1(zlibOptions$1) {
		return new InflateStream(zlibOptions$1);
	}
	function extractMimeType$2(headers) {
		let charset$1 = null;
		let essence = null;
		let mimeType = null;
		const values = getDecodeSplit$1("content-type", headers);
		if (values === null) return "failure";
		for (const value of values) {
			const temporaryMimeType = parseMIMEType$3(value);
			if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") continue;
			mimeType = temporaryMimeType;
			if (mimeType.essence !== essence) {
				charset$1 = null;
				if (mimeType.parameters.has("charset")) charset$1 = mimeType.parameters.get("charset");
				essence = mimeType.essence;
			} else if (!mimeType.parameters.has("charset") && charset$1 !== null) mimeType.parameters.set("charset", charset$1);
		}
		if (mimeType == null) return "failure";
		return mimeType;
	}
	function gettingDecodingSplitting(value) {
		const input = value;
		const position = { position: 0 };
		const values = [];
		let temporaryValue = "";
		while (position.position < input.length) {
			temporaryValue += collectASequenceOfCodePoints((char) => char !== "\"" && char !== ",", input, position);
			if (position.position < input.length) if (input.charCodeAt(position.position) === 34) {
				temporaryValue += collectAnHTTPQuotedString(input, position);
				if (position.position < input.length) continue;
			} else {
				assert$22(input.charCodeAt(position.position) === 44);
				position.position++;
			}
			temporaryValue = removeChars$1(temporaryValue, true, true, (char) => char === 9 || char === 32);
			values.push(temporaryValue);
			temporaryValue = "";
		}
		return values;
	}
	function getDecodeSplit$1(name$1, list) {
		const value = list.get(name$1, true);
		if (value === null) return null;
		return gettingDecodingSplitting(value);
	}
	var textDecoder = new TextDecoder();
	function utf8DecodeBytes$2(buffer$1) {
		if (buffer$1.length === 0) return "";
		if (buffer$1[0] === 239 && buffer$1[1] === 187 && buffer$1[2] === 191) buffer$1 = buffer$1.subarray(3);
		return textDecoder.decode(buffer$1);
	}
	var EnvironmentSettingsObjectBase = class {
		get baseUrl() {
			return getGlobalOrigin$1();
		}
		get origin() {
			return this.baseUrl?.origin;
		}
		policyContainer = makePolicyContainer$1();
	};
	var EnvironmentSettingsObject = class {
		settingsObject = new EnvironmentSettingsObjectBase();
	};
	module.exports = {
		isAborted: isAborted$2,
		isCancelled: isCancelled$2,
		isValidEncodedURL,
		createDeferredPromise: createDeferredPromise$3,
		ReadableStreamFrom: ReadableStreamFrom$2,
		tryUpgradeRequestToAPotentiallyTrustworthyURL: tryUpgradeRequestToAPotentiallyTrustworthyURL$1,
		clampAndCoarsenConnectionTimingInfo: clampAndCoarsenConnectionTimingInfo$1,
		coarsenedSharedCurrentTime: coarsenedSharedCurrentTime$1,
		determineRequestsReferrer: determineRequestsReferrer$1,
		makePolicyContainer: makePolicyContainer$1,
		clonePolicyContainer: clonePolicyContainer$1,
		appendFetchMetadata: appendFetchMetadata$1,
		appendRequestOriginHeader: appendRequestOriginHeader$1,
		TAOCheck: TAOCheck$1,
		corsCheck: corsCheck$1,
		crossOriginResourcePolicyCheck: crossOriginResourcePolicyCheck$1,
		createOpaqueTimingInfo: createOpaqueTimingInfo$1,
		setRequestReferrerPolicyOnRedirect: setRequestReferrerPolicyOnRedirect$1,
		isValidHTTPToken: isValidHTTPToken$1,
		requestBadPort: requestBadPort$1,
		requestCurrentURL: requestCurrentURL$1,
		responseURL,
		responseLocationURL: responseLocationURL$1,
		isBlobLike: isBlobLike$5,
		isURLPotentiallyTrustworthy,
		isValidReasonPhrase: isValidReasonPhrase$1,
		sameOrigin: sameOrigin$2,
		normalizeMethod,
		serializeJavascriptValueToJSONString: serializeJavascriptValueToJSONString$1,
		iteratorMixin: iteratorMixin$2,
		createIterator,
		isValidHeaderName: isValidHeaderName$2,
		isValidHeaderValue: isValidHeaderValue$1,
		isErrorLike: isErrorLike$2,
		fullyReadBody: fullyReadBody$2,
		bytesMatch: bytesMatch$1,
		isReadableStreamLike: isReadableStreamLike$1,
		readableStreamClose: readableStreamClose$2,
		isomorphicEncode: isomorphicEncode$2,
		urlIsLocal: urlIsLocal$1,
		urlHasHttpsScheme: urlHasHttpsScheme$1,
		urlIsHttpHttpsScheme: urlIsHttpHttpsScheme$2,
		readAllBytes: readAllBytes$1,
		simpleRangeHeaderValue: simpleRangeHeaderValue$1,
		buildContentRange: buildContentRange$1,
		parseMetadata,
		createInflate: createInflate$1,
		extractMimeType: extractMimeType$2,
		getDecodeSplit: getDecodeSplit$1,
		utf8DecodeBytes: utf8DecodeBytes$2,
		environmentSettingsObject: new EnvironmentSettingsObject()
	};
}));
var require_symbols$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		kUrl: Symbol("url"),
		kHeaders: Symbol("headers"),
		kSignal: Symbol("signal"),
		kState: Symbol("state"),
		kDispatcher: Symbol("dispatcher")
	};
}));
var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Blob: Blob$2, File: File$2 } = require("node:buffer");
	var { kState: kState$9 } = require_symbols$3();
	var { webidl: webidl$14 } = require_webidl();
	var FileLike$1 = class FileLike$1 {
		constructor(blobLike, fileName, options = {}) {
			this[kState$9] = {
				blobLike,
				name: fileName,
				type: options.type,
				lastModified: options.lastModified ?? Date.now()
			};
		}
		stream(...args) {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].blobLike.stream(...args);
		}
		arrayBuffer(...args) {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].blobLike.arrayBuffer(...args);
		}
		slice(...args) {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].blobLike.slice(...args);
		}
		text(...args) {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].blobLike.text(...args);
		}
		get size() {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].blobLike.size;
		}
		get type() {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].blobLike.type;
		}
		get name() {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].name;
		}
		get lastModified() {
			webidl$14.brandCheck(this, FileLike$1);
			return this[kState$9].lastModified;
		}
		get [Symbol.toStringTag]() {
			return "File";
		}
	};
	webidl$14.converters.Blob = webidl$14.interfaceConverter(Blob$2);
	function isFileLike$2(object) {
		return object instanceof File$2 || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File";
	}
	module.exports = {
		FileLike: FileLike$1,
		isFileLike: isFileLike$2
	};
}));
var require_formdata = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { isBlobLike: isBlobLike$4, iteratorMixin: iteratorMixin$1 } = require_util$8();
	var { kState: kState$8 } = require_symbols$3();
	var { kEnumerableProperty: kEnumerableProperty$9 } = require_util$9();
	var { FileLike, isFileLike: isFileLike$1 } = require_file$1();
	var { webidl: webidl$13 } = require_webidl();
	var { File: NativeFile } = require("node:buffer");
	var nodeUtil$2 = require("node:util");
	var File$1 = globalThis.File ?? NativeFile;
	var FormData$3 = class FormData$3 {
		constructor(form) {
			webidl$13.util.markAsUncloneable(this);
			if (form !== void 0) throw webidl$13.errors.conversionFailed({
				prefix: "FormData constructor",
				argument: "Argument 1",
				types: ["undefined"]
			});
			this[kState$8] = [];
		}
		append(name$1, value, filename = void 0) {
			webidl$13.brandCheck(this, FormData$3);
			const prefix = "FormData.append";
			webidl$13.argumentLengthCheck(arguments, 2, prefix);
			if (arguments.length === 3 && !isBlobLike$4(value)) throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");
			name$1 = webidl$13.converters.USVString(name$1, prefix, "name");
			value = isBlobLike$4(value) ? webidl$13.converters.Blob(value, prefix, "value", { strict: false }) : webidl$13.converters.USVString(value, prefix, "value");
			filename = arguments.length === 3 ? webidl$13.converters.USVString(filename, prefix, "filename") : void 0;
			const entry = makeEntry$1(name$1, value, filename);
			this[kState$8].push(entry);
		}
		delete(name$1) {
			webidl$13.brandCheck(this, FormData$3);
			const prefix = "FormData.delete";
			webidl$13.argumentLengthCheck(arguments, 1, prefix);
			name$1 = webidl$13.converters.USVString(name$1, prefix, "name");
			this[kState$8] = this[kState$8].filter((entry) => entry.name !== name$1);
		}
		get(name$1) {
			webidl$13.brandCheck(this, FormData$3);
			const prefix = "FormData.get";
			webidl$13.argumentLengthCheck(arguments, 1, prefix);
			name$1 = webidl$13.converters.USVString(name$1, prefix, "name");
			const idx = this[kState$8].findIndex((entry) => entry.name === name$1);
			if (idx === -1) return null;
			return this[kState$8][idx].value;
		}
		getAll(name$1) {
			webidl$13.brandCheck(this, FormData$3);
			const prefix = "FormData.getAll";
			webidl$13.argumentLengthCheck(arguments, 1, prefix);
			name$1 = webidl$13.converters.USVString(name$1, prefix, "name");
			return this[kState$8].filter((entry) => entry.name === name$1).map((entry) => entry.value);
		}
		has(name$1) {
			webidl$13.brandCheck(this, FormData$3);
			const prefix = "FormData.has";
			webidl$13.argumentLengthCheck(arguments, 1, prefix);
			name$1 = webidl$13.converters.USVString(name$1, prefix, "name");
			return this[kState$8].findIndex((entry) => entry.name === name$1) !== -1;
		}
		set(name$1, value, filename = void 0) {
			webidl$13.brandCheck(this, FormData$3);
			const prefix = "FormData.set";
			webidl$13.argumentLengthCheck(arguments, 2, prefix);
			if (arguments.length === 3 && !isBlobLike$4(value)) throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");
			name$1 = webidl$13.converters.USVString(name$1, prefix, "name");
			value = isBlobLike$4(value) ? webidl$13.converters.Blob(value, prefix, "name", { strict: false }) : webidl$13.converters.USVString(value, prefix, "name");
			filename = arguments.length === 3 ? webidl$13.converters.USVString(filename, prefix, "name") : void 0;
			const entry = makeEntry$1(name$1, value, filename);
			const idx = this[kState$8].findIndex((entry$1) => entry$1.name === name$1);
			if (idx !== -1) this[kState$8] = [
				...this[kState$8].slice(0, idx),
				entry,
				...this[kState$8].slice(idx + 1).filter((entry$1) => entry$1.name !== name$1)
			];
			else this[kState$8].push(entry);
		}
		[nodeUtil$2.inspect.custom](depth, options) {
			const state$1 = this[kState$8].reduce((a, b) => {
				if (a[b.name]) if (Array.isArray(a[b.name])) a[b.name].push(b.value);
				else a[b.name] = [a[b.name], b.value];
				else a[b.name] = b.value;
				return a;
			}, { __proto__: null });
			options.depth ??= depth;
			options.colors ??= true;
			const output = nodeUtil$2.formatWithOptions(options, state$1);
			return `FormData ${output.slice(output.indexOf("]") + 2)}`;
		}
	};
	iteratorMixin$1("FormData", FormData$3, kState$8, "name", "value");
	Object.defineProperties(FormData$3.prototype, {
		append: kEnumerableProperty$9,
		delete: kEnumerableProperty$9,
		get: kEnumerableProperty$9,
		getAll: kEnumerableProperty$9,
		has: kEnumerableProperty$9,
		set: kEnumerableProperty$9,
		[Symbol.toStringTag]: {
			value: "FormData",
			configurable: true
		}
	});
	function makeEntry$1(name$1, value, filename) {
		if (typeof value === "string") {} else {
			if (!isFileLike$1(value)) value = value instanceof Blob ? new File$1([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type });
			if (filename !== void 0) {
				const options = {
					type: value.type,
					lastModified: value.lastModified
				};
				value = value instanceof NativeFile ? new File$1([value], filename, options) : new FileLike(value, filename, options);
			}
		}
		return {
			name: name$1,
			value
		};
	}
	module.exports = {
		FormData: FormData$3,
		makeEntry: makeEntry$1
	};
}));
var require_formdata_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { isUSVString, bufferToLowerCasedHeaderName: bufferToLowerCasedHeaderName$1 } = require_util$9();
	var { utf8DecodeBytes: utf8DecodeBytes$1 } = require_util$8();
	var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url();
	var { isFileLike } = require_file$1();
	var { makeEntry } = require_formdata();
	var assert$21 = require("node:assert");
	var { File: NodeFile } = require("node:buffer");
	var File = globalThis.File ?? NodeFile;
	var formDataNameBuffer = Buffer.from("form-data; name=\"");
	var filenameBuffer = Buffer.from("; filename");
	var dd = Buffer.from("--");
	var ddcrlf = Buffer.from("--\r\n");
	function isAsciiString(chars) {
		for (let i = 0; i < chars.length; ++i) if ((chars.charCodeAt(i) & -128) !== 0) return false;
		return true;
	}
	function validateBoundary(boundary) {
		const length = boundary.length;
		if (length < 27 || length > 70) return false;
		for (let i = 0; i < length; ++i) {
			const cp = boundary.charCodeAt(i);
			if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) return false;
		}
		return true;
	}
	function multipartFormDataParser$1(input, mimeType) {
		assert$21(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
		const boundaryString = mimeType.parameters.get("boundary");
		if (boundaryString === void 0) return "failure";
		const boundary = Buffer.from(`--${boundaryString}`, "utf8");
		const entryList = [];
		const position = { position: 0 };
		while (input[position.position] === 13 && input[position.position + 1] === 10) position.position += 2;
		let trailing = input.length;
		while (input[trailing - 1] === 10 && input[trailing - 2] === 13) trailing -= 2;
		if (trailing !== input.length) input = input.subarray(0, trailing);
		while (true) {
			if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) position.position += boundary.length;
			else return "failure";
			if (position.position === input.length - 2 && bufferStartsWith(input, dd, position) || position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position)) return entryList;
			if (input[position.position] !== 13 || input[position.position + 1] !== 10) return "failure";
			position.position += 2;
			const result = parseMultipartFormDataHeaders(input, position);
			if (result === "failure") return "failure";
			let { name: name$1, filename, contentType: contentType$1, encoding } = result;
			position.position += 2;
			let body;
			{
				const boundaryIndex = input.indexOf(boundary.subarray(2), position.position);
				if (boundaryIndex === -1) return "failure";
				body = input.subarray(position.position, boundaryIndex - 4);
				position.position += body.length;
				if (encoding === "base64") body = Buffer.from(body.toString(), "base64");
			}
			if (input[position.position] !== 13 || input[position.position + 1] !== 10) return "failure";
			else position.position += 2;
			let value;
			if (filename !== null) {
				contentType$1 ??= "text/plain";
				if (!isAsciiString(contentType$1)) contentType$1 = "";
				value = new File([body], filename, { type: contentType$1 });
			} else value = utf8DecodeBytes$1(Buffer.from(body));
			assert$21(isUSVString(name$1));
			assert$21(typeof value === "string" && isUSVString(value) || isFileLike(value));
			entryList.push(makeEntry(name$1, value, filename));
		}
	}
	function parseMultipartFormDataHeaders(input, position) {
		let name$1 = null;
		let filename = null;
		let contentType$1 = null;
		let encoding = null;
		while (true) {
			if (input[position.position] === 13 && input[position.position + 1] === 10) {
				if (name$1 === null) return "failure";
				return {
					name: name$1,
					filename,
					contentType: contentType$1,
					encoding
				};
			}
			let headerName = collectASequenceOfBytes((char) => char !== 10 && char !== 13 && char !== 58, input, position);
			headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32);
			if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) return "failure";
			if (input[position.position] !== 58) return "failure";
			position.position++;
			collectASequenceOfBytes((char) => char === 32 || char === 9, input, position);
			switch (bufferToLowerCasedHeaderName$1(headerName)) {
				case "content-disposition":
					name$1 = filename = null;
					if (!bufferStartsWith(input, formDataNameBuffer, position)) return "failure";
					position.position += 17;
					name$1 = parseMultipartFormDataName(input, position);
					if (name$1 === null) return "failure";
					if (bufferStartsWith(input, filenameBuffer, position)) {
						let check = position.position + filenameBuffer.length;
						if (input[check] === 42) {
							position.position += 1;
							check += 1;
						}
						if (input[check] !== 61 || input[check + 1] !== 34) return "failure";
						position.position += 12;
						filename = parseMultipartFormDataName(input, position);
						if (filename === null) return "failure";
					}
					break;
				case "content-type": {
					let headerValue = collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position);
					headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
					contentType$1 = isomorphicDecode(headerValue);
					break;
				}
				case "content-transfer-encoding": {
					let headerValue = collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position);
					headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
					encoding = isomorphicDecode(headerValue);
					break;
				}
				default: collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position);
			}
			if (input[position.position] !== 13 && input[position.position + 1] !== 10) return "failure";
			else position.position += 2;
		}
	}
	function parseMultipartFormDataName(input, position) {
		assert$21(input[position.position - 1] === 34);
		let name$1 = collectASequenceOfBytes((char) => char !== 10 && char !== 13 && char !== 34, input, position);
		if (input[position.position] !== 34) return null;
		else position.position++;
		name$1 = new TextDecoder().decode(name$1).replace(/%0A/gi, "\n").replace(/%0D/gi, "\r").replace(/%22/g, "\"");
		return name$1;
	}
	function collectASequenceOfBytes(condition, input, position) {
		let start = position.position;
		while (start < input.length && condition(input[start])) ++start;
		return input.subarray(position.position, position.position = start);
	}
	function removeChars(buf, leading, trailing, predicate) {
		let lead = 0;
		let trail = buf.length - 1;
		if (leading) while (lead < buf.length && predicate(buf[lead])) lead++;
		if (trailing) while (trail > 0 && predicate(buf[trail])) trail--;
		return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1);
	}
	function bufferStartsWith(buffer$1, start, position) {
		if (buffer$1.length < start.length) return false;
		for (let i = 0; i < start.length; i++) if (start[i] !== buffer$1[position.position + i]) return false;
		return true;
	}
	module.exports = {
		multipartFormDataParser: multipartFormDataParser$1,
		validateBoundary
	};
}));
var require_body = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var util$23 = require_util$9();
	var { ReadableStreamFrom: ReadableStreamFrom$1, isBlobLike: isBlobLike$3, isReadableStreamLike, readableStreamClose: readableStreamClose$1, createDeferredPromise: createDeferredPromise$2, fullyReadBody: fullyReadBody$1, extractMimeType: extractMimeType$1, utf8DecodeBytes } = require_util$8();
	var { FormData: FormData$2 } = require_formdata();
	var { kState: kState$7 } = require_symbols$3();
	var { webidl: webidl$12 } = require_webidl();
	var { Blob: Blob$1 } = require("node:buffer");
	var assert$20 = require("node:assert");
	var { isErrored: isErrored$1, isDisturbed: isDisturbed$2 } = require("node:stream");
	var { isArrayBuffer } = require("node:util/types");
	var { serializeAMimeType: serializeAMimeType$3 } = require_data_url();
	var { multipartFormDataParser } = require_formdata_parser();
	var random;
	try {
		const crypto$7 = require("node:crypto");
		random = (max$2) => crypto$7.randomInt(0, max$2);
	} catch {
		random = (max$2) => Math.floor(Math.random(max$2));
	}
	var textEncoder$1 = new TextEncoder();
	function noop$4() {}
	var hasFinalizationRegistry$1 = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0;
	var streamRegistry$1;
	if (hasFinalizationRegistry$1) streamRegistry$1 = new FinalizationRegistry((weakRef) => {
		const stream$7 = weakRef.deref();
		if (stream$7 && !stream$7.locked && !isDisturbed$2(stream$7) && !isErrored$1(stream$7)) stream$7.cancel("Response object has been garbage collected").catch(noop$4);
	});
	function extractBody$5(object, keepalive = false) {
		let stream$7 = null;
		if (object instanceof ReadableStream) stream$7 = object;
		else if (isBlobLike$3(object)) stream$7 = object.stream();
		else stream$7 = new ReadableStream({
			async pull(controller) {
				const buffer$1 = typeof source === "string" ? textEncoder$1.encode(source) : source;
				if (buffer$1.byteLength) controller.enqueue(buffer$1);
				queueMicrotask(() => readableStreamClose$1(controller));
			},
			start() {},
			type: "bytes"
		});
		assert$20(isReadableStreamLike(stream$7));
		let action = null;
		let source = null;
		let length = null;
		let type = null;
		if (typeof object === "string") {
			source = object;
			type = "text/plain;charset=UTF-8";
		} else if (object instanceof URLSearchParams) {
			source = object.toString();
			type = "application/x-www-form-urlencoded;charset=UTF-8";
		} else if (isArrayBuffer(object)) source = new Uint8Array(object.slice());
		else if (ArrayBuffer.isView(object)) source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength));
		else if (util$23.isFormDataLike(object)) {
			const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`;
			const prefix = `--${boundary}\r\nContent-Disposition: form-data`;
			const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
			const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n");
			const blobParts = [];
			const rn = new Uint8Array([13, 10]);
			length = 0;
			let hasUnknownSizeValue = false;
			for (const [name$1, value] of object) if (typeof value === "string") {
				const chunk$1 = textEncoder$1.encode(prefix + `; name="${escape(normalizeLinefeeds(name$1))}"\r\n\r\n${normalizeLinefeeds(value)}\r\n`);
				blobParts.push(chunk$1);
				length += chunk$1.byteLength;
			} else {
				const chunk$1 = textEncoder$1.encode(`${prefix}; name="${escape(normalizeLinefeeds(name$1))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r
Content-Type: ${value.type || "application/octet-stream"}\r\n\r\n`);
				blobParts.push(chunk$1, value, rn);
				if (typeof value.size === "number") length += chunk$1.byteLength + value.size + rn.byteLength;
				else hasUnknownSizeValue = true;
			}
			const chunk = textEncoder$1.encode(`--${boundary}--\r\n`);
			blobParts.push(chunk);
			length += chunk.byteLength;
			if (hasUnknownSizeValue) length = null;
			source = object;
			action = async function* () {
				for (const part of blobParts) if (part.stream) yield* part.stream();
				else yield part;
			};
			type = `multipart/form-data; boundary=${boundary}`;
		} else if (isBlobLike$3(object)) {
			source = object;
			length = object.size;
			if (object.type) type = object.type;
		} else if (typeof object[Symbol.asyncIterator] === "function") {
			if (keepalive) throw new TypeError("keepalive");
			if (util$23.isDisturbed(object) || object.locked) throw new TypeError("Response body object should not be disturbed or locked");
			stream$7 = object instanceof ReadableStream ? object : ReadableStreamFrom$1(object);
		}
		if (typeof source === "string" || util$23.isBuffer(source)) length = Buffer.byteLength(source);
		if (action != null) {
			let iterator$1;
			stream$7 = new ReadableStream({
				async start() {
					iterator$1 = action(object)[Symbol.asyncIterator]();
				},
				async pull(controller) {
					const { value, done } = await iterator$1.next();
					if (done) queueMicrotask(() => {
						controller.close();
						controller.byobRequest?.respond(0);
					});
					else if (!isErrored$1(stream$7)) {
						const buffer$1 = new Uint8Array(value);
						if (buffer$1.byteLength) controller.enqueue(buffer$1);
					}
					return controller.desiredSize > 0;
				},
				async cancel(reason) {
					await iterator$1.return();
				},
				type: "bytes"
			});
		}
		return [{
			stream: stream$7,
			source,
			length
		}, type];
	}
	function safelyExtractBody$1(object, keepalive = false) {
		if (object instanceof ReadableStream) {
			// istanbul ignore next
			assert$20(!util$23.isDisturbed(object), "The body has already been consumed.");
			// istanbul ignore next
			assert$20(!object.locked, "The stream is locked.");
		}
		return extractBody$5(object, keepalive);
	}
	function cloneBody$2(instance, body) {
		const [out1, out2] = body.stream.tee();
		body.stream = out1;
		return {
			stream: out2,
			length: body.length,
			source: body.source
		};
	}
	function throwIfAborted(state$1) {
		if (state$1.aborted) throw new DOMException("The operation was aborted.", "AbortError");
	}
	function bodyMixinMethods(instance) {
		return {
			blob() {
				return consumeBody(this, (bytes) => {
					let mimeType = bodyMimeType(this);
					if (mimeType === null) mimeType = "";
					else if (mimeType) mimeType = serializeAMimeType$3(mimeType);
					return new Blob$1([bytes], { type: mimeType });
				}, instance);
			},
			arrayBuffer() {
				return consumeBody(this, (bytes) => {
					return new Uint8Array(bytes).buffer;
				}, instance);
			},
			text() {
				return consumeBody(this, utf8DecodeBytes, instance);
			},
			json() {
				return consumeBody(this, parseJSONFromBytes, instance);
			},
			formData() {
				return consumeBody(this, (value) => {
					const mimeType = bodyMimeType(this);
					if (mimeType !== null) switch (mimeType.essence) {
						case "multipart/form-data": {
							const parsed = multipartFormDataParser(value, mimeType);
							if (parsed === "failure") throw new TypeError("Failed to parse body as FormData.");
							const fd = new FormData$2();
							fd[kState$7] = parsed;
							return fd;
						}
						case "application/x-www-form-urlencoded": {
							const entries = new URLSearchParams(value.toString());
							const fd = new FormData$2();
							for (const [name$1, value$1] of entries) fd.append(name$1, value$1);
							return fd;
						}
					}
					throw new TypeError("Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".");
				}, instance);
			},
			bytes() {
				return consumeBody(this, (bytes) => {
					return new Uint8Array(bytes);
				}, instance);
			}
		};
	}
	function mixinBody$2(prototype$1) {
		Object.assign(prototype$1.prototype, bodyMixinMethods(prototype$1));
	}
	async function consumeBody(object, convertBytesToJSValue, instance) {
		webidl$12.brandCheck(object, instance);
		if (bodyUnusable$2(object)) throw new TypeError("Body is unusable: Body has already been read");
		throwIfAborted(object[kState$7]);
		const promise = createDeferredPromise$2();
		const errorSteps = (error) => promise.reject(error);
		const successSteps = (data$1) => {
			try {
				promise.resolve(convertBytesToJSValue(data$1));
			} catch (e) {
				errorSteps(e);
			}
		};
		if (object[kState$7].body == null) {
			successSteps(Buffer.allocUnsafe(0));
			return promise.promise;
		}
		await fullyReadBody$1(object[kState$7].body, successSteps, errorSteps);
		return promise.promise;
	}
	function bodyUnusable$2(object) {
		const body = object[kState$7].body;
		return body != null && (body.stream.locked || util$23.isDisturbed(body.stream));
	}
	function parseJSONFromBytes(bytes) {
		return JSON.parse(utf8DecodeBytes(bytes));
	}
	function bodyMimeType(requestOrResponse) {
		const headers = requestOrResponse[kState$7].headersList;
		const mimeType = extractMimeType$1(headers);
		if (mimeType === "failure") return null;
		return mimeType;
	}
	module.exports = {
		extractBody: extractBody$5,
		safelyExtractBody: safelyExtractBody$1,
		cloneBody: cloneBody$2,
		mixinBody: mixinBody$2,
		streamRegistry: streamRegistry$1,
		hasFinalizationRegistry: hasFinalizationRegistry$1,
		bodyUnusable: bodyUnusable$2
	};
}));
var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$19 = require("node:assert");
	var util$22 = require_util$9();
	var { channels: channels$3 } = require_diagnostics();
	var timers = require_timers();
	var { RequestContentLengthMismatchError: RequestContentLengthMismatchError$1, ResponseContentLengthMismatchError, RequestAbortedError: RequestAbortedError$7, HeadersTimeoutError, HeadersOverflowError, SocketError: SocketError$3, InformationalError: InformationalError$3, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = require_errors$1();
	var { kUrl: kUrl$5, kReset: kReset$1, kClient: kClient$3, kParser, kBlocking, kRunning: kRunning$5, kPending: kPending$4, kSize: kSize$6, kWriting, kQueue: kQueue$3, kNoRef, kKeepAliveDefaultTimeout: kKeepAliveDefaultTimeout$1, kHostHeader: kHostHeader$1, kPendingIdx: kPendingIdx$2, kRunningIdx: kRunningIdx$2, kError: kError$4, kPipelining: kPipelining$1, kSocket: kSocket$1, kKeepAliveTimeoutValue: kKeepAliveTimeoutValue$1, kMaxHeadersSize: kMaxHeadersSize$1, kKeepAliveMaxTimeout: kKeepAliveMaxTimeout$1, kKeepAliveTimeoutThreshold: kKeepAliveTimeoutThreshold$1, kHeadersTimeout: kHeadersTimeout$1, kBodyTimeout: kBodyTimeout$1, kStrictContentLength: kStrictContentLength$2, kMaxRequests: kMaxRequests$1, kCounter: kCounter$1, kMaxResponseSize: kMaxResponseSize$1, kOnError: kOnError$2, kResume: kResume$3, kHTTPContext: kHTTPContext$2 } = require_symbols$4();
	var constants = require_constants$3();
	var EMPTY_BUF = Buffer.alloc(0);
	var FastBuffer$1 = Buffer[Symbol.species];
	var addListener = util$22.addListener;
	var removeAllListeners = util$22.removeAllListeners;
	var extractBody$4;
	async function lazyllhttp() {
		const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0;
		let mod;
		try {
			mod = await WebAssembly.compile(require_llhttp_simd_wasm());
		} catch (e) {
			/* istanbul ignore next */
			mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm());
		}
		return await WebAssembly.instantiate(mod, { env: {
			wasm_on_url: (p, at, len) => {
				/* istanbul ignore next */
				return 0;
			},
			wasm_on_status: (p, at, len) => {
				assert$19(currentParser.ptr === p);
				const start = at - currentBufferPtr + currentBufferRef.byteOffset;
				return currentParser.onStatus(new FastBuffer$1(currentBufferRef.buffer, start, len)) || 0;
			},
			wasm_on_message_begin: (p) => {
				assert$19(currentParser.ptr === p);
				return currentParser.onMessageBegin() || 0;
			},
			wasm_on_header_field: (p, at, len) => {
				assert$19(currentParser.ptr === p);
				const start = at - currentBufferPtr + currentBufferRef.byteOffset;
				return currentParser.onHeaderField(new FastBuffer$1(currentBufferRef.buffer, start, len)) || 0;
			},
			wasm_on_header_value: (p, at, len) => {
				assert$19(currentParser.ptr === p);
				const start = at - currentBufferPtr + currentBufferRef.byteOffset;
				return currentParser.onHeaderValue(new FastBuffer$1(currentBufferRef.buffer, start, len)) || 0;
			},
			wasm_on_headers_complete: (p, statusCode, upgrade$1, shouldKeepAlive) => {
				assert$19(currentParser.ptr === p);
				return currentParser.onHeadersComplete(statusCode, Boolean(upgrade$1), Boolean(shouldKeepAlive)) || 0;
			},
			wasm_on_body: (p, at, len) => {
				assert$19(currentParser.ptr === p);
				const start = at - currentBufferPtr + currentBufferRef.byteOffset;
				return currentParser.onBody(new FastBuffer$1(currentBufferRef.buffer, start, len)) || 0;
			},
			wasm_on_message_complete: (p) => {
				assert$19(currentParser.ptr === p);
				return currentParser.onMessageComplete() || 0;
			}
		} });
	}
	var llhttpInstance = null;
	var llhttpPromise = lazyllhttp();
	llhttpPromise.catch();
	var currentParser = null;
	var currentBufferRef = null;
	var currentBufferSize = 0;
	var currentBufferPtr = null;
	var USE_NATIVE_TIMER = 0;
	var USE_FAST_TIMER = 1;
	var TIMEOUT_HEADERS = 2 | USE_FAST_TIMER;
	var TIMEOUT_BODY = 4 | USE_FAST_TIMER;
	var TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER;
	var Parser = class {
		constructor(client, socket, { exports: exports$1 }) {
			assert$19(Number.isFinite(client[kMaxHeadersSize$1]) && client[kMaxHeadersSize$1] > 0);
			this.llhttp = exports$1;
			this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE);
			this.client = client;
			this.socket = socket;
			this.timeout = null;
			this.timeoutValue = null;
			this.timeoutType = null;
			this.statusCode = null;
			this.statusText = "";
			this.upgrade = false;
			this.headers = [];
			this.headersSize = 0;
			this.headersMaxSize = client[kMaxHeadersSize$1];
			this.shouldKeepAlive = false;
			this.paused = false;
			this.resume = this.resume.bind(this);
			this.bytesRead = 0;
			this.keepAlive = "";
			this.contentLength = "";
			this.connection = "";
			this.maxResponseSize = client[kMaxResponseSize$1];
		}
		setTimeout(delay$2, type) {
			if (delay$2 !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) {
				if (this.timeout) {
					timers.clearTimeout(this.timeout);
					this.timeout = null;
				}
				if (delay$2) if (type & USE_FAST_TIMER) this.timeout = timers.setFastTimeout(onParserTimeout, delay$2, new WeakRef(this));
				else {
					this.timeout = setTimeout(onParserTimeout, delay$2, new WeakRef(this));
					this.timeout.unref();
				}
				this.timeoutValue = delay$2;
			} else if (this.timeout) {
				// istanbul ignore else: only for jest
				if (this.timeout.refresh) this.timeout.refresh();
			}
			this.timeoutType = type;
		}
		resume() {
			if (this.socket.destroyed || !this.paused) return;
			assert$19(this.ptr != null);
			assert$19(currentParser == null);
			this.llhttp.llhttp_resume(this.ptr);
			assert$19(this.timeoutType === TIMEOUT_BODY);
			if (this.timeout) {
				// istanbul ignore else: only for jest
				if (this.timeout.refresh) this.timeout.refresh();
			}
			this.paused = false;
			this.execute(this.socket.read() || EMPTY_BUF);
			this.readMore();
		}
		readMore() {
			while (!this.paused && this.ptr) {
				const chunk = this.socket.read();
				if (chunk === null) break;
				this.execute(chunk);
			}
		}
		execute(data$1) {
			assert$19(this.ptr != null);
			assert$19(currentParser == null);
			assert$19(!this.paused);
			const { socket, llhttp } = this;
			if (data$1.length > currentBufferSize) {
				if (currentBufferPtr) llhttp.free(currentBufferPtr);
				currentBufferSize = Math.ceil(data$1.length / 4096) * 4096;
				currentBufferPtr = llhttp.malloc(currentBufferSize);
			}
			new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data$1);
			try {
				let ret;
				try {
					currentBufferRef = data$1;
					currentParser = this;
					ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data$1.length);
				} catch (err) {
					/* istanbul ignore next: difficult to make a test case for */
					throw err;
				} finally {
					currentParser = null;
					currentBufferRef = null;
				}
				const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr;
				if (ret === constants.ERROR.PAUSED_UPGRADE) this.onUpgrade(data$1.slice(offset));
				else if (ret === constants.ERROR.PAUSED) {
					this.paused = true;
					socket.unshift(data$1.slice(offset));
				} else if (ret !== constants.ERROR.OK) {
					const ptr = llhttp.llhttp_get_error_reason(this.ptr);
					let message = "";
					/* istanbul ignore else: difficult to make a test case for */
					if (ptr) {
						const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
						message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
					}
					throw new HTTPParserError(message, constants.ERROR[ret], data$1.slice(offset));
				}
			} catch (err) {
				util$22.destroy(socket, err);
			}
		}
		destroy() {
			assert$19(this.ptr != null);
			assert$19(currentParser == null);
			this.llhttp.llhttp_free(this.ptr);
			this.ptr = null;
			this.timeout && timers.clearTimeout(this.timeout);
			this.timeout = null;
			this.timeoutValue = null;
			this.timeoutType = null;
			this.paused = false;
		}
		onStatus(buf) {
			this.statusText = buf.toString();
		}
		onMessageBegin() {
			const { socket, client } = this;
			/* istanbul ignore next: difficult to make a test case for */
			if (socket.destroyed) return -1;
			const request$1 = client[kQueue$3][client[kRunningIdx$2]];
			if (!request$1) return -1;
			request$1.onResponseStarted();
		}
		onHeaderField(buf) {
			const len = this.headers.length;
			if ((len & 1) === 0) this.headers.push(buf);
			else this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
			this.trackHeader(buf.length);
		}
		onHeaderValue(buf) {
			let len = this.headers.length;
			if ((len & 1) === 1) {
				this.headers.push(buf);
				len += 1;
			} else this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
			const key = this.headers[len - 2];
			if (key.length === 10) {
				const headerName = util$22.bufferToLowerCasedHeaderName(key);
				if (headerName === "keep-alive") this.keepAlive += buf.toString();
				else if (headerName === "connection") this.connection += buf.toString();
			} else if (key.length === 14 && util$22.bufferToLowerCasedHeaderName(key) === "content-length") this.contentLength += buf.toString();
			this.trackHeader(buf.length);
		}
		trackHeader(len) {
			this.headersSize += len;
			if (this.headersSize >= this.headersMaxSize) util$22.destroy(this.socket, new HeadersOverflowError());
		}
		onUpgrade(head) {
			const { upgrade: upgrade$1, client, socket, headers, statusCode } = this;
			assert$19(upgrade$1);
			assert$19(client[kSocket$1] === socket);
			assert$19(!socket.destroyed);
			assert$19(!this.paused);
			assert$19((headers.length & 1) === 0);
			const request$1 = client[kQueue$3][client[kRunningIdx$2]];
			assert$19(request$1);
			assert$19(request$1.upgrade || request$1.method === "CONNECT");
			this.statusCode = null;
			this.statusText = "";
			this.shouldKeepAlive = null;
			this.headers = [];
			this.headersSize = 0;
			socket.unshift(head);
			socket[kParser].destroy();
			socket[kParser] = null;
			socket[kClient$3] = null;
			socket[kError$4] = null;
			removeAllListeners(socket);
			client[kSocket$1] = null;
			client[kHTTPContext$2] = null;
			client[kQueue$3][client[kRunningIdx$2]++] = null;
			client.emit("disconnect", client[kUrl$5], [client], new InformationalError$3("upgrade"));
			try {
				request$1.onUpgrade(statusCode, headers, socket);
			} catch (err) {
				util$22.destroy(socket, err);
			}
			client[kResume$3]();
		}
		onHeadersComplete(statusCode, upgrade$1, shouldKeepAlive) {
			const { client, socket, headers, statusText } = this;
			/* istanbul ignore next: difficult to make a test case for */
			if (socket.destroyed) return -1;
			const request$1 = client[kQueue$3][client[kRunningIdx$2]];
			/* istanbul ignore next: difficult to make a test case for */
			if (!request$1) return -1;
			assert$19(!this.upgrade);
			assert$19(this.statusCode < 200);
			if (statusCode === 100) {
				util$22.destroy(socket, new SocketError$3("bad response", util$22.getSocketInfo(socket)));
				return -1;
			}
			if (upgrade$1 && !request$1.upgrade) {
				util$22.destroy(socket, new SocketError$3("bad upgrade", util$22.getSocketInfo(socket)));
				return -1;
			}
			assert$19(this.timeoutType === TIMEOUT_HEADERS);
			this.statusCode = statusCode;
			this.shouldKeepAlive = shouldKeepAlive || request$1.method === "HEAD" && !socket[kReset$1] && this.connection.toLowerCase() === "keep-alive";
			if (this.statusCode >= 200) {
				const bodyTimeout = request$1.bodyTimeout != null ? request$1.bodyTimeout : client[kBodyTimeout$1];
				this.setTimeout(bodyTimeout, TIMEOUT_BODY);
			} else if (this.timeout) {
				// istanbul ignore else: only for jest
				if (this.timeout.refresh) this.timeout.refresh();
			}
			if (request$1.method === "CONNECT") {
				assert$19(client[kRunning$5] === 1);
				this.upgrade = true;
				return 2;
			}
			if (upgrade$1) {
				assert$19(client[kRunning$5] === 1);
				this.upgrade = true;
				return 2;
			}
			assert$19((this.headers.length & 1) === 0);
			this.headers = [];
			this.headersSize = 0;
			if (this.shouldKeepAlive && client[kPipelining$1]) {
				const keepAliveTimeout = this.keepAlive ? util$22.parseKeepAliveTimeout(this.keepAlive) : null;
				if (keepAliveTimeout != null) {
					const timeout = Math.min(keepAliveTimeout - client[kKeepAliveTimeoutThreshold$1], client[kKeepAliveMaxTimeout$1]);
					if (timeout <= 0) socket[kReset$1] = true;
					else client[kKeepAliveTimeoutValue$1] = timeout;
				} else client[kKeepAliveTimeoutValue$1] = client[kKeepAliveDefaultTimeout$1];
			} else socket[kReset$1] = true;
			const pause = request$1.onHeaders(statusCode, headers, this.resume, statusText) === false;
			if (request$1.aborted) return -1;
			if (request$1.method === "HEAD") return 1;
			if (statusCode < 200) return 1;
			if (socket[kBlocking]) {
				socket[kBlocking] = false;
				client[kResume$3]();
			}
			return pause ? constants.ERROR.PAUSED : 0;
		}
		onBody(buf) {
			const { client, socket, statusCode, maxResponseSize } = this;
			if (socket.destroyed) return -1;
			const request$1 = client[kQueue$3][client[kRunningIdx$2]];
			assert$19(request$1);
			assert$19(this.timeoutType === TIMEOUT_BODY);
			if (this.timeout) {
				// istanbul ignore else: only for jest
				if (this.timeout.refresh) this.timeout.refresh();
			}
			assert$19(statusCode >= 200);
			if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
				util$22.destroy(socket, new ResponseExceededMaxSizeError());
				return -1;
			}
			this.bytesRead += buf.length;
			if (request$1.onData(buf) === false) return constants.ERROR.PAUSED;
		}
		onMessageComplete() {
			const { client, socket, statusCode, upgrade: upgrade$1, headers, contentLength, bytesRead, shouldKeepAlive } = this;
			if (socket.destroyed && (!statusCode || shouldKeepAlive)) return -1;
			if (upgrade$1) return;
			assert$19(statusCode >= 100);
			assert$19((this.headers.length & 1) === 0);
			const request$1 = client[kQueue$3][client[kRunningIdx$2]];
			assert$19(request$1);
			this.statusCode = null;
			this.statusText = "";
			this.bytesRead = 0;
			this.contentLength = "";
			this.keepAlive = "";
			this.connection = "";
			this.headers = [];
			this.headersSize = 0;
			if (statusCode < 200) return;
			/* istanbul ignore next: should be handled by llhttp? */
			if (request$1.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) {
				util$22.destroy(socket, new ResponseContentLengthMismatchError());
				return -1;
			}
			request$1.onComplete(headers);
			client[kQueue$3][client[kRunningIdx$2]++] = null;
			if (socket[kWriting]) {
				assert$19(client[kRunning$5] === 0);
				util$22.destroy(socket, new InformationalError$3("reset"));
				return constants.ERROR.PAUSED;
			} else if (!shouldKeepAlive) {
				util$22.destroy(socket, new InformationalError$3("reset"));
				return constants.ERROR.PAUSED;
			} else if (socket[kReset$1] && client[kRunning$5] === 0) {
				util$22.destroy(socket, new InformationalError$3("reset"));
				return constants.ERROR.PAUSED;
			} else if (client[kPipelining$1] == null || client[kPipelining$1] === 1) setImmediate(() => client[kResume$3]());
			else client[kResume$3]();
		}
	};
	function onParserTimeout(parser) {
		const { socket, timeoutType, client, paused } = parser.deref();
		/* istanbul ignore else */
		if (timeoutType === TIMEOUT_HEADERS) {
			if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning$5] > 1) {
				assert$19(!paused, "cannot be paused while waiting for headers");
				util$22.destroy(socket, new HeadersTimeoutError());
			}
		} else if (timeoutType === TIMEOUT_BODY) {
			if (!paused) util$22.destroy(socket, new BodyTimeoutError());
		} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
			assert$19(client[kRunning$5] === 0 && client[kKeepAliveTimeoutValue$1]);
			util$22.destroy(socket, new InformationalError$3("socket idle timeout"));
		}
	}
	async function connectH1$1(client, socket) {
		client[kSocket$1] = socket;
		if (!llhttpInstance) {
			llhttpInstance = await llhttpPromise;
			llhttpPromise = null;
		}
		socket[kNoRef] = false;
		socket[kWriting] = false;
		socket[kReset$1] = false;
		socket[kBlocking] = false;
		socket[kParser] = new Parser(client, socket, llhttpInstance);
		addListener(socket, "error", function(err) {
			assert$19(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
			const parser = this[kParser];
			if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) {
				parser.onMessageComplete();
				return;
			}
			this[kError$4] = err;
			this[kClient$3][kOnError$2](err);
		});
		addListener(socket, "readable", function() {
			const parser = this[kParser];
			if (parser) parser.readMore();
		});
		addListener(socket, "end", function() {
			const parser = this[kParser];
			if (parser.statusCode && !parser.shouldKeepAlive) {
				parser.onMessageComplete();
				return;
			}
			util$22.destroy(this, new SocketError$3("other side closed", util$22.getSocketInfo(this)));
		});
		addListener(socket, "close", function() {
			const client$1 = this[kClient$3];
			const parser = this[kParser];
			if (parser) {
				if (!this[kError$4] && parser.statusCode && !parser.shouldKeepAlive) parser.onMessageComplete();
				this[kParser].destroy();
				this[kParser] = null;
			}
			const err = this[kError$4] || new SocketError$3("closed", util$22.getSocketInfo(this));
			client$1[kSocket$1] = null;
			client$1[kHTTPContext$2] = null;
			if (client$1.destroyed) {
				assert$19(client$1[kPending$4] === 0);
				const requests = client$1[kQueue$3].splice(client$1[kRunningIdx$2]);
				for (let i = 0; i < requests.length; i++) {
					const request$1 = requests[i];
					util$22.errorRequest(client$1, request$1, err);
				}
			} else if (client$1[kRunning$5] > 0 && err.code !== "UND_ERR_INFO") {
				const request$1 = client$1[kQueue$3][client$1[kRunningIdx$2]];
				client$1[kQueue$3][client$1[kRunningIdx$2]++] = null;
				util$22.errorRequest(client$1, request$1, err);
			}
			client$1[kPendingIdx$2] = client$1[kRunningIdx$2];
			assert$19(client$1[kRunning$5] === 0);
			client$1.emit("disconnect", client$1[kUrl$5], [client$1], err);
			client$1[kResume$3]();
		});
		let closed = false;
		socket.on("close", () => {
			closed = true;
		});
		return {
			version: "h1",
			defaultPipelining: 1,
			write(...args) {
				return writeH1(client, ...args);
			},
			resume() {
				resumeH1(client);
			},
			destroy(err, callback) {
				if (closed) queueMicrotask(callback);
				else socket.destroy(err).on("close", callback);
			},
			get destroyed() {
				return socket.destroyed;
			},
			busy(request$1) {
				if (socket[kWriting] || socket[kReset$1] || socket[kBlocking]) return true;
				if (request$1) {
					if (client[kRunning$5] > 0 && !request$1.idempotent) return true;
					if (client[kRunning$5] > 0 && (request$1.upgrade || request$1.method === "CONNECT")) return true;
					if (client[kRunning$5] > 0 && util$22.bodyLength(request$1.body) !== 0 && (util$22.isStream(request$1.body) || util$22.isAsyncIterable(request$1.body) || util$22.isFormDataLike(request$1.body))) return true;
				}
				return false;
			}
		};
	}
	function resumeH1(client) {
		const socket = client[kSocket$1];
		if (socket && !socket.destroyed) {
			if (client[kSize$6] === 0) {
				if (!socket[kNoRef] && socket.unref) {
					socket.unref();
					socket[kNoRef] = true;
				}
			} else if (socket[kNoRef] && socket.ref) {
				socket.ref();
				socket[kNoRef] = false;
			}
			if (client[kSize$6] === 0) {
				if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) socket[kParser].setTimeout(client[kKeepAliveTimeoutValue$1], TIMEOUT_KEEP_ALIVE);
			} else if (client[kRunning$5] > 0 && socket[kParser].statusCode < 200) {
				if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
					const request$1 = client[kQueue$3][client[kRunningIdx$2]];
					const headersTimeout = request$1.headersTimeout != null ? request$1.headersTimeout : client[kHeadersTimeout$1];
					socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS);
				}
			}
		}
	}
	function shouldSendContentLength$1(method) {
		return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
	}
	function writeH1(client, request$1) {
		const { method, path: path$1, host, upgrade: upgrade$1, blocking, reset } = request$1;
		let { body, headers, contentLength } = request$1;
		const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
		if (util$22.isFormDataLike(body)) {
			if (!extractBody$4) extractBody$4 = require_body().extractBody;
			const [bodyStream, contentType$1] = extractBody$4(body);
			if (request$1.contentType == null) headers.push("content-type", contentType$1);
			body = bodyStream.stream;
			contentLength = bodyStream.length;
		} else if (util$22.isBlobLike(body) && request$1.contentType == null && body.type) headers.push("content-type", body.type);
		if (body && typeof body.read === "function") body.read(0);
		const bodyLength$1 = util$22.bodyLength(body);
		contentLength = bodyLength$1 ?? contentLength;
		if (contentLength === null) contentLength = request$1.contentLength;
		if (contentLength === 0 && !expectsPayload) contentLength = null;
		if (shouldSendContentLength$1(method) && contentLength > 0 && request$1.contentLength !== null && request$1.contentLength !== contentLength) {
			if (client[kStrictContentLength$2]) {
				util$22.errorRequest(client, request$1, new RequestContentLengthMismatchError$1());
				return false;
			}
			process.emitWarning(new RequestContentLengthMismatchError$1());
		}
		const socket = client[kSocket$1];
		const abort$4 = (err) => {
			if (request$1.aborted || request$1.completed) return;
			util$22.errorRequest(client, request$1, err || new RequestAbortedError$7());
			util$22.destroy(body);
			util$22.destroy(socket, new InformationalError$3("aborted"));
		};
		try {
			request$1.onConnect(abort$4);
		} catch (err) {
			util$22.errorRequest(client, request$1, err);
		}
		if (request$1.aborted) return false;
		if (method === "HEAD") socket[kReset$1] = true;
		if (upgrade$1 || method === "CONNECT") socket[kReset$1] = true;
		if (reset != null) socket[kReset$1] = reset;
		if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
		if (blocking) socket[kBlocking] = true;
		let header = `${method} ${path$1} HTTP/1.1\r\n`;
		if (typeof host === "string") header += `host: ${host}\r\n`;
		else header += client[kHostHeader$1];
		if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
		else if (client[kPipelining$1] && !socket[kReset$1]) header += "connection: keep-alive\r\n";
		else header += "connection: close\r\n";
		if (Array.isArray(headers)) for (let n$1 = 0; n$1 < headers.length; n$1 += 2) {
			const key = headers[n$1 + 0];
			const val = headers[n$1 + 1];
			if (Array.isArray(val)) for (let i = 0; i < val.length; i++) header += `${key}: ${val[i]}\r\n`;
			else header += `${key}: ${val}\r\n`;
		}
		if (channels$3.sendHeaders.hasSubscribers) channels$3.sendHeaders.publish({
			request: request$1,
			headers: header,
			socket
		});
		/* istanbul ignore else: assertion */
		if (!body || bodyLength$1 === 0) writeBuffer$1(abort$4, null, client, request$1, socket, contentLength, header, expectsPayload);
		else if (util$22.isBuffer(body)) writeBuffer$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload);
		else if (util$22.isBlobLike(body)) if (typeof body.stream === "function") writeIterable$1(abort$4, body.stream(), client, request$1, socket, contentLength, header, expectsPayload);
		else writeBlob$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload);
		else if (util$22.isStream(body)) writeStream$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload);
		else if (util$22.isIterable(body)) writeIterable$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload);
		else assert$19(false);
		return true;
	}
	function writeStream$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload) {
		assert$19(contentLength !== 0 || client[kRunning$5] === 0, "stream body cannot be pipelined");
		let finished$2 = false;
		const writer = new AsyncWriter({
			abort: abort$4,
			socket,
			request: request$1,
			contentLength,
			client,
			expectsPayload,
			header
		});
		const onData = function(chunk) {
			if (finished$2) return;
			try {
				if (!writer.write(chunk) && this.pause) this.pause();
			} catch (err) {
				util$22.destroy(this, err);
			}
		};
		const onDrain = function() {
			if (finished$2) return;
			if (body.resume) body.resume();
		};
		const onClose = function() {
			queueMicrotask(() => {
				body.removeListener("error", onFinished);
			});
			if (!finished$2) {
				const err = new RequestAbortedError$7();
				queueMicrotask(() => onFinished(err));
			}
		};
		const onFinished = function(err) {
			if (finished$2) return;
			finished$2 = true;
			assert$19(socket.destroyed || socket[kWriting] && client[kRunning$5] <= 1);
			socket.off("drain", onDrain).off("error", onFinished);
			body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
			if (!err) try {
				writer.end();
			} catch (er) {
				err = er;
			}
			writer.destroy(err);
			if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) util$22.destroy(body, err);
			else util$22.destroy(body);
		};
		body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose);
		if (body.resume) body.resume();
		socket.on("drain", onDrain).on("error", onFinished);
		if (body.errorEmitted ?? body.errored) setImmediate(() => onFinished(body.errored));
		else if (body.endEmitted ?? body.readableEnded) setImmediate(() => onFinished(null));
		if (body.closeEmitted ?? body.closed) setImmediate(onClose);
	}
	function writeBuffer$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload) {
		try {
			if (!body) if (contentLength === 0) socket.write(`${header}content-length: 0\r\n\r\n`, "latin1");
			else {
				assert$19(contentLength === null, "no body must not have content length");
				socket.write(`${header}\r\n`, "latin1");
			}
			else if (util$22.isBuffer(body)) {
				assert$19(contentLength === body.byteLength, "buffer body must have content length");
				socket.cork();
				socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, "latin1");
				socket.write(body);
				socket.uncork();
				request$1.onBodySent(body);
				if (!expectsPayload && request$1.reset !== false) socket[kReset$1] = true;
			}
			request$1.onRequestSent();
			client[kResume$3]();
		} catch (err) {
			abort$4(err);
		}
	}
	async function writeBlob$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload) {
		assert$19(contentLength === body.size, "blob body must have content length");
		try {
			if (contentLength != null && contentLength !== body.size) throw new RequestContentLengthMismatchError$1();
			const buffer$1 = Buffer.from(await body.arrayBuffer());
			socket.cork();
			socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, "latin1");
			socket.write(buffer$1);
			socket.uncork();
			request$1.onBodySent(buffer$1);
			request$1.onRequestSent();
			if (!expectsPayload && request$1.reset !== false) socket[kReset$1] = true;
			client[kResume$3]();
		} catch (err) {
			abort$4(err);
		}
	}
	async function writeIterable$1(abort$4, body, client, request$1, socket, contentLength, header, expectsPayload) {
		assert$19(contentLength !== 0 || client[kRunning$5] === 0, "iterator body cannot be pipelined");
		let callback = null;
		function onDrain() {
			if (callback) {
				const cb = callback;
				callback = null;
				cb();
			}
		}
		const waitForDrain = () => new Promise((resolve, reject) => {
			assert$19(callback === null);
			if (socket[kError$4]) reject(socket[kError$4]);
			else callback = resolve;
		});
		socket.on("close", onDrain).on("drain", onDrain);
		const writer = new AsyncWriter({
			abort: abort$4,
			socket,
			request: request$1,
			contentLength,
			client,
			expectsPayload,
			header
		});
		try {
			for await (const chunk of body) {
				if (socket[kError$4]) throw socket[kError$4];
				if (!writer.write(chunk)) await waitForDrain();
			}
			writer.end();
		} catch (err) {
			writer.destroy(err);
		} finally {
			socket.off("close", onDrain).off("drain", onDrain);
		}
	}
	var AsyncWriter = class {
		constructor({ abort: abort$4, socket, request: request$1, contentLength, client, expectsPayload, header }) {
			this.socket = socket;
			this.request = request$1;
			this.contentLength = contentLength;
			this.client = client;
			this.bytesWritten = 0;
			this.expectsPayload = expectsPayload;
			this.header = header;
			this.abort = abort$4;
			socket[kWriting] = true;
		}
		write(chunk) {
			const { socket, request: request$1, contentLength, client, bytesWritten, expectsPayload, header } = this;
			if (socket[kError$4]) throw socket[kError$4];
			if (socket.destroyed) return false;
			const len = Buffer.byteLength(chunk);
			if (!len) return true;
			if (contentLength !== null && bytesWritten + len > contentLength) {
				if (client[kStrictContentLength$2]) throw new RequestContentLengthMismatchError$1();
				process.emitWarning(new RequestContentLengthMismatchError$1());
			}
			socket.cork();
			if (bytesWritten === 0) {
				if (!expectsPayload && request$1.reset !== false) socket[kReset$1] = true;
				if (contentLength === null) socket.write(`${header}transfer-encoding: chunked\r\n`, "latin1");
				else socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, "latin1");
			}
			if (contentLength === null) socket.write(`\r\n${len.toString(16)}\r\n`, "latin1");
			this.bytesWritten += len;
			const ret = socket.write(chunk);
			socket.uncork();
			request$1.onBodySent(chunk);
			if (!ret) {
				if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
					// istanbul ignore else: only for jest
					if (socket[kParser].timeout.refresh) socket[kParser].timeout.refresh();
				}
			}
			return ret;
		}
		end() {
			const { socket, contentLength, client, bytesWritten, expectsPayload, header, request: request$1 } = this;
			request$1.onRequestSent();
			socket[kWriting] = false;
			if (socket[kError$4]) throw socket[kError$4];
			if (socket.destroyed) return;
			if (bytesWritten === 0) if (expectsPayload) socket.write(`${header}content-length: 0\r\n\r\n`, "latin1");
			else socket.write(`${header}\r\n`, "latin1");
			else if (contentLength === null) socket.write("\r\n0\r\n\r\n", "latin1");
			if (contentLength !== null && bytesWritten !== contentLength) if (client[kStrictContentLength$2]) throw new RequestContentLengthMismatchError$1();
			else process.emitWarning(new RequestContentLengthMismatchError$1());
			if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
				// istanbul ignore else: only for jest
				if (socket[kParser].timeout.refresh) socket[kParser].timeout.refresh();
			}
			client[kResume$3]();
		}
		destroy(err) {
			const { socket, client, abort: abort$4 } = this;
			socket[kWriting] = false;
			if (err) {
				assert$19(client[kRunning$5] <= 1, "pipeline should only contain this request");
				abort$4(err);
			}
		}
	};
	module.exports = connectH1$1;
}));
var require_client_h2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$18 = require("node:assert");
	var { pipeline: pipeline$3 } = require("node:stream");
	var util$21 = require_util$9();
	var { RequestContentLengthMismatchError, RequestAbortedError: RequestAbortedError$6, SocketError: SocketError$2, InformationalError: InformationalError$2 } = require_errors$1();
	var { kUrl: kUrl$4, kReset, kClient: kClient$2, kRunning: kRunning$4, kPending: kPending$3, kQueue: kQueue$2, kPendingIdx: kPendingIdx$1, kRunningIdx: kRunningIdx$1, kError: kError$3, kSocket, kStrictContentLength: kStrictContentLength$1, kOnError: kOnError$1, kMaxConcurrentStreams: kMaxConcurrentStreams$1, kHTTP2Session, kResume: kResume$2, kSize: kSize$5, kHTTPContext: kHTTPContext$1 } = require_symbols$4();
	var kOpenStreams = Symbol("open streams");
	var extractBody$3;
	var h2ExperimentalWarned = false;
	var http2$1;
	try {
		http2$1 = require("node:http2");
	} catch {
		http2$1 = { constants: {} };
	}
	var { constants: { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_SCHEME, HTTP2_HEADER_CONTENT_LENGTH, HTTP2_HEADER_EXPECT, HTTP2_HEADER_STATUS } } = http2$1;
	function parseH2Headers(headers) {
		const result = [];
		for (const [name$1, value] of Object.entries(headers)) if (Array.isArray(value)) for (const subvalue of value) result.push(Buffer.from(name$1), Buffer.from(subvalue));
		else result.push(Buffer.from(name$1), Buffer.from(value));
		return result;
	}
	async function connectH2$1(client, socket) {
		client[kSocket] = socket;
		if (!h2ExperimentalWarned) {
			h2ExperimentalWarned = true;
			process.emitWarning("H2 support is experimental, expect them to change at any time.", { code: "UNDICI-H2" });
		}
		const session = http2$1.connect(client[kUrl$4], {
			createConnection: () => socket,
			peerMaxConcurrentStreams: client[kMaxConcurrentStreams$1]
		});
		session[kOpenStreams] = 0;
		session[kClient$2] = client;
		session[kSocket] = socket;
		util$21.addListener(session, "error", onHttp2SessionError);
		util$21.addListener(session, "frameError", onHttp2FrameError);
		util$21.addListener(session, "end", onHttp2SessionEnd);
		util$21.addListener(session, "goaway", onHTTP2GoAway);
		util$21.addListener(session, "close", function() {
			const { [kClient$2]: client$1 } = this;
			const { [kSocket]: socket$1 } = client$1;
			const err = this[kSocket][kError$3] || this[kError$3] || new SocketError$2("closed", util$21.getSocketInfo(socket$1));
			client$1[kHTTP2Session] = null;
			if (client$1.destroyed) {
				assert$18(client$1[kPending$3] === 0);
				const requests = client$1[kQueue$2].splice(client$1[kRunningIdx$1]);
				for (let i = 0; i < requests.length; i++) {
					const request$1 = requests[i];
					util$21.errorRequest(client$1, request$1, err);
				}
			}
		});
		session.unref();
		client[kHTTP2Session] = session;
		socket[kHTTP2Session] = session;
		util$21.addListener(socket, "error", function(err) {
			assert$18(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
			this[kError$3] = err;
			this[kClient$2][kOnError$1](err);
		});
		util$21.addListener(socket, "end", function() {
			util$21.destroy(this, new SocketError$2("other side closed", util$21.getSocketInfo(this)));
		});
		util$21.addListener(socket, "close", function() {
			const err = this[kError$3] || new SocketError$2("closed", util$21.getSocketInfo(this));
			client[kSocket] = null;
			if (this[kHTTP2Session] != null) this[kHTTP2Session].destroy(err);
			client[kPendingIdx$1] = client[kRunningIdx$1];
			assert$18(client[kRunning$4] === 0);
			client.emit("disconnect", client[kUrl$4], [client], err);
			client[kResume$2]();
		});
		let closed = false;
		socket.on("close", () => {
			closed = true;
		});
		return {
			version: "h2",
			defaultPipelining: Infinity,
			write(...args) {
				return writeH2(client, ...args);
			},
			resume() {
				resumeH2(client);
			},
			destroy(err, callback) {
				if (closed) queueMicrotask(callback);
				else socket.destroy(err).on("close", callback);
			},
			get destroyed() {
				return socket.destroyed;
			},
			busy() {
				return false;
			}
		};
	}
	function resumeH2(client) {
		const socket = client[kSocket];
		if (socket?.destroyed === false) if (client[kSize$5] === 0 && client[kMaxConcurrentStreams$1] === 0) {
			socket.unref();
			client[kHTTP2Session].unref();
		} else {
			socket.ref();
			client[kHTTP2Session].ref();
		}
	}
	function onHttp2SessionError(err) {
		assert$18(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
		this[kSocket][kError$3] = err;
		this[kClient$2][kOnError$1](err);
	}
	function onHttp2FrameError(type, code, id) {
		if (id === 0) {
			const err = new InformationalError$2(`HTTP/2: "frameError" received - type ${type}, code ${code}`);
			this[kSocket][kError$3] = err;
			this[kClient$2][kOnError$1](err);
		}
	}
	function onHttp2SessionEnd() {
		const err = new SocketError$2("other side closed", util$21.getSocketInfo(this[kSocket]));
		this.destroy(err);
		util$21.destroy(this[kSocket], err);
	}
	function onHTTP2GoAway(code) {
		const err = this[kError$3] || new SocketError$2(`HTTP/2: "GOAWAY" frame received with code ${code}`, util$21.getSocketInfo(this));
		const client = this[kClient$2];
		client[kSocket] = null;
		client[kHTTPContext$1] = null;
		if (this[kHTTP2Session] != null) {
			this[kHTTP2Session].destroy(err);
			this[kHTTP2Session] = null;
		}
		util$21.destroy(this[kSocket], err);
		if (client[kRunningIdx$1] < client[kQueue$2].length) {
			const request$1 = client[kQueue$2][client[kRunningIdx$1]];
			client[kQueue$2][client[kRunningIdx$1]++] = null;
			util$21.errorRequest(client, request$1, err);
			client[kPendingIdx$1] = client[kRunningIdx$1];
		}
		assert$18(client[kRunning$4] === 0);
		client.emit("disconnect", client[kUrl$4], [client], err);
		client[kResume$2]();
	}
	function shouldSendContentLength(method) {
		return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
	}
	function writeH2(client, request$1) {
		const session = client[kHTTP2Session];
		const { method, path: path$1, host, upgrade: upgrade$1, expectContinue, signal, headers: reqHeaders } = request$1;
		let { body } = request$1;
		if (upgrade$1) {
			util$21.errorRequest(client, request$1, /* @__PURE__ */ new Error("Upgrade not supported for H2"));
			return false;
		}
		const headers = {};
		for (let n$1 = 0; n$1 < reqHeaders.length; n$1 += 2) {
			const key = reqHeaders[n$1 + 0];
			const val = reqHeaders[n$1 + 1];
			if (Array.isArray(val)) for (let i = 0; i < val.length; i++) if (headers[key]) headers[key] += `,${val[i]}`;
			else headers[key] = val[i];
			else headers[key] = val;
		}
		let stream$7;
		const { hostname, port } = client[kUrl$4];
		headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`;
		headers[HTTP2_HEADER_METHOD] = method;
		const abort$4 = (err) => {
			if (request$1.aborted || request$1.completed) return;
			err = err || new RequestAbortedError$6();
			util$21.errorRequest(client, request$1, err);
			if (stream$7 != null) util$21.destroy(stream$7, err);
			util$21.destroy(body, err);
			client[kQueue$2][client[kRunningIdx$1]++] = null;
			client[kResume$2]();
		};
		try {
			request$1.onConnect(abort$4);
		} catch (err) {
			util$21.errorRequest(client, request$1, err);
		}
		if (request$1.aborted) return false;
		if (method === "CONNECT") {
			session.ref();
			stream$7 = session.request(headers, {
				endStream: false,
				signal
			});
			if (stream$7.id && !stream$7.pending) {
				request$1.onUpgrade(null, null, stream$7);
				++session[kOpenStreams];
				client[kQueue$2][client[kRunningIdx$1]++] = null;
			} else stream$7.once("ready", () => {
				request$1.onUpgrade(null, null, stream$7);
				++session[kOpenStreams];
				client[kQueue$2][client[kRunningIdx$1]++] = null;
			});
			stream$7.once("close", () => {
				session[kOpenStreams] -= 1;
				if (session[kOpenStreams] === 0) session.unref();
			});
			return true;
		}
		headers[HTTP2_HEADER_PATH] = path$1;
		headers[HTTP2_HEADER_SCHEME] = "https";
		const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
		if (body && typeof body.read === "function") body.read(0);
		let contentLength = util$21.bodyLength(body);
		if (util$21.isFormDataLike(body)) {
			extractBody$3 ??= require_body().extractBody;
			const [bodyStream, contentType$1] = extractBody$3(body);
			headers["content-type"] = contentType$1;
			body = bodyStream.stream;
			contentLength = bodyStream.length;
		}
		if (contentLength == null) contentLength = request$1.contentLength;
		if (contentLength === 0 || !expectsPayload) contentLength = null;
		if (shouldSendContentLength(method) && contentLength > 0 && request$1.contentLength != null && request$1.contentLength !== contentLength) {
			if (client[kStrictContentLength$1]) {
				util$21.errorRequest(client, request$1, new RequestContentLengthMismatchError());
				return false;
			}
			process.emitWarning(new RequestContentLengthMismatchError());
		}
		if (contentLength != null) {
			assert$18(body, "no body must not have content length");
			headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
		}
		session.ref();
		const shouldEndStream = method === "GET" || method === "HEAD" || body === null;
		if (expectContinue) {
			headers[HTTP2_HEADER_EXPECT] = "100-continue";
			stream$7 = session.request(headers, {
				endStream: shouldEndStream,
				signal
			});
			stream$7.once("continue", writeBodyH2);
		} else {
			stream$7 = session.request(headers, {
				endStream: shouldEndStream,
				signal
			});
			writeBodyH2();
		}
		++session[kOpenStreams];
		stream$7.once("response", (headers$1) => {
			const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers$1;
			request$1.onResponseStarted();
			if (request$1.aborted) {
				const err = new RequestAbortedError$6();
				util$21.errorRequest(client, request$1, err);
				util$21.destroy(stream$7, err);
				return;
			}
			if (request$1.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream$7.resume.bind(stream$7), "") === false) stream$7.pause();
			stream$7.on("data", (chunk) => {
				if (request$1.onData(chunk) === false) stream$7.pause();
			});
		});
		stream$7.once("end", () => {
			if (stream$7.state?.state == null || stream$7.state.state < 6) request$1.onComplete([]);
			if (session[kOpenStreams] === 0) session.unref();
			abort$4(new InformationalError$2("HTTP/2: stream half-closed (remote)"));
			client[kQueue$2][client[kRunningIdx$1]++] = null;
			client[kPendingIdx$1] = client[kRunningIdx$1];
			client[kResume$2]();
		});
		stream$7.once("close", () => {
			session[kOpenStreams] -= 1;
			if (session[kOpenStreams] === 0) session.unref();
		});
		stream$7.once("error", function(err) {
			abort$4(err);
		});
		stream$7.once("frameError", (type, code) => {
			abort$4(new InformationalError$2(`HTTP/2: "frameError" received - type ${type}, code ${code}`));
		});
		return true;
		function writeBodyH2() {
			/* istanbul ignore else: assertion */
			if (!body || contentLength === 0) writeBuffer(abort$4, stream$7, null, client, request$1, client[kSocket], contentLength, expectsPayload);
			else if (util$21.isBuffer(body)) writeBuffer(abort$4, stream$7, body, client, request$1, client[kSocket], contentLength, expectsPayload);
			else if (util$21.isBlobLike(body)) if (typeof body.stream === "function") writeIterable(abort$4, stream$7, body.stream(), client, request$1, client[kSocket], contentLength, expectsPayload);
			else writeBlob(abort$4, stream$7, body, client, request$1, client[kSocket], contentLength, expectsPayload);
			else if (util$21.isStream(body)) writeStream(abort$4, client[kSocket], expectsPayload, stream$7, body, client, request$1, contentLength);
			else if (util$21.isIterable(body)) writeIterable(abort$4, stream$7, body, client, request$1, client[kSocket], contentLength, expectsPayload);
			else assert$18(false);
		}
	}
	function writeBuffer(abort$4, h2stream, body, client, request$1, socket, contentLength, expectsPayload) {
		try {
			if (body != null && util$21.isBuffer(body)) {
				assert$18(contentLength === body.byteLength, "buffer body must have content length");
				h2stream.cork();
				h2stream.write(body);
				h2stream.uncork();
				h2stream.end();
				request$1.onBodySent(body);
			}
			if (!expectsPayload) socket[kReset] = true;
			request$1.onRequestSent();
			client[kResume$2]();
		} catch (error) {
			abort$4(error);
		}
	}
	function writeStream(abort$4, socket, expectsPayload, h2stream, body, client, request$1, contentLength) {
		assert$18(contentLength !== 0 || client[kRunning$4] === 0, "stream body cannot be pipelined");
		const pipe = pipeline$3(body, h2stream, (err) => {
			if (err) {
				util$21.destroy(pipe, err);
				abort$4(err);
			} else {
				util$21.removeAllListeners(pipe);
				request$1.onRequestSent();
				if (!expectsPayload) socket[kReset] = true;
				client[kResume$2]();
			}
		});
		util$21.addListener(pipe, "data", onPipeData);
		function onPipeData(chunk) {
			request$1.onBodySent(chunk);
		}
	}
	async function writeBlob(abort$4, h2stream, body, client, request$1, socket, contentLength, expectsPayload) {
		assert$18(contentLength === body.size, "blob body must have content length");
		try {
			if (contentLength != null && contentLength !== body.size) throw new RequestContentLengthMismatchError();
			const buffer$1 = Buffer.from(await body.arrayBuffer());
			h2stream.cork();
			h2stream.write(buffer$1);
			h2stream.uncork();
			h2stream.end();
			request$1.onBodySent(buffer$1);
			request$1.onRequestSent();
			if (!expectsPayload) socket[kReset] = true;
			client[kResume$2]();
		} catch (err) {
			abort$4(err);
		}
	}
	async function writeIterable(abort$4, h2stream, body, client, request$1, socket, contentLength, expectsPayload) {
		assert$18(contentLength !== 0 || client[kRunning$4] === 0, "iterator body cannot be pipelined");
		let callback = null;
		function onDrain() {
			if (callback) {
				const cb = callback;
				callback = null;
				cb();
			}
		}
		const waitForDrain = () => new Promise((resolve, reject) => {
			assert$18(callback === null);
			if (socket[kError$3]) reject(socket[kError$3]);
			else callback = resolve;
		});
		h2stream.on("close", onDrain).on("drain", onDrain);
		try {
			for await (const chunk of body) {
				if (socket[kError$3]) throw socket[kError$3];
				const res = h2stream.write(chunk);
				request$1.onBodySent(chunk);
				if (!res) await waitForDrain();
			}
			h2stream.end();
			request$1.onRequestSent();
			if (!expectsPayload) socket[kReset] = true;
			client[kResume$2]();
		} catch (err) {
			abort$4(err);
		} finally {
			h2stream.off("close", onDrain).off("drain", onDrain);
		}
	}
	module.exports = connectH2$1;
}));
var require_redirect_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var util$20 = require_util$9();
	var { kBodyUsed } = require_symbols$4();
	var assert$17 = require("node:assert");
	var { InvalidArgumentError: InvalidArgumentError$19 } = require_errors$1();
	var EE$1 = require("node:events");
	var redirectableStatusCodes = [
		300,
		301,
		302,
		303,
		307,
		308
	];
	var kBody$1 = Symbol("body");
	var BodyAsyncIterable = class {
		constructor(body) {
			this[kBody$1] = body;
			this[kBodyUsed] = false;
		}
		async *[Symbol.asyncIterator]() {
			assert$17(!this[kBodyUsed], "disturbed");
			this[kBodyUsed] = true;
			yield* this[kBody$1];
		}
	};
	var RedirectHandler$3 = class {
		constructor(dispatch, maxRedirections, opts, handler) {
			if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) throw new InvalidArgumentError$19("maxRedirections must be a positive number");
			util$20.validateHandler(handler, opts.method, opts.upgrade);
			this.dispatch = dispatch;
			this.location = null;
			this.abort = null;
			this.opts = {
				...opts,
				maxRedirections: 0
			};
			this.maxRedirections = maxRedirections;
			this.handler = handler;
			this.history = [];
			this.redirectionLimitReached = false;
			if (util$20.isStream(this.opts.body)) {
				if (util$20.bodyLength(this.opts.body) === 0) this.opts.body.on("data", function() {
					assert$17(false);
				});
				if (typeof this.opts.body.readableDidRead !== "boolean") {
					this.opts.body[kBodyUsed] = false;
					EE$1.prototype.on.call(this.opts.body, "data", function() {
						this[kBodyUsed] = true;
					});
				}
			} else if (this.opts.body && typeof this.opts.body.pipeTo === "function") this.opts.body = new BodyAsyncIterable(this.opts.body);
			else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util$20.isIterable(this.opts.body)) this.opts.body = new BodyAsyncIterable(this.opts.body);
		}
		onConnect(abort$4) {
			this.abort = abort$4;
			this.handler.onConnect(abort$4, { history: this.history });
		}
		onUpgrade(statusCode, headers, socket) {
			this.handler.onUpgrade(statusCode, headers, socket);
		}
		onError(error) {
			this.handler.onError(error);
		}
		onHeaders(statusCode, headers, resume$2, statusText) {
			this.location = this.history.length >= this.maxRedirections || util$20.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
			if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
				if (this.request) this.request.abort(/* @__PURE__ */ new Error("max redirects"));
				this.redirectionLimitReached = true;
				this.abort(/* @__PURE__ */ new Error("max redirects"));
				return;
			}
			if (this.opts.origin) this.history.push(new URL(this.opts.path, this.opts.origin));
			if (!this.location) return this.handler.onHeaders(statusCode, headers, resume$2, statusText);
			const { origin: origin$1, pathname, search } = util$20.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
			const path$1 = search ? `${pathname}${search}` : pathname;
			this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin$1);
			this.opts.path = path$1;
			this.opts.origin = origin$1;
			this.opts.maxRedirections = 0;
			this.opts.query = null;
			if (statusCode === 303 && this.opts.method !== "HEAD") {
				this.opts.method = "GET";
				this.opts.body = null;
			}
		}
		onData(chunk) {
			if (this.location) {} else return this.handler.onData(chunk);
		}
		onComplete(trailers) {
			if (this.location) {
				this.location = null;
				this.abort = null;
				this.dispatch(this.opts, this);
			} else this.handler.onComplete(trailers);
		}
		onBodySent(chunk) {
			if (this.handler.onBodySent) this.handler.onBodySent(chunk);
		}
	};
	function parseLocation(statusCode, headers) {
		if (redirectableStatusCodes.indexOf(statusCode) === -1) return null;
		for (let i = 0; i < headers.length; i += 2) if (headers[i].length === 8 && util$20.headerNameToString(headers[i]) === "location") return headers[i + 1];
	}
	function shouldRemoveHeader(header, removeContent, unknownOrigin) {
		if (header.length === 4) return util$20.headerNameToString(header) === "host";
		if (removeContent && util$20.headerNameToString(header).startsWith("content-")) return true;
		if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
			const name$1 = util$20.headerNameToString(header);
			return name$1 === "authorization" || name$1 === "cookie" || name$1 === "proxy-authorization";
		}
		return false;
	}
	function cleanRequestHeaders(headers, removeContent, unknownOrigin) {
		const ret = [];
		if (Array.isArray(headers)) {
			for (let i = 0; i < headers.length; i += 2) if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) ret.push(headers[i], headers[i + 1]);
		} else if (headers && typeof headers === "object") {
			for (const key of Object.keys(headers)) if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) ret.push(key, headers[key]);
		} else assert$17(headers == null, "headers must be an object or an array");
		return ret;
	}
	module.exports = RedirectHandler$3;
}));
var require_redirect_interceptor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var RedirectHandler$2 = require_redirect_handler();
	function createRedirectInterceptor$3({ maxRedirections: defaultMaxRedirections }) {
		return (dispatch) => {
			return function Intercept(opts, handler) {
				const { maxRedirections = defaultMaxRedirections } = opts;
				if (!maxRedirections) return dispatch(opts, handler);
				const redirectHandler = new RedirectHandler$2(dispatch, maxRedirections, opts, handler);
				opts = {
					...opts,
					maxRedirections: 0
				};
				return dispatch(opts, redirectHandler);
			};
		};
	}
	module.exports = createRedirectInterceptor$3;
}));
var require_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$16 = require("node:assert");
	var net$5 = require("node:net");
	var http$6 = require("node:http");
	var util$19 = require_util$9();
	var { channels: channels$2 } = require_diagnostics();
	var Request$3 = require_request$1();
	var DispatcherBase$4 = require_dispatcher_base();
	var { InvalidArgumentError: InvalidArgumentError$18, InformationalError: InformationalError$1, ClientDestroyedError } = require_errors$1();
	var buildConnector$3 = require_connect();
	var { kUrl: kUrl$3, kServerName, kClient: kClient$1, kBusy: kBusy$1, kConnect, kResuming, kRunning: kRunning$3, kPending: kPending$2, kSize: kSize$4, kQueue: kQueue$1, kConnected: kConnected$5, kConnecting, kNeedDrain: kNeedDrain$3, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError: kError$2, kPipelining, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections: kMaxRedirections$1, kMaxRequests, kCounter, kClose: kClose$6, kDestroy: kDestroy$4, kDispatch: kDispatch$4, kInterceptors: kInterceptors$4, kLocalAddress, kMaxResponseSize, kOnError, kHTTPContext, kMaxConcurrentStreams, kResume: kResume$1 } = require_symbols$4();
	var connectH1 = require_client_h1();
	var connectH2 = require_client_h2();
	var deprecatedInterceptorWarned = false;
	var kClosedResolve$1 = Symbol("kClosedResolve");
	var noop$3 = () => {};
	function getPipelining(client) {
		return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1;
	}
	var Client$6 = class extends DispatcherBase$4 {
		constructor(url$3, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls: tls$5, strictContentLength, maxCachedSessions, maxRedirections, connect: connect$2, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, maxConcurrentStreams, allowH2 } = {}) {
			super();
			if (keepAlive !== void 0) throw new InvalidArgumentError$18("unsupported keepAlive, use pipelining=0 instead");
			if (socketTimeout !== void 0) throw new InvalidArgumentError$18("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");
			if (requestTimeout !== void 0) throw new InvalidArgumentError$18("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");
			if (idleTimeout !== void 0) throw new InvalidArgumentError$18("unsupported idleTimeout, use keepAliveTimeout instead");
			if (maxKeepAliveTimeout !== void 0) throw new InvalidArgumentError$18("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");
			if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) throw new InvalidArgumentError$18("invalid maxHeaderSize");
			if (socketPath != null && typeof socketPath !== "string") throw new InvalidArgumentError$18("invalid socketPath");
			if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) throw new InvalidArgumentError$18("invalid connectTimeout");
			if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) throw new InvalidArgumentError$18("invalid keepAliveTimeout");
			if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) throw new InvalidArgumentError$18("invalid keepAliveMaxTimeout");
			if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) throw new InvalidArgumentError$18("invalid keepAliveTimeoutThreshold");
			if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) throw new InvalidArgumentError$18("headersTimeout must be a positive integer or zero");
			if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) throw new InvalidArgumentError$18("bodyTimeout must be a positive integer or zero");
			if (connect$2 != null && typeof connect$2 !== "function" && typeof connect$2 !== "object") throw new InvalidArgumentError$18("connect must be a function or an object");
			if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) throw new InvalidArgumentError$18("maxRedirections must be a positive number");
			if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) throw new InvalidArgumentError$18("maxRequestsPerClient must be a positive number");
			if (localAddress != null && (typeof localAddress !== "string" || net$5.isIP(localAddress) === 0)) throw new InvalidArgumentError$18("localAddress must be valid string IP address");
			if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) throw new InvalidArgumentError$18("maxResponseSize must be a positive number");
			if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) throw new InvalidArgumentError$18("autoSelectFamilyAttemptTimeout must be a positive number");
			if (allowH2 != null && typeof allowH2 !== "boolean") throw new InvalidArgumentError$18("allowH2 must be a valid boolean value");
			if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) throw new InvalidArgumentError$18("maxConcurrentStreams must be a positive integer, greater than 0");
			if (typeof connect$2 !== "function") connect$2 = buildConnector$3({
				...tls$5,
				maxCachedSessions,
				allowH2,
				socketPath,
				timeout: connectTimeout,
				...autoSelectFamily ? {
					autoSelectFamily,
					autoSelectFamilyAttemptTimeout
				} : void 0,
				...connect$2
			});
			if (interceptors?.Client && Array.isArray(interceptors.Client)) {
				this[kInterceptors$4] = interceptors.Client;
				if (!deprecatedInterceptorWarned) {
					deprecatedInterceptorWarned = true;
					process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.", { code: "UNDICI-CLIENT-INTERCEPTOR-DEPRECATED" });
				}
			} else this[kInterceptors$4] = [createRedirectInterceptor$2({ maxRedirections })];
			this[kUrl$3] = util$19.parseOrigin(url$3);
			this[kConnector] = connect$2;
			this[kPipelining] = pipelining != null ? pipelining : 1;
			this[kMaxHeadersSize] = maxHeaderSize || http$6.maxHeaderSize;
			this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout;
			this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout;
			this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold;
			this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout];
			this[kServerName] = null;
			this[kLocalAddress] = localAddress != null ? localAddress : null;
			this[kResuming] = 0;
			this[kNeedDrain$3] = 0;
			this[kHostHeader] = `host: ${this[kUrl$3].hostname}${this[kUrl$3].port ? `:${this[kUrl$3].port}` : ""}\r\n`;
			this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5;
			this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5;
			this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength;
			this[kMaxRedirections$1] = maxRedirections;
			this[kMaxRequests] = maxRequestsPerClient;
			this[kClosedResolve$1] = null;
			this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1;
			this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100;
			this[kHTTPContext] = null;
			this[kQueue$1] = [];
			this[kRunningIdx] = 0;
			this[kPendingIdx] = 0;
			this[kResume$1] = (sync) => resume$1(this, sync);
			this[kOnError] = (err) => onError(this, err);
		}
		get pipelining() {
			return this[kPipelining];
		}
		set pipelining(value) {
			this[kPipelining] = value;
			this[kResume$1](true);
		}
		get [kPending$2]() {
			return this[kQueue$1].length - this[kPendingIdx];
		}
		get [kRunning$3]() {
			return this[kPendingIdx] - this[kRunningIdx];
		}
		get [kSize$4]() {
			return this[kQueue$1].length - this[kRunningIdx];
		}
		get [kConnected$5]() {
			return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed;
		}
		get [kBusy$1]() {
			return Boolean(this[kHTTPContext]?.busy(null) || this[kSize$4] >= (getPipelining(this) || 1) || this[kPending$2] > 0);
		}
		/* istanbul ignore: only used for test */
		[kConnect](cb) {
			connect$1(this);
			this.once("connect", cb);
		}
		[kDispatch$4](opts, handler) {
			const request$1 = new Request$3(opts.origin || this[kUrl$3].origin, opts, handler);
			this[kQueue$1].push(request$1);
			if (this[kResuming]) {} else if (util$19.bodyLength(request$1.body) == null && util$19.isIterable(request$1.body)) {
				this[kResuming] = 1;
				queueMicrotask(() => resume$1(this));
			} else this[kResume$1](true);
			if (this[kResuming] && this[kNeedDrain$3] !== 2 && this[kBusy$1]) this[kNeedDrain$3] = 2;
			return this[kNeedDrain$3] < 2;
		}
		async [kClose$6]() {
			return new Promise((resolve) => {
				if (this[kSize$4]) this[kClosedResolve$1] = resolve;
				else resolve(null);
			});
		}
		async [kDestroy$4](err) {
			return new Promise((resolve) => {
				const requests = this[kQueue$1].splice(this[kPendingIdx]);
				for (let i = 0; i < requests.length; i++) {
					const request$1 = requests[i];
					util$19.errorRequest(this, request$1, err);
				}
				const callback = () => {
					if (this[kClosedResolve$1]) {
						this[kClosedResolve$1]();
						this[kClosedResolve$1] = null;
					}
					resolve(null);
				};
				if (this[kHTTPContext]) {
					this[kHTTPContext].destroy(err, callback);
					this[kHTTPContext] = null;
				} else queueMicrotask(callback);
				this[kResume$1]();
			});
		}
	};
	var createRedirectInterceptor$2 = require_redirect_interceptor();
	function onError(client, err) {
		if (client[kRunning$3] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
			assert$16(client[kPendingIdx] === client[kRunningIdx]);
			const requests = client[kQueue$1].splice(client[kRunningIdx]);
			for (let i = 0; i < requests.length; i++) {
				const request$1 = requests[i];
				util$19.errorRequest(client, request$1, err);
			}
			assert$16(client[kSize$4] === 0);
		}
	}
	async function connect$1(client) {
		assert$16(!client[kConnecting]);
		assert$16(!client[kHTTPContext]);
		let { host, hostname, protocol, port } = client[kUrl$3];
		if (hostname[0] === "[") {
			const idx = hostname.indexOf("]");
			assert$16(idx !== -1);
			const ip = hostname.substring(1, idx);
			assert$16(net$5.isIP(ip));
			hostname = ip;
		}
		client[kConnecting] = true;
		if (channels$2.beforeConnect.hasSubscribers) channels$2.beforeConnect.publish({
			connectParams: {
				host,
				hostname,
				protocol,
				port,
				version: client[kHTTPContext]?.version,
				servername: client[kServerName],
				localAddress: client[kLocalAddress]
			},
			connector: client[kConnector]
		});
		try {
			const socket = await new Promise((resolve, reject) => {
				client[kConnector]({
					host,
					hostname,
					protocol,
					port,
					servername: client[kServerName],
					localAddress: client[kLocalAddress]
				}, (err, socket$1) => {
					if (err) reject(err);
					else resolve(socket$1);
				});
			});
			if (client.destroyed) {
				util$19.destroy(socket.on("error", noop$3), new ClientDestroyedError());
				return;
			}
			assert$16(socket);
			try {
				client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket);
			} catch (err) {
				socket.destroy().on("error", noop$3);
				throw err;
			}
			client[kConnecting] = false;
			socket[kCounter] = 0;
			socket[kMaxRequests] = client[kMaxRequests];
			socket[kClient$1] = client;
			socket[kError$2] = null;
			if (channels$2.connected.hasSubscribers) channels$2.connected.publish({
				connectParams: {
					host,
					hostname,
					protocol,
					port,
					version: client[kHTTPContext]?.version,
					servername: client[kServerName],
					localAddress: client[kLocalAddress]
				},
				connector: client[kConnector],
				socket
			});
			client.emit("connect", client[kUrl$3], [client]);
		} catch (err) {
			if (client.destroyed) return;
			client[kConnecting] = false;
			if (channels$2.connectError.hasSubscribers) channels$2.connectError.publish({
				connectParams: {
					host,
					hostname,
					protocol,
					port,
					version: client[kHTTPContext]?.version,
					servername: client[kServerName],
					localAddress: client[kLocalAddress]
				},
				connector: client[kConnector],
				error: err
			});
			if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
				assert$16(client[kRunning$3] === 0);
				while (client[kPending$2] > 0 && client[kQueue$1][client[kPendingIdx]].servername === client[kServerName]) {
					const request$1 = client[kQueue$1][client[kPendingIdx]++];
					util$19.errorRequest(client, request$1, err);
				}
			} else onError(client, err);
			client.emit("connectionError", client[kUrl$3], [client], err);
		}
		client[kResume$1]();
	}
	function emitDrain(client) {
		client[kNeedDrain$3] = 0;
		client.emit("drain", client[kUrl$3], [client]);
	}
	function resume$1(client, sync) {
		if (client[kResuming] === 2) return;
		client[kResuming] = 2;
		_resume(client, sync);
		client[kResuming] = 0;
		if (client[kRunningIdx] > 256) {
			client[kQueue$1].splice(0, client[kRunningIdx]);
			client[kPendingIdx] -= client[kRunningIdx];
			client[kRunningIdx] = 0;
		}
	}
	function _resume(client, sync) {
		while (true) {
			if (client.destroyed) {
				assert$16(client[kPending$2] === 0);
				return;
			}
			if (client[kClosedResolve$1] && !client[kSize$4]) {
				client[kClosedResolve$1]();
				client[kClosedResolve$1] = null;
				return;
			}
			if (client[kHTTPContext]) client[kHTTPContext].resume();
			if (client[kBusy$1]) client[kNeedDrain$3] = 2;
			else if (client[kNeedDrain$3] === 2) {
				if (sync) {
					client[kNeedDrain$3] = 1;
					queueMicrotask(() => emitDrain(client));
				} else emitDrain(client);
				continue;
			}
			if (client[kPending$2] === 0) return;
			if (client[kRunning$3] >= (getPipelining(client) || 1)) return;
			const request$1 = client[kQueue$1][client[kPendingIdx]];
			if (client[kUrl$3].protocol === "https:" && client[kServerName] !== request$1.servername) {
				if (client[kRunning$3] > 0) return;
				client[kServerName] = request$1.servername;
				client[kHTTPContext]?.destroy(new InformationalError$1("servername changed"), () => {
					client[kHTTPContext] = null;
					resume$1(client);
				});
			}
			if (client[kConnecting]) return;
			if (!client[kHTTPContext]) {
				connect$1(client);
				return;
			}
			if (client[kHTTPContext].destroyed) return;
			if (client[kHTTPContext].busy(request$1)) return;
			if (!request$1.aborted && client[kHTTPContext].write(request$1)) client[kPendingIdx]++;
			else client[kQueue$1].splice(client[kPendingIdx], 1);
		}
	}
	module.exports = Client$6;
}));
var require_fixed_queue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var kSize$3 = 2048;
	var kMask = kSize$3 - 1;
	var FixedCircularBuffer = class {
		constructor() {
			this.bottom = 0;
			this.top = 0;
			this.list = new Array(kSize$3);
			this.next = null;
		}
		isEmpty() {
			return this.top === this.bottom;
		}
		isFull() {
			return (this.top + 1 & kMask) === this.bottom;
		}
		push(data$1) {
			this.list[this.top] = data$1;
			this.top = this.top + 1 & kMask;
		}
		shift() {
			const nextItem = this.list[this.bottom];
			if (nextItem === void 0) return null;
			this.list[this.bottom] = void 0;
			this.bottom = this.bottom + 1 & kMask;
			return nextItem;
		}
	};
	module.exports = class FixedQueue$2 {
		constructor() {
			this.head = this.tail = new FixedCircularBuffer();
		}
		isEmpty() {
			return this.head.isEmpty();
		}
		push(data$1) {
			if (this.head.isFull()) this.head = this.head.next = new FixedCircularBuffer();
			this.head.push(data$1);
		}
		shift() {
			const tail$1 = this.tail;
			const next = tail$1.shift();
			if (tail$1.isEmpty() && tail$1.next !== null) this.tail = tail$1.next;
			return next;
		}
	};
}));
var require_pool_stats = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kFree: kFree$1, kConnected: kConnected$4, kPending: kPending$1, kQueued: kQueued$1, kRunning: kRunning$2, kSize: kSize$2 } = require_symbols$4();
	var kPool = Symbol("pool");
	var PoolStats$1 = class {
		constructor(pool) {
			this[kPool] = pool;
		}
		get connected() {
			return this[kPool][kConnected$4];
		}
		get free() {
			return this[kPool][kFree$1];
		}
		get pending() {
			return this[kPool][kPending$1];
		}
		get queued() {
			return this[kPool][kQueued$1];
		}
		get running() {
			return this[kPool][kRunning$2];
		}
		get size() {
			return this[kPool][kSize$2];
		}
	};
	module.exports = PoolStats$1;
}));
var require_pool_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var DispatcherBase$3 = require_dispatcher_base();
	var FixedQueue$1 = require_fixed_queue();
	var { kConnected: kConnected$3, kSize: kSize$1, kRunning: kRunning$1, kPending, kQueued, kBusy, kFree, kUrl: kUrl$2, kClose: kClose$5, kDestroy: kDestroy$3, kDispatch: kDispatch$3 } = require_symbols$4();
	var PoolStats = require_pool_stats();
	var kClients$4 = Symbol("clients");
	var kNeedDrain$2 = Symbol("needDrain");
	var kQueue = Symbol("queue");
	var kClosedResolve = Symbol("closed resolve");
	var kOnDrain$1 = Symbol("onDrain");
	var kOnConnect$1 = Symbol("onConnect");
	var kOnDisconnect$1 = Symbol("onDisconnect");
	var kOnConnectionError$1 = Symbol("onConnectionError");
	var kGetDispatcher$2 = Symbol("get dispatcher");
	var kAddClient$2 = Symbol("add client");
	var kRemoveClient$1 = Symbol("remove client");
	var kStats = Symbol("stats");
	var PoolBase$2 = class extends DispatcherBase$3 {
		constructor() {
			super();
			this[kQueue] = new FixedQueue$1();
			this[kClients$4] = [];
			this[kQueued] = 0;
			const pool = this;
			this[kOnDrain$1] = function onDrain(origin$1, targets) {
				const queue = pool[kQueue];
				let needDrain = false;
				while (!needDrain) {
					const item = queue.shift();
					if (!item) break;
					pool[kQueued]--;
					needDrain = !this.dispatch(item.opts, item.handler);
				}
				this[kNeedDrain$2] = needDrain;
				if (!this[kNeedDrain$2] && pool[kNeedDrain$2]) {
					pool[kNeedDrain$2] = false;
					pool.emit("drain", origin$1, [pool, ...targets]);
				}
				if (pool[kClosedResolve] && queue.isEmpty()) Promise.all(pool[kClients$4].map((c) => c.close())).then(pool[kClosedResolve]);
			};
			this[kOnConnect$1] = (origin$1, targets) => {
				pool.emit("connect", origin$1, [pool, ...targets]);
			};
			this[kOnDisconnect$1] = (origin$1, targets, err) => {
				pool.emit("disconnect", origin$1, [pool, ...targets], err);
			};
			this[kOnConnectionError$1] = (origin$1, targets, err) => {
				pool.emit("connectionError", origin$1, [pool, ...targets], err);
			};
			this[kStats] = new PoolStats(this);
		}
		get [kBusy]() {
			return this[kNeedDrain$2];
		}
		get [kConnected$3]() {
			return this[kClients$4].filter((client) => client[kConnected$3]).length;
		}
		get [kFree]() {
			return this[kClients$4].filter((client) => client[kConnected$3] && !client[kNeedDrain$2]).length;
		}
		get [kPending]() {
			let ret = this[kQueued];
			for (const { [kPending]: pending } of this[kClients$4]) ret += pending;
			return ret;
		}
		get [kRunning$1]() {
			let ret = 0;
			for (const { [kRunning$1]: running } of this[kClients$4]) ret += running;
			return ret;
		}
		get [kSize$1]() {
			let ret = this[kQueued];
			for (const { [kSize$1]: size } of this[kClients$4]) ret += size;
			return ret;
		}
		get stats() {
			return this[kStats];
		}
		async [kClose$5]() {
			if (this[kQueue].isEmpty()) await Promise.all(this[kClients$4].map((c) => c.close()));
			else await new Promise((resolve) => {
				this[kClosedResolve] = resolve;
			});
		}
		async [kDestroy$3](err) {
			while (true) {
				const item = this[kQueue].shift();
				if (!item) break;
				item.handler.onError(err);
			}
			await Promise.all(this[kClients$4].map((c) => c.destroy(err)));
		}
		[kDispatch$3](opts, handler) {
			const dispatcher = this[kGetDispatcher$2]();
			if (!dispatcher) {
				this[kNeedDrain$2] = true;
				this[kQueue].push({
					opts,
					handler
				});
				this[kQueued]++;
			} else if (!dispatcher.dispatch(opts, handler)) {
				dispatcher[kNeedDrain$2] = true;
				this[kNeedDrain$2] = !this[kGetDispatcher$2]();
			}
			return !this[kNeedDrain$2];
		}
		[kAddClient$2](client) {
			client.on("drain", this[kOnDrain$1]).on("connect", this[kOnConnect$1]).on("disconnect", this[kOnDisconnect$1]).on("connectionError", this[kOnConnectionError$1]);
			this[kClients$4].push(client);
			if (this[kNeedDrain$2]) queueMicrotask(() => {
				if (this[kNeedDrain$2]) this[kOnDrain$1](client[kUrl$2], [this, client]);
			});
			return this;
		}
		[kRemoveClient$1](client) {
			client.close(() => {
				const idx = this[kClients$4].indexOf(client);
				if (idx !== -1) this[kClients$4].splice(idx, 1);
			});
			this[kNeedDrain$2] = this[kClients$4].some((dispatcher) => !dispatcher[kNeedDrain$2] && dispatcher.closed !== true && dispatcher.destroyed !== true);
		}
	};
	module.exports = {
		PoolBase: PoolBase$2,
		kClients: kClients$4,
		kNeedDrain: kNeedDrain$2,
		kAddClient: kAddClient$2,
		kRemoveClient: kRemoveClient$1,
		kGetDispatcher: kGetDispatcher$2
	};
}));
var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { PoolBase: PoolBase$1, kClients: kClients$3, kNeedDrain: kNeedDrain$1, kAddClient: kAddClient$1, kGetDispatcher: kGetDispatcher$1 } = require_pool_base();
	var Client$5 = require_client();
	var { InvalidArgumentError: InvalidArgumentError$17 } = require_errors$1();
	var util$18 = require_util$9();
	var { kUrl: kUrl$1, kInterceptors: kInterceptors$3 } = require_symbols$4();
	var buildConnector$2 = require_connect();
	var kOptions$3 = Symbol("options");
	var kConnections = Symbol("connections");
	var kFactory$3 = Symbol("factory");
	function defaultFactory$3(origin$1, opts) {
		return new Client$5(origin$1, opts);
	}
	var Pool$5 = class extends PoolBase$1 {
		constructor(origin$1, { connections, factory: factory$1 = defaultFactory$3, connect: connect$2, connectTimeout, tls: tls$5, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options } = {}) {
			super();
			if (connections != null && (!Number.isFinite(connections) || connections < 0)) throw new InvalidArgumentError$17("invalid connections");
			if (typeof factory$1 !== "function") throw new InvalidArgumentError$17("factory must be a function.");
			if (connect$2 != null && typeof connect$2 !== "function" && typeof connect$2 !== "object") throw new InvalidArgumentError$17("connect must be a function or an object");
			if (typeof connect$2 !== "function") connect$2 = buildConnector$2({
				...tls$5,
				maxCachedSessions,
				allowH2,
				socketPath,
				timeout: connectTimeout,
				...autoSelectFamily ? {
					autoSelectFamily,
					autoSelectFamilyAttemptTimeout
				} : void 0,
				...connect$2
			});
			this[kInterceptors$3] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : [];
			this[kConnections] = connections || null;
			this[kUrl$1] = util$18.parseOrigin(origin$1);
			this[kOptions$3] = {
				...util$18.deepClone(options),
				connect: connect$2,
				allowH2
			};
			this[kOptions$3].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
			this[kFactory$3] = factory$1;
			this.on("connectionError", (origin$2, targets, error) => {
				for (const target of targets) {
					const idx = this[kClients$3].indexOf(target);
					if (idx !== -1) this[kClients$3].splice(idx, 1);
				}
			});
		}
		[kGetDispatcher$1]() {
			for (const client of this[kClients$3]) if (!client[kNeedDrain$1]) return client;
			if (!this[kConnections] || this[kClients$3].length < this[kConnections]) {
				const dispatcher = this[kFactory$3](this[kUrl$1], this[kOptions$3]);
				this[kAddClient$1](dispatcher);
				return dispatcher;
			}
		}
	};
	module.exports = Pool$5;
}));
var require_balanced_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { BalancedPoolMissingUpstreamError, InvalidArgumentError: InvalidArgumentError$16 } = require_errors$1();
	var { PoolBase, kClients: kClients$2, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } = require_pool_base();
	var Pool$4 = require_pool();
	var { kUrl, kInterceptors: kInterceptors$2 } = require_symbols$4();
	var { parseOrigin } = require_util$9();
	var kFactory$2 = Symbol("factory");
	var kOptions$2 = Symbol("options");
	var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor");
	var kCurrentWeight = Symbol("kCurrentWeight");
	var kIndex = Symbol("kIndex");
	var kWeight = Symbol("kWeight");
	var kMaxWeightPerServer = Symbol("kMaxWeightPerServer");
	var kErrorPenalty = Symbol("kErrorPenalty");
	function getGreatestCommonDivisor(a, b) {
		if (a === 0) return b;
		while (b !== 0) {
			const t = b;
			b = a % b;
			a = t;
		}
		return a;
	}
	function defaultFactory$2(origin$1, opts) {
		return new Pool$4(origin$1, opts);
	}
	var BalancedPool$1 = class extends PoolBase {
		constructor(upstreams = [], { factory: factory$1 = defaultFactory$2, ...opts } = {}) {
			super();
			this[kOptions$2] = opts;
			this[kIndex] = -1;
			this[kCurrentWeight] = 0;
			this[kMaxWeightPerServer] = this[kOptions$2].maxWeightPerServer || 100;
			this[kErrorPenalty] = this[kOptions$2].errorPenalty || 15;
			if (!Array.isArray(upstreams)) upstreams = [upstreams];
			if (typeof factory$1 !== "function") throw new InvalidArgumentError$16("factory must be a function.");
			this[kInterceptors$2] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : [];
			this[kFactory$2] = factory$1;
			for (const upstream of upstreams) this.addUpstream(upstream);
			this._updateBalancedPoolStats();
		}
		addUpstream(upstream) {
			const upstreamOrigin = parseOrigin(upstream).origin;
			if (this[kClients$2].find((pool$1) => pool$1[kUrl].origin === upstreamOrigin && pool$1.closed !== true && pool$1.destroyed !== true)) return this;
			const pool = this[kFactory$2](upstreamOrigin, Object.assign({}, this[kOptions$2]));
			this[kAddClient](pool);
			pool.on("connect", () => {
				pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]);
			});
			pool.on("connectionError", () => {
				pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]);
				this._updateBalancedPoolStats();
			});
			pool.on("disconnect", (...args) => {
				const err = args[2];
				if (err && err.code === "UND_ERR_SOCKET") {
					pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]);
					this._updateBalancedPoolStats();
				}
			});
			for (const client of this[kClients$2]) client[kWeight] = this[kMaxWeightPerServer];
			this._updateBalancedPoolStats();
			return this;
		}
		_updateBalancedPoolStats() {
			let result = 0;
			for (let i = 0; i < this[kClients$2].length; i++) result = getGreatestCommonDivisor(this[kClients$2][i][kWeight], result);
			this[kGreatestCommonDivisor] = result;
		}
		removeUpstream(upstream) {
			const upstreamOrigin = parseOrigin(upstream).origin;
			const pool = this[kClients$2].find((pool$1) => pool$1[kUrl].origin === upstreamOrigin && pool$1.closed !== true && pool$1.destroyed !== true);
			if (pool) this[kRemoveClient](pool);
			return this;
		}
		get upstreams() {
			return this[kClients$2].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p) => p[kUrl].origin);
		}
		[kGetDispatcher]() {
			if (this[kClients$2].length === 0) throw new BalancedPoolMissingUpstreamError();
			if (!this[kClients$2].find((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true)) return;
			if (this[kClients$2].map((pool) => pool[kNeedDrain]).reduce((a, b) => a && b, true)) return;
			let counter = 0;
			let maxWeightIndex = this[kClients$2].findIndex((pool) => !pool[kNeedDrain]);
			while (counter++ < this[kClients$2].length) {
				this[kIndex] = (this[kIndex] + 1) % this[kClients$2].length;
				const pool = this[kClients$2][this[kIndex]];
				if (pool[kWeight] > this[kClients$2][maxWeightIndex][kWeight] && !pool[kNeedDrain]) maxWeightIndex = this[kIndex];
				if (this[kIndex] === 0) {
					this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor];
					if (this[kCurrentWeight] <= 0) this[kCurrentWeight] = this[kMaxWeightPerServer];
				}
				if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) return pool;
			}
			this[kCurrentWeight] = this[kClients$2][maxWeightIndex][kWeight];
			this[kIndex] = maxWeightIndex;
			return this[kClients$2][maxWeightIndex];
		}
	};
	module.exports = BalancedPool$1;
}));
var require_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { InvalidArgumentError: InvalidArgumentError$15 } = require_errors$1();
	var { kClients: kClients$1, kRunning, kClose: kClose$4, kDestroy: kDestroy$2, kDispatch: kDispatch$2, kInterceptors: kInterceptors$1 } = require_symbols$4();
	var DispatcherBase$2 = require_dispatcher_base();
	var Pool$3 = require_pool();
	var Client$4 = require_client();
	var util$17 = require_util$9();
	var createRedirectInterceptor$1 = require_redirect_interceptor();
	var kOnConnect = Symbol("onConnect");
	var kOnDisconnect = Symbol("onDisconnect");
	var kOnConnectionError = Symbol("onConnectionError");
	var kMaxRedirections = Symbol("maxRedirections");
	var kOnDrain = Symbol("onDrain");
	var kFactory$1 = Symbol("factory");
	var kOptions$1 = Symbol("options");
	function defaultFactory$1(origin$1, opts) {
		return opts && opts.connections === 1 ? new Client$4(origin$1, opts) : new Pool$3(origin$1, opts);
	}
	var Agent$6 = class extends DispatcherBase$2 {
		constructor({ factory: factory$1 = defaultFactory$1, maxRedirections = 0, connect: connect$2, ...options } = {}) {
			super();
			if (typeof factory$1 !== "function") throw new InvalidArgumentError$15("factory must be a function.");
			if (connect$2 != null && typeof connect$2 !== "function" && typeof connect$2 !== "object") throw new InvalidArgumentError$15("connect must be a function or an object");
			if (!Number.isInteger(maxRedirections) || maxRedirections < 0) throw new InvalidArgumentError$15("maxRedirections must be a positive number");
			if (connect$2 && typeof connect$2 !== "function") connect$2 = { ...connect$2 };
			this[kInterceptors$1] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor$1({ maxRedirections })];
			this[kOptions$1] = {
				...util$17.deepClone(options),
				connect: connect$2
			};
			this[kOptions$1].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
			this[kMaxRedirections] = maxRedirections;
			this[kFactory$1] = factory$1;
			this[kClients$1] = /* @__PURE__ */ new Map();
			this[kOnDrain] = (origin$1, targets) => {
				this.emit("drain", origin$1, [this, ...targets]);
			};
			this[kOnConnect] = (origin$1, targets) => {
				this.emit("connect", origin$1, [this, ...targets]);
			};
			this[kOnDisconnect] = (origin$1, targets, err) => {
				this.emit("disconnect", origin$1, [this, ...targets], err);
			};
			this[kOnConnectionError] = (origin$1, targets, err) => {
				this.emit("connectionError", origin$1, [this, ...targets], err);
			};
		}
		get [kRunning]() {
			let ret = 0;
			for (const client of this[kClients$1].values()) ret += client[kRunning];
			return ret;
		}
		[kDispatch$2](opts, handler) {
			let key;
			if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) key = String(opts.origin);
			else throw new InvalidArgumentError$15("opts.origin must be a non-empty string or URL.");
			let dispatcher = this[kClients$1].get(key);
			if (!dispatcher) {
				dispatcher = this[kFactory$1](opts.origin, this[kOptions$1]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]);
				this[kClients$1].set(key, dispatcher);
			}
			return dispatcher.dispatch(opts, handler);
		}
		async [kClose$4]() {
			const closePromises = [];
			for (const client of this[kClients$1].values()) closePromises.push(client.close());
			this[kClients$1].clear();
			await Promise.all(closePromises);
		}
		async [kDestroy$2](err) {
			const destroyPromises = [];
			for (const client of this[kClients$1].values()) destroyPromises.push(client.destroy(err));
			this[kClients$1].clear();
			await Promise.all(destroyPromises);
		}
	};
	module.exports = Agent$6;
}));
var require_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kProxy, kClose: kClose$3, kDestroy: kDestroy$1, kDispatch: kDispatch$1, kInterceptors } = require_symbols$4();
	var { URL: URL$1 } = require("node:url");
	var Agent$5 = require_agent();
	var Pool$2 = require_pool();
	var DispatcherBase$1 = require_dispatcher_base();
	var { InvalidArgumentError: InvalidArgumentError$14, RequestAbortedError: RequestAbortedError$5, SecureProxyConnectionError } = require_errors$1();
	var buildConnector$1 = require_connect();
	var Client$3 = require_client();
	var kAgent$1 = Symbol("proxy agent");
	var kClient = Symbol("proxy client");
	var kProxyHeaders = Symbol("proxy headers");
	var kRequestTls = Symbol("request tls settings");
	var kProxyTls = Symbol("proxy tls settings");
	var kConnectEndpoint = Symbol("connect endpoint function");
	var kTunnelProxy = Symbol("tunnel proxy");
	function defaultProtocolPort(protocol) {
		return protocol === "https:" ? 443 : 80;
	}
	function defaultFactory(origin$1, opts) {
		return new Pool$2(origin$1, opts);
	}
	var noop$2 = () => {};
	function defaultAgentFactory(origin$1, opts) {
		if (opts.connections === 1) return new Client$3(origin$1, opts);
		return new Pool$2(origin$1, opts);
	}
	var Http1ProxyWrapper = class extends DispatcherBase$1 {
		#client;
		constructor(proxyUrl, { headers = {}, connect: connect$2, factory: factory$1 }) {
			super();
			if (!proxyUrl) throw new InvalidArgumentError$14("Proxy URL is mandatory");
			this[kProxyHeaders] = headers;
			if (factory$1) this.#client = factory$1(proxyUrl, { connect: connect$2 });
			else this.#client = new Client$3(proxyUrl, { connect: connect$2 });
		}
		[kDispatch$1](opts, handler) {
			const onHeaders = handler.onHeaders;
			handler.onHeaders = function(statusCode, data$1, resume$2) {
				if (statusCode === 407) {
					if (typeof handler.onError === "function") handler.onError(new InvalidArgumentError$14("Proxy Authentication Required (407)"));
					return;
				}
				if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$2);
			};
			const { origin: origin$1, path: path$1 = "/", headers = {} } = opts;
			opts.path = origin$1 + path$1;
			if (!("host" in headers) && !("Host" in headers)) {
				const { host } = new URL$1(origin$1);
				headers.host = host;
			}
			opts.headers = {
				...this[kProxyHeaders],
				...headers
			};
			return this.#client[kDispatch$1](opts, handler);
		}
		async [kClose$3]() {
			return this.#client.close();
		}
		async [kDestroy$1](err) {
			return this.#client.destroy(err);
		}
	};
	var ProxyAgent$4 = class extends DispatcherBase$1 {
		constructor(opts) {
			super();
			if (!opts || typeof opts === "object" && !(opts instanceof URL$1) && !opts.uri) throw new InvalidArgumentError$14("Proxy uri is mandatory");
			const { clientFactory = defaultFactory } = opts;
			if (typeof clientFactory !== "function") throw new InvalidArgumentError$14("Proxy opts.clientFactory must be a function.");
			const { proxyTunnel = true } = opts;
			const url$3 = this.#getUrl(opts);
			const { href, origin: origin$1, port, protocol, username, password, hostname: proxyHostname } = url$3;
			this[kProxy] = {
				uri: href,
				protocol
			};
			this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : [];
			this[kRequestTls] = opts.requestTls;
			this[kProxyTls] = opts.proxyTls;
			this[kProxyHeaders] = opts.headers || {};
			this[kTunnelProxy] = proxyTunnel;
			if (opts.auth && opts.token) throw new InvalidArgumentError$14("opts.auth cannot be used in combination with opts.token");
			else if (opts.auth) this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`;
			else if (opts.token) this[kProxyHeaders]["proxy-authorization"] = opts.token;
			else if (username && password) this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`;
			const connect$2 = buildConnector$1({ ...opts.proxyTls });
			this[kConnectEndpoint] = buildConnector$1({ ...opts.requestTls });
			const agentFactory = opts.factory || defaultAgentFactory;
			const factory$1 = (origin$2, options) => {
				const { protocol: protocol$1 } = new URL$1(origin$2);
				if (!this[kTunnelProxy] && protocol$1 === "http:" && this[kProxy].protocol === "http:") return new Http1ProxyWrapper(this[kProxy].uri, {
					headers: this[kProxyHeaders],
					connect: connect$2,
					factory: agentFactory
				});
				return agentFactory(origin$2, options);
			};
			this[kClient] = clientFactory(url$3, { connect: connect$2 });
			this[kAgent$1] = new Agent$5({
				...opts,
				factory: factory$1,
				connect: async (opts$1, callback) => {
					let requestedPath = opts$1.host;
					if (!opts$1.port) requestedPath += `:${defaultProtocolPort(opts$1.protocol)}`;
					try {
						const { socket, statusCode } = await this[kClient].connect({
							origin: origin$1,
							port,
							path: requestedPath,
							signal: opts$1.signal,
							headers: {
								...this[kProxyHeaders],
								host: opts$1.host
							},
							servername: this[kProxyTls]?.servername || proxyHostname
						});
						if (statusCode !== 200) {
							socket.on("error", noop$2).destroy();
							callback(new RequestAbortedError$5(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`));
						}
						if (opts$1.protocol !== "https:") {
							callback(null, socket);
							return;
						}
						let servername;
						if (this[kRequestTls]) servername = this[kRequestTls].servername;
						else servername = opts$1.servername;
						this[kConnectEndpoint]({
							...opts$1,
							servername,
							httpSocket: socket
						}, callback);
					} catch (err) {
						if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") callback(new SecureProxyConnectionError(err));
						else callback(err);
					}
				}
			});
		}
		dispatch(opts, handler) {
			const headers = buildHeaders(opts.headers);
			throwIfProxyAuthIsSent(headers);
			if (headers && !("host" in headers) && !("Host" in headers)) {
				const { host } = new URL$1(opts.origin);
				headers.host = host;
			}
			return this[kAgent$1].dispatch({
				...opts,
				headers
			}, handler);
		}
		#getUrl(opts) {
			if (typeof opts === "string") return new URL$1(opts);
			else if (opts instanceof URL$1) return opts;
			else return new URL$1(opts.uri);
		}
		async [kClose$3]() {
			await this[kAgent$1].close();
			await this[kClient].close();
		}
		async [kDestroy$1]() {
			await this[kAgent$1].destroy();
			await this[kClient].destroy();
		}
	};
	function buildHeaders(headers) {
		if (Array.isArray(headers)) {
			const headersPair = {};
			for (let i = 0; i < headers.length; i += 2) headersPair[headers[i]] = headers[i + 1];
			return headersPair;
		}
		return headers;
	}
	function throwIfProxyAuthIsSent(headers) {
		if (headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization")) throw new InvalidArgumentError$14("Proxy-Authorization should be sent in ProxyAgent constructor");
	}
	module.exports = ProxyAgent$4;
}));
var require_env_http_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var DispatcherBase = require_dispatcher_base();
	var { kClose: kClose$2, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols$4();
	var ProxyAgent$3 = require_proxy_agent();
	var Agent$4 = require_agent();
	var DEFAULT_PORTS$1 = {
		"http:": 80,
		"https:": 443
	};
	var experimentalWarned$1 = false;
	var EnvHttpProxyAgent$2 = class extends DispatcherBase {
		#noProxyValue = null;
		#noProxyEntries = null;
		#opts = null;
		constructor(opts = {}) {
			super();
			this.#opts = opts;
			if (!experimentalWarned$1) {
				experimentalWarned$1 = true;
				process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.", { code: "UNDICI-EHPA" });
			}
			const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts;
			this[kNoProxyAgent] = new Agent$4(agentOpts);
			const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
			if (HTTP_PROXY) this[kHttpProxyAgent] = new ProxyAgent$3({
				...agentOpts,
				uri: HTTP_PROXY
			});
			else this[kHttpProxyAgent] = this[kNoProxyAgent];
			const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY;
			if (HTTPS_PROXY) this[kHttpsProxyAgent] = new ProxyAgent$3({
				...agentOpts,
				uri: HTTPS_PROXY
			});
			else this[kHttpsProxyAgent] = this[kHttpProxyAgent];
			this.#parseNoProxy();
		}
		[kDispatch](opts, handler) {
			const url$3 = new URL(opts.origin);
			return this.#getProxyAgentForUrl(url$3).dispatch(opts, handler);
		}
		async [kClose$2]() {
			await this[kNoProxyAgent].close();
			if (!this[kHttpProxyAgent][kClosed]) await this[kHttpProxyAgent].close();
			if (!this[kHttpsProxyAgent][kClosed]) await this[kHttpsProxyAgent].close();
		}
		async [kDestroy](err) {
			await this[kNoProxyAgent].destroy(err);
			if (!this[kHttpProxyAgent][kDestroyed]) await this[kHttpProxyAgent].destroy(err);
			if (!this[kHttpsProxyAgent][kDestroyed]) await this[kHttpsProxyAgent].destroy(err);
		}
		#getProxyAgentForUrl(url$3) {
			let { protocol, host: hostname, port } = url$3;
			hostname = hostname.replace(/:\d*$/, "").toLowerCase();
			port = Number.parseInt(port, 10) || DEFAULT_PORTS$1[protocol] || 0;
			if (!this.#shouldProxy(hostname, port)) return this[kNoProxyAgent];
			if (protocol === "https:") return this[kHttpsProxyAgent];
			return this[kHttpProxyAgent];
		}
		#shouldProxy(hostname, port) {
			if (this.#noProxyChanged) this.#parseNoProxy();
			if (this.#noProxyEntries.length === 0) return true;
			if (this.#noProxyValue === "*") return false;
			for (let i = 0; i < this.#noProxyEntries.length; i++) {
				const entry = this.#noProxyEntries[i];
				if (entry.port && entry.port !== port) continue;
				if (!/^[.*]/.test(entry.hostname)) {
					if (hostname === entry.hostname) return false;
				} else if (hostname.endsWith(entry.hostname.replace(/^\*/, ""))) return false;
			}
			return true;
		}
		#parseNoProxy() {
			const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv;
			const noProxySplit = noProxyValue.split(/[,\s]/);
			const noProxyEntries = [];
			for (let i = 0; i < noProxySplit.length; i++) {
				const entry = noProxySplit[i];
				if (!entry) continue;
				const parsed = entry.match(/^(.+):(\d+)$/);
				noProxyEntries.push({
					hostname: (parsed ? parsed[1] : entry).toLowerCase(),
					port: parsed ? Number.parseInt(parsed[2], 10) : 0
				});
			}
			this.#noProxyValue = noProxyValue;
			this.#noProxyEntries = noProxyEntries;
		}
		get #noProxyChanged() {
			if (this.#opts.noProxy !== void 0) return false;
			return this.#noProxyValue !== this.#noProxyEnv;
		}
		get #noProxyEnv() {
			return process.env.no_proxy ?? process.env.NO_PROXY ?? "";
		}
	};
	module.exports = EnvHttpProxyAgent$2;
}));
var require_retry_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$15 = require("node:assert");
	var { kRetryHandlerDefaultRetry } = require_symbols$4();
	var { RequestRetryError } = require_errors$1();
	var { isDisturbed: isDisturbed$1, parseHeaders, parseRangeHeader, wrapRequestBody } = require_util$9();
	function calculateRetryAfterHeader(retryAfter) {
		const current = Date.now();
		return new Date(retryAfter).getTime() - current;
	}
	module.exports = class RetryHandler$3 {
		constructor(opts, handlers) {
			const { retryOptions, ...dispatchOpts } = opts;
			const { retry: retryFn, maxRetries, maxTimeout, minTimeout, timeoutFactor, methods, errorCodes, retryAfter, statusCodes } = retryOptions ?? {};
			this.dispatch = handlers.dispatch;
			this.handler = handlers.handler;
			this.opts = {
				...dispatchOpts,
				body: wrapRequestBody(opts.body)
			};
			this.abort = null;
			this.aborted = false;
			this.retryOpts = {
				retry: retryFn ?? RetryHandler$3[kRetryHandlerDefaultRetry],
				retryAfter: retryAfter ?? true,
				maxTimeout: maxTimeout ?? 30 * 1e3,
				minTimeout: minTimeout ?? 500,
				timeoutFactor: timeoutFactor ?? 2,
				maxRetries: maxRetries ?? 5,
				methods: methods ?? [
					"GET",
					"HEAD",
					"OPTIONS",
					"PUT",
					"DELETE",
					"TRACE"
				],
				statusCodes: statusCodes ?? [
					500,
					502,
					503,
					504,
					429
				],
				errorCodes: errorCodes ?? [
					"ECONNRESET",
					"ECONNREFUSED",
					"ENOTFOUND",
					"ENETDOWN",
					"ENETUNREACH",
					"EHOSTDOWN",
					"EHOSTUNREACH",
					"EPIPE",
					"UND_ERR_SOCKET"
				]
			};
			this.retryCount = 0;
			this.retryCountCheckpoint = 0;
			this.start = 0;
			this.end = null;
			this.etag = null;
			this.resume = null;
			this.handler.onConnect((reason) => {
				this.aborted = true;
				if (this.abort) this.abort(reason);
				else this.reason = reason;
			});
		}
		onRequestSent() {
			if (this.handler.onRequestSent) this.handler.onRequestSent();
		}
		onUpgrade(statusCode, headers, socket) {
			if (this.handler.onUpgrade) this.handler.onUpgrade(statusCode, headers, socket);
		}
		onConnect(abort$4) {
			if (this.aborted) abort$4(this.reason);
			else this.abort = abort$4;
		}
		onBodySent(chunk) {
			if (this.handler.onBodySent) return this.handler.onBodySent(chunk);
		}
		static [kRetryHandlerDefaultRetry](err, { state: state$1, opts }, cb) {
			const { statusCode, code, headers } = err;
			const { method, retryOptions } = opts;
			const { maxRetries, minTimeout, maxTimeout, timeoutFactor, statusCodes, errorCodes, methods } = retryOptions;
			const { counter } = state$1;
			if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) {
				cb(err);
				return;
			}
			if (Array.isArray(methods) && !methods.includes(method)) {
				cb(err);
				return;
			}
			if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) {
				cb(err);
				return;
			}
			if (counter > maxRetries) {
				cb(err);
				return;
			}
			let retryAfterHeader = headers?.["retry-after"];
			if (retryAfterHeader) {
				retryAfterHeader = Number(retryAfterHeader);
				retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3;
			}
			const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
			setTimeout(() => cb(null), retryTimeout);
		}
		onHeaders(statusCode, rawHeaders, resume$2, statusMessage) {
			const headers = parseHeaders(rawHeaders);
			this.retryCount += 1;
			if (statusCode >= 300) if (this.retryOpts.statusCodes.includes(statusCode) === false) return this.handler.onHeaders(statusCode, rawHeaders, resume$2, statusMessage);
			else {
				this.abort(new RequestRetryError("Request failed", statusCode, {
					headers,
					data: { count: this.retryCount }
				}));
				return false;
			}
			if (this.resume != null) {
				this.resume = null;
				if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {
					this.abort(new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, {
						headers,
						data: { count: this.retryCount }
					}));
					return false;
				}
				const contentRange = parseRangeHeader(headers["content-range"]);
				if (!contentRange) {
					this.abort(new RequestRetryError("Content-Range mismatch", statusCode, {
						headers,
						data: { count: this.retryCount }
					}));
					return false;
				}
				if (this.etag != null && this.etag !== headers.etag) {
					this.abort(new RequestRetryError("ETag mismatch", statusCode, {
						headers,
						data: { count: this.retryCount }
					}));
					return false;
				}
				const { start, size, end = size - 1 } = contentRange;
				assert$15(this.start === start, "content-range mismatch");
				assert$15(this.end == null || this.end === end, "content-range mismatch");
				this.resume = resume$2;
				return true;
			}
			if (this.end == null) {
				if (statusCode === 206) {
					const range = parseRangeHeader(headers["content-range"]);
					if (range == null) return this.handler.onHeaders(statusCode, rawHeaders, resume$2, statusMessage);
					const { start, size, end = size - 1 } = range;
					assert$15(start != null && Number.isFinite(start), "content-range mismatch");
					assert$15(end != null && Number.isFinite(end), "invalid content-length");
					this.start = start;
					this.end = end;
				}
				if (this.end == null) {
					const contentLength = headers["content-length"];
					this.end = contentLength != null ? Number(contentLength) - 1 : null;
				}
				assert$15(Number.isFinite(this.start));
				assert$15(this.end == null || Number.isFinite(this.end), "invalid content-length");
				this.resume = resume$2;
				this.etag = headers.etag != null ? headers.etag : null;
				if (this.etag != null && this.etag.startsWith("W/")) this.etag = null;
				return this.handler.onHeaders(statusCode, rawHeaders, resume$2, statusMessage);
			}
			const err = new RequestRetryError("Request failed", statusCode, {
				headers,
				data: { count: this.retryCount }
			});
			this.abort(err);
			return false;
		}
		onData(chunk) {
			this.start += chunk.length;
			return this.handler.onData(chunk);
		}
		onComplete(rawTrailers) {
			this.retryCount = 0;
			return this.handler.onComplete(rawTrailers);
		}
		onError(err) {
			if (this.aborted || isDisturbed$1(this.opts.body)) return this.handler.onError(err);
			if (this.retryCount - this.retryCountCheckpoint > 0) this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint);
			else this.retryCount += 1;
			this.retryOpts.retry(err, {
				state: { counter: this.retryCount },
				opts: {
					retryOptions: this.retryOpts,
					...this.opts
				}
			}, onRetry.bind(this));
			function onRetry(err$1) {
				if (err$1 != null || this.aborted || isDisturbed$1(this.opts.body)) return this.handler.onError(err$1);
				if (this.start !== 0) {
					const headers = { range: `bytes=${this.start}-${this.end ?? ""}` };
					if (this.etag != null) headers["if-match"] = this.etag;
					this.opts = {
						...this.opts,
						headers: {
							...this.opts.headers,
							...headers
						}
					};
				}
				try {
					this.retryCountCheckpoint = this.retryCount;
					this.dispatch(this.opts, this);
				} catch (err$2) {
					this.handler.onError(err$2);
				}
			}
		}
	};
}));
var require_retry_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var Dispatcher$3 = require_dispatcher();
	var RetryHandler$2 = require_retry_handler();
	var RetryAgent$1 = class extends Dispatcher$3 {
		#agent = null;
		#options = null;
		constructor(agent, options = {}) {
			super(options);
			this.#agent = agent;
			this.#options = options;
		}
		dispatch(opts, handler) {
			const retry = new RetryHandler$2({
				...opts,
				retryOptions: this.#options
			}, {
				dispatch: this.#agent.dispatch.bind(this.#agent),
				handler
			});
			return this.#agent.dispatch(opts, retry);
		}
		close() {
			return this.#agent.close();
		}
		destroy() {
			return this.#agent.destroy();
		}
	};
	module.exports = RetryAgent$1;
}));
var require_readable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$14 = require("node:assert");
	var { Readable: Readable$3 } = require("node:stream");
	var { RequestAbortedError: RequestAbortedError$4, NotSupportedError, InvalidArgumentError: InvalidArgumentError$13, AbortError } = require_errors$1();
	var util$16 = require_util$9();
	var { ReadableStreamFrom } = require_util$9();
	var kConsume = Symbol("kConsume");
	var kReading = Symbol("kReading");
	var kBody = Symbol("kBody");
	var kAbort = Symbol("kAbort");
	var kContentType = Symbol("kContentType");
	var kContentLength$1 = Symbol("kContentLength");
	var noop$1 = () => {};
	var BodyReadable = class extends Readable$3 {
		constructor({ resume: resume$2, abort: abort$4, contentType: contentType$1 = "", contentLength, highWaterMark = 64 * 1024 }) {
			super({
				autoDestroy: true,
				read: resume$2,
				highWaterMark
			});
			this._readableState.dataEmitted = false;
			this[kAbort] = abort$4;
			this[kConsume] = null;
			this[kBody] = null;
			this[kContentType] = contentType$1;
			this[kContentLength$1] = contentLength;
			this[kReading] = false;
		}
		destroy(err) {
			if (!err && !this._readableState.endEmitted) err = new RequestAbortedError$4();
			if (err) this[kAbort]();
			return super.destroy(err);
		}
		_destroy(err, callback) {
			if (!this[kReading]) setImmediate(() => {
				callback(err);
			});
			else callback(err);
		}
		on(ev, ...args) {
			if (ev === "data" || ev === "readable") this[kReading] = true;
			return super.on(ev, ...args);
		}
		addListener(ev, ...args) {
			return this.on(ev, ...args);
		}
		off(ev, ...args) {
			const ret = super.off(ev, ...args);
			if (ev === "data" || ev === "readable") this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0;
			return ret;
		}
		removeListener(ev, ...args) {
			return this.off(ev, ...args);
		}
		push(chunk) {
			if (this[kConsume] && chunk !== null) {
				consumePush(this[kConsume], chunk);
				return this[kReading] ? super.push(chunk) : true;
			}
			return super.push(chunk);
		}
		async text() {
			return consume(this, "text");
		}
		async json() {
			return consume(this, "json");
		}
		async blob() {
			return consume(this, "blob");
		}
		async bytes() {
			return consume(this, "bytes");
		}
		async arrayBuffer() {
			return consume(this, "arrayBuffer");
		}
		async formData() {
			throw new NotSupportedError();
		}
		get bodyUsed() {
			return util$16.isDisturbed(this);
		}
		get body() {
			if (!this[kBody]) {
				this[kBody] = ReadableStreamFrom(this);
				if (this[kConsume]) {
					this[kBody].getReader();
					assert$14(this[kBody].locked);
				}
			}
			return this[kBody];
		}
		async dump(opts) {
			let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024;
			const signal = opts?.signal;
			if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) throw new InvalidArgumentError$13("signal must be an AbortSignal");
			signal?.throwIfAborted();
			if (this._readableState.closeEmitted) return null;
			return await new Promise((resolve, reject) => {
				if (this[kContentLength$1] > limit) this.destroy(new AbortError());
				const onAbort = () => {
					this.destroy(signal.reason ?? new AbortError());
				};
				signal?.addEventListener("abort", onAbort);
				this.on("close", function() {
					signal?.removeEventListener("abort", onAbort);
					if (signal?.aborted) reject(signal.reason ?? new AbortError());
					else resolve(null);
				}).on("error", noop$1).on("data", function(chunk) {
					limit -= chunk.length;
					if (limit <= 0) this.destroy();
				}).resume();
			});
		}
	};
	function isLocked(self$1) {
		return self$1[kBody] && self$1[kBody].locked === true || self$1[kConsume];
	}
	function isUnusable(self$1) {
		return util$16.isDisturbed(self$1) || isLocked(self$1);
	}
	async function consume(stream$7, type) {
		assert$14(!stream$7[kConsume]);
		return new Promise((resolve, reject) => {
			if (isUnusable(stream$7)) {
				const rState = stream$7._readableState;
				if (rState.destroyed && rState.closeEmitted === false) stream$7.on("error", (err) => {
					reject(err);
				}).on("close", () => {
					reject(/* @__PURE__ */ new TypeError("unusable"));
				});
				else reject(rState.errored ?? /* @__PURE__ */ new TypeError("unusable"));
			} else queueMicrotask(() => {
				stream$7[kConsume] = {
					type,
					stream: stream$7,
					resolve,
					reject,
					length: 0,
					body: []
				};
				stream$7.on("error", function(err) {
					consumeFinish(this[kConsume], err);
				}).on("close", function() {
					if (this[kConsume].body !== null) consumeFinish(this[kConsume], new RequestAbortedError$4());
				});
				consumeStart(stream$7[kConsume]);
			});
		});
	}
	function consumeStart(consume$1) {
		if (consume$1.body === null) return;
		const { _readableState: state$1 } = consume$1.stream;
		if (state$1.bufferIndex) {
			const start = state$1.bufferIndex;
			const end = state$1.buffer.length;
			for (let n$1 = start; n$1 < end; n$1++) consumePush(consume$1, state$1.buffer[n$1]);
		} else for (const chunk of state$1.buffer) consumePush(consume$1, chunk);
		if (state$1.endEmitted) consumeEnd(this[kConsume]);
		else consume$1.stream.on("end", function() {
			consumeEnd(this[kConsume]);
		});
		consume$1.stream.resume();
		while (consume$1.stream.read() != null);
	}
	function chunksDecode$1(chunks, length) {
		if (chunks.length === 0 || length === 0) return "";
		const buffer$1 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length);
		const bufferLength = buffer$1.length;
		const start = bufferLength > 2 && buffer$1[0] === 239 && buffer$1[1] === 187 && buffer$1[2] === 191 ? 3 : 0;
		return buffer$1.utf8Slice(start, bufferLength);
	}
	function chunksConcat(chunks, length) {
		if (chunks.length === 0 || length === 0) return new Uint8Array(0);
		if (chunks.length === 1) return new Uint8Array(chunks[0]);
		const buffer$1 = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer);
		let offset = 0;
		for (let i = 0; i < chunks.length; ++i) {
			const chunk = chunks[i];
			buffer$1.set(chunk, offset);
			offset += chunk.length;
		}
		return buffer$1;
	}
	function consumeEnd(consume$1) {
		const { type, body, resolve, stream: stream$7, length } = consume$1;
		try {
			if (type === "text") resolve(chunksDecode$1(body, length));
			else if (type === "json") resolve(JSON.parse(chunksDecode$1(body, length)));
			else if (type === "arrayBuffer") resolve(chunksConcat(body, length).buffer);
			else if (type === "blob") resolve(new Blob(body, { type: stream$7[kContentType] }));
			else if (type === "bytes") resolve(chunksConcat(body, length));
			consumeFinish(consume$1);
		} catch (err) {
			stream$7.destroy(err);
		}
	}
	function consumePush(consume$1, chunk) {
		consume$1.length += chunk.length;
		consume$1.body.push(chunk);
	}
	function consumeFinish(consume$1, err) {
		if (consume$1.body === null) return;
		if (err) consume$1.reject(err);
		else consume$1.resolve();
		consume$1.type = null;
		consume$1.stream = null;
		consume$1.resolve = null;
		consume$1.reject = null;
		consume$1.length = 0;
		consume$1.body = null;
	}
	module.exports = {
		Readable: BodyReadable,
		chunksDecode: chunksDecode$1
	};
}));
var require_util$7 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$13 = require("node:assert");
	var { ResponseStatusCodeError } = require_errors$1();
	var { chunksDecode } = require_readable();
	var CHUNK_LIMIT = 128 * 1024;
	async function getResolveErrorBodyCallback$2({ callback, body, contentType: contentType$1, statusCode, statusMessage, headers }) {
		assert$13(body);
		let chunks = [];
		let length = 0;
		try {
			for await (const chunk of body) {
				chunks.push(chunk);
				length += chunk.length;
				if (length > CHUNK_LIMIT) {
					chunks = [];
					length = 0;
					break;
				}
			}
		} catch {
			chunks = [];
			length = 0;
		}
		const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`;
		if (statusCode === 204 || !contentType$1 || !length) {
			queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)));
			return;
		}
		const stackTraceLimit = Error.stackTraceLimit;
		Error.stackTraceLimit = 0;
		let payload;
		try {
			if (isContentTypeApplicationJson(contentType$1)) payload = JSON.parse(chunksDecode(chunks, length));
			else if (isContentTypeText(contentType$1)) payload = chunksDecode(chunks, length);
		} catch {} finally {
			Error.stackTraceLimit = stackTraceLimit;
		}
		queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)));
	}
	var isContentTypeApplicationJson = (contentType$1) => {
		return contentType$1.length > 15 && contentType$1[11] === "/" && contentType$1[0] === "a" && contentType$1[1] === "p" && contentType$1[2] === "p" && contentType$1[3] === "l" && contentType$1[4] === "i" && contentType$1[5] === "c" && contentType$1[6] === "a" && contentType$1[7] === "t" && contentType$1[8] === "i" && contentType$1[9] === "o" && contentType$1[10] === "n" && contentType$1[12] === "j" && contentType$1[13] === "s" && contentType$1[14] === "o" && contentType$1[15] === "n";
	};
	var isContentTypeText = (contentType$1) => {
		return contentType$1.length > 4 && contentType$1[4] === "/" && contentType$1[0] === "t" && contentType$1[1] === "e" && contentType$1[2] === "x" && contentType$1[3] === "t";
	};
	module.exports = {
		getResolveErrorBodyCallback: getResolveErrorBodyCallback$2,
		isContentTypeApplicationJson,
		isContentTypeText
	};
}));
var require_api_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$12 = require("node:assert");
	var { Readable: Readable$2 } = require_readable();
	var { InvalidArgumentError: InvalidArgumentError$12, RequestAbortedError: RequestAbortedError$3 } = require_errors$1();
	var util$15 = require_util$9();
	var { getResolveErrorBodyCallback: getResolveErrorBodyCallback$1 } = require_util$7();
	var { AsyncResource: AsyncResource$4 } = require("node:async_hooks");
	var RequestHandler = class extends AsyncResource$4 {
		constructor(opts, callback) {
			if (!opts || typeof opts !== "object") throw new InvalidArgumentError$12("invalid opts");
			const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts;
			try {
				if (typeof callback !== "function") throw new InvalidArgumentError$12("invalid callback");
				if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) throw new InvalidArgumentError$12("invalid highWaterMark");
				if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError$12("signal must be an EventEmitter or EventTarget");
				if (method === "CONNECT") throw new InvalidArgumentError$12("invalid method");
				if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError$12("invalid onInfo callback");
				super("UNDICI_REQUEST");
			} catch (err) {
				if (util$15.isStream(body)) util$15.destroy(body.on("error", util$15.nop), err);
				throw err;
			}
			this.method = method;
			this.responseHeaders = responseHeaders || null;
			this.opaque = opaque || null;
			this.callback = callback;
			this.res = null;
			this.abort = null;
			this.body = body;
			this.trailers = {};
			this.context = null;
			this.onInfo = onInfo || null;
			this.throwOnError = throwOnError;
			this.highWaterMark = highWaterMark;
			this.signal = signal;
			this.reason = null;
			this.removeAbortListener = null;
			if (util$15.isStream(body)) body.on("error", (err) => {
				this.onError(err);
			});
			if (this.signal) if (this.signal.aborted) this.reason = this.signal.reason ?? new RequestAbortedError$3();
			else this.removeAbortListener = util$15.addAbortListener(this.signal, () => {
				this.reason = this.signal.reason ?? new RequestAbortedError$3();
				if (this.res) util$15.destroy(this.res.on("error", util$15.nop), this.reason);
				else if (this.abort) this.abort(this.reason);
				if (this.removeAbortListener) {
					this.res?.off("close", this.removeAbortListener);
					this.removeAbortListener();
					this.removeAbortListener = null;
				}
			});
		}
		onConnect(abort$4, context) {
			if (this.reason) {
				abort$4(this.reason);
				return;
			}
			assert$12(this.callback);
			this.abort = abort$4;
			this.context = context;
		}
		onHeaders(statusCode, rawHeaders, resume$2, statusMessage) {
			const { callback, opaque, abort: abort$4, context, responseHeaders, highWaterMark } = this;
			const headers = responseHeaders === "raw" ? util$15.parseRawHeaders(rawHeaders) : util$15.parseHeaders(rawHeaders);
			if (statusCode < 200) {
				if (this.onInfo) this.onInfo({
					statusCode,
					headers
				});
				return;
			}
			const parsedHeaders = responseHeaders === "raw" ? util$15.parseHeaders(rawHeaders) : headers;
			const contentType$1 = parsedHeaders["content-type"];
			const contentLength = parsedHeaders["content-length"];
			const res = new Readable$2({
				resume: resume$2,
				abort: abort$4,
				contentType: contentType$1,
				contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null,
				highWaterMark
			});
			if (this.removeAbortListener) res.on("close", this.removeAbortListener);
			this.callback = null;
			this.res = res;
			if (callback !== null) if (this.throwOnError && statusCode >= 400) this.runInAsyncScope(getResolveErrorBodyCallback$1, null, {
				callback,
				body: res,
				contentType: contentType$1,
				statusCode,
				statusMessage,
				headers
			});
			else this.runInAsyncScope(callback, null, null, {
				statusCode,
				headers,
				trailers: this.trailers,
				opaque,
				body: res,
				context
			});
		}
		onData(chunk) {
			return this.res.push(chunk);
		}
		onComplete(trailers) {
			util$15.parseHeaders(trailers, this.trailers);
			this.res.push(null);
		}
		onError(err) {
			const { res, callback, body, opaque } = this;
			if (callback) {
				this.callback = null;
				queueMicrotask(() => {
					this.runInAsyncScope(callback, null, err, { opaque });
				});
			}
			if (res) {
				this.res = null;
				queueMicrotask(() => {
					util$15.destroy(res, err);
				});
			}
			if (body) {
				this.body = null;
				util$15.destroy(body, err);
			}
			if (this.removeAbortListener) {
				res?.off("close", this.removeAbortListener);
				this.removeAbortListener();
				this.removeAbortListener = null;
			}
		}
	};
	function request(opts, callback) {
		if (callback === void 0) return new Promise((resolve, reject) => {
			request.call(this, opts, (err, data$1) => {
				return err ? reject(err) : resolve(data$1);
			});
		});
		try {
			this.dispatch(opts, new RequestHandler(opts, callback));
		} catch (err) {
			if (typeof callback !== "function") throw err;
			const opaque = opts?.opaque;
			queueMicrotask(() => callback(err, { opaque }));
		}
	}
	module.exports = request;
	module.exports.RequestHandler = RequestHandler;
}));
var require_abort_signal = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { addAbortListener: addAbortListener$1 } = require_util$9();
	var { RequestAbortedError: RequestAbortedError$2 } = require_errors$1();
	var kListener = Symbol("kListener");
	var kSignal$1 = Symbol("kSignal");
	function abort(self$1) {
		if (self$1.abort) self$1.abort(self$1[kSignal$1]?.reason);
		else self$1.reason = self$1[kSignal$1]?.reason ?? new RequestAbortedError$2();
		removeSignal$4(self$1);
	}
	function addSignal$4(self$1, signal) {
		self$1.reason = null;
		self$1[kSignal$1] = null;
		self$1[kListener] = null;
		if (!signal) return;
		if (signal.aborted) {
			abort(self$1);
			return;
		}
		self$1[kSignal$1] = signal;
		self$1[kListener] = () => {
			abort(self$1);
		};
		addAbortListener$1(self$1[kSignal$1], self$1[kListener]);
	}
	function removeSignal$4(self$1) {
		if (!self$1[kSignal$1]) return;
		if ("removeEventListener" in self$1[kSignal$1]) self$1[kSignal$1].removeEventListener("abort", self$1[kListener]);
		else self$1[kSignal$1].removeListener("abort", self$1[kListener]);
		self$1[kSignal$1] = null;
		self$1[kListener] = null;
	}
	module.exports = {
		addSignal: addSignal$4,
		removeSignal: removeSignal$4
	};
}));
var require_api_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$11 = require("node:assert");
	var { finished: finished$1, PassThrough: PassThrough$1 } = require("node:stream");
	var { InvalidArgumentError: InvalidArgumentError$11, InvalidReturnValueError: InvalidReturnValueError$1 } = require_errors$1();
	var util$14 = require_util$9();
	var { getResolveErrorBodyCallback } = require_util$7();
	var { AsyncResource: AsyncResource$3 } = require("node:async_hooks");
	var { addSignal: addSignal$3, removeSignal: removeSignal$3 } = require_abort_signal();
	var StreamHandler = class extends AsyncResource$3 {
		constructor(opts, factory$1, callback) {
			if (!opts || typeof opts !== "object") throw new InvalidArgumentError$11("invalid opts");
			const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts;
			try {
				if (typeof callback !== "function") throw new InvalidArgumentError$11("invalid callback");
				if (typeof factory$1 !== "function") throw new InvalidArgumentError$11("invalid factory");
				if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError$11("signal must be an EventEmitter or EventTarget");
				if (method === "CONNECT") throw new InvalidArgumentError$11("invalid method");
				if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError$11("invalid onInfo callback");
				super("UNDICI_STREAM");
			} catch (err) {
				if (util$14.isStream(body)) util$14.destroy(body.on("error", util$14.nop), err);
				throw err;
			}
			this.responseHeaders = responseHeaders || null;
			this.opaque = opaque || null;
			this.factory = factory$1;
			this.callback = callback;
			this.res = null;
			this.abort = null;
			this.context = null;
			this.trailers = null;
			this.body = body;
			this.onInfo = onInfo || null;
			this.throwOnError = throwOnError || false;
			if (util$14.isStream(body)) body.on("error", (err) => {
				this.onError(err);
			});
			addSignal$3(this, signal);
		}
		onConnect(abort$4, context) {
			if (this.reason) {
				abort$4(this.reason);
				return;
			}
			assert$11(this.callback);
			this.abort = abort$4;
			this.context = context;
		}
		onHeaders(statusCode, rawHeaders, resume$2, statusMessage) {
			const { factory: factory$1, opaque, context, callback, responseHeaders } = this;
			const headers = responseHeaders === "raw" ? util$14.parseRawHeaders(rawHeaders) : util$14.parseHeaders(rawHeaders);
			if (statusCode < 200) {
				if (this.onInfo) this.onInfo({
					statusCode,
					headers
				});
				return;
			}
			this.factory = null;
			let res;
			if (this.throwOnError && statusCode >= 400) {
				const contentType$1 = (responseHeaders === "raw" ? util$14.parseHeaders(rawHeaders) : headers)["content-type"];
				res = new PassThrough$1();
				this.callback = null;
				this.runInAsyncScope(getResolveErrorBodyCallback, null, {
					callback,
					body: res,
					contentType: contentType$1,
					statusCode,
					statusMessage,
					headers
				});
			} else {
				if (factory$1 === null) return;
				res = this.runInAsyncScope(factory$1, null, {
					statusCode,
					headers,
					opaque,
					context
				});
				if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") throw new InvalidReturnValueError$1("expected Writable");
				finished$1(res, { readable: false }, (err) => {
					const { callback: callback$1, res: res$1, opaque: opaque$1, trailers, abort: abort$4 } = this;
					this.res = null;
					if (err || !res$1.readable) util$14.destroy(res$1, err);
					this.callback = null;
					this.runInAsyncScope(callback$1, null, err || null, {
						opaque: opaque$1,
						trailers
					});
					if (err) abort$4();
				});
			}
			res.on("drain", resume$2);
			this.res = res;
			return (res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain) !== true;
		}
		onData(chunk) {
			const { res } = this;
			return res ? res.write(chunk) : true;
		}
		onComplete(trailers) {
			const { res } = this;
			removeSignal$3(this);
			if (!res) return;
			this.trailers = util$14.parseHeaders(trailers);
			res.end();
		}
		onError(err) {
			const { res, callback, opaque, body } = this;
			removeSignal$3(this);
			this.factory = null;
			if (res) {
				this.res = null;
				util$14.destroy(res, err);
			} else if (callback) {
				this.callback = null;
				queueMicrotask(() => {
					this.runInAsyncScope(callback, null, err, { opaque });
				});
			}
			if (body) {
				this.body = null;
				util$14.destroy(body, err);
			}
		}
	};
	function stream$1(opts, factory$1, callback) {
		if (callback === void 0) return new Promise((resolve, reject) => {
			stream$1.call(this, opts, factory$1, (err, data$1) => {
				return err ? reject(err) : resolve(data$1);
			});
		});
		try {
			this.dispatch(opts, new StreamHandler(opts, factory$1, callback));
		} catch (err) {
			if (typeof callback !== "function") throw err;
			const opaque = opts?.opaque;
			queueMicrotask(() => callback(err, { opaque }));
		}
	}
	module.exports = stream$1;
}));
var require_api_pipeline = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Readable: Readable$1, Duplex, PassThrough } = require("node:stream");
	var { InvalidArgumentError: InvalidArgumentError$10, InvalidReturnValueError, RequestAbortedError: RequestAbortedError$1 } = require_errors$1();
	var util$13 = require_util$9();
	var { AsyncResource: AsyncResource$2 } = require("node:async_hooks");
	var { addSignal: addSignal$2, removeSignal: removeSignal$2 } = require_abort_signal();
	var assert$10 = require("node:assert");
	var kResume = Symbol("resume");
	var PipelineRequest = class extends Readable$1 {
		constructor() {
			super({ autoDestroy: true });
			this[kResume] = null;
		}
		_read() {
			const { [kResume]: resume$2 } = this;
			if (resume$2) {
				this[kResume] = null;
				resume$2();
			}
		}
		_destroy(err, callback) {
			this._read();
			callback(err);
		}
	};
	var PipelineResponse = class extends Readable$1 {
		constructor(resume$2) {
			super({ autoDestroy: true });
			this[kResume] = resume$2;
		}
		_read() {
			this[kResume]();
		}
		_destroy(err, callback) {
			if (!err && !this._readableState.endEmitted) err = new RequestAbortedError$1();
			callback(err);
		}
	};
	var PipelineHandler = class extends AsyncResource$2 {
		constructor(opts, handler) {
			if (!opts || typeof opts !== "object") throw new InvalidArgumentError$10("invalid opts");
			if (typeof handler !== "function") throw new InvalidArgumentError$10("invalid handler");
			const { signal, method, opaque, onInfo, responseHeaders } = opts;
			if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError$10("signal must be an EventEmitter or EventTarget");
			if (method === "CONNECT") throw new InvalidArgumentError$10("invalid method");
			if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError$10("invalid onInfo callback");
			super("UNDICI_PIPELINE");
			this.opaque = opaque || null;
			this.responseHeaders = responseHeaders || null;
			this.handler = handler;
			this.abort = null;
			this.context = null;
			this.onInfo = onInfo || null;
			this.req = new PipelineRequest().on("error", util$13.nop);
			this.ret = new Duplex({
				readableObjectMode: opts.objectMode,
				autoDestroy: true,
				read: () => {
					const { body } = this;
					if (body?.resume) body.resume();
				},
				write: (chunk, encoding, callback) => {
					const { req: req$1 } = this;
					if (req$1.push(chunk, encoding) || req$1._readableState.destroyed) callback();
					else req$1[kResume] = callback;
				},
				destroy: (err, callback) => {
					const { body, req: req$1, res, ret, abort: abort$4 } = this;
					if (!err && !ret._readableState.endEmitted) err = new RequestAbortedError$1();
					if (abort$4 && err) abort$4();
					util$13.destroy(body, err);
					util$13.destroy(req$1, err);
					util$13.destroy(res, err);
					removeSignal$2(this);
					callback(err);
				}
			}).on("prefinish", () => {
				const { req: req$1 } = this;
				req$1.push(null);
			});
			this.res = null;
			addSignal$2(this, signal);
		}
		onConnect(abort$4, context) {
			const { ret, res } = this;
			if (this.reason) {
				abort$4(this.reason);
				return;
			}
			assert$10(!res, "pipeline cannot be retried");
			assert$10(!ret.destroyed);
			this.abort = abort$4;
			this.context = context;
		}
		onHeaders(statusCode, rawHeaders, resume$2) {
			const { opaque, handler, context } = this;
			if (statusCode < 200) {
				if (this.onInfo) {
					const headers = this.responseHeaders === "raw" ? util$13.parseRawHeaders(rawHeaders) : util$13.parseHeaders(rawHeaders);
					this.onInfo({
						statusCode,
						headers
					});
				}
				return;
			}
			this.res = new PipelineResponse(resume$2);
			let body;
			try {
				this.handler = null;
				const headers = this.responseHeaders === "raw" ? util$13.parseRawHeaders(rawHeaders) : util$13.parseHeaders(rawHeaders);
				body = this.runInAsyncScope(handler, null, {
					statusCode,
					headers,
					opaque,
					body: this.res,
					context
				});
			} catch (err) {
				this.res.on("error", util$13.nop);
				throw err;
			}
			if (!body || typeof body.on !== "function") throw new InvalidReturnValueError("expected Readable");
			body.on("data", (chunk) => {
				const { ret, body: body$1 } = this;
				if (!ret.push(chunk) && body$1.pause) body$1.pause();
			}).on("error", (err) => {
				const { ret } = this;
				util$13.destroy(ret, err);
			}).on("end", () => {
				const { ret } = this;
				ret.push(null);
			}).on("close", () => {
				const { ret } = this;
				if (!ret._readableState.ended) util$13.destroy(ret, new RequestAbortedError$1());
			});
			this.body = body;
		}
		onData(chunk) {
			const { res } = this;
			return res.push(chunk);
		}
		onComplete(trailers) {
			const { res } = this;
			res.push(null);
		}
		onError(err) {
			const { ret } = this;
			this.handler = null;
			util$13.destroy(ret, err);
		}
	};
	function pipeline$2(opts, handler) {
		try {
			const pipelineHandler = new PipelineHandler(opts, handler);
			this.dispatch({
				...opts,
				body: pipelineHandler.req
			}, pipelineHandler);
			return pipelineHandler.ret;
		} catch (err) {
			return new PassThrough().destroy(err);
		}
	}
	module.exports = pipeline$2;
}));
var require_api_upgrade = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { InvalidArgumentError: InvalidArgumentError$9, SocketError: SocketError$1 } = require_errors$1();
	var { AsyncResource: AsyncResource$1 } = require("node:async_hooks");
	var util$12 = require_util$9();
	var { addSignal: addSignal$1, removeSignal: removeSignal$1 } = require_abort_signal();
	var assert$9 = require("node:assert");
	var UpgradeHandler = class extends AsyncResource$1 {
		constructor(opts, callback) {
			if (!opts || typeof opts !== "object") throw new InvalidArgumentError$9("invalid opts");
			if (typeof callback !== "function") throw new InvalidArgumentError$9("invalid callback");
			const { signal, opaque, responseHeaders } = opts;
			if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError$9("signal must be an EventEmitter or EventTarget");
			super("UNDICI_UPGRADE");
			this.responseHeaders = responseHeaders || null;
			this.opaque = opaque || null;
			this.callback = callback;
			this.abort = null;
			this.context = null;
			addSignal$1(this, signal);
		}
		onConnect(abort$4, context) {
			if (this.reason) {
				abort$4(this.reason);
				return;
			}
			assert$9(this.callback);
			this.abort = abort$4;
			this.context = null;
		}
		onHeaders() {
			throw new SocketError$1("bad upgrade", null);
		}
		onUpgrade(statusCode, rawHeaders, socket) {
			assert$9(statusCode === 101);
			const { callback, opaque, context } = this;
			removeSignal$1(this);
			this.callback = null;
			const headers = this.responseHeaders === "raw" ? util$12.parseRawHeaders(rawHeaders) : util$12.parseHeaders(rawHeaders);
			this.runInAsyncScope(callback, null, null, {
				headers,
				socket,
				opaque,
				context
			});
		}
		onError(err) {
			const { callback, opaque } = this;
			removeSignal$1(this);
			if (callback) {
				this.callback = null;
				queueMicrotask(() => {
					this.runInAsyncScope(callback, null, err, { opaque });
				});
			}
		}
	};
	function upgrade(opts, callback) {
		if (callback === void 0) return new Promise((resolve, reject) => {
			upgrade.call(this, opts, (err, data$1) => {
				return err ? reject(err) : resolve(data$1);
			});
		});
		try {
			const upgradeHandler = new UpgradeHandler(opts, callback);
			this.dispatch({
				...opts,
				method: opts.method || "GET",
				upgrade: opts.protocol || "Websocket"
			}, upgradeHandler);
		} catch (err) {
			if (typeof callback !== "function") throw err;
			const opaque = opts?.opaque;
			queueMicrotask(() => callback(err, { opaque }));
		}
	}
	module.exports = upgrade;
}));
var require_api_connect = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$8 = require("node:assert");
	var { AsyncResource } = require("node:async_hooks");
	var { InvalidArgumentError: InvalidArgumentError$8, SocketError } = require_errors$1();
	var util$11 = require_util$9();
	var { addSignal, removeSignal } = require_abort_signal();
	var ConnectHandler = class extends AsyncResource {
		constructor(opts, callback) {
			if (!opts || typeof opts !== "object") throw new InvalidArgumentError$8("invalid opts");
			if (typeof callback !== "function") throw new InvalidArgumentError$8("invalid callback");
			const { signal, opaque, responseHeaders } = opts;
			if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError$8("signal must be an EventEmitter or EventTarget");
			super("UNDICI_CONNECT");
			this.opaque = opaque || null;
			this.responseHeaders = responseHeaders || null;
			this.callback = callback;
			this.abort = null;
			addSignal(this, signal);
		}
		onConnect(abort$4, context) {
			if (this.reason) {
				abort$4(this.reason);
				return;
			}
			assert$8(this.callback);
			this.abort = abort$4;
			this.context = context;
		}
		onHeaders() {
			throw new SocketError("bad connect", null);
		}
		onUpgrade(statusCode, rawHeaders, socket) {
			const { callback, opaque, context } = this;
			removeSignal(this);
			this.callback = null;
			let headers = rawHeaders;
			if (headers != null) headers = this.responseHeaders === "raw" ? util$11.parseRawHeaders(rawHeaders) : util$11.parseHeaders(rawHeaders);
			this.runInAsyncScope(callback, null, null, {
				statusCode,
				headers,
				socket,
				opaque,
				context
			});
		}
		onError(err) {
			const { callback, opaque } = this;
			removeSignal(this);
			if (callback) {
				this.callback = null;
				queueMicrotask(() => {
					this.runInAsyncScope(callback, null, err, { opaque });
				});
			}
		}
	};
	function connect(opts, callback) {
		if (callback === void 0) return new Promise((resolve, reject) => {
			connect.call(this, opts, (err, data$1) => {
				return err ? reject(err) : resolve(data$1);
			});
		});
		try {
			const connectHandler = new ConnectHandler(opts, callback);
			this.dispatch({
				...opts,
				method: "CONNECT"
			}, connectHandler);
		} catch (err) {
			if (typeof callback !== "function") throw err;
			const opaque = opts?.opaque;
			queueMicrotask(() => callback(err, { opaque }));
		}
	}
	module.exports = connect;
}));
var require_api = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports.request = require_api_request();
	module.exports.stream = require_api_stream();
	module.exports.pipeline = require_api_pipeline();
	module.exports.upgrade = require_api_upgrade();
	module.exports.connect = require_api_connect();
}));
var require_mock_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { UndiciError: UndiciError$1 } = require_errors$1();
	var kMockNotMatchedError = Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");
	module.exports = { MockNotMatchedError: class MockNotMatchedError$1 extends UndiciError$1 {
		constructor(message) {
			super(message);
			Error.captureStackTrace(this, MockNotMatchedError$1);
			this.name = "MockNotMatchedError";
			this.message = message || "The request does not match any registered mock dispatches";
			this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED";
		}
		static [Symbol.hasInstance](instance) {
			return instance && instance[kMockNotMatchedError] === true;
		}
		[kMockNotMatchedError] = true;
	} };
}));
var require_mock_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		kAgent: Symbol("agent"),
		kOptions: Symbol("options"),
		kFactory: Symbol("factory"),
		kDispatches: Symbol("dispatches"),
		kDispatchKey: Symbol("dispatch key"),
		kDefaultHeaders: Symbol("default headers"),
		kDefaultTrailers: Symbol("default trailers"),
		kContentLength: Symbol("content length"),
		kMockAgent: Symbol("mock agent"),
		kMockAgentSet: Symbol("mock agent set"),
		kMockAgentGet: Symbol("mock agent get"),
		kMockDispatch: Symbol("mock dispatch"),
		kClose: Symbol("close"),
		kOriginalClose: Symbol("original agent close"),
		kOrigin: Symbol("origin"),
		kIsMockActive: Symbol("is mock active"),
		kNetConnect: Symbol("net connect"),
		kGetNetConnect: Symbol("get net connect"),
		kConnected: Symbol("connected")
	};
}));
var require_mock_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { MockNotMatchedError } = require_mock_errors();
	var { kDispatches: kDispatches$4, kMockAgent: kMockAgent$2, kOriginalDispatch: kOriginalDispatch$2, kOrigin: kOrigin$2, kGetNetConnect: kGetNetConnect$1 } = require_mock_symbols();
	var { buildURL: buildURL$1 } = require_util$9();
	var { STATUS_CODES: STATUS_CODES$1 } = require("node:http");
	var { types: { isPromise } } = require("node:util");
	function matchValue$1(match, value) {
		if (typeof match === "string") return match === value;
		if (match instanceof RegExp) return match.test(value);
		if (typeof match === "function") return match(value) === true;
		return false;
	}
	function lowerCaseEntries(headers) {
		return Object.fromEntries(Object.entries(headers).map(([headerName, headerValue]) => {
			return [headerName.toLocaleLowerCase(), headerValue];
		}));
	}
	function getHeaderByName(headers, key) {
		if (Array.isArray(headers)) {
			for (let i = 0; i < headers.length; i += 2) if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) return headers[i + 1];
			return;
		} else if (typeof headers.get === "function") return headers.get(key);
		else return lowerCaseEntries(headers)[key.toLocaleLowerCase()];
	}
	function buildHeadersFromArray(headers) {
		const clone = headers.slice();
		const entries = [];
		for (let index = 0; index < clone.length; index += 2) entries.push([clone[index], clone[index + 1]]);
		return Object.fromEntries(entries);
	}
	function matchHeaders(mockDispatch$1, headers) {
		if (typeof mockDispatch$1.headers === "function") {
			if (Array.isArray(headers)) headers = buildHeadersFromArray(headers);
			return mockDispatch$1.headers(headers ? lowerCaseEntries(headers) : {});
		}
		if (typeof mockDispatch$1.headers === "undefined") return true;
		if (typeof headers !== "object" || typeof mockDispatch$1.headers !== "object") return false;
		for (const [matchHeaderName, matchHeaderValue$1] of Object.entries(mockDispatch$1.headers)) if (!matchValue$1(matchHeaderValue$1, getHeaderByName(headers, matchHeaderName))) return false;
		return true;
	}
	function safeUrl(path$1) {
		if (typeof path$1 !== "string") return path$1;
		const pathSegments = path$1.split("?");
		if (pathSegments.length !== 2) return path$1;
		const qp = new URLSearchParams(pathSegments.pop());
		qp.sort();
		return [...pathSegments, qp.toString()].join("?");
	}
	function matchKey(mockDispatch$1, { path: path$1, method, body, headers }) {
		const pathMatch = matchValue$1(mockDispatch$1.path, path$1);
		const methodMatch = matchValue$1(mockDispatch$1.method, method);
		const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
		const headersMatch = matchHeaders(mockDispatch$1, headers);
		return pathMatch && methodMatch && bodyMatch && headersMatch;
	}
	function getResponseData$1(data$1) {
		if (Buffer.isBuffer(data$1)) return data$1;
		else if (data$1 instanceof Uint8Array) return data$1;
		else if (data$1 instanceof ArrayBuffer) return data$1;
		else if (typeof data$1 === "object") return JSON.stringify(data$1);
		else return data$1.toString();
	}
	function getMockDispatch(mockDispatches, key) {
		const basePath = key.query ? buildURL$1(key.path, key.query) : key.path;
		const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
		let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$1 }) => matchValue$1(safeUrl(path$1), resolvedPath));
		if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
		matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
		if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`);
		matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue$1(body, key.body) : true);
		if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`);
		matchedMockDispatches = matchedMockDispatches.filter((mockDispatch$1) => matchHeaders(mockDispatch$1, key.headers));
		if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers}' on path '${resolvedPath}'`);
		return matchedMockDispatches[0];
	}
	function addMockDispatch$1(mockDispatches, key, data$1) {
		const baseData = {
			timesInvoked: 0,
			times: 1,
			persist: false,
			consumed: false
		};
		const replyData = typeof data$1 === "function" ? { callback: data$1 } : { ...data$1 };
		const newMockDispatch = {
			...baseData,
			...key,
			pending: true,
			data: {
				error: null,
				...replyData
			}
		};
		mockDispatches.push(newMockDispatch);
		return newMockDispatch;
	}
	function deleteMockDispatch(mockDispatches, key) {
		const index = mockDispatches.findIndex((dispatch) => {
			if (!dispatch.consumed) return false;
			return matchKey(dispatch, key);
		});
		if (index !== -1) mockDispatches.splice(index, 1);
	}
	function buildKey$1(opts) {
		const { path: path$1, method, body, headers, query } = opts;
		return {
			path: path$1,
			method,
			body,
			headers,
			query
		};
	}
	function generateKeyValues(data$1) {
		const keys = Object.keys(data$1);
		const result = [];
		for (let i = 0; i < keys.length; ++i) {
			const key = keys[i];
			const value = data$1[key];
			const name$1 = Buffer.from(`${key}`);
			if (Array.isArray(value)) for (let j = 0; j < value.length; ++j) result.push(name$1, Buffer.from(`${value[j]}`));
			else result.push(name$1, Buffer.from(`${value}`));
		}
		return result;
	}
	function getStatusText(statusCode) {
		return STATUS_CODES$1[statusCode] || "unknown";
	}
	async function getResponse(body) {
		const buffers = [];
		for await (const data$1 of body) buffers.push(data$1);
		return Buffer.concat(buffers).toString("utf8");
	}
	function mockDispatch(opts, handler) {
		const key = buildKey$1(opts);
		const mockDispatch$1 = getMockDispatch(this[kDispatches$4], key);
		mockDispatch$1.timesInvoked++;
		if (mockDispatch$1.data.callback) mockDispatch$1.data = {
			...mockDispatch$1.data,
			...mockDispatch$1.data.callback(opts)
		};
		const { data: { statusCode, data: data$1, headers, trailers, error }, delay: delay$2, persist } = mockDispatch$1;
		const { timesInvoked, times } = mockDispatch$1;
		mockDispatch$1.consumed = !persist && timesInvoked >= times;
		mockDispatch$1.pending = timesInvoked < times;
		if (error !== null) {
			deleteMockDispatch(this[kDispatches$4], key);
			handler.onError(error);
			return true;
		}
		if (typeof delay$2 === "number" && delay$2 > 0) setTimeout(() => {
			handleReply(this[kDispatches$4]);
		}, delay$2);
		else handleReply(this[kDispatches$4]);
		function handleReply(mockDispatches, _data = data$1) {
			const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers;
			const body = typeof _data === "function" ? _data({
				...opts,
				headers: optsHeaders
			}) : _data;
			if (isPromise(body)) {
				body.then((newData) => handleReply(mockDispatches, newData));
				return;
			}
			const responseData = getResponseData$1(body);
			const responseHeaders = generateKeyValues(headers);
			const responseTrailers = generateKeyValues(trailers);
			handler.onConnect?.((err) => handler.onError(err), null);
			handler.onHeaders?.(statusCode, responseHeaders, resume$2, getStatusText(statusCode));
			handler.onData?.(Buffer.from(responseData));
			handler.onComplete?.(responseTrailers);
			deleteMockDispatch(mockDispatches, key);
		}
		function resume$2() {}
		return true;
	}
	function buildMockDispatch$2() {
		const agent = this[kMockAgent$2];
		const origin$1 = this[kOrigin$2];
		const originalDispatch = this[kOriginalDispatch$2];
		return function dispatch(opts, handler) {
			if (agent.isMockActive) try {
				mockDispatch.call(this, opts, handler);
			} catch (error) {
				if (error instanceof MockNotMatchedError) {
					const netConnect = agent[kGetNetConnect$1]();
					if (netConnect === false) throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin$1} was not allowed (net.connect disabled)`);
					if (checkNetConnect(netConnect, origin$1)) originalDispatch.call(this, opts, handler);
					else throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin$1} was not allowed (net.connect is not enabled for this origin)`);
				} else throw error;
			}
			else originalDispatch.call(this, opts, handler);
		};
	}
	function checkNetConnect(netConnect, origin$1) {
		const url$3 = new URL(origin$1);
		if (netConnect === true) return true;
		else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue$1(matcher, url$3.host))) return true;
		return false;
	}
	function buildMockOptions$1(opts) {
		if (opts) {
			const { agent, ...mockOptions } = opts;
			return mockOptions;
		}
	}
	module.exports = {
		getResponseData: getResponseData$1,
		getMockDispatch,
		addMockDispatch: addMockDispatch$1,
		deleteMockDispatch,
		buildKey: buildKey$1,
		generateKeyValues,
		matchValue: matchValue$1,
		getResponse,
		getStatusText,
		mockDispatch,
		buildMockDispatch: buildMockDispatch$2,
		checkNetConnect,
		buildMockOptions: buildMockOptions$1,
		getHeaderByName,
		buildHeadersFromArray
	};
}));
var require_mock_interceptor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { getResponseData, buildKey, addMockDispatch } = require_mock_utils();
	var { kDispatches: kDispatches$3, kDispatchKey, kDefaultHeaders, kDefaultTrailers, kContentLength, kMockDispatch } = require_mock_symbols();
	var { InvalidArgumentError: InvalidArgumentError$7 } = require_errors$1();
	var { buildURL } = require_util$9();
	var MockScope = class {
		constructor(mockDispatch$1) {
			this[kMockDispatch] = mockDispatch$1;
		}
		delay(waitInMs) {
			if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) throw new InvalidArgumentError$7("waitInMs must be a valid integer > 0");
			this[kMockDispatch].delay = waitInMs;
			return this;
		}
		persist() {
			this[kMockDispatch].persist = true;
			return this;
		}
		times(repeatTimes) {
			if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) throw new InvalidArgumentError$7("repeatTimes must be a valid integer > 0");
			this[kMockDispatch].times = repeatTimes;
			return this;
		}
	};
	var MockInterceptor$2 = class {
		constructor(opts, mockDispatches) {
			if (typeof opts !== "object") throw new InvalidArgumentError$7("opts must be an object");
			if (typeof opts.path === "undefined") throw new InvalidArgumentError$7("opts.path must be defined");
			if (typeof opts.method === "undefined") opts.method = "GET";
			if (typeof opts.path === "string") if (opts.query) opts.path = buildURL(opts.path, opts.query);
			else {
				const parsedURL = new URL(opts.path, "data://");
				opts.path = parsedURL.pathname + parsedURL.search;
			}
			if (typeof opts.method === "string") opts.method = opts.method.toUpperCase();
			this[kDispatchKey] = buildKey(opts);
			this[kDispatches$3] = mockDispatches;
			this[kDefaultHeaders] = {};
			this[kDefaultTrailers] = {};
			this[kContentLength] = false;
		}
		createMockScopeDispatchData({ statusCode, data: data$1, responseOptions }) {
			const responseData = getResponseData(data$1);
			const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {};
			return {
				statusCode,
				data: data$1,
				headers: {
					...this[kDefaultHeaders],
					...contentLength,
					...responseOptions.headers
				},
				trailers: {
					...this[kDefaultTrailers],
					...responseOptions.trailers
				}
			};
		}
		validateReplyParameters(replyParameters) {
			if (typeof replyParameters.statusCode === "undefined") throw new InvalidArgumentError$7("statusCode must be defined");
			if (typeof replyParameters.responseOptions !== "object" || replyParameters.responseOptions === null) throw new InvalidArgumentError$7("responseOptions must be an object");
		}
		reply(replyOptionsCallbackOrStatusCode) {
			if (typeof replyOptionsCallbackOrStatusCode === "function") {
				const wrappedDefaultsCallback = (opts) => {
					const resolvedData = replyOptionsCallbackOrStatusCode(opts);
					if (typeof resolvedData !== "object" || resolvedData === null) throw new InvalidArgumentError$7("reply options callback must return an object");
					const replyParameters$1 = {
						data: "",
						responseOptions: {},
						...resolvedData
					};
					this.validateReplyParameters(replyParameters$1);
					return { ...this.createMockScopeDispatchData(replyParameters$1) };
				};
				return new MockScope(addMockDispatch(this[kDispatches$3], this[kDispatchKey], wrappedDefaultsCallback));
			}
			const replyParameters = {
				statusCode: replyOptionsCallbackOrStatusCode,
				data: arguments[1] === void 0 ? "" : arguments[1],
				responseOptions: arguments[2] === void 0 ? {} : arguments[2]
			};
			this.validateReplyParameters(replyParameters);
			const dispatchData = this.createMockScopeDispatchData(replyParameters);
			return new MockScope(addMockDispatch(this[kDispatches$3], this[kDispatchKey], dispatchData));
		}
		replyWithError(error) {
			if (typeof error === "undefined") throw new InvalidArgumentError$7("error must be defined");
			return new MockScope(addMockDispatch(this[kDispatches$3], this[kDispatchKey], { error }));
		}
		defaultReplyHeaders(headers) {
			if (typeof headers === "undefined") throw new InvalidArgumentError$7("headers must be defined");
			this[kDefaultHeaders] = headers;
			return this;
		}
		defaultReplyTrailers(trailers) {
			if (typeof trailers === "undefined") throw new InvalidArgumentError$7("trailers must be defined");
			this[kDefaultTrailers] = trailers;
			return this;
		}
		replyContentLength() {
			this[kContentLength] = true;
			return this;
		}
	};
	module.exports.MockInterceptor = MockInterceptor$2;
	module.exports.MockScope = MockScope;
}));
var require_mock_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { promisify: promisify$1 } = require("node:util");
	var Client$2 = require_client();
	var { buildMockDispatch: buildMockDispatch$1 } = require_mock_utils();
	var { kDispatches: kDispatches$2, kMockAgent: kMockAgent$1, kClose: kClose$1, kOriginalClose: kOriginalClose$1, kOrigin: kOrigin$1, kOriginalDispatch: kOriginalDispatch$1, kConnected: kConnected$2 } = require_mock_symbols();
	var { MockInterceptor: MockInterceptor$1 } = require_mock_interceptor();
	var Symbols$1 = require_symbols$4();
	var { InvalidArgumentError: InvalidArgumentError$6 } = require_errors$1();
	var MockClient$2 = class extends Client$2 {
		constructor(origin$1, opts) {
			super(origin$1, opts);
			if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") throw new InvalidArgumentError$6("Argument opts.agent must implement Agent");
			this[kMockAgent$1] = opts.agent;
			this[kOrigin$1] = origin$1;
			this[kDispatches$2] = [];
			this[kConnected$2] = 1;
			this[kOriginalDispatch$1] = this.dispatch;
			this[kOriginalClose$1] = this.close.bind(this);
			this.dispatch = buildMockDispatch$1.call(this);
			this.close = this[kClose$1];
		}
		get [Symbols$1.kConnected]() {
			return this[kConnected$2];
		}
		intercept(opts) {
			return new MockInterceptor$1(opts, this[kDispatches$2]);
		}
		async [kClose$1]() {
			await promisify$1(this[kOriginalClose$1])();
			this[kConnected$2] = 0;
			this[kMockAgent$1][Symbols$1.kClients].delete(this[kOrigin$1]);
		}
	};
	module.exports = MockClient$2;
}));
var require_mock_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { promisify } = require("node:util");
	var Pool$1 = require_pool();
	var { buildMockDispatch } = require_mock_utils();
	var { kDispatches: kDispatches$1, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected: kConnected$1 } = require_mock_symbols();
	var { MockInterceptor } = require_mock_interceptor();
	var Symbols = require_symbols$4();
	var { InvalidArgumentError: InvalidArgumentError$5 } = require_errors$1();
	var MockPool$2 = class extends Pool$1 {
		constructor(origin$1, opts) {
			super(origin$1, opts);
			if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") throw new InvalidArgumentError$5("Argument opts.agent must implement Agent");
			this[kMockAgent] = opts.agent;
			this[kOrigin] = origin$1;
			this[kDispatches$1] = [];
			this[kConnected$1] = 1;
			this[kOriginalDispatch] = this.dispatch;
			this[kOriginalClose] = this.close.bind(this);
			this.dispatch = buildMockDispatch.call(this);
			this.close = this[kClose];
		}
		get [Symbols.kConnected]() {
			return this[kConnected$1];
		}
		intercept(opts) {
			return new MockInterceptor(opts, this[kDispatches$1]);
		}
		async [kClose]() {
			await promisify(this[kOriginalClose])();
			this[kConnected$1] = 0;
			this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
		}
	};
	module.exports = MockPool$2;
}));
var require_pluralizer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var singulars = {
		pronoun: "it",
		is: "is",
		was: "was",
		this: "this"
	};
	var plurals = {
		pronoun: "they",
		is: "are",
		was: "were",
		this: "these"
	};
	module.exports = class Pluralizer$1 {
		constructor(singular, plural$1) {
			this.singular = singular;
			this.plural = plural$1;
		}
		pluralize(count) {
			const one = count === 1;
			const keys = one ? singulars : plurals;
			const noun = one ? this.singular : this.plural;
			return {
				...keys,
				count,
				noun
			};
		}
	};
}));
var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Transform: Transform$1 } = require("node:stream");
	var { Console } = require("node:console");
	var PERSISTENT = process.versions.icu ? "✅" : "Y ";
	var NOT_PERSISTENT = process.versions.icu ? "❌" : "N ";
	module.exports = class PendingInterceptorsFormatter$1 {
		constructor({ disableColors } = {}) {
			this.transform = new Transform$1({ transform(chunk, _enc, cb) {
				cb(null, chunk);
			} });
			this.logger = new Console({
				stdout: this.transform,
				inspectOptions: { colors: !disableColors && !process.env.CI }
			});
		}
		format(pendingInterceptors) {
			const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$1, data: { statusCode }, persist, times, timesInvoked, origin: origin$1 }) => ({
				Method: method,
				Origin: origin$1,
				Path: path$1,
				"Status code": statusCode,
				Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
				Invocations: timesInvoked,
				Remaining: persist ? Infinity : times - timesInvoked
			}));
			this.logger.table(withPrettyHeaders);
			return this.transform.read().toString();
		}
	};
}));
var require_mock_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kClients } = require_symbols$4();
	var Agent$3 = require_agent();
	var { kAgent, kMockAgentSet, kMockAgentGet, kDispatches, kIsMockActive, kNetConnect, kGetNetConnect, kOptions, kFactory } = require_mock_symbols();
	var MockClient$1 = require_mock_client();
	var MockPool$1 = require_mock_pool();
	var { matchValue, buildMockOptions } = require_mock_utils();
	var { InvalidArgumentError: InvalidArgumentError$4, UndiciError } = require_errors$1();
	var Dispatcher$2 = require_dispatcher();
	var Pluralizer = require_pluralizer();
	var PendingInterceptorsFormatter = require_pending_interceptors_formatter();
	var MockAgent$1 = class extends Dispatcher$2 {
		constructor(opts) {
			super(opts);
			this[kNetConnect] = true;
			this[kIsMockActive] = true;
			if (opts?.agent && typeof opts.agent.dispatch !== "function") throw new InvalidArgumentError$4("Argument opts.agent must implement Agent");
			const agent = opts?.agent ? opts.agent : new Agent$3(opts);
			this[kAgent] = agent;
			this[kClients] = agent[kClients];
			this[kOptions] = buildMockOptions(opts);
		}
		get(origin$1) {
			let dispatcher = this[kMockAgentGet](origin$1);
			if (!dispatcher) {
				dispatcher = this[kFactory](origin$1);
				this[kMockAgentSet](origin$1, dispatcher);
			}
			return dispatcher;
		}
		dispatch(opts, handler) {
			this.get(opts.origin);
			return this[kAgent].dispatch(opts, handler);
		}
		async close() {
			await this[kAgent].close();
			this[kClients].clear();
		}
		deactivate() {
			this[kIsMockActive] = false;
		}
		activate() {
			this[kIsMockActive] = true;
		}
		enableNetConnect(matcher) {
			if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) if (Array.isArray(this[kNetConnect])) this[kNetConnect].push(matcher);
			else this[kNetConnect] = [matcher];
			else if (typeof matcher === "undefined") this[kNetConnect] = true;
			else throw new InvalidArgumentError$4("Unsupported matcher. Must be one of String|Function|RegExp.");
		}
		disableNetConnect() {
			this[kNetConnect] = false;
		}
		get isMockActive() {
			return this[kIsMockActive];
		}
		[kMockAgentSet](origin$1, dispatcher) {
			this[kClients].set(origin$1, dispatcher);
		}
		[kFactory](origin$1) {
			const mockOptions = Object.assign({ agent: this }, this[kOptions]);
			return this[kOptions] && this[kOptions].connections === 1 ? new MockClient$1(origin$1, mockOptions) : new MockPool$1(origin$1, mockOptions);
		}
		[kMockAgentGet](origin$1) {
			const client = this[kClients].get(origin$1);
			if (client) return client;
			if (typeof origin$1 !== "string") {
				const dispatcher = this[kFactory]("http://localhost:9999");
				this[kMockAgentSet](origin$1, dispatcher);
				return dispatcher;
			}
			for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin$1)) {
				const dispatcher = this[kFactory](origin$1);
				this[kMockAgentSet](origin$1, dispatcher);
				dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches];
				return dispatcher;
			}
		}
		[kGetNetConnect]() {
			return this[kNetConnect];
		}
		pendingInterceptors() {
			const mockAgentClients = this[kClients];
			return Array.from(mockAgentClients.entries()).flatMap(([origin$1, scope]) => scope[kDispatches].map((dispatch) => ({
				...dispatch,
				origin: origin$1
			}))).filter(({ pending }) => pending);
		}
		assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
			const pending = this.pendingInterceptors();
			if (pending.length === 0) return;
			const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length);
			throw new UndiciError(`
${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:

${pendingInterceptorsFormatter.format(pending)}
`.trim());
		}
	};
	module.exports = MockAgent$1;
}));
var require_global = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var globalDispatcher = Symbol.for("undici.globalDispatcher.1");
	var { InvalidArgumentError: InvalidArgumentError$3 } = require_errors$1();
	var Agent$2 = require_agent();
	if (getGlobalDispatcher$4() === void 0) setGlobalDispatcher$2(new Agent$2());
	function setGlobalDispatcher$2(agent) {
		if (!agent || typeof agent.dispatch !== "function") throw new InvalidArgumentError$3("Argument agent must implement Agent");
		Object.defineProperty(globalThis, globalDispatcher, {
			value: agent,
			writable: true,
			enumerable: false,
			configurable: false
		});
	}
	function getGlobalDispatcher$4() {
		return globalThis[globalDispatcher];
	}
	module.exports = {
		setGlobalDispatcher: setGlobalDispatcher$2,
		getGlobalDispatcher: getGlobalDispatcher$4
	};
}));
var require_decorator_handler = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = class DecoratorHandler$3 {
		#handler;
		constructor(handler) {
			if (typeof handler !== "object" || handler === null) throw new TypeError("handler must be an object");
			this.#handler = handler;
		}
		onConnect(...args) {
			return this.#handler.onConnect?.(...args);
		}
		onError(...args) {
			return this.#handler.onError?.(...args);
		}
		onUpgrade(...args) {
			return this.#handler.onUpgrade?.(...args);
		}
		onResponseStarted(...args) {
			return this.#handler.onResponseStarted?.(...args);
		}
		onHeaders(...args) {
			return this.#handler.onHeaders?.(...args);
		}
		onData(...args) {
			return this.#handler.onData?.(...args);
		}
		onComplete(...args) {
			return this.#handler.onComplete?.(...args);
		}
		onBodySent(...args) {
			return this.#handler.onBodySent?.(...args);
		}
	};
}));
var require_redirect = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var RedirectHandler$1 = require_redirect_handler();
	module.exports = (opts) => {
		const globalMaxRedirections = opts?.maxRedirections;
		return (dispatch) => {
			return function redirectInterceptor(opts$1, handler) {
				const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts$1;
				if (!maxRedirections) return dispatch(opts$1, handler);
				return dispatch(baseOpts, new RedirectHandler$1(dispatch, maxRedirections, opts$1, handler));
			};
		};
	};
}));
var require_retry = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var RetryHandler$1 = require_retry_handler();
	module.exports = (globalOpts) => {
		return (dispatch) => {
			return function retryInterceptor(opts, handler) {
				return dispatch(opts, new RetryHandler$1({
					...opts,
					retryOptions: {
						...globalOpts,
						...opts.retryOptions
					}
				}, {
					handler,
					dispatch
				}));
			};
		};
	};
}));
var require_dump = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var util$10 = require_util$9();
	var { InvalidArgumentError: InvalidArgumentError$2, RequestAbortedError } = require_errors$1();
	var DecoratorHandler$2 = require_decorator_handler();
	var DumpHandler = class extends DecoratorHandler$2 {
		#maxSize = 1024 * 1024;
		#abort = null;
		#dumped = false;
		#aborted = false;
		#size = 0;
		#reason = null;
		#handler = null;
		constructor({ maxSize }, handler) {
			super(handler);
			if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) throw new InvalidArgumentError$2("maxSize must be a number greater than 0");
			this.#maxSize = maxSize ?? this.#maxSize;
			this.#handler = handler;
		}
		onConnect(abort$4) {
			this.#abort = abort$4;
			this.#handler.onConnect(this.#customAbort.bind(this));
		}
		#customAbort(reason) {
			this.#aborted = true;
			this.#reason = reason;
		}
		onHeaders(statusCode, rawHeaders, resume$2, statusMessage) {
			const contentLength = util$10.parseHeaders(rawHeaders)["content-length"];
			if (contentLength != null && contentLength > this.#maxSize) throw new RequestAbortedError(`Response size (${contentLength}) larger than maxSize (${this.#maxSize})`);
			if (this.#aborted) return true;
			return this.#handler.onHeaders(statusCode, rawHeaders, resume$2, statusMessage);
		}
		onError(err) {
			if (this.#dumped) return;
			err = this.#reason ?? err;
			this.#handler.onError(err);
		}
		onData(chunk) {
			this.#size = this.#size + chunk.length;
			if (this.#size >= this.#maxSize) {
				this.#dumped = true;
				if (this.#aborted) this.#handler.onError(this.#reason);
				else this.#handler.onComplete([]);
			}
			return true;
		}
		onComplete(trailers) {
			if (this.#dumped) return;
			if (this.#aborted) {
				this.#handler.onError(this.reason);
				return;
			}
			this.#handler.onComplete(trailers);
		}
	};
	function createDumpInterceptor({ maxSize: defaultMaxSize } = { maxSize: 1024 * 1024 }) {
		return (dispatch) => {
			return function Intercept(opts, handler) {
				const { dumpMaxSize = defaultMaxSize } = opts;
				return dispatch(opts, new DumpHandler({ maxSize: dumpMaxSize }, handler));
			};
		};
	}
	module.exports = createDumpInterceptor;
}));
var require_dns = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { isIP } = require("node:net");
	var { lookup } = require("node:dns");
	var DecoratorHandler$1 = require_decorator_handler();
	var { InvalidArgumentError: InvalidArgumentError$1, InformationalError } = require_errors$1();
	var maxInt = Math.pow(2, 31) - 1;
	var DNSInstance = class {
		#maxTTL = 0;
		#maxItems = 0;
		#records = /* @__PURE__ */ new Map();
		dualStack = true;
		affinity = null;
		lookup = null;
		pick = null;
		constructor(opts) {
			this.#maxTTL = opts.maxTTL;
			this.#maxItems = opts.maxItems;
			this.dualStack = opts.dualStack;
			this.affinity = opts.affinity;
			this.lookup = opts.lookup ?? this.#defaultLookup;
			this.pick = opts.pick ?? this.#defaultPick;
		}
		get full() {
			return this.#records.size === this.#maxItems;
		}
		runLookup(origin$1, opts, cb) {
			const ips = this.#records.get(origin$1.hostname);
			if (ips == null && this.full) {
				cb(null, origin$1.origin);
				return;
			}
			const newOpts = {
				affinity: this.affinity,
				dualStack: this.dualStack,
				lookup: this.lookup,
				pick: this.pick,
				...opts.dns,
				maxTTL: this.#maxTTL,
				maxItems: this.#maxItems
			};
			if (ips == null) this.lookup(origin$1, newOpts, (err, addresses) => {
				if (err || addresses == null || addresses.length === 0) {
					cb(err ?? new InformationalError("No DNS entries found"));
					return;
				}
				this.setRecords(origin$1, addresses);
				const records = this.#records.get(origin$1.hostname);
				const ip = this.pick(origin$1, records, newOpts.affinity);
				let port;
				if (typeof ip.port === "number") port = `:${ip.port}`;
				else if (origin$1.port !== "") port = `:${origin$1.port}`;
				else port = "";
				cb(null, `${origin$1.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`);
			});
			else {
				const ip = this.pick(origin$1, ips, newOpts.affinity);
				if (ip == null) {
					this.#records.delete(origin$1.hostname);
					this.runLookup(origin$1, opts, cb);
					return;
				}
				let port;
				if (typeof ip.port === "number") port = `:${ip.port}`;
				else if (origin$1.port !== "") port = `:${origin$1.port}`;
				else port = "";
				cb(null, `${origin$1.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`);
			}
		}
		#defaultLookup(origin$1, opts, cb) {
			lookup(origin$1.hostname, {
				all: true,
				family: this.dualStack === false ? this.affinity : 0,
				order: "ipv4first"
			}, (err, addresses) => {
				if (err) return cb(err);
				const results = /* @__PURE__ */ new Map();
				for (const addr of addresses) results.set(`${addr.address}:${addr.family}`, addr);
				cb(null, results.values());
			});
		}
		#defaultPick(origin$1, hostnameRecords, affinity) {
			let ip = null;
			const { records, offset } = hostnameRecords;
			let family;
			if (this.dualStack) {
				if (affinity == null) if (offset == null || offset === maxInt) {
					hostnameRecords.offset = 0;
					affinity = 4;
				} else {
					hostnameRecords.offset++;
					affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4;
				}
				if (records[affinity] != null && records[affinity].ips.length > 0) family = records[affinity];
				else family = records[affinity === 4 ? 6 : 4];
			} else family = records[affinity];
			if (family == null || family.ips.length === 0) return ip;
			if (family.offset == null || family.offset === maxInt) family.offset = 0;
			else family.offset++;
			const position = family.offset % family.ips.length;
			ip = family.ips[position] ?? null;
			if (ip == null) return ip;
			if (Date.now() - ip.timestamp > ip.ttl) {
				family.ips.splice(position, 1);
				return this.pick(origin$1, hostnameRecords, affinity);
			}
			return ip;
		}
		setRecords(origin$1, addresses) {
			const timestamp = Date.now();
			const records = { records: {
				4: null,
				6: null
			} };
			for (const record of addresses) {
				record.timestamp = timestamp;
				if (typeof record.ttl === "number") record.ttl = Math.min(record.ttl, this.#maxTTL);
				else record.ttl = this.#maxTTL;
				const familyRecords = records.records[record.family] ?? { ips: [] };
				familyRecords.ips.push(record);
				records.records[record.family] = familyRecords;
			}
			this.#records.set(origin$1.hostname, records);
		}
		getHandler(meta, opts) {
			return new DNSDispatchHandler(this, meta, opts);
		}
	};
	var DNSDispatchHandler = class extends DecoratorHandler$1 {
		#state = null;
		#opts = null;
		#dispatch = null;
		#handler = null;
		#origin = null;
		constructor(state$1, { origin: origin$1, handler, dispatch }, opts) {
			super(handler);
			this.#origin = origin$1;
			this.#handler = handler;
			this.#opts = { ...opts };
			this.#state = state$1;
			this.#dispatch = dispatch;
		}
		onError(err) {
			switch (err.code) {
				case "ETIMEDOUT":
				case "ECONNREFUSED":
					if (this.#state.dualStack) {
						this.#state.runLookup(this.#origin, this.#opts, (err$1, newOrigin) => {
							if (err$1) return this.#handler.onError(err$1);
							const dispatchOpts = {
								...this.#opts,
								origin: newOrigin
							};
							this.#dispatch(dispatchOpts, this);
						});
						return;
					}
					this.#handler.onError(err);
					return;
				case "ENOTFOUND": this.#state.deleteRecord(this.#origin);
				default:
					this.#handler.onError(err);
					break;
			}
		}
	};
	module.exports = (interceptorOpts) => {
		if (interceptorOpts?.maxTTL != null && (typeof interceptorOpts?.maxTTL !== "number" || interceptorOpts?.maxTTL < 0)) throw new InvalidArgumentError$1("Invalid maxTTL. Must be a positive number");
		if (interceptorOpts?.maxItems != null && (typeof interceptorOpts?.maxItems !== "number" || interceptorOpts?.maxItems < 1)) throw new InvalidArgumentError$1("Invalid maxItems. Must be a positive number and greater than zero");
		if (interceptorOpts?.affinity != null && interceptorOpts?.affinity !== 4 && interceptorOpts?.affinity !== 6) throw new InvalidArgumentError$1("Invalid affinity. Must be either 4 or 6");
		if (interceptorOpts?.dualStack != null && typeof interceptorOpts?.dualStack !== "boolean") throw new InvalidArgumentError$1("Invalid dualStack. Must be a boolean");
		if (interceptorOpts?.lookup != null && typeof interceptorOpts?.lookup !== "function") throw new InvalidArgumentError$1("Invalid lookup. Must be a function");
		if (interceptorOpts?.pick != null && typeof interceptorOpts?.pick !== "function") throw new InvalidArgumentError$1("Invalid pick. Must be a function");
		const dualStack = interceptorOpts?.dualStack ?? true;
		let affinity;
		if (dualStack) affinity = interceptorOpts?.affinity ?? null;
		else affinity = interceptorOpts?.affinity ?? 4;
		const instance = new DNSInstance({
			maxTTL: interceptorOpts?.maxTTL ?? 1e4,
			lookup: interceptorOpts?.lookup ?? null,
			pick: interceptorOpts?.pick ?? null,
			dualStack,
			affinity,
			maxItems: interceptorOpts?.maxItems ?? Infinity
		});
		return (dispatch) => {
			return function dnsInterceptor(origDispatchOpts, handler) {
				const origin$1 = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin);
				if (isIP(origin$1.hostname) !== 0) return dispatch(origDispatchOpts, handler);
				instance.runLookup(origin$1, origDispatchOpts, (err, newOrigin) => {
					if (err) return handler.onError(err);
					let dispatchOpts = null;
					dispatchOpts = {
						...origDispatchOpts,
						servername: origin$1.hostname,
						origin: newOrigin,
						headers: {
							host: origin$1.hostname,
							...origDispatchOpts.headers
						}
					};
					dispatch(dispatchOpts, instance.getHandler({
						origin: origin$1,
						dispatch,
						handler
					}, origDispatchOpts));
				});
				return true;
			};
		};
	};
}));
var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kConstruct: kConstruct$6 } = require_symbols$4();
	var { kEnumerableProperty: kEnumerableProperty$8 } = require_util$9();
	var { iteratorMixin, isValidHeaderName: isValidHeaderName$1, isValidHeaderValue } = require_util$8();
	var { webidl: webidl$11 } = require_webidl();
	var assert$7 = require("node:assert");
	var util$9 = require("node:util");
	var kHeadersMap = Symbol("headers map");
	var kHeadersSortedMap = Symbol("headers map sorted");
	function isHTTPWhiteSpaceCharCode(code) {
		return code === 10 || code === 13 || code === 9 || code === 32;
	}
	function headerValueNormalize(potentialValue) {
		let i = 0;
		let j = potentialValue.length;
		while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j;
		while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i;
		return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j);
	}
	function fill$1(headers, object) {
		if (Array.isArray(object)) for (let i = 0; i < object.length; ++i) {
			const header = object[i];
			if (header.length !== 2) throw webidl$11.errors.exception({
				header: "Headers constructor",
				message: `expected name/value pair to be length 2, found ${header.length}.`
			});
			appendHeader(headers, header[0], header[1]);
		}
		else if (typeof object === "object" && object !== null) {
			const keys = Object.keys(object);
			for (let i = 0; i < keys.length; ++i) appendHeader(headers, keys[i], object[keys[i]]);
		} else throw webidl$11.errors.conversionFailed({
			prefix: "Headers constructor",
			argument: "Argument 1",
			types: ["sequence<sequence<ByteString>>", "record<ByteString, ByteString>"]
		});
	}
	function appendHeader(headers, name$1, value) {
		value = headerValueNormalize(value);
		if (!isValidHeaderName$1(name$1)) throw webidl$11.errors.invalidArgument({
			prefix: "Headers.append",
			value: name$1,
			type: "header name"
		});
		else if (!isValidHeaderValue(value)) throw webidl$11.errors.invalidArgument({
			prefix: "Headers.append",
			value,
			type: "header value"
		});
		if (getHeadersGuard$2(headers) === "immutable") throw new TypeError("immutable");
		return getHeadersList$2(headers).append(name$1, value, false);
	}
	function compareHeaderName(a, b) {
		return a[0] < b[0] ? -1 : 1;
	}
	var HeadersList$3 = class HeadersList$3 {
		cookies = null;
		constructor(init$1) {
			if (init$1 instanceof HeadersList$3) {
				this[kHeadersMap] = new Map(init$1[kHeadersMap]);
				this[kHeadersSortedMap] = init$1[kHeadersSortedMap];
				this.cookies = init$1.cookies === null ? null : [...init$1.cookies];
			} else {
				this[kHeadersMap] = new Map(init$1);
				this[kHeadersSortedMap] = null;
			}
		}
		contains(name$1, isLowerCase) {
			return this[kHeadersMap].has(isLowerCase ? name$1 : name$1.toLowerCase());
		}
		clear() {
			this[kHeadersMap].clear();
			this[kHeadersSortedMap] = null;
			this.cookies = null;
		}
		append(name$1, value, isLowerCase) {
			this[kHeadersSortedMap] = null;
			const lowercaseName = isLowerCase ? name$1 : name$1.toLowerCase();
			const exists = this[kHeadersMap].get(lowercaseName);
			if (exists) {
				const delimiter = lowercaseName === "cookie" ? "; " : ", ";
				this[kHeadersMap].set(lowercaseName, {
					name: exists.name,
					value: `${exists.value}${delimiter}${value}`
				});
			} else this[kHeadersMap].set(lowercaseName, {
				name: name$1,
				value
			});
			if (lowercaseName === "set-cookie") (this.cookies ??= []).push(value);
		}
		set(name$1, value, isLowerCase) {
			this[kHeadersSortedMap] = null;
			const lowercaseName = isLowerCase ? name$1 : name$1.toLowerCase();
			if (lowercaseName === "set-cookie") this.cookies = [value];
			this[kHeadersMap].set(lowercaseName, {
				name: name$1,
				value
			});
		}
		delete(name$1, isLowerCase) {
			this[kHeadersSortedMap] = null;
			if (!isLowerCase) name$1 = name$1.toLowerCase();
			if (name$1 === "set-cookie") this.cookies = null;
			this[kHeadersMap].delete(name$1);
		}
		get(name$1, isLowerCase) {
			return this[kHeadersMap].get(isLowerCase ? name$1 : name$1.toLowerCase())?.value ?? null;
		}
		*[Symbol.iterator]() {
			for (const { 0: name$1, 1: { value } } of this[kHeadersMap]) yield [name$1, value];
		}
		get entries() {
			const headers = {};
			if (this[kHeadersMap].size !== 0) for (const { name: name$1, value } of this[kHeadersMap].values()) headers[name$1] = value;
			return headers;
		}
		rawValues() {
			return this[kHeadersMap].values();
		}
		get entriesList() {
			const headers = [];
			if (this[kHeadersMap].size !== 0) for (const { 0: lowerName, 1: { name: name$1, value } } of this[kHeadersMap]) if (lowerName === "set-cookie") for (const cookie of this.cookies) headers.push([name$1, cookie]);
			else headers.push([name$1, value]);
			return headers;
		}
		toSortedArray() {
			const size = this[kHeadersMap].size;
			const array = new Array(size);
			if (size <= 32) {
				if (size === 0) return array;
				const iterator$1 = this[kHeadersMap][Symbol.iterator]();
				const firstValue = iterator$1.next().value;
				array[0] = [firstValue[0], firstValue[1].value];
				assert$7(firstValue[1].value !== null);
				for (let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value; i < size; ++i) {
					value = iterator$1.next().value;
					x = array[i] = [value[0], value[1].value];
					assert$7(x[1] !== null);
					left = 0;
					right = i;
					while (left < right) {
						pivot = left + (right - left >> 1);
						if (array[pivot][0] <= x[0]) left = pivot + 1;
						else right = pivot;
					}
					if (i !== pivot) {
						j = i;
						while (j > left) array[j] = array[--j];
						array[left] = x;
					}
				}
				/* c8 ignore next 4 */
				if (!iterator$1.next().done) throw new TypeError("Unreachable");
				return array;
			} else {
				let i = 0;
				for (const { 0: name$1, 1: { value } } of this[kHeadersMap]) {
					array[i++] = [name$1, value];
					assert$7(value !== null);
				}
				return array.sort(compareHeaderName);
			}
		}
	};
	var Headers$4 = class Headers$4 {
		#guard;
		#headersList;
		constructor(init$1 = void 0) {
			webidl$11.util.markAsUncloneable(this);
			if (init$1 === kConstruct$6) return;
			this.#headersList = new HeadersList$3();
			this.#guard = "none";
			if (init$1 !== void 0) {
				init$1 = webidl$11.converters.HeadersInit(init$1, "Headers contructor", "init");
				fill$1(this, init$1);
			}
		}
		append(name$1, value) {
			webidl$11.brandCheck(this, Headers$4);
			webidl$11.argumentLengthCheck(arguments, 2, "Headers.append");
			const prefix = "Headers.append";
			name$1 = webidl$11.converters.ByteString(name$1, prefix, "name");
			value = webidl$11.converters.ByteString(value, prefix, "value");
			return appendHeader(this, name$1, value);
		}
		delete(name$1) {
			webidl$11.brandCheck(this, Headers$4);
			webidl$11.argumentLengthCheck(arguments, 1, "Headers.delete");
			name$1 = webidl$11.converters.ByteString(name$1, "Headers.delete", "name");
			if (!isValidHeaderName$1(name$1)) throw webidl$11.errors.invalidArgument({
				prefix: "Headers.delete",
				value: name$1,
				type: "header name"
			});
			if (this.#guard === "immutable") throw new TypeError("immutable");
			if (!this.#headersList.contains(name$1, false)) return;
			this.#headersList.delete(name$1, false);
		}
		get(name$1) {
			webidl$11.brandCheck(this, Headers$4);
			webidl$11.argumentLengthCheck(arguments, 1, "Headers.get");
			const prefix = "Headers.get";
			name$1 = webidl$11.converters.ByteString(name$1, prefix, "name");
			if (!isValidHeaderName$1(name$1)) throw webidl$11.errors.invalidArgument({
				prefix,
				value: name$1,
				type: "header name"
			});
			return this.#headersList.get(name$1, false);
		}
		has(name$1) {
			webidl$11.brandCheck(this, Headers$4);
			webidl$11.argumentLengthCheck(arguments, 1, "Headers.has");
			const prefix = "Headers.has";
			name$1 = webidl$11.converters.ByteString(name$1, prefix, "name");
			if (!isValidHeaderName$1(name$1)) throw webidl$11.errors.invalidArgument({
				prefix,
				value: name$1,
				type: "header name"
			});
			return this.#headersList.contains(name$1, false);
		}
		set(name$1, value) {
			webidl$11.brandCheck(this, Headers$4);
			webidl$11.argumentLengthCheck(arguments, 2, "Headers.set");
			const prefix = "Headers.set";
			name$1 = webidl$11.converters.ByteString(name$1, prefix, "name");
			value = webidl$11.converters.ByteString(value, prefix, "value");
			value = headerValueNormalize(value);
			if (!isValidHeaderName$1(name$1)) throw webidl$11.errors.invalidArgument({
				prefix,
				value: name$1,
				type: "header name"
			});
			else if (!isValidHeaderValue(value)) throw webidl$11.errors.invalidArgument({
				prefix,
				value,
				type: "header value"
			});
			if (this.#guard === "immutable") throw new TypeError("immutable");
			this.#headersList.set(name$1, value, false);
		}
		getSetCookie() {
			webidl$11.brandCheck(this, Headers$4);
			const list = this.#headersList.cookies;
			if (list) return [...list];
			return [];
		}
		get [kHeadersSortedMap]() {
			if (this.#headersList[kHeadersSortedMap]) return this.#headersList[kHeadersSortedMap];
			const headers = [];
			const names = this.#headersList.toSortedArray();
			const cookies = this.#headersList.cookies;
			if (cookies === null || cookies.length === 1) return this.#headersList[kHeadersSortedMap] = names;
			for (let i = 0; i < names.length; ++i) {
				const { 0: name$1, 1: value } = names[i];
				if (name$1 === "set-cookie") for (let j = 0; j < cookies.length; ++j) headers.push([name$1, cookies[j]]);
				else headers.push([name$1, value]);
			}
			return this.#headersList[kHeadersSortedMap] = headers;
		}
		[util$9.inspect.custom](depth, options) {
			options.depth ??= depth;
			return `Headers ${util$9.formatWithOptions(options, this.#headersList.entries)}`;
		}
		static getHeadersGuard(o) {
			return o.#guard;
		}
		static setHeadersGuard(o, guard) {
			o.#guard = guard;
		}
		static getHeadersList(o) {
			return o.#headersList;
		}
		static setHeadersList(o, list) {
			o.#headersList = list;
		}
	};
	var { getHeadersGuard: getHeadersGuard$2, setHeadersGuard: setHeadersGuard$2, getHeadersList: getHeadersList$2, setHeadersList: setHeadersList$2 } = Headers$4;
	Reflect.deleteProperty(Headers$4, "getHeadersGuard");
	Reflect.deleteProperty(Headers$4, "setHeadersGuard");
	Reflect.deleteProperty(Headers$4, "getHeadersList");
	Reflect.deleteProperty(Headers$4, "setHeadersList");
	iteratorMixin("Headers", Headers$4, kHeadersSortedMap, 0, 1);
	Object.defineProperties(Headers$4.prototype, {
		append: kEnumerableProperty$8,
		delete: kEnumerableProperty$8,
		get: kEnumerableProperty$8,
		has: kEnumerableProperty$8,
		set: kEnumerableProperty$8,
		getSetCookie: kEnumerableProperty$8,
		[Symbol.toStringTag]: {
			value: "Headers",
			configurable: true
		},
		[util$9.inspect.custom]: { enumerable: false }
	});
	webidl$11.converters.HeadersInit = function(V, prefix, argument) {
		if (webidl$11.util.Type(V) === "Object") {
			const iterator$1 = Reflect.get(V, Symbol.iterator);
			if (!util$9.types.isProxy(V) && iterator$1 === Headers$4.prototype.entries) try {
				return getHeadersList$2(V).entriesList;
			} catch {}
			if (typeof iterator$1 === "function") return webidl$11.converters["sequence<sequence<ByteString>>"](V, prefix, argument, iterator$1.bind(V));
			return webidl$11.converters["record<ByteString, ByteString>"](V, prefix, argument);
		}
		throw webidl$11.errors.conversionFailed({
			prefix: "Headers constructor",
			argument: "Argument 1",
			types: ["sequence<sequence<ByteString>>", "record<ByteString, ByteString>"]
		});
	};
	module.exports = {
		fill: fill$1,
		compareHeaderName,
		Headers: Headers$4,
		HeadersList: HeadersList$3,
		getHeadersGuard: getHeadersGuard$2,
		setHeadersGuard: setHeadersGuard$2,
		setHeadersList: setHeadersList$2,
		getHeadersList: getHeadersList$2
	};
}));
var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Headers: Headers$3, HeadersList: HeadersList$2, fill, getHeadersGuard: getHeadersGuard$1, setHeadersGuard: setHeadersGuard$1, setHeadersList: setHeadersList$1 } = require_headers();
	var { extractBody: extractBody$2, cloneBody: cloneBody$1, mixinBody: mixinBody$1, hasFinalizationRegistry, streamRegistry, bodyUnusable: bodyUnusable$1 } = require_body();
	var util$8 = require_util$9();
	var nodeUtil$1 = require("node:util");
	var { kEnumerableProperty: kEnumerableProperty$7 } = util$8;
	var { isValidReasonPhrase, isCancelled: isCancelled$1, isAborted: isAborted$1, isBlobLike: isBlobLike$2, serializeJavascriptValueToJSONString, isErrorLike: isErrorLike$1, isomorphicEncode: isomorphicEncode$1, environmentSettingsObject: relevantRealm } = require_util$8();
	var { redirectStatusSet: redirectStatusSet$1, nullBodyStatus: nullBodyStatus$1 } = require_constants$2();
	var { kState: kState$6, kHeaders: kHeaders$1 } = require_symbols$3();
	var { webidl: webidl$10 } = require_webidl();
	var { FormData: FormData$1 } = require_formdata();
	var { URLSerializer: URLSerializer$3 } = require_data_url();
	var { kConstruct: kConstruct$5 } = require_symbols$4();
	var assert$6 = require("node:assert");
	var { types: types$2 } = require("node:util");
	var textEncoder = new TextEncoder("utf-8");
	var Response$1 = class Response$1 {
		static error() {
			return fromInnerResponse$2(makeNetworkError$1(), "immutable");
		}
		static json(data$1, init$1 = {}) {
			webidl$10.argumentLengthCheck(arguments, 1, "Response.json");
			if (init$1 !== null) init$1 = webidl$10.converters.ResponseInit(init$1);
			const body = extractBody$2(textEncoder.encode(serializeJavascriptValueToJSONString(data$1)));
			const responseObject = fromInnerResponse$2(makeResponse$1({}), "response");
			initializeResponse(responseObject, init$1, {
				body: body[0],
				type: "application/json"
			});
			return responseObject;
		}
		static redirect(url$3, status = 302) {
			webidl$10.argumentLengthCheck(arguments, 1, "Response.redirect");
			url$3 = webidl$10.converters.USVString(url$3);
			status = webidl$10.converters["unsigned short"](status);
			let parsedURL;
			try {
				parsedURL = new URL(url$3, relevantRealm.settingsObject.baseUrl);
			} catch (err) {
				throw new TypeError(`Failed to parse URL from ${url$3}`, { cause: err });
			}
			if (!redirectStatusSet$1.has(status)) throw new RangeError(`Invalid status code ${status}`);
			const responseObject = fromInnerResponse$2(makeResponse$1({}), "immutable");
			responseObject[kState$6].status = status;
			const value = isomorphicEncode$1(URLSerializer$3(parsedURL));
			responseObject[kState$6].headersList.append("location", value, true);
			return responseObject;
		}
		constructor(body = null, init$1 = {}) {
			webidl$10.util.markAsUncloneable(this);
			if (body === kConstruct$5) return;
			if (body !== null) body = webidl$10.converters.BodyInit(body);
			init$1 = webidl$10.converters.ResponseInit(init$1);
			this[kState$6] = makeResponse$1({});
			this[kHeaders$1] = new Headers$3(kConstruct$5);
			setHeadersGuard$1(this[kHeaders$1], "response");
			setHeadersList$1(this[kHeaders$1], this[kState$6].headersList);
			let bodyWithType = null;
			if (body != null) {
				const [extractedBody, type] = extractBody$2(body);
				bodyWithType = {
					body: extractedBody,
					type
				};
			}
			initializeResponse(this, init$1, bodyWithType);
		}
		get type() {
			webidl$10.brandCheck(this, Response$1);
			return this[kState$6].type;
		}
		get url() {
			webidl$10.brandCheck(this, Response$1);
			const urlList = this[kState$6].urlList;
			const url$3 = urlList[urlList.length - 1] ?? null;
			if (url$3 === null) return "";
			return URLSerializer$3(url$3, true);
		}
		get redirected() {
			webidl$10.brandCheck(this, Response$1);
			return this[kState$6].urlList.length > 1;
		}
		get status() {
			webidl$10.brandCheck(this, Response$1);
			return this[kState$6].status;
		}
		get ok() {
			webidl$10.brandCheck(this, Response$1);
			return this[kState$6].status >= 200 && this[kState$6].status <= 299;
		}
		get statusText() {
			webidl$10.brandCheck(this, Response$1);
			return this[kState$6].statusText;
		}
		get headers() {
			webidl$10.brandCheck(this, Response$1);
			return this[kHeaders$1];
		}
		get body() {
			webidl$10.brandCheck(this, Response$1);
			return this[kState$6].body ? this[kState$6].body.stream : null;
		}
		get bodyUsed() {
			webidl$10.brandCheck(this, Response$1);
			return !!this[kState$6].body && util$8.isDisturbed(this[kState$6].body.stream);
		}
		clone() {
			webidl$10.brandCheck(this, Response$1);
			if (bodyUnusable$1(this)) throw webidl$10.errors.exception({
				header: "Response.clone",
				message: "Body has already been consumed."
			});
			const clonedResponse = cloneResponse$1(this[kState$6]);
			if (hasFinalizationRegistry && this[kState$6].body?.stream) streamRegistry.register(this, new WeakRef(this[kState$6].body.stream));
			return fromInnerResponse$2(clonedResponse, getHeadersGuard$1(this[kHeaders$1]));
		}
		[nodeUtil$1.inspect.custom](depth, options) {
			if (options.depth === null) options.depth = 2;
			options.colors ??= true;
			const properties = {
				status: this.status,
				statusText: this.statusText,
				headers: this.headers,
				body: this.body,
				bodyUsed: this.bodyUsed,
				ok: this.ok,
				redirected: this.redirected,
				type: this.type,
				url: this.url
			};
			return `Response ${nodeUtil$1.formatWithOptions(options, properties)}`;
		}
	};
	mixinBody$1(Response$1);
	Object.defineProperties(Response$1.prototype, {
		type: kEnumerableProperty$7,
		url: kEnumerableProperty$7,
		status: kEnumerableProperty$7,
		ok: kEnumerableProperty$7,
		redirected: kEnumerableProperty$7,
		statusText: kEnumerableProperty$7,
		headers: kEnumerableProperty$7,
		clone: kEnumerableProperty$7,
		body: kEnumerableProperty$7,
		bodyUsed: kEnumerableProperty$7,
		[Symbol.toStringTag]: {
			value: "Response",
			configurable: true
		}
	});
	Object.defineProperties(Response$1, {
		json: kEnumerableProperty$7,
		redirect: kEnumerableProperty$7,
		error: kEnumerableProperty$7
	});
	function cloneResponse$1(response) {
		if (response.internalResponse) return filterResponse$1(cloneResponse$1(response.internalResponse), response.type);
		const newResponse = makeResponse$1({
			...response,
			body: null
		});
		if (response.body != null) newResponse.body = cloneBody$1(newResponse, response.body);
		return newResponse;
	}
	function makeResponse$1(init$1) {
		return {
			aborted: false,
			rangeRequested: false,
			timingAllowPassed: false,
			requestIncludesCredentials: false,
			type: "default",
			status: 200,
			timingInfo: null,
			cacheState: "",
			statusText: "",
			...init$1,
			headersList: init$1?.headersList ? new HeadersList$2(init$1?.headersList) : new HeadersList$2(),
			urlList: init$1?.urlList ? [...init$1.urlList] : []
		};
	}
	function makeNetworkError$1(reason) {
		return makeResponse$1({
			type: "error",
			status: 0,
			error: isErrorLike$1(reason) ? reason : new Error(reason ? String(reason) : reason),
			aborted: reason && reason.name === "AbortError"
		});
	}
	function isNetworkError$1(response) {
		return response.type === "error" && response.status === 0;
	}
	function makeFilteredResponse(response, state$1) {
		state$1 = {
			internalResponse: response,
			...state$1
		};
		return new Proxy(response, {
			get(target, p) {
				return p in state$1 ? state$1[p] : target[p];
			},
			set(target, p, value) {
				assert$6(!(p in state$1));
				target[p] = value;
				return true;
			}
		});
	}
	function filterResponse$1(response, type) {
		if (type === "basic") return makeFilteredResponse(response, {
			type: "basic",
			headersList: response.headersList
		});
		else if (type === "cors") return makeFilteredResponse(response, {
			type: "cors",
			headersList: response.headersList
		});
		else if (type === "opaque") return makeFilteredResponse(response, {
			type: "opaque",
			urlList: Object.freeze([]),
			status: 0,
			statusText: "",
			body: null
		});
		else if (type === "opaqueredirect") return makeFilteredResponse(response, {
			type: "opaqueredirect",
			status: 0,
			statusText: "",
			headersList: [],
			body: null
		});
		else assert$6(false);
	}
	function makeAppropriateNetworkError$1(fetchParams, err = null) {
		assert$6(isCancelled$1(fetchParams));
		return isAborted$1(fetchParams) ? makeNetworkError$1(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError$1(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
	}
	function initializeResponse(response, init$1, body) {
		if (init$1.status !== null && (init$1.status < 200 || init$1.status > 599)) throw new RangeError("init[\"status\"] must be in the range of 200 to 599, inclusive.");
		if ("statusText" in init$1 && init$1.statusText != null) {
			if (!isValidReasonPhrase(String(init$1.statusText))) throw new TypeError("Invalid statusText");
		}
		if ("status" in init$1 && init$1.status != null) response[kState$6].status = init$1.status;
		if ("statusText" in init$1 && init$1.statusText != null) response[kState$6].statusText = init$1.statusText;
		if ("headers" in init$1 && init$1.headers != null) fill(response[kHeaders$1], init$1.headers);
		if (body) {
			if (nullBodyStatus$1.includes(response.status)) throw webidl$10.errors.exception({
				header: "Response constructor",
				message: `Invalid response status code ${response.status}`
			});
			response[kState$6].body = body.body;
			if (body.type != null && !response[kState$6].headersList.contains("content-type", true)) response[kState$6].headersList.append("content-type", body.type, true);
		}
	}
	function fromInnerResponse$2(innerResponse, guard) {
		const response = new Response$1(kConstruct$5);
		response[kState$6] = innerResponse;
		response[kHeaders$1] = new Headers$3(kConstruct$5);
		setHeadersList$1(response[kHeaders$1], innerResponse.headersList);
		setHeadersGuard$1(response[kHeaders$1], guard);
		if (hasFinalizationRegistry && innerResponse.body?.stream) streamRegistry.register(response, new WeakRef(innerResponse.body.stream));
		return response;
	}
	webidl$10.converters.ReadableStream = webidl$10.interfaceConverter(ReadableStream);
	webidl$10.converters.FormData = webidl$10.interfaceConverter(FormData$1);
	webidl$10.converters.URLSearchParams = webidl$10.interfaceConverter(URLSearchParams);
	webidl$10.converters.XMLHttpRequestBodyInit = function(V, prefix, name$1) {
		if (typeof V === "string") return webidl$10.converters.USVString(V, prefix, name$1);
		if (isBlobLike$2(V)) return webidl$10.converters.Blob(V, prefix, name$1, { strict: false });
		if (ArrayBuffer.isView(V) || types$2.isArrayBuffer(V)) return webidl$10.converters.BufferSource(V, prefix, name$1);
		if (util$8.isFormDataLike(V)) return webidl$10.converters.FormData(V, prefix, name$1, { strict: false });
		if (V instanceof URLSearchParams) return webidl$10.converters.URLSearchParams(V, prefix, name$1);
		return webidl$10.converters.DOMString(V, prefix, name$1);
	};
	webidl$10.converters.BodyInit = function(V, prefix, argument) {
		if (V instanceof ReadableStream) return webidl$10.converters.ReadableStream(V, prefix, argument);
		if (V?.[Symbol.asyncIterator]) return V;
		return webidl$10.converters.XMLHttpRequestBodyInit(V, prefix, argument);
	};
	webidl$10.converters.ResponseInit = webidl$10.dictionaryConverter([
		{
			key: "status",
			converter: webidl$10.converters["unsigned short"],
			defaultValue: () => 200
		},
		{
			key: "statusText",
			converter: webidl$10.converters.ByteString,
			defaultValue: () => ""
		},
		{
			key: "headers",
			converter: webidl$10.converters.HeadersInit
		}
	]);
	module.exports = {
		isNetworkError: isNetworkError$1,
		makeNetworkError: makeNetworkError$1,
		makeResponse: makeResponse$1,
		makeAppropriateNetworkError: makeAppropriateNetworkError$1,
		filterResponse: filterResponse$1,
		Response: Response$1,
		cloneResponse: cloneResponse$1,
		fromInnerResponse: fromInnerResponse$2
	};
}));
var require_dispatcher_weakref = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kConnected, kSize } = require_symbols$4();
	var CompatWeakRef = class {
		constructor(value) {
			this.value = value;
		}
		deref() {
			return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value;
		}
	};
	var CompatFinalizer = class {
		constructor(finalizer) {
			this.finalizer = finalizer;
		}
		register(dispatcher, key) {
			if (dispatcher.on) dispatcher.on("disconnect", () => {
				if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) this.finalizer(key);
			});
		}
		unregister(key) {}
	};
	module.exports = function() {
		if (process.env.NODE_V8_COVERAGE && process.version.startsWith("v18")) {
			process._rawDebug("Using compatibility WeakRef and FinalizationRegistry");
			return {
				WeakRef: CompatWeakRef,
				FinalizationRegistry: CompatFinalizer
			};
		}
		return {
			WeakRef,
			FinalizationRegistry
		};
	};
}));
var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { extractBody: extractBody$1, mixinBody, cloneBody, bodyUnusable } = require_body();
	var { Headers: Headers$2, fill: fillHeaders, HeadersList: HeadersList$1, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList: getHeadersList$1 } = require_headers();
	var { FinalizationRegistry: FinalizationRegistry$1 } = require_dispatcher_weakref()();
	var util$7 = require_util$9();
	var nodeUtil = require("node:util");
	var { isValidHTTPToken, sameOrigin: sameOrigin$1, environmentSettingsObject: environmentSettingsObject$2 } = require_util$8();
	var { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = require_constants$2();
	var { kEnumerableProperty: kEnumerableProperty$6, normalizedMethodRecordsBase, normalizedMethodRecords } = util$7;
	var { kHeaders, kSignal, kState: kState$5, kDispatcher: kDispatcher$1 } = require_symbols$3();
	var { webidl: webidl$9 } = require_webidl();
	var { URLSerializer: URLSerializer$2 } = require_data_url();
	var { kConstruct: kConstruct$4 } = require_symbols$4();
	var assert$5 = require("node:assert");
	var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("node:events");
	var kAbortController = Symbol("abortController");
	var requestFinalizer = new FinalizationRegistry$1(({ signal, abort: abort$4 }) => {
		signal.removeEventListener("abort", abort$4);
	});
	var dependentControllerMap = /* @__PURE__ */ new WeakMap();
	function buildAbort(acRef) {
		return abort$4;
		function abort$4() {
			const ac = acRef.deref();
			if (ac !== void 0) {
				requestFinalizer.unregister(abort$4);
				this.removeEventListener("abort", abort$4);
				ac.abort(this.reason);
				const controllerList = dependentControllerMap.get(ac.signal);
				if (controllerList !== void 0) {
					if (controllerList.size !== 0) {
						for (const ref of controllerList) {
							const ctrl = ref.deref();
							if (ctrl !== void 0) ctrl.abort(this.reason);
						}
						controllerList.clear();
					}
					dependentControllerMap.delete(ac.signal);
				}
			}
		}
	}
	var patchMethodWarning = false;
	var Request$2 = class Request$2 {
		constructor(input, init$1 = {}) {
			webidl$9.util.markAsUncloneable(this);
			if (input === kConstruct$4) return;
			const prefix = "Request constructor";
			webidl$9.argumentLengthCheck(arguments, 1, prefix);
			input = webidl$9.converters.RequestInfo(input, prefix, "input");
			init$1 = webidl$9.converters.RequestInit(init$1, prefix, "init");
			let request$1 = null;
			let fallbackMode = null;
			const baseUrl = environmentSettingsObject$2.settingsObject.baseUrl;
			let signal = null;
			if (typeof input === "string") {
				this[kDispatcher$1] = init$1.dispatcher;
				let parsedURL;
				try {
					parsedURL = new URL(input, baseUrl);
				} catch (err) {
					throw new TypeError("Failed to parse URL from " + input, { cause: err });
				}
				if (parsedURL.username || parsedURL.password) throw new TypeError("Request cannot be constructed from a URL that includes credentials: " + input);
				request$1 = makeRequest$2({ urlList: [parsedURL] });
				fallbackMode = "cors";
			} else {
				this[kDispatcher$1] = init$1.dispatcher || input[kDispatcher$1];
				assert$5(input instanceof Request$2);
				request$1 = input[kState$5];
				signal = input[kSignal];
			}
			const origin$1 = environmentSettingsObject$2.settingsObject.origin;
			let window$1 = "client";
			if (request$1.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin$1(request$1.window, origin$1)) window$1 = request$1.window;
			if (init$1.window != null) throw new TypeError(`'window' option '${window$1}' must be null`);
			if ("window" in init$1) window$1 = "no-window";
			request$1 = makeRequest$2({
				method: request$1.method,
				headersList: request$1.headersList,
				unsafeRequest: request$1.unsafeRequest,
				client: environmentSettingsObject$2.settingsObject,
				window: window$1,
				priority: request$1.priority,
				origin: request$1.origin,
				referrer: request$1.referrer,
				referrerPolicy: request$1.referrerPolicy,
				mode: request$1.mode,
				credentials: request$1.credentials,
				cache: request$1.cache,
				redirect: request$1.redirect,
				integrity: request$1.integrity,
				keepalive: request$1.keepalive,
				reloadNavigation: request$1.reloadNavigation,
				historyNavigation: request$1.historyNavigation,
				urlList: [...request$1.urlList]
			});
			const initHasKey = Object.keys(init$1).length !== 0;
			if (initHasKey) {
				if (request$1.mode === "navigate") request$1.mode = "same-origin";
				request$1.reloadNavigation = false;
				request$1.historyNavigation = false;
				request$1.origin = "client";
				request$1.referrer = "client";
				request$1.referrerPolicy = "";
				request$1.url = request$1.urlList[request$1.urlList.length - 1];
				request$1.urlList = [request$1.url];
			}
			if (init$1.referrer !== void 0) {
				const referrer = init$1.referrer;
				if (referrer === "") request$1.referrer = "no-referrer";
				else {
					let parsedReferrer;
					try {
						parsedReferrer = new URL(referrer, baseUrl);
					} catch (err) {
						throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err });
					}
					if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin$1 && !sameOrigin$1(parsedReferrer, environmentSettingsObject$2.settingsObject.baseUrl)) request$1.referrer = "client";
					else request$1.referrer = parsedReferrer;
				}
			}
			if (init$1.referrerPolicy !== void 0) request$1.referrerPolicy = init$1.referrerPolicy;
			let mode;
			if (init$1.mode !== void 0) mode = init$1.mode;
			else mode = fallbackMode;
			if (mode === "navigate") throw webidl$9.errors.exception({
				header: "Request constructor",
				message: "invalid request mode navigate."
			});
			if (mode != null) request$1.mode = mode;
			if (init$1.credentials !== void 0) request$1.credentials = init$1.credentials;
			if (init$1.cache !== void 0) request$1.cache = init$1.cache;
			if (request$1.cache === "only-if-cached" && request$1.mode !== "same-origin") throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");
			if (init$1.redirect !== void 0) request$1.redirect = init$1.redirect;
			if (init$1.integrity != null) request$1.integrity = String(init$1.integrity);
			if (init$1.keepalive !== void 0) request$1.keepalive = Boolean(init$1.keepalive);
			if (init$1.method !== void 0) {
				let method = init$1.method;
				const mayBeNormalized = normalizedMethodRecords[method];
				if (mayBeNormalized !== void 0) request$1.method = mayBeNormalized;
				else {
					if (!isValidHTTPToken(method)) throw new TypeError(`'${method}' is not a valid HTTP method.`);
					const upperCase = method.toUpperCase();
					if (forbiddenMethodsSet.has(upperCase)) throw new TypeError(`'${method}' HTTP method is unsupported.`);
					method = normalizedMethodRecordsBase[upperCase] ?? method;
					request$1.method = method;
				}
				if (!patchMethodWarning && request$1.method === "patch") {
					process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", { code: "UNDICI-FETCH-patch" });
					patchMethodWarning = true;
				}
			}
			if (init$1.signal !== void 0) signal = init$1.signal;
			this[kState$5] = request$1;
			const ac = new AbortController();
			this[kSignal] = ac.signal;
			if (signal != null) {
				if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");
				if (signal.aborted) ac.abort(signal.reason);
				else {
					this[kAbortController] = ac;
					const abort$4 = buildAbort(new WeakRef(ac));
					try {
						if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) setMaxListeners(1500, signal);
						else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) setMaxListeners(1500, signal);
					} catch {}
					util$7.addAbortListener(signal, abort$4);
					requestFinalizer.register(ac, {
						signal,
						abort: abort$4
					}, abort$4);
				}
			}
			this[kHeaders] = new Headers$2(kConstruct$4);
			setHeadersList(this[kHeaders], request$1.headersList);
			setHeadersGuard(this[kHeaders], "request");
			if (mode === "no-cors") {
				if (!corsSafeListedMethodsSet.has(request$1.method)) throw new TypeError(`'${request$1.method} is unsupported in no-cors mode.`);
				setHeadersGuard(this[kHeaders], "request-no-cors");
			}
			if (initHasKey) {
				const headersList = getHeadersList$1(this[kHeaders]);
				const headers = init$1.headers !== void 0 ? init$1.headers : new HeadersList$1(headersList);
				headersList.clear();
				if (headers instanceof HeadersList$1) {
					for (const { name: name$1, value } of headers.rawValues()) headersList.append(name$1, value, false);
					headersList.cookies = headers.cookies;
				} else fillHeaders(this[kHeaders], headers);
			}
			const inputBody = input instanceof Request$2 ? input[kState$5].body : null;
			if ((init$1.body != null || inputBody != null) && (request$1.method === "GET" || request$1.method === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body.");
			let initBody = null;
			if (init$1.body != null) {
				const [extractedBody, contentType$1] = extractBody$1(init$1.body, request$1.keepalive);
				initBody = extractedBody;
				if (contentType$1 && !getHeadersList$1(this[kHeaders]).contains("content-type", true)) this[kHeaders].append("content-type", contentType$1);
			}
			const inputOrInitBody = initBody ?? inputBody;
			if (inputOrInitBody != null && inputOrInitBody.source == null) {
				if (initBody != null && init$1.duplex == null) throw new TypeError("RequestInit: duplex option is required when sending a body.");
				if (request$1.mode !== "same-origin" && request$1.mode !== "cors") throw new TypeError("If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"");
				request$1.useCORSPreflightFlag = true;
			}
			let finalBody = inputOrInitBody;
			if (initBody == null && inputBody != null) {
				if (bodyUnusable(input)) throw new TypeError("Cannot construct a Request with a Request object that has already been used.");
				const identityTransform = new TransformStream();
				inputBody.stream.pipeThrough(identityTransform);
				finalBody = {
					source: inputBody.source,
					length: inputBody.length,
					stream: identityTransform.readable
				};
			}
			this[kState$5].body = finalBody;
		}
		get method() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].method;
		}
		get url() {
			webidl$9.brandCheck(this, Request$2);
			return URLSerializer$2(this[kState$5].url);
		}
		get headers() {
			webidl$9.brandCheck(this, Request$2);
			return this[kHeaders];
		}
		get destination() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].destination;
		}
		get referrer() {
			webidl$9.brandCheck(this, Request$2);
			if (this[kState$5].referrer === "no-referrer") return "";
			if (this[kState$5].referrer === "client") return "about:client";
			return this[kState$5].referrer.toString();
		}
		get referrerPolicy() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].referrerPolicy;
		}
		get mode() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].mode;
		}
		get credentials() {
			return this[kState$5].credentials;
		}
		get cache() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].cache;
		}
		get redirect() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].redirect;
		}
		get integrity() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].integrity;
		}
		get keepalive() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].keepalive;
		}
		get isReloadNavigation() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].reloadNavigation;
		}
		get isHistoryNavigation() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].historyNavigation;
		}
		get signal() {
			webidl$9.brandCheck(this, Request$2);
			return this[kSignal];
		}
		get body() {
			webidl$9.brandCheck(this, Request$2);
			return this[kState$5].body ? this[kState$5].body.stream : null;
		}
		get bodyUsed() {
			webidl$9.brandCheck(this, Request$2);
			return !!this[kState$5].body && util$7.isDisturbed(this[kState$5].body.stream);
		}
		get duplex() {
			webidl$9.brandCheck(this, Request$2);
			return "half";
		}
		clone() {
			webidl$9.brandCheck(this, Request$2);
			if (bodyUnusable(this)) throw new TypeError("unusable");
			const clonedRequest = cloneRequest$1(this[kState$5]);
			const ac = new AbortController();
			if (this.signal.aborted) ac.abort(this.signal.reason);
			else {
				let list = dependentControllerMap.get(this.signal);
				if (list === void 0) {
					list = /* @__PURE__ */ new Set();
					dependentControllerMap.set(this.signal, list);
				}
				const acRef = new WeakRef(ac);
				list.add(acRef);
				util$7.addAbortListener(ac.signal, buildAbort(acRef));
			}
			return fromInnerRequest$1(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]));
		}
		[nodeUtil.inspect.custom](depth, options) {
			if (options.depth === null) options.depth = 2;
			options.colors ??= true;
			const properties = {
				method: this.method,
				url: this.url,
				headers: this.headers,
				destination: this.destination,
				referrer: this.referrer,
				referrerPolicy: this.referrerPolicy,
				mode: this.mode,
				credentials: this.credentials,
				cache: this.cache,
				redirect: this.redirect,
				integrity: this.integrity,
				keepalive: this.keepalive,
				isReloadNavigation: this.isReloadNavigation,
				isHistoryNavigation: this.isHistoryNavigation,
				signal: this.signal
			};
			return `Request ${nodeUtil.formatWithOptions(options, properties)}`;
		}
	};
	mixinBody(Request$2);
	function makeRequest$2(init$1) {
		return {
			method: init$1.method ?? "GET",
			localURLsOnly: init$1.localURLsOnly ?? false,
			unsafeRequest: init$1.unsafeRequest ?? false,
			body: init$1.body ?? null,
			client: init$1.client ?? null,
			reservedClient: init$1.reservedClient ?? null,
			replacesClientId: init$1.replacesClientId ?? "",
			window: init$1.window ?? "client",
			keepalive: init$1.keepalive ?? false,
			serviceWorkers: init$1.serviceWorkers ?? "all",
			initiator: init$1.initiator ?? "",
			destination: init$1.destination ?? "",
			priority: init$1.priority ?? null,
			origin: init$1.origin ?? "client",
			policyContainer: init$1.policyContainer ?? "client",
			referrer: init$1.referrer ?? "client",
			referrerPolicy: init$1.referrerPolicy ?? "",
			mode: init$1.mode ?? "no-cors",
			useCORSPreflightFlag: init$1.useCORSPreflightFlag ?? false,
			credentials: init$1.credentials ?? "same-origin",
			useCredentials: init$1.useCredentials ?? false,
			cache: init$1.cache ?? "default",
			redirect: init$1.redirect ?? "follow",
			integrity: init$1.integrity ?? "",
			cryptoGraphicsNonceMetadata: init$1.cryptoGraphicsNonceMetadata ?? "",
			parserMetadata: init$1.parserMetadata ?? "",
			reloadNavigation: init$1.reloadNavigation ?? false,
			historyNavigation: init$1.historyNavigation ?? false,
			userActivation: init$1.userActivation ?? false,
			taintedOrigin: init$1.taintedOrigin ?? false,
			redirectCount: init$1.redirectCount ?? 0,
			responseTainting: init$1.responseTainting ?? "basic",
			preventNoCacheCacheControlHeaderModification: init$1.preventNoCacheCacheControlHeaderModification ?? false,
			done: init$1.done ?? false,
			timingAllowFailed: init$1.timingAllowFailed ?? false,
			urlList: init$1.urlList,
			url: init$1.urlList[0],
			headersList: init$1.headersList ? new HeadersList$1(init$1.headersList) : new HeadersList$1()
		};
	}
	function cloneRequest$1(request$1) {
		const newRequest = makeRequest$2({
			...request$1,
			body: null
		});
		if (request$1.body != null) newRequest.body = cloneBody(newRequest, request$1.body);
		return newRequest;
	}
	function fromInnerRequest$1(innerRequest, signal, guard) {
		const request$1 = new Request$2(kConstruct$4);
		request$1[kState$5] = innerRequest;
		request$1[kSignal] = signal;
		request$1[kHeaders] = new Headers$2(kConstruct$4);
		setHeadersList(request$1[kHeaders], innerRequest.headersList);
		setHeadersGuard(request$1[kHeaders], guard);
		return request$1;
	}
	Object.defineProperties(Request$2.prototype, {
		method: kEnumerableProperty$6,
		url: kEnumerableProperty$6,
		headers: kEnumerableProperty$6,
		redirect: kEnumerableProperty$6,
		clone: kEnumerableProperty$6,
		signal: kEnumerableProperty$6,
		duplex: kEnumerableProperty$6,
		destination: kEnumerableProperty$6,
		body: kEnumerableProperty$6,
		bodyUsed: kEnumerableProperty$6,
		isHistoryNavigation: kEnumerableProperty$6,
		isReloadNavigation: kEnumerableProperty$6,
		keepalive: kEnumerableProperty$6,
		integrity: kEnumerableProperty$6,
		cache: kEnumerableProperty$6,
		credentials: kEnumerableProperty$6,
		attribute: kEnumerableProperty$6,
		referrerPolicy: kEnumerableProperty$6,
		referrer: kEnumerableProperty$6,
		mode: kEnumerableProperty$6,
		[Symbol.toStringTag]: {
			value: "Request",
			configurable: true
		}
	});
	webidl$9.converters.Request = webidl$9.interfaceConverter(Request$2);
	webidl$9.converters.RequestInfo = function(V, prefix, argument) {
		if (typeof V === "string") return webidl$9.converters.USVString(V, prefix, argument);
		if (V instanceof Request$2) return webidl$9.converters.Request(V, prefix, argument);
		return webidl$9.converters.USVString(V, prefix, argument);
	};
	webidl$9.converters.AbortSignal = webidl$9.interfaceConverter(AbortSignal);
	webidl$9.converters.RequestInit = webidl$9.dictionaryConverter([
		{
			key: "method",
			converter: webidl$9.converters.ByteString
		},
		{
			key: "headers",
			converter: webidl$9.converters.HeadersInit
		},
		{
			key: "body",
			converter: webidl$9.nullableConverter(webidl$9.converters.BodyInit)
		},
		{
			key: "referrer",
			converter: webidl$9.converters.USVString
		},
		{
			key: "referrerPolicy",
			converter: webidl$9.converters.DOMString,
			allowedValues: referrerPolicy
		},
		{
			key: "mode",
			converter: webidl$9.converters.DOMString,
			allowedValues: requestMode
		},
		{
			key: "credentials",
			converter: webidl$9.converters.DOMString,
			allowedValues: requestCredentials
		},
		{
			key: "cache",
			converter: webidl$9.converters.DOMString,
			allowedValues: requestCache
		},
		{
			key: "redirect",
			converter: webidl$9.converters.DOMString,
			allowedValues: requestRedirect
		},
		{
			key: "integrity",
			converter: webidl$9.converters.DOMString
		},
		{
			key: "keepalive",
			converter: webidl$9.converters.boolean
		},
		{
			key: "signal",
			converter: webidl$9.nullableConverter((signal) => webidl$9.converters.AbortSignal(signal, "RequestInit", "signal", { strict: false }))
		},
		{
			key: "window",
			converter: webidl$9.converters.any
		},
		{
			key: "duplex",
			converter: webidl$9.converters.DOMString,
			allowedValues: requestDuplex
		},
		{
			key: "dispatcher",
			converter: webidl$9.converters.any
		}
	]);
	module.exports = {
		Request: Request$2,
		makeRequest: makeRequest$2,
		fromInnerRequest: fromInnerRequest$1,
		cloneRequest: cloneRequest$1
	};
}));
var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { makeNetworkError, makeAppropriateNetworkError, filterResponse, makeResponse, fromInnerResponse: fromInnerResponse$1 } = require_response();
	var { HeadersList } = require_headers();
	var { Request: Request$1, cloneRequest } = require_request();
	var zlib$1 = require("node:zlib");
	var { bytesMatch, makePolicyContainer, clonePolicyContainer, requestBadPort, TAOCheck, appendRequestOriginHeader, responseLocationURL, requestCurrentURL, setRequestReferrerPolicyOnRedirect, tryUpgradeRequestToAPotentiallyTrustworthyURL, createOpaqueTimingInfo, appendFetchMetadata, corsCheck, crossOriginResourcePolicyCheck, determineRequestsReferrer, coarsenedSharedCurrentTime, createDeferredPromise: createDeferredPromise$1, isBlobLike: isBlobLike$1, sameOrigin, isCancelled, isAborted, isErrorLike, fullyReadBody, readableStreamClose, isomorphicEncode, urlIsLocal, urlIsHttpHttpsScheme: urlIsHttpHttpsScheme$1, urlHasHttpsScheme, clampAndCoarsenConnectionTimingInfo, simpleRangeHeaderValue, buildContentRange, createInflate, extractMimeType } = require_util$8();
	var { kState: kState$4, kDispatcher } = require_symbols$3();
	var assert$4 = require("node:assert");
	var { safelyExtractBody, extractBody } = require_body();
	var { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet } = require_constants$2();
	var EE = require("node:events");
	var { Readable, pipeline: pipeline$1, finished } = require("node:stream");
	var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util$9();
	var { dataURLProcessor, serializeAMimeType: serializeAMimeType$2, minimizeSupportedMimeType } = require_data_url();
	var { getGlobalDispatcher: getGlobalDispatcher$3 } = require_global();
	var { webidl: webidl$8 } = require_webidl();
	var { STATUS_CODES } = require("node:http");
	var GET_OR_HEAD = ["GET", "HEAD"];
	var defaultUserAgent = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici";
	var resolveObjectURL;
	var Fetch = class extends EE {
		constructor(dispatcher) {
			super();
			this.dispatcher = dispatcher;
			this.connection = null;
			this.dump = false;
			this.state = "ongoing";
		}
		terminate(reason) {
			if (this.state !== "ongoing") return;
			this.state = "terminated";
			this.connection?.destroy(reason);
			this.emit("terminated", reason);
		}
		abort(error) {
			if (this.state !== "ongoing") return;
			this.state = "aborted";
			if (!error) error = new DOMException("The operation was aborted.", "AbortError");
			this.serializedAbortReason = error;
			this.connection?.destroy(error);
			this.emit("terminated", error);
		}
	};
	function handleFetchDone(response) {
		finalizeAndReportTiming(response, "fetch");
	}
	function fetch$1(input, init$1 = void 0) {
		webidl$8.argumentLengthCheck(arguments, 1, "globalThis.fetch");
		let p = createDeferredPromise$1();
		let requestObject;
		try {
			requestObject = new Request$1(input, init$1);
		} catch (e) {
			p.reject(e);
			return p.promise;
		}
		const request$1 = requestObject[kState$4];
		if (requestObject.signal.aborted) {
			abortFetch(p, request$1, null, requestObject.signal.reason);
			return p.promise;
		}
		if (request$1.client.globalObject?.constructor?.name === "ServiceWorkerGlobalScope") request$1.serviceWorkers = "none";
		let responseObject = null;
		let locallyAborted = false;
		let controller = null;
		addAbortListener(requestObject.signal, () => {
			locallyAborted = true;
			assert$4(controller != null);
			controller.abort(requestObject.signal.reason);
			const realResponse = responseObject?.deref();
			abortFetch(p, request$1, realResponse, requestObject.signal.reason);
		});
		const processResponse = (response) => {
			if (locallyAborted) return;
			if (response.aborted) {
				abortFetch(p, request$1, responseObject, controller.serializedAbortReason);
				return;
			}
			if (response.type === "error") {
				p.reject(new TypeError("fetch failed", { cause: response.error }));
				return;
			}
			responseObject = new WeakRef(fromInnerResponse$1(response, "immutable"));
			p.resolve(responseObject.deref());
			p = null;
		};
		controller = fetching$3({
			request: request$1,
			processResponseEndOfBody: handleFetchDone,
			processResponse,
			dispatcher: requestObject[kDispatcher]
		});
		return p.promise;
	}
	function finalizeAndReportTiming(response, initiatorType = "other") {
		if (response.type === "error" && response.aborted) return;
		if (!response.urlList?.length) return;
		const originalURL = response.urlList[0];
		let timingInfo = response.timingInfo;
		let cacheState = response.cacheState;
		if (!urlIsHttpHttpsScheme$1(originalURL)) return;
		if (timingInfo === null) return;
		if (!response.timingAllowPassed) {
			timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime });
			cacheState = "";
		}
		timingInfo.endTime = coarsenedSharedCurrentTime();
		response.timingInfo = timingInfo;
		markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState);
	}
	var markResourceTiming = performance.markResourceTiming;
	function abortFetch(p, request$1, responseObject, error) {
		if (p) p.reject(error);
		if (request$1.body != null && isReadable(request$1.body?.stream)) request$1.body.stream.cancel(error).catch((err) => {
			if (err.code === "ERR_INVALID_STATE") return;
			throw err;
		});
		if (responseObject == null) return;
		const response = responseObject[kState$4];
		if (response.body != null && isReadable(response.body?.stream)) response.body.stream.cancel(error).catch((err) => {
			if (err.code === "ERR_INVALID_STATE") return;
			throw err;
		});
	}
	function fetching$3({ request: request$1, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseEndOfBody, processResponseConsumeBody, useParallelQueue = false, dispatcher = getGlobalDispatcher$3() }) {
		assert$4(dispatcher);
		let taskDestination = null;
		let crossOriginIsolatedCapability = false;
		if (request$1.client != null) {
			taskDestination = request$1.client.globalObject;
			crossOriginIsolatedCapability = request$1.client.crossOriginIsolatedCapability;
		}
		const timingInfo = createOpaqueTimingInfo({ startTime: coarsenedSharedCurrentTime(crossOriginIsolatedCapability) });
		const fetchParams = {
			controller: new Fetch(dispatcher),
			request: request$1,
			timingInfo,
			processRequestBodyChunkLength,
			processRequestEndOfBody,
			processResponse,
			processResponseConsumeBody,
			processResponseEndOfBody,
			taskDestination,
			crossOriginIsolatedCapability
		};
		assert$4(!request$1.body || request$1.body.stream);
		if (request$1.window === "client") request$1.window = request$1.client?.globalObject?.constructor?.name === "Window" ? request$1.client : "no-window";
		if (request$1.origin === "client") request$1.origin = request$1.client.origin;
		if (request$1.policyContainer === "client") if (request$1.client != null) request$1.policyContainer = clonePolicyContainer(request$1.client.policyContainer);
		else request$1.policyContainer = makePolicyContainer();
		if (!request$1.headersList.contains("accept", true)) request$1.headersList.append("accept", "*/*", true);
		if (!request$1.headersList.contains("accept-language", true)) request$1.headersList.append("accept-language", "*", true);
		if (request$1.priority === null) {}
		if (subresourceSet.has(request$1.destination)) {}
		mainFetch(fetchParams).catch((err) => {
			fetchParams.controller.terminate(err);
		});
		return fetchParams.controller;
	}
	async function mainFetch(fetchParams, recursive = false) {
		const request$1 = fetchParams.request;
		let response = null;
		if (request$1.localURLsOnly && !urlIsLocal(requestCurrentURL(request$1))) response = makeNetworkError("local URLs only");
		tryUpgradeRequestToAPotentiallyTrustworthyURL(request$1);
		if (requestBadPort(request$1) === "blocked") response = makeNetworkError("bad port");
		if (request$1.referrerPolicy === "") request$1.referrerPolicy = request$1.policyContainer.referrerPolicy;
		if (request$1.referrer !== "no-referrer") request$1.referrer = determineRequestsReferrer(request$1);
		if (response === null) response = await (async () => {
			const currentURL = requestCurrentURL(request$1);
			if (sameOrigin(currentURL, request$1.url) && request$1.responseTainting === "basic" || currentURL.protocol === "data:" || request$1.mode === "navigate" || request$1.mode === "websocket") {
				request$1.responseTainting = "basic";
				return await schemeFetch(fetchParams);
			}
			if (request$1.mode === "same-origin") return makeNetworkError("request mode cannot be \"same-origin\"");
			if (request$1.mode === "no-cors") {
				if (request$1.redirect !== "follow") return makeNetworkError("redirect mode cannot be \"follow\" for \"no-cors\" request");
				request$1.responseTainting = "opaque";
				return await schemeFetch(fetchParams);
			}
			if (!urlIsHttpHttpsScheme$1(requestCurrentURL(request$1))) return makeNetworkError("URL scheme must be a HTTP(S) scheme");
			request$1.responseTainting = "cors";
			return await httpFetch(fetchParams);
		})();
		if (recursive) return response;
		if (response.status !== 0 && !response.internalResponse) {
			if (request$1.responseTainting === "cors") {}
			if (request$1.responseTainting === "basic") response = filterResponse(response, "basic");
			else if (request$1.responseTainting === "cors") response = filterResponse(response, "cors");
			else if (request$1.responseTainting === "opaque") response = filterResponse(response, "opaque");
			else assert$4(false);
		}
		let internalResponse = response.status === 0 ? response : response.internalResponse;
		if (internalResponse.urlList.length === 0) internalResponse.urlList.push(...request$1.urlList);
		if (!request$1.timingAllowFailed) response.timingAllowPassed = true;
		if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request$1.headers.contains("range", true)) response = internalResponse = makeNetworkError();
		if (response.status !== 0 && (request$1.method === "HEAD" || request$1.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) {
			internalResponse.body = null;
			fetchParams.controller.dump = true;
		}
		if (request$1.integrity) {
			const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason));
			if (request$1.responseTainting === "opaque" || response.body == null) {
				processBodyError(response.error);
				return;
			}
			const processBody = (bytes) => {
				if (!bytesMatch(bytes, request$1.integrity)) {
					processBodyError("integrity mismatch");
					return;
				}
				response.body = safelyExtractBody(bytes)[0];
				fetchFinale(fetchParams, response);
			};
			await fullyReadBody(response.body, processBody, processBodyError);
		} else fetchFinale(fetchParams, response);
	}
	function schemeFetch(fetchParams) {
		if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) return Promise.resolve(makeAppropriateNetworkError(fetchParams));
		const { request: request$1 } = fetchParams;
		const { protocol: scheme } = requestCurrentURL(request$1);
		switch (scheme) {
			case "about:": return Promise.resolve(makeNetworkError("about scheme is not supported"));
			case "blob:": {
				if (!resolveObjectURL) resolveObjectURL = require("node:buffer").resolveObjectURL;
				const blobURLEntry = requestCurrentURL(request$1);
				if (blobURLEntry.search.length !== 0) return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource."));
				const blob = resolveObjectURL(blobURLEntry.toString());
				if (request$1.method !== "GET" || !isBlobLike$1(blob)) return Promise.resolve(makeNetworkError("invalid method"));
				const response = makeResponse();
				const fullLength = blob.size;
				const serializedFullLength = isomorphicEncode(`${fullLength}`);
				const type = blob.type;
				if (!request$1.headersList.contains("range", true)) {
					const bodyWithType = extractBody(blob);
					response.statusText = "OK";
					response.body = bodyWithType[0];
					response.headersList.set("content-length", serializedFullLength, true);
					response.headersList.set("content-type", type, true);
				} else {
					response.rangeRequested = true;
					const rangeValue = simpleRangeHeaderValue(request$1.headersList.get("range", true), true);
					if (rangeValue === "failure") return Promise.resolve(makeNetworkError("failed to fetch the data URL"));
					let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue;
					if (rangeStart === null) {
						rangeStart = fullLength - rangeEnd;
						rangeEnd = rangeStart + rangeEnd - 1;
					} else {
						if (rangeStart >= fullLength) return Promise.resolve(makeNetworkError("Range start is greater than the blob's size."));
						if (rangeEnd === null || rangeEnd >= fullLength) rangeEnd = fullLength - 1;
					}
					const slicedBlob = blob.slice(rangeStart, rangeEnd, type);
					response.body = extractBody(slicedBlob)[0];
					const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`);
					const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength);
					response.status = 206;
					response.statusText = "Partial Content";
					response.headersList.set("content-length", serializedSlicedLength, true);
					response.headersList.set("content-type", type, true);
					response.headersList.set("content-range", contentRange, true);
				}
				return Promise.resolve(response);
			}
			case "data:": {
				const dataURLStruct = dataURLProcessor(requestCurrentURL(request$1));
				if (dataURLStruct === "failure") return Promise.resolve(makeNetworkError("failed to fetch the data URL"));
				const mimeType = serializeAMimeType$2(dataURLStruct.mimeType);
				return Promise.resolve(makeResponse({
					statusText: "OK",
					headersList: [["content-type", {
						name: "Content-Type",
						value: mimeType
					}]],
					body: safelyExtractBody(dataURLStruct.body)[0]
				}));
			}
			case "file:": return Promise.resolve(makeNetworkError("not implemented... yet..."));
			case "http:":
			case "https:": return httpFetch(fetchParams).catch((err) => makeNetworkError(err));
			default: return Promise.resolve(makeNetworkError("unknown scheme"));
		}
	}
	function finalizeResponse(fetchParams, response) {
		fetchParams.request.done = true;
		if (fetchParams.processResponseDone != null) queueMicrotask(() => fetchParams.processResponseDone(response));
	}
	function fetchFinale(fetchParams, response) {
		let timingInfo = fetchParams.timingInfo;
		const processResponseEndOfBody = () => {
			const unsafeEndTime = Date.now();
			if (fetchParams.request.destination === "document") fetchParams.controller.fullTimingInfo = timingInfo;
			fetchParams.controller.reportTimingSteps = () => {
				if (fetchParams.request.url.protocol !== "https:") return;
				timingInfo.endTime = unsafeEndTime;
				let cacheState = response.cacheState;
				const bodyInfo = response.bodyInfo;
				if (!response.timingAllowPassed) {
					timingInfo = createOpaqueTimingInfo(timingInfo);
					cacheState = "";
				}
				let responseStatus = 0;
				if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) {
					responseStatus = response.status;
					const mimeType = extractMimeType(response.headersList);
					if (mimeType !== "failure") bodyInfo.contentType = minimizeSupportedMimeType(mimeType);
				}
				if (fetchParams.request.initiatorType != null) markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus);
			};
			const processResponseEndOfBodyTask = () => {
				fetchParams.request.done = true;
				if (fetchParams.processResponseEndOfBody != null) queueMicrotask(() => fetchParams.processResponseEndOfBody(response));
				if (fetchParams.request.initiatorType != null) fetchParams.controller.reportTimingSteps();
			};
			queueMicrotask(() => processResponseEndOfBodyTask());
		};
		if (fetchParams.processResponse != null) queueMicrotask(() => {
			fetchParams.processResponse(response);
			fetchParams.processResponse = null;
		});
		const internalResponse = response.type === "error" ? response : response.internalResponse ?? response;
		if (internalResponse.body == null) processResponseEndOfBody();
		else finished(internalResponse.body.stream, () => {
			processResponseEndOfBody();
		});
	}
	async function httpFetch(fetchParams) {
		const request$1 = fetchParams.request;
		let response = null;
		let actualResponse = null;
		const timingInfo = fetchParams.timingInfo;
		if (request$1.serviceWorkers === "all") {}
		if (response === null) {
			if (request$1.redirect === "follow") request$1.serviceWorkers = "none";
			actualResponse = response = await httpNetworkOrCacheFetch(fetchParams);
			if (request$1.responseTainting === "cors" && corsCheck(request$1, response) === "failure") return makeNetworkError("cors failure");
			if (TAOCheck(request$1, response) === "failure") request$1.timingAllowFailed = true;
		}
		if ((request$1.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck(request$1.origin, request$1.client, request$1.destination, actualResponse) === "blocked") return makeNetworkError("blocked");
		if (redirectStatusSet.has(actualResponse.status)) {
			if (request$1.redirect !== "manual") fetchParams.controller.connection.destroy(void 0, false);
			if (request$1.redirect === "error") response = makeNetworkError("unexpected redirect");
			else if (request$1.redirect === "manual") response = actualResponse;
			else if (request$1.redirect === "follow") response = await httpRedirectFetch(fetchParams, response);
			else assert$4(false);
		}
		response.timingInfo = timingInfo;
		return response;
	}
	function httpRedirectFetch(fetchParams, response) {
		const request$1 = fetchParams.request;
		const actualResponse = response.internalResponse ? response.internalResponse : response;
		let locationURL;
		try {
			locationURL = responseLocationURL(actualResponse, requestCurrentURL(request$1).hash);
			if (locationURL == null) return response;
		} catch (err) {
			return Promise.resolve(makeNetworkError(err));
		}
		if (!urlIsHttpHttpsScheme$1(locationURL)) return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme"));
		if (request$1.redirectCount === 20) return Promise.resolve(makeNetworkError("redirect count exceeded"));
		request$1.redirectCount += 1;
		if (request$1.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request$1, locationURL)) return Promise.resolve(makeNetworkError("cross origin not allowed for request mode \"cors\""));
		if (request$1.responseTainting === "cors" && (locationURL.username || locationURL.password)) return Promise.resolve(makeNetworkError("URL cannot contain credentials for request mode \"cors\""));
		if (actualResponse.status !== 303 && request$1.body != null && request$1.body.source == null) return Promise.resolve(makeNetworkError());
		if ([301, 302].includes(actualResponse.status) && request$1.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request$1.method)) {
			request$1.method = "GET";
			request$1.body = null;
			for (const headerName of requestBodyHeader) request$1.headersList.delete(headerName);
		}
		if (!sameOrigin(requestCurrentURL(request$1), locationURL)) {
			request$1.headersList.delete("authorization", true);
			request$1.headersList.delete("proxy-authorization", true);
			request$1.headersList.delete("cookie", true);
			request$1.headersList.delete("host", true);
		}
		if (request$1.body != null) {
			assert$4(request$1.body.source != null);
			request$1.body = safelyExtractBody(request$1.body.source)[0];
		}
		const timingInfo = fetchParams.timingInfo;
		timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);
		if (timingInfo.redirectStartTime === 0) timingInfo.redirectStartTime = timingInfo.startTime;
		request$1.urlList.push(locationURL);
		setRequestReferrerPolicyOnRedirect(request$1, actualResponse);
		return mainFetch(fetchParams, true);
	}
	async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) {
		const request$1 = fetchParams.request;
		let httpFetchParams = null;
		let httpRequest = null;
		let response = null;
		const httpCache = null;
		if (request$1.window === "no-window" && request$1.redirect === "error") {
			httpFetchParams = fetchParams;
			httpRequest = request$1;
		} else {
			httpRequest = cloneRequest(request$1);
			httpFetchParams = { ...fetchParams };
			httpFetchParams.request = httpRequest;
		}
		const includeCredentials = request$1.credentials === "include" || request$1.credentials === "same-origin" && request$1.responseTainting === "basic";
		const contentLength = httpRequest.body ? httpRequest.body.length : null;
		let contentLengthHeaderValue = null;
		if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) contentLengthHeaderValue = "0";
		if (contentLength != null) contentLengthHeaderValue = isomorphicEncode(`${contentLength}`);
		if (contentLengthHeaderValue != null) httpRequest.headersList.append("content-length", contentLengthHeaderValue, true);
		if (contentLength != null && httpRequest.keepalive) {}
		if (httpRequest.referrer instanceof URL) httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href), true);
		appendRequestOriginHeader(httpRequest);
		appendFetchMetadata(httpRequest);
		if (!httpRequest.headersList.contains("user-agent", true)) httpRequest.headersList.append("user-agent", defaultUserAgent);
		if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since", true) || httpRequest.headersList.contains("if-none-match", true) || httpRequest.headersList.contains("if-unmodified-since", true) || httpRequest.headersList.contains("if-match", true) || httpRequest.headersList.contains("if-range", true))) httpRequest.cache = "no-store";
		if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control", true)) httpRequest.headersList.append("cache-control", "max-age=0", true);
		if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") {
			if (!httpRequest.headersList.contains("pragma", true)) httpRequest.headersList.append("pragma", "no-cache", true);
			if (!httpRequest.headersList.contains("cache-control", true)) httpRequest.headersList.append("cache-control", "no-cache", true);
		}
		if (httpRequest.headersList.contains("range", true)) httpRequest.headersList.append("accept-encoding", "identity", true);
		if (!httpRequest.headersList.contains("accept-encoding", true)) if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) httpRequest.headersList.append("accept-encoding", "br, gzip, deflate", true);
		else httpRequest.headersList.append("accept-encoding", "gzip, deflate", true);
		httpRequest.headersList.delete("host", true);
		if (includeCredentials) {}
		if (httpCache == null) httpRequest.cache = "no-store";
		if (httpRequest.cache !== "no-store" && httpRequest.cache !== "reload") {}
		if (response == null) {
			if (httpRequest.cache === "only-if-cached") return makeNetworkError("only if cached");
			const forwardResponse = await httpNetworkFetch(httpFetchParams, includeCredentials, isNewConnectionFetch);
			if (!safeMethodsSet.has(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) {}
			if (response == null) response = forwardResponse;
		}
		response.urlList = [...httpRequest.urlList];
		if (httpRequest.headersList.contains("range", true)) response.rangeRequested = true;
		response.requestIncludesCredentials = includeCredentials;
		if (response.status === 407) {
			if (request$1.window === "no-window") return makeNetworkError();
			if (isCancelled(fetchParams)) return makeAppropriateNetworkError(fetchParams);
			return makeNetworkError("proxy authentication required");
		}
		if (response.status === 421 && !isNewConnectionFetch && (request$1.body == null || request$1.body.source != null)) {
			if (isCancelled(fetchParams)) return makeAppropriateNetworkError(fetchParams);
			fetchParams.controller.connection.destroy();
			response = await httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch, true);
		}
		if (isAuthenticationFetch) {}
		return response;
	}
	async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
		assert$4(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
		fetchParams.controller.connection = {
			abort: null,
			destroyed: false,
			destroy(err, abort$4 = true) {
				if (!this.destroyed) {
					this.destroyed = true;
					if (abort$4) this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError"));
				}
			}
		};
		const request$1 = fetchParams.request;
		let response = null;
		const timingInfo = fetchParams.timingInfo;
		request$1.cache = "no-store";
		if (request$1.mode === "websocket") {}
		let requestBody = null;
		if (request$1.body == null && fetchParams.processRequestEndOfBody) queueMicrotask(() => fetchParams.processRequestEndOfBody());
		else if (request$1.body != null) {
			const processBodyChunk = async function* (bytes) {
				if (isCancelled(fetchParams)) return;
				yield bytes;
				fetchParams.processRequestBodyChunkLength?.(bytes.byteLength);
			};
			const processEndOfBody = () => {
				if (isCancelled(fetchParams)) return;
				if (fetchParams.processRequestEndOfBody) fetchParams.processRequestEndOfBody();
			};
			const processBodyError = (e) => {
				if (isCancelled(fetchParams)) return;
				if (e.name === "AbortError") fetchParams.controller.abort();
				else fetchParams.controller.terminate(e);
			};
			requestBody = (async function* () {
				try {
					for await (const bytes of request$1.body.stream) yield* processBodyChunk(bytes);
					processEndOfBody();
				} catch (err) {
					processBodyError(err);
				}
			})();
		}
		try {
			const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody });
			if (socket) response = makeResponse({
				status,
				statusText,
				headersList,
				socket
			});
			else {
				const iterator$1 = body[Symbol.asyncIterator]();
				fetchParams.controller.next = () => iterator$1.next();
				response = makeResponse({
					status,
					statusText,
					headersList
				});
			}
		} catch (err) {
			if (err.name === "AbortError") {
				fetchParams.controller.connection.destroy();
				return makeAppropriateNetworkError(fetchParams, err);
			}
			return makeNetworkError(err);
		}
		const pullAlgorithm = async () => {
			await fetchParams.controller.resume();
		};
		const cancelAlgorithm = (reason) => {
			if (!isCancelled(fetchParams)) fetchParams.controller.abort(reason);
		};
		const stream$7 = new ReadableStream({
			async start(controller) {
				fetchParams.controller.controller = controller;
			},
			async pull(controller) {
				await pullAlgorithm(controller);
			},
			async cancel(reason) {
				await cancelAlgorithm(reason);
			},
			type: "bytes"
		});
		response.body = {
			stream: stream$7,
			source: null,
			length: null
		};
		fetchParams.controller.onAborted = onAborted;
		fetchParams.controller.on("terminated", onAborted);
		fetchParams.controller.resume = async () => {
			while (true) {
				let bytes;
				let isFailure;
				try {
					const { done, value } = await fetchParams.controller.next();
					if (isAborted(fetchParams)) break;
					bytes = done ? void 0 : value;
				} catch (err) {
					if (fetchParams.controller.ended && !timingInfo.encodedBodySize) bytes = void 0;
					else {
						bytes = err;
						isFailure = true;
					}
				}
				if (bytes === void 0) {
					readableStreamClose(fetchParams.controller.controller);
					finalizeResponse(fetchParams, response);
					return;
				}
				timingInfo.decodedBodySize += bytes?.byteLength ?? 0;
				if (isFailure) {
					fetchParams.controller.terminate(bytes);
					return;
				}
				const buffer$1 = new Uint8Array(bytes);
				if (buffer$1.byteLength) fetchParams.controller.controller.enqueue(buffer$1);
				if (isErrored(stream$7)) {
					fetchParams.controller.terminate();
					return;
				}
				if (fetchParams.controller.controller.desiredSize <= 0) return;
			}
		};
		function onAborted(reason) {
			if (isAborted(fetchParams)) {
				response.aborted = true;
				if (isReadable(stream$7)) fetchParams.controller.controller.error(fetchParams.controller.serializedAbortReason);
			} else if (isReadable(stream$7)) fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 }));
			fetchParams.controller.connection.destroy();
		}
		return response;
		function dispatch({ body }) {
			const url$3 = requestCurrentURL(request$1);
			const agent = fetchParams.controller.dispatcher;
			return new Promise((resolve, reject) => agent.dispatch({
				path: url$3.pathname + url$3.search,
				origin: url$3.origin,
				method: request$1.method,
				body: agent.isMockActive ? request$1.body && (request$1.body.source || request$1.body.stream) : body,
				headers: request$1.headersList.entries,
				maxRedirections: 0,
				upgrade: request$1.mode === "websocket" ? "websocket" : void 0
			}, {
				body: null,
				abort: null,
				onConnect(abort$4) {
					const { connection } = fetchParams.controller;
					timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(void 0, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability);
					if (connection.destroyed) abort$4(new DOMException("The operation was aborted.", "AbortError"));
					else {
						fetchParams.controller.on("terminated", abort$4);
						this.abort = connection.abort = abort$4;
					}
					timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);
				},
				onResponseStarted() {
					timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);
				},
				onHeaders(status, rawHeaders, resume$2, statusText) {
					if (status < 200) return;
					let location = "";
					const headersList = new HeadersList();
					for (let i = 0; i < rawHeaders.length; i += 2) headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true);
					location = headersList.get("location", true);
					this.body = new Readable({ read: resume$2 });
					const decoders = [];
					const willFollow = location && request$1.redirect === "follow" && redirectStatusSet.has(status);
					if (request$1.method !== "HEAD" && request$1.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) {
						const contentEncoding = headersList.get("content-encoding", true);
						const codings = contentEncoding ? contentEncoding.toLowerCase().split(",") : [];
						const maxContentEncodings = 5;
						if (codings.length > maxContentEncodings) {
							reject(/* @__PURE__ */ new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`));
							return true;
						}
						for (let i = codings.length - 1; i >= 0; --i) {
							const coding = codings[i].trim();
							if (coding === "x-gzip" || coding === "gzip") decoders.push(zlib$1.createGunzip({
								flush: zlib$1.constants.Z_SYNC_FLUSH,
								finishFlush: zlib$1.constants.Z_SYNC_FLUSH
							}));
							else if (coding === "deflate") decoders.push(createInflate({
								flush: zlib$1.constants.Z_SYNC_FLUSH,
								finishFlush: zlib$1.constants.Z_SYNC_FLUSH
							}));
							else if (coding === "br") decoders.push(zlib$1.createBrotliDecompress({
								flush: zlib$1.constants.BROTLI_OPERATION_FLUSH,
								finishFlush: zlib$1.constants.BROTLI_OPERATION_FLUSH
							}));
							else {
								decoders.length = 0;
								break;
							}
						}
					}
					const onError$1 = this.onError.bind(this);
					resolve({
						status,
						statusText,
						headersList,
						body: decoders.length ? pipeline$1(this.body, ...decoders, (err) => {
							if (err) this.onError(err);
						}).on("error", onError$1) : this.body.on("error", onError$1)
					});
					return true;
				},
				onData(chunk) {
					if (fetchParams.controller.dump) return;
					const bytes = chunk;
					timingInfo.encodedBodySize += bytes.byteLength;
					return this.body.push(bytes);
				},
				onComplete() {
					if (this.abort) fetchParams.controller.off("terminated", this.abort);
					if (fetchParams.controller.onAborted) fetchParams.controller.off("terminated", fetchParams.controller.onAborted);
					fetchParams.controller.ended = true;
					this.body.push(null);
				},
				onError(error) {
					if (this.abort) fetchParams.controller.off("terminated", this.abort);
					this.body?.destroy(error);
					fetchParams.controller.terminate(error);
					reject(error);
				},
				onUpgrade(status, rawHeaders, socket) {
					if (status !== 101) return;
					const headersList = new HeadersList();
					for (let i = 0; i < rawHeaders.length; i += 2) headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true);
					resolve({
						status,
						statusText: STATUS_CODES[status],
						headersList,
						socket
					});
					return true;
				}
			}));
		}
	}
	module.exports = {
		fetch: fetch$1,
		Fetch,
		fetching: fetching$3,
		finalizeAndReportTiming
	};
}));
var require_symbols$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		kState: Symbol("FileReader state"),
		kResult: Symbol("FileReader result"),
		kError: Symbol("FileReader error"),
		kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"),
		kEvents: Symbol("FileReader events"),
		kAborted: Symbol("FileReader aborted")
	};
}));
var require_progressevent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { webidl: webidl$7 } = require_webidl();
	var kState$3 = Symbol("ProgressEvent state");
	var ProgressEvent$1 = class ProgressEvent$1 extends Event {
		constructor(type, eventInitDict = {}) {
			type = webidl$7.converters.DOMString(type, "ProgressEvent constructor", "type");
			eventInitDict = webidl$7.converters.ProgressEventInit(eventInitDict ?? {});
			super(type, eventInitDict);
			this[kState$3] = {
				lengthComputable: eventInitDict.lengthComputable,
				loaded: eventInitDict.loaded,
				total: eventInitDict.total
			};
		}
		get lengthComputable() {
			webidl$7.brandCheck(this, ProgressEvent$1);
			return this[kState$3].lengthComputable;
		}
		get loaded() {
			webidl$7.brandCheck(this, ProgressEvent$1);
			return this[kState$3].loaded;
		}
		get total() {
			webidl$7.brandCheck(this, ProgressEvent$1);
			return this[kState$3].total;
		}
	};
	webidl$7.converters.ProgressEventInit = webidl$7.dictionaryConverter([
		{
			key: "lengthComputable",
			converter: webidl$7.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "loaded",
			converter: webidl$7.converters["unsigned long long"],
			defaultValue: () => 0
		},
		{
			key: "total",
			converter: webidl$7.converters["unsigned long long"],
			defaultValue: () => 0
		},
		{
			key: "bubbles",
			converter: webidl$7.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "cancelable",
			converter: webidl$7.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "composed",
			converter: webidl$7.converters.boolean,
			defaultValue: () => false
		}
	]);
	module.exports = { ProgressEvent: ProgressEvent$1 };
}));
var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	function getEncoding$1(label) {
		if (!label) return "failure";
		switch (label.trim().toLowerCase()) {
			case "unicode-1-1-utf-8":
			case "unicode11utf8":
			case "unicode20utf8":
			case "utf-8":
			case "utf8":
			case "x-unicode20utf8": return "UTF-8";
			case "866":
			case "cp866":
			case "csibm866":
			case "ibm866": return "IBM866";
			case "csisolatin2":
			case "iso-8859-2":
			case "iso-ir-101":
			case "iso8859-2":
			case "iso88592":
			case "iso_8859-2":
			case "iso_8859-2:1987":
			case "l2":
			case "latin2": return "ISO-8859-2";
			case "csisolatin3":
			case "iso-8859-3":
			case "iso-ir-109":
			case "iso8859-3":
			case "iso88593":
			case "iso_8859-3":
			case "iso_8859-3:1988":
			case "l3":
			case "latin3": return "ISO-8859-3";
			case "csisolatin4":
			case "iso-8859-4":
			case "iso-ir-110":
			case "iso8859-4":
			case "iso88594":
			case "iso_8859-4":
			case "iso_8859-4:1988":
			case "l4":
			case "latin4": return "ISO-8859-4";
			case "csisolatincyrillic":
			case "cyrillic":
			case "iso-8859-5":
			case "iso-ir-144":
			case "iso8859-5":
			case "iso88595":
			case "iso_8859-5":
			case "iso_8859-5:1988": return "ISO-8859-5";
			case "arabic":
			case "asmo-708":
			case "csiso88596e":
			case "csiso88596i":
			case "csisolatinarabic":
			case "ecma-114":
			case "iso-8859-6":
			case "iso-8859-6-e":
			case "iso-8859-6-i":
			case "iso-ir-127":
			case "iso8859-6":
			case "iso88596":
			case "iso_8859-6":
			case "iso_8859-6:1987": return "ISO-8859-6";
			case "csisolatingreek":
			case "ecma-118":
			case "elot_928":
			case "greek":
			case "greek8":
			case "iso-8859-7":
			case "iso-ir-126":
			case "iso8859-7":
			case "iso88597":
			case "iso_8859-7":
			case "iso_8859-7:1987":
			case "sun_eu_greek": return "ISO-8859-7";
			case "csiso88598e":
			case "csisolatinhebrew":
			case "hebrew":
			case "iso-8859-8":
			case "iso-8859-8-e":
			case "iso-ir-138":
			case "iso8859-8":
			case "iso88598":
			case "iso_8859-8":
			case "iso_8859-8:1988":
			case "visual": return "ISO-8859-8";
			case "csiso88598i":
			case "iso-8859-8-i":
			case "logical": return "ISO-8859-8-I";
			case "csisolatin6":
			case "iso-8859-10":
			case "iso-ir-157":
			case "iso8859-10":
			case "iso885910":
			case "l6":
			case "latin6": return "ISO-8859-10";
			case "iso-8859-13":
			case "iso8859-13":
			case "iso885913": return "ISO-8859-13";
			case "iso-8859-14":
			case "iso8859-14":
			case "iso885914": return "ISO-8859-14";
			case "csisolatin9":
			case "iso-8859-15":
			case "iso8859-15":
			case "iso885915":
			case "iso_8859-15":
			case "l9": return "ISO-8859-15";
			case "iso-8859-16": return "ISO-8859-16";
			case "cskoi8r":
			case "koi":
			case "koi8":
			case "koi8-r":
			case "koi8_r": return "KOI8-R";
			case "koi8-ru":
			case "koi8-u": return "KOI8-U";
			case "csmacintosh":
			case "mac":
			case "macintosh":
			case "x-mac-roman": return "macintosh";
			case "iso-8859-11":
			case "iso8859-11":
			case "iso885911":
			case "tis-620":
			case "windows-874": return "windows-874";
			case "cp1250":
			case "windows-1250":
			case "x-cp1250": return "windows-1250";
			case "cp1251":
			case "windows-1251":
			case "x-cp1251": return "windows-1251";
			case "ansi_x3.4-1968":
			case "ascii":
			case "cp1252":
			case "cp819":
			case "csisolatin1":
			case "ibm819":
			case "iso-8859-1":
			case "iso-ir-100":
			case "iso8859-1":
			case "iso88591":
			case "iso_8859-1":
			case "iso_8859-1:1987":
			case "l1":
			case "latin1":
			case "us-ascii":
			case "windows-1252":
			case "x-cp1252": return "windows-1252";
			case "cp1253":
			case "windows-1253":
			case "x-cp1253": return "windows-1253";
			case "cp1254":
			case "csisolatin5":
			case "iso-8859-9":
			case "iso-ir-148":
			case "iso8859-9":
			case "iso88599":
			case "iso_8859-9":
			case "iso_8859-9:1989":
			case "l5":
			case "latin5":
			case "windows-1254":
			case "x-cp1254": return "windows-1254";
			case "cp1255":
			case "windows-1255":
			case "x-cp1255": return "windows-1255";
			case "cp1256":
			case "windows-1256":
			case "x-cp1256": return "windows-1256";
			case "cp1257":
			case "windows-1257":
			case "x-cp1257": return "windows-1257";
			case "cp1258":
			case "windows-1258":
			case "x-cp1258": return "windows-1258";
			case "x-mac-cyrillic":
			case "x-mac-ukrainian": return "x-mac-cyrillic";
			case "chinese":
			case "csgb2312":
			case "csiso58gb231280":
			case "gb2312":
			case "gb_2312":
			case "gb_2312-80":
			case "gbk":
			case "iso-ir-58":
			case "x-gbk": return "GBK";
			case "gb18030": return "gb18030";
			case "big5":
			case "big5-hkscs":
			case "cn-big5":
			case "csbig5":
			case "x-x-big5": return "Big5";
			case "cseucpkdfmtjapanese":
			case "euc-jp":
			case "x-euc-jp": return "EUC-JP";
			case "csiso2022jp":
			case "iso-2022-jp": return "ISO-2022-JP";
			case "csshiftjis":
			case "ms932":
			case "ms_kanji":
			case "shift-jis":
			case "shift_jis":
			case "sjis":
			case "windows-31j":
			case "x-sjis": return "Shift_JIS";
			case "cseuckr":
			case "csksc56011987":
			case "euc-kr":
			case "iso-ir-149":
			case "korean":
			case "ks_c_5601-1987":
			case "ks_c_5601-1989":
			case "ksc5601":
			case "ksc_5601":
			case "windows-949": return "EUC-KR";
			case "csiso2022kr":
			case "hz-gb-2312":
			case "iso-2022-cn":
			case "iso-2022-cn-ext":
			case "iso-2022-kr":
			case "replacement": return "replacement";
			case "unicodefffe":
			case "utf-16be": return "UTF-16BE";
			case "csunicode":
			case "iso-10646-ucs-2":
			case "ucs-2":
			case "unicode":
			case "unicodefeff":
			case "utf-16":
			case "utf-16le": return "UTF-16LE";
			case "x-user-defined": return "x-user-defined";
			default: return "failure";
		}
	}
	module.exports = { getEncoding: getEncoding$1 };
}));
var require_util$6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kState: kState$2, kError: kError$1, kResult: kResult$1, kAborted: kAborted$1, kLastProgressEventFired } = require_symbols$2();
	var { ProgressEvent } = require_progressevent();
	var { getEncoding } = require_encoding();
	var { serializeAMimeType: serializeAMimeType$1, parseMIMEType: parseMIMEType$2 } = require_data_url();
	var { types: types$1 } = require("node:util");
	var { StringDecoder } = require("string_decoder");
	var { btoa: btoa$1 } = require("node:buffer");
	var staticPropertyDescriptors$3 = {
		enumerable: true,
		writable: false,
		configurable: false
	};
	function readOperation$1(fr, blob, type, encodingName) {
		if (fr[kState$2] === "loading") throw new DOMException("Invalid state", "InvalidStateError");
		fr[kState$2] = "loading";
		fr[kResult$1] = null;
		fr[kError$1] = null;
		const reader = blob.stream().getReader();
		const bytes = [];
		let chunkPromise = reader.read();
		let isFirstChunk = true;
		(async () => {
			while (!fr[kAborted$1]) try {
				const { done, value } = await chunkPromise;
				if (isFirstChunk && !fr[kAborted$1]) queueMicrotask(() => {
					fireAProgressEvent$1("loadstart", fr);
				});
				isFirstChunk = false;
				if (!done && types$1.isUint8Array(value)) {
					bytes.push(value);
					if ((fr[kLastProgressEventFired] === void 0 || Date.now() - fr[kLastProgressEventFired] >= 50) && !fr[kAborted$1]) {
						fr[kLastProgressEventFired] = Date.now();
						queueMicrotask(() => {
							fireAProgressEvent$1("progress", fr);
						});
					}
					chunkPromise = reader.read();
				} else if (done) {
					queueMicrotask(() => {
						fr[kState$2] = "done";
						try {
							const result = packageData(bytes, type, blob.type, encodingName);
							if (fr[kAborted$1]) return;
							fr[kResult$1] = result;
							fireAProgressEvent$1("load", fr);
						} catch (error) {
							fr[kError$1] = error;
							fireAProgressEvent$1("error", fr);
						}
						if (fr[kState$2] !== "loading") fireAProgressEvent$1("loadend", fr);
					});
					break;
				}
			} catch (error) {
				if (fr[kAborted$1]) return;
				queueMicrotask(() => {
					fr[kState$2] = "done";
					fr[kError$1] = error;
					fireAProgressEvent$1("error", fr);
					if (fr[kState$2] !== "loading") fireAProgressEvent$1("loadend", fr);
				});
				break;
			}
		})();
	}
	function fireAProgressEvent$1(e, reader) {
		const event = new ProgressEvent(e, {
			bubbles: false,
			cancelable: false
		});
		reader.dispatchEvent(event);
	}
	function packageData(bytes, type, mimeType, encodingName) {
		switch (type) {
			case "DataURL": {
				let dataURL = "data:";
				const parsed = parseMIMEType$2(mimeType || "application/octet-stream");
				if (parsed !== "failure") dataURL += serializeAMimeType$1(parsed);
				dataURL += ";base64,";
				const decoder = new StringDecoder("latin1");
				for (const chunk of bytes) dataURL += btoa$1(decoder.write(chunk));
				dataURL += btoa$1(decoder.end());
				return dataURL;
			}
			case "Text": {
				let encoding = "failure";
				if (encodingName) encoding = getEncoding(encodingName);
				if (encoding === "failure" && mimeType) {
					const type$1 = parseMIMEType$2(mimeType);
					if (type$1 !== "failure") encoding = getEncoding(type$1.parameters.get("charset"));
				}
				if (encoding === "failure") encoding = "UTF-8";
				return decode(bytes, encoding);
			}
			case "ArrayBuffer": return combineByteSequences(bytes).buffer;
			case "BinaryString": {
				let binaryString = "";
				const decoder = new StringDecoder("latin1");
				for (const chunk of bytes) binaryString += decoder.write(chunk);
				binaryString += decoder.end();
				return binaryString;
			}
		}
	}
	function decode(ioQueue, encoding) {
		const bytes = combineByteSequences(ioQueue);
		const BOMEncoding = BOMSniffing(bytes);
		let slice = 0;
		if (BOMEncoding !== null) {
			encoding = BOMEncoding;
			slice = BOMEncoding === "UTF-8" ? 3 : 2;
		}
		const sliced = bytes.slice(slice);
		return new TextDecoder(encoding).decode(sliced);
	}
	function BOMSniffing(ioQueue) {
		const [a, b, c] = ioQueue;
		if (a === 239 && b === 187 && c === 191) return "UTF-8";
		else if (a === 254 && b === 255) return "UTF-16BE";
		else if (a === 255 && b === 254) return "UTF-16LE";
		return null;
	}
	function combineByteSequences(sequences) {
		const size = sequences.reduce((a, b) => {
			return a + b.byteLength;
		}, 0);
		let offset = 0;
		return sequences.reduce((a, b) => {
			a.set(b, offset);
			offset += b.byteLength;
			return a;
		}, new Uint8Array(size));
	}
	module.exports = {
		staticPropertyDescriptors: staticPropertyDescriptors$3,
		readOperation: readOperation$1,
		fireAProgressEvent: fireAProgressEvent$1
	};
}));
var require_filereader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { staticPropertyDescriptors: staticPropertyDescriptors$2, readOperation, fireAProgressEvent } = require_util$6();
	var { kState: kState$1, kError, kResult, kEvents, kAborted } = require_symbols$2();
	var { webidl: webidl$6 } = require_webidl();
	var { kEnumerableProperty: kEnumerableProperty$5 } = require_util$9();
	var FileReader = class FileReader extends EventTarget {
		constructor() {
			super();
			this[kState$1] = "empty";
			this[kResult] = null;
			this[kError] = null;
			this[kEvents] = {
				loadend: null,
				error: null,
				abort: null,
				load: null,
				progress: null,
				loadstart: null
			};
		}
		readAsArrayBuffer(blob) {
			webidl$6.brandCheck(this, FileReader);
			webidl$6.argumentLengthCheck(arguments, 1, "FileReader.readAsArrayBuffer");
			blob = webidl$6.converters.Blob(blob, { strict: false });
			readOperation(this, blob, "ArrayBuffer");
		}
		readAsBinaryString(blob) {
			webidl$6.brandCheck(this, FileReader);
			webidl$6.argumentLengthCheck(arguments, 1, "FileReader.readAsBinaryString");
			blob = webidl$6.converters.Blob(blob, { strict: false });
			readOperation(this, blob, "BinaryString");
		}
		readAsText(blob, encoding = void 0) {
			webidl$6.brandCheck(this, FileReader);
			webidl$6.argumentLengthCheck(arguments, 1, "FileReader.readAsText");
			blob = webidl$6.converters.Blob(blob, { strict: false });
			if (encoding !== void 0) encoding = webidl$6.converters.DOMString(encoding, "FileReader.readAsText", "encoding");
			readOperation(this, blob, "Text", encoding);
		}
		readAsDataURL(blob) {
			webidl$6.brandCheck(this, FileReader);
			webidl$6.argumentLengthCheck(arguments, 1, "FileReader.readAsDataURL");
			blob = webidl$6.converters.Blob(blob, { strict: false });
			readOperation(this, blob, "DataURL");
		}
		abort() {
			if (this[kState$1] === "empty" || this[kState$1] === "done") {
				this[kResult] = null;
				return;
			}
			if (this[kState$1] === "loading") {
				this[kState$1] = "done";
				this[kResult] = null;
			}
			this[kAborted] = true;
			fireAProgressEvent("abort", this);
			if (this[kState$1] !== "loading") fireAProgressEvent("loadend", this);
		}
		get readyState() {
			webidl$6.brandCheck(this, FileReader);
			switch (this[kState$1]) {
				case "empty": return this.EMPTY;
				case "loading": return this.LOADING;
				case "done": return this.DONE;
			}
		}
		get result() {
			webidl$6.brandCheck(this, FileReader);
			return this[kResult];
		}
		get error() {
			webidl$6.brandCheck(this, FileReader);
			return this[kError];
		}
		get onloadend() {
			webidl$6.brandCheck(this, FileReader);
			return this[kEvents].loadend;
		}
		set onloadend(fn) {
			webidl$6.brandCheck(this, FileReader);
			if (this[kEvents].loadend) this.removeEventListener("loadend", this[kEvents].loadend);
			if (typeof fn === "function") {
				this[kEvents].loadend = fn;
				this.addEventListener("loadend", fn);
			} else this[kEvents].loadend = null;
		}
		get onerror() {
			webidl$6.brandCheck(this, FileReader);
			return this[kEvents].error;
		}
		set onerror(fn) {
			webidl$6.brandCheck(this, FileReader);
			if (this[kEvents].error) this.removeEventListener("error", this[kEvents].error);
			if (typeof fn === "function") {
				this[kEvents].error = fn;
				this.addEventListener("error", fn);
			} else this[kEvents].error = null;
		}
		get onloadstart() {
			webidl$6.brandCheck(this, FileReader);
			return this[kEvents].loadstart;
		}
		set onloadstart(fn) {
			webidl$6.brandCheck(this, FileReader);
			if (this[kEvents].loadstart) this.removeEventListener("loadstart", this[kEvents].loadstart);
			if (typeof fn === "function") {
				this[kEvents].loadstart = fn;
				this.addEventListener("loadstart", fn);
			} else this[kEvents].loadstart = null;
		}
		get onprogress() {
			webidl$6.brandCheck(this, FileReader);
			return this[kEvents].progress;
		}
		set onprogress(fn) {
			webidl$6.brandCheck(this, FileReader);
			if (this[kEvents].progress) this.removeEventListener("progress", this[kEvents].progress);
			if (typeof fn === "function") {
				this[kEvents].progress = fn;
				this.addEventListener("progress", fn);
			} else this[kEvents].progress = null;
		}
		get onload() {
			webidl$6.brandCheck(this, FileReader);
			return this[kEvents].load;
		}
		set onload(fn) {
			webidl$6.brandCheck(this, FileReader);
			if (this[kEvents].load) this.removeEventListener("load", this[kEvents].load);
			if (typeof fn === "function") {
				this[kEvents].load = fn;
				this.addEventListener("load", fn);
			} else this[kEvents].load = null;
		}
		get onabort() {
			webidl$6.brandCheck(this, FileReader);
			return this[kEvents].abort;
		}
		set onabort(fn) {
			webidl$6.brandCheck(this, FileReader);
			if (this[kEvents].abort) this.removeEventListener("abort", this[kEvents].abort);
			if (typeof fn === "function") {
				this[kEvents].abort = fn;
				this.addEventListener("abort", fn);
			} else this[kEvents].abort = null;
		}
	};
	FileReader.EMPTY = FileReader.prototype.EMPTY = 0;
	FileReader.LOADING = FileReader.prototype.LOADING = 1;
	FileReader.DONE = FileReader.prototype.DONE = 2;
	Object.defineProperties(FileReader.prototype, {
		EMPTY: staticPropertyDescriptors$2,
		LOADING: staticPropertyDescriptors$2,
		DONE: staticPropertyDescriptors$2,
		readAsArrayBuffer: kEnumerableProperty$5,
		readAsBinaryString: kEnumerableProperty$5,
		readAsText: kEnumerableProperty$5,
		readAsDataURL: kEnumerableProperty$5,
		abort: kEnumerableProperty$5,
		readyState: kEnumerableProperty$5,
		result: kEnumerableProperty$5,
		error: kEnumerableProperty$5,
		onloadstart: kEnumerableProperty$5,
		onprogress: kEnumerableProperty$5,
		onload: kEnumerableProperty$5,
		onabort: kEnumerableProperty$5,
		onerror: kEnumerableProperty$5,
		onloadend: kEnumerableProperty$5,
		[Symbol.toStringTag]: {
			value: "FileReader",
			writable: false,
			enumerable: false,
			configurable: true
		}
	});
	Object.defineProperties(FileReader, {
		EMPTY: staticPropertyDescriptors$2,
		LOADING: staticPropertyDescriptors$2,
		DONE: staticPropertyDescriptors$2
	});
	module.exports = { FileReader };
}));
var require_symbols$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = { kConstruct: require_symbols$4().kConstruct };
}));
var require_util$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var assert$3 = require("node:assert");
	var { URLSerializer: URLSerializer$1 } = require_data_url();
	var { isValidHeaderName } = require_util$8();
	function urlEquals$1(A, B, excludeFragment = false) {
		return URLSerializer$1(A, excludeFragment) === URLSerializer$1(B, excludeFragment);
	}
	function getFieldValues$1(header) {
		assert$3(header !== null);
		const values = [];
		for (let value of header.split(",")) {
			value = value.trim();
			if (isValidHeaderName(value)) values.push(value);
		}
		return values;
	}
	module.exports = {
		urlEquals: urlEquals$1,
		getFieldValues: getFieldValues$1
	};
}));
var require_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kConstruct: kConstruct$3 } = require_symbols$1();
	var { urlEquals, getFieldValues } = require_util$5();
	var { kEnumerableProperty: kEnumerableProperty$4, isDisturbed } = require_util$9();
	var { webidl: webidl$5 } = require_webidl();
	var { Response, cloneResponse, fromInnerResponse } = require_response();
	var { Request, fromInnerRequest } = require_request();
	var { kState } = require_symbols$3();
	var { fetching: fetching$2 } = require_fetch();
	var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util$8();
	var assert$2 = require("node:assert");
	var Cache$1 = class Cache$1 {
		#relevantRequestResponseList;
		constructor() {
			if (arguments[0] !== kConstruct$3) webidl$5.illegalConstructor();
			webidl$5.util.markAsUncloneable(this);
			this.#relevantRequestResponseList = arguments[1];
		}
		async match(request$1, options = {}) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.match";
			webidl$5.argumentLengthCheck(arguments, 1, prefix);
			request$1 = webidl$5.converters.RequestInfo(request$1, prefix, "request");
			options = webidl$5.converters.CacheQueryOptions(options, prefix, "options");
			const p = this.#internalMatchAll(request$1, options, 1);
			if (p.length === 0) return;
			return p[0];
		}
		async matchAll(request$1 = void 0, options = {}) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.matchAll";
			if (request$1 !== void 0) request$1 = webidl$5.converters.RequestInfo(request$1, prefix, "request");
			options = webidl$5.converters.CacheQueryOptions(options, prefix, "options");
			return this.#internalMatchAll(request$1, options);
		}
		async add(request$1) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.add";
			webidl$5.argumentLengthCheck(arguments, 1, prefix);
			request$1 = webidl$5.converters.RequestInfo(request$1, prefix, "request");
			const requests = [request$1];
			return await this.addAll(requests);
		}
		async addAll(requests) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.addAll";
			webidl$5.argumentLengthCheck(arguments, 1, prefix);
			const responsePromises = [];
			const requestList = [];
			for (let request$1 of requests) {
				if (request$1 === void 0) throw webidl$5.errors.conversionFailed({
					prefix,
					argument: "Argument 1",
					types: ["undefined is not allowed"]
				});
				request$1 = webidl$5.converters.RequestInfo(request$1);
				if (typeof request$1 === "string") continue;
				const r = request$1[kState];
				if (!urlIsHttpHttpsScheme(r.url) || r.method !== "GET") throw webidl$5.errors.exception({
					header: prefix,
					message: "Expected http/s scheme when method is not GET."
				});
			}
			const fetchControllers = [];
			for (const request$1 of requests) {
				const r = new Request(request$1)[kState];
				if (!urlIsHttpHttpsScheme(r.url)) throw webidl$5.errors.exception({
					header: prefix,
					message: "Expected http/s scheme."
				});
				r.initiator = "fetch";
				r.destination = "subresource";
				requestList.push(r);
				const responsePromise = createDeferredPromise();
				fetchControllers.push(fetching$2({
					request: r,
					processResponse(response) {
						if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) responsePromise.reject(webidl$5.errors.exception({
							header: "Cache.addAll",
							message: "Received an invalid status code or the request failed."
						}));
						else if (response.headersList.contains("vary")) {
							const fieldValues = getFieldValues(response.headersList.get("vary"));
							for (const fieldValue of fieldValues) if (fieldValue === "*") {
								responsePromise.reject(webidl$5.errors.exception({
									header: "Cache.addAll",
									message: "invalid vary field value"
								}));
								for (const controller of fetchControllers) controller.abort();
								return;
							}
						}
					},
					processResponseEndOfBody(response) {
						if (response.aborted) {
							responsePromise.reject(new DOMException("aborted", "AbortError"));
							return;
						}
						responsePromise.resolve(response);
					}
				}));
				responsePromises.push(responsePromise.promise);
			}
			const responses = await Promise.all(responsePromises);
			const operations = [];
			let index = 0;
			for (const response of responses) {
				const operation = {
					type: "put",
					request: requestList[index],
					response
				};
				operations.push(operation);
				index++;
			}
			const cacheJobPromise = createDeferredPromise();
			let errorData = null;
			try {
				this.#batchCacheOperations(operations);
			} catch (e) {
				errorData = e;
			}
			queueMicrotask(() => {
				if (errorData === null) cacheJobPromise.resolve(void 0);
				else cacheJobPromise.reject(errorData);
			});
			return cacheJobPromise.promise;
		}
		async put(request$1, response) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.put";
			webidl$5.argumentLengthCheck(arguments, 2, prefix);
			request$1 = webidl$5.converters.RequestInfo(request$1, prefix, "request");
			response = webidl$5.converters.Response(response, prefix, "response");
			let innerRequest = null;
			if (request$1 instanceof Request) innerRequest = request$1[kState];
			else innerRequest = new Request(request$1)[kState];
			if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") throw webidl$5.errors.exception({
				header: prefix,
				message: "Expected an http/s scheme when method is not GET"
			});
			const innerResponse = response[kState];
			if (innerResponse.status === 206) throw webidl$5.errors.exception({
				header: prefix,
				message: "Got 206 status"
			});
			if (innerResponse.headersList.contains("vary")) {
				const fieldValues = getFieldValues(innerResponse.headersList.get("vary"));
				for (const fieldValue of fieldValues) if (fieldValue === "*") throw webidl$5.errors.exception({
					header: prefix,
					message: "Got * vary field value"
				});
			}
			if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) throw webidl$5.errors.exception({
				header: prefix,
				message: "Response body is locked or disturbed"
			});
			const clonedResponse = cloneResponse(innerResponse);
			const bodyReadPromise = createDeferredPromise();
			if (innerResponse.body != null) readAllBytes(innerResponse.body.stream.getReader()).then(bodyReadPromise.resolve, bodyReadPromise.reject);
			else bodyReadPromise.resolve(void 0);
			const operations = [];
			const operation = {
				type: "put",
				request: innerRequest,
				response: clonedResponse
			};
			operations.push(operation);
			const bytes = await bodyReadPromise.promise;
			if (clonedResponse.body != null) clonedResponse.body.source = bytes;
			const cacheJobPromise = createDeferredPromise();
			let errorData = null;
			try {
				this.#batchCacheOperations(operations);
			} catch (e) {
				errorData = e;
			}
			queueMicrotask(() => {
				if (errorData === null) cacheJobPromise.resolve();
				else cacheJobPromise.reject(errorData);
			});
			return cacheJobPromise.promise;
		}
		async delete(request$1, options = {}) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.delete";
			webidl$5.argumentLengthCheck(arguments, 1, prefix);
			request$1 = webidl$5.converters.RequestInfo(request$1, prefix, "request");
			options = webidl$5.converters.CacheQueryOptions(options, prefix, "options");
			let r = null;
			if (request$1 instanceof Request) {
				r = request$1[kState];
				if (r.method !== "GET" && !options.ignoreMethod) return false;
			} else {
				assert$2(typeof request$1 === "string");
				r = new Request(request$1)[kState];
			}
			const operations = [];
			const operation = {
				type: "delete",
				request: r,
				options
			};
			operations.push(operation);
			const cacheJobPromise = createDeferredPromise();
			let errorData = null;
			let requestResponses;
			try {
				requestResponses = this.#batchCacheOperations(operations);
			} catch (e) {
				errorData = e;
			}
			queueMicrotask(() => {
				if (errorData === null) cacheJobPromise.resolve(!!requestResponses?.length);
				else cacheJobPromise.reject(errorData);
			});
			return cacheJobPromise.promise;
		}
		async keys(request$1 = void 0, options = {}) {
			webidl$5.brandCheck(this, Cache$1);
			const prefix = "Cache.keys";
			if (request$1 !== void 0) request$1 = webidl$5.converters.RequestInfo(request$1, prefix, "request");
			options = webidl$5.converters.CacheQueryOptions(options, prefix, "options");
			let r = null;
			if (request$1 !== void 0) {
				if (request$1 instanceof Request) {
					r = request$1[kState];
					if (r.method !== "GET" && !options.ignoreMethod) return [];
				} else if (typeof request$1 === "string") r = new Request(request$1)[kState];
			}
			const promise = createDeferredPromise();
			const requests = [];
			if (request$1 === void 0) for (const requestResponse of this.#relevantRequestResponseList) requests.push(requestResponse[0]);
			else {
				const requestResponses = this.#queryCache(r, options);
				for (const requestResponse of requestResponses) requests.push(requestResponse[0]);
			}
			queueMicrotask(() => {
				const requestList = [];
				for (const request$2 of requests) {
					const requestObject = fromInnerRequest(request$2, new AbortController().signal, "immutable");
					requestList.push(requestObject);
				}
				promise.resolve(Object.freeze(requestList));
			});
			return promise.promise;
		}
		#batchCacheOperations(operations) {
			const cache = this.#relevantRequestResponseList;
			const backupCache = [...cache];
			const addedItems = [];
			const resultList = [];
			try {
				for (const operation of operations) {
					if (operation.type !== "delete" && operation.type !== "put") throw webidl$5.errors.exception({
						header: "Cache.#batchCacheOperations",
						message: "operation type does not match \"delete\" or \"put\""
					});
					if (operation.type === "delete" && operation.response != null) throw webidl$5.errors.exception({
						header: "Cache.#batchCacheOperations",
						message: "delete operation should not have an associated response"
					});
					if (this.#queryCache(operation.request, operation.options, addedItems).length) throw new DOMException("???", "InvalidStateError");
					let requestResponses;
					if (operation.type === "delete") {
						requestResponses = this.#queryCache(operation.request, operation.options);
						if (requestResponses.length === 0) return [];
						for (const requestResponse of requestResponses) {
							const idx = cache.indexOf(requestResponse);
							assert$2(idx !== -1);
							cache.splice(idx, 1);
						}
					} else if (operation.type === "put") {
						if (operation.response == null) throw webidl$5.errors.exception({
							header: "Cache.#batchCacheOperations",
							message: "put operation should have an associated response"
						});
						const r = operation.request;
						if (!urlIsHttpHttpsScheme(r.url)) throw webidl$5.errors.exception({
							header: "Cache.#batchCacheOperations",
							message: "expected http or https scheme"
						});
						if (r.method !== "GET") throw webidl$5.errors.exception({
							header: "Cache.#batchCacheOperations",
							message: "not get method"
						});
						if (operation.options != null) throw webidl$5.errors.exception({
							header: "Cache.#batchCacheOperations",
							message: "options must not be defined"
						});
						requestResponses = this.#queryCache(operation.request);
						for (const requestResponse of requestResponses) {
							const idx = cache.indexOf(requestResponse);
							assert$2(idx !== -1);
							cache.splice(idx, 1);
						}
						cache.push([operation.request, operation.response]);
						addedItems.push([operation.request, operation.response]);
					}
					resultList.push([operation.request, operation.response]);
				}
				return resultList;
			} catch (e) {
				this.#relevantRequestResponseList.length = 0;
				this.#relevantRequestResponseList = backupCache;
				throw e;
			}
		}
		#queryCache(requestQuery, options, targetStorage) {
			const resultList = [];
			const storage = targetStorage ?? this.#relevantRequestResponseList;
			for (const requestResponse of storage) {
				const [cachedRequest, cachedResponse] = requestResponse;
				if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) resultList.push(requestResponse);
			}
			return resultList;
		}
		#requestMatchesCachedItem(requestQuery, request$1, response = null, options) {
			const queryURL = new URL(requestQuery.url);
			const cachedURL = new URL(request$1.url);
			if (options?.ignoreSearch) {
				cachedURL.search = "";
				queryURL.search = "";
			}
			if (!urlEquals(queryURL, cachedURL, true)) return false;
			if (response == null || options?.ignoreVary || !response.headersList.contains("vary")) return true;
			const fieldValues = getFieldValues(response.headersList.get("vary"));
			for (const fieldValue of fieldValues) {
				if (fieldValue === "*") return false;
				if (request$1.headersList.get(fieldValue) !== requestQuery.headersList.get(fieldValue)) return false;
			}
			return true;
		}
		#internalMatchAll(request$1, options, maxResponses = Infinity) {
			let r = null;
			if (request$1 !== void 0) {
				if (request$1 instanceof Request) {
					r = request$1[kState];
					if (r.method !== "GET" && !options.ignoreMethod) return [];
				} else if (typeof request$1 === "string") r = new Request(request$1)[kState];
			}
			const responses = [];
			if (request$1 === void 0) for (const requestResponse of this.#relevantRequestResponseList) responses.push(requestResponse[1]);
			else {
				const requestResponses = this.#queryCache(r, options);
				for (const requestResponse of requestResponses) responses.push(requestResponse[1]);
			}
			const responseList = [];
			for (const response of responses) {
				const responseObject = fromInnerResponse(response, "immutable");
				responseList.push(responseObject.clone());
				if (responseList.length >= maxResponses) break;
			}
			return Object.freeze(responseList);
		}
	};
	Object.defineProperties(Cache$1.prototype, {
		[Symbol.toStringTag]: {
			value: "Cache",
			configurable: true
		},
		match: kEnumerableProperty$4,
		matchAll: kEnumerableProperty$4,
		add: kEnumerableProperty$4,
		addAll: kEnumerableProperty$4,
		put: kEnumerableProperty$4,
		delete: kEnumerableProperty$4,
		keys: kEnumerableProperty$4
	});
	var cacheQueryOptionConverters = [
		{
			key: "ignoreSearch",
			converter: webidl$5.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "ignoreMethod",
			converter: webidl$5.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "ignoreVary",
			converter: webidl$5.converters.boolean,
			defaultValue: () => false
		}
	];
	webidl$5.converters.CacheQueryOptions = webidl$5.dictionaryConverter(cacheQueryOptionConverters);
	webidl$5.converters.MultiCacheQueryOptions = webidl$5.dictionaryConverter([...cacheQueryOptionConverters, {
		key: "cacheName",
		converter: webidl$5.converters.DOMString
	}]);
	webidl$5.converters.Response = webidl$5.interfaceConverter(Response);
	webidl$5.converters["sequence<RequestInfo>"] = webidl$5.sequenceConverter(webidl$5.converters.RequestInfo);
	module.exports = { Cache: Cache$1 };
}));
var require_cachestorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kConstruct: kConstruct$2 } = require_symbols$1();
	var { Cache } = require_cache();
	var { webidl: webidl$4 } = require_webidl();
	var { kEnumerableProperty: kEnumerableProperty$3 } = require_util$9();
	var CacheStorage$1 = class CacheStorage$1 {
		#caches = /* @__PURE__ */ new Map();
		constructor() {
			if (arguments[0] !== kConstruct$2) webidl$4.illegalConstructor();
			webidl$4.util.markAsUncloneable(this);
		}
		async match(request$1, options = {}) {
			webidl$4.brandCheck(this, CacheStorage$1);
			webidl$4.argumentLengthCheck(arguments, 1, "CacheStorage.match");
			request$1 = webidl$4.converters.RequestInfo(request$1);
			options = webidl$4.converters.MultiCacheQueryOptions(options);
			if (options.cacheName != null) {
				if (this.#caches.has(options.cacheName)) return await new Cache(kConstruct$2, this.#caches.get(options.cacheName)).match(request$1, options);
			} else for (const cacheList of this.#caches.values()) {
				const response = await new Cache(kConstruct$2, cacheList).match(request$1, options);
				if (response !== void 0) return response;
			}
		}
		async has(cacheName) {
			webidl$4.brandCheck(this, CacheStorage$1);
			const prefix = "CacheStorage.has";
			webidl$4.argumentLengthCheck(arguments, 1, prefix);
			cacheName = webidl$4.converters.DOMString(cacheName, prefix, "cacheName");
			return this.#caches.has(cacheName);
		}
		async open(cacheName) {
			webidl$4.brandCheck(this, CacheStorage$1);
			const prefix = "CacheStorage.open";
			webidl$4.argumentLengthCheck(arguments, 1, prefix);
			cacheName = webidl$4.converters.DOMString(cacheName, prefix, "cacheName");
			if (this.#caches.has(cacheName)) return new Cache(kConstruct$2, this.#caches.get(cacheName));
			const cache = [];
			this.#caches.set(cacheName, cache);
			return new Cache(kConstruct$2, cache);
		}
		async delete(cacheName) {
			webidl$4.brandCheck(this, CacheStorage$1);
			const prefix = "CacheStorage.delete";
			webidl$4.argumentLengthCheck(arguments, 1, prefix);
			cacheName = webidl$4.converters.DOMString(cacheName, prefix, "cacheName");
			return this.#caches.delete(cacheName);
		}
		async keys() {
			webidl$4.brandCheck(this, CacheStorage$1);
			return [...this.#caches.keys()];
		}
	};
	Object.defineProperties(CacheStorage$1.prototype, {
		[Symbol.toStringTag]: {
			value: "CacheStorage",
			configurable: true
		},
		match: kEnumerableProperty$3,
		has: kEnumerableProperty$3,
		open: kEnumerableProperty$3,
		delete: kEnumerableProperty$3,
		keys: kEnumerableProperty$3
	});
	module.exports = { CacheStorage: CacheStorage$1 };
}));
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		maxAttributeValueSize: 1024,
		maxNameValuePairSize: 4096
	};
}));
var require_util$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	function isCTLExcludingHtab$1(value) {
		for (let i = 0; i < value.length; ++i) {
			const code = value.charCodeAt(i);
			if (code >= 0 && code <= 8 || code >= 10 && code <= 31 || code === 127) return true;
		}
		return false;
	}
	function validateCookieName(name$1) {
		for (let i = 0; i < name$1.length; ++i) {
			const code = name$1.charCodeAt(i);
			if (code < 33 || code > 126 || code === 34 || code === 40 || code === 41 || code === 60 || code === 62 || code === 64 || code === 44 || code === 59 || code === 58 || code === 92 || code === 47 || code === 91 || code === 93 || code === 63 || code === 61 || code === 123 || code === 125) throw new Error("Invalid cookie name");
		}
	}
	function validateCookieValue(value) {
		let len = value.length;
		let i = 0;
		if (value[0] === "\"") {
			if (len === 1 || value[len - 1] !== "\"") throw new Error("Invalid cookie value");
			--len;
			++i;
		}
		while (i < len) {
			const code = value.charCodeAt(i++);
			if (code < 33 || code > 126 || code === 34 || code === 44 || code === 59 || code === 92) throw new Error("Invalid cookie value");
		}
	}
	function validateCookiePath(path$1) {
		for (let i = 0; i < path$1.length; ++i) {
			const code = path$1.charCodeAt(i);
			if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path");
		}
	}
	function validateCookieDomain(domain) {
		if (domain.startsWith("-") || domain.endsWith(".") || domain.endsWith("-")) throw new Error("Invalid cookie domain");
	}
	var IMFDays = [
		"Sun",
		"Mon",
		"Tue",
		"Wed",
		"Thu",
		"Fri",
		"Sat"
	];
	var IMFMonths = [
		"Jan",
		"Feb",
		"Mar",
		"Apr",
		"May",
		"Jun",
		"Jul",
		"Aug",
		"Sep",
		"Oct",
		"Nov",
		"Dec"
	];
	var IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, "0"));
	function toIMFDate(date) {
		if (typeof date === "number") date = new Date(date);
		return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`;
	}
	function validateCookieMaxAge(maxAge) {
		if (maxAge < 0) throw new Error("Invalid cookie max-age");
	}
	function stringify$1(cookie) {
		if (cookie.name.length === 0) return null;
		validateCookieName(cookie.name);
		validateCookieValue(cookie.value);
		const out = [`${cookie.name}=${cookie.value}`];
		if (cookie.name.startsWith("__Secure-")) cookie.secure = true;
		if (cookie.name.startsWith("__Host-")) {
			cookie.secure = true;
			cookie.domain = null;
			cookie.path = "/";
		}
		if (cookie.secure) out.push("Secure");
		if (cookie.httpOnly) out.push("HttpOnly");
		if (typeof cookie.maxAge === "number") {
			validateCookieMaxAge(cookie.maxAge);
			out.push(`Max-Age=${cookie.maxAge}`);
		}
		if (cookie.domain) {
			validateCookieDomain(cookie.domain);
			out.push(`Domain=${cookie.domain}`);
		}
		if (cookie.path) {
			validateCookiePath(cookie.path);
			out.push(`Path=${cookie.path}`);
		}
		if (cookie.expires && cookie.expires.toString() !== "Invalid Date") out.push(`Expires=${toIMFDate(cookie.expires)}`);
		if (cookie.sameSite) out.push(`SameSite=${cookie.sameSite}`);
		for (const part of cookie.unparsed) {
			if (!part.includes("=")) throw new Error("Invalid unparsed");
			const [key, ...value] = part.split("=");
			out.push(`${key.trim()}=${value.join("=")}`);
		}
		return out.join("; ");
	}
	module.exports = {
		isCTLExcludingHtab: isCTLExcludingHtab$1,
		validateCookieName,
		validateCookiePath,
		validateCookieValue,
		toIMFDate,
		stringify: stringify$1
	};
}));
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { maxNameValuePairSize, maxAttributeValueSize } = require_constants$1();
	var { isCTLExcludingHtab } = require_util$4();
	var { collectASequenceOfCodePointsFast: collectASequenceOfCodePointsFast$1 } = require_data_url();
	var assert$1 = require("node:assert");
	function parseSetCookie$1(header) {
		if (isCTLExcludingHtab(header)) return null;
		let nameValuePair = "";
		let unparsedAttributes = "";
		let name$1 = "";
		let value = "";
		if (header.includes(";")) {
			const position = { position: 0 };
			nameValuePair = collectASequenceOfCodePointsFast$1(";", header, position);
			unparsedAttributes = header.slice(position.position);
		} else nameValuePair = header;
		if (!nameValuePair.includes("=")) value = nameValuePair;
		else {
			const position = { position: 0 };
			name$1 = collectASequenceOfCodePointsFast$1("=", nameValuePair, position);
			value = nameValuePair.slice(position.position + 1);
		}
		name$1 = name$1.trim();
		value = value.trim();
		if (name$1.length + value.length > maxNameValuePairSize) return null;
		return {
			name: name$1,
			value,
			...parseUnparsedAttributes(unparsedAttributes)
		};
	}
	function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) {
		if (unparsedAttributes.length === 0) return cookieAttributeList;
		assert$1(unparsedAttributes[0] === ";");
		unparsedAttributes = unparsedAttributes.slice(1);
		let cookieAv = "";
		if (unparsedAttributes.includes(";")) {
			cookieAv = collectASequenceOfCodePointsFast$1(";", unparsedAttributes, { position: 0 });
			unparsedAttributes = unparsedAttributes.slice(cookieAv.length);
		} else {
			cookieAv = unparsedAttributes;
			unparsedAttributes = "";
		}
		let attributeName = "";
		let attributeValue = "";
		if (cookieAv.includes("=")) {
			const position = { position: 0 };
			attributeName = collectASequenceOfCodePointsFast$1("=", cookieAv, position);
			attributeValue = cookieAv.slice(position.position + 1);
		} else attributeName = cookieAv;
		attributeName = attributeName.trim();
		attributeValue = attributeValue.trim();
		if (attributeValue.length > maxAttributeValueSize) return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
		const attributeNameLowercase = attributeName.toLowerCase();
		if (attributeNameLowercase === "expires") cookieAttributeList.expires = new Date(attributeValue);
		else if (attributeNameLowercase === "max-age") {
			const charCode = attributeValue.charCodeAt(0);
			if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
			if (!/^\d+$/.test(attributeValue)) return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
			cookieAttributeList.maxAge = Number(attributeValue);
		} else if (attributeNameLowercase === "domain") {
			let cookieDomain = attributeValue;
			if (cookieDomain[0] === ".") cookieDomain = cookieDomain.slice(1);
			cookieDomain = cookieDomain.toLowerCase();
			cookieAttributeList.domain = cookieDomain;
		} else if (attributeNameLowercase === "path") {
			let cookiePath = "";
			if (attributeValue.length === 0 || attributeValue[0] !== "/") cookiePath = "/";
			else cookiePath = attributeValue;
			cookieAttributeList.path = cookiePath;
		} else if (attributeNameLowercase === "secure") cookieAttributeList.secure = true;
		else if (attributeNameLowercase === "httponly") cookieAttributeList.httpOnly = true;
		else if (attributeNameLowercase === "samesite") {
			let enforcement = "Default";
			const attributeValueLowercase = attributeValue.toLowerCase();
			if (attributeValueLowercase.includes("none")) enforcement = "None";
			if (attributeValueLowercase.includes("strict")) enforcement = "Strict";
			if (attributeValueLowercase.includes("lax")) enforcement = "Lax";
			cookieAttributeList.sameSite = enforcement;
		} else {
			cookieAttributeList.unparsed ??= [];
			cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`);
		}
		return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList);
	}
	module.exports = {
		parseSetCookie: parseSetCookie$1,
		parseUnparsedAttributes
	};
}));
var require_cookies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { parseSetCookie } = require_parse();
	var { stringify } = require_util$4();
	var { webidl: webidl$3 } = require_webidl();
	var { Headers: Headers$1 } = require_headers();
	function getCookies$1(headers) {
		webidl$3.argumentLengthCheck(arguments, 1, "getCookies");
		webidl$3.brandCheck(headers, Headers$1, { strict: false });
		const cookie = headers.get("cookie");
		const out = {};
		if (!cookie) return out;
		for (const piece of cookie.split(";")) {
			const [name$1, ...value] = piece.split("=");
			out[name$1.trim()] = value.join("=");
		}
		return out;
	}
	function deleteCookie$1(headers, name$1, attributes) {
		webidl$3.brandCheck(headers, Headers$1, { strict: false });
		const prefix = "deleteCookie";
		webidl$3.argumentLengthCheck(arguments, 2, prefix);
		name$1 = webidl$3.converters.DOMString(name$1, prefix, "name");
		attributes = webidl$3.converters.DeleteCookieAttributes(attributes);
		setCookie$1(headers, {
			name: name$1,
			value: "",
			expires: /* @__PURE__ */ new Date(0),
			...attributes
		});
	}
	function getSetCookies$1(headers) {
		webidl$3.argumentLengthCheck(arguments, 1, "getSetCookies");
		webidl$3.brandCheck(headers, Headers$1, { strict: false });
		const cookies = headers.getSetCookie();
		if (!cookies) return [];
		return cookies.map((pair) => parseSetCookie(pair));
	}
	function setCookie$1(headers, cookie) {
		webidl$3.argumentLengthCheck(arguments, 2, "setCookie");
		webidl$3.brandCheck(headers, Headers$1, { strict: false });
		cookie = webidl$3.converters.Cookie(cookie);
		const str = stringify(cookie);
		if (str) headers.append("Set-Cookie", str);
	}
	webidl$3.converters.DeleteCookieAttributes = webidl$3.dictionaryConverter([{
		converter: webidl$3.nullableConverter(webidl$3.converters.DOMString),
		key: "path",
		defaultValue: () => null
	}, {
		converter: webidl$3.nullableConverter(webidl$3.converters.DOMString),
		key: "domain",
		defaultValue: () => null
	}]);
	webidl$3.converters.Cookie = webidl$3.dictionaryConverter([
		{
			converter: webidl$3.converters.DOMString,
			key: "name"
		},
		{
			converter: webidl$3.converters.DOMString,
			key: "value"
		},
		{
			converter: webidl$3.nullableConverter((value) => {
				if (typeof value === "number") return webidl$3.converters["unsigned long long"](value);
				return new Date(value);
			}),
			key: "expires",
			defaultValue: () => null
		},
		{
			converter: webidl$3.nullableConverter(webidl$3.converters["long long"]),
			key: "maxAge",
			defaultValue: () => null
		},
		{
			converter: webidl$3.nullableConverter(webidl$3.converters.DOMString),
			key: "domain",
			defaultValue: () => null
		},
		{
			converter: webidl$3.nullableConverter(webidl$3.converters.DOMString),
			key: "path",
			defaultValue: () => null
		},
		{
			converter: webidl$3.nullableConverter(webidl$3.converters.boolean),
			key: "secure",
			defaultValue: () => null
		},
		{
			converter: webidl$3.nullableConverter(webidl$3.converters.boolean),
			key: "httpOnly",
			defaultValue: () => null
		},
		{
			converter: webidl$3.converters.USVString,
			key: "sameSite",
			allowedValues: [
				"Strict",
				"Lax",
				"None"
			]
		},
		{
			converter: webidl$3.sequenceConverter(webidl$3.converters.DOMString),
			key: "unparsed",
			defaultValue: () => new Array(0)
		}
	]);
	module.exports = {
		getCookies: getCookies$1,
		deleteCookie: deleteCookie$1,
		getSetCookies: getSetCookies$1,
		setCookie: setCookie$1
	};
}));
var require_events = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { webidl: webidl$2 } = require_webidl();
	var { kEnumerableProperty: kEnumerableProperty$2 } = require_util$9();
	var { kConstruct: kConstruct$1 } = require_symbols$4();
	var { MessagePort } = require("node:worker_threads");
	var MessageEvent$1 = class MessageEvent$1 extends Event {
		#eventInit;
		constructor(type, eventInitDict = {}) {
			if (type === kConstruct$1) {
				super(arguments[1], arguments[2]);
				webidl$2.util.markAsUncloneable(this);
				return;
			}
			const prefix = "MessageEvent constructor";
			webidl$2.argumentLengthCheck(arguments, 1, prefix);
			type = webidl$2.converters.DOMString(type, prefix, "type");
			eventInitDict = webidl$2.converters.MessageEventInit(eventInitDict, prefix, "eventInitDict");
			super(type, eventInitDict);
			this.#eventInit = eventInitDict;
			webidl$2.util.markAsUncloneable(this);
		}
		get data() {
			webidl$2.brandCheck(this, MessageEvent$1);
			return this.#eventInit.data;
		}
		get origin() {
			webidl$2.brandCheck(this, MessageEvent$1);
			return this.#eventInit.origin;
		}
		get lastEventId() {
			webidl$2.brandCheck(this, MessageEvent$1);
			return this.#eventInit.lastEventId;
		}
		get source() {
			webidl$2.brandCheck(this, MessageEvent$1);
			return this.#eventInit.source;
		}
		get ports() {
			webidl$2.brandCheck(this, MessageEvent$1);
			if (!Object.isFrozen(this.#eventInit.ports)) Object.freeze(this.#eventInit.ports);
			return this.#eventInit.ports;
		}
		initMessageEvent(type, bubbles = false, cancelable = false, data$1 = null, origin$1 = "", lastEventId = "", source = null, ports = []) {
			webidl$2.brandCheck(this, MessageEvent$1);
			webidl$2.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent");
			return new MessageEvent$1(type, {
				bubbles,
				cancelable,
				data: data$1,
				origin: origin$1,
				lastEventId,
				source,
				ports
			});
		}
		static createFastMessageEvent(type, init$1) {
			const messageEvent = new MessageEvent$1(kConstruct$1, type, init$1);
			messageEvent.#eventInit = init$1;
			messageEvent.#eventInit.data ??= null;
			messageEvent.#eventInit.origin ??= "";
			messageEvent.#eventInit.lastEventId ??= "";
			messageEvent.#eventInit.source ??= null;
			messageEvent.#eventInit.ports ??= [];
			return messageEvent;
		}
	};
	var { createFastMessageEvent: createFastMessageEvent$2 } = MessageEvent$1;
	delete MessageEvent$1.createFastMessageEvent;
	var CloseEvent$3 = class CloseEvent$3 extends Event {
		#eventInit;
		constructor(type, eventInitDict = {}) {
			const prefix = "CloseEvent constructor";
			webidl$2.argumentLengthCheck(arguments, 1, prefix);
			type = webidl$2.converters.DOMString(type, prefix, "type");
			eventInitDict = webidl$2.converters.CloseEventInit(eventInitDict);
			super(type, eventInitDict);
			this.#eventInit = eventInitDict;
			webidl$2.util.markAsUncloneable(this);
		}
		get wasClean() {
			webidl$2.brandCheck(this, CloseEvent$3);
			return this.#eventInit.wasClean;
		}
		get code() {
			webidl$2.brandCheck(this, CloseEvent$3);
			return this.#eventInit.code;
		}
		get reason() {
			webidl$2.brandCheck(this, CloseEvent$3);
			return this.#eventInit.reason;
		}
	};
	var ErrorEvent$3 = class ErrorEvent$3 extends Event {
		#eventInit;
		constructor(type, eventInitDict) {
			const prefix = "ErrorEvent constructor";
			webidl$2.argumentLengthCheck(arguments, 1, prefix);
			super(type, eventInitDict);
			webidl$2.util.markAsUncloneable(this);
			type = webidl$2.converters.DOMString(type, prefix, "type");
			eventInitDict = webidl$2.converters.ErrorEventInit(eventInitDict ?? {});
			this.#eventInit = eventInitDict;
		}
		get message() {
			webidl$2.brandCheck(this, ErrorEvent$3);
			return this.#eventInit.message;
		}
		get filename() {
			webidl$2.brandCheck(this, ErrorEvent$3);
			return this.#eventInit.filename;
		}
		get lineno() {
			webidl$2.brandCheck(this, ErrorEvent$3);
			return this.#eventInit.lineno;
		}
		get colno() {
			webidl$2.brandCheck(this, ErrorEvent$3);
			return this.#eventInit.colno;
		}
		get error() {
			webidl$2.brandCheck(this, ErrorEvent$3);
			return this.#eventInit.error;
		}
	};
	Object.defineProperties(MessageEvent$1.prototype, {
		[Symbol.toStringTag]: {
			value: "MessageEvent",
			configurable: true
		},
		data: kEnumerableProperty$2,
		origin: kEnumerableProperty$2,
		lastEventId: kEnumerableProperty$2,
		source: kEnumerableProperty$2,
		ports: kEnumerableProperty$2,
		initMessageEvent: kEnumerableProperty$2
	});
	Object.defineProperties(CloseEvent$3.prototype, {
		[Symbol.toStringTag]: {
			value: "CloseEvent",
			configurable: true
		},
		reason: kEnumerableProperty$2,
		code: kEnumerableProperty$2,
		wasClean: kEnumerableProperty$2
	});
	Object.defineProperties(ErrorEvent$3.prototype, {
		[Symbol.toStringTag]: {
			value: "ErrorEvent",
			configurable: true
		},
		message: kEnumerableProperty$2,
		filename: kEnumerableProperty$2,
		lineno: kEnumerableProperty$2,
		colno: kEnumerableProperty$2,
		error: kEnumerableProperty$2
	});
	webidl$2.converters.MessagePort = webidl$2.interfaceConverter(MessagePort);
	webidl$2.converters["sequence<MessagePort>"] = webidl$2.sequenceConverter(webidl$2.converters.MessagePort);
	var eventInit = [
		{
			key: "bubbles",
			converter: webidl$2.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "cancelable",
			converter: webidl$2.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "composed",
			converter: webidl$2.converters.boolean,
			defaultValue: () => false
		}
	];
	webidl$2.converters.MessageEventInit = webidl$2.dictionaryConverter([
		...eventInit,
		{
			key: "data",
			converter: webidl$2.converters.any,
			defaultValue: () => null
		},
		{
			key: "origin",
			converter: webidl$2.converters.USVString,
			defaultValue: () => ""
		},
		{
			key: "lastEventId",
			converter: webidl$2.converters.DOMString,
			defaultValue: () => ""
		},
		{
			key: "source",
			converter: webidl$2.nullableConverter(webidl$2.converters.MessagePort),
			defaultValue: () => null
		},
		{
			key: "ports",
			converter: webidl$2.converters["sequence<MessagePort>"],
			defaultValue: () => new Array(0)
		}
	]);
	webidl$2.converters.CloseEventInit = webidl$2.dictionaryConverter([
		...eventInit,
		{
			key: "wasClean",
			converter: webidl$2.converters.boolean,
			defaultValue: () => false
		},
		{
			key: "code",
			converter: webidl$2.converters["unsigned short"],
			defaultValue: () => 0
		},
		{
			key: "reason",
			converter: webidl$2.converters.USVString,
			defaultValue: () => ""
		}
	]);
	webidl$2.converters.ErrorEventInit = webidl$2.dictionaryConverter([
		...eventInit,
		{
			key: "message",
			converter: webidl$2.converters.DOMString,
			defaultValue: () => ""
		},
		{
			key: "filename",
			converter: webidl$2.converters.USVString,
			defaultValue: () => ""
		},
		{
			key: "lineno",
			converter: webidl$2.converters["unsigned long"],
			defaultValue: () => 0
		},
		{
			key: "colno",
			converter: webidl$2.converters["unsigned long"],
			defaultValue: () => 0
		},
		{
			key: "error",
			converter: webidl$2.converters.any
		}
	]);
	module.exports = {
		MessageEvent: MessageEvent$1,
		CloseEvent: CloseEvent$3,
		ErrorEvent: ErrorEvent$3,
		createFastMessageEvent: createFastMessageEvent$2
	};
}));
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		uid: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
		sentCloseFrameState: {
			NOT_SENT: 0,
			PROCESSING: 1,
			SENT: 2
		},
		staticPropertyDescriptors: {
			enumerable: true,
			writable: false,
			configurable: false
		},
		states: {
			CONNECTING: 0,
			OPEN: 1,
			CLOSING: 2,
			CLOSED: 3
		},
		opcodes: {
			CONTINUATION: 0,
			TEXT: 1,
			BINARY: 2,
			CLOSE: 8,
			PING: 9,
			PONG: 10
		},
		maxUnsigned16Bit: 2 ** 16 - 1,
		parserStates: {
			INFO: 0,
			PAYLOADLENGTH_16: 2,
			PAYLOADLENGTH_64: 3,
			READ_DATA: 4
		},
		emptyBuffer: Buffer.allocUnsafe(0),
		sendHints: {
			string: 1,
			typedArray: 2,
			arrayBuffer: 3,
			blob: 4
		}
	};
}));
var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	module.exports = {
		kWebSocketURL: Symbol("url"),
		kReadyState: Symbol("ready state"),
		kController: Symbol("controller"),
		kResponse: Symbol("response"),
		kBinaryType: Symbol("binary type"),
		kSentClose: Symbol("sent close"),
		kReceivedClose: Symbol("received close"),
		kByteParser: Symbol("byte parser")
	};
}));
var require_util$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { kReadyState: kReadyState$3, kController: kController$1, kResponse: kResponse$3, kBinaryType: kBinaryType$1, kWebSocketURL: kWebSocketURL$1 } = require_symbols();
	var { states: states$3, opcodes: opcodes$3 } = require_constants();
	var { ErrorEvent: ErrorEvent$2, createFastMessageEvent: createFastMessageEvent$1 } = require_events();
	var { isUtf8 } = require("node:buffer");
	var { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require_data_url();
	function isConnecting$1(ws) {
		return ws[kReadyState$3] === states$3.CONNECTING;
	}
	function isEstablished$2(ws) {
		return ws[kReadyState$3] === states$3.OPEN;
	}
	function isClosing$2(ws) {
		return ws[kReadyState$3] === states$3.CLOSING;
	}
	function isClosed$1(ws) {
		return ws[kReadyState$3] === states$3.CLOSED;
	}
	function fireEvent$2(e, target, eventFactory = (type, init$1) => new Event(type, init$1), eventInitDict = {}) {
		const event = eventFactory(e, eventInitDict);
		target.dispatchEvent(event);
	}
	function websocketMessageReceived$1(ws, type, data$1) {
		if (ws[kReadyState$3] !== states$3.OPEN) return;
		let dataForEvent;
		if (type === opcodes$3.TEXT) try {
			dataForEvent = utf8Decode$1(data$1);
		} catch {
			failWebsocketConnection$2(ws, "Received invalid UTF-8 in text frame.");
			return;
		}
		else if (type === opcodes$3.BINARY) if (ws[kBinaryType$1] === "blob") dataForEvent = new Blob([data$1]);
		else dataForEvent = toArrayBuffer(data$1);
		fireEvent$2("message", ws, createFastMessageEvent$1, {
			origin: ws[kWebSocketURL$1].origin,
			data: dataForEvent
		});
	}
	function toArrayBuffer(buffer$1) {
		if (buffer$1.byteLength === buffer$1.buffer.byteLength) return buffer$1.buffer;
		return buffer$1.buffer.slice(buffer$1.byteOffset, buffer$1.byteOffset + buffer$1.byteLength);
	}
	function isValidSubprotocol$1(protocol) {
		if (protocol.length === 0) return false;
		for (let i = 0; i < protocol.length; ++i) {
			const code = protocol.charCodeAt(i);
			if (code < 33 || code > 126 || code === 34 || code === 40 || code === 41 || code === 44 || code === 47 || code === 58 || code === 59 || code === 60 || code === 61 || code === 62 || code === 63 || code === 64 || code === 91 || code === 92 || code === 93 || code === 123 || code === 125) return false;
		}
		return true;
	}
	function isValidStatusCode$1(code) {
		if (code >= 1e3 && code < 1015) return code !== 1004 && code !== 1005 && code !== 1006;
		return code >= 3e3 && code <= 4999;
	}
	function failWebsocketConnection$2(ws, reason) {
		const { [kController$1]: controller, [kResponse$3]: response } = ws;
		controller.abort();
		if (response?.socket && !response.socket.destroyed) response.socket.destroy();
		if (reason) fireEvent$2("error", ws, (type, init$1) => new ErrorEvent$2(type, init$1), {
			error: new Error(reason),
			message: reason
		});
	}
	function isControlFrame$1(opcode) {
		return opcode === opcodes$3.CLOSE || opcode === opcodes$3.PING || opcode === opcodes$3.PONG;
	}
	function isContinuationFrame$1(opcode) {
		return opcode === opcodes$3.CONTINUATION;
	}
	function isTextBinaryFrame$1(opcode) {
		return opcode === opcodes$3.TEXT || opcode === opcodes$3.BINARY;
	}
	function isValidOpcode$1(opcode) {
		return isTextBinaryFrame$1(opcode) || isContinuationFrame$1(opcode) || isControlFrame$1(opcode);
	}
	function parseExtensions$1(extensions) {
		const position = { position: 0 };
		const extensionList = /* @__PURE__ */ new Map();
		while (position.position < extensions.length) {
			const [name$1, value = ""] = collectASequenceOfCodePointsFast(";", extensions, position).split("=");
			extensionList.set(removeHTTPWhitespace(name$1, true, false), removeHTTPWhitespace(value, false, true));
			position.position++;
		}
		return extensionList;
	}
	function isValidClientWindowBits$1(value) {
		for (let i = 0; i < value.length; i++) {
			const byte = value.charCodeAt(i);
			if (byte < 48 || byte > 57) return false;
		}
		return true;
	}
	var hasIntl = typeof process.versions.icu === "string";
	var fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0;
	var utf8Decode$1 = hasIntl ? fatalDecoder.decode.bind(fatalDecoder) : function(buffer$1) {
		if (isUtf8(buffer$1)) return buffer$1.toString("utf-8");
		throw new TypeError("Invalid utf-8 received.");
	};
	module.exports = {
		isConnecting: isConnecting$1,
		isEstablished: isEstablished$2,
		isClosing: isClosing$2,
		isClosed: isClosed$1,
		fireEvent: fireEvent$2,
		isValidSubprotocol: isValidSubprotocol$1,
		isValidStatusCode: isValidStatusCode$1,
		failWebsocketConnection: failWebsocketConnection$2,
		websocketMessageReceived: websocketMessageReceived$1,
		utf8Decode: utf8Decode$1,
		isControlFrame: isControlFrame$1,
		isContinuationFrame: isContinuationFrame$1,
		isTextBinaryFrame: isTextBinaryFrame$1,
		isValidOpcode: isValidOpcode$1,
		parseExtensions: parseExtensions$1,
		isValidClientWindowBits: isValidClientWindowBits$1
	};
}));
var require_frame = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { maxUnsigned16Bit } = require_constants();
	var BUFFER_SIZE = 16386;
	var crypto$3;
	var buffer = null;
	var bufIdx = BUFFER_SIZE;
	try {
		crypto$3 = require("node:crypto");
	} catch {
		crypto$3 = { randomFillSync: function randomFillSync(buffer$1, _offset, _size) {
			for (let i = 0; i < buffer$1.length; ++i) buffer$1[i] = Math.random() * 255 | 0;
			return buffer$1;
		} };
	}
	function generateMask() {
		if (bufIdx === BUFFER_SIZE) {
			bufIdx = 0;
			crypto$3.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE);
		}
		return [
			buffer[bufIdx++],
			buffer[bufIdx++],
			buffer[bufIdx++],
			buffer[bufIdx++]
		];
	}
	var WebsocketFrameSend$3 = class {
		constructor(data$1) {
			this.frameData = data$1;
		}
		createFrame(opcode) {
			const frameData = this.frameData;
			const maskKey = generateMask();
			const bodyLength$1 = frameData?.byteLength ?? 0;
			let payloadLength = bodyLength$1;
			let offset = 6;
			if (bodyLength$1 > maxUnsigned16Bit) {
				offset += 8;
				payloadLength = 127;
			} else if (bodyLength$1 > 125) {
				offset += 2;
				payloadLength = 126;
			}
			const buffer$1 = Buffer.allocUnsafe(bodyLength$1 + offset);
			buffer$1[0] = buffer$1[1] = 0;
			buffer$1[0] |= 128;
			buffer$1[0] = (buffer$1[0] & 240) + opcode;
			buffer$1[offset - 4] = maskKey[0];
			buffer$1[offset - 3] = maskKey[1];
			buffer$1[offset - 2] = maskKey[2];
			buffer$1[offset - 1] = maskKey[3];
			buffer$1[1] = payloadLength;
			if (payloadLength === 126) buffer$1.writeUInt16BE(bodyLength$1, 2);
			else if (payloadLength === 127) {
				buffer$1[2] = buffer$1[3] = 0;
				buffer$1.writeUIntBE(bodyLength$1, 4, 6);
			}
			buffer$1[1] |= 128;
			for (let i = 0; i < bodyLength$1; ++i) buffer$1[offset + i] = frameData[i] ^ maskKey[i & 3];
			return buffer$1;
		}
	};
	module.exports = { WebsocketFrameSend: WebsocketFrameSend$3 };
}));
var require_connection = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { uid, states: states$2, sentCloseFrameState: sentCloseFrameState$2, emptyBuffer: emptyBuffer$1, opcodes: opcodes$2 } = require_constants();
	var { kReadyState: kReadyState$2, kSentClose: kSentClose$2, kByteParser: kByteParser$1, kReceivedClose: kReceivedClose$1, kResponse: kResponse$2 } = require_symbols();
	var { fireEvent: fireEvent$1, failWebsocketConnection: failWebsocketConnection$1, isClosing: isClosing$1, isClosed, isEstablished: isEstablished$1, parseExtensions } = require_util$3();
	var { channels: channels$1 } = require_diagnostics();
	var { CloseEvent: CloseEvent$2 } = require_events();
	var { makeRequest: makeRequest$1 } = require_request();
	var { fetching: fetching$1 } = require_fetch();
	var { Headers, getHeadersList } = require_headers();
	var { getDecodeSplit } = require_util$8();
	var { WebsocketFrameSend: WebsocketFrameSend$2 } = require_frame();
	var crypto$2;
	try {
		crypto$2 = require("node:crypto");
	} catch {}
	function establishWebSocketConnection$1(url$3, protocols, client, ws, onEstablish, options) {
		const requestURL = url$3;
		requestURL.protocol = url$3.protocol === "ws:" ? "http:" : "https:";
		const request$1 = makeRequest$1({
			urlList: [requestURL],
			client,
			serviceWorkers: "none",
			referrer: "no-referrer",
			mode: "websocket",
			credentials: "include",
			cache: "no-store",
			redirect: "error"
		});
		if (options.headers) request$1.headersList = getHeadersList(new Headers(options.headers));
		const keyValue = crypto$2.randomBytes(16).toString("base64");
		request$1.headersList.append("sec-websocket-key", keyValue);
		request$1.headersList.append("sec-websocket-version", "13");
		for (const protocol of protocols) request$1.headersList.append("sec-websocket-protocol", protocol);
		request$1.headersList.append("sec-websocket-extensions", "permessage-deflate; client_max_window_bits");
		return fetching$1({
			request: request$1,
			useParallelQueue: true,
			dispatcher: options.dispatcher,
			processResponse(response) {
				if (response.type === "error" || response.status !== 101) {
					failWebsocketConnection$1(ws, "Received network error or non-101 status code.");
					return;
				}
				if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) {
					failWebsocketConnection$1(ws, "Server did not respond with sent protocols.");
					return;
				}
				if (response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") {
					failWebsocketConnection$1(ws, "Server did not set Upgrade header to \"websocket\".");
					return;
				}
				if (response.headersList.get("Connection")?.toLowerCase() !== "upgrade") {
					failWebsocketConnection$1(ws, "Server did not set Connection header to \"upgrade\".");
					return;
				}
				if (response.headersList.get("Sec-WebSocket-Accept") !== crypto$2.createHash("sha1").update(keyValue + uid).digest("base64")) {
					failWebsocketConnection$1(ws, "Incorrect hash received in Sec-WebSocket-Accept header.");
					return;
				}
				const secExtension = response.headersList.get("Sec-WebSocket-Extensions");
				let extensions;
				if (secExtension !== null) {
					extensions = parseExtensions(secExtension);
					if (!extensions.has("permessage-deflate")) {
						failWebsocketConnection$1(ws, "Sec-WebSocket-Extensions header does not match.");
						return;
					}
				}
				const secProtocol = response.headersList.get("Sec-WebSocket-Protocol");
				if (secProtocol !== null) {
					if (!getDecodeSplit("sec-websocket-protocol", request$1.headersList).includes(secProtocol)) {
						failWebsocketConnection$1(ws, "Protocol was not set in the opening handshake.");
						return;
					}
				}
				response.socket.on("data", onSocketData);
				response.socket.on("close", onSocketClose);
				response.socket.on("error", onSocketError);
				if (channels$1.open.hasSubscribers) channels$1.open.publish({
					address: response.socket.address(),
					protocol: secProtocol,
					extensions: secExtension
				});
				onEstablish(response, extensions);
			}
		});
	}
	function closeWebSocketConnection$2(ws, code, reason, reasonByteLength) {
		if (isClosing$1(ws) || isClosed(ws)) {} else if (!isEstablished$1(ws)) {
			failWebsocketConnection$1(ws, "Connection was closed before it was established.");
			ws[kReadyState$2] = states$2.CLOSING;
		} else if (ws[kSentClose$2] === sentCloseFrameState$2.NOT_SENT) {
			ws[kSentClose$2] = sentCloseFrameState$2.PROCESSING;
			const frame = new WebsocketFrameSend$2();
			if (code !== void 0 && reason === void 0) {
				frame.frameData = Buffer.allocUnsafe(2);
				frame.frameData.writeUInt16BE(code, 0);
			} else if (code !== void 0 && reason !== void 0) {
				frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength);
				frame.frameData.writeUInt16BE(code, 0);
				frame.frameData.write(reason, 2, "utf-8");
			} else frame.frameData = emptyBuffer$1;
			ws[kResponse$2].socket.write(frame.createFrame(opcodes$2.CLOSE));
			ws[kSentClose$2] = sentCloseFrameState$2.SENT;
			ws[kReadyState$2] = states$2.CLOSING;
		} else ws[kReadyState$2] = states$2.CLOSING;
	}
	function onSocketData(chunk) {
		if (!this.ws[kByteParser$1].write(chunk)) this.pause();
	}
	function onSocketClose() {
		const { ws } = this;
		const { [kResponse$2]: response } = ws;
		response.socket.off("data", onSocketData);
		response.socket.off("close", onSocketClose);
		response.socket.off("error", onSocketError);
		const wasClean = ws[kSentClose$2] === sentCloseFrameState$2.SENT && ws[kReceivedClose$1];
		let code = 1005;
		let reason = "";
		const result = ws[kByteParser$1].closingInfo;
		if (result && !result.error) {
			code = result.code ?? 1005;
			reason = result.reason;
		} else if (!ws[kReceivedClose$1]) code = 1006;
		ws[kReadyState$2] = states$2.CLOSED;
		fireEvent$1("close", ws, (type, init$1) => new CloseEvent$2(type, init$1), {
			wasClean,
			code,
			reason
		});
		if (channels$1.close.hasSubscribers) channels$1.close.publish({
			websocket: ws,
			code,
			reason
		});
	}
	function onSocketError(error) {
		const { ws } = this;
		ws[kReadyState$2] = states$2.CLOSING;
		if (channels$1.socketError.hasSubscribers) channels$1.socketError.publish(error);
		this.destroy();
	}
	module.exports = {
		establishWebSocketConnection: establishWebSocketConnection$1,
		closeWebSocketConnection: closeWebSocketConnection$2
	};
}));
var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require("node:zlib");
	var { isValidClientWindowBits } = require_util$3();
	var tail = Buffer.from([
		0,
		0,
		255,
		255
	]);
	var kBuffer = Symbol("kBuffer");
	var kLength = Symbol("kLength");
	var PerMessageDeflate$1 = class {
		#inflate;
		#options = {};
		constructor(extensions) {
			this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover");
			this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits");
		}
		decompress(chunk, fin, callback) {
			if (!this.#inflate) {
				let windowBits = Z_DEFAULT_WINDOWBITS;
				if (this.#options.serverMaxWindowBits) {
					if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {
						callback(/* @__PURE__ */ new Error("Invalid server_max_window_bits"));
						return;
					}
					windowBits = Number.parseInt(this.#options.serverMaxWindowBits);
				}
				this.#inflate = createInflateRaw({ windowBits });
				this.#inflate[kBuffer] = [];
				this.#inflate[kLength] = 0;
				this.#inflate.on("data", (data$1) => {
					this.#inflate[kBuffer].push(data$1);
					this.#inflate[kLength] += data$1.length;
				});
				this.#inflate.on("error", (err) => {
					this.#inflate = null;
					callback(err);
				});
			}
			this.#inflate.write(chunk);
			if (fin) this.#inflate.write(tail);
			this.#inflate.flush(() => {
				const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]);
				this.#inflate[kBuffer].length = 0;
				this.#inflate[kLength] = 0;
				callback(null, full);
			});
		}
	};
	module.exports = { PerMessageDeflate: PerMessageDeflate$1 };
}));
var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Writable } = require("node:stream");
	var assert = require("node:assert");
	var { parserStates, opcodes: opcodes$1, states: states$1, emptyBuffer, sentCloseFrameState: sentCloseFrameState$1 } = require_constants();
	var { kReadyState: kReadyState$1, kSentClose: kSentClose$1, kResponse: kResponse$1, kReceivedClose } = require_symbols();
	var { channels } = require_diagnostics();
	var { isValidStatusCode, isValidOpcode, failWebsocketConnection, websocketMessageReceived, utf8Decode, isControlFrame, isTextBinaryFrame, isContinuationFrame } = require_util$3();
	var { WebsocketFrameSend: WebsocketFrameSend$1 } = require_frame();
	var { closeWebSocketConnection: closeWebSocketConnection$1 } = require_connection();
	var { PerMessageDeflate } = require_permessage_deflate();
	var ByteParser$1 = class extends Writable {
		#buffers = [];
		#byteOffset = 0;
		#loop = false;
		#state = parserStates.INFO;
		#info = {};
		#fragments = [];
		#extensions;
		constructor(ws, extensions) {
			super();
			this.ws = ws;
			this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions;
			if (this.#extensions.has("permessage-deflate")) this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions));
		}
		_write(chunk, _, callback) {
			this.#buffers.push(chunk);
			this.#byteOffset += chunk.length;
			this.#loop = true;
			this.run(callback);
		}
		run(callback) {
			while (this.#loop) if (this.#state === parserStates.INFO) {
				if (this.#byteOffset < 2) return callback();
				const buffer$1 = this.consume(2);
				const fin = (buffer$1[0] & 128) !== 0;
				const opcode = buffer$1[0] & 15;
				const masked = (buffer$1[1] & 128) === 128;
				const fragmented = !fin && opcode !== opcodes$1.CONTINUATION;
				const payloadLength = buffer$1[1] & 127;
				const rsv1 = buffer$1[0] & 64;
				const rsv2 = buffer$1[0] & 32;
				const rsv3 = buffer$1[0] & 16;
				if (!isValidOpcode(opcode)) {
					failWebsocketConnection(this.ws, "Invalid opcode received");
					return callback();
				}
				if (masked) {
					failWebsocketConnection(this.ws, "Frame cannot be masked");
					return callback();
				}
				if (rsv1 !== 0 && !this.#extensions.has("permessage-deflate")) {
					failWebsocketConnection(this.ws, "Expected RSV1 to be clear.");
					return;
				}
				if (rsv2 !== 0 || rsv3 !== 0) {
					failWebsocketConnection(this.ws, "RSV1, RSV2, RSV3 must be clear");
					return;
				}
				if (fragmented && !isTextBinaryFrame(opcode)) {
					failWebsocketConnection(this.ws, "Invalid frame type was fragmented.");
					return;
				}
				if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {
					failWebsocketConnection(this.ws, "Expected continuation frame");
					return;
				}
				if (this.#info.fragmented && fragmented) {
					failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes.");
					return;
				}
				if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {
					failWebsocketConnection(this.ws, "Control frame either too large or fragmented");
					return;
				}
				if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
					failWebsocketConnection(this.ws, "Unexpected continuation frame");
					return;
				}
				if (payloadLength <= 125) {
					this.#info.payloadLength = payloadLength;
					this.#state = parserStates.READ_DATA;
				} else if (payloadLength === 126) this.#state = parserStates.PAYLOADLENGTH_16;
				else if (payloadLength === 127) this.#state = parserStates.PAYLOADLENGTH_64;
				if (isTextBinaryFrame(opcode)) {
					this.#info.binaryType = opcode;
					this.#info.compressed = rsv1 !== 0;
				}
				this.#info.opcode = opcode;
				this.#info.masked = masked;
				this.#info.fin = fin;
				this.#info.fragmented = fragmented;
			} else if (this.#state === parserStates.PAYLOADLENGTH_16) {
				if (this.#byteOffset < 2) return callback();
				const buffer$1 = this.consume(2);
				this.#info.payloadLength = buffer$1.readUInt16BE(0);
				this.#state = parserStates.READ_DATA;
			} else if (this.#state === parserStates.PAYLOADLENGTH_64) {
				if (this.#byteOffset < 8) return callback();
				const buffer$1 = this.consume(8);
				const upper = buffer$1.readUInt32BE(0);
				if (upper > 2 ** 31 - 1) {
					failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes.");
					return;
				}
				const lower = buffer$1.readUInt32BE(4);
				this.#info.payloadLength = (upper << 8) + lower;
				this.#state = parserStates.READ_DATA;
			} else if (this.#state === parserStates.READ_DATA) {
				if (this.#byteOffset < this.#info.payloadLength) return callback();
				const body = this.consume(this.#info.payloadLength);
				if (isControlFrame(this.#info.opcode)) {
					this.#loop = this.parseControlFrame(body);
					this.#state = parserStates.INFO;
				} else if (!this.#info.compressed) {
					this.#fragments.push(body);
					if (!this.#info.fragmented && this.#info.fin) {
						const fullMessage = Buffer.concat(this.#fragments);
						websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage);
						this.#fragments.length = 0;
					}
					this.#state = parserStates.INFO;
				} else {
					this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data$1) => {
						if (error) {
							closeWebSocketConnection$1(this.ws, 1007, error.message, error.message.length);
							return;
						}
						this.#fragments.push(data$1);
						if (!this.#info.fin) {
							this.#state = parserStates.INFO;
							this.#loop = true;
							this.run(callback);
							return;
						}
						websocketMessageReceived(this.ws, this.#info.binaryType, Buffer.concat(this.#fragments));
						this.#loop = true;
						this.#state = parserStates.INFO;
						this.#fragments.length = 0;
						this.run(callback);
					});
					this.#loop = false;
					break;
				}
			}
		}
		consume(n$1) {
			if (n$1 > this.#byteOffset) throw new Error("Called consume() before buffers satiated.");
			else if (n$1 === 0) return emptyBuffer;
			if (this.#buffers[0].length === n$1) {
				this.#byteOffset -= this.#buffers[0].length;
				return this.#buffers.shift();
			}
			const buffer$1 = Buffer.allocUnsafe(n$1);
			let offset = 0;
			while (offset !== n$1) {
				const next = this.#buffers[0];
				const { length } = next;
				if (length + offset === n$1) {
					buffer$1.set(this.#buffers.shift(), offset);
					break;
				} else if (length + offset > n$1) {
					buffer$1.set(next.subarray(0, n$1 - offset), offset);
					this.#buffers[0] = next.subarray(n$1 - offset);
					break;
				} else {
					buffer$1.set(this.#buffers.shift(), offset);
					offset += next.length;
				}
			}
			this.#byteOffset -= n$1;
			return buffer$1;
		}
		parseCloseBody(data$1) {
			assert(data$1.length !== 1);
			let code;
			if (data$1.length >= 2) code = data$1.readUInt16BE(0);
			if (code !== void 0 && !isValidStatusCode(code)) return {
				code: 1002,
				reason: "Invalid status code",
				error: true
			};
			let reason = data$1.subarray(2);
			if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) reason = reason.subarray(3);
			try {
				reason = utf8Decode(reason);
			} catch {
				return {
					code: 1007,
					reason: "Invalid UTF-8",
					error: true
				};
			}
			return {
				code,
				reason,
				error: false
			};
		}
		parseControlFrame(body) {
			const { opcode, payloadLength } = this.#info;
			if (opcode === opcodes$1.CLOSE) {
				if (payloadLength === 1) {
					failWebsocketConnection(this.ws, "Received close frame with a 1-byte body.");
					return false;
				}
				this.#info.closeInfo = this.parseCloseBody(body);
				if (this.#info.closeInfo.error) {
					const { code, reason } = this.#info.closeInfo;
					closeWebSocketConnection$1(this.ws, code, reason, reason.length);
					failWebsocketConnection(this.ws, reason);
					return false;
				}
				if (this.ws[kSentClose$1] !== sentCloseFrameState$1.SENT) {
					let body$1 = emptyBuffer;
					if (this.#info.closeInfo.code) {
						body$1 = Buffer.allocUnsafe(2);
						body$1.writeUInt16BE(this.#info.closeInfo.code, 0);
					}
					const closeFrame = new WebsocketFrameSend$1(body$1);
					this.ws[kResponse$1].socket.write(closeFrame.createFrame(opcodes$1.CLOSE), (err) => {
						if (!err) this.ws[kSentClose$1] = sentCloseFrameState$1.SENT;
					});
				}
				this.ws[kReadyState$1] = states$1.CLOSING;
				this.ws[kReceivedClose] = true;
				return false;
			} else if (opcode === opcodes$1.PING) {
				if (!this.ws[kReceivedClose]) {
					const frame = new WebsocketFrameSend$1(body);
					this.ws[kResponse$1].socket.write(frame.createFrame(opcodes$1.PONG));
					if (channels.ping.hasSubscribers) channels.ping.publish({ payload: body });
				}
			} else if (opcode === opcodes$1.PONG) {
				if (channels.pong.hasSubscribers) channels.pong.publish({ payload: body });
			}
			return true;
		}
		get closingInfo() {
			return this.#info.closeInfo;
		}
	};
	module.exports = { ByteParser: ByteParser$1 };
}));
var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { WebsocketFrameSend } = require_frame();
	var { opcodes, sendHints: sendHints$1 } = require_constants();
	var FixedQueue = require_fixed_queue();
	var FastBuffer = Buffer[Symbol.species];
	var SendQueue$1 = class {
		#queue = new FixedQueue();
		#running = false;
		#socket;
		constructor(socket) {
			this.#socket = socket;
		}
		add(item, cb, hint) {
			if (hint !== sendHints$1.blob) {
				const frame = createFrame(item, hint);
				if (!this.#running) this.#socket.write(frame, cb);
				else {
					const node$1 = {
						promise: null,
						callback: cb,
						frame
					};
					this.#queue.push(node$1);
				}
				return;
			}
			const node = {
				promise: item.arrayBuffer().then((ab) => {
					node.promise = null;
					node.frame = createFrame(ab, hint);
				}),
				callback: cb,
				frame: null
			};
			this.#queue.push(node);
			if (!this.#running) this.#run();
		}
		async #run() {
			this.#running = true;
			const queue = this.#queue;
			while (!queue.isEmpty()) {
				const node = queue.shift();
				if (node.promise !== null) await node.promise;
				this.#socket.write(node.frame, node.callback);
				node.callback = node.frame = null;
			}
			this.#running = false;
		}
	};
	function createFrame(data$1, hint) {
		return new WebsocketFrameSend(toBuffer$1(data$1, hint)).createFrame(hint === sendHints$1.string ? opcodes.TEXT : opcodes.BINARY);
	}
	function toBuffer$1(data$1, hint) {
		switch (hint) {
			case sendHints$1.string: return Buffer.from(data$1);
			case sendHints$1.arrayBuffer:
			case sendHints$1.blob: return new FastBuffer(data$1);
			case sendHints$1.typedArray: return new FastBuffer(data$1.buffer, data$1.byteOffset, data$1.byteLength);
		}
	}
	module.exports = { SendQueue: SendQueue$1 };
}));
var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { webidl: webidl$1 } = require_webidl();
	var { URLSerializer } = require_data_url();
	var { environmentSettingsObject: environmentSettingsObject$1 } = require_util$8();
	var { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require_constants();
	var { kWebSocketURL, kReadyState, kController, kBinaryType, kResponse, kSentClose, kByteParser } = require_symbols();
	var { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent } = require_util$3();
	var { establishWebSocketConnection, closeWebSocketConnection } = require_connection();
	var { ByteParser } = require_receiver();
	var { kEnumerableProperty: kEnumerableProperty$1, isBlobLike } = require_util$9();
	var { getGlobalDispatcher: getGlobalDispatcher$2 } = require_global();
	var { types } = require("node:util");
	var { ErrorEvent: ErrorEvent$1, CloseEvent: CloseEvent$1 } = require_events();
	var { SendQueue } = require_sender();
	var WebSocket = class WebSocket extends EventTarget {
		#events = {
			open: null,
			error: null,
			close: null,
			message: null
		};
		#bufferedAmount = 0;
		#protocol = "";
		#extensions = "";
		#sendQueue;
		constructor(url$3, protocols = []) {
			super();
			webidl$1.util.markAsUncloneable(this);
			const prefix = "WebSocket constructor";
			webidl$1.argumentLengthCheck(arguments, 1, prefix);
			const options = webidl$1.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options");
			url$3 = webidl$1.converters.USVString(url$3, prefix, "url");
			protocols = options.protocols;
			const baseURL = environmentSettingsObject$1.settingsObject.baseUrl;
			let urlRecord;
			try {
				urlRecord = new URL(url$3, baseURL);
			} catch (e) {
				throw new DOMException(e, "SyntaxError");
			}
			if (urlRecord.protocol === "http:") urlRecord.protocol = "ws:";
			else if (urlRecord.protocol === "https:") urlRecord.protocol = "wss:";
			if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") throw new DOMException(`Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, "SyntaxError");
			if (urlRecord.hash || urlRecord.href.endsWith("#")) throw new DOMException("Got fragment", "SyntaxError");
			if (typeof protocols === "string") protocols = [protocols];
			if (protocols.length !== new Set(protocols.map((p) => p.toLowerCase())).size) throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
			if (protocols.length > 0 && !protocols.every((p) => isValidSubprotocol(p))) throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
			this[kWebSocketURL] = new URL(urlRecord.href);
			const client = environmentSettingsObject$1.settingsObject;
			this[kController] = establishWebSocketConnection(urlRecord, protocols, client, this, (response, extensions) => this.#onConnectionEstablished(response, extensions), options);
			this[kReadyState] = WebSocket.CONNECTING;
			this[kSentClose] = sentCloseFrameState.NOT_SENT;
			this[kBinaryType] = "blob";
		}
		close(code = void 0, reason = void 0) {
			webidl$1.brandCheck(this, WebSocket);
			const prefix = "WebSocket.close";
			if (code !== void 0) code = webidl$1.converters["unsigned short"](code, prefix, "code", { clamp: true });
			if (reason !== void 0) reason = webidl$1.converters.USVString(reason, prefix, "reason");
			if (code !== void 0) {
				if (code !== 1e3 && (code < 3e3 || code > 4999)) throw new DOMException("invalid code", "InvalidAccessError");
			}
			let reasonByteLength = 0;
			if (reason !== void 0) {
				reasonByteLength = Buffer.byteLength(reason);
				if (reasonByteLength > 123) throw new DOMException(`Reason must be less than 123 bytes; received ${reasonByteLength}`, "SyntaxError");
			}
			closeWebSocketConnection(this, code, reason, reasonByteLength);
		}
		send(data$1) {
			webidl$1.brandCheck(this, WebSocket);
			const prefix = "WebSocket.send";
			webidl$1.argumentLengthCheck(arguments, 1, prefix);
			data$1 = webidl$1.converters.WebSocketSendData(data$1, prefix, "data");
			if (isConnecting(this)) throw new DOMException("Sent before connected.", "InvalidStateError");
			if (!isEstablished(this) || isClosing(this)) return;
			if (typeof data$1 === "string") {
				const length = Buffer.byteLength(data$1);
				this.#bufferedAmount += length;
				this.#sendQueue.add(data$1, () => {
					this.#bufferedAmount -= length;
				}, sendHints.string);
			} else if (types.isArrayBuffer(data$1)) {
				this.#bufferedAmount += data$1.byteLength;
				this.#sendQueue.add(data$1, () => {
					this.#bufferedAmount -= data$1.byteLength;
				}, sendHints.arrayBuffer);
			} else if (ArrayBuffer.isView(data$1)) {
				this.#bufferedAmount += data$1.byteLength;
				this.#sendQueue.add(data$1, () => {
					this.#bufferedAmount -= data$1.byteLength;
				}, sendHints.typedArray);
			} else if (isBlobLike(data$1)) {
				this.#bufferedAmount += data$1.size;
				this.#sendQueue.add(data$1, () => {
					this.#bufferedAmount -= data$1.size;
				}, sendHints.blob);
			}
		}
		get readyState() {
			webidl$1.brandCheck(this, WebSocket);
			return this[kReadyState];
		}
		get bufferedAmount() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#bufferedAmount;
		}
		get url() {
			webidl$1.brandCheck(this, WebSocket);
			return URLSerializer(this[kWebSocketURL]);
		}
		get extensions() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#extensions;
		}
		get protocol() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#protocol;
		}
		get onopen() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#events.open;
		}
		set onopen(fn) {
			webidl$1.brandCheck(this, WebSocket);
			if (this.#events.open) this.removeEventListener("open", this.#events.open);
			if (typeof fn === "function") {
				this.#events.open = fn;
				this.addEventListener("open", fn);
			} else this.#events.open = null;
		}
		get onerror() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#events.error;
		}
		set onerror(fn) {
			webidl$1.brandCheck(this, WebSocket);
			if (this.#events.error) this.removeEventListener("error", this.#events.error);
			if (typeof fn === "function") {
				this.#events.error = fn;
				this.addEventListener("error", fn);
			} else this.#events.error = null;
		}
		get onclose() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#events.close;
		}
		set onclose(fn) {
			webidl$1.brandCheck(this, WebSocket);
			if (this.#events.close) this.removeEventListener("close", this.#events.close);
			if (typeof fn === "function") {
				this.#events.close = fn;
				this.addEventListener("close", fn);
			} else this.#events.close = null;
		}
		get onmessage() {
			webidl$1.brandCheck(this, WebSocket);
			return this.#events.message;
		}
		set onmessage(fn) {
			webidl$1.brandCheck(this, WebSocket);
			if (this.#events.message) this.removeEventListener("message", this.#events.message);
			if (typeof fn === "function") {
				this.#events.message = fn;
				this.addEventListener("message", fn);
			} else this.#events.message = null;
		}
		get binaryType() {
			webidl$1.brandCheck(this, WebSocket);
			return this[kBinaryType];
		}
		set binaryType(type) {
			webidl$1.brandCheck(this, WebSocket);
			if (type !== "blob" && type !== "arraybuffer") this[kBinaryType] = "blob";
			else this[kBinaryType] = type;
		}
		#onConnectionEstablished(response, parsedExtensions) {
			this[kResponse] = response;
			const parser = new ByteParser(this, parsedExtensions);
			parser.on("drain", onParserDrain);
			parser.on("error", onParserError.bind(this));
			response.socket.ws = this;
			this[kByteParser] = parser;
			this.#sendQueue = new SendQueue(response.socket);
			this[kReadyState] = states.OPEN;
			const extensions = response.headersList.get("sec-websocket-extensions");
			if (extensions !== null) this.#extensions = extensions;
			const protocol = response.headersList.get("sec-websocket-protocol");
			if (protocol !== null) this.#protocol = protocol;
			fireEvent("open", this);
		}
	};
	WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING;
	WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN;
	WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING;
	WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED;
	Object.defineProperties(WebSocket.prototype, {
		CONNECTING: staticPropertyDescriptors,
		OPEN: staticPropertyDescriptors,
		CLOSING: staticPropertyDescriptors,
		CLOSED: staticPropertyDescriptors,
		url: kEnumerableProperty$1,
		readyState: kEnumerableProperty$1,
		bufferedAmount: kEnumerableProperty$1,
		onopen: kEnumerableProperty$1,
		onerror: kEnumerableProperty$1,
		onclose: kEnumerableProperty$1,
		close: kEnumerableProperty$1,
		onmessage: kEnumerableProperty$1,
		binaryType: kEnumerableProperty$1,
		send: kEnumerableProperty$1,
		extensions: kEnumerableProperty$1,
		protocol: kEnumerableProperty$1,
		[Symbol.toStringTag]: {
			value: "WebSocket",
			writable: false,
			enumerable: false,
			configurable: true
		}
	});
	Object.defineProperties(WebSocket, {
		CONNECTING: staticPropertyDescriptors,
		OPEN: staticPropertyDescriptors,
		CLOSING: staticPropertyDescriptors,
		CLOSED: staticPropertyDescriptors
	});
	webidl$1.converters["sequence<DOMString>"] = webidl$1.sequenceConverter(webidl$1.converters.DOMString);
	webidl$1.converters["DOMString or sequence<DOMString>"] = function(V, prefix, argument) {
		if (webidl$1.util.Type(V) === "Object" && Symbol.iterator in V) return webidl$1.converters["sequence<DOMString>"](V);
		return webidl$1.converters.DOMString(V, prefix, argument);
	};
	webidl$1.converters.WebSocketInit = webidl$1.dictionaryConverter([
		{
			key: "protocols",
			converter: webidl$1.converters["DOMString or sequence<DOMString>"],
			defaultValue: () => new Array(0)
		},
		{
			key: "dispatcher",
			converter: webidl$1.converters.any,
			defaultValue: () => getGlobalDispatcher$2()
		},
		{
			key: "headers",
			converter: webidl$1.nullableConverter(webidl$1.converters.HeadersInit)
		}
	]);
	webidl$1.converters["DOMString or sequence<DOMString> or WebSocketInit"] = function(V) {
		if (webidl$1.util.Type(V) === "Object" && !(Symbol.iterator in V)) return webidl$1.converters.WebSocketInit(V);
		return { protocols: webidl$1.converters["DOMString or sequence<DOMString>"](V) };
	};
	webidl$1.converters.WebSocketSendData = function(V) {
		if (webidl$1.util.Type(V) === "Object") {
			if (isBlobLike(V)) return webidl$1.converters.Blob(V, { strict: false });
			if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) return webidl$1.converters.BufferSource(V);
		}
		return webidl$1.converters.USVString(V);
	};
	function onParserDrain() {
		this.ws[kResponse].socket.resume();
	}
	function onParserError(err) {
		let message;
		let code;
		if (err instanceof CloseEvent$1) {
			message = err.reason;
			code = err.code;
		} else message = err.message;
		fireEvent("error", this, () => new ErrorEvent$1("error", {
			error: err,
			message
		}));
		closeWebSocketConnection(this, code);
	}
	module.exports = { WebSocket };
}));
var require_util$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	function isValidLastEventId$1(value) {
		return value.indexOf("\0") === -1;
	}
	function isASCIINumber$1(value) {
		if (value.length === 0) return false;
		for (let i = 0; i < value.length; i++) if (value.charCodeAt(i) < 48 || value.charCodeAt(i) > 57) return false;
		return true;
	}
	function delay$1(ms) {
		return new Promise((resolve) => {
			setTimeout(resolve, ms).unref();
		});
	}
	module.exports = {
		isValidLastEventId: isValidLastEventId$1,
		isASCIINumber: isASCIINumber$1,
		delay: delay$1
	};
}));
var require_eventsource_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { Transform } = require("node:stream");
	var { isASCIINumber, isValidLastEventId } = require_util$2();
	var BOM = [
		239,
		187,
		191
	];
	var LF$1 = 10;
	var CR = 13;
	var COLON = 58;
	var SPACE = 32;
	var EventSourceStream$1 = class extends Transform {
		state = null;
		checkBOM = true;
		crlfCheck = false;
		eventEndCheck = false;
		buffer = null;
		pos = 0;
		event = {
			data: void 0,
			event: void 0,
			id: void 0,
			retry: void 0
		};
		constructor(options = {}) {
			options.readableObjectMode = true;
			super(options);
			this.state = options.eventSourceSettings || {};
			if (options.push) this.push = options.push;
		}
		_transform(chunk, _encoding, callback) {
			if (chunk.length === 0) {
				callback();
				return;
			}
			if (this.buffer) this.buffer = Buffer.concat([this.buffer, chunk]);
			else this.buffer = chunk;
			if (this.checkBOM) switch (this.buffer.length) {
				case 1:
					if (this.buffer[0] === BOM[0]) {
						callback();
						return;
					}
					this.checkBOM = false;
					callback();
					return;
				case 2:
					if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1]) {
						callback();
						return;
					}
					this.checkBOM = false;
					break;
				case 3:
					if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) {
						this.buffer = Buffer.alloc(0);
						this.checkBOM = false;
						callback();
						return;
					}
					this.checkBOM = false;
					break;
				default:
					if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) this.buffer = this.buffer.subarray(3);
					this.checkBOM = false;
					break;
			}
			while (this.pos < this.buffer.length) {
				if (this.eventEndCheck) {
					if (this.crlfCheck) {
						if (this.buffer[this.pos] === LF$1) {
							this.buffer = this.buffer.subarray(this.pos + 1);
							this.pos = 0;
							this.crlfCheck = false;
							continue;
						}
						this.crlfCheck = false;
					}
					if (this.buffer[this.pos] === LF$1 || this.buffer[this.pos] === CR) {
						if (this.buffer[this.pos] === CR) this.crlfCheck = true;
						this.buffer = this.buffer.subarray(this.pos + 1);
						this.pos = 0;
						if (this.event.data !== void 0 || this.event.event || this.event.id || this.event.retry) this.processEvent(this.event);
						this.clearEvent();
						continue;
					}
					this.eventEndCheck = false;
					continue;
				}
				if (this.buffer[this.pos] === LF$1 || this.buffer[this.pos] === CR) {
					if (this.buffer[this.pos] === CR) this.crlfCheck = true;
					this.parseLine(this.buffer.subarray(0, this.pos), this.event);
					this.buffer = this.buffer.subarray(this.pos + 1);
					this.pos = 0;
					this.eventEndCheck = true;
					continue;
				}
				this.pos++;
			}
			callback();
		}
		parseLine(line, event) {
			if (line.length === 0) return;
			const colonPosition = line.indexOf(COLON);
			if (colonPosition === 0) return;
			let field = "";
			let value = "";
			if (colonPosition !== -1) {
				field = line.subarray(0, colonPosition).toString("utf8");
				let valueStart = colonPosition + 1;
				if (line[valueStart] === SPACE) ++valueStart;
				value = line.subarray(valueStart).toString("utf8");
			} else {
				field = line.toString("utf8");
				value = "";
			}
			switch (field) {
				case "data":
					if (event[field] === void 0) event[field] = value;
					else event[field] += `\n${value}`;
					break;
				case "retry":
					if (isASCIINumber(value)) event[field] = value;
					break;
				case "id":
					if (isValidLastEventId(value)) event[field] = value;
					break;
				case "event":
					if (value.length > 0) event[field] = value;
					break;
			}
		}
		processEvent(event) {
			if (event.retry && isASCIINumber(event.retry)) this.state.reconnectionTime = parseInt(event.retry, 10);
			if (event.id && isValidLastEventId(event.id)) this.state.lastEventId = event.id;
			if (event.data !== void 0) this.push({
				type: event.event || "message",
				options: {
					data: event.data,
					lastEventId: this.state.lastEventId,
					origin: this.state.origin
				}
			});
		}
		clearEvent() {
			this.event = {
				data: void 0,
				event: void 0,
				id: void 0,
				retry: void 0
			};
		}
	};
	module.exports = { EventSourceStream: EventSourceStream$1 };
}));
var require_eventsource = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var { pipeline } = require("node:stream");
	var { fetching } = require_fetch();
	var { makeRequest } = require_request();
	var { webidl } = require_webidl();
	var { EventSourceStream } = require_eventsource_stream();
	var { parseMIMEType: parseMIMEType$1 } = require_data_url();
	var { createFastMessageEvent } = require_events();
	var { isNetworkError } = require_response();
	var { delay } = require_util$2();
	var { kEnumerableProperty } = require_util$9();
	var { environmentSettingsObject } = require_util$8();
	var experimentalWarned = false;
	var defaultReconnectionTime = 3e3;
	var CONNECTING = 0;
	var OPEN = 1;
	var CLOSED = 2;
	var ANONYMOUS = "anonymous";
	var USE_CREDENTIALS = "use-credentials";
	var EventSource$1 = class EventSource$1 extends EventTarget {
		#events = {
			open: null,
			error: null,
			message: null
		};
		#url = null;
		#withCredentials = false;
		#readyState = CONNECTING;
		#request = null;
		#controller = null;
		#dispatcher;
		#state;
		constructor(url$3, eventSourceInitDict = {}) {
			super();
			webidl.util.markAsUncloneable(this);
			const prefix = "EventSource constructor";
			webidl.argumentLengthCheck(arguments, 1, prefix);
			if (!experimentalWarned) {
				experimentalWarned = true;
				process.emitWarning("EventSource is experimental, expect them to change at any time.", { code: "UNDICI-ES" });
			}
			url$3 = webidl.converters.USVString(url$3, prefix, "url");
			eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict");
			this.#dispatcher = eventSourceInitDict.dispatcher;
			this.#state = {
				lastEventId: "",
				reconnectionTime: defaultReconnectionTime
			};
			const settings = environmentSettingsObject;
			let urlRecord;
			try {
				urlRecord = new URL(url$3, settings.settingsObject.baseUrl);
				this.#state.origin = urlRecord.origin;
			} catch (e) {
				throw new DOMException(e, "SyntaxError");
			}
			this.#url = urlRecord.href;
			let corsAttributeState = ANONYMOUS;
			if (eventSourceInitDict.withCredentials) {
				corsAttributeState = USE_CREDENTIALS;
				this.#withCredentials = true;
			}
			const initRequest = {
				redirect: "follow",
				keepalive: true,
				mode: "cors",
				credentials: corsAttributeState === "anonymous" ? "same-origin" : "omit",
				referrer: "no-referrer"
			};
			initRequest.client = environmentSettingsObject.settingsObject;
			initRequest.headersList = [["accept", {
				name: "accept",
				value: "text/event-stream"
			}]];
			initRequest.cache = "no-store";
			initRequest.initiator = "other";
			initRequest.urlList = [new URL(this.#url)];
			this.#request = makeRequest(initRequest);
			this.#connect();
		}
		get readyState() {
			return this.#readyState;
		}
		get url() {
			return this.#url;
		}
		get withCredentials() {
			return this.#withCredentials;
		}
		#connect() {
			if (this.#readyState === CLOSED) return;
			this.#readyState = CONNECTING;
			const fetchParams = {
				request: this.#request,
				dispatcher: this.#dispatcher
			};
			const processEventSourceEndOfBody = (response) => {
				if (isNetworkError(response)) {
					this.dispatchEvent(new Event("error"));
					this.close();
				}
				this.#reconnect();
			};
			fetchParams.processResponseEndOfBody = processEventSourceEndOfBody;
			fetchParams.processResponse = (response) => {
				if (isNetworkError(response)) if (response.aborted) {
					this.close();
					this.dispatchEvent(new Event("error"));
					return;
				} else {
					this.#reconnect();
					return;
				}
				const contentType$1 = response.headersList.get("content-type", true);
				const mimeType = contentType$1 !== null ? parseMIMEType$1(contentType$1) : "failure";
				const contentTypeValid = mimeType !== "failure" && mimeType.essence === "text/event-stream";
				if (response.status !== 200 || contentTypeValid === false) {
					this.close();
					this.dispatchEvent(new Event("error"));
					return;
				}
				this.#readyState = OPEN;
				this.dispatchEvent(new Event("open"));
				this.#state.origin = response.urlList[response.urlList.length - 1].origin;
				const eventSourceStream = new EventSourceStream({
					eventSourceSettings: this.#state,
					push: (event) => {
						this.dispatchEvent(createFastMessageEvent(event.type, event.options));
					}
				});
				pipeline(response.body.stream, eventSourceStream, (error) => {
					if (error?.aborted === false) {
						this.close();
						this.dispatchEvent(new Event("error"));
					}
				});
			};
			this.#controller = fetching(fetchParams);
		}
		async #reconnect() {
			if (this.#readyState === CLOSED) return;
			this.#readyState = CONNECTING;
			this.dispatchEvent(new Event("error"));
			await delay(this.#state.reconnectionTime);
			if (this.#readyState !== CONNECTING) return;
			if (this.#state.lastEventId.length) this.#request.headersList.set("last-event-id", this.#state.lastEventId, true);
			this.#connect();
		}
		close() {
			webidl.brandCheck(this, EventSource$1);
			if (this.#readyState === CLOSED) return;
			this.#readyState = CLOSED;
			this.#controller.abort();
			this.#request = null;
		}
		get onopen() {
			return this.#events.open;
		}
		set onopen(fn) {
			if (this.#events.open) this.removeEventListener("open", this.#events.open);
			if (typeof fn === "function") {
				this.#events.open = fn;
				this.addEventListener("open", fn);
			} else this.#events.open = null;
		}
		get onmessage() {
			return this.#events.message;
		}
		set onmessage(fn) {
			if (this.#events.message) this.removeEventListener("message", this.#events.message);
			if (typeof fn === "function") {
				this.#events.message = fn;
				this.addEventListener("message", fn);
			} else this.#events.message = null;
		}
		get onerror() {
			return this.#events.error;
		}
		set onerror(fn) {
			if (this.#events.error) this.removeEventListener("error", this.#events.error);
			if (typeof fn === "function") {
				this.#events.error = fn;
				this.addEventListener("error", fn);
			} else this.#events.error = null;
		}
	};
	var constantsPropertyDescriptors = {
		CONNECTING: {
			__proto__: null,
			configurable: false,
			enumerable: true,
			value: CONNECTING,
			writable: false
		},
		OPEN: {
			__proto__: null,
			configurable: false,
			enumerable: true,
			value: OPEN,
			writable: false
		},
		CLOSED: {
			__proto__: null,
			configurable: false,
			enumerable: true,
			value: CLOSED,
			writable: false
		}
	};
	Object.defineProperties(EventSource$1, constantsPropertyDescriptors);
	Object.defineProperties(EventSource$1.prototype, constantsPropertyDescriptors);
	Object.defineProperties(EventSource$1.prototype, {
		close: kEnumerableProperty,
		onerror: kEnumerableProperty,
		onmessage: kEnumerableProperty,
		onopen: kEnumerableProperty,
		readyState: kEnumerableProperty,
		url: kEnumerableProperty,
		withCredentials: kEnumerableProperty
	});
	webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([{
		key: "withCredentials",
		converter: webidl.converters.boolean,
		defaultValue: () => false
	}, {
		key: "dispatcher",
		converter: webidl.converters.any
	}]);
	module.exports = {
		EventSource: EventSource$1,
		defaultReconnectionTime
	};
}));
var require_undici = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var Client$1 = require_client();
	var Dispatcher$1 = require_dispatcher();
	var Pool = require_pool();
	var BalancedPool = require_balanced_pool();
	var Agent$1 = require_agent();
	var ProxyAgent$2 = require_proxy_agent();
	var EnvHttpProxyAgent$1 = require_env_http_proxy_agent();
	var RetryAgent = require_retry_agent();
	var errors = require_errors$1();
	var util$6 = require_util$9();
	var { InvalidArgumentError } = errors;
	var api = require_api();
	var buildConnector = require_connect();
	var MockClient = require_mock_client();
	var MockAgent = require_mock_agent();
	var MockPool = require_mock_pool();
	var mockErrors = require_mock_errors();
	var RetryHandler = require_retry_handler();
	var { getGlobalDispatcher: getGlobalDispatcher$1, setGlobalDispatcher: setGlobalDispatcher$1 } = require_global();
	var DecoratorHandler = require_decorator_handler();
	var RedirectHandler = require_redirect_handler();
	var createRedirectInterceptor = require_redirect_interceptor();
	Object.assign(Dispatcher$1.prototype, api);
	module.exports.Dispatcher = Dispatcher$1;
	module.exports.Client = Client$1;
	module.exports.Pool = Pool;
	module.exports.BalancedPool = BalancedPool;
	module.exports.Agent = Agent$1;
	module.exports.ProxyAgent = ProxyAgent$2;
	module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent$1;
	module.exports.RetryAgent = RetryAgent;
	module.exports.RetryHandler = RetryHandler;
	module.exports.DecoratorHandler = DecoratorHandler;
	module.exports.RedirectHandler = RedirectHandler;
	module.exports.createRedirectInterceptor = createRedirectInterceptor;
	module.exports.interceptors = {
		redirect: require_redirect(),
		retry: require_retry(),
		dump: require_dump(),
		dns: require_dns()
	};
	module.exports.buildConnector = buildConnector;
	module.exports.errors = errors;
	module.exports.util = {
		parseHeaders: util$6.parseHeaders,
		headerNameToString: util$6.headerNameToString
	};
	function makeDispatcher(fn) {
		return (url$3, opts, handler) => {
			if (typeof opts === "function") {
				handler = opts;
				opts = null;
			}
			if (!url$3 || typeof url$3 !== "string" && typeof url$3 !== "object" && !(url$3 instanceof URL)) throw new InvalidArgumentError("invalid url");
			if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
			if (opts && opts.path != null) {
				if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
				let path$1 = opts.path;
				if (!opts.path.startsWith("/")) path$1 = `/${path$1}`;
				url$3 = new URL(util$6.parseOrigin(url$3).origin + path$1);
			} else {
				if (!opts) opts = typeof url$3 === "object" ? url$3 : {};
				url$3 = util$6.parseURL(url$3);
			}
			const { agent, dispatcher = getGlobalDispatcher$1() } = opts;
			if (agent) throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?");
			return fn.call(dispatcher, {
				...opts,
				origin: url$3.origin,
				path: url$3.search ? `${url$3.pathname}${url$3.search}` : url$3.pathname,
				method: opts.method || (opts.body ? "PUT" : "GET")
			}, handler);
		};
	}
	module.exports.setGlobalDispatcher = setGlobalDispatcher$1;
	module.exports.getGlobalDispatcher = getGlobalDispatcher$1;
	var fetchImpl = require_fetch().fetch;
	module.exports.fetch = async function fetch$2(init$1, options = void 0) {
		try {
			return await fetchImpl(init$1, options);
		} catch (err) {
			if (err && typeof err === "object") Error.captureStackTrace(err);
			throw err;
		}
	};
	module.exports.Headers = require_headers().Headers;
	module.exports.Response = require_response().Response;
	module.exports.Request = require_request().Request;
	module.exports.FormData = require_formdata().FormData;
	module.exports.File = globalThis.File ?? require("node:buffer").File;
	module.exports.FileReader = require_filereader().FileReader;
	var { setGlobalOrigin, getGlobalOrigin } = require_global$1();
	module.exports.setGlobalOrigin = setGlobalOrigin;
	module.exports.getGlobalOrigin = getGlobalOrigin;
	var { CacheStorage } = require_cachestorage();
	var { kConstruct } = require_symbols$1();
	module.exports.caches = new CacheStorage(kConstruct);
	var { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies();
	module.exports.deleteCookie = deleteCookie;
	module.exports.getCookies = getCookies;
	module.exports.getSetCookies = getSetCookies;
	module.exports.setCookie = setCookie;
	var { parseMIMEType, serializeAMimeType } = require_data_url();
	module.exports.parseMIMEType = parseMIMEType;
	module.exports.serializeAMimeType = serializeAMimeType;
	var { CloseEvent, ErrorEvent, MessageEvent } = require_events();
	module.exports.WebSocket = require_websocket().WebSocket;
	module.exports.CloseEvent = CloseEvent;
	module.exports.ErrorEvent = ErrorEvent;
	module.exports.MessageEvent = MessageEvent;
	module.exports.request = makeDispatcher(api.request);
	module.exports.stream = makeDispatcher(api.stream);
	module.exports.pipeline = makeDispatcher(api.pipeline);
	module.exports.connect = makeDispatcher(api.connect);
	module.exports.upgrade = makeDispatcher(api.upgrade);
	module.exports.MockClient = MockClient;
	module.exports.MockPool = MockPool;
	module.exports.MockAgent = MockAgent;
	module.exports.mockErrors = mockErrors;
	var { EventSource } = require_eventsource();
	module.exports.EventSource = EventSource;
}));
var require_fetch_socks = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.socksDispatcher = socksDispatcher$1;
	var socks_1$1 = require_build();
	var undici_1 = require_undici();
	function resolvePort(protocol, port) {
		return port ? Number.parseInt(port) : protocol === "http:" ? 80 : 443;
	}
	function socksConnector(proxies, tlsOpts = {}) {
		const chain = Array.isArray(proxies) ? proxies : [proxies];
		const { timeout = 1e4 } = tlsOpts;
		const undiciConnect = (0, undici_1.buildConnector)(tlsOpts);
		return async (options, callback) => {
			let { protocol, hostname, port, httpSocket } = options;
			for (let i = 0; i < chain.length; i++) {
				const next = chain[i + 1];
				const destination = i === chain.length - 1 ? {
					host: hostname,
					port: resolvePort(protocol, port)
				} : {
					port: next.port,
					host: next.host ?? next.ipaddress
				};
				const socksOpts = {
					command: "connect",
					proxy: chain[i],
					timeout,
					destination,
					existing_socket: httpSocket
				};
				try {
					httpSocket = (await socks_1$1.SocksClient.createConnection(socksOpts)).socket;
				} catch (error) {
					return callback(error, null);
				}
			}
			if (httpSocket && protocol !== "https:") return callback(null, httpSocket.setNoDelay());
			return undiciConnect({
				...options,
				httpSocket
			}, callback);
		};
	}
	function socksDispatcher$1(proxies, options = {}) {
		const { connect: connect$2, ...rest } = options;
		return new undici_1.Agent({
			...rest,
			connect: socksConnector(proxies, connect$2)
		});
	}
}));
var require_ipaddr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	(function(root) {
		"use strict";
		const ipv4Part = "(0?\\d+|0x[a-f0-9]+)";
		const ipv4Regexes = {
			fourOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, "i"),
			threeOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, "i"),
			twoOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}$`, "i"),
			longValue: new RegExp(`^${ipv4Part}$`, "i")
		};
		const octalRegex = new RegExp(`^0[0-7]+$`, "i");
		const hexRegex = new RegExp(`^0x[a-f0-9]+$`, "i");
		const zoneIndex = "%[0-9a-z]{1,}";
		const ipv6Part = "(?:[0-9a-f]+::?)+";
		const ipv6Regexes = {
			zoneIndex: new RegExp(zoneIndex, "i"),
			"native": new RegExp(`^(::)?(${ipv6Part})?([0-9a-f]+)?(::)?(${zoneIndex})?$`, "i"),
			deprecatedTransitional: new RegExp(`^(?:::)(${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?)$`, "i"),
			transitional: new RegExp(`^((?:${ipv6Part})|(?:::)(?:${ipv6Part})?)${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?$`, "i")
		};
		function expandIPv6(string, parts) {
			if (string.indexOf("::") !== string.lastIndexOf("::")) return null;
			let colonCount = 0;
			let lastColon = -1;
			let zoneId = (string.match(ipv6Regexes.zoneIndex) || [])[0];
			let replacement, replacementCount;
			if (zoneId) {
				zoneId = zoneId.substring(1);
				string = string.replace(/%.+$/, "");
			}
			while ((lastColon = string.indexOf(":", lastColon + 1)) >= 0) colonCount++;
			if (string.substr(0, 2) === "::") colonCount--;
			if (string.substr(-2, 2) === "::") colonCount--;
			if (colonCount > parts) return null;
			replacementCount = parts - colonCount;
			replacement = ":";
			while (replacementCount--) replacement += "0:";
			string = string.replace("::", replacement);
			if (string[0] === ":") string = string.slice(1);
			if (string[string.length - 1] === ":") string = string.slice(0, -1);
			parts = (function() {
				const ref = string.split(":");
				const results = [];
				for (let i = 0; i < ref.length; i++) results.push(parseInt(ref[i], 16));
				return results;
			})();
			return {
				parts,
				zoneId
			};
		}
		function matchCIDR(first, second, partSize, cidrBits) {
			if (first.length !== second.length) throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
			let part = 0;
			let shift;
			while (cidrBits > 0) {
				shift = partSize - cidrBits;
				if (shift < 0) shift = 0;
				if (first[part] >> shift !== second[part] >> shift) return false;
				cidrBits -= partSize;
				part += 1;
			}
			return true;
		}
		function parseIntAuto(string) {
			if (hexRegex.test(string)) return parseInt(string, 16);
			if (string[0] === "0" && !isNaN(parseInt(string[1], 10))) {
				if (octalRegex.test(string)) return parseInt(string, 8);
				throw new Error(`ipaddr: cannot parse ${string} as octal`);
			}
			return parseInt(string, 10);
		}
		function padPart(part, length) {
			while (part.length < length) part = `0${part}`;
			return part;
		}
		const ipaddr = {};
		ipaddr.IPv4 = (function() {
			function IPv4(octets) {
				if (octets.length !== 4) throw new Error("ipaddr: ipv4 octet count should be 4");
				let i, octet;
				for (i = 0; i < octets.length; i++) {
					octet = octets[i];
					if (!(0 <= octet && octet <= 255)) throw new Error("ipaddr: ipv4 octet should fit in 8 bits");
				}
				this.octets = octets;
			}
			IPv4.prototype.SpecialRanges = {
				unspecified: [[new IPv4([
					0,
					0,
					0,
					0
				]), 8]],
				broadcast: [[new IPv4([
					255,
					255,
					255,
					255
				]), 32]],
				multicast: [[new IPv4([
					224,
					0,
					0,
					0
				]), 4]],
				linkLocal: [[new IPv4([
					169,
					254,
					0,
					0
				]), 16]],
				loopback: [[new IPv4([
					127,
					0,
					0,
					0
				]), 8]],
				carrierGradeNat: [[new IPv4([
					100,
					64,
					0,
					0
				]), 10]],
				"private": [
					[new IPv4([
						10,
						0,
						0,
						0
					]), 8],
					[new IPv4([
						172,
						16,
						0,
						0
					]), 12],
					[new IPv4([
						192,
						168,
						0,
						0
					]), 16]
				],
				reserved: [
					[new IPv4([
						192,
						0,
						0,
						0
					]), 24],
					[new IPv4([
						192,
						0,
						2,
						0
					]), 24],
					[new IPv4([
						192,
						88,
						99,
						0
					]), 24],
					[new IPv4([
						198,
						18,
						0,
						0
					]), 15],
					[new IPv4([
						198,
						51,
						100,
						0
					]), 24],
					[new IPv4([
						203,
						0,
						113,
						0
					]), 24],
					[new IPv4([
						240,
						0,
						0,
						0
					]), 4]
				],
				as112: [[new IPv4([
					192,
					175,
					48,
					0
				]), 24], [new IPv4([
					192,
					31,
					196,
					0
				]), 24]],
				amt: [[new IPv4([
					192,
					52,
					193,
					0
				]), 24]]
			};
			IPv4.prototype.kind = function() {
				return "ipv4";
			};
			IPv4.prototype.match = function(other, cidrRange) {
				let ref;
				if (cidrRange === void 0) {
					ref = other;
					other = ref[0];
					cidrRange = ref[1];
				}
				if (other.kind() !== "ipv4") throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");
				return matchCIDR(this.octets, other.octets, 8, cidrRange);
			};
			IPv4.prototype.prefixLengthFromSubnetMask = function() {
				let cidr = 0;
				let stop = false;
				const zerotable = {
					0: 8,
					128: 7,
					192: 6,
					224: 5,
					240: 4,
					248: 3,
					252: 2,
					254: 1,
					255: 0
				};
				let i, octet, zeros;
				for (i = 3; i >= 0; i -= 1) {
					octet = this.octets[i];
					if (octet in zerotable) {
						zeros = zerotable[octet];
						if (stop && zeros !== 0) return null;
						if (zeros !== 8) stop = true;
						cidr += zeros;
					} else return null;
				}
				return 32 - cidr;
			};
			IPv4.prototype.range = function() {
				return ipaddr.subnetMatch(this, this.SpecialRanges);
			};
			IPv4.prototype.toByteArray = function() {
				return this.octets.slice(0);
			};
			IPv4.prototype.toIPv4MappedAddress = function() {
				return ipaddr.IPv6.parse(`::ffff:${this.toString()}`);
			};
			IPv4.prototype.toNormalizedString = function() {
				return this.toString();
			};
			IPv4.prototype.toString = function() {
				return this.octets.join(".");
			};
			return IPv4;
		})();
		ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {
			try {
				const cidr = this.parseCIDR(string);
				const ipInterfaceOctets = cidr[0].toByteArray();
				const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
				const octets = [];
				let i = 0;
				while (i < 4) {
					octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);
					i++;
				}
				return new this(octets);
			} catch (e) {
				throw new Error("ipaddr: the address does not have IPv4 CIDR format");
			}
		};
		ipaddr.IPv4.isIPv4 = function(string) {
			return this.parser(string) !== null;
		};
		ipaddr.IPv4.isValid = function(string) {
			try {
				new this(this.parser(string));
				return true;
			} catch (e) {
				return false;
			}
		};
		ipaddr.IPv4.isValidCIDR = function(string) {
			try {
				this.parseCIDR(string);
				return true;
			} catch (e) {
				return false;
			}
		};
		ipaddr.IPv4.isValidFourPartDecimal = function(string) {
			if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) return true;
			else return false;
		};
		ipaddr.IPv4.isValidCIDRFourPartDecimal = function(string) {
			const match = string.match(/^(.+)\/(\d+)$/);
			if (!ipaddr.IPv4.isValidCIDR(string) || !match) return false;
			return ipaddr.IPv4.isValidFourPartDecimal(match[1]);
		};
		ipaddr.IPv4.networkAddressFromCIDR = function(string) {
			let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
			try {
				cidr = this.parseCIDR(string);
				ipInterfaceOctets = cidr[0].toByteArray();
				subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
				octets = [];
				i = 0;
				while (i < 4) {
					octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));
					i++;
				}
				return new this(octets);
			} catch (e) {
				throw new Error("ipaddr: the address does not have IPv4 CIDR format");
			}
		};
		ipaddr.IPv4.parse = function(string) {
			const parts = this.parser(string);
			if (parts === null) throw new Error("ipaddr: string is not formatted like an IPv4 Address");
			return new this(parts);
		};
		ipaddr.IPv4.parseCIDR = function(string) {
			let match;
			if (match = string.match(/^(.+)\/(\d+)$/)) {
				const maskLength = parseInt(match[2]);
				if (maskLength >= 0 && maskLength <= 32) {
					const parsed = [this.parse(match[1]), maskLength];
					Object.defineProperty(parsed, "toString", { value: function() {
						return this.join("/");
					} });
					return parsed;
				}
			}
			throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
		};
		ipaddr.IPv4.parser = function(string) {
			let match, part, value;
			if (match = string.match(ipv4Regexes.fourOctet)) return (function() {
				const ref = match.slice(1, 6);
				const results = [];
				for (let i = 0; i < ref.length; i++) {
					part = ref[i];
					results.push(parseIntAuto(part));
				}
				return results;
			})();
			else if (match = string.match(ipv4Regexes.longValue)) {
				value = parseIntAuto(match[1]);
				if (value > 4294967295 || value < 0) throw new Error("ipaddr: address outside defined range");
				return (function() {
					const results = [];
					let shift;
					for (shift = 0; shift <= 24; shift += 8) results.push(value >> shift & 255);
					return results;
				})().reverse();
			} else if (match = string.match(ipv4Regexes.twoOctet)) return (function() {
				const ref = match.slice(1, 4);
				const results = [];
				value = parseIntAuto(ref[1]);
				if (value > 16777215 || value < 0) throw new Error("ipaddr: address outside defined range");
				results.push(parseIntAuto(ref[0]));
				results.push(value >> 16 & 255);
				results.push(value >> 8 & 255);
				results.push(value & 255);
				return results;
			})();
			else if (match = string.match(ipv4Regexes.threeOctet)) return (function() {
				const ref = match.slice(1, 5);
				const results = [];
				value = parseIntAuto(ref[2]);
				if (value > 65535 || value < 0) throw new Error("ipaddr: address outside defined range");
				results.push(parseIntAuto(ref[0]));
				results.push(parseIntAuto(ref[1]));
				results.push(value >> 8 & 255);
				results.push(value & 255);
				return results;
			})();
			else return null;
		};
		ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) {
			prefix = parseInt(prefix);
			if (prefix < 0 || prefix > 32) throw new Error("ipaddr: invalid IPv4 prefix length");
			const octets = [
				0,
				0,
				0,
				0
			];
			let j = 0;
			const filledOctetCount = Math.floor(prefix / 8);
			while (j < filledOctetCount) {
				octets[j] = 255;
				j++;
			}
			if (filledOctetCount < 4) octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8;
			return new this(octets);
		};
		ipaddr.IPv6 = (function() {
			function IPv6(parts, zoneId) {
				let i, part;
				if (parts.length === 16) {
					this.parts = [];
					for (i = 0; i <= 14; i += 2) this.parts.push(parts[i] << 8 | parts[i + 1]);
				} else if (parts.length === 8) this.parts = parts;
				else throw new Error("ipaddr: ipv6 part count should be 8 or 16");
				for (i = 0; i < this.parts.length; i++) {
					part = this.parts[i];
					if (!(0 <= part && part <= 65535)) throw new Error("ipaddr: ipv6 part should fit in 16 bits");
				}
				if (zoneId) this.zoneId = zoneId;
			}
			IPv6.prototype.SpecialRanges = {
				unspecified: [new IPv6([
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 128],
				linkLocal: [new IPv6([
					65152,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 10],
				multicast: [new IPv6([
					65280,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 8],
				loopback: [new IPv6([
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					1
				]), 128],
				uniqueLocal: [new IPv6([
					64512,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 7],
				ipv4Mapped: [new IPv6([
					0,
					0,
					0,
					0,
					0,
					65535,
					0,
					0
				]), 96],
				discard: [new IPv6([
					256,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 64],
				rfc6145: [new IPv6([
					0,
					0,
					0,
					0,
					65535,
					0,
					0,
					0
				]), 96],
				rfc6052: [new IPv6([
					100,
					65435,
					0,
					0,
					0,
					0,
					0,
					0
				]), 96],
				"6to4": [new IPv6([
					8194,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 16],
				teredo: [new IPv6([
					8193,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 32],
				benchmarking: [new IPv6([
					8193,
					2,
					0,
					0,
					0,
					0,
					0,
					0
				]), 48],
				amt: [new IPv6([
					8193,
					3,
					0,
					0,
					0,
					0,
					0,
					0
				]), 32],
				as112v6: [[new IPv6([
					8193,
					4,
					274,
					0,
					0,
					0,
					0,
					0
				]), 48], [new IPv6([
					9760,
					79,
					32768,
					0,
					0,
					0,
					0,
					0
				]), 48]],
				deprecated: [new IPv6([
					8193,
					16,
					0,
					0,
					0,
					0,
					0,
					0
				]), 28],
				orchid2: [new IPv6([
					8193,
					32,
					0,
					0,
					0,
					0,
					0,
					0
				]), 28],
				droneRemoteIdProtocolEntityTags: [new IPv6([
					8193,
					48,
					0,
					0,
					0,
					0,
					0,
					0
				]), 28],
				reserved: [[new IPv6([
					8193,
					0,
					0,
					0,
					0,
					0,
					0,
					0
				]), 23], [new IPv6([
					8193,
					3512,
					0,
					0,
					0,
					0,
					0,
					0
				]), 32]]
			};
			IPv6.prototype.isIPv4MappedAddress = function() {
				return this.range() === "ipv4Mapped";
			};
			IPv6.prototype.kind = function() {
				return "ipv6";
			};
			IPv6.prototype.match = function(other, cidrRange) {
				let ref;
				if (cidrRange === void 0) {
					ref = other;
					other = ref[0];
					cidrRange = ref[1];
				}
				if (other.kind() !== "ipv6") throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");
				return matchCIDR(this.parts, other.parts, 16, cidrRange);
			};
			IPv6.prototype.prefixLengthFromSubnetMask = function() {
				let cidr = 0;
				let stop = false;
				const zerotable = {
					0: 16,
					32768: 15,
					49152: 14,
					57344: 13,
					61440: 12,
					63488: 11,
					64512: 10,
					65024: 9,
					65280: 8,
					65408: 7,
					65472: 6,
					65504: 5,
					65520: 4,
					65528: 3,
					65532: 2,
					65534: 1,
					65535: 0
				};
				let part, zeros;
				for (let i = 7; i >= 0; i -= 1) {
					part = this.parts[i];
					if (part in zerotable) {
						zeros = zerotable[part];
						if (stop && zeros !== 0) return null;
						if (zeros !== 16) stop = true;
						cidr += zeros;
					} else return null;
				}
				return 128 - cidr;
			};
			IPv6.prototype.range = function() {
				return ipaddr.subnetMatch(this, this.SpecialRanges);
			};
			IPv6.prototype.toByteArray = function() {
				let part;
				const bytes = [];
				const ref = this.parts;
				for (let i = 0; i < ref.length; i++) {
					part = ref[i];
					bytes.push(part >> 8);
					bytes.push(part & 255);
				}
				return bytes;
			};
			IPv6.prototype.toFixedLengthString = function() {
				const addr = (function() {
					const results = [];
					for (let i = 0; i < this.parts.length; i++) results.push(padPart(this.parts[i].toString(16), 4));
					return results;
				}).call(this).join(":");
				let suffix = "";
				if (this.zoneId) suffix = `%${this.zoneId}`;
				return addr + suffix;
			};
			IPv6.prototype.toIPv4Address = function() {
				if (!this.isIPv4MappedAddress()) throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
				const ref = this.parts.slice(-2);
				const high = ref[0];
				const low = ref[1];
				return new ipaddr.IPv4([
					high >> 8,
					high & 255,
					low >> 8,
					low & 255
				]);
			};
			IPv6.prototype.toNormalizedString = function() {
				const addr = (function() {
					const results = [];
					for (let i = 0; i < this.parts.length; i++) results.push(this.parts[i].toString(16));
					return results;
				}).call(this).join(":");
				let suffix = "";
				if (this.zoneId) suffix = `%${this.zoneId}`;
				return addr + suffix;
			};
			IPv6.prototype.toRFC5952String = function() {
				const regex = /((^|:)(0(:|$)){2,})/g;
				const string = this.toNormalizedString();
				let bestMatchIndex = 0;
				let bestMatchLength = -1;
				let match;
				while (match = regex.exec(string)) if (match[0].length > bestMatchLength) {
					bestMatchIndex = match.index;
					bestMatchLength = match[0].length;
				}
				if (bestMatchLength < 0) return string;
				return `${string.substring(0, bestMatchIndex)}::${string.substring(bestMatchIndex + bestMatchLength)}`;
			};
			IPv6.prototype.toString = function() {
				return this.toRFC5952String();
			};
			return IPv6;
		})();
		ipaddr.IPv6.broadcastAddressFromCIDR = function(string) {
			try {
				const cidr = this.parseCIDR(string);
				const ipInterfaceOctets = cidr[0].toByteArray();
				const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
				const octets = [];
				let i = 0;
				while (i < 16) {
					octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);
					i++;
				}
				return new this(octets);
			} catch (e) {
				throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
			}
		};
		ipaddr.IPv6.isIPv6 = function(string) {
			return this.parser(string) !== null;
		};
		ipaddr.IPv6.isValid = function(string) {
			if (typeof string === "string" && string.indexOf(":") === -1) return false;
			try {
				const addr = this.parser(string);
				new this(addr.parts, addr.zoneId);
				return true;
			} catch (e) {
				return false;
			}
		};
		ipaddr.IPv6.isValidCIDR = function(string) {
			if (typeof string === "string" && string.indexOf(":") === -1) return false;
			try {
				this.parseCIDR(string);
				return true;
			} catch (e) {
				return false;
			}
		};
		ipaddr.IPv6.networkAddressFromCIDR = function(string) {
			let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
			try {
				cidr = this.parseCIDR(string);
				ipInterfaceOctets = cidr[0].toByteArray();
				subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
				octets = [];
				i = 0;
				while (i < 16) {
					octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));
					i++;
				}
				return new this(octets);
			} catch (e) {
				throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
			}
		};
		ipaddr.IPv6.parse = function(string) {
			const addr = this.parser(string);
			if (addr.parts === null) throw new Error("ipaddr: string is not formatted like an IPv6 Address");
			return new this(addr.parts, addr.zoneId);
		};
		ipaddr.IPv6.parseCIDR = function(string) {
			let maskLength, match, parsed;
			if (match = string.match(/^(.+)\/(\d+)$/)) {
				maskLength = parseInt(match[2]);
				if (maskLength >= 0 && maskLength <= 128) {
					parsed = [this.parse(match[1]), maskLength];
					Object.defineProperty(parsed, "toString", { value: function() {
						return this.join("/");
					} });
					return parsed;
				}
			}
			throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
		};
		ipaddr.IPv6.parser = function(string) {
			let addr, i, match, octet, octets, zoneId;
			if (match = string.match(ipv6Regexes.deprecatedTransitional)) return this.parser(`::ffff:${match[1]}`);
			if (ipv6Regexes.native.test(string)) return expandIPv6(string, 8);
			if (match = string.match(ipv6Regexes.transitional)) {
				zoneId = match[6] || "";
				addr = match[1];
				if (!match[1].endsWith("::")) addr = addr.slice(0, -1);
				addr = expandIPv6(addr + zoneId, 6);
				if (addr.parts) {
					octets = [
						parseInt(match[2]),
						parseInt(match[3]),
						parseInt(match[4]),
						parseInt(match[5])
					];
					for (i = 0; i < octets.length; i++) {
						octet = octets[i];
						if (!(0 <= octet && octet <= 255)) return null;
					}
					addr.parts.push(octets[0] << 8 | octets[1]);
					addr.parts.push(octets[2] << 8 | octets[3]);
					return {
						parts: addr.parts,
						zoneId: addr.zoneId
					};
				}
			}
			return null;
		};
		ipaddr.IPv6.subnetMaskFromPrefixLength = function(prefix) {
			prefix = parseInt(prefix);
			if (prefix < 0 || prefix > 128) throw new Error("ipaddr: invalid IPv6 prefix length");
			const octets = [
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0,
				0
			];
			let j = 0;
			const filledOctetCount = Math.floor(prefix / 8);
			while (j < filledOctetCount) {
				octets[j] = 255;
				j++;
			}
			if (filledOctetCount < 16) octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8;
			return new this(octets);
		};
		ipaddr.fromByteArray = function(bytes) {
			const length = bytes.length;
			if (length === 4) return new ipaddr.IPv4(bytes);
			else if (length === 16) return new ipaddr.IPv6(bytes);
			else throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
		};
		ipaddr.isValid = function(string) {
			return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);
		};
		ipaddr.isValidCIDR = function(string) {
			return ipaddr.IPv6.isValidCIDR(string) || ipaddr.IPv4.isValidCIDR(string);
		};
		ipaddr.parse = function(string) {
			if (ipaddr.IPv6.isValid(string)) return ipaddr.IPv6.parse(string);
			else if (ipaddr.IPv4.isValid(string)) return ipaddr.IPv4.parse(string);
			else throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
		};
		ipaddr.parseCIDR = function(string) {
			try {
				return ipaddr.IPv6.parseCIDR(string);
			} catch (e) {
				try {
					return ipaddr.IPv4.parseCIDR(string);
				} catch (e2) {
					throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
				}
			}
		};
		ipaddr.process = function(string) {
			const addr = this.parse(string);
			if (addr.kind() === "ipv6" && addr.isIPv4MappedAddress()) return addr.toIPv4Address();
			else return addr;
		};
		ipaddr.subnetMatch = function(address, rangeList, defaultName) {
			let i, rangeName, rangeSubnets, subnet;
			if (defaultName === void 0 || defaultName === null) defaultName = "unicast";
			for (rangeName in rangeList) if (Object.prototype.hasOwnProperty.call(rangeList, rangeName)) {
				rangeSubnets = rangeList[rangeName];
				if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) rangeSubnets = [rangeSubnets];
				for (i = 0; i < rangeSubnets.length; i++) {
					subnet = rangeSubnets[i];
					if (address.kind() === subnet[0].kind() && address.match.apply(address, subnet)) return rangeName;
				}
			}
			return defaultName;
		};
		if (typeof module !== "undefined" && module.exports) module.exports = ipaddr;
		else root.ipaddr = ipaddr;
	})(exports);
}));
var require_lru_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
	var AC = typeof AbortController === "function" ? AbortController : class AbortController$1 {
		constructor() {
			this.signal = new AS();
		}
		abort(reason = /* @__PURE__ */ new Error("This operation was aborted")) {
			this.signal.reason = this.signal.reason || reason;
			this.signal.aborted = true;
			this.signal.dispatchEvent({
				type: "abort",
				target: this.signal
			});
		}
	};
	var hasAbortSignal = typeof AbortSignal === "function";
	var hasACAbortSignal = typeof AC.AbortSignal === "function";
	var AS = hasAbortSignal ? AbortSignal : hasACAbortSignal ? AC.AbortController : class AbortSignal$1 {
		constructor() {
			this.reason = void 0;
			this.aborted = false;
			this._listeners = [];
		}
		dispatchEvent(e) {
			if (e.type === "abort") {
				this.aborted = true;
				this.onabort(e);
				this._listeners.forEach((f) => f(e), this);
			}
		}
		onabort() {}
		addEventListener(ev, fn) {
			if (ev === "abort") this._listeners.push(fn);
		}
		removeEventListener(ev, fn) {
			if (ev === "abort") this._listeners = this._listeners.filter((f) => f !== fn);
		}
	};
	var warned = /* @__PURE__ */ new Set();
	var deprecatedOption = (opt, instead) => {
		const code = `LRU_CACHE_OPTION_${opt}`;
		if (shouldWarn(code)) warn(code, `${opt} option`, `options.${instead}`, LRUCache);
	};
	var deprecatedMethod = (method, instead) => {
		const code = `LRU_CACHE_METHOD_${method}`;
		if (shouldWarn(code)) {
			const { prototype: prototype$1 } = LRUCache;
			const { get } = Object.getOwnPropertyDescriptor(prototype$1, method);
			warn(code, `${method} method`, `cache.${instead}()`, get);
		}
	};
	var deprecatedProperty = (field, instead) => {
		const code = `LRU_CACHE_PROPERTY_${field}`;
		if (shouldWarn(code)) {
			const { prototype: prototype$1 } = LRUCache;
			const { get } = Object.getOwnPropertyDescriptor(prototype$1, field);
			warn(code, `${field} property`, `cache.${instead}`, get);
		}
	};
	var emitWarning = (...a) => {
		typeof process === "object" && process && typeof process.emitWarning === "function" ? process.emitWarning(...a) : console.error(...a);
	};
	var shouldWarn = (code) => !warned.has(code);
	var warn = (code, what, instead, fn) => {
		warned.add(code);
		emitWarning(`The ${what} is deprecated. Please use ${instead} instead.`, "DeprecationWarning", code, fn);
	};
	var isPosInt = (n$1) => n$1 && n$1 === Math.floor(n$1) && n$1 > 0 && isFinite(n$1);
	/* istanbul ignore next - This is a little bit ridiculous, tbh.
	* The maximum array length is 2^32-1 or thereabouts on most JS impls.
	* And well before that point, you're caching the entire world, I mean,
	* that's ~32GB of just integers for the next/prev links, plus whatever
	* else to hold that many keys and values.  Just filling the memory with
	* zeroes at init time is brutal when you get that big.
	* But why not be complete?
	* Maybe in the future, these limits will have expanded. */
	var getUintArray = (max$2) => !isPosInt(max$2) ? null : max$2 <= Math.pow(2, 8) ? Uint8Array : max$2 <= Math.pow(2, 16) ? Uint16Array : max$2 <= Math.pow(2, 32) ? Uint32Array : max$2 <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
	var ZeroArray = class extends Array {
		constructor(size) {
			super(size);
			this.fill(0);
		}
	};
	var Stack = class {
		constructor(max$2) {
			if (max$2 === 0) return [];
			this.heap = new (getUintArray(max$2))(max$2);
			this.length = 0;
		}
		push(n$1) {
			this.heap[this.length++] = n$1;
		}
		pop() {
			return this.heap[--this.length];
		}
	};
	var LRUCache = class LRUCache {
		constructor(options = {}) {
			const { max: max$2 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, fetchContext, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
			const { length, maxAge, stale } = options instanceof LRUCache ? {} : options;
			if (max$2 !== 0 && !isPosInt(max$2)) throw new TypeError("max option must be a nonnegative integer");
			const UintArray = max$2 ? getUintArray(max$2) : Array;
			if (!UintArray) throw new Error("invalid max value: " + max$2);
			this.max = max$2;
			this.maxSize = maxSize;
			this.maxEntrySize = maxEntrySize || this.maxSize;
			this.sizeCalculation = sizeCalculation || length;
			if (this.sizeCalculation) {
				if (!this.maxSize && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
				if (typeof this.sizeCalculation !== "function") throw new TypeError("sizeCalculation set to non-function");
			}
			this.fetchMethod = fetchMethod || null;
			if (this.fetchMethod && typeof this.fetchMethod !== "function") throw new TypeError("fetchMethod must be a function if specified");
			this.fetchContext = fetchContext;
			if (!this.fetchMethod && fetchContext !== void 0) throw new TypeError("cannot set fetchContext without fetchMethod");
			this.keyMap = /* @__PURE__ */ new Map();
			this.keyList = new Array(max$2).fill(null);
			this.valList = new Array(max$2).fill(null);
			this.next = new UintArray(max$2);
			this.prev = new UintArray(max$2);
			this.head = 0;
			this.tail = 0;
			this.free = new Stack(max$2);
			this.initialFill = 1;
			this.size = 0;
			if (typeof dispose === "function") this.dispose = dispose;
			if (typeof disposeAfter === "function") {
				this.disposeAfter = disposeAfter;
				this.disposed = [];
			} else {
				this.disposeAfter = null;
				this.disposed = null;
			}
			this.noDisposeOnSet = !!noDisposeOnSet;
			this.noUpdateTTL = !!noUpdateTTL;
			this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
			this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
			this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
			this.ignoreFetchAbort = !!ignoreFetchAbort;
			if (this.maxEntrySize !== 0) {
				if (this.maxSize !== 0) {
					if (!isPosInt(this.maxSize)) throw new TypeError("maxSize must be a positive integer if specified");
				}
				if (!isPosInt(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
				this.initializeSizeTracking();
			}
			this.allowStale = !!allowStale || !!stale;
			this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
			this.updateAgeOnGet = !!updateAgeOnGet;
			this.updateAgeOnHas = !!updateAgeOnHas;
			this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
			this.ttlAutopurge = !!ttlAutopurge;
			this.ttl = ttl || maxAge || 0;
			if (this.ttl) {
				if (!isPosInt(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
				this.initializeTTLTracking();
			}
			if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
			if (!this.ttlAutopurge && !this.max && !this.maxSize) {
				const code = "LRU_CACHE_UNBOUNDED";
				if (shouldWarn(code)) {
					warned.add(code);
					emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", code, LRUCache);
				}
			}
			if (stale) deprecatedOption("stale", "allowStale");
			if (maxAge) deprecatedOption("maxAge", "ttl");
			if (length) deprecatedOption("length", "sizeCalculation");
		}
		getRemainingTTL(key) {
			return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0;
		}
		initializeTTLTracking() {
			this.ttls = new ZeroArray(this.max);
			this.starts = new ZeroArray(this.max);
			this.setItemTTL = (index, ttl, start = perf.now()) => {
				this.starts[index] = ttl !== 0 ? start : 0;
				this.ttls[index] = ttl;
				if (ttl !== 0 && this.ttlAutopurge) {
					const t = setTimeout(() => {
						if (this.isStale(index)) this.delete(this.keyList[index]);
					}, ttl + 1);
					/* istanbul ignore else - unref() not supported on all platforms */
					if (t.unref) t.unref();
				}
			};
			this.updateItemAge = (index) => {
				this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0;
			};
			this.statusTTL = (status, index) => {
				if (status) {
					status.ttl = this.ttls[index];
					status.start = this.starts[index];
					status.now = cachedNow || getNow();
					status.remainingTTL = status.now + status.ttl - status.start;
				}
			};
			let cachedNow = 0;
			const getNow = () => {
				const n$1 = perf.now();
				if (this.ttlResolution > 0) {
					cachedNow = n$1;
					const t = setTimeout(() => cachedNow = 0, this.ttlResolution);
					/* istanbul ignore else - not available on all platforms */
					if (t.unref) t.unref();
				}
				return n$1;
			};
			this.getRemainingTTL = (key) => {
				const index = this.keyMap.get(key);
				if (index === void 0) return 0;
				return this.ttls[index] === 0 || this.starts[index] === 0 ? Infinity : this.starts[index] + this.ttls[index] - (cachedNow || getNow());
			};
			this.isStale = (index) => {
				return this.ttls[index] !== 0 && this.starts[index] !== 0 && (cachedNow || getNow()) - this.starts[index] > this.ttls[index];
			};
		}
		updateItemAge(_index) {}
		statusTTL(_status, _index) {}
		setItemTTL(_index, _ttl, _start) {}
		isStale(_index) {
			return false;
		}
		initializeSizeTracking() {
			this.calculatedSize = 0;
			this.sizes = new ZeroArray(this.max);
			this.removeItemSize = (index) => {
				this.calculatedSize -= this.sizes[index];
				this.sizes[index] = 0;
			};
			this.requireSize = (k, v, size, sizeCalculation) => {
				if (this.isBackgroundFetch(v)) return 0;
				if (!isPosInt(size)) if (sizeCalculation) {
					if (typeof sizeCalculation !== "function") throw new TypeError("sizeCalculation must be a function");
					size = sizeCalculation(v, k);
					if (!isPosInt(size)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
				} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
				return size;
			};
			this.addItemSize = (index, size, status) => {
				this.sizes[index] = size;
				if (this.maxSize) {
					const maxSize = this.maxSize - this.sizes[index];
					while (this.calculatedSize > maxSize) this.evict(true);
				}
				this.calculatedSize += this.sizes[index];
				if (status) {
					status.entrySize = size;
					status.totalCalculatedSize = this.calculatedSize;
				}
			};
		}
		removeItemSize(_index) {}
		addItemSize(_index, _size) {}
		requireSize(_k, _v, size, sizeCalculation) {
			if (size || sizeCalculation) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
		}
		*indexes({ allowStale = this.allowStale } = {}) {
			if (this.size) for (let i = this.tail;;) {
				if (!this.isValidIndex(i)) break;
				if (allowStale || !this.isStale(i)) yield i;
				if (i === this.head) break;
				else i = this.prev[i];
			}
		}
		*rindexes({ allowStale = this.allowStale } = {}) {
			if (this.size) for (let i = this.head;;) {
				if (!this.isValidIndex(i)) break;
				if (allowStale || !this.isStale(i)) yield i;
				if (i === this.tail) break;
				else i = this.next[i];
			}
		}
		isValidIndex(index) {
			return index !== void 0 && this.keyMap.get(this.keyList[index]) === index;
		}
		*entries() {
			for (const i of this.indexes()) if (this.valList[i] !== void 0 && this.keyList[i] !== void 0 && !this.isBackgroundFetch(this.valList[i])) yield [this.keyList[i], this.valList[i]];
		}
		*rentries() {
			for (const i of this.rindexes()) if (this.valList[i] !== void 0 && this.keyList[i] !== void 0 && !this.isBackgroundFetch(this.valList[i])) yield [this.keyList[i], this.valList[i]];
		}
		*keys() {
			for (const i of this.indexes()) if (this.keyList[i] !== void 0 && !this.isBackgroundFetch(this.valList[i])) yield this.keyList[i];
		}
		*rkeys() {
			for (const i of this.rindexes()) if (this.keyList[i] !== void 0 && !this.isBackgroundFetch(this.valList[i])) yield this.keyList[i];
		}
		*values() {
			for (const i of this.indexes()) if (this.valList[i] !== void 0 && !this.isBackgroundFetch(this.valList[i])) yield this.valList[i];
		}
		*rvalues() {
			for (const i of this.rindexes()) if (this.valList[i] !== void 0 && !this.isBackgroundFetch(this.valList[i])) yield this.valList[i];
		}
		[Symbol.iterator]() {
			return this.entries();
		}
		find(fn, getOptions) {
			for (const i of this.indexes()) {
				const v = this.valList[i];
				const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
				if (value === void 0) continue;
				if (fn(value, this.keyList[i], this)) return this.get(this.keyList[i], getOptions);
			}
		}
		forEach(fn, thisp = this) {
			for (const i of this.indexes()) {
				const v = this.valList[i];
				const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
				if (value === void 0) continue;
				fn.call(thisp, value, this.keyList[i], this);
			}
		}
		rforEach(fn, thisp = this) {
			for (const i of this.rindexes()) {
				const v = this.valList[i];
				const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
				if (value === void 0) continue;
				fn.call(thisp, value, this.keyList[i], this);
			}
		}
		get prune() {
			deprecatedMethod("prune", "purgeStale");
			return this.purgeStale;
		}
		purgeStale() {
			let deleted = false;
			for (const i of this.rindexes({ allowStale: true })) if (this.isStale(i)) {
				this.delete(this.keyList[i]);
				deleted = true;
			}
			return deleted;
		}
		dump() {
			const arr = [];
			for (const i of this.indexes({ allowStale: true })) {
				const key = this.keyList[i];
				const v = this.valList[i];
				const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
				if (value === void 0) continue;
				const entry = { value };
				if (this.ttls) {
					entry.ttl = this.ttls[i];
					const age = perf.now() - this.starts[i];
					entry.start = Math.floor(Date.now() - age);
				}
				if (this.sizes) entry.size = this.sizes[i];
				arr.unshift([key, entry]);
			}
			return arr;
		}
		load(arr) {
			this.clear();
			for (const [key, entry] of arr) {
				if (entry.start) {
					const age = Date.now() - entry.start;
					entry.start = perf.now() - age;
				}
				this.set(key, entry.value, entry);
			}
		}
		dispose(_v, _k, _reason) {}
		set(k, v, { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, status } = {}) {
			size = this.requireSize(k, v, size, sizeCalculation);
			if (this.maxEntrySize && size > this.maxEntrySize) {
				if (status) {
					status.set = "miss";
					status.maxEntrySizeExceeded = true;
				}
				this.delete(k);
				return this;
			}
			let index = this.size === 0 ? void 0 : this.keyMap.get(k);
			if (index === void 0) {
				index = this.newIndex();
				this.keyList[index] = k;
				this.valList[index] = v;
				this.keyMap.set(k, index);
				this.next[this.tail] = index;
				this.prev[index] = this.tail;
				this.tail = index;
				this.size++;
				this.addItemSize(index, size, status);
				if (status) status.set = "add";
				noUpdateTTL = false;
			} else {
				this.moveToTail(index);
				const oldVal = this.valList[index];
				if (v !== oldVal) {
					if (this.isBackgroundFetch(oldVal)) oldVal.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
					else if (!noDisposeOnSet) {
						this.dispose(oldVal, k, "set");
						if (this.disposeAfter) this.disposed.push([
							oldVal,
							k,
							"set"
						]);
					}
					this.removeItemSize(index);
					this.valList[index] = v;
					this.addItemSize(index, size, status);
					if (status) {
						status.set = "replace";
						const oldValue = oldVal && this.isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
						if (oldValue !== void 0) status.oldValue = oldValue;
					}
				} else if (status) status.set = "update";
			}
			if (ttl !== 0 && this.ttl === 0 && !this.ttls) this.initializeTTLTracking();
			if (!noUpdateTTL) this.setItemTTL(index, ttl, start);
			this.statusTTL(status, index);
			if (this.disposeAfter) while (this.disposed.length) this.disposeAfter(...this.disposed.shift());
			return this;
		}
		newIndex() {
			if (this.size === 0) return this.tail;
			if (this.size === this.max && this.max !== 0) return this.evict(false);
			if (this.free.length !== 0) return this.free.pop();
			return this.initialFill++;
		}
		pop() {
			if (this.size) {
				const val = this.valList[this.head];
				this.evict(true);
				return val;
			}
		}
		evict(free) {
			const head = this.head;
			const k = this.keyList[head];
			const v = this.valList[head];
			if (this.isBackgroundFetch(v)) v.__abortController.abort(/* @__PURE__ */ new Error("evicted"));
			else {
				this.dispose(v, k, "evict");
				if (this.disposeAfter) this.disposed.push([
					v,
					k,
					"evict"
				]);
			}
			this.removeItemSize(head);
			if (free) {
				this.keyList[head] = null;
				this.valList[head] = null;
				this.free.push(head);
			}
			this.head = this.next[head];
			this.keyMap.delete(k);
			this.size--;
			return head;
		}
		has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) {
			const index = this.keyMap.get(k);
			if (index !== void 0) {
				if (!this.isStale(index)) {
					if (updateAgeOnHas) this.updateItemAge(index);
					if (status) status.has = "hit";
					this.statusTTL(status, index);
					return true;
				} else if (status) {
					status.has = "stale";
					this.statusTTL(status, index);
				}
			} else if (status) status.has = "miss";
			return false;
		}
		peek(k, { allowStale = this.allowStale } = {}) {
			const index = this.keyMap.get(k);
			if (index !== void 0 && (allowStale || !this.isStale(index))) {
				const v = this.valList[index];
				return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
			}
		}
		backgroundFetch(k, index, options, context) {
			const v = index === void 0 ? void 0 : this.valList[index];
			if (this.isBackgroundFetch(v)) return v;
			const ac = new AC();
			if (options.signal) options.signal.addEventListener("abort", () => ac.abort(options.signal.reason));
			const fetchOpts = {
				signal: ac.signal,
				options,
				context
			};
			const cb = (v$1, updateCache = false) => {
				const { aborted } = ac.signal;
				const ignoreAbort = options.ignoreFetchAbort && v$1 !== void 0;
				if (options.status) if (aborted && !updateCache) {
					options.status.fetchAborted = true;
					options.status.fetchError = ac.signal.reason;
					if (ignoreAbort) options.status.fetchAbortIgnored = true;
				} else options.status.fetchResolved = true;
				if (aborted && !ignoreAbort && !updateCache) return fetchFail(ac.signal.reason);
				if (this.valList[index] === p) if (v$1 === void 0) if (p.__staleWhileFetching) this.valList[index] = p.__staleWhileFetching;
				else this.delete(k);
				else {
					if (options.status) options.status.fetchUpdated = true;
					this.set(k, v$1, fetchOpts.options);
				}
				return v$1;
			};
			const eb = (er) => {
				if (options.status) {
					options.status.fetchRejected = true;
					options.status.fetchError = er;
				}
				return fetchFail(er);
			};
			const fetchFail = (er) => {
				const { aborted } = ac.signal;
				const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
				const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
				const noDelete = allowStale || options.noDeleteOnFetchRejection;
				if (this.valList[index] === p) {
					if (!noDelete || p.__staleWhileFetching === void 0) this.delete(k);
					else if (!allowStaleAborted) this.valList[index] = p.__staleWhileFetching;
				}
				if (allowStale) {
					if (options.status && p.__staleWhileFetching !== void 0) options.status.returnedStale = true;
					return p.__staleWhileFetching;
				} else if (p.__returned === p) throw er;
			};
			const pcall = (res, rej) => {
				this.fetchMethod(k, v, fetchOpts).then((v$1) => res(v$1), rej);
				ac.signal.addEventListener("abort", () => {
					if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
						res();
						if (options.allowStaleOnFetchAbort) res = (v$1) => cb(v$1, true);
					}
				});
			};
			if (options.status) options.status.fetchDispatched = true;
			const p = new Promise(pcall).then(cb, eb);
			p.__abortController = ac;
			p.__staleWhileFetching = v;
			p.__returned = null;
			if (index === void 0) {
				this.set(k, p, {
					...fetchOpts.options,
					status: void 0
				});
				index = this.keyMap.get(k);
			} else this.valList[index] = p;
			return p;
		}
		isBackgroundFetch(p) {
			return p && typeof p === "object" && typeof p.then === "function" && Object.prototype.hasOwnProperty.call(p, "__staleWhileFetching") && Object.prototype.hasOwnProperty.call(p, "__returned") && (p.__returned === p || p.__returned === null);
		}
		async fetch(k, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, fetchContext = this.fetchContext, forceRefresh = false, status, signal } = {}) {
			if (!this.fetchMethod) {
				if (status) status.fetch = "get";
				return this.get(k, {
					allowStale,
					updateAgeOnGet,
					noDeleteOnStaleGet,
					status
				});
			}
			const options = {
				allowStale,
				updateAgeOnGet,
				noDeleteOnStaleGet,
				ttl,
				noDisposeOnSet,
				size,
				sizeCalculation,
				noUpdateTTL,
				noDeleteOnFetchRejection,
				allowStaleOnFetchRejection,
				allowStaleOnFetchAbort,
				ignoreFetchAbort,
				status,
				signal
			};
			let index = this.keyMap.get(k);
			if (index === void 0) {
				if (status) status.fetch = "miss";
				const p = this.backgroundFetch(k, index, options, fetchContext);
				return p.__returned = p;
			} else {
				const v = this.valList[index];
				if (this.isBackgroundFetch(v)) {
					const stale = allowStale && v.__staleWhileFetching !== void 0;
					if (status) {
						status.fetch = "inflight";
						if (stale) status.returnedStale = true;
					}
					return stale ? v.__staleWhileFetching : v.__returned = v;
				}
				const isStale = this.isStale(index);
				if (!forceRefresh && !isStale) {
					if (status) status.fetch = "hit";
					this.moveToTail(index);
					if (updateAgeOnGet) this.updateItemAge(index);
					this.statusTTL(status, index);
					return v;
				}
				const p = this.backgroundFetch(k, index, options, fetchContext);
				const hasStale = p.__staleWhileFetching !== void 0;
				const staleVal = hasStale && allowStale;
				if (status) {
					status.fetch = hasStale && isStale ? "stale" : "refresh";
					if (staleVal && isStale) status.returnedStale = true;
				}
				return staleVal ? p.__staleWhileFetching : p.__returned = p;
			}
		}
		get(k, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = {}) {
			const index = this.keyMap.get(k);
			if (index !== void 0) {
				const value = this.valList[index];
				const fetching$4 = this.isBackgroundFetch(value);
				this.statusTTL(status, index);
				if (this.isStale(index)) {
					if (status) status.get = "stale";
					if (!fetching$4) {
						if (!noDeleteOnStaleGet) this.delete(k);
						if (status) status.returnedStale = allowStale;
						return allowStale ? value : void 0;
					} else {
						if (status) status.returnedStale = allowStale && value.__staleWhileFetching !== void 0;
						return allowStale ? value.__staleWhileFetching : void 0;
					}
				} else {
					if (status) status.get = "hit";
					if (fetching$4) return value.__staleWhileFetching;
					this.moveToTail(index);
					if (updateAgeOnGet) this.updateItemAge(index);
					return value;
				}
			} else if (status) status.get = "miss";
		}
		connect(p, n$1) {
			this.prev[n$1] = p;
			this.next[p] = n$1;
		}
		moveToTail(index) {
			if (index !== this.tail) {
				if (index === this.head) this.head = this.next[index];
				else this.connect(this.prev[index], this.next[index]);
				this.connect(this.tail, index);
				this.tail = index;
			}
		}
		get del() {
			deprecatedMethod("del", "delete");
			return this.delete;
		}
		delete(k) {
			let deleted = false;
			if (this.size !== 0) {
				const index = this.keyMap.get(k);
				if (index !== void 0) {
					deleted = true;
					if (this.size === 1) this.clear();
					else {
						this.removeItemSize(index);
						const v = this.valList[index];
						if (this.isBackgroundFetch(v)) v.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
						else {
							this.dispose(v, k, "delete");
							if (this.disposeAfter) this.disposed.push([
								v,
								k,
								"delete"
							]);
						}
						this.keyMap.delete(k);
						this.keyList[index] = null;
						this.valList[index] = null;
						if (index === this.tail) this.tail = this.prev[index];
						else if (index === this.head) this.head = this.next[index];
						else {
							this.next[this.prev[index]] = this.next[index];
							this.prev[this.next[index]] = this.prev[index];
						}
						this.size--;
						this.free.push(index);
					}
				}
			}
			if (this.disposed) while (this.disposed.length) this.disposeAfter(...this.disposed.shift());
			return deleted;
		}
		clear() {
			for (const index of this.rindexes({ allowStale: true })) {
				const v = this.valList[index];
				if (this.isBackgroundFetch(v)) v.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
				else {
					const k = this.keyList[index];
					this.dispose(v, k, "delete");
					if (this.disposeAfter) this.disposed.push([
						v,
						k,
						"delete"
					]);
				}
			}
			this.keyMap.clear();
			this.valList.fill(null);
			this.keyList.fill(null);
			if (this.ttls) {
				this.ttls.fill(0);
				this.starts.fill(0);
			}
			if (this.sizes) this.sizes.fill(0);
			this.head = 0;
			this.tail = 0;
			this.initialFill = 1;
			this.free.length = 0;
			this.calculatedSize = 0;
			this.size = 0;
			if (this.disposed) while (this.disposed.length) this.disposeAfter(...this.disposed.shift());
		}
		get reset() {
			deprecatedMethod("reset", "clear");
			return this.clear;
		}
		get length() {
			deprecatedProperty("length", "size");
			return this.size;
		}
		static get AbortController() {
			return AC;
		}
		static get AbortSignal() {
			return AS;
		}
	};
	module.exports = LRUCache;
}));
var require_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$12 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$9 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$10 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$12(result, mod, k);
		}
		__setModuleDefault$9(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.req = exports.json = exports.toBuffer = void 0;
	var http$5 = __importStar$10(require("http"));
	var https$4 = __importStar$10(require("https"));
	async function toBuffer(stream$7) {
		let length = 0;
		const chunks = [];
		for await (const chunk of stream$7) {
			length += chunk.length;
			chunks.push(chunk);
		}
		return Buffer.concat(chunks, length);
	}
	exports.toBuffer = toBuffer;
	async function json(stream$7) {
		const str = (await toBuffer(stream$7)).toString("utf8");
		try {
			return JSON.parse(str);
		} catch (_err) {
			const err = _err;
			err.message += ` (input: ${str})`;
			throw err;
		}
	}
	exports.json = json;
	function req(url$3, opts = {}) {
		const req$1 = ((typeof url$3 === "string" ? url$3 : url$3.href).startsWith("https:") ? https$4 : http$5).request(url$3, opts);
		const promise = new Promise((resolve, reject) => {
			req$1.once("response", resolve).once("error", reject).end();
		});
		req$1.then = promise.then.bind(promise);
		return req$1;
	}
	exports.req = req;
}));
var require_dist$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$11 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$8 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$9 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$11(result, mod, k);
		}
		__setModuleDefault$8(result, mod);
		return result;
	};
	var __exportStar$4 = exports && exports.__exportStar || function(m$1, exports$1) {
		for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding$11(exports$1, m$1, p);
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Agent = void 0;
	var net$4 = __importStar$9(require("net"));
	var http$4 = __importStar$9(require("http"));
	var https_1$3 = require("https");
	__exportStar$4(require_helpers(), exports);
	var INTERNAL = Symbol("AgentBaseInternalState");
	var Agent = class extends http$4.Agent {
		constructor(opts) {
			super(opts);
			this[INTERNAL] = {};
		}
		isSecureEndpoint(options) {
			if (options) {
				if (typeof options.secureEndpoint === "boolean") return options.secureEndpoint;
				if (typeof options.protocol === "string") return options.protocol === "https:";
			}
			const { stack } = /* @__PURE__ */ new Error();
			if (typeof stack !== "string") return false;
			return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
		}
		incrementSockets(name$1) {
			if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) return null;
			if (!this.sockets[name$1]) this.sockets[name$1] = [];
			const fakeSocket = new net$4.Socket({ writable: false });
			this.sockets[name$1].push(fakeSocket);
			this.totalSocketCount++;
			return fakeSocket;
		}
		decrementSockets(name$1, socket) {
			if (!this.sockets[name$1] || socket === null) return;
			const sockets = this.sockets[name$1];
			const index = sockets.indexOf(socket);
			if (index !== -1) {
				sockets.splice(index, 1);
				this.totalSocketCount--;
				if (sockets.length === 0) delete this.sockets[name$1];
			}
		}
		getName(options) {
			if (this.isSecureEndpoint(options)) return https_1$3.Agent.prototype.getName.call(this, options);
			return super.getName(options);
		}
		createSocket(req$1, options, cb) {
			const connectOpts = {
				...options,
				secureEndpoint: this.isSecureEndpoint(options)
			};
			const name$1 = this.getName(connectOpts);
			const fakeSocket = this.incrementSockets(name$1);
			Promise.resolve().then(() => this.connect(req$1, connectOpts)).then((socket) => {
				this.decrementSockets(name$1, fakeSocket);
				if (socket instanceof http$4.Agent) try {
					return socket.addRequest(req$1, connectOpts);
				} catch (err) {
					return cb(err);
				}
				this[INTERNAL].currentSocket = socket;
				super.createSocket(req$1, options, cb);
			}, (err) => {
				this.decrementSockets(name$1, fakeSocket);
				cb(err);
			});
		}
		createConnection() {
			const socket = this[INTERNAL].currentSocket;
			this[INTERNAL].currentSocket = void 0;
			if (!socket) throw new Error("No socket was returned in the `connect()` function");
			return socket;
		}
		get defaultPort() {
			return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
		}
		set defaultPort(v) {
			if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
		}
		get protocol() {
			return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
		}
		set protocol(v) {
			if (this[INTERNAL]) this[INTERNAL].protocol = v;
		}
	};
	exports.Agent = Agent;
}));
var require_proxy_from_env = /* @__PURE__ */ __commonJSMin(((exports) => {
	var parseUrl = require("url").parse;
	var DEFAULT_PORTS = {
		ftp: 21,
		gopher: 70,
		http: 80,
		https: 443,
		ws: 80,
		wss: 443
	};
	var stringEndsWith = String.prototype.endsWith || function(s$1) {
		return s$1.length <= this.length && this.indexOf(s$1, this.length - s$1.length) !== -1;
	};
	function getProxyForUrl(url$3) {
		var parsedUrl = typeof url$3 === "string" ? parseUrl(url$3) : url$3 || {};
		var proto = parsedUrl.protocol;
		var hostname = parsedUrl.host;
		var port = parsedUrl.port;
		if (typeof hostname !== "string" || !hostname || typeof proto !== "string") return "";
		proto = proto.split(":", 1)[0];
		hostname = hostname.replace(/:\d*$/, "");
		port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
		if (!shouldProxy(hostname, port)) return "";
		var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
		if (proxy && proxy.indexOf("://") === -1) proxy = proto + "://" + proxy;
		return proxy;
	}
	function shouldProxy(hostname, port) {
		var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
		if (!NO_PROXY) return true;
		if (NO_PROXY === "*") return false;
		return NO_PROXY.split(/[,\s]/).every(function(proxy) {
			if (!proxy) return true;
			var parsedProxy = proxy.match(/^(.+):(\d+)$/);
			var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
			var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
			if (parsedProxyPort && parsedProxyPort !== port) return true;
			if (!/^[.*]/.test(parsedProxyHostname)) return hostname !== parsedProxyHostname;
			if (parsedProxyHostname.charAt(0) === "*") parsedProxyHostname = parsedProxyHostname.slice(1);
			return !stringEndsWith.call(hostname, parsedProxyHostname);
		});
	}
	function getEnv(key) {
		return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
	}
	exports.getProxyForUrl = getProxyForUrl;
}));
var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$10 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$7 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$8 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$10(result, mod, k);
		}
		__setModuleDefault$7(result, mod);
		return result;
	};
	var __importDefault$15 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.HttpProxyAgent = void 0;
	var net$3 = __importStar$8(require("net"));
	var tls$3 = __importStar$8(require("tls"));
	var debug_1$14 = __importDefault$15(require_src());
	var events_1$2 = require("events");
	var agent_base_1$4 = require_dist$10();
	var url_1$5 = require("url");
	var debug$10 = (0, debug_1$14.default)("http-proxy-agent");
	var HttpProxyAgent = class extends agent_base_1$4.Agent {
		constructor(proxy, opts) {
			super(opts);
			this.proxy = typeof proxy === "string" ? new url_1$5.URL(proxy) : proxy;
			this.proxyHeaders = opts?.headers ?? {};
			debug$10("Creating new HttpProxyAgent instance: %o", this.proxy.href);
			const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
			const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
			this.connectOpts = {
				...opts ? omit$2(opts, "headers") : null,
				host,
				port
			};
		}
		addRequest(req$1, opts) {
			req$1._header = null;
			this.setRequestProps(req$1, opts);
			super.addRequest(req$1, opts);
		}
		setRequestProps(req$1, opts) {
			const { proxy } = this;
			const base = `${opts.secureEndpoint ? "https:" : "http:"}//${req$1.getHeader("host") || "localhost"}`;
			const url$3 = new url_1$5.URL(req$1.path, base);
			if (opts.port !== 80) url$3.port = String(opts.port);
			req$1.path = String(url$3);
			const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
			if (proxy.username || proxy.password) {
				const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
				headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
			}
			if (!headers["Proxy-Connection"]) headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
			for (const name$1 of Object.keys(headers)) {
				const value = headers[name$1];
				if (value) req$1.setHeader(name$1, value);
			}
		}
		async connect(req$1, opts) {
			req$1._header = null;
			if (!req$1.path.includes("://")) this.setRequestProps(req$1, opts);
			let first;
			let endOfHeaders;
			debug$10("Regenerating stored HTTP header string for request");
			req$1._implicitHeader();
			if (req$1.outputData && req$1.outputData.length > 0) {
				debug$10("Patching connection write() output buffer with updated header");
				first = req$1.outputData[0].data;
				endOfHeaders = first.indexOf("\r\n\r\n") + 4;
				req$1.outputData[0].data = req$1._header + first.substring(endOfHeaders);
				debug$10("Output buffer: %o", req$1.outputData[0].data);
			}
			let socket;
			if (this.proxy.protocol === "https:") {
				debug$10("Creating `tls.Socket`: %o", this.connectOpts);
				socket = tls$3.connect(this.connectOpts);
			} else {
				debug$10("Creating `net.Socket`: %o", this.connectOpts);
				socket = net$3.connect(this.connectOpts);
			}
			await (0, events_1$2.once)(socket, "connect");
			return socket;
		}
	};
	HttpProxyAgent.protocols = ["http", "https"];
	exports.HttpProxyAgent = HttpProxyAgent;
	function omit$2(obj, ...keys) {
		const ret = {};
		let key;
		for (key in obj) if (!keys.includes(key)) ret[key] = obj[key];
		return ret;
	}
}));
var require_parse_proxy_response = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$14 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.parseProxyResponse = void 0;
	var debug$9 = (0, __importDefault$14(require_src()).default)("https-proxy-agent:parse-proxy-response");
	function parseProxyResponse(socket) {
		return new Promise((resolve, reject) => {
			let buffersLength = 0;
			const buffers = [];
			function read() {
				const b = socket.read();
				if (b) ondata(b);
				else socket.once("readable", read);
			}
			function cleanup() {
				socket.removeListener("end", onend);
				socket.removeListener("error", onerror);
				socket.removeListener("readable", read);
			}
			function onend() {
				cleanup();
				debug$9("onend");
				reject(/* @__PURE__ */ new Error("Proxy connection ended before receiving CONNECT response"));
			}
			function onerror(err) {
				cleanup();
				debug$9("onerror %o", err);
				reject(err);
			}
			function ondata(b) {
				buffers.push(b);
				buffersLength += b.length;
				const buffered = Buffer.concat(buffers, buffersLength);
				const endOfHeaders = buffered.indexOf("\r\n\r\n");
				if (endOfHeaders === -1) {
					debug$9("have not received end of HTTP headers yet...");
					read();
					return;
				}
				const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
				const firstLine = headerParts.shift();
				if (!firstLine) {
					socket.destroy();
					return reject(/* @__PURE__ */ new Error("No header received from proxy CONNECT response"));
				}
				const firstLineParts = firstLine.split(" ");
				const statusCode = +firstLineParts[1];
				const statusText = firstLineParts.slice(2).join(" ");
				const headers = {};
				for (const header of headerParts) {
					if (!header) continue;
					const firstColon = header.indexOf(":");
					if (firstColon === -1) {
						socket.destroy();
						return reject(/* @__PURE__ */ new Error(`Invalid header from proxy CONNECT response: "${header}"`));
					}
					const key = header.slice(0, firstColon).toLowerCase();
					const value = header.slice(firstColon + 1).trimStart();
					const current = headers[key];
					if (typeof current === "string") headers[key] = [current, value];
					else if (Array.isArray(current)) current.push(value);
					else headers[key] = value;
				}
				debug$9("got proxy server response: %o %o", firstLine, headers);
				cleanup();
				resolve({
					connect: {
						statusCode,
						statusText,
						headers
					},
					buffered
				});
			}
			socket.on("error", onerror);
			socket.on("end", onend);
			read();
		});
	}
	exports.parseProxyResponse = parseProxyResponse;
}));
var require_dist$8 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$9 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$6 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$7 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$9(result, mod, k);
		}
		__setModuleDefault$6(result, mod);
		return result;
	};
	var __importDefault$13 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.HttpsProxyAgent = void 0;
	var net$2 = __importStar$7(require("net"));
	var tls$2 = __importStar$7(require("tls"));
	var assert_1 = __importDefault$13(require("assert"));
	var debug_1$13 = __importDefault$13(require_src());
	var agent_base_1$3 = require_dist$10();
	var url_1$4 = require("url");
	var parse_proxy_response_1 = require_parse_proxy_response();
	var debug$8 = (0, debug_1$13.default)("https-proxy-agent");
	var setServernameFromNonIpHost$2 = (options) => {
		if (options.servername === void 0 && options.host && !net$2.isIP(options.host)) return {
			...options,
			servername: options.host
		};
		return options;
	};
	var HttpsProxyAgent = class extends agent_base_1$3.Agent {
		constructor(proxy, opts) {
			super(opts);
			this.options = { path: void 0 };
			this.proxy = typeof proxy === "string" ? new url_1$4.URL(proxy) : proxy;
			this.proxyHeaders = opts?.headers ?? {};
			debug$8("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
			const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
			const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
			this.connectOpts = {
				ALPNProtocols: ["http/1.1"],
				...opts ? omit$1(opts, "headers") : null,
				host,
				port
			};
		}
		async connect(req$1, opts) {
			const { proxy } = this;
			if (!opts.host) throw new TypeError("No \"host\" provided");
			let socket;
			if (proxy.protocol === "https:") {
				debug$8("Creating `tls.Socket`: %o", this.connectOpts);
				socket = tls$2.connect(setServernameFromNonIpHost$2(this.connectOpts));
			} else {
				debug$8("Creating `net.Socket`: %o", this.connectOpts);
				socket = net$2.connect(this.connectOpts);
			}
			const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
			const host = net$2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
			let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
			if (proxy.username || proxy.password) {
				const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
				headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
			}
			headers.Host = `${host}:${opts.port}`;
			if (!headers["Proxy-Connection"]) headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
			for (const name$1 of Object.keys(headers)) payload += `${name$1}: ${headers[name$1]}\r\n`;
			const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
			socket.write(`${payload}\r\n`);
			const { connect: connect$2, buffered } = await proxyResponsePromise;
			req$1.emit("proxyConnect", connect$2);
			this.emit("proxyConnect", connect$2, req$1);
			if (connect$2.statusCode === 200) {
				req$1.once("socket", resume);
				if (opts.secureEndpoint) {
					debug$8("Upgrading socket connection to TLS");
					return tls$2.connect({
						...omit$1(setServernameFromNonIpHost$2(opts), "host", "path", "port"),
						socket
					});
				}
				return socket;
			}
			socket.destroy();
			const fakeSocket = new net$2.Socket({ writable: false });
			fakeSocket.readable = true;
			req$1.once("socket", (s$1) => {
				debug$8("Replaying proxy buffer for failed request");
				(0, assert_1.default)(s$1.listenerCount("data") > 0);
				s$1.push(buffered);
				s$1.push(null);
			});
			return fakeSocket;
		}
	};
	HttpsProxyAgent.protocols = ["http", "https"];
	exports.HttpsProxyAgent = HttpsProxyAgent;
	function resume(socket) {
		socket.resume();
	}
	function omit$1(obj, ...keys) {
		const ret = {};
		let key;
		for (key in obj) if (!keys.includes(key)) ret[key] = obj[key];
		return ret;
	}
}));
var require_dist$7 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$8 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$5 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$6 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$8(result, mod, k);
		}
		__setModuleDefault$5(result, mod);
		return result;
	};
	var __importDefault$12 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.SocksProxyAgent = void 0;
	var socks_1 = require_build();
	var agent_base_1$2 = require_dist$10();
	var debug_1$12 = __importDefault$12(require_src());
	var dns = __importStar$6(require("dns"));
	var net$1 = __importStar$6(require("net"));
	var tls$1 = __importStar$6(require("tls"));
	var url_1$3 = require("url");
	var debug$7 = (0, debug_1$12.default)("socks-proxy-agent");
	var setServernameFromNonIpHost$1 = (options) => {
		if (options.servername === void 0 && options.host && !net$1.isIP(options.host)) return {
			...options,
			servername: options.host
		};
		return options;
	};
	function parseSocksURL(url$3) {
		let lookup$2 = false;
		let type = 5;
		const host = url$3.hostname;
		const port = parseInt(url$3.port, 10) || 1080;
		switch (url$3.protocol.replace(":", "")) {
			case "socks4":
				lookup$2 = true;
				type = 4;
				break;
			case "socks4a":
				type = 4;
				break;
			case "socks5":
				lookup$2 = true;
				type = 5;
				break;
			case "socks":
				type = 5;
				break;
			case "socks5h":
				type = 5;
				break;
			default: throw new TypeError(`A "socks" protocol must be specified! Got: ${String(url$3.protocol)}`);
		}
		const proxy = {
			host,
			port,
			type
		};
		if (url$3.username) Object.defineProperty(proxy, "userId", {
			value: decodeURIComponent(url$3.username),
			enumerable: false
		});
		if (url$3.password != null) Object.defineProperty(proxy, "password", {
			value: decodeURIComponent(url$3.password),
			enumerable: false
		});
		return {
			lookup: lookup$2,
			proxy
		};
	}
	var SocksProxyAgent = class extends agent_base_1$2.Agent {
		constructor(uri, opts) {
			super(opts);
			const { proxy, lookup: lookup$2 } = parseSocksURL(typeof uri === "string" ? new url_1$3.URL(uri) : uri);
			this.shouldLookup = lookup$2;
			this.proxy = proxy;
			this.timeout = opts?.timeout ?? null;
			this.socketOptions = opts?.socketOptions ?? null;
		}
		async connect(req$1, opts) {
			const { shouldLookup, proxy, timeout } = this;
			if (!opts.host) throw new Error("No `host` defined!");
			let { host } = opts;
			const { port, lookup: lookupFn = dns.lookup } = opts;
			if (shouldLookup) host = await new Promise((resolve, reject) => {
				lookupFn(host, {}, (err, res) => {
					if (err) reject(err);
					else resolve(res);
				});
			});
			const socksOpts = {
				proxy,
				destination: {
					host,
					port: typeof port === "number" ? port : parseInt(port, 10)
				},
				command: "connect",
				timeout: timeout ?? void 0,
				socket_options: this.socketOptions ?? void 0
			};
			const cleanup = (tlsSocket) => {
				req$1.destroy();
				socket.destroy();
				if (tlsSocket) tlsSocket.destroy();
			};
			debug$7("Creating socks proxy connection: %o", socksOpts);
			const { socket } = await socks_1.SocksClient.createConnection(socksOpts);
			debug$7("Successfully created socks proxy connection");
			if (timeout !== null) {
				socket.setTimeout(timeout);
				socket.on("timeout", () => cleanup());
			}
			if (opts.secureEndpoint) {
				debug$7("Upgrading socket connection to TLS");
				const tlsSocket = tls$1.connect({
					...omit(setServernameFromNonIpHost$1(opts), "host", "path", "port"),
					socket
				});
				tlsSocket.once("error", (error) => {
					debug$7("Socket TLS error", error.message);
					cleanup(tlsSocket);
				});
				return tlsSocket;
			}
			return socket;
		}
	};
	SocksProxyAgent.protocols = [
		"socks",
		"socks4",
		"socks4a",
		"socks5",
		"socks5h"
	];
	exports.SocksProxyAgent = SocksProxyAgent;
	function omit(obj, ...keys) {
		const ret = {};
		let key;
		for (key in obj) if (!keys.includes(key)) ret[key] = obj[key];
		return ret;
	}
}));
var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.makeDataUriToBuffer = void 0;
	var makeDataUriToBuffer = (convert) => (uri) => {
		uri = String(uri);
		if (!/^data:/i.test(uri)) throw new TypeError("`uri` does not appear to be a Data URI (must begin with \"data:\")");
		uri = uri.replace(/\r?\n/g, "");
		const firstComma = uri.indexOf(",");
		if (firstComma === -1 || firstComma <= 4) throw new TypeError("malformed data: URI");
		const meta = uri.substring(5, firstComma).split(";");
		let charset$1 = "";
		let base64$1 = false;
		const type = meta[0] || "text/plain";
		let typeFull = type;
		for (let i = 1; i < meta.length; i++) if (meta[i] === "base64") base64$1 = true;
		else if (meta[i]) {
			typeFull += `;${meta[i]}`;
			if (meta[i].indexOf("charset=") === 0) charset$1 = meta[i].substring(8);
		}
		if (!meta[0] && !charset$1.length) {
			typeFull += ";charset=US-ASCII";
			charset$1 = "US-ASCII";
		}
		const data$1 = unescape(uri.substring(firstComma + 1));
		const buffer$1 = base64$1 ? convert.base64ToArrayBuffer(data$1) : convert.stringToBuffer(data$1);
		return {
			type,
			typeFull,
			charset: charset$1,
			buffer: buffer$1
		};
	};
	exports.makeDataUriToBuffer = makeDataUriToBuffer;
}));
var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.dataUriToBuffer = void 0;
	var common_1 = require_common();
	function nodeBuffertoArrayBuffer(nodeBuf) {
		if (nodeBuf.byteLength === nodeBuf.buffer.byteLength) return nodeBuf.buffer;
		const buffer$1 = new ArrayBuffer(nodeBuf.byteLength);
		new Uint8Array(buffer$1).set(nodeBuf);
		return buffer$1;
	}
	function base64ToArrayBuffer(base64$1) {
		return nodeBuffertoArrayBuffer(Buffer.from(base64$1, "base64"));
	}
	function stringToBuffer(str) {
		return nodeBuffertoArrayBuffer(Buffer.from(str, "ascii"));
	}
	exports.dataUriToBuffer = (0, common_1.makeDataUriToBuffer)({
		stringToBuffer,
		base64ToArrayBuffer
	});
}));
var require_notmodified = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var NotModifiedError = class extends Error {
		constructor(message) {
			super(message || "Source has not been modified since the provied \"cache\", re-use previous results");
			this.code = "ENOTMODIFIED";
		}
	};
	exports.default = NotModifiedError;
}));
var require_data = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$11 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.data = void 0;
	var debug_1$11 = __importDefault$11(require_src());
	var stream_1$3 = require("stream");
	var crypto_1 = require("crypto");
	var data_uri_to_buffer_1 = require_node();
	var notmodified_1$3 = __importDefault$11(require_notmodified());
	var debug$6 = (0, debug_1$11.default)("get-uri:data");
	var DataReadable = class extends stream_1$3.Readable {
		constructor(hash, buf) {
			super();
			this.push(buf);
			this.push(null);
			this.hash = hash;
		}
	};
	var data = async ({ href: uri }, { cache } = {}) => {
		const shasum = (0, crypto_1.createHash)("sha1");
		shasum.update(uri);
		const hash = shasum.digest("hex");
		debug$6("generated SHA1 hash for \"data:\" URI: %o", hash);
		if (cache?.hash === hash) {
			debug$6("got matching cache SHA1 hash: %o", hash);
			throw new notmodified_1$3.default();
		} else {
			debug$6("creating Readable stream from \"data:\" URI buffer");
			const { buffer: buffer$1 } = (0, data_uri_to_buffer_1.dataUriToBuffer)(uri);
			return new DataReadable(hash, Buffer.from(buffer$1));
		}
	};
	exports.data = data;
}));
var require_notfound = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var NotFoundError = class extends Error {
		constructor(message) {
			super(message || "File does not exist at the specified endpoint");
			this.code = "ENOTFOUND";
		}
	};
	exports.default = NotFoundError;
}));
var require_file = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$10 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.file = void 0;
	var debug_1$10 = __importDefault$10(require_src());
	var fs_1$1 = require("fs");
	var notfound_1$2 = __importDefault$10(require_notfound());
	var notmodified_1$2 = __importDefault$10(require_notmodified());
	var url_1$2 = require("url");
	var debug$5 = (0, debug_1$10.default)("get-uri:file");
	var file = async ({ href: uri }, opts = {}) => {
		const { cache, flags = "r", mode = 438 } = opts;
		try {
			const filepath = (0, url_1$2.fileURLToPath)(uri);
			debug$5("Normalized pathname: %o", filepath);
			const fdHandle = await fs_1$1.promises.open(filepath, flags, mode);
			const fd = fdHandle.fd;
			const stat = await fdHandle.stat();
			if (cache && cache.stat && stat && isNotModified(cache.stat, stat)) {
				await fdHandle.close();
				throw new notmodified_1$2.default();
			}
			const rs = (0, fs_1$1.createReadStream)(filepath, {
				autoClose: true,
				...opts,
				fd
			});
			rs.stat = stat;
			return rs;
		} catch (err) {
			if (err.code === "ENOENT") throw new notfound_1$2.default();
			throw err;
		}
	};
	exports.file = file;
	function isNotModified(prev, curr) {
		return +prev.mtime === +curr.mtime;
	}
}));
var require_parseControlResponse = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.parseControlResponse = parseControlResponse;
	exports.isSingleLine = isSingleLine;
	exports.isMultiline = isMultiline;
	exports.positiveCompletion = positiveCompletion;
	exports.positiveIntermediate = positiveIntermediate;
	var LF = "\n";
	function parseControlResponse(text) {
		const lines = text.split(/\r?\n/).filter(isNotBlank$1);
		const messages = [];
		let startAt = 0;
		let tokenRegex;
		for (let i = 0; i < lines.length; i++) {
			const line = lines[i];
			if (!tokenRegex) {
				if (isMultiline(line)) {
					const token = line.substr(0, 3);
					tokenRegex = /* @__PURE__ */ new RegExp(`^${token}(?:$| )`);
					startAt = i;
				} else if (isSingleLine(line)) messages.push(line);
			} else if (tokenRegex.test(line)) {
				tokenRegex = void 0;
				messages.push(lines.slice(startAt, i + 1).join(LF));
			}
		}
		return {
			messages,
			rest: tokenRegex ? lines.slice(startAt).join(LF) + LF : ""
		};
	}
	function isSingleLine(line) {
		return /^\d\d\d(?:$| )/.test(line);
	}
	function isMultiline(line) {
		return /^\d\d\d-/.test(line);
	}
	function positiveCompletion(code) {
		return code >= 200 && code < 300;
	}
	function positiveIntermediate(code) {
		return code >= 300 && code < 400;
	}
	function isNotBlank$1(str) {
		return str.trim() !== "";
	}
}));
var require_FtpContext = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.FTPContext = exports.FTPError = void 0;
	var net_1$1 = require("net");
	var parseControlResponse_1$2 = require_parseControlResponse();
	var FTPError = class extends Error {
		constructor(res) {
			super(res.message);
			this.name = this.constructor.name;
			this.code = res.code;
		}
	};
	exports.FTPError = FTPError;
	function doNothing() {}
	var FTPContext = class {
		constructor(timeout = 0, encoding = "utf8") {
			this.timeout = timeout;
			this.verbose = false;
			this.ipFamily = void 0;
			this.tlsOptions = {};
			this._partialResponse = "";
			this._encoding = encoding;
			this._socket = this.socket = this._newSocket();
			this._dataSocket = void 0;
		}
		close() {
			const message = this._task ? "User closed client during task" : "User closed client";
			const err = new Error(message);
			this.closeWithError(err);
		}
		closeWithError(err) {
			if (this._closingError) return;
			this._closingError = err;
			this._closeControlSocket();
			this._closeSocket(this._dataSocket);
			this._passToHandler(err);
			this._stopTrackingTask();
		}
		get closed() {
			return this.socket.remoteAddress === void 0 || this._closingError !== void 0;
		}
		reset() {
			this.socket = this._newSocket();
		}
		get socket() {
			return this._socket;
		}
		set socket(socket) {
			this.dataSocket = void 0;
			this.tlsOptions = {};
			this._partialResponse = "";
			if (this._socket) if (socket.localPort === this._socket.localPort) this._removeSocketListeners(this.socket);
			else this._closeControlSocket();
			if (socket) {
				this._closingError = void 0;
				socket.setTimeout(0);
				socket.setEncoding(this._encoding);
				socket.setKeepAlive(true);
				socket.on("data", (data$1) => this._onControlSocketData(data$1));
				socket.on("end", () => this.closeWithError(/* @__PURE__ */ new Error("Server sent FIN packet unexpectedly, closing connection.")));
				socket.on("close", (hadError) => {
					if (!hadError) this.closeWithError(/* @__PURE__ */ new Error("Server closed connection unexpectedly."));
				});
				this._setupDefaultErrorHandlers(socket, "control socket");
			}
			this._socket = socket;
		}
		get dataSocket() {
			return this._dataSocket;
		}
		set dataSocket(socket) {
			this._closeSocket(this._dataSocket);
			if (socket) {
				socket.setTimeout(0);
				this._setupDefaultErrorHandlers(socket, "data socket");
			}
			this._dataSocket = socket;
		}
		get encoding() {
			return this._encoding;
		}
		set encoding(encoding) {
			this._encoding = encoding;
			if (this.socket) this.socket.setEncoding(encoding);
		}
		send(command) {
			const message = command.startsWith("PASS") ? "> PASS ###" : `> ${command}`;
			this.log(message);
			this._socket.write(command + "\r\n", this.encoding);
		}
		request(command) {
			return this.handle(command, (res, task) => {
				if (res instanceof Error) task.reject(res);
				else task.resolve(res);
			});
		}
		handle(command, responseHandler) {
			if (this._task) {
				const err = /* @__PURE__ */ new Error("User launched a task while another one is still running. Forgot to use 'await' or '.then()'?");
				err.stack += `\nRunning task launched at: ${this._task.stack}`;
				this.closeWithError(err);
			}
			return new Promise((resolveTask, rejectTask) => {
				this._task = {
					stack: (/* @__PURE__ */ new Error()).stack || "Unknown call stack",
					responseHandler,
					resolver: {
						resolve: (arg) => {
							this._stopTrackingTask();
							resolveTask(arg);
						},
						reject: (err) => {
							this._stopTrackingTask();
							rejectTask(err);
						}
					}
				};
				if (this._closingError) {
					const err = /* @__PURE__ */ new Error(`Client is closed because ${this._closingError.message}`);
					err.stack += `\nClosing reason: ${this._closingError.stack}`;
					err.code = this._closingError.code !== void 0 ? this._closingError.code : "0";
					this._passToHandler(err);
					return;
				}
				this.socket.setTimeout(this.timeout);
				if (command) this.send(command);
			});
		}
		log(message) {
			if (this.verbose) console.log(message);
		}
		get hasTLS() {
			return "encrypted" in this._socket;
		}
		_stopTrackingTask() {
			this.socket.setTimeout(0);
			this._task = void 0;
		}
		_onControlSocketData(chunk) {
			this.log(`< ${chunk}`);
			const completeResponse = this._partialResponse + chunk;
			const parsed = (0, parseControlResponse_1$2.parseControlResponse)(completeResponse);
			this._partialResponse = parsed.rest;
			for (const message of parsed.messages) {
				const code = parseInt(message.substr(0, 3), 10);
				const response = {
					code,
					message
				};
				const err = code >= 400 ? new FTPError(response) : void 0;
				this._passToHandler(err ? err : response);
			}
		}
		_passToHandler(response) {
			if (this._task) this._task.responseHandler(response, this._task.resolver);
		}
		_setupDefaultErrorHandlers(socket, identifier) {
			socket.once("error", (error) => {
				error.message += ` (${identifier})`;
				this.closeWithError(error);
			});
			socket.once("close", (hadError) => {
				if (hadError) this.closeWithError(/* @__PURE__ */ new Error(`Socket closed due to transmission error (${identifier})`));
			});
			socket.once("timeout", () => {
				socket.destroy();
				this.closeWithError(/* @__PURE__ */ new Error(`Timeout (${identifier})`));
			});
		}
		_closeControlSocket() {
			this._removeSocketListeners(this._socket);
			this._socket.on("error", doNothing);
			this.send("QUIT");
			this._closeSocket(this._socket);
		}
		_closeSocket(socket) {
			if (socket) {
				this._removeSocketListeners(socket);
				socket.on("error", doNothing);
				socket.destroy();
			}
		}
		_removeSocketListeners(socket) {
			socket.removeAllListeners();
			socket.removeAllListeners("timeout");
			socket.removeAllListeners("data");
			socket.removeAllListeners("end");
			socket.removeAllListeners("error");
			socket.removeAllListeners("close");
			socket.removeAllListeners("connect");
		}
		_newSocket() {
			return new net_1$1.Socket();
		}
	};
	exports.FTPContext = FTPContext;
}));
var require_FileInfo = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.FileInfo = exports.FileType = void 0;
	var FileType;
	(function(FileType$1) {
		FileType$1[FileType$1["Unknown"] = 0] = "Unknown";
		FileType$1[FileType$1["File"] = 1] = "File";
		FileType$1[FileType$1["Directory"] = 2] = "Directory";
		FileType$1[FileType$1["SymbolicLink"] = 3] = "SymbolicLink";
	})(FileType || (exports.FileType = FileType = {}));
	var FileInfo = class {
		constructor(name$1) {
			this.name = name$1;
			this.type = FileType.Unknown;
			this.size = 0;
			this.rawModifiedAt = "";
			this.modifiedAt = void 0;
			this.permissions = void 0;
			this.hardLinkCount = void 0;
			this.link = void 0;
			this.group = void 0;
			this.user = void 0;
			this.uniqueID = void 0;
			this.name = name$1;
		}
		get isDirectory() {
			return this.type === FileType.Directory;
		}
		get isSymbolicLink() {
			return this.type === FileType.SymbolicLink;
		}
		get isFile() {
			return this.type === FileType.File;
		}
		get date() {
			return this.rawModifiedAt;
		}
		set date(rawModifiedAt) {
			this.rawModifiedAt = rawModifiedAt;
		}
	};
	exports.FileInfo = FileInfo;
	FileInfo.UnixPermission = {
		Read: 4,
		Write: 2,
		Execute: 1
	};
}));
var require_parseListDOS = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.testLine = testLine$2;
	exports.parseLine = parseLine$2;
	exports.transformList = transformList$2;
	var FileInfo_1$2 = require_FileInfo();
	var RE_LINE$1 = /* @__PURE__ */ new RegExp("(\\S+)\\s+(\\S+)\\s+(?:(<DIR>)|([0-9]+))\\s+(\\S.*)");
	function testLine$2(line) {
		return /^\d{2}/.test(line) && RE_LINE$1.test(line);
	}
	function parseLine$2(line) {
		const groups = line.match(RE_LINE$1);
		if (groups === null) return;
		const name$1 = groups[5];
		if (name$1 === "." || name$1 === "..") return;
		const file$1 = new FileInfo_1$2.FileInfo(name$1);
		if (groups[3] === "<DIR>") {
			file$1.type = FileInfo_1$2.FileType.Directory;
			file$1.size = 0;
		} else {
			file$1.type = FileInfo_1$2.FileType.File;
			file$1.size = parseInt(groups[4], 10);
		}
		file$1.rawModifiedAt = groups[1] + " " + groups[2];
		return file$1;
	}
	function transformList$2(files$1) {
		return files$1;
	}
}));
var require_parseListUnix = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.testLine = testLine$1;
	exports.parseLine = parseLine$1;
	exports.transformList = transformList$1;
	var FileInfo_1$1 = require_FileInfo();
	var RE_LINE = /* @__PURE__ */ new RegExp("([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+)*?)\\s+)?(?:(\\S+(?:\\s\\S+)*)\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}月\\s+\\d{1,2}日))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}年))\\s(.*)");
	function testLine$1(line) {
		return RE_LINE.test(line);
	}
	function parseLine$1(line) {
		const groups = line.match(RE_LINE);
		if (groups === null) return;
		const name$1 = groups[21];
		if (name$1 === "." || name$1 === "..") return;
		const file$1 = new FileInfo_1$1.FileInfo(name$1);
		file$1.size = parseInt(groups[18], 10);
		file$1.user = groups[16];
		file$1.group = groups[17];
		file$1.hardLinkCount = parseInt(groups[15], 10);
		file$1.rawModifiedAt = groups[19] + " " + groups[20];
		file$1.permissions = {
			user: parseMode(groups[4], groups[5], groups[6]),
			group: parseMode(groups[8], groups[9], groups[10]),
			world: parseMode(groups[12], groups[13], groups[14])
		};
		switch (groups[1].charAt(0)) {
			case "d":
				file$1.type = FileInfo_1$1.FileType.Directory;
				break;
			case "e":
				file$1.type = FileInfo_1$1.FileType.SymbolicLink;
				break;
			case "l":
				file$1.type = FileInfo_1$1.FileType.SymbolicLink;
				break;
			case "b":
			case "c":
				file$1.type = FileInfo_1$1.FileType.File;
				break;
			case "f":
			case "-":
				file$1.type = FileInfo_1$1.FileType.File;
				break;
			default: file$1.type = FileInfo_1$1.FileType.Unknown;
		}
		if (file$1.isSymbolicLink) {
			const end = name$1.indexOf(" -> ");
			if (end !== -1) {
				file$1.name = name$1.substring(0, end);
				file$1.link = name$1.substring(end + 4);
			}
		}
		return file$1;
	}
	function transformList$1(files$1) {
		return files$1;
	}
	function parseMode(r, w$1, x) {
		let value = 0;
		if (r !== "-") value += FileInfo_1$1.FileInfo.UnixPermission.Read;
		if (w$1 !== "-") value += FileInfo_1$1.FileInfo.UnixPermission.Write;
		const execToken = x.charAt(0);
		if (execToken !== "-" && execToken.toUpperCase() !== execToken) value += FileInfo_1$1.FileInfo.UnixPermission.Execute;
		return value;
	}
}));
var require_parseListMLSD = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.testLine = testLine;
	exports.parseLine = parseLine;
	exports.transformList = transformList;
	exports.parseMLSxDate = parseMLSxDate;
	var FileInfo_1 = require_FileInfo();
	function parseSize(value, info) {
		info.size = parseInt(value, 10);
	}
	var factHandlersByName = {
		"size": parseSize,
		"sizd": parseSize,
		"unique": (value, info) => {
			info.uniqueID = value;
		},
		"modify": (value, info) => {
			info.modifiedAt = parseMLSxDate(value);
			info.rawModifiedAt = info.modifiedAt.toISOString();
		},
		"type": (value, info) => {
			if (value.startsWith("OS.unix=slink")) {
				info.type = FileInfo_1.FileType.SymbolicLink;
				info.link = value.substr(value.indexOf(":") + 1);
				return 1;
			}
			switch (value) {
				case "file":
					info.type = FileInfo_1.FileType.File;
					break;
				case "dir":
					info.type = FileInfo_1.FileType.Directory;
					break;
				case "OS.unix=symlink":
					info.type = FileInfo_1.FileType.SymbolicLink;
					break;
				case "cdir":
				case "pdir": return 2;
				default: info.type = FileInfo_1.FileType.Unknown;
			}
			return 1;
		},
		"unix.mode": (value, info) => {
			const digits = value.substr(-3);
			info.permissions = {
				user: parseInt(digits[0], 10),
				group: parseInt(digits[1], 10),
				world: parseInt(digits[2], 10)
			};
		},
		"unix.ownername": (value, info) => {
			info.user = value;
		},
		"unix.owner": (value, info) => {
			if (info.user === void 0) info.user = value;
		},
		get "unix.uid"() {
			return this["unix.owner"];
		},
		"unix.groupname": (value, info) => {
			info.group = value;
		},
		"unix.group": (value, info) => {
			if (info.group === void 0) info.group = value;
		},
		get "unix.gid"() {
			return this["unix.group"];
		}
	};
	function splitStringOnce(str, delimiter) {
		const pos = str.indexOf(delimiter);
		return [str.substr(0, pos), str.substr(pos + delimiter.length)];
	}
	function testLine(line) {
		return /^\S+=\S+;/.test(line) || line.startsWith(" ");
	}
	function parseLine(line) {
		const [packedFacts, name$1] = splitStringOnce(line, " ");
		if (name$1 === "" || name$1 === "." || name$1 === "..") return;
		const info = new FileInfo_1.FileInfo(name$1);
		const facts = packedFacts.split(";");
		for (const fact of facts) {
			const [factName, factValue] = splitStringOnce(fact, "=");
			if (!factValue) continue;
			const factHandler = factHandlersByName[factName.toLowerCase()];
			if (!factHandler) continue;
			if (factHandler(factValue, info) === 2) return;
		}
		return info;
	}
	function transformList(files$1) {
		const nonLinksByID = /* @__PURE__ */ new Map();
		for (const file$1 of files$1) if (!file$1.isSymbolicLink && file$1.uniqueID !== void 0) nonLinksByID.set(file$1.uniqueID, file$1);
		const resolvedFiles = [];
		for (const file$1 of files$1) {
			if (file$1.isSymbolicLink && file$1.uniqueID !== void 0 && file$1.link === void 0) {
				const target = nonLinksByID.get(file$1.uniqueID);
				if (target !== void 0) file$1.link = target.name;
			}
			if (!file$1.name.includes("/")) resolvedFiles.push(file$1);
		}
		return resolvedFiles;
	}
	function parseMLSxDate(fact) {
		return new Date(Date.UTC(+fact.slice(0, 4), +fact.slice(4, 6) - 1, +fact.slice(6, 8), +fact.slice(8, 10), +fact.slice(10, 12), +fact.slice(12, 14), +fact.slice(15, 18)));
	}
}));
var require_parseList = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$7 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$4 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$5 = exports && exports.__importStar || (function() {
		var ownKeys = function(o) {
			ownKeys = Object.getOwnPropertyNames || function(o$1) {
				var ar = [];
				for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
				return ar;
			};
			return ownKeys(o);
		};
		return function(mod) {
			if (mod && mod.__esModule) return mod;
			var result = {};
			if (mod != null) {
				for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$7(result, mod, k[i]);
			}
			__setModuleDefault$4(result, mod);
			return result;
		};
	})();
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.parseList = parseList;
	var availableParsers = [
		__importStar$5(require_parseListDOS()),
		__importStar$5(require_parseListUnix()),
		__importStar$5(require_parseListMLSD())
	];
	function firstCompatibleParser(line, parsers) {
		return parsers.find((parser) => parser.testLine(line) === true);
	}
	function isNotBlank(str) {
		return str.trim() !== "";
	}
	function isNotMeta(str) {
		return !str.startsWith("total");
	}
	var REGEX_NEWLINE$1 = /\r?\n/;
	function parseList(rawList) {
		const lines = rawList.split(REGEX_NEWLINE$1).filter(isNotBlank).filter(isNotMeta);
		if (lines.length === 0) return [];
		const testLine$3 = lines[lines.length - 1];
		const parser = firstCompatibleParser(testLine$3, availableParsers);
		if (!parser) throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details.");
		const files$1 = lines.map(parser.parseLine).filter((info) => info !== void 0);
		return parser.transformList(files$1);
	}
}));
var require_ProgressTracker = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ProgressTracker = void 0;
	var ProgressTracker = class {
		constructor() {
			this.bytesOverall = 0;
			this.intervalMs = 500;
			this.onStop = noop;
			this.onHandle = noop;
		}
		reportTo(onHandle = noop) {
			this.onHandle = onHandle;
		}
		start(socket, name$1, type) {
			let lastBytes = 0;
			this.onStop = poll(this.intervalMs, () => {
				const bytes = socket.bytesRead + socket.bytesWritten;
				this.bytesOverall += bytes - lastBytes;
				lastBytes = bytes;
				this.onHandle({
					name: name$1,
					type,
					bytes,
					bytesOverall: this.bytesOverall
				});
			});
		}
		stop() {
			this.onStop(false);
		}
		updateAndStop() {
			this.onStop(true);
		}
	};
	exports.ProgressTracker = ProgressTracker;
	function poll(intervalMs, updateFunc) {
		const id = setInterval(updateFunc, intervalMs);
		const stopFunc = (stopWithUpdate) => {
			clearInterval(id);
			if (stopWithUpdate) updateFunc();
			updateFunc = noop;
		};
		updateFunc();
		return stopFunc;
	}
	function noop() {}
}));
var require_StringWriter = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.StringWriter = void 0;
	var stream_1$2 = require("stream");
	var StringWriter = class extends stream_1$2.Writable {
		constructor() {
			super(...arguments);
			this.buf = Buffer.alloc(0);
		}
		_write(chunk, _, callback) {
			if (chunk instanceof Buffer) {
				this.buf = Buffer.concat([this.buf, chunk]);
				callback(null);
			} else callback(/* @__PURE__ */ new Error("StringWriter expects chunks of type 'Buffer'."));
		}
		getText(encoding) {
			return this.buf.toString(encoding);
		}
	};
	exports.StringWriter = StringWriter;
}));
var require_netUtils = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.describeTLS = describeTLS;
	exports.describeAddress = describeAddress;
	exports.upgradeSocket = upgradeSocket;
	exports.ipIsPrivateV4Address = ipIsPrivateV4Address;
	var tls_1$2 = require("tls");
	function describeTLS(socket) {
		if (socket instanceof tls_1$2.TLSSocket) {
			const protocol = socket.getProtocol();
			return protocol ? protocol : "Server socket or disconnected client socket";
		}
		return "No encryption";
	}
	function describeAddress(socket) {
		if (socket.remoteFamily === "IPv6") return `[${socket.remoteAddress}]:${socket.remotePort}`;
		return `${socket.remoteAddress}:${socket.remotePort}`;
	}
	function upgradeSocket(socket, options) {
		return new Promise((resolve, reject) => {
			const tlsOptions = Object.assign({}, options, { socket });
			const tlsSocket = (0, tls_1$2.connect)(tlsOptions, () => {
				if (tlsOptions.rejectUnauthorized !== false && !tlsSocket.authorized) reject(tlsSocket.authorizationError);
				else {
					tlsSocket.removeAllListeners("error");
					resolve(tlsSocket);
				}
			}).once("error", (error) => {
				reject(error);
			});
		});
	}
	function ipIsPrivateV4Address(ip = "") {
		if (ip.startsWith("::ffff:")) ip = ip.substr(7);
		const octets = ip.split(".").map((o) => parseInt(o, 10));
		return octets[0] === 10 || octets[0] === 172 && octets[1] >= 16 && octets[1] <= 31 || octets[0] === 192 && octets[1] === 168 || ip === "127.0.0.1";
	}
}));
var require_transfer = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.enterPassiveModeIPv6 = enterPassiveModeIPv6;
	exports.parseEpsvResponse = parseEpsvResponse;
	exports.enterPassiveModeIPv4 = enterPassiveModeIPv4;
	exports.enterPassiveModeIPv4_forceControlHostIP = enterPassiveModeIPv4_forceControlHostIP;
	exports.parsePasvResponse = parsePasvResponse;
	exports.connectForPassiveTransfer = connectForPassiveTransfer;
	exports.uploadFrom = uploadFrom;
	exports.downloadTo = downloadTo;
	var netUtils_1$1 = require_netUtils();
	var stream_1$1 = require("stream");
	var tls_1$1 = require("tls");
	var parseControlResponse_1$1 = require_parseControlResponse();
	async function enterPassiveModeIPv6(ftp$1) {
		const res = await ftp$1.request("EPSV");
		const port = parseEpsvResponse(res.message);
		if (!port) throw new Error("Can't parse EPSV response: " + res.message);
		const controlHost = ftp$1.socket.remoteAddress;
		if (controlHost === void 0) throw new Error("Control socket is disconnected, can't get remote address.");
		await connectForPassiveTransfer(controlHost, port, ftp$1);
		return res;
	}
	function parseEpsvResponse(message) {
		const groups = message.match(/[|!]{3}(.+)[|!]/);
		if (groups === null || groups[1] === void 0) throw new Error(`Can't parse response to 'EPSV': ${message}`);
		const port = parseInt(groups[1], 10);
		if (Number.isNaN(port)) throw new Error(`Can't parse response to 'EPSV', port is not a number: ${message}`);
		return port;
	}
	async function enterPassiveModeIPv4(ftp$1) {
		const res = await ftp$1.request("PASV");
		const target = parsePasvResponse(res.message);
		if (!target) throw new Error("Can't parse PASV response: " + res.message);
		const controlHost = ftp$1.socket.remoteAddress;
		if ((0, netUtils_1$1.ipIsPrivateV4Address)(target.host) && controlHost && !(0, netUtils_1$1.ipIsPrivateV4Address)(controlHost)) target.host = controlHost;
		await connectForPassiveTransfer(target.host, target.port, ftp$1);
		return res;
	}
	async function enterPassiveModeIPv4_forceControlHostIP(ftp$1) {
		const res = await ftp$1.request("PASV");
		const target = parsePasvResponse(res.message);
		if (!target) throw new Error("Can't parse PASV response: " + res.message);
		const controlHost = ftp$1.socket.remoteAddress;
		if (controlHost === void 0) throw new Error("Control socket is disconnected, can't get remote address.");
		await connectForPassiveTransfer(controlHost, target.port, ftp$1);
		return res;
	}
	function parsePasvResponse(message) {
		const groups = message.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/);
		if (groups === null || groups.length !== 4) throw new Error(`Can't parse response to 'PASV': ${message}`);
		return {
			host: groups[1].replace(/,/g, "."),
			port: (parseInt(groups[2], 10) & 255) * 256 + (parseInt(groups[3], 10) & 255)
		};
	}
	function connectForPassiveTransfer(host, port, ftp$1) {
		return new Promise((resolve, reject) => {
			let socket = ftp$1._newSocket();
			const handleConnErr = function(err) {
				err.message = "Can't open data connection in passive mode: " + err.message;
				reject(err);
			};
			const handleTimeout = function() {
				socket.destroy();
				reject(/* @__PURE__ */ new Error(`Timeout when trying to open data connection to ${host}:${port}`));
			};
			socket.setTimeout(ftp$1.timeout);
			socket.on("error", handleConnErr);
			socket.on("timeout", handleTimeout);
			socket.connect({
				port,
				host,
				family: ftp$1.ipFamily
			}, () => {
				if (ftp$1.socket instanceof tls_1$1.TLSSocket) socket = (0, tls_1$1.connect)(Object.assign({}, ftp$1.tlsOptions, {
					socket,
					session: ftp$1.socket.getSession()
				}));
				socket.removeListener("error", handleConnErr);
				socket.removeListener("timeout", handleTimeout);
				ftp$1.dataSocket = socket;
				resolve();
			});
		});
	}
	var TransferResolver = class {
		constructor(ftp$1, progress) {
			this.ftp = ftp$1;
			this.progress = progress;
			this.response = void 0;
			this.dataTransferDone = false;
		}
		onDataStart(name$1, type) {
			if (this.ftp.dataSocket === void 0) throw new Error("Data transfer should start but there is no data connection.");
			this.ftp.socket.setTimeout(0);
			this.ftp.dataSocket.setTimeout(this.ftp.timeout);
			this.progress.start(this.ftp.dataSocket, name$1, type);
		}
		onDataDone(task) {
			this.progress.updateAndStop();
			this.ftp.socket.setTimeout(this.ftp.timeout);
			if (this.ftp.dataSocket) this.ftp.dataSocket.setTimeout(0);
			this.dataTransferDone = true;
			this.tryResolve(task);
		}
		onControlDone(task, response) {
			this.response = response;
			this.tryResolve(task);
		}
		onError(task, err) {
			this.progress.updateAndStop();
			this.ftp.socket.setTimeout(this.ftp.timeout);
			this.ftp.dataSocket = void 0;
			task.reject(err);
		}
		onUnexpectedRequest(response) {
			const err = /* @__PURE__ */ new Error(`Unexpected FTP response is requesting an answer: ${response.message}`);
			this.ftp.closeWithError(err);
		}
		tryResolve(task) {
			if (this.dataTransferDone && this.response !== void 0) {
				this.ftp.dataSocket = void 0;
				task.resolve(this.response);
			}
		}
	};
	function uploadFrom(source, config) {
		const resolver = new TransferResolver(config.ftp, config.tracker);
		const fullCommand = `${config.command} ${config.remotePath}`;
		return config.ftp.handle(fullCommand, (res, task) => {
			if (res instanceof Error) resolver.onError(task, res);
			else if (res.code === 150 || res.code === 125) {
				const dataSocket = config.ftp.dataSocket;
				if (!dataSocket) {
					resolver.onError(task, /* @__PURE__ */ new Error("Upload should begin but no data connection is available."));
					return;
				}
				onConditionOrEvent("getCipher" in dataSocket ? dataSocket.getCipher() !== void 0 : true, dataSocket, "secureConnect", () => {
					config.ftp.log(`Uploading to ${(0, netUtils_1$1.describeAddress)(dataSocket)} (${(0, netUtils_1$1.describeTLS)(dataSocket)})`);
					resolver.onDataStart(config.remotePath, config.type);
					(0, stream_1$1.pipeline)(source, dataSocket, (err) => {
						if (err) resolver.onError(task, err);
						else resolver.onDataDone(task);
					});
				});
			} else if ((0, parseControlResponse_1$1.positiveCompletion)(res.code)) resolver.onControlDone(task, res);
			else if ((0, parseControlResponse_1$1.positiveIntermediate)(res.code)) resolver.onUnexpectedRequest(res);
		});
	}
	function downloadTo(destination, config) {
		if (!config.ftp.dataSocket) throw new Error("Download will be initiated but no data connection is available.");
		const resolver = new TransferResolver(config.ftp, config.tracker);
		return config.ftp.handle(config.command, (res, task) => {
			if (res instanceof Error) resolver.onError(task, res);
			else if (res.code === 150 || res.code === 125) {
				const dataSocket = config.ftp.dataSocket;
				if (!dataSocket) {
					resolver.onError(task, /* @__PURE__ */ new Error("Download should begin but no data connection is available."));
					return;
				}
				config.ftp.log(`Downloading from ${(0, netUtils_1$1.describeAddress)(dataSocket)} (${(0, netUtils_1$1.describeTLS)(dataSocket)})`);
				resolver.onDataStart(config.remotePath, config.type);
				(0, stream_1$1.pipeline)(dataSocket, destination, (err) => {
					if (err) resolver.onError(task, err);
					else resolver.onDataDone(task);
				});
			} else if (res.code === 350) config.ftp.send("RETR " + config.remotePath);
			else if ((0, parseControlResponse_1$1.positiveCompletion)(res.code)) resolver.onControlDone(task, res);
			else if ((0, parseControlResponse_1$1.positiveIntermediate)(res.code)) resolver.onUnexpectedRequest(res);
		});
	}
	function onConditionOrEvent(condition, emitter, eventName, action) {
		if (condition === true) action();
		else emitter.once(eventName, () => action());
	}
}));
var require_Client = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Client = void 0;
	var fs_1 = require("fs");
	var path_1$3 = require("path");
	var tls_1 = require("tls");
	var util_1$6 = require("util");
	var FtpContext_1 = require_FtpContext();
	var parseList_1 = require_parseList();
	var ProgressTracker_1 = require_ProgressTracker();
	var StringWriter_1 = require_StringWriter();
	var parseListMLSD_1 = require_parseListMLSD();
	var netUtils_1 = require_netUtils();
	var transfer_1$1 = require_transfer();
	var parseControlResponse_1 = require_parseControlResponse();
	var fsReadDir = (0, util_1$6.promisify)(fs_1.readdir);
	var fsMkDir = (0, util_1$6.promisify)(fs_1.mkdir);
	var fsStat = (0, util_1$6.promisify)(fs_1.stat);
	var fsOpen = (0, util_1$6.promisify)(fs_1.open);
	var fsClose = (0, util_1$6.promisify)(fs_1.close);
	var fsUnlink = (0, util_1$6.promisify)(fs_1.unlink);
	var defaultClientOptions = { allowSeparateTransferHost: true };
	var LIST_COMMANDS_DEFAULT = () => ["LIST -a", "LIST"];
	var LIST_COMMANDS_MLSD = () => [
		"MLSD",
		"LIST -a",
		"LIST"
	];
	var Client = class {
		constructor(timeout = 3e4, options = defaultClientOptions) {
			this.availableListCommands = LIST_COMMANDS_DEFAULT();
			this.ftp = new FtpContext_1.FTPContext(timeout);
			this.prepareTransfer = this._enterFirstCompatibleMode([transfer_1$1.enterPassiveModeIPv6, options.allowSeparateTransferHost ? transfer_1$1.enterPassiveModeIPv4 : transfer_1$1.enterPassiveModeIPv4_forceControlHostIP]);
			this.parseList = parseList_1.parseList;
			this._progressTracker = new ProgressTracker_1.ProgressTracker();
		}
		close() {
			this.ftp.close();
			this._progressTracker.stop();
		}
		get closed() {
			return this.ftp.closed;
		}
		connect(host = "localhost", port = 21) {
			this.ftp.reset();
			this.ftp.socket.connect({
				host,
				port,
				family: this.ftp.ipFamily
			}, () => this.ftp.log(`Connected to ${(0, netUtils_1.describeAddress)(this.ftp.socket)} (${(0, netUtils_1.describeTLS)(this.ftp.socket)})`));
			return this._handleConnectResponse();
		}
		connectImplicitTLS(host = "localhost", port = 21, tlsOptions = {}) {
			this.ftp.reset();
			this.ftp.socket = (0, tls_1.connect)(port, host, tlsOptions, () => this.ftp.log(`Connected to ${(0, netUtils_1.describeAddress)(this.ftp.socket)} (${(0, netUtils_1.describeTLS)(this.ftp.socket)})`));
			this.ftp.tlsOptions = tlsOptions;
			return this._handleConnectResponse();
		}
		_handleConnectResponse() {
			return this.ftp.handle(void 0, (res, task) => {
				if (res instanceof Error) task.reject(res);
				else if ((0, parseControlResponse_1.positiveCompletion)(res.code)) task.resolve(res);
				else task.reject(new FtpContext_1.FTPError(res));
			});
		}
		send(command, ignoreErrorCodesDEPRECATED = false) {
			if (ignoreErrorCodesDEPRECATED) {
				this.ftp.log("Deprecated call using send(command, flag) with boolean flag to ignore errors. Use sendIgnoringError(command).");
				return this.sendIgnoringError(command);
			}
			return this.ftp.request(command);
		}
		sendIgnoringError(command) {
			return this.ftp.handle(command, (res, task) => {
				if (res instanceof FtpContext_1.FTPError) task.resolve({
					code: res.code,
					message: res.message
				});
				else if (res instanceof Error) task.reject(res);
				else task.resolve(res);
			});
		}
		async useTLS(options = {}, command = "AUTH TLS") {
			const ret = await this.send(command);
			this.ftp.socket = await (0, netUtils_1.upgradeSocket)(this.ftp.socket, options);
			this.ftp.tlsOptions = options;
			this.ftp.log(`Control socket is using: ${(0, netUtils_1.describeTLS)(this.ftp.socket)}`);
			return ret;
		}
		login(user = "anonymous", password = "guest") {
			this.ftp.log(`Login security: ${(0, netUtils_1.describeTLS)(this.ftp.socket)}`);
			return this.ftp.handle("USER " + user, (res, task) => {
				if (res instanceof Error) task.reject(res);
				else if ((0, parseControlResponse_1.positiveCompletion)(res.code)) task.resolve(res);
				else if (res.code === 331) this.ftp.send("PASS " + password);
				else task.reject(new FtpContext_1.FTPError(res));
			});
		}
		async useDefaultSettings() {
			const supportsMLSD = (await this.features()).has("MLST");
			this.availableListCommands = supportsMLSD ? LIST_COMMANDS_MLSD() : LIST_COMMANDS_DEFAULT();
			await this.send("TYPE I");
			await this.sendIgnoringError("STRU F");
			await this.sendIgnoringError("OPTS UTF8 ON");
			if (supportsMLSD) await this.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;");
			if (this.ftp.hasTLS) {
				await this.sendIgnoringError("PBSZ 0");
				await this.sendIgnoringError("PROT P");
			}
		}
		async access(options = {}) {
			var _a$1, _b;
			const useExplicitTLS = options.secure === true;
			const useImplicitTLS = options.secure === "implicit";
			let welcome;
			if (useImplicitTLS) welcome = await this.connectImplicitTLS(options.host, options.port, options.secureOptions);
			else welcome = await this.connect(options.host, options.port);
			if (useExplicitTLS) {
				const secureOptions = (_a$1 = options.secureOptions) !== null && _a$1 !== void 0 ? _a$1 : {};
				secureOptions.host = (_b = secureOptions.host) !== null && _b !== void 0 ? _b : options.host;
				await this.useTLS(secureOptions);
			}
			await this.sendIgnoringError("OPTS UTF8 ON");
			await this.login(options.user, options.password);
			await this.useDefaultSettings();
			return welcome;
		}
		async pwd() {
			const res = await this.send("PWD");
			const parsed = res.message.match(/"(.+)"/);
			if (parsed === null || parsed[1] === void 0) throw new Error(`Can't parse response to command 'PWD': ${res.message}`);
			return parsed[1];
		}
		async features() {
			const res = await this.sendIgnoringError("FEAT");
			const features = /* @__PURE__ */ new Map();
			if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) res.message.split("\n").slice(1, -1).forEach((line) => {
				const entry = line.trim().split(" ");
				features.set(entry[0], entry[1] || "");
			});
			return features;
		}
		async cd(path$1) {
			const validPath = await this.protectWhitespace(path$1);
			return this.send("CWD " + validPath);
		}
		async cdup() {
			return this.send("CDUP");
		}
		async lastMod(path$1) {
			const validPath = await this.protectWhitespace(path$1);
			const date = (await this.send(`MDTM ${validPath}`)).message.slice(4);
			return (0, parseListMLSD_1.parseMLSxDate)(date);
		}
		async size(path$1) {
			const command = `SIZE ${await this.protectWhitespace(path$1)}`;
			const res = await this.send(command);
			const size = parseInt(res.message.slice(4), 10);
			if (Number.isNaN(size)) throw new Error(`Can't parse response to command '${command}' as a numerical value: ${res.message}`);
			return size;
		}
		async rename(srcPath, destPath) {
			const validSrc = await this.protectWhitespace(srcPath);
			const validDest = await this.protectWhitespace(destPath);
			await this.send("RNFR " + validSrc);
			return this.send("RNTO " + validDest);
		}
		async remove(path$1, ignoreErrorCodes = false) {
			const validPath = await this.protectWhitespace(path$1);
			if (ignoreErrorCodes) return this.sendIgnoringError(`DELE ${validPath}`);
			return this.send(`DELE ${validPath}`);
		}
		trackProgress(handler) {
			this._progressTracker.bytesOverall = 0;
			this._progressTracker.reportTo(handler);
		}
		async uploadFrom(source, toRemotePath, options = {}) {
			return this._uploadWithCommand(source, toRemotePath, "STOR", options);
		}
		async appendFrom(source, toRemotePath, options = {}) {
			return this._uploadWithCommand(source, toRemotePath, "APPE", options);
		}
		async _uploadWithCommand(source, remotePath, command, options) {
			if (typeof source === "string") return this._uploadLocalFile(source, remotePath, command, options);
			return this._uploadFromStream(source, remotePath, command);
		}
		async _uploadLocalFile(localPath, remotePath, command, options) {
			const fd = await fsOpen(localPath, "r");
			const source = (0, fs_1.createReadStream)("", {
				fd,
				start: options.localStart,
				end: options.localEndInclusive,
				autoClose: false
			});
			try {
				return await this._uploadFromStream(source, remotePath, command);
			} finally {
				await ignoreError(() => fsClose(fd));
			}
		}
		async _uploadFromStream(source, remotePath, command) {
			const onError$1 = (err) => this.ftp.closeWithError(err);
			source.once("error", onError$1);
			try {
				const validPath = await this.protectWhitespace(remotePath);
				await this.prepareTransfer(this.ftp);
				return await (0, transfer_1$1.uploadFrom)(source, {
					ftp: this.ftp,
					tracker: this._progressTracker,
					command,
					remotePath: validPath,
					type: "upload"
				});
			} finally {
				source.removeListener("error", onError$1);
			}
		}
		async downloadTo(destination, fromRemotePath, startAt = 0) {
			if (typeof destination === "string") return this._downloadToFile(destination, fromRemotePath, startAt);
			return this._downloadToStream(destination, fromRemotePath, startAt);
		}
		async _downloadToFile(localPath, remotePath, startAt) {
			const appendingToLocalFile = startAt > 0;
			const fd = await fsOpen(localPath, appendingToLocalFile ? "r+" : "w");
			const destination = (0, fs_1.createWriteStream)("", {
				fd,
				start: startAt,
				autoClose: false
			});
			try {
				return await this._downloadToStream(destination, remotePath, startAt);
			} catch (err) {
				const localFileStats = await ignoreError(() => fsStat(localPath));
				const hasDownloadedData = localFileStats && localFileStats.size > 0;
				if (!appendingToLocalFile && !hasDownloadedData) await ignoreError(() => fsUnlink(localPath));
				throw err;
			} finally {
				await ignoreError(() => fsClose(fd));
			}
		}
		async _downloadToStream(destination, remotePath, startAt) {
			const onError$1 = (err) => this.ftp.closeWithError(err);
			destination.once("error", onError$1);
			try {
				const validPath = await this.protectWhitespace(remotePath);
				await this.prepareTransfer(this.ftp);
				return await (0, transfer_1$1.downloadTo)(destination, {
					ftp: this.ftp,
					tracker: this._progressTracker,
					command: startAt > 0 ? `REST ${startAt}` : `RETR ${validPath}`,
					remotePath: validPath,
					type: "download"
				});
			} finally {
				destination.removeListener("error", onError$1);
				destination.end();
			}
		}
		async list(path$1 = "") {
			const validPath = await this.protectWhitespace(path$1);
			let lastError;
			for (const candidate of this.availableListCommands) {
				const command = validPath === "" ? candidate : `${candidate} ${validPath}`;
				await this.prepareTransfer(this.ftp);
				try {
					const parsedList = await this._requestListWithCommand(command);
					this.availableListCommands = [candidate];
					return parsedList;
				} catch (err) {
					if (!(err instanceof FtpContext_1.FTPError)) throw err;
					lastError = err;
				}
			}
			throw lastError;
		}
		async _requestListWithCommand(command) {
			const buffer$1 = new StringWriter_1.StringWriter();
			await (0, transfer_1$1.downloadTo)(buffer$1, {
				ftp: this.ftp,
				tracker: this._progressTracker,
				command,
				remotePath: "",
				type: "list"
			});
			const text = buffer$1.getText(this.ftp.encoding);
			this.ftp.log(text);
			return this.parseList(text);
		}
		async removeDir(remoteDirPath) {
			return this._exitAtCurrentDirectory(async () => {
				await this.cd(remoteDirPath);
				const absoluteDirPath = await this.pwd();
				await this.clearWorkingDir();
				if (!(absoluteDirPath === "/")) {
					await this.cdup();
					await this.removeEmptyDir(absoluteDirPath);
				}
			});
		}
		async clearWorkingDir() {
			for (const file$1 of await this.list()) if (file$1.isDirectory) {
				await this.cd(file$1.name);
				await this.clearWorkingDir();
				await this.cdup();
				await this.removeEmptyDir(file$1.name);
			} else await this.remove(file$1.name);
		}
		async uploadFromDir(localDirPath, remoteDirPath) {
			return this._exitAtCurrentDirectory(async () => {
				if (remoteDirPath) await this.ensureDir(remoteDirPath);
				return await this._uploadToWorkingDir(localDirPath);
			});
		}
		async _uploadToWorkingDir(localDirPath) {
			const files$1 = await fsReadDir(localDirPath);
			for (const file$1 of files$1) {
				const fullPath = (0, path_1$3.join)(localDirPath, file$1);
				const stats = await fsStat(fullPath);
				if (stats.isFile()) await this.uploadFrom(fullPath, file$1);
				else if (stats.isDirectory()) {
					await this._openDir(file$1);
					await this._uploadToWorkingDir(fullPath);
					await this.cdup();
				}
			}
		}
		async downloadToDir(localDirPath, remoteDirPath) {
			return this._exitAtCurrentDirectory(async () => {
				if (remoteDirPath) await this.cd(remoteDirPath);
				return await this._downloadFromWorkingDir(localDirPath);
			});
		}
		async _downloadFromWorkingDir(localDirPath) {
			await ensureLocalDirectory(localDirPath);
			for (const file$1 of await this.list()) {
				if (!file$1.name || (0, path_1$3.basename)(file$1.name) !== file$1.name) {
					const safeName = JSON.stringify(file$1.name);
					this.ftp.log(`Invalid filename from server listing, will skip file. (${safeName})`);
					continue;
				}
				const localPath = (0, path_1$3.join)(localDirPath, file$1.name);
				if (file$1.isDirectory) {
					await this.cd(file$1.name);
					await this._downloadFromWorkingDir(localPath);
					await this.cdup();
				} else if (file$1.isFile) await this.downloadTo(localPath, file$1.name);
			}
		}
		async ensureDir(remoteDirPath) {
			if (remoteDirPath.startsWith("/")) await this.cd("/");
			const names = remoteDirPath.split("/").filter((name$1) => name$1 !== "");
			for (const name$1 of names) await this._openDir(name$1);
		}
		async _openDir(dirName) {
			await this.sendIgnoringError("MKD " + dirName);
			await this.cd(dirName);
		}
		async removeEmptyDir(path$1) {
			const validPath = await this.protectWhitespace(path$1);
			return this.send(`RMD ${validPath}`);
		}
		async protectWhitespace(path$1) {
			if (!path$1.startsWith(" ")) return path$1;
			const pwd = await this.pwd();
			return (pwd.endsWith("/") ? pwd : pwd + "/") + path$1;
		}
		async _exitAtCurrentDirectory(func) {
			const userDir = await this.pwd();
			try {
				return await func();
			} finally {
				if (!this.closed) await ignoreError(() => this.cd(userDir));
			}
		}
		_enterFirstCompatibleMode(strategies) {
			return async (ftp$1) => {
				ftp$1.log("Trying to find optimal transfer strategy...");
				let lastError = void 0;
				for (const strategy of strategies) try {
					const res = await strategy(ftp$1);
					ftp$1.log("Optimal transfer strategy found.");
					this.prepareTransfer = strategy;
					return res;
				} catch (err) {
					lastError = err;
				}
				throw new Error(`None of the available transfer strategies work. Last error response was '${lastError}'.`);
			};
		}
		async upload(source, toRemotePath, options = {}) {
			this.ftp.log("Warning: upload() has been deprecated, use uploadFrom().");
			return this.uploadFrom(source, toRemotePath, options);
		}
		async append(source, toRemotePath, options = {}) {
			this.ftp.log("Warning: append() has been deprecated, use appendFrom().");
			return this.appendFrom(source, toRemotePath, options);
		}
		async download(destination, fromRemotePath, startAt = 0) {
			this.ftp.log("Warning: download() has been deprecated, use downloadTo().");
			return this.downloadTo(destination, fromRemotePath, startAt);
		}
		async uploadDir(localDirPath, remoteDirPath) {
			this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir().");
			return this.uploadFromDir(localDirPath, remoteDirPath);
		}
		async downloadDir(localDirPath) {
			this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir().");
			return this.downloadToDir(localDirPath);
		}
	};
	exports.Client = Client;
	async function ensureLocalDirectory(path$1) {
		try {
			await fsStat(path$1);
		} catch (_a$1) {
			await fsMkDir(path$1, { recursive: true });
		}
	}
	async function ignoreError(func) {
		try {
			return await func();
		} catch (_a$1) {
			return;
		}
	}
}));
var require_StringEncoding = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
}));
var require_dist$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$6 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __exportStar$3 = exports && exports.__exportStar || function(m$1, exports$1) {
		for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding$6(exports$1, m$1, p);
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.enterPassiveModeIPv6 = exports.enterPassiveModeIPv4 = void 0;
	__exportStar$3(require_Client(), exports);
	__exportStar$3(require_FtpContext(), exports);
	__exportStar$3(require_FileInfo(), exports);
	__exportStar$3(require_parseList(), exports);
	__exportStar$3(require_StringEncoding(), exports);
	var transfer_1 = require_transfer();
	Object.defineProperty(exports, "enterPassiveModeIPv4", {
		enumerable: true,
		get: function() {
			return transfer_1.enterPassiveModeIPv4;
		}
	});
	Object.defineProperty(exports, "enterPassiveModeIPv6", {
		enumerable: true,
		get: function() {
			return transfer_1.enterPassiveModeIPv6;
		}
	});
}));
var require_ftp = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$9 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ftp = void 0;
	var basic_ftp_1 = require_dist$6();
	var stream_1 = require("stream");
	var path_1$2 = require("path");
	var debug_1$9 = __importDefault$9(require_src());
	var notfound_1$1 = __importDefault$9(require_notfound());
	var notmodified_1$1 = __importDefault$9(require_notmodified());
	var debug$4 = (0, debug_1$9.default)("get-uri:ftp");
	var ftp = async (url$3, opts = {}) => {
		const { cache } = opts;
		const filepath = decodeURIComponent(url$3.pathname);
		let lastModified;
		if (!filepath) throw new TypeError("No \"pathname\"!");
		const client = new basic_ftp_1.Client();
		try {
			const host = url$3.hostname || url$3.host || "localhost";
			const port = parseInt(url$3.port || "0", 10) || 21;
			const user = url$3.username ? decodeURIComponent(url$3.username) : void 0;
			const password = url$3.password ? decodeURIComponent(url$3.password) : void 0;
			await client.access({
				host,
				port,
				user,
				password,
				...opts
			});
			try {
				lastModified = await client.lastMod(filepath);
			} catch (err) {
				if (err.code === 550) throw new notfound_1$1.default();
			}
			if (!lastModified) {
				const list = await client.list((0, path_1$2.dirname)(filepath));
				const name$1 = (0, path_1$2.basename)(filepath);
				const entry = list.find((e) => e.name === name$1);
				if (entry) lastModified = entry.modifiedAt;
			}
			if (lastModified) {
				if (isNotModified$1()) throw new notmodified_1$1.default();
			} else throw new notfound_1$1.default();
			const stream$7 = new stream_1.PassThrough();
			const rs = stream$7;
			client.downloadTo(stream$7, filepath).then((result) => {
				debug$4(result.message);
				client.close();
			});
			rs.lastModified = lastModified;
			return rs;
		} catch (err) {
			client.close();
			throw err;
		}
		function isNotModified$1() {
			if (cache?.lastModified && lastModified) return +cache.lastModified === +lastModified;
			return false;
		}
	};
	exports.ftp = ftp;
}));
var require_http_error = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var http_1$3 = require("http");
	var HTTPError = class extends Error {
		constructor(statusCode, message = http_1$3.STATUS_CODES[statusCode]) {
			super(message);
			this.statusCode = statusCode;
			this.code = `E${String(message).toUpperCase().replace(/\s+/g, "")}`;
		}
	};
	exports.default = HTTPError;
}));
var require_http = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$8 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.http = void 0;
	var http_1$2 = __importDefault$8(require("http"));
	var https_1$2 = __importDefault$8(require("https"));
	var events_1$1 = require("events");
	var debug_1$8 = __importDefault$8(require_src());
	var http_error_1 = __importDefault$8(require_http_error());
	var notfound_1 = __importDefault$8(require_notfound());
	var notmodified_1 = __importDefault$8(require_notmodified());
	var debug$3 = (0, debug_1$8.default)("get-uri:http");
	var http$3 = async (url$3, opts = {}) => {
		debug$3("GET %o", url$3.href);
		const cache = getCache(url$3, opts.cache);
		if (cache && isFresh(cache) && typeof cache.statusCode === "number") {
			if ((cache.statusCode / 100 | 0) === 3 && cache.headers.location) {
				debug$3("cached redirect");
				throw new Error("TODO: implement cached redirects!");
			}
			throw new notmodified_1.default();
		}
		const maxRedirects = typeof opts.maxRedirects === "number" ? opts.maxRedirects : 5;
		debug$3("allowing %o max redirects", maxRedirects);
		let mod;
		if (opts.http) {
			mod = opts.http;
			debug$3("using secure `https` core module");
		} else {
			mod = http_1$2.default;
			debug$3("using `http` core module");
		}
		const options = { ...opts };
		if (cache) {
			if (!options.headers) options.headers = {};
			const lastModified = cache.headers["last-modified"];
			if (lastModified) {
				options.headers["If-Modified-Since"] = lastModified;
				debug$3("added \"If-Modified-Since\" request header: %o", lastModified);
			}
			const etag = cache.headers.etag;
			if (etag) {
				options.headers["If-None-Match"] = etag;
				debug$3("added \"If-None-Match\" request header: %o", etag);
			}
		}
		const req$1 = mod.get(url$3, options);
		const [res] = await (0, events_1$1.once)(req$1, "response");
		const code = res.statusCode || 0;
		res.date = Date.now();
		res.parsed = url$3;
		debug$3("got %o response status code", code);
		const type = code / 100 | 0;
		const location = res.headers.location;
		if (type === 3 && location) {
			if (!opts.redirects) opts.redirects = [];
			const redirects = opts.redirects;
			if (redirects.length < maxRedirects) {
				debug$3("got a \"redirect\" status code with Location: %o", location);
				res.resume();
				redirects.push(res);
				const newUri = new URL(location, url$3.href);
				debug$3("resolved redirect URL: %o", newUri.href);
				debug$3("%o more redirects allowed after this one", maxRedirects - redirects.length);
				if (newUri.protocol !== url$3.protocol) opts.http = newUri.protocol === "https:" ? https_1$2.default : void 0;
				return (0, exports.http)(newUri, opts);
			}
		}
		if (type !== 2) {
			res.resume();
			if (code === 304) throw new notmodified_1.default();
			else if (code === 404) throw new notfound_1.default();
			throw new http_error_1.default(code);
		}
		if (opts.redirects) res.redirects = opts.redirects;
		return res;
	};
	exports.http = http$3;
	function isFresh(cache) {
		let fresh = false;
		let expires = parseInt(cache.headers.expires || "", 10);
		const cacheControl = cache.headers["cache-control"];
		if (cacheControl) {
			debug$3("Cache-Control: %o", cacheControl);
			const parts = cacheControl.split(/,\s*?\b/);
			for (let i = 0; i < parts.length; i++) {
				const part = parts[i];
				const subparts = part.split("=");
				const name$1 = subparts[0];
				switch (name$1) {
					case "max-age":
						expires = (cache.date || 0) + parseInt(subparts[1], 10) * 1e3;
						fresh = Date.now() < expires;
						if (fresh) debug$3("cache is \"fresh\" due to previous %o Cache-Control param", part);
						return fresh;
					case "must-revalidate": break;
					case "no-cache":
					case "no-store":
						debug$3("cache is \"stale\" due to explicit %o Cache-Control param", name$1);
						return false;
					default: break;
				}
			}
		} else if (expires) {
			debug$3("Expires: %o", expires);
			fresh = Date.now() < expires;
			if (fresh) debug$3("cache is \"fresh\" due to previous Expires response header");
			return fresh;
		}
		return false;
	}
	function getCache(url$3, cache) {
		if (cache) {
			if (cache.parsed && cache.parsed.href === url$3.href) return cache;
			if (cache.redirects) for (let i = 0; i < cache.redirects.length; i++) {
				const c = getCache(url$3, cache.redirects[i]);
				if (c) return c;
			}
		}
		return null;
	}
}));
var require_https = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$7 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.https = void 0;
	var https_1$1 = __importDefault$7(require("https"));
	var http_1$1 = require_http();
	var https$3 = (url$3, opts) => {
		return (0, http_1$1.http)(url$3, {
			...opts,
			http: https_1$1.default
		});
	};
	exports.https = https$3;
}));
var require_dist$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$6 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.getUri = exports.isValidProtocol = exports.protocols = void 0;
	var debug_1$7 = __importDefault$6(require_src());
	var data_1 = require_data();
	var file_1 = require_file();
	var ftp_1 = require_ftp();
	var http_1 = require_http();
	var https_1 = require_https();
	var debug$2 = (0, debug_1$7.default)("get-uri");
	exports.protocols = {
		data: data_1.data,
		file: file_1.file,
		ftp: ftp_1.ftp,
		http: http_1.http,
		https: https_1.https
	};
	var VALID_PROTOCOLS = new Set(Object.keys(exports.protocols));
	function isValidProtocol$1(p) {
		return VALID_PROTOCOLS.has(p);
	}
	exports.isValidProtocol = isValidProtocol$1;
	async function getUri(uri, opts) {
		debug$2("getUri(%o)", uri);
		if (!uri) throw new TypeError("Must pass in a URI to \"getUri()\"");
		const url$3 = typeof uri === "string" ? new URL(uri) : uri;
		const protocol = url$3.protocol.replace(/:$/, "");
		if (!isValidProtocol$1(protocol)) throw new TypeError(`Unsupported protocol "${protocol}" specified in URI: "${uri}"`);
		const getter = exports.protocols[protocol];
		return getter(url$3, opts);
	}
	exports.getUri = getUri;
}));
var require_estraverse = /* @__PURE__ */ __commonJSMin(((exports) => {
	(function clone(exports$1) {
		"use strict";
		var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE;
		function deepCopy(obj) {
			var ret = {}, key, val;
			for (key in obj) if (obj.hasOwnProperty(key)) {
				val = obj[key];
				if (typeof val === "object" && val !== null) ret[key] = deepCopy(val);
				else ret[key] = val;
			}
			return ret;
		}
		function upperBound(array, func) {
			var diff, len = array.length, i = 0, current;
			while (len) {
				diff = len >>> 1;
				current = i + diff;
				if (func(array[current])) len = diff;
				else {
					i = current + 1;
					len -= diff + 1;
				}
			}
			return i;
		}
		Syntax = {
			AssignmentExpression: "AssignmentExpression",
			AssignmentPattern: "AssignmentPattern",
			ArrayExpression: "ArrayExpression",
			ArrayPattern: "ArrayPattern",
			ArrowFunctionExpression: "ArrowFunctionExpression",
			AwaitExpression: "AwaitExpression",
			BlockStatement: "BlockStatement",
			BinaryExpression: "BinaryExpression",
			BreakStatement: "BreakStatement",
			CallExpression: "CallExpression",
			CatchClause: "CatchClause",
			ChainExpression: "ChainExpression",
			ClassBody: "ClassBody",
			ClassDeclaration: "ClassDeclaration",
			ClassExpression: "ClassExpression",
			ComprehensionBlock: "ComprehensionBlock",
			ComprehensionExpression: "ComprehensionExpression",
			ConditionalExpression: "ConditionalExpression",
			ContinueStatement: "ContinueStatement",
			DebuggerStatement: "DebuggerStatement",
			DirectiveStatement: "DirectiveStatement",
			DoWhileStatement: "DoWhileStatement",
			EmptyStatement: "EmptyStatement",
			ExportAllDeclaration: "ExportAllDeclaration",
			ExportDefaultDeclaration: "ExportDefaultDeclaration",
			ExportNamedDeclaration: "ExportNamedDeclaration",
			ExportSpecifier: "ExportSpecifier",
			ExpressionStatement: "ExpressionStatement",
			ForStatement: "ForStatement",
			ForInStatement: "ForInStatement",
			ForOfStatement: "ForOfStatement",
			FunctionDeclaration: "FunctionDeclaration",
			FunctionExpression: "FunctionExpression",
			GeneratorExpression: "GeneratorExpression",
			Identifier: "Identifier",
			IfStatement: "IfStatement",
			ImportExpression: "ImportExpression",
			ImportDeclaration: "ImportDeclaration",
			ImportDefaultSpecifier: "ImportDefaultSpecifier",
			ImportNamespaceSpecifier: "ImportNamespaceSpecifier",
			ImportSpecifier: "ImportSpecifier",
			Literal: "Literal",
			LabeledStatement: "LabeledStatement",
			LogicalExpression: "LogicalExpression",
			MemberExpression: "MemberExpression",
			MetaProperty: "MetaProperty",
			MethodDefinition: "MethodDefinition",
			ModuleSpecifier: "ModuleSpecifier",
			NewExpression: "NewExpression",
			ObjectExpression: "ObjectExpression",
			ObjectPattern: "ObjectPattern",
			PrivateIdentifier: "PrivateIdentifier",
			Program: "Program",
			Property: "Property",
			PropertyDefinition: "PropertyDefinition",
			RestElement: "RestElement",
			ReturnStatement: "ReturnStatement",
			SequenceExpression: "SequenceExpression",
			SpreadElement: "SpreadElement",
			Super: "Super",
			SwitchStatement: "SwitchStatement",
			SwitchCase: "SwitchCase",
			TaggedTemplateExpression: "TaggedTemplateExpression",
			TemplateElement: "TemplateElement",
			TemplateLiteral: "TemplateLiteral",
			ThisExpression: "ThisExpression",
			ThrowStatement: "ThrowStatement",
			TryStatement: "TryStatement",
			UnaryExpression: "UnaryExpression",
			UpdateExpression: "UpdateExpression",
			VariableDeclaration: "VariableDeclaration",
			VariableDeclarator: "VariableDeclarator",
			WhileStatement: "WhileStatement",
			WithStatement: "WithStatement",
			YieldExpression: "YieldExpression"
		};
		VisitorKeys = {
			AssignmentExpression: ["left", "right"],
			AssignmentPattern: ["left", "right"],
			ArrayExpression: ["elements"],
			ArrayPattern: ["elements"],
			ArrowFunctionExpression: ["params", "body"],
			AwaitExpression: ["argument"],
			BlockStatement: ["body"],
			BinaryExpression: ["left", "right"],
			BreakStatement: ["label"],
			CallExpression: ["callee", "arguments"],
			CatchClause: ["param", "body"],
			ChainExpression: ["expression"],
			ClassBody: ["body"],
			ClassDeclaration: [
				"id",
				"superClass",
				"body"
			],
			ClassExpression: [
				"id",
				"superClass",
				"body"
			],
			ComprehensionBlock: ["left", "right"],
			ComprehensionExpression: [
				"blocks",
				"filter",
				"body"
			],
			ConditionalExpression: [
				"test",
				"consequent",
				"alternate"
			],
			ContinueStatement: ["label"],
			DebuggerStatement: [],
			DirectiveStatement: [],
			DoWhileStatement: ["body", "test"],
			EmptyStatement: [],
			ExportAllDeclaration: ["source"],
			ExportDefaultDeclaration: ["declaration"],
			ExportNamedDeclaration: [
				"declaration",
				"specifiers",
				"source"
			],
			ExportSpecifier: ["exported", "local"],
			ExpressionStatement: ["expression"],
			ForStatement: [
				"init",
				"test",
				"update",
				"body"
			],
			ForInStatement: [
				"left",
				"right",
				"body"
			],
			ForOfStatement: [
				"left",
				"right",
				"body"
			],
			FunctionDeclaration: [
				"id",
				"params",
				"body"
			],
			FunctionExpression: [
				"id",
				"params",
				"body"
			],
			GeneratorExpression: [
				"blocks",
				"filter",
				"body"
			],
			Identifier: [],
			IfStatement: [
				"test",
				"consequent",
				"alternate"
			],
			ImportExpression: ["source"],
			ImportDeclaration: ["specifiers", "source"],
			ImportDefaultSpecifier: ["local"],
			ImportNamespaceSpecifier: ["local"],
			ImportSpecifier: ["imported", "local"],
			Literal: [],
			LabeledStatement: ["label", "body"],
			LogicalExpression: ["left", "right"],
			MemberExpression: ["object", "property"],
			MetaProperty: ["meta", "property"],
			MethodDefinition: ["key", "value"],
			ModuleSpecifier: [],
			NewExpression: ["callee", "arguments"],
			ObjectExpression: ["properties"],
			ObjectPattern: ["properties"],
			PrivateIdentifier: [],
			Program: ["body"],
			Property: ["key", "value"],
			PropertyDefinition: ["key", "value"],
			RestElement: ["argument"],
			ReturnStatement: ["argument"],
			SequenceExpression: ["expressions"],
			SpreadElement: ["argument"],
			Super: [],
			SwitchStatement: ["discriminant", "cases"],
			SwitchCase: ["test", "consequent"],
			TaggedTemplateExpression: ["tag", "quasi"],
			TemplateElement: [],
			TemplateLiteral: ["quasis", "expressions"],
			ThisExpression: [],
			ThrowStatement: ["argument"],
			TryStatement: [
				"block",
				"handler",
				"finalizer"
			],
			UnaryExpression: ["argument"],
			UpdateExpression: ["argument"],
			VariableDeclaration: ["declarations"],
			VariableDeclarator: ["id", "init"],
			WhileStatement: ["test", "body"],
			WithStatement: ["object", "body"],
			YieldExpression: ["argument"]
		};
		BREAK = {};
		SKIP = {};
		REMOVE = {};
		VisitorOption = {
			Break: BREAK,
			Skip: SKIP,
			Remove: REMOVE
		};
		function Reference(parent, key) {
			this.parent = parent;
			this.key = key;
		}
		Reference.prototype.replace = function replace$1(node) {
			this.parent[this.key] = node;
		};
		Reference.prototype.remove = function remove() {
			if (Array.isArray(this.parent)) {
				this.parent.splice(this.key, 1);
				return true;
			} else {
				this.replace(null);
				return false;
			}
		};
		function Element(node, path$1, wrap$1, ref) {
			this.node = node;
			this.path = path$1;
			this.wrap = wrap$1;
			this.ref = ref;
		}
		function Controller() {}
		Controller.prototype.path = function path$1() {
			var i, iz, j, jz, result, element;
			function addToPath(result$1, path$2) {
				if (Array.isArray(path$2)) for (j = 0, jz = path$2.length; j < jz; ++j) result$1.push(path$2[j]);
				else result$1.push(path$2);
			}
			if (!this.__current.path) return null;
			result = [];
			for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
				element = this.__leavelist[i];
				addToPath(result, element.path);
			}
			addToPath(result, this.__current.path);
			return result;
		};
		Controller.prototype.type = function() {
			return this.current().type || this.__current.wrap;
		};
		Controller.prototype.parents = function parents() {
			var i, iz, result = [];
			for (i = 1, iz = this.__leavelist.length; i < iz; ++i) result.push(this.__leavelist[i].node);
			return result;
		};
		Controller.prototype.current = function current() {
			return this.__current.node;
		};
		Controller.prototype.__execute = function __execute(callback, element) {
			var previous, result = void 0;
			previous = this.__current;
			this.__current = element;
			this.__state = null;
			if (callback) result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
			this.__current = previous;
			return result;
		};
		Controller.prototype.notify = function notify(flag) {
			this.__state = flag;
		};
		Controller.prototype.skip = function() {
			this.notify(SKIP);
		};
		Controller.prototype["break"] = function() {
			this.notify(BREAK);
		};
		Controller.prototype.remove = function() {
			this.notify(REMOVE);
		};
		Controller.prototype.__initialize = function(root, visitor) {
			this.visitor = visitor;
			this.root = root;
			this.__worklist = [];
			this.__leavelist = [];
			this.__current = null;
			this.__state = null;
			this.__fallback = null;
			if (visitor.fallback === "iteration") this.__fallback = Object.keys;
			else if (typeof visitor.fallback === "function") this.__fallback = visitor.fallback;
			this.__keys = VisitorKeys;
			if (visitor.keys) this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
		};
		function isNode(node) {
			if (node == null) return false;
			return typeof node === "object" && typeof node.type === "string";
		}
		function isProperty(nodeType, key) {
			return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && "properties" === key;
		}
		function candidateExistsInLeaveList(leavelist, candidate) {
			for (var i = leavelist.length - 1; i >= 0; --i) if (leavelist[i].node === candidate) return true;
			return false;
		}
		Controller.prototype.traverse = function traverse$1(root, visitor) {
			var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
			this.__initialize(root, visitor);
			sentinel = {};
			worklist = this.__worklist;
			leavelist = this.__leavelist;
			worklist.push(new Element(root, null, null, null));
			leavelist.push(new Element(null, null, null, null));
			while (worklist.length) {
				element = worklist.pop();
				if (element === sentinel) {
					element = leavelist.pop();
					ret = this.__execute(visitor.leave, element);
					if (this.__state === BREAK || ret === BREAK) return;
					continue;
				}
				if (element.node) {
					ret = this.__execute(visitor.enter, element);
					if (this.__state === BREAK || ret === BREAK) return;
					worklist.push(sentinel);
					leavelist.push(element);
					if (this.__state === SKIP || ret === SKIP) continue;
					node = element.node;
					nodeType = node.type || element.wrap;
					candidates = this.__keys[nodeType];
					if (!candidates) if (this.__fallback) candidates = this.__fallback(node);
					else throw new Error("Unknown node type " + nodeType + ".");
					current = candidates.length;
					while ((current -= 1) >= 0) {
						key = candidates[current];
						candidate = node[key];
						if (!candidate) continue;
						if (Array.isArray(candidate)) {
							current2 = candidate.length;
							while ((current2 -= 1) >= 0) {
								if (!candidate[current2]) continue;
								if (candidateExistsInLeaveList(leavelist, candidate[current2])) continue;
								if (isProperty(nodeType, candidates[current])) element = new Element(candidate[current2], [key, current2], "Property", null);
								else if (isNode(candidate[current2])) element = new Element(candidate[current2], [key, current2], null, null);
								else continue;
								worklist.push(element);
							}
						} else if (isNode(candidate)) {
							if (candidateExistsInLeaveList(leavelist, candidate)) continue;
							worklist.push(new Element(candidate, key, null, null));
						}
					}
				}
			}
		};
		Controller.prototype.replace = function replace$1(root, visitor) {
			var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
			function removeElem(element$1) {
				var i, key$1, nextElem, parent;
				if (element$1.ref.remove()) {
					key$1 = element$1.ref.key;
					parent = element$1.ref.parent;
					i = worklist.length;
					while (i--) {
						nextElem = worklist[i];
						if (nextElem.ref && nextElem.ref.parent === parent) {
							if (nextElem.ref.key < key$1) break;
							--nextElem.ref.key;
						}
					}
				}
			}
			this.__initialize(root, visitor);
			sentinel = {};
			worklist = this.__worklist;
			leavelist = this.__leavelist;
			outer = { root };
			element = new Element(root, null, null, new Reference(outer, "root"));
			worklist.push(element);
			leavelist.push(element);
			while (worklist.length) {
				element = worklist.pop();
				if (element === sentinel) {
					element = leavelist.pop();
					target = this.__execute(visitor.leave, element);
					if (target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE) element.ref.replace(target);
					if (this.__state === REMOVE || target === REMOVE) removeElem(element);
					if (this.__state === BREAK || target === BREAK) return outer.root;
					continue;
				}
				target = this.__execute(visitor.enter, element);
				if (target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE) {
					element.ref.replace(target);
					element.node = target;
				}
				if (this.__state === REMOVE || target === REMOVE) {
					removeElem(element);
					element.node = null;
				}
				if (this.__state === BREAK || target === BREAK) return outer.root;
				node = element.node;
				if (!node) continue;
				worklist.push(sentinel);
				leavelist.push(element);
				if (this.__state === SKIP || target === SKIP) continue;
				nodeType = node.type || element.wrap;
				candidates = this.__keys[nodeType];
				if (!candidates) if (this.__fallback) candidates = this.__fallback(node);
				else throw new Error("Unknown node type " + nodeType + ".");
				current = candidates.length;
				while ((current -= 1) >= 0) {
					key = candidates[current];
					candidate = node[key];
					if (!candidate) continue;
					if (Array.isArray(candidate)) {
						current2 = candidate.length;
						while ((current2 -= 1) >= 0) {
							if (!candidate[current2]) continue;
							if (isProperty(nodeType, candidates[current])) element = new Element(candidate[current2], [key, current2], "Property", new Reference(candidate, current2));
							else if (isNode(candidate[current2])) element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
							else continue;
							worklist.push(element);
						}
					} else if (isNode(candidate)) worklist.push(new Element(candidate, key, null, new Reference(node, key)));
				}
			}
			return outer.root;
		};
		function traverse(root, visitor) {
			return new Controller().traverse(root, visitor);
		}
		function replace(root, visitor) {
			return new Controller().replace(root, visitor);
		}
		function extendCommentRange(comment, tokens) {
			var target = upperBound(tokens, function search(token) {
				return token.range[0] > comment.range[0];
			});
			comment.extendedRange = [comment.range[0], comment.range[1]];
			if (target !== tokens.length) comment.extendedRange[1] = tokens[target].range[0];
			target -= 1;
			if (target >= 0) comment.extendedRange[0] = tokens[target].range[1];
			return comment;
		}
		function attachComments(tree$2, providedComments, tokens) {
			var comments = [], comment, len, i, cursor;
			if (!tree$2.range) throw new Error("attachComments needs range information");
			if (!tokens.length) {
				if (providedComments.length) {
					for (i = 0, len = providedComments.length; i < len; i += 1) {
						comment = deepCopy(providedComments[i]);
						comment.extendedRange = [0, tree$2.range[0]];
						comments.push(comment);
					}
					tree$2.leadingComments = comments;
				}
				return tree$2;
			}
			for (i = 0, len = providedComments.length; i < len; i += 1) comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
			cursor = 0;
			traverse(tree$2, { enter: function(node) {
				var comment$1;
				while (cursor < comments.length) {
					comment$1 = comments[cursor];
					if (comment$1.extendedRange[1] > node.range[0]) break;
					if (comment$1.extendedRange[1] === node.range[0]) {
						if (!node.leadingComments) node.leadingComments = [];
						node.leadingComments.push(comment$1);
						comments.splice(cursor, 1);
					} else cursor += 1;
				}
				if (cursor === comments.length) return VisitorOption.Break;
				if (comments[cursor].extendedRange[0] > node.range[1]) return VisitorOption.Skip;
			} });
			cursor = 0;
			traverse(tree$2, { leave: function(node) {
				var comment$1;
				while (cursor < comments.length) {
					comment$1 = comments[cursor];
					if (node.range[1] < comment$1.extendedRange[0]) break;
					if (node.range[1] === comment$1.extendedRange[0]) {
						if (!node.trailingComments) node.trailingComments = [];
						node.trailingComments.push(comment$1);
						comments.splice(cursor, 1);
					} else cursor += 1;
				}
				if (cursor === comments.length) return VisitorOption.Break;
				if (comments[cursor].extendedRange[0] > node.range[1]) return VisitorOption.Skip;
			} });
			return tree$2;
		}
		exports$1.Syntax = Syntax;
		exports$1.traverse = traverse;
		exports$1.replace = replace;
		exports$1.attachComments = attachComments;
		exports$1.VisitorKeys = VisitorKeys;
		exports$1.VisitorOption = VisitorOption;
		exports$1.Controller = Controller;
		exports$1.cloneEnvironment = function() {
			return clone({});
		};
		return exports$1;
	})(exports);
}));
var require_ast = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	(function() {
		"use strict";
		function isExpression(node) {
			if (node == null) return false;
			switch (node.type) {
				case "ArrayExpression":
				case "AssignmentExpression":
				case "BinaryExpression":
				case "CallExpression":
				case "ConditionalExpression":
				case "FunctionExpression":
				case "Identifier":
				case "Literal":
				case "LogicalExpression":
				case "MemberExpression":
				case "NewExpression":
				case "ObjectExpression":
				case "SequenceExpression":
				case "ThisExpression":
				case "UnaryExpression":
				case "UpdateExpression": return true;
			}
			return false;
		}
		function isIterationStatement(node) {
			if (node == null) return false;
			switch (node.type) {
				case "DoWhileStatement":
				case "ForInStatement":
				case "ForStatement":
				case "WhileStatement": return true;
			}
			return false;
		}
		function isStatement(node) {
			if (node == null) return false;
			switch (node.type) {
				case "BlockStatement":
				case "BreakStatement":
				case "ContinueStatement":
				case "DebuggerStatement":
				case "DoWhileStatement":
				case "EmptyStatement":
				case "ExpressionStatement":
				case "ForInStatement":
				case "ForStatement":
				case "IfStatement":
				case "LabeledStatement":
				case "ReturnStatement":
				case "SwitchStatement":
				case "ThrowStatement":
				case "TryStatement":
				case "VariableDeclaration":
				case "WhileStatement":
				case "WithStatement": return true;
			}
			return false;
		}
		function isSourceElement(node) {
			return isStatement(node) || node != null && node.type === "FunctionDeclaration";
		}
		function trailingStatement(node) {
			switch (node.type) {
				case "IfStatement":
					if (node.alternate != null) return node.alternate;
					return node.consequent;
				case "LabeledStatement":
				case "ForStatement":
				case "ForInStatement":
				case "WhileStatement":
				case "WithStatement": return node.body;
			}
			return null;
		}
		function isProblematicIfStatement(node) {
			var current;
			if (node.type !== "IfStatement") return false;
			if (node.alternate == null) return false;
			current = node.consequent;
			do {
				if (current.type === "IfStatement") {
					if (current.alternate == null) return true;
				}
				current = trailingStatement(current);
			} while (current);
			return false;
		}
		module.exports = {
			isExpression,
			isStatement,
			isIterationStatement,
			isSourceElement,
			isProblematicIfStatement,
			trailingStatement
		};
	})();
}));
var require_code = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	(function() {
		"use strict";
		var ES6Regex, ES5Regex = {
			NonAsciiIdentifierStart: /[\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\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\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\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]/,
			NonAsciiIdentifierPart: /[\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\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\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\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\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\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-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\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\u200C\u200D\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\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]/
		}, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
		ES6Regex = {
			NonAsciiIdentifierStart: /[\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\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\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-\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\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\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\uDF30-\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\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\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]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\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]|\uD87E[\uDC00-\uDE1D]/,
			NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\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\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\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\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\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\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\u1369-\u1371\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-\u19DA\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-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\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\uDF30-\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\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\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]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\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]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
		};
		function isDecimalDigit(ch$1) {
			return 48 <= ch$1 && ch$1 <= 57;
		}
		function isHexDigit(ch$1) {
			return 48 <= ch$1 && ch$1 <= 57 || 97 <= ch$1 && ch$1 <= 102 || 65 <= ch$1 && ch$1 <= 70;
		}
		function isOctalDigit(ch$1) {
			return ch$1 >= 48 && ch$1 <= 55;
		}
		NON_ASCII_WHITESPACES = [
			5760,
			8192,
			8193,
			8194,
			8195,
			8196,
			8197,
			8198,
			8199,
			8200,
			8201,
			8202,
			8239,
			8287,
			12288,
			65279
		];
		function isWhiteSpace(ch$1) {
			return ch$1 === 32 || ch$1 === 9 || ch$1 === 11 || ch$1 === 12 || ch$1 === 160 || ch$1 >= 5760 && NON_ASCII_WHITESPACES.indexOf(ch$1) >= 0;
		}
		function isLineTerminator(ch$1) {
			return ch$1 === 10 || ch$1 === 13 || ch$1 === 8232 || ch$1 === 8233;
		}
		function fromCodePoint(cp) {
			if (cp <= 65535) return String.fromCharCode(cp);
			return String.fromCharCode(Math.floor((cp - 65536) / 1024) + 55296) + String.fromCharCode((cp - 65536) % 1024 + 56320);
		}
		IDENTIFIER_START = new Array(128);
		for (ch = 0; ch < 128; ++ch) IDENTIFIER_START[ch] = ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90 || ch === 36 || ch === 95;
		IDENTIFIER_PART = new Array(128);
		for (ch = 0; ch < 128; ++ch) IDENTIFIER_PART[ch] = ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95;
		function isIdentifierStartES5(ch$1) {
			return ch$1 < 128 ? IDENTIFIER_START[ch$1] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch$1));
		}
		function isIdentifierPartES5(ch$1) {
			return ch$1 < 128 ? IDENTIFIER_PART[ch$1] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch$1));
		}
		function isIdentifierStartES6(ch$1) {
			return ch$1 < 128 ? IDENTIFIER_START[ch$1] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch$1));
		}
		function isIdentifierPartES6(ch$1) {
			return ch$1 < 128 ? IDENTIFIER_PART[ch$1] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch$1));
		}
		module.exports = {
			isDecimalDigit,
			isHexDigit,
			isOctalDigit,
			isWhiteSpace,
			isLineTerminator,
			isIdentifierStartES5,
			isIdentifierPartES5,
			isIdentifierStartES6,
			isIdentifierPartES6
		};
	})();
}));
var require_keyword = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	(function() {
		"use strict";
		var code = require_code();
		function isStrictModeReservedWordES6(id) {
			switch (id) {
				case "implements":
				case "interface":
				case "package":
				case "private":
				case "protected":
				case "public":
				case "static":
				case "let": return true;
				default: return false;
			}
		}
		function isKeywordES5(id, strict) {
			if (!strict && id === "yield") return false;
			return isKeywordES6(id, strict);
		}
		function isKeywordES6(id, strict) {
			if (strict && isStrictModeReservedWordES6(id)) return true;
			switch (id.length) {
				case 2: return id === "if" || id === "in" || id === "do";
				case 3: return id === "var" || id === "for" || id === "new" || id === "try";
				case 4: return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum";
				case 5: return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super";
				case 6: return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import";
				case 7: return id === "default" || id === "finally" || id === "extends";
				case 8: return id === "function" || id === "continue" || id === "debugger";
				case 10: return id === "instanceof";
				default: return false;
			}
		}
		function isReservedWordES5(id, strict) {
			return id === "null" || id === "true" || id === "false" || isKeywordES5(id, strict);
		}
		function isReservedWordES6(id, strict) {
			return id === "null" || id === "true" || id === "false" || isKeywordES6(id, strict);
		}
		function isRestrictedWord(id) {
			return id === "eval" || id === "arguments";
		}
		function isIdentifierNameES5(id) {
			var i, iz, ch;
			if (id.length === 0) return false;
			ch = id.charCodeAt(0);
			if (!code.isIdentifierStartES5(ch)) return false;
			for (i = 1, iz = id.length; i < iz; ++i) {
				ch = id.charCodeAt(i);
				if (!code.isIdentifierPartES5(ch)) return false;
			}
			return true;
		}
		function decodeUtf16(lead, trail) {
			return (lead - 55296) * 1024 + (trail - 56320) + 65536;
		}
		function isIdentifierNameES6(id) {
			var i, iz, ch, lowCh, check;
			if (id.length === 0) return false;
			check = code.isIdentifierStartES6;
			for (i = 0, iz = id.length; i < iz; ++i) {
				ch = id.charCodeAt(i);
				if (55296 <= ch && ch <= 56319) {
					++i;
					if (i >= iz) return false;
					lowCh = id.charCodeAt(i);
					if (!(56320 <= lowCh && lowCh <= 57343)) return false;
					ch = decodeUtf16(ch, lowCh);
				}
				if (!check(ch)) return false;
				check = code.isIdentifierPartES6;
			}
			return true;
		}
		function isIdentifierES5(id, strict) {
			return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
		}
		function isIdentifierES6(id, strict) {
			return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
		}
		module.exports = {
			isKeywordES5,
			isKeywordES6,
			isReservedWordES5,
			isReservedWordES6,
			isRestrictedWord,
			isIdentifierNameES5,
			isIdentifierNameES6,
			isIdentifierES5,
			isIdentifierES6
		};
	})();
}));
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
	(function() {
		"use strict";
		exports.ast = require_ast();
		exports.code = require_code();
		exports.keyword = require_keyword();
	})();
}));
var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
	exports.encode = function(number) {
		if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
		throw new TypeError("Must be between 0 and 63: " + number);
	};
	exports.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;
	};
}));
var require_base64_vlq = /* @__PURE__ */ __commonJSMin(((exports) => {
	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;
	}
	exports.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;
	};
	exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
		var strLen = aStr.length;
		var result = 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;
			result = result + (digit << shift);
			shift += VLQ_BASE_SHIFT;
		} while (continuation);
		aOutParam.value = fromVLQSigned(result);
		aOutParam.rest = aIndex;
	};
}));
var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
	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.");
	}
	exports.getArg = getArg;
	var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
	var dataUrlRegexp = /^data:.+\,.+$/;
	function urlParse(aUrl) {
		var match = aUrl.match(urlRegexp);
		if (!match) return null;
		return {
			scheme: match[1],
			auth: match[2],
			host: match[3],
			port: match[4],
			path: match[5]
		};
	}
	exports.urlParse = urlParse;
	function urlGenerate(aParsedUrl) {
		var url$3 = "";
		if (aParsedUrl.scheme) url$3 += aParsedUrl.scheme + ":";
		url$3 += "//";
		if (aParsedUrl.auth) url$3 += aParsedUrl.auth + "@";
		if (aParsedUrl.host) url$3 += aParsedUrl.host;
		if (aParsedUrl.port) url$3 += ":" + aParsedUrl.port;
		if (aParsedUrl.path) url$3 += aParsedUrl.path;
		return url$3;
	}
	exports.urlGenerate = urlGenerate;
	function normalize(aPath) {
		var path$1 = aPath;
		var url$3 = urlParse(aPath);
		if (url$3) {
			if (!url$3.path) return aPath;
			path$1 = url$3.path;
		}
		var isAbsolute = exports.isAbsolute(path$1);
		var parts = path$1.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--;
			}
		}
		path$1 = parts.join("/");
		if (path$1 === "") path$1 = isAbsolute ? "/" : ".";
		if (url$3) {
			url$3.path = path$1;
			return urlGenerate(url$3);
		}
		return path$1;
	}
	exports.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;
	}
	exports.join = join;
	exports.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);
	}
	exports.relative = relative;
	var supportsNullProto = function() {
		return !("__proto__" in Object.create(null));
	}();
	function identity(s$1) {
		return s$1;
	}
	function toSetString(aStr) {
		if (isProtoString(aStr)) return "$" + aStr;
		return aStr;
	}
	exports.toSetString = supportsNullProto ? identity : toSetString;
	function fromSetString(aStr) {
		if (isProtoString(aStr)) return aStr.slice(1);
		return aStr;
	}
	exports.fromSetString = supportsNullProto ? identity : fromSetString;
	function isProtoString(s$1) {
		if (!s$1) return false;
		var length = s$1.length;
		if (length < 9) return false;
		if (s$1.charCodeAt(length - 1) !== 95 || s$1.charCodeAt(length - 2) !== 95 || s$1.charCodeAt(length - 3) !== 111 || s$1.charCodeAt(length - 4) !== 116 || s$1.charCodeAt(length - 5) !== 111 || s$1.charCodeAt(length - 6) !== 114 || s$1.charCodeAt(length - 7) !== 112 || s$1.charCodeAt(length - 8) !== 95 || s$1.charCodeAt(length - 9) !== 95) return false;
		for (var i = length - 10; i >= 0; i--) if (s$1.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);
	}
	exports.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);
	}
	exports.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);
	}
	exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
	function parseSourceMapInput(str) {
		return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
	}
	exports.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);
	}
	exports.computeSourceURL = computeSourceURL;
}));
var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => {
	var util$5 = require_util$1();
	var has = Object.prototype.hasOwnProperty;
	var hasNativeMap = typeof Map !== "undefined";
	function ArraySet$2() {
		this._array = [];
		this._set = hasNativeMap ? /* @__PURE__ */ new Map() : Object.create(null);
	}
	ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
		var set = new ArraySet$2();
		for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates);
		return set;
	};
	ArraySet$2.prototype.size = function ArraySet_size() {
		return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
	};
	ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
		var sStr = hasNativeMap ? aStr : util$5.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$2.prototype.has = function ArraySet_has(aStr) {
		if (hasNativeMap) return this._set.has(aStr);
		else {
			var sStr = util$5.toSetString(aStr);
			return has.call(this._set, sStr);
		}
	};
	ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
		if (hasNativeMap) {
			var idx = this._set.get(aStr);
			if (idx >= 0) return idx;
		} else {
			var sStr = util$5.toSetString(aStr);
			if (has.call(this._set, sStr)) return this._set[sStr];
		}
		throw new Error("\"" + aStr + "\" is not in the set.");
	};
	ArraySet$2.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$2.prototype.toArray = function ArraySet_toArray() {
		return this._array.slice();
	};
	exports.ArraySet = ArraySet$2;
}));
var require_mapping_list = /* @__PURE__ */ __commonJSMin(((exports) => {
	var util$4 = require_util$1();
	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$4.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
	}
	function MappingList$1() {
		this._array = [];
		this._sorted = true;
		this._last = {
			generatedLine: -1,
			generatedColumn: 0
		};
	}
	MappingList$1.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
		this._array.forEach(aCallback, aThisArg);
	};
	MappingList$1.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$1.prototype.toArray = function MappingList_toArray() {
		if (!this._sorted) {
			this._array.sort(util$4.compareByGeneratedPositionsInflated);
			this._sorted = true;
		}
		return this._array;
	};
	exports.MappingList = MappingList$1;
}));
var require_source_map_generator = /* @__PURE__ */ __commonJSMin(((exports) => {
	var base64VLQ$1 = require_base64_vlq();
	var util$3 = require_util$1();
	var ArraySet$1 = require_array_set().ArraySet;
	var MappingList = require_mapping_list().MappingList;
	function SourceMapGenerator$1(aArgs) {
		if (!aArgs) aArgs = {};
		this._file = util$3.getArg(aArgs, "file", null);
		this._sourceRoot = util$3.getArg(aArgs, "sourceRoot", null);
		this._skipValidation = util$3.getArg(aArgs, "skipValidation", false);
		this._sources = new ArraySet$1();
		this._names = new ArraySet$1();
		this._mappings = new MappingList();
		this._sourcesContents = null;
	}
	SourceMapGenerator$1.prototype._version = 3;
	SourceMapGenerator$1.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
		var sourceRoot = aSourceMapConsumer.sourceRoot;
		var generator = new SourceMapGenerator$1({
			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$3.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$3.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$1.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
		var generated = util$3.getArg(aArgs, "generated");
		var original = util$3.getArg(aArgs, "original", null);
		var source = util$3.getArg(aArgs, "source", null);
		var name$1 = util$3.getArg(aArgs, "name", null);
		if (!this._skipValidation) this._validateMapping(generated, original, source, name$1);
		if (source != null) {
			source = String(source);
			if (!this._sources.has(source)) this._sources.add(source);
		}
		if (name$1 != null) {
			name$1 = String(name$1);
			if (!this._names.has(name$1)) this._names.add(name$1);
		}
		this._mappings.add({
			generatedLine: generated.line,
			generatedColumn: generated.column,
			originalLine: original != null && original.line,
			originalColumn: original != null && original.column,
			source,
			name: name$1
		});
	};
	SourceMapGenerator$1.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
		var source = aSourceFile;
		if (this._sourceRoot != null) source = util$3.relative(this._sourceRoot, source);
		if (aSourceContent != null) {
			if (!this._sourcesContents) this._sourcesContents = Object.create(null);
			this._sourcesContents[util$3.toSetString(source)] = aSourceContent;
		} else if (this._sourcesContents) {
			delete this._sourcesContents[util$3.toSetString(source)];
			if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null;
		}
	};
	SourceMapGenerator$1.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$3.relative(sourceRoot, sourceFile);
		var newSources = new ArraySet$1();
		var newNames = new ArraySet$1();
		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$3.join(aSourceMapPath, mapping.source);
					if (sourceRoot != null) mapping.source = util$3.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$1 = mapping.name;
			if (name$1 != null && !newNames.has(name$1)) newNames.add(name$1);
		}, this);
		this._sources = newSources;
		this._names = newNames;
		aSourceMapConsumer.sources.forEach(function(sourceFile$1) {
			var content = aSourceMapConsumer.sourceContentFor(sourceFile$1);
			if (content != null) {
				if (aSourceMapPath != null) sourceFile$1 = util$3.join(aSourceMapPath, sourceFile$1);
				if (sourceRoot != null) sourceFile$1 = util$3.relative(sourceRoot, sourceFile$1);
				this.setSourceContent(sourceFile$1, content);
			}
		}, this);
	};
	SourceMapGenerator$1.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$1.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
		var previousGeneratedColumn = 0;
		var previousGeneratedLine = 1;
		var previousOriginalColumn = 0;
		var previousOriginalLine = 0;
		var previousName = 0;
		var previousSource = 0;
		var result = "";
		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$3.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
				next += ",";
			}
			next += base64VLQ$1.encode(mapping.generatedColumn - previousGeneratedColumn);
			previousGeneratedColumn = mapping.generatedColumn;
			if (mapping.source != null) {
				sourceIdx = this._sources.indexOf(mapping.source);
				next += base64VLQ$1.encode(sourceIdx - previousSource);
				previousSource = sourceIdx;
				next += base64VLQ$1.encode(mapping.originalLine - 1 - previousOriginalLine);
				previousOriginalLine = mapping.originalLine - 1;
				next += base64VLQ$1.encode(mapping.originalColumn - previousOriginalColumn);
				previousOriginalColumn = mapping.originalColumn;
				if (mapping.name != null) {
					nameIdx = this._names.indexOf(mapping.name);
					next += base64VLQ$1.encode(nameIdx - previousName);
					previousName = nameIdx;
				}
			}
			result += next;
		}
		return result;
	};
	SourceMapGenerator$1.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
		return aSources.map(function(source) {
			if (!this._sourcesContents) return null;
			if (aSourceRoot != null) source = util$3.relative(aSourceRoot, source);
			var key = util$3.toSetString(source);
			return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
		}, this);
	};
	SourceMapGenerator$1.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$1.prototype.toString = function SourceMapGenerator_toString() {
		return JSON.stringify(this.toJSON());
	};
	exports.SourceMapGenerator = SourceMapGenerator$1;
}));
var require_binary_search = /* @__PURE__ */ __commonJSMin(((exports) => {
	exports.GREATEST_LOWER_BOUND = 1;
	exports.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 == exports.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 == exports.LEAST_UPPER_BOUND) return mid;
			else return aLow < 0 ? -1 : aLow;
		}
	}
	exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
		if (aHaystack.length === 0) return -1;
		var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.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;
	};
}));
var require_quick_sort = /* @__PURE__ */ __commonJSMin(((exports) => {
	function swap(ary, x, y$1) {
		var temp = ary[x];
		ary[x] = ary[y$1];
		ary[y$1] = 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);
		}
	}
	exports.quickSort = function(ary, comparator) {
		doQuickSort(ary, comparator, 0, ary.length - 1);
	};
}));
var require_source_map_consumer = /* @__PURE__ */ __commonJSMin(((exports) => {
	var util$2 = require_util$1();
	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$2.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$2.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$2.getArg(aArgs, "line");
		var needle = {
			source: util$2.getArg(aArgs, "source"),
			originalLine: line,
			originalColumn: util$2.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$2.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$2.getArg(mapping, "generatedLine", null),
						column: util$2.getArg(mapping, "generatedColumn", null),
						lastColumn: util$2.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$2.getArg(mapping, "generatedLine", null),
						column: util$2.getArg(mapping, "generatedColumn", null),
						lastColumn: util$2.getArg(mapping, "lastGeneratedColumn", null)
					});
					mapping = this._originalMappings[++index];
				}
			}
		}
		return mappings;
	};
	exports.SourceMapConsumer = SourceMapConsumer;
	function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
		var sourceMap = aSourceMap;
		if (typeof aSourceMap === "string") sourceMap = util$2.parseSourceMapInput(aSourceMap);
		var version$1 = util$2.getArg(sourceMap, "version");
		var sources = util$2.getArg(sourceMap, "sources");
		var names = util$2.getArg(sourceMap, "names", []);
		var sourceRoot = util$2.getArg(sourceMap, "sourceRoot", null);
		var sourcesContent = util$2.getArg(sourceMap, "sourcesContent", null);
		var mappings = util$2.getArg(sourceMap, "mappings");
		var file$1 = util$2.getArg(sourceMap, "file", null);
		if (version$1 != this._version) throw new Error("Unsupported version: " + version$1);
		if (sourceRoot) sourceRoot = util$2.normalize(sourceRoot);
		sources = sources.map(String).map(util$2.normalize).map(function(source) {
			return sourceRoot && util$2.isAbsolute(sourceRoot) && util$2.isAbsolute(source) ? util$2.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$1) {
			return util$2.computeSourceURL(sourceRoot, s$1, aSourceMapURL);
		});
		this.sourceRoot = sourceRoot;
		this.sourcesContent = sourcesContent;
		this._mappings = mappings;
		this._sourceMapURL = aSourceMapURL;
		this.file = file$1;
	}
	BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
	BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
	BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
		var relativeSource = aSource;
		if (this.sourceRoot != null) relativeSource = util$2.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$1) {
			return util$2.computeSourceURL(smc.sourceRoot, s$1, 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$2.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$2.compareByGeneratedPositionsDeflated);
		this.__generatedMappings = generatedMappings;
		quickSort(originalMappings, util$2.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$2.getArg(aArgs, "line"),
			generatedColumn: util$2.getArg(aArgs, "column")
		};
		var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util$2.compareByGeneratedPositionsDeflated, util$2.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
		if (index >= 0) {
			var mapping = this._generatedMappings[index];
			if (mapping.generatedLine === needle.generatedLine) {
				var source = util$2.getArg(mapping, "source", null);
				if (source !== null) {
					source = this._sources.at(source);
					source = util$2.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
				}
				var name$1 = util$2.getArg(mapping, "name", null);
				if (name$1 !== null) name$1 = this._names.at(name$1);
				return {
					source,
					line: util$2.getArg(mapping, "originalLine", null),
					column: util$2.getArg(mapping, "originalColumn", null),
					name: name$1
				};
			}
		}
		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$2.relative(this.sourceRoot, relativeSource);
		var url$3;
		if (this.sourceRoot != null && (url$3 = util$2.urlParse(this.sourceRoot))) {
			var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
			if (url$3.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
			if ((!url$3.path || url$3.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$2.getArg(aArgs, "source");
		source = this._findSourceIndex(source);
		if (source < 0) return {
			line: null,
			column: null,
			lastColumn: null
		};
		var needle = {
			source,
			originalLine: util$2.getArg(aArgs, "line"),
			originalColumn: util$2.getArg(aArgs, "column")
		};
		var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util$2.compareByOriginalPositions, util$2.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
		if (index >= 0) {
			var mapping = this._originalMappings[index];
			if (mapping.source === needle.source) return {
				line: util$2.getArg(mapping, "generatedLine", null),
				column: util$2.getArg(mapping, "generatedColumn", null),
				lastColumn: util$2.getArg(mapping, "lastGeneratedColumn", null)
			};
		}
		return {
			line: null,
			column: null,
			lastColumn: null
		};
	};
	exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
	function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
		var sourceMap = aSourceMap;
		if (typeof aSourceMap === "string") sourceMap = util$2.parseSourceMapInput(aSourceMap);
		var version$1 = util$2.getArg(sourceMap, "version");
		var sections = util$2.getArg(sourceMap, "sections");
		if (version$1 != this._version) throw new Error("Unsupported version: " + version$1);
		this._sources = new ArraySet();
		this._names = new ArraySet();
		var lastOffset = {
			line: -1,
			column: 0
		};
		this._sections = sections.map(function(s$1) {
			if (s$1.url) throw new Error("Support for url field in sections not implemented.");
			var offset = util$2.getArg(s$1, "offset");
			var offsetLine = util$2.getArg(offset, "line");
			var offsetColumn = util$2.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: {
					generatedLine: offsetLine + 1,
					generatedColumn: offsetColumn + 1
				},
				consumer: new SourceMapConsumer(util$2.getArg(s$1, "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$2.getArg(aArgs, "line"),
			generatedColumn: util$2.getArg(aArgs, "column")
		};
		var sectionIndex = binarySearch.search(needle, this._sections, function(needle$1, section$1) {
			var cmp = needle$1.generatedLine - section$1.generatedOffset.generatedLine;
			if (cmp) return cmp;
			return needle$1.generatedColumn - section$1.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$1) {
			return s$1.consumer.hasContentsOfAllSources();
		});
	};
	IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
		for (var i = 0; i < this._sections.length; i++) {
			var content = this._sections[i].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$2.getArg(aArgs, "source")) === -1) continue;
			var generatedPosition = section.consumer.generatedPositionFor(aArgs);
			if (generatedPosition) return {
				line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
				column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
			};
		}
		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$2.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
				this._sources.add(source);
				source = this._sources.indexOf(source);
				var name$1 = null;
				if (mapping.name) {
					name$1 = section.consumer._names.at(mapping.name);
					this._names.add(name$1);
					name$1 = this._names.indexOf(name$1);
				}
				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: name$1
				};
				this.__generatedMappings.push(adjustedMapping);
				if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping);
			}
		}
		quickSort(this.__generatedMappings, util$2.compareByGeneratedPositionsDeflated);
		quickSort(this.__originalMappings, util$2.compareByOriginalPositions);
	};
	exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
}));
var require_source_node = /* @__PURE__ */ __commonJSMin(((exports) => {
	var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
	var util$1 = require_util$1();
	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() {
			return getNextLine() + (getNextLine() || "");
			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$1.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$1.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$1.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$1.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
		};
	};
	exports.SourceNode = SourceNode;
}));
var require_source_map = /* @__PURE__ */ __commonJSMin(((exports) => {
	exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
	exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
	exports.SourceNode = require_source_node().SourceNode;
}));
var package_exports = /* @__PURE__ */ __export({
	bin: () => bin,
	default: () => package_default,
	dependencies: () => dependencies,
	description: () => description,
	devDependencies: () => devDependencies,
	engines: () => engines,
	files: () => files,
	homepage: () => homepage,
	license: () => license,
	main: () => main,
	maintainers: () => maintainers,
	name: () => name,
	optionalDependencies: () => optionalDependencies,
	repository: () => repository,
	scripts: () => scripts,
	version: () => version
}, 1);
var name, description, homepage, main, bin, files, version, engines, maintainers, repository, dependencies, optionalDependencies, devDependencies, license, scripts, package_default;
var init_package = __esmMin((() => {
	name = "escodegen";
	description = "ECMAScript code generator";
	homepage = "http://github.com/estools/escodegen";
	main = "escodegen.js";
	bin = {
		"esgenerate": "./bin/esgenerate.js",
		"escodegen": "./bin/escodegen.js"
	};
	files = [
		"LICENSE.BSD",
		"README.md",
		"bin",
		"escodegen.js",
		"package.json"
	];
	version = "2.1.0";
	engines = { "node": ">=6.0" };
	maintainers = [{
		"name": "Yusuke Suzuki",
		"email": "utatane.tea@gmail.com",
		"web": "http://github.com/Constellation"
	}];
	repository = {
		"type": "git",
		"url": "http://github.com/estools/escodegen.git"
	};
	dependencies = {
		"estraverse": "^5.2.0",
		"esutils": "^2.0.2",
		"esprima": "^4.0.1"
	};
	optionalDependencies = { "source-map": "~0.6.1" };
	devDependencies = {
		"acorn": "^8.0.4",
		"bluebird": "^3.4.7",
		"bower-registry-client": "^1.0.0",
		"chai": "^4.2.0",
		"chai-exclude": "^2.0.2",
		"commonjs-everywhere": "^0.9.7",
		"gulp": "^4.0.2",
		"gulp-eslint": "^6.0.0",
		"gulp-mocha": "^7.0.2",
		"minimist": "^1.2.5",
		"optionator": "^0.9.1",
		"semver": "^7.3.4"
	};
	license = "BSD-2-Clause";
	scripts = {
		"test": "gulp travis",
		"unit-test": "gulp test",
		"lint": "gulp lint",
		"release": "node tools/release.js",
		"build-min": "./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",
		"build": "./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"
	};
	package_default = {
		name,
		description,
		homepage,
		main,
		bin,
		files,
		version,
		engines,
		maintainers,
		repository,
		dependencies,
		optionalDependencies,
		devDependencies,
		license,
		scripts
	};
}));
var require_escodegen = /* @__PURE__ */ __commonJSMin(((exports) => {
	(function() {
		"use strict";
		var Syntax, Precedence, BinaryPrecedence, SourceNode$1, estraverse = require_estraverse(), esutils = require_utils(), base, indent, json$1, renumber, hexadecimal, quotes, escapeless, newline, space, parentheses, semicolons, safeConcatenation, directive, extra, parse$1, sourceMap, sourceCode, preserveBlankLines, FORMAT_MINIFY, FORMAT_DEFAULTS;
		Syntax = estraverse.Syntax;
		function isExpression(node) {
			return CodeGenerator.Expression.hasOwnProperty(node.type);
		}
		function isStatement(node) {
			return CodeGenerator.Statement.hasOwnProperty(node.type);
		}
		Precedence = {
			Sequence: 0,
			Yield: 1,
			Assignment: 1,
			Conditional: 2,
			ArrowFunction: 2,
			Coalesce: 3,
			LogicalOR: 4,
			LogicalAND: 5,
			BitwiseOR: 6,
			BitwiseXOR: 7,
			BitwiseAND: 8,
			Equality: 9,
			Relational: 10,
			BitwiseSHIFT: 11,
			Additive: 12,
			Multiplicative: 13,
			Exponentiation: 14,
			Await: 15,
			Unary: 15,
			Postfix: 16,
			OptionalChaining: 17,
			Call: 18,
			New: 19,
			TaggedTemplate: 20,
			Member: 21,
			Primary: 22
		};
		BinaryPrecedence = {
			"??": Precedence.Coalesce,
			"||": Precedence.LogicalOR,
			"&&": Precedence.LogicalAND,
			"|": Precedence.BitwiseOR,
			"^": Precedence.BitwiseXOR,
			"&": Precedence.BitwiseAND,
			"==": Precedence.Equality,
			"!=": Precedence.Equality,
			"===": Precedence.Equality,
			"!==": Precedence.Equality,
			"is": Precedence.Equality,
			"isnt": Precedence.Equality,
			"<": Precedence.Relational,
			">": Precedence.Relational,
			"<=": Precedence.Relational,
			">=": Precedence.Relational,
			"in": Precedence.Relational,
			"instanceof": Precedence.Relational,
			"<<": Precedence.BitwiseSHIFT,
			">>": Precedence.BitwiseSHIFT,
			">>>": Precedence.BitwiseSHIFT,
			"+": Precedence.Additive,
			"-": Precedence.Additive,
			"*": Precedence.Multiplicative,
			"%": Precedence.Multiplicative,
			"/": Precedence.Multiplicative,
			"**": Precedence.Exponentiation
		};
		var F_ALLOW_IN = 1, F_ALLOW_CALL = 2, F_ALLOW_UNPARATH_NEW = 4, F_FUNC_BODY = 8, F_DIRECTIVE_CTX = 16, F_SEMICOLON_OPT = 32, F_FOUND_COALESCE = 64;
		var E_FTT = F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, E_TTF = F_ALLOW_IN | F_ALLOW_CALL, E_TTT = F_ALLOW_IN | F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, E_TFF = F_ALLOW_IN, E_FFT = F_ALLOW_UNPARATH_NEW, E_TFT = F_ALLOW_IN | F_ALLOW_UNPARATH_NEW;
		var S_TFFF = F_ALLOW_IN, S_TFFT = F_ALLOW_IN | F_SEMICOLON_OPT, S_FFFF = 0, S_TFTF = F_ALLOW_IN | F_DIRECTIVE_CTX, S_TTFF = F_ALLOW_IN | F_FUNC_BODY;
		function getDefaultOptions() {
			return {
				indent: null,
				base: null,
				parse: null,
				comment: false,
				format: {
					indent: {
						style: "    ",
						base: 0,
						adjustMultilineComment: false
					},
					newline: "\n",
					space: " ",
					json: false,
					renumber: false,
					hexadecimal: false,
					quotes: "single",
					escapeless: false,
					compact: false,
					parentheses: true,
					semicolons: true,
					safeConcatenation: false,
					preserveBlankLines: false
				},
				moz: {
					comprehensionExpressionStartsWithAssignment: false,
					starlessGenerator: false
				},
				sourceMap: null,
				sourceMapRoot: null,
				sourceMapWithCode: false,
				directive: false,
				raw: true,
				verbatim: null,
				sourceCode: null
			};
		}
		function stringRepeat(str, num) {
			var result = "";
			for (num |= 0; num > 0; num >>>= 1, str += str) if (num & 1) result += str;
			return result;
		}
		function hasLineTerminator(str) {
			return /[\r\n]/g.test(str);
		}
		function endsWithLineTerminator(str) {
			var len = str.length;
			return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1));
		}
		function merge$1(target, override) {
			var key;
			for (key in override) if (override.hasOwnProperty(key)) target[key] = override[key];
			return target;
		}
		function updateDeeply(target, override) {
			var key, val;
			function isHashObject(target$1) {
				return typeof target$1 === "object" && target$1 instanceof Object && !(target$1 instanceof RegExp);
			}
			for (key in override) if (override.hasOwnProperty(key)) {
				val = override[key];
				if (isHashObject(val)) if (isHashObject(target[key])) updateDeeply(target[key], val);
				else target[key] = updateDeeply({}, val);
				else target[key] = val;
			}
			return target;
		}
		function generateNumber(value) {
			var result, point, temp, exponent, pos;
			if (value !== value) throw new Error("Numeric literal whose value is NaN");
			if (value < 0 || value === 0 && 1 / value < 0) throw new Error("Numeric literal whose value is negative");
			if (value === Infinity) return json$1 ? "null" : renumber ? "1e400" : "1e+400";
			result = "" + value;
			if (!renumber || result.length < 3) return result;
			point = result.indexOf(".");
			if (!json$1 && result.charCodeAt(0) === 48 && point === 1) {
				point = 0;
				result = result.slice(1);
			}
			temp = result;
			result = result.replace("e+", "e");
			exponent = 0;
			if ((pos = temp.indexOf("e")) > 0) {
				exponent = +temp.slice(pos + 1);
				temp = temp.slice(0, pos);
			}
			if (point >= 0) {
				exponent -= temp.length - point - 1;
				temp = +(temp.slice(0, point) + temp.slice(point + 1)) + "";
			}
			pos = 0;
			while (temp.charCodeAt(temp.length + pos - 1) === 48) --pos;
			if (pos !== 0) {
				exponent -= pos;
				temp = temp.slice(0, pos);
			}
			if (exponent !== 0) temp += "e" + exponent;
			if ((temp.length < result.length || hexadecimal && value > 0xe8d4a51000 && Math.floor(value) === value && (temp = "0x" + value.toString(16)).length < result.length) && +temp === value) result = temp;
			return result;
		}
		function escapeRegExpCharacter(ch, previousIsBackslash) {
			if ((ch & -2) === 8232) return (previousIsBackslash ? "u" : "\\u") + (ch === 8232 ? "2028" : "2029");
			else if (ch === 10 || ch === 13) return (previousIsBackslash ? "" : "\\") + (ch === 10 ? "n" : "r");
			return String.fromCharCode(ch);
		}
		function generateRegExp(reg) {
			var match, result = reg.toString(), flags, i, iz, ch, characterInBrack, previousIsBackslash;
			if (reg.source) {
				match = result.match(/\/([^/]*)$/);
				if (!match) return result;
				flags = match[1];
				result = "";
				characterInBrack = false;
				previousIsBackslash = false;
				for (i = 0, iz = reg.source.length; i < iz; ++i) {
					ch = reg.source.charCodeAt(i);
					if (!previousIsBackslash) {
						if (characterInBrack) {
							if (ch === 93) characterInBrack = false;
						} else if (ch === 47) result += "\\";
						else if (ch === 91) characterInBrack = true;
						result += escapeRegExpCharacter(ch, previousIsBackslash);
						previousIsBackslash = ch === 92;
					} else {
						result += escapeRegExpCharacter(ch, previousIsBackslash);
						previousIsBackslash = false;
					}
				}
				return "/" + result + "/" + flags;
			}
			return result;
		}
		function escapeAllowedCharacter(code, next) {
			var hex;
			if (code === 8) return "\\b";
			if (code === 12) return "\\f";
			if (code === 9) return "\\t";
			hex = code.toString(16).toUpperCase();
			if (json$1 || code > 255) return "\\u" + "0000".slice(hex.length) + hex;
			else if (code === 0 && !esutils.code.isDecimalDigit(next)) return "\\0";
			else if (code === 11) return "\\x0B";
			else return "\\x" + "00".slice(hex.length) + hex;
		}
		function escapeDisallowedCharacter(code) {
			if (code === 92) return "\\\\";
			if (code === 10) return "\\n";
			if (code === 13) return "\\r";
			if (code === 8232) return "\\u2028";
			if (code === 8233) return "\\u2029";
			throw new Error("Incorrectly classified character");
		}
		function escapeDirective(str) {
			var i, iz, code, quote = quotes === "double" ? "\"" : "'";
			for (i = 0, iz = str.length; i < iz; ++i) {
				code = str.charCodeAt(i);
				if (code === 39) {
					quote = "\"";
					break;
				} else if (code === 34) {
					quote = "'";
					break;
				} else if (code === 92) ++i;
			}
			return quote + str + quote;
		}
		function escapeString(str) {
			var result = "", i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote;
			for (i = 0, len = str.length; i < len; ++i) {
				code = str.charCodeAt(i);
				if (code === 39) ++singleQuotes;
				else if (code === 34) ++doubleQuotes;
				else if (code === 47 && json$1) result += "\\";
				else if (esutils.code.isLineTerminator(code) || code === 92) {
					result += escapeDisallowedCharacter(code);
					continue;
				} else if (!esutils.code.isIdentifierPartES5(code) && (json$1 && code < 32 || !json$1 && !escapeless && (code < 32 || code > 126))) {
					result += escapeAllowedCharacter(code, str.charCodeAt(i + 1));
					continue;
				}
				result += String.fromCharCode(code);
			}
			single = !(quotes === "double" || quotes === "auto" && doubleQuotes < singleQuotes);
			quote = single ? "'" : "\"";
			if (!(single ? singleQuotes : doubleQuotes)) return quote + result + quote;
			str = result;
			result = quote;
			for (i = 0, len = str.length; i < len; ++i) {
				code = str.charCodeAt(i);
				if (code === 39 && single || code === 34 && !single) result += "\\";
				result += String.fromCharCode(code);
			}
			return result + quote;
		}
		function flattenToString(arr) {
			var i, iz, elem, result = "";
			for (i = 0, iz = arr.length; i < iz; ++i) {
				elem = arr[i];
				result += Array.isArray(elem) ? flattenToString(elem) : elem;
			}
			return result;
		}
		function toSourceNodeWhenNeeded(generated, node) {
			if (!sourceMap) if (Array.isArray(generated)) return flattenToString(generated);
			else return generated;
			if (node == null) if (generated instanceof SourceNode$1) return generated;
			else node = {};
			if (node.loc == null) return new SourceNode$1(null, null, sourceMap, generated, node.name || null);
			return new SourceNode$1(node.loc.start.line, node.loc.start.column, sourceMap === true ? node.loc.source || null : sourceMap, generated, node.name || null);
		}
		function noEmptySpace() {
			return space ? space : " ";
		}
		function join$1(left, right) {
			var leftSource = toSourceNodeWhenNeeded(left).toString(), rightSource, leftCharCode, rightCharCode;
			if (leftSource.length === 0) return [right];
			rightSource = toSourceNodeWhenNeeded(right).toString();
			if (rightSource.length === 0) return [left];
			leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
			rightCharCode = rightSource.charCodeAt(0);
			if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || leftCharCode === 47 && rightCharCode === 105) return [
				left,
				noEmptySpace(),
				right
			];
			else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) return [left, right];
			return [
				left,
				space,
				right
			];
		}
		function addIndent(stmt) {
			return [base, stmt];
		}
		function withIndent(fn) {
			var previousBase = base;
			base += indent;
			fn(base);
			base = previousBase;
		}
		function calculateSpaces(str) {
			var i;
			for (i = str.length - 1; i >= 0; --i) if (esutils.code.isLineTerminator(str.charCodeAt(i))) break;
			return str.length - 1 - i;
		}
		function adjustMultilineComment(value, specialBase) {
			var array = value.split(/\r\n|[\r\n]/), i, len, line, j, spaces = Number.MAX_VALUE, previousBase, sn;
			for (i = 1, len = array.length; i < len; ++i) {
				line = array[i];
				j = 0;
				while (j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j))) ++j;
				if (spaces > j) spaces = j;
			}
			if (typeof specialBase !== "undefined") {
				previousBase = base;
				if (array[1][spaces] === "*") specialBase += " ";
				base = specialBase;
			} else {
				if (spaces & 1) --spaces;
				previousBase = base;
			}
			for (i = 1, len = array.length; i < len; ++i) {
				sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces)));
				array[i] = sourceMap ? sn.join("") : sn;
			}
			base = previousBase;
			return array.join("\n");
		}
		function generateComment(comment, specialBase) {
			if (comment.type === "Line") if (endsWithLineTerminator(comment.value)) return "//" + comment.value;
			else {
				var result = "//" + comment.value;
				if (!preserveBlankLines) result += "\n";
				return result;
			}
			if (extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value)) return adjustMultilineComment("/*" + comment.value + "*/", specialBase);
			return "/*" + comment.value + "*/";
		}
		function addComments(stmt, result) {
			var i, len, comment, save$2, tailingToStatement, specialBase, fragment, extRange, range, prevRange, prefix, infix, suffix, count;
			if (stmt.leadingComments && stmt.leadingComments.length > 0) {
				save$2 = result;
				if (preserveBlankLines) {
					comment = stmt.leadingComments[0];
					result = [];
					extRange = comment.extendedRange;
					range = comment.range;
					prefix = sourceCode.substring(extRange[0], range[0]);
					count = (prefix.match(/\n/g) || []).length;
					if (count > 0) {
						result.push(stringRepeat("\n", count));
						result.push(addIndent(generateComment(comment)));
					} else {
						result.push(prefix);
						result.push(generateComment(comment));
					}
					prevRange = range;
					for (i = 1, len = stmt.leadingComments.length; i < len; i++) {
						comment = stmt.leadingComments[i];
						range = comment.range;
						infix = sourceCode.substring(prevRange[1], range[0]);
						count = (infix.match(/\n/g) || []).length;
						result.push(stringRepeat("\n", count));
						result.push(addIndent(generateComment(comment)));
						prevRange = range;
					}
					suffix = sourceCode.substring(range[1], extRange[1]);
					count = (suffix.match(/\n/g) || []).length;
					result.push(stringRepeat("\n", count));
				} else {
					comment = stmt.leadingComments[0];
					result = [];
					if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) result.push("\n");
					result.push(generateComment(comment));
					if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push("\n");
					for (i = 1, len = stmt.leadingComments.length; i < len; ++i) {
						comment = stmt.leadingComments[i];
						fragment = [generateComment(comment)];
						if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) fragment.push("\n");
						result.push(addIndent(fragment));
					}
				}
				result.push(addIndent(save$2));
			}
			if (stmt.trailingComments) if (preserveBlankLines) {
				comment = stmt.trailingComments[0];
				extRange = comment.extendedRange;
				range = comment.range;
				prefix = sourceCode.substring(extRange[0], range[0]);
				count = (prefix.match(/\n/g) || []).length;
				if (count > 0) {
					result.push(stringRepeat("\n", count));
					result.push(addIndent(generateComment(comment)));
				} else {
					result.push(prefix);
					result.push(generateComment(comment));
				}
			} else {
				tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString());
				specialBase = stringRepeat(" ", calculateSpaces(toSourceNodeWhenNeeded([
					base,
					result,
					indent
				]).toString()));
				for (i = 0, len = stmt.trailingComments.length; i < len; ++i) {
					comment = stmt.trailingComments[i];
					if (tailingToStatement) {
						if (i === 0) result = [result, indent];
						else result = [result, specialBase];
						result.push(generateComment(comment, specialBase));
					} else result = [result, addIndent(generateComment(comment))];
					if (i !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result = [result, "\n"];
				}
			}
			return result;
		}
		function generateBlankLines(start, end, result) {
			var j, newlineCount = 0;
			for (j = start; j < end; j++) if (sourceCode[j] === "\n") newlineCount++;
			for (j = 1; j < newlineCount; j++) result.push(newline);
		}
		function parenthesize(text, current, should) {
			if (current < should) return [
				"(",
				text,
				")"
			];
			return text;
		}
		function generateVerbatimString(string) {
			var i, iz, result = string.split(/\r\n|\n/);
			for (i = 1, iz = result.length; i < iz; i++) result[i] = newline + base + result[i];
			return result;
		}
		function generateVerbatim(expr, precedence) {
			var verbatim = expr[extra.verbatim], result, prec;
			if (typeof verbatim === "string") result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, precedence);
			else {
				result = generateVerbatimString(verbatim.content);
				prec = verbatim.precedence != null ? verbatim.precedence : Precedence.Sequence;
				result = parenthesize(result, prec, precedence);
			}
			return toSourceNodeWhenNeeded(result, expr);
		}
		function CodeGenerator() {}
		CodeGenerator.prototype.maybeBlock = function(stmt, flags) {
			var result, noLeadingComment, that = this;
			noLeadingComment = !extra.comment || !stmt.leadingComments;
			if (stmt.type === Syntax.BlockStatement && noLeadingComment) return [space, this.generateStatement(stmt, flags)];
			if (stmt.type === Syntax.EmptyStatement && noLeadingComment) return ";";
			withIndent(function() {
				result = [newline, addIndent(that.generateStatement(stmt, flags))];
			});
			return result;
		};
		CodeGenerator.prototype.maybeBlockSuffix = function(stmt, result) {
			var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString());
			if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) return [result, space];
			if (ends) return [result, base];
			return [
				result,
				newline,
				base
			];
		};
		function generateIdentifier(node) {
			return toSourceNodeWhenNeeded(node.name, node);
		}
		function generateAsyncPrefix(node, spaceRequired) {
			return node.async ? "async" + (spaceRequired ? noEmptySpace() : space) : "";
		}
		function generateStarSuffix(node) {
			return node.generator && !extra.moz.starlessGenerator ? "*" + space : "";
		}
		function generateMethodPrefix(prop) {
			var func = prop.value, prefix = "";
			if (func.async) prefix += generateAsyncPrefix(func, !prop.computed);
			if (func.generator) prefix += generateStarSuffix(func) ? "*" : "";
			return prefix;
		}
		CodeGenerator.prototype.generatePattern = function(node, precedence, flags) {
			if (node.type === Syntax.Identifier) return generateIdentifier(node);
			return this.generateExpression(node, precedence, flags);
		};
		CodeGenerator.prototype.generateFunctionParams = function(node) {
			var i, iz, result, hasDefault = false;
			if (node.type === Syntax.ArrowFunctionExpression && !node.rest && (!node.defaults || node.defaults.length === 0) && node.params.length === 1 && node.params[0].type === Syntax.Identifier) result = [generateAsyncPrefix(node, true), generateIdentifier(node.params[0])];
			else {
				result = node.type === Syntax.ArrowFunctionExpression ? [generateAsyncPrefix(node, false)] : [];
				result.push("(");
				if (node.defaults) hasDefault = true;
				for (i = 0, iz = node.params.length; i < iz; ++i) {
					if (hasDefault && node.defaults[i]) result.push(this.generateAssignment(node.params[i], node.defaults[i], "=", Precedence.Assignment, E_TTT));
					else result.push(this.generatePattern(node.params[i], Precedence.Assignment, E_TTT));
					if (i + 1 < iz) result.push("," + space);
				}
				if (node.rest) {
					if (node.params.length) result.push("," + space);
					result.push("...");
					result.push(generateIdentifier(node.rest));
				}
				result.push(")");
			}
			return result;
		};
		CodeGenerator.prototype.generateFunctionBody = function(node) {
			var result = this.generateFunctionParams(node), expr;
			if (node.type === Syntax.ArrowFunctionExpression) {
				result.push(space);
				result.push("=>");
			}
			if (node.expression) {
				result.push(space);
				expr = this.generateExpression(node.body, Precedence.Assignment, E_TTT);
				if (expr.toString().charAt(0) === "{") expr = [
					"(",
					expr,
					")"
				];
				result.push(expr);
			} else result.push(this.maybeBlock(node.body, S_TTFF));
			return result;
		};
		CodeGenerator.prototype.generateIterationForStatement = function(operator, stmt, flags) {
			var result = ["for" + (stmt.await ? noEmptySpace() + "await" : "") + space + "("], that = this;
			withIndent(function() {
				if (stmt.left.type === Syntax.VariableDeclaration) withIndent(function() {
					result.push(stmt.left.kind + noEmptySpace());
					result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF));
				});
				else result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT));
				result = join$1(result, operator);
				result = [join$1(result, that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)), ")"];
			});
			result.push(this.maybeBlock(stmt.body, flags));
			return result;
		};
		CodeGenerator.prototype.generatePropertyKey = function(expr, computed) {
			var result = [];
			if (computed) result.push("[");
			result.push(this.generateExpression(expr, Precedence.Assignment, E_TTT));
			if (computed) result.push("]");
			return result;
		};
		CodeGenerator.prototype.generateAssignment = function(left, right, operator, precedence, flags) {
			if (Precedence.Assignment < precedence) flags |= F_ALLOW_IN;
			return parenthesize([
				this.generateExpression(left, Precedence.Call, flags),
				space + operator + space,
				this.generateExpression(right, Precedence.Assignment, flags)
			], Precedence.Assignment, precedence);
		};
		CodeGenerator.prototype.semicolon = function(flags) {
			if (!semicolons && flags & F_SEMICOLON_OPT) return "";
			return ";";
		};
		CodeGenerator.Statement = {
			BlockStatement: function(stmt, flags) {
				var range, content, result = ["{", newline], that = this;
				withIndent(function() {
					if (stmt.body.length === 0 && preserveBlankLines) {
						range = stmt.range;
						if (range[1] - range[0] > 2) {
							content = sourceCode.substring(range[0] + 1, range[1] - 1);
							if (content[0] === "\n") result = ["{"];
							result.push(content);
						}
					}
					var i, iz, fragment, bodyFlags = S_TFFF;
					if (flags & F_FUNC_BODY) bodyFlags |= F_DIRECTIVE_CTX;
					for (i = 0, iz = stmt.body.length; i < iz; ++i) {
						if (preserveBlankLines) {
							if (i === 0) {
								if (stmt.body[0].leadingComments) {
									range = stmt.body[0].leadingComments[0].extendedRange;
									content = sourceCode.substring(range[0], range[1]);
									if (content[0] === "\n") result = ["{"];
								}
								if (!stmt.body[0].leadingComments) generateBlankLines(stmt.range[0], stmt.body[0].range[0], result);
							}
							if (i > 0) {
								if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result);
							}
						}
						if (i === iz - 1) bodyFlags |= F_SEMICOLON_OPT;
						if (stmt.body[i].leadingComments && preserveBlankLines) fragment = that.generateStatement(stmt.body[i], bodyFlags);
						else fragment = addIndent(that.generateStatement(stmt.body[i], bodyFlags));
						result.push(fragment);
						if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) if (preserveBlankLines && i < iz - 1) {
							if (!stmt.body[i + 1].leadingComments) result.push(newline);
						} else result.push(newline);
						if (preserveBlankLines) {
							if (i === iz - 1) {
								if (!stmt.body[i].trailingComments) generateBlankLines(stmt.body[i].range[1], stmt.range[1], result);
							}
						}
					}
				});
				result.push(addIndent("}"));
				return result;
			},
			BreakStatement: function(stmt, flags) {
				if (stmt.label) return "break " + stmt.label.name + this.semicolon(flags);
				return "break" + this.semicolon(flags);
			},
			ContinueStatement: function(stmt, flags) {
				if (stmt.label) return "continue " + stmt.label.name + this.semicolon(flags);
				return "continue" + this.semicolon(flags);
			},
			ClassBody: function(stmt, flags) {
				var result = ["{", newline], that = this;
				withIndent(function(indent$1) {
					var i, iz;
					for (i = 0, iz = stmt.body.length; i < iz; ++i) {
						result.push(indent$1);
						result.push(that.generateExpression(stmt.body[i], Precedence.Sequence, E_TTT));
						if (i + 1 < iz) result.push(newline);
					}
				});
				if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
				result.push(base);
				result.push("}");
				return result;
			},
			ClassDeclaration: function(stmt, flags) {
				var result = ["class"], fragment;
				if (stmt.id) result = join$1(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
				if (stmt.superClass) {
					fragment = join$1("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT));
					result = join$1(result, fragment);
				}
				result.push(space);
				result.push(this.generateStatement(stmt.body, S_TFFT));
				return result;
			},
			DirectiveStatement: function(stmt, flags) {
				if (extra.raw && stmt.raw) return stmt.raw + this.semicolon(flags);
				return escapeDirective(stmt.directive) + this.semicolon(flags);
			},
			DoWhileStatement: function(stmt, flags) {
				var result = join$1("do", this.maybeBlock(stmt.body, S_TFFF));
				result = this.maybeBlockSuffix(stmt.body, result);
				return join$1(result, [
					"while" + space + "(",
					this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
					")" + this.semicolon(flags)
				]);
			},
			CatchClause: function(stmt, flags) {
				var result, that = this;
				withIndent(function() {
					var guard;
					if (stmt.param) {
						result = [
							"catch" + space + "(",
							that.generateExpression(stmt.param, Precedence.Sequence, E_TTT),
							")"
						];
						if (stmt.guard) {
							guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT);
							result.splice(2, 0, " if ", guard);
						}
					} else result = ["catch"];
				});
				result.push(this.maybeBlock(stmt.body, S_TFFF));
				return result;
			},
			DebuggerStatement: function(stmt, flags) {
				return "debugger" + this.semicolon(flags);
			},
			EmptyStatement: function(stmt, flags) {
				return ";";
			},
			ExportDefaultDeclaration: function(stmt, flags) {
				var result = ["export"], bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
				result = join$1(result, "default");
				if (isStatement(stmt.declaration)) result = join$1(result, this.generateStatement(stmt.declaration, bodyFlags));
				else result = join$1(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags));
				return result;
			},
			ExportNamedDeclaration: function(stmt, flags) {
				var result = ["export"], bodyFlags, that = this;
				bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
				if (stmt.declaration) return join$1(result, this.generateStatement(stmt.declaration, bodyFlags));
				if (stmt.specifiers) {
					if (stmt.specifiers.length === 0) result = join$1(result, "{" + space + "}");
					else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) result = join$1(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT));
					else {
						result = join$1(result, "{");
						withIndent(function(indent$1) {
							var i, iz;
							result.push(newline);
							for (i = 0, iz = stmt.specifiers.length; i < iz; ++i) {
								result.push(indent$1);
								result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT));
								if (i + 1 < iz) result.push("," + newline);
							}
						});
						if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
						result.push(base + "}");
					}
					if (stmt.source) result = join$1(result, [
						"from" + space,
						this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
						this.semicolon(flags)
					]);
					else result.push(this.semicolon(flags));
				}
				return result;
			},
			ExportAllDeclaration: function(stmt, flags) {
				return [
					"export" + space,
					"*" + space,
					"from" + space,
					this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
					this.semicolon(flags)
				];
			},
			ExpressionStatement: function(stmt, flags) {
				var result, fragment;
				function isClassPrefixed(fragment$1) {
					var code;
					if (fragment$1.slice(0, 5) !== "class") return false;
					code = fragment$1.charCodeAt(5);
					return code === 123 || esutils.code.isWhiteSpace(code) || esutils.code.isLineTerminator(code);
				}
				function isFunctionPrefixed(fragment$1) {
					var code;
					if (fragment$1.slice(0, 8) !== "function") return false;
					code = fragment$1.charCodeAt(8);
					return code === 40 || esutils.code.isWhiteSpace(code) || code === 42 || esutils.code.isLineTerminator(code);
				}
				function isAsyncPrefixed(fragment$1) {
					var code, i, iz;
					if (fragment$1.slice(0, 5) !== "async") return false;
					if (!esutils.code.isWhiteSpace(fragment$1.charCodeAt(5))) return false;
					for (i = 6, iz = fragment$1.length; i < iz; ++i) if (!esutils.code.isWhiteSpace(fragment$1.charCodeAt(i))) break;
					if (i === iz) return false;
					if (fragment$1.slice(i, i + 8) !== "function") return false;
					code = fragment$1.charCodeAt(i + 8);
					return code === 40 || esutils.code.isWhiteSpace(code) || code === 42 || esutils.code.isLineTerminator(code);
				}
				result = [this.generateExpression(stmt.expression, Precedence.Sequence, E_TTT)];
				fragment = toSourceNodeWhenNeeded(result).toString();
				if (fragment.charCodeAt(0) === 123 || isClassPrefixed(fragment) || isFunctionPrefixed(fragment) || isAsyncPrefixed(fragment) || directive && flags & F_DIRECTIVE_CTX && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === "string") result = [
					"(",
					result,
					")" + this.semicolon(flags)
				];
				else result.push(this.semicolon(flags));
				return result;
			},
			ImportDeclaration: function(stmt, flags) {
				var result, cursor, that = this;
				if (stmt.specifiers.length === 0) return [
					"import",
					space,
					this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
					this.semicolon(flags)
				];
				result = ["import"];
				cursor = 0;
				if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) {
					result = join$1(result, [this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)]);
					++cursor;
				}
				if (stmt.specifiers[cursor]) {
					if (cursor !== 0) result.push(",");
					if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) result = join$1(result, [space, this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)]);
					else {
						result.push(space + "{");
						if (stmt.specifiers.length - cursor === 1) {
							result.push(space);
							result.push(this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT));
							result.push(space + "}" + space);
						} else {
							withIndent(function(indent$1) {
								var i, iz;
								result.push(newline);
								for (i = cursor, iz = stmt.specifiers.length; i < iz; ++i) {
									result.push(indent$1);
									result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT));
									if (i + 1 < iz) result.push("," + newline);
								}
							});
							if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
							result.push(base + "}" + space);
						}
					}
				}
				result = join$1(result, [
					"from" + space,
					this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
					this.semicolon(flags)
				]);
				return result;
			},
			VariableDeclarator: function(stmt, flags) {
				var itemFlags = flags & F_ALLOW_IN ? E_TTT : E_FTT;
				if (stmt.init) return [
					this.generateExpression(stmt.id, Precedence.Assignment, itemFlags),
					space,
					"=",
					space,
					this.generateExpression(stmt.init, Precedence.Assignment, itemFlags)
				];
				return this.generatePattern(stmt.id, Precedence.Assignment, itemFlags);
			},
			VariableDeclaration: function(stmt, flags) {
				var result, i, iz, node, bodyFlags, that = this;
				result = [stmt.kind];
				bodyFlags = flags & F_ALLOW_IN ? S_TFFF : S_FFFF;
				function block() {
					node = stmt.declarations[0];
					if (extra.comment && node.leadingComments) {
						result.push("\n");
						result.push(addIndent(that.generateStatement(node, bodyFlags)));
					} else {
						result.push(noEmptySpace());
						result.push(that.generateStatement(node, bodyFlags));
					}
					for (i = 1, iz = stmt.declarations.length; i < iz; ++i) {
						node = stmt.declarations[i];
						if (extra.comment && node.leadingComments) {
							result.push("," + newline);
							result.push(addIndent(that.generateStatement(node, bodyFlags)));
						} else {
							result.push("," + space);
							result.push(that.generateStatement(node, bodyFlags));
						}
					}
				}
				if (stmt.declarations.length > 1) withIndent(block);
				else block();
				result.push(this.semicolon(flags));
				return result;
			},
			ThrowStatement: function(stmt, flags) {
				return [join$1("throw", this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)), this.semicolon(flags)];
			},
			TryStatement: function(stmt, flags) {
				var result = ["try", this.maybeBlock(stmt.block, S_TFFF)], i, iz, guardedHandlers;
				result = this.maybeBlockSuffix(stmt.block, result);
				if (stmt.handlers) for (i = 0, iz = stmt.handlers.length; i < iz; ++i) {
					result = join$1(result, this.generateStatement(stmt.handlers[i], S_TFFF));
					if (stmt.finalizer || i + 1 !== iz) result = this.maybeBlockSuffix(stmt.handlers[i].body, result);
				}
				else {
					guardedHandlers = stmt.guardedHandlers || [];
					for (i = 0, iz = guardedHandlers.length; i < iz; ++i) {
						result = join$1(result, this.generateStatement(guardedHandlers[i], S_TFFF));
						if (stmt.finalizer || i + 1 !== iz) result = this.maybeBlockSuffix(guardedHandlers[i].body, result);
					}
					if (stmt.handler) if (Array.isArray(stmt.handler)) for (i = 0, iz = stmt.handler.length; i < iz; ++i) {
						result = join$1(result, this.generateStatement(stmt.handler[i], S_TFFF));
						if (stmt.finalizer || i + 1 !== iz) result = this.maybeBlockSuffix(stmt.handler[i].body, result);
					}
					else {
						result = join$1(result, this.generateStatement(stmt.handler, S_TFFF));
						if (stmt.finalizer) result = this.maybeBlockSuffix(stmt.handler.body, result);
					}
				}
				if (stmt.finalizer) result = join$1(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]);
				return result;
			},
			SwitchStatement: function(stmt, flags) {
				var result, fragment, i, iz, bodyFlags, that = this;
				withIndent(function() {
					result = [
						"switch" + space + "(",
						that.generateExpression(stmt.discriminant, Precedence.Sequence, E_TTT),
						")" + space + "{" + newline
					];
				});
				if (stmt.cases) {
					bodyFlags = S_TFFF;
					for (i = 0, iz = stmt.cases.length; i < iz; ++i) {
						if (i === iz - 1) bodyFlags |= F_SEMICOLON_OPT;
						fragment = addIndent(this.generateStatement(stmt.cases[i], bodyFlags));
						result.push(fragment);
						if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) result.push(newline);
					}
				}
				result.push(addIndent("}"));
				return result;
			},
			SwitchCase: function(stmt, flags) {
				var result, fragment, i, iz, bodyFlags, that = this;
				withIndent(function() {
					if (stmt.test) result = [join$1("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)), ":"];
					else result = ["default:"];
					i = 0;
					iz = stmt.consequent.length;
					if (iz && stmt.consequent[0].type === Syntax.BlockStatement) {
						fragment = that.maybeBlock(stmt.consequent[0], S_TFFF);
						result.push(fragment);
						i = 1;
					}
					if (i !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
					bodyFlags = S_TFFF;
					for (; i < iz; ++i) {
						if (i === iz - 1 && flags & F_SEMICOLON_OPT) bodyFlags |= F_SEMICOLON_OPT;
						fragment = addIndent(that.generateStatement(stmt.consequent[i], bodyFlags));
						result.push(fragment);
						if (i + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) result.push(newline);
					}
				});
				return result;
			},
			IfStatement: function(stmt, flags) {
				var result, bodyFlags, semicolonOptional, that = this;
				withIndent(function() {
					result = [
						"if" + space + "(",
						that.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
						")"
					];
				});
				semicolonOptional = flags & F_SEMICOLON_OPT;
				bodyFlags = S_TFFF;
				if (semicolonOptional) bodyFlags |= F_SEMICOLON_OPT;
				if (stmt.alternate) {
					result.push(this.maybeBlock(stmt.consequent, S_TFFF));
					result = this.maybeBlockSuffix(stmt.consequent, result);
					if (stmt.alternate.type === Syntax.IfStatement) result = join$1(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]);
					else result = join$1(result, join$1("else", this.maybeBlock(stmt.alternate, bodyFlags)));
				} else result.push(this.maybeBlock(stmt.consequent, bodyFlags));
				return result;
			},
			ForStatement: function(stmt, flags) {
				var result, that = this;
				withIndent(function() {
					result = ["for" + space + "("];
					if (stmt.init) if (stmt.init.type === Syntax.VariableDeclaration) result.push(that.generateStatement(stmt.init, S_FFFF));
					else {
						result.push(that.generateExpression(stmt.init, Precedence.Sequence, E_FTT));
						result.push(";");
					}
					else result.push(";");
					if (stmt.test) {
						result.push(space);
						result.push(that.generateExpression(stmt.test, Precedence.Sequence, E_TTT));
						result.push(";");
					} else result.push(";");
					if (stmt.update) {
						result.push(space);
						result.push(that.generateExpression(stmt.update, Precedence.Sequence, E_TTT));
						result.push(")");
					} else result.push(")");
				});
				result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF));
				return result;
			},
			ForInStatement: function(stmt, flags) {
				return this.generateIterationForStatement("in", stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF);
			},
			ForOfStatement: function(stmt, flags) {
				return this.generateIterationForStatement("of", stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF);
			},
			LabeledStatement: function(stmt, flags) {
				return [stmt.label.name + ":", this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)];
			},
			Program: function(stmt, flags) {
				var result, fragment, i, iz = stmt.body.length, bodyFlags;
				result = [safeConcatenation && iz > 0 ? "\n" : ""];
				bodyFlags = S_TFTF;
				for (i = 0; i < iz; ++i) {
					if (!safeConcatenation && i === iz - 1) bodyFlags |= F_SEMICOLON_OPT;
					if (preserveBlankLines) {
						if (i === 0) {
							if (!stmt.body[0].leadingComments) generateBlankLines(stmt.range[0], stmt.body[i].range[0], result);
						}
						if (i > 0) {
							if (!stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments) generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result);
						}
					}
					fragment = addIndent(this.generateStatement(stmt.body[i], bodyFlags));
					result.push(fragment);
					if (i + 1 < iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) if (preserveBlankLines) {
						if (!stmt.body[i + 1].leadingComments) result.push(newline);
					} else result.push(newline);
					if (preserveBlankLines) {
						if (i === iz - 1) {
							if (!stmt.body[i].trailingComments) generateBlankLines(stmt.body[i].range[1], stmt.range[1], result);
						}
					}
				}
				return result;
			},
			FunctionDeclaration: function(stmt, flags) {
				return [
					generateAsyncPrefix(stmt, true),
					"function",
					generateStarSuffix(stmt) || noEmptySpace(),
					stmt.id ? generateIdentifier(stmt.id) : "",
					this.generateFunctionBody(stmt)
				];
			},
			ReturnStatement: function(stmt, flags) {
				if (stmt.argument) return [join$1("return", this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)), this.semicolon(flags)];
				return ["return" + this.semicolon(flags)];
			},
			WhileStatement: function(stmt, flags) {
				var result, that = this;
				withIndent(function() {
					result = [
						"while" + space + "(",
						that.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
						")"
					];
				});
				result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF));
				return result;
			},
			WithStatement: function(stmt, flags) {
				var result, that = this;
				withIndent(function() {
					result = [
						"with" + space + "(",
						that.generateExpression(stmt.object, Precedence.Sequence, E_TTT),
						")"
					];
				});
				result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF));
				return result;
			}
		};
		merge$1(CodeGenerator.prototype, CodeGenerator.Statement);
		CodeGenerator.Expression = {
			SequenceExpression: function(expr, precedence, flags) {
				var result, i, iz;
				if (Precedence.Sequence < precedence) flags |= F_ALLOW_IN;
				result = [];
				for (i = 0, iz = expr.expressions.length; i < iz; ++i) {
					result.push(this.generateExpression(expr.expressions[i], Precedence.Assignment, flags));
					if (i + 1 < iz) result.push("," + space);
				}
				return parenthesize(result, Precedence.Sequence, precedence);
			},
			AssignmentExpression: function(expr, precedence, flags) {
				return this.generateAssignment(expr.left, expr.right, expr.operator, precedence, flags);
			},
			ArrowFunctionExpression: function(expr, precedence, flags) {
				return parenthesize(this.generateFunctionBody(expr), Precedence.ArrowFunction, precedence);
			},
			ConditionalExpression: function(expr, precedence, flags) {
				if (Precedence.Conditional < precedence) flags |= F_ALLOW_IN;
				return parenthesize([
					this.generateExpression(expr.test, Precedence.Coalesce, flags),
					space + "?" + space,
					this.generateExpression(expr.consequent, Precedence.Assignment, flags),
					space + ":" + space,
					this.generateExpression(expr.alternate, Precedence.Assignment, flags)
				], Precedence.Conditional, precedence);
			},
			LogicalExpression: function(expr, precedence, flags) {
				if (expr.operator === "??") flags |= F_FOUND_COALESCE;
				return this.BinaryExpression(expr, precedence, flags);
			},
			BinaryExpression: function(expr, precedence, flags) {
				var result, leftPrecedence, rightPrecedence, currentPrecedence = BinaryPrecedence[expr.operator], fragment, leftSource;
				leftPrecedence = expr.operator === "**" ? Precedence.Postfix : currentPrecedence;
				rightPrecedence = expr.operator === "**" ? currentPrecedence : currentPrecedence + 1;
				if (currentPrecedence < precedence) flags |= F_ALLOW_IN;
				fragment = this.generateExpression(expr.left, leftPrecedence, flags);
				leftSource = fragment.toString();
				if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) result = [
					fragment,
					noEmptySpace(),
					expr.operator
				];
				else result = join$1(fragment, expr.operator);
				fragment = this.generateExpression(expr.right, rightPrecedence, flags);
				if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") {
					result.push(noEmptySpace());
					result.push(fragment);
				} else result = join$1(result, fragment);
				if (expr.operator === "in" && !(flags & F_ALLOW_IN)) return [
					"(",
					result,
					")"
				];
				if ((expr.operator === "||" || expr.operator === "&&") && flags & F_FOUND_COALESCE) return [
					"(",
					result,
					")"
				];
				return parenthesize(result, currentPrecedence, precedence);
			},
			CallExpression: function(expr, precedence, flags) {
				var result = [this.generateExpression(expr.callee, Precedence.Call, E_TTF)], i, iz;
				if (expr.optional) result.push("?.");
				result.push("(");
				for (i = 0, iz = expr["arguments"].length; i < iz; ++i) {
					result.push(this.generateExpression(expr["arguments"][i], Precedence.Assignment, E_TTT));
					if (i + 1 < iz) result.push("," + space);
				}
				result.push(")");
				if (!(flags & F_ALLOW_CALL)) return [
					"(",
					result,
					")"
				];
				return parenthesize(result, Precedence.Call, precedence);
			},
			ChainExpression: function(expr, precedence, flags) {
				if (Precedence.OptionalChaining < precedence) flags |= F_ALLOW_CALL;
				return parenthesize(this.generateExpression(expr.expression, Precedence.OptionalChaining, flags), Precedence.OptionalChaining, precedence);
			},
			NewExpression: function(expr, precedence, flags) {
				var result, length = expr["arguments"].length, i, iz, itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF;
				result = join$1("new", this.generateExpression(expr.callee, Precedence.New, itemFlags));
				if (!(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) {
					result.push("(");
					for (i = 0, iz = length; i < iz; ++i) {
						result.push(this.generateExpression(expr["arguments"][i], Precedence.Assignment, E_TTT));
						if (i + 1 < iz) result.push("," + space);
					}
					result.push(")");
				}
				return parenthesize(result, Precedence.New, precedence);
			},
			MemberExpression: function(expr, precedence, flags) {
				var result = [this.generateExpression(expr.object, Precedence.Call, flags & F_ALLOW_CALL ? E_TTF : E_TFF)], fragment;
				if (expr.computed) {
					if (expr.optional) result.push("?.");
					result.push("[");
					result.push(this.generateExpression(expr.property, Precedence.Sequence, flags & F_ALLOW_CALL ? E_TTT : E_TFT));
					result.push("]");
				} else {
					if (!expr.optional && expr.object.type === Syntax.Literal && typeof expr.object.value === "number") {
						fragment = toSourceNodeWhenNeeded(result).toString();
						if (fragment.indexOf(".") < 0 && !/[eExX]/.test(fragment) && esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && !(fragment.length >= 2 && fragment.charCodeAt(0) === 48)) result.push(" ");
					}
					result.push(expr.optional ? "?." : ".");
					result.push(generateIdentifier(expr.property));
				}
				return parenthesize(result, Precedence.Member, precedence);
			},
			MetaProperty: function(expr, precedence, flags) {
				var result = [];
				result.push(typeof expr.meta === "string" ? expr.meta : generateIdentifier(expr.meta));
				result.push(".");
				result.push(typeof expr.property === "string" ? expr.property : generateIdentifier(expr.property));
				return parenthesize(result, Precedence.Member, precedence);
			},
			UnaryExpression: function(expr, precedence, flags) {
				var result, fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT), rightCharCode, leftSource, leftCharCode;
				if (space === "") result = join$1(expr.operator, fragment);
				else {
					result = [expr.operator];
					if (expr.operator.length > 2) result = join$1(result, fragment);
					else {
						leftSource = toSourceNodeWhenNeeded(result).toString();
						leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
						rightCharCode = fragment.toString().charCodeAt(0);
						if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode)) {
							result.push(noEmptySpace());
							result.push(fragment);
						} else result.push(fragment);
					}
				}
				return parenthesize(result, Precedence.Unary, precedence);
			},
			YieldExpression: function(expr, precedence, flags) {
				var result;
				if (expr.delegate) result = "yield*";
				else result = "yield";
				if (expr.argument) result = join$1(result, this.generateExpression(expr.argument, Precedence.Yield, E_TTT));
				return parenthesize(result, Precedence.Yield, precedence);
			},
			AwaitExpression: function(expr, precedence, flags) {
				return parenthesize(join$1(expr.all ? "await*" : "await", this.generateExpression(expr.argument, Precedence.Await, E_TTT)), Precedence.Await, precedence);
			},
			UpdateExpression: function(expr, precedence, flags) {
				if (expr.prefix) return parenthesize([expr.operator, this.generateExpression(expr.argument, Precedence.Unary, E_TTT)], Precedence.Unary, precedence);
				return parenthesize([this.generateExpression(expr.argument, Precedence.Postfix, E_TTT), expr.operator], Precedence.Postfix, precedence);
			},
			FunctionExpression: function(expr, precedence, flags) {
				var result = [generateAsyncPrefix(expr, true), "function"];
				if (expr.id) {
					result.push(generateStarSuffix(expr) || noEmptySpace());
					result.push(generateIdentifier(expr.id));
				} else result.push(generateStarSuffix(expr) || space);
				result.push(this.generateFunctionBody(expr));
				return result;
			},
			ArrayPattern: function(expr, precedence, flags) {
				return this.ArrayExpression(expr, precedence, flags, true);
			},
			ArrayExpression: function(expr, precedence, flags, isPattern) {
				var result, multiline, that = this;
				if (!expr.elements.length) return "[]";
				multiline = isPattern ? false : expr.elements.length > 1;
				result = ["[", multiline ? newline : ""];
				withIndent(function(indent$1) {
					var i, iz;
					for (i = 0, iz = expr.elements.length; i < iz; ++i) {
						if (!expr.elements[i]) {
							if (multiline) result.push(indent$1);
							if (i + 1 === iz) result.push(",");
						} else {
							result.push(multiline ? indent$1 : "");
							result.push(that.generateExpression(expr.elements[i], Precedence.Assignment, E_TTT));
						}
						if (i + 1 < iz) result.push("," + (multiline ? newline : space));
					}
				});
				if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
				result.push(multiline ? base : "");
				result.push("]");
				return result;
			},
			RestElement: function(expr, precedence, flags) {
				return "..." + this.generatePattern(expr.argument);
			},
			ClassExpression: function(expr, precedence, flags) {
				var result = ["class"], fragment;
				if (expr.id) result = join$1(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
				if (expr.superClass) {
					fragment = join$1("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT));
					result = join$1(result, fragment);
				}
				result.push(space);
				result.push(this.generateStatement(expr.body, S_TFFT));
				return result;
			},
			MethodDefinition: function(expr, precedence, flags) {
				var result, fragment;
				if (expr["static"]) result = ["static" + space];
				else result = [];
				if (expr.kind === "get" || expr.kind === "set") fragment = [join$1(expr.kind, this.generatePropertyKey(expr.key, expr.computed)), this.generateFunctionBody(expr.value)];
				else fragment = [
					generateMethodPrefix(expr),
					this.generatePropertyKey(expr.key, expr.computed),
					this.generateFunctionBody(expr.value)
				];
				return join$1(result, fragment);
			},
			Property: function(expr, precedence, flags) {
				if (expr.kind === "get" || expr.kind === "set") return [
					expr.kind,
					noEmptySpace(),
					this.generatePropertyKey(expr.key, expr.computed),
					this.generateFunctionBody(expr.value)
				];
				if (expr.shorthand) {
					if (expr.value.type === "AssignmentPattern") return this.AssignmentPattern(expr.value, Precedence.Sequence, E_TTT);
					return this.generatePropertyKey(expr.key, expr.computed);
				}
				if (expr.method) return [
					generateMethodPrefix(expr),
					this.generatePropertyKey(expr.key, expr.computed),
					this.generateFunctionBody(expr.value)
				];
				return [
					this.generatePropertyKey(expr.key, expr.computed),
					":" + space,
					this.generateExpression(expr.value, Precedence.Assignment, E_TTT)
				];
			},
			ObjectExpression: function(expr, precedence, flags) {
				var multiline, result, fragment, that = this;
				if (!expr.properties.length) return "{}";
				multiline = expr.properties.length > 1;
				withIndent(function() {
					fragment = that.generateExpression(expr.properties[0], Precedence.Sequence, E_TTT);
				});
				if (!multiline) {
					if (!hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) return [
						"{",
						space,
						fragment,
						space,
						"}"
					];
				}
				withIndent(function(indent$1) {
					var i, iz;
					result = [
						"{",
						newline,
						indent$1,
						fragment
					];
					if (multiline) {
						result.push("," + newline);
						for (i = 1, iz = expr.properties.length; i < iz; ++i) {
							result.push(indent$1);
							result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT));
							if (i + 1 < iz) result.push("," + newline);
						}
					}
				});
				if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
				result.push(base);
				result.push("}");
				return result;
			},
			AssignmentPattern: function(expr, precedence, flags) {
				return this.generateAssignment(expr.left, expr.right, "=", precedence, flags);
			},
			ObjectPattern: function(expr, precedence, flags) {
				var result, i, iz, multiline, property, that = this;
				if (!expr.properties.length) return "{}";
				multiline = false;
				if (expr.properties.length === 1) {
					property = expr.properties[0];
					if (property.type === Syntax.Property && property.value.type !== Syntax.Identifier) multiline = true;
				} else for (i = 0, iz = expr.properties.length; i < iz; ++i) {
					property = expr.properties[i];
					if (property.type === Syntax.Property && !property.shorthand) {
						multiline = true;
						break;
					}
				}
				result = ["{", multiline ? newline : ""];
				withIndent(function(indent$1) {
					var i$1, iz$1;
					for (i$1 = 0, iz$1 = expr.properties.length; i$1 < iz$1; ++i$1) {
						result.push(multiline ? indent$1 : "");
						result.push(that.generateExpression(expr.properties[i$1], Precedence.Sequence, E_TTT));
						if (i$1 + 1 < iz$1) result.push("," + (multiline ? newline : space));
					}
				});
				if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) result.push(newline);
				result.push(multiline ? base : "");
				result.push("}");
				return result;
			},
			ThisExpression: function(expr, precedence, flags) {
				return "this";
			},
			Super: function(expr, precedence, flags) {
				return "super";
			},
			Identifier: function(expr, precedence, flags) {
				return generateIdentifier(expr);
			},
			ImportDefaultSpecifier: function(expr, precedence, flags) {
				return generateIdentifier(expr.id || expr.local);
			},
			ImportNamespaceSpecifier: function(expr, precedence, flags) {
				var result = ["*"];
				var id = expr.id || expr.local;
				if (id) result.push(space + "as" + noEmptySpace() + generateIdentifier(id));
				return result;
			},
			ImportSpecifier: function(expr, precedence, flags) {
				var imported = expr.imported;
				var result = [imported.name];
				var local = expr.local;
				if (local && local.name !== imported.name) result.push(noEmptySpace() + "as" + noEmptySpace() + generateIdentifier(local));
				return result;
			},
			ExportSpecifier: function(expr, precedence, flags) {
				var local = expr.local;
				var result = [local.name];
				var exported = expr.exported;
				if (exported && exported.name !== local.name) result.push(noEmptySpace() + "as" + noEmptySpace() + generateIdentifier(exported));
				return result;
			},
			Literal: function(expr, precedence, flags) {
				var raw;
				if (expr.hasOwnProperty("raw") && parse$1 && extra.raw) try {
					raw = parse$1(expr.raw).body[0].expression;
					if (raw.type === Syntax.Literal) {
						if (raw.value === expr.value) return expr.raw;
					}
				} catch (e) {}
				if (expr.regex) return "/" + expr.regex.pattern + "/" + expr.regex.flags;
				if (typeof expr.value === "bigint") return expr.value.toString() + "n";
				if (expr.bigint) return expr.bigint + "n";
				if (expr.value === null) return "null";
				if (typeof expr.value === "string") return escapeString(expr.value);
				if (typeof expr.value === "number") return generateNumber(expr.value);
				if (typeof expr.value === "boolean") return expr.value ? "true" : "false";
				return generateRegExp(expr.value);
			},
			GeneratorExpression: function(expr, precedence, flags) {
				return this.ComprehensionExpression(expr, precedence, flags);
			},
			ComprehensionExpression: function(expr, precedence, flags) {
				var result, i, iz, fragment, that = this;
				result = expr.type === Syntax.GeneratorExpression ? ["("] : ["["];
				if (extra.moz.comprehensionExpressionStartsWithAssignment) {
					fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
					result.push(fragment);
				}
				if (expr.blocks) withIndent(function() {
					for (i = 0, iz = expr.blocks.length; i < iz; ++i) {
						fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT);
						if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) result = join$1(result, fragment);
						else result.push(fragment);
					}
				});
				if (expr.filter) {
					result = join$1(result, "if" + space);
					fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT);
					result = join$1(result, [
						"(",
						fragment,
						")"
					]);
				}
				if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
					fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
					result = join$1(result, fragment);
				}
				result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]");
				return result;
			},
			ComprehensionBlock: function(expr, precedence, flags) {
				var fragment;
				if (expr.left.type === Syntax.VariableDeclaration) fragment = [
					expr.left.kind,
					noEmptySpace(),
					this.generateStatement(expr.left.declarations[0], S_FFFF)
				];
				else fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT);
				fragment = join$1(fragment, expr.of ? "of" : "in");
				fragment = join$1(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT));
				return [
					"for" + space + "(",
					fragment,
					")"
				];
			},
			SpreadElement: function(expr, precedence, flags) {
				return ["...", this.generateExpression(expr.argument, Precedence.Assignment, E_TTT)];
			},
			TaggedTemplateExpression: function(expr, precedence, flags) {
				var itemFlags = E_TTF;
				if (!(flags & F_ALLOW_CALL)) itemFlags = E_TFF;
				return parenthesize([this.generateExpression(expr.tag, Precedence.Call, itemFlags), this.generateExpression(expr.quasi, Precedence.Primary, E_FFT)], Precedence.TaggedTemplate, precedence);
			},
			TemplateElement: function(expr, precedence, flags) {
				return expr.value.raw;
			},
			TemplateLiteral: function(expr, precedence, flags) {
				var result = ["`"], i, iz;
				for (i = 0, iz = expr.quasis.length; i < iz; ++i) {
					result.push(this.generateExpression(expr.quasis[i], Precedence.Primary, E_TTT));
					if (i + 1 < iz) {
						result.push("${" + space);
						result.push(this.generateExpression(expr.expressions[i], Precedence.Sequence, E_TTT));
						result.push(space + "}");
					}
				}
				result.push("`");
				return result;
			},
			ModuleSpecifier: function(expr, precedence, flags) {
				return this.Literal(expr, precedence, flags);
			},
			ImportExpression: function(expr, precedence, flag) {
				return parenthesize([
					"import(",
					this.generateExpression(expr.source, Precedence.Assignment, E_TTT),
					")"
				], Precedence.Call, precedence);
			}
		};
		merge$1(CodeGenerator.prototype, CodeGenerator.Expression);
		CodeGenerator.prototype.generateExpression = function(expr, precedence, flags) {
			var result, type = expr.type || Syntax.Property;
			if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) return generateVerbatim(expr, precedence);
			result = this[type](expr, precedence, flags);
			if (extra.comment) result = addComments(expr, result);
			return toSourceNodeWhenNeeded(result, expr);
		};
		CodeGenerator.prototype.generateStatement = function(stmt, flags) {
			var result = this[stmt.type](stmt, flags), fragment;
			if (extra.comment) result = addComments(stmt, result);
			fragment = toSourceNodeWhenNeeded(result).toString();
			if (stmt.type === Syntax.Program && !safeConcatenation && newline === "" && fragment.charAt(fragment.length - 1) === "\n") result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, "") : fragment.replace(/\s+$/, "");
			return toSourceNodeWhenNeeded(result, stmt);
		};
		function generateInternal(node) {
			var codegen = new CodeGenerator();
			if (isStatement(node)) return codegen.generateStatement(node, S_TFFF);
			if (isExpression(node)) return codegen.generateExpression(node, Precedence.Sequence, E_TTT);
			throw new Error("Unknown node type: " + node.type);
		}
		function generate(node, options) {
			var defaultOptions = getDefaultOptions(), result, pair;
			if (options != null) {
				if (typeof options.indent === "string") defaultOptions.format.indent.style = options.indent;
				if (typeof options.base === "number") defaultOptions.format.indent.base = options.base;
				options = updateDeeply(defaultOptions, options);
				indent = options.format.indent.style;
				if (typeof options.base === "string") base = options.base;
				else base = stringRepeat(indent, options.format.indent.base);
			} else {
				options = defaultOptions;
				indent = options.format.indent.style;
				base = stringRepeat(indent, options.format.indent.base);
			}
			json$1 = options.format.json;
			renumber = options.format.renumber;
			hexadecimal = json$1 ? false : options.format.hexadecimal;
			quotes = json$1 ? "double" : options.format.quotes;
			escapeless = options.format.escapeless;
			newline = options.format.newline;
			space = options.format.space;
			if (options.format.compact) newline = space = indent = base = "";
			parentheses = options.format.parentheses;
			semicolons = options.format.semicolons;
			safeConcatenation = options.format.safeConcatenation;
			directive = options.directive;
			parse$1 = json$1 ? null : options.parse;
			sourceMap = options.sourceMap;
			sourceCode = options.sourceCode;
			preserveBlankLines = options.format.preserveBlankLines && sourceCode !== null;
			extra = options;
			if (sourceMap) if (!exports.browser) SourceNode$1 = require_source_map().SourceNode;
			else SourceNode$1 = global.sourceMap.SourceNode;
			result = generateInternal(node);
			if (!sourceMap) {
				pair = {
					code: result.toString(),
					map: null
				};
				return options.sourceMapWithCode ? pair : pair.code;
			}
			pair = result.toStringWithSourceMap({
				file: options.file,
				sourceRoot: options.sourceMapRoot
			});
			if (options.sourceContent) pair.map.setSourceContent(options.sourceMap, options.sourceContent);
			if (options.sourceMapWithCode) return pair;
			return pair.map.toString();
		}
		FORMAT_MINIFY = {
			indent: {
				style: "",
				base: 0
			},
			renumber: true,
			hexadecimal: true,
			quotes: "auto",
			escapeless: true,
			compact: true,
			parentheses: false,
			semicolons: false
		};
		FORMAT_DEFAULTS = getDefaultOptions().format;
		exports.version = (init_package(), __toCommonJS(package_exports).default).version;
		exports.generate = generate;
		exports.attachComments = estraverse.attachComments;
		exports.Precedence = updateDeeply({}, Precedence);
		exports.browser = false;
		exports.FORMAT_MINIFY = FORMAT_MINIFY;
		exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS;
	})();
}));
var require_esprima$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	(function webpackUniversalModuleDefinition(root, factory$1) {
		/* istanbul ignore next */
		if (typeof exports === "object" && typeof module === "object") module.exports = factory$1();
		else if (typeof define === "function" && define.amd) define([], factory$1);
		else if (typeof exports === "object") exports["esprima"] = factory$1();
		else root["esprima"] = factory$1();
	})(exports, function() {
		return (function(modules) {
			var installedModules = {};
			function __webpack_require__(moduleId) {
				/* istanbul ignore if */
				if (installedModules[moduleId]) return installedModules[moduleId].exports;
				var module$1 = installedModules[moduleId] = {
					exports: {},
					id: moduleId,
					loaded: false
				};
				modules[moduleId].call(module$1.exports, module$1, module$1.exports, __webpack_require__);
				module$1.loaded = true;
				return module$1.exports;
			}
			__webpack_require__.m = modules;
			__webpack_require__.c = installedModules;
			__webpack_require__.p = "";
			return __webpack_require__(0);
		})([
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var comment_handler_1 = __webpack_require__(1);
				var jsx_parser_1 = __webpack_require__(3);
				var parser_1 = __webpack_require__(8);
				var tokenizer_1 = __webpack_require__(15);
				function parse$1(code, options, delegate) {
					var commentHandler = null;
					var proxyDelegate = function(node, metadata) {
						if (delegate) delegate(node, metadata);
						if (commentHandler) commentHandler.visit(node, metadata);
					};
					var parserDelegate = typeof delegate === "function" ? proxyDelegate : null;
					var collectComment = false;
					if (options) {
						collectComment = typeof options.comment === "boolean" && options.comment;
						var attachComment = typeof options.attachComment === "boolean" && options.attachComment;
						if (collectComment || attachComment) {
							commentHandler = new comment_handler_1.CommentHandler();
							commentHandler.attach = attachComment;
							options.comment = true;
							parserDelegate = proxyDelegate;
						}
					}
					var isModule = false;
					if (options && typeof options.sourceType === "string") isModule = options.sourceType === "module";
					var parser;
					if (options && typeof options.jsx === "boolean" && options.jsx) parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
					else parser = new parser_1.Parser(code, options, parserDelegate);
					var ast = isModule ? parser.parseModule() : parser.parseScript();
					if (collectComment && commentHandler) ast.comments = commentHandler.comments;
					if (parser.config.tokens) ast.tokens = parser.tokens;
					if (parser.config.tolerant) ast.errors = parser.errorHandler.errors;
					return ast;
				}
				exports$1.parse = parse$1;
				function parseModule(code, options, delegate) {
					var parsingOptions = options || {};
					parsingOptions.sourceType = "module";
					return parse$1(code, parsingOptions, delegate);
				}
				exports$1.parseModule = parseModule;
				function parseScript(code, options, delegate) {
					var parsingOptions = options || {};
					parsingOptions.sourceType = "script";
					return parse$1(code, parsingOptions, delegate);
				}
				exports$1.parseScript = parseScript;
				function tokenize(code, options, delegate) {
					var tokenizer = new tokenizer_1.Tokenizer(code, options);
					var tokens = [];
					try {
						while (true) {
							var token = tokenizer.getNextToken();
							if (!token) break;
							if (delegate) token = delegate(token);
							tokens.push(token);
						}
					} catch (e) {
						tokenizer.errorHandler.tolerate(e);
					}
					if (tokenizer.errorHandler.tolerant) tokens.errors = tokenizer.errors();
					return tokens;
				}
				exports$1.tokenize = tokenize;
				exports$1.Syntax = __webpack_require__(2).Syntax;
				exports$1.version = "4.0.1";
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var syntax_1 = __webpack_require__(2);
				exports$1.CommentHandler = function() {
					function CommentHandler() {
						this.attach = false;
						this.comments = [];
						this.stack = [];
						this.leading = [];
						this.trailing = [];
					}
					CommentHandler.prototype.insertInnerComments = function(node, metadata) {
						if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
							var innerComments = [];
							for (var i = this.leading.length - 1; i >= 0; --i) {
								var entry = this.leading[i];
								if (metadata.end.offset >= entry.start) {
									innerComments.unshift(entry.comment);
									this.leading.splice(i, 1);
									this.trailing.splice(i, 1);
								}
							}
							if (innerComments.length) node.innerComments = innerComments;
						}
					};
					CommentHandler.prototype.findTrailingComments = function(metadata) {
						var trailingComments = [];
						if (this.trailing.length > 0) {
							for (var i = this.trailing.length - 1; i >= 0; --i) {
								var entry_1 = this.trailing[i];
								if (entry_1.start >= metadata.end.offset) trailingComments.unshift(entry_1.comment);
							}
							this.trailing.length = 0;
							return trailingComments;
						}
						var entry = this.stack[this.stack.length - 1];
						if (entry && entry.node.trailingComments) {
							var firstComment = entry.node.trailingComments[0];
							if (firstComment && firstComment.range[0] >= metadata.end.offset) {
								trailingComments = entry.node.trailingComments;
								delete entry.node.trailingComments;
							}
						}
						return trailingComments;
					};
					CommentHandler.prototype.findLeadingComments = function(metadata) {
						var leadingComments = [];
						var target;
						while (this.stack.length > 0) {
							var entry = this.stack[this.stack.length - 1];
							if (entry && entry.start >= metadata.start.offset) {
								target = entry.node;
								this.stack.pop();
							} else break;
						}
						if (target) {
							for (var i = (target.leadingComments ? target.leadingComments.length : 0) - 1; i >= 0; --i) {
								var comment = target.leadingComments[i];
								if (comment.range[1] <= metadata.start.offset) {
									leadingComments.unshift(comment);
									target.leadingComments.splice(i, 1);
								}
							}
							if (target.leadingComments && target.leadingComments.length === 0) delete target.leadingComments;
							return leadingComments;
						}
						for (var i = this.leading.length - 1; i >= 0; --i) {
							var entry = this.leading[i];
							if (entry.start <= metadata.start.offset) {
								leadingComments.unshift(entry.comment);
								this.leading.splice(i, 1);
							}
						}
						return leadingComments;
					};
					CommentHandler.prototype.visitNode = function(node, metadata) {
						if (node.type === syntax_1.Syntax.Program && node.body.length > 0) return;
						this.insertInnerComments(node, metadata);
						var trailingComments = this.findTrailingComments(metadata);
						var leadingComments = this.findLeadingComments(metadata);
						if (leadingComments.length > 0) node.leadingComments = leadingComments;
						if (trailingComments.length > 0) node.trailingComments = trailingComments;
						this.stack.push({
							node,
							start: metadata.start.offset
						});
					};
					CommentHandler.prototype.visitComment = function(node, metadata) {
						var type = node.type[0] === "L" ? "Line" : "Block";
						var comment = {
							type,
							value: node.value
						};
						if (node.range) comment.range = node.range;
						if (node.loc) comment.loc = node.loc;
						this.comments.push(comment);
						if (this.attach) {
							var entry = {
								comment: {
									type,
									value: node.value,
									range: [metadata.start.offset, metadata.end.offset]
								},
								start: metadata.start.offset
							};
							if (node.loc) entry.comment.loc = node.loc;
							node.type = type;
							this.leading.push(entry);
							this.trailing.push(entry);
						}
					};
					CommentHandler.prototype.visit = function(node, metadata) {
						if (node.type === "LineComment") this.visitComment(node, metadata);
						else if (node.type === "BlockComment") this.visitComment(node, metadata);
						else if (this.attach) this.visitNode(node, metadata);
					};
					return CommentHandler;
				}();
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				exports$1.Syntax = {
					AssignmentExpression: "AssignmentExpression",
					AssignmentPattern: "AssignmentPattern",
					ArrayExpression: "ArrayExpression",
					ArrayPattern: "ArrayPattern",
					ArrowFunctionExpression: "ArrowFunctionExpression",
					AwaitExpression: "AwaitExpression",
					BlockStatement: "BlockStatement",
					BinaryExpression: "BinaryExpression",
					BreakStatement: "BreakStatement",
					CallExpression: "CallExpression",
					CatchClause: "CatchClause",
					ClassBody: "ClassBody",
					ClassDeclaration: "ClassDeclaration",
					ClassExpression: "ClassExpression",
					ConditionalExpression: "ConditionalExpression",
					ContinueStatement: "ContinueStatement",
					DoWhileStatement: "DoWhileStatement",
					DebuggerStatement: "DebuggerStatement",
					EmptyStatement: "EmptyStatement",
					ExportAllDeclaration: "ExportAllDeclaration",
					ExportDefaultDeclaration: "ExportDefaultDeclaration",
					ExportNamedDeclaration: "ExportNamedDeclaration",
					ExportSpecifier: "ExportSpecifier",
					ExpressionStatement: "ExpressionStatement",
					ForStatement: "ForStatement",
					ForOfStatement: "ForOfStatement",
					ForInStatement: "ForInStatement",
					FunctionDeclaration: "FunctionDeclaration",
					FunctionExpression: "FunctionExpression",
					Identifier: "Identifier",
					IfStatement: "IfStatement",
					ImportDeclaration: "ImportDeclaration",
					ImportDefaultSpecifier: "ImportDefaultSpecifier",
					ImportNamespaceSpecifier: "ImportNamespaceSpecifier",
					ImportSpecifier: "ImportSpecifier",
					Literal: "Literal",
					LabeledStatement: "LabeledStatement",
					LogicalExpression: "LogicalExpression",
					MemberExpression: "MemberExpression",
					MetaProperty: "MetaProperty",
					MethodDefinition: "MethodDefinition",
					NewExpression: "NewExpression",
					ObjectExpression: "ObjectExpression",
					ObjectPattern: "ObjectPattern",
					Program: "Program",
					Property: "Property",
					RestElement: "RestElement",
					ReturnStatement: "ReturnStatement",
					SequenceExpression: "SequenceExpression",
					SpreadElement: "SpreadElement",
					Super: "Super",
					SwitchCase: "SwitchCase",
					SwitchStatement: "SwitchStatement",
					TaggedTemplateExpression: "TaggedTemplateExpression",
					TemplateElement: "TemplateElement",
					TemplateLiteral: "TemplateLiteral",
					ThisExpression: "ThisExpression",
					ThrowStatement: "ThrowStatement",
					TryStatement: "TryStatement",
					UnaryExpression: "UnaryExpression",
					UpdateExpression: "UpdateExpression",
					VariableDeclaration: "VariableDeclaration",
					VariableDeclarator: "VariableDeclarator",
					WhileStatement: "WhileStatement",
					WithStatement: "WithStatement",
					YieldExpression: "YieldExpression"
				};
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				/* istanbul ignore next */
				var __extends$1 = this && this.__extends || (function() {
					var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d$1, b) {
						d$1.__proto__ = b;
					} || function(d$1, b) {
						for (var p in b) if (b.hasOwnProperty(p)) d$1[p] = b[p];
					};
					return function(d$1, b) {
						extendStatics(d$1, b);
						function __() {
							this.constructor = d$1;
						}
						d$1.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
					};
				})();
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var character_1 = __webpack_require__(4);
				var JSXNode = __webpack_require__(5);
				var jsx_syntax_1 = __webpack_require__(6);
				var Node = __webpack_require__(7);
				var parser_1 = __webpack_require__(8);
				var token_1 = __webpack_require__(13);
				var xhtml_entities_1 = __webpack_require__(14);
				token_1.TokenName[100] = "JSXIdentifier";
				token_1.TokenName[101] = "JSXText";
				function getQualifiedElementName(elementName) {
					var qualifiedName;
					switch (elementName.type) {
						case jsx_syntax_1.JSXSyntax.JSXIdentifier:
							qualifiedName = elementName.name;
							break;
						case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
							var ns = elementName;
							qualifiedName = getQualifiedElementName(ns.namespace) + ":" + getQualifiedElementName(ns.name);
							break;
						case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
							var expr = elementName;
							qualifiedName = getQualifiedElementName(expr.object) + "." + getQualifiedElementName(expr.property);
							break;
						default: break;
					}
					return qualifiedName;
				}
				exports$1.JSXParser = function(_super) {
					__extends$1(JSXParser, _super);
					function JSXParser(code, options, delegate) {
						return _super.call(this, code, options, delegate) || this;
					}
					JSXParser.prototype.parsePrimaryExpression = function() {
						return this.match("<") ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
					};
					JSXParser.prototype.startJSX = function() {
						this.scanner.index = this.startMarker.index;
						this.scanner.lineNumber = this.startMarker.line;
						this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
					};
					JSXParser.prototype.finishJSX = function() {
						this.nextToken();
					};
					JSXParser.prototype.reenterJSX = function() {
						this.startJSX();
						this.expectJSX("}");
						if (this.config.tokens) this.tokens.pop();
					};
					JSXParser.prototype.createJSXNode = function() {
						this.collectComments();
						return {
							index: this.scanner.index,
							line: this.scanner.lineNumber,
							column: this.scanner.index - this.scanner.lineStart
						};
					};
					JSXParser.prototype.createJSXChildNode = function() {
						return {
							index: this.scanner.index,
							line: this.scanner.lineNumber,
							column: this.scanner.index - this.scanner.lineStart
						};
					};
					JSXParser.prototype.scanXHTMLEntity = function(quote) {
						var result = "&";
						var valid = true;
						var terminated = false;
						var numeric = false;
						var hex = false;
						while (!this.scanner.eof() && valid && !terminated) {
							var ch = this.scanner.source[this.scanner.index];
							if (ch === quote) break;
							terminated = ch === ";";
							result += ch;
							++this.scanner.index;
							if (!terminated) switch (result.length) {
								case 2:
									numeric = ch === "#";
									break;
								case 3:
									if (numeric) {
										hex = ch === "x";
										valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
										numeric = numeric && !hex;
									}
									break;
								default:
									valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
									valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
									break;
							}
						}
						if (valid && terminated && result.length > 2) {
							var str = result.substr(1, result.length - 2);
							if (numeric && str.length > 1) result = String.fromCharCode(parseInt(str.substr(1), 10));
							else if (hex && str.length > 2) result = String.fromCharCode(parseInt("0" + str.substr(1), 16));
							else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) result = xhtml_entities_1.XHTMLEntities[str];
						}
						return result;
					};
					JSXParser.prototype.lexJSX = function() {
						var cp = this.scanner.source.charCodeAt(this.scanner.index);
						if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
							var value = this.scanner.source[this.scanner.index++];
							return {
								type: 7,
								value,
								lineNumber: this.scanner.lineNumber,
								lineStart: this.scanner.lineStart,
								start: this.scanner.index - 1,
								end: this.scanner.index
							};
						}
						if (cp === 34 || cp === 39) {
							var start = this.scanner.index;
							var quote = this.scanner.source[this.scanner.index++];
							var str = "";
							while (!this.scanner.eof()) {
								var ch = this.scanner.source[this.scanner.index++];
								if (ch === quote) break;
								else if (ch === "&") str += this.scanXHTMLEntity(quote);
								else str += ch;
							}
							return {
								type: 8,
								value: str,
								lineNumber: this.scanner.lineNumber,
								lineStart: this.scanner.lineStart,
								start,
								end: this.scanner.index
							};
						}
						if (cp === 46) {
							var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
							var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
							var value = n1 === 46 && n2 === 46 ? "..." : ".";
							var start = this.scanner.index;
							this.scanner.index += value.length;
							return {
								type: 7,
								value,
								lineNumber: this.scanner.lineNumber,
								lineStart: this.scanner.lineStart,
								start,
								end: this.scanner.index
							};
						}
						if (cp === 96) return {
							type: 10,
							value: "",
							lineNumber: this.scanner.lineNumber,
							lineStart: this.scanner.lineStart,
							start: this.scanner.index,
							end: this.scanner.index
						};
						if (character_1.Character.isIdentifierStart(cp) && cp !== 92) {
							var start = this.scanner.index;
							++this.scanner.index;
							while (!this.scanner.eof()) {
								var ch = this.scanner.source.charCodeAt(this.scanner.index);
								if (character_1.Character.isIdentifierPart(ch) && ch !== 92) ++this.scanner.index;
								else if (ch === 45) ++this.scanner.index;
								else break;
							}
							return {
								type: 100,
								value: this.scanner.source.slice(start, this.scanner.index),
								lineNumber: this.scanner.lineNumber,
								lineStart: this.scanner.lineStart,
								start,
								end: this.scanner.index
							};
						}
						return this.scanner.lex();
					};
					JSXParser.prototype.nextJSXToken = function() {
						this.collectComments();
						this.startMarker.index = this.scanner.index;
						this.startMarker.line = this.scanner.lineNumber;
						this.startMarker.column = this.scanner.index - this.scanner.lineStart;
						var token = this.lexJSX();
						this.lastMarker.index = this.scanner.index;
						this.lastMarker.line = this.scanner.lineNumber;
						this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
						if (this.config.tokens) this.tokens.push(this.convertToken(token));
						return token;
					};
					JSXParser.prototype.nextJSXText = function() {
						this.startMarker.index = this.scanner.index;
						this.startMarker.line = this.scanner.lineNumber;
						this.startMarker.column = this.scanner.index - this.scanner.lineStart;
						var start = this.scanner.index;
						var text = "";
						while (!this.scanner.eof()) {
							var ch = this.scanner.source[this.scanner.index];
							if (ch === "{" || ch === "<") break;
							++this.scanner.index;
							text += ch;
							if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
								++this.scanner.lineNumber;
								if (ch === "\r" && this.scanner.source[this.scanner.index] === "\n") ++this.scanner.index;
								this.scanner.lineStart = this.scanner.index;
							}
						}
						this.lastMarker.index = this.scanner.index;
						this.lastMarker.line = this.scanner.lineNumber;
						this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
						var token = {
							type: 101,
							value: text,
							lineNumber: this.scanner.lineNumber,
							lineStart: this.scanner.lineStart,
							start,
							end: this.scanner.index
						};
						if (text.length > 0 && this.config.tokens) this.tokens.push(this.convertToken(token));
						return token;
					};
					JSXParser.prototype.peekJSXToken = function() {
						var state$1 = this.scanner.saveState();
						this.scanner.scanComments();
						var next = this.lexJSX();
						this.scanner.restoreState(state$1);
						return next;
					};
					JSXParser.prototype.expectJSX = function(value) {
						var token = this.nextJSXToken();
						if (token.type !== 7 || token.value !== value) this.throwUnexpectedToken(token);
					};
					JSXParser.prototype.matchJSX = function(value) {
						var next = this.peekJSXToken();
						return next.type === 7 && next.value === value;
					};
					JSXParser.prototype.parseJSXIdentifier = function() {
						var node = this.createJSXNode();
						var token = this.nextJSXToken();
						if (token.type !== 100) this.throwUnexpectedToken(token);
						return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
					};
					JSXParser.prototype.parseJSXElementName = function() {
						var node = this.createJSXNode();
						var elementName = this.parseJSXIdentifier();
						if (this.matchJSX(":")) {
							var namespace = elementName;
							this.expectJSX(":");
							var name_1 = this.parseJSXIdentifier();
							elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
						} else if (this.matchJSX(".")) while (this.matchJSX(".")) {
							var object = elementName;
							this.expectJSX(".");
							var property = this.parseJSXIdentifier();
							elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
						}
						return elementName;
					};
					JSXParser.prototype.parseJSXAttributeName = function() {
						var node = this.createJSXNode();
						var attributeName;
						var identifier = this.parseJSXIdentifier();
						if (this.matchJSX(":")) {
							var namespace = identifier;
							this.expectJSX(":");
							var name_2 = this.parseJSXIdentifier();
							attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
						} else attributeName = identifier;
						return attributeName;
					};
					JSXParser.prototype.parseJSXStringLiteralAttribute = function() {
						var node = this.createJSXNode();
						var token = this.nextJSXToken();
						if (token.type !== 8) this.throwUnexpectedToken(token);
						var raw = this.getTokenRaw(token);
						return this.finalize(node, new Node.Literal(token.value, raw));
					};
					JSXParser.prototype.parseJSXExpressionAttribute = function() {
						var node = this.createJSXNode();
						this.expectJSX("{");
						this.finishJSX();
						if (this.match("}")) this.tolerateError("JSX attributes must only be assigned a non-empty expression");
						var expression = this.parseAssignmentExpression();
						this.reenterJSX();
						return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
					};
					JSXParser.prototype.parseJSXAttributeValue = function() {
						return this.matchJSX("{") ? this.parseJSXExpressionAttribute() : this.matchJSX("<") ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
					};
					JSXParser.prototype.parseJSXNameValueAttribute = function() {
						var node = this.createJSXNode();
						var name$1 = this.parseJSXAttributeName();
						var value = null;
						if (this.matchJSX("=")) {
							this.expectJSX("=");
							value = this.parseJSXAttributeValue();
						}
						return this.finalize(node, new JSXNode.JSXAttribute(name$1, value));
					};
					JSXParser.prototype.parseJSXSpreadAttribute = function() {
						var node = this.createJSXNode();
						this.expectJSX("{");
						this.expectJSX("...");
						this.finishJSX();
						var argument = this.parseAssignmentExpression();
						this.reenterJSX();
						return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
					};
					JSXParser.prototype.parseJSXAttributes = function() {
						var attributes = [];
						while (!this.matchJSX("/") && !this.matchJSX(">")) {
							var attribute = this.matchJSX("{") ? this.parseJSXSpreadAttribute() : this.parseJSXNameValueAttribute();
							attributes.push(attribute);
						}
						return attributes;
					};
					JSXParser.prototype.parseJSXOpeningElement = function() {
						var node = this.createJSXNode();
						this.expectJSX("<");
						var name$1 = this.parseJSXElementName();
						var attributes = this.parseJSXAttributes();
						var selfClosing = this.matchJSX("/");
						if (selfClosing) this.expectJSX("/");
						this.expectJSX(">");
						return this.finalize(node, new JSXNode.JSXOpeningElement(name$1, selfClosing, attributes));
					};
					JSXParser.prototype.parseJSXBoundaryElement = function() {
						var node = this.createJSXNode();
						this.expectJSX("<");
						if (this.matchJSX("/")) {
							this.expectJSX("/");
							var name_3 = this.parseJSXElementName();
							this.expectJSX(">");
							return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
						}
						var name$1 = this.parseJSXElementName();
						var attributes = this.parseJSXAttributes();
						var selfClosing = this.matchJSX("/");
						if (selfClosing) this.expectJSX("/");
						this.expectJSX(">");
						return this.finalize(node, new JSXNode.JSXOpeningElement(name$1, selfClosing, attributes));
					};
					JSXParser.prototype.parseJSXEmptyExpression = function() {
						var node = this.createJSXChildNode();
						this.collectComments();
						this.lastMarker.index = this.scanner.index;
						this.lastMarker.line = this.scanner.lineNumber;
						this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
						return this.finalize(node, new JSXNode.JSXEmptyExpression());
					};
					JSXParser.prototype.parseJSXExpressionContainer = function() {
						var node = this.createJSXNode();
						this.expectJSX("{");
						var expression;
						if (this.matchJSX("}")) {
							expression = this.parseJSXEmptyExpression();
							this.expectJSX("}");
						} else {
							this.finishJSX();
							expression = this.parseAssignmentExpression();
							this.reenterJSX();
						}
						return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
					};
					JSXParser.prototype.parseJSXChildren = function() {
						var children = [];
						while (!this.scanner.eof()) {
							var node = this.createJSXChildNode();
							var token = this.nextJSXText();
							if (token.start < token.end) {
								var raw = this.getTokenRaw(token);
								var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
								children.push(child);
							}
							if (this.scanner.source[this.scanner.index] === "{") {
								var container = this.parseJSXExpressionContainer();
								children.push(container);
							} else break;
						}
						return children;
					};
					JSXParser.prototype.parseComplexJSXElement = function(el) {
						var stack = [];
						while (!this.scanner.eof()) {
							el.children = el.children.concat(this.parseJSXChildren());
							var node = this.createJSXChildNode();
							var element = this.parseJSXBoundaryElement();
							if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
								var opening = element;
								if (opening.selfClosing) {
									var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
									el.children.push(child);
								} else {
									stack.push(el);
									el = {
										node,
										opening,
										closing: null,
										children: []
									};
								}
							}
							if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
								el.closing = element;
								var open_1 = getQualifiedElementName(el.opening.name);
								if (open_1 !== getQualifiedElementName(el.closing.name)) this.tolerateError("Expected corresponding JSX closing tag for %0", open_1);
								if (stack.length > 0) {
									var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
									el = stack[stack.length - 1];
									el.children.push(child);
									stack.pop();
								} else break;
							}
						}
						return el;
					};
					JSXParser.prototype.parseJSXElement = function() {
						var node = this.createJSXNode();
						var opening = this.parseJSXOpeningElement();
						var children = [];
						var closing = null;
						if (!opening.selfClosing) {
							var el = this.parseComplexJSXElement({
								node,
								opening,
								closing,
								children
							});
							children = el.children;
							closing = el.closing;
						}
						return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
					};
					JSXParser.prototype.parseJSXRoot = function() {
						if (this.config.tokens) this.tokens.pop();
						this.startJSX();
						var element = this.parseJSXElement();
						this.finishJSX();
						return element;
					};
					JSXParser.prototype.isStartOfExpression = function() {
						return _super.prototype.isStartOfExpression.call(this) || this.match("<");
					};
					return JSXParser;
				}(parser_1.Parser);
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var Regex = {
					NonAsciiIdentifierStart: /[\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\u08A0-\u08B4\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\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\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\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-\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\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\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\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\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\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[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\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]|\uD82C[\uDC00\uDC01]|\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]|\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]|\uD87E[\uDC00-\uDE1D]/,
					NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\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\u08A0-\u08B4\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\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\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\u0C81-\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\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\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\u1369-\u1371\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-\u19DA\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\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\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\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\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\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[\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\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\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]|\uD82C[\uDC00\uDC01]|\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]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\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]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
				};
				exports$1.Character = {
					fromCodePoint: function(cp) {
						return cp < 65536 ? String.fromCharCode(cp) : String.fromCharCode(55296 + (cp - 65536 >> 10)) + String.fromCharCode(56320 + (cp - 65536 & 1023));
					},
					isWhiteSpace: function(cp) {
						return cp === 32 || cp === 9 || cp === 11 || cp === 12 || cp === 160 || cp >= 5760 && [
							5760,
							8192,
							8193,
							8194,
							8195,
							8196,
							8197,
							8198,
							8199,
							8200,
							8201,
							8202,
							8239,
							8287,
							12288,
							65279
						].indexOf(cp) >= 0;
					},
					isLineTerminator: function(cp) {
						return cp === 10 || cp === 13 || cp === 8232 || cp === 8233;
					},
					isIdentifierStart: function(cp) {
						return cp === 36 || cp === 95 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 92 || cp >= 128 && Regex.NonAsciiIdentifierStart.test(exports$1.Character.fromCodePoint(cp));
					},
					isIdentifierPart: function(cp) {
						return cp === 36 || cp === 95 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp >= 48 && cp <= 57 || cp === 92 || cp >= 128 && Regex.NonAsciiIdentifierPart.test(exports$1.Character.fromCodePoint(cp));
					},
					isDecimalDigit: function(cp) {
						return cp >= 48 && cp <= 57;
					},
					isHexDigit: function(cp) {
						return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 70 || cp >= 97 && cp <= 102;
					},
					isOctalDigit: function(cp) {
						return cp >= 48 && cp <= 55;
					}
				};
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var jsx_syntax_1 = __webpack_require__(6);
				exports$1.JSXClosingElement = function() {
					function JSXClosingElement(name$1) {
						this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
						this.name = name$1;
					}
					return JSXClosingElement;
				}();
				exports$1.JSXElement = function() {
					function JSXElement(openingElement, children, closingElement) {
						this.type = jsx_syntax_1.JSXSyntax.JSXElement;
						this.openingElement = openingElement;
						this.children = children;
						this.closingElement = closingElement;
					}
					return JSXElement;
				}();
				exports$1.JSXEmptyExpression = function() {
					function JSXEmptyExpression() {
						this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
					}
					return JSXEmptyExpression;
				}();
				exports$1.JSXExpressionContainer = function() {
					function JSXExpressionContainer(expression) {
						this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
						this.expression = expression;
					}
					return JSXExpressionContainer;
				}();
				exports$1.JSXIdentifier = function() {
					function JSXIdentifier(name$1) {
						this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
						this.name = name$1;
					}
					return JSXIdentifier;
				}();
				exports$1.JSXMemberExpression = function() {
					function JSXMemberExpression(object, property) {
						this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
						this.object = object;
						this.property = property;
					}
					return JSXMemberExpression;
				}();
				exports$1.JSXAttribute = function() {
					function JSXAttribute(name$1, value) {
						this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
						this.name = name$1;
						this.value = value;
					}
					return JSXAttribute;
				}();
				exports$1.JSXNamespacedName = function() {
					function JSXNamespacedName(namespace, name$1) {
						this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
						this.namespace = namespace;
						this.name = name$1;
					}
					return JSXNamespacedName;
				}();
				exports$1.JSXOpeningElement = function() {
					function JSXOpeningElement(name$1, selfClosing, attributes) {
						this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
						this.name = name$1;
						this.selfClosing = selfClosing;
						this.attributes = attributes;
					}
					return JSXOpeningElement;
				}();
				exports$1.JSXSpreadAttribute = function() {
					function JSXSpreadAttribute(argument) {
						this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
						this.argument = argument;
					}
					return JSXSpreadAttribute;
				}();
				exports$1.JSXText = function() {
					function JSXText(value, raw) {
						this.type = jsx_syntax_1.JSXSyntax.JSXText;
						this.value = value;
						this.raw = raw;
					}
					return JSXText;
				}();
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				exports$1.JSXSyntax = {
					JSXAttribute: "JSXAttribute",
					JSXClosingElement: "JSXClosingElement",
					JSXElement: "JSXElement",
					JSXEmptyExpression: "JSXEmptyExpression",
					JSXExpressionContainer: "JSXExpressionContainer",
					JSXIdentifier: "JSXIdentifier",
					JSXMemberExpression: "JSXMemberExpression",
					JSXNamespacedName: "JSXNamespacedName",
					JSXOpeningElement: "JSXOpeningElement",
					JSXSpreadAttribute: "JSXSpreadAttribute",
					JSXText: "JSXText"
				};
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var syntax_1 = __webpack_require__(2);
				exports$1.ArrayExpression = function() {
					function ArrayExpression(elements) {
						this.type = syntax_1.Syntax.ArrayExpression;
						this.elements = elements;
					}
					return ArrayExpression;
				}();
				exports$1.ArrayPattern = function() {
					function ArrayPattern(elements) {
						this.type = syntax_1.Syntax.ArrayPattern;
						this.elements = elements;
					}
					return ArrayPattern;
				}();
				exports$1.ArrowFunctionExpression = function() {
					function ArrowFunctionExpression(params, body, expression) {
						this.type = syntax_1.Syntax.ArrowFunctionExpression;
						this.id = null;
						this.params = params;
						this.body = body;
						this.generator = false;
						this.expression = expression;
						this.async = false;
					}
					return ArrowFunctionExpression;
				}();
				exports$1.AssignmentExpression = function() {
					function AssignmentExpression(operator, left, right) {
						this.type = syntax_1.Syntax.AssignmentExpression;
						this.operator = operator;
						this.left = left;
						this.right = right;
					}
					return AssignmentExpression;
				}();
				exports$1.AssignmentPattern = function() {
					function AssignmentPattern(left, right) {
						this.type = syntax_1.Syntax.AssignmentPattern;
						this.left = left;
						this.right = right;
					}
					return AssignmentPattern;
				}();
				exports$1.AsyncArrowFunctionExpression = function() {
					function AsyncArrowFunctionExpression(params, body, expression) {
						this.type = syntax_1.Syntax.ArrowFunctionExpression;
						this.id = null;
						this.params = params;
						this.body = body;
						this.generator = false;
						this.expression = expression;
						this.async = true;
					}
					return AsyncArrowFunctionExpression;
				}();
				exports$1.AsyncFunctionDeclaration = function() {
					function AsyncFunctionDeclaration(id, params, body) {
						this.type = syntax_1.Syntax.FunctionDeclaration;
						this.id = id;
						this.params = params;
						this.body = body;
						this.generator = false;
						this.expression = false;
						this.async = true;
					}
					return AsyncFunctionDeclaration;
				}();
				exports$1.AsyncFunctionExpression = function() {
					function AsyncFunctionExpression(id, params, body) {
						this.type = syntax_1.Syntax.FunctionExpression;
						this.id = id;
						this.params = params;
						this.body = body;
						this.generator = false;
						this.expression = false;
						this.async = true;
					}
					return AsyncFunctionExpression;
				}();
				exports$1.AwaitExpression = function() {
					function AwaitExpression(argument) {
						this.type = syntax_1.Syntax.AwaitExpression;
						this.argument = argument;
					}
					return AwaitExpression;
				}();
				exports$1.BinaryExpression = function() {
					function BinaryExpression(operator, left, right) {
						this.type = operator === "||" || operator === "&&" ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
						this.operator = operator;
						this.left = left;
						this.right = right;
					}
					return BinaryExpression;
				}();
				exports$1.BlockStatement = function() {
					function BlockStatement(body) {
						this.type = syntax_1.Syntax.BlockStatement;
						this.body = body;
					}
					return BlockStatement;
				}();
				exports$1.BreakStatement = function() {
					function BreakStatement(label) {
						this.type = syntax_1.Syntax.BreakStatement;
						this.label = label;
					}
					return BreakStatement;
				}();
				exports$1.CallExpression = function() {
					function CallExpression(callee, args) {
						this.type = syntax_1.Syntax.CallExpression;
						this.callee = callee;
						this.arguments = args;
					}
					return CallExpression;
				}();
				exports$1.CatchClause = function() {
					function CatchClause(param, body) {
						this.type = syntax_1.Syntax.CatchClause;
						this.param = param;
						this.body = body;
					}
					return CatchClause;
				}();
				exports$1.ClassBody = function() {
					function ClassBody(body) {
						this.type = syntax_1.Syntax.ClassBody;
						this.body = body;
					}
					return ClassBody;
				}();
				exports$1.ClassDeclaration = function() {
					function ClassDeclaration(id, superClass, body) {
						this.type = syntax_1.Syntax.ClassDeclaration;
						this.id = id;
						this.superClass = superClass;
						this.body = body;
					}
					return ClassDeclaration;
				}();
				exports$1.ClassExpression = function() {
					function ClassExpression(id, superClass, body) {
						this.type = syntax_1.Syntax.ClassExpression;
						this.id = id;
						this.superClass = superClass;
						this.body = body;
					}
					return ClassExpression;
				}();
				exports$1.ComputedMemberExpression = function() {
					function ComputedMemberExpression(object, property) {
						this.type = syntax_1.Syntax.MemberExpression;
						this.computed = true;
						this.object = object;
						this.property = property;
					}
					return ComputedMemberExpression;
				}();
				exports$1.ConditionalExpression = function() {
					function ConditionalExpression(test$1, consequent, alternate) {
						this.type = syntax_1.Syntax.ConditionalExpression;
						this.test = test$1;
						this.consequent = consequent;
						this.alternate = alternate;
					}
					return ConditionalExpression;
				}();
				exports$1.ContinueStatement = function() {
					function ContinueStatement(label) {
						this.type = syntax_1.Syntax.ContinueStatement;
						this.label = label;
					}
					return ContinueStatement;
				}();
				exports$1.DebuggerStatement = function() {
					function DebuggerStatement() {
						this.type = syntax_1.Syntax.DebuggerStatement;
					}
					return DebuggerStatement;
				}();
				exports$1.Directive = function() {
					function Directive(expression, directive) {
						this.type = syntax_1.Syntax.ExpressionStatement;
						this.expression = expression;
						this.directive = directive;
					}
					return Directive;
				}();
				exports$1.DoWhileStatement = function() {
					function DoWhileStatement(body, test$1) {
						this.type = syntax_1.Syntax.DoWhileStatement;
						this.body = body;
						this.test = test$1;
					}
					return DoWhileStatement;
				}();
				exports$1.EmptyStatement = function() {
					function EmptyStatement() {
						this.type = syntax_1.Syntax.EmptyStatement;
					}
					return EmptyStatement;
				}();
				exports$1.ExportAllDeclaration = function() {
					function ExportAllDeclaration(source) {
						this.type = syntax_1.Syntax.ExportAllDeclaration;
						this.source = source;
					}
					return ExportAllDeclaration;
				}();
				exports$1.ExportDefaultDeclaration = function() {
					function ExportDefaultDeclaration(declaration) {
						this.type = syntax_1.Syntax.ExportDefaultDeclaration;
						this.declaration = declaration;
					}
					return ExportDefaultDeclaration;
				}();
				exports$1.ExportNamedDeclaration = function() {
					function ExportNamedDeclaration(declaration, specifiers, source) {
						this.type = syntax_1.Syntax.ExportNamedDeclaration;
						this.declaration = declaration;
						this.specifiers = specifiers;
						this.source = source;
					}
					return ExportNamedDeclaration;
				}();
				exports$1.ExportSpecifier = function() {
					function ExportSpecifier(local, exported) {
						this.type = syntax_1.Syntax.ExportSpecifier;
						this.exported = exported;
						this.local = local;
					}
					return ExportSpecifier;
				}();
				exports$1.ExpressionStatement = function() {
					function ExpressionStatement(expression) {
						this.type = syntax_1.Syntax.ExpressionStatement;
						this.expression = expression;
					}
					return ExpressionStatement;
				}();
				exports$1.ForInStatement = function() {
					function ForInStatement(left, right, body) {
						this.type = syntax_1.Syntax.ForInStatement;
						this.left = left;
						this.right = right;
						this.body = body;
						this.each = false;
					}
					return ForInStatement;
				}();
				exports$1.ForOfStatement = function() {
					function ForOfStatement(left, right, body) {
						this.type = syntax_1.Syntax.ForOfStatement;
						this.left = left;
						this.right = right;
						this.body = body;
					}
					return ForOfStatement;
				}();
				exports$1.ForStatement = function() {
					function ForStatement(init$1, test$1, update, body) {
						this.type = syntax_1.Syntax.ForStatement;
						this.init = init$1;
						this.test = test$1;
						this.update = update;
						this.body = body;
					}
					return ForStatement;
				}();
				exports$1.FunctionDeclaration = function() {
					function FunctionDeclaration(id, params, body, generator) {
						this.type = syntax_1.Syntax.FunctionDeclaration;
						this.id = id;
						this.params = params;
						this.body = body;
						this.generator = generator;
						this.expression = false;
						this.async = false;
					}
					return FunctionDeclaration;
				}();
				exports$1.FunctionExpression = function() {
					function FunctionExpression(id, params, body, generator) {
						this.type = syntax_1.Syntax.FunctionExpression;
						this.id = id;
						this.params = params;
						this.body = body;
						this.generator = generator;
						this.expression = false;
						this.async = false;
					}
					return FunctionExpression;
				}();
				exports$1.Identifier = function() {
					function Identifier(name$1) {
						this.type = syntax_1.Syntax.Identifier;
						this.name = name$1;
					}
					return Identifier;
				}();
				exports$1.IfStatement = function() {
					function IfStatement(test$1, consequent, alternate) {
						this.type = syntax_1.Syntax.IfStatement;
						this.test = test$1;
						this.consequent = consequent;
						this.alternate = alternate;
					}
					return IfStatement;
				}();
				exports$1.ImportDeclaration = function() {
					function ImportDeclaration(specifiers, source) {
						this.type = syntax_1.Syntax.ImportDeclaration;
						this.specifiers = specifiers;
						this.source = source;
					}
					return ImportDeclaration;
				}();
				exports$1.ImportDefaultSpecifier = function() {
					function ImportDefaultSpecifier(local) {
						this.type = syntax_1.Syntax.ImportDefaultSpecifier;
						this.local = local;
					}
					return ImportDefaultSpecifier;
				}();
				exports$1.ImportNamespaceSpecifier = function() {
					function ImportNamespaceSpecifier(local) {
						this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
						this.local = local;
					}
					return ImportNamespaceSpecifier;
				}();
				exports$1.ImportSpecifier = function() {
					function ImportSpecifier(local, imported) {
						this.type = syntax_1.Syntax.ImportSpecifier;
						this.local = local;
						this.imported = imported;
					}
					return ImportSpecifier;
				}();
				exports$1.LabeledStatement = function() {
					function LabeledStatement(label, body) {
						this.type = syntax_1.Syntax.LabeledStatement;
						this.label = label;
						this.body = body;
					}
					return LabeledStatement;
				}();
				exports$1.Literal = function() {
					function Literal(value, raw) {
						this.type = syntax_1.Syntax.Literal;
						this.value = value;
						this.raw = raw;
					}
					return Literal;
				}();
				exports$1.MetaProperty = function() {
					function MetaProperty(meta, property) {
						this.type = syntax_1.Syntax.MetaProperty;
						this.meta = meta;
						this.property = property;
					}
					return MetaProperty;
				}();
				exports$1.MethodDefinition = function() {
					function MethodDefinition(key, computed, value, kind, isStatic) {
						this.type = syntax_1.Syntax.MethodDefinition;
						this.key = key;
						this.computed = computed;
						this.value = value;
						this.kind = kind;
						this.static = isStatic;
					}
					return MethodDefinition;
				}();
				exports$1.Module = function() {
					function Module(body) {
						this.type = syntax_1.Syntax.Program;
						this.body = body;
						this.sourceType = "module";
					}
					return Module;
				}();
				exports$1.NewExpression = function() {
					function NewExpression(callee, args) {
						this.type = syntax_1.Syntax.NewExpression;
						this.callee = callee;
						this.arguments = args;
					}
					return NewExpression;
				}();
				exports$1.ObjectExpression = function() {
					function ObjectExpression(properties) {
						this.type = syntax_1.Syntax.ObjectExpression;
						this.properties = properties;
					}
					return ObjectExpression;
				}();
				exports$1.ObjectPattern = function() {
					function ObjectPattern(properties) {
						this.type = syntax_1.Syntax.ObjectPattern;
						this.properties = properties;
					}
					return ObjectPattern;
				}();
				exports$1.Property = function() {
					function Property(kind, key, computed, value, method, shorthand) {
						this.type = syntax_1.Syntax.Property;
						this.key = key;
						this.computed = computed;
						this.value = value;
						this.kind = kind;
						this.method = method;
						this.shorthand = shorthand;
					}
					return Property;
				}();
				exports$1.RegexLiteral = function() {
					function RegexLiteral(value, raw, pattern, flags) {
						this.type = syntax_1.Syntax.Literal;
						this.value = value;
						this.raw = raw;
						this.regex = {
							pattern,
							flags
						};
					}
					return RegexLiteral;
				}();
				exports$1.RestElement = function() {
					function RestElement(argument) {
						this.type = syntax_1.Syntax.RestElement;
						this.argument = argument;
					}
					return RestElement;
				}();
				exports$1.ReturnStatement = function() {
					function ReturnStatement(argument) {
						this.type = syntax_1.Syntax.ReturnStatement;
						this.argument = argument;
					}
					return ReturnStatement;
				}();
				exports$1.Script = function() {
					function Script(body) {
						this.type = syntax_1.Syntax.Program;
						this.body = body;
						this.sourceType = "script";
					}
					return Script;
				}();
				exports$1.SequenceExpression = function() {
					function SequenceExpression(expressions) {
						this.type = syntax_1.Syntax.SequenceExpression;
						this.expressions = expressions;
					}
					return SequenceExpression;
				}();
				exports$1.SpreadElement = function() {
					function SpreadElement(argument) {
						this.type = syntax_1.Syntax.SpreadElement;
						this.argument = argument;
					}
					return SpreadElement;
				}();
				exports$1.StaticMemberExpression = function() {
					function StaticMemberExpression(object, property) {
						this.type = syntax_1.Syntax.MemberExpression;
						this.computed = false;
						this.object = object;
						this.property = property;
					}
					return StaticMemberExpression;
				}();
				exports$1.Super = function() {
					function Super() {
						this.type = syntax_1.Syntax.Super;
					}
					return Super;
				}();
				exports$1.SwitchCase = function() {
					function SwitchCase(test$1, consequent) {
						this.type = syntax_1.Syntax.SwitchCase;
						this.test = test$1;
						this.consequent = consequent;
					}
					return SwitchCase;
				}();
				exports$1.SwitchStatement = function() {
					function SwitchStatement(discriminant, cases) {
						this.type = syntax_1.Syntax.SwitchStatement;
						this.discriminant = discriminant;
						this.cases = cases;
					}
					return SwitchStatement;
				}();
				exports$1.TaggedTemplateExpression = function() {
					function TaggedTemplateExpression(tag, quasi) {
						this.type = syntax_1.Syntax.TaggedTemplateExpression;
						this.tag = tag;
						this.quasi = quasi;
					}
					return TaggedTemplateExpression;
				}();
				exports$1.TemplateElement = function() {
					function TemplateElement(value, tail$1) {
						this.type = syntax_1.Syntax.TemplateElement;
						this.value = value;
						this.tail = tail$1;
					}
					return TemplateElement;
				}();
				exports$1.TemplateLiteral = function() {
					function TemplateLiteral(quasis, expressions) {
						this.type = syntax_1.Syntax.TemplateLiteral;
						this.quasis = quasis;
						this.expressions = expressions;
					}
					return TemplateLiteral;
				}();
				exports$1.ThisExpression = function() {
					function ThisExpression() {
						this.type = syntax_1.Syntax.ThisExpression;
					}
					return ThisExpression;
				}();
				exports$1.ThrowStatement = function() {
					function ThrowStatement(argument) {
						this.type = syntax_1.Syntax.ThrowStatement;
						this.argument = argument;
					}
					return ThrowStatement;
				}();
				exports$1.TryStatement = function() {
					function TryStatement(block, handler, finalizer) {
						this.type = syntax_1.Syntax.TryStatement;
						this.block = block;
						this.handler = handler;
						this.finalizer = finalizer;
					}
					return TryStatement;
				}();
				exports$1.UnaryExpression = function() {
					function UnaryExpression(operator, argument) {
						this.type = syntax_1.Syntax.UnaryExpression;
						this.operator = operator;
						this.argument = argument;
						this.prefix = true;
					}
					return UnaryExpression;
				}();
				exports$1.UpdateExpression = function() {
					function UpdateExpression(operator, argument, prefix) {
						this.type = syntax_1.Syntax.UpdateExpression;
						this.operator = operator;
						this.argument = argument;
						this.prefix = prefix;
					}
					return UpdateExpression;
				}();
				exports$1.VariableDeclaration = function() {
					function VariableDeclaration(declarations, kind) {
						this.type = syntax_1.Syntax.VariableDeclaration;
						this.declarations = declarations;
						this.kind = kind;
					}
					return VariableDeclaration;
				}();
				exports$1.VariableDeclarator = function() {
					function VariableDeclarator(id, init$1) {
						this.type = syntax_1.Syntax.VariableDeclarator;
						this.id = id;
						this.init = init$1;
					}
					return VariableDeclarator;
				}();
				exports$1.WhileStatement = function() {
					function WhileStatement(test$1, body) {
						this.type = syntax_1.Syntax.WhileStatement;
						this.test = test$1;
						this.body = body;
					}
					return WhileStatement;
				}();
				exports$1.WithStatement = function() {
					function WithStatement(object, body) {
						this.type = syntax_1.Syntax.WithStatement;
						this.object = object;
						this.body = body;
					}
					return WithStatement;
				}();
				exports$1.YieldExpression = function() {
					function YieldExpression(argument, delegate) {
						this.type = syntax_1.Syntax.YieldExpression;
						this.argument = argument;
						this.delegate = delegate;
					}
					return YieldExpression;
				}();
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var assert_1$1 = __webpack_require__(9);
				var error_handler_1 = __webpack_require__(10);
				var messages_1 = __webpack_require__(11);
				var Node = __webpack_require__(7);
				var scanner_1 = __webpack_require__(12);
				var syntax_1 = __webpack_require__(2);
				var token_1 = __webpack_require__(13);
				var ArrowParameterPlaceHolder = "ArrowParameterPlaceHolder";
				exports$1.Parser = function() {
					function Parser$1(code, options, delegate) {
						if (options === void 0) options = {};
						this.config = {
							range: typeof options.range === "boolean" && options.range,
							loc: typeof options.loc === "boolean" && options.loc,
							source: null,
							tokens: typeof options.tokens === "boolean" && options.tokens,
							comment: typeof options.comment === "boolean" && options.comment,
							tolerant: typeof options.tolerant === "boolean" && options.tolerant
						};
						if (this.config.loc && options.source && options.source !== null) this.config.source = String(options.source);
						this.delegate = delegate;
						this.errorHandler = new error_handler_1.ErrorHandler();
						this.errorHandler.tolerant = this.config.tolerant;
						this.scanner = new scanner_1.Scanner(code, this.errorHandler);
						this.scanner.trackComment = this.config.comment;
						this.operatorPrecedence = {
							")": 0,
							";": 0,
							",": 0,
							"=": 0,
							"]": 0,
							"||": 1,
							"&&": 2,
							"|": 3,
							"^": 4,
							"&": 5,
							"==": 6,
							"!=": 6,
							"===": 6,
							"!==": 6,
							"<": 7,
							">": 7,
							"<=": 7,
							">=": 7,
							"<<": 8,
							">>": 8,
							">>>": 8,
							"+": 9,
							"-": 9,
							"*": 11,
							"/": 11,
							"%": 11
						};
						this.lookahead = {
							type: 2,
							value: "",
							lineNumber: this.scanner.lineNumber,
							lineStart: 0,
							start: 0,
							end: 0
						};
						this.hasLineTerminator = false;
						this.context = {
							isModule: false,
							await: false,
							allowIn: true,
							allowStrictDirective: true,
							allowYield: true,
							firstCoverInitializedNameError: null,
							isAssignmentTarget: false,
							isBindingElement: false,
							inFunctionBody: false,
							inIteration: false,
							inSwitch: false,
							labelSet: {},
							strict: false
						};
						this.tokens = [];
						this.startMarker = {
							index: 0,
							line: this.scanner.lineNumber,
							column: 0
						};
						this.lastMarker = {
							index: 0,
							line: this.scanner.lineNumber,
							column: 0
						};
						this.nextToken();
						this.lastMarker = {
							index: this.scanner.index,
							line: this.scanner.lineNumber,
							column: this.scanner.index - this.scanner.lineStart
						};
					}
					Parser$1.prototype.throwError = function(messageFormat) {
						var values = [];
						for (var _i = 1; _i < arguments.length; _i++) values[_i - 1] = arguments[_i];
						var args = Array.prototype.slice.call(arguments, 1);
						var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) {
							assert_1$1.assert(idx < args.length, "Message reference must be in range");
							return args[idx];
						});
						var index = this.lastMarker.index;
						var line = this.lastMarker.line;
						var column = this.lastMarker.column + 1;
						throw this.errorHandler.createError(index, line, column, msg);
					};
					Parser$1.prototype.tolerateError = function(messageFormat) {
						var values = [];
						for (var _i = 1; _i < arguments.length; _i++) values[_i - 1] = arguments[_i];
						var args = Array.prototype.slice.call(arguments, 1);
						var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) {
							assert_1$1.assert(idx < args.length, "Message reference must be in range");
							return args[idx];
						});
						var index = this.lastMarker.index;
						var line = this.scanner.lineNumber;
						var column = this.lastMarker.column + 1;
						this.errorHandler.tolerateError(index, line, column, msg);
					};
					Parser$1.prototype.unexpectedTokenError = function(token, message) {
						var msg = message || messages_1.Messages.UnexpectedToken;
						var value;
						if (token) {
							if (!message) {
								msg = token.type === 2 ? messages_1.Messages.UnexpectedEOS : token.type === 3 ? messages_1.Messages.UnexpectedIdentifier : token.type === 6 ? messages_1.Messages.UnexpectedNumber : token.type === 8 ? messages_1.Messages.UnexpectedString : token.type === 10 ? messages_1.Messages.UnexpectedTemplate : messages_1.Messages.UnexpectedToken;
								if (token.type === 4) {
									if (this.scanner.isFutureReservedWord(token.value)) msg = messages_1.Messages.UnexpectedReserved;
									else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) msg = messages_1.Messages.StrictReservedWord;
								}
							}
							value = token.value;
						} else value = "ILLEGAL";
						msg = msg.replace("%0", value);
						if (token && typeof token.lineNumber === "number") {
							var index = token.start;
							var line = token.lineNumber;
							var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
							var column = token.start - lastMarkerLineStart + 1;
							return this.errorHandler.createError(index, line, column, msg);
						} else {
							var index = this.lastMarker.index;
							var line = this.lastMarker.line;
							var column = this.lastMarker.column + 1;
							return this.errorHandler.createError(index, line, column, msg);
						}
					};
					Parser$1.prototype.throwUnexpectedToken = function(token, message) {
						throw this.unexpectedTokenError(token, message);
					};
					Parser$1.prototype.tolerateUnexpectedToken = function(token, message) {
						this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
					};
					Parser$1.prototype.collectComments = function() {
						if (!this.config.comment) this.scanner.scanComments();
						else {
							var comments = this.scanner.scanComments();
							if (comments.length > 0 && this.delegate) for (var i = 0; i < comments.length; ++i) {
								var e = comments[i];
								var node = void 0;
								node = {
									type: e.multiLine ? "BlockComment" : "LineComment",
									value: this.scanner.source.slice(e.slice[0], e.slice[1])
								};
								if (this.config.range) node.range = e.range;
								if (this.config.loc) node.loc = e.loc;
								var metadata = {
									start: {
										line: e.loc.start.line,
										column: e.loc.start.column,
										offset: e.range[0]
									},
									end: {
										line: e.loc.end.line,
										column: e.loc.end.column,
										offset: e.range[1]
									}
								};
								this.delegate(node, metadata);
							}
						}
					};
					Parser$1.prototype.getTokenRaw = function(token) {
						return this.scanner.source.slice(token.start, token.end);
					};
					Parser$1.prototype.convertToken = function(token) {
						var t = {
							type: token_1.TokenName[token.type],
							value: this.getTokenRaw(token)
						};
						if (this.config.range) t.range = [token.start, token.end];
						if (this.config.loc) t.loc = {
							start: {
								line: this.startMarker.line,
								column: this.startMarker.column
							},
							end: {
								line: this.scanner.lineNumber,
								column: this.scanner.index - this.scanner.lineStart
							}
						};
						if (token.type === 9) t.regex = {
							pattern: token.pattern,
							flags: token.flags
						};
						return t;
					};
					Parser$1.prototype.nextToken = function() {
						var token = this.lookahead;
						this.lastMarker.index = this.scanner.index;
						this.lastMarker.line = this.scanner.lineNumber;
						this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
						this.collectComments();
						if (this.scanner.index !== this.startMarker.index) {
							this.startMarker.index = this.scanner.index;
							this.startMarker.line = this.scanner.lineNumber;
							this.startMarker.column = this.scanner.index - this.scanner.lineStart;
						}
						var next = this.scanner.lex();
						this.hasLineTerminator = token.lineNumber !== next.lineNumber;
						if (next && this.context.strict && next.type === 3) {
							if (this.scanner.isStrictModeReservedWord(next.value)) next.type = 4;
						}
						this.lookahead = next;
						if (this.config.tokens && next.type !== 2) this.tokens.push(this.convertToken(next));
						return token;
					};
					Parser$1.prototype.nextRegexToken = function() {
						this.collectComments();
						var token = this.scanner.scanRegExp();
						if (this.config.tokens) {
							this.tokens.pop();
							this.tokens.push(this.convertToken(token));
						}
						this.lookahead = token;
						this.nextToken();
						return token;
					};
					Parser$1.prototype.createNode = function() {
						return {
							index: this.startMarker.index,
							line: this.startMarker.line,
							column: this.startMarker.column
						};
					};
					Parser$1.prototype.startNode = function(token, lastLineStart) {
						if (lastLineStart === void 0) lastLineStart = 0;
						var column = token.start - token.lineStart;
						var line = token.lineNumber;
						if (column < 0) {
							column += lastLineStart;
							line--;
						}
						return {
							index: token.start,
							line,
							column
						};
					};
					Parser$1.prototype.finalize = function(marker, node) {
						if (this.config.range) node.range = [marker.index, this.lastMarker.index];
						if (this.config.loc) {
							node.loc = {
								start: {
									line: marker.line,
									column: marker.column
								},
								end: {
									line: this.lastMarker.line,
									column: this.lastMarker.column
								}
							};
							if (this.config.source) node.loc.source = this.config.source;
						}
						if (this.delegate) {
							var metadata = {
								start: {
									line: marker.line,
									column: marker.column,
									offset: marker.index
								},
								end: {
									line: this.lastMarker.line,
									column: this.lastMarker.column,
									offset: this.lastMarker.index
								}
							};
							this.delegate(node, metadata);
						}
						return node;
					};
					Parser$1.prototype.expect = function(value) {
						var token = this.nextToken();
						if (token.type !== 7 || token.value !== value) this.throwUnexpectedToken(token);
					};
					Parser$1.prototype.expectCommaSeparator = function() {
						if (this.config.tolerant) {
							var token = this.lookahead;
							if (token.type === 7 && token.value === ",") this.nextToken();
							else if (token.type === 7 && token.value === ";") {
								this.nextToken();
								this.tolerateUnexpectedToken(token);
							} else this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
						} else this.expect(",");
					};
					Parser$1.prototype.expectKeyword = function(keyword) {
						var token = this.nextToken();
						if (token.type !== 4 || token.value !== keyword) this.throwUnexpectedToken(token);
					};
					Parser$1.prototype.match = function(value) {
						return this.lookahead.type === 7 && this.lookahead.value === value;
					};
					Parser$1.prototype.matchKeyword = function(keyword) {
						return this.lookahead.type === 4 && this.lookahead.value === keyword;
					};
					Parser$1.prototype.matchContextualKeyword = function(keyword) {
						return this.lookahead.type === 3 && this.lookahead.value === keyword;
					};
					Parser$1.prototype.matchAssign = function() {
						if (this.lookahead.type !== 7) return false;
						var op = this.lookahead.value;
						return op === "=" || op === "*=" || op === "**=" || op === "/=" || op === "%=" || op === "+=" || op === "-=" || op === "<<=" || op === ">>=" || op === ">>>=" || op === "&=" || op === "^=" || op === "|=";
					};
					Parser$1.prototype.isolateCoverGrammar = function(parseFunction) {
						var previousIsBindingElement = this.context.isBindingElement;
						var previousIsAssignmentTarget = this.context.isAssignmentTarget;
						var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
						this.context.isBindingElement = true;
						this.context.isAssignmentTarget = true;
						this.context.firstCoverInitializedNameError = null;
						var result = parseFunction.call(this);
						if (this.context.firstCoverInitializedNameError !== null) this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
						this.context.isBindingElement = previousIsBindingElement;
						this.context.isAssignmentTarget = previousIsAssignmentTarget;
						this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
						return result;
					};
					Parser$1.prototype.inheritCoverGrammar = function(parseFunction) {
						var previousIsBindingElement = this.context.isBindingElement;
						var previousIsAssignmentTarget = this.context.isAssignmentTarget;
						var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
						this.context.isBindingElement = true;
						this.context.isAssignmentTarget = true;
						this.context.firstCoverInitializedNameError = null;
						var result = parseFunction.call(this);
						this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
						this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
						this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
						return result;
					};
					Parser$1.prototype.consumeSemicolon = function() {
						if (this.match(";")) this.nextToken();
						else if (!this.hasLineTerminator) {
							if (this.lookahead.type !== 2 && !this.match("}")) this.throwUnexpectedToken(this.lookahead);
							this.lastMarker.index = this.startMarker.index;
							this.lastMarker.line = this.startMarker.line;
							this.lastMarker.column = this.startMarker.column;
						}
					};
					Parser$1.prototype.parsePrimaryExpression = function() {
						var node = this.createNode();
						var expr;
						var token, raw;
						switch (this.lookahead.type) {
							case 3:
								if ((this.context.isModule || this.context.await) && this.lookahead.value === "await") this.tolerateUnexpectedToken(this.lookahead);
								expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
								break;
							case 6:
							case 8:
								if (this.context.strict && this.lookahead.octal) this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
								this.context.isAssignmentTarget = false;
								this.context.isBindingElement = false;
								token = this.nextToken();
								raw = this.getTokenRaw(token);
								expr = this.finalize(node, new Node.Literal(token.value, raw));
								break;
							case 1:
								this.context.isAssignmentTarget = false;
								this.context.isBindingElement = false;
								token = this.nextToken();
								raw = this.getTokenRaw(token);
								expr = this.finalize(node, new Node.Literal(token.value === "true", raw));
								break;
							case 5:
								this.context.isAssignmentTarget = false;
								this.context.isBindingElement = false;
								token = this.nextToken();
								raw = this.getTokenRaw(token);
								expr = this.finalize(node, new Node.Literal(null, raw));
								break;
							case 10:
								expr = this.parseTemplateLiteral();
								break;
							case 7:
								switch (this.lookahead.value) {
									case "(":
										this.context.isBindingElement = false;
										expr = this.inheritCoverGrammar(this.parseGroupExpression);
										break;
									case "[":
										expr = this.inheritCoverGrammar(this.parseArrayInitializer);
										break;
									case "{":
										expr = this.inheritCoverGrammar(this.parseObjectInitializer);
										break;
									case "/":
									case "/=":
										this.context.isAssignmentTarget = false;
										this.context.isBindingElement = false;
										this.scanner.index = this.startMarker.index;
										token = this.nextRegexToken();
										raw = this.getTokenRaw(token);
										expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
										break;
									default: expr = this.throwUnexpectedToken(this.nextToken());
								}
								break;
							case 4:
								if (!this.context.strict && this.context.allowYield && this.matchKeyword("yield")) expr = this.parseIdentifierName();
								else if (!this.context.strict && this.matchKeyword("let")) expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
								else {
									this.context.isAssignmentTarget = false;
									this.context.isBindingElement = false;
									if (this.matchKeyword("function")) expr = this.parseFunctionExpression();
									else if (this.matchKeyword("this")) {
										this.nextToken();
										expr = this.finalize(node, new Node.ThisExpression());
									} else if (this.matchKeyword("class")) expr = this.parseClassExpression();
									else expr = this.throwUnexpectedToken(this.nextToken());
								}
								break;
							default: expr = this.throwUnexpectedToken(this.nextToken());
						}
						return expr;
					};
					Parser$1.prototype.parseSpreadElement = function() {
						var node = this.createNode();
						this.expect("...");
						var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
						return this.finalize(node, new Node.SpreadElement(arg));
					};
					Parser$1.prototype.parseArrayInitializer = function() {
						var node = this.createNode();
						var elements = [];
						this.expect("[");
						while (!this.match("]")) if (this.match(",")) {
							this.nextToken();
							elements.push(null);
						} else if (this.match("...")) {
							var element = this.parseSpreadElement();
							if (!this.match("]")) {
								this.context.isAssignmentTarget = false;
								this.context.isBindingElement = false;
								this.expect(",");
							}
							elements.push(element);
						} else {
							elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
							if (!this.match("]")) this.expect(",");
						}
						this.expect("]");
						return this.finalize(node, new Node.ArrayExpression(elements));
					};
					Parser$1.prototype.parsePropertyMethod = function(params) {
						this.context.isAssignmentTarget = false;
						this.context.isBindingElement = false;
						var previousStrict = this.context.strict;
						var previousAllowStrictDirective = this.context.allowStrictDirective;
						this.context.allowStrictDirective = params.simple;
						var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
						if (this.context.strict && params.firstRestricted) this.tolerateUnexpectedToken(params.firstRestricted, params.message);
						if (this.context.strict && params.stricted) this.tolerateUnexpectedToken(params.stricted, params.message);
						this.context.strict = previousStrict;
						this.context.allowStrictDirective = previousAllowStrictDirective;
						return body;
					};
					Parser$1.prototype.parsePropertyMethodFunction = function() {
						var isGenerator = false;
						var node = this.createNode();
						var previousAllowYield = this.context.allowYield;
						this.context.allowYield = true;
						var params = this.parseFormalParameters();
						var method = this.parsePropertyMethod(params);
						this.context.allowYield = previousAllowYield;
						return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
					};
					Parser$1.prototype.parsePropertyMethodAsyncFunction = function() {
						var node = this.createNode();
						var previousAllowYield = this.context.allowYield;
						var previousAwait = this.context.await;
						this.context.allowYield = false;
						this.context.await = true;
						var params = this.parseFormalParameters();
						var method = this.parsePropertyMethod(params);
						this.context.allowYield = previousAllowYield;
						this.context.await = previousAwait;
						return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
					};
					Parser$1.prototype.parseObjectPropertyKey = function() {
						var node = this.createNode();
						var token = this.nextToken();
						var key;
						switch (token.type) {
							case 8:
							case 6:
								if (this.context.strict && token.octal) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
								var raw = this.getTokenRaw(token);
								key = this.finalize(node, new Node.Literal(token.value, raw));
								break;
							case 3:
							case 1:
							case 5:
							case 4:
								key = this.finalize(node, new Node.Identifier(token.value));
								break;
							case 7:
								if (token.value === "[") {
									key = this.isolateCoverGrammar(this.parseAssignmentExpression);
									this.expect("]");
								} else key = this.throwUnexpectedToken(token);
								break;
							default: key = this.throwUnexpectedToken(token);
						}
						return key;
					};
					Parser$1.prototype.isPropertyKey = function(key, value) {
						return key.type === syntax_1.Syntax.Identifier && key.name === value || key.type === syntax_1.Syntax.Literal && key.value === value;
					};
					Parser$1.prototype.parseObjectProperty = function(hasProto) {
						var node = this.createNode();
						var token = this.lookahead;
						var kind;
						var key = null;
						var value = null;
						var computed = false;
						var method = false;
						var shorthand = false;
						var isAsync = false;
						if (token.type === 3) {
							var id = token.value;
							this.nextToken();
							computed = this.match("[");
							isAsync = !this.hasLineTerminator && id === "async" && !this.match(":") && !this.match("(") && !this.match("*") && !this.match(",");
							key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id));
						} else if (this.match("*")) this.nextToken();
						else {
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
						}
						var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
						if (token.type === 3 && !isAsync && token.value === "get" && lookaheadPropertyKey) {
							kind = "get";
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
							this.context.allowYield = false;
							value = this.parseGetterMethod();
						} else if (token.type === 3 && !isAsync && token.value === "set" && lookaheadPropertyKey) {
							kind = "set";
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
							value = this.parseSetterMethod();
						} else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) {
							kind = "init";
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
							value = this.parseGeneratorMethod();
							method = true;
						} else {
							if (!key) this.throwUnexpectedToken(this.lookahead);
							kind = "init";
							if (this.match(":") && !isAsync) {
								if (!computed && this.isPropertyKey(key, "__proto__")) {
									if (hasProto.value) this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
									hasProto.value = true;
								}
								this.nextToken();
								value = this.inheritCoverGrammar(this.parseAssignmentExpression);
							} else if (this.match("(")) {
								value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
								method = true;
							} else if (token.type === 3) {
								var id = this.finalize(node, new Node.Identifier(token.value));
								if (this.match("=")) {
									this.context.firstCoverInitializedNameError = this.lookahead;
									this.nextToken();
									shorthand = true;
									var init$1 = this.isolateCoverGrammar(this.parseAssignmentExpression);
									value = this.finalize(node, new Node.AssignmentPattern(id, init$1));
								} else {
									shorthand = true;
									value = id;
								}
							} else this.throwUnexpectedToken(this.nextToken());
						}
						return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
					};
					Parser$1.prototype.parseObjectInitializer = function() {
						var node = this.createNode();
						this.expect("{");
						var properties = [];
						var hasProto = { value: false };
						while (!this.match("}")) {
							properties.push(this.parseObjectProperty(hasProto));
							if (!this.match("}")) this.expectCommaSeparator();
						}
						this.expect("}");
						return this.finalize(node, new Node.ObjectExpression(properties));
					};
					Parser$1.prototype.parseTemplateHead = function() {
						assert_1$1.assert(this.lookahead.head, "Template literal must start with a template head");
						var node = this.createNode();
						var token = this.nextToken();
						var raw = token.value;
						var cooked = token.cooked;
						return this.finalize(node, new Node.TemplateElement({
							raw,
							cooked
						}, token.tail));
					};
					Parser$1.prototype.parseTemplateElement = function() {
						if (this.lookahead.type !== 10) this.throwUnexpectedToken();
						var node = this.createNode();
						var token = this.nextToken();
						var raw = token.value;
						var cooked = token.cooked;
						return this.finalize(node, new Node.TemplateElement({
							raw,
							cooked
						}, token.tail));
					};
					Parser$1.prototype.parseTemplateLiteral = function() {
						var node = this.createNode();
						var expressions = [];
						var quasis = [];
						var quasi = this.parseTemplateHead();
						quasis.push(quasi);
						while (!quasi.tail) {
							expressions.push(this.parseExpression());
							quasi = this.parseTemplateElement();
							quasis.push(quasi);
						}
						return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
					};
					Parser$1.prototype.reinterpretExpressionAsPattern = function(expr) {
						switch (expr.type) {
							case syntax_1.Syntax.Identifier:
							case syntax_1.Syntax.MemberExpression:
							case syntax_1.Syntax.RestElement:
							case syntax_1.Syntax.AssignmentPattern: break;
							case syntax_1.Syntax.SpreadElement:
								expr.type = syntax_1.Syntax.RestElement;
								this.reinterpretExpressionAsPattern(expr.argument);
								break;
							case syntax_1.Syntax.ArrayExpression:
								expr.type = syntax_1.Syntax.ArrayPattern;
								for (var i = 0; i < expr.elements.length; i++) if (expr.elements[i] !== null) this.reinterpretExpressionAsPattern(expr.elements[i]);
								break;
							case syntax_1.Syntax.ObjectExpression:
								expr.type = syntax_1.Syntax.ObjectPattern;
								for (var i = 0; i < expr.properties.length; i++) this.reinterpretExpressionAsPattern(expr.properties[i].value);
								break;
							case syntax_1.Syntax.AssignmentExpression:
								expr.type = syntax_1.Syntax.AssignmentPattern;
								delete expr.operator;
								this.reinterpretExpressionAsPattern(expr.left);
								break;
							default: break;
						}
					};
					Parser$1.prototype.parseGroupExpression = function() {
						var expr;
						this.expect("(");
						if (this.match(")")) {
							this.nextToken();
							if (!this.match("=>")) this.expect("=>");
							expr = {
								type: ArrowParameterPlaceHolder,
								params: [],
								async: false
							};
						} else {
							var startToken = this.lookahead;
							var params = [];
							if (this.match("...")) {
								expr = this.parseRestElement(params);
								this.expect(")");
								if (!this.match("=>")) this.expect("=>");
								expr = {
									type: ArrowParameterPlaceHolder,
									params: [expr],
									async: false
								};
							} else {
								var arrow = false;
								this.context.isBindingElement = true;
								expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
								if (this.match(",")) {
									var expressions = [];
									this.context.isAssignmentTarget = false;
									expressions.push(expr);
									while (this.lookahead.type !== 2) {
										if (!this.match(",")) break;
										this.nextToken();
										if (this.match(")")) {
											this.nextToken();
											for (var i = 0; i < expressions.length; i++) this.reinterpretExpressionAsPattern(expressions[i]);
											arrow = true;
											expr = {
												type: ArrowParameterPlaceHolder,
												params: expressions,
												async: false
											};
										} else if (this.match("...")) {
											if (!this.context.isBindingElement) this.throwUnexpectedToken(this.lookahead);
											expressions.push(this.parseRestElement(params));
											this.expect(")");
											if (!this.match("=>")) this.expect("=>");
											this.context.isBindingElement = false;
											for (var i = 0; i < expressions.length; i++) this.reinterpretExpressionAsPattern(expressions[i]);
											arrow = true;
											expr = {
												type: ArrowParameterPlaceHolder,
												params: expressions,
												async: false
											};
										} else expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
										if (arrow) break;
									}
									if (!arrow) expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
								}
								if (!arrow) {
									this.expect(")");
									if (this.match("=>")) {
										if (expr.type === syntax_1.Syntax.Identifier && expr.name === "yield") {
											arrow = true;
											expr = {
												type: ArrowParameterPlaceHolder,
												params: [expr],
												async: false
											};
										}
										if (!arrow) {
											if (!this.context.isBindingElement) this.throwUnexpectedToken(this.lookahead);
											if (expr.type === syntax_1.Syntax.SequenceExpression) for (var i = 0; i < expr.expressions.length; i++) this.reinterpretExpressionAsPattern(expr.expressions[i]);
											else this.reinterpretExpressionAsPattern(expr);
											expr = {
												type: ArrowParameterPlaceHolder,
												params: expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr],
												async: false
											};
										}
									}
									this.context.isBindingElement = false;
								}
							}
						}
						return expr;
					};
					Parser$1.prototype.parseArguments = function() {
						this.expect("(");
						var args = [];
						if (!this.match(")")) while (true) {
							var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAssignmentExpression);
							args.push(expr);
							if (this.match(")")) break;
							this.expectCommaSeparator();
							if (this.match(")")) break;
						}
						this.expect(")");
						return args;
					};
					Parser$1.prototype.isIdentifierName = function(token) {
						return token.type === 3 || token.type === 4 || token.type === 1 || token.type === 5;
					};
					Parser$1.prototype.parseIdentifierName = function() {
						var node = this.createNode();
						var token = this.nextToken();
						if (!this.isIdentifierName(token)) this.throwUnexpectedToken(token);
						return this.finalize(node, new Node.Identifier(token.value));
					};
					Parser$1.prototype.parseNewExpression = function() {
						var node = this.createNode();
						var id = this.parseIdentifierName();
						assert_1$1.assert(id.name === "new", "New expression must start with `new`");
						var expr;
						if (this.match(".")) {
							this.nextToken();
							if (this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === "target") {
								var property = this.parseIdentifierName();
								expr = new Node.MetaProperty(id, property);
							} else this.throwUnexpectedToken(this.lookahead);
						} else {
							var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
							var args = this.match("(") ? this.parseArguments() : [];
							expr = new Node.NewExpression(callee, args);
							this.context.isAssignmentTarget = false;
							this.context.isBindingElement = false;
						}
						return this.finalize(node, expr);
					};
					Parser$1.prototype.parseAsyncArgument = function() {
						var arg = this.parseAssignmentExpression();
						this.context.firstCoverInitializedNameError = null;
						return arg;
					};
					Parser$1.prototype.parseAsyncArguments = function() {
						this.expect("(");
						var args = [];
						if (!this.match(")")) while (true) {
							var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAsyncArgument);
							args.push(expr);
							if (this.match(")")) break;
							this.expectCommaSeparator();
							if (this.match(")")) break;
						}
						this.expect(")");
						return args;
					};
					Parser$1.prototype.parseLeftHandSideExpressionAllowCall = function() {
						var startToken = this.lookahead;
						var maybeAsync$1 = this.matchContextualKeyword("async");
						var previousAllowIn = this.context.allowIn;
						this.context.allowIn = true;
						var expr;
						if (this.matchKeyword("super") && this.context.inFunctionBody) {
							expr = this.createNode();
							this.nextToken();
							expr = this.finalize(expr, new Node.Super());
							if (!this.match("(") && !this.match(".") && !this.match("[")) this.throwUnexpectedToken(this.lookahead);
						} else expr = this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression);
						while (true) if (this.match(".")) {
							this.context.isBindingElement = false;
							this.context.isAssignmentTarget = true;
							this.expect(".");
							var property = this.parseIdentifierName();
							expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property));
						} else if (this.match("(")) {
							var asyncArrow = maybeAsync$1 && startToken.lineNumber === this.lookahead.lineNumber;
							this.context.isBindingElement = false;
							this.context.isAssignmentTarget = false;
							var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
							expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args));
							if (asyncArrow && this.match("=>")) {
								for (var i = 0; i < args.length; ++i) this.reinterpretExpressionAsPattern(args[i]);
								expr = {
									type: ArrowParameterPlaceHolder,
									params: args,
									async: true
								};
							}
						} else if (this.match("[")) {
							this.context.isBindingElement = false;
							this.context.isAssignmentTarget = true;
							this.expect("[");
							var property = this.isolateCoverGrammar(this.parseExpression);
							this.expect("]");
							expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property));
						} else if (this.lookahead.type === 10 && this.lookahead.head) {
							var quasi = this.parseTemplateLiteral();
							expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi));
						} else break;
						this.context.allowIn = previousAllowIn;
						return expr;
					};
					Parser$1.prototype.parseSuper = function() {
						var node = this.createNode();
						this.expectKeyword("super");
						if (!this.match("[") && !this.match(".")) this.throwUnexpectedToken(this.lookahead);
						return this.finalize(node, new Node.Super());
					};
					Parser$1.prototype.parseLeftHandSideExpression = function() {
						assert_1$1.assert(this.context.allowIn, "callee of new expression always allow in keyword.");
						var node = this.startNode(this.lookahead);
						var expr = this.matchKeyword("super") && this.context.inFunctionBody ? this.parseSuper() : this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression);
						while (true) if (this.match("[")) {
							this.context.isBindingElement = false;
							this.context.isAssignmentTarget = true;
							this.expect("[");
							var property = this.isolateCoverGrammar(this.parseExpression);
							this.expect("]");
							expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property));
						} else if (this.match(".")) {
							this.context.isBindingElement = false;
							this.context.isAssignmentTarget = true;
							this.expect(".");
							var property = this.parseIdentifierName();
							expr = this.finalize(node, new Node.StaticMemberExpression(expr, property));
						} else if (this.lookahead.type === 10 && this.lookahead.head) {
							var quasi = this.parseTemplateLiteral();
							expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi));
						} else break;
						return expr;
					};
					Parser$1.prototype.parseUpdateExpression = function() {
						var expr;
						var startToken = this.lookahead;
						if (this.match("++") || this.match("--")) {
							var node = this.startNode(startToken);
							var token = this.nextToken();
							expr = this.inheritCoverGrammar(this.parseUnaryExpression);
							if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) this.tolerateError(messages_1.Messages.StrictLHSPrefix);
							if (!this.context.isAssignmentTarget) this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
							var prefix = true;
							expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix));
							this.context.isAssignmentTarget = false;
							this.context.isBindingElement = false;
						} else {
							expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
							if (!this.hasLineTerminator && this.lookahead.type === 7) {
								if (this.match("++") || this.match("--")) {
									if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) this.tolerateError(messages_1.Messages.StrictLHSPostfix);
									if (!this.context.isAssignmentTarget) this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
									this.context.isAssignmentTarget = false;
									this.context.isBindingElement = false;
									var operator = this.nextToken().value;
									var prefix = false;
									expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix));
								}
							}
						}
						return expr;
					};
					Parser$1.prototype.parseAwaitExpression = function() {
						var node = this.createNode();
						this.nextToken();
						var argument = this.parseUnaryExpression();
						return this.finalize(node, new Node.AwaitExpression(argument));
					};
					Parser$1.prototype.parseUnaryExpression = function() {
						var expr;
						if (this.match("+") || this.match("-") || this.match("~") || this.match("!") || this.matchKeyword("delete") || this.matchKeyword("void") || this.matchKeyword("typeof")) {
							var node = this.startNode(this.lookahead);
							var token = this.nextToken();
							expr = this.inheritCoverGrammar(this.parseUnaryExpression);
							expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
							if (this.context.strict && expr.operator === "delete" && expr.argument.type === syntax_1.Syntax.Identifier) this.tolerateError(messages_1.Messages.StrictDelete);
							this.context.isAssignmentTarget = false;
							this.context.isBindingElement = false;
						} else if (this.context.await && this.matchContextualKeyword("await")) expr = this.parseAwaitExpression();
						else expr = this.parseUpdateExpression();
						return expr;
					};
					Parser$1.prototype.parseExponentiationExpression = function() {
						var startToken = this.lookahead;
						var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
						if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match("**")) {
							this.nextToken();
							this.context.isAssignmentTarget = false;
							this.context.isBindingElement = false;
							var left = expr;
							var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
							expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression("**", left, right));
						}
						return expr;
					};
					Parser$1.prototype.binaryPrecedence = function(token) {
						var op = token.value;
						var precedence;
						if (token.type === 7) precedence = this.operatorPrecedence[op] || 0;
						else if (token.type === 4) precedence = op === "instanceof" || this.context.allowIn && op === "in" ? 7 : 0;
						else precedence = 0;
						return precedence;
					};
					Parser$1.prototype.parseBinaryExpression = function() {
						var startToken = this.lookahead;
						var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
						var token = this.lookahead;
						var prec = this.binaryPrecedence(token);
						if (prec > 0) {
							this.nextToken();
							this.context.isAssignmentTarget = false;
							this.context.isBindingElement = false;
							var markers = [startToken, this.lookahead];
							var left = expr;
							var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
							var stack = [
								left,
								token.value,
								right
							];
							var precedences = [prec];
							while (true) {
								prec = this.binaryPrecedence(this.lookahead);
								if (prec <= 0) break;
								while (stack.length > 2 && prec <= precedences[precedences.length - 1]) {
									right = stack.pop();
									var operator = stack.pop();
									precedences.pop();
									left = stack.pop();
									markers.pop();
									var node = this.startNode(markers[markers.length - 1]);
									stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right)));
								}
								stack.push(this.nextToken().value);
								precedences.push(prec);
								markers.push(this.lookahead);
								stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
							}
							var i = stack.length - 1;
							expr = stack[i];
							var lastMarker = markers.pop();
							while (i > 1) {
								var marker = markers.pop();
								var lastLineStart = lastMarker && lastMarker.lineStart;
								var node = this.startNode(marker, lastLineStart);
								var operator = stack[i - 1];
								expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr));
								i -= 2;
								lastMarker = marker;
							}
						}
						return expr;
					};
					Parser$1.prototype.parseConditionalExpression = function() {
						var startToken = this.lookahead;
						var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
						if (this.match("?")) {
							this.nextToken();
							var previousAllowIn = this.context.allowIn;
							this.context.allowIn = true;
							var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
							this.context.allowIn = previousAllowIn;
							this.expect(":");
							var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
							expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate));
							this.context.isAssignmentTarget = false;
							this.context.isBindingElement = false;
						}
						return expr;
					};
					Parser$1.prototype.checkPatternParam = function(options, param) {
						switch (param.type) {
							case syntax_1.Syntax.Identifier:
								this.validateParam(options, param, param.name);
								break;
							case syntax_1.Syntax.RestElement:
								this.checkPatternParam(options, param.argument);
								break;
							case syntax_1.Syntax.AssignmentPattern:
								this.checkPatternParam(options, param.left);
								break;
							case syntax_1.Syntax.ArrayPattern:
								for (var i = 0; i < param.elements.length; i++) if (param.elements[i] !== null) this.checkPatternParam(options, param.elements[i]);
								break;
							case syntax_1.Syntax.ObjectPattern:
								for (var i = 0; i < param.properties.length; i++) this.checkPatternParam(options, param.properties[i].value);
								break;
							default: break;
						}
						options.simple = options.simple && param instanceof Node.Identifier;
					};
					Parser$1.prototype.reinterpretAsCoverFormalsList = function(expr) {
						var params = [expr];
						var options;
						var asyncArrow = false;
						switch (expr.type) {
							case syntax_1.Syntax.Identifier: break;
							case ArrowParameterPlaceHolder:
								params = expr.params;
								asyncArrow = expr.async;
								break;
							default: return null;
						}
						options = {
							simple: true,
							paramSet: {}
						};
						for (var i = 0; i < params.length; ++i) {
							var param = params[i];
							if (param.type === syntax_1.Syntax.AssignmentPattern) {
								if (param.right.type === syntax_1.Syntax.YieldExpression) {
									if (param.right.argument) this.throwUnexpectedToken(this.lookahead);
									param.right.type = syntax_1.Syntax.Identifier;
									param.right.name = "yield";
									delete param.right.argument;
									delete param.right.delegate;
								}
							} else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === "await") this.throwUnexpectedToken(this.lookahead);
							this.checkPatternParam(options, param);
							params[i] = param;
						}
						if (this.context.strict || !this.context.allowYield) for (var i = 0; i < params.length; ++i) {
							var param = params[i];
							if (param.type === syntax_1.Syntax.YieldExpression) this.throwUnexpectedToken(this.lookahead);
						}
						if (options.message === messages_1.Messages.StrictParamDupe) {
							var token = this.context.strict ? options.stricted : options.firstRestricted;
							this.throwUnexpectedToken(token, options.message);
						}
						return {
							simple: options.simple,
							params,
							stricted: options.stricted,
							firstRestricted: options.firstRestricted,
							message: options.message
						};
					};
					Parser$1.prototype.parseAssignmentExpression = function() {
						var expr;
						if (!this.context.allowYield && this.matchKeyword("yield")) expr = this.parseYieldExpression();
						else {
							var startToken = this.lookahead;
							var token = startToken;
							expr = this.parseConditionalExpression();
							if (token.type === 3 && token.lineNumber === this.lookahead.lineNumber && token.value === "async") {
								if (this.lookahead.type === 3 || this.matchKeyword("yield")) {
									var arg = this.parsePrimaryExpression();
									this.reinterpretExpressionAsPattern(arg);
									expr = {
										type: ArrowParameterPlaceHolder,
										params: [arg],
										async: true
									};
								}
							}
							if (expr.type === ArrowParameterPlaceHolder || this.match("=>")) {
								this.context.isAssignmentTarget = false;
								this.context.isBindingElement = false;
								var isAsync = expr.async;
								var list = this.reinterpretAsCoverFormalsList(expr);
								if (list) {
									if (this.hasLineTerminator) this.tolerateUnexpectedToken(this.lookahead);
									this.context.firstCoverInitializedNameError = null;
									var previousStrict = this.context.strict;
									var previousAllowStrictDirective = this.context.allowStrictDirective;
									this.context.allowStrictDirective = list.simple;
									var previousAllowYield = this.context.allowYield;
									var previousAwait = this.context.await;
									this.context.allowYield = true;
									this.context.await = isAsync;
									var node = this.startNode(startToken);
									this.expect("=>");
									var body = void 0;
									if (this.match("{")) {
										var previousAllowIn = this.context.allowIn;
										this.context.allowIn = true;
										body = this.parseFunctionSourceElements();
										this.context.allowIn = previousAllowIn;
									} else body = this.isolateCoverGrammar(this.parseAssignmentExpression);
									var expression = body.type !== syntax_1.Syntax.BlockStatement;
									if (this.context.strict && list.firstRestricted) this.throwUnexpectedToken(list.firstRestricted, list.message);
									if (this.context.strict && list.stricted) this.tolerateUnexpectedToken(list.stricted, list.message);
									expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression));
									this.context.strict = previousStrict;
									this.context.allowStrictDirective = previousAllowStrictDirective;
									this.context.allowYield = previousAllowYield;
									this.context.await = previousAwait;
								}
							} else if (this.matchAssign()) {
								if (!this.context.isAssignmentTarget) this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
								if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
									var id = expr;
									if (this.scanner.isRestrictedWord(id.name)) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
									if (this.scanner.isStrictModeReservedWord(id.name)) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
								}
								if (!this.match("=")) {
									this.context.isAssignmentTarget = false;
									this.context.isBindingElement = false;
								} else this.reinterpretExpressionAsPattern(expr);
								token = this.nextToken();
								var operator = token.value;
								var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
								expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right));
								this.context.firstCoverInitializedNameError = null;
							}
						}
						return expr;
					};
					Parser$1.prototype.parseExpression = function() {
						var startToken = this.lookahead;
						var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
						if (this.match(",")) {
							var expressions = [];
							expressions.push(expr);
							while (this.lookahead.type !== 2) {
								if (!this.match(",")) break;
								this.nextToken();
								expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
							}
							expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
						}
						return expr;
					};
					Parser$1.prototype.parseStatementListItem = function() {
						var statement;
						this.context.isAssignmentTarget = true;
						this.context.isBindingElement = true;
						if (this.lookahead.type === 4) switch (this.lookahead.value) {
							case "export":
								if (!this.context.isModule) this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
								statement = this.parseExportDeclaration();
								break;
							case "import":
								if (!this.context.isModule) this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
								statement = this.parseImportDeclaration();
								break;
							case "const":
								statement = this.parseLexicalDeclaration({ inFor: false });
								break;
							case "function":
								statement = this.parseFunctionDeclaration();
								break;
							case "class":
								statement = this.parseClassDeclaration();
								break;
							case "let":
								statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
								break;
							default:
								statement = this.parseStatement();
								break;
						}
						else statement = this.parseStatement();
						return statement;
					};
					Parser$1.prototype.parseBlock = function() {
						var node = this.createNode();
						this.expect("{");
						var block = [];
						while (true) {
							if (this.match("}")) break;
							block.push(this.parseStatementListItem());
						}
						this.expect("}");
						return this.finalize(node, new Node.BlockStatement(block));
					};
					Parser$1.prototype.parseLexicalBinding = function(kind, options) {
						var node = this.createNode();
						var id = this.parsePattern([], kind);
						if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
							if (this.scanner.isRestrictedWord(id.name)) this.tolerateError(messages_1.Messages.StrictVarName);
						}
						var init$1 = null;
						if (kind === "const") {
							if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) if (this.match("=")) {
								this.nextToken();
								init$1 = this.isolateCoverGrammar(this.parseAssignmentExpression);
							} else this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
						} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
							this.expect("=");
							init$1 = this.isolateCoverGrammar(this.parseAssignmentExpression);
						}
						return this.finalize(node, new Node.VariableDeclarator(id, init$1));
					};
					Parser$1.prototype.parseBindingList = function(kind, options) {
						var list = [this.parseLexicalBinding(kind, options)];
						while (this.match(",")) {
							this.nextToken();
							list.push(this.parseLexicalBinding(kind, options));
						}
						return list;
					};
					Parser$1.prototype.isLexicalDeclaration = function() {
						var state$1 = this.scanner.saveState();
						this.scanner.scanComments();
						var next = this.scanner.lex();
						this.scanner.restoreState(state$1);
						return next.type === 3 || next.type === 7 && next.value === "[" || next.type === 7 && next.value === "{" || next.type === 4 && next.value === "let" || next.type === 4 && next.value === "yield";
					};
					Parser$1.prototype.parseLexicalDeclaration = function(options) {
						var node = this.createNode();
						var kind = this.nextToken().value;
						assert_1$1.assert(kind === "let" || kind === "const", "Lexical declaration must be either let or const");
						var declarations = this.parseBindingList(kind, options);
						this.consumeSemicolon();
						return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
					};
					Parser$1.prototype.parseBindingRestElement = function(params, kind) {
						var node = this.createNode();
						this.expect("...");
						var arg = this.parsePattern(params, kind);
						return this.finalize(node, new Node.RestElement(arg));
					};
					Parser$1.prototype.parseArrayPattern = function(params, kind) {
						var node = this.createNode();
						this.expect("[");
						var elements = [];
						while (!this.match("]")) if (this.match(",")) {
							this.nextToken();
							elements.push(null);
						} else {
							if (this.match("...")) {
								elements.push(this.parseBindingRestElement(params, kind));
								break;
							} else elements.push(this.parsePatternWithDefault(params, kind));
							if (!this.match("]")) this.expect(",");
						}
						this.expect("]");
						return this.finalize(node, new Node.ArrayPattern(elements));
					};
					Parser$1.prototype.parsePropertyPattern = function(params, kind) {
						var node = this.createNode();
						var computed = false;
						var shorthand = false;
						var method = false;
						var key;
						var value;
						if (this.lookahead.type === 3) {
							var keyToken = this.lookahead;
							key = this.parseVariableIdentifier();
							var init$1 = this.finalize(node, new Node.Identifier(keyToken.value));
							if (this.match("=")) {
								params.push(keyToken);
								shorthand = true;
								this.nextToken();
								var expr = this.parseAssignmentExpression();
								value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init$1, expr));
							} else if (!this.match(":")) {
								params.push(keyToken);
								shorthand = true;
								value = init$1;
							} else {
								this.expect(":");
								value = this.parsePatternWithDefault(params, kind);
							}
						} else {
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
							this.expect(":");
							value = this.parsePatternWithDefault(params, kind);
						}
						return this.finalize(node, new Node.Property("init", key, computed, value, method, shorthand));
					};
					Parser$1.prototype.parseObjectPattern = function(params, kind) {
						var node = this.createNode();
						var properties = [];
						this.expect("{");
						while (!this.match("}")) {
							properties.push(this.parsePropertyPattern(params, kind));
							if (!this.match("}")) this.expect(",");
						}
						this.expect("}");
						return this.finalize(node, new Node.ObjectPattern(properties));
					};
					Parser$1.prototype.parsePattern = function(params, kind) {
						var pattern;
						if (this.match("[")) pattern = this.parseArrayPattern(params, kind);
						else if (this.match("{")) pattern = this.parseObjectPattern(params, kind);
						else {
							if (this.matchKeyword("let") && (kind === "const" || kind === "let")) this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
							params.push(this.lookahead);
							pattern = this.parseVariableIdentifier(kind);
						}
						return pattern;
					};
					Parser$1.prototype.parsePatternWithDefault = function(params, kind) {
						var startToken = this.lookahead;
						var pattern = this.parsePattern(params, kind);
						if (this.match("=")) {
							this.nextToken();
							var previousAllowYield = this.context.allowYield;
							this.context.allowYield = true;
							var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
							this.context.allowYield = previousAllowYield;
							pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
						}
						return pattern;
					};
					Parser$1.prototype.parseVariableIdentifier = function(kind) {
						var node = this.createNode();
						var token = this.nextToken();
						if (token.type === 4 && token.value === "yield") {
							if (this.context.strict) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
							else if (!this.context.allowYield) this.throwUnexpectedToken(token);
						} else if (token.type !== 3) {
							if (this.context.strict && token.type === 4 && this.scanner.isStrictModeReservedWord(token.value)) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
							else if (this.context.strict || token.value !== "let" || kind !== "var") this.throwUnexpectedToken(token);
						} else if ((this.context.isModule || this.context.await) && token.type === 3 && token.value === "await") this.tolerateUnexpectedToken(token);
						return this.finalize(node, new Node.Identifier(token.value));
					};
					Parser$1.prototype.parseVariableDeclaration = function(options) {
						var node = this.createNode();
						var id = this.parsePattern([], "var");
						if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
							if (this.scanner.isRestrictedWord(id.name)) this.tolerateError(messages_1.Messages.StrictVarName);
						}
						var init$1 = null;
						if (this.match("=")) {
							this.nextToken();
							init$1 = this.isolateCoverGrammar(this.parseAssignmentExpression);
						} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) this.expect("=");
						return this.finalize(node, new Node.VariableDeclarator(id, init$1));
					};
					Parser$1.prototype.parseVariableDeclarationList = function(options) {
						var opt = { inFor: options.inFor };
						var list = [];
						list.push(this.parseVariableDeclaration(opt));
						while (this.match(",")) {
							this.nextToken();
							list.push(this.parseVariableDeclaration(opt));
						}
						return list;
					};
					Parser$1.prototype.parseVariableStatement = function() {
						var node = this.createNode();
						this.expectKeyword("var");
						var declarations = this.parseVariableDeclarationList({ inFor: false });
						this.consumeSemicolon();
						return this.finalize(node, new Node.VariableDeclaration(declarations, "var"));
					};
					Parser$1.prototype.parseEmptyStatement = function() {
						var node = this.createNode();
						this.expect(";");
						return this.finalize(node, new Node.EmptyStatement());
					};
					Parser$1.prototype.parseExpressionStatement = function() {
						var node = this.createNode();
						var expr = this.parseExpression();
						this.consumeSemicolon();
						return this.finalize(node, new Node.ExpressionStatement(expr));
					};
					Parser$1.prototype.parseIfClause = function() {
						if (this.context.strict && this.matchKeyword("function")) this.tolerateError(messages_1.Messages.StrictFunction);
						return this.parseStatement();
					};
					Parser$1.prototype.parseIfStatement = function() {
						var node = this.createNode();
						var consequent;
						var alternate = null;
						this.expectKeyword("if");
						this.expect("(");
						var test$1 = this.parseExpression();
						if (!this.match(")") && this.config.tolerant) {
							this.tolerateUnexpectedToken(this.nextToken());
							consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
						} else {
							this.expect(")");
							consequent = this.parseIfClause();
							if (this.matchKeyword("else")) {
								this.nextToken();
								alternate = this.parseIfClause();
							}
						}
						return this.finalize(node, new Node.IfStatement(test$1, consequent, alternate));
					};
					Parser$1.prototype.parseDoWhileStatement = function() {
						var node = this.createNode();
						this.expectKeyword("do");
						var previousInIteration = this.context.inIteration;
						this.context.inIteration = true;
						var body = this.parseStatement();
						this.context.inIteration = previousInIteration;
						this.expectKeyword("while");
						this.expect("(");
						var test$1 = this.parseExpression();
						if (!this.match(")") && this.config.tolerant) this.tolerateUnexpectedToken(this.nextToken());
						else {
							this.expect(")");
							if (this.match(";")) this.nextToken();
						}
						return this.finalize(node, new Node.DoWhileStatement(body, test$1));
					};
					Parser$1.prototype.parseWhileStatement = function() {
						var node = this.createNode();
						var body;
						this.expectKeyword("while");
						this.expect("(");
						var test$1 = this.parseExpression();
						if (!this.match(")") && this.config.tolerant) {
							this.tolerateUnexpectedToken(this.nextToken());
							body = this.finalize(this.createNode(), new Node.EmptyStatement());
						} else {
							this.expect(")");
							var previousInIteration = this.context.inIteration;
							this.context.inIteration = true;
							body = this.parseStatement();
							this.context.inIteration = previousInIteration;
						}
						return this.finalize(node, new Node.WhileStatement(test$1, body));
					};
					Parser$1.prototype.parseForStatement = function() {
						var init$1 = null;
						var test$1 = null;
						var update = null;
						var forIn = true;
						var left, right;
						var node = this.createNode();
						this.expectKeyword("for");
						this.expect("(");
						if (this.match(";")) this.nextToken();
						else if (this.matchKeyword("var")) {
							init$1 = this.createNode();
							this.nextToken();
							var previousAllowIn = this.context.allowIn;
							this.context.allowIn = false;
							var declarations = this.parseVariableDeclarationList({ inFor: true });
							this.context.allowIn = previousAllowIn;
							if (declarations.length === 1 && this.matchKeyword("in")) {
								var decl = declarations[0];
								if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
								init$1 = this.finalize(init$1, new Node.VariableDeclaration(declarations, "var"));
								this.nextToken();
								left = init$1;
								right = this.parseExpression();
								init$1 = null;
							} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
								init$1 = this.finalize(init$1, new Node.VariableDeclaration(declarations, "var"));
								this.nextToken();
								left = init$1;
								right = this.parseAssignmentExpression();
								init$1 = null;
								forIn = false;
							} else {
								init$1 = this.finalize(init$1, new Node.VariableDeclaration(declarations, "var"));
								this.expect(";");
							}
						} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
							init$1 = this.createNode();
							var kind = this.nextToken().value;
							if (!this.context.strict && this.lookahead.value === "in") {
								init$1 = this.finalize(init$1, new Node.Identifier(kind));
								this.nextToken();
								left = init$1;
								right = this.parseExpression();
								init$1 = null;
							} else {
								var previousAllowIn = this.context.allowIn;
								this.context.allowIn = false;
								var declarations = this.parseBindingList(kind, { inFor: true });
								this.context.allowIn = previousAllowIn;
								if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
									init$1 = this.finalize(init$1, new Node.VariableDeclaration(declarations, kind));
									this.nextToken();
									left = init$1;
									right = this.parseExpression();
									init$1 = null;
								} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
									init$1 = this.finalize(init$1, new Node.VariableDeclaration(declarations, kind));
									this.nextToken();
									left = init$1;
									right = this.parseAssignmentExpression();
									init$1 = null;
									forIn = false;
								} else {
									this.consumeSemicolon();
									init$1 = this.finalize(init$1, new Node.VariableDeclaration(declarations, kind));
								}
							}
						} else {
							var initStartToken = this.lookahead;
							var previousAllowIn = this.context.allowIn;
							this.context.allowIn = false;
							init$1 = this.inheritCoverGrammar(this.parseAssignmentExpression);
							this.context.allowIn = previousAllowIn;
							if (this.matchKeyword("in")) {
								if (!this.context.isAssignmentTarget || init$1.type === syntax_1.Syntax.AssignmentExpression) this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
								this.nextToken();
								this.reinterpretExpressionAsPattern(init$1);
								left = init$1;
								right = this.parseExpression();
								init$1 = null;
							} else if (this.matchContextualKeyword("of")) {
								if (!this.context.isAssignmentTarget || init$1.type === syntax_1.Syntax.AssignmentExpression) this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
								this.nextToken();
								this.reinterpretExpressionAsPattern(init$1);
								left = init$1;
								right = this.parseAssignmentExpression();
								init$1 = null;
								forIn = false;
							} else {
								if (this.match(",")) {
									var initSeq = [init$1];
									while (this.match(",")) {
										this.nextToken();
										initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
									}
									init$1 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
								}
								this.expect(";");
							}
						}
						if (typeof left === "undefined") {
							if (!this.match(";")) test$1 = this.parseExpression();
							this.expect(";");
							if (!this.match(")")) update = this.parseExpression();
						}
						var body;
						if (!this.match(")") && this.config.tolerant) {
							this.tolerateUnexpectedToken(this.nextToken());
							body = this.finalize(this.createNode(), new Node.EmptyStatement());
						} else {
							this.expect(")");
							var previousInIteration = this.context.inIteration;
							this.context.inIteration = true;
							body = this.isolateCoverGrammar(this.parseStatement);
							this.context.inIteration = previousInIteration;
						}
						return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init$1, test$1, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body));
					};
					Parser$1.prototype.parseContinueStatement = function() {
						var node = this.createNode();
						this.expectKeyword("continue");
						var label = null;
						if (this.lookahead.type === 3 && !this.hasLineTerminator) {
							var id = this.parseVariableIdentifier();
							label = id;
							var key = "$" + id.name;
							if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) this.throwError(messages_1.Messages.UnknownLabel, id.name);
						}
						this.consumeSemicolon();
						if (label === null && !this.context.inIteration) this.throwError(messages_1.Messages.IllegalContinue);
						return this.finalize(node, new Node.ContinueStatement(label));
					};
					Parser$1.prototype.parseBreakStatement = function() {
						var node = this.createNode();
						this.expectKeyword("break");
						var label = null;
						if (this.lookahead.type === 3 && !this.hasLineTerminator) {
							var id = this.parseVariableIdentifier();
							var key = "$" + id.name;
							if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) this.throwError(messages_1.Messages.UnknownLabel, id.name);
							label = id;
						}
						this.consumeSemicolon();
						if (label === null && !this.context.inIteration && !this.context.inSwitch) this.throwError(messages_1.Messages.IllegalBreak);
						return this.finalize(node, new Node.BreakStatement(label));
					};
					Parser$1.prototype.parseReturnStatement = function() {
						if (!this.context.inFunctionBody) this.tolerateError(messages_1.Messages.IllegalReturn);
						var node = this.createNode();
						this.expectKeyword("return");
						var argument = !this.match(";") && !this.match("}") && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10 ? this.parseExpression() : null;
						this.consumeSemicolon();
						return this.finalize(node, new Node.ReturnStatement(argument));
					};
					Parser$1.prototype.parseWithStatement = function() {
						if (this.context.strict) this.tolerateError(messages_1.Messages.StrictModeWith);
						var node = this.createNode();
						var body;
						this.expectKeyword("with");
						this.expect("(");
						var object = this.parseExpression();
						if (!this.match(")") && this.config.tolerant) {
							this.tolerateUnexpectedToken(this.nextToken());
							body = this.finalize(this.createNode(), new Node.EmptyStatement());
						} else {
							this.expect(")");
							body = this.parseStatement();
						}
						return this.finalize(node, new Node.WithStatement(object, body));
					};
					Parser$1.prototype.parseSwitchCase = function() {
						var node = this.createNode();
						var test$1;
						if (this.matchKeyword("default")) {
							this.nextToken();
							test$1 = null;
						} else {
							this.expectKeyword("case");
							test$1 = this.parseExpression();
						}
						this.expect(":");
						var consequent = [];
						while (true) {
							if (this.match("}") || this.matchKeyword("default") || this.matchKeyword("case")) break;
							consequent.push(this.parseStatementListItem());
						}
						return this.finalize(node, new Node.SwitchCase(test$1, consequent));
					};
					Parser$1.prototype.parseSwitchStatement = function() {
						var node = this.createNode();
						this.expectKeyword("switch");
						this.expect("(");
						var discriminant = this.parseExpression();
						this.expect(")");
						var previousInSwitch = this.context.inSwitch;
						this.context.inSwitch = true;
						var cases = [];
						var defaultFound = false;
						this.expect("{");
						while (true) {
							if (this.match("}")) break;
							var clause = this.parseSwitchCase();
							if (clause.test === null) {
								if (defaultFound) this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
								defaultFound = true;
							}
							cases.push(clause);
						}
						this.expect("}");
						this.context.inSwitch = previousInSwitch;
						return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
					};
					Parser$1.prototype.parseLabelledStatement = function() {
						var node = this.createNode();
						var expr = this.parseExpression();
						var statement;
						if (expr.type === syntax_1.Syntax.Identifier && this.match(":")) {
							this.nextToken();
							var id = expr;
							var key = "$" + id.name;
							if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) this.throwError(messages_1.Messages.Redeclaration, "Label", id.name);
							this.context.labelSet[key] = true;
							var body = void 0;
							if (this.matchKeyword("class")) {
								this.tolerateUnexpectedToken(this.lookahead);
								body = this.parseClassDeclaration();
							} else if (this.matchKeyword("function")) {
								var token = this.lookahead;
								var declaration = this.parseFunctionDeclaration();
								if (this.context.strict) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
								else if (declaration.generator) this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
								body = declaration;
							} else body = this.parseStatement();
							delete this.context.labelSet[key];
							statement = new Node.LabeledStatement(id, body);
						} else {
							this.consumeSemicolon();
							statement = new Node.ExpressionStatement(expr);
						}
						return this.finalize(node, statement);
					};
					Parser$1.prototype.parseThrowStatement = function() {
						var node = this.createNode();
						this.expectKeyword("throw");
						if (this.hasLineTerminator) this.throwError(messages_1.Messages.NewlineAfterThrow);
						var argument = this.parseExpression();
						this.consumeSemicolon();
						return this.finalize(node, new Node.ThrowStatement(argument));
					};
					Parser$1.prototype.parseCatchClause = function() {
						var node = this.createNode();
						this.expectKeyword("catch");
						this.expect("(");
						if (this.match(")")) this.throwUnexpectedToken(this.lookahead);
						var params = [];
						var param = this.parsePattern(params);
						var paramMap = {};
						for (var i = 0; i < params.length; i++) {
							var key = "$" + params[i].value;
							if (Object.prototype.hasOwnProperty.call(paramMap, key)) this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value);
							paramMap[key] = true;
						}
						if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
							if (this.scanner.isRestrictedWord(param.name)) this.tolerateError(messages_1.Messages.StrictCatchVariable);
						}
						this.expect(")");
						var body = this.parseBlock();
						return this.finalize(node, new Node.CatchClause(param, body));
					};
					Parser$1.prototype.parseFinallyClause = function() {
						this.expectKeyword("finally");
						return this.parseBlock();
					};
					Parser$1.prototype.parseTryStatement = function() {
						var node = this.createNode();
						this.expectKeyword("try");
						var block = this.parseBlock();
						var handler = this.matchKeyword("catch") ? this.parseCatchClause() : null;
						var finalizer = this.matchKeyword("finally") ? this.parseFinallyClause() : null;
						if (!handler && !finalizer) this.throwError(messages_1.Messages.NoCatchOrFinally);
						return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
					};
					Parser$1.prototype.parseDebuggerStatement = function() {
						var node = this.createNode();
						this.expectKeyword("debugger");
						this.consumeSemicolon();
						return this.finalize(node, new Node.DebuggerStatement());
					};
					Parser$1.prototype.parseStatement = function() {
						var statement;
						switch (this.lookahead.type) {
							case 1:
							case 5:
							case 6:
							case 8:
							case 10:
							case 9:
								statement = this.parseExpressionStatement();
								break;
							case 7:
								var value = this.lookahead.value;
								if (value === "{") statement = this.parseBlock();
								else if (value === "(") statement = this.parseExpressionStatement();
								else if (value === ";") statement = this.parseEmptyStatement();
								else statement = this.parseExpressionStatement();
								break;
							case 3:
								statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
								break;
							case 4:
								switch (this.lookahead.value) {
									case "break":
										statement = this.parseBreakStatement();
										break;
									case "continue":
										statement = this.parseContinueStatement();
										break;
									case "debugger":
										statement = this.parseDebuggerStatement();
										break;
									case "do":
										statement = this.parseDoWhileStatement();
										break;
									case "for":
										statement = this.parseForStatement();
										break;
									case "function":
										statement = this.parseFunctionDeclaration();
										break;
									case "if":
										statement = this.parseIfStatement();
										break;
									case "return":
										statement = this.parseReturnStatement();
										break;
									case "switch":
										statement = this.parseSwitchStatement();
										break;
									case "throw":
										statement = this.parseThrowStatement();
										break;
									case "try":
										statement = this.parseTryStatement();
										break;
									case "var":
										statement = this.parseVariableStatement();
										break;
									case "while":
										statement = this.parseWhileStatement();
										break;
									case "with":
										statement = this.parseWithStatement();
										break;
									default:
										statement = this.parseExpressionStatement();
										break;
								}
								break;
							default: statement = this.throwUnexpectedToken(this.lookahead);
						}
						return statement;
					};
					Parser$1.prototype.parseFunctionSourceElements = function() {
						var node = this.createNode();
						this.expect("{");
						var body = this.parseDirectivePrologues();
						var previousLabelSet = this.context.labelSet;
						var previousInIteration = this.context.inIteration;
						var previousInSwitch = this.context.inSwitch;
						var previousInFunctionBody = this.context.inFunctionBody;
						this.context.labelSet = {};
						this.context.inIteration = false;
						this.context.inSwitch = false;
						this.context.inFunctionBody = true;
						while (this.lookahead.type !== 2) {
							if (this.match("}")) break;
							body.push(this.parseStatementListItem());
						}
						this.expect("}");
						this.context.labelSet = previousLabelSet;
						this.context.inIteration = previousInIteration;
						this.context.inSwitch = previousInSwitch;
						this.context.inFunctionBody = previousInFunctionBody;
						return this.finalize(node, new Node.BlockStatement(body));
					};
					Parser$1.prototype.validateParam = function(options, param, name$1) {
						var key = "$" + name$1;
						if (this.context.strict) {
							if (this.scanner.isRestrictedWord(name$1)) {
								options.stricted = param;
								options.message = messages_1.Messages.StrictParamName;
							}
							if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
								options.stricted = param;
								options.message = messages_1.Messages.StrictParamDupe;
							}
						} else if (!options.firstRestricted) {
							if (this.scanner.isRestrictedWord(name$1)) {
								options.firstRestricted = param;
								options.message = messages_1.Messages.StrictParamName;
							} else if (this.scanner.isStrictModeReservedWord(name$1)) {
								options.firstRestricted = param;
								options.message = messages_1.Messages.StrictReservedWord;
							} else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
								options.stricted = param;
								options.message = messages_1.Messages.StrictParamDupe;
							}
						}
						/* istanbul ignore next */
						if (typeof Object.defineProperty === "function") Object.defineProperty(options.paramSet, key, {
							value: true,
							enumerable: true,
							writable: true,
							configurable: true
						});
						else options.paramSet[key] = true;
					};
					Parser$1.prototype.parseRestElement = function(params) {
						var node = this.createNode();
						this.expect("...");
						var arg = this.parsePattern(params);
						if (this.match("=")) this.throwError(messages_1.Messages.DefaultRestParameter);
						if (!this.match(")")) this.throwError(messages_1.Messages.ParameterAfterRestParameter);
						return this.finalize(node, new Node.RestElement(arg));
					};
					Parser$1.prototype.parseFormalParameter = function(options) {
						var params = [];
						var param = this.match("...") ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
						for (var i = 0; i < params.length; i++) this.validateParam(options, params[i], params[i].value);
						options.simple = options.simple && param instanceof Node.Identifier;
						options.params.push(param);
					};
					Parser$1.prototype.parseFormalParameters = function(firstRestricted) {
						var options = {
							simple: true,
							params: [],
							firstRestricted
						};
						this.expect("(");
						if (!this.match(")")) {
							options.paramSet = {};
							while (this.lookahead.type !== 2) {
								this.parseFormalParameter(options);
								if (this.match(")")) break;
								this.expect(",");
								if (this.match(")")) break;
							}
						}
						this.expect(")");
						return {
							simple: options.simple,
							params: options.params,
							stricted: options.stricted,
							firstRestricted: options.firstRestricted,
							message: options.message
						};
					};
					Parser$1.prototype.matchAsyncFunction = function() {
						var match = this.matchContextualKeyword("async");
						if (match) {
							var state$1 = this.scanner.saveState();
							this.scanner.scanComments();
							var next = this.scanner.lex();
							this.scanner.restoreState(state$1);
							match = state$1.lineNumber === next.lineNumber && next.type === 4 && next.value === "function";
						}
						return match;
					};
					Parser$1.prototype.parseFunctionDeclaration = function(identifierIsOptional) {
						var node = this.createNode();
						var isAsync = this.matchContextualKeyword("async");
						if (isAsync) this.nextToken();
						this.expectKeyword("function");
						var isGenerator = isAsync ? false : this.match("*");
						if (isGenerator) this.nextToken();
						var message;
						var id = null;
						var firstRestricted = null;
						if (!identifierIsOptional || !this.match("(")) {
							var token = this.lookahead;
							id = this.parseVariableIdentifier();
							if (this.context.strict) {
								if (this.scanner.isRestrictedWord(token.value)) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
							} else if (this.scanner.isRestrictedWord(token.value)) {
								firstRestricted = token;
								message = messages_1.Messages.StrictFunctionName;
							} else if (this.scanner.isStrictModeReservedWord(token.value)) {
								firstRestricted = token;
								message = messages_1.Messages.StrictReservedWord;
							}
						}
						var previousAllowAwait = this.context.await;
						var previousAllowYield = this.context.allowYield;
						this.context.await = isAsync;
						this.context.allowYield = !isGenerator;
						var formalParameters = this.parseFormalParameters(firstRestricted);
						var params = formalParameters.params;
						var stricted = formalParameters.stricted;
						firstRestricted = formalParameters.firstRestricted;
						if (formalParameters.message) message = formalParameters.message;
						var previousStrict = this.context.strict;
						var previousAllowStrictDirective = this.context.allowStrictDirective;
						this.context.allowStrictDirective = formalParameters.simple;
						var body = this.parseFunctionSourceElements();
						if (this.context.strict && firstRestricted) this.throwUnexpectedToken(firstRestricted, message);
						if (this.context.strict && stricted) this.tolerateUnexpectedToken(stricted, message);
						this.context.strict = previousStrict;
						this.context.allowStrictDirective = previousAllowStrictDirective;
						this.context.await = previousAllowAwait;
						this.context.allowYield = previousAllowYield;
						return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator));
					};
					Parser$1.prototype.parseFunctionExpression = function() {
						var node = this.createNode();
						var isAsync = this.matchContextualKeyword("async");
						if (isAsync) this.nextToken();
						this.expectKeyword("function");
						var isGenerator = isAsync ? false : this.match("*");
						if (isGenerator) this.nextToken();
						var message;
						var id = null;
						var firstRestricted;
						var previousAllowAwait = this.context.await;
						var previousAllowYield = this.context.allowYield;
						this.context.await = isAsync;
						this.context.allowYield = !isGenerator;
						if (!this.match("(")) {
							var token = this.lookahead;
							id = !this.context.strict && !isGenerator && this.matchKeyword("yield") ? this.parseIdentifierName() : this.parseVariableIdentifier();
							if (this.context.strict) {
								if (this.scanner.isRestrictedWord(token.value)) this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
							} else if (this.scanner.isRestrictedWord(token.value)) {
								firstRestricted = token;
								message = messages_1.Messages.StrictFunctionName;
							} else if (this.scanner.isStrictModeReservedWord(token.value)) {
								firstRestricted = token;
								message = messages_1.Messages.StrictReservedWord;
							}
						}
						var formalParameters = this.parseFormalParameters(firstRestricted);
						var params = formalParameters.params;
						var stricted = formalParameters.stricted;
						firstRestricted = formalParameters.firstRestricted;
						if (formalParameters.message) message = formalParameters.message;
						var previousStrict = this.context.strict;
						var previousAllowStrictDirective = this.context.allowStrictDirective;
						this.context.allowStrictDirective = formalParameters.simple;
						var body = this.parseFunctionSourceElements();
						if (this.context.strict && firstRestricted) this.throwUnexpectedToken(firstRestricted, message);
						if (this.context.strict && stricted) this.tolerateUnexpectedToken(stricted, message);
						this.context.strict = previousStrict;
						this.context.allowStrictDirective = previousAllowStrictDirective;
						this.context.await = previousAllowAwait;
						this.context.allowYield = previousAllowYield;
						return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator));
					};
					Parser$1.prototype.parseDirective = function() {
						var token = this.lookahead;
						var node = this.createNode();
						var expr = this.parseExpression();
						var directive = expr.type === syntax_1.Syntax.Literal ? this.getTokenRaw(token).slice(1, -1) : null;
						this.consumeSemicolon();
						return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr));
					};
					Parser$1.prototype.parseDirectivePrologues = function() {
						var firstRestricted = null;
						var body = [];
						while (true) {
							var token = this.lookahead;
							if (token.type !== 8) break;
							var statement = this.parseDirective();
							body.push(statement);
							var directive = statement.directive;
							if (typeof directive !== "string") break;
							if (directive === "use strict") {
								this.context.strict = true;
								if (firstRestricted) this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
								if (!this.context.allowStrictDirective) this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
							} else if (!firstRestricted && token.octal) firstRestricted = token;
						}
						return body;
					};
					Parser$1.prototype.qualifiedPropertyName = function(token) {
						switch (token.type) {
							case 3:
							case 8:
							case 1:
							case 5:
							case 6:
							case 4: return true;
							case 7: return token.value === "[";
							default: break;
						}
						return false;
					};
					Parser$1.prototype.parseGetterMethod = function() {
						var node = this.createNode();
						var isGenerator = false;
						var previousAllowYield = this.context.allowYield;
						this.context.allowYield = !isGenerator;
						var formalParameters = this.parseFormalParameters();
						if (formalParameters.params.length > 0) this.tolerateError(messages_1.Messages.BadGetterArity);
						var method = this.parsePropertyMethod(formalParameters);
						this.context.allowYield = previousAllowYield;
						return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
					};
					Parser$1.prototype.parseSetterMethod = function() {
						var node = this.createNode();
						var isGenerator = false;
						var previousAllowYield = this.context.allowYield;
						this.context.allowYield = !isGenerator;
						var formalParameters = this.parseFormalParameters();
						if (formalParameters.params.length !== 1) this.tolerateError(messages_1.Messages.BadSetterArity);
						else if (formalParameters.params[0] instanceof Node.RestElement) this.tolerateError(messages_1.Messages.BadSetterRestParameter);
						var method = this.parsePropertyMethod(formalParameters);
						this.context.allowYield = previousAllowYield;
						return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
					};
					Parser$1.prototype.parseGeneratorMethod = function() {
						var node = this.createNode();
						var isGenerator = true;
						var previousAllowYield = this.context.allowYield;
						this.context.allowYield = true;
						var params = this.parseFormalParameters();
						this.context.allowYield = false;
						var method = this.parsePropertyMethod(params);
						this.context.allowYield = previousAllowYield;
						return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
					};
					Parser$1.prototype.isStartOfExpression = function() {
						var start = true;
						var value = this.lookahead.value;
						switch (this.lookahead.type) {
							case 7:
								start = value === "[" || value === "(" || value === "{" || value === "+" || value === "-" || value === "!" || value === "~" || value === "++" || value === "--" || value === "/" || value === "/=";
								break;
							case 4:
								start = value === "class" || value === "delete" || value === "function" || value === "let" || value === "new" || value === "super" || value === "this" || value === "typeof" || value === "void" || value === "yield";
								break;
							default: break;
						}
						return start;
					};
					Parser$1.prototype.parseYieldExpression = function() {
						var node = this.createNode();
						this.expectKeyword("yield");
						var argument = null;
						var delegate = false;
						if (!this.hasLineTerminator) {
							var previousAllowYield = this.context.allowYield;
							this.context.allowYield = false;
							delegate = this.match("*");
							if (delegate) {
								this.nextToken();
								argument = this.parseAssignmentExpression();
							} else if (this.isStartOfExpression()) argument = this.parseAssignmentExpression();
							this.context.allowYield = previousAllowYield;
						}
						return this.finalize(node, new Node.YieldExpression(argument, delegate));
					};
					Parser$1.prototype.parseClassElement = function(hasConstructor) {
						var token = this.lookahead;
						var node = this.createNode();
						var kind = "";
						var key = null;
						var value = null;
						var computed = false;
						var method = false;
						var isStatic = false;
						var isAsync = false;
						if (this.match("*")) this.nextToken();
						else {
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
							if (key.name === "static" && (this.qualifiedPropertyName(this.lookahead) || this.match("*"))) {
								token = this.lookahead;
								isStatic = true;
								computed = this.match("[");
								if (this.match("*")) this.nextToken();
								else key = this.parseObjectPropertyKey();
							}
							if (token.type === 3 && !this.hasLineTerminator && token.value === "async") {
								var punctuator = this.lookahead.value;
								if (punctuator !== ":" && punctuator !== "(" && punctuator !== "*") {
									isAsync = true;
									token = this.lookahead;
									key = this.parseObjectPropertyKey();
									if (token.type === 3 && token.value === "constructor") this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
								}
							}
						}
						var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
						if (token.type === 3) {
							if (token.value === "get" && lookaheadPropertyKey) {
								kind = "get";
								computed = this.match("[");
								key = this.parseObjectPropertyKey();
								this.context.allowYield = false;
								value = this.parseGetterMethod();
							} else if (token.value === "set" && lookaheadPropertyKey) {
								kind = "set";
								computed = this.match("[");
								key = this.parseObjectPropertyKey();
								value = this.parseSetterMethod();
							}
						} else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) {
							kind = "init";
							computed = this.match("[");
							key = this.parseObjectPropertyKey();
							value = this.parseGeneratorMethod();
							method = true;
						}
						if (!kind && key && this.match("(")) {
							kind = "init";
							value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
							method = true;
						}
						if (!kind) this.throwUnexpectedToken(this.lookahead);
						if (kind === "init") kind = "method";
						if (!computed) {
							if (isStatic && this.isPropertyKey(key, "prototype")) this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
							if (!isStatic && this.isPropertyKey(key, "constructor")) {
								if (kind !== "method" || !method || value && value.generator) this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
								if (hasConstructor.value) this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
								else hasConstructor.value = true;
								kind = "constructor";
							}
						}
						return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic));
					};
					Parser$1.prototype.parseClassElementList = function() {
						var body = [];
						var hasConstructor = { value: false };
						this.expect("{");
						while (!this.match("}")) if (this.match(";")) this.nextToken();
						else body.push(this.parseClassElement(hasConstructor));
						this.expect("}");
						return body;
					};
					Parser$1.prototype.parseClassBody = function() {
						var node = this.createNode();
						var elementList = this.parseClassElementList();
						return this.finalize(node, new Node.ClassBody(elementList));
					};
					Parser$1.prototype.parseClassDeclaration = function(identifierIsOptional) {
						var node = this.createNode();
						var previousStrict = this.context.strict;
						this.context.strict = true;
						this.expectKeyword("class");
						var id = identifierIsOptional && this.lookahead.type !== 3 ? null : this.parseVariableIdentifier();
						var superClass = null;
						if (this.matchKeyword("extends")) {
							this.nextToken();
							superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
						}
						var classBody = this.parseClassBody();
						this.context.strict = previousStrict;
						return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody));
					};
					Parser$1.prototype.parseClassExpression = function() {
						var node = this.createNode();
						var previousStrict = this.context.strict;
						this.context.strict = true;
						this.expectKeyword("class");
						var id = this.lookahead.type === 3 ? this.parseVariableIdentifier() : null;
						var superClass = null;
						if (this.matchKeyword("extends")) {
							this.nextToken();
							superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
						}
						var classBody = this.parseClassBody();
						this.context.strict = previousStrict;
						return this.finalize(node, new Node.ClassExpression(id, superClass, classBody));
					};
					Parser$1.prototype.parseModule = function() {
						this.context.strict = true;
						this.context.isModule = true;
						this.scanner.isModule = true;
						var node = this.createNode();
						var body = this.parseDirectivePrologues();
						while (this.lookahead.type !== 2) body.push(this.parseStatementListItem());
						return this.finalize(node, new Node.Module(body));
					};
					Parser$1.prototype.parseScript = function() {
						var node = this.createNode();
						var body = this.parseDirectivePrologues();
						while (this.lookahead.type !== 2) body.push(this.parseStatementListItem());
						return this.finalize(node, new Node.Script(body));
					};
					Parser$1.prototype.parseModuleSpecifier = function() {
						var node = this.createNode();
						if (this.lookahead.type !== 8) this.throwError(messages_1.Messages.InvalidModuleSpecifier);
						var token = this.nextToken();
						var raw = this.getTokenRaw(token);
						return this.finalize(node, new Node.Literal(token.value, raw));
					};
					Parser$1.prototype.parseImportSpecifier = function() {
						var node = this.createNode();
						var imported;
						var local;
						if (this.lookahead.type === 3) {
							imported = this.parseVariableIdentifier();
							local = imported;
							if (this.matchContextualKeyword("as")) {
								this.nextToken();
								local = this.parseVariableIdentifier();
							}
						} else {
							imported = this.parseIdentifierName();
							local = imported;
							if (this.matchContextualKeyword("as")) {
								this.nextToken();
								local = this.parseVariableIdentifier();
							} else this.throwUnexpectedToken(this.nextToken());
						}
						return this.finalize(node, new Node.ImportSpecifier(local, imported));
					};
					Parser$1.prototype.parseNamedImports = function() {
						this.expect("{");
						var specifiers = [];
						while (!this.match("}")) {
							specifiers.push(this.parseImportSpecifier());
							if (!this.match("}")) this.expect(",");
						}
						this.expect("}");
						return specifiers;
					};
					Parser$1.prototype.parseImportDefaultSpecifier = function() {
						var node = this.createNode();
						var local = this.parseIdentifierName();
						return this.finalize(node, new Node.ImportDefaultSpecifier(local));
					};
					Parser$1.prototype.parseImportNamespaceSpecifier = function() {
						var node = this.createNode();
						this.expect("*");
						if (!this.matchContextualKeyword("as")) this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
						this.nextToken();
						var local = this.parseIdentifierName();
						return this.finalize(node, new Node.ImportNamespaceSpecifier(local));
					};
					Parser$1.prototype.parseImportDeclaration = function() {
						if (this.context.inFunctionBody) this.throwError(messages_1.Messages.IllegalImportDeclaration);
						var node = this.createNode();
						this.expectKeyword("import");
						var src;
						var specifiers = [];
						if (this.lookahead.type === 8) src = this.parseModuleSpecifier();
						else {
							if (this.match("{")) specifiers = specifiers.concat(this.parseNamedImports());
							else if (this.match("*")) specifiers.push(this.parseImportNamespaceSpecifier());
							else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword("default")) {
								specifiers.push(this.parseImportDefaultSpecifier());
								if (this.match(",")) {
									this.nextToken();
									if (this.match("*")) specifiers.push(this.parseImportNamespaceSpecifier());
									else if (this.match("{")) specifiers = specifiers.concat(this.parseNamedImports());
									else this.throwUnexpectedToken(this.lookahead);
								}
							} else this.throwUnexpectedToken(this.nextToken());
							if (!this.matchContextualKeyword("from")) {
								var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
								this.throwError(message, this.lookahead.value);
							}
							this.nextToken();
							src = this.parseModuleSpecifier();
						}
						this.consumeSemicolon();
						return this.finalize(node, new Node.ImportDeclaration(specifiers, src));
					};
					Parser$1.prototype.parseExportSpecifier = function() {
						var node = this.createNode();
						var local = this.parseIdentifierName();
						var exported = local;
						if (this.matchContextualKeyword("as")) {
							this.nextToken();
							exported = this.parseIdentifierName();
						}
						return this.finalize(node, new Node.ExportSpecifier(local, exported));
					};
					Parser$1.prototype.parseExportDeclaration = function() {
						if (this.context.inFunctionBody) this.throwError(messages_1.Messages.IllegalExportDeclaration);
						var node = this.createNode();
						this.expectKeyword("export");
						var exportDeclaration;
						if (this.matchKeyword("default")) {
							this.nextToken();
							if (this.matchKeyword("function")) {
								var declaration = this.parseFunctionDeclaration(true);
								exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
							} else if (this.matchKeyword("class")) {
								var declaration = this.parseClassDeclaration(true);
								exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
							} else if (this.matchContextualKeyword("async")) {
								var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
								exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
							} else {
								if (this.matchContextualKeyword("from")) this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
								var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") ? this.parseArrayInitializer() : this.parseAssignmentExpression();
								this.consumeSemicolon();
								exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
							}
						} else if (this.match("*")) {
							this.nextToken();
							if (!this.matchContextualKeyword("from")) {
								var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
								this.throwError(message, this.lookahead.value);
							}
							this.nextToken();
							var src = this.parseModuleSpecifier();
							this.consumeSemicolon();
							exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
						} else if (this.lookahead.type === 4) {
							var declaration = void 0;
							switch (this.lookahead.value) {
								case "let":
								case "const":
									declaration = this.parseLexicalDeclaration({ inFor: false });
									break;
								case "var":
								case "class":
								case "function":
									declaration = this.parseStatementListItem();
									break;
								default: this.throwUnexpectedToken(this.lookahead);
							}
							exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
						} else if (this.matchAsyncFunction()) {
							var declaration = this.parseFunctionDeclaration();
							exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
						} else {
							var specifiers = [];
							var source = null;
							var isExportFromIdentifier = false;
							this.expect("{");
							while (!this.match("}")) {
								isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword("default");
								specifiers.push(this.parseExportSpecifier());
								if (!this.match("}")) this.expect(",");
							}
							this.expect("}");
							if (this.matchContextualKeyword("from")) {
								this.nextToken();
								source = this.parseModuleSpecifier();
								this.consumeSemicolon();
							} else if (isExportFromIdentifier) {
								var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
								this.throwError(message, this.lookahead.value);
							} else this.consumeSemicolon();
							exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source));
						}
						return exportDeclaration;
					};
					return Parser$1;
				}();
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				function assert$29(condition, message) {
					/* istanbul ignore if */
					if (!condition) throw new Error("ASSERT: " + message);
				}
				exports$1.assert = assert$29;
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				exports$1.ErrorHandler = function() {
					function ErrorHandler() {
						this.errors = [];
						this.tolerant = false;
					}
					ErrorHandler.prototype.recordError = function(error) {
						this.errors.push(error);
					};
					ErrorHandler.prototype.tolerate = function(error) {
						if (this.tolerant) this.recordError(error);
						else throw error;
					};
					ErrorHandler.prototype.constructError = function(msg, column) {
						var error = new Error(msg);
						try {
							throw error;
						} catch (base) {
							/* istanbul ignore else */
							if (Object.create && Object.defineProperty) {
								error = Object.create(base);
								Object.defineProperty(error, "column", { value: column });
							}
						}
						/* istanbul ignore next */
						return error;
					};
					ErrorHandler.prototype.createError = function(index, line, col, description$1) {
						var msg = "Line " + line + ": " + description$1;
						var error = this.constructError(msg, col);
						error.index = index;
						error.lineNumber = line;
						error.description = description$1;
						return error;
					};
					ErrorHandler.prototype.throwError = function(index, line, col, description$1) {
						throw this.createError(index, line, col, description$1);
					};
					ErrorHandler.prototype.tolerateError = function(index, line, col, description$1) {
						var error = this.createError(index, line, col, description$1);
						if (this.tolerant) this.recordError(error);
						else throw error;
					};
					return ErrorHandler;
				}();
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				exports$1.Messages = {
					BadGetterArity: "Getter must not have any formal parameters",
					BadSetterArity: "Setter must have exactly one formal parameter",
					BadSetterRestParameter: "Setter function argument must not be a rest parameter",
					ConstructorIsAsync: "Class constructor may not be an async method",
					ConstructorSpecialMethod: "Class constructor may not be an accessor",
					DeclarationMissingInitializer: "Missing initializer in %0 declaration",
					DefaultRestParameter: "Unexpected token =",
					DuplicateBinding: "Duplicate binding %0",
					DuplicateConstructor: "A class may only have one constructor",
					DuplicateProtoProperty: "Duplicate __proto__ fields are not allowed in object literals",
					ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer",
					GeneratorInLegacyContext: "Generator declarations are not allowed in legacy contexts",
					IllegalBreak: "Illegal break statement",
					IllegalContinue: "Illegal continue statement",
					IllegalExportDeclaration: "Unexpected token",
					IllegalImportDeclaration: "Unexpected token",
					IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list",
					IllegalReturn: "Illegal return statement",
					InvalidEscapedReservedWord: "Keyword must not contain escaped characters",
					InvalidHexEscapeSequence: "Invalid hexadecimal escape sequence",
					InvalidLHSInAssignment: "Invalid left-hand side in assignment",
					InvalidLHSInForIn: "Invalid left-hand side in for-in",
					InvalidLHSInForLoop: "Invalid left-hand side in for-loop",
					InvalidModuleSpecifier: "Unexpected token",
					InvalidRegExp: "Invalid regular expression",
					LetInLexicalBinding: "let is disallowed as a lexically bound name",
					MissingFromClause: "Unexpected token",
					MultipleDefaultsInSwitch: "More than one default clause in switch statement",
					NewlineAfterThrow: "Illegal newline after throw",
					NoAsAfterImportNamespace: "Unexpected token",
					NoCatchOrFinally: "Missing catch or finally after try",
					ParameterAfterRestParameter: "Rest parameter must be last formal parameter",
					Redeclaration: "%0 '%1' has already been declared",
					StaticPrototype: "Classes may not have static property named prototype",
					StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode",
					StrictDelete: "Delete of an unqualified identifier in strict mode.",
					StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block",
					StrictFunctionName: "Function name may not be eval or arguments in strict mode",
					StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode",
					StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode",
					StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode",
					StrictModeWith: "Strict mode code may not include a with statement",
					StrictOctalLiteral: "Octal literals are not allowed in strict mode.",
					StrictParamDupe: "Strict mode function may not have duplicate parameter names",
					StrictParamName: "Parameter name eval or arguments is not allowed in strict mode",
					StrictReservedWord: "Use of future reserved word in strict mode",
					StrictVarName: "Variable name may not be eval or arguments in strict mode",
					TemplateOctalLiteral: "Octal literals are not allowed in template strings.",
					UnexpectedEOS: "Unexpected end of input",
					UnexpectedIdentifier: "Unexpected identifier",
					UnexpectedNumber: "Unexpected number",
					UnexpectedReserved: "Unexpected reserved word",
					UnexpectedString: "Unexpected string",
					UnexpectedTemplate: "Unexpected quasi %0",
					UnexpectedToken: "Unexpected token %0",
					UnexpectedTokenIllegal: "Unexpected token ILLEGAL",
					UnknownLabel: "Undefined label '%0'",
					UnterminatedRegExp: "Invalid regular expression: missing /"
				};
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var assert_1$1 = __webpack_require__(9);
				var character_1 = __webpack_require__(4);
				var messages_1 = __webpack_require__(11);
				function hexValue(ch) {
					return "0123456789abcdef".indexOf(ch.toLowerCase());
				}
				function octalValue(ch) {
					return "01234567".indexOf(ch);
				}
				exports$1.Scanner = function() {
					function Scanner(code, handler) {
						this.source = code;
						this.errorHandler = handler;
						this.trackComment = false;
						this.isModule = false;
						this.length = code.length;
						this.index = 0;
						this.lineNumber = code.length > 0 ? 1 : 0;
						this.lineStart = 0;
						this.curlyStack = [];
					}
					Scanner.prototype.saveState = function() {
						return {
							index: this.index,
							lineNumber: this.lineNumber,
							lineStart: this.lineStart
						};
					};
					Scanner.prototype.restoreState = function(state$1) {
						this.index = state$1.index;
						this.lineNumber = state$1.lineNumber;
						this.lineStart = state$1.lineStart;
					};
					Scanner.prototype.eof = function() {
						return this.index >= this.length;
					};
					Scanner.prototype.throwUnexpectedToken = function(message) {
						if (message === void 0) message = messages_1.Messages.UnexpectedTokenIllegal;
						return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
					};
					Scanner.prototype.tolerateUnexpectedToken = function(message) {
						if (message === void 0) message = messages_1.Messages.UnexpectedTokenIllegal;
						this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
					};
					Scanner.prototype.skipSingleLineComment = function(offset) {
						var comments = [];
						var start, loc;
						if (this.trackComment) {
							comments = [];
							start = this.index - offset;
							loc = {
								start: {
									line: this.lineNumber,
									column: this.index - this.lineStart - offset
								},
								end: {}
							};
						}
						while (!this.eof()) {
							var ch = this.source.charCodeAt(this.index);
							++this.index;
							if (character_1.Character.isLineTerminator(ch)) {
								if (this.trackComment) {
									loc.end = {
										line: this.lineNumber,
										column: this.index - this.lineStart - 1
									};
									var entry = {
										multiLine: false,
										slice: [start + offset, this.index - 1],
										range: [start, this.index - 1],
										loc
									};
									comments.push(entry);
								}
								if (ch === 13 && this.source.charCodeAt(this.index) === 10) ++this.index;
								++this.lineNumber;
								this.lineStart = this.index;
								return comments;
							}
						}
						if (this.trackComment) {
							loc.end = {
								line: this.lineNumber,
								column: this.index - this.lineStart
							};
							var entry = {
								multiLine: false,
								slice: [start + offset, this.index],
								range: [start, this.index],
								loc
							};
							comments.push(entry);
						}
						return comments;
					};
					Scanner.prototype.skipMultiLineComment = function() {
						var comments = [];
						var start, loc;
						if (this.trackComment) {
							comments = [];
							start = this.index - 2;
							loc = {
								start: {
									line: this.lineNumber,
									column: this.index - this.lineStart - 2
								},
								end: {}
							};
						}
						while (!this.eof()) {
							var ch = this.source.charCodeAt(this.index);
							if (character_1.Character.isLineTerminator(ch)) {
								if (ch === 13 && this.source.charCodeAt(this.index + 1) === 10) ++this.index;
								++this.lineNumber;
								++this.index;
								this.lineStart = this.index;
							} else if (ch === 42) {
								if (this.source.charCodeAt(this.index + 1) === 47) {
									this.index += 2;
									if (this.trackComment) {
										loc.end = {
											line: this.lineNumber,
											column: this.index - this.lineStart
										};
										var entry = {
											multiLine: true,
											slice: [start + 2, this.index - 2],
											range: [start, this.index],
											loc
										};
										comments.push(entry);
									}
									return comments;
								}
								++this.index;
							} else ++this.index;
						}
						if (this.trackComment) {
							loc.end = {
								line: this.lineNumber,
								column: this.index - this.lineStart
							};
							var entry = {
								multiLine: true,
								slice: [start + 2, this.index],
								range: [start, this.index],
								loc
							};
							comments.push(entry);
						}
						this.tolerateUnexpectedToken();
						return comments;
					};
					Scanner.prototype.scanComments = function() {
						var comments;
						if (this.trackComment) comments = [];
						var start = this.index === 0;
						while (!this.eof()) {
							var ch = this.source.charCodeAt(this.index);
							if (character_1.Character.isWhiteSpace(ch)) ++this.index;
							else if (character_1.Character.isLineTerminator(ch)) {
								++this.index;
								if (ch === 13 && this.source.charCodeAt(this.index) === 10) ++this.index;
								++this.lineNumber;
								this.lineStart = this.index;
								start = true;
							} else if (ch === 47) {
								ch = this.source.charCodeAt(this.index + 1);
								if (ch === 47) {
									this.index += 2;
									var comment = this.skipSingleLineComment(2);
									if (this.trackComment) comments = comments.concat(comment);
									start = true;
								} else if (ch === 42) {
									this.index += 2;
									var comment = this.skipMultiLineComment();
									if (this.trackComment) comments = comments.concat(comment);
								} else break;
							} else if (start && ch === 45) if (this.source.charCodeAt(this.index + 1) === 45 && this.source.charCodeAt(this.index + 2) === 62) {
								this.index += 3;
								var comment = this.skipSingleLineComment(3);
								if (this.trackComment) comments = comments.concat(comment);
							} else break;
							else if (ch === 60 && !this.isModule) if (this.source.slice(this.index + 1, this.index + 4) === "!--") {
								this.index += 4;
								var comment = this.skipSingleLineComment(4);
								if (this.trackComment) comments = comments.concat(comment);
							} else break;
							else break;
						}
						return comments;
					};
					Scanner.prototype.isFutureReservedWord = function(id) {
						switch (id) {
							case "enum":
							case "export":
							case "import":
							case "super": return true;
							default: return false;
						}
					};
					Scanner.prototype.isStrictModeReservedWord = function(id) {
						switch (id) {
							case "implements":
							case "interface":
							case "package":
							case "private":
							case "protected":
							case "public":
							case "static":
							case "yield":
							case "let": return true;
							default: return false;
						}
					};
					Scanner.prototype.isRestrictedWord = function(id) {
						return id === "eval" || id === "arguments";
					};
					Scanner.prototype.isKeyword = function(id) {
						switch (id.length) {
							case 2: return id === "if" || id === "in" || id === "do";
							case 3: return id === "var" || id === "for" || id === "new" || id === "try" || id === "let";
							case 4: return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum";
							case 5: return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super";
							case 6: return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import";
							case 7: return id === "default" || id === "finally" || id === "extends";
							case 8: return id === "function" || id === "continue" || id === "debugger";
							case 10: return id === "instanceof";
							default: return false;
						}
					};
					Scanner.prototype.codePointAt = function(i) {
						var cp = this.source.charCodeAt(i);
						if (cp >= 55296 && cp <= 56319) {
							var second = this.source.charCodeAt(i + 1);
							if (second >= 56320 && second <= 57343) cp = (cp - 55296) * 1024 + second - 56320 + 65536;
						}
						return cp;
					};
					Scanner.prototype.scanHexEscape = function(prefix) {
						var len = prefix === "u" ? 4 : 2;
						var code = 0;
						for (var i = 0; i < len; ++i) if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) code = code * 16 + hexValue(this.source[this.index++]);
						else return null;
						return String.fromCharCode(code);
					};
					Scanner.prototype.scanUnicodeCodePointEscape = function() {
						var ch = this.source[this.index];
						var code = 0;
						if (ch === "}") this.throwUnexpectedToken();
						while (!this.eof()) {
							ch = this.source[this.index++];
							if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) break;
							code = code * 16 + hexValue(ch);
						}
						if (code > 1114111 || ch !== "}") this.throwUnexpectedToken();
						return character_1.Character.fromCodePoint(code);
					};
					Scanner.prototype.getIdentifier = function() {
						var start = this.index++;
						while (!this.eof()) {
							var ch = this.source.charCodeAt(this.index);
							if (ch === 92) {
								this.index = start;
								return this.getComplexIdentifier();
							} else if (ch >= 55296 && ch < 57343) {
								this.index = start;
								return this.getComplexIdentifier();
							}
							if (character_1.Character.isIdentifierPart(ch)) ++this.index;
							else break;
						}
						return this.source.slice(start, this.index);
					};
					Scanner.prototype.getComplexIdentifier = function() {
						var cp = this.codePointAt(this.index);
						var id = character_1.Character.fromCodePoint(cp);
						this.index += id.length;
						var ch;
						if (cp === 92) {
							if (this.source.charCodeAt(this.index) !== 117) this.throwUnexpectedToken();
							++this.index;
							if (this.source[this.index] === "{") {
								++this.index;
								ch = this.scanUnicodeCodePointEscape();
							} else {
								ch = this.scanHexEscape("u");
								if (ch === null || ch === "\\" || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) this.throwUnexpectedToken();
							}
							id = ch;
						}
						while (!this.eof()) {
							cp = this.codePointAt(this.index);
							if (!character_1.Character.isIdentifierPart(cp)) break;
							ch = character_1.Character.fromCodePoint(cp);
							id += ch;
							this.index += ch.length;
							if (cp === 92) {
								id = id.substr(0, id.length - 1);
								if (this.source.charCodeAt(this.index) !== 117) this.throwUnexpectedToken();
								++this.index;
								if (this.source[this.index] === "{") {
									++this.index;
									ch = this.scanUnicodeCodePointEscape();
								} else {
									ch = this.scanHexEscape("u");
									if (ch === null || ch === "\\" || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) this.throwUnexpectedToken();
								}
								id += ch;
							}
						}
						return id;
					};
					Scanner.prototype.octalToDecimal = function(ch) {
						var octal = ch !== "0";
						var code = octalValue(ch);
						if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
							octal = true;
							code = code * 8 + octalValue(this.source[this.index++]);
							if ("0123".indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) code = code * 8 + octalValue(this.source[this.index++]);
						}
						return {
							code,
							octal
						};
					};
					Scanner.prototype.scanIdentifier = function() {
						var type;
						var start = this.index;
						var id = this.source.charCodeAt(start) === 92 ? this.getComplexIdentifier() : this.getIdentifier();
						if (id.length === 1) type = 3;
						else if (this.isKeyword(id)) type = 4;
						else if (id === "null") type = 5;
						else if (id === "true" || id === "false") type = 1;
						else type = 3;
						if (type !== 3 && start + id.length !== this.index) {
							var restore = this.index;
							this.index = start;
							this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
							this.index = restore;
						}
						return {
							type,
							value: id,
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.scanPunctuator = function() {
						var start = this.index;
						var str = this.source[this.index];
						switch (str) {
							case "(":
							case "{":
								if (str === "{") this.curlyStack.push("{");
								++this.index;
								break;
							case ".":
								++this.index;
								if (this.source[this.index] === "." && this.source[this.index + 1] === ".") {
									this.index += 2;
									str = "...";
								}
								break;
							case "}":
								++this.index;
								this.curlyStack.pop();
								break;
							case ")":
							case ";":
							case ",":
							case "[":
							case "]":
							case ":":
							case "?":
							case "~":
								++this.index;
								break;
							default:
								str = this.source.substr(this.index, 4);
								if (str === ">>>=") this.index += 4;
								else {
									str = str.substr(0, 3);
									if (str === "===" || str === "!==" || str === ">>>" || str === "<<=" || str === ">>=" || str === "**=") this.index += 3;
									else {
										str = str.substr(0, 2);
										if (str === "&&" || str === "||" || str === "==" || str === "!=" || str === "+=" || str === "-=" || str === "*=" || str === "/=" || str === "++" || str === "--" || str === "<<" || str === ">>" || str === "&=" || str === "|=" || str === "^=" || str === "%=" || str === "<=" || str === ">=" || str === "=>" || str === "**") this.index += 2;
										else {
											str = this.source[this.index];
											if ("<>=!+-*%&|^/".indexOf(str) >= 0) ++this.index;
										}
									}
								}
						}
						if (this.index === start) this.throwUnexpectedToken();
						return {
							type: 7,
							value: str,
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.scanHexLiteral = function(start) {
						var num = "";
						while (!this.eof()) {
							if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) break;
							num += this.source[this.index++];
						}
						if (num.length === 0) this.throwUnexpectedToken();
						if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) this.throwUnexpectedToken();
						return {
							type: 6,
							value: parseInt("0x" + num, 16),
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.scanBinaryLiteral = function(start) {
						var num = "";
						var ch;
						while (!this.eof()) {
							ch = this.source[this.index];
							if (ch !== "0" && ch !== "1") break;
							num += this.source[this.index++];
						}
						if (num.length === 0) this.throwUnexpectedToken();
						if (!this.eof()) {
							ch = this.source.charCodeAt(this.index);
							/* istanbul ignore else */
							if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) this.throwUnexpectedToken();
						}
						return {
							type: 6,
							value: parseInt(num, 2),
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.scanOctalLiteral = function(prefix, start) {
						var num = "";
						var octal = false;
						if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
							octal = true;
							num = "0" + this.source[this.index++];
						} else ++this.index;
						while (!this.eof()) {
							if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) break;
							num += this.source[this.index++];
						}
						if (!octal && num.length === 0) this.throwUnexpectedToken();
						if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) this.throwUnexpectedToken();
						return {
							type: 6,
							value: parseInt(num, 8),
							octal,
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.isImplicitOctalLiteral = function() {
						for (var i = this.index + 1; i < this.length; ++i) {
							var ch = this.source[i];
							if (ch === "8" || ch === "9") return false;
							if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) return true;
						}
						return true;
					};
					Scanner.prototype.scanNumericLiteral = function() {
						var start = this.index;
						var ch = this.source[start];
						assert_1$1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || ch === ".", "Numeric literal must start with a decimal digit or a decimal point");
						var num = "";
						if (ch !== ".") {
							num = this.source[this.index++];
							ch = this.source[this.index];
							if (num === "0") {
								if (ch === "x" || ch === "X") {
									++this.index;
									return this.scanHexLiteral(start);
								}
								if (ch === "b" || ch === "B") {
									++this.index;
									return this.scanBinaryLiteral(start);
								}
								if (ch === "o" || ch === "O") return this.scanOctalLiteral(ch, start);
								if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
									if (this.isImplicitOctalLiteral()) return this.scanOctalLiteral(ch, start);
								}
							}
							while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) num += this.source[this.index++];
							ch = this.source[this.index];
						}
						if (ch === ".") {
							num += this.source[this.index++];
							while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) num += this.source[this.index++];
							ch = this.source[this.index];
						}
						if (ch === "e" || ch === "E") {
							num += this.source[this.index++];
							ch = this.source[this.index];
							if (ch === "+" || ch === "-") num += this.source[this.index++];
							if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) num += this.source[this.index++];
							else this.throwUnexpectedToken();
						}
						if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) this.throwUnexpectedToken();
						return {
							type: 6,
							value: parseFloat(num),
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.scanStringLiteral = function() {
						var start = this.index;
						var quote = this.source[start];
						assert_1$1.assert(quote === "'" || quote === "\"", "String literal must starts with a quote");
						++this.index;
						var octal = false;
						var str = "";
						while (!this.eof()) {
							var ch = this.source[this.index++];
							if (ch === quote) {
								quote = "";
								break;
							} else if (ch === "\\") {
								ch = this.source[this.index++];
								if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) switch (ch) {
									case "u":
										if (this.source[this.index] === "{") {
											++this.index;
											str += this.scanUnicodeCodePointEscape();
										} else {
											var unescaped_1 = this.scanHexEscape(ch);
											if (unescaped_1 === null) this.throwUnexpectedToken();
											str += unescaped_1;
										}
										break;
									case "x":
										var unescaped = this.scanHexEscape(ch);
										if (unescaped === null) this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
										str += unescaped;
										break;
									case "n":
										str += "\n";
										break;
									case "r":
										str += "\r";
										break;
									case "t":
										str += "	";
										break;
									case "b":
										str += "\b";
										break;
									case "f":
										str += "\f";
										break;
									case "v":
										str += "\v";
										break;
									case "8":
									case "9":
										str += ch;
										this.tolerateUnexpectedToken();
										break;
									default:
										if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
											var octToDec = this.octalToDecimal(ch);
											octal = octToDec.octal || octal;
											str += String.fromCharCode(octToDec.code);
										} else str += ch;
										break;
								}
								else {
									++this.lineNumber;
									if (ch === "\r" && this.source[this.index] === "\n") ++this.index;
									this.lineStart = this.index;
								}
							} else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) break;
							else str += ch;
						}
						if (quote !== "") {
							this.index = start;
							this.throwUnexpectedToken();
						}
						return {
							type: 8,
							value: str,
							octal,
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.scanTemplate = function() {
						var cooked = "";
						var terminated = false;
						var start = this.index;
						var head = this.source[start] === "`";
						var tail$1 = false;
						var rawOffset = 2;
						++this.index;
						while (!this.eof()) {
							var ch = this.source[this.index++];
							if (ch === "`") {
								rawOffset = 1;
								tail$1 = true;
								terminated = true;
								break;
							} else if (ch === "$") {
								if (this.source[this.index] === "{") {
									this.curlyStack.push("${");
									++this.index;
									terminated = true;
									break;
								}
								cooked += ch;
							} else if (ch === "\\") {
								ch = this.source[this.index++];
								if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) switch (ch) {
									case "n":
										cooked += "\n";
										break;
									case "r":
										cooked += "\r";
										break;
									case "t":
										cooked += "	";
										break;
									case "u":
										if (this.source[this.index] === "{") {
											++this.index;
											cooked += this.scanUnicodeCodePointEscape();
										} else {
											var restore = this.index;
											var unescaped_2 = this.scanHexEscape(ch);
											if (unescaped_2 !== null) cooked += unescaped_2;
											else {
												this.index = restore;
												cooked += ch;
											}
										}
										break;
									case "x":
										var unescaped = this.scanHexEscape(ch);
										if (unescaped === null) this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
										cooked += unescaped;
										break;
									case "b":
										cooked += "\b";
										break;
									case "f":
										cooked += "\f";
										break;
									case "v":
										cooked += "\v";
										break;
									default:
										if (ch === "0") {
											if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
											cooked += "\0";
										} else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
										else cooked += ch;
										break;
								}
								else {
									++this.lineNumber;
									if (ch === "\r" && this.source[this.index] === "\n") ++this.index;
									this.lineStart = this.index;
								}
							} else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
								++this.lineNumber;
								if (ch === "\r" && this.source[this.index] === "\n") ++this.index;
								this.lineStart = this.index;
								cooked += "\n";
							} else cooked += ch;
						}
						if (!terminated) this.throwUnexpectedToken();
						if (!head) this.curlyStack.pop();
						return {
							type: 10,
							value: this.source.slice(start + 1, this.index - rawOffset),
							cooked,
							head,
							tail: tail$1,
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.testRegExp = function(pattern, flags) {
						var astralSubstitute = "";
						var tmp = pattern;
						var self$1 = this;
						if (flags.indexOf("u") >= 0) tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function($0, $1, $2) {
							var codePoint = parseInt($1 || $2, 16);
							if (codePoint > 1114111) self$1.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
							if (codePoint <= 65535) return String.fromCharCode(codePoint);
							return astralSubstitute;
						}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
						try {
							return new RegExp(pattern, flags);
						} catch (exception) {
							/* istanbul ignore next */
							return null;
						}
					};
					Scanner.prototype.scanRegExpBody = function() {
						var ch = this.source[this.index];
						assert_1$1.assert(ch === "/", "Regular expression literal must start with a slash");
						var str = this.source[this.index++];
						var classMarker = false;
						var terminated = false;
						while (!this.eof()) {
							ch = this.source[this.index++];
							str += ch;
							if (ch === "\\") {
								ch = this.source[this.index++];
								if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
								str += ch;
							} else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
							else if (classMarker) {
								if (ch === "]") classMarker = false;
							} else if (ch === "/") {
								terminated = true;
								break;
							} else if (ch === "[") classMarker = true;
						}
						if (!terminated) this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
						return str.substr(1, str.length - 2);
					};
					Scanner.prototype.scanRegExpFlags = function() {
						var str = "";
						var flags = "";
						while (!this.eof()) {
							var ch = this.source[this.index];
							if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) break;
							++this.index;
							if (ch === "\\" && !this.eof()) {
								ch = this.source[this.index];
								if (ch === "u") {
									++this.index;
									var restore = this.index;
									var char = this.scanHexEscape("u");
									if (char !== null) {
										flags += char;
										for (str += "\\u"; restore < this.index; ++restore) str += this.source[restore];
									} else {
										this.index = restore;
										flags += "u";
										str += "\\u";
									}
									this.tolerateUnexpectedToken();
								} else {
									str += "\\";
									this.tolerateUnexpectedToken();
								}
							} else {
								flags += ch;
								str += ch;
							}
						}
						return flags;
					};
					Scanner.prototype.scanRegExp = function() {
						var start = this.index;
						var pattern = this.scanRegExpBody();
						var flags = this.scanRegExpFlags();
						return {
							type: 9,
							value: "",
							pattern,
							flags,
							regex: this.testRegExp(pattern, flags),
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start,
							end: this.index
						};
					};
					Scanner.prototype.lex = function() {
						if (this.eof()) return {
							type: 2,
							value: "",
							lineNumber: this.lineNumber,
							lineStart: this.lineStart,
							start: this.index,
							end: this.index
						};
						var cp = this.source.charCodeAt(this.index);
						if (character_1.Character.isIdentifierStart(cp)) return this.scanIdentifier();
						if (cp === 40 || cp === 41 || cp === 59) return this.scanPunctuator();
						if (cp === 39 || cp === 34) return this.scanStringLiteral();
						if (cp === 46) {
							if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) return this.scanNumericLiteral();
							return this.scanPunctuator();
						}
						if (character_1.Character.isDecimalDigit(cp)) return this.scanNumericLiteral();
						if (cp === 96 || cp === 125 && this.curlyStack[this.curlyStack.length - 1] === "${") return this.scanTemplate();
						if (cp >= 55296 && cp < 57343) {
							if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) return this.scanIdentifier();
						}
						return this.scanPunctuator();
					};
					return Scanner;
				}();
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				exports$1.TokenName = {};
				exports$1.TokenName[1] = "Boolean";
				exports$1.TokenName[2] = "<end>";
				exports$1.TokenName[3] = "Identifier";
				exports$1.TokenName[4] = "Keyword";
				exports$1.TokenName[5] = "Null";
				exports$1.TokenName[6] = "Numeric";
				exports$1.TokenName[7] = "Punctuator";
				exports$1.TokenName[8] = "String";
				exports$1.TokenName[9] = "RegularExpression";
				exports$1.TokenName[10] = "Template";
			},
			function(module$1, exports$1) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				exports$1.XHTMLEntities = {
					quot: "\"",
					amp: "&",
					apos: "'",
					gt: ">",
					nbsp: "\xA0",
					iexcl: "¡",
					cent: "¢",
					pound: "£",
					curren: "¤",
					yen: "¥",
					brvbar: "¦",
					sect: "§",
					uml: "¨",
					copy: "©",
					ordf: "ª",
					laquo: "«",
					not: "¬",
					shy: "­",
					reg: "®",
					macr: "¯",
					deg: "°",
					plusmn: "±",
					sup2: "²",
					sup3: "³",
					acute: "´",
					micro: "µ",
					para: "¶",
					middot: "·",
					cedil: "¸",
					sup1: "¹",
					ordm: "º",
					raquo: "»",
					frac14: "¼",
					frac12: "½",
					frac34: "¾",
					iquest: "¿",
					Agrave: "À",
					Aacute: "Á",
					Acirc: "Â",
					Atilde: "Ã",
					Auml: "Ä",
					Aring: "Å",
					AElig: "Æ",
					Ccedil: "Ç",
					Egrave: "È",
					Eacute: "É",
					Ecirc: "Ê",
					Euml: "Ë",
					Igrave: "Ì",
					Iacute: "Í",
					Icirc: "Î",
					Iuml: "Ï",
					ETH: "Ð",
					Ntilde: "Ñ",
					Ograve: "Ò",
					Oacute: "Ó",
					Ocirc: "Ô",
					Otilde: "Õ",
					Ouml: "Ö",
					times: "×",
					Oslash: "Ø",
					Ugrave: "Ù",
					Uacute: "Ú",
					Ucirc: "Û",
					Uuml: "Ü",
					Yacute: "Ý",
					THORN: "Þ",
					szlig: "ß",
					agrave: "à",
					aacute: "á",
					acirc: "â",
					atilde: "ã",
					auml: "ä",
					aring: "å",
					aelig: "æ",
					ccedil: "ç",
					egrave: "è",
					eacute: "é",
					ecirc: "ê",
					euml: "ë",
					igrave: "ì",
					iacute: "í",
					icirc: "î",
					iuml: "ï",
					eth: "ð",
					ntilde: "ñ",
					ograve: "ò",
					oacute: "ó",
					ocirc: "ô",
					otilde: "õ",
					ouml: "ö",
					divide: "÷",
					oslash: "ø",
					ugrave: "ù",
					uacute: "ú",
					ucirc: "û",
					uuml: "ü",
					yacute: "ý",
					thorn: "þ",
					yuml: "ÿ",
					OElig: "Œ",
					oelig: "œ",
					Scaron: "Š",
					scaron: "š",
					Yuml: "Ÿ",
					fnof: "ƒ",
					circ: "ˆ",
					tilde: "˜",
					Alpha: "Α",
					Beta: "Β",
					Gamma: "Γ",
					Delta: "Δ",
					Epsilon: "Ε",
					Zeta: "Ζ",
					Eta: "Η",
					Theta: "Θ",
					Iota: "Ι",
					Kappa: "Κ",
					Lambda: "Λ",
					Mu: "Μ",
					Nu: "Ν",
					Xi: "Ξ",
					Omicron: "Ο",
					Pi: "Π",
					Rho: "Ρ",
					Sigma: "Σ",
					Tau: "Τ",
					Upsilon: "Υ",
					Phi: "Φ",
					Chi: "Χ",
					Psi: "Ψ",
					Omega: "Ω",
					alpha: "α",
					beta: "β",
					gamma: "γ",
					delta: "δ",
					epsilon: "ε",
					zeta: "ζ",
					eta: "η",
					theta: "θ",
					iota: "ι",
					kappa: "κ",
					lambda: "λ",
					mu: "μ",
					nu: "ν",
					xi: "ξ",
					omicron: "ο",
					pi: "π",
					rho: "ρ",
					sigmaf: "ς",
					sigma: "σ",
					tau: "τ",
					upsilon: "υ",
					phi: "φ",
					chi: "χ",
					psi: "ψ",
					omega: "ω",
					thetasym: "ϑ",
					upsih: "ϒ",
					piv: "ϖ",
					ensp: " ",
					emsp: " ",
					thinsp: " ",
					zwnj: "‌",
					zwj: "‍",
					lrm: "‎",
					rlm: "‏",
					ndash: "–",
					mdash: "—",
					lsquo: "‘",
					rsquo: "’",
					sbquo: "‚",
					ldquo: "“",
					rdquo: "”",
					bdquo: "„",
					dagger: "†",
					Dagger: "‡",
					bull: "•",
					hellip: "…",
					permil: "‰",
					prime: "′",
					Prime: "″",
					lsaquo: "‹",
					rsaquo: "›",
					oline: "‾",
					frasl: "⁄",
					euro: "€",
					image: "ℑ",
					weierp: "℘",
					real: "ℜ",
					trade: "™",
					alefsym: "ℵ",
					larr: "←",
					uarr: "↑",
					rarr: "→",
					darr: "↓",
					harr: "↔",
					crarr: "↵",
					lArr: "⇐",
					uArr: "⇑",
					rArr: "⇒",
					dArr: "⇓",
					hArr: "⇔",
					forall: "∀",
					part: "∂",
					exist: "∃",
					empty: "∅",
					nabla: "∇",
					isin: "∈",
					notin: "∉",
					ni: "∋",
					prod: "∏",
					sum: "∑",
					minus: "−",
					lowast: "∗",
					radic: "√",
					prop: "∝",
					infin: "∞",
					ang: "∠",
					and: "∧",
					or: "∨",
					cap: "∩",
					cup: "∪",
					int: "∫",
					there4: "∴",
					sim: "∼",
					cong: "≅",
					asymp: "≈",
					ne: "≠",
					equiv: "≡",
					le: "≤",
					ge: "≥",
					sub: "⊂",
					sup: "⊃",
					nsub: "⊄",
					sube: "⊆",
					supe: "⊇",
					oplus: "⊕",
					otimes: "⊗",
					perp: "⊥",
					sdot: "⋅",
					lceil: "⌈",
					rceil: "⌉",
					lfloor: "⌊",
					rfloor: "⌋",
					loz: "◊",
					spades: "♠",
					clubs: "♣",
					hearts: "♥",
					diams: "♦",
					lang: "⟨",
					rang: "⟩"
				};
			},
			function(module$1, exports$1, __webpack_require__) {
				"use strict";
				Object.defineProperty(exports$1, "__esModule", { value: true });
				var error_handler_1 = __webpack_require__(10);
				var scanner_1 = __webpack_require__(12);
				var token_1 = __webpack_require__(13);
				var Reader = function() {
					function Reader$1() {
						this.values = [];
						this.curly = this.paren = -1;
					}
					Reader$1.prototype.beforeFunctionExpression = function(t) {
						return [
							"(",
							"{",
							"[",
							"in",
							"typeof",
							"instanceof",
							"new",
							"return",
							"case",
							"delete",
							"throw",
							"void",
							"=",
							"+=",
							"-=",
							"*=",
							"**=",
							"/=",
							"%=",
							"<<=",
							">>=",
							">>>=",
							"&=",
							"|=",
							"^=",
							",",
							"+",
							"-",
							"*",
							"**",
							"/",
							"%",
							"++",
							"--",
							"<<",
							">>",
							">>>",
							"&",
							"|",
							"^",
							"!",
							"~",
							"&&",
							"||",
							"?",
							":",
							"===",
							"==",
							">=",
							"<=",
							"<",
							">",
							"!=",
							"!=="
						].indexOf(t) >= 0;
					};
					Reader$1.prototype.isRegexStart = function() {
						var previous = this.values[this.values.length - 1];
						var regex = previous !== null;
						switch (previous) {
							case "this":
							case "]":
								regex = false;
								break;
							case ")":
								var keyword = this.values[this.paren - 1];
								regex = keyword === "if" || keyword === "while" || keyword === "for" || keyword === "with";
								break;
							case "}":
								regex = false;
								if (this.values[this.curly - 3] === "function") {
									var check = this.values[this.curly - 4];
									regex = check ? !this.beforeFunctionExpression(check) : false;
								} else if (this.values[this.curly - 4] === "function") {
									var check = this.values[this.curly - 5];
									regex = check ? !this.beforeFunctionExpression(check) : true;
								}
								break;
							default: break;
						}
						return regex;
					};
					Reader$1.prototype.push = function(token) {
						if (token.type === 7 || token.type === 4) {
							if (token.value === "{") this.curly = this.values.length;
							else if (token.value === "(") this.paren = this.values.length;
							this.values.push(token.value);
						} else this.values.push(null);
					};
					return Reader$1;
				}();
				exports$1.Tokenizer = function() {
					function Tokenizer(code, config) {
						this.errorHandler = new error_handler_1.ErrorHandler();
						this.errorHandler.tolerant = config ? typeof config.tolerant === "boolean" && config.tolerant : false;
						this.scanner = new scanner_1.Scanner(code, this.errorHandler);
						this.scanner.trackComment = config ? typeof config.comment === "boolean" && config.comment : false;
						this.trackRange = config ? typeof config.range === "boolean" && config.range : false;
						this.trackLoc = config ? typeof config.loc === "boolean" && config.loc : false;
						this.buffer = [];
						this.reader = new Reader();
					}
					Tokenizer.prototype.errors = function() {
						return this.errorHandler.errors;
					};
					Tokenizer.prototype.getNextToken = function() {
						if (this.buffer.length === 0) {
							var comments = this.scanner.scanComments();
							if (this.scanner.trackComment) for (var i = 0; i < comments.length; ++i) {
								var e = comments[i];
								var value = this.scanner.source.slice(e.slice[0], e.slice[1]);
								var comment = {
									type: e.multiLine ? "BlockComment" : "LineComment",
									value
								};
								if (this.trackRange) comment.range = e.range;
								if (this.trackLoc) comment.loc = e.loc;
								this.buffer.push(comment);
							}
							if (!this.scanner.eof()) {
								var loc = void 0;
								if (this.trackLoc) loc = {
									start: {
										line: this.scanner.lineNumber,
										column: this.scanner.index - this.scanner.lineStart
									},
									end: {}
								};
								var token = this.scanner.source[this.scanner.index] === "/" && this.reader.isRegexStart() ? this.scanner.scanRegExp() : this.scanner.lex();
								this.reader.push(token);
								var entry = {
									type: token_1.TokenName[token.type],
									value: this.scanner.source.slice(token.start, token.end)
								};
								if (this.trackRange) entry.range = [token.start, token.end];
								if (this.trackLoc) {
									loc.end = {
										line: this.scanner.lineNumber,
										column: this.scanner.index - this.scanner.lineStart
									};
									entry.loc = loc;
								}
								if (token.type === 9) entry.regex = {
									pattern: token.pattern,
									flags: token.flags
								};
								this.buffer.push(entry);
							}
						}
						return this.buffer.shift();
					};
					return Tokenizer;
				}();
			}
		]);
	});
}));
var require_tslib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var __extends;
	var __assign;
	var __rest;
	var __decorate;
	var __param;
	var __esDecorate;
	var __runInitializers;
	var __propKey;
	var __setFunctionName;
	var __metadata;
	var __awaiter;
	var __generator;
	var __exportStar$2;
	var __values;
	var __read;
	var __spread;
	var __spreadArrays;
	var __spreadArray;
	var __await;
	var __asyncGenerator;
	var __asyncDelegator;
	var __asyncValues;
	var __makeTemplateObject;
	var __importStar$4;
	var __importDefault$5;
	var __classPrivateFieldGet;
	var __classPrivateFieldSet;
	var __classPrivateFieldIn;
	var __createBinding$5;
	var __addDisposableResource;
	var __disposeResources;
	var __rewriteRelativeImportExtension;
	(function(factory$1) {
		var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
		if (typeof define === "function" && define.amd) define("tslib", ["exports"], function(exports$1) {
			factory$1(createExporter(root, createExporter(exports$1)));
		});
		else if (typeof module === "object" && typeof module.exports === "object") factory$1(createExporter(root, createExporter(module.exports)));
		else factory$1(createExporter(root));
		function createExporter(exports$1, previous) {
			if (exports$1 !== root) if (typeof Object.create === "function") Object.defineProperty(exports$1, "__esModule", { value: true });
			else exports$1.__esModule = true;
			return function(id, v) {
				return exports$1[id] = previous ? previous(id, v) : v;
			};
		}
	})(function(exporter) {
		var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d$1, b) {
			d$1.__proto__ = b;
		} || function(d$1, b) {
			for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d$1[p] = b[p];
		};
		__extends = function(d$1, b) {
			if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
			extendStatics(d$1, b);
			function __() {
				this.constructor = d$1;
			}
			d$1.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
		};
		__assign = Object.assign || function(t) {
			for (var s$1, i = 1, n$1 = arguments.length; i < n$1; i++) {
				s$1 = arguments[i];
				for (var p in s$1) if (Object.prototype.hasOwnProperty.call(s$1, p)) t[p] = s$1[p];
			}
			return t;
		};
		__rest = function(s$1, e) {
			var t = {};
			for (var p in s$1) if (Object.prototype.hasOwnProperty.call(s$1, p) && e.indexOf(p) < 0) t[p] = s$1[p];
			if (s$1 != null && typeof Object.getOwnPropertySymbols === "function") {
				for (var i = 0, p = Object.getOwnPropertySymbols(s$1); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s$1, p[i])) t[p[i]] = s$1[p[i]];
			}
			return t;
		};
		__decorate = function(decorators, target, key, desc$1) {
			var c = arguments.length, r = c < 3 ? target : desc$1 === null ? desc$1 = Object.getOwnPropertyDescriptor(target, key) : desc$1, d$1;
			if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc$1);
			else for (var i = decorators.length - 1; i >= 0; i--) if (d$1 = decorators[i]) r = (c < 3 ? d$1(r) : c > 3 ? d$1(target, key, r) : d$1(target, key)) || r;
			return c > 3 && r && Object.defineProperty(target, key, r), r;
		};
		__param = function(paramIndex, decorator) {
			return function(target, key) {
				decorator(target, key, paramIndex);
			};
		};
		__esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
			function accept(f) {
				if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
				return f;
			}
			var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
			var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
			var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
			var _, done = false;
			for (var i = decorators.length - 1; i >= 0; i--) {
				var context = {};
				for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
				for (var p in contextIn.access) context.access[p] = contextIn.access[p];
				context.addInitializer = function(f) {
					if (done) throw new TypeError("Cannot add initializers after decoration has completed");
					extraInitializers.push(accept(f || null));
				};
				var result = (0, decorators[i])(kind === "accessor" ? {
					get: descriptor.get,
					set: descriptor.set
				} : descriptor[key], context);
				if (kind === "accessor") {
					if (result === void 0) continue;
					if (result === null || typeof result !== "object") throw new TypeError("Object expected");
					if (_ = accept(result.get)) descriptor.get = _;
					if (_ = accept(result.set)) descriptor.set = _;
					if (_ = accept(result.init)) initializers.unshift(_);
				} else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
				else descriptor[key] = _;
			}
			if (target) Object.defineProperty(target, contextIn.name, descriptor);
			done = true;
		};
		__runInitializers = function(thisArg, initializers, value) {
			var useValue = arguments.length > 2;
			for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
			return useValue ? value : void 0;
		};
		__propKey = function(x) {
			return typeof x === "symbol" ? x : "".concat(x);
		};
		__setFunctionName = function(f, name$1, prefix) {
			if (typeof name$1 === "symbol") name$1 = name$1.description ? "[".concat(name$1.description, "]") : "";
			return Object.defineProperty(f, "name", {
				configurable: true,
				value: prefix ? "".concat(prefix, " ", name$1) : name$1
			});
		};
		__metadata = function(metadataKey, metadataValue) {
			if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
		};
		__awaiter = function(thisArg, _arguments, P, generator) {
			function adopt(value) {
				return value instanceof P ? value : new P(function(resolve) {
					resolve(value);
				});
			}
			return new (P || (P = Promise))(function(resolve, reject) {
				function fulfilled(value) {
					try {
						step(generator.next(value));
					} catch (e) {
						reject(e);
					}
				}
				function rejected(value) {
					try {
						step(generator["throw"](value));
					} catch (e) {
						reject(e);
					}
				}
				function step(result) {
					result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
				}
				step((generator = generator.apply(thisArg, _arguments || [])).next());
			});
		};
		__generator = function(thisArg, body) {
			var _ = {
				label: 0,
				sent: function() {
					if (t[0] & 1) throw t[1];
					return t[1];
				},
				trys: [],
				ops: []
			}, f, y$1, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
			return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
				return this;
			}), g;
			function verb(n$1) {
				return function(v) {
					return step([n$1, v]);
				};
			}
			function step(op) {
				if (f) throw new TypeError("Generator is already executing.");
				while (g && (g = 0, op[0] && (_ = 0)), _) try {
					if (f = 1, y$1 && (t = op[0] & 2 ? y$1["return"] : op[0] ? y$1["throw"] || ((t = y$1["return"]) && t.call(y$1), 0) : y$1.next) && !(t = t.call(y$1, op[1])).done) return t;
					if (y$1 = 0, t) op = [op[0] & 2, t.value];
					switch (op[0]) {
						case 0:
						case 1:
							t = op;
							break;
						case 4:
							_.label++;
							return {
								value: op[1],
								done: false
							};
						case 5:
							_.label++;
							y$1 = op[1];
							op = [0];
							continue;
						case 7:
							op = _.ops.pop();
							_.trys.pop();
							continue;
						default:
							if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
								_ = 0;
								continue;
							}
							if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
								_.label = op[1];
								break;
							}
							if (op[0] === 6 && _.label < t[1]) {
								_.label = t[1];
								t = op;
								break;
							}
							if (t && _.label < t[2]) {
								_.label = t[2];
								_.ops.push(op);
								break;
							}
							if (t[2]) _.ops.pop();
							_.trys.pop();
							continue;
					}
					op = body.call(thisArg, _);
				} catch (e) {
					op = [6, e];
					y$1 = 0;
				} finally {
					f = t = 0;
				}
				if (op[0] & 5) throw op[1];
				return {
					value: op[0] ? op[1] : void 0,
					done: true
				};
			}
		};
		__exportStar$2 = function(m$1, o) {
			for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding$5(o, m$1, p);
		};
		__createBinding$5 = Object.create ? (function(o, m$1, k, k2) {
			if (k2 === void 0) k2 = k;
			var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
			if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
				enumerable: true,
				get: function() {
					return m$1[k];
				}
			};
			Object.defineProperty(o, k2, desc$1);
		}) : (function(o, m$1, k, k2) {
			if (k2 === void 0) k2 = k;
			o[k2] = m$1[k];
		});
		__values = function(o) {
			var s$1 = typeof Symbol === "function" && Symbol.iterator, m$1 = s$1 && o[s$1], i = 0;
			if (m$1) return m$1.call(o);
			if (o && typeof o.length === "number") return { next: function() {
				if (o && i >= o.length) o = void 0;
				return {
					value: o && o[i++],
					done: !o
				};
			} };
			throw new TypeError(s$1 ? "Object is not iterable." : "Symbol.iterator is not defined.");
		};
		__read = function(o, n$1) {
			var m$1 = typeof Symbol === "function" && o[Symbol.iterator];
			if (!m$1) return o;
			var i = m$1.call(o), r, ar = [], e;
			try {
				while ((n$1 === void 0 || n$1-- > 0) && !(r = i.next()).done) ar.push(r.value);
			} catch (error) {
				e = { error };
			} finally {
				try {
					if (r && !r.done && (m$1 = i["return"])) m$1.call(i);
				} finally {
					if (e) throw e.error;
				}
			}
			return ar;
		};
		__spread = function() {
			for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
			return ar;
		};
		__spreadArrays = function() {
			for (var s$1 = 0, i = 0, il = arguments.length; i < il; i++) s$1 += arguments[i].length;
			for (var r = Array(s$1), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
			return r;
		};
		__spreadArray = function(to, from, pack) {
			if (pack || arguments.length === 2) {
				for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
					if (!ar) ar = Array.prototype.slice.call(from, 0, i);
					ar[i] = from[i];
				}
			}
			return to.concat(ar || Array.prototype.slice.call(from));
		};
		__await = function(v) {
			return this instanceof __await ? (this.v = v, this) : new __await(v);
		};
		__asyncGenerator = function(thisArg, _arguments, generator) {
			if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
			var g = generator.apply(thisArg, _arguments || []), i, q = [];
			return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
				return this;
			}, i;
			function awaitReturn(f) {
				return function(v) {
					return Promise.resolve(v).then(f, reject);
				};
			}
			function verb(n$1, f) {
				if (g[n$1]) {
					i[n$1] = function(v) {
						return new Promise(function(a, b) {
							q.push([
								n$1,
								v,
								a,
								b
							]) > 1 || resume$2(n$1, v);
						});
					};
					if (f) i[n$1] = f(i[n$1]);
				}
			}
			function resume$2(n$1, v) {
				try {
					step(g[n$1](v));
				} catch (e) {
					settle$1(q[0][3], e);
				}
			}
			function step(r) {
				r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle$1(q[0][2], r);
			}
			function fulfill(value) {
				resume$2("next", value);
			}
			function reject(value) {
				resume$2("throw", value);
			}
			function settle$1(f, v) {
				if (f(v), q.shift(), q.length) resume$2(q[0][0], q[0][1]);
			}
		};
		__asyncDelegator = function(o) {
			var i, p;
			return i = {}, verb("next"), verb("throw", function(e) {
				throw e;
			}), verb("return"), i[Symbol.iterator] = function() {
				return this;
			}, i;
			function verb(n$1, f) {
				i[n$1] = o[n$1] ? function(v) {
					return (p = !p) ? {
						value: __await(o[n$1](v)),
						done: false
					} : f ? f(v) : v;
				} : f;
			}
		};
		__asyncValues = function(o) {
			if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
			var m$1 = o[Symbol.asyncIterator], i;
			return m$1 ? m$1.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
				return this;
			}, i);
			function verb(n$1) {
				i[n$1] = o[n$1] && function(v) {
					return new Promise(function(resolve, reject) {
						v = o[n$1](v), settle$1(resolve, reject, v.done, v.value);
					});
				};
			}
			function settle$1(resolve, reject, d$1, v) {
				Promise.resolve(v).then(function(v$1) {
					resolve({
						value: v$1,
						done: d$1
					});
				}, reject);
			}
		};
		__makeTemplateObject = function(cooked, raw) {
			if (Object.defineProperty) Object.defineProperty(cooked, "raw", { value: raw });
			else cooked.raw = raw;
			return cooked;
		};
		var __setModuleDefault$14 = Object.create ? (function(o, v) {
			Object.defineProperty(o, "default", {
				enumerable: true,
				value: v
			});
		}) : function(o, v) {
			o["default"] = v;
		};
		var ownKeys = function(o) {
			ownKeys = Object.getOwnPropertyNames || function(o$1) {
				var ar = [];
				for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
				return ar;
			};
			return ownKeys(o);
		};
		__importStar$4 = function(mod) {
			if (mod && mod.__esModule) return mod;
			var result = {};
			if (mod != null) {
				for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$5(result, mod, k[i]);
			}
			__setModuleDefault$14(result, mod);
			return result;
		};
		__importDefault$5 = function(mod) {
			return mod && mod.__esModule ? mod : { "default": mod };
		};
		__classPrivateFieldGet = function(receiver, state$1, kind, f) {
			if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
			if (typeof state$1 === "function" ? receiver !== state$1 || !f : !state$1.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$1.get(receiver);
		};
		__classPrivateFieldSet = function(receiver, state$1, value, kind, f) {
			if (kind === "m") throw new TypeError("Private method is not writable");
			if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
			if (typeof state$1 === "function" ? receiver !== state$1 || !f : !state$1.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
			return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state$1.set(receiver, value), value;
		};
		__classPrivateFieldIn = function(state$1, receiver) {
			if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
			return typeof state$1 === "function" ? receiver === state$1 : state$1.has(receiver);
		};
		__addDisposableResource = function(env$1, value, async$3) {
			if (value !== null && value !== void 0) {
				if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
				var dispose, inner;
				if (async$3) {
					if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
					dispose = value[Symbol.asyncDispose];
				}
				if (dispose === void 0) {
					if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
					dispose = value[Symbol.dispose];
					if (async$3) inner = dispose;
				}
				if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
				if (inner) dispose = function() {
					try {
						inner.call(this);
					} catch (e) {
						return Promise.reject(e);
					}
				};
				env$1.stack.push({
					value,
					dispose,
					async: async$3
				});
			} else if (async$3) env$1.stack.push({ async: true });
			return value;
		};
		var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
			var e = new Error(message);
			return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
		};
		__disposeResources = function(env$1) {
			function fail(e) {
				env$1.error = env$1.hasError ? new _SuppressedError(e, env$1.error, "An error was suppressed during disposal.") : e;
				env$1.hasError = true;
			}
			var r, s$1 = 0;
			function next() {
				while (r = env$1.stack.pop()) try {
					if (!r.async && s$1 === 1) return s$1 = 0, env$1.stack.push(r), Promise.resolve().then(next);
					if (r.dispose) {
						var result = r.dispose.call(r.value);
						if (r.async) return s$1 |= 2, Promise.resolve(result).then(next, function(e) {
							fail(e);
							return next();
						});
					} else s$1 |= 1;
				} catch (e) {
					fail(e);
				}
				if (s$1 === 1) return env$1.hasError ? Promise.reject(env$1.error) : Promise.resolve();
				if (env$1.hasError) throw env$1.error;
			}
			return next();
		};
		__rewriteRelativeImportExtension = function(path$1, preserveJsx) {
			if (typeof path$1 === "string" && /^\.\.?\//.test(path$1)) return path$1.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m$1, tsx, d$1, ext, cm) {
				return tsx ? preserveJsx ? ".jsx" : ".js" : d$1 && (!ext || !cm) ? m$1 : d$1 + ext + "." + cm.toLowerCase() + "js";
			});
			return path$1;
		};
		exporter("__extends", __extends);
		exporter("__assign", __assign);
		exporter("__rest", __rest);
		exporter("__decorate", __decorate);
		exporter("__param", __param);
		exporter("__esDecorate", __esDecorate);
		exporter("__runInitializers", __runInitializers);
		exporter("__propKey", __propKey);
		exporter("__setFunctionName", __setFunctionName);
		exporter("__metadata", __metadata);
		exporter("__awaiter", __awaiter);
		exporter("__generator", __generator);
		exporter("__exportStar", __exportStar$2);
		exporter("__createBinding", __createBinding$5);
		exporter("__values", __values);
		exporter("__read", __read);
		exporter("__spread", __spread);
		exporter("__spreadArrays", __spreadArrays);
		exporter("__spreadArray", __spreadArray);
		exporter("__await", __await);
		exporter("__asyncGenerator", __asyncGenerator);
		exporter("__asyncDelegator", __asyncDelegator);
		exporter("__asyncValues", __asyncValues);
		exporter("__makeTemplateObject", __makeTemplateObject);
		exporter("__importStar", __importStar$4);
		exporter("__importDefault", __importDefault$5);
		exporter("__classPrivateFieldGet", __classPrivateFieldGet);
		exporter("__classPrivateFieldSet", __classPrivateFieldSet);
		exporter("__classPrivateFieldIn", __classPrivateFieldIn);
		exporter("__addDisposableResource", __addDisposableResource);
		exporter("__disposeResources", __disposeResources);
		exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension);
	});
}));
var require_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Def = void 0;
	var tslib_1$16 = require_tslib();
	var Op = Object.prototype;
	var objToStr = Op.toString;
	var hasOwn$3 = Op.hasOwnProperty;
	var BaseType = function() {
		function BaseType$1() {}
		BaseType$1.prototype.assert = function(value, deep) {
			if (!this.check(value, deep)) {
				var str = shallowStringify(value);
				throw new Error(str + " does not match type " + this);
			}
			return true;
		};
		BaseType$1.prototype.arrayOf = function() {
			return new ArrayType(this);
		};
		return BaseType$1;
	}();
	var ArrayType = function(_super) {
		tslib_1$16.__extends(ArrayType$1, _super);
		function ArrayType$1(elemType) {
			var _this = _super.call(this) || this;
			_this.elemType = elemType;
			_this.kind = "ArrayType";
			return _this;
		}
		ArrayType$1.prototype.toString = function() {
			return "[" + this.elemType + "]";
		};
		ArrayType$1.prototype.check = function(value, deep) {
			var _this = this;
			return Array.isArray(value) && value.every(function(elem) {
				return _this.elemType.check(elem, deep);
			});
		};
		return ArrayType$1;
	}(BaseType);
	var IdentityType = function(_super) {
		tslib_1$16.__extends(IdentityType$1, _super);
		function IdentityType$1(value) {
			var _this = _super.call(this) || this;
			_this.value = value;
			_this.kind = "IdentityType";
			return _this;
		}
		IdentityType$1.prototype.toString = function() {
			return String(this.value);
		};
		IdentityType$1.prototype.check = function(value, deep) {
			var result = value === this.value;
			if (!result && typeof deep === "function") deep(this, value);
			return result;
		};
		return IdentityType$1;
	}(BaseType);
	var ObjectType = function(_super) {
		tslib_1$16.__extends(ObjectType$1, _super);
		function ObjectType$1(fields) {
			var _this = _super.call(this) || this;
			_this.fields = fields;
			_this.kind = "ObjectType";
			return _this;
		}
		ObjectType$1.prototype.toString = function() {
			return "{ " + this.fields.join(", ") + " }";
		};
		ObjectType$1.prototype.check = function(value, deep) {
			return objToStr.call(value) === objToStr.call({}) && this.fields.every(function(field) {
				return field.type.check(value[field.name], deep);
			});
		};
		return ObjectType$1;
	}(BaseType);
	var OrType = function(_super) {
		tslib_1$16.__extends(OrType$1, _super);
		function OrType$1(types$4) {
			var _this = _super.call(this) || this;
			_this.types = types$4;
			_this.kind = "OrType";
			return _this;
		}
		OrType$1.prototype.toString = function() {
			return this.types.join(" | ");
		};
		OrType$1.prototype.check = function(value, deep) {
			return this.types.some(function(type) {
				return type.check(value, deep);
			});
		};
		return OrType$1;
	}(BaseType);
	var PredicateType = function(_super) {
		tslib_1$16.__extends(PredicateType$1, _super);
		function PredicateType$1(name$1, predicate) {
			var _this = _super.call(this) || this;
			_this.name = name$1;
			_this.predicate = predicate;
			_this.kind = "PredicateType";
			return _this;
		}
		PredicateType$1.prototype.toString = function() {
			return this.name;
		};
		PredicateType$1.prototype.check = function(value, deep) {
			var result = this.predicate(value, deep);
			if (!result && typeof deep === "function") deep(this, value);
			return result;
		};
		return PredicateType$1;
	}(BaseType);
	var Def = function() {
		function Def$1(type, typeName) {
			this.type = type;
			this.typeName = typeName;
			this.baseNames = [];
			this.ownFields = Object.create(null);
			this.allSupertypes = Object.create(null);
			this.supertypeList = [];
			this.allFields = Object.create(null);
			this.fieldNames = [];
			this.finalized = false;
			this.buildable = false;
			this.buildParams = [];
		}
		Def$1.prototype.isSupertypeOf = function(that) {
			if (that instanceof Def$1) {
				if (this.finalized !== true || that.finalized !== true) throw new Error("");
				return hasOwn$3.call(that.allSupertypes, this.typeName);
			} else throw new Error(that + " is not a Def");
		};
		Def$1.prototype.checkAllFields = function(value, deep) {
			var allFields = this.allFields;
			if (this.finalized !== true) throw new Error("" + this.typeName);
			function checkFieldByName(name$1) {
				var field = allFields[name$1];
				var type = field.type;
				var child = field.getValue(value);
				return type.check(child, deep);
			}
			return value !== null && typeof value === "object" && Object.keys(allFields).every(checkFieldByName);
		};
		Def$1.prototype.bases = function() {
			var supertypeNames = [];
			for (var _i = 0; _i < arguments.length; _i++) supertypeNames[_i] = arguments[_i];
			var bases = this.baseNames;
			if (this.finalized) {
				if (supertypeNames.length !== bases.length) throw new Error("");
				for (var i = 0; i < supertypeNames.length; i++) if (supertypeNames[i] !== bases[i]) throw new Error("");
				return this;
			}
			supertypeNames.forEach(function(baseName) {
				if (bases.indexOf(baseName) < 0) bases.push(baseName);
			});
			return this;
		};
		return Def$1;
	}();
	exports.Def = Def;
	var Field = function() {
		function Field$1(name$1, type, defaultFn, hidden) {
			this.name = name$1;
			this.type = type;
			this.defaultFn = defaultFn;
			this.hidden = !!hidden;
		}
		Field$1.prototype.toString = function() {
			return JSON.stringify(this.name) + ": " + this.type;
		};
		Field$1.prototype.getValue = function(obj) {
			var value = obj[this.name];
			if (typeof value !== "undefined") return value;
			if (typeof this.defaultFn === "function") value = this.defaultFn.call(obj);
			return value;
		};
		return Field$1;
	}();
	function shallowStringify(value) {
		if (Array.isArray(value)) return "[" + value.map(shallowStringify).join(", ") + "]";
		if (value && typeof value === "object") return "{ " + Object.keys(value).map(function(key) {
			return key + ": " + value[key];
		}).join(", ") + " }";
		return JSON.stringify(value);
	}
	function typesPlugin(_fork) {
		var Type$1 = {
			or: function() {
				var types$4 = [];
				for (var _i = 0; _i < arguments.length; _i++) types$4[_i] = arguments[_i];
				return new OrType(types$4.map(function(type) {
					return Type$1.from(type);
				}));
			},
			from: function(value, name$1) {
				if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) return value;
				if (value instanceof Def) return value.type;
				if (isArray$2.check(value)) {
					if (value.length !== 1) throw new Error("only one element type is permitted for typed arrays");
					return new ArrayType(Type$1.from(value[0]));
				}
				if (isObject$1.check(value)) return new ObjectType(Object.keys(value).map(function(name$2) {
					return new Field(name$2, Type$1.from(value[name$2], name$2));
				}));
				if (typeof value === "function") {
					var bicfIndex = builtInCtorFns.indexOf(value);
					if (bicfIndex >= 0) return builtInCtorTypes[bicfIndex];
					if (typeof name$1 !== "string") throw new Error("missing name");
					return new PredicateType(name$1, value);
				}
				return new IdentityType(value);
			},
			def: function(typeName) {
				return hasOwn$3.call(defCache, typeName) ? defCache[typeName] : defCache[typeName] = new DefImpl(typeName);
			},
			hasDef: function(typeName) {
				return hasOwn$3.call(defCache, typeName);
			}
		};
		var builtInCtorFns = [];
		var builtInCtorTypes = [];
		function defBuiltInType(name$1, example) {
			var objStr = objToStr.call(example);
			var type = new PredicateType(name$1, function(value) {
				return objToStr.call(value) === objStr;
			});
			if (example && typeof example.constructor === "function") {
				builtInCtorFns.push(example.constructor);
				builtInCtorTypes.push(type);
			}
			return type;
		}
		var isString$2 = defBuiltInType("string", "truthy");
		var isFunction$3 = defBuiltInType("function", function() {});
		var isArray$2 = defBuiltInType("array", []);
		var isObject$1 = defBuiltInType("object", {});
		var isRegExp$1 = defBuiltInType("RegExp", /./);
		var isDate$1 = defBuiltInType("Date", /* @__PURE__ */ new Date());
		var isNumber$1 = defBuiltInType("number", 3);
		var isBoolean$1 = defBuiltInType("boolean", true);
		var isNull = defBuiltInType("null", null);
		var isUndefined$1 = defBuiltInType("undefined", void 0);
		var builtInTypes$1 = {
			string: isString$2,
			function: isFunction$3,
			array: isArray$2,
			object: isObject$1,
			RegExp: isRegExp$1,
			Date: isDate$1,
			number: isNumber$1,
			boolean: isBoolean$1,
			null: isNull,
			undefined: isUndefined$1
		};
		var defCache = Object.create(null);
		function defFromValue(value) {
			if (value && typeof value === "object") {
				var type = value.type;
				if (typeof type === "string" && hasOwn$3.call(defCache, type)) {
					var d$1 = defCache[type];
					if (d$1.finalized) return d$1;
				}
			}
			return null;
		}
		var DefImpl = function(_super) {
			tslib_1$16.__extends(DefImpl$1, _super);
			function DefImpl$1(typeName) {
				var _this = _super.call(this, new PredicateType(typeName, function(value, deep) {
					return _this.check(value, deep);
				}), typeName) || this;
				return _this;
			}
			DefImpl$1.prototype.check = function(value, deep) {
				if (this.finalized !== true) throw new Error("prematurely checking unfinalized type " + this.typeName);
				if (value === null || typeof value !== "object") return false;
				var vDef = defFromValue(value);
				if (!vDef) {
					if (this.typeName === "SourceLocation" || this.typeName === "Position") return this.checkAllFields(value, deep);
					return false;
				}
				if (deep && vDef === this) return this.checkAllFields(value, deep);
				if (!this.isSupertypeOf(vDef)) return false;
				if (!deep) return true;
				return vDef.checkAllFields(value, deep) && this.checkAllFields(value, false);
			};
			DefImpl$1.prototype.build = function() {
				var _this = this;
				var buildParams = [];
				for (var _i = 0; _i < arguments.length; _i++) buildParams[_i] = arguments[_i];
				this.buildParams = buildParams;
				if (this.buildable) return this;
				this.field("type", String, function() {
					return _this.typeName;
				});
				this.buildable = true;
				var addParam = function(built, param, arg, isArgAvailable) {
					if (hasOwn$3.call(built, param)) return;
					var all = _this.allFields;
					if (!hasOwn$3.call(all, param)) throw new Error("" + param);
					var field = all[param];
					var type = field.type;
					var value;
					if (isArgAvailable) value = arg;
					else if (field.defaultFn) value = field.defaultFn.call(built);
					else {
						var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name$1) {
							return all[name$1];
						}).join(", ") + ")";
						throw new Error(message);
					}
					if (!type.check(value)) throw new Error(shallowStringify(value) + " does not match field " + field + " of type " + _this.typeName);
					built[param] = value;
				};
				var builder = function() {
					var args = [];
					for (var _i$1 = 0; _i$1 < arguments.length; _i$1++) args[_i$1] = arguments[_i$1];
					var argc = args.length;
					if (!_this.finalized) throw new Error("attempting to instantiate unfinalized type " + _this.typeName);
					var built = Object.create(nodePrototype);
					_this.buildParams.forEach(function(param, i) {
						if (i < argc) addParam(built, param, args[i], true);
						else addParam(built, param, null, false);
					});
					Object.keys(_this.allFields).forEach(function(param) {
						addParam(built, param, null, false);
					});
					if (built.type !== _this.typeName) throw new Error("");
					return built;
				};
				builder.from = function(obj) {
					if (!_this.finalized) throw new Error("attempting to instantiate unfinalized type " + _this.typeName);
					var built = Object.create(nodePrototype);
					Object.keys(_this.allFields).forEach(function(param) {
						if (hasOwn$3.call(obj, param)) addParam(built, param, obj[param], true);
						else addParam(built, param, null, false);
					});
					if (built.type !== _this.typeName) throw new Error("");
					return built;
				};
				Object.defineProperty(builders$1, getBuilderName$1(this.typeName), {
					enumerable: true,
					value: builder
				});
				return this;
			};
			DefImpl$1.prototype.field = function(name$1, type, defaultFn, hidden) {
				if (this.finalized) {
					console.error("Ignoring attempt to redefine field " + JSON.stringify(name$1) + " of finalized type " + JSON.stringify(this.typeName));
					return this;
				}
				this.ownFields[name$1] = new Field(name$1, Type$1.from(type), defaultFn, hidden);
				return this;
			};
			DefImpl$1.prototype.finalize = function() {
				var _this = this;
				if (!this.finalized) {
					var allFields = this.allFields;
					var allSupertypes = this.allSupertypes;
					this.baseNames.forEach(function(name$1) {
						var def = defCache[name$1];
						if (def instanceof Def) {
							def.finalize();
							extend$1(allFields, def.allFields);
							extend$1(allSupertypes, def.allSupertypes);
						} else {
							var message = "unknown supertype name " + JSON.stringify(name$1) + " for subtype " + JSON.stringify(_this.typeName);
							throw new Error(message);
						}
					});
					extend$1(allFields, this.ownFields);
					allSupertypes[this.typeName] = this;
					this.fieldNames.length = 0;
					for (var fieldName in allFields) if (hasOwn$3.call(allFields, fieldName) && !allFields[fieldName].hidden) this.fieldNames.push(fieldName);
					Object.defineProperty(namedTypes, this.typeName, {
						enumerable: true,
						value: this.type
					});
					this.finalized = true;
					populateSupertypeList(this.typeName, this.supertypeList);
					if (this.buildable && this.supertypeList.lastIndexOf("Expression") >= 0) wrapExpressionBuilderWithStatement(this.typeName);
				}
			};
			return DefImpl$1;
		}(Def);
		function getSupertypeNames$1(typeName) {
			if (!hasOwn$3.call(defCache, typeName)) throw new Error("");
			var d$1 = defCache[typeName];
			if (d$1.finalized !== true) throw new Error("");
			return d$1.supertypeList.slice(1);
		}
		function computeSupertypeLookupTable(candidates) {
			var table = {};
			var typeNames = Object.keys(defCache);
			var typeNameCount = typeNames.length;
			for (var i = 0; i < typeNameCount; ++i) {
				var typeName = typeNames[i];
				var d$1 = defCache[typeName];
				if (d$1.finalized !== true) throw new Error("" + typeName);
				for (var j = 0; j < d$1.supertypeList.length; ++j) {
					var superTypeName = d$1.supertypeList[j];
					if (hasOwn$3.call(candidates, superTypeName)) {
						table[typeName] = superTypeName;
						break;
					}
				}
			}
			return table;
		}
		var builders$1 = Object.create(null);
		var nodePrototype = {};
		function defineMethod$1(name$1, func) {
			var old = nodePrototype[name$1];
			if (isUndefined$1.check(func)) delete nodePrototype[name$1];
			else {
				isFunction$3.assert(func);
				Object.defineProperty(nodePrototype, name$1, {
					enumerable: true,
					configurable: true,
					value: func
				});
			}
			return old;
		}
		function getBuilderName$1(typeName) {
			return typeName.replace(/^[A-Z]+/, function(upperCasePrefix) {
				var len = upperCasePrefix.length;
				switch (len) {
					case 0: return "";
					case 1: return upperCasePrefix.toLowerCase();
					default: return upperCasePrefix.slice(0, len - 1).toLowerCase() + upperCasePrefix.charAt(len - 1);
				}
			});
		}
		function getStatementBuilderName(typeName) {
			typeName = getBuilderName$1(typeName);
			return typeName.replace(/(Expression)?$/, "Statement");
		}
		var namedTypes = {};
		function getFieldNames$1(object) {
			var d$1 = defFromValue(object);
			if (d$1) return d$1.fieldNames.slice(0);
			if ("type" in object) throw new Error("did not recognize object of type " + JSON.stringify(object.type));
			return Object.keys(object);
		}
		function getFieldValue$1(object, fieldName) {
			var d$1 = defFromValue(object);
			if (d$1) {
				var field = d$1.allFields[fieldName];
				if (field) return field.getValue(object);
			}
			return object && object[fieldName];
		}
		function eachField$1(object, callback, context) {
			getFieldNames$1(object).forEach(function(name$1) {
				callback.call(this, name$1, getFieldValue$1(object, name$1));
			}, context);
		}
		function someField$1(object, callback, context) {
			return getFieldNames$1(object).some(function(name$1) {
				return callback.call(this, name$1, getFieldValue$1(object, name$1));
			}, context);
		}
		function wrapExpressionBuilderWithStatement(typeName) {
			var wrapperName = getStatementBuilderName(typeName);
			if (builders$1[wrapperName]) return;
			var wrapped = builders$1[getBuilderName$1(typeName)];
			if (!wrapped) return;
			var builder = function() {
				var args = [];
				for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
				return builders$1.expressionStatement(wrapped.apply(builders$1, args));
			};
			builder.from = function() {
				var args = [];
				for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
				return builders$1.expressionStatement(wrapped.from.apply(builders$1, args));
			};
			builders$1[wrapperName] = builder;
		}
		function populateSupertypeList(typeName, list) {
			list.length = 0;
			list.push(typeName);
			var lastSeen = Object.create(null);
			for (var pos = 0; pos < list.length; ++pos) {
				typeName = list[pos];
				var d$1 = defCache[typeName];
				if (d$1.finalized !== true) throw new Error("");
				if (hasOwn$3.call(lastSeen, typeName)) delete list[lastSeen[typeName]];
				lastSeen[typeName] = pos;
				list.push.apply(list, d$1.baseNames);
			}
			for (var to = 0, from = to, len = list.length; from < len; ++from) if (hasOwn$3.call(list, from)) list[to++] = list[from];
			list.length = to;
		}
		function extend$1(into, from) {
			Object.keys(from).forEach(function(name$1) {
				into[name$1] = from[name$1];
			});
			return into;
		}
		function finalize$1() {
			Object.keys(defCache).forEach(function(name$1) {
				defCache[name$1].finalize();
			});
		}
		return {
			Type: Type$1,
			builtInTypes: builtInTypes$1,
			getSupertypeNames: getSupertypeNames$1,
			computeSupertypeLookupTable,
			builders: builders$1,
			defineMethod: defineMethod$1,
			getBuilderName: getBuilderName$1,
			getStatementBuilderName,
			namedTypes,
			getFieldNames: getFieldNames$1,
			getFieldValue: getFieldValue$1,
			eachField: eachField$1,
			someField: someField$1,
			finalize: finalize$1
		};
	}
	exports.default = typesPlugin;
}));
var require_path = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var types_1$22 = require_tslib().__importDefault(require_types$1());
	var hasOwn$2 = Object.prototype.hasOwnProperty;
	function pathPlugin(fork) {
		var types$4 = fork.use(types_1$22.default);
		var isArray$2 = types$4.builtInTypes.array;
		var isNumber$1 = types$4.builtInTypes.number;
		var Path$1 = function Path$2(value, parentPath, name$1) {
			if (!(this instanceof Path$2)) throw new Error("Path constructor cannot be invoked without 'new'");
			if (parentPath) {
				if (!(parentPath instanceof Path$2)) throw new Error("");
			} else {
				parentPath = null;
				name$1 = null;
			}
			this.value = value;
			this.parentPath = parentPath;
			this.name = name$1;
			this.__childCache = null;
		};
		var Pp = Path$1.prototype;
		function getChildCache(path$1) {
			return path$1.__childCache || (path$1.__childCache = Object.create(null));
		}
		function getChildPath(path$1, name$1) {
			var cache = getChildCache(path$1);
			var actualChildValue = path$1.getValueProperty(name$1);
			var childPath = cache[name$1];
			if (!hasOwn$2.call(cache, name$1) || childPath.value !== actualChildValue) childPath = cache[name$1] = new path$1.constructor(actualChildValue, path$1, name$1);
			return childPath;
		}
		Pp.getValueProperty = function getValueProperty(name$1) {
			return this.value[name$1];
		};
		Pp.get = function get() {
			var names = [];
			for (var _i = 0; _i < arguments.length; _i++) names[_i] = arguments[_i];
			var path$1 = this;
			var count = names.length;
			for (var i = 0; i < count; ++i) path$1 = getChildPath(path$1, names[i]);
			return path$1;
		};
		Pp.each = function each(callback, context) {
			var childPaths = [];
			var len = this.value.length;
			var i = 0;
			for (var i = 0; i < len; ++i) if (hasOwn$2.call(this.value, i)) childPaths[i] = this.get(i);
			context = context || this;
			for (i = 0; i < len; ++i) if (hasOwn$2.call(childPaths, i)) callback.call(context, childPaths[i]);
		};
		Pp.map = function map(callback, context) {
			var result = [];
			this.each(function(childPath) {
				result.push(callback.call(this, childPath));
			}, context);
			return result;
		};
		Pp.filter = function filter(callback, context) {
			var result = [];
			this.each(function(childPath) {
				if (callback.call(this, childPath)) result.push(childPath);
			}, context);
			return result;
		};
		function emptyMoves() {}
		function getMoves(path$1, offset, start, end) {
			isArray$2.assert(path$1.value);
			if (offset === 0) return emptyMoves;
			var length = path$1.value.length;
			if (length < 1) return emptyMoves;
			var argc = arguments.length;
			if (argc === 2) {
				start = 0;
				end = length;
			} else if (argc === 3) {
				start = Math.max(start, 0);
				end = length;
			} else {
				start = Math.max(start, 0);
				end = Math.min(end, length);
			}
			isNumber$1.assert(start);
			isNumber$1.assert(end);
			var moves = Object.create(null);
			var cache = getChildCache(path$1);
			for (var i = start; i < end; ++i) if (hasOwn$2.call(path$1.value, i)) {
				var childPath = path$1.get(i);
				if (childPath.name !== i) throw new Error("");
				var newIndex = i + offset;
				childPath.name = newIndex;
				moves[newIndex] = childPath;
				delete cache[i];
			}
			delete cache.length;
			return function() {
				for (var newIndex$1 in moves) {
					var childPath$1 = moves[newIndex$1];
					if (childPath$1.name !== +newIndex$1) throw new Error("");
					cache[newIndex$1] = childPath$1;
					path$1.value[newIndex$1] = childPath$1.value;
				}
			};
		}
		Pp.shift = function shift() {
			var move = getMoves(this, -1);
			var result = this.value.shift();
			move();
			return result;
		};
		Pp.unshift = function unshift() {
			var args = [];
			for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
			var move = getMoves(this, args.length);
			var result = this.value.unshift.apply(this.value, args);
			move();
			return result;
		};
		Pp.push = function push() {
			var args = [];
			for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
			isArray$2.assert(this.value);
			delete getChildCache(this).length;
			return this.value.push.apply(this.value, args);
		};
		Pp.pop = function pop() {
			isArray$2.assert(this.value);
			var cache = getChildCache(this);
			delete cache[this.value.length - 1];
			delete cache.length;
			return this.value.pop();
		};
		Pp.insertAt = function insertAt(index) {
			var argc = arguments.length;
			var move = getMoves(this, argc - 1, index);
			if (move === emptyMoves && argc <= 1) return this;
			index = Math.max(index, 0);
			for (var i = 1; i < argc; ++i) this.value[index + i - 1] = arguments[i];
			move();
			return this;
		};
		Pp.insertBefore = function insertBefore() {
			var args = [];
			for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
			var pp = this.parentPath;
			var argc = args.length;
			var insertAtArgs = [this.name];
			for (var i = 0; i < argc; ++i) insertAtArgs.push(args[i]);
			return pp.insertAt.apply(pp, insertAtArgs);
		};
		Pp.insertAfter = function insertAfter() {
			var args = [];
			for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
			var pp = this.parentPath;
			var argc = args.length;
			var insertAtArgs = [this.name + 1];
			for (var i = 0; i < argc; ++i) insertAtArgs.push(args[i]);
			return pp.insertAt.apply(pp, insertAtArgs);
		};
		function repairRelationshipWithParent(path$1) {
			if (!(path$1 instanceof Path$1)) throw new Error("");
			var pp = path$1.parentPath;
			if (!pp) return path$1;
			var parentValue = pp.value;
			var parentCache = getChildCache(pp);
			if (parentValue[path$1.name] === path$1.value) parentCache[path$1.name] = path$1;
			else if (isArray$2.check(parentValue)) {
				var i = parentValue.indexOf(path$1.value);
				if (i >= 0) parentCache[path$1.name = i] = path$1;
			} else {
				parentValue[path$1.name] = path$1.value;
				parentCache[path$1.name] = path$1;
			}
			if (parentValue[path$1.name] !== path$1.value) throw new Error("");
			if (path$1.parentPath.get(path$1.name) !== path$1) throw new Error("");
			return path$1;
		}
		Pp.replace = function replace(replacement) {
			var results = [];
			var parentValue = this.parentPath.value;
			var parentCache = getChildCache(this.parentPath);
			var count = arguments.length;
			repairRelationshipWithParent(this);
			if (isArray$2.check(parentValue)) {
				var originalLength = parentValue.length;
				var move = getMoves(this.parentPath, count - 1, this.name + 1);
				var spliceArgs = [this.name, 1];
				for (var i = 0; i < count; ++i) spliceArgs.push(arguments[i]);
				if (parentValue.splice.apply(parentValue, spliceArgs)[0] !== this.value) throw new Error("");
				if (parentValue.length !== originalLength - 1 + count) throw new Error("");
				move();
				if (count === 0) {
					delete this.value;
					delete parentCache[this.name];
					this.__childCache = null;
				} else {
					if (parentValue[this.name] !== replacement) throw new Error("");
					if (this.value !== replacement) {
						this.value = replacement;
						this.__childCache = null;
					}
					for (i = 0; i < count; ++i) results.push(this.parentPath.get(this.name + i));
					if (results[0] !== this) throw new Error("");
				}
			} else if (count === 1) {
				if (this.value !== replacement) this.__childCache = null;
				this.value = parentValue[this.name] = replacement;
				results.push(this);
			} else if (count === 0) {
				delete parentValue[this.name];
				delete this.value;
				this.__childCache = null;
			} else throw new Error("Could not replace path");
			return results;
		};
		return Path$1;
	}
	exports.default = pathPlugin;
	module.exports = exports["default"];
}));
var require_scope = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var types_1$21 = require_tslib().__importDefault(require_types$1());
	var hasOwn$1 = Object.prototype.hasOwnProperty;
	function scopePlugin(fork) {
		var types$4 = fork.use(types_1$21.default);
		var Type$1 = types$4.Type;
		var namedTypes = types$4.namedTypes;
		var Node = namedTypes.Node;
		var Expression = namedTypes.Expression;
		var isArray$2 = types$4.builtInTypes.array;
		var b = types$4.builders;
		var Scope$1 = function Scope$2(path$1, parentScope) {
			if (!(this instanceof Scope$2)) throw new Error("Scope constructor cannot be invoked without 'new'");
			ScopeType.assert(path$1.value);
			var depth;
			if (parentScope) {
				if (!(parentScope instanceof Scope$2)) throw new Error("");
				depth = parentScope.depth + 1;
			} else {
				parentScope = null;
				depth = 0;
			}
			Object.defineProperties(this, {
				path: { value: path$1 },
				node: { value: path$1.value },
				isGlobal: {
					value: !parentScope,
					enumerable: true
				},
				depth: { value: depth },
				parent: { value: parentScope },
				bindings: { value: {} },
				types: { value: {} }
			});
		};
		var scopeTypes = [
			namedTypes.Program,
			namedTypes.Function,
			namedTypes.CatchClause
		];
		var ScopeType = Type$1.or.apply(Type$1, scopeTypes);
		Scope$1.isEstablishedBy = function(node) {
			return ScopeType.check(node);
		};
		var Sp = Scope$1.prototype;
		Sp.didScan = false;
		Sp.declares = function(name$1) {
			this.scan();
			return hasOwn$1.call(this.bindings, name$1);
		};
		Sp.declaresType = function(name$1) {
			this.scan();
			return hasOwn$1.call(this.types, name$1);
		};
		Sp.declareTemporary = function(prefix) {
			if (prefix) {
				if (!/^[a-z$_]/i.test(prefix)) throw new Error("");
			} else prefix = "t$";
			prefix += this.depth.toString(36) + "$";
			this.scan();
			var index = 0;
			while (this.declares(prefix + index)) ++index;
			var name$1 = prefix + index;
			return this.bindings[name$1] = types$4.builders.identifier(name$1);
		};
		Sp.injectTemporary = function(identifier, init$1) {
			identifier || (identifier = this.declareTemporary());
			var bodyPath = this.path.get("body");
			if (namedTypes.BlockStatement.check(bodyPath.value)) bodyPath = bodyPath.get("body");
			bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init$1 || null)]));
			return identifier;
		};
		Sp.scan = function(force) {
			if (force || !this.didScan) {
				for (var name$1 in this.bindings) delete this.bindings[name$1];
				scanScope(this.path, this.bindings, this.types);
				this.didScan = true;
			}
		};
		Sp.getBindings = function() {
			this.scan();
			return this.bindings;
		};
		Sp.getTypes = function() {
			this.scan();
			return this.types;
		};
		function scanScope(path$1, bindings, scopeTypes$1) {
			var node = path$1.value;
			ScopeType.assert(node);
			if (namedTypes.CatchClause.check(node)) {
				var param = path$1.get("param");
				if (param.value) addPattern(param, bindings);
			} else recursiveScanScope(path$1, bindings, scopeTypes$1);
		}
		function recursiveScanScope(path$1, bindings, scopeTypes$1) {
			var node = path$1.value;
			if (path$1.parent && namedTypes.FunctionExpression.check(path$1.parent.node) && path$1.parent.node.id) addPattern(path$1.parent.get("id"), bindings);
			if (!node) {} else if (isArray$2.check(node)) path$1.each(function(childPath) {
				recursiveScanChild(childPath, bindings, scopeTypes$1);
			});
			else if (namedTypes.Function.check(node)) {
				path$1.get("params").each(function(paramPath) {
					addPattern(paramPath, bindings);
				});
				recursiveScanChild(path$1.get("body"), bindings, scopeTypes$1);
			} else if (namedTypes.TypeAlias && namedTypes.TypeAlias.check(node) || namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node) || namedTypes.TSTypeAliasDeclaration && namedTypes.TSTypeAliasDeclaration.check(node) || namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node)) addTypePattern(path$1.get("id"), scopeTypes$1);
			else if (namedTypes.VariableDeclarator.check(node)) {
				addPattern(path$1.get("id"), bindings);
				recursiveScanChild(path$1.get("init"), bindings, scopeTypes$1);
			} else if (node.type === "ImportSpecifier" || node.type === "ImportNamespaceSpecifier" || node.type === "ImportDefaultSpecifier") addPattern(path$1.get(node.local ? "local" : node.name ? "name" : "id"), bindings);
			else if (Node.check(node) && !Expression.check(node)) types$4.eachField(node, function(name$1, child) {
				var childPath = path$1.get(name$1);
				if (!pathHasValue(childPath, child)) throw new Error("");
				recursiveScanChild(childPath, bindings, scopeTypes$1);
			});
		}
		function pathHasValue(path$1, value) {
			if (path$1.value === value) return true;
			if (Array.isArray(path$1.value) && path$1.value.length === 0 && Array.isArray(value) && value.length === 0) return true;
			return false;
		}
		function recursiveScanChild(path$1, bindings, scopeTypes$1) {
			var node = path$1.value;
			if (!node || Expression.check(node)) {} else if (namedTypes.FunctionDeclaration.check(node) && node.id !== null) addPattern(path$1.get("id"), bindings);
			else if (namedTypes.ClassDeclaration && namedTypes.ClassDeclaration.check(node)) addPattern(path$1.get("id"), bindings);
			else if (ScopeType.check(node)) {
				if (namedTypes.CatchClause.check(node) && namedTypes.Identifier.check(node.param)) {
					var catchParamName = node.param.name;
					var hadBinding = hasOwn$1.call(bindings, catchParamName);
					recursiveScanScope(path$1.get("body"), bindings, scopeTypes$1);
					if (!hadBinding) delete bindings[catchParamName];
				}
			} else recursiveScanScope(path$1, bindings, scopeTypes$1);
		}
		function addPattern(patternPath, bindings) {
			var pattern = patternPath.value;
			namedTypes.Pattern.assert(pattern);
			if (namedTypes.Identifier.check(pattern)) if (hasOwn$1.call(bindings, pattern.name)) bindings[pattern.name].push(patternPath);
			else bindings[pattern.name] = [patternPath];
			else if (namedTypes.AssignmentPattern && namedTypes.AssignmentPattern.check(pattern)) addPattern(patternPath.get("left"), bindings);
			else if (namedTypes.ObjectPattern && namedTypes.ObjectPattern.check(pattern)) patternPath.get("properties").each(function(propertyPath) {
				var property = propertyPath.value;
				if (namedTypes.Pattern.check(property)) addPattern(propertyPath, bindings);
				else if (namedTypes.Property.check(property)) addPattern(propertyPath.get("value"), bindings);
				else if (namedTypes.SpreadProperty && namedTypes.SpreadProperty.check(property)) addPattern(propertyPath.get("argument"), bindings);
			});
			else if (namedTypes.ArrayPattern && namedTypes.ArrayPattern.check(pattern)) patternPath.get("elements").each(function(elementPath) {
				var element = elementPath.value;
				if (namedTypes.Pattern.check(element)) addPattern(elementPath, bindings);
				else if (namedTypes.SpreadElement && namedTypes.SpreadElement.check(element)) addPattern(elementPath.get("argument"), bindings);
			});
			else if (namedTypes.PropertyPattern && namedTypes.PropertyPattern.check(pattern)) addPattern(patternPath.get("pattern"), bindings);
			else if (namedTypes.SpreadElementPattern && namedTypes.SpreadElementPattern.check(pattern) || namedTypes.SpreadPropertyPattern && namedTypes.SpreadPropertyPattern.check(pattern)) addPattern(patternPath.get("argument"), bindings);
		}
		function addTypePattern(patternPath, types$5) {
			var pattern = patternPath.value;
			namedTypes.Pattern.assert(pattern);
			if (namedTypes.Identifier.check(pattern)) if (hasOwn$1.call(types$5, pattern.name)) types$5[pattern.name].push(patternPath);
			else types$5[pattern.name] = [patternPath];
		}
		Sp.lookup = function(name$1) {
			for (var scope = this; scope; scope = scope.parent) if (scope.declares(name$1)) break;
			return scope;
		};
		Sp.lookupType = function(name$1) {
			for (var scope = this; scope; scope = scope.parent) if (scope.declaresType(name$1)) break;
			return scope;
		};
		Sp.getGlobalScope = function() {
			var scope = this;
			while (!scope.isGlobal) scope = scope.parent;
			return scope;
		};
		return Scope$1;
	}
	exports.default = scopePlugin;
	module.exports = exports["default"];
}));
var require_node_path = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$15 = require_tslib();
	var types_1$20 = tslib_1$15.__importDefault(require_types$1());
	var path_1$1 = tslib_1$15.__importDefault(require_path());
	var scope_1 = tslib_1$15.__importDefault(require_scope());
	function nodePathPlugin(fork) {
		var types$4 = fork.use(types_1$20.default);
		var n$1 = types$4.namedTypes;
		var b = types$4.builders;
		var isNumber$1 = types$4.builtInTypes.number;
		var isArray$2 = types$4.builtInTypes.array;
		var Path$1 = fork.use(path_1$1.default);
		var Scope$1 = fork.use(scope_1.default);
		var NodePath$1 = function NodePath$2(value, parentPath, name$1) {
			if (!(this instanceof NodePath$2)) throw new Error("NodePath constructor cannot be invoked without 'new'");
			Path$1.call(this, value, parentPath, name$1);
		};
		var NPp = NodePath$1.prototype = Object.create(Path$1.prototype, { constructor: {
			value: NodePath$1,
			enumerable: false,
			writable: true,
			configurable: true
		} });
		Object.defineProperties(NPp, {
			node: { get: function() {
				Object.defineProperty(this, "node", {
					configurable: true,
					value: this._computeNode()
				});
				return this.node;
			} },
			parent: { get: function() {
				Object.defineProperty(this, "parent", {
					configurable: true,
					value: this._computeParent()
				});
				return this.parent;
			} },
			scope: { get: function() {
				Object.defineProperty(this, "scope", {
					configurable: true,
					value: this._computeScope()
				});
				return this.scope;
			} }
		});
		NPp.replace = function() {
			delete this.node;
			delete this.parent;
			delete this.scope;
			return Path$1.prototype.replace.apply(this, arguments);
		};
		NPp.prune = function() {
			var remainingNodePath = this.parent;
			this.replace();
			return cleanUpNodesAfterPrune(remainingNodePath);
		};
		NPp._computeNode = function() {
			var value = this.value;
			if (n$1.Node.check(value)) return value;
			var pp = this.parentPath;
			return pp && pp.node || null;
		};
		NPp._computeParent = function() {
			var value = this.value;
			var pp = this.parentPath;
			if (!n$1.Node.check(value)) {
				while (pp && !n$1.Node.check(pp.value)) pp = pp.parentPath;
				if (pp) pp = pp.parentPath;
			}
			while (pp && !n$1.Node.check(pp.value)) pp = pp.parentPath;
			return pp || null;
		};
		NPp._computeScope = function() {
			var value = this.value;
			var pp = this.parentPath;
			var scope = pp && pp.scope;
			if (n$1.Node.check(value) && Scope$1.isEstablishedBy(value)) scope = new Scope$1(this, scope);
			return scope || null;
		};
		NPp.getValueProperty = function(name$1) {
			return types$4.getFieldValue(this.value, name$1);
		};
		NPp.needsParens = function(assumeExpressionContext) {
			var pp = this.parentPath;
			if (!pp) return false;
			var node = this.value;
			if (!n$1.Expression.check(node)) return false;
			if (node.type === "Identifier") return false;
			while (!n$1.Node.check(pp.value)) {
				pp = pp.parentPath;
				if (!pp) return false;
			}
			var parent = pp.value;
			switch (node.type) {
				case "UnaryExpression":
				case "SpreadElement":
				case "SpreadProperty": return parent.type === "MemberExpression" && this.name === "object" && parent.object === node;
				case "BinaryExpression":
				case "LogicalExpression": switch (parent.type) {
					case "CallExpression": return this.name === "callee" && parent.callee === node;
					case "UnaryExpression":
					case "SpreadElement":
					case "SpreadProperty": return true;
					case "MemberExpression": return this.name === "object" && parent.object === node;
					case "BinaryExpression":
					case "LogicalExpression":
						var n_1 = node;
						var pp_1 = PRECEDENCE[parent.operator];
						var np = PRECEDENCE[n_1.operator];
						if (pp_1 > np) return true;
						if (pp_1 === np && this.name === "right") {
							if (parent.right !== n_1) throw new Error("Nodes must be equal");
							return true;
						}
					default: return false;
				}
				case "SequenceExpression": switch (parent.type) {
					case "ForStatement": return false;
					case "ExpressionStatement": return this.name !== "expression";
					default: return true;
				}
				case "YieldExpression": switch (parent.type) {
					case "BinaryExpression":
					case "LogicalExpression":
					case "UnaryExpression":
					case "SpreadElement":
					case "SpreadProperty":
					case "CallExpression":
					case "MemberExpression":
					case "NewExpression":
					case "ConditionalExpression":
					case "YieldExpression": return true;
					default: return false;
				}
				case "Literal": return parent.type === "MemberExpression" && isNumber$1.check(node.value) && this.name === "object" && parent.object === node;
				case "AssignmentExpression":
				case "ConditionalExpression": switch (parent.type) {
					case "UnaryExpression":
					case "SpreadElement":
					case "SpreadProperty":
					case "BinaryExpression":
					case "LogicalExpression": return true;
					case "CallExpression": return this.name === "callee" && parent.callee === node;
					case "ConditionalExpression": return this.name === "test" && parent.test === node;
					case "MemberExpression": return this.name === "object" && parent.object === node;
					default: return false;
				}
				default: if (parent.type === "NewExpression" && this.name === "callee" && parent.callee === node) return containsCallExpression(node);
			}
			if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) return true;
			return false;
		};
		function isBinary(node) {
			return n$1.BinaryExpression.check(node) || n$1.LogicalExpression.check(node);
		}
		var PRECEDENCE = {};
		[
			["||"],
			["&&"],
			["|"],
			["^"],
			["&"],
			[
				"==",
				"===",
				"!=",
				"!=="
			],
			[
				"<",
				">",
				"<=",
				">=",
				"in",
				"instanceof"
			],
			[
				">>",
				"<<",
				">>>"
			],
			["+", "-"],
			[
				"*",
				"/",
				"%"
			]
		].forEach(function(tier, i) {
			tier.forEach(function(op) {
				PRECEDENCE[op] = i;
			});
		});
		function containsCallExpression(node) {
			if (n$1.CallExpression.check(node)) return true;
			if (isArray$2.check(node)) return node.some(containsCallExpression);
			if (n$1.Node.check(node)) return types$4.someField(node, function(_name, child) {
				return containsCallExpression(child);
			});
			return false;
		}
		NPp.canBeFirstInStatement = function() {
			var node = this.node;
			return !n$1.FunctionExpression.check(node) && !n$1.ObjectExpression.check(node);
		};
		NPp.firstInStatement = function() {
			return firstInStatement(this);
		};
		function firstInStatement(path$1) {
			for (var node, parent; path$1.parent; path$1 = path$1.parent) {
				node = path$1.node;
				parent = path$1.parent.node;
				if (n$1.BlockStatement.check(parent) && path$1.parent.name === "body" && path$1.name === 0) {
					if (parent.body[0] !== node) throw new Error("Nodes must be equal");
					return true;
				}
				if (n$1.ExpressionStatement.check(parent) && path$1.name === "expression") {
					if (parent.expression !== node) throw new Error("Nodes must be equal");
					return true;
				}
				if (n$1.SequenceExpression.check(parent) && path$1.parent.name === "expressions" && path$1.name === 0) {
					if (parent.expressions[0] !== node) throw new Error("Nodes must be equal");
					continue;
				}
				if (n$1.CallExpression.check(parent) && path$1.name === "callee") {
					if (parent.callee !== node) throw new Error("Nodes must be equal");
					continue;
				}
				if (n$1.MemberExpression.check(parent) && path$1.name === "object") {
					if (parent.object !== node) throw new Error("Nodes must be equal");
					continue;
				}
				if (n$1.ConditionalExpression.check(parent) && path$1.name === "test") {
					if (parent.test !== node) throw new Error("Nodes must be equal");
					continue;
				}
				if (isBinary(parent) && path$1.name === "left") {
					if (parent.left !== node) throw new Error("Nodes must be equal");
					continue;
				}
				if (n$1.UnaryExpression.check(parent) && !parent.prefix && path$1.name === "argument") {
					if (parent.argument !== node) throw new Error("Nodes must be equal");
					continue;
				}
				return false;
			}
			return true;
		}
		function cleanUpNodesAfterPrune(remainingNodePath) {
			if (n$1.VariableDeclaration.check(remainingNodePath.node)) {
				var declarations = remainingNodePath.get("declarations").value;
				if (!declarations || declarations.length === 0) return remainingNodePath.prune();
			} else if (n$1.ExpressionStatement.check(remainingNodePath.node)) {
				if (!remainingNodePath.get("expression").value) return remainingNodePath.prune();
			} else if (n$1.IfStatement.check(remainingNodePath.node)) cleanUpIfStatementAfterPrune(remainingNodePath);
			return remainingNodePath;
		}
		function cleanUpIfStatementAfterPrune(ifStatement) {
			var testExpression = ifStatement.get("test").value;
			var alternate = ifStatement.get("alternate").value;
			var consequent = ifStatement.get("consequent").value;
			if (!consequent && !alternate) {
				var testExpressionStatement = b.expressionStatement(testExpression);
				ifStatement.replace(testExpressionStatement);
			} else if (!consequent && alternate) {
				var negatedTestExpression = b.unaryExpression("!", testExpression, true);
				if (n$1.UnaryExpression.check(testExpression) && testExpression.operator === "!") negatedTestExpression = testExpression.argument;
				ifStatement.get("test").replace(negatedTestExpression);
				ifStatement.get("consequent").replace(alternate);
				ifStatement.get("alternate").replace();
			}
		}
		return NodePath$1;
	}
	exports.default = nodePathPlugin;
	module.exports = exports["default"];
}));
var require_path_visitor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$14 = require_tslib();
	var types_1$19 = tslib_1$14.__importDefault(require_types$1());
	var node_path_1$1 = tslib_1$14.__importDefault(require_node_path());
	var hasOwn = Object.prototype.hasOwnProperty;
	function pathVisitorPlugin(fork) {
		var types$4 = fork.use(types_1$19.default);
		var NodePath$1 = fork.use(node_path_1$1.default);
		var isArray$2 = types$4.builtInTypes.array;
		var isObject$1 = types$4.builtInTypes.object;
		var isFunction$3 = types$4.builtInTypes.function;
		var undefined$2;
		var PathVisitor$1 = function PathVisitor$2() {
			if (!(this instanceof PathVisitor$2)) throw new Error("PathVisitor constructor cannot be invoked without 'new'");
			this._reusableContextStack = [];
			this._methodNameTable = computeMethodNameTable(this);
			this._shouldVisitComments = hasOwn.call(this._methodNameTable, "Block") || hasOwn.call(this._methodNameTable, "Line");
			this.Context = makeContextConstructor(this);
			this._visiting = false;
			this._changeReported = false;
		};
		function computeMethodNameTable(visitor) {
			var typeNames = Object.create(null);
			for (var methodName in visitor) if (/^visit[A-Z]/.test(methodName)) typeNames[methodName.slice(5)] = true;
			var supertypeTable = types$4.computeSupertypeLookupTable(typeNames);
			var methodNameTable = Object.create(null);
			var typeNameKeys = Object.keys(supertypeTable);
			var typeNameCount = typeNameKeys.length;
			for (var i = 0; i < typeNameCount; ++i) {
				var typeName = typeNameKeys[i];
				methodName = "visit" + supertypeTable[typeName];
				if (isFunction$3.check(visitor[methodName])) methodNameTable[typeName] = methodName;
			}
			return methodNameTable;
		}
		PathVisitor$1.fromMethodsObject = function fromMethodsObject(methods) {
			if (methods instanceof PathVisitor$1) return methods;
			if (!isObject$1.check(methods)) return new PathVisitor$1();
			var Visitor = function Visitor$1() {
				if (!(this instanceof Visitor$1)) throw new Error("Visitor constructor cannot be invoked without 'new'");
				PathVisitor$1.call(this);
			};
			var Vp = Visitor.prototype = Object.create(PVp);
			Vp.constructor = Visitor;
			extend$1(Vp, methods);
			extend$1(Visitor, PathVisitor$1);
			isFunction$3.assert(Visitor.fromMethodsObject);
			isFunction$3.assert(Visitor.visit);
			return new Visitor();
		};
		function extend$1(target, source) {
			for (var property in source) if (hasOwn.call(source, property)) target[property] = source[property];
			return target;
		}
		PathVisitor$1.visit = function visit$1(node, methods) {
			return PathVisitor$1.fromMethodsObject(methods).visit(node);
		};
		var PVp = PathVisitor$1.prototype;
		PVp.visit = function() {
			if (this._visiting) throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");
			this._visiting = true;
			this._changeReported = false;
			this._abortRequested = false;
			var argc = arguments.length;
			var args = new Array(argc);
			for (var i = 0; i < argc; ++i) args[i] = arguments[i];
			if (!(args[0] instanceof NodePath$1)) args[0] = new NodePath$1({ root: args[0] }).get("root");
			this.reset.apply(this, args);
			var didNotThrow;
			try {
				var root = this.visitWithoutReset(args[0]);
				didNotThrow = true;
			} finally {
				this._visiting = false;
				if (!didNotThrow && this._abortRequested) return args[0].value;
			}
			return root;
		};
		PVp.AbortRequest = function AbortRequest() {};
		PVp.abort = function() {
			var visitor = this;
			visitor._abortRequested = true;
			var request$1 = new visitor.AbortRequest();
			request$1.cancel = function() {
				visitor._abortRequested = false;
			};
			throw request$1;
		};
		PVp.reset = function(_path) {};
		PVp.visitWithoutReset = function(path$1) {
			if (this instanceof this.Context) return this.visitor.visitWithoutReset(path$1);
			if (!(path$1 instanceof NodePath$1)) throw new Error("");
			var value = path$1.value;
			var methodName = value && typeof value === "object" && typeof value.type === "string" && this._methodNameTable[value.type];
			if (methodName) {
				var context = this.acquireContext(path$1);
				try {
					return context.invokeVisitorMethod(methodName);
				} finally {
					this.releaseContext(context);
				}
			} else return visitChildren(path$1, this);
		};
		function visitChildren(path$1, visitor) {
			if (!(path$1 instanceof NodePath$1)) throw new Error("");
			if (!(visitor instanceof PathVisitor$1)) throw new Error("");
			var value = path$1.value;
			if (isArray$2.check(value)) path$1.each(visitor.visitWithoutReset, visitor);
			else if (!isObject$1.check(value)) {} else {
				var childNames = types$4.getFieldNames(value);
				if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) childNames.push("comments");
				var childCount = childNames.length;
				var childPaths = [];
				for (var i = 0; i < childCount; ++i) {
					var childName = childNames[i];
					if (!hasOwn.call(value, childName)) value[childName] = types$4.getFieldValue(value, childName);
					childPaths.push(path$1.get(childName));
				}
				for (var i = 0; i < childCount; ++i) visitor.visitWithoutReset(childPaths[i]);
			}
			return path$1.value;
		}
		PVp.acquireContext = function(path$1) {
			if (this._reusableContextStack.length === 0) return new this.Context(path$1);
			return this._reusableContextStack.pop().reset(path$1);
		};
		PVp.releaseContext = function(context) {
			if (!(context instanceof this.Context)) throw new Error("");
			this._reusableContextStack.push(context);
			context.currentPath = null;
		};
		PVp.reportChanged = function() {
			this._changeReported = true;
		};
		PVp.wasChangeReported = function() {
			return this._changeReported;
		};
		function makeContextConstructor(visitor) {
			function Context(path$1) {
				if (!(this instanceof Context)) throw new Error("");
				if (!(this instanceof PathVisitor$1)) throw new Error("");
				if (!(path$1 instanceof NodePath$1)) throw new Error("");
				Object.defineProperty(this, "visitor", {
					value: visitor,
					writable: false,
					enumerable: true,
					configurable: false
				});
				this.currentPath = path$1;
				this.needToCallTraverse = true;
				Object.seal(this);
			}
			if (!(visitor instanceof PathVisitor$1)) throw new Error("");
			var Cp = Context.prototype = Object.create(visitor);
			Cp.constructor = Context;
			extend$1(Cp, sharedContextProtoMethods);
			return Context;
		}
		var sharedContextProtoMethods = Object.create(null);
		sharedContextProtoMethods.reset = function reset(path$1) {
			if (!(this instanceof this.Context)) throw new Error("");
			if (!(path$1 instanceof NodePath$1)) throw new Error("");
			this.currentPath = path$1;
			this.needToCallTraverse = true;
			return this;
		};
		sharedContextProtoMethods.invokeVisitorMethod = function invokeVisitorMethod(methodName) {
			if (!(this instanceof this.Context)) throw new Error("");
			if (!(this.currentPath instanceof NodePath$1)) throw new Error("");
			var result = this.visitor[methodName].call(this, this.currentPath);
			if (result === false) this.needToCallTraverse = false;
			else if (result !== undefined$2) {
				this.currentPath = this.currentPath.replace(result)[0];
				if (this.needToCallTraverse) this.traverse(this.currentPath);
			}
			if (this.needToCallTraverse !== false) throw new Error("Must either call this.traverse or return false in " + methodName);
			var path$1 = this.currentPath;
			return path$1 && path$1.value;
		};
		sharedContextProtoMethods.traverse = function traverse(path$1, newVisitor) {
			if (!(this instanceof this.Context)) throw new Error("");
			if (!(path$1 instanceof NodePath$1)) throw new Error("");
			if (!(this.currentPath instanceof NodePath$1)) throw new Error("");
			this.needToCallTraverse = false;
			return visitChildren(path$1, PathVisitor$1.fromMethodsObject(newVisitor || this.visitor));
		};
		sharedContextProtoMethods.visit = function visit$1(path$1, newVisitor) {
			if (!(this instanceof this.Context)) throw new Error("");
			if (!(path$1 instanceof NodePath$1)) throw new Error("");
			if (!(this.currentPath instanceof NodePath$1)) throw new Error("");
			this.needToCallTraverse = false;
			return PathVisitor$1.fromMethodsObject(newVisitor || this.visitor).visitWithoutReset(path$1);
		};
		sharedContextProtoMethods.reportChanged = function reportChanged() {
			this.visitor.reportChanged();
		};
		sharedContextProtoMethods.abort = function abort$4() {
			this.needToCallTraverse = false;
			this.visitor.abort();
		};
		return PathVisitor$1;
	}
	exports.default = pathVisitorPlugin;
	module.exports = exports["default"];
}));
var require_equiv = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var types_1$18 = require_tslib().__importDefault(require_types$1());
	function default_1$14(fork) {
		var types$4 = fork.use(types_1$18.default);
		var getFieldNames$1 = types$4.getFieldNames;
		var getFieldValue$1 = types$4.getFieldValue;
		var isArray$2 = types$4.builtInTypes.array;
		var isObject$1 = types$4.builtInTypes.object;
		var isDate$1 = types$4.builtInTypes.Date;
		var isRegExp$1 = types$4.builtInTypes.RegExp;
		var hasOwn$7 = Object.prototype.hasOwnProperty;
		function astNodesAreEquivalent$1(a, b, problemPath) {
			if (isArray$2.check(problemPath)) problemPath.length = 0;
			else problemPath = null;
			return areEquivalent(a, b, problemPath);
		}
		astNodesAreEquivalent$1.assert = function(a, b) {
			var problemPath = [];
			if (!astNodesAreEquivalent$1(a, b, problemPath)) if (problemPath.length === 0) {
				if (a !== b) throw new Error("Nodes must be equal");
			} else throw new Error("Nodes differ in the following path: " + problemPath.map(subscriptForProperty).join(""));
		};
		function subscriptForProperty(property) {
			if (/[_$a-z][_$a-z0-9]*/i.test(property)) return "." + property;
			return "[" + JSON.stringify(property) + "]";
		}
		function areEquivalent(a, b, problemPath) {
			if (a === b) return true;
			if (isArray$2.check(a)) return arraysAreEquivalent(a, b, problemPath);
			if (isObject$1.check(a)) return objectsAreEquivalent(a, b, problemPath);
			if (isDate$1.check(a)) return isDate$1.check(b) && +a === +b;
			if (isRegExp$1.check(a)) return isRegExp$1.check(b) && a.source === b.source && a.global === b.global && a.multiline === b.multiline && a.ignoreCase === b.ignoreCase;
			return a == b;
		}
		function arraysAreEquivalent(a, b, problemPath) {
			isArray$2.assert(a);
			var aLength = a.length;
			if (!isArray$2.check(b) || b.length !== aLength) {
				if (problemPath) problemPath.push("length");
				return false;
			}
			for (var i = 0; i < aLength; ++i) {
				if (problemPath) problemPath.push(i);
				if (i in a !== i in b) return false;
				if (!areEquivalent(a[i], b[i], problemPath)) return false;
				if (problemPath) {
					var problemPathTail = problemPath.pop();
					if (problemPathTail !== i) throw new Error("" + problemPathTail);
				}
			}
			return true;
		}
		function objectsAreEquivalent(a, b, problemPath) {
			isObject$1.assert(a);
			if (!isObject$1.check(b)) return false;
			if (a.type !== b.type) {
				if (problemPath) problemPath.push("type");
				return false;
			}
			var aNames = getFieldNames$1(a);
			var aNameCount = aNames.length;
			var bNames = getFieldNames$1(b);
			var bNameCount = bNames.length;
			if (aNameCount === bNameCount) {
				for (var i = 0; i < aNameCount; ++i) {
					var name$1 = aNames[i];
					var aChild = getFieldValue$1(a, name$1);
					var bChild = getFieldValue$1(b, name$1);
					if (problemPath) problemPath.push(name$1);
					if (!areEquivalent(aChild, bChild, problemPath)) return false;
					if (problemPath) {
						var problemPathTail = problemPath.pop();
						if (problemPathTail !== name$1) throw new Error("" + problemPathTail);
					}
				}
				return true;
			}
			if (!problemPath) return false;
			var seenNames = Object.create(null);
			for (i = 0; i < aNameCount; ++i) seenNames[aNames[i]] = true;
			for (i = 0; i < bNameCount; ++i) {
				name$1 = bNames[i];
				if (!hasOwn$7.call(seenNames, name$1)) {
					problemPath.push(name$1);
					return false;
				}
				delete seenNames[name$1];
			}
			for (name$1 in seenNames) {
				problemPath.push(name$1);
				break;
			}
			return false;
		}
		return astNodesAreEquivalent$1;
	}
	exports.default = default_1$14;
	module.exports = exports["default"];
}));
var require_fork = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$13 = require_tslib();
	var types_1$17 = tslib_1$13.__importDefault(require_types$1());
	var path_visitor_1 = tslib_1$13.__importDefault(require_path_visitor());
	var equiv_1 = tslib_1$13.__importDefault(require_equiv());
	var path_1 = tslib_1$13.__importDefault(require_path());
	var node_path_1 = tslib_1$13.__importDefault(require_node_path());
	function default_1$13(defs) {
		var fork = createFork();
		var types$4 = fork.use(types_1$17.default);
		defs.forEach(fork.use);
		types$4.finalize();
		var PathVisitor$1 = fork.use(path_visitor_1.default);
		return {
			Type: types$4.Type,
			builtInTypes: types$4.builtInTypes,
			namedTypes: types$4.namedTypes,
			builders: types$4.builders,
			defineMethod: types$4.defineMethod,
			getFieldNames: types$4.getFieldNames,
			getFieldValue: types$4.getFieldValue,
			eachField: types$4.eachField,
			someField: types$4.someField,
			getSupertypeNames: types$4.getSupertypeNames,
			getBuilderName: types$4.getBuilderName,
			astNodesAreEquivalent: fork.use(equiv_1.default),
			finalize: types$4.finalize,
			Path: fork.use(path_1.default),
			NodePath: fork.use(node_path_1.default),
			PathVisitor: PathVisitor$1,
			use: fork.use,
			visit: PathVisitor$1.visit
		};
	}
	exports.default = default_1$13;
	function createFork() {
		var used = [];
		var usedResult = [];
		function use$1(plugin) {
			var idx = used.indexOf(plugin);
			if (idx === -1) {
				idx = used.length;
				used.push(plugin);
				usedResult[idx] = plugin(fork);
			}
			return usedResult[idx];
		}
		var fork = { use: use$1 };
		return fork;
	}
	module.exports = exports["default"];
}));
var require_shared = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var types_1$16 = require_tslib().__importDefault(require_types$1());
	function default_1$12(fork) {
		var types$4 = fork.use(types_1$16.default);
		var Type$1 = types$4.Type;
		var builtin = types$4.builtInTypes;
		var isNumber$1 = builtin.number;
		function geq(than) {
			return Type$1.from(function(value) {
				return isNumber$1.check(value) && value >= than;
			}, isNumber$1 + " >= " + than);
		}
		var defaults$1 = {
			"null": function() {
				return null;
			},
			"emptyArray": function() {
				return [];
			},
			"false": function() {
				return false;
			},
			"true": function() {
				return true;
			},
			"undefined": function() {},
			"use strict": function() {
				return "use strict";
			}
		};
		var naiveIsPrimitive = Type$1.or(builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined);
		return {
			geq,
			defaults: defaults$1,
			isPrimitive: Type$1.from(function(value) {
				if (value === null) return true;
				var type = typeof value;
				if (type === "object" || type === "function") return false;
				return true;
			}, naiveIsPrimitive.toString())
		};
	}
	exports.default = default_1$12;
	module.exports = exports["default"];
}));
var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$12 = require_tslib();
	var types_1$15 = tslib_1$12.__importDefault(require_types$1());
	var shared_1$9 = tslib_1$12.__importDefault(require_shared());
	function default_1$11(fork) {
		var Type$1 = fork.use(types_1$15.default).Type;
		var def = Type$1.def;
		var or = Type$1.or;
		var shared = fork.use(shared_1$9.default);
		var defaults$1 = shared.defaults;
		var geq = shared.geq;
		def("Printable").field("loc", or(def("SourceLocation"), null), defaults$1["null"], true);
		def("Node").bases("Printable").field("type", String).field("comments", or([def("Comment")], null), defaults$1["null"], true);
		def("SourceLocation").field("start", def("Position")).field("end", def("Position")).field("source", or(String, null), defaults$1["null"]);
		def("Position").field("line", geq(1)).field("column", geq(0));
		def("File").bases("Node").build("program", "name").field("program", def("Program")).field("name", or(String, null), defaults$1["null"]);
		def("Program").bases("Node").build("body").field("body", [def("Statement")]);
		def("Function").bases("Node").field("id", or(def("Identifier"), null), defaults$1["null"]).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("generator", Boolean, defaults$1["false"]).field("async", Boolean, defaults$1["false"]);
		def("Statement").bases("Node");
		def("EmptyStatement").bases("Statement").build();
		def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]);
		def("ExpressionStatement").bases("Statement").build("expression").field("expression", def("Expression"));
		def("IfStatement").bases("Statement").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Statement")).field("alternate", or(def("Statement"), null), defaults$1["null"]);
		def("LabeledStatement").bases("Statement").build("label", "body").field("label", def("Identifier")).field("body", def("Statement"));
		def("BreakStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults$1["null"]);
		def("ContinueStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults$1["null"]);
		def("WithStatement").bases("Statement").build("object", "body").field("object", def("Expression")).field("body", def("Statement"));
		def("SwitchStatement").bases("Statement").build("discriminant", "cases", "lexical").field("discriminant", def("Expression")).field("cases", [def("SwitchCase")]).field("lexical", Boolean, defaults$1["false"]);
		def("ReturnStatement").bases("Statement").build("argument").field("argument", or(def("Expression"), null));
		def("ThrowStatement").bases("Statement").build("argument").field("argument", def("Expression"));
		def("TryStatement").bases("Statement").build("block", "handler", "finalizer").field("block", def("BlockStatement")).field("handler", or(def("CatchClause"), null), function() {
			return this.handlers && this.handlers[0] || null;
		}).field("handlers", [def("CatchClause")], function() {
			return this.handler ? [this.handler] : [];
		}, true).field("guardedHandlers", [def("CatchClause")], defaults$1.emptyArray).field("finalizer", or(def("BlockStatement"), null), defaults$1["null"]);
		def("CatchClause").bases("Node").build("param", "guard", "body").field("param", or(def("Pattern"), null), defaults$1["null"]).field("guard", or(def("Expression"), null), defaults$1["null"]).field("body", def("BlockStatement"));
		def("WhileStatement").bases("Statement").build("test", "body").field("test", def("Expression")).field("body", def("Statement"));
		def("DoWhileStatement").bases("Statement").build("body", "test").field("body", def("Statement")).field("test", def("Expression"));
		def("ForStatement").bases("Statement").build("init", "test", "update", "body").field("init", or(def("VariableDeclaration"), def("Expression"), null)).field("test", or(def("Expression"), null)).field("update", or(def("Expression"), null)).field("body", def("Statement"));
		def("ForInStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement"));
		def("DebuggerStatement").bases("Statement").build();
		def("Declaration").bases("Statement");
		def("FunctionDeclaration").bases("Function", "Declaration").build("id", "params", "body").field("id", def("Identifier"));
		def("FunctionExpression").bases("Function", "Expression").build("id", "params", "body");
		def("VariableDeclaration").bases("Declaration").build("kind", "declarations").field("kind", or("var", "let", "const")).field("declarations", [def("VariableDeclarator")]);
		def("VariableDeclarator").bases("Node").build("id", "init").field("id", def("Pattern")).field("init", or(def("Expression"), null), defaults$1["null"]);
		def("Expression").bases("Node");
		def("ThisExpression").bases("Expression").build();
		def("ArrayExpression").bases("Expression").build("elements").field("elements", [or(def("Expression"), null)]);
		def("ObjectExpression").bases("Expression").build("properties").field("properties", [def("Property")]);
		def("Property").bases("Node").build("kind", "key", "value").field("kind", or("init", "get", "set")).field("key", or(def("Literal"), def("Identifier"))).field("value", def("Expression"));
		def("SequenceExpression").bases("Expression").build("expressions").field("expressions", [def("Expression")]);
		var UnaryOperator = or("-", "+", "!", "~", "typeof", "void", "delete");
		def("UnaryExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UnaryOperator).field("argument", def("Expression")).field("prefix", Boolean, defaults$1["true"]);
		var BinaryOperator = or("==", "!=", "===", "!==", "<", "<=", ">", ">=", "<<", ">>", ">>>", "+", "-", "*", "/", "%", "**", "&", "|", "^", "in", "instanceof");
		def("BinaryExpression").bases("Expression").build("operator", "left", "right").field("operator", BinaryOperator).field("left", def("Expression")).field("right", def("Expression"));
		var AssignmentOperator = or("=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=");
		def("AssignmentExpression").bases("Expression").build("operator", "left", "right").field("operator", AssignmentOperator).field("left", or(def("Pattern"), def("MemberExpression"))).field("right", def("Expression"));
		var UpdateOperator = or("++", "--");
		def("UpdateExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UpdateOperator).field("argument", def("Expression")).field("prefix", Boolean);
		var LogicalOperator = or("||", "&&");
		def("LogicalExpression").bases("Expression").build("operator", "left", "right").field("operator", LogicalOperator).field("left", def("Expression")).field("right", def("Expression"));
		def("ConditionalExpression").bases("Expression").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Expression")).field("alternate", def("Expression"));
		def("NewExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]);
		def("CallExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]);
		def("MemberExpression").bases("Expression").build("object", "property", "computed").field("object", def("Expression")).field("property", or(def("Identifier"), def("Expression"))).field("computed", Boolean, function() {
			var type = this.property.type;
			if (type === "Literal" || type === "MemberExpression" || type === "BinaryExpression") return true;
			return false;
		});
		def("Pattern").bases("Node");
		def("SwitchCase").bases("Node").build("test", "consequent").field("test", or(def("Expression"), null)).field("consequent", [def("Statement")]);
		def("Identifier").bases("Expression", "Pattern").build("name").field("name", String).field("optional", Boolean, defaults$1["false"]);
		def("Literal").bases("Expression").build("value").field("value", or(String, Boolean, null, Number, RegExp)).field("regex", or({
			pattern: String,
			flags: String
		}, null), function() {
			if (this.value instanceof RegExp) {
				var flags = "";
				if (this.value.ignoreCase) flags += "i";
				if (this.value.multiline) flags += "m";
				if (this.value.global) flags += "g";
				return {
					pattern: this.value.source,
					flags
				};
			}
			return null;
		});
		def("Comment").bases("Printable").field("value", String).field("leading", Boolean, defaults$1["true"]).field("trailing", Boolean, defaults$1["false"]);
	}
	exports.default = default_1$11;
	module.exports = exports["default"];
}));
var require_es6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$11 = require_tslib();
	var core_1$2 = tslib_1$11.__importDefault(require_core());
	var types_1$14 = tslib_1$11.__importDefault(require_types$1());
	var shared_1$8 = tslib_1$11.__importDefault(require_shared());
	function default_1$10(fork) {
		fork.use(core_1$2.default);
		var types$4 = fork.use(types_1$14.default);
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		var defaults$1 = fork.use(shared_1$8.default).defaults;
		def("Function").field("generator", Boolean, defaults$1["false"]).field("expression", Boolean, defaults$1["false"]).field("defaults", [or(def("Expression"), null)], defaults$1.emptyArray).field("rest", or(def("Identifier"), null), defaults$1["null"]);
		def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field("typeAnnotation", or(def("TypeAnnotation"), def("TSTypeAnnotation"), null), defaults$1["null"]);
		def("SpreadElementPattern").bases("Pattern").build("argument").field("argument", def("Pattern"));
		def("FunctionDeclaration").build("id", "params", "body", "generator", "expression");
		def("FunctionExpression").build("id", "params", "body", "generator", "expression");
		def("ArrowFunctionExpression").bases("Function", "Expression").build("params", "body", "expression").field("id", null, defaults$1["null"]).field("body", or(def("BlockStatement"), def("Expression"))).field("generator", false, defaults$1["false"]);
		def("ForOfStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Pattern"))).field("right", def("Expression")).field("body", def("Statement"));
		def("YieldExpression").bases("Expression").build("argument", "delegate").field("argument", or(def("Expression"), null)).field("delegate", Boolean, defaults$1["false"]);
		def("GeneratorExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null));
		def("ComprehensionExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null));
		def("ComprehensionBlock").bases("Node").build("left", "right", "each").field("left", def("Pattern")).field("right", def("Expression")).field("each", Boolean);
		def("Property").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("method", Boolean, defaults$1["false"]).field("shorthand", Boolean, defaults$1["false"]).field("computed", Boolean, defaults$1["false"]);
		def("ObjectProperty").field("shorthand", Boolean, defaults$1["false"]);
		def("PropertyPattern").bases("Pattern").build("key", "pattern").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("pattern", def("Pattern")).field("computed", Boolean, defaults$1["false"]);
		def("ObjectPattern").bases("Pattern").build("properties").field("properties", [or(def("PropertyPattern"), def("Property"))]);
		def("ArrayPattern").bases("Pattern").build("elements").field("elements", [or(def("Pattern"), null)]);
		def("MethodDefinition").bases("Declaration").build("kind", "key", "value", "static").field("kind", or("constructor", "method", "get", "set")).field("key", def("Expression")).field("value", def("Function")).field("computed", Boolean, defaults$1["false"]).field("static", Boolean, defaults$1["false"]);
		def("SpreadElement").bases("Node").build("argument").field("argument", def("Expression"));
		def("ArrayExpression").field("elements", [or(def("Expression"), def("SpreadElement"), def("RestElement"), null)]);
		def("NewExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]);
		def("CallExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]);
		def("AssignmentPattern").bases("Pattern").build("left", "right").field("left", def("Pattern")).field("right", def("Expression"));
		var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"));
		def("ClassProperty").bases("Declaration").build("key").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("computed", Boolean, defaults$1["false"]);
		def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition", ClassBodyElement);
		def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]);
		def("ClassDeclaration").bases("Declaration").build("id", "body", "superClass").field("id", or(def("Identifier"), null)).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults$1["null"]);
		def("ClassExpression").bases("Expression").build("id", "body", "superClass").field("id", or(def("Identifier"), null), defaults$1["null"]).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults$1["null"]);
		def("Specifier").bases("Node");
		def("ModuleSpecifier").bases("Specifier").field("local", or(def("Identifier"), null), defaults$1["null"]).field("id", or(def("Identifier"), null), defaults$1["null"]).field("name", or(def("Identifier"), null), defaults$1["null"]);
		def("ImportSpecifier").bases("ModuleSpecifier").build("id", "name");
		def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("id");
		def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("id");
		def("ImportDeclaration").bases("Declaration").build("specifiers", "source", "importKind").field("specifiers", [or(def("ImportSpecifier"), def("ImportNamespaceSpecifier"), def("ImportDefaultSpecifier"))], defaults$1.emptyArray).field("source", def("Literal")).field("importKind", or("value", "type"), function() {
			return "value";
		});
		def("TaggedTemplateExpression").bases("Expression").build("tag", "quasi").field("tag", def("Expression")).field("quasi", def("TemplateLiteral"));
		def("TemplateLiteral").bases("Expression").build("quasis", "expressions").field("quasis", [def("TemplateElement")]).field("expressions", [def("Expression")]);
		def("TemplateElement").bases("Node").build("value", "tail").field("value", {
			"cooked": String,
			"raw": String
		}).field("tail", Boolean);
	}
	exports.default = default_1$10;
	module.exports = exports["default"];
}));
var require_es7 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$10 = require_tslib();
	var es6_1$1 = tslib_1$10.__importDefault(require_es6());
	var types_1$13 = tslib_1$10.__importDefault(require_types$1());
	var shared_1$7 = tslib_1$10.__importDefault(require_shared());
	function default_1$9(fork) {
		fork.use(es6_1$1.default);
		var types$4 = fork.use(types_1$13.default);
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		var defaults$1 = fork.use(shared_1$7.default).defaults;
		def("Function").field("async", Boolean, defaults$1["false"]);
		def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
		def("ObjectExpression").field("properties", [or(def("Property"), def("SpreadProperty"), def("SpreadElement"))]);
		def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument", def("Pattern"));
		def("ObjectPattern").field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"))]);
		def("AwaitExpression").bases("Expression").build("argument", "all").field("argument", or(def("Expression"), null)).field("all", Boolean, defaults$1["false"]);
	}
	exports.default = default_1$9;
	module.exports = exports["default"];
}));
var require_es2020 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$9 = require_tslib();
	var es7_1$5 = tslib_1$9.__importDefault(require_es7());
	var types_1$12 = tslib_1$9.__importDefault(require_types$1());
	function default_1$8(fork) {
		fork.use(es7_1$5.default);
		var def = fork.use(types_1$12.default).Type.def;
		def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
	}
	exports.default = default_1$8;
	module.exports = exports["default"];
}));
var require_jsx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$8 = require_tslib();
	var es7_1$4 = tslib_1$8.__importDefault(require_es7());
	var types_1$11 = tslib_1$8.__importDefault(require_types$1());
	var shared_1$6 = tslib_1$8.__importDefault(require_shared());
	function default_1$7(fork) {
		fork.use(es7_1$4.default);
		var types$4 = fork.use(types_1$11.default);
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		var defaults$1 = fork.use(shared_1$6.default).defaults;
		def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(def("Literal"), def("JSXExpressionContainer"), null), defaults$1["null"]);
		def("JSXIdentifier").bases("Identifier").build("name").field("name", String);
		def("JSXNamespacedName").bases("Node").build("namespace", "name").field("namespace", def("JSXIdentifier")).field("name", def("JSXIdentifier"));
		def("JSXMemberExpression").bases("MemberExpression").build("object", "property").field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))).field("property", def("JSXIdentifier")).field("computed", Boolean, defaults$1.false);
		var JSXElementName = or(def("JSXIdentifier"), def("JSXNamespacedName"), def("JSXMemberExpression"));
		def("JSXSpreadAttribute").bases("Node").build("argument").field("argument", def("Expression"));
		var JSXAttributes = [or(def("JSXAttribute"), def("JSXSpreadAttribute"))];
		def("JSXExpressionContainer").bases("Expression").build("expression").field("expression", def("Expression"));
		def("JSXElement").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningElement")).field("closingElement", or(def("JSXClosingElement"), null), defaults$1["null"]).field("children", [or(def("JSXElement"), def("JSXExpressionContainer"), def("JSXFragment"), def("JSXText"), def("Literal"))], defaults$1.emptyArray).field("name", JSXElementName, function() {
			return this.openingElement.name;
		}, true).field("selfClosing", Boolean, function() {
			return this.openingElement.selfClosing;
		}, true).field("attributes", JSXAttributes, function() {
			return this.openingElement.attributes;
		}, true);
		def("JSXOpeningElement").bases("Node").build("name", "attributes", "selfClosing").field("name", JSXElementName).field("attributes", JSXAttributes, defaults$1.emptyArray).field("selfClosing", Boolean, defaults$1["false"]);
		def("JSXClosingElement").bases("Node").build("name").field("name", JSXElementName);
		def("JSXFragment").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningFragment")).field("closingElement", def("JSXClosingFragment")).field("children", [or(def("JSXElement"), def("JSXExpressionContainer"), def("JSXFragment"), def("JSXText"), def("Literal"))], defaults$1.emptyArray);
		def("JSXOpeningFragment").bases("Node").build();
		def("JSXClosingFragment").bases("Node").build();
		def("JSXText").bases("Literal").build("value").field("value", String);
		def("JSXEmptyExpression").bases("Expression").build();
		def("JSXSpreadChild").bases("Expression").build("expression").field("expression", def("Expression"));
	}
	exports.default = default_1$7;
	module.exports = exports["default"];
}));
var require_type_annotations = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$7 = require_tslib();
	var types_1$10 = tslib_1$7.__importDefault(require_types$1());
	var shared_1$5 = tslib_1$7.__importDefault(require_shared());
	function default_1$6(fork) {
		var types$4 = fork.use(types_1$10.default);
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		var defaults$1 = fork.use(shared_1$5.default).defaults;
		var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
		var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
		def("Identifier").field("typeAnnotation", TypeAnnotation, defaults$1["null"]);
		def("ObjectPattern").field("typeAnnotation", TypeAnnotation, defaults$1["null"]);
		def("Function").field("returnType", TypeAnnotation, defaults$1["null"]).field("typeParameters", TypeParamDecl, defaults$1["null"]);
		def("ClassProperty").build("key", "value", "typeAnnotation", "static").field("value", or(def("Expression"), null)).field("static", Boolean, defaults$1["false"]).field("typeAnnotation", TypeAnnotation, defaults$1["null"]);
		["ClassDeclaration", "ClassExpression"].forEach(function(typeName) {
			def(typeName).field("typeParameters", TypeParamDecl, defaults$1["null"]).field("superTypeParameters", or(def("TypeParameterInstantiation"), def("TSTypeParameterInstantiation"), null), defaults$1["null"]).field("implements", or([def("ClassImplements")], [def("TSExpressionWithTypeArguments")]), defaults$1.emptyArray);
		});
	}
	exports.default = default_1$6;
	module.exports = exports["default"];
}));
var require_flow = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$6 = require_tslib();
	var es7_1$3 = tslib_1$6.__importDefault(require_es7());
	var type_annotations_1$1 = tslib_1$6.__importDefault(require_type_annotations());
	var types_1$9 = tslib_1$6.__importDefault(require_types$1());
	var shared_1$4 = tslib_1$6.__importDefault(require_shared());
	function default_1$5(fork) {
		fork.use(es7_1$3.default);
		fork.use(type_annotations_1$1.default);
		var types$4 = fork.use(types_1$9.default);
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		var defaults$1 = fork.use(shared_1$4.default).defaults;
		def("Flow").bases("Node");
		def("FlowType").bases("Flow");
		def("AnyTypeAnnotation").bases("FlowType").build();
		def("EmptyTypeAnnotation").bases("FlowType").build();
		def("MixedTypeAnnotation").bases("FlowType").build();
		def("VoidTypeAnnotation").bases("FlowType").build();
		def("NumberTypeAnnotation").bases("FlowType").build();
		def("NumberLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String);
		def("NumericLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String);
		def("StringTypeAnnotation").bases("FlowType").build();
		def("StringLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", String).field("raw", String);
		def("BooleanTypeAnnotation").bases("FlowType").build();
		def("BooleanLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Boolean).field("raw", String);
		def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", def("FlowType"));
		def("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation", def("FlowType"));
		def("NullLiteralTypeAnnotation").bases("FlowType").build();
		def("NullTypeAnnotation").bases("FlowType").build();
		def("ThisTypeAnnotation").bases("FlowType").build();
		def("ExistsTypeAnnotation").bases("FlowType").build();
		def("ExistentialTypeParam").bases("FlowType").build();
		def("FunctionTypeAnnotation").bases("FlowType").build("params", "returnType", "rest", "typeParameters").field("params", [def("FunctionTypeParam")]).field("returnType", def("FlowType")).field("rest", or(def("FunctionTypeParam"), null)).field("typeParameters", or(def("TypeParameterDeclaration"), null));
		def("FunctionTypeParam").bases("Node").build("name", "typeAnnotation", "optional").field("name", def("Identifier")).field("typeAnnotation", def("FlowType")).field("optional", Boolean);
		def("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType", def("FlowType"));
		def("ObjectTypeAnnotation").bases("FlowType").build("properties", "indexers", "callProperties").field("properties", [or(def("ObjectTypeProperty"), def("ObjectTypeSpreadProperty"))]).field("indexers", [def("ObjectTypeIndexer")], defaults$1.emptyArray).field("callProperties", [def("ObjectTypeCallProperty")], defaults$1.emptyArray).field("inexact", or(Boolean, void 0), defaults$1["undefined"]).field("exact", Boolean, defaults$1["false"]).field("internalSlots", [def("ObjectTypeInternalSlot")], defaults$1.emptyArray);
		def("Variance").bases("Node").build("kind").field("kind", or("plus", "minus"));
		var LegacyVariance = or(def("Variance"), "plus", "minus", null);
		def("ObjectTypeProperty").bases("Node").build("key", "value", "optional").field("key", or(def("Literal"), def("Identifier"))).field("value", def("FlowType")).field("optional", Boolean).field("variance", LegacyVariance, defaults$1["null"]);
		def("ObjectTypeIndexer").bases("Node").build("id", "key", "value").field("id", def("Identifier")).field("key", def("FlowType")).field("value", def("FlowType")).field("variance", LegacyVariance, defaults$1["null"]);
		def("ObjectTypeCallProperty").bases("Node").build("value").field("value", def("FunctionTypeAnnotation")).field("static", Boolean, defaults$1["false"]);
		def("QualifiedTypeIdentifier").bases("Node").build("qualification", "id").field("qualification", or(def("Identifier"), def("QualifiedTypeIdentifier"))).field("id", def("Identifier"));
		def("GenericTypeAnnotation").bases("FlowType").build("id", "typeParameters").field("id", or(def("Identifier"), def("QualifiedTypeIdentifier"))).field("typeParameters", or(def("TypeParameterInstantiation"), null));
		def("MemberTypeAnnotation").bases("FlowType").build("object", "property").field("object", def("Identifier")).field("property", or(def("MemberTypeAnnotation"), def("GenericTypeAnnotation")));
		def("UnionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
		def("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
		def("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument", def("FlowType"));
		def("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument", def("FlowType"));
		def("ObjectTypeInternalSlot").bases("Node").build("id", "value", "optional", "static", "method").field("id", def("Identifier")).field("value", def("FlowType")).field("optional", Boolean).field("static", Boolean).field("method", Boolean);
		def("TypeParameterDeclaration").bases("Node").build("params").field("params", [def("TypeParameter")]);
		def("TypeParameterInstantiation").bases("Node").build("params").field("params", [def("FlowType")]);
		def("TypeParameter").bases("FlowType").build("name", "variance", "bound").field("name", String).field("variance", LegacyVariance, defaults$1["null"]).field("bound", or(def("TypeAnnotation"), null), defaults$1["null"]);
		def("ClassProperty").field("variance", LegacyVariance, defaults$1["null"]);
		def("ClassImplements").bases("Node").build("id").field("id", def("Identifier")).field("superClass", or(def("Expression"), null), defaults$1["null"]).field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults$1["null"]);
		def("InterfaceTypeAnnotation").bases("FlowType").build("body", "extends").field("body", def("ObjectTypeAnnotation")).field("extends", or([def("InterfaceExtends")], null), defaults$1["null"]);
		def("InterfaceDeclaration").bases("Declaration").build("id", "body", "extends").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null), defaults$1["null"]).field("body", def("ObjectTypeAnnotation")).field("extends", [def("InterfaceExtends")]);
		def("DeclareInterface").bases("InterfaceDeclaration").build("id", "body", "extends");
		def("InterfaceExtends").bases("Node").build("id").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults$1["null"]);
		def("TypeAlias").bases("Declaration").build("id", "typeParameters", "right").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("right", def("FlowType"));
		def("OpaqueType").bases("Declaration").build("id", "typeParameters", "impltype", "supertype").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("impltype", def("FlowType")).field("supertype", def("FlowType"));
		def("DeclareTypeAlias").bases("TypeAlias").build("id", "typeParameters", "right");
		def("DeclareOpaqueType").bases("TypeAlias").build("id", "typeParameters", "supertype");
		def("TypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TypeAnnotation"));
		def("TupleTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
		def("DeclareVariable").bases("Statement").build("id").field("id", def("Identifier"));
		def("DeclareFunction").bases("Statement").build("id").field("id", def("Identifier"));
		def("DeclareClass").bases("InterfaceDeclaration").build("id");
		def("DeclareModule").bases("Statement").build("id", "body").field("id", or(def("Identifier"), def("Literal"))).field("body", def("BlockStatement"));
		def("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation", def("TypeAnnotation"));
		def("DeclareExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or(def("DeclareVariable"), def("DeclareFunction"), def("DeclareClass"), def("FlowType"), null)).field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults$1.emptyArray).field("source", or(def("Literal"), null), defaults$1["null"]);
		def("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source", or(def("Literal"), null), defaults$1["null"]);
		def("FlowPredicate").bases("Flow");
		def("InferredPredicate").bases("FlowPredicate").build();
		def("DeclaredPredicate").bases("FlowPredicate").build("value").field("value", def("Expression"));
		def("CallExpression").field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults$1["null"]);
		def("NewExpression").field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults$1["null"]);
	}
	exports.default = default_1$5;
	module.exports = exports["default"];
}));
var require_esprima = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$5 = require_tslib();
	var es7_1$2 = tslib_1$5.__importDefault(require_es7());
	var types_1$8 = tslib_1$5.__importDefault(require_types$1());
	var shared_1$3 = tslib_1$5.__importDefault(require_shared());
	function default_1$4(fork) {
		fork.use(es7_1$2.default);
		var types$4 = fork.use(types_1$8.default);
		var defaults$1 = fork.use(shared_1$3.default).defaults;
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		def("VariableDeclaration").field("declarations", [or(def("VariableDeclarator"), def("Identifier"))]);
		def("Property").field("value", or(def("Expression"), def("Pattern")));
		def("ArrayPattern").field("elements", [or(def("Pattern"), def("SpreadElement"), null)]);
		def("ObjectPattern").field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"))]);
		def("ExportSpecifier").bases("ModuleSpecifier").build("id", "name");
		def("ExportBatchSpecifier").bases("Specifier").build();
		def("ExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or(def("Declaration"), def("Expression"), null)).field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults$1.emptyArray).field("source", or(def("Literal"), null), defaults$1["null"]);
		def("Block").bases("Comment").build("value", "leading", "trailing");
		def("Line").bases("Comment").build("value", "leading", "trailing");
	}
	exports.default = default_1$4;
	module.exports = exports["default"];
}));
var require_babel_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$4 = require_tslib();
	var types_1$7 = tslib_1$4.__importDefault(require_types$1());
	var shared_1$2 = tslib_1$4.__importDefault(require_shared());
	var es7_1$1 = tslib_1$4.__importDefault(require_es7());
	function default_1$3(fork) {
		fork.use(es7_1$1.default);
		var types$4 = fork.use(types_1$7.default);
		var defaults$1 = fork.use(shared_1$2.default).defaults;
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		def("Noop").bases("Statement").build();
		def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
		def("Super").bases("Expression").build();
		def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
		def("Decorator").bases("Node").build("expression").field("expression", def("Expression"));
		def("Property").field("decorators", or([def("Decorator")], null), defaults$1["null"]);
		def("MethodDefinition").field("decorators", or([def("Decorator")], null), defaults$1["null"]);
		def("MetaProperty").bases("Expression").build("meta", "property").field("meta", def("Identifier")).field("property", def("Identifier"));
		def("ParenthesizedExpression").bases("Expression").build("expression").field("expression", def("Expression"));
		def("ImportSpecifier").bases("ModuleSpecifier").build("imported", "local").field("imported", def("Identifier"));
		def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local");
		def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local");
		def("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration", or(def("Declaration"), def("Expression")));
		def("ExportNamedDeclaration").bases("Declaration").build("declaration", "specifiers", "source").field("declaration", or(def("Declaration"), null)).field("specifiers", [def("ExportSpecifier")], defaults$1.emptyArray).field("source", or(def("Literal"), null), defaults$1["null"]);
		def("ExportSpecifier").bases("ModuleSpecifier").build("local", "exported").field("exported", def("Identifier"));
		def("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier"));
		def("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier"));
		def("ExportAllDeclaration").bases("Declaration").build("exported", "source").field("exported", or(def("Identifier"), null)).field("source", def("Literal"));
		def("CommentBlock").bases("Comment").build("value", "leading", "trailing");
		def("CommentLine").bases("Comment").build("value", "leading", "trailing");
		def("Directive").bases("Node").build("value").field("value", def("DirectiveLiteral"));
		def("DirectiveLiteral").bases("Node", "Expression").build("value").field("value", String, defaults$1["use strict"]);
		def("InterpreterDirective").bases("Node").build("value").field("value", String);
		def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults$1.emptyArray);
		def("Program").bases("Node").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults$1.emptyArray).field("interpreter", or(def("InterpreterDirective"), null), defaults$1["null"]);
		def("StringLiteral").bases("Literal").build("value").field("value", String);
		def("NumericLiteral").bases("Literal").build("value").field("value", Number).field("raw", or(String, null), defaults$1["null"]).field("extra", {
			rawValue: Number,
			raw: String
		}, function getDefault() {
			return {
				rawValue: this.value,
				raw: this.value + ""
			};
		});
		def("BigIntLiteral").bases("Literal").build("value").field("value", or(String, Number)).field("extra", {
			rawValue: String,
			raw: String
		}, function getDefault() {
			return {
				rawValue: String(this.value),
				raw: this.value + "n"
			};
		});
		def("NullLiteral").bases("Literal").build().field("value", null, defaults$1["null"]);
		def("BooleanLiteral").bases("Literal").build("value").field("value", Boolean);
		def("RegExpLiteral").bases("Literal").build("pattern", "flags").field("pattern", String).field("flags", String).field("value", RegExp, function() {
			return new RegExp(this.pattern, this.flags);
		});
		var ObjectExpressionProperty = or(def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"), def("SpreadElement"));
		def("ObjectExpression").bases("Expression").build("properties").field("properties", [ObjectExpressionProperty]);
		def("ObjectMethod").bases("Node", "Function").build("kind", "key", "params", "body", "computed").field("kind", or("method", "get", "set")).field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("computed", Boolean, defaults$1["false"]).field("generator", Boolean, defaults$1["false"]).field("async", Boolean, defaults$1["false"]).field("accessibility", or(def("Literal"), null), defaults$1["null"]).field("decorators", or([def("Decorator")], null), defaults$1["null"]);
		def("ObjectProperty").bases("Node").build("key", "value").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("accessibility", or(def("Literal"), null), defaults$1["null"]).field("computed", Boolean, defaults$1["false"]);
		var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"));
		def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]);
		def("ClassMethod").bases("Declaration", "Function").build("kind", "key", "params", "body", "computed", "static").field("key", or(def("Literal"), def("Identifier"), def("Expression")));
		def("ClassPrivateMethod").bases("Declaration", "Function").build("key", "params", "body", "kind", "computed", "static").field("key", def("PrivateName"));
		["ClassMethod", "ClassPrivateMethod"].forEach(function(typeName) {
			def(typeName).field("kind", or("get", "set", "method", "constructor"), function() {
				return "method";
			}).field("body", def("BlockStatement")).field("computed", Boolean, defaults$1["false"]).field("static", or(Boolean, null), defaults$1["null"]).field("abstract", or(Boolean, null), defaults$1["null"]).field("access", or("public", "private", "protected", null), defaults$1["null"]).field("accessibility", or("public", "private", "protected", null), defaults$1["null"]).field("decorators", or([def("Decorator")], null), defaults$1["null"]).field("optional", or(Boolean, null), defaults$1["null"]);
		});
		def("ClassPrivateProperty").bases("ClassProperty").build("key", "value").field("key", def("PrivateName")).field("value", or(def("Expression"), null), defaults$1["null"]);
		def("PrivateName").bases("Expression", "Pattern").build("id").field("id", def("Identifier"));
		var ObjectPatternProperty = or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"), def("ObjectProperty"), def("RestProperty"));
		def("ObjectPattern").bases("Pattern").build("properties").field("properties", [ObjectPatternProperty]).field("decorators", or([def("Decorator")], null), defaults$1["null"]);
		def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
		def("RestProperty").bases("Node").build("argument").field("argument", def("Expression"));
		def("ForAwaitStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement"));
		def("Import").bases("Expression").build();
	}
	exports.default = default_1$3;
	module.exports = exports["default"];
}));
var require_babel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$3 = require_tslib();
	var babel_core_1$1 = tslib_1$3.__importDefault(require_babel_core());
	var flow_1$1 = tslib_1$3.__importDefault(require_flow());
	function default_1$2(fork) {
		fork.use(babel_core_1$1.default);
		fork.use(flow_1$1.default);
	}
	exports.default = default_1$2;
	module.exports = exports["default"];
}));
var require_typescript = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$2 = require_tslib();
	var babel_core_1 = tslib_1$2.__importDefault(require_babel_core());
	var type_annotations_1 = tslib_1$2.__importDefault(require_type_annotations());
	var types_1$6 = tslib_1$2.__importDefault(require_types$1());
	var shared_1$1 = tslib_1$2.__importDefault(require_shared());
	function default_1$1(fork) {
		fork.use(babel_core_1.default);
		fork.use(type_annotations_1.default);
		var types$4 = fork.use(types_1$6.default);
		var n$1 = types$4.namedTypes;
		var def = types$4.Type.def;
		var or = types$4.Type.or;
		var defaults$1 = fork.use(shared_1$1.default).defaults;
		var StringLiteral = types$4.Type.from(function(value, deep) {
			if (n$1.StringLiteral && n$1.StringLiteral.check(value, deep)) return true;
			if (n$1.Literal && n$1.Literal.check(value, deep) && typeof value.value === "string") return true;
			return false;
		}, "StringLiteral");
		def("TSType").bases("Node");
		var TSEntityName = or(def("Identifier"), def("TSQualifiedName"));
		def("TSTypeReference").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("typeName", "typeParameters").field("typeName", TSEntityName);
		def("TSHasOptionalTypeParameterInstantiation").field("typeParameters", or(def("TSTypeParameterInstantiation"), null), defaults$1["null"]);
		def("TSHasOptionalTypeParameters").field("typeParameters", or(def("TSTypeParameterDeclaration"), null, void 0), defaults$1["null"]);
		def("TSHasOptionalTypeAnnotation").field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults$1["null"]);
		def("TSQualifiedName").bases("Node").build("left", "right").field("left", TSEntityName).field("right", TSEntityName);
		def("TSAsExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")).field("extra", or({ parenthesized: Boolean }, null), defaults$1["null"]);
		def("TSNonNullExpression").bases("Expression", "Pattern").build("expression").field("expression", def("Expression"));
		[
			"TSAnyKeyword",
			"TSBigIntKeyword",
			"TSBooleanKeyword",
			"TSNeverKeyword",
			"TSNullKeyword",
			"TSNumberKeyword",
			"TSObjectKeyword",
			"TSStringKeyword",
			"TSSymbolKeyword",
			"TSUndefinedKeyword",
			"TSUnknownKeyword",
			"TSVoidKeyword",
			"TSThisType"
		].forEach(function(keywordType) {
			def(keywordType).bases("TSType").build();
		});
		def("TSArrayType").bases("TSType").build("elementType").field("elementType", def("TSType"));
		def("TSLiteralType").bases("TSType").build("literal").field("literal", or(def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression")));
		["TSUnionType", "TSIntersectionType"].forEach(function(typeName) {
			def(typeName).bases("TSType").build("types").field("types", [def("TSType")]);
		});
		def("TSConditionalType").bases("TSType").build("checkType", "extendsType", "trueType", "falseType").field("checkType", def("TSType")).field("extendsType", def("TSType")).field("trueType", def("TSType")).field("falseType", def("TSType"));
		def("TSInferType").bases("TSType").build("typeParameter").field("typeParameter", def("TSTypeParameter"));
		def("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
		var ParametersType = [or(def("Identifier"), def("RestElement"), def("ArrayPattern"), def("ObjectPattern"))];
		["TSFunctionType", "TSConstructorType"].forEach(function(typeName) {
			def(typeName).bases("TSType", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters").field("parameters", ParametersType);
		});
		def("TSDeclareFunction").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "params", "returnType").field("declare", Boolean, defaults$1["false"]).field("async", Boolean, defaults$1["false"]).field("generator", Boolean, defaults$1["false"]).field("id", or(def("Identifier"), null), defaults$1["null"]).field("params", [def("Pattern")]).field("returnType", or(def("TSTypeAnnotation"), def("Noop"), null), defaults$1["null"]);
		def("TSDeclareMethod").bases("Declaration", "TSHasOptionalTypeParameters").build("key", "params", "returnType").field("async", Boolean, defaults$1["false"]).field("generator", Boolean, defaults$1["false"]).field("params", [def("Pattern")]).field("abstract", Boolean, defaults$1["false"]).field("accessibility", or("public", "private", "protected", void 0), defaults$1["undefined"]).field("static", Boolean, defaults$1["false"]).field("computed", Boolean, defaults$1["false"]).field("optional", Boolean, defaults$1["false"]).field("key", or(def("Identifier"), def("StringLiteral"), def("NumericLiteral"), def("Expression"))).field("kind", or("get", "set", "method", "constructor"), function getDefault() {
			return "method";
		}).field("access", or("public", "private", "protected", void 0), defaults$1["undefined"]).field("decorators", or([def("Decorator")], null), defaults$1["null"]).field("returnType", or(def("TSTypeAnnotation"), def("Noop"), null), defaults$1["null"]);
		def("TSMappedType").bases("TSType").build("typeParameter", "typeAnnotation").field("readonly", or(Boolean, "+", "-"), defaults$1["false"]).field("typeParameter", def("TSTypeParameter")).field("optional", or(Boolean, "+", "-"), defaults$1["false"]).field("typeAnnotation", or(def("TSType"), null), defaults$1["null"]);
		def("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes", [or(def("TSType"), def("TSNamedTupleMember"))]);
		def("TSNamedTupleMember").bases("TSType").build("label", "elementType", "optional").field("label", def("Identifier")).field("optional", Boolean, defaults$1["false"]).field("elementType", def("TSType"));
		def("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
		def("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
		def("TSIndexedAccessType").bases("TSType").build("objectType", "indexType").field("objectType", def("TSType")).field("indexType", def("TSType"));
		def("TSTypeOperator").bases("TSType").build("operator").field("operator", String).field("typeAnnotation", def("TSType"));
		def("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", or(def("TSType"), def("TSTypeAnnotation")));
		def("TSIndexSignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", [def("Identifier")]).field("readonly", Boolean, defaults$1["false"]);
		def("TSPropertySignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("key", "typeAnnotation", "optional").field("key", def("Expression")).field("computed", Boolean, defaults$1["false"]).field("readonly", Boolean, defaults$1["false"]).field("optional", Boolean, defaults$1["false"]).field("initializer", or(def("Expression"), null), defaults$1["null"]);
		def("TSMethodSignature").bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("key", "parameters", "typeAnnotation").field("key", def("Expression")).field("computed", Boolean, defaults$1["false"]).field("optional", Boolean, defaults$1["false"]).field("parameters", ParametersType);
		def("TSTypePredicate").bases("TSTypeAnnotation", "TSType").build("parameterName", "typeAnnotation", "asserts").field("parameterName", or(def("Identifier"), def("TSThisType"))).field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults$1["null"]).field("asserts", Boolean, defaults$1["false"]);
		["TSCallSignatureDeclaration", "TSConstructSignatureDeclaration"].forEach(function(typeName) {
			def(typeName).bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", ParametersType);
		});
		def("TSEnumMember").bases("Node").build("id", "initializer").field("id", or(def("Identifier"), StringLiteral)).field("initializer", or(def("Expression"), null), defaults$1["null"]);
		def("TSTypeQuery").bases("TSType").build("exprName").field("exprName", or(TSEntityName, def("TSImportType")));
		var TSTypeMember = or(def("TSCallSignatureDeclaration"), def("TSConstructSignatureDeclaration"), def("TSIndexSignature"), def("TSMethodSignature"), def("TSPropertySignature"));
		def("TSTypeLiteral").bases("TSType").build("members").field("members", [TSTypeMember]);
		def("TSTypeParameter").bases("Identifier").build("name", "constraint", "default").field("name", String).field("constraint", or(def("TSType"), void 0), defaults$1["undefined"]).field("default", or(def("TSType"), void 0), defaults$1["undefined"]);
		def("TSTypeAssertion").bases("Expression", "Pattern").build("typeAnnotation", "expression").field("typeAnnotation", def("TSType")).field("expression", def("Expression")).field("extra", or({ parenthesized: Boolean }, null), defaults$1["null"]);
		def("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params", [def("TSTypeParameter")]);
		def("TSTypeParameterInstantiation").bases("Node").build("params").field("params", [def("TSType")]);
		def("TSEnumDeclaration").bases("Declaration").build("id", "members").field("id", def("Identifier")).field("const", Boolean, defaults$1["false"]).field("declare", Boolean, defaults$1["false"]).field("members", [def("TSEnumMember")]).field("initializer", or(def("Expression"), null), defaults$1["null"]);
		def("TSTypeAliasDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "typeAnnotation").field("id", def("Identifier")).field("declare", Boolean, defaults$1["false"]).field("typeAnnotation", def("TSType"));
		def("TSModuleBlock").bases("Node").build("body").field("body", [def("Statement")]);
		def("TSModuleDeclaration").bases("Declaration").build("id", "body").field("id", or(StringLiteral, TSEntityName)).field("declare", Boolean, defaults$1["false"]).field("global", Boolean, defaults$1["false"]).field("body", or(def("TSModuleBlock"), def("TSModuleDeclaration"), null), defaults$1["null"]);
		def("TSImportType").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("argument", "qualifier", "typeParameters").field("argument", StringLiteral).field("qualifier", or(TSEntityName, void 0), defaults$1["undefined"]);
		def("TSImportEqualsDeclaration").bases("Declaration").build("id", "moduleReference").field("id", def("Identifier")).field("isExport", Boolean, defaults$1["false"]).field("moduleReference", or(TSEntityName, def("TSExternalModuleReference")));
		def("TSExternalModuleReference").bases("Declaration").build("expression").field("expression", StringLiteral);
		def("TSExportAssignment").bases("Statement").build("expression").field("expression", def("Expression"));
		def("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id", def("Identifier"));
		def("TSInterfaceBody").bases("Node").build("body").field("body", [TSTypeMember]);
		def("TSExpressionWithTypeArguments").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", TSEntityName);
		def("TSInterfaceDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "body").field("id", TSEntityName).field("declare", Boolean, defaults$1["false"]).field("extends", or([def("TSExpressionWithTypeArguments")], null), defaults$1["null"]).field("body", def("TSInterfaceBody"));
		def("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility", or("public", "private", "protected", void 0), defaults$1["undefined"]).field("readonly", Boolean, defaults$1["false"]).field("parameter", or(def("Identifier"), def("AssignmentPattern")));
		def("ClassProperty").field("access", or("public", "private", "protected", void 0), defaults$1["undefined"]);
		def("ClassBody").field("body", [or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("TSDeclareMethod"), TSTypeMember)]);
	}
	exports.default = default_1$1;
	module.exports = exports["default"];
}));
var require_es_proposals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var tslib_1$1 = require_tslib();
	var types_1$5 = tslib_1$1.__importDefault(require_types$1());
	var shared_1 = tslib_1$1.__importDefault(require_shared());
	var core_1$1 = tslib_1$1.__importDefault(require_core());
	function default_1(fork) {
		fork.use(core_1$1.default);
		var types$4 = fork.use(types_1$5.default);
		var Type$1 = types$4.Type;
		var def = types$4.Type.def;
		var or = Type$1.or;
		var defaults$1 = fork.use(shared_1.default).defaults;
		def("OptionalMemberExpression").bases("MemberExpression").build("object", "property", "computed", "optional").field("optional", Boolean, defaults$1["true"]);
		def("OptionalCallExpression").bases("CallExpression").build("callee", "arguments", "optional").field("optional", Boolean, defaults$1["true"]);
		var LogicalOperator = or("||", "&&", "??");
		def("LogicalExpression").field("operator", LogicalOperator);
	}
	exports.default = default_1;
	module.exports = exports["default"];
}));
var require_namedTypes = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.namedTypes = void 0;
	(function(namedTypes) {})(exports.namedTypes || (exports.namedTypes = {}));
}));
var require_main = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.visit = exports.use = exports.Type = exports.someField = exports.PathVisitor = exports.Path = exports.NodePath = exports.namedTypes = exports.getSupertypeNames = exports.getFieldValue = exports.getFieldNames = exports.getBuilderName = exports.finalize = exports.eachField = exports.defineMethod = exports.builtInTypes = exports.builders = exports.astNodesAreEquivalent = void 0;
	var tslib_1 = require_tslib();
	var fork_1 = tslib_1.__importDefault(require_fork());
	var core_1 = tslib_1.__importDefault(require_core());
	var es6_1 = tslib_1.__importDefault(require_es6());
	var es7_1 = tslib_1.__importDefault(require_es7());
	var es2020_1 = tslib_1.__importDefault(require_es2020());
	var jsx_1 = tslib_1.__importDefault(require_jsx());
	var flow_1 = tslib_1.__importDefault(require_flow());
	var esprima_1$1 = tslib_1.__importDefault(require_esprima());
	var babel_1 = tslib_1.__importDefault(require_babel());
	var typescript_1 = tslib_1.__importDefault(require_typescript());
	var es_proposals_1 = tslib_1.__importDefault(require_es_proposals());
	var namedTypes_1 = require_namedTypes();
	Object.defineProperty(exports, "namedTypes", {
		enumerable: true,
		get: function() {
			return namedTypes_1.namedTypes;
		}
	});
	var _a = fork_1.default([
		core_1.default,
		es6_1.default,
		es7_1.default,
		es2020_1.default,
		jsx_1.default,
		flow_1.default,
		esprima_1$1.default,
		babel_1.default,
		typescript_1.default,
		es_proposals_1.default
	]), astNodesAreEquivalent = _a.astNodesAreEquivalent, builders = _a.builders, builtInTypes = _a.builtInTypes, defineMethod = _a.defineMethod, eachField = _a.eachField, finalize = _a.finalize, getBuilderName = _a.getBuilderName, getFieldNames = _a.getFieldNames, getFieldValue = _a.getFieldValue, getSupertypeNames = _a.getSupertypeNames, n = _a.namedTypes, NodePath = _a.NodePath, Path = _a.Path, PathVisitor = _a.PathVisitor, someField = _a.someField, Type = _a.Type, use = _a.use, visit = _a.visit;
	exports.astNodesAreEquivalent = astNodesAreEquivalent;
	exports.builders = builders;
	exports.builtInTypes = builtInTypes;
	exports.defineMethod = defineMethod;
	exports.eachField = eachField;
	exports.finalize = finalize;
	exports.getBuilderName = getBuilderName;
	exports.getFieldNames = getFieldNames;
	exports.getFieldValue = getFieldValue;
	exports.getSupertypeNames = getSupertypeNames;
	exports.NodePath = NodePath;
	exports.Path = Path;
	exports.PathVisitor = PathVisitor;
	exports.someField = someField;
	exports.Type = Type;
	exports.use = use;
	exports.visit = visit;
	Object.assign(namedTypes_1.namedTypes, n);
}));
var require_degenerator = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.degenerator = void 0;
	var util_1$5 = require("util");
	var escodegen_1 = require_escodegen();
	var esprima_1 = require_esprima$1();
	var ast_types_1 = require_main();
	function degenerator(code, _names) {
		if (!Array.isArray(_names)) throw new TypeError("an array of async function \"names\" is required");
		const names = _names.slice(0);
		const ast = (0, esprima_1.parseScript)(code);
		let lastNamesLength = 0;
		do {
			lastNamesLength = names.length;
			(0, ast_types_1.visit)(ast, {
				visitVariableDeclaration(path$1) {
					if (path$1.node.declarations) for (let i = 0; i < path$1.node.declarations.length; i++) {
						const declaration = path$1.node.declarations[i];
						if (ast_types_1.namedTypes.VariableDeclarator.check(declaration) && ast_types_1.namedTypes.Identifier.check(declaration.init) && ast_types_1.namedTypes.Identifier.check(declaration.id) && checkName(declaration.init.name, names) && !checkName(declaration.id.name, names)) names.push(declaration.id.name);
					}
					return false;
				},
				visitAssignmentExpression(path$1) {
					if (ast_types_1.namedTypes.Identifier.check(path$1.node.left) && ast_types_1.namedTypes.Identifier.check(path$1.node.right) && checkName(path$1.node.right.name, names) && !checkName(path$1.node.left.name, names)) names.push(path$1.node.left.name);
					return false;
				},
				visitFunction(path$1) {
					if (path$1.node.id) {
						let shouldDegenerate = false;
						(0, ast_types_1.visit)(path$1.node, { visitCallExpression(path$2) {
							if (checkNames(path$2.node, names)) shouldDegenerate = true;
							return false;
						} });
						if (!shouldDegenerate) return false;
						path$1.node.async = true;
						if (!checkName(path$1.node.id.name, names)) names.push(path$1.node.id.name);
					}
					this.traverse(path$1);
				}
			});
		} while (lastNamesLength !== names.length);
		(0, ast_types_1.visit)(ast, { visitCallExpression(path$1) {
			if (checkNames(path$1.node, names)) {
				const delegate = false;
				const { name: name$1, parent: { node: pNode } } = path$1;
				const expr = ast_types_1.builders.awaitExpression(path$1.node, delegate);
				if (ast_types_1.namedTypes.CallExpression.check(pNode)) pNode.arguments[name$1] = expr;
				else pNode[name$1] = expr;
			}
			this.traverse(path$1);
		} });
		return (0, escodegen_1.generate)(ast);
	}
	exports.degenerator = degenerator;
	function checkNames({ callee }, names) {
		let name$1;
		if (ast_types_1.namedTypes.Identifier.check(callee)) name$1 = callee.name;
		else if (ast_types_1.namedTypes.MemberExpression.check(callee)) if (ast_types_1.namedTypes.Identifier.check(callee.object) && ast_types_1.namedTypes.Identifier.check(callee.property)) name$1 = `${callee.object.name}.${callee.property.name}`;
		else return false;
		else if (ast_types_1.namedTypes.FunctionExpression.check(callee)) if (callee.id) name$1 = callee.id.name;
		else return false;
		else throw new Error(`Don't know how to get name for: ${callee.type}`);
		return checkName(name$1, names);
	}
	function checkName(name$1, names) {
		for (let i = 0; i < names.length; i++) {
			const n$1 = names[i];
			if (util_1$5.types.isRegExp(n$1)) {
				if (n$1.test(name$1)) return true;
			} else if (name$1 === n$1) return true;
		}
		return false;
	}
}));
var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.compile = void 0;
	var util_1$4 = require("util");
	var degenerator_1$1 = require_degenerator();
	function compile(qjs, code, returnName, options = {}) {
		const compiled = (0, degenerator_1$1.degenerator)(code, options.names ?? []);
		const vm = qjs.newContext();
		if (options.sandbox) for (const [name$1, value] of Object.entries(options.sandbox)) {
			if (typeof value !== "function") throw new Error(`Expected a "function" for sandbox property \`${name$1}\`, but got "${typeof value}"`);
			vm.newFunction(name$1, (...args) => {
				const result = value(...args.map((arg) => quickJSHandleToHost(vm, arg)));
				vm.runtime.executePendingJobs();
				return hostToQuickJSHandle(vm, result);
			}).consume((handle) => vm.setProp(vm.global, name$1, handle));
		}
		const fnResult = vm.evalCode(`${compiled};${returnName}`, options.filename);
		const fn = vm.unwrapResult(fnResult);
		const t = vm.typeof(fn);
		if (t !== "function") throw new Error(`Expected a "function" named \`${returnName}\` to be defined, but got "${t}"`);
		const r = async function(...args) {
			let promiseHandle;
			let resolvedHandle;
			try {
				const result = vm.callFunction(fn, vm.undefined, ...args.map((arg) => hostToQuickJSHandle(vm, arg)));
				promiseHandle = vm.unwrapResult(result);
				const resolvedResultP = vm.resolvePromise(promiseHandle);
				vm.runtime.executePendingJobs();
				const resolvedResult = await resolvedResultP;
				resolvedHandle = vm.unwrapResult(resolvedResult);
				return quickJSHandleToHost(vm, resolvedHandle);
			} catch (err) {
				if (err && typeof err === "object" && "cause" in err && err.cause) {
					if (typeof err.cause === "object" && "stack" in err.cause && "name" in err.cause && "message" in err.cause && typeof err.cause.stack === "string" && typeof err.cause.name === "string" && typeof err.cause.message === "string") err.cause.stack = `${err.cause.name}: ${err.cause.message}\n${err.cause.stack}`;
					throw err.cause;
				}
				throw err;
			} finally {
				promiseHandle?.dispose();
				resolvedHandle?.dispose();
			}
		};
		Object.defineProperty(r, "toString", {
			value: () => compiled,
			enumerable: false
		});
		return r;
	}
	exports.compile = compile;
	function quickJSHandleToHost(vm, val) {
		return vm.dump(val);
	}
	function hostToQuickJSHandle(vm, val) {
		if (typeof val === "undefined") return vm.undefined;
		else if (val === null) return vm.null;
		else if (typeof val === "string") return vm.newString(val);
		else if (typeof val === "number") return vm.newNumber(val);
		else if (typeof val === "bigint") return vm.newBigInt(val);
		else if (typeof val === "boolean") return val ? vm.true : vm.false;
		else if (util_1$4.types.isPromise(val)) {
			const promise = vm.newPromise();
			promise.settled.then(vm.runtime.executePendingJobs);
			val.then((r) => {
				promise.resolve(hostToQuickJSHandle(vm, r));
			}, (err) => {
				promise.reject(hostToQuickJSHandle(vm, err));
			});
			return promise.handle;
		} else if (util_1$4.types.isNativeError(val)) return vm.newError(val);
		throw new Error(`Unsupported value: ${val}`);
	}
}));
var require_dist$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$4 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __exportStar$1 = exports && exports.__exportStar || function(m$1, exports$1) {
		for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding$4(exports$1, m$1, p);
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	__exportStar$1(require_degenerator(), exports);
	__exportStar$1(require_compile(), exports);
}));
var require_dateRange = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function dateRange() {
		return false;
	}
	exports.default = dateRange;
}));
var require_dnsDomainIs = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function dnsDomainIs(host, domain) {
		host = String(host);
		domain = String(domain);
		return host.substr(domain.length * -1) === domain;
	}
	exports.default = dnsDomainIs;
}));
var require_dnsDomainLevels = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function dnsDomainLevels(host) {
		const match = String(host).match(/\./g);
		let levels = 0;
		if (match) levels = match.length;
		return levels;
	}
	exports.default = dnsDomainLevels;
}));
var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.isGMT = exports.dnsLookup = void 0;
	var dns_1 = require("dns");
	function dnsLookup(host, opts) {
		return new Promise((resolve, reject) => {
			(0, dns_1.lookup)(host, opts, (err, res) => {
				if (err) reject(err);
				else resolve(res);
			});
		});
	}
	exports.dnsLookup = dnsLookup;
	function isGMT(v) {
		return v === "GMT";
	}
	exports.isGMT = isGMT;
}));
var require_dnsResolve = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var util_1$3 = require_util();
	async function dnsResolve(host) {
		const family = 4;
		try {
			const r = await (0, util_1$3.dnsLookup)(host, { family });
			if (typeof r === "string") return r;
		} catch (err) {}
		return null;
	}
	exports.default = dnsResolve;
}));
var require_netmask = /* @__PURE__ */ __commonJSMin(((exports) => {
	(function() {
		var Netmask, atob$1, chr, chr0, chrA, chra, ip2long, long2ip = function(long) {
			return [
				(long & 255 << 24) >>> 24,
				(long & 255 << 16) >>> 16,
				(long & 65280) >>> 8,
				long & 255
			].join(".");
		};
		ip2long = function(ip) {
			var b = [], c, i, j, n$1, ref;
			for (i = j = 0; j <= 3; i = ++j) {
				if (ip.length === 0) break;
				if (i > 0) {
					if (ip[0] !== ".") throw new Error("Invalid IP");
					ip = ip.substring(1);
				}
				ref = atob$1(ip), n$1 = ref[0], c = ref[1];
				ip = ip.substring(c);
				b.push(n$1);
			}
			if (ip.length !== 0) throw new Error("Invalid IP");
			switch (b.length) {
				case 1:
					if (b[0] > 4294967295) throw new Error("Invalid IP");
					return b[0] >>> 0;
				case 2:
					if (b[0] > 255 || b[1] > 16777215) throw new Error("Invalid IP");
					return (b[0] << 24 | b[1]) >>> 0;
				case 3:
					if (b[0] > 255 || b[1] > 255 || b[2] > 65535) throw new Error("Invalid IP");
					return (b[0] << 24 | b[1] << 16 | b[2]) >>> 0;
				case 4:
					if (b[0] > 255 || b[1] > 255 || b[2] > 255 || b[3] > 255) throw new Error("Invalid IP");
					return (b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3]) >>> 0;
				default: throw new Error("Invalid IP");
			}
		};
		chr = function(b) {
			return b.charCodeAt(0);
		};
		chr0 = chr("0");
		chra = chr("a");
		chrA = chr("A");
		atob$1 = function(s$1) {
			var base, dmax, i, n$1 = 0, start;
			base = 10;
			dmax = "9";
			i = 0;
			if (s$1.length > 1 && s$1[i] === "0") {
				if (s$1[i + 1] === "x" || s$1[i + 1] === "X") {
					i += 2;
					base = 16;
				} else if ("0" <= s$1[i + 1] && s$1[i + 1] <= "9") {
					i++;
					base = 8;
					dmax = "7";
				}
			}
			start = i;
			while (i < s$1.length) {
				if ("0" <= s$1[i] && s$1[i] <= dmax) n$1 = n$1 * base + (chr(s$1[i]) - chr0) >>> 0;
				else if (base === 16) if ("a" <= s$1[i] && s$1[i] <= "f") n$1 = n$1 * base + (10 + chr(s$1[i]) - chra) >>> 0;
				else if ("A" <= s$1[i] && s$1[i] <= "F") n$1 = n$1 * base + (10 + chr(s$1[i]) - chrA) >>> 0;
				else break;
				else break;
				if (n$1 > 4294967295) throw new Error("too large");
				i++;
			}
			if (i === start) throw new Error("empty octet");
			return [n$1, i];
		};
		Netmask = (function() {
			function Netmask$1(net$10, mask) {
				var i, j, ref;
				if (typeof net$10 !== "string") throw new Error("Missing `net' parameter");
				if (!mask) ref = net$10.split("/", 2), net$10 = ref[0], mask = ref[1];
				if (!mask) mask = 32;
				if (typeof mask === "string" && mask.indexOf(".") > -1) {
					try {
						this.maskLong = ip2long(mask);
					} catch (error1) {
						throw new Error("Invalid mask: " + mask);
					}
					for (i = j = 32; j >= 0; i = --j) if (this.maskLong === 4294967295 << 32 - i >>> 0) {
						this.bitmask = i;
						break;
					}
				} else if (mask || mask === 0) {
					this.bitmask = parseInt(mask, 10);
					this.maskLong = 0;
					if (this.bitmask > 0) this.maskLong = 4294967295 << 32 - this.bitmask >>> 0;
				} else throw new Error("Invalid mask: empty");
				try {
					this.netLong = (ip2long(net$10) & this.maskLong) >>> 0;
				} catch (error1) {
					throw new Error("Invalid net address: " + net$10);
				}
				if (!(this.bitmask <= 32)) throw new Error("Invalid mask for ip4: " + mask);
				this.size = Math.pow(2, 32 - this.bitmask);
				this.base = long2ip(this.netLong);
				this.mask = long2ip(this.maskLong);
				this.hostmask = long2ip(~this.maskLong);
				this.first = this.bitmask <= 30 ? long2ip(this.netLong + 1) : this.base;
				this.last = this.bitmask <= 30 ? long2ip(this.netLong + this.size - 2) : long2ip(this.netLong + this.size - 1);
				this.broadcast = this.bitmask <= 30 ? long2ip(this.netLong + this.size - 1) : void 0;
			}
			Netmask$1.prototype.contains = function(ip) {
				if (typeof ip === "string" && (ip.indexOf("/") > 0 || ip.split(".").length !== 4)) ip = new Netmask$1(ip);
				if (ip instanceof Netmask$1) return this.contains(ip.base) && this.contains(ip.broadcast || ip.last);
				else return (ip2long(ip) & this.maskLong) >>> 0 === (this.netLong & this.maskLong) >>> 0;
			};
			Netmask$1.prototype.next = function(count) {
				if (count == null) count = 1;
				return new Netmask$1(long2ip(this.netLong + this.size * count), this.mask);
			};
			Netmask$1.prototype.forEach = function(fn) {
				var index, lastLong, long = ip2long(this.first);
				lastLong = ip2long(this.last);
				index = 0;
				while (long <= lastLong) {
					fn(long2ip(long), long, index);
					index++;
					long++;
				}
			};
			Netmask$1.prototype.toString = function() {
				return this.base + "/" + this.bitmask;
			};
			return Netmask$1;
		})();
		exports.ip2long = ip2long;
		exports.long2ip = long2ip;
		exports.Netmask = Netmask;
	}).call(exports);
}));
var require_isInNet = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var netmask_1 = require_netmask();
	var util_1$2 = require_util();
	async function isInNet(host, pattern, mask) {
		const family = 4;
		try {
			const ip = await (0, util_1$2.dnsLookup)(host, { family });
			if (typeof ip === "string") return new netmask_1.Netmask(pattern, mask).contains(ip);
		} catch (err) {}
		return false;
	}
	exports.default = isInNet;
}));
var require_isPlainHostName = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function isPlainHostName(host) {
		return !/\./.test(host);
	}
	exports.default = isPlainHostName;
}));
var require_isResolvable = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var util_1$1 = require_util();
	async function isResolvable(host) {
		const family = 4;
		try {
			if (await (0, util_1$1.dnsLookup)(host, { family })) return true;
		} catch (err) {}
		return false;
	}
	exports.default = isResolvable;
}));
var require_localHostOrDomainIs = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function localHostOrDomainIs(host, hostdom) {
		const parts = host.split(".");
		const domparts = hostdom.split(".");
		let matches = true;
		for (let i = 0; i < parts.length; i++) if (parts[i] !== domparts[i]) {
			matches = false;
			break;
		}
		return matches;
	}
	exports.default = localHostOrDomainIs;
}));
var require_ip = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$4 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ip = void 0;
	var os_1 = __importDefault$4(require("os"));
	exports.ip = {
		address() {
			const interfaces = os_1.default.networkInterfaces();
			const family = normalizeFamily();
			const all = Object.values(interfaces).map((addrs = []) => {
				const addresses = addrs.filter((details) => {
					if (normalizeFamily(details.family) !== family || exports.ip.isLoopback(details.address)) return false;
					return true;
				});
				return addresses.length ? addresses[0].address : void 0;
			}).filter(Boolean);
			return !all.length ? exports.ip.loopback(family) : all[0];
		},
		isLoopback(addr) {
			return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr);
		},
		loopback(family) {
			family = normalizeFamily(family);
			if (family !== "ipv4" && family !== "ipv6") throw new Error("family must be ipv4 or ipv6");
			return family === "ipv4" ? "127.0.0.1" : "fe80::1";
		}
	};
	function normalizeFamily(family) {
		if (family === 4) return "ipv4";
		if (family === 6) return "ipv6";
		return family ? family.toLowerCase() : "ipv4";
	}
}));
var require_myIpAddress = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$3 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	var ip_1 = require_ip();
	var net_1 = __importDefault$3(require("net"));
	async function myIpAddress() {
		return new Promise((resolve, reject) => {
			const socket = net_1.default.connect({
				host: "8.8.8.8",
				port: 53
			});
			const onError$1 = () => {
				resolve(ip_1.ip.address());
			};
			socket.once("error", onError$1);
			socket.once("connect", () => {
				socket.removeListener("error", onError$1);
				const addr = socket.address();
				socket.destroy();
				if (typeof addr === "string") resolve(addr);
				else if (addr.address) resolve(addr.address);
				else reject(/* @__PURE__ */ new Error("Expected a `string`"));
			});
		});
	}
	exports.default = myIpAddress;
}));
var require_shExpMatch = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function shExpMatch(str, shexp) {
		return toRegExp(shexp).test(str);
	}
	exports.default = shExpMatch;
	function toRegExp(str) {
		str = String(str).replace(/\./g, "\\.").replace(/\?/g, ".").replace(/\*/g, ".*");
		return /* @__PURE__ */ new RegExp(`^${str}$`);
	}
}));
var require_timeRange = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	function timeRange() {
		const args = Array.prototype.slice.call(arguments);
		const lastArg = args.pop();
		const useGMTzone = lastArg === "GMT";
		const currentDate = /* @__PURE__ */ new Date();
		if (!useGMTzone) args.push(lastArg);
		let result = false;
		const noOfArgs = args.length;
		const numericArgs = args.map((n$1) => parseInt(n$1, 10));
		if (noOfArgs === 1) result = getCurrentHour(useGMTzone, currentDate) === numericArgs[0];
		else if (noOfArgs === 2) {
			const currentHour = getCurrentHour(useGMTzone, currentDate);
			result = numericArgs[0] <= currentHour && currentHour < numericArgs[1];
		} else if (noOfArgs === 4) result = valueInRange$1(secondsElapsedToday(numericArgs[0], numericArgs[1], 0), secondsElapsedToday(getCurrentHour(useGMTzone, currentDate), getCurrentMinute(useGMTzone, currentDate), 0), secondsElapsedToday(numericArgs[2], numericArgs[3], 59));
		else if (noOfArgs === 6) result = valueInRange$1(secondsElapsedToday(numericArgs[0], numericArgs[1], numericArgs[2]), secondsElapsedToday(getCurrentHour(useGMTzone, currentDate), getCurrentMinute(useGMTzone, currentDate), getCurrentSecond(useGMTzone, currentDate)), secondsElapsedToday(numericArgs[3], numericArgs[4], numericArgs[5]));
		return result;
	}
	exports.default = timeRange;
	function secondsElapsedToday(hh, mm, ss) {
		return hh * 3600 + mm * 60 + ss;
	}
	function getCurrentHour(gmt, currentDate) {
		return gmt ? currentDate.getUTCHours() : currentDate.getHours();
	}
	function getCurrentMinute(gmt, currentDate) {
		return gmt ? currentDate.getUTCMinutes() : currentDate.getMinutes();
	}
	function getCurrentSecond(gmt, currentDate) {
		return gmt ? currentDate.getUTCSeconds() : currentDate.getSeconds();
	}
	function valueInRange$1(start, value, finish) {
		return start <= value && value <= finish;
	}
}));
var require_weekdayRange = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var util_1 = require_util();
	var weekdays = [
		"SUN",
		"MON",
		"TUE",
		"WED",
		"THU",
		"FRI",
		"SAT"
	];
	function weekdayRange(wd1, wd2, gmt) {
		let useGMTzone = false;
		let wd1Index = -1;
		let wd2Index = -1;
		let wd2IsGmt = false;
		if ((0, util_1.isGMT)(gmt)) useGMTzone = true;
		else if ((0, util_1.isGMT)(wd2)) {
			useGMTzone = true;
			wd2IsGmt = true;
		}
		wd1Index = weekdays.indexOf(wd1);
		if (!wd2IsGmt && isWeekday(wd2)) wd2Index = weekdays.indexOf(wd2);
		const todaysDay = getTodaysDay(useGMTzone);
		let result;
		if (wd2Index < 0) result = todaysDay === wd1Index;
		else if (wd1Index <= wd2Index) result = valueInRange(wd1Index, todaysDay, wd2Index);
		else result = valueInRange(wd1Index, todaysDay, 6) || valueInRange(0, todaysDay, wd2Index);
		return result;
	}
	exports.default = weekdayRange;
	function getTodaysDay(gmt) {
		return gmt ? (/* @__PURE__ */ new Date()).getUTCDay() : (/* @__PURE__ */ new Date()).getDay();
	}
	function valueInRange(start, value, finish) {
		return start <= value && value <= finish;
	}
	function isWeekday(v) {
		if (!v) return false;
		return weekdays.includes(v);
	}
}));
var require_dist$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __importDefault$2 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.sandbox = exports.createPacResolver = void 0;
	var degenerator_1 = require_dist$4();
	var dateRange_1 = __importDefault$2(require_dateRange());
	var dnsDomainIs_1 = __importDefault$2(require_dnsDomainIs());
	var dnsDomainLevels_1 = __importDefault$2(require_dnsDomainLevels());
	var dnsResolve_1 = __importDefault$2(require_dnsResolve());
	var isInNet_1 = __importDefault$2(require_isInNet());
	var isPlainHostName_1 = __importDefault$2(require_isPlainHostName());
	var isResolvable_1 = __importDefault$2(require_isResolvable());
	var localHostOrDomainIs_1 = __importDefault$2(require_localHostOrDomainIs());
	var myIpAddress_1 = __importDefault$2(require_myIpAddress());
	var shExpMatch_1 = __importDefault$2(require_shExpMatch());
	var timeRange_1 = __importDefault$2(require_timeRange());
	var weekdayRange_1 = __importDefault$2(require_weekdayRange());
	function createPacResolver(qjs, _str, _opts = {}) {
		const str = Buffer.isBuffer(_str) ? _str.toString("utf8") : _str;
		const context = {
			...exports.sandbox,
			..._opts.sandbox
		};
		const opts = {
			filename: "proxy.pac",
			names: Object.keys(context).filter((k) => isAsyncFunction(context[k])),
			..._opts,
			sandbox: context
		};
		const resolver = (0, degenerator_1.compile)(qjs, str, "FindProxyForURL", opts);
		function FindProxyForURL(url$3, _host) {
			const urlObj = typeof url$3 === "string" ? new URL(url$3) : url$3;
			const host = _host || urlObj.hostname;
			if (!host) throw new TypeError("Could not determine `host`");
			return resolver(urlObj.href, host);
		}
		Object.defineProperty(FindProxyForURL, "toString", {
			value: () => resolver.toString(),
			enumerable: false
		});
		return FindProxyForURL;
	}
	exports.createPacResolver = createPacResolver;
	exports.sandbox = Object.freeze({
		alert: (message = "") => console.log("%s", message),
		dateRange: dateRange_1.default,
		dnsDomainIs: dnsDomainIs_1.default,
		dnsDomainLevels: dnsDomainLevels_1.default,
		dnsResolve: dnsResolve_1.default,
		isInNet: isInNet_1.default,
		isPlainHostName: isPlainHostName_1.default,
		isResolvable: isResolvable_1.default,
		localHostOrDomainIs: localHostOrDomainIs_1.default,
		myIpAddress: myIpAddress_1.default,
		shExpMatch: shExpMatch_1.default,
		timeRange: timeRange_1.default,
		weekdayRange: weekdayRange_1.default
	});
	function isAsyncFunction(v) {
		if (typeof v !== "function") return false;
		if (v.constructor.name === "AsyncFunction") return true;
		if (String(v).indexOf("__awaiter(") !== -1) return true;
		return Boolean(v.async);
	}
}));
var require_esmHelpers = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.unwrapJavascript = exports.unwrapTypescript = void 0;
	function fakeUnwrapDefault(mod) {
		return mod.default;
	}
	function actualUnwrapDefault(mod) {
		return mod.default ?? mod;
	}
	exports.unwrapTypescript = actualUnwrapDefault;
	exports.unwrapJavascript = fakeUnwrapDefault;
}));
var require_debug = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.debugLog = exports.QTS_DEBUG = void 0;
	exports.QTS_DEBUG = Boolean(typeof process === "object" && process.env.QTS_DEBUG);
	exports.debugLog = exports.QTS_DEBUG ? console.log.bind(console) : () => {};
}));
var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSMemoryLeakDetected = exports.QuickJSAsyncifySuspended = exports.QuickJSAsyncifyError = exports.QuickJSNotImplemented = exports.QuickJSUseAfterFree = exports.QuickJSWrongOwner = exports.QuickJSUnwrapError = void 0;
	var QuickJSUnwrapError = class extends Error {
		constructor(cause, context) {
			super(String(cause));
			this.cause = cause;
			this.context = context;
			this.name = "QuickJSUnwrapError";
		}
	};
	exports.QuickJSUnwrapError = QuickJSUnwrapError;
	var QuickJSWrongOwner = class extends Error {
		constructor() {
			super(...arguments);
			this.name = "QuickJSWrongOwner";
		}
	};
	exports.QuickJSWrongOwner = QuickJSWrongOwner;
	var QuickJSUseAfterFree = class extends Error {
		constructor() {
			super(...arguments);
			this.name = "QuickJSUseAfterFree";
		}
	};
	exports.QuickJSUseAfterFree = QuickJSUseAfterFree;
	var QuickJSNotImplemented = class extends Error {
		constructor() {
			super(...arguments);
			this.name = "QuickJSNotImplemented";
		}
	};
	exports.QuickJSNotImplemented = QuickJSNotImplemented;
	var QuickJSAsyncifyError = class extends Error {
		constructor() {
			super(...arguments);
			this.name = "QuickJSAsyncifyError";
		}
	};
	exports.QuickJSAsyncifyError = QuickJSAsyncifyError;
	var QuickJSAsyncifySuspended = class extends Error {
		constructor() {
			super(...arguments);
			this.name = "QuickJSAsyncifySuspended";
		}
	};
	exports.QuickJSAsyncifySuspended = QuickJSAsyncifySuspended;
	var QuickJSMemoryLeakDetected = class extends Error {
		constructor() {
			super(...arguments);
			this.name = "QuickJSMemoryLeakDetected";
		}
	};
	exports.QuickJSMemoryLeakDetected = QuickJSMemoryLeakDetected;
}));
var require_asyncify_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.awaitEachYieldedPromise = exports.maybeAsync = exports.maybeAsyncFn = void 0;
	function* awaitYield(value) {
		return yield value;
	}
	function awaitYieldOf(generator) {
		return awaitYield(awaitEachYieldedPromise(generator));
	}
	var AwaitYield = awaitYield;
	AwaitYield.of = awaitYieldOf;
	function maybeAsyncFn(that, fn) {
		return (...args) => {
			return awaitEachYieldedPromise(fn.call(that, AwaitYield, ...args));
		};
	}
	exports.maybeAsyncFn = maybeAsyncFn;
	function maybeAsync(that, startGenerator) {
		return awaitEachYieldedPromise(startGenerator.call(that, AwaitYield));
	}
	exports.maybeAsync = maybeAsync;
	function awaitEachYieldedPromise(gen) {
		function handleNextStep(step) {
			if (step.done) return step.value;
			if (step.value instanceof Promise) return step.value.then((value) => handleNextStep(gen.next(value)), (error) => handleNextStep(gen.throw(error)));
			return handleNextStep(gen.next(step.value));
		}
		return handleNextStep(gen.next());
	}
	exports.awaitEachYieldedPromise = awaitEachYieldedPromise;
}));
var require_lifetime = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.Scope = exports.WeakLifetime = exports.StaticLifetime = exports.Lifetime = void 0;
	var asyncify_helpers_1$1 = require_asyncify_helpers();
	var debug_1$6 = require_debug();
	var errors_1$5 = require_errors();
	var Lifetime = class Lifetime {
		constructor(_value, copier, disposer, _owner) {
			this._value = _value;
			this.copier = copier;
			this.disposer = disposer;
			this._owner = _owner;
			this._alive = true;
			this._constructorStack = debug_1$6.QTS_DEBUG ? (/* @__PURE__ */ new Error("Lifetime constructed")).stack : void 0;
		}
		get alive() {
			return this._alive;
		}
		get value() {
			this.assertAlive();
			return this._value;
		}
		get owner() {
			return this._owner;
		}
		get dupable() {
			return !!this.copier;
		}
		dup() {
			this.assertAlive();
			if (!this.copier) throw new Error("Non-dupable lifetime");
			return new Lifetime(this.copier(this._value), this.copier, this.disposer, this._owner);
		}
		consume(map) {
			this.assertAlive();
			const result = map(this);
			this.dispose();
			return result;
		}
		dispose() {
			this.assertAlive();
			if (this.disposer) this.disposer(this._value);
			this._alive = false;
		}
		assertAlive() {
			if (!this.alive) {
				if (this._constructorStack) throw new errors_1$5.QuickJSUseAfterFree(`Lifetime not alive\n${this._constructorStack}\nLifetime used`);
				throw new errors_1$5.QuickJSUseAfterFree("Lifetime not alive");
			}
		}
	};
	exports.Lifetime = Lifetime;
	var StaticLifetime = class extends Lifetime {
		constructor(value, owner) {
			super(value, void 0, void 0, owner);
		}
		get dupable() {
			return true;
		}
		dup() {
			return this;
		}
		dispose() {}
	};
	exports.StaticLifetime = StaticLifetime;
	var WeakLifetime = class extends Lifetime {
		constructor(value, copier, disposer, owner) {
			super(value, copier, disposer, owner);
		}
		dispose() {
			this._alive = false;
		}
	};
	exports.WeakLifetime = WeakLifetime;
	function scopeFinally(scope, blockError) {
		let disposeError;
		try {
			scope.dispose();
		} catch (error) {
			disposeError = error;
		}
		if (blockError && disposeError) {
			Object.assign(blockError, {
				message: `${blockError.message}\n Then, failed to dispose scope: ${disposeError.message}`,
				disposeError
			});
			throw blockError;
		}
		if (blockError || disposeError) throw blockError || disposeError;
	}
	exports.Scope = class Scope {
		constructor() {
			this._disposables = new Lifetime(/* @__PURE__ */ new Set());
		}
		static withScope(block) {
			const scope = new Scope();
			let blockError;
			try {
				return block(scope);
			} catch (error) {
				blockError = error;
				throw error;
			} finally {
				scopeFinally(scope, blockError);
			}
		}
		static withScopeMaybeAsync(_this, block) {
			return (0, asyncify_helpers_1$1.maybeAsync)(void 0, function* (awaited) {
				const scope = new Scope();
				let blockError;
				try {
					return yield* awaited.of(block.call(_this, awaited, scope));
				} catch (error) {
					blockError = error;
					throw error;
				} finally {
					scopeFinally(scope, blockError);
				}
			});
		}
		static async withScopeAsync(block) {
			const scope = new Scope();
			let blockError;
			try {
				return await block(scope);
			} catch (error) {
				blockError = error;
				throw error;
			} finally {
				scopeFinally(scope, blockError);
			}
		}
		manage(lifetime) {
			this._disposables.value.add(lifetime);
			return lifetime;
		}
		get alive() {
			return this._disposables.alive;
		}
		dispose() {
			const lifetimes = Array.from(this._disposables.value.values()).reverse();
			for (const lifetime of lifetimes) if (lifetime.alive) lifetime.dispose();
			this._disposables.dispose();
		}
	};
}));
var require_deferred_promise = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSDeferredPromise = void 0;
	var QuickJSDeferredPromise = class {
		constructor(args) {
			this.resolve = (value) => {
				if (!this.resolveHandle.alive) return;
				this.context.unwrapResult(this.context.callFunction(this.resolveHandle, this.context.undefined, value || this.context.undefined)).dispose();
				this.disposeResolvers();
				this.onSettled();
			};
			this.reject = (value) => {
				if (!this.rejectHandle.alive) return;
				this.context.unwrapResult(this.context.callFunction(this.rejectHandle, this.context.undefined, value || this.context.undefined)).dispose();
				this.disposeResolvers();
				this.onSettled();
			};
			this.dispose = () => {
				if (this.handle.alive) this.handle.dispose();
				this.disposeResolvers();
			};
			this.context = args.context;
			this.owner = args.context.runtime;
			this.handle = args.promiseHandle;
			this.settled = new Promise((resolve) => {
				this.onSettled = resolve;
			});
			this.resolveHandle = args.resolveHandle;
			this.rejectHandle = args.rejectHandle;
		}
		get alive() {
			return this.handle.alive || this.resolveHandle.alive || this.rejectHandle.alive;
		}
		disposeResolvers() {
			if (this.resolveHandle.alive) this.resolveHandle.dispose();
			if (this.rejectHandle.alive) this.rejectHandle.dispose();
		}
	};
	exports.QuickJSDeferredPromise = QuickJSDeferredPromise;
}));
var require_memory = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ModuleMemory = void 0;
	var lifetime_1$5 = require_lifetime();
	var ModuleMemory = class {
		constructor(module$1) {
			this.module = module$1;
		}
		toPointerArray(handleArray) {
			const typedArray = new Int32Array(handleArray.map((handle) => handle.value));
			const numBytes = typedArray.length * typedArray.BYTES_PER_ELEMENT;
			const ptr = this.module._malloc(numBytes);
			new Uint8Array(this.module.HEAPU8.buffer, ptr, numBytes).set(new Uint8Array(typedArray.buffer));
			return new lifetime_1$5.Lifetime(ptr, void 0, (ptr$1) => this.module._free(ptr$1));
		}
		newMutablePointerArray(length) {
			const zeros = new Int32Array(new Array(length).fill(0));
			const numBytes = zeros.length * zeros.BYTES_PER_ELEMENT;
			const ptr = this.module._malloc(numBytes);
			const typedArray = new Int32Array(this.module.HEAPU8.buffer, ptr, length);
			typedArray.set(zeros);
			return new lifetime_1$5.Lifetime({
				typedArray,
				ptr
			}, void 0, (value) => this.module._free(value.ptr));
		}
		newHeapCharPointer(string) {
			const numBytes = this.module.lengthBytesUTF8(string) + 1;
			const ptr = this.module._malloc(numBytes);
			this.module.stringToUTF8(string, ptr, numBytes);
			return new lifetime_1$5.Lifetime(ptr, void 0, (value) => this.module._free(value));
		}
		consumeHeapCharPointer(ptr) {
			const str = this.module.UTF8ToString(ptr);
			this.module._free(ptr);
			return str;
		}
	};
	exports.ModuleMemory = ModuleMemory;
}));
var require_types_ffi = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.EvalFlags = exports.assertSync = void 0;
	function assertSync(fn) {
		return function mustBeSync(...args) {
			const result = fn(...args);
			if (result && typeof result === "object" && result instanceof Promise) throw new Error("Function unexpectedly returned a Promise");
			return result;
		};
	}
	exports.assertSync = assertSync;
	exports.EvalFlags = {
		JS_EVAL_TYPE_GLOBAL: 0,
		JS_EVAL_TYPE_MODULE: 1,
		JS_EVAL_TYPE_DIRECT: 2,
		JS_EVAL_TYPE_INDIRECT: 3,
		JS_EVAL_TYPE_MASK: 3,
		JS_EVAL_FLAG_STRICT: 8,
		JS_EVAL_FLAG_STRIP: 16,
		JS_EVAL_FLAG_COMPILE_ONLY: 32,
		JS_EVAL_FLAG_BACKTRACE_BARRIER: 64
	};
}));
var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.concat = exports.evalOptionsToFlags = exports.DefaultIntrinsics = void 0;
	var types_ffi_1 = require_types_ffi();
	exports.DefaultIntrinsics = Symbol("DefaultIntrinsics");
	function evalOptionsToFlags(evalOptions) {
		if (typeof evalOptions === "number") return evalOptions;
		if (evalOptions === void 0) return 0;
		const { type, strict, strip, compileOnly, backtraceBarrier } = evalOptions;
		let flags = 0;
		if (type === "global") flags |= types_ffi_1.EvalFlags.JS_EVAL_TYPE_GLOBAL;
		if (type === "module") flags |= types_ffi_1.EvalFlags.JS_EVAL_TYPE_MODULE;
		if (strict) flags |= types_ffi_1.EvalFlags.JS_EVAL_FLAG_STRICT;
		if (strip) flags |= types_ffi_1.EvalFlags.JS_EVAL_FLAG_STRIP;
		if (compileOnly) flags |= types_ffi_1.EvalFlags.JS_EVAL_FLAG_COMPILE_ONLY;
		if (backtraceBarrier) flags |= types_ffi_1.EvalFlags.JS_EVAL_FLAG_BACKTRACE_BARRIER;
		return flags;
	}
	exports.evalOptionsToFlags = evalOptionsToFlags;
	function concat(...values) {
		let result = [];
		for (const value of values) if (value !== void 0) result = result.concat(value);
		return result;
	}
	exports.concat = concat;
}));
var require_context = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSContext = void 0;
	var debug_1$5 = require_debug();
	var deferred_promise_1 = require_deferred_promise();
	var errors_1$4 = require_errors();
	var lifetime_1$4 = require_lifetime();
	var memory_1$1 = require_memory();
	var types_1$4 = require_types();
	var ContextMemory = class extends memory_1$1.ModuleMemory {
		constructor(args) {
			super(args.module);
			this.scope = new lifetime_1$4.Scope();
			this.copyJSValue = (ptr) => {
				return this.ffi.QTS_DupValuePointer(this.ctx.value, ptr);
			};
			this.freeJSValue = (ptr) => {
				this.ffi.QTS_FreeValuePointer(this.ctx.value, ptr);
			};
			args.ownedLifetimes?.forEach((lifetime) => this.scope.manage(lifetime));
			this.owner = args.owner;
			this.module = args.module;
			this.ffi = args.ffi;
			this.rt = args.rt;
			this.ctx = this.scope.manage(args.ctx);
		}
		get alive() {
			return this.scope.alive;
		}
		dispose() {
			return this.scope.dispose();
		}
		manage(lifetime) {
			return this.scope.manage(lifetime);
		}
		consumeJSCharPointer(ptr) {
			const str = this.module.UTF8ToString(ptr);
			this.ffi.QTS_FreeCString(this.ctx.value, ptr);
			return str;
		}
		heapValueHandle(ptr) {
			return new lifetime_1$4.Lifetime(ptr, this.copyJSValue, this.freeJSValue, this.owner);
		}
	};
	var QuickJSContext = class {
		constructor(args) {
			this._undefined = void 0;
			this._null = void 0;
			this._false = void 0;
			this._true = void 0;
			this._global = void 0;
			this._BigInt = void 0;
			this.fnNextId = -32768;
			this.fnMaps = /* @__PURE__ */ new Map();
			this.cToHostCallbacks = { callFunction: (ctx, this_ptr, argc, argv, fn_id) => {
				if (ctx !== this.ctx.value) throw new Error("QuickJSContext instance received C -> JS call with mismatched ctx");
				const fn = this.getFunction(fn_id);
				if (!fn) throw new Error(`QuickJSContext had no callback with id ${fn_id}`);
				return lifetime_1$4.Scope.withScopeMaybeAsync(this, function* (awaited, scope) {
					const thisHandle = scope.manage(new lifetime_1$4.WeakLifetime(this_ptr, this.memory.copyJSValue, this.memory.freeJSValue, this.runtime));
					const argHandles = new Array(argc);
					for (let i = 0; i < argc; i++) {
						const ptr = this.ffi.QTS_ArgvGetJSValueConstPointer(argv, i);
						argHandles[i] = scope.manage(new lifetime_1$4.WeakLifetime(ptr, this.memory.copyJSValue, this.memory.freeJSValue, this.runtime));
					}
					try {
						const result = yield* awaited(fn.apply(thisHandle, argHandles));
						if (result) {
							if ("error" in result && result.error) {
								(0, debug_1$5.debugLog)("throw error", result.error);
								throw result.error;
							}
							const handle = scope.manage(result instanceof lifetime_1$4.Lifetime ? result : result.value);
							return this.ffi.QTS_DupValuePointer(this.ctx.value, handle.value);
						}
						return 0;
					} catch (error) {
						return this.errorToHandle(error).consume((errorHandle) => this.ffi.QTS_Throw(this.ctx.value, errorHandle.value));
					}
				});
			} };
			this.runtime = args.runtime;
			this.module = args.module;
			this.ffi = args.ffi;
			this.rt = args.rt;
			this.ctx = args.ctx;
			this.memory = new ContextMemory({
				...args,
				owner: this.runtime
			});
			args.callbacks.setContextCallbacks(this.ctx.value, this.cToHostCallbacks);
			this.dump = this.dump.bind(this);
			this.getString = this.getString.bind(this);
			this.getNumber = this.getNumber.bind(this);
			this.resolvePromise = this.resolvePromise.bind(this);
		}
		get alive() {
			return this.memory.alive;
		}
		dispose() {
			this.memory.dispose();
		}
		get undefined() {
			if (this._undefined) return this._undefined;
			const ptr = this.ffi.QTS_GetUndefined();
			return this._undefined = new lifetime_1$4.StaticLifetime(ptr);
		}
		get null() {
			if (this._null) return this._null;
			const ptr = this.ffi.QTS_GetNull();
			return this._null = new lifetime_1$4.StaticLifetime(ptr);
		}
		get true() {
			if (this._true) return this._true;
			const ptr = this.ffi.QTS_GetTrue();
			return this._true = new lifetime_1$4.StaticLifetime(ptr);
		}
		get false() {
			if (this._false) return this._false;
			const ptr = this.ffi.QTS_GetFalse();
			return this._false = new lifetime_1$4.StaticLifetime(ptr);
		}
		get global() {
			if (this._global) return this._global;
			const ptr = this.ffi.QTS_GetGlobalObject(this.ctx.value);
			this.memory.manage(this.memory.heapValueHandle(ptr));
			this._global = new lifetime_1$4.StaticLifetime(ptr, this.runtime);
			return this._global;
		}
		newNumber(num) {
			return this.memory.heapValueHandle(this.ffi.QTS_NewFloat64(this.ctx.value, num));
		}
		newString(str) {
			const ptr = this.memory.newHeapCharPointer(str).consume((charHandle) => this.ffi.QTS_NewString(this.ctx.value, charHandle.value));
			return this.memory.heapValueHandle(ptr);
		}
		newUniqueSymbol(description$1) {
			const key = (typeof description$1 === "symbol" ? description$1.description : description$1) ?? "";
			const ptr = this.memory.newHeapCharPointer(key).consume((charHandle) => this.ffi.QTS_NewSymbol(this.ctx.value, charHandle.value, 0));
			return this.memory.heapValueHandle(ptr);
		}
		newSymbolFor(key) {
			const description$1 = (typeof key === "symbol" ? key.description : key) ?? "";
			const ptr = this.memory.newHeapCharPointer(description$1).consume((charHandle) => this.ffi.QTS_NewSymbol(this.ctx.value, charHandle.value, 1));
			return this.memory.heapValueHandle(ptr);
		}
		newBigInt(num) {
			if (!this._BigInt) {
				const bigIntHandle$1 = this.getProp(this.global, "BigInt");
				this.memory.manage(bigIntHandle$1);
				this._BigInt = new lifetime_1$4.StaticLifetime(bigIntHandle$1.value, this.runtime);
			}
			const bigIntHandle = this._BigInt;
			const asString = String(num);
			return this.newString(asString).consume((handle) => this.unwrapResult(this.callFunction(bigIntHandle, this.undefined, handle)));
		}
		newObject(prototype$1) {
			if (prototype$1) this.runtime.assertOwned(prototype$1);
			const ptr = prototype$1 ? this.ffi.QTS_NewObjectProto(this.ctx.value, prototype$1.value) : this.ffi.QTS_NewObject(this.ctx.value);
			return this.memory.heapValueHandle(ptr);
		}
		newArray() {
			const ptr = this.ffi.QTS_NewArray(this.ctx.value);
			return this.memory.heapValueHandle(ptr);
		}
		newPromise(value) {
			const deferredPromise = lifetime_1$4.Scope.withScope((scope) => {
				const mutablePointerArray = scope.manage(this.memory.newMutablePointerArray(2));
				const promisePtr = this.ffi.QTS_NewPromiseCapability(this.ctx.value, mutablePointerArray.value.ptr);
				const promiseHandle = this.memory.heapValueHandle(promisePtr);
				const [resolveHandle, rejectHandle] = Array.from(mutablePointerArray.value.typedArray).map((jsvaluePtr) => this.memory.heapValueHandle(jsvaluePtr));
				return new deferred_promise_1.QuickJSDeferredPromise({
					context: this,
					promiseHandle,
					resolveHandle,
					rejectHandle
				});
			});
			if (value && typeof value === "function") value = new Promise(value);
			if (value) Promise.resolve(value).then(deferredPromise.resolve, (error) => error instanceof lifetime_1$4.Lifetime ? deferredPromise.reject(error) : this.newError(error).consume(deferredPromise.reject));
			return deferredPromise;
		}
		newFunction(name$1, fn) {
			const fnId = ++this.fnNextId;
			this.setFunction(fnId, fn);
			return this.memory.heapValueHandle(this.ffi.QTS_NewFunction(this.ctx.value, fnId, name$1));
		}
		newError(error) {
			const errorHandle = this.memory.heapValueHandle(this.ffi.QTS_NewError(this.ctx.value));
			if (error && typeof error === "object") {
				if (error.name !== void 0) this.newString(error.name).consume((handle) => this.setProp(errorHandle, "name", handle));
				if (error.message !== void 0) this.newString(error.message).consume((handle) => this.setProp(errorHandle, "message", handle));
			} else if (typeof error === "string") this.newString(error).consume((handle) => this.setProp(errorHandle, "message", handle));
			else if (error !== void 0) this.newString(String(error)).consume((handle) => this.setProp(errorHandle, "message", handle));
			return errorHandle;
		}
		typeof(handle) {
			this.runtime.assertOwned(handle);
			return this.memory.consumeHeapCharPointer(this.ffi.QTS_Typeof(this.ctx.value, handle.value));
		}
		getNumber(handle) {
			this.runtime.assertOwned(handle);
			return this.ffi.QTS_GetFloat64(this.ctx.value, handle.value);
		}
		getString(handle) {
			this.runtime.assertOwned(handle);
			return this.memory.consumeJSCharPointer(this.ffi.QTS_GetString(this.ctx.value, handle.value));
		}
		getSymbol(handle) {
			this.runtime.assertOwned(handle);
			const key = this.memory.consumeJSCharPointer(this.ffi.QTS_GetSymbolDescriptionOrKey(this.ctx.value, handle.value));
			return this.ffi.QTS_IsGlobalSymbol(this.ctx.value, handle.value) ? Symbol.for(key) : Symbol(key);
		}
		getBigInt(handle) {
			this.runtime.assertOwned(handle);
			const asString = this.getString(handle);
			return BigInt(asString);
		}
		resolvePromise(promiseLikeHandle) {
			this.runtime.assertOwned(promiseLikeHandle);
			const vmResolveResult = lifetime_1$4.Scope.withScope((scope) => {
				const vmPromise = scope.manage(this.getProp(this.global, "Promise"));
				const vmPromiseResolve = scope.manage(this.getProp(vmPromise, "resolve"));
				return this.callFunction(vmPromiseResolve, vmPromise, promiseLikeHandle);
			});
			if (vmResolveResult.error) return Promise.resolve(vmResolveResult);
			return new Promise((resolve) => {
				lifetime_1$4.Scope.withScope((scope) => {
					const resolveHandle = scope.manage(this.newFunction("resolve", (value) => {
						resolve({ value: value && value.dup() });
					}));
					const rejectHandle = scope.manage(this.newFunction("reject", (error) => {
						resolve({ error: error && error.dup() });
					}));
					const promiseHandle = scope.manage(vmResolveResult.value);
					const promiseThenHandle = scope.manage(this.getProp(promiseHandle, "then"));
					this.unwrapResult(this.callFunction(promiseThenHandle, promiseHandle, resolveHandle, rejectHandle)).dispose();
				});
			});
		}
		getProp(handle, key) {
			this.runtime.assertOwned(handle);
			const ptr = this.borrowPropertyKey(key).consume((quickJSKey) => this.ffi.QTS_GetProp(this.ctx.value, handle.value, quickJSKey.value));
			return this.memory.heapValueHandle(ptr);
		}
		setProp(handle, key, value) {
			this.runtime.assertOwned(handle);
			this.borrowPropertyKey(key).consume((quickJSKey) => this.ffi.QTS_SetProp(this.ctx.value, handle.value, quickJSKey.value, value.value));
		}
		defineProp(handle, key, descriptor) {
			this.runtime.assertOwned(handle);
			lifetime_1$4.Scope.withScope((scope) => {
				const quickJSKey = scope.manage(this.borrowPropertyKey(key));
				const value = descriptor.value || this.undefined;
				const configurable = Boolean(descriptor.configurable);
				const enumerable = Boolean(descriptor.enumerable);
				const hasValue = Boolean(descriptor.value);
				const get = descriptor.get ? scope.manage(this.newFunction(descriptor.get.name, descriptor.get)) : this.undefined;
				const set = descriptor.set ? scope.manage(this.newFunction(descriptor.set.name, descriptor.set)) : this.undefined;
				this.ffi.QTS_DefineProp(this.ctx.value, handle.value, quickJSKey.value, value.value, get.value, set.value, configurable, enumerable, hasValue);
			});
		}
		callFunction(func, thisVal, ...args) {
			this.runtime.assertOwned(func);
			const resultPtr = this.memory.toPointerArray(args).consume((argsArrayPtr) => this.ffi.QTS_Call(this.ctx.value, func.value, thisVal.value, args.length, argsArrayPtr.value));
			const errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr);
			if (errorPtr) {
				this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr);
				return { error: this.memory.heapValueHandle(errorPtr) };
			}
			return { value: this.memory.heapValueHandle(resultPtr) };
		}
		evalCode(code, filename = "eval.js", options) {
			const detectModule = options === void 0 ? 1 : 0;
			const flags = (0, types_1$4.evalOptionsToFlags)(options);
			const resultPtr = this.memory.newHeapCharPointer(code).consume((charHandle) => this.ffi.QTS_Eval(this.ctx.value, charHandle.value, filename, detectModule, flags));
			const errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr);
			if (errorPtr) {
				this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr);
				return { error: this.memory.heapValueHandle(errorPtr) };
			}
			return { value: this.memory.heapValueHandle(resultPtr) };
		}
		throw(error) {
			return this.errorToHandle(error).consume((handle) => this.ffi.QTS_Throw(this.ctx.value, handle.value));
		}
		borrowPropertyKey(key) {
			if (typeof key === "number") return this.newNumber(key);
			if (typeof key === "string") return this.newString(key);
			return new lifetime_1$4.StaticLifetime(key.value, this.runtime);
		}
		getMemory(rt) {
			if (rt === this.rt.value) return this.memory;
			else throw new Error("Private API. Cannot get memory from a different runtime");
		}
		dump(handle) {
			this.runtime.assertOwned(handle);
			const type = this.typeof(handle);
			if (type === "string") return this.getString(handle);
			else if (type === "number") return this.getNumber(handle);
			else if (type === "bigint") return this.getBigInt(handle);
			else if (type === "undefined") return;
			else if (type === "symbol") return this.getSymbol(handle);
			const str = this.memory.consumeJSCharPointer(this.ffi.QTS_Dump(this.ctx.value, handle.value));
			try {
				return JSON.parse(str);
			} catch (err) {
				return str;
			}
		}
		unwrapResult(result) {
			if (result.error) {
				const context = "context" in result.error ? result.error.context : this;
				const cause = result.error.consume((error) => this.dump(error));
				if (cause && typeof cause === "object" && typeof cause.message === "string") {
					const { message, name: name$1, stack } = cause;
					const exception = new errors_1$4.QuickJSUnwrapError("");
					const hostStack = exception.stack;
					if (typeof name$1 === "string") exception.name = cause.name;
					if (typeof stack === "string") exception.stack = `${name$1}: ${message}\n${cause.stack}Host: ${hostStack}`;
					Object.assign(exception, {
						cause,
						context,
						message
					});
					throw exception;
				}
				throw new errors_1$4.QuickJSUnwrapError(cause, context);
			}
			return result.value;
		}
		getFunction(fn_id) {
			const map_id = fn_id >> 8;
			const fnMap = this.fnMaps.get(map_id);
			if (!fnMap) return;
			return fnMap.get(fn_id);
		}
		setFunction(fn_id, handle) {
			const map_id = fn_id >> 8;
			let fnMap = this.fnMaps.get(map_id);
			if (!fnMap) {
				fnMap = /* @__PURE__ */ new Map();
				this.fnMaps.set(map_id, fnMap);
			}
			return fnMap.set(fn_id, handle);
		}
		errorToHandle(error) {
			if (error instanceof lifetime_1$4.Lifetime) return error;
			return this.newError(error);
		}
	};
	exports.QuickJSContext = QuickJSContext;
}));
var require_runtime = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSRuntime = void 0;
	var asyncify_helpers_1 = require_asyncify_helpers();
	var context_1$1 = require_context();
	var debug_1$4 = require_debug();
	var errors_1$3 = require_errors();
	var lifetime_1$3 = require_lifetime();
	var memory_1 = require_memory();
	var types_1$3 = require_types();
	var QuickJSRuntime = class {
		constructor(args) {
			this.scope = new lifetime_1$3.Scope();
			this.contextMap = /* @__PURE__ */ new Map();
			this.cToHostCallbacks = {
				shouldInterrupt: (rt) => {
					if (rt !== this.rt.value) throw new Error("QuickJSContext instance received C -> JS interrupt with mismatched rt");
					const fn = this.interruptHandler;
					if (!fn) throw new Error("QuickJSContext had no interrupt handler");
					return fn(this) ? 1 : 0;
				},
				loadModuleSource: (0, asyncify_helpers_1.maybeAsyncFn)(this, function* (awaited, rt, ctx, moduleName) {
					const moduleLoader = this.moduleLoader;
					if (!moduleLoader) throw new Error("Runtime has no module loader");
					if (rt !== this.rt.value) throw new Error("Runtime pointer mismatch");
					const context = this.contextMap.get(ctx) ?? this.newContext({ contextPointer: ctx });
					try {
						const result = yield* awaited(moduleLoader(moduleName, context));
						if (typeof result === "object" && "error" in result && result.error) {
							(0, debug_1$4.debugLog)("cToHostLoadModule: loader returned error", result.error);
							throw result.error;
						}
						const moduleSource = typeof result === "string" ? result : "value" in result ? result.value : result;
						return this.memory.newHeapCharPointer(moduleSource).value;
					} catch (error) {
						(0, debug_1$4.debugLog)("cToHostLoadModule: caught error", error);
						context.throw(error);
						return 0;
					}
				}),
				normalizeModule: (0, asyncify_helpers_1.maybeAsyncFn)(this, function* (awaited, rt, ctx, baseModuleName, moduleNameRequest) {
					const moduleNormalizer = this.moduleNormalizer;
					if (!moduleNormalizer) throw new Error("Runtime has no module normalizer");
					if (rt !== this.rt.value) throw new Error("Runtime pointer mismatch");
					const context = this.contextMap.get(ctx) ?? this.newContext({ contextPointer: ctx });
					try {
						const result = yield* awaited(moduleNormalizer(baseModuleName, moduleNameRequest, context));
						if (typeof result === "object" && "error" in result && result.error) {
							(0, debug_1$4.debugLog)("cToHostNormalizeModule: normalizer returned error", result.error);
							throw result.error;
						}
						const name$1 = typeof result === "string" ? result : result.value;
						return context.getMemory(this.rt.value).newHeapCharPointer(name$1).value;
					} catch (error) {
						(0, debug_1$4.debugLog)("normalizeModule: caught error", error);
						context.throw(error);
						return 0;
					}
				})
			};
			args.ownedLifetimes?.forEach((lifetime) => this.scope.manage(lifetime));
			this.module = args.module;
			this.memory = new memory_1.ModuleMemory(this.module);
			this.ffi = args.ffi;
			this.rt = args.rt;
			this.callbacks = args.callbacks;
			this.scope.manage(this.rt);
			this.callbacks.setRuntimeCallbacks(this.rt.value, this.cToHostCallbacks);
			this.executePendingJobs = this.executePendingJobs.bind(this);
		}
		get alive() {
			return this.scope.alive;
		}
		dispose() {
			return this.scope.dispose();
		}
		newContext(options = {}) {
			if (options.intrinsics && options.intrinsics !== types_1$3.DefaultIntrinsics) throw new Error("TODO: Custom intrinsics are not supported yet");
			const ctx = new lifetime_1$3.Lifetime(options.contextPointer || this.ffi.QTS_NewContext(this.rt.value), void 0, (ctx_ptr) => {
				this.contextMap.delete(ctx_ptr);
				this.callbacks.deleteContext(ctx_ptr);
				this.ffi.QTS_FreeContext(ctx_ptr);
			});
			const context = new context_1$1.QuickJSContext({
				module: this.module,
				ctx,
				ffi: this.ffi,
				rt: this.rt,
				ownedLifetimes: options.ownedLifetimes,
				runtime: this,
				callbacks: this.callbacks
			});
			this.contextMap.set(ctx.value, context);
			return context;
		}
		setModuleLoader(moduleLoader, moduleNormalizer) {
			this.moduleLoader = moduleLoader;
			this.moduleNormalizer = moduleNormalizer;
			this.ffi.QTS_RuntimeEnableModuleLoader(this.rt.value, this.moduleNormalizer ? 1 : 0);
		}
		removeModuleLoader() {
			this.moduleLoader = void 0;
			this.ffi.QTS_RuntimeDisableModuleLoader(this.rt.value);
		}
		hasPendingJob() {
			return Boolean(this.ffi.QTS_IsJobPending(this.rt.value));
		}
		setInterruptHandler(cb) {
			const prevInterruptHandler = this.interruptHandler;
			this.interruptHandler = cb;
			if (!prevInterruptHandler) this.ffi.QTS_RuntimeEnableInterruptHandler(this.rt.value);
		}
		removeInterruptHandler() {
			if (this.interruptHandler) {
				this.ffi.QTS_RuntimeDisableInterruptHandler(this.rt.value);
				this.interruptHandler = void 0;
			}
		}
		executePendingJobs(maxJobsToExecute = -1) {
			const ctxPtrOut = this.memory.newMutablePointerArray(1);
			const valuePtr = this.ffi.QTS_ExecutePendingJob(this.rt.value, maxJobsToExecute ?? -1, ctxPtrOut.value.ptr);
			const ctxPtr = ctxPtrOut.value.typedArray[0];
			ctxPtrOut.dispose();
			if (ctxPtr === 0) {
				this.ffi.QTS_FreeValuePointerRuntime(this.rt.value, valuePtr);
				return { value: 0 };
			}
			const context = this.contextMap.get(ctxPtr) ?? this.newContext({ contextPointer: ctxPtr });
			const resultValue = context.getMemory(this.rt.value).heapValueHandle(valuePtr);
			if (context.typeof(resultValue) === "number") {
				const executedJobs = context.getNumber(resultValue);
				resultValue.dispose();
				return { value: executedJobs };
			} else return { error: Object.assign(resultValue, { context }) };
		}
		setMemoryLimit(limitBytes) {
			if (limitBytes < 0 && limitBytes !== -1) throw new Error("Cannot set memory limit to negative number. To unset, pass -1");
			this.ffi.QTS_RuntimeSetMemoryLimit(this.rt.value, limitBytes);
		}
		computeMemoryUsage() {
			const serviceContextMemory = this.getSystemContext().getMemory(this.rt.value);
			return serviceContextMemory.heapValueHandle(this.ffi.QTS_RuntimeComputeMemoryUsage(this.rt.value, serviceContextMemory.ctx.value));
		}
		dumpMemoryUsage() {
			return this.memory.consumeHeapCharPointer(this.ffi.QTS_RuntimeDumpMemoryUsage(this.rt.value));
		}
		setMaxStackSize(stackSize) {
			if (stackSize < 0) throw new Error("Cannot set memory limit to negative number. To unset, pass 0.");
			this.ffi.QTS_RuntimeSetMaxStackSize(this.rt.value, stackSize);
		}
		assertOwned(handle) {
			if (handle.owner && handle.owner.rt !== this.rt) throw new errors_1$3.QuickJSWrongOwner(`Handle is not owned by this runtime: ${handle.owner.rt.value} != ${this.rt.value}`);
		}
		getSystemContext() {
			if (!this.context) this.context = this.scope.manage(this.newContext());
			return this.context;
		}
	};
	exports.QuickJSRuntime = QuickJSRuntime;
}));
var require_module = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSWASMModule = exports.applyModuleEvalRuntimeOptions = exports.applyBaseRuntimeOptions = exports.QuickJSModuleCallbacks = void 0;
	var debug_1$3 = require_debug();
	var errors_1$2 = require_errors();
	var lifetime_1$2 = require_lifetime();
	var runtime_1$1 = require_runtime();
	var types_1$2 = require_types();
	var QuickJSEmscriptenModuleCallbacks = class {
		constructor(args) {
			this.callFunction = args.callFunction;
			this.shouldInterrupt = args.shouldInterrupt;
			this.loadModuleSource = args.loadModuleSource;
			this.normalizeModule = args.normalizeModule;
		}
	};
	var QuickJSModuleCallbacks = class {
		constructor(module$1) {
			this.contextCallbacks = /* @__PURE__ */ new Map();
			this.runtimeCallbacks = /* @__PURE__ */ new Map();
			this.suspendedCount = 0;
			this.cToHostCallbacks = new QuickJSEmscriptenModuleCallbacks({
				callFunction: (asyncify, ctx, this_ptr, argc, argv, fn_id) => this.handleAsyncify(asyncify, () => {
					try {
						const vm = this.contextCallbacks.get(ctx);
						if (!vm) throw new Error(`QuickJSContext(ctx = ${ctx}) not found for C function call "${fn_id}"`);
						return vm.callFunction(ctx, this_ptr, argc, argv, fn_id);
					} catch (error) {
						console.error("[C to host error: returning null]", error);
						return 0;
					}
				}),
				shouldInterrupt: (asyncify, rt) => this.handleAsyncify(asyncify, () => {
					try {
						const vm = this.runtimeCallbacks.get(rt);
						if (!vm) throw new Error(`QuickJSRuntime(rt = ${rt}) not found for C interrupt`);
						return vm.shouldInterrupt(rt);
					} catch (error) {
						console.error("[C to host interrupt: returning error]", error);
						return 1;
					}
				}),
				loadModuleSource: (asyncify, rt, ctx, moduleName) => this.handleAsyncify(asyncify, () => {
					try {
						const runtimeCallbacks = this.runtimeCallbacks.get(rt);
						if (!runtimeCallbacks) throw new Error(`QuickJSRuntime(rt = ${rt}) not found for C module loader`);
						const loadModule = runtimeCallbacks.loadModuleSource;
						if (!loadModule) throw new Error(`QuickJSRuntime(rt = ${rt}) does not support module loading`);
						return loadModule(rt, ctx, moduleName);
					} catch (error) {
						console.error("[C to host module loader error: returning null]", error);
						return 0;
					}
				}),
				normalizeModule: (asyncify, rt, ctx, moduleBaseName, moduleName) => this.handleAsyncify(asyncify, () => {
					try {
						const runtimeCallbacks = this.runtimeCallbacks.get(rt);
						if (!runtimeCallbacks) throw new Error(`QuickJSRuntime(rt = ${rt}) not found for C module loader`);
						const normalizeModule = runtimeCallbacks.normalizeModule;
						if (!normalizeModule) throw new Error(`QuickJSRuntime(rt = ${rt}) does not support module loading`);
						return normalizeModule(rt, ctx, moduleBaseName, moduleName);
					} catch (error) {
						console.error("[C to host module loader error: returning null]", error);
						return 0;
					}
				})
			});
			this.module = module$1;
			this.module.callbacks = this.cToHostCallbacks;
		}
		setRuntimeCallbacks(rt, callbacks) {
			this.runtimeCallbacks.set(rt, callbacks);
		}
		deleteRuntime(rt) {
			this.runtimeCallbacks.delete(rt);
		}
		setContextCallbacks(ctx, callbacks) {
			this.contextCallbacks.set(ctx, callbacks);
		}
		deleteContext(ctx) {
			this.contextCallbacks.delete(ctx);
		}
		handleAsyncify(asyncify, fn) {
			if (asyncify) return asyncify.handleSleep((done) => {
				try {
					const result = fn();
					if (!(result instanceof Promise)) {
						(0, debug_1$3.debugLog)("asyncify.handleSleep: not suspending:", result);
						done(result);
						return;
					}
					if (this.suspended) throw new errors_1$2.QuickJSAsyncifyError(`Already suspended at: ${this.suspended.stack}\nAttempted to suspend at:`);
					else {
						this.suspended = new errors_1$2.QuickJSAsyncifySuspended(`(${this.suspendedCount++})`);
						(0, debug_1$3.debugLog)("asyncify.handleSleep: suspending:", this.suspended);
					}
					result.then((resolvedResult) => {
						this.suspended = void 0;
						(0, debug_1$3.debugLog)("asyncify.handleSleep: resolved:", resolvedResult);
						done(resolvedResult);
					}, (error) => {
						(0, debug_1$3.debugLog)("asyncify.handleSleep: rejected:", error);
						console.error("QuickJS: cannot handle error in suspended function", error);
						this.suspended = void 0;
					});
				} catch (error) {
					(0, debug_1$3.debugLog)("asyncify.handleSleep: error:", error);
					this.suspended = void 0;
					throw error;
				}
			});
			const value = fn();
			if (value instanceof Promise) throw new Error("Promise return value not supported in non-asyncify context.");
			return value;
		}
	};
	exports.QuickJSModuleCallbacks = QuickJSModuleCallbacks;
	function applyBaseRuntimeOptions(runtime, options) {
		if (options.interruptHandler) runtime.setInterruptHandler(options.interruptHandler);
		if (options.maxStackSizeBytes !== void 0) runtime.setMaxStackSize(options.maxStackSizeBytes);
		if (options.memoryLimitBytes !== void 0) runtime.setMemoryLimit(options.memoryLimitBytes);
	}
	exports.applyBaseRuntimeOptions = applyBaseRuntimeOptions;
	function applyModuleEvalRuntimeOptions(runtime, options) {
		if (options.moduleLoader) runtime.setModuleLoader(options.moduleLoader);
		if (options.shouldInterrupt) runtime.setInterruptHandler(options.shouldInterrupt);
		if (options.memoryLimitBytes !== void 0) runtime.setMemoryLimit(options.memoryLimitBytes);
		if (options.maxStackSizeBytes !== void 0) runtime.setMaxStackSize(options.maxStackSizeBytes);
	}
	exports.applyModuleEvalRuntimeOptions = applyModuleEvalRuntimeOptions;
	var QuickJSWASMModule = class {
		constructor(module$1, ffi) {
			this.module = module$1;
			this.ffi = ffi;
			this.callbacks = new QuickJSModuleCallbacks(module$1);
		}
		newRuntime(options = {}) {
			const rt = new lifetime_1$2.Lifetime(this.ffi.QTS_NewRuntime(), void 0, (rt_ptr) => {
				this.callbacks.deleteRuntime(rt_ptr);
				this.ffi.QTS_FreeRuntime(rt_ptr);
			});
			const runtime = new runtime_1$1.QuickJSRuntime({
				module: this.module,
				callbacks: this.callbacks,
				ffi: this.ffi,
				rt
			});
			applyBaseRuntimeOptions(runtime, options);
			if (options.moduleLoader) runtime.setModuleLoader(options.moduleLoader);
			return runtime;
		}
		newContext(options = {}) {
			const runtime = this.newRuntime();
			const context = runtime.newContext({
				...options,
				ownedLifetimes: (0, types_1$2.concat)(runtime, options.ownedLifetimes)
			});
			runtime.context = context;
			return context;
		}
		evalCode(code, options = {}) {
			return lifetime_1$2.Scope.withScope((scope) => {
				const vm = scope.manage(this.newContext());
				applyModuleEvalRuntimeOptions(vm.runtime, options);
				const result = vm.evalCode(code, "eval.js");
				if (options.memoryLimitBytes !== void 0) vm.runtime.setMemoryLimit(-1);
				if (result.error) throw vm.dump(scope.manage(result.error));
				return vm.dump(scope.manage(result.value));
			});
		}
		getFFI() {
			return this.ffi;
		}
	};
	exports.QuickJSWASMModule = QuickJSWASMModule;
}));
var require_context_asyncify = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSAsyncContext = void 0;
	var context_1 = require_context();
	var debug_1$2 = require_debug();
	var types_1$1 = require_types();
	var QuickJSAsyncContext = class extends context_1.QuickJSContext {
		async evalCodeAsync(code, filename = "eval.js", options) {
			const detectModule = options === void 0 ? 1 : 0;
			const flags = (0, types_1$1.evalOptionsToFlags)(options);
			let resultPtr = 0;
			try {
				resultPtr = await this.memory.newHeapCharPointer(code).consume((charHandle) => this.ffi.QTS_Eval_MaybeAsync(this.ctx.value, charHandle.value, filename, detectModule, flags));
			} catch (error) {
				(0, debug_1$2.debugLog)("QTS_Eval_MaybeAsync threw", error);
				throw error;
			}
			const errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr);
			if (errorPtr) {
				this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr);
				return { error: this.memory.heapValueHandle(errorPtr) };
			}
			return { value: this.memory.heapValueHandle(resultPtr) };
		}
		newAsyncifiedFunction(name$1, fn) {
			return this.newFunction(name$1, fn);
		}
	};
	exports.QuickJSAsyncContext = QuickJSAsyncContext;
}));
var require_runtime_asyncify = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSAsyncRuntime = void 0;
	var _1 = require_dist$2();
	var context_asyncify_1 = require_context_asyncify();
	var runtime_1 = require_runtime();
	var types_1 = require_types();
	var QuickJSAsyncRuntime = class extends runtime_1.QuickJSRuntime {
		constructor(args) {
			super(args);
		}
		newContext(options = {}) {
			if (options.intrinsics && options.intrinsics !== types_1.DefaultIntrinsics) throw new Error("TODO: Custom intrinsics are not supported yet");
			const ctx = new _1.Lifetime(this.ffi.QTS_NewContext(this.rt.value), void 0, (ctx_ptr) => {
				this.contextMap.delete(ctx_ptr);
				this.callbacks.deleteContext(ctx_ptr);
				this.ffi.QTS_FreeContext(ctx_ptr);
			});
			const context = new context_asyncify_1.QuickJSAsyncContext({
				module: this.module,
				ctx,
				ffi: this.ffi,
				rt: this.rt,
				ownedLifetimes: [],
				runtime: this,
				callbacks: this.callbacks
			});
			this.contextMap.set(ctx.value, context);
			return context;
		}
		setModuleLoader(moduleLoader, moduleNormalizer) {
			super.setModuleLoader(moduleLoader, moduleNormalizer);
		}
		setMaxStackSize(stackSize) {
			return super.setMaxStackSize(stackSize);
		}
	};
	exports.QuickJSAsyncRuntime = QuickJSAsyncRuntime;
}));
var require_module_asyncify = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSAsyncWASMModule = void 0;
	var errors_1$1 = require_errors();
	var lifetime_1$1 = require_lifetime();
	var module_1 = require_module();
	var runtime_asyncify_1 = require_runtime_asyncify();
	var QuickJSAsyncWASMModule = class extends module_1.QuickJSWASMModule {
		constructor(module$1, ffi) {
			super(module$1, ffi);
			this.ffi = ffi;
			this.module = module$1;
		}
		newRuntime(options = {}) {
			const rt = new lifetime_1$1.Lifetime(this.ffi.QTS_NewRuntime(), void 0, (rt_ptr) => {
				this.callbacks.deleteRuntime(rt_ptr);
				this.ffi.QTS_FreeRuntime(rt_ptr);
			});
			const runtime = new runtime_asyncify_1.QuickJSAsyncRuntime({
				module: this.module,
				ffi: this.ffi,
				rt,
				callbacks: this.callbacks
			});
			(0, module_1.applyBaseRuntimeOptions)(runtime, options);
			if (options.moduleLoader) runtime.setModuleLoader(options.moduleLoader);
			return runtime;
		}
		newContext(options = {}) {
			const runtime = this.newRuntime();
			const lifetimes = options.ownedLifetimes ? options.ownedLifetimes.concat([runtime]) : [runtime];
			const context = runtime.newContext({
				...options,
				ownedLifetimes: lifetimes
			});
			runtime.context = context;
			return context;
		}
		evalCode() {
			throw new errors_1$1.QuickJSNotImplemented("QuickJSWASMModuleAsyncify.evalCode: use evalCodeAsync instead");
		}
		evalCodeAsync(code, options) {
			return lifetime_1$1.Scope.withScopeAsync(async (scope) => {
				const vm = scope.manage(this.newContext());
				(0, module_1.applyModuleEvalRuntimeOptions)(vm.runtime, options);
				const result = await vm.evalCodeAsync(code, "eval.js");
				if (options.memoryLimitBytes !== void 0) vm.runtime.setMemoryLimit(-1);
				if (result.error) throw vm.dump(scope.manage(result.error));
				return vm.dump(scope.manage(result.value));
			});
		}
	};
	exports.QuickJSAsyncWASMModule = QuickJSAsyncWASMModule;
}));
var require_ffi_WASM_RELEASE_SYNC = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.QuickJSFFI = void 0;
	var QuickJSFFI = class {
		constructor(module$1) {
			this.module = module$1;
			this.DEBUG = false;
			this.QTS_Throw = this.module.cwrap("QTS_Throw", "number", ["number", "number"]);
			this.QTS_NewError = this.module.cwrap("QTS_NewError", "number", ["number"]);
			this.QTS_RuntimeSetMemoryLimit = this.module.cwrap("QTS_RuntimeSetMemoryLimit", null, ["number", "number"]);
			this.QTS_RuntimeComputeMemoryUsage = this.module.cwrap("QTS_RuntimeComputeMemoryUsage", "number", ["number", "number"]);
			this.QTS_RuntimeDumpMemoryUsage = this.module.cwrap("QTS_RuntimeDumpMemoryUsage", "number", ["number"]);
			this.QTS_RecoverableLeakCheck = this.module.cwrap("QTS_RecoverableLeakCheck", "number", []);
			this.QTS_BuildIsSanitizeLeak = this.module.cwrap("QTS_BuildIsSanitizeLeak", "number", []);
			this.QTS_RuntimeSetMaxStackSize = this.module.cwrap("QTS_RuntimeSetMaxStackSize", null, ["number", "number"]);
			this.QTS_GetUndefined = this.module.cwrap("QTS_GetUndefined", "number", []);
			this.QTS_GetNull = this.module.cwrap("QTS_GetNull", "number", []);
			this.QTS_GetFalse = this.module.cwrap("QTS_GetFalse", "number", []);
			this.QTS_GetTrue = this.module.cwrap("QTS_GetTrue", "number", []);
			this.QTS_NewRuntime = this.module.cwrap("QTS_NewRuntime", "number", []);
			this.QTS_FreeRuntime = this.module.cwrap("QTS_FreeRuntime", null, ["number"]);
			this.QTS_NewContext = this.module.cwrap("QTS_NewContext", "number", ["number"]);
			this.QTS_FreeContext = this.module.cwrap("QTS_FreeContext", null, ["number"]);
			this.QTS_FreeValuePointer = this.module.cwrap("QTS_FreeValuePointer", null, ["number", "number"]);
			this.QTS_FreeValuePointerRuntime = this.module.cwrap("QTS_FreeValuePointerRuntime", null, ["number", "number"]);
			this.QTS_FreeVoidPointer = this.module.cwrap("QTS_FreeVoidPointer", null, ["number", "number"]);
			this.QTS_FreeCString = this.module.cwrap("QTS_FreeCString", null, ["number", "number"]);
			this.QTS_DupValuePointer = this.module.cwrap("QTS_DupValuePointer", "number", ["number", "number"]);
			this.QTS_NewObject = this.module.cwrap("QTS_NewObject", "number", ["number"]);
			this.QTS_NewObjectProto = this.module.cwrap("QTS_NewObjectProto", "number", ["number", "number"]);
			this.QTS_NewArray = this.module.cwrap("QTS_NewArray", "number", ["number"]);
			this.QTS_NewFloat64 = this.module.cwrap("QTS_NewFloat64", "number", ["number", "number"]);
			this.QTS_GetFloat64 = this.module.cwrap("QTS_GetFloat64", "number", ["number", "number"]);
			this.QTS_NewString = this.module.cwrap("QTS_NewString", "number", ["number", "number"]);
			this.QTS_GetString = this.module.cwrap("QTS_GetString", "number", ["number", "number"]);
			this.QTS_NewSymbol = this.module.cwrap("QTS_NewSymbol", "number", [
				"number",
				"number",
				"number"
			]);
			this.QTS_GetSymbolDescriptionOrKey = this.module.cwrap("QTS_GetSymbolDescriptionOrKey", "number", ["number", "number"]);
			this.QTS_IsGlobalSymbol = this.module.cwrap("QTS_IsGlobalSymbol", "number", ["number", "number"]);
			this.QTS_IsJobPending = this.module.cwrap("QTS_IsJobPending", "number", ["number"]);
			this.QTS_ExecutePendingJob = this.module.cwrap("QTS_ExecutePendingJob", "number", [
				"number",
				"number",
				"number"
			]);
			this.QTS_GetProp = this.module.cwrap("QTS_GetProp", "number", [
				"number",
				"number",
				"number"
			]);
			this.QTS_SetProp = this.module.cwrap("QTS_SetProp", null, [
				"number",
				"number",
				"number",
				"number"
			]);
			this.QTS_DefineProp = this.module.cwrap("QTS_DefineProp", null, [
				"number",
				"number",
				"number",
				"number",
				"number",
				"number",
				"boolean",
				"boolean",
				"boolean"
			]);
			this.QTS_Call = this.module.cwrap("QTS_Call", "number", [
				"number",
				"number",
				"number",
				"number",
				"number"
			]);
			this.QTS_ResolveException = this.module.cwrap("QTS_ResolveException", "number", ["number", "number"]);
			this.QTS_Dump = this.module.cwrap("QTS_Dump", "number", ["number", "number"]);
			this.QTS_Eval = this.module.cwrap("QTS_Eval", "number", [
				"number",
				"number",
				"string",
				"number",
				"number"
			]);
			this.QTS_Typeof = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]);
			this.QTS_GetGlobalObject = this.module.cwrap("QTS_GetGlobalObject", "number", ["number"]);
			this.QTS_NewPromiseCapability = this.module.cwrap("QTS_NewPromiseCapability", "number", ["number", "number"]);
			this.QTS_TestStringArg = this.module.cwrap("QTS_TestStringArg", null, ["string"]);
			this.QTS_BuildIsDebug = this.module.cwrap("QTS_BuildIsDebug", "number", []);
			this.QTS_BuildIsAsyncify = this.module.cwrap("QTS_BuildIsAsyncify", "number", []);
			this.QTS_NewFunction = this.module.cwrap("QTS_NewFunction", "number", [
				"number",
				"number",
				"string"
			]);
			this.QTS_ArgvGetJSValueConstPointer = this.module.cwrap("QTS_ArgvGetJSValueConstPointer", "number", ["number", "number"]);
			this.QTS_RuntimeEnableInterruptHandler = this.module.cwrap("QTS_RuntimeEnableInterruptHandler", null, ["number"]);
			this.QTS_RuntimeDisableInterruptHandler = this.module.cwrap("QTS_RuntimeDisableInterruptHandler", null, ["number"]);
			this.QTS_RuntimeEnableModuleLoader = this.module.cwrap("QTS_RuntimeEnableModuleLoader", null, ["number", "number"]);
			this.QTS_RuntimeDisableModuleLoader = this.module.cwrap("QTS_RuntimeDisableModuleLoader", null, ["number"]);
		}
	};
	exports.QuickJSFFI = QuickJSFFI;
}));
var require_emscripten_module_WASM_RELEASE_SYNC = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	var QuickJSRaw = (() => {
		var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : void 0;
		if (typeof __filename !== "undefined") _scriptDir = _scriptDir || __filename;
		return (function(QuickJSRaw$1 = {}) {
			var a;
			a || (a = typeof QuickJSRaw$1 !== "undefined" ? QuickJSRaw$1 : {});
			var m$1, n$1;
			a.ready = new Promise(function(b, c) {
				m$1 = b;
				n$1 = c;
			});
			var p = Object.assign({}, a), t = "./this.program", u = "object" == typeof window, v = "function" == typeof importScripts, w$1 = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, x = "", y$1, z, A;
			if (w$1) {
				var fs$1 = require("fs"), B = require("path");
				x = v ? B.dirname(x) + "/" : __dirname + "/";
				y$1 = (b, c) => {
					var d$1 = C(b);
					if (d$1) return c ? d$1 : d$1.toString();
					b = b.startsWith("file://") ? new URL(b) : B.normalize(b);
					return fs$1.readFileSync(b, c ? void 0 : "utf8");
				};
				A = (b) => {
					b = y$1(b, !0);
					b.buffer || (b = new Uint8Array(b));
					return b;
				};
				z = (b, c, d$1) => {
					var e = C(b);
					e && c(e);
					b = b.startsWith("file://") ? new URL(b) : B.normalize(b);
					fs$1.readFile(b, function(f, g) {
						f ? d$1(f) : c(g.buffer);
					});
				};
				!a.thisProgram && 1 < process.argv.length && (t = process.argv[1].replace(/\\/g, "/"));
				process.argv.slice(2);
				a.inspect = function() {
					return "[Emscripten Module object]";
				};
			} else if (u || v) v ? x = self.location.href : "undefined" != typeof document && document.currentScript && (x = document.currentScript.src), _scriptDir && (x = _scriptDir), 0 !== x.indexOf("blob:") ? x = x.substr(0, x.replace(/[?#].*/, "").lastIndexOf("/") + 1) : x = "", y$1 = (b) => {
				try {
					var c = new XMLHttpRequest();
					c.open("GET", b, !1);
					c.send(null);
					return c.responseText;
				} catch (f) {
					if (b = C(b)) {
						c = [];
						for (var d$1 = 0; d$1 < b.length; d$1++) {
							var e = b[d$1];
							255 < e && (e &= 255);
							c.push(String.fromCharCode(e));
						}
						return c.join("");
					}
					throw f;
				}
			}, v && (A = (b) => {
				try {
					var c = new XMLHttpRequest();
					c.open("GET", b, !1);
					c.responseType = "arraybuffer";
					c.send(null);
					return new Uint8Array(c.response);
				} catch (d$1) {
					if (b = C(b)) return b;
					throw d$1;
				}
			}), z = (b, c, d$1) => {
				var e = new XMLHttpRequest();
				e.open("GET", b, !0);
				e.responseType = "arraybuffer";
				e.onload = () => {
					if (200 == e.status || 0 == e.status && e.response) c(e.response);
					else {
						var f = C(b);
						f ? c(f.buffer) : d$1();
					}
				};
				e.onerror = d$1;
				e.send(null);
			};
			var aa = a.print || console.log.bind(console), D = a.printErr || console.warn.bind(console);
			Object.assign(a, p);
			p = null;
			a.thisProgram && (t = a.thisProgram);
			var E;
			a.wasmBinary && (E = a.wasmBinary);
			a.noExitRuntime;
			"object" != typeof WebAssembly && F("no native wasm support detected");
			var G$1, H = !1, I, J, K, L;
			function M() {
				var b = G$1.buffer;
				a.HEAP8 = I = new Int8Array(b);
				a.HEAP16 = new Int16Array(b);
				a.HEAP32 = K = new Int32Array(b);
				a.HEAPU8 = J = new Uint8Array(b);
				a.HEAPU16 = new Uint16Array(b);
				a.HEAPU32 = L = new Uint32Array(b);
				a.HEAPF32 = new Float32Array(b);
				a.HEAPF64 = new Float64Array(b);
			}
			var ba = [], ca = [], da = [];
			function ea() {
				var b = a.preRun.shift();
				ba.unshift(b);
			}
			var N = 0, O = null, P = null;
			function F(b) {
				if (a.onAbort) a.onAbort(b);
				b = "Aborted(" + b + ")";
				D(b);
				H = !0;
				b = new WebAssembly.RuntimeError(b + ". Build with -sASSERTIONS for more info.");
				n$1(b);
				throw b;
			}
			var Q = "data:application/octet-stream;base64,", R = "data:application/octet-stream;base64,[encoded data, 608272 characters]";
			if (!R.startsWith(Q)) {
				var fa = R;
				R = a.locateFile ? a.locateFile(fa, x) : x + fa;
			}
			function ha(b) {
				try {
					if (b == R && E) return new Uint8Array(E);
					var c = C(b);
					if (c) return c;
					if (A) return A(b);
					throw "both async and sync fetching of the wasm failed";
				} catch (d$1) {
					F(d$1);
				}
			}
			function ia(b) {
				if (!E && (u || v)) {
					if ("function" == typeof fetch && !b.startsWith("file://")) return fetch(b, { credentials: "same-origin" }).then(function(c) {
						if (!c.ok) throw "failed to load wasm binary file at '" + b + "'";
						return c.arrayBuffer();
					}).catch(function() {
						return ha(b);
					});
					if (z) return new Promise(function(c, d$1) {
						z(b, function(e) {
							c(new Uint8Array(e));
						}, d$1);
					});
				}
				return Promise.resolve().then(function() {
					return ha(b);
				});
			}
			function ja(b, c, d$1) {
				return ia(b).then(function(e) {
					return WebAssembly.instantiate(e, c);
				}).then(function(e) {
					return e;
				}).then(d$1, function(e) {
					D("failed to asynchronously prepare wasm: " + e);
					F(e);
				});
			}
			function ka(b, c) {
				var d$1 = R;
				return E || "function" != typeof WebAssembly.instantiateStreaming || d$1.startsWith(Q) || d$1.startsWith("file://") || w$1 || "function" != typeof fetch ? ja(d$1, b, c) : fetch(d$1, { credentials: "same-origin" }).then(function(e) {
					return WebAssembly.instantiateStreaming(e, b).then(c, function(f) {
						D("wasm streaming compile failed: " + f);
						D("falling back to ArrayBuffer instantiation");
						return ja(d$1, b, c);
					});
				});
			}
			function S(b) {
				for (; 0 < b.length;) b.shift()(a);
			}
			var la = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0;
			function na(b, c, d$1) {
				var e = c + d$1;
				for (d$1 = c; b[d$1] && !(d$1 >= e);) ++d$1;
				if (16 < d$1 - c && b.buffer && la) return la.decode(b.subarray(c, d$1));
				for (e = ""; c < d$1;) {
					var f = b[c++];
					if (f & 128) {
						var g = b[c++] & 63;
						if (192 == (f & 224)) e += String.fromCharCode((f & 31) << 6 | g);
						else {
							var h$1 = b[c++] & 63;
							f = 224 == (f & 240) ? (f & 15) << 12 | g << 6 | h$1 : (f & 7) << 18 | g << 12 | h$1 << 6 | b[c++] & 63;
							65536 > f ? e += String.fromCharCode(f) : (f -= 65536, e += String.fromCharCode(55296 | f >> 10, 56320 | f & 1023));
						}
					} else e += String.fromCharCode(f);
				}
				return e;
			}
			function T(b, c) {
				return b ? na(J, b, c) : "";
			}
			var oa = [
				0,
				31,
				60,
				91,
				121,
				152,
				182,
				213,
				244,
				274,
				305,
				335
			], pa = [
				0,
				31,
				59,
				90,
				120,
				151,
				181,
				212,
				243,
				273,
				304,
				334
			];
			function U(b) {
				for (var c = 0, d$1 = 0; d$1 < b.length; ++d$1) {
					var e = b.charCodeAt(d$1);
					127 >= e ? c++ : 2047 >= e ? c += 2 : 55296 <= e && 57343 >= e ? (c += 4, ++d$1) : c += 3;
				}
				return c;
			}
			function V(b, c, d$1) {
				var e = J;
				if (!(0 < d$1)) return 0;
				var f = c;
				d$1 = c + d$1 - 1;
				for (var g = 0; g < b.length; ++g) {
					var h$1 = b.charCodeAt(g);
					if (55296 <= h$1 && 57343 >= h$1) {
						var k = b.charCodeAt(++g);
						h$1 = 65536 + ((h$1 & 1023) << 10) | k & 1023;
					}
					if (127 >= h$1) {
						if (c >= d$1) break;
						e[c++] = h$1;
					} else {
						if (2047 >= h$1) {
							if (c + 1 >= d$1) break;
							e[c++] = 192 | h$1 >> 6;
						} else {
							if (65535 >= h$1) {
								if (c + 2 >= d$1) break;
								e[c++] = 224 | h$1 >> 12;
							} else {
								if (c + 3 >= d$1) break;
								e[c++] = 240 | h$1 >> 18;
								e[c++] = 128 | h$1 >> 12 & 63;
							}
							e[c++] = 128 | h$1 >> 6 & 63;
						}
						e[c++] = 128 | h$1 & 63;
					}
				}
				e[c] = 0;
				return c - f;
			}
			function qa(b) {
				var c = U(b) + 1, d$1 = ra(c);
				d$1 && V(b, d$1, c);
				return d$1;
			}
			var W = {};
			function sa() {
				if (!X) {
					var b = {
						USER: "web_user",
						LOGNAME: "web_user",
						PATH: "/",
						PWD: "/",
						HOME: "/home/web_user",
						LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8",
						_: t || "./this.program"
					}, c;
					for (c in W) void 0 === W[c] ? delete b[c] : b[c] = W[c];
					var d$1 = [];
					for (c in b) d$1.push(c + "=" + b[c]);
					X = d$1;
				}
				return X;
			}
			var X, ta = [
				null,
				[],
				[]
			];
			function ua(b, c, d$1, e) {
				var f = {
					string: (l) => {
						var q = 0;
						if (null !== l && void 0 !== l && 0 !== l) {
							q = U(l) + 1;
							var ma = Y(q);
							V(l, ma, q);
							q = ma;
						}
						return q;
					},
					array: (l) => {
						var q = Y(l.length);
						I.set(l, q);
						return q;
					}
				};
				b = a["_" + b];
				var g = [], h$1 = 0;
				if (e) for (var k = 0; k < e.length; k++) {
					var r = f[d$1[k]];
					r ? (0 === h$1 && (h$1 = va()), g[k] = r(e[k])) : g[k] = e[k];
				}
				d$1 = b.apply(null, g);
				return d$1 = function(l) {
					0 !== h$1 && wa(h$1);
					return "string" === c ? T(l) : "boolean" === c ? !!l : l;
				}(d$1);
			}
			var xa = "function" == typeof atob ? atob : function(b) {
				var c = "", d$1 = 0;
				b = b.replace(/[^A-Za-z0-9\+\/=]/g, "");
				do {
					var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d$1++));
					var f = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d$1++));
					var g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d$1++));
					var h$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d$1++));
					e = e << 2 | f >> 4;
					f = (f & 15) << 4 | g >> 2;
					var k = (g & 3) << 6 | h$1;
					c += String.fromCharCode(e);
					64 !== g && (c += String.fromCharCode(f));
					64 !== h$1 && (c += String.fromCharCode(k));
				} while (d$1 < b.length);
				return c;
			};
			function C(b) {
				if (b.startsWith(Q)) {
					b = b.slice(Q.length);
					if ("boolean" == typeof w$1 && w$1) {
						var c = Buffer.from(b, "base64");
						c = new Uint8Array(c.buffer, c.byteOffset, c.byteLength);
					} else try {
						var d$1 = xa(b), e = new Uint8Array(d$1.length);
						for (b = 0; b < d$1.length; ++b) e[b] = d$1.charCodeAt(b);
						c = e;
					} catch (f) {
						throw Error("Converting base64 string to bytes failed.");
					}
					return c;
				}
			}
			var ya = {
				a: function(b, c, d$1, e) {
					F("Assertion failed: " + T(b) + ", at: " + [
						c ? T(c) : "unknown filename",
						d$1,
						e ? T(e) : "unknown function"
					]);
				},
				l: function(b, c) {
					b = /* @__PURE__ */ new Date(1e3 * (L[b >> 2] + 4294967296 * K[b + 4 >> 2]));
					K[c >> 2] = b.getSeconds();
					K[c + 4 >> 2] = b.getMinutes();
					K[c + 8 >> 2] = b.getHours();
					K[c + 12 >> 2] = b.getDate();
					K[c + 16 >> 2] = b.getMonth();
					K[c + 20 >> 2] = b.getFullYear() - 1900;
					K[c + 24 >> 2] = b.getDay();
					var d$1 = b.getFullYear();
					K[c + 28 >> 2] = (0 !== d$1 % 4 || 0 === d$1 % 100 && 0 !== d$1 % 400 ? pa : oa)[b.getMonth()] + b.getDate() - 1 | 0;
					K[c + 36 >> 2] = -(60 * b.getTimezoneOffset());
					d$1 = new Date(b.getFullYear(), 6, 1).getTimezoneOffset();
					var e = new Date(b.getFullYear(), 0, 1).getTimezoneOffset();
					K[c + 32 >> 2] = (d$1 != e && b.getTimezoneOffset() == Math.min(e, d$1)) | 0;
				},
				k: function(b, c, d$1) {
					function e(r) {
						return (r = r.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? r[1] : "GMT";
					}
					var f = (/* @__PURE__ */ new Date()).getFullYear(), g = new Date(f, 0, 1), h$1 = new Date(f, 6, 1);
					f = g.getTimezoneOffset();
					var k = h$1.getTimezoneOffset();
					L[b >> 2] = 60 * Math.max(f, k);
					K[c >> 2] = Number(f != k);
					b = e(g);
					c = e(h$1);
					b = qa(b);
					c = qa(c);
					k < f ? (L[d$1 >> 2] = b, L[d$1 + 4 >> 2] = c) : (L[d$1 >> 2] = c, L[d$1 + 4 >> 2] = b);
				},
				b: function() {
					F("");
				},
				m: function() {
					return Date.now();
				},
				j: function(b) {
					var c = J.length;
					b >>>= 0;
					if (2147483648 < b) return !1;
					for (var d$1 = 1; 4 >= d$1; d$1 *= 2) {
						var e = c * (1 + .2 / d$1);
						e = Math.min(e, b + 100663296);
						var f = Math, g = f.min;
						e = Math.max(b, e);
						e += (65536 - e % 65536) % 65536;
						a: {
							var h$1 = G$1.buffer;
							try {
								G$1.grow(g.call(f, 2147483648, e) - h$1.byteLength + 65535 >>> 16);
								M();
								var k = 1;
								break a;
							} catch (r) {}
							k = void 0;
						}
						if (k) return !0;
					}
					return !1;
				},
				e: function(b, c) {
					var d$1 = 0;
					sa().forEach(function(e, f) {
						var g = c + d$1;
						f = L[b + 4 * f >> 2] = g;
						for (g = 0; g < e.length; ++g) I[f++ >> 0] = e.charCodeAt(g);
						I[f >> 0] = 0;
						d$1 += e.length + 1;
					});
					return 0;
				},
				f: function(b, c) {
					var d$1 = sa();
					L[b >> 2] = d$1.length;
					var e = 0;
					d$1.forEach(function(f) {
						e += f.length + 1;
					});
					L[c >> 2] = e;
					return 0;
				},
				d: function() {
					return 52;
				},
				i: function() {
					return 70;
				},
				c: function(b, c, d$1, e) {
					for (var f = 0, g = 0; g < d$1; g++) {
						var h$1 = L[c >> 2], k = L[c + 4 >> 2];
						c += 8;
						for (var r = 0; r < k; r++) {
							var l = J[h$1 + r], q = ta[b];
							0 === l || 10 === l ? ((1 === b ? aa : D)(na(q, 0)), q.length = 0) : q.push(l);
						}
						f += k;
					}
					L[e >> 2] = f;
					return 0;
				},
				o: function(b, c, d$1, e, f) {
					return a.callbacks.callFunction(void 0, b, c, d$1, e, f);
				},
				n: function(b) {
					return a.callbacks.shouldInterrupt(void 0, b);
				},
				h: function(b, c, d$1) {
					d$1 = T(d$1);
					return a.callbacks.loadModuleSource(void 0, b, c, d$1);
				},
				g: function(b, c, d$1, e) {
					d$1 = T(d$1);
					e = T(e);
					return a.callbacks.normalizeModule(void 0, b, c, d$1, e);
				}
			};
			(function() {
				function b(d$1) {
					d$1 = d$1.exports;
					a.asm = d$1;
					G$1 = a.asm.p;
					M();
					ca.unshift(a.asm.q);
					N--;
					a.monitorRunDependencies && a.monitorRunDependencies(N);
					if (0 == N && (null !== O && (clearInterval(O), O = null), P)) {
						var e = P;
						P = null;
						e();
					}
					return d$1;
				}
				var c = { a: ya };
				N++;
				a.monitorRunDependencies && a.monitorRunDependencies(N);
				if (a.instantiateWasm) try {
					return a.instantiateWasm(c, b);
				} catch (d$1) {
					D("Module.instantiateWasm callback failed with error: " + d$1), n$1(d$1);
				}
				ka(c, function(d$1) {
					b(d$1.instance);
				}).catch(n$1);
				return {};
			})();
			var ra = a._malloc = function() {
				return (ra = a._malloc = a.asm.r).apply(null, arguments);
			};
			a._QTS_Throw = function() {
				return (a._QTS_Throw = a.asm.s).apply(null, arguments);
			};
			a._QTS_NewError = function() {
				return (a._QTS_NewError = a.asm.t).apply(null, arguments);
			};
			a._QTS_RuntimeSetMemoryLimit = function() {
				return (a._QTS_RuntimeSetMemoryLimit = a.asm.u).apply(null, arguments);
			};
			a._QTS_RuntimeComputeMemoryUsage = function() {
				return (a._QTS_RuntimeComputeMemoryUsage = a.asm.v).apply(null, arguments);
			};
			a._QTS_RuntimeDumpMemoryUsage = function() {
				return (a._QTS_RuntimeDumpMemoryUsage = a.asm.w).apply(null, arguments);
			};
			a._QTS_RecoverableLeakCheck = function() {
				return (a._QTS_RecoverableLeakCheck = a.asm.x).apply(null, arguments);
			};
			a._QTS_BuildIsSanitizeLeak = function() {
				return (a._QTS_BuildIsSanitizeLeak = a.asm.y).apply(null, arguments);
			};
			a._QTS_RuntimeSetMaxStackSize = function() {
				return (a._QTS_RuntimeSetMaxStackSize = a.asm.z).apply(null, arguments);
			};
			a._QTS_GetUndefined = function() {
				return (a._QTS_GetUndefined = a.asm.A).apply(null, arguments);
			};
			a._QTS_GetNull = function() {
				return (a._QTS_GetNull = a.asm.B).apply(null, arguments);
			};
			a._QTS_GetFalse = function() {
				return (a._QTS_GetFalse = a.asm.C).apply(null, arguments);
			};
			a._QTS_GetTrue = function() {
				return (a._QTS_GetTrue = a.asm.D).apply(null, arguments);
			};
			a._QTS_NewRuntime = function() {
				return (a._QTS_NewRuntime = a.asm.E).apply(null, arguments);
			};
			a._QTS_FreeRuntime = function() {
				return (a._QTS_FreeRuntime = a.asm.F).apply(null, arguments);
			};
			a._QTS_NewContext = function() {
				return (a._QTS_NewContext = a.asm.G).apply(null, arguments);
			};
			a._QTS_FreeContext = function() {
				return (a._QTS_FreeContext = a.asm.H).apply(null, arguments);
			};
			a._QTS_FreeValuePointer = function() {
				return (a._QTS_FreeValuePointer = a.asm.I).apply(null, arguments);
			};
			a._free = function() {
				return (a._free = a.asm.J).apply(null, arguments);
			};
			a._QTS_FreeValuePointerRuntime = function() {
				return (a._QTS_FreeValuePointerRuntime = a.asm.K).apply(null, arguments);
			};
			a._QTS_FreeVoidPointer = function() {
				return (a._QTS_FreeVoidPointer = a.asm.L).apply(null, arguments);
			};
			a._QTS_FreeCString = function() {
				return (a._QTS_FreeCString = a.asm.M).apply(null, arguments);
			};
			a._QTS_DupValuePointer = function() {
				return (a._QTS_DupValuePointer = a.asm.N).apply(null, arguments);
			};
			a._QTS_NewObject = function() {
				return (a._QTS_NewObject = a.asm.O).apply(null, arguments);
			};
			a._QTS_NewObjectProto = function() {
				return (a._QTS_NewObjectProto = a.asm.P).apply(null, arguments);
			};
			a._QTS_NewArray = function() {
				return (a._QTS_NewArray = a.asm.Q).apply(null, arguments);
			};
			a._QTS_NewFloat64 = function() {
				return (a._QTS_NewFloat64 = a.asm.R).apply(null, arguments);
			};
			a._QTS_GetFloat64 = function() {
				return (a._QTS_GetFloat64 = a.asm.S).apply(null, arguments);
			};
			a._QTS_NewString = function() {
				return (a._QTS_NewString = a.asm.T).apply(null, arguments);
			};
			a._QTS_GetString = function() {
				return (a._QTS_GetString = a.asm.U).apply(null, arguments);
			};
			a._QTS_NewSymbol = function() {
				return (a._QTS_NewSymbol = a.asm.V).apply(null, arguments);
			};
			a._QTS_GetSymbolDescriptionOrKey = function() {
				return (a._QTS_GetSymbolDescriptionOrKey = a.asm.W).apply(null, arguments);
			};
			a._QTS_IsGlobalSymbol = function() {
				return (a._QTS_IsGlobalSymbol = a.asm.X).apply(null, arguments);
			};
			a._QTS_IsJobPending = function() {
				return (a._QTS_IsJobPending = a.asm.Y).apply(null, arguments);
			};
			a._QTS_ExecutePendingJob = function() {
				return (a._QTS_ExecutePendingJob = a.asm.Z).apply(null, arguments);
			};
			a._QTS_GetProp = function() {
				return (a._QTS_GetProp = a.asm._).apply(null, arguments);
			};
			a._QTS_SetProp = function() {
				return (a._QTS_SetProp = a.asm.$).apply(null, arguments);
			};
			a._QTS_DefineProp = function() {
				return (a._QTS_DefineProp = a.asm.aa).apply(null, arguments);
			};
			a._QTS_Call = function() {
				return (a._QTS_Call = a.asm.ba).apply(null, arguments);
			};
			a._QTS_ResolveException = function() {
				return (a._QTS_ResolveException = a.asm.ca).apply(null, arguments);
			};
			a._QTS_Dump = function() {
				return (a._QTS_Dump = a.asm.da).apply(null, arguments);
			};
			a._QTS_Eval = function() {
				return (a._QTS_Eval = a.asm.ea).apply(null, arguments);
			};
			a._QTS_Typeof = function() {
				return (a._QTS_Typeof = a.asm.fa).apply(null, arguments);
			};
			a._QTS_GetGlobalObject = function() {
				return (a._QTS_GetGlobalObject = a.asm.ga).apply(null, arguments);
			};
			a._QTS_NewPromiseCapability = function() {
				return (a._QTS_NewPromiseCapability = a.asm.ha).apply(null, arguments);
			};
			a._QTS_TestStringArg = function() {
				return (a._QTS_TestStringArg = a.asm.ia).apply(null, arguments);
			};
			a._QTS_BuildIsDebug = function() {
				return (a._QTS_BuildIsDebug = a.asm.ja).apply(null, arguments);
			};
			a._QTS_BuildIsAsyncify = function() {
				return (a._QTS_BuildIsAsyncify = a.asm.ka).apply(null, arguments);
			};
			a._QTS_NewFunction = function() {
				return (a._QTS_NewFunction = a.asm.la).apply(null, arguments);
			};
			a._QTS_ArgvGetJSValueConstPointer = function() {
				return (a._QTS_ArgvGetJSValueConstPointer = a.asm.ma).apply(null, arguments);
			};
			a._QTS_RuntimeEnableInterruptHandler = function() {
				return (a._QTS_RuntimeEnableInterruptHandler = a.asm.na).apply(null, arguments);
			};
			a._QTS_RuntimeDisableInterruptHandler = function() {
				return (a._QTS_RuntimeDisableInterruptHandler = a.asm.oa).apply(null, arguments);
			};
			a._QTS_RuntimeEnableModuleLoader = function() {
				return (a._QTS_RuntimeEnableModuleLoader = a.asm.pa).apply(null, arguments);
			};
			a._QTS_RuntimeDisableModuleLoader = function() {
				return (a._QTS_RuntimeDisableModuleLoader = a.asm.qa).apply(null, arguments);
			};
			function va() {
				return (va = a.asm.sa).apply(null, arguments);
			}
			function wa() {
				return (wa = a.asm.ta).apply(null, arguments);
			}
			function Y() {
				return (Y = a.asm.ua).apply(null, arguments);
			}
			a.___start_em_js = 74916;
			a.___stop_em_js = 75818;
			a.cwrap = function(b, c, d$1, e) {
				var f = !d$1 || d$1.every((g) => "number" === g || "boolean" === g);
				return "string" !== c && f && !e ? a["_" + b] : function() {
					return ua(b, c, d$1, arguments);
				};
			};
			a.UTF8ToString = T;
			a.stringToUTF8 = function(b, c, d$1) {
				return V(b, c, d$1);
			};
			a.lengthBytesUTF8 = U;
			var Z;
			P = function za() {
				Z || Aa();
				Z || (P = za);
			};
			function Aa() {
				function b() {
					if (!Z && (Z = !0, a.calledRun = !0, !H)) {
						S(ca);
						m$1(a);
						if (a.onRuntimeInitialized) a.onRuntimeInitialized();
						if (a.postRun) for ("function" == typeof a.postRun && (a.postRun = [a.postRun]); a.postRun.length;) {
							var c = a.postRun.shift();
							da.unshift(c);
						}
						S(da);
					}
				}
				if (!(0 < N)) {
					if (a.preRun) for ("function" == typeof a.preRun && (a.preRun = [a.preRun]); a.preRun.length;) ea();
					S(ba);
					0 < N || (a.setStatus ? (a.setStatus("Running..."), setTimeout(function() {
						setTimeout(function() {
							a.setStatus("");
						}, 1);
						b();
					}, 1)) : b());
				}
			}
			if (a.preInit) for ("function" == typeof a.preInit && (a.preInit = [a.preInit]); 0 < a.preInit.length;) a.preInit.pop()();
			Aa();
			return QuickJSRaw$1.ready;
		});
	})();
	if (typeof exports === "object" && typeof module === "object") module.exports = QuickJSRaw;
	else if (typeof define === "function" && define["amd"]) define([], function() {
		return QuickJSRaw;
	});
	else if (typeof exports === "object") exports["QuickJSRaw"] = QuickJSRaw;
}));
var require_variants = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$3 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$3 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$3 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$3(result, mod, k);
		}
		__setModuleDefault$3(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.RELEASE_ASYNC = exports.DEBUG_ASYNC = exports.RELEASE_SYNC = exports.DEBUG_SYNC = exports.memoizePromiseFactory = exports.newQuickJSAsyncWASMModule = exports.newQuickJSWASMModule = void 0;
	var esmHelpers_1 = require_esmHelpers();
	async function newQuickJSWASMModule(variant = exports.RELEASE_SYNC) {
		const [wasmModuleLoader, QuickJSFFI$1, { QuickJSWASMModule: QuickJSWASMModule$1 }] = await Promise.all([
			variant.importModuleLoader(),
			variant.importFFI(),
			Promise.resolve().then(() => __importStar$3(require_module())).then(esmHelpers_1.unwrapTypescript)
		]);
		const wasmModule = await wasmModuleLoader();
		wasmModule.type = "sync";
		return new QuickJSWASMModule$1(wasmModule, new QuickJSFFI$1(wasmModule));
	}
	exports.newQuickJSWASMModule = newQuickJSWASMModule;
	async function newQuickJSAsyncWASMModule(variant = exports.RELEASE_ASYNC) {
		const [wasmModuleLoader, QuickJSAsyncFFI, { QuickJSAsyncWASMModule: QuickJSAsyncWASMModule$1 }] = await Promise.all([
			variant.importModuleLoader(),
			variant.importFFI(),
			Promise.resolve().then(() => __importStar$3(require_module_asyncify())).then(esmHelpers_1.unwrapTypescript)
		]);
		const wasmModule = await wasmModuleLoader();
		wasmModule.type = "async";
		return new QuickJSAsyncWASMModule$1(wasmModule, new QuickJSAsyncFFI(wasmModule));
	}
	exports.newQuickJSAsyncWASMModule = newQuickJSAsyncWASMModule;
	function memoizePromiseFactory(fn) {
		let promise;
		return () => {
			return promise ?? (promise = fn());
		};
	}
	exports.memoizePromiseFactory = memoizePromiseFactory;
	exports.DEBUG_SYNC = {
		type: "sync",
		async importFFI() {
			throw new Error("not implemented");
		},
		async importModuleLoader() {
			throw new Error("not implemented");
		}
	};
	exports.RELEASE_SYNC = {
		type: "sync",
		async importFFI() {
			const mod = await Promise.resolve().then(() => __importStar$3(require_ffi_WASM_RELEASE_SYNC()));
			return (0, esmHelpers_1.unwrapTypescript)(mod).QuickJSFFI;
		},
		async importModuleLoader() {
			const mod = await Promise.resolve().then(() => __importStar$3(require_emscripten_module_WASM_RELEASE_SYNC()));
			return (0, esmHelpers_1.unwrapJavascript)(mod);
		}
	};
	exports.DEBUG_ASYNC = {
		type: "async",
		async importFFI() {
			throw new Error("not implemented");
		},
		async importModuleLoader() {
			throw new Error("not implemented");
		}
	};
	exports.RELEASE_ASYNC = {
		type: "async",
		async importFFI() {
			throw new Error("not implemented");
		},
		async importModuleLoader() {
			throw new Error("not implemented");
		}
	};
}));
var require_vm_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.isFail = exports.isSuccess = void 0;
	function isSuccess(successOrFail) {
		return "error" in successOrFail === false;
	}
	exports.isSuccess = isSuccess;
	function isFail(successOrFail) {
		return "error" in successOrFail === true;
	}
	exports.isFail = isFail;
}));
var require_module_test = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.TestQuickJSWASMModule = void 0;
	var errors_1 = require_errors();
	var lifetime_1 = require_lifetime();
	var TestQuickJSWASMModule = class {
		constructor(parent) {
			this.parent = parent;
			this.contexts = /* @__PURE__ */ new Set();
			this.runtimes = /* @__PURE__ */ new Set();
		}
		newRuntime(options) {
			const runtime = this.parent.newRuntime({
				...options,
				ownedLifetimes: [new lifetime_1.Lifetime(void 0, void 0, () => this.runtimes.delete(runtime)), ...options?.ownedLifetimes ?? []]
			});
			this.runtimes.add(runtime);
			return runtime;
		}
		newContext(options) {
			const context = this.parent.newContext({
				...options,
				ownedLifetimes: [new lifetime_1.Lifetime(void 0, void 0, () => this.contexts.delete(context)), ...options?.ownedLifetimes ?? []]
			});
			this.contexts.add(context);
			return context;
		}
		evalCode(code, options) {
			return this.parent.evalCode(code, options);
		}
		disposeAll() {
			const allDisposables = [...this.contexts, ...this.runtimes];
			this.runtimes.clear();
			this.contexts.clear();
			allDisposables.forEach((d$1) => {
				if (d$1.alive) d$1.dispose();
			});
		}
		assertNoMemoryAllocated() {
			if (this.getFFI().QTS_RecoverableLeakCheck()) throw new errors_1.QuickJSMemoryLeakDetected("Leak sanitizer detected un-freed memory");
			if (this.contexts.size > 0) throw new errors_1.QuickJSMemoryLeakDetected(`${this.contexts.size} contexts leaked`);
			if (this.runtimes.size > 0) throw new errors_1.QuickJSMemoryLeakDetected(`${this.runtimes.size} runtimes leaked`);
		}
		getFFI() {
			return this.parent.getFFI();
		}
	};
	exports.TestQuickJSWASMModule = TestQuickJSWASMModule;
}));
var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$2 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$2 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __exportStar = exports && exports.__exportStar || function(m$1, exports$1) {
		for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding$2(exports$1, m$1, p);
	};
	var __importStar$2 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$2(result, mod, k);
		}
		__setModuleDefault$2(result, mod);
		return result;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.shouldInterruptAfterDeadline = exports.newAsyncContext = exports.newAsyncRuntime = exports.getQuickJSSync = exports.getQuickJS = exports.errors = exports.RELEASE_SYNC = exports.RELEASE_ASYNC = exports.DEBUG_SYNC = exports.DEBUG_ASYNC = exports.newQuickJSAsyncWASMModule = exports.newQuickJSWASMModule = void 0;
	var variants_1 = require_variants();
	Object.defineProperty(exports, "newQuickJSWASMModule", {
		enumerable: true,
		get: function() {
			return variants_1.newQuickJSWASMModule;
		}
	});
	Object.defineProperty(exports, "newQuickJSAsyncWASMModule", {
		enumerable: true,
		get: function() {
			return variants_1.newQuickJSAsyncWASMModule;
		}
	});
	Object.defineProperty(exports, "DEBUG_ASYNC", {
		enumerable: true,
		get: function() {
			return variants_1.DEBUG_ASYNC;
		}
	});
	Object.defineProperty(exports, "DEBUG_SYNC", {
		enumerable: true,
		get: function() {
			return variants_1.DEBUG_SYNC;
		}
	});
	Object.defineProperty(exports, "RELEASE_ASYNC", {
		enumerable: true,
		get: function() {
			return variants_1.RELEASE_ASYNC;
		}
	});
	Object.defineProperty(exports, "RELEASE_SYNC", {
		enumerable: true,
		get: function() {
			return variants_1.RELEASE_SYNC;
		}
	});
	__exportStar(require_vm_interface(), exports);
	__exportStar(require_lifetime(), exports);
	exports.errors = __importStar$2(require_errors());
	__exportStar(require_deferred_promise(), exports);
	__exportStar(require_module_test(), exports);
	var singleton = void 0;
	var singletonPromise = void 0;
	async function getQuickJS() {
		singletonPromise ?? (singletonPromise = (0, variants_1.newQuickJSWASMModule)().then((instance) => {
			singleton = instance;
			return instance;
		}));
		return await singletonPromise;
	}
	exports.getQuickJS = getQuickJS;
	function getQuickJSSync() {
		if (!singleton) throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");
		return singleton;
	}
	exports.getQuickJSSync = getQuickJSSync;
	async function newAsyncRuntime(options) {
		return (await (0, variants_1.newQuickJSAsyncWASMModule)()).newRuntime(options);
	}
	exports.newAsyncRuntime = newAsyncRuntime;
	async function newAsyncContext(options) {
		return (await (0, variants_1.newQuickJSAsyncWASMModule)()).newContext(options);
	}
	exports.newAsyncContext = newAsyncContext;
	function shouldInterruptAfterDeadline(deadline) {
		const deadlineAsNumber = typeof deadline === "number" ? deadline : deadline.getTime();
		return function() {
			return Date.now() > deadlineAsNumber;
		};
	}
	exports.shouldInterruptAfterDeadline = shouldInterruptAfterDeadline;
}));
var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding$1 = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault$1 = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar$1 = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$1(result, mod, k);
		}
		__setModuleDefault$1(result, mod);
		return result;
	};
	var __importDefault$1 = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.PacProxyAgent = void 0;
	var net = __importStar$1(require("net"));
	var tls = __importStar$1(require("tls"));
	var crypto$1 = __importStar$1(require("crypto"));
	var events_1 = require("events");
	var debug_1$1 = __importDefault$1(require_src());
	var url_1$1 = require("url");
	var agent_base_1$1 = require_dist$10();
	var get_uri_1 = require_dist$5();
	var pac_resolver_1 = require_dist$3();
	var quickjs_emscripten_1 = require_dist$2();
	var debug$1 = (0, debug_1$1.default)("pac-proxy-agent");
	var setServernameFromNonIpHost = (options) => {
		if (options.servername === void 0 && options.host && !net.isIP(options.host)) return {
			...options,
			servername: options.host
		};
		return options;
	};
	var PacProxyAgent = class extends agent_base_1$1.Agent {
		constructor(uri, opts) {
			super(opts);
			this.clearResolverPromise = () => {
				this.resolverPromise = void 0;
			};
			const uriStr = typeof uri === "string" ? uri : uri.href;
			this.uri = new url_1$1.URL(uriStr.replace(/^pac\+/i, ""));
			debug$1("Creating PacProxyAgent with URI %o", this.uri.href);
			this.opts = { ...opts };
			this.cache = void 0;
			this.resolver = void 0;
			this.resolverHash = "";
			this.resolverPromise = void 0;
			if (!this.opts.filename) this.opts.filename = this.uri.href;
		}
		getResolver() {
			if (!this.resolverPromise) {
				this.resolverPromise = this.loadResolver();
				this.resolverPromise.then(this.clearResolverPromise, this.clearResolverPromise);
			}
			return this.resolverPromise;
		}
		async loadResolver() {
			try {
				const [qjs, code] = await Promise.all([(0, quickjs_emscripten_1.getQuickJS)(), this.loadPacFile()]);
				const hash = crypto$1.createHash("sha1").update(code).digest("hex");
				if (this.resolver && this.resolverHash === hash) {
					debug$1("Same sha1 hash for code - contents have not changed, reusing previous proxy resolver");
					return this.resolver;
				}
				debug$1("Creating new proxy resolver instance");
				this.resolver = (0, pac_resolver_1.createPacResolver)(qjs, code, this.opts);
				this.resolverHash = hash;
				return this.resolver;
			} catch (err) {
				if (this.resolver && err.code === "ENOTMODIFIED") {
					debug$1("Got ENOTMODIFIED response, reusing previous proxy resolver");
					return this.resolver;
				}
				throw err;
			}
		}
		async loadPacFile() {
			debug$1("Loading PAC file: %o", this.uri);
			const rs = await (0, get_uri_1.getUri)(this.uri, {
				...this.opts,
				cache: this.cache
			});
			debug$1("Got `Readable` instance for URI");
			this.cache = rs;
			const buf = await (0, agent_base_1$1.toBuffer)(rs);
			debug$1("Read %o byte PAC file from URI", buf.length);
			return buf.toString("utf8");
		}
		async connect(req$1, opts) {
			const { secureEndpoint } = opts;
			const isWebSocket = req$1.getHeader("upgrade") === "websocket";
			const resolver = await this.getResolver();
			const protocol = secureEndpoint ? "https:" : "http:";
			const host = opts.host && net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
			const defaultPort = secureEndpoint ? 443 : 80;
			const url$3 = Object.assign(new url_1$1.URL(req$1.path, `${protocol}//${host}`), defaultPort ? void 0 : { port: opts.port });
			debug$1("url: %s", url$3);
			let result = await resolver(url$3);
			if (!result) result = "DIRECT";
			const proxies = String(result).trim().split(/\s*;\s*/g).filter(Boolean);
			if (this.opts.fallbackToDirect && !proxies.includes("DIRECT")) proxies.push("DIRECT");
			for (const proxy of proxies) {
				let agent = null;
				let socket = null;
				const [type, target] = proxy.split(/\s+/);
				debug$1("Attempting to use proxy: %o", proxy);
				if (type === "DIRECT") if (secureEndpoint) socket = tls.connect(setServernameFromNonIpHost(opts));
				else socket = net.connect(opts);
				else if (type === "SOCKS" || type === "SOCKS5") {
					const { SocksProxyAgent: SocksProxyAgent$1 } = await Promise.resolve().then(() => __importStar$1(require_dist$7()));
					agent = new SocksProxyAgent$1(`socks://${target}`, this.opts);
				} else if (type === "SOCKS4") {
					const { SocksProxyAgent: SocksProxyAgent$1 } = await Promise.resolve().then(() => __importStar$1(require_dist$7()));
					agent = new SocksProxyAgent$1(`socks4a://${target}`, this.opts);
				} else if (type === "PROXY" || type === "HTTP" || type === "HTTPS") {
					const proxyURL = `${type === "HTTPS" ? "https" : "http"}://${target}`;
					if (secureEndpoint || isWebSocket) {
						const { HttpsProxyAgent: HttpsProxyAgent$1 } = await Promise.resolve().then(() => __importStar$1(require_dist$8()));
						agent = new HttpsProxyAgent$1(proxyURL, this.opts);
					} else {
						const { HttpProxyAgent: HttpProxyAgent$1 } = await Promise.resolve().then(() => __importStar$1(require_dist$9()));
						agent = new HttpProxyAgent$1(proxyURL, this.opts);
					}
				}
				try {
					if (socket) {
						await (0, events_1.once)(socket, "connect");
						req$1.emit("proxy", {
							proxy,
							socket
						});
						return socket;
					}
					if (agent) {
						const s$1 = await agent.connect(req$1, opts);
						if (!(s$1 instanceof net.Socket)) throw new Error("Expected a `net.Socket` to be returned from agent");
						req$1.emit("proxy", {
							proxy,
							socket: s$1
						});
						return s$1;
					}
					throw new Error(`Could not determine proxy type for: ${proxy}`);
				} catch (err) {
					debug$1("Got error for proxy %o: %o", proxy, err);
					req$1.emit("proxy", {
						proxy,
						error: err
					});
				}
			}
			throw new Error(`Failed to establish a socket connection to proxies: ${JSON.stringify(proxies)}`);
		}
	};
	PacProxyAgent.protocols = [
		"pac+data",
		"pac+file",
		"pac+ftp",
		"pac+http",
		"pac+https"
	];
	exports.PacProxyAgent = PacProxyAgent;
}));
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
	var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		var desc$1 = Object.getOwnPropertyDescriptor(m$1, k);
		if (!desc$1 || ("get" in desc$1 ? !m$1.__esModule : desc$1.writable || desc$1.configurable)) desc$1 = {
			enumerable: true,
			get: function() {
				return m$1[k];
			}
		};
		Object.defineProperty(o, k2, desc$1);
	}) : (function(o, m$1, k, k2) {
		if (k2 === void 0) k2 = k;
		o[k2] = m$1[k];
	}));
	var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
		Object.defineProperty(o, "default", {
			enumerable: true,
			value: v
		});
	}) : function(o, v) {
		o["default"] = v;
	});
	var __importStar = exports && exports.__importStar || function(mod) {
		if (mod && mod.__esModule) return mod;
		var result = {};
		if (mod != null) {
			for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
		}
		__setModuleDefault(result, mod);
		return result;
	};
	var __importDefault = exports && exports.__importDefault || function(mod) {
		return mod && mod.__esModule ? mod : { "default": mod };
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.ProxyAgent = exports.proxies = void 0;
	var http$2 = __importStar(require("http"));
	var https$2 = __importStar(require("https"));
	var url_1 = require("url");
	var lru_cache_1 = __importDefault(require_lru_cache());
	var agent_base_1 = require_dist$10();
	var debug_1 = __importDefault(require_src());
	var proxy_from_env_1 = require_proxy_from_env();
	var debug = (0, debug_1.default)("proxy-agent");
	var wellKnownAgents = {
		http: async () => (await Promise.resolve().then(() => __importStar(require_dist$9()))).HttpProxyAgent,
		https: async () => (await Promise.resolve().then(() => __importStar(require_dist$8()))).HttpsProxyAgent,
		socks: async () => (await Promise.resolve().then(() => __importStar(require_dist$7()))).SocksProxyAgent,
		pac: async () => (await Promise.resolve().then(() => __importStar(require_dist$1()))).PacProxyAgent
	};
	exports.proxies = {
		http: [wellKnownAgents.http, wellKnownAgents.https],
		https: [wellKnownAgents.http, wellKnownAgents.https],
		socks: [wellKnownAgents.socks, wellKnownAgents.socks],
		socks4: [wellKnownAgents.socks, wellKnownAgents.socks],
		socks4a: [wellKnownAgents.socks, wellKnownAgents.socks],
		socks5: [wellKnownAgents.socks, wellKnownAgents.socks],
		socks5h: [wellKnownAgents.socks, wellKnownAgents.socks],
		"pac+data": [wellKnownAgents.pac, wellKnownAgents.pac],
		"pac+file": [wellKnownAgents.pac, wellKnownAgents.pac],
		"pac+ftp": [wellKnownAgents.pac, wellKnownAgents.pac],
		"pac+http": [wellKnownAgents.pac, wellKnownAgents.pac],
		"pac+https": [wellKnownAgents.pac, wellKnownAgents.pac]
	};
	function isValidProtocol(v) {
		return Object.keys(exports.proxies).includes(v);
	}
	var ProxyAgent$1 = class extends agent_base_1.Agent {
		constructor(opts) {
			super(opts);
			this.cache = new lru_cache_1.default({
				max: 20,
				dispose: (agent) => agent.destroy()
			});
			debug("Creating new ProxyAgent instance: %o", opts);
			this.connectOpts = opts;
			this.httpAgent = opts?.httpAgent || new http$2.Agent(opts);
			this.httpsAgent = opts?.httpsAgent || new https$2.Agent(opts);
			this.getProxyForUrl = opts?.getProxyForUrl || proxy_from_env_1.getProxyForUrl;
		}
		async connect(req$1, opts) {
			const { secureEndpoint } = opts;
			const isWebSocket = req$1.getHeader("upgrade") === "websocket";
			const protocol = secureEndpoint ? isWebSocket ? "wss:" : "https:" : isWebSocket ? "ws:" : "http:";
			const host = req$1.getHeader("host");
			const url$3 = new url_1.URL(req$1.path, `${protocol}//${host}`).href;
			const proxy = await this.getProxyForUrl(url$3, req$1);
			if (!proxy) {
				debug("Proxy not enabled for URL: %o", url$3);
				return secureEndpoint ? this.httpsAgent : this.httpAgent;
			}
			debug("Request URL: %o", url$3);
			debug("Proxy URL: %o", proxy);
			const cacheKey = `${protocol}+${proxy}`;
			let agent = this.cache.get(cacheKey);
			if (!agent) {
				const proxyProto = new url_1.URL(proxy).protocol.replace(":", "");
				if (!isValidProtocol(proxyProto)) throw new Error(`Unsupported protocol for proxy URL: ${proxy}`);
				agent = new (await (exports.proxies[proxyProto][secureEndpoint || isWebSocket ? 1 : 0]()))(proxy, this.connectOpts);
				this.cache.set(cacheKey, agent);
			} else debug("Cache hit for proxy URL: %o", proxy);
			return agent;
		}
		destroy() {
			for (const agent of this.cache.values()) agent.destroy();
			super.destroy();
		}
	};
	exports.ProxyAgent = ProxyAgent$1;
}));
var import_fetch_socks = require_fetch_socks();
var import_ipaddr = /* @__PURE__ */ __toESM(require_ipaddr());
var import_dist = require_dist();
var import_undici = require_undici();
const CHERRY_NODE_PROXY_RULES_ENV = "CHERRY_STUDIO_NODE_PROXY_RULES";
const CHERRY_NODE_PROXY_BYPASS_RULES_ENV = "CHERRY_STUDIO_NODE_PROXY_BYPASS_RULES";
var NODE_PROXY_ENV_KEYS = [
	CHERRY_NODE_PROXY_RULES_ENV,
	CHERRY_NODE_PROXY_BYPASS_RULES_ENV,
	"HTTP_PROXY",
	"HTTPS_PROXY",
	"http_proxy",
	"https_proxy",
	"ALL_PROXY",
	"all_proxy",
	"SOCKS_PROXY",
	"socks_proxy",
	"NO_PROXY",
	"no_proxy",
	"grpc_proxy"
];
var ProxyBypassRuleType = /* @__PURE__ */ function(ProxyBypassRuleType$1) {
	ProxyBypassRuleType$1["Local"] = "local";
	ProxyBypassRuleType$1["Cidr"] = "cidr";
	ProxyBypassRuleType$1["Ip"] = "ip";
	ProxyBypassRuleType$1["Domain"] = "domain";
	return ProxyBypassRuleType$1;
}(ProxyBypassRuleType || {});
var SOCKS_DISPATCHER_SYMBOL = Symbol.for("undici.globalDispatcher.1");
var globalDispatcherRegistry = globalThis;
var getDefaultPortForProtocol = (protocol) => {
	switch (protocol.toLowerCase()) {
		case "http:": return "80";
		case "https:": return "443";
		default: return null;
	}
};
var buildWildcardRegex = (pattern) => {
	const escapedSegments = pattern.split("*").map((segment) => segment.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
	return new RegExp(`^${escapedSegments.join(".*")}$`, "i");
};
var isWildcardIp = (value) => {
	if (!value.includes("*")) return false;
	const replaced = value.replace(/\*/g, "0");
	return import_ipaddr.isValid(replaced);
};
var matchHostnameRule = (hostname, rule) => {
	const normalizedHostname = hostname.toLowerCase();
	switch (rule.matchType) {
		case "exact": return normalizedHostname === rule.domain;
		case "wildcardSubdomain": {
			const domain = rule.domain;
			if (!domain) return false;
			return normalizedHostname === domain || normalizedHostname.endsWith(`.${domain}`);
		}
		case "generalWildcard": return rule.regex ? rule.regex.test(normalizedHostname) : false;
		default: return false;
	}
};
var parseProxyBypassRule = (rule) => {
	const trimmedRule = rule.trim();
	if (!trimmedRule) return null;
	if (trimmedRule === "<local>") return {
		type: ProxyBypassRuleType.Local,
		matchType: "exact",
		rule: "<local>"
	};
	let workingRule = trimmedRule;
	let scheme;
	const schemeMatch = workingRule.match(/^([a-zA-Z][a-zA-Z\d+\-.]*):\/\//);
	if (schemeMatch) {
		scheme = schemeMatch[1].toLowerCase();
		workingRule = workingRule.slice(schemeMatch[0].length);
	}
	if (workingRule.includes("/")) {
		const cleanedCidr = workingRule.replace(/^\[|\]$/g, "");
		if (import_ipaddr.isValidCIDR(cleanedCidr)) return {
			type: ProxyBypassRuleType.Cidr,
			matchType: "exact",
			rule: workingRule,
			scheme,
			cidr: import_ipaddr.parseCIDR(cleanedCidr)
		};
	}
	let port;
	const portMatch = workingRule.match(/^(.+?):(\d+)$/);
	if (portMatch) {
		const potentialHost = portMatch[1];
		if (!potentialHost.startsWith("[") || potentialHost.includes("]")) {
			workingRule = potentialHost;
			port = portMatch[2];
		}
	}
	const cleanedHost = workingRule.replace(/^\[|\]$/g, "");
	const normalizedHost = cleanedHost.toLowerCase();
	if (!cleanedHost) return null;
	if (import_ipaddr.isValid(cleanedHost)) return {
		type: ProxyBypassRuleType.Ip,
		matchType: "exact",
		rule: cleanedHost,
		scheme,
		port,
		ip: cleanedHost
	};
	if (isWildcardIp(cleanedHost)) {
		const regexPattern = cleanedHost.replace(/\./g, "\\.").replace(/\*/g, "\\d+");
		return {
			type: ProxyBypassRuleType.Ip,
			matchType: "generalWildcard",
			rule: cleanedHost,
			scheme,
			port,
			regex: /* @__PURE__ */ new RegExp(`^${regexPattern}$`)
		};
	}
	if (workingRule.startsWith("*.")) {
		const domain = normalizedHost.slice(2);
		return {
			type: ProxyBypassRuleType.Domain,
			matchType: "wildcardSubdomain",
			rule: workingRule,
			scheme,
			port,
			domain
		};
	}
	if (workingRule.startsWith(".")) {
		const domain = normalizedHost.slice(1);
		return {
			type: ProxyBypassRuleType.Domain,
			matchType: "wildcardSubdomain",
			rule: workingRule,
			scheme,
			port,
			domain
		};
	}
	if (workingRule.includes("*")) return {
		type: ProxyBypassRuleType.Domain,
		matchType: "generalWildcard",
		rule: workingRule,
		scheme,
		port,
		regex: buildWildcardRegex(normalizedHost)
	};
	return {
		type: ProxyBypassRuleType.Domain,
		matchType: "exact",
		rule: workingRule,
		scheme,
		port,
		domain: normalizedHost
	};
};
var isLocalHostname = (hostname) => {
	if (hostname.toLowerCase() === "localhost") return true;
	const cleaned = hostname.replace(/^\[|\]$/g, "");
	if (import_ipaddr.isValid(cleaned)) return import_ipaddr.parse(cleaned).range() === "loopback";
	return false;
};
const normalizeProxyBypassRules = (rules) => {
	if (Array.isArray(rules)) return rules.map((rule) => rule.trim()).filter((rule) => rule.length > 0);
	return rules ? rules.split(/[;,]/).map((rule) => rule.trim()).filter((rule) => rule.length > 0) : [];
};
const getProxyEnvironment = (env$1 = process.env) => {
	const proxyEnv = {};
	for (const key of NODE_PROXY_ENV_KEYS) {
		const value = env$1[key];
		if (typeof value === "string" && value.trim() !== "") proxyEnv[key] = value;
	}
	return proxyEnv;
};
const getNodeProxyConfigFromEnvironment = (env$1 = process.env) => {
	const proxyEnv = getProxyEnvironment(env$1);
	const proxyRules = proxyEnv["CHERRY_STUDIO_NODE_PROXY_RULES"] || proxyEnv.ALL_PROXY || proxyEnv.all_proxy || proxyEnv.SOCKS_PROXY || proxyEnv.socks_proxy || proxyEnv.HTTPS_PROXY || proxyEnv.https_proxy || proxyEnv.HTTP_PROXY || proxyEnv.http_proxy;
	if (!proxyRules) return null;
	return {
		proxyRules,
		proxyBypassRules: proxyEnv["CHERRY_STUDIO_NODE_PROXY_BYPASS_RULES"] || proxyEnv.NO_PROXY || proxyEnv.no_proxy
	};
};
const getProxyProtocol = (proxyRules) => {
	if (!proxyRules) return null;
	try {
		return new URL(proxyRules).protocol.replace(":", "").toLowerCase();
	} catch {
		return null;
	}
};
const isSocksProxyProtocol = (protocol) => {
	return protocol !== null && protocol.startsWith("socks");
};
var ProxyBypassRuleMatcher = class {
	parsedByPassRules = [];
	updateByPassRules(rules, logger) {
		this.parsedByPassRules = [];
		for (const rule of rules) {
			const parsedRule = parseProxyBypassRule(rule);
			if (parsedRule) this.parsedByPassRules.push(parsedRule);
			else logger?.warn?.(`Skipping invalid proxy bypass rule: ${rule}`);
		}
	}
	isByPass(url$3, logger) {
		if (this.parsedByPassRules.length === 0) return false;
		try {
			const parsedUrl = new URL(url$3);
			const hostname = parsedUrl.hostname;
			const cleanedHostname = hostname.replace(/^\[|\]$/g, "");
			const protocol = parsedUrl.protocol;
			const protocolName = protocol.replace(":", "").toLowerCase();
			const defaultPort = getDefaultPortForProtocol(protocol);
			const port = parsedUrl.port || defaultPort || "";
			const hostnameIsIp = import_ipaddr.isValid(cleanedHostname);
			for (const rule of this.parsedByPassRules) {
				if (rule.scheme && rule.scheme !== protocolName) continue;
				if (rule.port && rule.port !== port) continue;
				switch (rule.type) {
					case ProxyBypassRuleType.Local:
						if (isLocalHostname(hostname)) return true;
						break;
					case ProxyBypassRuleType.Ip:
						if (!hostnameIsIp) break;
						if (rule.ip && cleanedHostname === rule.ip) return true;
						if (rule.regex && rule.regex.test(cleanedHostname)) return true;
						break;
					case ProxyBypassRuleType.Cidr:
						if (hostnameIsIp && rule.cidr) {
							const parsedHost = import_ipaddr.parse(cleanedHostname);
							const [cidrAddress, prefixLength] = rule.cidr;
							if (parsedHost.kind() === cidrAddress.kind() && parsedHost.match([cidrAddress, prefixLength])) return true;
						}
						break;
					case ProxyBypassRuleType.Domain:
						if (!hostnameIsIp && matchHostnameRule(hostname, rule)) return true;
						break;
					default:
						logger?.error?.(`Unknown proxy bypass rule type: ${rule.type}`);
						break;
				}
			}
		} catch (error) {
			logger?.error?.("Failed to check bypass:", error);
			return false;
		}
		return false;
	}
};
const buildNodeProxyEnvironment = (config) => {
	const proxyUrl = config.proxyRules?.trim();
	if (!proxyUrl) return {};
	const normalizedByPassRules = normalizeProxyBypassRules(config.proxyBypassRules);
	const proxyProtocol = getProxyProtocol(proxyUrl);
	const env$1 = {
		[CHERRY_NODE_PROXY_RULES_ENV]: proxyUrl,
		[CHERRY_NODE_PROXY_BYPASS_RULES_ENV]: normalizedByPassRules.join(",")
	};
	if (normalizedByPassRules.length > 0) {
		env$1.NO_PROXY = normalizedByPassRules.join(",");
		env$1.no_proxy = normalizedByPassRules.join(",");
	}
	if (isSocksProxyProtocol(proxyProtocol)) {
		env$1.SOCKS_PROXY = proxyUrl;
		env$1.socks_proxy = proxyUrl;
		env$1.ALL_PROXY = proxyUrl;
		env$1.all_proxy = proxyUrl;
		return env$1;
	}
	env$1.grpc_proxy = proxyUrl;
	env$1.HTTP_PROXY = proxyUrl;
	env$1.HTTPS_PROXY = proxyUrl;
	env$1.http_proxy = proxyUrl;
	env$1.https_proxy = proxyUrl;
	env$1.ALL_PROXY = proxyUrl;
	env$1.all_proxy = proxyUrl;
	return env$1;
};
var SelectiveDispatcher = class extends import_undici.Dispatcher {
	constructor(proxyDispatcher, directDispatcher, shouldByPass, logger) {
		super();
		this.proxyDispatcher = proxyDispatcher;
		this.directDispatcher = directDispatcher;
		this.shouldByPass = shouldByPass;
		this.logger = logger;
	}
	dispatch(opts, handler) {
		if (opts.origin && this.shouldByPass(opts.origin.toString())) return this.directDispatcher.dispatch(opts, handler);
		return this.proxyDispatcher.dispatch(opts, handler);
	}
	async close() {
		try {
			await this.proxyDispatcher.close();
		} catch (error) {
			this.logger?.error?.("Failed to close dispatcher:", error);
			this.proxyDispatcher.destroy();
		}
	}
	async destroy() {
		try {
			await this.proxyDispatcher.destroy();
		} catch (error) {
			this.logger?.error?.("Failed to destroy dispatcher:", error);
		}
	}
};
var NodeProxyController = class {
	proxyDispatcher = null;
	proxyAgent = null;
	currentConfigKey = null;
	proxyBypassRuleMatcher = new ProxyBypassRuleMatcher();
	originalGlobalDispatcher;
	originalSocksDispatcher;
	originalHttpGet;
	originalHttpRequest;
	originalHttpsGet;
	originalHttpsRequest;
	originalAxiosAdapter;
	constructor(logger) {
		this.logger = logger;
		this.originalGlobalDispatcher = (0, import_undici.getGlobalDispatcher)();
		this.originalSocksDispatcher = globalDispatcherRegistry[SOCKS_DISPATCHER_SYMBOL] ?? this.originalGlobalDispatcher;
		this.originalHttpGet = http.default.get;
		this.originalHttpRequest = http.default.request;
		this.originalHttpsGet = https.default.get;
		this.originalHttpsRequest = https.default.request;
		this.originalAxiosAdapter = axios_default.defaults.adapter;
	}
	configure(config) {
		const proxyUrl = config.proxyRules?.trim();
		const normalizedByPassRules = normalizeProxyBypassRules(config.proxyBypassRules);
		const configKey = JSON.stringify({
			proxyUrl: proxyUrl ?? null,
			proxyByPassRules: normalizedByPassRules
		});
		if (this.currentConfigKey === configKey) return;
		this.proxyBypassRuleMatcher.updateByPassRules(normalizedByPassRules, this.logger);
		this.setEnvironment(proxyUrl, normalizedByPassRules);
		this.setGlobalFetchProxy(proxyUrl);
		this.setGlobalHttpProxy(proxyUrl);
		this.currentConfigKey = configKey;
	}
	setEnvironment(url$3, normalizedByPassRules) {
		delete process.env[CHERRY_NODE_PROXY_RULES_ENV];
		delete process.env[CHERRY_NODE_PROXY_BYPASS_RULES_ENV];
		delete process.env.HTTP_PROXY;
		delete process.env.HTTPS_PROXY;
		delete process.env.grpc_proxy;
		delete process.env.http_proxy;
		delete process.env.https_proxy;
		delete process.env.NO_PROXY;
		delete process.env.no_proxy;
		delete process.env.SOCKS_PROXY;
		delete process.env.socks_proxy;
		delete process.env.ALL_PROXY;
		delete process.env.all_proxy;
		if (!url$3) return;
		const env$1 = buildNodeProxyEnvironment({
			proxyRules: url$3,
			proxyBypassRules: normalizedByPassRules
		});
		for (const [key, value] of Object.entries(env$1)) process.env[key] = value;
	}
	setGlobalHttpProxy(proxyUrl) {
		if (!proxyUrl) {
			http.default.get = this.originalHttpGet;
			http.default.request = this.originalHttpRequest;
			https.default.get = this.originalHttpsGet;
			https.default.request = this.originalHttpsRequest;
			try {
				this.proxyAgent?.destroy();
			} catch (error) {
				this.logger?.error?.("Failed to destroy proxy agent:", error);
			}
			this.proxyAgent = null;
			return;
		}
		const agent = new import_dist.ProxyAgent();
		this.proxyAgent = agent;
		http.default.get = this.bindHttpMethod(this.originalHttpGet, agent);
		http.default.request = this.bindHttpMethod(this.originalHttpRequest, agent);
		https.default.get = this.bindHttpMethod(this.originalHttpsGet, agent);
		https.default.request = this.bindHttpMethod(this.originalHttpsRequest, agent);
	}
	bindHttpMethod(originalMethod, agent) {
		return (...args) => {
			let url$3;
			let options;
			let callback;
			if (typeof args[0] === "string" || args[0] instanceof URL) {
				url$3 = args[0];
				if (typeof args[1] === "function") {
					options = {};
					callback = args[1];
				} else {
					options = { ...args[1] };
					callback = args[2];
				}
			} else {
				options = { ...args[0] };
				callback = args[1];
			}
			if (url$3 && this.proxyBypassRuleMatcher.isByPass(url$3.toString(), this.logger)) return originalMethod(url$3, options, callback);
			if (options.agent instanceof https.default.Agent) agent.options.rejectUnauthorized = options.agent.options.rejectUnauthorized;
			options.agent = agent;
			if (url$3) return originalMethod(url$3, options, callback);
			return originalMethod(options, callback);
		};
	}
	setGlobalFetchProxy(proxyUrl) {
		if (!proxyUrl) {
			(0, import_undici.setGlobalDispatcher)(this.originalGlobalDispatcher);
			globalDispatcherRegistry[SOCKS_DISPATCHER_SYMBOL] = this.originalSocksDispatcher;
			this.proxyDispatcher?.close();
			this.proxyDispatcher = null;
			axios_default.defaults.adapter = this.originalAxiosAdapter;
			return;
		}
		let url$3;
		try {
			url$3 = new URL(proxyUrl);
		} catch {
			this.logger?.error?.(`Invalid proxy URL: ${proxyUrl}`);
			return;
		}
		axios_default.defaults.adapter = "fetch";
		if (url$3.protocol === "http:" || url$3.protocol === "https:") {
			this.proxyDispatcher = new SelectiveDispatcher(new import_undici.EnvHttpProxyAgent(), this.originalGlobalDispatcher, (origin$1) => this.proxyBypassRuleMatcher.isByPass(origin$1, this.logger), this.logger);
			(0, import_undici.setGlobalDispatcher)(this.proxyDispatcher);
			return;
		}
		this.proxyDispatcher = new SelectiveDispatcher((0, import_fetch_socks.socksDispatcher)({
			port: parseInt(url$3.port),
			type: url$3.protocol === "socks4:" ? 4 : 5,
			host: url$3.hostname,
			userId: url$3.username || void 0,
			password: url$3.password || void 0
		}), this.originalSocksDispatcher, (origin$1) => this.proxyBypassRuleMatcher.isByPass(origin$1, this.logger), this.logger);
		(0, import_undici.setGlobalDispatcher)(this.proxyDispatcher);
		globalDispatcherRegistry[SOCKS_DISPATCHER_SYMBOL] = this.proxyDispatcher;
	}
};
const applyNodeProxyFromEnvironment = (env$1 = process.env) => {
	const proxyConfig = getNodeProxyConfigFromEnvironment(env$1);
	if (!proxyConfig) return false;
	new NodeProxyController().configure(proxyConfig);
	return true;
};
try {
	applyNodeProxyFromEnvironment();
} catch (error) {
	const message = error instanceof Error ? `${error.name}: ${error.message}` : String(error);
	process.stderr.write(`[CherryStudioProxyBootstrap] Proxy bootstrap failed - child process will run WITHOUT proxy: ${message}\n`);
}
