@umijs/bundler-webpack 4.0.15 → 4.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/client/client.js +12 -8
- package/compiled/webpack/package.json +1 -5
- package/dist/config/config.js +1 -1
- package/dist/config/cssRules.js +30 -42
- package/dist/config/detectDeadCode.d.ts +1 -1
- package/dist/config/detectDeadCode.js +40 -15
- package/dist/config/detectDeadCodePlugin.js +1 -1
- package/dist/dev.d.ts +3 -1
- package/dist/dev.js +4 -20
- package/dist/server/server.js +1 -58
- package/dist/types.d.ts +5 -4
- package/package.json +5 -7
- package/compiled/http-proxy-middleware/LICENSE +0 -22
- package/compiled/http-proxy-middleware/dist/index.d.ts +0 -4
- package/compiled/http-proxy-middleware/dist/types.d.ts +0 -54
- package/compiled/http-proxy-middleware/http-proxy/index.d.ts +0 -226
- package/compiled/http-proxy-middleware/index.js +0 -66
- package/compiled/http-proxy-middleware/package.json +0 -1
package/client/client/client.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
+
|
|
1
5
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
6
|
|
|
3
7
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -37,9 +41,9 @@ var hadRuntimeError = false;
|
|
|
37
41
|
var pingUrl = getPingUrl();
|
|
38
42
|
var socket = new WebSocket(getSocketUrl(), 'webpack-hmr');
|
|
39
43
|
socket.addEventListener('message', /*#__PURE__*/function () {
|
|
40
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/
|
|
44
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
41
45
|
var data;
|
|
42
|
-
return
|
|
46
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
43
47
|
while (1) {
|
|
44
48
|
switch (_context.prev = _context.next) {
|
|
45
49
|
case 0:
|
|
@@ -75,10 +79,10 @@ function waitForSuccessfulPing() {
|
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
function _waitForSuccessfulPing() {
|
|
78
|
-
_waitForSuccessfulPing = _asyncToGenerator( /*#__PURE__*/
|
|
82
|
+
_waitForSuccessfulPing = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
79
83
|
var ms,
|
|
80
84
|
_args3 = arguments;
|
|
81
|
-
return
|
|
85
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
82
86
|
while (1) {
|
|
83
87
|
switch (_context3.prev = _context3.next) {
|
|
84
88
|
case 0:
|
|
@@ -119,8 +123,8 @@ function _waitForSuccessfulPing() {
|
|
|
119
123
|
return _waitForSuccessfulPing.apply(this, arguments);
|
|
120
124
|
}
|
|
121
125
|
|
|
122
|
-
socket.addEventListener('close', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
123
|
-
return
|
|
126
|
+
socket.addEventListener('close', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
127
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
124
128
|
while (1) {
|
|
125
129
|
switch (_context2.prev = _context2.next) {
|
|
126
130
|
case 0:
|
|
@@ -295,8 +299,8 @@ function handleMessage(_x2) {
|
|
|
295
299
|
}
|
|
296
300
|
|
|
297
301
|
function _handleMessage() {
|
|
298
|
-
_handleMessage = _asyncToGenerator( /*#__PURE__*/
|
|
299
|
-
return
|
|
302
|
+
_handleMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
|
|
303
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
300
304
|
while (1) {
|
|
301
305
|
switch (_context4.prev = _context4.next) {
|
|
302
306
|
case 0:
|
package/dist/config/config.js
CHANGED
|
@@ -103,7 +103,7 @@ async function getConfig(opts) {
|
|
|
103
103
|
config.devtool(isDev ? userConfig.devtool === false ? false : userConfig.devtool || import_constants.DEFAULT_DEVTOOL : userConfig.devtool);
|
|
104
104
|
const absOutputPath = (0, import_path.resolve)(opts.cwd, userConfig.outputPath || import_constants.DEFAULT_OUTPUT_PATH);
|
|
105
105
|
const disableCompress = process.env.COMPRESS === "none";
|
|
106
|
-
config.output.path(absOutputPath).filename(useHash ? `[name].[contenthash:8].js` : `[name].js`).chunkFilename(useHash ? `[name].[contenthash:8].async.js` : `[name].async.js`).publicPath(userConfig.publicPath || "auto").pathinfo(isDev || disableCompress).set("assetModuleFilename", `${applyOpts.staticPathPrefix}[name].[hash:8][ext]`);
|
|
106
|
+
config.output.path(absOutputPath).filename(useHash ? `[name].[contenthash:8].js` : `[name].js`).chunkFilename(useHash ? `[name].[contenthash:8].async.js` : `[name].async.js`).publicPath(userConfig.publicPath || "auto").pathinfo(isDev || disableCompress).set("assetModuleFilename", `${applyOpts.staticPathPrefix}[name].[hash:8][ext]`).set("hashFunction", "xxhash64");
|
|
107
107
|
config.resolve.set("symlinks", true).modules.add("node_modules").end().alias.merge(userConfig.alias || {}).end().extensions.merge([
|
|
108
108
|
".wasm",
|
|
109
109
|
".mjs",
|
package/dist/config/cssRules.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -53,10 +36,11 @@ async function addCSSRules(opts) {
|
|
|
53
36
|
loader: require.resolve("@umijs/bundler-webpack/compiled/less-loader"),
|
|
54
37
|
loaderOptions: {
|
|
55
38
|
implementation: require.resolve("@umijs/bundler-utils/compiled/less"),
|
|
56
|
-
lessOptions:
|
|
39
|
+
lessOptions: {
|
|
57
40
|
modifyVars: userConfig.theme,
|
|
58
|
-
javascriptEnabled: true
|
|
59
|
-
|
|
41
|
+
javascriptEnabled: true,
|
|
42
|
+
...userConfig.lessLoader
|
|
43
|
+
}
|
|
60
44
|
}
|
|
61
45
|
},
|
|
62
46
|
{
|
|
@@ -80,7 +64,7 @@ async function addCSSRules(opts) {
|
|
|
80
64
|
].filter(Boolean);
|
|
81
65
|
for (const { rule: rule2, isCSSModules } of nestRulesConfig) {
|
|
82
66
|
if (userConfig.styleLoader) {
|
|
83
|
-
rule2.use("style-loader").loader(require.resolve("@umijs/bundler-webpack/compiled/style-loader")).options(
|
|
67
|
+
rule2.use("style-loader").loader(require.resolve("@umijs/bundler-webpack/compiled/style-loader")).options({ base: 0, esModule: true, ...userConfig.styleLoader });
|
|
84
68
|
} else {
|
|
85
69
|
rule2.use("mini-css-extract-plugin").loader(require.resolve("@umijs/bundler-webpack/compiled/mini-css-extract-plugin/loader")).options({
|
|
86
70
|
publicPath: "./",
|
|
@@ -88,7 +72,7 @@ async function addCSSRules(opts) {
|
|
|
88
72
|
esModule: true
|
|
89
73
|
});
|
|
90
74
|
}
|
|
91
|
-
rule2.use("css-loader").loader(require.resolve("css-loader")).options(
|
|
75
|
+
rule2.use("css-loader").loader(require.resolve("css-loader")).options({
|
|
92
76
|
importLoaders: 1,
|
|
93
77
|
esModule: true,
|
|
94
78
|
url: {
|
|
@@ -98,34 +82,38 @@ async function addCSSRules(opts) {
|
|
|
98
82
|
return true;
|
|
99
83
|
}
|
|
100
84
|
},
|
|
101
|
-
import: true
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
85
|
+
import: true,
|
|
86
|
+
...isCSSModules ? {
|
|
87
|
+
modules: {
|
|
88
|
+
localIdentName: "[local]___[hash:base64:5]",
|
|
89
|
+
...userConfig.cssLoaderModules,
|
|
90
|
+
getLocalIdent: userConfig.ssr && ((context, localIdentName, localName, opt) => {
|
|
91
|
+
const classIdent = ((0, import_utils.winPath)(context.resourcePath).replace((0, import_utils.winPath)(ensureLastSlash(opt.context)), "") + "@" + localName).trim();
|
|
92
|
+
let hash = Buffer.from(classIdent).toString("base64").replace(/=/g, "");
|
|
93
|
+
hash = hash.substring(hash.length - 5);
|
|
94
|
+
const result = localIdentName.replace(/\[local]/g, localName).replace(/\[hash[^\[]*?]/g, hash);
|
|
95
|
+
return result;
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
} : {},
|
|
99
|
+
...userConfig.cssLoader
|
|
100
|
+
});
|
|
115
101
|
rule2.use("postcss-loader").loader(require.resolve("@umijs/bundler-webpack/compiled/postcss-loader")).options({
|
|
116
|
-
postcssOptions:
|
|
102
|
+
postcssOptions: {
|
|
117
103
|
ident: "postcss",
|
|
118
104
|
plugins: [
|
|
119
105
|
require("@umijs/bundler-webpack/compiled/postcss-flexbugs-fixes"),
|
|
120
106
|
require("postcss-preset-env")({
|
|
121
107
|
browsers: opts.browsers,
|
|
122
|
-
autoprefixer:
|
|
123
|
-
flexbox: "no-2009"
|
|
124
|
-
|
|
108
|
+
autoprefixer: {
|
|
109
|
+
flexbox: "no-2009",
|
|
110
|
+
...userConfig.autoprefixer
|
|
111
|
+
},
|
|
125
112
|
stage: 3
|
|
126
113
|
})
|
|
127
|
-
].concat(userConfig.extraPostCSSPlugins || [])
|
|
128
|
-
|
|
114
|
+
].concat(userConfig.extraPostCSSPlugins || []),
|
|
115
|
+
...userConfig.postcssLoader
|
|
116
|
+
}
|
|
129
117
|
});
|
|
130
118
|
if (loader) {
|
|
131
119
|
rule2.use(loader).loader(typeof loader === "string" ? require.resolve(loader) : loader).options(loaderOptions || {});
|
|
@@ -7,6 +7,6 @@ export interface Options extends DeadCodeParams {
|
|
|
7
7
|
detectUnusedFiles: boolean;
|
|
8
8
|
detectUnusedExport: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const ignores: string[];
|
|
11
11
|
declare const detectDeadCode: (compilation: Compilation, options: Options) => void;
|
|
12
12
|
export default detectDeadCode;
|
|
@@ -23,22 +23,37 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var detectDeadCode_exports = {};
|
|
24
24
|
__export(detectDeadCode_exports, {
|
|
25
25
|
default: () => detectDeadCode_default,
|
|
26
|
-
|
|
26
|
+
ignores: () => ignores
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(detectDeadCode_exports);
|
|
29
29
|
var import_webpack = require("@umijs/bundler-webpack/compiled/webpack");
|
|
30
30
|
var import_utils = require("@umijs/utils");
|
|
31
31
|
var import_path = __toESM(require("path"));
|
|
32
|
-
var
|
|
33
|
-
"node_modules",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
32
|
+
var ignores = [
|
|
33
|
+
"**/node_modules/**",
|
|
34
|
+
"**/.umi/**",
|
|
35
|
+
"**/.umi-production/**",
|
|
36
|
+
"**/.umi-test/**",
|
|
37
|
+
"coverage/**",
|
|
38
|
+
"dist/**",
|
|
39
|
+
"config/**",
|
|
40
|
+
"public/**",
|
|
41
|
+
"mock/**"
|
|
37
42
|
];
|
|
38
43
|
var detectDeadCode = (compilation, options) => {
|
|
39
44
|
const assets = getWebpackAssets(compilation);
|
|
40
45
|
const compiledFilesDictionary = convertFilesToDict(assets);
|
|
41
|
-
const
|
|
46
|
+
const context = options.context;
|
|
47
|
+
if (!options.patterns.length) {
|
|
48
|
+
options.patterns = getDefaultSourcePattern({ cwd: context });
|
|
49
|
+
}
|
|
50
|
+
const includedFiles = options.patterns.map((pattern) => {
|
|
51
|
+
return import_utils.glob.sync(pattern, {
|
|
52
|
+
ignore: [...ignores, ...options.exclude],
|
|
53
|
+
cwd: context,
|
|
54
|
+
absolute: true
|
|
55
|
+
});
|
|
56
|
+
}).flat();
|
|
42
57
|
const unusedFiles = options.detectUnusedFiles ? includedFiles.filter((file) => !compiledFilesDictionary[file]) : [];
|
|
43
58
|
const unusedExportMap = options.detectUnusedExport ? getUnusedExportMap(convertFilesToDict(includedFiles), compilation) : {};
|
|
44
59
|
logUnusedFiles(unusedFiles);
|
|
@@ -48,9 +63,6 @@ var detectDeadCode = (compilation, options) => {
|
|
|
48
63
|
process.exit(2);
|
|
49
64
|
}
|
|
50
65
|
};
|
|
51
|
-
var getPattern = (options) => {
|
|
52
|
-
return options.patterns.map((pattern) => import_path.default.resolve(options.context || "", pattern)).concat(options.exclude.map((pattern) => import_path.default.resolve(options.context || "", `!${pattern}`))).map(convertToUnixPath);
|
|
53
|
-
};
|
|
54
66
|
var getUnusedExportMap = (includedFileMap, compilation) => {
|
|
55
67
|
const unusedExportMap = {};
|
|
56
68
|
compilation.chunks.forEach((chunk) => {
|
|
@@ -64,7 +76,7 @@ var outputUnusedExportMap = (compilation, chunk, module2, includedFileMap, unuse
|
|
|
64
76
|
if (!(module2 instanceof import_webpack.NormalModule) || !module2.resource) {
|
|
65
77
|
return;
|
|
66
78
|
}
|
|
67
|
-
const path2 =
|
|
79
|
+
const path2 = (0, import_utils.winPath)(module2.resource);
|
|
68
80
|
if (!/^((?!(node_modules)).)*$/.test(path2))
|
|
69
81
|
return;
|
|
70
82
|
const providedExports = compilation.chunkGraph.moduleGraph.getProvidedExports(module2);
|
|
@@ -111,8 +123,8 @@ var getWebpackAssets = (compilation) => {
|
|
|
111
123
|
return assets;
|
|
112
124
|
};
|
|
113
125
|
var convertFilesToDict = (assets) => {
|
|
114
|
-
return assets.filter((
|
|
115
|
-
const unixFile =
|
|
126
|
+
return assets.filter((path2) => !/(node_modules|(\.umi))/.test(path2) && Boolean(path2)).reduce((fileDictionary, file) => {
|
|
127
|
+
const unixFile = (0, import_utils.winPath)(file);
|
|
116
128
|
fileDictionary[unixFile] = true;
|
|
117
129
|
return fileDictionary;
|
|
118
130
|
}, {});
|
|
@@ -124,9 +136,22 @@ var logUnusedFiles = (unusedFiles) => {
|
|
|
124
136
|
console.log(import_utils.chalk.yellow.bold("\nWarning:"), import_utils.chalk.yellow(`There are ${unusedFiles.length} unused files:`), ...unusedFiles.map((file, index) => `
|
|
125
137
|
${index + 1}. ${import_utils.chalk.yellow(file)}`), import_utils.chalk.red.bold("\nPlease be careful if you want to remove them (\xAC\xBA-\xB0)\xAC.\n"));
|
|
126
138
|
};
|
|
127
|
-
|
|
139
|
+
function isDirExist(p) {
|
|
140
|
+
return import_utils.fsExtra.existsSync(p) && import_utils.fsExtra.statSync(p).isDirectory();
|
|
141
|
+
}
|
|
142
|
+
function getDefaultSourcePattern(opts) {
|
|
143
|
+
const { cwd } = opts;
|
|
144
|
+
const srcPath = import_path.default.join(cwd, "src");
|
|
145
|
+
if (isDirExist(srcPath)) {
|
|
146
|
+
return ["src/**/*"];
|
|
147
|
+
}
|
|
148
|
+
const dirs = import_utils.fsExtra.readdirSync(cwd).filter((p) => {
|
|
149
|
+
return !p.startsWith(".") && isDirExist(p);
|
|
150
|
+
});
|
|
151
|
+
return dirs.map((dir) => `${dir}/**/*`);
|
|
152
|
+
}
|
|
128
153
|
var detectDeadCode_default = detectDeadCode;
|
|
129
154
|
// Annotate the CommonJS export names for ESM import in node:
|
|
130
155
|
0 && (module.exports = {
|
|
131
|
-
|
|
156
|
+
ignores
|
|
132
157
|
});
|
|
@@ -45,7 +45,7 @@ module.exports = __toCommonJS(detectDeadCodePlugin_exports);
|
|
|
45
45
|
var import_types = require("../types");
|
|
46
46
|
var import_detectDeadCode = __toESM(require("./detectDeadCode"));
|
|
47
47
|
var defaultOptions = {
|
|
48
|
-
patterns: [
|
|
48
|
+
patterns: [],
|
|
49
49
|
exclude: [],
|
|
50
50
|
failOnHint: false,
|
|
51
51
|
detectUnusedFiles: true,
|
package/dist/dev.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Worker } from 'worker_threads';
|
|
1
3
|
import { IOpts as IConfigOpts } from './config/config';
|
|
2
4
|
import { IConfig } from './types';
|
|
3
5
|
declare type IOpts = {
|
|
@@ -22,8 +24,8 @@ declare type IOpts = {
|
|
|
22
24
|
entry: Record<string, string>;
|
|
23
25
|
mfsuStrategy?: 'eager' | 'normal';
|
|
24
26
|
mfsuInclude?: string[];
|
|
25
|
-
mfsuServerBase?: string;
|
|
26
27
|
srcCodeCache?: any;
|
|
28
|
+
startBuildWorker?: (deps: any[]) => Worker;
|
|
27
29
|
} & Pick<IConfigOpts, 'cache' | 'pkg'>;
|
|
28
30
|
export declare function stripUndefined(obj: any): any;
|
|
29
31
|
export declare function dev(opts: IOpts): Promise<void>;
|
package/dist/dev.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -97,7 +80,7 @@ async function dev(opts) {
|
|
|
97
80
|
publicPath: opts.config.publicPath
|
|
98
81
|
});
|
|
99
82
|
},
|
|
100
|
-
|
|
83
|
+
startBuildWorker: opts.startBuildWorker
|
|
101
84
|
});
|
|
102
85
|
}
|
|
103
86
|
const webpackConfig = await (0, import_config.getConfig)({
|
|
@@ -122,9 +105,10 @@ async function dev(opts) {
|
|
|
122
105
|
modifyWebpackConfig: opts.modifyWebpackConfig,
|
|
123
106
|
hmr: process.env.HMR !== "none",
|
|
124
107
|
analyze: process.env.ANALYZE,
|
|
125
|
-
cache: opts.cache ?
|
|
108
|
+
cache: opts.cache ? {
|
|
109
|
+
...opts.cache,
|
|
126
110
|
cacheDirectory: (0, import_path.join)(cacheDirectoryPath, "bundler-webpack")
|
|
127
|
-
}
|
|
111
|
+
} : void 0,
|
|
128
112
|
pkg: opts.pkg
|
|
129
113
|
});
|
|
130
114
|
const depConfig = await (0, import_config.getConfig)({
|
package/dist/server/server.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -44,10 +27,8 @@ __export(server_exports, {
|
|
|
44
27
|
module.exports = __toCommonJS(server_exports);
|
|
45
28
|
var import_bundler_utils = require("@umijs/bundler-utils");
|
|
46
29
|
var import_express = __toESM(require("@umijs/bundler-utils/compiled/express"));
|
|
47
|
-
var import_http_proxy_middleware = require("@umijs/bundler-webpack/compiled/http-proxy-middleware");
|
|
48
30
|
var import_webpack = __toESM(require("@umijs/bundler-webpack/compiled/webpack"));
|
|
49
31
|
var import_utils = require("@umijs/utils");
|
|
50
|
-
var import_assert = __toESM(require("assert"));
|
|
51
32
|
var import_cors = __toESM(require("cors"));
|
|
52
33
|
var import_fs = require("fs");
|
|
53
34
|
var import_http = __toESM(require("http"));
|
|
@@ -153,45 +134,7 @@ async function createServer(opts) {
|
|
|
153
134
|
(_a = sender || ws) == null ? void 0 : _a.send(JSON.stringify({ type, data }));
|
|
154
135
|
}
|
|
155
136
|
if (proxy) {
|
|
156
|
-
|
|
157
|
-
return __spreadProps(__spreadValues({}, proxy[key]), {
|
|
158
|
-
context: key
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
proxyArr.forEach((proxy2) => {
|
|
162
|
-
let middleware;
|
|
163
|
-
if (proxy2.target) {
|
|
164
|
-
(0, import_assert.default)(typeof proxy2.target === "string", "proxy.target must be string");
|
|
165
|
-
(0, import_assert.default)(proxy2.context, "proxy.context must be supplied");
|
|
166
|
-
middleware = (0, import_http_proxy_middleware.createProxyMiddleware)(proxy2.context, __spreadProps(__spreadValues({}, proxy2), {
|
|
167
|
-
onProxyReq(proxyReq, req, res) {
|
|
168
|
-
var _a, _b;
|
|
169
|
-
if (proxyReq.getHeader("origin")) {
|
|
170
|
-
proxyReq.setHeader("origin", ((_a = new URL(proxy2.target)) == null ? void 0 : _a.href) || "");
|
|
171
|
-
}
|
|
172
|
-
(_b = proxy2.onProxyReq) == null ? void 0 : _b.call(proxy2, proxyReq, req, res);
|
|
173
|
-
},
|
|
174
|
-
onProxyRes(proxyRes, req, res) {
|
|
175
|
-
var _a, _b;
|
|
176
|
-
proxyRes.headers["x-real-url"] = ((_a = new URL(req.url || "", proxy2.target)) == null ? void 0 : _a.href) || "";
|
|
177
|
-
(_b = proxy2.onProxyRes) == null ? void 0 : _b.call(proxy2, proxyRes, req, res);
|
|
178
|
-
}
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
app.use((req, res, next) => {
|
|
182
|
-
const bypassUrl = typeof proxy2.bypass === "function" ? proxy2.bypass(req, res, proxy2) : null;
|
|
183
|
-
if (typeof bypassUrl === "string") {
|
|
184
|
-
req.url = bypassUrl;
|
|
185
|
-
return next();
|
|
186
|
-
} else if (bypassUrl === false) {
|
|
187
|
-
return res.end(404);
|
|
188
|
-
} else if ((bypassUrl === null || bypassUrl === void 0) && middleware) {
|
|
189
|
-
return middleware(req, res, next);
|
|
190
|
-
} else {
|
|
191
|
-
next();
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
});
|
|
137
|
+
(0, import_bundler_utils.createProxy)(proxy, app);
|
|
195
138
|
}
|
|
196
139
|
(opts.afterMiddlewares || []).forEach((m) => {
|
|
197
140
|
app.use(m.toString().includes(`{ compiler }`) ? m({ compiler }) : m);
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Config as SwcConfig } from '@swc/core';
|
|
2
|
-
import type { HttpsServerOptions } from '@umijs/bundler-utils';
|
|
3
|
-
import type { Options as ProxyOptions } from '../compiled/http-proxy-middleware';
|
|
2
|
+
import type { HttpsServerOptions, ProxyOptions } from '@umijs/bundler-utils';
|
|
4
3
|
import { Configuration } from '../compiled/webpack';
|
|
5
4
|
import Config from '../compiled/webpack-5-chain';
|
|
6
5
|
export declare enum Env {
|
|
@@ -33,7 +32,9 @@ export interface ICopy {
|
|
|
33
32
|
declare type WebpackConfig = Required<Configuration>;
|
|
34
33
|
declare type IBabelPlugin = Function | string | [string, {
|
|
35
34
|
[key: string]: any;
|
|
36
|
-
}]
|
|
35
|
+
}] | [string, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}, string];
|
|
37
38
|
export interface DeadCodeParams {
|
|
38
39
|
patterns?: string[];
|
|
39
40
|
exclude?: string[];
|
|
@@ -88,7 +89,7 @@ export interface IConfig {
|
|
|
88
89
|
};
|
|
89
90
|
proxy?: {
|
|
90
91
|
[key: string]: ProxyOptions;
|
|
91
|
-
};
|
|
92
|
+
} | ProxyOptions[];
|
|
92
93
|
publicPath?: string;
|
|
93
94
|
purgeCSS?: {
|
|
94
95
|
[key: string]: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-webpack",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.18",
|
|
4
4
|
"description": "@umijs/bundler-webpack",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-webpack#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@svgr/plugin-jsx": "^6.2.1",
|
|
35
35
|
"@svgr/plugin-svgo": "^6.2.0",
|
|
36
36
|
"@types/hapi__joi": "17.1.8",
|
|
37
|
-
"@umijs/babel-preset-umi": "4.0.
|
|
38
|
-
"@umijs/bundler-utils": "4.0.
|
|
37
|
+
"@umijs/babel-preset-umi": "4.0.18",
|
|
38
|
+
"@umijs/bundler-utils": "4.0.18",
|
|
39
39
|
"@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
|
|
40
|
-
"@umijs/mfsu": "4.0.
|
|
41
|
-
"@umijs/utils": "4.0.
|
|
40
|
+
"@umijs/mfsu": "4.0.18",
|
|
41
|
+
"@umijs/utils": "4.0.18",
|
|
42
42
|
"cors": "^2.8.5",
|
|
43
43
|
"css-loader": "6.7.1",
|
|
44
44
|
"es5-imcompatible-versions": "^0.1.73",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"copy-webpack-plugin": "10.2.4",
|
|
63
63
|
"css-minimizer-webpack-plugin": "4.0.0",
|
|
64
64
|
"cssnano": "5.1.7",
|
|
65
|
-
"http-proxy-middleware": "2.0.4",
|
|
66
65
|
"less-loader": "10.2.0",
|
|
67
66
|
"mini-css-extract-plugin": "2.6.0",
|
|
68
67
|
"postcss-flexbugs-fixes": "5.0.2",
|
|
@@ -100,7 +99,6 @@
|
|
|
100
99
|
"cssnano",
|
|
101
100
|
"compression",
|
|
102
101
|
"connect-history-api-fallback",
|
|
103
|
-
"http-proxy-middleware",
|
|
104
102
|
"less-loader",
|
|
105
103
|
"mini-css-extract-plugin",
|
|
106
104
|
"postcss-flexbugs-fixes",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 Steven Chim
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Based on definition by DefinitelyTyped:
|
|
3
|
-
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/6f529c6c67a447190f86bfbf894d1061e41e07b7/types/http-proxy-middleware/index.d.ts
|
|
4
|
-
*/
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
import type * as express from '../../express';
|
|
7
|
-
import type * as http from 'http';
|
|
8
|
-
import type * as httpProxy from '../http-proxy';
|
|
9
|
-
import type * as net from 'net';
|
|
10
|
-
import type * as url from 'url';
|
|
11
|
-
export interface Request extends express.Request {
|
|
12
|
-
}
|
|
13
|
-
export interface Response extends express.Response {
|
|
14
|
-
}
|
|
15
|
-
export interface RequestHandler extends express.RequestHandler {
|
|
16
|
-
upgrade?: (req: Request, socket: net.Socket, head: any) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare type Filter = string | string[] | ((pathname: string, req: Request) => boolean);
|
|
19
|
-
export interface Options extends httpProxy.ServerOptions {
|
|
20
|
-
pathRewrite?: {
|
|
21
|
-
[regexp: string]: string;
|
|
22
|
-
} | ((path: string, req: Request) => string) | ((path: string, req: Request) => Promise<string>);
|
|
23
|
-
router?: {
|
|
24
|
-
[hostOrPath: string]: httpProxy.ServerOptions['target'];
|
|
25
|
-
} | ((req: Request) => httpProxy.ServerOptions['target']) | ((req: Request) => Promise<httpProxy.ServerOptions['target']>);
|
|
26
|
-
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
27
|
-
logProvider?: LogProviderCallback;
|
|
28
|
-
onError?: OnErrorCallback;
|
|
29
|
-
onProxyRes?: OnProxyResCallback;
|
|
30
|
-
onProxyReq?: OnProxyReqCallback;
|
|
31
|
-
onProxyReqWs?: OnProxyReqWsCallback;
|
|
32
|
-
onOpen?: OnOpenCallback;
|
|
33
|
-
onClose?: OnCloseCallback;
|
|
34
|
-
}
|
|
35
|
-
interface LogProvider {
|
|
36
|
-
log: Logger;
|
|
37
|
-
debug?: Logger;
|
|
38
|
-
info?: Logger;
|
|
39
|
-
warn?: Logger;
|
|
40
|
-
error?: Logger;
|
|
41
|
-
}
|
|
42
|
-
declare type Logger = (...args: any[]) => void;
|
|
43
|
-
export declare type LogProviderCallback = (provider: LogProvider) => LogProvider;
|
|
44
|
-
/**
|
|
45
|
-
* Use types based on the events listeners from http-proxy
|
|
46
|
-
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/51504fd999031b7f025220fab279f1b2155cbaff/types/http-proxy/index.d.ts
|
|
47
|
-
*/
|
|
48
|
-
export declare type OnErrorCallback = (err: Error, req: Request, res: Response, target?: string | Partial<url.Url>) => void;
|
|
49
|
-
export declare type OnProxyResCallback = (proxyRes: http.IncomingMessage, req: Request, res: Response) => void;
|
|
50
|
-
export declare type OnProxyReqCallback = (proxyReq: http.ClientRequest, req: Request, res: Response, options: httpProxy.ServerOptions) => void;
|
|
51
|
-
export declare type OnProxyReqWsCallback = (proxyReq: http.ClientRequest, req: Request, socket: net.Socket, options: httpProxy.ServerOptions, head: any) => void;
|
|
52
|
-
export declare type OnCloseCallback = (proxyRes: Response, proxySocket: net.Socket, proxyHead: any) => void;
|
|
53
|
-
export declare type OnOpenCallback = (proxySocket: net.Socket) => void;
|
|
54
|
-
export {};
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
// Type definitions for node-http-proxy 1.17
|
|
2
|
-
// Project: https://github.com/nodejitsu/node-http-proxy
|
|
3
|
-
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
|
|
4
|
-
// Florian Oellerich <https://github.com/Raigen>
|
|
5
|
-
// Daniel Schmidt <https://github.com/DanielMSchmidt>
|
|
6
|
-
// Jordan Abreu <https://github.com/jabreu610>
|
|
7
|
-
// Samuel Bodin <https://github.com/bodinsamuel>
|
|
8
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
9
|
-
// TypeScript Version: 2.1
|
|
10
|
-
|
|
11
|
-
/// <reference types="node" />
|
|
12
|
-
|
|
13
|
-
import * as net from 'net';
|
|
14
|
-
import * as http from 'http';
|
|
15
|
-
import * as https from 'https';
|
|
16
|
-
import * as events from 'events';
|
|
17
|
-
import * as url from 'url';
|
|
18
|
-
import * as stream from 'stream';
|
|
19
|
-
|
|
20
|
-
interface ProxyTargetDetailed {
|
|
21
|
-
host: string;
|
|
22
|
-
port: number;
|
|
23
|
-
protocol?: string | undefined;
|
|
24
|
-
hostname?: string | undefined;
|
|
25
|
-
socketPath?: string | undefined;
|
|
26
|
-
key?: string | undefined;
|
|
27
|
-
passphrase?: string | undefined;
|
|
28
|
-
pfx?: Buffer | string | undefined;
|
|
29
|
-
cert?: string | undefined;
|
|
30
|
-
ca?: string | undefined;
|
|
31
|
-
ciphers?: string | undefined;
|
|
32
|
-
secureProtocol?: string | undefined;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
declare class Server extends events.EventEmitter {
|
|
36
|
-
/**
|
|
37
|
-
* Creates the proxy server with specified options.
|
|
38
|
-
* @param options - Config object passed to the proxy
|
|
39
|
-
*/
|
|
40
|
-
constructor(options?: Server.ServerOptions);
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Used for proxying regular HTTP(S) requests
|
|
44
|
-
* @param req - Client request.
|
|
45
|
-
* @param res - Client response.
|
|
46
|
-
* @param options - Additionnal options.
|
|
47
|
-
*/
|
|
48
|
-
web(
|
|
49
|
-
req: http.IncomingMessage,
|
|
50
|
-
res: http.ServerResponse,
|
|
51
|
-
options?: Server.ServerOptions,
|
|
52
|
-
callback?: Server.ErrorCallback,
|
|
53
|
-
): void;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Used for proxying regular HTTP(S) requests
|
|
57
|
-
* @param req - Client request.
|
|
58
|
-
* @param socket - Client socket.
|
|
59
|
-
* @param head - Client head.
|
|
60
|
-
* @param options - Additionnal options.
|
|
61
|
-
*/
|
|
62
|
-
ws(
|
|
63
|
-
req: http.IncomingMessage,
|
|
64
|
-
socket: any,
|
|
65
|
-
head: any,
|
|
66
|
-
options?: Server.ServerOptions,
|
|
67
|
-
callback?: Server.ErrorCallback,
|
|
68
|
-
): void;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* A function that wraps the object in a webserver, for your convenience
|
|
72
|
-
* @param port - Port to listen on
|
|
73
|
-
*/
|
|
74
|
-
listen(port: number): Server;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* A function that closes the inner webserver and stops listening on given port
|
|
78
|
-
*/
|
|
79
|
-
close(callback?: () => void): void;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Creates the proxy server with specified options.
|
|
83
|
-
* @param options Config object passed to the proxy
|
|
84
|
-
* @returns Proxy object with handlers for `ws` and `web` requests
|
|
85
|
-
*/
|
|
86
|
-
static createProxyServer(options?: Server.ServerOptions): Server;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Creates the proxy server with specified options.
|
|
90
|
-
* @param options Config object passed to the proxy
|
|
91
|
-
* @returns Proxy object with handlers for `ws` and `web` requests
|
|
92
|
-
*/
|
|
93
|
-
static createServer(options?: Server.ServerOptions): Server;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Creates the proxy server with specified options.
|
|
97
|
-
* @param options Config object passed to the proxy
|
|
98
|
-
* @returns Proxy object with handlers for `ws` and `web` requests
|
|
99
|
-
*/
|
|
100
|
-
static createProxy(options?: Server.ServerOptions): Server;
|
|
101
|
-
|
|
102
|
-
addListener(event: string, listener: () => void): this;
|
|
103
|
-
on(event: string, listener: () => void): this;
|
|
104
|
-
on(event: "error", listener: Server.ErrorCallback): this;
|
|
105
|
-
on(event: "start", listener: Server.StartCallback): this;
|
|
106
|
-
on(event: "proxyReq", listener: Server.ProxyReqCallback): this;
|
|
107
|
-
on(event: "proxyRes", listener: Server.ProxyResCallback): this;
|
|
108
|
-
on(event: "proxyReqWs", listener: Server.ProxyReqWsCallback): this;
|
|
109
|
-
on(event: "econnreset", listener: Server.EconnresetCallback): this;
|
|
110
|
-
on(event: "end", listener: Server.EndCallback): this;
|
|
111
|
-
on(event: "open", listener: Server.OpenCallback): this;
|
|
112
|
-
on(event: "close", listener: Server.CloseCallback): this;
|
|
113
|
-
|
|
114
|
-
once(event: string, listener: () => void): this;
|
|
115
|
-
once(event: "error", listener: Server.ErrorCallback): this;
|
|
116
|
-
once(event: "start", listener: Server.StartCallback): this;
|
|
117
|
-
once(event: "proxyReq", listener: Server.ProxyReqCallback): this;
|
|
118
|
-
once(event: "proxyRes", listener: Server.ProxyResCallback): this;
|
|
119
|
-
once(event: "proxyReqWs", listener: Server.ProxyReqWsCallback): this;
|
|
120
|
-
once(event: "econnreset", listener: Server.EconnresetCallback): this;
|
|
121
|
-
once(event: "end", listener: Server.EndCallback): this;
|
|
122
|
-
once(event: "open", listener: Server.OpenCallback): this;
|
|
123
|
-
once(event: "close", listener: Server.CloseCallback): this;
|
|
124
|
-
removeListener(event: string, listener: () => void): this;
|
|
125
|
-
removeAllListeners(event?: string): this;
|
|
126
|
-
getMaxListeners(): number;
|
|
127
|
-
setMaxListeners(n: number): this;
|
|
128
|
-
listeners(event: string): Array<() => void>;
|
|
129
|
-
emit(event: string, ...args: any[]): boolean;
|
|
130
|
-
listenerCount(type: string): number;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
declare namespace Server {
|
|
134
|
-
type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
|
|
135
|
-
type ProxyTargetUrl = string | Partial<url.Url>;
|
|
136
|
-
|
|
137
|
-
interface ServerOptions {
|
|
138
|
-
/** URL string to be parsed with the url module. */
|
|
139
|
-
target?: ProxyTarget | undefined;
|
|
140
|
-
/** URL string to be parsed with the url module. */
|
|
141
|
-
forward?: ProxyTargetUrl | undefined;
|
|
142
|
-
/** Object to be passed to http(s).request. */
|
|
143
|
-
agent?: any;
|
|
144
|
-
/** Object to be passed to https.createServer(). */
|
|
145
|
-
ssl?: any;
|
|
146
|
-
/** If you want to proxy websockets. */
|
|
147
|
-
ws?: boolean | undefined;
|
|
148
|
-
/** Adds x- forward headers. */
|
|
149
|
-
xfwd?: boolean | undefined;
|
|
150
|
-
/** Verify SSL certificate. */
|
|
151
|
-
secure?: boolean | undefined;
|
|
152
|
-
/** Explicitly specify if we are proxying to another proxy. */
|
|
153
|
-
toProxy?: boolean | undefined;
|
|
154
|
-
/** Specify whether you want to prepend the target's path to the proxy path. */
|
|
155
|
-
prependPath?: boolean | undefined;
|
|
156
|
-
/** Specify whether you want to ignore the proxy path of the incoming request. */
|
|
157
|
-
ignorePath?: boolean | undefined;
|
|
158
|
-
/** Local interface string to bind for outgoing connections. */
|
|
159
|
-
localAddress?: string | undefined;
|
|
160
|
-
/** Changes the origin of the host header to the target URL. */
|
|
161
|
-
changeOrigin?: boolean | undefined;
|
|
162
|
-
/** specify whether you want to keep letter case of response header key */
|
|
163
|
-
preserveHeaderKeyCase?: boolean | undefined;
|
|
164
|
-
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
|
|
165
|
-
auth?: string | undefined;
|
|
166
|
-
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
|
|
167
|
-
hostRewrite?: string | undefined;
|
|
168
|
-
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
|
|
169
|
-
autoRewrite?: boolean | undefined;
|
|
170
|
-
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
|
|
171
|
-
protocolRewrite?: string | undefined;
|
|
172
|
-
/** rewrites domain of set-cookie headers. */
|
|
173
|
-
cookieDomainRewrite?: false | string | { [oldDomain: string]: string } | undefined;
|
|
174
|
-
/** rewrites path of set-cookie headers. Default: false */
|
|
175
|
-
cookiePathRewrite?: false | string | { [oldPath: string]: string } | undefined;
|
|
176
|
-
/** object with extra headers to be added to target requests. */
|
|
177
|
-
headers?: { [header: string]: string } | undefined;
|
|
178
|
-
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
|
179
|
-
proxyTimeout?: number | undefined;
|
|
180
|
-
/** Timeout (in milliseconds) for incoming requests */
|
|
181
|
-
timeout?: number | undefined;
|
|
182
|
-
/** Specify whether you want to follow redirects. Default: false */
|
|
183
|
-
followRedirects?: boolean | undefined;
|
|
184
|
-
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
|
|
185
|
-
selfHandleResponse?: boolean | undefined;
|
|
186
|
-
/** Buffer */
|
|
187
|
-
buffer?: stream.Stream | undefined;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
type StartCallback = (req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl) => void;
|
|
191
|
-
type ProxyReqCallback = (
|
|
192
|
-
proxyReq: http.ClientRequest,
|
|
193
|
-
req: http.IncomingMessage,
|
|
194
|
-
res: http.ServerResponse,
|
|
195
|
-
options: ServerOptions,
|
|
196
|
-
) => void;
|
|
197
|
-
type ProxyResCallback = (
|
|
198
|
-
proxyRes: http.IncomingMessage,
|
|
199
|
-
req: http.IncomingMessage,
|
|
200
|
-
res: http.ServerResponse,
|
|
201
|
-
) => void;
|
|
202
|
-
type ProxyReqWsCallback = (
|
|
203
|
-
proxyReq: http.ClientRequest,
|
|
204
|
-
req: http.IncomingMessage,
|
|
205
|
-
socket: net.Socket,
|
|
206
|
-
options: ServerOptions,
|
|
207
|
-
head: any,
|
|
208
|
-
) => void;
|
|
209
|
-
type EconnresetCallback = (
|
|
210
|
-
err: Error,
|
|
211
|
-
req: http.IncomingMessage,
|
|
212
|
-
res: http.ServerResponse,
|
|
213
|
-
target: ProxyTargetUrl,
|
|
214
|
-
) => void;
|
|
215
|
-
type EndCallback = (req: http.IncomingMessage, res: http.ServerResponse, proxyRes: http.IncomingMessage) => void;
|
|
216
|
-
type OpenCallback = (proxySocket: net.Socket) => void;
|
|
217
|
-
type CloseCallback = (proxyRes: http.IncomingMessage, proxySocket: net.Socket, proxyHead: any) => void;
|
|
218
|
-
type ErrorCallback = (
|
|
219
|
-
err: Error,
|
|
220
|
-
req: http.IncomingMessage,
|
|
221
|
-
res: http.ServerResponse | net.Socket,
|
|
222
|
-
target?: ProxyTargetUrl,
|
|
223
|
-
) => void;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export = Server;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
(function(){var e={1570:function(e,t,r){"use strict";const n=r(3625);const o=r(4666);const s=r(6183);const i=r(2467);const braces=(e,t={})=>{let r=[];if(Array.isArray(e)){for(let n of e){let e=braces.create(n,t);if(Array.isArray(e)){r.push(...e)}else{r.push(e)}}}else{r=[].concat(braces.create(e,t))}if(t&&t.expand===true&&t.nodupes===true){r=[...new Set(r)]}return r};braces.parse=(e,t={})=>i(e,t);braces.stringify=(e,t={})=>{if(typeof e==="string"){return n(braces.parse(e,t),t)}return n(e,t)};braces.compile=(e,t={})=>{if(typeof e==="string"){e=braces.parse(e,t)}return o(e,t)};braces.expand=(e,t={})=>{if(typeof e==="string"){e=braces.parse(e,t)}let r=s(e,t);if(t.noempty===true){r=r.filter(Boolean)}if(t.nodupes===true){r=[...new Set(r)]}return r};braces.create=(e,t={})=>{if(e===""||e.length<3){return[e]}return t.expand!==true?braces.compile(e,t):braces.expand(e,t)};e.exports=braces},4666:function(e,t,r){"use strict";const n=r(442);const o=r(2456);const compile=(e,t={})=>{let walk=(e,r={})=>{let s=o.isInvalidBrace(r);let i=e.invalid===true&&t.escapeInvalid===true;let u=s===true||i===true;let a=t.escapeInvalid===true?"\\":"";let c="";if(e.isOpen===true){return a+e.value}if(e.isClose===true){return a+e.value}if(e.type==="open"){return u?a+e.value:"("}if(e.type==="close"){return u?a+e.value:")"}if(e.type==="comma"){return e.prev.type==="comma"?"":u?e.value:"|"}if(e.value){return e.value}if(e.nodes&&e.ranges>0){let r=o.reduce(e.nodes);let s=n(...r,{...t,wrap:false,toRegex:true});if(s.length!==0){return r.length>1&&s.length>1?`(${s})`:s}}if(e.nodes){for(let t of e.nodes){c+=walk(t,e)}}return c};return walk(e)};e.exports=compile},487:function(e){"use strict";e.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},6183:function(e,t,r){"use strict";const n=r(442);const o=r(3625);const s=r(2456);const append=(e="",t="",r=false)=>{let n=[];e=[].concat(e);t=[].concat(t);if(!t.length)return e;if(!e.length){return r?s.flatten(t).map((e=>`{${e}}`)):t}for(let o of e){if(Array.isArray(o)){for(let e of o){n.push(append(e,t,r))}}else{for(let e of t){if(r===true&&typeof e==="string")e=`{${e}}`;n.push(Array.isArray(e)?append(o,e,r):o+e)}}}return s.flatten(n)};const expand=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit;let walk=(e,i={})=>{e.queue=[];let u=i;let a=i.queue;while(u.type!=="brace"&&u.type!=="root"&&u.parent){u=u.parent;a=u.queue}if(e.invalid||e.dollar){a.push(append(a.pop(),o(e,t)));return}if(e.type==="brace"&&e.invalid!==true&&e.nodes.length===2){a.push(append(a.pop(),["{}"]));return}if(e.nodes&&e.ranges>0){let i=s.reduce(e.nodes);if(s.exceedsLimit(...i,t.step,r)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let u=n(...i,t);if(u.length===0){u=o(e,t)}a.push(append(a.pop(),u));e.nodes=[];return}let c=s.encloseBrace(e);let l=e.queue;let f=e;while(f.type!=="brace"&&f.type!=="root"&&f.parent){f=f.parent;l=f.queue}for(let t=0;t<e.nodes.length;t++){let r=e.nodes[t];if(r.type==="comma"&&e.type==="brace"){if(t===1)l.push("");l.push("");continue}if(r.type==="close"){a.push(append(a.pop(),l,c));continue}if(r.value&&r.type!=="open"){l.push(append(l.pop(),r.value));continue}if(r.nodes){walk(r,e)}}return l};return s.flatten(walk(e))};e.exports=expand},2467:function(e,t,r){"use strict";const n=r(3625);const{MAX_LENGTH:o,CHAR_BACKSLASH:s,CHAR_BACKTICK:i,CHAR_COMMA:u,CHAR_DOT:a,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:g,CHAR_SINGLE_QUOTE:y,CHAR_NO_BREAK_SPACE:R,CHAR_ZERO_WIDTH_NOBREAK_SPACE:v}=r(487);const parse=(e,t={})=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}let r=t||{};let _=typeof r.maxLength==="number"?Math.min(o,r.maxLength):o;if(e.length>_){throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${_})`)}let b={type:"root",input:e,nodes:[]};let m=[b];let E=b;let C=b;let x=0;let A=e.length;let w=0;let O=0;let S;let H={};const advance=()=>e[w++];const push=e=>{if(e.type==="text"&&C.type==="dot"){C.type="text"}if(C&&C.type==="text"&&e.type==="text"){C.value+=e.value;return}E.nodes.push(e);e.parent=E;e.prev=C;C=e;return e};push({type:"bos"});while(w<A){E=m[m.length-1];S=advance();if(S===v||S===R){continue}if(S===s){push({type:"text",value:(t.keepEscaping?S:"")+advance()});continue}if(S===d){push({type:"text",value:"\\"+S});continue}if(S===h){x++;let e=true;let t;while(w<A&&(t=advance())){S+=t;if(t===h){x++;continue}if(t===s){S+=advance();continue}if(t===d){x--;if(x===0){break}}}push({type:"text",value:S});continue}if(S===c){E=push({type:"paren",nodes:[]});m.push(E);push({type:"text",value:S});continue}if(S===l){if(E.type!=="paren"){push({type:"text",value:S});continue}E=m.pop();push({type:"text",value:S});E=m[m.length-1];continue}if(S===g||S===y||S===i){let e=S;let r;if(t.keepQuotes!==true){S=""}while(w<A&&(r=advance())){if(r===s){S+=r+advance();continue}if(r===e){if(t.keepQuotes===true)S+=r;break}S+=r}push({type:"text",value:S});continue}if(S===f){O++;let e=C.value&&C.value.slice(-1)==="$"||E.dollar===true;let t={type:"brace",open:true,close:false,dollar:e,depth:O,commas:0,ranges:0,nodes:[]};E=push(t);m.push(E);push({type:"open",value:S});continue}if(S===p){if(E.type!=="brace"){push({type:"text",value:S});continue}let e="close";E=m.pop();E.close=true;push({type:e,value:S});O--;E=m[m.length-1];continue}if(S===u&&O>0){if(E.ranges>0){E.ranges=0;let e=E.nodes.shift();E.nodes=[e,{type:"text",value:n(E)}]}push({type:"comma",value:S});E.commas++;continue}if(S===a&&O>0&&E.commas===0){let e=E.nodes;if(O===0||e.length===0){push({type:"text",value:S});continue}if(C.type==="dot"){E.range=[];C.value+=S;C.type="range";if(E.nodes.length!==3&&E.nodes.length!==5){E.invalid=true;E.ranges=0;C.type="text";continue}E.ranges++;E.args=[];continue}if(C.type==="range"){e.pop();let t=e[e.length-1];t.value+=C.value+S;C=t;E.ranges--;continue}push({type:"dot",value:S});continue}push({type:"text",value:S})}do{E=m.pop();if(E.type!=="root"){E.nodes.forEach((e=>{if(!e.nodes){if(e.type==="open")e.isOpen=true;if(e.type==="close")e.isClose=true;if(!e.nodes)e.type="text";e.invalid=true}}));let e=m[m.length-1];let t=e.nodes.indexOf(E);e.nodes.splice(t,1,...E.nodes)}}while(m.length>0);push({type:"eos"});return b};e.exports=parse},3625:function(e,t,r){"use strict";const n=r(2456);e.exports=(e,t={})=>{let stringify=(e,r={})=>{let o=t.escapeInvalid&&n.isInvalidBrace(r);let s=e.invalid===true&&t.escapeInvalid===true;let i="";if(e.value){if((o||s)&&n.isOpenOrClose(e)){return"\\"+e.value}return e.value}if(e.value){return e.value}if(e.nodes){for(let t of e.nodes){i+=stringify(t)}}return i};return stringify(e)}},2456:function(e,t){"use strict";t.isInteger=e=>{if(typeof e==="number"){return Number.isInteger(e)}if(typeof e==="string"&&e.trim()!==""){return Number.isInteger(Number(e))}return false};t.find=(e,t)=>e.nodes.find((e=>e.type===t));t.exceedsLimit=(e,r,n=1,o)=>{if(o===false)return false;if(!t.isInteger(e)||!t.isInteger(r))return false;return(Number(r)-Number(e))/Number(n)>=o};t.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];if(!n)return;if(r&&n.type===r||n.type==="open"||n.type==="close"){if(n.escaped!==true){n.value="\\"+n.value;n.escaped=true}}};t.encloseBrace=e=>{if(e.type!=="brace")return false;if(e.commas>>0+e.ranges>>0===0){e.invalid=true;return true}return false};t.isInvalidBrace=e=>{if(e.type!=="brace")return false;if(e.invalid===true||e.dollar)return true;if(e.commas>>0+e.ranges>>0===0){e.invalid=true;return true}if(e.open!==true||e.close!==true){e.invalid=true;return true}return false};t.isOpenOrClose=e=>{if(e.type==="open"||e.type==="close"){return true}return e.open===true||e.close===true};t.reduce=e=>e.reduce(((e,t)=>{if(t.type==="text")e.push(t.value);if(t.type==="range")t.type="text";return e}),[]);t.flatten=(...e)=>{const t=[];const flat=e=>{for(let r=0;r<e.length;r++){let n=e[r];Array.isArray(n)?flat(n,t):n!==void 0&&t.push(n)}return t};flat(e);return t}},664:function(e,t,r){t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=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`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0;let o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}n++;if(e==="%c"){o=n}}));t.splice(o,0,r)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=r(9156)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},9156:function(e,t,r){function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=r(1367);createDebug.destroy=destroy;Object.keys(e).forEach((t=>{createDebug[t]=e[t]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;let r=null;let n;let o;function debug(...e){if(!debug.enabled){return}const r=debug;const n=Number(new Date);const o=n-(t||n);r.diff=o;r.prev=t;r.curr=n;t=n;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,n)=>{if(t==="%%"){return"%"}s++;const o=createDebug.formatters[n];if(typeof o==="function"){const n=e[s];t=o.call(r,n);e.splice(s,1);s--}return t}));createDebug.formatArgs.call(r,e);const i=r.log||createDebug.log;i.apply(r,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(r!==null){return r}if(n!==createDebug.namespaces){n=createDebug.namespaces;o=createDebug.enabled(e)}return o},set:e=>{r=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const n=r.length;for(t=0;t<n;t++){if(!r[t]){continue}e=r[t].replace(/\*/g,".*?");if(e[0]==="-"){createDebug.skips.push(new RegExp("^"+e.substr(1)+"$"))}else{createDebug.names.push(new RegExp("^"+e+"$"))}}}function disable(){const e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t<r;t++){if(createDebug.skips[t].test(e)){return false}}for(t=0,r=createDebug.names.length;t<r;t++){if(createDebug.names[t].test(e)){return true}}return false}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},341:function(e,t,r){if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=r(664)}else{e.exports=r(3103)}},3103:function(e,t,r){const n=r(6224);const o=r(3837);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=o.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=r(1270);if(e&&(e.stderr||e).level>=2){t.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(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n)){n=true}else if(/^(no|off|false|disabled)$/i.test(n)){n=false}else if(n==="null"){n=null}else{n=Number(n)}e[r]=n;return e}),{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:n}=this;if(n){const n=this.color;const o="[3"+(n<8?n:"8;5;"+n);const s=` ${o};1m${r} [0m`;t[0]=s+t[0].split("\n").join("\n"+s);t.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(o.format(...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++){e.inspectOpts[r[n]]=t.inspectOpts[r[n]]}}e.exports=r(9156)(t);const{formatters:s}=e.exports;s.o=function(e){this.inspectOpts.colors=this.useColors;return o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};s.O=function(e){this.inspectOpts.colors=this.useColors;return o.inspect(e,this.inspectOpts)}},5377:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function Events(){}if(Object.create){Events.prototype=Object.create(null);if(!(new Events).__proto__)r=false}function EE(e,t,r){this.fn=e;this.context=t;this.once=r||false}function addListener(e,t,n,o,s){if(typeof n!=="function"){throw new TypeError("The listener must be a function")}var i=new EE(n,o||e,s),u=r?r+t:t;if(!e._events[u])e._events[u]=i,e._eventsCount++;else if(!e._events[u].fn)e._events[u].push(i);else e._events[u]=[e._events[u],i];return e}function clearEvent(e,t){if(--e._eventsCount===0)e._events=new Events;else delete e._events[t]}function EventEmitter(){this._events=new Events;this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],n,o;if(this._eventsCount===0)return e;for(o in n=this._events){if(t.call(n,o))e.push(r?o.slice(1):o)}if(Object.getOwnPropertySymbols){return e.concat(Object.getOwnPropertySymbols(n))}return e};EventEmitter.prototype.listeners=function listeners(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,i=new Array(s);o<s;o++){i[o]=n[o].fn}return i};EventEmitter.prototype.listenerCount=function listenerCount(e){var t=r?r+e:e,n=this._events[t];if(!n)return 0;if(n.fn)return 1;return n.length};EventEmitter.prototype.emit=function emit(e,t,n,o,s,i){var u=r?r+e:e;if(!this._events[u])return false;var a=this._events[u],c=arguments.length,l,f;if(a.fn){if(a.once)this.removeListener(e,a.fn,undefined,true);switch(c){case 1:return a.fn.call(a.context),true;case 2:return a.fn.call(a.context,t),true;case 3:return a.fn.call(a.context,t,n),true;case 4:return a.fn.call(a.context,t,n,o),true;case 5:return a.fn.call(a.context,t,n,o,s),true;case 6:return a.fn.call(a.context,t,n,o,s,i),true}for(f=1,l=new Array(c-1);f<c;f++){l[f-1]=arguments[f]}a.fn.apply(a.context,l)}else{var p=a.length,h;for(f=0;f<p;f++){if(a[f].once)this.removeListener(e,a[f].fn,undefined,true);switch(c){case 1:a[f].fn.call(a[f].context);break;case 2:a[f].fn.call(a[f].context,t);break;case 3:a[f].fn.call(a[f].context,t,n);break;case 4:a[f].fn.call(a[f].context,t,n,o);break;default:if(!l)for(h=1,l=new Array(c-1);h<c;h++){l[h-1]=arguments[h]}a[f].fn.apply(a[f].context,l)}}}return true};EventEmitter.prototype.on=function on(e,t,r){return addListener(this,e,t,r,false)};EventEmitter.prototype.once=function once(e,t,r){return addListener(this,e,t,r,true)};EventEmitter.prototype.removeListener=function removeListener(e,t,n,o){var s=r?r+e:e;if(!this._events[s])return this;if(!t){clearEvent(this,s);return this}var i=this._events[s];if(i.fn){if(i.fn===t&&(!o||i.once)&&(!n||i.context===n)){clearEvent(this,s)}}else{for(var u=0,a=[],c=i.length;u<c;u++){if(i[u].fn!==t||o&&!i[u].once||n&&i[u].context!==n){a.push(i[u])}}if(a.length)this._events[s]=a.length===1?a[0]:a;else clearEvent(this,s)}return this};EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;if(e){t=r?r+e:e;if(this._events[t])clearEvent(this,t)}else{this._events=new Events;this._eventsCount=0}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prefixed=r;EventEmitter.EventEmitter=EventEmitter;if(true){e.exports=EventEmitter}},442:function(e,t,r){"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
6
|
-
* Licensed under the MIT License.
|
|
7
|
-
*/const n=r(3837);const o=r(211);const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let r=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++r]==="0");return r>0};const stringify=(e,t,r)=>{if(typeof e==="string"||typeof t==="string"){return true}return r.stringify===true};const pad=(e,t,r)=>{if(t>0){let r=e[0]==="-"?"-":"";if(r)e=e.slice(1);e=r+e.padStart(r?t-1:t,"0")}if(r===false){return String(e)}return e};const toMaxLen=(e,t)=>{let r=e[0]==="-"?"-":"";if(r){e=e.slice(1);t--}while(e.length<t)e="0"+e;return r?"-"+e:e};const toSequence=(e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0));e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r=t.capture?"":"?:";let n="";let o="";let s;if(e.positives.length){n=e.positives.join("|")}if(e.negatives.length){o=`-(${r}${e.negatives.join("|")})`}if(n&&o){s=`${n}|${o}`}else{s=n||o}if(t.wrap){return`(${r}${s})`}return s};const toRange=(e,t,r,n)=>{if(r){return o(e,t,{wrap:false,...n})}let s=String.fromCharCode(e);if(e===t)return s;let i=String.fromCharCode(t);return`[${s}-${i}]`};const toRegex=(e,t,r)=>{if(Array.isArray(e)){let t=r.wrap===true;let n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return o(e,t,r)};const rangeError=(...e)=>new RangeError("Invalid range arguments: "+n.inspect(...e));const invalidRange=(e,t,r)=>{if(r.strictRanges===true)throw rangeError([e,t]);return[]};const invalidStep=(e,t)=>{if(t.strictRanges===true){throw new TypeError(`Expected step "${e}" to be a number`)}return[]};const fillNumbers=(e,t,r=1,n={})=>{let o=Number(e);let s=Number(t);if(!Number.isInteger(o)||!Number.isInteger(s)){if(n.strictRanges===true)throw rangeError([e,t]);return[]}if(o===0)o=0;if(s===0)s=0;let i=o>s;let u=String(e);let a=String(t);let c=String(r);r=Math.max(Math.abs(r),1);let l=zeros(u)||zeros(a)||zeros(c);let f=l?Math.max(u.length,a.length,c.length):0;let p=l===false&&stringify(e,t,n)===false;let h=n.transform||transform(p);if(n.toRegex&&r===1){return toRange(toMaxLen(e,f),toMaxLen(t,f),true,n)}let d={negatives:[],positives:[]};let push=e=>d[e<0?"negatives":"positives"].push(Math.abs(e));let g=[];let y=0;while(i?o>=s:o<=s){if(n.toRegex===true&&r>1){push(o)}else{g.push(pad(h(o,y),f,p))}o=i?o-r:o+r;y++}if(n.toRegex===true){return r>1?toSequence(d,n):toRegex(g,null,{wrap:false,...n})}return g};const fillLetters=(e,t,r=1,n={})=>{if(!isNumber(e)&&e.length>1||!isNumber(t)&&t.length>1){return invalidRange(e,t,n)}let o=n.transform||(e=>String.fromCharCode(e));let s=`${e}`.charCodeAt(0);let i=`${t}`.charCodeAt(0);let u=s>i;let a=Math.min(s,i);let c=Math.max(s,i);if(n.toRegex&&r===1){return toRange(a,c,false,n)}let l=[];let f=0;while(u?s>=i:s<=i){l.push(o(s,f));s=u?s-r:s+r;f++}if(n.toRegex===true){return toRegex(l,null,{wrap:false,options:n})}return l};const fill=(e,t,r,n={})=>{if(t==null&&isValidValue(e)){return[e]}if(!isValidValue(e)||!isValidValue(t)){return invalidRange(e,t,n)}if(typeof r==="function"){return fill(e,t,1,{transform:r})}if(isObject(r)){return fill(e,t,0,r)}let o={...n};if(o.capture===true)o.wrap=true;r=r||o.step||1;if(!isNumber(r)){if(r!=null&&!isObject(r))return invalidStep(r,o);return fill(e,t,1,r)}if(isNumber(e)&&isNumber(t)){return fillNumbers(e,t,r,o)}return fillLetters(e,t,Math.max(Math.abs(r),1),o)};e.exports=fill},4767:function(e,t,r){var n;e.exports=function(){if(!n){try{n=r(341)("follow-redirects")}catch(e){}if(typeof n!=="function"){n=function(){}}}n.apply(null,arguments)}},8973:function(e,t,r){var n=r(7310);var o=n.URL;var s=r(2181);var i=r(5687);var u=r(2781).Writable;var a=r(9491);var c=r(4767);var l=["abort","aborted","connect","error","socket","timeout"];var f=Object.create(null);l.forEach((function(e){f[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}}));var p=createErrorType("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var h=createErrorType("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded");var d=createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var g=createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");function RedirectableRequest(e,t){u.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(e){r._processResponse(e)};this._performRequest()}RedirectableRequest.prototype=Object.create(u.prototype);RedirectableRequest.prototype.abort=function(){abortRequest(this._currentRequest);this.emit("abort")};RedirectableRequest.prototype.write=function(e,t,r){if(this._ending){throw new g}if(!(typeof e==="string"||typeof e==="object"&&"length"in e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(typeof t==="function"){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new d);this.abort()}};RedirectableRequest.prototype.end=function(e,t,r){if(typeof e==="function"){r=e;e=t=null}else if(typeof t==="function"){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var o=this._currentRequest;this.write(e,t,(function(){n._ended=true;o.end(null,null,r)}));this._ending=true}};RedirectableRequest.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};RedirectableRequest.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};RedirectableRequest.prototype.setTimeout=function(e,t){var r=this;function destroyOnTimeout(t){t.setTimeout(e);t.removeListener("timeout",t.destroy);t.addListener("timeout",t.destroy)}function startTimer(t){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout((function(){r.emit("timeout");clearTimer()}),e);destroyOnTimeout(t)}function clearTimer(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",clearTimer);r.removeListener("error",clearTimer);r.removeListener("response",clearTimer);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",startTimer)}}if(t){this.on("timeout",t)}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);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){RedirectableRequest.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}}));["aborted","connection","socket"].forEach((function(e){Object.defineProperty(RedirectableRequest.prototype,e,{get:function(){return this._currentRequest[e]}})}));RedirectableRequest.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};RedirectableRequest.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){this.emit("error",new TypeError("Unsupported protocol "+e));return}if(this._options.agents){var r=e.substr(0,e.length-1);this._options.agent=this._options.agents[r]}var o=this._currentRequest=t.request(this._options,this._onNativeResponse);this._currentUrl=n.format(this._options);o._redirectable=this;for(var s=0;s<l.length;s++){o.on(l[s],f[l[s]])}if(this._isRedirect){var i=0;var u=this;var a=this._requestBodyBuffers;(function writeNext(e){if(o===u._currentRequest){if(e){u.emit("error",e)}else if(i<a.length){var t=a[i++];if(!o.finished){o.write(t.data,t.encoding,writeNext)}}else if(u._ended){o.end()}}})()}};RedirectableRequest.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}abortRequest(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){this.emit("error",new h);return}if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];removeMatchingHeaders(/^content-/i,this._options.headers)}var o=removeMatchingHeaders(/^host$/i,this._options.headers);var s=n.parse(this._currentUrl);var i=o||s.host;var u=/^\w+:/.test(r)?this._currentUrl:n.format(Object.assign(s,{host:i}));var a;try{a=n.resolve(u,r)}catch(e){this.emit("error",new p(e));return}c("redirecting to",a);this._isRedirect=true;var l=n.parse(a);Object.assign(this._options,l);if(l.protocol!==s.protocol&&l.protocol!=="https:"||l.host!==i&&!isSubdomain(l.host,i)){removeMatchingHeaders(/^(?:authorization|cookie)$/i,this._options.headers)}if(typeof this._options.beforeRedirect==="function"){var f={headers:e.headers};try{this._options.beforeRedirect.call(null,this._options,f)}catch(e){this.emit("error",e);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new p(e))}};function wrap(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach((function(s){var i=s+":";var u=r[i]=e[s];var l=t[s]=Object.create(u);function request(e,s,u){if(typeof e==="string"){var l=e;try{e=urlToOptions(new o(l))}catch(t){e=n.parse(l)}}else if(o&&e instanceof o){e=urlToOptions(e)}else{u=s;s=e;e={protocol:i}}if(typeof s==="function"){u=s;s=null}s=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,s);s.nativeProtocols=r;a.equal(s.protocol,i,"protocol mismatch");c("options",s);return new RedirectableRequest(s,u)}function get(e,t,r){var n=l.request(e,t,r);n.end();return n}Object.defineProperties(l,{request:{value:request,configurable:true,enumerable:true,writable:true},get:{value:get,configurable:true,enumerable:true,writable:true}})}));return t}function noop(){}function urlToOptions(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};if(e.port!==""){t.port=Number(e.port)}return t}function removeMatchingHeaders(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?undefined:String(r).trim()}function createErrorType(e,t){function CustomError(e){Error.captureStackTrace(this,this.constructor);if(!e){this.message=t}else{this.message=t+": "+e.message;this.cause=e}}CustomError.prototype=new Error;CustomError.prototype.constructor=CustomError;CustomError.prototype.name="Error ["+e+"]";CustomError.prototype.code=e;return CustomError}function abortRequest(e){for(var t=0;t<l.length;t++){e.removeListener(l[t],f[l[t]])}e.on("error",noop);e.abort()}function isSubdomain(e,t){const r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}e.exports=wrap({http:s,https:i});e.exports.wrap=wrap},3975:function(e){"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}},9843:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getHandlers=t.init=void 0;const n=r(6589);const o=(0,n.getInstance)();function init(e,t){const r=getHandlers(t);for(const t of Object.keys(r)){e.on(t,r[t])}o.debug("[HPM] Subscribed to http-proxy events:",Object.keys(r))}t.init=init;function getHandlers(e){const t={error:"onError",proxyReq:"onProxyReq",proxyReqWs:"onProxyReqWs",proxyRes:"onProxyRes",open:"onOpen",close:"onClose"};const r={};for(const[n,o]of Object.entries(t)){const t=e?e[o]:null;if(typeof t==="function"){r[n]=t}}if(typeof r.error!=="function"){r.error=defaultErrorHandler}if(typeof r.close!=="function"){r.close=logClose}return r}t.getHandlers=getHandlers;function defaultErrorHandler(e,t,r){if(!t&&!r){throw e}const n=t.headers&&t.headers.host;const o=e.code;if(r.writeHead&&!r.headersSent){if(/HPE_INVALID/.test(o)){r.writeHead(502)}else{switch(o){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":r.writeHead(504);break;default:r.writeHead(500)}}}r.end(`Error occurred while trying to proxy: ${n}${t.url}`)}function logClose(e,t,r){o.info("[HPM] Client disconnected")}},9934:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createConfig=void 0;const n=r(4273);const o=r(7310);const s=r(7431);const i=r(6589);const u=(0,i.getInstance)();function createConfig(e,t){const r={context:undefined,options:{}};if(isContextless(e,t)){r.context="/";r.options=Object.assign(r.options,e)}else if(isStringShortHand(e)){const n=o.parse(e);const s=[n.protocol,"//",n.host].join("");r.context=n.pathname||"/";r.options=Object.assign(r.options,{target:s},t);if(n.protocol==="ws:"||n.protocol==="wss:"){r.options.ws=true}}else{r.context=e;r.options=Object.assign(r.options,t)}configureLogger(r.options);if(!r.options.target&&!r.options.router){throw new Error(s.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING)}return r}t.createConfig=createConfig;function isStringShortHand(e){if(typeof e==="string"){return!!o.parse(e).host}}function isContextless(e,t){return n(e)&&(t==null||Object.keys(t).length===0)}function configureLogger(e){if(e.logLevel){u.setLevel(e.logLevel)}if(e.logProvider){u.setProvider(e.logProvider)}}},6178:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.match=void 0;const n=r(6654);const o=r(1224);const s=r(7310);const i=r(7431);function match(e,t,r){if(isStringPath(e)){return matchSingleStringPath(e,t)}if(isGlobPath(e)){return matchSingleGlobPath(e,t)}if(Array.isArray(e)){if(e.every(isStringPath)){return matchMultiPath(e,t)}if(e.every(isGlobPath)){return matchMultiGlobPath(e,t)}throw new Error(i.ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY)}if(typeof e==="function"){const n=getUrlPathName(t);return e(n,r)}throw new Error(i.ERRORS.ERR_CONTEXT_MATCHER_GENERIC)}t.match=match;function matchSingleStringPath(e,t){const r=getUrlPathName(t);return r.indexOf(e)===0}function matchSingleGlobPath(e,t){const r=getUrlPathName(t);const n=o([r],e);return n&&n.length>0}function matchMultiGlobPath(e,t){return matchSingleGlobPath(e,t)}function matchMultiPath(e,t){let r=false;for(const n of e){if(matchSingleStringPath(n,t)){r=true;break}}return r}function getUrlPathName(e){return e&&s.parse(e).pathname}function isStringPath(e){return typeof e==="string"&&!n(e)}function isGlobPath(e){return n(e)}},7431:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ERRORS=void 0;var r;(function(e){e["ERR_CONFIG_FACTORY_TARGET_MISSING"]='[HPM] Missing "target" option. Example: {target: "http://www.example.org"}';e["ERR_CONTEXT_MATCHER_GENERIC"]='[HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]';e["ERR_CONTEXT_MATCHER_INVALID_ARRAY"]='[HPM] Invalid context. Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"]';e["ERR_PATH_REWRITER_CONFIG"]="[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function"})(r=t.ERRORS||(t.ERRORS={}))},9805:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fixRequestBody=void 0;const n=r(3477);function fixRequestBody(e,t){const r=t.body;if(!r){return}const o=e.getHeader("Content-Type");const writeBody=t=>{e.setHeader("Content-Length",Buffer.byteLength(t));e.write(t)};if(o&&o.includes("application/json")){writeBody(JSON.stringify(r))}if(o&&o.includes("application/x-www-form-urlencoded")){writeBody(n.stringify(r))}}t.fixRequestBody=fixRequestBody},5987:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(9039),t)},9039:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fixRequestBody=t.responseInterceptor=void 0;var n=r(2762);Object.defineProperty(t,"responseInterceptor",{enumerable:true,get:function(){return n.responseInterceptor}});var o=r(9805);Object.defineProperty(t,"fixRequestBody",{enumerable:true,get:function(){return o.fixRequestBody}})},2762:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.responseInterceptor=void 0;const n=r(9796);function responseInterceptor(e){return async function proxyRes(proxyRes,t,r){const n=proxyRes;let o=Buffer.from("","utf8");const s=decompress(proxyRes,proxyRes.headers["content-encoding"]);s.on("data",(e=>o=Buffer.concat([o,e])));s.on("end",(async()=>{copyHeaders(proxyRes,r);const s=Buffer.from(await e(o,n,t,r));r.setHeader("content-length",Buffer.byteLength(s,"utf8"));r.write(s);r.end()}));s.on("error",(e=>{r.end(`Error fetching proxied request: ${e.message}`)}))}}t.responseInterceptor=responseInterceptor;function decompress(e,t){let r=e;let o;switch(t){case"gzip":o=n.createGunzip();break;case"br":o=n.createBrotliDecompress();break;case"deflate":o=n.createInflate();break;default:break}if(o){r.pipe(o);r=o}return r}function copyHeaders(e,t){t.statusCode=e.statusCode;t.statusMessage=e.statusMessage;if(t.setHeader){let r=Object.keys(e.headers);r=r.filter((e=>!["content-encoding","transfer-encoding"].includes(e)));r.forEach((r=>{let n=e.headers[r];if(r==="set-cookie"){n=Array.isArray(n)?n:[n];n=n.map((e=>e.replace(/Domain=[^;]+?/i,"")))}t.setHeader(r,n)}))}else{t.headers=e.headers}}},3808:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HttpProxyMiddleware=void 0;const n=r(6873);const o=r(9934);const s=r(6178);const i=r(9843);const u=r(6589);const a=r(4773);const c=r(4367);class HttpProxyMiddleware{constructor(e,t){this.logger=(0,u.getInstance)();this.wsInternalSubscribed=false;this.serverOnCloseSubscribed=false;this.middleware=async(e,t,r)=>{var n,o;if(this.shouldProxy(this.config.context,e)){try{const r=await this.prepareProxyRequest(e);this.proxy.web(e,t,r)}catch(e){r(e)}}else{r()}const s=(o=(n=e.socket)!==null&&n!==void 0?n:e.connection)===null||o===void 0?void 0:o.server;if(s&&!this.serverOnCloseSubscribed){s.on("close",(()=>{this.logger.info("[HPM] server close signal received: closing proxy server");this.proxy.close()}));this.serverOnCloseSubscribed=true}if(this.proxyOptions.ws===true){this.catchUpgradeRequest(s)}};this.catchUpgradeRequest=e=>{if(!this.wsInternalSubscribed){e.on("upgrade",this.handleUpgrade);this.wsInternalSubscribed=true}};this.handleUpgrade=async(e,t,r)=>{if(this.shouldProxy(this.config.context,e)){const n=await this.prepareProxyRequest(e);this.proxy.ws(e,t,r,n);this.logger.info("[HPM] Upgrading to WebSocket")}};this.shouldProxy=(e,t)=>{const r=t.originalUrl||t.url;return s.match(e,r,t)};this.prepareProxyRequest=async e=>{e.url=e.originalUrl||e.url;const t=e.url;const r=Object.assign({},this.proxyOptions);await this.applyRouter(e,r);await this.applyPathRewrite(e,this.pathRewriter);if(this.proxyOptions.logLevel==="debug"){const n=(0,u.getArrow)(t,e.url,this.proxyOptions.target,r.target);this.logger.debug("[HPM] %s %s %s %s",e.method,t,n,r.target)}return r};this.applyRouter=async(e,t)=>{let r;if(t.router){r=await c.getTarget(e,t);if(r){this.logger.debug('[HPM] Router new target: %s -> "%s"',t.target,r);t.target=r}}};this.applyPathRewrite=async(e,t)=>{if(t){const r=await t(e.url,e);if(typeof r==="string"){e.url=r}else{this.logger.info("[HPM] pathRewrite: No rewritten path found. (%s)",e.url)}}};this.logError=(e,t,r,n)=>{var o;const s=((o=t.headers)===null||o===void 0?void 0:o.host)||t.hostname||t.host;const i=`${s}${t.url}`;const u=`${n===null||n===void 0?void 0:n.href}`;const a="[HPM] Error occurred while proxying request %s to %s [%s] (%s)";const c="https://nodejs.org/api/errors.html#errors_common_system_errors";this.logger.error(a,i,u,e.code||e,c)};this.config=(0,o.createConfig)(e,t);this.proxyOptions=this.config.options;this.proxy=n.createProxyServer({});this.logger.info(`[HPM] Proxy created: ${this.config.context} -> ${this.proxyOptions.target}`);this.pathRewriter=a.createPathRewriter(this.proxyOptions.pathRewrite);i.init(this.proxy,this.proxyOptions);this.proxy.on("error",this.logError);this.middleware.upgrade=(e,t,r)=>{if(!this.wsInternalSubscribed){this.handleUpgrade(e,t,r)}}}}t.HttpProxyMiddleware=HttpProxyMiddleware},3685:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.createProxyMiddleware=void 0;const s=r(3808);function createProxyMiddleware(e,t){const{middleware:r}=new s.HttpProxyMiddleware(e,t);return r}t.createProxyMiddleware=createProxyMiddleware;o(r(5987),t)},6589:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getArrow=t.getInstance=void 0;const n=r(3837);let o;const s={log:console.log,debug:console.log,info:console.info,warn:console.warn,error:console.error};var i;(function(e){e[e["debug"]=10]="debug";e[e["info"]=20]="info";e[e["warn"]=30]="warn";e[e["error"]=50]="error";e[e["silent"]=80]="silent"})(i||(i={}));function getInstance(){if(!o){o=new Logger}return o}t.getInstance=getInstance;class Logger{constructor(){this.setLevel("info");this.setProvider((()=>s))}log(){this.provider.log(this._interpolate.apply(null,arguments))}debug(){if(this._showLevel("debug")){this.provider.debug(this._interpolate.apply(null,arguments))}}info(){if(this._showLevel("info")){this.provider.info(this._interpolate.apply(null,arguments))}}warn(){if(this._showLevel("warn")){this.provider.warn(this._interpolate.apply(null,arguments))}}error(){if(this._showLevel("error")){this.provider.error(this._interpolate.apply(null,arguments))}}setLevel(e){if(this.isValidLevel(e)){this.logLevel=e}}setProvider(e){if(e&&this.isValidProvider(e)){this.provider=e(s)}}isValidProvider(e){const t=true;if(e&&typeof e!=="function"){throw new Error("[HPM] Log provider config error. Expecting a function.")}return t}isValidLevel(e){const t=Object.keys(i);const r=t.includes(e);if(!r){throw new Error("[HPM] Log level error. Invalid logLevel.")}return r}_showLevel(e){let t=false;const r=i[this.logLevel];if(r&&r<=i[e]){t=true}return t}_interpolate(e,...t){const r=n.format(e,...t);return r}}function getArrow(e,t,r,n){const o=[">"];const s=r!==n;const i=e!==t;if(i&&!s){o.unshift("~")}else if(!i&&s){o.unshift("=")}else if(i&&s){o.unshift("≈")}else{o.unshift("-")}return o.join("")}t.getArrow=getArrow},4773:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createPathRewriter=void 0;const n=r(4273);const o=r(7431);const s=r(6589);const i=(0,s.getInstance)();function createPathRewriter(e){let t;if(!isValidRewriteConfig(e)){return}if(typeof e==="function"){const t=e;return t}else{t=parsePathRewriteRules(e);return rewritePath}function rewritePath(e){let r=e;for(const n of t){if(n.regex.test(e)){r=r.replace(n.regex,n.value);i.debug('[HPM] Rewriting path from "%s" to "%s"',e,r);break}}return r}}t.createPathRewriter=createPathRewriter;function isValidRewriteConfig(e){if(typeof e==="function"){return true}else if(n(e)){return Object.keys(e).length!==0}else if(e===undefined||e===null){return false}else{throw new Error(o.ERRORS.ERR_PATH_REWRITER_CONFIG)}}function parsePathRewriteRules(e){const t=[];if(n(e)){for(const[r]of Object.entries(e)){t.push({regex:new RegExp(r),value:e[r]});i.info('[HPM] Proxy rewrite rule created: "%s" ~> "%s"',r,e[r])}}return t}},4367:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getTarget=void 0;const n=r(4273);const o=r(6589);const s=(0,o.getInstance)();async function getTarget(e,t){let r;const o=t.router;if(n(o)){r=getTargetFromProxyTable(e,o)}else if(typeof o==="function"){r=await o(e)}return r}t.getTarget=getTarget;function getTargetFromProxyTable(e,t){let r;const n=e.headers.host;const o=e.url;const i=n+o;for(const[e]of Object.entries(t)){if(containsPath(e)){if(i.indexOf(e)>-1){r=t[e];s.debug('[HPM] Router table match: "%s"',e);break}}else{if(e===n){r=t[e];s.debug('[HPM] Router table match: "%s"',n);break}}}return r}function containsPath(e){return e.indexOf("/")>-1}},6873:function(e,t,r){
|
|
8
|
-
/*!
|
|
9
|
-
* Caron dimonio, con occhi di bragia
|
|
10
|
-
* loro accennando, tutte le raccoglie;
|
|
11
|
-
* batte col remo qualunque s’adagia
|
|
12
|
-
*
|
|
13
|
-
* Charon the demon, with the eyes of glede,
|
|
14
|
-
* Beckoning to them, collects them all together,
|
|
15
|
-
* Beats with his oar whoever lags behind
|
|
16
|
-
*
|
|
17
|
-
* Dante - The Divine Comedy (Canto III)
|
|
18
|
-
*/
|
|
19
|
-
e.exports=r(8831)},8831:function(e,t,r){var n=r(9691).Server;function createProxyServer(e){return new n(e)}n.createProxyServer=createProxyServer;n.createServer=createProxyServer;n.createProxy=createProxyServer;e.exports=n},8398:function(e,t,r){var n=t,o=r(7310),s=r(3837)._extend,i=r(926);var u=/(^|,)\s*upgrade\s*($|,)/i,a=/^https|wss/;n.isSSL=a;n.setupOutgoing=function(e,t,r,c){e.port=t[c||"target"].port||(a.test(t[c||"target"].protocol)?443:80);["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach((function(r){e[r]=t[c||"target"][r]}));e.method=t.method||r.method;e.headers=s({},r.headers);if(t.headers){s(e.headers,t.headers)}if(t.auth){e.auth=t.auth}if(t.ca){e.ca=t.ca}if(a.test(t[c||"target"].protocol)){e.rejectUnauthorized=typeof t.secure==="undefined"?true:t.secure}e.agent=t.agent||false;e.localAddress=t.localAddress;if(!e.agent){e.headers=e.headers||{};if(typeof e.headers.connection!=="string"||!u.test(e.headers.connection)){e.headers.connection="close"}}var l=t[c||"target"];var f=l&&t.prependPath!==false?l.path||"":"";var p=!t.toProxy?o.parse(r.url).path||"":r.url;p=!t.ignorePath?p:"";e.path=n.urlJoin(f,p);if(t.changeOrigin){e.headers.host=i(e.port,t[c||"target"].protocol)&&!hasPort(e.host)?e.host+":"+e.port:e.host}return e};n.setupSocket=function(e){e.setTimeout(0);e.setNoDelay(true);e.setKeepAlive(true,0);return e};n.getPort=function(e){var t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:n.hasEncryptedConnection(e)?"443":"80"};n.hasEncryptedConnection=function(e){return Boolean(e.connection.encrypted||e.connection.pair)};n.urlJoin=function(){var e=Array.prototype.slice.call(arguments),t=e.length-1,r=e[t],n=r.split("?"),o;e[t]=n.shift();o=[e.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")];o.push.apply(o,n);return o.join("?")};n.rewriteCookieProperty=function rewriteCookieProperty(e,t,r){if(Array.isArray(e)){return e.map((function(e){return rewriteCookieProperty(e,t,r)}))}return e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),(function(e,r,n){var o;if(n in t){o=t[n]}else if("*"in t){o=t["*"]}else{return e}if(o){return r+o}else{return""}}))};function hasPort(e){return!!~e.indexOf(":")}},9691:function(e,t,r){var n=e.exports,o=r(3837)._extend,s=r(7310).parse,i=r(5377),u=r(2181),a=r(5687),c=r(3756),l=r(2733);n.Server=ProxyServer;function createRightProxy(e){return function(t){return function(r,n){var i=e==="ws"?this.wsPasses:this.webPasses,u=[].slice.call(arguments),a=u.length-1,c,l;if(typeof u[a]==="function"){l=u[a];a--}var f=t;if(!(u[a]instanceof Buffer)&&u[a]!==n){f=o({},t);o(f,u[a]);a--}if(u[a]instanceof Buffer){c=u[a]}["target","forward"].forEach((function(e){if(typeof f[e]==="string")f[e]=s(f[e])}));if(!f.target&&!f.forward){return this.emit("error",new Error("Must provide a proper URL as target"))}for(var p=0;p<i.length;p++){if(i[p](r,n,f,c,this,l)){break}}}}}n.createRightProxy=createRightProxy;function ProxyServer(e){i.call(this);e=e||{};e.prependPath=e.prependPath===false?false:true;this.web=this.proxyRequest=createRightProxy("web")(e);this.ws=this.proxyWebsocketRequest=createRightProxy("ws")(e);this.options=e;this.webPasses=Object.keys(c).map((function(e){return c[e]}));this.wsPasses=Object.keys(l).map((function(e){return l[e]}));this.on("error",this.onError,this)}r(3837).inherits(ProxyServer,i);ProxyServer.prototype.onError=function(e){if(this.listeners("error").length===1){throw e}};ProxyServer.prototype.listen=function(e,t){var r=this,closure=function(e,t){r.web(e,t)};this._server=this.options.ssl?a.createServer(this.options.ssl,closure):u.createServer(closure);if(this.options.ws){this._server.on("upgrade",(function(e,t,n){r.ws(e,t,n)}))}this._server.listen(e,t);return this};ProxyServer.prototype.close=function(e){var t=this;if(this._server){this._server.close(done)}function done(){t._server=null;if(e){e.apply(null,arguments)}}};ProxyServer.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web"){throw new Error("type must be `web` or `ws`")}var n=e==="ws"?this.wsPasses:this.webPasses,o=false;n.forEach((function(e,r){if(e.name===t)o=r}));if(o===false)throw new Error("No such pass");n.splice(o,0,r)};ProxyServer.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web"){throw new Error("type must be `web` or `ws`")}var n=e==="ws"?this.wsPasses:this.webPasses,o=false;n.forEach((function(e,r){if(e.name===t)o=r}));if(o===false)throw new Error("No such pass");n.splice(o++,0,r)}},3756:function(e,t,r){var n=r(2181),o=r(5687),s=r(2272),i=r(8398),u=r(8973);s=Object.keys(s).map((function(e){return s[e]}));var a={http:n,https:o};
|
|
20
|
-
/*!
|
|
21
|
-
* Array of passes.
|
|
22
|
-
*
|
|
23
|
-
* A `pass` is just a function that is executed on `req, res, options`
|
|
24
|
-
* so that you can easily add new checks while still keeping the base
|
|
25
|
-
* flexible.
|
|
26
|
-
*/e.exports={deleteLength:function deleteLength(e,t,r){if((e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]){e.headers["content-length"]="0";delete e.headers["transfer-encoding"]}},timeout:function timeout(e,t,r){if(r.timeout){e.socket.setTimeout(r.timeout)}},XHeaders:function XHeaders(e,t,r){if(!r.xfwd)return;var n=e.isSpdy||i.hasEncryptedConnection(e);var o={for:e.connection.remoteAddress||e.socket.remoteAddress,port:i.getPort(e),proto:n?"https":"http"};["for","port","proto"].forEach((function(t){e.headers["x-forwarded-"+t]=(e.headers["x-forwarded-"+t]||"")+(e.headers["x-forwarded-"+t]?",":"")+o[t]}));e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers["host"]||""},stream:function stream(e,t,r,n,o,c){o.emit("start",e,t,r.target||r.forward);var l=r.followRedirects?u:a;var f=l.http;var p=l.https;if(r.forward){var h=(r.forward.protocol==="https:"?p:f).request(i.setupOutgoing(r.ssl||{},r,e,"forward"));var d=createErrorHandler(h,r.forward);e.on("error",d);h.on("error",d);(r.buffer||e).pipe(h);if(!r.target){return t.end()}}var g=(r.target.protocol==="https:"?p:f).request(i.setupOutgoing(r.ssl||{},r,e));g.on("socket",(function(n){if(o&&!g.getHeader("expect")){o.emit("proxyReq",g,e,t,r)}}));if(r.proxyTimeout){g.setTimeout(r.proxyTimeout,(function(){g.abort()}))}e.on("aborted",(function(){g.abort()}));var y=createErrorHandler(g,r.target);e.on("error",y);g.on("error",y);function createErrorHandler(r,n){return function proxyError(s){if(e.socket.destroyed&&s.code==="ECONNRESET"){o.emit("econnreset",s,e,t,n);return r.abort()}if(c){c(s,e,t,n)}else{o.emit("error",s,e,t,n)}}}(r.buffer||e).pipe(g);g.on("response",(function(n){if(o){o.emit("proxyRes",n,e,t)}if(!t.headersSent&&!r.selfHandleResponse){for(var i=0;i<s.length;i++){if(s[i](e,t,n,r)){break}}}if(!t.finished){n.on("end",(function(){if(o)o.emit("end",e,t,n)}));if(!r.selfHandleResponse)n.pipe(t)}else{if(o)o.emit("end",e,t,n)}}))}}},2272:function(e,t,r){var n=r(7310),o=r(8398);var s=/^201|30(1|2|7|8)$/;
|
|
27
|
-
/*!
|
|
28
|
-
* Array of passes.
|
|
29
|
-
*
|
|
30
|
-
* A `pass` is just a function that is executed on `req, res, options`
|
|
31
|
-
* so that you can easily add new checks while still keeping the base
|
|
32
|
-
* flexible.
|
|
33
|
-
*/e.exports={removeChunked:function removeChunked(e,t,r){if(e.httpVersion==="1.0"){delete r.headers["transfer-encoding"]}},setConnection:function setConnection(e,t,r){if(e.httpVersion==="1.0"){r.headers.connection=e.headers.connection||"close"}else if(e.httpVersion!=="2.0"&&!r.headers.connection){r.headers.connection=e.headers.connection||"keep-alive"}},setRedirectHostRewrite:function setRedirectHostRewrite(e,t,r,o){if((o.hostRewrite||o.autoRewrite||o.protocolRewrite)&&r.headers["location"]&&s.test(r.statusCode)){var i=n.parse(o.target);var u=n.parse(r.headers["location"]);if(i.host!=u.host){return}if(o.hostRewrite){u.host=o.hostRewrite}else if(o.autoRewrite){u.host=e.headers["host"]}if(o.protocolRewrite){u.protocol=o.protocolRewrite}r.headers["location"]=u.format()}},writeHeaders:function writeHeaders(e,t,r,n){var s=n.cookieDomainRewrite,i=n.cookiePathRewrite,u=n.preserveHeaderKeyCase,a,setHeader=function(e,r){if(r==undefined)return;if(s&&e.toLowerCase()==="set-cookie"){r=o.rewriteCookieProperty(r,s,"domain")}if(i&&e.toLowerCase()==="set-cookie"){r=o.rewriteCookieProperty(r,i,"path")}t.setHeader(String(e).trim(),r)};if(typeof s==="string"){s={"*":s}}if(typeof i==="string"){i={"*":i}}if(u&&r.rawHeaders!=undefined){a={};for(var c=0;c<r.rawHeaders.length;c+=2){var l=r.rawHeaders[c];a[l.toLowerCase()]=l}}Object.keys(r.headers).forEach((function(e){var t=r.headers[e];if(u&&a){e=a[e]||e}setHeader(e,t)}))},writeStatusCode:function writeStatusCode(e,t,r){if(r.statusMessage){t.statusCode=r.statusCode;t.statusMessage=r.statusMessage}else{t.statusCode=r.statusCode}}}},2733:function(e,t,r){var n=r(2181),o=r(5687),s=r(8398);
|
|
34
|
-
/*!
|
|
35
|
-
* Array of passes.
|
|
36
|
-
*
|
|
37
|
-
* A `pass` is just a function that is executed on `req, socket, options`
|
|
38
|
-
* so that you can easily add new checks while still keeping the base
|
|
39
|
-
* flexible.
|
|
40
|
-
*/e.exports={checkMethodAndHeader:function checkMethodAndHeader(e,t){if(e.method!=="GET"||!e.headers.upgrade){t.destroy();return true}if(e.headers.upgrade.toLowerCase()!=="websocket"){t.destroy();return true}},XHeaders:function XHeaders(e,t,r){if(!r.xfwd)return;var n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:s.getPort(e),proto:s.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach((function(t){e.headers["x-forwarded-"+t]=(e.headers["x-forwarded-"+t]||"")+(e.headers["x-forwarded-"+t]?",":"")+n[t]}))},stream:function stream(e,t,r,i,u,a){var createHttpHeader=function(e,t){return Object.keys(t).reduce((function(e,r){var n=t[r];if(!Array.isArray(n)){e.push(r+": "+n);return e}for(var o=0;o<n.length;o++){e.push(r+": "+n[o])}return e}),[e]).join("\r\n")+"\r\n\r\n"};s.setupSocket(t);if(i&&i.length)t.unshift(i);var c=(s.isSSL.test(r.target.protocol)?o:n).request(s.setupOutgoing(r.ssl||{},r,e));if(u){u.emit("proxyReqWs",c,e,t,r,i)}c.on("error",onOutgoingError);c.on("response",(function(e){if(!e.upgrade){t.write(createHttpHeader("HTTP/"+e.httpVersion+" "+e.statusCode+" "+e.statusMessage,e.headers));e.pipe(t)}}));c.on("upgrade",(function(e,r,n){r.on("error",onOutgoingError);r.on("end",(function(){u.emit("close",e,r,n)}));t.on("error",(function(){r.end()}));s.setupSocket(r);if(n&&n.length)r.unshift(n);t.write(createHttpHeader("HTTP/1.1 101 Switching Protocols",e.headers));r.pipe(t).pipe(r);u.emit("open",r);u.emit("proxySocket",r)}));return c.end();function onOutgoingError(r){if(a){a(r,e,t)}else{u.emit("error",r,e,t)}t.end()}}}},3071:function(e){
|
|
41
|
-
/*!
|
|
42
|
-
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
45
|
-
* Licensed under the MIT License.
|
|
46
|
-
*/
|
|
47
|
-
e.exports=function isExtglob(e){if(typeof e!=="string"||e===""){return false}var t;while(t=/(\\).|([@?!+*]\(.*\))/g.exec(e)){if(t[2])return true;e=e.slice(t.index+t[0].length)}return false}},6654:function(e,t,r){
|
|
48
|
-
/*!
|
|
49
|
-
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
50
|
-
*
|
|
51
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
52
|
-
* Released under the MIT License.
|
|
53
|
-
*/
|
|
54
|
-
var n=r(3071);var o={"{":"}","(":")","[":"]"};var strictCheck=function(e){if(e[0]==="!"){return true}var t=0;var r=-2;var n=-2;var s=-2;var i=-2;var u=-2;while(t<e.length){if(e[t]==="*"){return true}if(e[t+1]==="?"&&/[\].+)]/.test(e[t])){return true}if(n!==-1&&e[t]==="["&&e[t+1]!=="]"){if(n<t){n=e.indexOf("]",t)}if(n>t){if(u===-1||u>n){return true}u=e.indexOf("\\",t);if(u===-1||u>n){return true}}}if(s!==-1&&e[t]==="{"&&e[t+1]!=="}"){s=e.indexOf("}",t);if(s>t){u=e.indexOf("\\",t);if(u===-1||u>s){return true}}}if(i!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"){i=e.indexOf(")",t);if(i>t){u=e.indexOf("\\",t);if(u===-1||u>i){return true}}}if(r!==-1&&e[t]==="("&&e[t+1]!=="|"){if(r<t){r=e.indexOf("|",t)}if(r!==-1&&e[r+1]!==")"){i=e.indexOf(")",r);if(i>r){u=e.indexOf("\\",r);if(u===-1||u>i){return true}}}}if(e[t]==="\\"){var a=e[t+1];t+=2;var c=o[a];if(c){var l=e.indexOf(c,t);if(l!==-1){t=l+1}}if(e[t]==="!"){return true}}else{t++}}return false};var relaxedCheck=function(e){if(e[0]==="!"){return true}var t=0;while(t<e.length){if(/[*?{}()[\]]/.test(e[t])){return true}if(e[t]==="\\"){var r=e[t+1];t+=2;var n=o[r];if(n){var s=e.indexOf(n,t);if(s!==-1){t=s+1}}if(e[t]==="!"){return true}}else{t++}}return false};e.exports=function isGlob(e,t){if(typeof e!=="string"||e===""){return false}if(n(e)){return true}var r=strictCheck;if(t&&t.strict===false){r=relaxedCheck}return r(e)}},8387:function(e){"use strict";
|
|
55
|
-
/*!
|
|
56
|
-
* is-number <https://github.com/jonschlinkert/is-number>
|
|
57
|
-
*
|
|
58
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
59
|
-
* Released under the MIT License.
|
|
60
|
-
*/e.exports=function(e){if(typeof e==="number"){return e-e===0}if(typeof e==="string"&&e.trim()!==""){return Number.isFinite?Number.isFinite(+e):isFinite(+e)}return false}},4273:function(e){"use strict";e.exports=e=>{if(Object.prototype.toString.call(e)!=="[object Object]"){return false}const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}},1224:function(e,t,r){"use strict";const n=r(3837);const o=r(1570);const s=r(376);const i=r(8658);const isEmptyString=e=>e===""||e==="./";const micromatch=(e,t,r)=>{t=[].concat(t);e=[].concat(e);let n=new Set;let o=new Set;let i=new Set;let u=0;let onResult=e=>{i.add(e.output);if(r&&r.onResult){r.onResult(e)}};for(let i=0;i<t.length;i++){let a=s(String(t[i]),{...r,onResult:onResult},true);let c=a.state.negated||a.state.negatedExtglob;if(c)u++;for(let t of e){let e=a(t,true);let r=c?!e.isMatch:e.isMatch;if(!r)continue;if(c){n.add(e.output)}else{n.delete(e.output);o.add(e.output)}}}let a=u===t.length?[...i]:[...o];let c=a.filter((e=>!n.has(e)));if(r&&c.length===0){if(r.failglob===true){throw new Error(`No matches found for "${t.join(", ")}"`)}if(r.nonull===true||r.nullglob===true){return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}}return c};micromatch.match=micromatch;micromatch.matcher=(e,t)=>s(e,t);micromatch.isMatch=(e,t,r)=>s(t,r)(e);micromatch.any=micromatch.isMatch;micromatch.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set;let o=[];let onResult=e=>{if(r.onResult)r.onResult(e);o.push(e.output)};let s=micromatch(e,t,{...r,onResult:onResult});for(let e of o){if(!s.includes(e)){n.add(e)}}return[...n]};micromatch.contains=(e,t,r)=>{if(typeof e!=="string"){throw new TypeError(`Expected a string: "${n.inspect(e)}"`)}if(Array.isArray(t)){return t.some((t=>micromatch.contains(e,t,r)))}if(typeof t==="string"){if(isEmptyString(e)||isEmptyString(t)){return false}if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t)){return true}}return micromatch.isMatch(e,t,{...r,contains:true})};micromatch.matchKeys=(e,t,r)=>{if(!i.isObject(e)){throw new TypeError("Expected the first argument to be an object")}let n=micromatch(Object.keys(e),t,r);let o={};for(let t of n)o[t]=e[t];return o};micromatch.some=(e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(n.some((e=>t(e)))){return true}}return false};micromatch.every=(e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(!n.every((e=>t(e)))){return false}}return true};micromatch.all=(e,t,r)=>{if(typeof e!=="string"){throw new TypeError(`Expected a string: "${n.inspect(e)}"`)}return[].concat(t).every((t=>s(t,r)(e)))};micromatch.capture=(e,t,r)=>{let n=i.isWindows(r);let o=s.makeRe(String(e),{...r,capture:true});let u=o.exec(n?i.toPosixSlashes(t):t);if(u){return u.slice(1).map((e=>e===void 0?"":e))}};micromatch.makeRe=(...e)=>s.makeRe(...e);micromatch.scan=(...e)=>s.scan(...e);micromatch.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[])){for(let e of o(String(n),t)){r.push(s.parse(e,t))}}return r};micromatch.braces=(e,t)=>{if(typeof e!=="string")throw new TypeError("Expected a string");if(t&&t.nobrace===true||!/\{.*\}/.test(e)){return[e]}return o(e,t)};micromatch.braceExpand=(e,t)=>{if(typeof e!=="string")throw new TypeError("Expected a string");return micromatch.braces(e,{...t,expand:true})};e.exports=micromatch},1367:function(e){var t=1e3;var r=t*60;var n=r*60;var o=n*24;var s=o*7;var i=o*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!u){return}var a=parseFloat(u[1]);var c=(u[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return a*i;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function fmtShort(e){var s=Math.abs(e);if(s>=o){return Math.round(e/o)+"d"}if(s>=n){return Math.round(e/n)+"h"}if(s>=r){return Math.round(e/r)+"m"}if(s>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var s=Math.abs(e);if(s>=o){return plural(e,s,o,"day")}if(s>=n){return plural(e,s,n,"hour")}if(s>=r){return plural(e,s,r,"minute")}if(s>=t){return plural(e,s,t,"second")}return e+" ms"}function plural(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}},376:function(e,t,r){"use strict";e.exports=r(7631)},7820:function(e,t,r){"use strict";const n=r(1017);const o="\\\\/";const s=`[^${o}]`;const i="\\.";const u="\\+";const a="\\?";const c="\\/";const l="(?=.)";const f="[^/]";const p=`(?:${c}|$)`;const h=`(?:^|${c})`;const d=`${i}{1,2}${p}`;const g=`(?!${i})`;const y=`(?!${h}${d})`;const R=`(?!${i}{0,1}${p})`;const v=`(?!${d})`;const _=`[^.${c}]`;const b=`${f}*?`;const m={DOT_LITERAL:i,PLUS_LITERAL:u,QMARK_LITERAL:a,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:f,END_ANCHOR:p,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:y,NO_DOT_SLASH:R,NO_DOTS_SLASH:v,QMARK_NO_DOT:_,STAR:b,START_ANCHOR:h};const E={...m,SLASH_LITERAL:`[${o}]`,QMARK:s,STAR:`${s}*?`,DOTS_SLASH:`${i}{1,2}(?:[${o}]|$)`,NO_DOT:`(?!${i})`,NO_DOTS:`(?!(?:^|[${o}])${i}{1,2}(?:[${o}]|$))`,NO_DOT_SLASH:`(?!${i}{0,1}(?:[${o}]|$))`,NO_DOTS_SLASH:`(?!${i}{1,2}(?:[${o}]|$))`,QMARK_NO_DOT:`[^.${o}]`,START_ANCHOR:`(?:^|[${o}])`,END_ANCHOR:`(?:[${o}]|$)`};const C={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};e.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:C,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===true?E:m}}},6986:function(e,t,r){"use strict";const n=r(7820);const o=r(8658);const{MAX_LENGTH:s,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:c}=n;const expandRange=(e,t)=>{if(typeof t.expandRange==="function"){return t.expandRange(...e,t)}e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>o.escapeRegex(e))).join("..")}return r};const syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`;const parse=(e,t)=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}e=c[e]||e;const r={...t};const l=typeof r.maxLength==="number"?Math.min(s,r.maxLength):s;let f=e.length;if(f>l){throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${l}`)}const p={type:"bos",value:"",output:r.prepend||""};const h=[p];const d=r.capture?"":"?:";const g=o.isWindows(t);const y=n.globChars(g);const R=n.extglobChars(y);const{DOT_LITERAL:v,PLUS_LITERAL:_,SLASH_LITERAL:b,ONE_CHAR:m,DOTS_SLASH:E,NO_DOT:C,NO_DOT_SLASH:x,NO_DOTS_SLASH:A,QMARK:w,QMARK_NO_DOT:O,STAR:S,START_ANCHOR:H}=y;const globstar=e=>`(${d}(?:(?!${H}${e.dot?E:v}).)*?)`;const T=r.dot?"":C;const P=r.dot?w:O;let L=r.bash===true?globstar(r):S;if(r.capture){L=`(${L})`}if(typeof r.noext==="boolean"){r.noextglob=r.noext}const $={input:e,index:-1,start:0,dot:r.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:h};e=o.removePrefix(e,$);f=e.length;const k=[];const I=[];const N=[];let M=p;let F;const eos=()=>$.index===f-1;const D=$.peek=(t=1)=>e[$.index+t];const B=$.advance=()=>e[++$.index]||"";const remaining=()=>e.slice($.index+1);const consume=(e="",t=0)=>{$.consumed+=e;$.index+=t};const append=e=>{$.output+=e.output!=null?e.output:e.value;consume(e.value)};const negate=()=>{let e=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?")){B();$.start++;e++}if(e%2===0){return false}$.negated=true;$.start++;return true};const increment=e=>{$[e]++;N.push(e)};const decrement=e=>{$[e]--;N.pop()};const push=e=>{if(M.type==="globstar"){const t=$.braces>0&&(e.type==="comma"||e.type==="brace");const r=e.extglob===true||k.length&&(e.type==="pipe"||e.type==="paren");if(e.type!=="slash"&&e.type!=="paren"&&!t&&!r){$.output=$.output.slice(0,-M.output.length);M.type="star";M.value="*";M.output=L;$.output+=M.output}}if(k.length&&e.type!=="paren"){k[k.length-1].inner+=e.value}if(e.value||e.output)append(e);if(M&&M.type==="text"&&e.type==="text"){M.value+=e.value;M.output=(M.output||"")+e.value;return}e.prev=M;h.push(e);M=e};const extglobOpen=(e,t)=>{const n={...R[t],conditions:1,inner:""};n.prev=M;n.parens=$.parens;n.output=$.output;const o=(r.capture?"(":"")+n.open;increment("parens");push({type:e,value:t,output:$.output?"":m});push({type:"paren",extglob:true,value:B(),output:o});k.push(n)};const extglobClose=e=>{let n=e.close+(r.capture?")":"");let o;if(e.type==="negate"){let s=L;if(e.inner&&e.inner.length>1&&e.inner.includes("/")){s=globstar(r)}if(s!==L||eos()||/^\)+$/.test(remaining())){n=e.close=`)$))${s}`}if(e.inner.includes("*")&&(o=remaining())&&/^\.[^\\/.]+$/.test(o)){const r=parse(o,{...t,fastpaths:false}).output;n=e.close=`)${r})${s})`}if(e.prev.type==="bos"){$.negatedExtglob=true}}push({type:"paren",extglob:true,value:F,output:n});decrement("parens")};if(r.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=false;let s=e.replace(a,((e,t,r,o,s,i)=>{if(o==="\\"){n=true;return e}if(o==="?"){if(t){return t+o+(s?w.repeat(s.length):"")}if(i===0){return P+(s?w.repeat(s.length):"")}return w.repeat(r.length)}if(o==="."){return v.repeat(r.length)}if(o==="*"){if(t){return t+o+(s?L:"")}return L}return t?e:`\\${e}`}));if(n===true){if(r.unescape===true){s=s.replace(/\\/g,"")}else{s=s.replace(/\\+/g,(e=>e.length%2===0?"\\\\":e?"\\":""))}}if(s===e&&r.contains===true){$.output=e;return $}$.output=o.wrapOutput(s,$,t);return $}while(!eos()){F=B();if(F==="\0"){continue}if(F==="\\"){const e=D();if(e==="/"&&r.bash!==true){continue}if(e==="."||e===";"){continue}if(!e){F+="\\";push({type:"text",value:F});continue}const t=/^\\+/.exec(remaining());let n=0;if(t&&t[0].length>2){n=t[0].length;$.index+=n;if(n%2!==0){F+="\\"}}if(r.unescape===true){F=B()}else{F+=B()}if($.brackets===0){push({type:"text",value:F});continue}}if($.brackets>0&&(F!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==false&&F===":"){const e=M.value.slice(1);if(e.includes("[")){M.posix=true;if(e.includes(":")){const e=M.value.lastIndexOf("[");const t=M.value.slice(0,e);const r=M.value.slice(e+2);const n=i[r];if(n){M.value=t+n;$.backtrack=true;B();if(!p.output&&h.indexOf(M)===1){p.output=m}continue}}}}if(F==="["&&D()!==":"||F==="-"&&D()==="]"){F=`\\${F}`}if(F==="]"&&(M.value==="["||M.value==="[^")){F=`\\${F}`}if(r.posix===true&&F==="!"&&M.value==="["){F="^"}M.value+=F;append({value:F});continue}if($.quotes===1&&F!=='"'){F=o.escapeRegex(F);M.value+=F;append({value:F});continue}if(F==='"'){$.quotes=$.quotes===1?0:1;if(r.keepQuotes===true){push({type:"text",value:F})}continue}if(F==="("){increment("parens");push({type:"paren",value:F});continue}if(F===")"){if($.parens===0&&r.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const e=k[k.length-1];if(e&&$.parens===e.parens+1){extglobClose(k.pop());continue}push({type:"paren",value:F,output:$.parens?")":"\\)"});decrement("parens");continue}if(F==="["){if(r.nobracket===true||!remaining().includes("]")){if(r.nobracket!==true&&r.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}F=`\\${F}`}else{increment("brackets")}push({type:"bracket",value:F});continue}if(F==="]"){if(r.nobracket===true||M&&M.type==="bracket"&&M.value.length===1){push({type:"text",value:F,output:`\\${F}`});continue}if($.brackets===0){if(r.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:F,output:`\\${F}`});continue}decrement("brackets");const e=M.value.slice(1);if(M.posix!==true&&e[0]==="^"&&!e.includes("/")){F=`/${F}`}M.value+=F;append({value:F});if(r.literalBrackets===false||o.hasRegexChars(e)){continue}const t=o.escapeRegex(M.value);$.output=$.output.slice(0,-M.value.length);if(r.literalBrackets===true){$.output+=t;M.value=t;continue}M.value=`(${d}${t}|${M.value})`;$.output+=M.value;continue}if(F==="{"&&r.nobrace!==true){increment("braces");const e={type:"brace",value:F,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};I.push(e);push(e);continue}if(F==="}"){const e=I[I.length-1];if(r.nobrace===true||!e){push({type:"text",value:F,output:F});continue}let t=")";if(e.dots===true){const e=h.slice();const n=[];for(let t=e.length-1;t>=0;t--){h.pop();if(e[t].type==="brace"){break}if(e[t].type!=="dots"){n.unshift(e[t].value)}}t=expandRange(n,r);$.backtrack=true}if(e.comma!==true&&e.dots!==true){const r=$.output.slice(0,e.outputIndex);const n=$.tokens.slice(e.tokensIndex);e.value=e.output="\\{";F=t="\\}";$.output=r;for(const e of n){$.output+=e.output||e.value}}push({type:"brace",value:F,output:t});decrement("braces");I.pop();continue}if(F==="|"){if(k.length>0){k[k.length-1].conditions++}push({type:"text",value:F});continue}if(F===","){let e=F;const t=I[I.length-1];if(t&&N[N.length-1]==="braces"){t.comma=true;e="|"}push({type:"comma",value:F,output:e});continue}if(F==="/"){if(M.type==="dot"&&$.index===$.start+1){$.start=$.index+1;$.consumed="";$.output="";h.pop();M=p;continue}push({type:"slash",value:F,output:b});continue}if(F==="."){if($.braces>0&&M.type==="dot"){if(M.value===".")M.output=v;const e=I[I.length-1];M.type="dots";M.output+=F;M.value+=F;e.dots=true;continue}if($.braces+$.parens===0&&M.type!=="bos"&&M.type!=="slash"){push({type:"text",value:F,output:v});continue}push({type:"dot",value:F,output:v});continue}if(F==="?"){const e=M&&M.value==="(";if(!e&&r.noextglob!==true&&D()==="("&&D(2)!=="?"){extglobOpen("qmark",F);continue}if(M&&M.type==="paren"){const e=D();let t=F;if(e==="<"&&!o.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(M.value==="("&&!/[!=<:]/.test(e)||e==="<"&&!/<([!=]|\w+>)/.test(remaining())){t=`\\${F}`}push({type:"text",value:F,output:t});continue}if(r.dot!==true&&(M.type==="slash"||M.type==="bos")){push({type:"qmark",value:F,output:O});continue}push({type:"qmark",value:F,output:w});continue}if(F==="!"){if(r.noextglob!==true&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){extglobOpen("negate",F);continue}}if(r.nonegate!==true&&$.index===0){negate();continue}}if(F==="+"){if(r.noextglob!==true&&D()==="("&&D(2)!=="?"){extglobOpen("plus",F);continue}if(M&&M.value==="("||r.regex===false){push({type:"plus",value:F,output:_});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||$.parens>0){push({type:"plus",value:F});continue}push({type:"plus",value:_});continue}if(F==="@"){if(r.noextglob!==true&&D()==="("&&D(2)!=="?"){push({type:"at",extglob:true,value:F,output:""});continue}push({type:"text",value:F});continue}if(F!=="*"){if(F==="$"||F==="^"){F=`\\${F}`}const e=u.exec(remaining());if(e){F+=e[0];$.index+=e[0].length}push({type:"text",value:F});continue}if(M&&(M.type==="globstar"||M.star===true)){M.type="star";M.star=true;M.value+=F;M.output=L;$.backtrack=true;$.globstar=true;consume(F);continue}let t=remaining();if(r.noextglob!==true&&/^\([^?]/.test(t)){extglobOpen("star",F);continue}if(M.type==="star"){if(r.noglobstar===true){consume(F);continue}const n=M.prev;const o=n.prev;const s=n.type==="slash"||n.type==="bos";const i=o&&(o.type==="star"||o.type==="globstar");if(r.bash===true&&(!s||t[0]&&t[0]!=="/")){push({type:"star",value:F,output:""});continue}const u=$.braces>0&&(n.type==="comma"||n.type==="brace");const a=k.length&&(n.type==="pipe"||n.type==="paren");if(!s&&n.type!=="paren"&&!u&&!a){push({type:"star",value:F,output:""});continue}while(t.slice(0,3)==="/**"){const r=e[$.index+4];if(r&&r!=="/"){break}t=t.slice(3);consume("/**",3)}if(n.type==="bos"&&eos()){M.type="globstar";M.value+=F;M.output=globstar(r);$.output=M.output;$.globstar=true;consume(F);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&!i&&eos()){$.output=$.output.slice(0,-(n.output+M.output).length);n.output=`(?:${n.output}`;M.type="globstar";M.output=globstar(r)+(r.strictSlashes?")":"|$)");M.value+=F;$.globstar=true;$.output+=n.output+M.output;consume(F);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&t[0]==="/"){const e=t[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(n.output+M.output).length);n.output=`(?:${n.output}`;M.type="globstar";M.output=`${globstar(r)}${b}|${b}${e})`;M.value+=F;$.output+=n.output+M.output;$.globstar=true;consume(F+B());push({type:"slash",value:"/",output:""});continue}if(n.type==="bos"&&t[0]==="/"){M.type="globstar";M.value+=F;M.output=`(?:^|${b}|${globstar(r)}${b})`;$.output=M.output;$.globstar=true;consume(F+B());push({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-M.output.length);M.type="globstar";M.output=globstar(r);M.value+=F;$.output+=M.output;$.globstar=true;consume(F);continue}const n={type:"star",value:F,output:L};if(r.bash===true){n.output=".*?";if(M.type==="bos"||M.type==="slash"){n.output=T+n.output}push(n);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===true){n.output=F;push(n);continue}if($.index===$.start||M.type==="slash"||M.type==="dot"){if(M.type==="dot"){$.output+=x;M.output+=x}else if(r.dot===true){$.output+=A;M.output+=A}else{$.output+=T;M.output+=T}if(D()!=="*"){$.output+=m;M.output+=m}}push(n)}while($.brackets>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));$.output=o.escapeLast($.output,"[");decrement("brackets")}while($.parens>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));$.output=o.escapeLast($.output,"(");decrement("parens")}while($.braces>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));$.output=o.escapeLast($.output,"{");decrement("braces")}if(r.strictSlashes!==true&&(M.type==="star"||M.type==="bracket")){push({type:"maybe_slash",value:"",output:`${b}?`})}if($.backtrack===true){$.output="";for(const e of $.tokens){$.output+=e.output!=null?e.output:e.value;if(e.suffix){$.output+=e.suffix}}}return $};parse.fastpaths=(e,t)=>{const r={...t};const i=typeof r.maxLength==="number"?Math.min(s,r.maxLength):s;const u=e.length;if(u>i){throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${i}`)}e=c[e]||e;const a=o.isWindows(t);const{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:y,STAR:R,START_ANCHOR:v}=n.globChars(a);const _=r.dot?g:d;const b=r.dot?y:d;const m=r.capture?"":"?:";const E={negated:false,prefix:""};let C=r.bash===true?".*?":R;if(r.capture){C=`(${C})`}const globstar=e=>{if(e.noglobstar===true)return C;return`(${m}(?:(?!${v}${e.dot?h:l}).)*?)`};const create=e=>{switch(e){case"*":return`${_}${p}${C}`;case".*":return`${l}${p}${C}`;case"*.*":return`${_}${C}${l}${p}${C}`;case"*/*":return`${_}${C}${f}${p}${b}${C}`;case"**":return _+globstar(r);case"**/*":return`(?:${_}${globstar(r)}${f})?${b}${p}${C}`;case"**/*.*":return`(?:${_}${globstar(r)}${f})?${b}${C}${l}${p}${C}`;case"**/.*":return`(?:${_}${globstar(r)}${f})?${l}${p}${C}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=create(t[1]);if(!r)return;return r+l+t[2]}}};const x=o.removePrefix(e,E);let A=create(x);if(A&&r.strictSlashes!==true){A+=`${f}?`}return A};e.exports=parse},7631:function(e,t,r){"use strict";const n=r(1017);const o=r(8640);const s=r(6986);const i=r(8658);const u=r(7820);const isObject=e=>e&&typeof e==="object"&&!Array.isArray(e);const picomatch=(e,t,r=false)=>{if(Array.isArray(e)){const n=e.map((e=>picomatch(e,t,r)));const arrayMatcher=e=>{for(const t of n){const r=t(e);if(r)return r}return false};return arrayMatcher}const n=isObject(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!n){throw new TypeError("Expected pattern to be a non-empty string")}const o=t||{};const s=i.isWindows(t);const u=n?picomatch.compileRe(e,t):picomatch.makeRe(e,t,false,true);const a=u.state;delete u.state;let isIgnored=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(o.ignore,e,r)}const matcher=(r,n=false)=>{const{isMatch:i,match:c,output:l}=picomatch.test(r,u,t,{glob:e,posix:s});const f={glob:e,state:a,regex:u,posix:s,input:r,output:l,match:c,isMatch:i};if(typeof o.onResult==="function"){o.onResult(f)}if(i===false){f.isMatch=false;return n?f:false}if(isIgnored(r)){if(typeof o.onIgnore==="function"){o.onIgnore(f)}f.isMatch=false;return n?f:false}if(typeof o.onMatch==="function"){o.onMatch(f)}return n?f:true};if(r){matcher.state=a}return matcher};picomatch.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!=="string"){throw new TypeError("Expected input to be a string")}if(e===""){return{isMatch:false,output:""}}const s=r||{};const u=s.format||(o?i.toPosixSlashes:null);let a=e===n;let c=a&&u?u(e):e;if(a===false){c=u?u(e):e;a=c===n}if(a===false||s.capture===true){if(s.matchBase===true||s.basename===true){a=picomatch.matchBase(e,t,r,o)}else{a=t.exec(c)}}return{isMatch:Boolean(a),match:a,output:c}};picomatch.matchBase=(e,t,r,o=i.isWindows(r))=>{const s=t instanceof RegExp?t:picomatch.makeRe(t,r);return s.test(n.basename(e))};picomatch.isMatch=(e,t,r)=>picomatch(t,r)(e);picomatch.parse=(e,t)=>{if(Array.isArray(e))return e.map((e=>picomatch.parse(e,t)));return s(e,{...t,fastpaths:false})};picomatch.scan=(e,t)=>o(e,t);picomatch.compileRe=(e,t,r=false,n=false)=>{if(r===true){return e.output}const o=t||{};const s=o.contains?"":"^";const i=o.contains?"":"$";let u=`${s}(?:${e.output})${i}`;if(e&&e.negated===true){u=`^(?!${u}).*$`}const a=picomatch.toRegex(u,t);if(n===true){a.state=e}return a};picomatch.makeRe=(e,t={},r=false,n=false)=>{if(!e||typeof e!=="string"){throw new TypeError("Expected a non-empty string")}let o={negated:false,fastpaths:true};if(t.fastpaths!==false&&(e[0]==="."||e[0]==="*")){o.output=s.fastpaths(e,t)}if(!o.output){o=s(e,t)}return picomatch.compileRe(o,t,r,n)};picomatch.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&t.debug===true)throw e;return/$^/}};picomatch.constants=u;e.exports=picomatch},8640:function(e,t,r){"use strict";const n=r(8658);const{CHAR_ASTERISK:o,CHAR_AT:s,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:u,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:R,CHAR_RIGHT_SQUARE_BRACKET:v}=r(7820);const isPathSeparator=e=>e===l||e===i;const depth=e=>{if(e.isPrefix!==true){e.depth=e.isGlobstar?Infinity:1}};const scan=(e,t)=>{const r=t||{};const _=e.length-1;const b=r.parts===true||r.scanToEnd===true;const m=[];const E=[];const C=[];let x=e;let A=-1;let w=0;let O=0;let S=false;let H=false;let T=false;let P=false;let L=false;let $=false;let k=false;let I=false;let N=false;let M=false;let F=0;let D;let B;let q={value:"",depth:0,isGlob:false};const eos=()=>A>=_;const peek=()=>x.charCodeAt(A+1);const advance=()=>{D=B;return x.charCodeAt(++A)};while(A<_){B=advance();let e;if(B===i){k=q.backslashes=true;B=advance();if(B===f){$=true}continue}if($===true||B===f){F++;while(eos()!==true&&(B=advance())){if(B===i){k=q.backslashes=true;advance();continue}if(B===f){F++;continue}if($!==true&&B===a&&(B=advance())===a){S=q.isBrace=true;T=q.isGlob=true;M=true;if(b===true){continue}break}if($!==true&&B===u){S=q.isBrace=true;T=q.isGlob=true;M=true;if(b===true){continue}break}if(B===y){F--;if(F===0){$=false;S=q.isBrace=true;M=true;break}}}if(b===true){continue}break}if(B===l){m.push(A);E.push(q);q={value:"",depth:0,isGlob:false};if(M===true)continue;if(D===a&&A===w+1){w+=2;continue}O=A+1;continue}if(r.noext!==true){const e=B===d||B===s||B===o||B===g||B===c;if(e===true&&peek()===p){T=q.isGlob=true;P=q.isExtglob=true;M=true;if(B===c&&A===w){N=true}if(b===true){while(eos()!==true&&(B=advance())){if(B===i){k=q.backslashes=true;B=advance();continue}if(B===R){T=q.isGlob=true;M=true;break}}continue}break}}if(B===o){if(D===o)L=q.isGlobstar=true;T=q.isGlob=true;M=true;if(b===true){continue}break}if(B===g){T=q.isGlob=true;M=true;if(b===true){continue}break}if(B===h){while(eos()!==true&&(e=advance())){if(e===i){k=q.backslashes=true;advance();continue}if(e===v){H=q.isBracket=true;T=q.isGlob=true;M=true;break}}if(b===true){continue}break}if(r.nonegate!==true&&B===c&&A===w){I=q.negated=true;w++;continue}if(r.noparen!==true&&B===p){T=q.isGlob=true;if(b===true){while(eos()!==true&&(B=advance())){if(B===p){k=q.backslashes=true;B=advance();continue}if(B===R){M=true;break}}continue}break}if(T===true){M=true;if(b===true){continue}break}}if(r.noext===true){P=false;T=false}let j=x;let G="";let U="";if(w>0){G=x.slice(0,w);x=x.slice(w);O-=w}if(j&&T===true&&O>0){j=x.slice(0,O);U=x.slice(O)}else if(T===true){j="";U=x}else{j=x}if(j&&j!==""&&j!=="/"&&j!==x){if(isPathSeparator(j.charCodeAt(j.length-1))){j=j.slice(0,-1)}}if(r.unescape===true){if(U)U=n.removeBackslashes(U);if(j&&k===true){j=n.removeBackslashes(j)}}const K={prefix:G,input:e,start:w,base:j,glob:U,isBrace:S,isBracket:H,isGlob:T,isExtglob:P,isGlobstar:L,negated:I,negatedExtglob:N};if(r.tokens===true){K.maxDepth=0;if(!isPathSeparator(B)){E.push(q)}K.tokens=E}if(r.parts===true||r.tokens===true){let t;for(let n=0;n<m.length;n++){const o=t?t+1:w;const s=m[n];const i=e.slice(o,s);if(r.tokens){if(n===0&&w!==0){E[n].isPrefix=true;E[n].value=G}else{E[n].value=i}depth(E[n]);K.maxDepth+=E[n].depth}if(n!==0||i!==""){C.push(i)}t=s}if(t&&t+1<e.length){const n=e.slice(t+1);C.push(n);if(r.tokens){E[E.length-1].value=n;depth(E[E.length-1]);K.maxDepth+=E[E.length-1].depth}}K.slashes=m;K.parts=C}return K};e.exports=scan},8658:function(e,t,r){"use strict";const n=r(1017);const o=process.platform==="win32";const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:a}=r(7820);t.isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);t.hasRegexChars=e=>u.test(e);t.isRegexChar=e=>e.length===1&&t.hasRegexChars(e);t.escapeRegex=e=>e.replace(a,"\\$1");t.toPosixSlashes=e=>e.replace(s,"/");t.removeBackslashes=e=>e.replace(i,(e=>e==="\\"?"":e));t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);if(e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10){return true}return false};t.isWindows=e=>{if(e&&typeof e.windows==="boolean"){return e.windows}return o===true||n.sep==="\\"};t.escapeLast=(e,r,n)=>{const o=e.lastIndexOf(r,n);if(o===-1)return e;if(e[o-1]==="\\")return t.escapeLast(e,r,o-1);return`${e.slice(0,o)}\\${e.slice(o)}`};t.removePrefix=(e,t={})=>{let r=e;if(r.startsWith("./")){r=r.slice(2);t.prefix="./"}return r};t.wrapOutput=(e,t={},r={})=>{const n=r.contains?"":"^";const o=r.contains?"":"$";let s=`${n}(?:${e})${o}`;if(t.negated===true){s=`(?:^(?!${s}).*$)`}return s}},926:function(e){"use strict";e.exports=function required(e,t){t=t.split(":")[0];e=+e;if(!e)return false;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return false}return e!==0}},1270:function(e,t,r){"use strict";const n=r(2037);const o=r(6224);const s=r(3975);const{env:i}=process;let u;if(s("no-color")||s("no-colors")||s("color=false")||s("color=never")){u=0}else if(s("color")||s("colors")||s("color=true")||s("color=always")){u=1}function envForceColor(){if("FORCE_COLOR"in i){if(i.FORCE_COLOR==="true"){return 1}if(i.FORCE_COLOR==="false"){return 0}return i.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(i.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,{streamIsTTY:t,sniffFlags:r=true}={}){const o=envForceColor();if(o!==undefined){u=o}const a=r?u:o;if(a===0){return 0}if(r){if(s("color=16m")||s("color=full")||s("color=truecolor")){return 3}if(s("color=256")){return 2}}if(e&&!t&&a===undefined){return 0}const c=a||0;if(i.TERM==="dumb"){return c}if(process.platform==="win32"){const e=n.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((e=>e in i))||i.CI_NAME==="codeship"){return 1}return c}if("TEAMCITY_VERSION"in i){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0}if(i.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in i){const e=Number.parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(i.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)){return 1}if("COLORTERM"in i){return 1}return c}function getSupportLevel(e,t={}){const r=supportsColor(e,{streamIsTTY:e&&e.isTTY,...t});return translateLevel(r)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel({isTTY:o.isatty(1)}),stderr:getSupportLevel({isTTY:o.isatty(2)})}},211:function(e,t,r){"use strict";
|
|
61
|
-
/*!
|
|
62
|
-
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
63
|
-
*
|
|
64
|
-
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
65
|
-
* Released under the MIT License.
|
|
66
|
-
*/const n=r(8387);const toRegexRange=(e,t,r)=>{if(n(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(n(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let o={relaxZeros:true,...r};if(typeof o.strictZeros==="boolean"){o.relaxZeros=o.strictZeros===false}let s=String(o.relaxZeros);let i=String(o.shorthand);let u=String(o.capture);let a=String(o.wrap);let c=e+":"+t+"="+s+i+u+a;if(toRegexRange.cache.hasOwnProperty(c)){return toRegexRange.cache[c].result}let l=Math.min(e,t);let f=Math.max(e,t);if(Math.abs(l-f)===1){let r=e+"|"+t;if(o.capture){return`(${r})`}if(o.wrap===false){return r}return`(?:${r})`}let p=hasPadding(e)||hasPadding(t);let h={min:e,max:t,a:l,b:f};let d=[];let g=[];if(p){h.isPadded=p;h.maxLen=String(h.max).length}if(l<0){let e=f<0?Math.abs(f):1;g=splitToPatterns(e,Math.abs(l),h,o);l=h.a=0}if(f>=0){d=splitToPatterns(l,f,h,o)}h.negatives=g;h.positives=d;h.result=collatePatterns(g,d,o);if(o.capture===true){h.result=`(${h.result})`}else if(o.wrap!==false&&d.length+g.length>1){h.result=`(?:${h.result})`}toRegexRange.cache[c]=h;return h.result};function collatePatterns(e,t,r){let n=filterPatterns(e,t,"-",false,r)||[];let o=filterPatterns(t,e,"",false,r)||[];let s=filterPatterns(e,t,"-?",true,r)||[];let i=n.concat(s).concat(o);return i.join("|")}function splitToRanges(e,t){let r=1;let n=1;let o=countNines(e,r);let s=new Set([t]);while(e<=o&&o<=t){s.add(o);r+=1;o=countNines(e,r)}o=countZeros(t+1,n)-1;while(e<o&&o<=t){s.add(o);n+=1;o=countZeros(t+1,n)-1}s=[...s];s.sort(compare);return s}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let n=zip(e,t);let o=n.length;let s="";let i=0;for(let e=0;e<o;e++){let[t,o]=n[e];if(t===o){s+=t}else if(t!=="0"||o!=="9"){s+=toCharacterClass(t,o,r)}else{i++}}if(i){s+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:s,count:[i],digits:o}}function splitToPatterns(e,t,r,n){let o=splitToRanges(e,t);let s=[];let i=e;let u;for(let e=0;e<o.length;e++){let t=o[e];let a=rangeToPattern(String(i),String(t),n);let c="";if(!r.isPadded&&u&&u.pattern===a.pattern){if(u.count.length>1){u.count.pop()}u.count.push(a.count[0]);u.string=u.pattern+toQuantifier(u.count);i=t+1;continue}if(r.isPadded){c=padZeros(t,r,n)}a.string=c+a.pattern+toQuantifier(a.count);s.push(a);i=t+1;u=a}return s}function filterPatterns(e,t,r,n,o){let s=[];for(let o of e){let{string:e}=o;if(!n&&!contains(t,"string",e)){s.push(r+e)}if(n&&contains(t,"string",e)){s.push(r+e)}}return s}function zip(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let n=Math.abs(t.maxLen-String(e).length);let o=r.relaxZeros!==false;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:{return o?`0{0,${n}}`:`0{${n}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};e.exports=toRegexRange},9491:function(e){"use strict";e.exports=require("assert")},2181:function(e){"use strict";e.exports=require("http")},5687:function(e){"use strict";e.exports=require("https")},2037:function(e){"use strict";e.exports=require("os")},1017:function(e){"use strict";e.exports=require("path")},3477:function(e){"use strict";e.exports=require("querystring")},2781:function(e){"use strict";e.exports=require("stream")},6224:function(e){"use strict";e.exports=require("tty")},7310:function(e){"use strict";e.exports=require("url")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var s=true;try{e[r].call(o.exports,o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(3685);module.exports=r})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"http-proxy-middleware","author":"Steven Chim","license":"MIT","types":"dist/index.d.ts"}
|