From 180b468c910725f507807f74c0cf318d3cfb2da1 Mon Sep 17 00:00:00 2001 From: Corey Innis Date: Sat, 25 May 2024 16:06:47 -0700 Subject: [PATCH] [Changed] bump playwright-core to v1.23.0 --- assets/package-lock.json | 30 +- assets/package.json | 2 +- priv/static/driver.js | 7844 ++++++++++-------- test/integration/page/accessibility_test.exs | 3 +- 4 files changed, 4353 insertions(+), 3526 deletions(-) diff --git a/assets/package-lock.json b/assets/package-lock.json index f84a7b39..e742deea 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -6,7 +6,7 @@ "": { "dependencies": { "electron": "24.0.0", - "playwright": "1.22.0" + "playwright": "1.23.0" } }, "../../playwright-test-example": { @@ -594,12 +594,12 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" }, "node_modules/playwright": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.22.0.tgz", - "integrity": "sha512-T2UqJAuvJip7TfYwvl7h3gUWtEE5D950PKd96POhUpumG3BkMfiLmXOe6Ja6UP39Ab3wEvatUJYBXvZCkocfpg==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.23.0.tgz", + "integrity": "sha512-rfZfuLueBPGV3UdEqPQxS8Uw7TgVMATWSPb3O0oV8SZBmVAhOndkOU9MPP8dxJoQI68r94yevuObPr14PhW9Xg==", "hasInstallScript": true, "dependencies": { - "playwright-core": "1.22.0" + "playwright-core": "1.23.0" }, "bin": { "playwright": "cli.js" @@ -609,9 +609,9 @@ } }, "node_modules/playwright-core": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.22.0.tgz", - "integrity": "sha512-XnDPiV4NCzTtXWxQdyJ6Wg8xhST3ciUjt5mITaxoqOoYggmRtofKm0PXLehfbetXh2ppPYj5U8UhtUpdIE4wag==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.23.0.tgz", + "integrity": "sha512-Zzhyr5RZGoJ1ek2sgfJCt2076kdOg8hnNwFBqAYeLySiutXyxSQk93vZ5gbnFiWV1sHvueCcwla9n35acUTxtA==", "bin": { "playwright": "cli.js" }, @@ -1198,17 +1198,17 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" }, "playwright": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.22.0.tgz", - "integrity": "sha512-T2UqJAuvJip7TfYwvl7h3gUWtEE5D950PKd96POhUpumG3BkMfiLmXOe6Ja6UP39Ab3wEvatUJYBXvZCkocfpg==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.23.0.tgz", + "integrity": "sha512-rfZfuLueBPGV3UdEqPQxS8Uw7TgVMATWSPb3O0oV8SZBmVAhOndkOU9MPP8dxJoQI68r94yevuObPr14PhW9Xg==", "requires": { - "playwright-core": "1.22.0" + "playwright-core": "1.23.0" } }, "playwright-core": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.22.0.tgz", - "integrity": "sha512-XnDPiV4NCzTtXWxQdyJ6Wg8xhST3ciUjt5mITaxoqOoYggmRtofKm0PXLehfbetXh2ppPYj5U8UhtUpdIE4wag==" + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.23.0.tgz", + "integrity": "sha512-Zzhyr5RZGoJ1ek2sgfJCt2076kdOg8hnNwFBqAYeLySiutXyxSQk93vZ5gbnFiWV1sHvueCcwla9n35acUTxtA==" }, "progress": { "version": "2.0.3", diff --git a/assets/package.json b/assets/package.json index 61dfe521..eb7d49c4 100644 --- a/assets/package.json +++ b/assets/package.json @@ -1,6 +1,6 @@ { "dependencies": { "electron": "24.0.0", - "playwright": "1.22.0" + "playwright": "1.23.0" } } diff --git a/priv/static/driver.js b/priv/static/driver.js index 570ac718..c38508d7 100755 --- a/priv/static/driver.js +++ b/priv/static/driver.js @@ -61,73 +61,73 @@ var __async = (__this, __arguments, generator) => { // node_modules/playwright-core/lib/utilsBundleImpl.js var require_utilsBundleImpl = __commonJS({ "node_modules/playwright-core/lib/utilsBundleImpl.js"(exports2, module2) { - var Ch = Object.create; + var Oh = Object.create; var li = Object.defineProperty; - var Oh = Object.getOwnPropertyDescriptor; - var Ih = Object.getOwnPropertyNames; - var Th = Object.getPrototypeOf; - var Ah = Object.prototype.hasOwnProperty; + var Ih = Object.getOwnPropertyDescriptor; + var Th = Object.getOwnPropertyNames; + var Ah = Object.getPrototypeOf; + var Rh = Object.prototype.hasOwnProperty; var x = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports); - var Rh = (t, e) => { + var Bh = (t, e) => { for (var r in e) li(t, r, { get: e[r], enumerable: true }); }; - var yo = (t, e, r, i) => { + var bo = (t, e, r, i) => { if (e && typeof e == "object" || typeof e == "function") - for (let n of Ih(e)) - !Ah.call(t, n) && n !== r && li(t, n, { get: () => e[n], enumerable: !(i = Oh(e, n)) || i.enumerable }); + for (let n of Th(e)) + !Rh.call(t, n) && n !== r && li(t, n, { get: () => e[n], enumerable: !(i = Ih(e, n)) || i.enumerable }); return t; }; - var Te = (t, e, r) => (r = t != null ? Ch(Th(t)) : {}, yo(e || !t || !t.__esModule ? li(r, "default", { value: t, enumerable: true }) : r, t)); - var Bh = (t) => yo(li({}, "__esModule", { value: true }), t); - var So = x((Xg, Eo) => { - var wo = {}; - Eo.exports = wo; - var bo = { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], grey: [90, 39], brightRed: [91, 39], brightGreen: [92, 39], brightYellow: [93, 39], brightBlue: [94, 39], brightMagenta: [95, 39], brightCyan: [96, 39], brightWhite: [97, 39], bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgGray: [100, 49], bgGrey: [100, 49], bgBrightRed: [101, 49], bgBrightGreen: [102, 49], bgBrightYellow: [103, 49], bgBrightBlue: [104, 49], bgBrightMagenta: [105, 49], bgBrightCyan: [106, 49], bgBrightWhite: [107, 49], blackBG: [40, 49], redBG: [41, 49], greenBG: [42, 49], yellowBG: [43, 49], blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], whiteBG: [47, 49] }; - Object.keys(bo).forEach(function(t) { - var e = bo[t], r = wo[t] = []; + var Te = (t, e, r) => (r = t != null ? Oh(Ah(t)) : {}, bo(e || !t || !t.__esModule ? li(r, "default", { value: t, enumerable: true }) : r, t)); + var Lh = (t) => bo(li({}, "__esModule", { value: true }), t); + var ko = x((Qg, So) => { + var Eo = {}; + So.exports = Eo; + var wo = { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], grey: [90, 39], brightRed: [91, 39], brightGreen: [92, 39], brightYellow: [93, 39], brightBlue: [94, 39], brightMagenta: [95, 39], brightCyan: [96, 39], brightWhite: [97, 39], bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgGray: [100, 49], bgGrey: [100, 49], bgBrightRed: [101, 49], bgBrightGreen: [102, 49], bgBrightYellow: [103, 49], bgBrightBlue: [104, 49], bgBrightMagenta: [105, 49], bgBrightCyan: [106, 49], bgBrightWhite: [107, 49], blackBG: [40, 49], redBG: [41, 49], greenBG: [42, 49], yellowBG: [43, 49], blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], whiteBG: [47, 49] }; + Object.keys(wo).forEach(function(t) { + var e = wo[t], r = Eo[t] = []; r.open = "[" + e[0] + "m", r.close = "[" + e[1] + "m"; }); }); - var Co = x((Qg, ko) => { + var Oo = x((Jg, Co) => { "use strict"; - ko.exports = function(t, e) { + Co.exports = function(t, e) { e = e || process.argv; var r = e.indexOf("--"), i = /^-{1,2}/.test(t) ? "" : "--", n = e.indexOf(i + t); return n !== -1 && (r === -1 ? true : n < r); }; }); - var Io = x((Jg, Oo) => { + var To = x((e_, Io) => { "use strict"; - var Lh = require("os"), rt = Co(), $e = process.env, Kt = void 0; - rt("no-color") || rt("no-colors") || rt("color=false") ? Kt = false : (rt("color") || rt("colors") || rt("color=true") || rt("color=always")) && (Kt = true); - "FORCE_COLOR" in $e && (Kt = $e.FORCE_COLOR.length === 0 || parseInt($e.FORCE_COLOR, 10) !== 0); - function Nh(t) { + var Nh = require("os"), rt = Oo(), Ve = process.env, Zt = void 0; + rt("no-color") || rt("no-colors") || rt("color=false") ? Zt = false : (rt("color") || rt("colors") || rt("color=true") || rt("color=always")) && (Zt = true); + "FORCE_COLOR" in Ve && (Zt = Ve.FORCE_COLOR.length === 0 || parseInt(Ve.FORCE_COLOR, 10) !== 0); + function Ph(t) { return t === 0 ? false : { level: t, hasBasic: true, has256: t >= 2, has16m: t >= 3 }; } - function Ph(t) { - if (Kt === false) + function Fh(t) { + if (Zt === false) return 0; if (rt("color=16m") || rt("color=full") || rt("color=truecolor")) return 3; if (rt("color=256")) return 2; - if (t && !t.isTTY && Kt !== true) + if (t && !t.isTTY && Zt !== true) return 0; - var e = Kt ? 1 : 0; + var e = Zt ? 1 : 0; if (process.platform === "win32") { - var r = Lh.release().split("."); + var r = Nh.release().split("."); return Number(process.versions.node.split(".")[0]) >= 8 && Number(r[0]) >= 10 && Number(r[2]) >= 10586 ? Number(r[2]) >= 14931 ? 3 : 2 : 1; } - if ("CI" in $e) + if ("CI" in Ve) return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(n) { - return n in $e; - }) || $e.CI_NAME === "codeship" ? 1 : e; - if ("TEAMCITY_VERSION" in $e) - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($e.TEAMCITY_VERSION) ? 1 : 0; - if ("TERM_PROGRAM" in $e) { - var i = parseInt(($e.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch ($e.TERM_PROGRAM) { + return n in Ve; + }) || Ve.CI_NAME === "codeship" ? 1 : e; + if ("TEAMCITY_VERSION" in Ve) + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ve.TEAMCITY_VERSION) ? 1 : 0; + if ("TERM_PROGRAM" in Ve) { + var i = parseInt((Ve.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (Ve.TERM_PROGRAM) { case "iTerm.app": return i >= 3 ? 3 : 2; case "Hyper": @@ -136,16 +136,16 @@ var require_utilsBundleImpl = __commonJS({ return 2; } } - return /-256(color)?$/i.test($e.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test($e.TERM) || "COLORTERM" in $e ? 1 : ($e.TERM === "dumb", e); + return /-256(color)?$/i.test(Ve.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ve.TERM) || "COLORTERM" in Ve ? 1 : (Ve.TERM === "dumb", e); } function Qi(t) { - var e = Ph(t); - return Nh(e); + var e = Fh(t); + return Ph(e); } - Oo.exports = { supportsColor: Qi, stdout: Qi(process.stdout), stderr: Qi(process.stderr) }; + Io.exports = { supportsColor: Qi, stdout: Qi(process.stdout), stderr: Qi(process.stderr) }; }); - var Ao = x((e_, To) => { - To.exports = function(e, r) { + var Ro = x((t_, Ao) => { + Ao.exports = function(e, r) { var i = ""; e = e || "Run the trap, drop the bass", e = e.split(""); var n = { a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"], b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"], c: ["\xA9", "\u023B", "\u03FE"], d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"], e: ["\xCB", "\u0115", "\u018E", "\u0258", "\u03A3", "\u03BE", "\u04BC", "\u0A6C"], f: ["\u04FA"], g: ["\u0262"], h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"], i: ["\u0F0F"], j: ["\u0134"], k: ["\u0138", "\u04A0", "\u04C3", "\u051E"], l: ["\u0139"], m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"], n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"], o: ["\xD8", "\xF5", "\xF8", "\u01FE", "\u0298", "\u047A", "\u05DD", "\u06DD", "\u0E4F"], p: ["\u01F7", "\u048E"], q: ["\u09CD"], r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"], s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"], t: ["\u0141", "\u0166", "\u0373"], u: ["\u01B1", "\u054D"], v: ["\u05D8"], w: ["\u0428", "\u0460", "\u047C", "\u0D70"], x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"], y: ["\xA5", "\u04B0", "\u04CB"], z: ["\u01B5", "\u0240"] }; @@ -156,8 +156,8 @@ var require_utilsBundleImpl = __commonJS({ }), i; }; }); - var Bo = x((t_, Ro) => { - Ro.exports = function(e, r) { + var Lo = x((r_, Bo) => { + Bo.exports = function(e, r) { e = e || " he is here "; var i = { up: ["\u030D", "\u030E", "\u0304", "\u0305", "\u033F", "\u0311", "\u0306", "\u0310", "\u0352", "\u0357", "\u0351", "\u0307", "\u0308", "\u030A", "\u0342", "\u0313", "\u0308", "\u034A", "\u034B", "\u034C", "\u0303", "\u0302", "\u030C", "\u0350", "\u0300", "\u0301", "\u030B", "\u030F", "\u0312", "\u0313", "\u0314", "\u033D", "\u0309", "\u0363", "\u0364", "\u0365", "\u0366", "\u0367", "\u0368", "\u0369", "\u036A", "\u036B", "\u036C", "\u036D", "\u036E", "\u036F", "\u033E", "\u035B", "\u0346", "\u031A"], down: ["\u0316", "\u0317", "\u0318", "\u0319", "\u031C", "\u031D", "\u031E", "\u031F", "\u0320", "\u0324", "\u0325", "\u0326", "\u0329", "\u032A", "\u032B", "\u032C", "\u032D", "\u032E", "\u032F", "\u0330", "\u0331", "\u0332", "\u0333", "\u0339", "\u033A", "\u033B", "\u033C", "\u0345", "\u0347", "\u0348", "\u0349", "\u034D", "\u034E", "\u0353", "\u0354", "\u0355", "\u0356", "\u0359", "\u035A", "\u0323"], mid: ["\u0315", "\u031B", "\u0300", "\u0301", "\u0358", "\u0321", "\u0322", "\u0327", "\u0328", "\u0334", "\u0335", "\u0336", "\u035C", "\u035D", "\u035E", "\u035F", "\u0360", "\u0362", "\u0338", "\u0337", "\u0361", " \u0489"] }, n = [].concat(i.up, i.down, i.mid); function s(l) { @@ -196,8 +196,8 @@ var require_utilsBundleImpl = __commonJS({ return a(e, r); }; }); - var No = x((r_, Lo) => { - Lo.exports = function(t) { + var Po = x((i_, No) => { + No.exports = function(t) { return function(e, r, i) { if (e === " ") return e; @@ -212,147 +212,147 @@ var require_utilsBundleImpl = __commonJS({ }; }; }); - var Fo = x((i_, Po) => { - Po.exports = function(t) { + var Mo = x((n_, Fo) => { + Fo.exports = function(t) { return function(e, r, i) { return r % 2 === 0 ? e : t.inverse(e); }; }; }); - var Uo = x((n_, Mo) => { - Mo.exports = function(t) { + var Do = x((s_, Uo) => { + Uo.exports = function(t) { var e = ["red", "yellow", "green", "blue", "magenta"]; return function(r, i, n) { return r === " " ? r : t[e[i++ % e.length]](r); }; }; }); - var jo = x((s_, Do) => { - Do.exports = function(t) { + var qo = x((o_, jo) => { + jo.exports = function(t) { var e = ["underline", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta", "brightYellow", "brightRed", "brightGreen", "brightBlue", "brightWhite", "brightCyan", "brightMagenta"]; return function(r, i, n) { return r === " " ? r : t[e[Math.round(Math.random() * (e.length - 2))]](r); }; }; }); - var zo = x((a_, Go) => { - var le = {}; - Go.exports = le; - le.themes = {}; - var Fh = require("util"), Rt = le.styles = So(), Ho = Object.defineProperties, Mh = new RegExp(/[\r\n]+/g); - le.supportsColor = Io().supportsColor; - typeof le.enabled == "undefined" && (le.enabled = le.supportsColor() !== false); - le.enable = function() { - le.enabled = true; + var Wo = x((l_, zo) => { + var ae = {}; + zo.exports = ae; + ae.themes = {}; + var Mh = require("util"), Rt = ae.styles = ko(), Vo = Object.defineProperties, Uh = new RegExp(/[\r\n]+/g); + ae.supportsColor = To().supportsColor; + typeof ae.enabled == "undefined" && (ae.enabled = ae.supportsColor() !== false); + ae.enable = function() { + ae.enabled = true; }; - le.disable = function() { - le.enabled = false; + ae.disable = function() { + ae.enabled = false; }; - le.stripColors = le.strip = function(t) { + ae.stripColors = ae.strip = function(t) { return ("" + t).replace(/\x1B\[\d+m/g, ""); }; - var o_ = le.stylize = function(e, r) { - if (!le.enabled) + var a_ = ae.stylize = function(e, r) { + if (!ae.enabled) return e + ""; var i = Rt[r]; - return !i && r in le ? le[r](e) : i.open + e + i.close; - }, Uh = /[|\\{}()[\]^$+*?.]/g, Dh = function(t) { + return !i && r in ae ? ae[r](e) : i.open + e + i.close; + }, Dh = /[|\\{}()[\]^$+*?.]/g, jh = function(t) { if (typeof t != "string") throw new TypeError("Expected a string"); - return t.replace(Uh, "\\$&"); + return t.replace(Dh, "\\$&"); }; - function Vo(t) { + function $o(t) { var e = function r() { - return qh.apply(r, arguments); + return Hh.apply(r, arguments); }; - return e._styles = t, e.__proto__ = jh, e; + return e._styles = t, e.__proto__ = qh, e; } - var $o = function() { + var Go = function() { var t = {}; return Rt.grey = Rt.gray, Object.keys(Rt).forEach(function(e) { - Rt[e].closeRe = new RegExp(Dh(Rt[e].close), "g"), t[e] = { get: function() { - return Vo(this._styles.concat(e)); + Rt[e].closeRe = new RegExp(jh(Rt[e].close), "g"), t[e] = { get: function() { + return $o(this._styles.concat(e)); } }; }), t; - }(), jh = Ho(function() { - }, $o); - function qh() { + }(), qh = Vo(function() { + }, Go); + function Hh() { var t = Array.prototype.slice.call(arguments), e = t.map(function(o) { - return o != null && o.constructor === String ? o : Fh.inspect(o); + return o != null && o.constructor === String ? o : Mh.inspect(o); }).join(" "); - if (!le.enabled || !e) + if (!ae.enabled || !e) return e; for (var r = e.indexOf(` `) != -1, i = this._styles, n = i.length; n--; ) { var s = Rt[i[n]]; - e = s.open + e.replace(s.closeRe, s.open) + s.close, r && (e = e.replace(Mh, function(o) { + e = s.open + e.replace(s.closeRe, s.open) + s.close, r && (e = e.replace(Uh, function(o) { return s.close + o + s.open; })); } return e; } - le.setTheme = function(t) { + ae.setTheme = function(t) { if (typeof t == "string") { console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); return; } for (var e in t) (function(r) { - le[r] = function(i) { + ae[r] = function(i) { if (typeof t[r] == "object") { var n = i; for (var s in t[r]) - n = le[t[r][s]](n); + n = ae[t[r][s]](n); return n; } - return le[t[r]](i); + return ae[t[r]](i); }; })(e); }; - function Hh() { + function Vh() { var t = {}; - return Object.keys($o).forEach(function(e) { + return Object.keys(Go).forEach(function(e) { t[e] = { get: function() { - return Vo([e]); + return $o([e]); } }; }), t; } - var Vh = function(e, r) { + var $h = function(e, r) { var i = r.split(""); return i = i.map(e), i.join(""); }; - le.trap = Ao(); - le.zalgo = Bo(); - le.maps = {}; - le.maps.america = No()(le); - le.maps.zebra = Fo()(le); - le.maps.rainbow = Uo()(le); - le.maps.random = jo()(le); - for (qo in le.maps) + ae.trap = Ro(); + ae.zalgo = Lo(); + ae.maps = {}; + ae.maps.america = Po()(ae); + ae.maps.zebra = Mo()(ae); + ae.maps.rainbow = Do()(ae); + ae.maps.random = qo()(ae); + for (Ho in ae.maps) (function(t) { - le[t] = function(e) { - return Vh(le.maps[t], e); + ae[t] = function(e) { + return $h(ae.maps[t], e); }; - })(qo); - var qo; - Ho(le, Hh()); + })(Ho); + var Ho; + Vo(ae, Vh()); }); - var Yo = x((l_, Wo) => { - var $h = zo(); - Wo.exports = $h; + var Ko = x((c_, Yo) => { + var Gh = Wo(); + Yo.exports = Gh; }); - var Ji = x((c_, Ko) => { - var Zt = 1e3, Xt = Zt * 60, Qt = Xt * 60, Bt = Qt * 24, Gh = Bt * 7, zh = Bt * 365.25; - Ko.exports = function(t, e) { + var Ji = x((u_, Zo) => { + var Xt = 1e3, Qt = Xt * 60, Jt = Qt * 60, Bt = Jt * 24, zh = Bt * 7, Wh = Bt * 365.25; + Zo.exports = function(t, e) { e = e || {}; var r = typeof t; if (r === "string" && t.length > 0) - return Wh(t); + return Yh(t); if (r === "number" && isFinite(t)) - return e.long ? Kh(t) : Yh(t); + return e.long ? Zh(t) : Kh(t); throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(t)); }; - function Wh(t) { + function Yh(t) { if (t = String(t), !(t.length > 100)) { var e = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t); if (!!e) { @@ -363,11 +363,11 @@ var require_utilsBundleImpl = __commonJS({ case "yrs": case "yr": case "y": - return r * zh; + return r * Wh; case "weeks": case "week": case "w": - return r * Gh; + return r * zh; case "days": case "day": case "d": @@ -377,19 +377,19 @@ var require_utilsBundleImpl = __commonJS({ case "hrs": case "hr": case "h": - return r * Qt; + return r * Jt; case "minutes": case "minute": case "mins": case "min": case "m": - return r * Xt; + return r * Qt; case "seconds": case "second": case "secs": case "sec": case "s": - return r * Zt; + return r * Xt; case "milliseconds": case "millisecond": case "msecs": @@ -402,21 +402,21 @@ var require_utilsBundleImpl = __commonJS({ } } } - function Yh(t) { + function Kh(t) { var e = Math.abs(t); - return e >= Bt ? Math.round(t / Bt) + "d" : e >= Qt ? Math.round(t / Qt) + "h" : e >= Xt ? Math.round(t / Xt) + "m" : e >= Zt ? Math.round(t / Zt) + "s" : t + "ms"; + return e >= Bt ? Math.round(t / Bt) + "d" : e >= Jt ? Math.round(t / Jt) + "h" : e >= Qt ? Math.round(t / Qt) + "m" : e >= Xt ? Math.round(t / Xt) + "s" : t + "ms"; } - function Kh(t) { + function Zh(t) { var e = Math.abs(t); - return e >= Bt ? ci(t, e, Bt, "day") : e >= Qt ? ci(t, e, Qt, "hour") : e >= Xt ? ci(t, e, Xt, "minute") : e >= Zt ? ci(t, e, Zt, "second") : t + " ms"; + return e >= Bt ? ci(t, e, Bt, "day") : e >= Jt ? ci(t, e, Jt, "hour") : e >= Qt ? ci(t, e, Qt, "minute") : e >= Xt ? ci(t, e, Xt, "second") : t + " ms"; } function ci(t, e, r, i) { var n = e >= r * 1.5; return Math.round(t / r) + " " + i + (n ? "s" : ""); } }); - var en = x((u_, Zo) => { - function Zh(t) { + var en = x((f_, Xo) => { + function Xh(t) { r.debug = r, r.default = r, r.coerce = l, r.disable = s, r.enable = n, r.enabled = o, r.humanize = Ji(), r.destroy = c, Object.keys(t).forEach((u) => { r[u] = t[u]; }), r.names = [], r.skips = [], r.formatters = {}; @@ -432,19 +432,19 @@ var require_utilsBundleImpl = __commonJS({ function m(...v) { if (!m.enabled) return; - let y = m, O = Number(new Date()), w = O - (f || O); - y.diff = w, y.prev = f, y.curr = O, f = O, v[0] = r.coerce(v[0]), typeof v[0] != "string" && v.unshift("%O"); + let y = m, I = Number(new Date()), w = I - (f || I); + y.diff = w, y.prev = f, y.curr = I, f = I, v[0] = r.coerce(v[0]), typeof v[0] != "string" && v.unshift("%O"); let S = 0; - v[0] = v[0].replace(/%([a-zA-Z%])/g, (V, C) => { - if (V === "%%") + v[0] = v[0].replace(/%([a-zA-Z%])/g, ($, C) => { + if ($ === "%%") return "%"; S++; - let M = r.formatters[C]; - if (typeof M == "function") { + let U = r.formatters[C]; + if (typeof U == "function") { let E = v[S]; - V = M.call(y, E), v.splice(S, 1), S--; + $ = U.call(y, E), v.splice(S, 1), S--; } - return V; + return $; }), r.formatArgs.call(y, v), (y.log || r.log).apply(y, v); } return m.namespace = u, m.useColors = r.useColors(), m.color = r.selectColor(u), m.extend = i, m.destroy = r.destroy, Object.defineProperty(m, "enabled", { enumerable: true, configurable: false, get: () => h !== null ? h : (p !== r.namespaces && (p = r.namespaces, d = r.enabled(u)), d), set: (v) => { @@ -488,25 +488,25 @@ var require_utilsBundleImpl = __commonJS({ } return r.enable(r.load()), r; } - Zo.exports = Zh; + Xo.exports = Xh; }); - var Xo = x((Ke, ui) => { - Ke.formatArgs = Qh; - Ke.save = Jh; - Ke.load = ep; - Ke.useColors = Xh; - Ke.storage = tp(); - Ke.destroy = (() => { + var Qo = x((We, ui) => { + We.formatArgs = Jh; + We.save = ep; + We.load = tp; + We.useColors = Qh; + We.storage = rp(); + We.destroy = (() => { let t = false; return () => { t || (t = 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`.")); }; })(); - Ke.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 Xh() { + We.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 Qh() { return typeof window != "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs) ? true : typeof navigator != "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/) ? false : 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 Qh(t) { + function Jh(t) { if (t[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + t[0] + (this.useColors ? "%c " : " ") + "+" + ui.exports.humanize(this.diff), !this.useColors) return; let e = "color: " + this.color; @@ -516,31 +516,31 @@ var require_utilsBundleImpl = __commonJS({ n !== "%%" && (r++, n === "%c" && (i = r)); }), t.splice(i, 0, e); } - Ke.log = console.debug || console.log || (() => { + We.log = console.debug || console.log || (() => { }); - function Jh(t) { + function ep(t) { try { - t ? Ke.storage.setItem("debug", t) : Ke.storage.removeItem("debug"); + t ? We.storage.setItem("debug", t) : We.storage.removeItem("debug"); } catch (e) { } } - function ep() { + function tp() { let t; try { - t = Ke.storage.getItem("debug"); + t = We.storage.getItem("debug"); } catch (e) { } return !t && typeof process != "undefined" && "env" in process && (t = process.env.DEBUG), t; } - function tp() { + function rp() { try { return localStorage; } catch (e) { } } - ui.exports = en()(Ke); - var { formatters: rp } = ui.exports; - rp.j = function(t) { + ui.exports = en()(We); + var { formatters: ip } = ui.exports; + ip.j = function(t) { try { return JSON.stringify(t); } catch (e) { @@ -548,83 +548,83 @@ var require_utilsBundleImpl = __commonJS({ } }; }); - var Jo = x((f_, Qo) => { + var ea = x((h_, Jo) => { "use strict"; - Qo.exports = (t, e) => { + Jo.exports = (t, e) => { e = e || process.argv; let r = t.startsWith("-") ? "" : t.length === 1 ? "-" : "--", i = e.indexOf(r + t), n = e.indexOf("--"); return i !== -1 && (n === -1 ? true : i < n); }; }); - var ta = x((h_, ea) => { + var ra = x((p_, ta) => { "use strict"; - var ip = require("os"), it = Jo(), qe = process.env, Jt; - it("no-color") || it("no-colors") || it("color=false") ? Jt = false : (it("color") || it("colors") || it("color=true") || it("color=always")) && (Jt = true); - "FORCE_COLOR" in qe && (Jt = qe.FORCE_COLOR.length === 0 || parseInt(qe.FORCE_COLOR, 10) !== 0); - function np(t) { + var np = require("os"), it = ea(), je = process.env, er; + it("no-color") || it("no-colors") || it("color=false") ? er = false : (it("color") || it("colors") || it("color=true") || it("color=always")) && (er = true); + "FORCE_COLOR" in je && (er = je.FORCE_COLOR.length === 0 || parseInt(je.FORCE_COLOR, 10) !== 0); + function sp(t) { return t === 0 ? false : { level: t, hasBasic: true, has256: t >= 2, has16m: t >= 3 }; } - function sp(t) { - if (Jt === false) + function op(t) { + if (er === false) return 0; if (it("color=16m") || it("color=full") || it("color=truecolor")) return 3; if (it("color=256")) return 2; - if (t && !t.isTTY && Jt !== true) + if (t && !t.isTTY && er !== true) return 0; - let e = Jt ? 1 : 0; + let e = er ? 1 : 0; if (process.platform === "win32") { - let r = ip.release().split("."); + let r = np.release().split("."); return Number(process.versions.node.split(".")[0]) >= 8 && Number(r[0]) >= 10 && Number(r[2]) >= 10586 ? Number(r[2]) >= 14931 ? 3 : 2 : 1; } - if ("CI" in qe) - return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((r) => r in qe) || qe.CI_NAME === "codeship" ? 1 : e; - if ("TEAMCITY_VERSION" in qe) - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(qe.TEAMCITY_VERSION) ? 1 : 0; - if (qe.COLORTERM === "truecolor") + if ("CI" in je) + return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((r) => r in je) || je.CI_NAME === "codeship" ? 1 : e; + if ("TEAMCITY_VERSION" in je) + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(je.TEAMCITY_VERSION) ? 1 : 0; + if (je.COLORTERM === "truecolor") return 3; - if ("TERM_PROGRAM" in qe) { - let r = parseInt((qe.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (qe.TERM_PROGRAM) { + if ("TERM_PROGRAM" in je) { + let r = parseInt((je.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (je.TERM_PROGRAM) { case "iTerm.app": return r >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } - return /-256(color)?$/i.test(qe.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(qe.TERM) || "COLORTERM" in qe ? 1 : (qe.TERM === "dumb", e); + return /-256(color)?$/i.test(je.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(je.TERM) || "COLORTERM" in je ? 1 : (je.TERM === "dumb", e); } function tn(t) { - let e = sp(t); - return np(e); - } - ea.exports = { supportsColor: tn, stdout: tn(process.stdout), stderr: tn(process.stderr) }; - }); - var ia = x((Ue, hi) => { - var op = require("tty"), fi = require("util"); - Ue.init = pp; - Ue.log = up; - Ue.formatArgs = lp; - Ue.save = fp; - Ue.load = hp; - Ue.useColors = ap; - Ue.destroy = fi.deprecate(() => { + let e = op(t); + return sp(e); + } + ta.exports = { supportsColor: tn, stdout: tn(process.stdout), stderr: tn(process.stderr) }; + }); + var na = x((Me, hi) => { + var ap = require("tty"), fi = require("util"); + Me.init = dp; + Me.log = fp; + Me.formatArgs = cp; + Me.save = hp; + Me.load = pp; + Me.useColors = lp; + Me.destroy = fi.deprecate(() => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - Ue.colors = [6, 2, 3, 4, 5, 1]; + Me.colors = [6, 2, 3, 4, 5, 1]; try { - let t = ta(); - t && (t.stderr || t).level >= 2 && (Ue.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]); + let t = ra(); + t && (t.stderr || t).level >= 2 && (Me.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) { } - Ue.inspectOpts = Object.keys(process.env).filter((t) => /^debug_/i.test(t)).reduce((t, e) => { + Me.inspectOpts = Object.keys(process.env).filter((t) => /^debug_/i.test(t)).reduce((t, e) => { let r = e.substring(6).toLowerCase().replace(/_([a-z])/g, (n, s) => s.toUpperCase()), i = process.env[e]; return /^(yes|on|true|enabled)$/i.test(i) ? i = true : /^(no|off|false|disabled)$/i.test(i) ? i = false : i === "null" ? i = null : i = Number(i), t[r] = i, t; }, {}); - function ap() { - return "colors" in Ue.inspectOpts ? Boolean(Ue.inspectOpts.colors) : op.isatty(process.stderr.fd); + function lp() { + return "colors" in Me.inspectOpts ? Boolean(Me.inspectOpts.colors) : ap.isatty(process.stderr.fd); } - function lp(t) { + function cp(t) { let { namespace: e, useColors: r } = this; if (r) { let i = this.color, n = "[3" + (i < 8 ? i : "8;5;" + i), s = ` ${n};1m${e} `; @@ -632,70 +632,70 @@ var require_utilsBundleImpl = __commonJS({ `).join(` ` + s), t.push(n + "m+" + hi.exports.humanize(this.diff) + ""); } else - t[0] = cp() + e + " " + t[0]; + t[0] = up() + e + " " + t[0]; } - function cp() { - return Ue.inspectOpts.hideDate ? "" : new Date().toISOString() + " "; + function up() { + return Me.inspectOpts.hideDate ? "" : new Date().toISOString() + " "; } - function up(...t) { + function fp(...t) { return process.stderr.write(fi.format(...t) + ` `); } - function fp(t) { + function hp(t) { t ? process.env.DEBUG = t : delete process.env.DEBUG; } - function hp() { + function pp() { return process.env.DEBUG; } - function pp(t) { + function dp(t) { t.inspectOpts = {}; - let e = Object.keys(Ue.inspectOpts); + let e = Object.keys(Me.inspectOpts); for (let r = 0; r < e.length; r++) - t.inspectOpts[e[r]] = Ue.inspectOpts[e[r]]; + t.inspectOpts[e[r]] = Me.inspectOpts[e[r]]; } - hi.exports = en()(Ue); - var { formatters: ra } = hi.exports; - ra.o = function(t) { + hi.exports = en()(Me); + var { formatters: ia } = hi.exports; + ia.o = function(t) { return this.inspectOpts.colors = this.useColors, fi.inspect(t, this.inspectOpts).split(` `).map((e) => e.trim()).join(" "); }; - ra.O = function(t) { + ia.O = function(t) { return this.inspectOpts.colors = this.useColors, fi.inspect(t, this.inspectOpts); }; }); - var er = x((p_, rn) => { - typeof process == "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs ? rn.exports = Xo() : rn.exports = ia(); + var tr = x((d_, rn) => { + typeof process == "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs ? rn.exports = Qo() : rn.exports = na(); }); - var sa = x((na) => { + var oa = x((sa) => { "use strict"; - var dp = require("url").parse, mp = { ftp: 21, gopher: 70, http: 80, https: 443, ws: 80, wss: 443 }, vp = String.prototype.endsWith || function(t) { + var mp = require("url").parse, vp = { ftp: 21, gopher: 70, http: 80, https: 443, ws: 80, wss: 443 }, gp = String.prototype.endsWith || function(t) { return t.length <= this.length && this.indexOf(t, this.length - t.length) !== -1; }; - function gp(t) { - var e = typeof t == "string" ? dp(t) : t || {}, r = e.protocol, i = e.host, n = e.port; - if (typeof i != "string" || !i || typeof r != "string" || (r = r.split(":", 1)[0], i = i.replace(/:\d*$/, ""), n = parseInt(n) || mp[r] || 0, !_p(i, n))) + function _p(t) { + var e = typeof t == "string" ? mp(t) : t || {}, r = e.protocol, i = e.host, n = e.port; + if (typeof i != "string" || !i || typeof r != "string" || (r = r.split(":", 1)[0], i = i.replace(/:\d*$/, ""), n = parseInt(n) || vp[r] || 0, !xp(i, n))) return ""; - var s = tr("npm_config_" + r + "_proxy") || tr(r + "_proxy") || tr("npm_config_proxy") || tr("all_proxy"); + var s = rr("npm_config_" + r + "_proxy") || rr(r + "_proxy") || rr("npm_config_proxy") || rr("all_proxy"); return s && s.indexOf("://") === -1 && (s = r + "://" + s), s; } - function _p(t, e) { - var r = (tr("npm_config_no_proxy") || tr("no_proxy")).toLowerCase(); + function xp(t, e) { + var r = (rr("npm_config_no_proxy") || rr("no_proxy")).toLowerCase(); return r ? r === "*" ? false : r.split(/[,\s]/).every(function(i) { if (!i) return true; var n = i.match(/^(.+):(\d+)$/), s = n ? n[1] : i, o = n ? parseInt(n[2]) : 0; - return o && o !== e ? true : /^[.*]/.test(s) ? (s.charAt(0) === "*" && (s = s.slice(1)), !vp.call(t, s)) : t !== s; + return o && o !== e ? true : /^[.*]/.test(s) ? (s.charAt(0) === "*" && (s = s.slice(1)), !gp.call(t, s)) : t !== s; }) : true; } - function tr(t) { + function rr(t) { return process.env[t.toLowerCase()] || process.env[t.toUpperCase()] || ""; } - na.getProxyForUrl = gp; + sa.getProxyForUrl = _p; }); - var oa = x((nn) => { + var aa = x((nn) => { "use strict"; Object.defineProperty(nn, "__esModule", { value: true }); - function xp(t) { + function yp(t) { return function(e, r) { return new Promise((i, n) => { t.call(this, e, r, (s, o) => { @@ -704,14 +704,14 @@ var require_utilsBundleImpl = __commonJS({ }); }; } - nn.default = xp; + nn.default = yp; }); - var an = x((on, la) => { + var an = x((on, ca) => { "use strict"; - var aa = on && on.__importDefault || function(t) { + var la = on && on.__importDefault || function(t) { return t && t.__esModule ? t : { default: t }; - }, yp = require("events"), bp = aa(er()), wp = aa(oa()), Rr = bp.default("agent-base"); - function Ep(t) { + }, bp = require("events"), wp = la(tr()), Ep = la(aa()), Br = wp.default("agent-base"); + function Sp(t) { return Boolean(t) && typeof t.addRequest == "function"; } function sn() { @@ -723,7 +723,7 @@ var require_utilsBundleImpl = __commonJS({ return new pi.Agent(t, e); } (function(t) { - class e extends yp.EventEmitter { + class e extends bp.EventEmitter { constructor(i, n) { super(); let s = n; @@ -758,8 +758,8 @@ var require_utilsBundleImpl = __commonJS({ }, h = (p) => { if (o) return; - if (a != null && (clearTimeout(a), a = null), Ep(p)) { - Rr("Callback returned another Agent instance %o", p.constructor.name), p.addRequest(i, s); + if (a != null && (clearTimeout(a), a = null), Sp(p)) { + Br("Callback returned another Agent instance %o", p.constructor.name), p.addRequest(i, s); return; } if (p) { @@ -775,32 +775,32 @@ var require_utilsBundleImpl = __commonJS({ c(new Error("`callback` is not defined")); return; } - this.promisifiedCallback || (this.callback.length >= 3 ? (Rr("Converting legacy callback function to promise"), this.promisifiedCallback = wp.default(this.callback)) : this.promisifiedCallback = this.callback), typeof l == "number" && l > 0 && (a = setTimeout(u, l)), "port" in s && typeof s.port != "number" && (s.port = Number(s.port)); + this.promisifiedCallback || (this.callback.length >= 3 ? (Br("Converting legacy callback function to promise"), this.promisifiedCallback = Ep.default(this.callback)) : this.promisifiedCallback = this.callback), typeof l == "number" && l > 0 && (a = setTimeout(u, l)), "port" in s && typeof s.port != "number" && (s.port = Number(s.port)); try { - Rr("Resolving socket for %o request: %o", s.protocol, `${i.method} ${i.path}`), Promise.resolve(this.promisifiedCallback(i, s)).then(h, f); + Br("Resolving socket for %o request: %o", s.protocol, `${i.method} ${i.path}`), Promise.resolve(this.promisifiedCallback(i, s)).then(h, f); } catch (p) { Promise.reject(p).catch(f); } } freeSocket(i, n) { - Rr("Freeing socket %o %o", i.constructor.name, n), i.destroy(); + Br("Freeing socket %o %o", i.constructor.name, n), i.destroy(); } destroy() { - Rr("Destroying agent %o", this.constructor.name); + Br("Destroying agent %o", this.constructor.name); } } t.Agent = e, t.prototype = t.Agent.prototype; })(pi || (pi = {})); - la.exports = pi; + ca.exports = pi; }); - var ca = x((Lr) => { + var ua = x((Nr) => { "use strict"; - var Sp = Lr && Lr.__importDefault || function(t) { + var kp = Nr && Nr.__importDefault || function(t) { return t && t.__esModule ? t : { default: t }; }; - Object.defineProperty(Lr, "__esModule", { value: true }); - var kp = Sp(er()), Br = kp.default("https-proxy-agent:parse-proxy-response"); - function Cp(t) { + Object.defineProperty(Nr, "__esModule", { value: true }); + var Cp = kp(tr()), Lr = Cp.default("https-proxy-agent:parse-proxy-response"); + function Op(t) { return new Promise((e, r) => { let i = 0, n = []; function s() { @@ -811,13 +811,13 @@ var require_utilsBundleImpl = __commonJS({ t.removeListener("end", l), t.removeListener("error", c), t.removeListener("close", a), t.removeListener("readable", s); } function a(f) { - Br("onclose had error %o", f); + Lr("onclose had error %o", f); } function l() { - Br("onend"); + Lr("onend"); } function c(f) { - o(), Br("onerror %o", f), r(f); + o(), Lr("onerror %o", f), r(f); } function u(f) { n.push(f), i += f.length; @@ -825,21 +825,21 @@ var require_utilsBundleImpl = __commonJS({ if (h.indexOf(`\r \r `) === -1) { - Br("have not received end of HTTP headers yet..."), s(); + Lr("have not received end of HTTP headers yet..."), s(); return; } let d = h.toString("ascii", 0, h.indexOf(`\r `)), m = +d.split(" ")[1]; - Br("got proxy server response: %o", d), e({ statusCode: m, buffered: h }); + Lr("got proxy server response: %o", d), e({ statusCode: m, buffered: h }); } t.on("error", c), t.on("close", a), t.on("end", l), s(); }); } - Lr.default = Cp; + Nr.default = Op; }); - var pa = x((Lt) => { + var da = x((Lt) => { "use strict"; - var Op = Lt && Lt.__awaiter || function(t, e, r, i) { + var Ip = Lt && Lt.__awaiter || function(t, e, r, i) { function n(s) { return s instanceof r ? s : new r(function(o) { o(s); @@ -865,498 +865,510 @@ var require_utilsBundleImpl = __commonJS({ } c((i = i.apply(t, e || [])).next()); }); - }, rr = Lt && Lt.__importDefault || function(t) { + }, ir = Lt && Lt.__importDefault || function(t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(Lt, "__esModule", { value: true }); - var ua = rr(require("net")), fa = rr(require("tls")), Ip = rr(require("url")), Tp = rr(require("assert")), Ap = rr(er()), Rp = an(), Bp = rr(ca()), Nr = Ap.default("https-proxy-agent:agent"), ha = class extends Rp.Agent { + var fa = ir(require("net")), ha = ir(require("tls")), Tp = ir(require("url")), Ap = ir(require("assert")), Rp = ir(tr()), Bp = an(), Lp = ir(ua()), Pr = Rp.default("https-proxy-agent:agent"), pa = class extends Bp.Agent { constructor(e) { let r; - if (typeof e == "string" ? r = Ip.default.parse(e) : r = e, !r) + if (typeof e == "string" ? r = Tp.default.parse(e) : r = e, !r) throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!"); - Nr("creating new HttpsProxyAgent instance: %o", r); + Pr("creating new HttpsProxyAgent instance: %o", r); super(r); let i = Object.assign({}, r); - this.secureProxy = r.secureProxy || Pp(i.protocol), i.host = i.hostname || i.host, typeof i.port == "string" && (i.port = parseInt(i.port, 10)), !i.port && i.host && (i.port = this.secureProxy ? 443 : 80), this.secureProxy && !("ALPNProtocols" in i) && (i.ALPNProtocols = ["http 1.1"]), i.host && i.path && (delete i.path, delete i.pathname), this.proxy = i; + this.secureProxy = r.secureProxy || Fp(i.protocol), i.host = i.hostname || i.host, typeof i.port == "string" && (i.port = parseInt(i.port, 10)), !i.port && i.host && (i.port = this.secureProxy ? 443 : 80), this.secureProxy && !("ALPNProtocols" in i) && (i.ALPNProtocols = ["http 1.1"]), i.host && i.path && (delete i.path, delete i.pathname), this.proxy = i; } callback(e, r) { - return Op(this, void 0, void 0, function* () { + return Ip(this, void 0, void 0, function* () { let { proxy: i, secureProxy: n } = this, s; - n ? (Nr("Creating `tls.Socket`: %o", i), s = fa.default.connect(i)) : (Nr("Creating `net.Socket`: %o", i), s = ua.default.connect(i)); + n ? (Pr("Creating `tls.Socket`: %o", i), s = ha.default.connect(i)) : (Pr("Creating `net.Socket`: %o", i), s = fa.default.connect(i)); let o = Object.assign({}, i.headers), l = `CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r `; i.auth && (o["Proxy-Authorization"] = `Basic ${Buffer.from(i.auth).toString("base64")}`); let { host: c, port: u, secureEndpoint: f } = r; - Np(u, f) || (c += `:${u}`), o.Host = c, o.Connection = "close"; + Pp(u, f) || (c += `:${u}`), o.Host = c, o.Connection = "close"; for (let v of Object.keys(o)) l += `${v}: ${o[v]}\r `; - let h = Bp.default(s); + let h = Lp.default(s); s.write(`${l}\r `); let { statusCode: p, buffered: d } = yield h; if (p === 200) { - if (e.once("socket", Lp), r.secureEndpoint) { + if (e.once("socket", Np), r.secureEndpoint) { let v = r.servername || r.host; if (!v) throw new Error('Could not determine "servername"'); - return Nr("Upgrading socket connection to TLS"), fa.default.connect(Object.assign(Object.assign({}, Fp(r, "host", "hostname", "path", "port")), { socket: s, servername: v })); + return Pr("Upgrading socket connection to TLS"), ha.default.connect(Object.assign(Object.assign({}, Mp(r, "host", "hostname", "path", "port")), { socket: s, servername: v })); } return s; } s.destroy(); - let m = new ua.default.Socket(); + let m = new fa.default.Socket(); return m.readable = true, e.once("socket", (v) => { - Nr("replaying proxy buffer for failed request"), Tp.default(v.listenerCount("data") > 0), v.push(d), v.push(null); + Pr("replaying proxy buffer for failed request"), Ap.default(v.listenerCount("data") > 0), v.push(d), v.push(null); }), m; }); } }; - Lt.default = ha; - function Lp(t) { + Lt.default = pa; + function Np(t) { t.resume(); } - function Np(t, e) { + function Pp(t, e) { return Boolean(!e && t === 80 || e && t === 443); } - function Pp(t) { + function Fp(t) { return typeof t == "string" ? /^https:?$/i.test(t) : false; } - function Fp(t, ...e) { + function Mp(t, ...e) { let r = {}, i; for (i in t) e.includes(i) || (r[i] = t[i]); return r; } }); - var ma = x((un, da) => { + var va = x((un, ma) => { "use strict"; - var Mp = un && un.__importDefault || function(t) { + var Up = un && un.__importDefault || function(t) { return t && t.__esModule ? t : { default: t }; - }, ln = Mp(pa()); + }, ln = Up(da()); function cn(t) { return new ln.default(t); } (function(t) { t.HttpsProxyAgent = ln.default, t.prototype = ln.default.prototype; })(cn || (cn = {})); - da.exports = cn; + ma.exports = cn; }); - var _a = x((__, di) => { - var ga = ga || function(t) { + var xa = x((x_, di) => { + var _a = _a || function(t) { return Buffer.from(t).toString("base64"); }; - function Up(t) { - var e = this, r = Math.round, i = Math.floor, n = new Array(64), s = new Array(64), o = new Array(64), a = new Array(64), l, c, u, f, h = new Array(65535), p = new Array(65535), d = new Array(64), m = new Array(64), v = [], y = 0, O = 7, w = new Array(64), S = new Array(64), b = new Array(64), V = new Array(256), C = new Array(2048), M, E = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], I = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], $ = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], B = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], ee = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], A = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], F = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], D = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250]; - function z(_) { - for (var U = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], Y = 0; Y < 64; Y++) { - var Z = i((U[Y] * _ + 50) / 100); - Z < 1 ? Z = 1 : Z > 255 && (Z = 255), n[E[Y]] = Z; + function Dp(t) { + var e = this, r = Math.round, i = Math.floor, n = new Array(64), s = new Array(64), o = new Array(64), a = new Array(64), l, c, u, f, h = new Array(65535), p = new Array(65535), d = new Array(64), m = new Array(64), v = [], y = 0, I = 7, w = new Array(64), S = new Array(64), b = new Array(64), $ = new Array(256), C = new Array(2048), U, E = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], T = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], B = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], G = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], L = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], Q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], F = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], j = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250]; + function z(g) { + for (var D = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], W = 0; W < 64; W++) { + var V = i((D[W] * g + 50) / 100); + V < 1 ? V = 1 : V > 255 && (V = 255), n[E[W]] = V; } - for (var X = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], he = 0; he < 64; he++) { - var se = i((X[he] * _ + 50) / 100); - se < 1 ? se = 1 : se > 255 && (se = 255), s[E[he]] = se; + for (var J = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], ee = 0; ee < 64; ee++) { + var he = i((J[ee] * g + 50) / 100); + he < 1 ? he = 1 : he > 255 && (he = 255), s[E[ee]] = he; } - for (var pe = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], Ee = 0, ke = 0; ke < 8; ke++) - for (var G = 0; G < 8; G++) - o[Ee] = 1 / (n[E[Ee]] * pe[ke] * pe[G] * 8), a[Ee] = 1 / (s[E[Ee]] * pe[ke] * pe[G] * 8), Ee++; + for (var pe = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], Oe = 0, be = 0; be < 8; be++) + for (var O = 0; O < 8; O++) + o[Oe] = 1 / (n[E[Oe]] * pe[be] * pe[O] * 8), a[Oe] = 1 / (s[E[Oe]] * pe[be] * pe[O] * 8), Oe++; } - function N(_, U) { - for (var Y = 0, Z = 0, X = new Array(), he = 1; he <= 16; he++) { - for (var se = 1; se <= _[he]; se++) - X[U[Z]] = [], X[U[Z]][0] = Y, X[U[Z]][1] = he, Z++, Y++; - Y *= 2; + function N(g, D) { + for (var W = 0, V = 0, J = new Array(), ee = 1; ee <= 16; ee++) { + for (var he = 1; he <= g[ee]; he++) + J[D[V]] = [], J[D[V]][0] = W, J[D[V]][1] = ee, V++, W++; + W *= 2; } - return X; + return J; } - function Ce() { - l = N(I, R), c = N(ee, A), u = N($, B), f = N(F, D); + function Se() { + l = N(T, B), c = N(Q, R), u = N(G, L), f = N(F, j); } function ce() { - for (var _ = 1, U = 2, Y = 1; Y <= 15; Y++) { - for (var Z = _; Z < U; Z++) - p[32767 + Z] = Y, h[32767 + Z] = [], h[32767 + Z][1] = Y, h[32767 + Z][0] = Z; - for (var X = -(U - 1); X <= -_; X++) - p[32767 + X] = Y, h[32767 + X] = [], h[32767 + X][1] = Y, h[32767 + X][0] = U - 1 + X; - _ <<= 1, U <<= 1; - } - } - function re() { - for (var _ = 0; _ < 256; _++) - C[_] = 19595 * _, C[_ + 256 >> 0] = 38470 * _, C[_ + 512 >> 0] = 7471 * _ + 32768, C[_ + 768 >> 0] = -11059 * _, C[_ + 1024 >> 0] = -21709 * _, C[_ + 1280 >> 0] = 32768 * _ + 8421375, C[_ + 1536 >> 0] = -27439 * _, C[_ + 1792 >> 0] = -5329 * _; - } - function ie(_) { - for (var U = _[0], Y = _[1] - 1; Y >= 0; ) - U & 1 << Y && (y |= 1 << O), Y--, O--, O < 0 && (y == 255 ? (g(255), g(0)) : g(y), O = 7, y = 0); - } - function g(_) { - v.push(_); - } - function H(_) { - g(_ >> 8 & 255), g(_ & 255); - } - function ge(_, U) { - var Y, Z, X, he, se, pe, Ee, ke, G = 0, L, j = 8, oe = 64; - for (L = 0; L < j; ++L) { - Y = _[G], Z = _[G + 1], X = _[G + 2], he = _[G + 3], se = _[G + 4], pe = _[G + 5], Ee = _[G + 6], ke = _[G + 7]; - var me = Y + ke, Q = Y - ke, ye = Z + Ee, de = Z - Ee, W = X + pe, be = X - pe, Me = he + se, Ae = he - se, We = me + Me, Tt = me - Me, At = ye + W, Yt = ye - W; - _[G] = We + At, _[G + 4] = We - At; - var ii = (Yt + Tt) * 0.707106781; - _[G + 2] = Tt + ii, _[G + 6] = Tt - ii, We = Ae + be, At = be + de, Yt = de + Q; - var Sr = (We - Yt) * 0.382683433, kr = 0.5411961 * We + Sr, ni = 1.306562965 * Yt + Sr, Cr = At * 0.707106781, Or = Q + Cr, Ir = Q - Cr; - _[G + 5] = Ir + kr, _[G + 3] = Ir - kr, _[G + 1] = Or + ni, _[G + 7] = Or - ni, G += 8; - } - for (G = 0, L = 0; L < j; ++L) { - Y = _[G], Z = _[G + 8], X = _[G + 16], he = _[G + 24], se = _[G + 32], pe = _[G + 40], Ee = _[G + 48], ke = _[G + 56]; - var Tr = Y + ke, Zi = Y - ke, ao = Z + Ee, lo = Z - Ee, co = X + pe, uo = X - pe, fo = he + se, kh = he - se, Ar = Tr + fo, Xi = Tr - fo, si = ao + co, oi = ao - co; - _[G] = Ar + si, _[G + 32] = Ar - si; - var ho = (oi + Xi) * 0.707106781; - _[G + 16] = Xi + ho, _[G + 48] = Xi - ho, Ar = kh + uo, si = uo + lo, oi = lo + Zi; - var po = (Ar - oi) * 0.382683433, mo = 0.5411961 * Ar + po, vo = 1.306562965 * oi + po, go = si * 0.707106781, _o = Zi + go, xo = Zi - go; - _[G + 40] = xo + mo, _[G + 24] = xo - mo, _[G + 8] = _o + vo, _[G + 56] = _o - vo, G++; + for (var g = 1, D = 2, W = 1; W <= 15; W++) { + for (var V = g; V < D; V++) + p[32767 + V] = W, h[32767 + V] = [], h[32767 + V][1] = W, h[32767 + V][0] = V; + for (var J = -(D - 1); J <= -g; J++) + p[32767 + J] = W, h[32767 + J] = [], h[32767 + J][1] = W, h[32767 + J][0] = D - 1 + J; + g <<= 1, D <<= 1; + } + } + function ie() { + for (var g = 0; g < 256; g++) + C[g] = 19595 * g, C[g + 256 >> 0] = 38470 * g, C[g + 512 >> 0] = 7471 * g + 32768, C[g + 768 >> 0] = -11059 * g, C[g + 1024 >> 0] = -21709 * g, C[g + 1280 >> 0] = 32768 * g + 8421375, C[g + 1536 >> 0] = -27439 * g, C[g + 1792 >> 0] = -5329 * g; + } + function ne(g) { + for (var D = g[0], W = g[1] - 1; W >= 0; ) + D & 1 << W && (y |= 1 << I), W--, I--, I < 0 && (y == 255 ? (_(255), _(0)) : _(y), I = 7, y = 0); + } + function _(g) { + v.push(g); + } + function q(g) { + _(g >> 8 & 255), _(g & 255); + } + function ve(g, D) { + var W, V, J, ee, he, pe, Oe, be, O = 0, M, Z = 8, ke = 64; + for (M = 0; M < Z; ++M) { + W = g[O], V = g[O + 1], J = g[O + 2], ee = g[O + 3], he = g[O + 4], pe = g[O + 5], Oe = g[O + 6], be = g[O + 7]; + var te = W + be, le = W - be, _e = V + Oe, Y = V - Oe, de = J + pe, Fe = J - pe, Ee = ee + he, Xe = ee - he, at = te + Ee, At = te - Ee, Yt = _e + de, Kt = _e - de; + g[O] = at + Yt, g[O + 4] = at - Yt; + var kr = (Kt + At) * 0.707106781; + g[O + 2] = At + kr, g[O + 6] = At - kr, at = Xe + Fe, Yt = Fe + Y, Kt = Y + le; + var Cr = (at - Kt) * 0.382683433, ni = 0.5411961 * at + Cr, Or = 1.306562965 * Kt + Cr, Ir = Yt * 0.707106781, Tr = le + Ir, Ar = le - Ir; + g[O + 5] = Ar + ni, g[O + 3] = Ar - ni, g[O + 1] = Tr + Or, g[O + 7] = Tr - Or, O += 8; + } + for (O = 0, M = 0; M < Z; ++M) { + W = g[O], V = g[O + 8], J = g[O + 16], ee = g[O + 24], he = g[O + 32], pe = g[O + 40], Oe = g[O + 48], be = g[O + 56]; + var ao = W + be, Zi = W - be, lo = V + Oe, co = V - Oe, uo = J + pe, fo = J - pe, ho = ee + he, Ch = ee - he, Rr = ao + ho, Xi = ao - ho, si = lo + uo, oi = lo - uo; + g[O] = Rr + si, g[O + 32] = Rr - si; + var po = (oi + Xi) * 0.707106781; + g[O + 16] = Xi + po, g[O + 48] = Xi - po, Rr = Ch + fo, si = fo + co, oi = co + Zi; + var mo = (Rr - oi) * 0.382683433, vo = 0.5411961 * Rr + mo, go = 1.306562965 * oi + mo, _o = si * 0.707106781, xo = Zi + _o, yo = Zi - _o; + g[O + 40] = yo + vo, g[O + 24] = yo - vo, g[O + 8] = xo + go, g[O + 56] = xo - go, O++; } var ai; - for (L = 0; L < oe; ++L) - ai = _[L] * U[L], d[L] = ai > 0 ? ai + 0.5 | 0 : ai - 0.5 | 0; + for (M = 0; M < ke; ++M) + ai = g[M] * D[M], d[M] = ai > 0 ? ai + 0.5 | 0 : ai - 0.5 | 0; return d; } - function _e() { - H(65504), H(16), g(74), g(70), g(73), g(70), g(0), g(1), g(1), g(0), H(1), H(1), g(0), g(0); + function ge() { + q(65504), q(16), _(74), _(70), _(73), _(70), _(0), _(1), _(1), _(0), q(1), q(1), _(0), _(0); } - function ue(_) { - if (!!_) { - H(65505), _[0] === 69 && _[1] === 120 && _[2] === 105 && _[3] === 102 ? H(_.length + 2) : (H(_.length + 5 + 2), g(69), g(120), g(105), g(102), g(0)); - for (var U = 0; U < _.length; U++) - g(_[U]); + function ue(g) { + if (!!g) { + q(65505), g[0] === 69 && g[1] === 120 && g[2] === 105 && g[3] === 102 ? q(g.length + 2) : (q(g.length + 5 + 2), _(69), _(120), _(105), _(102), _(0)); + for (var D = 0; D < g.length; D++) + _(g[D]); } } - function fe(_, U) { - H(65472), H(17), g(8), H(U), H(_), g(3), g(1), g(17), g(0), g(2), g(17), g(1), g(3), g(17), g(1); + function fe(g, D) { + q(65472), q(17), _(8), q(D), q(g), _(3), _(1), _(17), _(0), _(2), _(17), _(1), _(3), _(17), _(1); } - function ae() { - H(65499), H(132), g(0); - for (var _ = 0; _ < 64; _++) - g(n[_]); - g(1); - for (var U = 0; U < 64; U++) - g(s[U]); + function se() { + q(65499), q(132), _(0); + for (var g = 0; g < 64; g++) + _(n[g]); + _(1); + for (var D = 0; D < 64; D++) + _(s[D]); } function P() { - H(65476), H(418), g(0); - for (var _ = 0; _ < 16; _++) - g(I[_ + 1]); - for (var U = 0; U <= 11; U++) - g(R[U]); - g(16); - for (var Y = 0; Y < 16; Y++) - g($[Y + 1]); - for (var Z = 0; Z <= 161; Z++) - g(B[Z]); - g(1); - for (var X = 0; X < 16; X++) - g(ee[X + 1]); - for (var he = 0; he <= 11; he++) - g(A[he]); - g(17); - for (var se = 0; se < 16; se++) - g(F[se + 1]); + q(65476), q(418), _(0); + for (var g = 0; g < 16; g++) + _(T[g + 1]); + for (var D = 0; D <= 11; D++) + _(B[D]); + _(16); + for (var W = 0; W < 16; W++) + _(G[W + 1]); + for (var V = 0; V <= 161; V++) + _(L[V]); + _(1); + for (var J = 0; J < 16; J++) + _(Q[J + 1]); + for (var ee = 0; ee <= 11; ee++) + _(R[ee]); + _(17); + for (var he = 0; he < 16; he++) + _(F[he + 1]); for (var pe = 0; pe <= 161; pe++) - g(D[pe]); + _(j[pe]); } - function T() { - H(65498), H(12), g(3), g(1), g(0), g(2), g(17), g(3), g(17), g(0), g(63), g(0); + function A(g) { + typeof g == "undefined" || g.constructor !== Array || g.forEach((D) => { + if (typeof D == "string") { + q(65534); + var W = D.length; + q(W + 2); + var V; + for (V = 0; V < W; V++) + _(D.charCodeAt(V)); + } + }); } - function xe(_, U, Y, Z, X) { - for (var he = X[0], se = X[240], pe, Ee = 16, ke = 63, G = 64, L = ge(_, U), j = 0; j < G; ++j) - m[E[j]] = L[j]; - var oe = m[0] - Y; - Y = m[0], oe == 0 ? ie(Z[0]) : (pe = 32767 + oe, ie(Z[p[pe]]), ie(h[pe])); - for (var me = 63; me > 0 && m[me] == 0; me--) + function ye() { + q(65498), q(12), _(3), _(1), _(0), _(2), _(17), _(3), _(17), _(0), _(63), _(0); + } + function K(g, D, W, V, J) { + for (var ee = J[0], he = J[240], pe, Oe = 16, be = 63, O = 64, M = ve(g, D), Z = 0; Z < O; ++Z) + m[E[Z]] = M[Z]; + var ke = m[0] - W; + W = m[0], ke == 0 ? ne(V[0]) : (pe = 32767 + ke, ne(V[p[pe]]), ne(h[pe])); + for (var te = 63; te > 0 && m[te] == 0; te--) ; - if (me == 0) - return ie(he), Y; - for (var Q = 1, ye; Q <= me; ) { - for (var de = Q; m[Q] == 0 && Q <= me; ++Q) + if (te == 0) + return ne(ee), W; + for (var le = 1, _e; le <= te; ) { + for (var Y = le; m[le] == 0 && le <= te; ++le) ; - var W = Q - de; - if (W >= Ee) { - ye = W >> 4; - for (var be = 1; be <= ye; ++be) - ie(se); - W = W & 15; - } - pe = 32767 + m[Q], ie(X[(W << 4) + p[pe]]), ie(h[pe]), Q++; - } - return me != ke && ie(he), Y; - } - function K() { - for (var _ = String.fromCharCode, U = 0; U < 256; U++) - V[U] = _(U); - } - this.encode = function(_, U) { - var Y = new Date().getTime(); - U && ne(U), v = new Array(), y = 0, O = 7, H(65496), _e(), ue(_.exifBuffer), ae(), fe(_.width, _.height), P(), T(); - var Z = 0, X = 0, he = 0; - y = 0, O = 7, this.encode.displayName = "_encode_"; - for (var se = _.data, pe = _.width, Ee = _.height, ke = pe * 4, G = pe * 3, L, j = 0, oe, me, Q, ye, de, W, be, Me; j < Ee; ) { - for (L = 0; L < ke; ) { - for (ye = ke * j + L, de = ye, W = -1, be = 0, Me = 0; Me < 64; Me++) - be = Me >> 3, W = (Me & 7) * 4, de = ye + be * ke + W, j + be >= Ee && (de -= ke * (j + 1 + be - Ee)), L + W >= ke && (de -= L + W - ke + 4), oe = se[de++], me = se[de++], Q = se[de++], w[Me] = (C[oe] + C[me + 256 >> 0] + C[Q + 512 >> 0] >> 16) - 128, S[Me] = (C[oe + 768 >> 0] + C[me + 1024 >> 0] + C[Q + 1280 >> 0] >> 16) - 128, b[Me] = (C[oe + 1280 >> 0] + C[me + 1536 >> 0] + C[Q + 1792 >> 0] >> 16) - 128; - Z = xe(w, o, Z, l, u), X = xe(S, a, X, c, f), he = xe(b, a, he, c, f), L += 32; - } - j += 8; - } - if (O >= 0) { - var Ae = []; - Ae[1] = O + 1, Ae[0] = (1 << O + 1) - 1, ie(Ae); - } - if (H(65497), typeof di == "undefined") + var de = le - Y; + if (de >= Oe) { + _e = de >> 4; + for (var Fe = 1; Fe <= _e; ++Fe) + ne(he); + de = de & 15; + } + pe = 32767 + m[le], ne(J[(de << 4) + p[pe]]), ne(h[pe]), le++; + } + return te != be && ne(ee), W; + } + function oe() { + for (var g = String.fromCharCode, D = 0; D < 256; D++) + $[D] = g(D); + } + this.encode = function(g, D) { + var W = new Date().getTime(); + D && Ze(D), v = new Array(), y = 0, I = 7, q(65496), ge(), A(g.comments), ue(g.exifBuffer), se(), fe(g.width, g.height), P(), ye(); + var V = 0, J = 0, ee = 0; + y = 0, I = 7, this.encode.displayName = "_encode_"; + for (var he = g.data, pe = g.width, Oe = g.height, be = pe * 4, O = pe * 3, M, Z = 0, ke, te, le, _e, Y, de, Fe, Ee; Z < Oe; ) { + for (M = 0; M < be; ) { + for (_e = be * Z + M, Y = _e, de = -1, Fe = 0, Ee = 0; Ee < 64; Ee++) + Fe = Ee >> 3, de = (Ee & 7) * 4, Y = _e + Fe * be + de, Z + Fe >= Oe && (Y -= be * (Z + 1 + Fe - Oe)), M + de >= be && (Y -= M + de - be + 4), ke = he[Y++], te = he[Y++], le = he[Y++], w[Ee] = (C[ke] + C[te + 256 >> 0] + C[le + 512 >> 0] >> 16) - 128, S[Ee] = (C[ke + 768 >> 0] + C[te + 1024 >> 0] + C[le + 1280 >> 0] >> 16) - 128, b[Ee] = (C[ke + 1280 >> 0] + C[te + 1536 >> 0] + C[le + 1792 >> 0] >> 16) - 128; + V = K(w, o, V, l, u), J = K(S, a, J, c, f), ee = K(b, a, ee, c, f), M += 32; + } + Z += 8; + } + if (I >= 0) { + var Xe = []; + Xe[1] = I + 1, Xe[0] = (1 << I + 1) - 1, ne(Xe); + } + if (q(65497), typeof di == "undefined") return new Uint8Array(v); return Buffer.from(v); - var We, Tt; + var at, At; }; - function ne(_) { - if (_ <= 0 && (_ = 1), _ > 100 && (_ = 100), M != _) { - var U = 0; - _ < 50 ? U = Math.floor(5e3 / _) : U = Math.floor(200 - _ * 2), z(U), M = _; + function Ze(g) { + if (g <= 0 && (g = 1), g > 100 && (g = 100), U != g) { + var D = 0; + g < 50 ? D = Math.floor(5e3 / g) : D = Math.floor(200 - g * 2), z(D), U = g; } } function tt() { - var _ = new Date().getTime(); - t || (t = 50), K(), Ce(), ce(), re(), ne(t); - var U = new Date().getTime() - _; + var g = new Date().getTime(); + t || (t = 50), oe(), Se(), ce(), ie(), Ze(t); + var D = new Date().getTime() - g; } tt(); } - typeof di != "undefined" ? di.exports = va : typeof window != "undefined" && (window["jpeg-js"] = window["jpeg-js"] || {}, window["jpeg-js"].encode = va); - function va(t, e) { + typeof di != "undefined" ? di.exports = ga : typeof window != "undefined" && (window["jpeg-js"] = window["jpeg-js"] || {}, window["jpeg-js"].encode = ga); + function ga(t, e) { typeof e == "undefined" && (e = 50); - var r = new Up(e), i = r.encode(t, e); + var r = new Dp(e), i = r.encode(t, e); return { data: i, width: t.width, height: t.height }; } }); - var ya = x((x_, hn) => { + var ba = x((y_, hn) => { var fn = function() { "use strict"; var e = new Int32Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]), r = 4017, i = 799, n = 3406, s = 2276, o = 1567, a = 3784, l = 5793, c = 2896; function u() { } - function f(O, w) { - for (var S = 0, b = [], V, C, M = 16; M > 0 && !O[M - 1]; ) - M--; + function f(I, w) { + for (var S = 0, b = [], $, C, U = 16; U > 0 && !I[U - 1]; ) + U--; b.push({ children: [], index: 0 }); - var E = b[0], I; - for (V = 0; V < M; V++) { - for (C = 0; C < O[V]; C++) { + var E = b[0], T; + for ($ = 0; $ < U; $++) { + for (C = 0; C < I[$]; C++) { for (E = b.pop(), E.children[E.index] = w[S]; E.index > 0; ) { if (b.length === 0) throw new Error("Could not recreate Huffman Table"); E = b.pop(); } - for (E.index++, b.push(E); b.length <= V; ) - b.push(I = { children: [], index: 0 }), E.children[E.index] = I.children, E = I; + for (E.index++, b.push(E); b.length <= $; ) + b.push(T = { children: [], index: 0 }), E.children[E.index] = T.children, E = T; S++; } - V + 1 < M && (b.push(I = { children: [], index: 0 }), E.children[E.index] = I.children, E = I); + $ + 1 < U && (b.push(T = { children: [], index: 0 }), E.children[E.index] = T.children, E = T); } return b[0].children; } - function h(O, w, S, b, V, C, M, E, I, R) { - var $ = S.precision, B = S.samplesPerLine, ee = S.scanLines, A = S.mcusPerLine, F = S.progressive, D = S.maxH, z = S.maxV, N = w, Ce = 0, ce = 0; - function re() { + function h(I, w, S, b, $, C, U, E, T, B) { + var G = S.precision, L = S.samplesPerLine, Q = S.scanLines, R = S.mcusPerLine, F = S.progressive, j = S.maxH, z = S.maxV, N = w, Se = 0, ce = 0; + function ie() { if (ce > 0) - return ce--, Ce >> ce & 1; - if (Ce = O[w++], Ce == 255) { - var L = O[w++]; - if (L) - throw new Error("unexpected marker: " + (Ce << 8 | L).toString(16)); - } - return ce = 7, Ce >>> 7; - } - function ie(L) { - for (var j = L, oe; (oe = re()) !== null; ) { - if (j = j[oe], typeof j == "number") - return j; - if (typeof j != "object") + return ce--, Se >> ce & 1; + if (Se = I[w++], Se == 255) { + var O = I[w++]; + if (O) + throw new Error("unexpected marker: " + (Se << 8 | O).toString(16)); + } + return ce = 7, Se >>> 7; + } + function ne(O) { + for (var M = O, Z; (Z = ie()) !== null; ) { + if (M = M[Z], typeof M == "number") + return M; + if (typeof M != "object") throw new Error("invalid huffman sequence"); } return null; } - function g(L) { - for (var j = 0; L > 0; ) { - var oe = re(); - if (oe === null) + function _(O) { + for (var M = 0; O > 0; ) { + var Z = ie(); + if (Z === null) return; - j = j << 1 | oe, L--; + M = M << 1 | Z, O--; } - return j; + return M; } - function H(L) { - var j = g(L); - return j >= 1 << L - 1 ? j : j + (-1 << L) + 1; + function q(O) { + var M = _(O); + return M >= 1 << O - 1 ? M : M + (-1 << O) + 1; } - function ge(L, j) { - var oe = ie(L.huffmanTableDC), me = oe === 0 ? 0 : H(oe); - j[0] = L.pred += me; - for (var Q = 1; Q < 64; ) { - var ye = ie(L.huffmanTableAC), de = ye & 15, W = ye >> 4; - if (de === 0) { - if (W < 15) + function ve(O, M) { + var Z = ne(O.huffmanTableDC), ke = Z === 0 ? 0 : q(Z); + M[0] = O.pred += ke; + for (var te = 1; te < 64; ) { + var le = ne(O.huffmanTableAC), _e = le & 15, Y = le >> 4; + if (_e === 0) { + if (Y < 15) break; - Q += 16; + te += 16; continue; } - Q += W; - var be = e[Q]; - j[be] = H(de), Q++; + te += Y; + var de = e[te]; + M[de] = q(_e), te++; } } - function _e(L, j) { - var oe = ie(L.huffmanTableDC), me = oe === 0 ? 0 : H(oe) << I; - j[0] = L.pred += me; + function ge(O, M) { + var Z = ne(O.huffmanTableDC), ke = Z === 0 ? 0 : q(Z) << T; + M[0] = O.pred += ke; } - function ue(L, j) { - j[0] |= re() << I; + function ue(O, M) { + M[0] |= ie() << T; } var fe = 0; - function ae(L, j) { + function se(O, M) { if (fe > 0) { fe--; return; } - for (var oe = C, me = M; oe <= me; ) { - var Q = ie(L.huffmanTableAC), ye = Q & 15, de = Q >> 4; - if (ye === 0) { - if (de < 15) { - fe = g(de) + (1 << de) - 1; + for (var Z = C, ke = U; Z <= ke; ) { + var te = ne(O.huffmanTableAC), le = te & 15, _e = te >> 4; + if (le === 0) { + if (_e < 15) { + fe = _(_e) + (1 << _e) - 1; break; } - oe += 16; + Z += 16; continue; } - oe += de; - var W = e[oe]; - j[W] = H(ye) * (1 << I), oe++; + Z += _e; + var Y = e[Z]; + M[Y] = q(le) * (1 << T), Z++; } } - var P = 0, T; - function xe(L, j) { - for (var oe = C, me = M, Q = 0; oe <= me; ) { - var ye = e[oe], de = j[ye] < 0 ? -1 : 1; + var P = 0, A; + function ye(O, M) { + for (var Z = C, ke = U, te = 0; Z <= ke; ) { + var le = e[Z], _e = M[le] < 0 ? -1 : 1; switch (P) { case 0: - var W = ie(L.huffmanTableAC), be = W & 15, Q = W >> 4; - if (be === 0) - Q < 15 ? (fe = g(Q) + (1 << Q), P = 4) : (Q = 16, P = 1); + var Y = ne(O.huffmanTableAC), de = Y & 15, te = Y >> 4; + if (de === 0) + te < 15 ? (fe = _(te) + (1 << te), P = 4) : (te = 16, P = 1); else { - if (be !== 1) + if (de !== 1) throw new Error("invalid ACn encoding"); - T = H(be), P = Q ? 2 : 3; + A = q(de), P = te ? 2 : 3; } continue; case 1: case 2: - j[ye] ? j[ye] += (re() << I) * de : (Q--, Q === 0 && (P = P == 2 ? 3 : 0)); + M[le] ? M[le] += (ie() << T) * _e : (te--, te === 0 && (P = P == 2 ? 3 : 0)); break; case 3: - j[ye] ? j[ye] += (re() << I) * de : (j[ye] = T << I, P = 0); + M[le] ? M[le] += (ie() << T) * _e : (M[le] = A << T, P = 0); break; case 4: - j[ye] && (j[ye] += (re() << I) * de); + M[le] && (M[le] += (ie() << T) * _e); break; } - oe++; + Z++; } P === 4 && (fe--, fe === 0 && (P = 0)); } - function K(L, j, oe, me, Q) { - var ye = oe / A | 0, de = oe % A, W = ye * L.v + me, be = de * L.h + Q; - L.blocks[W] === void 0 && R.tolerantDecoding || j(L, L.blocks[W][be]); - } - function ne(L, j, oe) { - var me = oe / L.blocksPerLine | 0, Q = oe % L.blocksPerLine; - L.blocks[me] === void 0 && R.tolerantDecoding || j(L, L.blocks[me][Q]); - } - var tt = b.length, _, U, Y, Z, X, he; - F ? C === 0 ? he = E === 0 ? _e : ue : he = E === 0 ? ae : xe : he = ge; - var se = 0, pe, Ee; - tt == 1 ? Ee = b[0].blocksPerLine * b[0].blocksPerColumn : Ee = A * S.mcusPerColumn, V || (V = Ee); - for (var ke, G; se < Ee; ) { - for (U = 0; U < tt; U++) - b[U].pred = 0; - if (fe = 0, tt == 1) - for (_ = b[0], X = 0; X < V; X++) - ne(_, he, se), se++; + function K(O, M, Z, ke, te) { + var le = Z / R | 0, _e = Z % R, Y = le * O.v + ke, de = _e * O.h + te; + O.blocks[Y] === void 0 && B.tolerantDecoding || M(O, O.blocks[Y][de]); + } + function oe(O, M, Z) { + var ke = Z / O.blocksPerLine | 0, te = Z % O.blocksPerLine; + O.blocks[ke] === void 0 && B.tolerantDecoding || M(O, O.blocks[ke][te]); + } + var Ze = b.length, tt, g, D, W, V, J; + F ? C === 0 ? J = E === 0 ? ge : ue : J = E === 0 ? se : ye : J = ve; + var ee = 0, he, pe; + Ze == 1 ? pe = b[0].blocksPerLine * b[0].blocksPerColumn : pe = R * S.mcusPerColumn, $ || ($ = pe); + for (var Oe, be; ee < pe; ) { + for (g = 0; g < Ze; g++) + b[g].pred = 0; + if (fe = 0, Ze == 1) + for (tt = b[0], V = 0; V < $; V++) + oe(tt, J, ee), ee++; else - for (X = 0; X < V; X++) { - for (U = 0; U < tt; U++) - for (_ = b[U], ke = _.h, G = _.v, Y = 0; Y < G; Y++) - for (Z = 0; Z < ke; Z++) - K(_, he, se, Y, Z); - if (se++, se === Ee) + for (V = 0; V < $; V++) { + for (g = 0; g < Ze; g++) + for (tt = b[g], Oe = tt.h, be = tt.v, D = 0; D < be; D++) + for (W = 0; W < Oe; W++) + K(tt, J, ee, D, W); + if (ee++, ee === pe) break; } - if (se === Ee) + if (ee === pe) do { - if (O[w] === 255 && O[w + 1] !== 0) + if (I[w] === 255 && I[w + 1] !== 0) break; w += 1; - } while (w < O.length - 2); - if (ce = 0, pe = O[w] << 8 | O[w + 1], pe < 65280) + } while (w < I.length - 2); + if (ce = 0, he = I[w] << 8 | I[w + 1], he < 65280) throw new Error("marker was not found"); - if (pe >= 65488 && pe <= 65495) + if (he >= 65488 && he <= 65495) w += 2; else break; } return w - N; } - function p(O, w) { - var S = [], b = w.blocksPerLine, V = w.blocksPerColumn, C = b << 3, M = new Int32Array(64), E = new Uint8Array(64); - function I(N, Ce, ce) { - var re = w.quantizationTable, ie, g, H, ge, _e, ue, fe, ae, P, T = ce, xe; - for (xe = 0; xe < 64; xe++) - T[xe] = N[xe] * re[xe]; - for (xe = 0; xe < 8; ++xe) { - var K = 8 * xe; - if (T[1 + K] == 0 && T[2 + K] == 0 && T[3 + K] == 0 && T[4 + K] == 0 && T[5 + K] == 0 && T[6 + K] == 0 && T[7 + K] == 0) { - P = l * T[0 + K] + 512 >> 10, T[0 + K] = P, T[1 + K] = P, T[2 + K] = P, T[3 + K] = P, T[4 + K] = P, T[5 + K] = P, T[6 + K] = P, T[7 + K] = P; + function p(I, w) { + var S = [], b = w.blocksPerLine, $ = w.blocksPerColumn, C = b << 3, U = new Int32Array(64), E = new Uint8Array(64); + function T(N, Se, ce) { + var ie = w.quantizationTable, ne, _, q, ve, ge, ue, fe, se, P, A = ce, ye; + for (ye = 0; ye < 64; ye++) + A[ye] = N[ye] * ie[ye]; + for (ye = 0; ye < 8; ++ye) { + var K = 8 * ye; + if (A[1 + K] == 0 && A[2 + K] == 0 && A[3 + K] == 0 && A[4 + K] == 0 && A[5 + K] == 0 && A[6 + K] == 0 && A[7 + K] == 0) { + P = l * A[0 + K] + 512 >> 10, A[0 + K] = P, A[1 + K] = P, A[2 + K] = P, A[3 + K] = P, A[4 + K] = P, A[5 + K] = P, A[6 + K] = P, A[7 + K] = P; continue; } - ie = l * T[0 + K] + 128 >> 8, g = l * T[4 + K] + 128 >> 8, H = T[2 + K], ge = T[6 + K], _e = c * (T[1 + K] - T[7 + K]) + 128 >> 8, ae = c * (T[1 + K] + T[7 + K]) + 128 >> 8, ue = T[3 + K] << 4, fe = T[5 + K] << 4, P = ie - g + 1 >> 1, ie = ie + g + 1 >> 1, g = P, P = H * a + ge * o + 128 >> 8, H = H * o - ge * a + 128 >> 8, ge = P, P = _e - fe + 1 >> 1, _e = _e + fe + 1 >> 1, fe = P, P = ae + ue + 1 >> 1, ue = ae - ue + 1 >> 1, ae = P, P = ie - ge + 1 >> 1, ie = ie + ge + 1 >> 1, ge = P, P = g - H + 1 >> 1, g = g + H + 1 >> 1, H = P, P = _e * s + ae * n + 2048 >> 12, _e = _e * n - ae * s + 2048 >> 12, ae = P, P = ue * i + fe * r + 2048 >> 12, ue = ue * r - fe * i + 2048 >> 12, fe = P, T[0 + K] = ie + ae, T[7 + K] = ie - ae, T[1 + K] = g + fe, T[6 + K] = g - fe, T[2 + K] = H + ue, T[5 + K] = H - ue, T[3 + K] = ge + _e, T[4 + K] = ge - _e; + ne = l * A[0 + K] + 128 >> 8, _ = l * A[4 + K] + 128 >> 8, q = A[2 + K], ve = A[6 + K], ge = c * (A[1 + K] - A[7 + K]) + 128 >> 8, se = c * (A[1 + K] + A[7 + K]) + 128 >> 8, ue = A[3 + K] << 4, fe = A[5 + K] << 4, P = ne - _ + 1 >> 1, ne = ne + _ + 1 >> 1, _ = P, P = q * a + ve * o + 128 >> 8, q = q * o - ve * a + 128 >> 8, ve = P, P = ge - fe + 1 >> 1, ge = ge + fe + 1 >> 1, fe = P, P = se + ue + 1 >> 1, ue = se - ue + 1 >> 1, se = P, P = ne - ve + 1 >> 1, ne = ne + ve + 1 >> 1, ve = P, P = _ - q + 1 >> 1, _ = _ + q + 1 >> 1, q = P, P = ge * s + se * n + 2048 >> 12, ge = ge * n - se * s + 2048 >> 12, se = P, P = ue * i + fe * r + 2048 >> 12, ue = ue * r - fe * i + 2048 >> 12, fe = P, A[0 + K] = ne + se, A[7 + K] = ne - se, A[1 + K] = _ + fe, A[6 + K] = _ - fe, A[2 + K] = q + ue, A[5 + K] = q - ue, A[3 + K] = ve + ge, A[4 + K] = ve - ge; } - for (xe = 0; xe < 8; ++xe) { - var ne = xe; - if (T[8 + ne] == 0 && T[16 + ne] == 0 && T[24 + ne] == 0 && T[32 + ne] == 0 && T[40 + ne] == 0 && T[48 + ne] == 0 && T[56 + ne] == 0) { - P = l * ce[xe + 0] + 8192 >> 14, T[0 + ne] = P, T[8 + ne] = P, T[16 + ne] = P, T[24 + ne] = P, T[32 + ne] = P, T[40 + ne] = P, T[48 + ne] = P, T[56 + ne] = P; + for (ye = 0; ye < 8; ++ye) { + var oe = ye; + if (A[8 + oe] == 0 && A[16 + oe] == 0 && A[24 + oe] == 0 && A[32 + oe] == 0 && A[40 + oe] == 0 && A[48 + oe] == 0 && A[56 + oe] == 0) { + P = l * ce[ye + 0] + 8192 >> 14, A[0 + oe] = P, A[8 + oe] = P, A[16 + oe] = P, A[24 + oe] = P, A[32 + oe] = P, A[40 + oe] = P, A[48 + oe] = P, A[56 + oe] = P; continue; } - ie = l * T[0 + ne] + 2048 >> 12, g = l * T[32 + ne] + 2048 >> 12, H = T[16 + ne], ge = T[48 + ne], _e = c * (T[8 + ne] - T[56 + ne]) + 2048 >> 12, ae = c * (T[8 + ne] + T[56 + ne]) + 2048 >> 12, ue = T[24 + ne], fe = T[40 + ne], P = ie - g + 1 >> 1, ie = ie + g + 1 >> 1, g = P, P = H * a + ge * o + 2048 >> 12, H = H * o - ge * a + 2048 >> 12, ge = P, P = _e - fe + 1 >> 1, _e = _e + fe + 1 >> 1, fe = P, P = ae + ue + 1 >> 1, ue = ae - ue + 1 >> 1, ae = P, P = ie - ge + 1 >> 1, ie = ie + ge + 1 >> 1, ge = P, P = g - H + 1 >> 1, g = g + H + 1 >> 1, H = P, P = _e * s + ae * n + 2048 >> 12, _e = _e * n - ae * s + 2048 >> 12, ae = P, P = ue * i + fe * r + 2048 >> 12, ue = ue * r - fe * i + 2048 >> 12, fe = P, T[0 + ne] = ie + ae, T[56 + ne] = ie - ae, T[8 + ne] = g + fe, T[48 + ne] = g - fe, T[16 + ne] = H + ue, T[40 + ne] = H - ue, T[24 + ne] = ge + _e, T[32 + ne] = ge - _e; + ne = l * A[0 + oe] + 2048 >> 12, _ = l * A[32 + oe] + 2048 >> 12, q = A[16 + oe], ve = A[48 + oe], ge = c * (A[8 + oe] - A[56 + oe]) + 2048 >> 12, se = c * (A[8 + oe] + A[56 + oe]) + 2048 >> 12, ue = A[24 + oe], fe = A[40 + oe], P = ne - _ + 1 >> 1, ne = ne + _ + 1 >> 1, _ = P, P = q * a + ve * o + 2048 >> 12, q = q * o - ve * a + 2048 >> 12, ve = P, P = ge - fe + 1 >> 1, ge = ge + fe + 1 >> 1, fe = P, P = se + ue + 1 >> 1, ue = se - ue + 1 >> 1, se = P, P = ne - ve + 1 >> 1, ne = ne + ve + 1 >> 1, ve = P, P = _ - q + 1 >> 1, _ = _ + q + 1 >> 1, q = P, P = ge * s + se * n + 2048 >> 12, ge = ge * n - se * s + 2048 >> 12, se = P, P = ue * i + fe * r + 2048 >> 12, ue = ue * r - fe * i + 2048 >> 12, fe = P, A[0 + oe] = ne + se, A[56 + oe] = ne - se, A[8 + oe] = _ + fe, A[48 + oe] = _ - fe, A[16 + oe] = q + ue, A[40 + oe] = q - ue, A[24 + oe] = ve + ge, A[32 + oe] = ve - ge; } - for (xe = 0; xe < 64; ++xe) { - var tt = 128 + (T[xe] + 8 >> 4); - Ce[xe] = tt < 0 ? 0 : tt > 255 ? 255 : tt; + for (ye = 0; ye < 64; ++ye) { + var Ze = 128 + (A[ye] + 8 >> 4); + Se[ye] = Ze < 0 ? 0 : Ze > 255 ? 255 : Ze; } } - y(C * V * 8); - for (var R, $, B = 0; B < V; B++) { - var ee = B << 3; - for (R = 0; R < 8; R++) + y(C * $ * 8); + for (var B, G, L = 0; L < $; L++) { + var Q = L << 3; + for (B = 0; B < 8; B++) S.push(new Uint8Array(C)); - for (var A = 0; A < b; A++) { - I(w.blocks[B][A], E, M); - var F = 0, D = A << 3; - for ($ = 0; $ < 8; $++) { - var z = S[ee + $]; - for (R = 0; R < 8; R++) - z[D + R] = E[F++]; + for (var R = 0; R < b; R++) { + T(w.blocks[L][R], E, U); + var F = 0, j = R << 3; + for (G = 0; G < 8; G++) { + var z = S[Q + G]; + for (B = 0; B < 8; B++) + z[j + B] = E[F++]; } } } return S; } - function d(O) { - return O < 0 ? 0 : O > 255 ? 255 : O; + function d(I) { + return I < 0 ? 0 : I > 255 ? 255 : I; } u.prototype = { load: function(w) { var S = new XMLHttpRequest(); @@ -1365,39 +1377,39 @@ var require_utilsBundleImpl = __commonJS({ this.parse(b), this.onload && this.onload(); }.bind(this), S.send(null); }, parse: function(w) { - var S = this.opts.maxResolutionInMP * 1e3 * 1e3, b = 0, V = w.length; + var S = this.opts.maxResolutionInMP * 1e3 * 1e3, b = 0, $ = w.length; function C() { - var W = w[b] << 8 | w[b + 1]; - return b += 2, W; - } - function M() { - var W = C(), be = w.subarray(b, b + W - 2); - return b += be.length, be; - } - function E(W) { - var be = 0, Me = 0, Ae, We; - for (We in W.components) - W.components.hasOwnProperty(We) && (Ae = W.components[We], be < Ae.h && (be = Ae.h), Me < Ae.v && (Me = Ae.v)); - var Tt = Math.ceil(W.samplesPerLine / 8 / be), At = Math.ceil(W.scanLines / 8 / Me); - for (We in W.components) - if (W.components.hasOwnProperty(We)) { - Ae = W.components[We]; - var Yt = Math.ceil(Math.ceil(W.samplesPerLine / 8) * Ae.h / be), ii = Math.ceil(Math.ceil(W.scanLines / 8) * Ae.v / Me), Sr = Tt * Ae.h, kr = At * Ae.v, ni = kr * Sr, Cr = []; + var Y = w[b] << 8 | w[b + 1]; + return b += 2, Y; + } + function U() { + var Y = C(), de = w.subarray(b, b + Y - 2); + return b += de.length, de; + } + function E(Y) { + var de = 1, Fe = 1, Ee, Xe; + for (Xe in Y.components) + Y.components.hasOwnProperty(Xe) && (Ee = Y.components[Xe], de < Ee.h && (de = Ee.h), Fe < Ee.v && (Fe = Ee.v)); + var at = Math.ceil(Y.samplesPerLine / 8 / de), At = Math.ceil(Y.scanLines / 8 / Fe); + for (Xe in Y.components) + if (Y.components.hasOwnProperty(Xe)) { + Ee = Y.components[Xe]; + var Yt = Math.ceil(Math.ceil(Y.samplesPerLine / 8) * Ee.h / de), Kt = Math.ceil(Math.ceil(Y.scanLines / 8) * Ee.v / Fe), kr = at * Ee.h, Cr = At * Ee.v, ni = Cr * kr, Or = []; y(ni * 256); - for (var Or = 0; Or < kr; Or++) { - for (var Ir = [], Tr = 0; Tr < Sr; Tr++) - Ir.push(new Int32Array(64)); - Cr.push(Ir); + for (var Ir = 0; Ir < Cr; Ir++) { + for (var Tr = [], Ar = 0; Ar < kr; Ar++) + Tr.push(new Int32Array(64)); + Or.push(Tr); } - Ae.blocksPerLine = Yt, Ae.blocksPerColumn = ii, Ae.blocks = Cr; + Ee.blocksPerLine = Yt, Ee.blocksPerColumn = Kt, Ee.blocks = Or; } - W.maxH = be, W.maxV = Me, W.mcusPerLine = Tt, W.mcusPerColumn = At; + Y.maxH = de, Y.maxV = Fe, Y.mcusPerLine = at, Y.mcusPerColumn = At; } - var I = null, R = null, $ = null, B, ee, A = [], F = [], D = [], z = [], N = C(), Ce = -1; + var T = null, B = null, G = null, L, Q, R = [], F = [], j = [], z = [], N = C(), Se = -1; if (this.comments = [], N != 65496) throw new Error("SOI not found"); for (N = C(); N != 65497; ) { - var ce, re, ie; + var ce, ie, ne; switch (N) { case 65280: break; @@ -1418,78 +1430,80 @@ var require_utilsBundleImpl = __commonJS({ case 65518: case 65519: case 65534: - var g = M(); + var _ = U(); if (N === 65534) { - var H = String.fromCharCode.apply(null, g); - this.comments.push(H); + var q = String.fromCharCode.apply(null, _); + this.comments.push(q); } - N === 65504 && g[0] === 74 && g[1] === 70 && g[2] === 73 && g[3] === 70 && g[4] === 0 && (I = { version: { major: g[5], minor: g[6] }, densityUnits: g[7], xDensity: g[8] << 8 | g[9], yDensity: g[10] << 8 | g[11], thumbWidth: g[12], thumbHeight: g[13], thumbData: g.subarray(14, 14 + 3 * g[12] * g[13]) }), N === 65505 && g[0] === 69 && g[1] === 120 && g[2] === 105 && g[3] === 102 && g[4] === 0 && (this.exifBuffer = g.subarray(5, g.length)), N === 65518 && g[0] === 65 && g[1] === 100 && g[2] === 111 && g[3] === 98 && g[4] === 101 && g[5] === 0 && (R = { version: g[6], flags0: g[7] << 8 | g[8], flags1: g[9] << 8 | g[10], transformCode: g[11] }); + N === 65504 && _[0] === 74 && _[1] === 70 && _[2] === 73 && _[3] === 70 && _[4] === 0 && (T = { version: { major: _[5], minor: _[6] }, densityUnits: _[7], xDensity: _[8] << 8 | _[9], yDensity: _[10] << 8 | _[11], thumbWidth: _[12], thumbHeight: _[13], thumbData: _.subarray(14, 14 + 3 * _[12] * _[13]) }), N === 65505 && _[0] === 69 && _[1] === 120 && _[2] === 105 && _[3] === 102 && _[4] === 0 && (this.exifBuffer = _.subarray(5, _.length)), N === 65518 && _[0] === 65 && _[1] === 100 && _[2] === 111 && _[3] === 98 && _[4] === 101 && _[5] === 0 && (B = { version: _[6], flags0: _[7] << 8 | _[8], flags1: _[9] << 8 | _[10], transformCode: _[11] }); break; case 65499: - for (var ge = C(), _e = ge + b - 2; b < _e; ) { + for (var ve = C(), ge = ve + b - 2; b < ge; ) { var ue = w[b++]; y(256); var fe = new Int32Array(64); if (ue >> 4 === 0) - for (re = 0; re < 64; re++) { - var ae = e[re]; - fe[ae] = w[b++]; + for (ie = 0; ie < 64; ie++) { + var se = e[ie]; + fe[se] = w[b++]; } else if (ue >> 4 === 1) - for (re = 0; re < 64; re++) { - var ae = e[re]; - fe[ae] = C(); + for (ie = 0; ie < 64; ie++) { + var se = e[ie]; + fe[se] = C(); } else throw new Error("DQT: invalid table spec"); - A[ue & 15] = fe; + R[ue & 15] = fe; } break; case 65472: case 65473: case 65474: - C(), B = {}, B.extended = N === 65473, B.progressive = N === 65474, B.precision = w[b++], B.scanLines = C(), B.samplesPerLine = C(), B.components = {}, B.componentsOrder = []; - var P = B.scanLines * B.samplesPerLine; + C(), L = {}, L.extended = N === 65473, L.progressive = N === 65474, L.precision = w[b++], L.scanLines = C(), L.samplesPerLine = C(), L.components = {}, L.componentsOrder = []; + var P = L.scanLines * L.samplesPerLine; if (P > S) { - var T = Math.ceil((P - S) / 1e6); - throw new Error(`maxResolutionInMP limit exceeded by ${T}MP`); + var A = Math.ceil((P - S) / 1e6); + throw new Error(`maxResolutionInMP limit exceeded by ${A}MP`); } - var xe = w[b++], K, ne = 0, tt = 0; - for (ce = 0; ce < xe; ce++) { + var ye = w[b++], K, oe = 0, Ze = 0; + for (ce = 0; ce < ye; ce++) { K = w[b]; - var _ = w[b + 1] >> 4, U = w[b + 1] & 15, Y = w[b + 2]; - B.componentsOrder.push(K), B.components[K] = { h: _, v: U, quantizationIdx: Y }, b += 3; + var tt = w[b + 1] >> 4, g = w[b + 1] & 15, D = w[b + 2]; + if (tt <= 0 || g <= 0) + throw new Error("Invalid sampling factor, expected values above 0"); + L.componentsOrder.push(K), L.components[K] = { h: tt, v: g, quantizationIdx: D }, b += 3; } - E(B), F.push(B); + E(L), F.push(L); break; case 65476: - var Z = C(); - for (ce = 2; ce < Z; ) { - var X = w[b++], he = new Uint8Array(16), se = 0; - for (re = 0; re < 16; re++, b++) - se += he[re] = w[b]; - y(16 + se); - var pe = new Uint8Array(se); - for (re = 0; re < se; re++, b++) - pe[re] = w[b]; - ce += 17 + se, (X >> 4 === 0 ? z : D)[X & 15] = f(he, pe); + var W = C(); + for (ce = 2; ce < W; ) { + var V = w[b++], J = new Uint8Array(16), ee = 0; + for (ie = 0; ie < 16; ie++, b++) + ee += J[ie] = w[b]; + y(16 + ee); + var he = new Uint8Array(ee); + for (ie = 0; ie < ee; ie++, b++) + he[ie] = w[b]; + ce += 17 + ee, (V >> 4 === 0 ? z : j)[V & 15] = f(J, he); } break; case 65501: - C(), ee = C(); + C(), Q = C(); break; case 65500: C(), C(); break; case 65498: - var Ee = C(), ke = w[b++], G = [], L; - for (ce = 0; ce < ke; ce++) { - L = B.components[w[b++]]; - var j = w[b++]; - L.huffmanTableDC = z[j >> 4], L.huffmanTableAC = D[j & 15], G.push(L); + var pe = C(), Oe = w[b++], be = [], O; + for (ce = 0; ce < Oe; ce++) { + O = L.components[w[b++]]; + var M = w[b++]; + O.huffmanTableDC = z[M >> 4], O.huffmanTableAC = j[M & 15], be.push(O); } - var oe = w[b++], me = w[b++], Q = w[b++], ye = h(w, b, B, G, ee, oe, me, Q >> 4, Q & 15, this.opts); - b += ye; + var Z = w[b++], ke = w[b++], te = w[b++], le = h(w, b, L, be, Q, Z, ke, te >> 4, te & 15, this.opts); + b += le; break; case 65535: w[b] !== 255 && b--; @@ -1499,12 +1513,12 @@ var require_utilsBundleImpl = __commonJS({ b -= 3; break; } else if (N === 224 || N == 225) { - if (Ce !== -1) - throw new Error(`first unknown JPEG marker at offset ${Ce.toString(16)}, second unknown JPEG marker ${N.toString(16)} at offset ${(b - 1).toString(16)}`); - Ce = b - 1; - let W = C(); - if (w[b + W - 2] === 255) { - b += W - 2; + if (Se !== -1) + throw new Error(`first unknown JPEG marker at offset ${Se.toString(16)}, second unknown JPEG marker ${N.toString(16)} at offset ${(b - 1).toString(16)}`); + Se = b - 1; + let Y = C(); + if (w[b + Y - 2] === 255) { + b += Y - 2; break; } } @@ -1515,85 +1529,85 @@ var require_utilsBundleImpl = __commonJS({ if (F.length != 1) throw new Error("only single frame JPEGs supported"); for (var ce = 0; ce < F.length; ce++) { - var de = F[ce].components; - for (var re in de) - de[re].quantizationTable = A[de[re].quantizationIdx], delete de[re].quantizationIdx; + var _e = F[ce].components; + for (var ie in _e) + _e[ie].quantizationTable = R[_e[ie].quantizationIdx], delete _e[ie].quantizationIdx; } - this.width = B.samplesPerLine, this.height = B.scanLines, this.jfif = I, this.adobe = R, this.components = []; - for (var ce = 0; ce < B.componentsOrder.length; ce++) { - var L = B.components[B.componentsOrder[ce]]; - this.components.push({ lines: p(B, L), scaleX: L.h / B.maxH, scaleY: L.v / B.maxV }); + this.width = L.samplesPerLine, this.height = L.scanLines, this.jfif = T, this.adobe = B, this.components = []; + for (var ce = 0; ce < L.componentsOrder.length; ce++) { + var O = L.components[L.componentsOrder[ce]]; + this.components.push({ lines: p(L, O), scaleX: O.h / L.maxH, scaleY: O.v / L.maxV }); } }, getData: function(w, S) { - var b = this.width / w, V = this.height / S, C, M, E, I, R, $, B, ee, A, F, D = 0, z, N, Ce, ce, re, ie, g, H, ge, _e, ue, fe = w * S * this.components.length; + var b = this.width / w, $ = this.height / S, C, U, E, T, B, G, L, Q, R, F, j = 0, z, N, Se, ce, ie, ne, _, q, ve, ge, ue, fe = w * S * this.components.length; y(fe); - var ae = new Uint8Array(fe); + var se = new Uint8Array(fe); switch (this.components.length) { case 1: for (C = this.components[0], F = 0; F < S; F++) - for (R = C.lines[0 | F * C.scaleY * V], A = 0; A < w; A++) - z = R[0 | A * C.scaleX * b], ae[D++] = z; + for (B = C.lines[0 | F * C.scaleY * $], R = 0; R < w; R++) + z = B[0 | R * C.scaleX * b], se[j++] = z; break; case 2: - for (C = this.components[0], M = this.components[1], F = 0; F < S; F++) - for (R = C.lines[0 | F * C.scaleY * V], $ = M.lines[0 | F * M.scaleY * V], A = 0; A < w; A++) - z = R[0 | A * C.scaleX * b], ae[D++] = z, z = $[0 | A * M.scaleX * b], ae[D++] = z; + for (C = this.components[0], U = this.components[1], F = 0; F < S; F++) + for (B = C.lines[0 | F * C.scaleY * $], G = U.lines[0 | F * U.scaleY * $], R = 0; R < w; R++) + z = B[0 | R * C.scaleX * b], se[j++] = z, z = G[0 | R * U.scaleX * b], se[j++] = z; break; case 3: - for (ue = true, this.adobe && this.adobe.transformCode ? ue = true : typeof this.opts.colorTransform != "undefined" && (ue = !!this.opts.colorTransform), C = this.components[0], M = this.components[1], E = this.components[2], F = 0; F < S; F++) - for (R = C.lines[0 | F * C.scaleY * V], $ = M.lines[0 | F * M.scaleY * V], B = E.lines[0 | F * E.scaleY * V], A = 0; A < w; A++) - ue ? (z = R[0 | A * C.scaleX * b], N = $[0 | A * M.scaleX * b], Ce = B[0 | A * E.scaleX * b], H = d(z + 1.402 * (Ce - 128)), ge = d(z - 0.3441363 * (N - 128) - 0.71413636 * (Ce - 128)), _e = d(z + 1.772 * (N - 128))) : (H = R[0 | A * C.scaleX * b], ge = $[0 | A * M.scaleX * b], _e = B[0 | A * E.scaleX * b]), ae[D++] = H, ae[D++] = ge, ae[D++] = _e; + for (ue = true, this.adobe && this.adobe.transformCode ? ue = true : typeof this.opts.colorTransform != "undefined" && (ue = !!this.opts.colorTransform), C = this.components[0], U = this.components[1], E = this.components[2], F = 0; F < S; F++) + for (B = C.lines[0 | F * C.scaleY * $], G = U.lines[0 | F * U.scaleY * $], L = E.lines[0 | F * E.scaleY * $], R = 0; R < w; R++) + ue ? (z = B[0 | R * C.scaleX * b], N = G[0 | R * U.scaleX * b], Se = L[0 | R * E.scaleX * b], q = d(z + 1.402 * (Se - 128)), ve = d(z - 0.3441363 * (N - 128) - 0.71413636 * (Se - 128)), ge = d(z + 1.772 * (N - 128))) : (q = B[0 | R * C.scaleX * b], ve = G[0 | R * U.scaleX * b], ge = L[0 | R * E.scaleX * b]), se[j++] = q, se[j++] = ve, se[j++] = ge; break; case 4: if (!this.adobe) throw new Error("Unsupported color mode (4 components)"); - for (ue = false, this.adobe && this.adobe.transformCode ? ue = true : typeof this.opts.colorTransform != "undefined" && (ue = !!this.opts.colorTransform), C = this.components[0], M = this.components[1], E = this.components[2], I = this.components[3], F = 0; F < S; F++) - for (R = C.lines[0 | F * C.scaleY * V], $ = M.lines[0 | F * M.scaleY * V], B = E.lines[0 | F * E.scaleY * V], ee = I.lines[0 | F * I.scaleY * V], A = 0; A < w; A++) - ue ? (z = R[0 | A * C.scaleX * b], N = $[0 | A * M.scaleX * b], Ce = B[0 | A * E.scaleX * b], ce = ee[0 | A * I.scaleX * b], re = 255 - d(z + 1.402 * (Ce - 128)), ie = 255 - d(z - 0.3441363 * (N - 128) - 0.71413636 * (Ce - 128)), g = 255 - d(z + 1.772 * (N - 128))) : (re = R[0 | A * C.scaleX * b], ie = $[0 | A * M.scaleX * b], g = B[0 | A * E.scaleX * b], ce = ee[0 | A * I.scaleX * b]), ae[D++] = 255 - re, ae[D++] = 255 - ie, ae[D++] = 255 - g, ae[D++] = 255 - ce; + for (ue = false, this.adobe && this.adobe.transformCode ? ue = true : typeof this.opts.colorTransform != "undefined" && (ue = !!this.opts.colorTransform), C = this.components[0], U = this.components[1], E = this.components[2], T = this.components[3], F = 0; F < S; F++) + for (B = C.lines[0 | F * C.scaleY * $], G = U.lines[0 | F * U.scaleY * $], L = E.lines[0 | F * E.scaleY * $], Q = T.lines[0 | F * T.scaleY * $], R = 0; R < w; R++) + ue ? (z = B[0 | R * C.scaleX * b], N = G[0 | R * U.scaleX * b], Se = L[0 | R * E.scaleX * b], ce = Q[0 | R * T.scaleX * b], ie = 255 - d(z + 1.402 * (Se - 128)), ne = 255 - d(z - 0.3441363 * (N - 128) - 0.71413636 * (Se - 128)), _ = 255 - d(z + 1.772 * (N - 128))) : (ie = B[0 | R * C.scaleX * b], ne = G[0 | R * U.scaleX * b], _ = L[0 | R * E.scaleX * b], ce = Q[0 | R * T.scaleX * b]), se[j++] = 255 - ie, se[j++] = 255 - ne, se[j++] = 255 - _, se[j++] = 255 - ce; break; default: throw new Error("Unsupported color mode"); } - return ae; + return se; }, copyToImageData: function(w, S) { - var b = w.width, V = w.height, C = w.data, M = this.getData(b, V), E = 0, I = 0, R, $, B, ee, A, F, D, z, N; + var b = w.width, $ = w.height, C = w.data, U = this.getData(b, $), E = 0, T = 0, B, G, L, Q, R, F, j, z, N; switch (this.components.length) { case 1: - for ($ = 0; $ < V; $++) - for (R = 0; R < b; R++) - B = M[E++], C[I++] = B, C[I++] = B, C[I++] = B, S && (C[I++] = 255); + for (G = 0; G < $; G++) + for (B = 0; B < b; B++) + L = U[E++], C[T++] = L, C[T++] = L, C[T++] = L, S && (C[T++] = 255); break; case 3: - for ($ = 0; $ < V; $++) - for (R = 0; R < b; R++) - D = M[E++], z = M[E++], N = M[E++], C[I++] = D, C[I++] = z, C[I++] = N, S && (C[I++] = 255); + for (G = 0; G < $; G++) + for (B = 0; B < b; B++) + j = U[E++], z = U[E++], N = U[E++], C[T++] = j, C[T++] = z, C[T++] = N, S && (C[T++] = 255); break; case 4: - for ($ = 0; $ < V; $++) - for (R = 0; R < b; R++) - A = M[E++], F = M[E++], B = M[E++], ee = M[E++], D = 255 - d(A * (1 - ee / 255) + ee), z = 255 - d(F * (1 - ee / 255) + ee), N = 255 - d(B * (1 - ee / 255) + ee), C[I++] = D, C[I++] = z, C[I++] = N, S && (C[I++] = 255); + for (G = 0; G < $; G++) + for (B = 0; B < b; B++) + R = U[E++], F = U[E++], L = U[E++], Q = U[E++], j = 255 - d(R * (1 - Q / 255) + Q), z = 255 - d(F * (1 - Q / 255) + Q), N = 255 - d(L * (1 - Q / 255) + Q), C[T++] = j, C[T++] = z, C[T++] = N, S && (C[T++] = 255); break; default: throw new Error("Unsupported color mode"); } } }; var m = 0, v = 0; - function y(O = 0) { - var w = m + O; + function y(I = 0) { + var w = m + I; if (w > v) { var S = Math.ceil((w - v) / 1024 / 1024); throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${S}MB`); } m = w; } - return u.resetMaxMemoryUsage = function(O) { - m = 0, v = O; + return u.resetMaxMemoryUsage = function(I) { + m = 0, v = I; }, u.getBytesAllocated = function() { return m; }, u.requestMemoryAllocation = y, u; }(); - typeof hn != "undefined" ? hn.exports = xa : typeof window != "undefined" && (window["jpeg-js"] = window["jpeg-js"] || {}, window["jpeg-js"].decode = xa); - function xa(t, e = {}) { + typeof hn != "undefined" ? hn.exports = ya : typeof window != "undefined" && (window["jpeg-js"] = window["jpeg-js"] || {}, window["jpeg-js"].decode = ya); + function ya(t, e = {}) { var r = { colorTransform: void 0, useTArray: false, formatAsRGBA: true, tolerantDecoding: true, maxResolutionInMP: 100, maxMemoryUsageInMB: 512 }, i = __spreadValues(__spreadValues({}, r), e), n = new Uint8Array(t), s = new fn(); s.opts = i, fn.resetMaxMemoryUsage(i.maxMemoryUsageInMB * 1024 * 1024), s.parse(n); var o = i.formatAsRGBA ? 4 : 3, a = s.width * s.height * o; @@ -1602,19 +1616,19 @@ var require_utilsBundleImpl = __commonJS({ var l = { width: s.width, height: s.height, exifBuffer: s.exifBuffer, data: i.useTArray ? new Uint8Array(a) : Buffer.alloc(a) }; s.comments.length > 0 && (l.comments = s.comments); } catch (c) { - throw c instanceof RangeError ? new Error("Could not allocate enough memory for the image. Required: " + a) : c; + throw c instanceof RangeError ? new Error("Could not allocate enough memory for the image. Required: " + a) : c instanceof ReferenceError && c.message === "Buffer is not defined" ? new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true") : c; } return s.copyToImageData(l, i.formatAsRGBA), l; } }); - var wa = x((y_, ba) => { - var Dp = _a(), jp = ya(); - ba.exports = { encode: Dp, decode: jp }; + var Ea = x((b_, wa) => { + var jp = xa(), qp = ba(); + wa.exports = { encode: jp, decode: qp }; }); - var Sa = x((b_, Ea) => { - var mt = require("constants"), qp = process.cwd, mi = null, Hp = process.env.GRACEFUL_FS_PLATFORM || process.platform; + var ka = x((w_, Sa) => { + var vt = require("constants"), Hp = process.cwd, mi = null, Vp = process.env.GRACEFUL_FS_PLATFORM || process.platform; process.cwd = function() { - return mi || (mi = qp.call(process)), mi; + return mi || (mi = Hp.call(process)), mi; }; try { process.cwd(); @@ -1624,42 +1638,42 @@ var require_utilsBundleImpl = __commonJS({ mi = null, pn.call(process, t); }, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, pn)); var pn; - Ea.exports = Vp; - function Vp(t) { - mt.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && e(t), t.lutimes || r(t), t.chown = s(t.chown), t.fchown = s(t.fchown), t.lchown = s(t.lchown), t.chmod = i(t.chmod), t.fchmod = i(t.fchmod), t.lchmod = i(t.lchmod), t.chownSync = o(t.chownSync), t.fchownSync = o(t.fchownSync), t.lchownSync = o(t.lchownSync), t.chmodSync = n(t.chmodSync), t.fchmodSync = n(t.fchmodSync), t.lchmodSync = n(t.lchmodSync), t.stat = a(t.stat), t.fstat = a(t.fstat), t.lstat = a(t.lstat), t.statSync = l(t.statSync), t.fstatSync = l(t.fstatSync), t.lstatSync = l(t.lstatSync), t.chmod && !t.lchmod && (t.lchmod = function(u, f, h) { + Sa.exports = $p; + function $p(t) { + vt.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && e(t), t.lutimes || r(t), t.chown = s(t.chown), t.fchown = s(t.fchown), t.lchown = s(t.lchown), t.chmod = i(t.chmod), t.fchmod = i(t.fchmod), t.lchmod = i(t.lchmod), t.chownSync = o(t.chownSync), t.fchownSync = o(t.fchownSync), t.lchownSync = o(t.lchownSync), t.chmodSync = n(t.chmodSync), t.fchmodSync = n(t.fchmodSync), t.lchmodSync = n(t.lchmodSync), t.stat = a(t.stat), t.fstat = a(t.fstat), t.lstat = a(t.lstat), t.statSync = l(t.statSync), t.fstatSync = l(t.fstatSync), t.lstatSync = l(t.lstatSync), t.chmod && !t.lchmod && (t.lchmod = function(u, f, h) { h && process.nextTick(h); }, t.lchmodSync = function() { }), t.chown && !t.lchown && (t.lchown = function(u, f, h, p) { p && process.nextTick(p); }, t.lchownSync = function() { - }), Hp === "win32" && (t.rename = typeof t.rename != "function" ? t.rename : function(u) { + }), Vp === "win32" && (t.rename = typeof t.rename != "function" ? t.rename : function(u) { function f(h, p, d) { var m = Date.now(), v = 0; - u(h, p, function y(O) { - if (O && (O.code === "EACCES" || O.code === "EPERM") && Date.now() - m < 6e4) { + u(h, p, function y(I) { + if (I && (I.code === "EACCES" || I.code === "EPERM") && Date.now() - m < 6e4) { setTimeout(function() { t.stat(p, function(w, S) { - w && w.code === "ENOENT" ? u(h, p, y) : d(O); + w && w.code === "ENOENT" ? u(h, p, y) : d(I); }); }, v), v < 100 && (v += 10); return; } - d && d(O); + d && d(I); }); } return Object.setPrototypeOf && Object.setPrototypeOf(f, u), f; }(t.rename)), t.read = typeof t.read != "function" ? t.read : function(u) { function f(h, p, d, m, v, y) { - var O; + var I; if (y && typeof y == "function") { var w = 0; - O = function(S, b, V) { + I = function(S, b, $) { if (S && S.code === "EAGAIN" && w < 10) - return w++, u.call(t, h, p, d, m, v, O); + return w++, u.call(t, h, p, d, m, v, I); y.apply(this, arguments); }; } - return u.call(t, h, p, d, m, v, O); + return u.call(t, h, p, d, m, v, I); } return Object.setPrototypeOf && Object.setPrototypeOf(f, u), f; }(t.read), t.readSync = typeof t.readSync != "function" ? t.readSync : function(u) { @@ -1678,7 +1692,7 @@ var require_utilsBundleImpl = __commonJS({ }(t.readSync); function e(u) { u.lchmod = function(f, h, p) { - u.open(f, mt.O_WRONLY | mt.O_SYMLINK, h, function(d, m) { + u.open(f, vt.O_WRONLY | vt.O_SYMLINK, h, function(d, m) { if (d) { p && p(d); return; @@ -1690,7 +1704,7 @@ var require_utilsBundleImpl = __commonJS({ }); }); }, u.lchmodSync = function(f, h) { - var p = u.openSync(f, mt.O_WRONLY | mt.O_SYMLINK, h), d = true, m; + var p = u.openSync(f, vt.O_WRONLY | vt.O_SYMLINK, h), d = true, m; try { m = u.fchmodSync(p, h), d = false; } finally { @@ -1706,20 +1720,20 @@ var require_utilsBundleImpl = __commonJS({ }; } function r(u) { - mt.hasOwnProperty("O_SYMLINK") && u.futimes ? (u.lutimes = function(f, h, p, d) { - u.open(f, mt.O_SYMLINK, function(m, v) { + vt.hasOwnProperty("O_SYMLINK") && u.futimes ? (u.lutimes = function(f, h, p, d) { + u.open(f, vt.O_SYMLINK, function(m, v) { if (m) { d && d(m); return; } u.futimes(v, h, p, function(y) { - u.close(v, function(O) { - d && d(y || O); + u.close(v, function(I) { + d && d(y || I); }); }); }); }, u.lutimesSync = function(f, h, p) { - var d = u.openSync(f, mt.O_SYMLINK), m, v = true; + var d = u.openSync(f, vt.O_SYMLINK), m, v = true; try { m = u.futimesSync(d, h, p), v = false; } finally { @@ -1794,15 +1808,15 @@ var require_utilsBundleImpl = __commonJS({ } } }); - var Oa = x((w_, Ca) => { - var ka = require("stream").Stream; - Ca.exports = $p; - function $p(t) { + var Ia = x((E_, Oa) => { + var Ca = require("stream").Stream; + Oa.exports = Gp; + function Gp(t) { return { ReadStream: e, WriteStream: r }; function e(i, n) { if (!(this instanceof e)) return new e(i, n); - ka.call(this); + Ca.call(this); var s = this; this.path = i, this.fd = null, this.readable = true, this.paused = false, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, n = n || {}; for (var o = Object.keys(n), a = 0, l = o.length; a < l; a++) { @@ -1837,7 +1851,7 @@ var require_utilsBundleImpl = __commonJS({ function r(i, n) { if (!(this instanceof r)) return new r(i, n); - ka.call(this), this.path = i, this.fd = null, this.writable = true, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, n = n || {}; + Ca.call(this), this.path = i, this.fd = null, this.writable = true, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, n = n || {}; for (var s = Object.keys(n), o = 0, a = s.length; o < a; o++) { var l = s[o]; this[l] = n[l]; @@ -1853,17 +1867,17 @@ var require_utilsBundleImpl = __commonJS({ } } }); - var Ta = x((E_, Ia) => { + var Aa = x((S_, Ta) => { "use strict"; - Ia.exports = zp; - var Gp = Object.getPrototypeOf || function(t) { + Ta.exports = Wp; + var zp = Object.getPrototypeOf || function(t) { return t.__proto__; }; - function zp(t) { + function Wp(t) { if (t === null || typeof t != "object") return t; if (t instanceof Object) - var e = { __proto__: Gp(t) }; + var e = { __proto__: zp(t) }; else var e = Object.create(null); return Object.getOwnPropertyNames(t).forEach(function(r) { @@ -1871,106 +1885,106 @@ var require_utilsBundleImpl = __commonJS({ }), e; } }); - var gn = x((S_, vn) => { - var Ie = require("fs"), Wp = Sa(), Yp = Oa(), Kp = Ta(), vi = require("util"), De, _i; - typeof Symbol == "function" && typeof Symbol.for == "function" ? (De = Symbol.for("graceful-fs.queue"), _i = Symbol.for("graceful-fs.previous")) : (De = "___graceful-fs.queue", _i = "___graceful-fs.previous"); - function Zp() { + var gn = x((k_, vn) => { + var Ie = require("fs"), Yp = ka(), Kp = Ia(), Zp = Aa(), vi = require("util"), Ue, _i; + typeof Symbol == "function" && typeof Symbol.for == "function" ? (Ue = Symbol.for("graceful-fs.queue"), _i = Symbol.for("graceful-fs.previous")) : (Ue = "___graceful-fs.queue", _i = "___graceful-fs.previous"); + function Xp() { } - function Ba(t, e) { - Object.defineProperty(t, De, { get: function() { + function La(t, e) { + Object.defineProperty(t, Ue, { get: function() { return e; } }); } - var Nt = Zp; + var Nt = Xp; vi.debuglog ? Nt = vi.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (Nt = function() { var t = vi.format.apply(vi, arguments); t = "GFS4: " + t.split(/\n/).join(` GFS4: `), console.error(t); }); - Ie[De] || (Aa = global[De] || [], Ba(Ie, Aa), Ie.close = function(t) { + Ie[Ue] || (Ra = global[Ue] || [], La(Ie, Ra), Ie.close = function(t) { function e(r, i) { return t.call(Ie, r, function(n) { - n || Ra(), typeof i == "function" && i.apply(this, arguments); + n || Ba(), typeof i == "function" && i.apply(this, arguments); }); } return Object.defineProperty(e, _i, { value: t }), e; }(Ie.close), Ie.closeSync = function(t) { function e(r) { - t.apply(Ie, arguments), Ra(); + t.apply(Ie, arguments), Ba(); } return Object.defineProperty(e, _i, { value: t }), e; }(Ie.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() { - Nt(Ie[De]), require("assert").equal(Ie[De].length, 0); + Nt(Ie[Ue]), require("assert").equal(Ie[Ue].length, 0); })); - var Aa; - global[De] || Ba(global, Ie[De]); - vn.exports = dn(Kp(Ie)); + var Ra; + global[Ue] || La(global, Ie[Ue]); + vn.exports = dn(Zp(Ie)); process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !Ie.__patched && (vn.exports = dn(Ie), Ie.__patched = true); function dn(t) { - Wp(t), t.gracefulify = dn, t.createReadStream = b, t.createWriteStream = V; + Yp(t), t.gracefulify = dn, t.createReadStream = b, t.createWriteStream = $; var e = t.readFile; t.readFile = r; - function r(E, I, R) { - return typeof I == "function" && (R = I, I = null), $(E, I, R); - function $(B, ee, A, F) { - return e(B, ee, function(D) { - D && (D.code === "EMFILE" || D.code === "ENFILE") ? ir([$, [B, ee, A], D, F || Date.now(), Date.now()]) : typeof A == "function" && A.apply(this, arguments); + function r(E, T, B) { + return typeof T == "function" && (B = T, T = null), G(E, T, B); + function G(L, Q, R, F) { + return e(L, Q, function(j) { + j && (j.code === "EMFILE" || j.code === "ENFILE") ? nr([G, [L, Q, R], j, F || Date.now(), Date.now()]) : typeof R == "function" && R.apply(this, arguments); }); } } var i = t.writeFile; t.writeFile = n; - function n(E, I, R, $) { - return typeof R == "function" && ($ = R, R = null), B(E, I, R, $); - function B(ee, A, F, D, z) { - return i(ee, A, F, function(N) { - N && (N.code === "EMFILE" || N.code === "ENFILE") ? ir([B, [ee, A, F, D], N, z || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments); + function n(E, T, B, G) { + return typeof B == "function" && (G = B, B = null), L(E, T, B, G); + function L(Q, R, F, j, z) { + return i(Q, R, F, function(N) { + N && (N.code === "EMFILE" || N.code === "ENFILE") ? nr([L, [Q, R, F, j], N, z || Date.now(), Date.now()]) : typeof j == "function" && j.apply(this, arguments); }); } } var s = t.appendFile; s && (t.appendFile = o); - function o(E, I, R, $) { - return typeof R == "function" && ($ = R, R = null), B(E, I, R, $); - function B(ee, A, F, D, z) { - return s(ee, A, F, function(N) { - N && (N.code === "EMFILE" || N.code === "ENFILE") ? ir([B, [ee, A, F, D], N, z || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments); + function o(E, T, B, G) { + return typeof B == "function" && (G = B, B = null), L(E, T, B, G); + function L(Q, R, F, j, z) { + return s(Q, R, F, function(N) { + N && (N.code === "EMFILE" || N.code === "ENFILE") ? nr([L, [Q, R, F, j], N, z || Date.now(), Date.now()]) : typeof j == "function" && j.apply(this, arguments); }); } } var a = t.copyFile; a && (t.copyFile = l); - function l(E, I, R, $) { - return typeof R == "function" && ($ = R, R = 0), B(E, I, R, $); - function B(ee, A, F, D, z) { - return a(ee, A, F, function(N) { - N && (N.code === "EMFILE" || N.code === "ENFILE") ? ir([B, [ee, A, F, D], N, z || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments); + function l(E, T, B, G) { + return typeof B == "function" && (G = B, B = 0), L(E, T, B, G); + function L(Q, R, F, j, z) { + return a(Q, R, F, function(N) { + N && (N.code === "EMFILE" || N.code === "ENFILE") ? nr([L, [Q, R, F, j], N, z || Date.now(), Date.now()]) : typeof j == "function" && j.apply(this, arguments); }); } } var c = t.readdir; t.readdir = f; var u = /^v[0-5]\./; - function f(E, I, R) { - typeof I == "function" && (R = I, I = null); - var $ = u.test(process.version) ? function(A, F, D, z) { - return c(A, B(A, F, D, z)); - } : function(A, F, D, z) { - return c(A, F, B(A, F, D, z)); + function f(E, T, B) { + typeof T == "function" && (B = T, T = null); + var G = u.test(process.version) ? function(R, F, j, z) { + return c(R, L(R, F, j, z)); + } : function(R, F, j, z) { + return c(R, F, L(R, F, j, z)); }; - return $(E, I, R); - function B(ee, A, F, D) { + return G(E, T, B); + function L(Q, R, F, j) { return function(z, N) { - z && (z.code === "EMFILE" || z.code === "ENFILE") ? ir([$, [ee, A, F], z, D || Date.now(), Date.now()]) : (N && N.sort && N.sort(), typeof F == "function" && F.call(this, z, N)); + z && (z.code === "EMFILE" || z.code === "ENFILE") ? nr([G, [Q, R, F], z, j || Date.now(), Date.now()]) : (N && N.sort && N.sort(), typeof F == "function" && F.call(this, z, N)); }; } } if (process.version.substr(0, 4) === "v0.8") { - var h = Yp(t); + var h = Kp(t); y = h.ReadStream, w = h.WriteStream; } var p = t.ReadStream; - p && (y.prototype = Object.create(p.prototype), y.prototype.open = O); + p && (y.prototype = Object.create(p.prototype), y.prototype.open = I); var d = t.WriteStream; d && (w.prototype = Object.create(d.prototype), w.prototype.open = S), Object.defineProperty(t, "ReadStream", { get: function() { return y; @@ -1993,54 +2007,54 @@ GFS4: `), console.error(t); }, set: function(E) { v = E; }, enumerable: true, configurable: true }); - function y(E, I) { + function y(E, T) { return this instanceof y ? (p.apply(this, arguments), this) : y.apply(Object.create(y.prototype), arguments); } - function O() { + function I() { var E = this; - M(E.path, E.flags, E.mode, function(I, R) { - I ? (E.autoClose && E.destroy(), E.emit("error", I)) : (E.fd = R, E.emit("open", R), E.read()); + U(E.path, E.flags, E.mode, function(T, B) { + T ? (E.autoClose && E.destroy(), E.emit("error", T)) : (E.fd = B, E.emit("open", B), E.read()); }); } - function w(E, I) { + function w(E, T) { return this instanceof w ? (d.apply(this, arguments), this) : w.apply(Object.create(w.prototype), arguments); } function S() { var E = this; - M(E.path, E.flags, E.mode, function(I, R) { - I ? (E.destroy(), E.emit("error", I)) : (E.fd = R, E.emit("open", R)); + U(E.path, E.flags, E.mode, function(T, B) { + T ? (E.destroy(), E.emit("error", T)) : (E.fd = B, E.emit("open", B)); }); } - function b(E, I) { - return new t.ReadStream(E, I); + function b(E, T) { + return new t.ReadStream(E, T); } - function V(E, I) { - return new t.WriteStream(E, I); + function $(E, T) { + return new t.WriteStream(E, T); } var C = t.open; - t.open = M; - function M(E, I, R, $) { - return typeof R == "function" && ($ = R, R = null), B(E, I, R, $); - function B(ee, A, F, D, z) { - return C(ee, A, F, function(N, Ce) { - N && (N.code === "EMFILE" || N.code === "ENFILE") ? ir([B, [ee, A, F, D], N, z || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments); + t.open = U; + function U(E, T, B, G) { + return typeof B == "function" && (G = B, B = null), L(E, T, B, G); + function L(Q, R, F, j, z) { + return C(Q, R, F, function(N, Se) { + N && (N.code === "EMFILE" || N.code === "ENFILE") ? nr([L, [Q, R, F, j], N, z || Date.now(), Date.now()]) : typeof j == "function" && j.apply(this, arguments); }); } } return t; } - function ir(t) { - Nt("ENQUEUE", t[0].name, t[1]), Ie[De].push(t), mn(); + function nr(t) { + Nt("ENQUEUE", t[0].name, t[1]), Ie[Ue].push(t), mn(); } var gi; - function Ra() { - for (var t = Date.now(), e = 0; e < Ie[De].length; ++e) - Ie[De][e].length > 2 && (Ie[De][e][3] = t, Ie[De][e][4] = t); + function Ba() { + for (var t = Date.now(), e = 0; e < Ie[Ue].length; ++e) + Ie[Ue][e].length > 2 && (Ie[Ue][e][3] = t, Ie[Ue][e][4] = t); mn(); } function mn() { - if (clearTimeout(gi), gi = void 0, Ie[De].length !== 0) { - var t = Ie[De].shift(), e = t[0], r = t[1], i = t[2], n = t[3], s = t[4]; + if (clearTimeout(gi), gi = void 0, Ie[Ue].length !== 0) { + var t = Ie[Ue].shift(), e = t[0], r = t[1], i = t[2], n = t[3], s = t[4]; if (n === void 0) Nt("RETRY", e.name, r), e.apply(null, r); else if (Date.now() - n >= 6e4) { @@ -2049,17 +2063,17 @@ GFS4: `), console.error(t); typeof o == "function" && o.call(null, i); } else { var a = Date.now() - s, l = Math.max(s - n, 1), c = Math.min(l * 1.2, 100); - a >= c ? (Nt("RETRY", e.name, r), e.apply(null, r.concat([n]))) : Ie[De].push(t); + a >= c ? (Nt("RETRY", e.name, r), e.apply(null, r.concat([n]))) : Ie[Ue].push(t); } gi === void 0 && (gi = setTimeout(mn, 0)); } } }); - var Na = x((k_, La) => { + var Pa = x((C_, Na) => { function Qe(t, e) { typeof e == "boolean" && (e = { forever: e }), this._originalTimeouts = JSON.parse(JSON.stringify(t)), this._timeouts = t, this._options = e || {}, this._maxRetryTime = e && e.maxRetryTime || 1 / 0, this._fn = null, this._errors = [], this._attempts = 1, this._operationTimeout = null, this._operationTimeoutCb = null, this._timeout = null, this._operationStart = null, this._options.forever && (this._cachedTimeouts = this._timeouts.slice(0)); } - La.exports = Qe; + Na.exports = Qe; Qe.prototype.reset = function() { this._attempts = 1, this._timeouts = this._originalTimeouts; }; @@ -2116,11 +2130,11 @@ GFS4: `), console.error(t); return e; }; }); - var Pa = x((Pt) => { - var Xp = Na(); + var Fa = x((Pt) => { + var Qp = Pa(); Pt.operation = function(t) { var e = Pt.timeouts(t); - return new Xp(e, { forever: t && t.forever, unref: t && t.unref, maxRetryTime: t && t.maxRetryTime }); + return new Qp(e, { forever: t && t.forever, unref: t && t.unref, maxRetryTime: t && t.maxRetryTime }); }; Pt.timeouts = function(t) { if (t instanceof Array) @@ -2159,75 +2173,75 @@ GFS4: `), console.error(t); } }; }); - var Ma = x((O_, Fa) => { - Fa.exports = Pa(); + var Ua = x((I_, Ma) => { + Ma.exports = Fa(); }); - var Ua = x((I_, xi) => { + var Da = x((T_, xi) => { xi.exports = ["SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM"]; process.platform !== "win32" && xi.exports.push("SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT"); process.platform === "linux" && xi.exports.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED"); }); - var Va = x((T_, or) => { - var Oe = global.process, Ft = function(t) { + var $a = x((A_, ar) => { + var Ce = global.process, Ft = function(t) { return t && typeof t == "object" && typeof t.removeListener == "function" && typeof t.emit == "function" && typeof t.reallyExit == "function" && typeof t.listeners == "function" && typeof t.kill == "function" && typeof t.pid == "number" && typeof t.on == "function"; }; - Ft(Oe) ? (Da = require("assert"), nr = Ua(), ja = /^win/i.test(Oe.platform), Pr = require("events"), typeof Pr != "function" && (Pr = Pr.EventEmitter), Oe.__signal_exit_emitter__ ? Ne = Oe.__signal_exit_emitter__ : (Ne = Oe.__signal_exit_emitter__ = new Pr(), Ne.count = 0, Ne.emitted = {}), Ne.infinite || (Ne.setMaxListeners(1 / 0), Ne.infinite = true), or.exports = function(t, e) { + Ft(Ce) ? (ja = require("assert"), sr = Da(), qa = /^win/i.test(Ce.platform), Fr = require("events"), typeof Fr != "function" && (Fr = Fr.EventEmitter), Ce.__signal_exit_emitter__ ? Le = Ce.__signal_exit_emitter__ : (Le = Ce.__signal_exit_emitter__ = new Fr(), Le.count = 0, Le.emitted = {}), Le.infinite || (Le.setMaxListeners(1 / 0), Le.infinite = true), ar.exports = function(t, e) { if (!Ft(global.process)) return function() { }; - Da.equal(typeof t, "function", "a callback must be provided for exit handler"), sr === false && _n(); + ja.equal(typeof t, "function", "a callback must be provided for exit handler"), or === false && _n(); var r = "exit"; e && e.alwaysLast && (r = "afterexit"); var i = function() { - Ne.removeListener(r, t), Ne.listeners("exit").length === 0 && Ne.listeners("afterexit").length === 0 && yi(); + Le.removeListener(r, t), Le.listeners("exit").length === 0 && Le.listeners("afterexit").length === 0 && yi(); }; - return Ne.on(r, t), i; + return Le.on(r, t), i; }, yi = function() { - !sr || !Ft(global.process) || (sr = false, nr.forEach(function(e) { + !or || !Ft(global.process) || (or = false, sr.forEach(function(e) { try { - Oe.removeListener(e, bi[e]); + Ce.removeListener(e, bi[e]); } catch (e2) { } - }), Oe.emit = wi, Oe.reallyExit = xn, Ne.count -= 1); - }, or.exports.unload = yi, Mt = function(e, r, i) { - Ne.emitted[e] || (Ne.emitted[e] = true, Ne.emit(e, r, i)); - }, bi = {}, nr.forEach(function(t) { + }), Ce.emit = wi, Ce.reallyExit = xn, Le.count -= 1); + }, ar.exports.unload = yi, Mt = function(e, r, i) { + Le.emitted[e] || (Le.emitted[e] = true, Le.emit(e, r, i)); + }, bi = {}, sr.forEach(function(t) { bi[t] = function() { if (!!Ft(global.process)) { - var r = Oe.listeners(t); - r.length === Ne.count && (yi(), Mt("exit", null, t), Mt("afterexit", null, t), ja && t === "SIGHUP" && (t = "SIGINT"), Oe.kill(Oe.pid, t)); + var r = Ce.listeners(t); + r.length === Le.count && (yi(), Mt("exit", null, t), Mt("afterexit", null, t), qa && t === "SIGHUP" && (t = "SIGINT"), Ce.kill(Ce.pid, t)); } }; - }), or.exports.signals = function() { - return nr; - }, sr = false, _n = function() { - sr || !Ft(global.process) || (sr = true, Ne.count += 1, nr = nr.filter(function(e) { + }), ar.exports.signals = function() { + return sr; + }, or = false, _n = function() { + or || !Ft(global.process) || (or = true, Le.count += 1, sr = sr.filter(function(e) { try { - return Oe.on(e, bi[e]), true; + return Ce.on(e, bi[e]), true; } catch (e2) { return false; } - }), Oe.emit = Ha, Oe.reallyExit = qa); - }, or.exports.load = _n, xn = Oe.reallyExit, qa = function(e) { - !Ft(global.process) || (Oe.exitCode = e || 0, Mt("exit", Oe.exitCode, null), Mt("afterexit", Oe.exitCode, null), xn.call(Oe, Oe.exitCode)); - }, wi = Oe.emit, Ha = function(e, r) { + }), Ce.emit = Va, Ce.reallyExit = Ha); + }, ar.exports.load = _n, xn = Ce.reallyExit, Ha = function(e) { + !Ft(global.process) || (Ce.exitCode = e || 0, Mt("exit", Ce.exitCode, null), Mt("afterexit", Ce.exitCode, null), xn.call(Ce, Ce.exitCode)); + }, wi = Ce.emit, Va = function(e, r) { if (e === "exit" && Ft(global.process)) { - r !== void 0 && (Oe.exitCode = r); + r !== void 0 && (Ce.exitCode = r); var i = wi.apply(this, arguments); - return Mt("exit", Oe.exitCode, null), Mt("afterexit", Oe.exitCode, null), i; + return Mt("exit", Ce.exitCode, null), Mt("afterexit", Ce.exitCode, null), i; } else return wi.apply(this, arguments); - }) : or.exports = function() { + }) : ar.exports = function() { return function() { }; }; - var Da, nr, ja, Pr, Ne, yi, Mt, bi, sr, _n, xn, qa, wi, Ha; + var ja, sr, qa, Fr, Le, yi, Mt, bi, or, _n, xn, Ha, wi, Va; }); - var Ga = x((A_, yn) => { + var za = x((R_, yn) => { "use strict"; - var $a = Symbol(); - function Qp(t, e, r) { - let i = e[$a]; + var Ga = Symbol(); + function Jp(t, e, r) { + let i = e[Ga]; if (i) return e.stat(t, (s, o) => { if (s) @@ -2242,33 +2256,33 @@ GFS4: `), console.error(t); if (o) return r(o); let l = a.mtime.getTime() % 1e3 === 0 ? "s" : "ms"; - Object.defineProperty(e, $a, { value: l }), r(null, a.mtime, l); + Object.defineProperty(e, Ga, { value: l }), r(null, a.mtime, l); }); }); } - function Jp(t) { + function ed(t) { let e = Date.now(); return t === "s" && (e = Math.ceil(e / 1e3) * 1e3), new Date(e); } - yn.exports.probe = Qp; - yn.exports.getMtime = Jp; + yn.exports.probe = Jp; + yn.exports.getMtime = ed; }); - var Za = x((R_, Mr) => { + var Xa = x((B_, Ur) => { "use strict"; - var ed = require("path"), En = gn(), td = Ma(), rd = Va(), za = Ga(), ct = {}; - function Fr(t, e) { + var td = require("path"), En = gn(), rd = Ua(), id = $a(), Wa = za(), ut = {}; + function Mr(t, e) { return e.lockfilePath || `${t}.lock`; } function Sn(t, e, r) { if (!e.realpath) - return r(null, ed.resolve(t)); + return r(null, td.resolve(t)); e.fs.realpath(t, r); } function wn(t, e, r) { - let i = Fr(t, e); + let i = Mr(t, e); e.fs.mkdir(i, (n) => { if (!n) - return za.probe(i, e.fs, (s, o, a) => { + return Wa.probe(i, e.fs, (s, o, a) => { if (s) return e.fs.rmdir(i, () => { }), r(s); @@ -2281,9 +2295,9 @@ GFS4: `), console.error(t); e.fs.stat(i, (s, o) => { if (s) return s.code === "ENOENT" ? wn(t, __spreadProps(__spreadValues({}, e), { stale: 0 }), r) : r(s); - if (!Wa(o, e)) + if (!Ya(o, e)) return r(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file: t })); - Ya(t, e, (a) => { + Ka(t, e, (a) => { if (a) return r(a); wn(t, __spreadProps(__spreadValues({}, e), { stale: 0 }), r); @@ -2291,18 +2305,18 @@ GFS4: `), console.error(t); }); }); } - function Wa(t, e) { + function Ya(t, e) { return t.mtime.getTime() < Date.now() - e.stale; } - function Ya(t, e, r) { - e.fs.rmdir(Fr(t, e), (i) => { + function Ka(t, e, r) { + e.fs.rmdir(Mr(t, e), (i) => { if (i && i.code !== "ENOENT") return r(i); r(); }); } function Ei(t, e) { - let r = ct[t]; + let r = ut[t]; r.updateTimeout || (r.updateDelay = r.updateDelay || e.update, r.updateTimeout = setTimeout(() => { r.updateTimeout = null, e.fs.stat(r.lockfilePath, (i, n) => { let s = r.lastUpdate + e.stale < Date.now(); @@ -2310,7 +2324,7 @@ GFS4: `), console.error(t); return i.code === "ENOENT" || s ? bn(t, r, Object.assign(i, { code: "ECOMPROMISED" })) : (r.updateDelay = 1e3, Ei(t, e)); if (!(r.mtime.getTime() === n.mtime.getTime())) return bn(t, r, Object.assign(new Error("Unable to update lock within the stale threshold"), { code: "ECOMPROMISED" })); - let a = za.getMtime(r.mtimePrecision); + let a = Wa.getMtime(r.mtimePrecision); e.fs.utimes(r.lockfilePath, a, a, (l) => { let c = r.lastUpdate + e.stale < Date.now(); if (!r.released) { @@ -2323,69 +2337,69 @@ GFS4: `), console.error(t); }, r.updateDelay), r.updateTimeout.unref && r.updateTimeout.unref()); } function bn(t, e, r) { - e.released = true, e.updateTimeout && clearTimeout(e.updateTimeout), ct[t] === e && delete ct[t], e.options.onCompromised(r); + e.released = true, e.updateTimeout && clearTimeout(e.updateTimeout), ut[t] === e && delete ut[t], e.options.onCompromised(r); } - function id(t, e, r) { + function nd(t, e, r) { e = __spreadValues({ stale: 1e4, update: null, realpath: true, retries: 0, fs: En, onCompromised: (i) => { throw i; } }, e), e.retries = e.retries || 0, e.retries = typeof e.retries == "number" ? { retries: e.retries } : e.retries, e.stale = Math.max(e.stale || 0, 2e3), e.update = e.update == null ? e.stale / 2 : e.update || 0, e.update = Math.max(Math.min(e.update, e.stale / 2), 1e3), Sn(t, e, (i, n) => { if (i) return r(i); - let s = td.operation(e.retries); + let s = rd.operation(e.retries); s.attempt(() => { wn(n, e, (o, a, l) => { if (s.retry(o)) return; if (o) return r(s.mainError()); - let c = ct[n] = { lockfilePath: Fr(n, e), mtime: a, mtimePrecision: l, options: e, lastUpdate: Date.now() }; + let c = ut[n] = { lockfilePath: Mr(n, e), mtime: a, mtimePrecision: l, options: e, lastUpdate: Date.now() }; Ei(n, e), r(null, (u) => { if (c.released) return u && u(Object.assign(new Error("Lock is already released"), { code: "ERELEASED" })); - Ka(n, __spreadProps(__spreadValues({}, e), { realpath: false }), u); + Za(n, __spreadProps(__spreadValues({}, e), { realpath: false }), u); }); }); }); }); } - function Ka(t, e, r) { + function Za(t, e, r) { e = __spreadValues({ fs: En, realpath: true }, e), Sn(t, e, (i, n) => { if (i) return r(i); - let s = ct[n]; + let s = ut[n]; if (!s) return r(Object.assign(new Error("Lock is not acquired/owned by you"), { code: "ENOTACQUIRED" })); - s.updateTimeout && clearTimeout(s.updateTimeout), s.released = true, delete ct[n], Ya(n, e, r); + s.updateTimeout && clearTimeout(s.updateTimeout), s.released = true, delete ut[n], Ka(n, e, r); }); } - function nd(t, e, r) { + function sd(t, e, r) { e = __spreadValues({ stale: 1e4, realpath: true, fs: En }, e), e.stale = Math.max(e.stale || 0, 2e3), Sn(t, e, (i, n) => { if (i) return r(i); - e.fs.stat(Fr(n, e), (s, o) => s ? s.code === "ENOENT" ? r(null, false) : r(s) : r(null, !Wa(o, e))); + e.fs.stat(Mr(n, e), (s, o) => s ? s.code === "ENOENT" ? r(null, false) : r(s) : r(null, !Ya(o, e))); }); } - function sd() { - return ct; + function od() { + return ut; } - rd(() => { - for (let t in ct) { - let e = ct[t].options; + id(() => { + for (let t in ut) { + let e = ut[t].options; try { - e.fs.rmdirSync(Fr(t, e)); + e.fs.rmdirSync(Mr(t, e)); } catch (e2) { } } }); - Mr.exports.lock = id; - Mr.exports.unlock = Ka; - Mr.exports.check = nd; - Mr.exports.getLocks = sd; + Ur.exports.lock = nd; + Ur.exports.unlock = Za; + Ur.exports.check = sd; + Ur.exports.getLocks = od; }); - var Qa = x((B_, Xa) => { + var Ja = x((L_, Qa) => { "use strict"; - var od = gn(); - function ad(t) { + var ad = gn(); + function ld(t) { let e = ["mkdir", "realpath", "stat", "rmdir", "utimes"], r = __spreadValues({}, t); return e.forEach((i) => { r[i] = (...n) => { @@ -2399,14 +2413,14 @@ GFS4: `), console.error(t); }; }), r; } - function ld(t) { + function cd(t) { return (...e) => new Promise((r, i) => { e.push((n, s) => { n ? i(n) : r(s); }), t(...e); }); } - function cd(t) { + function ud(t) { return (...e) => { let r, i; if (e.push((n, s) => { @@ -2416,47 +2430,47 @@ GFS4: `), console.error(t); return i; }; } - function ud(t) { - if (t = __spreadValues({}, t), t.fs = ad(t.fs || od), typeof t.retries == "number" && t.retries > 0 || t.retries && typeof t.retries.retries == "number" && t.retries.retries > 0) + function fd(t) { + if (t = __spreadValues({}, t), t.fs = ld(t.fs || ad), typeof t.retries == "number" && t.retries > 0 || t.retries && typeof t.retries.retries == "number" && t.retries.retries > 0) throw Object.assign(new Error("Cannot use retries with the sync api"), { code: "ESYNC" }); return t; } - Xa.exports = { toPromise: ld, toSync: cd, toSyncOptions: ud }; + Qa.exports = { toPromise: cd, toSync: ud, toSyncOptions: fd }; }); - var el = x((L_, vt) => { + var tl = x((N_, gt) => { "use strict"; - var ar = Za(), { toPromise: Si, toSync: ki, toSyncOptions: kn } = Qa(); - function Ja(t, e) { + var lr = Xa(), { toPromise: Si, toSync: ki, toSyncOptions: kn } = Ja(); + function el(t, e) { return __async(this, null, function* () { - let r = yield Si(ar.lock)(t, e); + let r = yield Si(lr.lock)(t, e); return Si(r); }); } - function fd(t, e) { - let r = ki(ar.lock)(t, kn(e)); - return ki(r); - } function hd(t, e) { - return Si(ar.unlock)(t, e); + let r = ki(lr.lock)(t, kn(e)); + return ki(r); } function pd(t, e) { - return ki(ar.unlock)(t, kn(e)); + return Si(lr.unlock)(t, e); } function dd(t, e) { - return Si(ar.check)(t, e); + return ki(lr.unlock)(t, kn(e)); } function md(t, e) { - return ki(ar.check)(t, kn(e)); + return Si(lr.check)(t, e); + } + function vd(t, e) { + return ki(lr.check)(t, kn(e)); } - vt.exports = Ja; - vt.exports.lock = Ja; - vt.exports.unlock = hd; - vt.exports.lockSync = fd; - vt.exports.unlockSync = pd; - vt.exports.check = dd; - vt.exports.checkSync = md; + gt.exports = el; + gt.exports.lock = el; + gt.exports.unlock = pd; + gt.exports.lockSync = hd; + gt.exports.unlockSync = dd; + gt.exports.check = md; + gt.exports.checkSync = vd; }); - var rl = x((N_, tl) => { + var il = x((P_, rl) => { "use strict"; function Ci() { this._types = Object.create(null), this._extensions = Object.create(null); @@ -2492,45 +2506,45 @@ GFS4: `), console.error(t); Ci.prototype.getExtension = function(t) { return t = /^\s*([^;\s]*)/.test(t) && RegExp.$1, t && this._extensions[t.toLowerCase()] || null; }; - tl.exports = Ci; + rl.exports = Ci; }); - var nl = x((P_, il) => { - il.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] }; + var sl = x((F_, nl) => { + nl.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] }; }); - var ol = x((F_, sl) => { - sl.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] }; + var al = x((M_, ol) => { + ol.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] }; }); - var ll = x((M_, al) => { + var cl = x((U_, ll) => { "use strict"; - var vd = rl(); - al.exports = new vd(nl(), ol()); + var gd = il(); + ll.exports = new gd(sl(), al()); }); - var ul = x((U_, cl) => { - cl.exports = function(t, e) { + var fl = x((D_, ul) => { + ul.exports = function(t, e) { for (var r = [], i = 0; i < t.length; i++) { var n = e(t[i], i); - gd(n) ? r.push.apply(r, n) : r.push(n); + _d(n) ? r.push.apply(r, n) : r.push(n); } return r; }; - var gd = Array.isArray || function(t) { + var _d = Array.isArray || function(t) { return Object.prototype.toString.call(t) === "[object Array]"; }; }); - var ml = x((D_, dl) => { + var vl = x((j_, ml) => { "use strict"; - dl.exports = hl; - function hl(t, e, r) { - t instanceof RegExp && (t = fl(t, r)), e instanceof RegExp && (e = fl(e, r)); - var i = pl(t, e, r); + ml.exports = pl; + function pl(t, e, r) { + t instanceof RegExp && (t = hl(t, r)), e instanceof RegExp && (e = hl(e, r)); + var i = dl(t, e, r); return i && { start: i[0], end: i[1], pre: r.slice(0, i[0]), body: r.slice(i[0] + t.length, i[1]), post: r.slice(i[1] + e.length) }; } - function fl(t, e) { + function hl(t, e) { var r = e.match(t); return r ? r[0] : null; } - hl.range = pl; - function pl(t, e, r) { + pl.range = dl; + function dl(t, e, r) { var i, n, s, o, a, l = r.indexOf(t), c = r.indexOf(e, l + 1), u = l; if (l >= 0 && c > 0) { if (t === e) @@ -2542,116 +2556,116 @@ GFS4: `), console.error(t); return a; } }); - var El = x((j_, wl) => { - var _d = ul(), vl = ml(); - wl.exports = bd; - var gl = "\0SLASH" + Math.random() + "\0", _l = "\0OPEN" + Math.random() + "\0", On = "\0CLOSE" + Math.random() + "\0", xl = "\0COMMA" + Math.random() + "\0", yl = "\0PERIOD" + Math.random() + "\0"; + var Sl = x((q_, El) => { + var xd = fl(), gl = vl(); + El.exports = wd; + var _l = "\0SLASH" + Math.random() + "\0", xl = "\0OPEN" + Math.random() + "\0", On = "\0CLOSE" + Math.random() + "\0", yl = "\0COMMA" + Math.random() + "\0", bl = "\0PERIOD" + Math.random() + "\0"; function Cn(t) { return parseInt(t, 10) == t ? parseInt(t, 10) : t.charCodeAt(0); } - function xd(t) { - return t.split("\\\\").join(gl).split("\\{").join(_l).split("\\}").join(On).split("\\,").join(xl).split("\\.").join(yl); - } function yd(t) { - return t.split(gl).join("\\").split(_l).join("{").split(On).join("}").split(xl).join(",").split(yl).join("."); + return t.split("\\\\").join(_l).split("\\{").join(xl).split("\\}").join(On).split("\\,").join(yl).split("\\.").join(bl); } - function bl(t) { + function bd(t) { + return t.split(_l).join("\\").split(xl).join("{").split(On).join("}").split(yl).join(",").split(bl).join("."); + } + function wl(t) { if (!t) return [""]; - var e = [], r = vl("{", "}", t); + var e = [], r = gl("{", "}", t); if (!r) return t.split(","); var i = r.pre, n = r.body, s = r.post, o = i.split(","); o[o.length - 1] += "{" + n + "}"; - var a = bl(s); + var a = wl(s); return s.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), e.push.apply(e, o), e; } - function bd(t) { - return t ? (t.substr(0, 2) === "{}" && (t = "\\{\\}" + t.substr(2)), lr(xd(t), true).map(yd)) : []; - } function wd(t) { - return "{" + t + "}"; + return t ? (t.substr(0, 2) === "{}" && (t = "\\{\\}" + t.substr(2)), cr(yd(t), true).map(bd)) : []; } function Ed(t) { + return "{" + t + "}"; + } + function Sd(t) { return /^-?0\d/.test(t); } - function Sd(t, e) { + function kd(t, e) { return t <= e; } - function kd(t, e) { + function Cd(t, e) { return t >= e; } - function lr(t, e) { - var r = [], i = vl("{", "}", t); + function cr(t, e) { + var r = [], i = gl("{", "}", t); if (!i || /\$$/.test(i.pre)) return [t]; var n = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), s = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), o = n || s, a = i.body.indexOf(",") >= 0; if (!o && !a) - return i.post.match(/,.*\}/) ? (t = i.pre + "{" + i.body + On + i.post, lr(t)) : [t]; + return i.post.match(/,.*\}/) ? (t = i.pre + "{" + i.body + On + i.post, cr(t)) : [t]; var l; if (o) l = i.body.split(/\.\./); - else if (l = bl(i.body), l.length === 1 && (l = lr(l[0], false).map(wd), l.length === 1)) { - var u = i.post.length ? lr(i.post, false) : [""]; - return u.map(function(R) { - return i.pre + l[0] + R; + else if (l = wl(i.body), l.length === 1 && (l = cr(l[0], false).map(Ed), l.length === 1)) { + var u = i.post.length ? cr(i.post, false) : [""]; + return u.map(function(B) { + return i.pre + l[0] + B; }); } - var c = i.pre, u = i.post.length ? lr(i.post, false) : [""], f; + var c = i.pre, u = i.post.length ? cr(i.post, false) : [""], f; if (o) { - var h = Cn(l[0]), p = Cn(l[1]), d = Math.max(l[0].length, l[1].length), m = l.length == 3 ? Math.abs(Cn(l[2])) : 1, v = Sd, y = p < h; - y && (m *= -1, v = kd); - var O = l.some(Ed); + var h = Cn(l[0]), p = Cn(l[1]), d = Math.max(l[0].length, l[1].length), m = l.length == 3 ? Math.abs(Cn(l[2])) : 1, v = kd, y = p < h; + y && (m *= -1, v = Cd); + var I = l.some(Sd); f = []; for (var w = h; v(w, p); w += m) { var S; if (s) S = String.fromCharCode(w), S === "\\" && (S = ""); - else if (S = String(w), O) { + else if (S = String(w), I) { var b = d - S.length; if (b > 0) { - var V = new Array(b + 1).join("0"); - w < 0 ? S = "-" + V + S.slice(1) : S = V + S; + var $ = new Array(b + 1).join("0"); + w < 0 ? S = "-" + $ + S.slice(1) : S = $ + S; } } f.push(S); } } else - f = _d(l, function(I) { - return lr(I, false); + f = xd(l, function(T) { + return cr(T, false); }); for (var C = 0; C < f.length; C++) - for (var M = 0; M < u.length; M++) { - var E = c + f[C] + u[M]; + for (var U = 0; U < u.length; U++) { + var E = c + f[C] + u[U]; (!e || o || E) && r.push(E); } return r; } }); - var Dr = x((q_, Il) => { - Il.exports = Ze; - Ze.Minimatch = je; - var Ur = function() { + var jr = x((H_, Tl) => { + Tl.exports = Ye; + Ye.Minimatch = De; + var Dr = function() { try { return require("path"); } catch (e) { } }() || { sep: "/" }; - Ze.sep = Ur.sep; - var An = Ze.GLOBSTAR = je.GLOBSTAR = {}, Cd = El(), Sl = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }, In = "[^/]", Tn = In + "*?", Od = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Id = "(?:(?!(?:\\/|^)\\.).)*?", kl = Td("().*{}+?[]^$\\!"); - function Td(t) { + Ye.sep = Dr.sep; + var An = Ye.GLOBSTAR = De.GLOBSTAR = {}, Od = Sl(), kl = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }, In = "[^/]", Tn = In + "*?", Id = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Td = "(?:(?!(?:\\/|^)\\.).)*?", Cl = Ad("().*{}+?[]^$\\!"); + function Ad(t) { return t.split("").reduce(function(e, r) { return e[r] = true, e; }, {}); } - var Cl = /\/+/; - Ze.filter = Ad; - function Ad(t, e) { + var Ol = /\/+/; + Ye.filter = Rd; + function Rd(t, e) { return e = e || {}, function(r, i, n) { - return Ze(r, t, e); + return Ye(r, t, e); }; } - function gt(t, e) { + function _t(t, e) { e = e || {}; var r = {}; return Object.keys(t).forEach(function(i) { @@ -2660,43 +2674,43 @@ GFS4: `), console.error(t); r[i] = e[i]; }), r; } - Ze.defaults = function(t) { + Ye.defaults = function(t) { if (!t || typeof t != "object" || !Object.keys(t).length) - return Ze; - var e = Ze, r = function(n, s, o) { - return e(n, s, gt(t, o)); + return Ye; + var e = Ye, r = function(n, s, o) { + return e(n, s, _t(t, o)); }; return r.Minimatch = function(n, s) { - return new e.Minimatch(n, gt(t, s)); + return new e.Minimatch(n, _t(t, s)); }, r.Minimatch.defaults = function(n) { - return e.defaults(gt(t, n)).Minimatch; + return e.defaults(_t(t, n)).Minimatch; }, r.filter = function(n, s) { - return e.filter(n, gt(t, s)); + return e.filter(n, _t(t, s)); }, r.defaults = function(n) { - return e.defaults(gt(t, n)); + return e.defaults(_t(t, n)); }, r.makeRe = function(n, s) { - return e.makeRe(n, gt(t, s)); + return e.makeRe(n, _t(t, s)); }, r.braceExpand = function(n, s) { - return e.braceExpand(n, gt(t, s)); + return e.braceExpand(n, _t(t, s)); }, r.match = function(i, n, s) { - return e.match(i, n, gt(t, s)); + return e.match(i, n, _t(t, s)); }, r; }; - je.defaults = function(t) { - return Ze.defaults(t).Minimatch; + De.defaults = function(t) { + return Ye.defaults(t).Minimatch; }; - function Ze(t, e, r) { - return Ii(e), r || (r = {}), !r.nocomment && e.charAt(0) === "#" ? false : new je(e, r).match(t); + function Ye(t, e, r) { + return Ii(e), r || (r = {}), !r.nocomment && e.charAt(0) === "#" ? false : new De(e, r).match(t); } - function je(t, e) { - if (!(this instanceof je)) - return new je(t, e); - Ii(t), e || (e = {}), t = t.trim(), !e.allowWindowsEscape && Ur.sep !== "/" && (t = t.split(Ur.sep).join("/")), this.options = e, this.set = [], this.pattern = t, this.regexp = null, this.negate = false, this.comment = false, this.empty = false, this.partial = !!e.partial, this.make(); + function De(t, e) { + if (!(this instanceof De)) + return new De(t, e); + Ii(t), e || (e = {}), t = t.trim(), !e.allowWindowsEscape && Dr.sep !== "/" && (t = t.split(Dr.sep).join("/")), this.options = e, this.set = [], this.pattern = t, this.regexp = null, this.negate = false, this.comment = false, this.empty = false, this.partial = !!e.partial, this.make(); } - je.prototype.debug = function() { + De.prototype.debug = function() { }; - je.prototype.make = Rd; - function Rd() { + De.prototype.make = Bd; + function Bd() { var t = this.pattern, e = this.options; if (!e.nocomment && t.charAt(0) === "#") { this.comment = true; @@ -2711,15 +2725,15 @@ GFS4: `), console.error(t); e.debug && (this.debug = function() { console.error.apply(console, arguments); }), this.debug(this.pattern, r), r = this.globParts = r.map(function(i) { - return i.split(Cl); + return i.split(Ol); }), this.debug(this.pattern, r), r = r.map(function(i, n, s) { return i.map(this.parse, this); }, this), this.debug(this.pattern, r), r = r.filter(function(i) { return i.indexOf(false) === -1; }), this.debug(this.pattern, r), this.set = r; } - je.prototype.parseNegate = Bd; - function Bd() { + De.prototype.parseNegate = Ld; + function Ld() { var t = this.pattern, e = false, r = this.options, i = 0; if (!r.nonegate) { for (var n = 0, s = t.length; n < s && t.charAt(n) === "!"; n++) @@ -2727,22 +2741,22 @@ GFS4: `), console.error(t); i && (this.pattern = t.substr(i)), this.negate = e; } } - Ze.braceExpand = function(t, e) { - return Ol(t, e); + Ye.braceExpand = function(t, e) { + return Il(t, e); }; - je.prototype.braceExpand = Ol; - function Ol(t, e) { - return e || (this instanceof je ? e = this.options : e = {}), t = typeof t == "undefined" ? this.pattern : t, Ii(t), e.nobrace || !/\{(?:(?!\{).)*\}/.test(t) ? [t] : Cd(t); + De.prototype.braceExpand = Il; + function Il(t, e) { + return e || (this instanceof De ? e = this.options : e = {}), t = typeof t == "undefined" ? this.pattern : t, Ii(t), e.nobrace || !/\{(?:(?!\{).)*\}/.test(t) ? [t] : Od(t); } - var Ld = 1024 * 64, Ii = function(t) { + var Nd = 1024 * 64, Ii = function(t) { if (typeof t != "string") throw new TypeError("invalid pattern"); - if (t.length > Ld) + if (t.length > Nd) throw new TypeError("pattern is too long"); }; - je.prototype.parse = Nd; + De.prototype.parse = Pd; var Oi = {}; - function Nd(t, e) { + function Pd(t, e) { Ii(t); var r = this.options; if (t === "**") @@ -2770,7 +2784,7 @@ GFS4: `), console.error(t); } } for (var m = 0, v = t.length, y; m < v && (y = t.charAt(m)); m++) { - if (this.debug("%s %s %s %j", t, m, i, y), s && kl[y]) { + if (this.debug("%s %s %s %j", t, m, i, y), s && Cl[y]) { i += "\\" + y, s = false; continue; } @@ -2800,7 +2814,7 @@ GFS4: `), console.error(t); i += "\\("; continue; } - o.push({ type: l, start: m - 1, reStart: i.length, open: Sl[l].open, close: Sl[l].close }), i += l === "!" ? "(?:(?!(?:" : "(?:", this.debug("plType %j %j", l, i), l = false; + o.push({ type: l, start: m - 1, reStart: i.length, open: kl[l].open, close: kl[l].close }), i += l === "!" ? "(?:(?!(?:" : "(?:", this.debug("plType %j %j", l, i), l = false; continue; case ")": if (c || !o.length) { @@ -2808,8 +2822,8 @@ GFS4: `), console.error(t); continue; } d(), n = true; - var O = o.pop(); - i += O.close, O.type === "!" && a.push(O), O.reEnd = i.length; + var I = o.pop(); + i += I.close, I.type === "!" && a.push(I), I.reEnd = i.length; continue; case "|": if (c || !o.length || s) { @@ -2841,17 +2855,17 @@ GFS4: `), console.error(t); n = true, c = false, i += y; continue; default: - d(), s ? s = false : kl[y] && !(y === "^" && c) && (i += "\\"), i += y; + d(), s ? s = false : Cl[y] && !(y === "^" && c) && (i += "\\"), i += y; } } - for (c && (w = t.substr(f + 1), S = this.parse(w, Oi), i = i.substr(0, u) + "\\[" + S[0], n = n || S[1]), O = o.pop(); O; O = o.pop()) { - var b = i.slice(O.reStart + O.open.length); - this.debug("setting tail", i, O), b = b.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(Ce, ce, re) { - return re || (re = "\\"), ce + ce + re + "|"; + for (c && (w = t.substr(f + 1), S = this.parse(w, Oi), i = i.substr(0, u) + "\\[" + S[0], n = n || S[1]), I = o.pop(); I; I = o.pop()) { + var b = i.slice(I.reStart + I.open.length); + this.debug("setting tail", i, I), b = b.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(Se, ce, ie) { + return ie || (ie = "\\"), ce + ce + ie + "|"; }), this.debug(`tail=%j - %s`, b, b, O, i); - var V = O.type === "*" ? Tn : O.type === "?" ? In : "\\" + O.type; - n = true, i = i.slice(0, O.reStart) + V + "\\(" + b; + %s`, b, b, I, i); + var $ = I.type === "*" ? Tn : I.type === "?" ? In : "\\" + I.type; + n = true, i = i.slice(0, I.reStart) + $ + "\\(" + b; } d(), s && (i += "\\\\"); var C = false; @@ -2861,22 +2875,22 @@ GFS4: `), console.error(t); case "(": C = true; } - for (var M = a.length - 1; M > -1; M--) { - var E = a[M], I = i.slice(0, E.reStart), R = i.slice(E.reStart, E.reEnd - 8), $ = i.slice(E.reEnd - 8, E.reEnd), B = i.slice(E.reEnd); - $ += B; - var ee = I.split("(").length - 1, A = B; - for (m = 0; m < ee; m++) - A = A.replace(/\)[+*?]?/, ""); - B = A; + for (var U = a.length - 1; U > -1; U--) { + var E = a[U], T = i.slice(0, E.reStart), B = i.slice(E.reStart, E.reEnd - 8), G = i.slice(E.reEnd - 8, E.reEnd), L = i.slice(E.reEnd); + G += L; + var Q = T.split("(").length - 1, R = L; + for (m = 0; m < Q; m++) + R = R.replace(/\)[+*?]?/, ""); + L = R; var F = ""; - B === "" && e !== Oi && (F = "$"); - var D = I + R + B + F + $; - i = D; + L === "" && e !== Oi && (F = "$"); + var j = T + B + L + F + G; + i = j; } if (i !== "" && n && (i = "(?=.)" + i), C && (i = h + i), e === Oi) return [i, n]; if (!n) - return Fd(t); + return Md(t); var z = r.nocase ? "i" : ""; try { var N = new RegExp("^" + i + "$", z); @@ -2885,19 +2899,19 @@ GFS4: `), console.error(t); } return N._glob = t, N._src = i, N; } - Ze.makeRe = function(t, e) { - return new je(t, e || {}).makeRe(); + Ye.makeRe = function(t, e) { + return new De(t, e || {}).makeRe(); }; - je.prototype.makeRe = Pd; - function Pd() { + De.prototype.makeRe = Fd; + function Fd() { if (this.regexp || this.regexp === false) return this.regexp; var t = this.set; if (!t.length) return this.regexp = false, this.regexp; - var e = this.options, r = e.noglobstar ? Tn : e.dot ? Od : Id, i = e.nocase ? "i" : "", n = t.map(function(s) { + var e = this.options, r = e.noglobstar ? Tn : e.dot ? Id : Td, i = e.nocase ? "i" : "", n = t.map(function(s) { return s.map(function(o) { - return o === An ? r : typeof o == "string" ? Md(o) : o._src; + return o === An ? r : typeof o == "string" ? Ud(o) : o._src; }).join("\\/"); }).join("|"); n = "^(?:" + n + ")$", this.negate && (n = "^(?!" + n + ").*$"); @@ -2908,14 +2922,14 @@ GFS4: `), console.error(t); } return this.regexp; } - Ze.match = function(t, e, r) { + Ye.match = function(t, e, r) { r = r || {}; - var i = new je(e, r); + var i = new De(e, r); return t = t.filter(function(n) { return i.match(n); }), i.options.nonull && !t.length && t.push(e), t; }; - je.prototype.match = function(e, r) { + De.prototype.match = function(e, r) { if (typeof r == "undefined" && (r = this.partial), this.debug("match", e, this.pattern), this.comment) return false; if (this.empty) @@ -2923,7 +2937,7 @@ GFS4: `), console.error(t); if (e === "/" && r) return true; var i = this.options; - Ur.sep !== "/" && (e = e.split(Ur.sep).join("/")), e = e.split(Cl), this.debug(this.pattern, "split", e); + Dr.sep !== "/" && (e = e.split(Dr.sep).join("/")), e = e.split(Ol), this.debug(this.pattern, "split", e); var n = this.set; this.debug(this.pattern, "set", n); var s, o; @@ -2938,7 +2952,7 @@ GFS4: `), console.error(t); } return i.flipNegate ? false : this.negate; }; - je.prototype.matchOne = function(t, e, r) { + De.prototype.matchOne = function(t, e, r) { var i = this.options; this.debug("matchOne", { this: this, file: t, pattern: e }), this.debug("matchOne", t.length, e.length); for (var n = 0, s = 0, o = t.length, a = e.length; n < o && s < a; n++, s++) { @@ -2981,19 +2995,19 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return n === o - 1 && t[n] === ""; throw new Error("wtf?"); }; - function Fd(t) { + function Md(t) { return t.replace(/\\(.)/g, "$1"); } - function Md(t) { + function Ud(t) { return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } }); - var Rn = x((H_, Al) => { + var Rn = x((V_, Rl) => { "use strict"; - var Ud = require("util"), Tl = require("stream"), nt = Al.exports = function() { - Tl.call(this), this._buffers = [], this._buffered = 0, this._reads = [], this._paused = false, this._encoding = "utf8", this.writable = true; + var Dd = require("util"), Al = require("stream"), nt = Rl.exports = function() { + Al.call(this), this._buffers = [], this._buffered = 0, this._reads = [], this._paused = false, this._encoding = "utf8", this.writable = true; }; - Ud.inherits(nt, Tl); + Dd.inherits(nt, Al); nt.prototype.read = function(t, e) { this._reads.push({ length: Math.abs(t), allowLess: t < 0, func: e }), process.nextTick(function() { this._process(), this._paused && this._reads && this._reads.length > 0 && (this._paused = false, this.emit("drain")); @@ -3048,11 +3062,11 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) }); var Ln = x((Bn) => { "use strict"; - var _t = [{ x: [0], y: [0] }, { x: [4], y: [0] }, { x: [0, 4], y: [4] }, { x: [2, 6], y: [0, 4] }, { x: [0, 2, 4, 6], y: [2, 6] }, { x: [1, 3, 5, 7], y: [0, 2, 4, 6] }, { x: [0, 1, 2, 3, 4, 5, 6, 7], y: [1, 3, 5, 7] }]; + var xt = [{ x: [0], y: [0] }, { x: [4], y: [0] }, { x: [0, 4], y: [4] }, { x: [2, 6], y: [0, 4] }, { x: [0, 2, 4, 6], y: [2, 6] }, { x: [1, 3, 5, 7], y: [0, 2, 4, 6] }, { x: [0, 1, 2, 3, 4, 5, 6, 7], y: [1, 3, 5, 7] }]; Bn.getImagePasses = function(t, e) { let r = [], i = t % 8, n = e % 8, s = (t - i) / 8, o = (e - n) / 8; - for (let a = 0; a < _t.length; a++) { - let l = _t[a], c = s * l.x.length, u = o * l.y.length; + for (let a = 0; a < xt.length; a++) { + let l = xt[a], c = s * l.x.length, u = o * l.y.length; for (let f = 0; f < l.x.length && l.x[f] < i; f++) c++; for (let f = 0; f < l.y.length && l.y[f] < n; f++) @@ -3063,67 +3077,67 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) }; Bn.getInterlaceIterator = function(t) { return function(e, r, i) { - let n = e % _t[i].x.length, s = (e - n) / _t[i].x.length * 8 + _t[i].x[n], o = r % _t[i].y.length, a = (r - o) / _t[i].y.length * 8 + _t[i].y[o]; + let n = e % xt[i].x.length, s = (e - n) / xt[i].x.length * 8 + xt[i].x[n], o = r % xt[i].y.length, a = (r - o) / xt[i].y.length * 8 + xt[i].y[o]; return s * 4 + a * t * 4; }; }; }); - var Nn = x(($_, Rl) => { + var Nn = x((G_, Bl) => { "use strict"; - Rl.exports = function(e, r, i) { + Bl.exports = function(e, r, i) { let n = e + r - i, s = Math.abs(n - e), o = Math.abs(n - r), a = Math.abs(n - i); return s <= o && s <= a ? e : o <= a ? r : i; }; }); - var Pn = x((G_, Ll) => { + var Pn = x((z_, Nl) => { "use strict"; - var Dd = Ln(), jd = Nn(); - function Bl(t, e, r) { + var jd = Ln(), qd = Nn(); + function Ll(t, e, r) { let i = t * e; return r !== 8 && (i = Math.ceil(i / (8 / r))), i; } - var cr = Ll.exports = function(t, e) { + var ur = Nl.exports = function(t, e) { let r = t.width, i = t.height, n = t.interlace, s = t.bpp, o = t.depth; if (this.read = e.read, this.write = e.write, this.complete = e.complete, this._imageIndex = 0, this._images = [], n) { - let a = Dd.getImagePasses(r, i); + let a = jd.getImagePasses(r, i); for (let l = 0; l < a.length; l++) - this._images.push({ byteWidth: Bl(a[l].width, s, o), height: a[l].height, lineIndex: 0 }); + this._images.push({ byteWidth: Ll(a[l].width, s, o), height: a[l].height, lineIndex: 0 }); } else - this._images.push({ byteWidth: Bl(r, s, o), height: i, lineIndex: 0 }); + this._images.push({ byteWidth: Ll(r, s, o), height: i, lineIndex: 0 }); o === 8 ? this._xComparison = s : o === 16 ? this._xComparison = s * 2 : this._xComparison = 1; }; - cr.prototype.start = function() { + ur.prototype.start = function() { this.read(this._images[this._imageIndex].byteWidth + 1, this._reverseFilterLine.bind(this)); }; - cr.prototype._unFilterType1 = function(t, e, r) { + ur.prototype._unFilterType1 = function(t, e, r) { let i = this._xComparison, n = i - 1; for (let s = 0; s < r; s++) { let o = t[1 + s], a = s > n ? e[s - i] : 0; e[s] = o + a; } }; - cr.prototype._unFilterType2 = function(t, e, r) { + ur.prototype._unFilterType2 = function(t, e, r) { let i = this._lastLine; for (let n = 0; n < r; n++) { let s = t[1 + n], o = i ? i[n] : 0; e[n] = s + o; } }; - cr.prototype._unFilterType3 = function(t, e, r) { + ur.prototype._unFilterType3 = function(t, e, r) { let i = this._xComparison, n = i - 1, s = this._lastLine; for (let o = 0; o < r; o++) { let a = t[1 + o], l = s ? s[o] : 0, c = o > n ? e[o - i] : 0, u = Math.floor((c + l) / 2); e[o] = a + u; } }; - cr.prototype._unFilterType4 = function(t, e, r) { + ur.prototype._unFilterType4 = function(t, e, r) { let i = this._xComparison, n = i - 1, s = this._lastLine; for (let o = 0; o < r; o++) { - let a = t[1 + o], l = s ? s[o] : 0, c = o > n ? e[o - i] : 0, u = o > n && s ? s[o - i] : 0, f = jd(c, l, u); + let a = t[1 + o], l = s ? s[o] : 0, c = o > n ? e[o - i] : 0, u = o > n && s ? s[o - i] : 0, f = qd(c, l, u); e[o] = a + f; } }; - cr.prototype._reverseFilterLine = function(t) { + ur.prototype._reverseFilterLine = function(t) { let e = t[0], r, i = this._images[this._imageIndex], n = i.byteWidth; if (e === 0) r = t.slice(1, n + 1); @@ -3147,24 +3161,24 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) this.write(r), i.lineIndex++, i.lineIndex >= i.height ? (this._lastLine = null, this._imageIndex++, i = this._images[this._imageIndex]) : this._lastLine = r, i ? this.read(i.byteWidth + 1, this._reverseFilterLine.bind(this)) : (this._lastLine = null, this.complete()); }; }); - var Fl = x((z_, Pl) => { + var Ml = x((W_, Fl) => { "use strict"; - var qd = require("util"), Nl = Rn(), Hd = Pn(), Vd = Pl.exports = function(t) { - Nl.call(this); + var Hd = require("util"), Pl = Rn(), Vd = Pn(), $d = Fl.exports = function(t) { + Pl.call(this); let e = [], r = this; - this._filter = new Hd(t, { read: this.read.bind(this), write: function(i) { + this._filter = new Vd(t, { read: this.read.bind(this), write: function(i) { e.push(i); }, complete: function() { r.emit("complete", Buffer.concat(e)); } }), this._filter.start(); }; - qd.inherits(Vd, Nl); + Hd.inherits($d, Pl); }); - var ur = x((W_, Ml) => { + var fr = x((Y_, Ul) => { "use strict"; - Ml.exports = { PNG_SIGNATURE: [137, 80, 78, 71, 13, 10, 26, 10], TYPE_IHDR: 1229472850, TYPE_IEND: 1229278788, TYPE_IDAT: 1229209940, TYPE_PLTE: 1347179589, TYPE_tRNS: 1951551059, TYPE_gAMA: 1732332865, COLORTYPE_GRAYSCALE: 0, COLORTYPE_PALETTE: 1, COLORTYPE_COLOR: 2, COLORTYPE_ALPHA: 4, COLORTYPE_PALETTE_COLOR: 3, COLORTYPE_COLOR_ALPHA: 6, COLORTYPE_TO_BPP_MAP: { 0: 1, 2: 3, 3: 1, 4: 2, 6: 4 }, GAMMA_DIVISION: 1e5 }; + Ul.exports = { PNG_SIGNATURE: [137, 80, 78, 71, 13, 10, 26, 10], TYPE_IHDR: 1229472850, TYPE_IEND: 1229278788, TYPE_IDAT: 1229209940, TYPE_PLTE: 1347179589, TYPE_tRNS: 1951551059, TYPE_gAMA: 1732332865, COLORTYPE_GRAYSCALE: 0, COLORTYPE_PALETTE: 1, COLORTYPE_COLOR: 2, COLORTYPE_ALPHA: 4, COLORTYPE_PALETTE_COLOR: 3, COLORTYPE_COLOR_ALPHA: 6, COLORTYPE_TO_BPP_MAP: { 0: 1, 2: 3, 3: 1, 4: 2, 6: 4 }, GAMMA_DIVISION: 1e5 }; }); - var Un = x((Y_, Ul) => { + var Un = x((K_, Dl) => { "use strict"; var Fn = []; (function() { @@ -3175,7 +3189,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) Fn[t] = e; } })(); - var Mn = Ul.exports = function() { + var Mn = Dl.exports = function() { this._crc = -1; }; Mn.prototype.write = function(t) { @@ -3193,17 +3207,17 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return e ^ -1; }; }); - var Dn = x((K_, Dl) => { + var Dn = x((Z_, jl) => { "use strict"; - var Re = ur(), $d = Un(), Pe = Dl.exports = function(t, e) { - this._options = t, t.checkCRC = t.checkCRC !== false, this._hasIHDR = false, this._hasIEND = false, this._emittedHeadersFinished = false, this._palette = [], this._colorType = 0, this._chunks = {}, this._chunks[Re.TYPE_IHDR] = this._handleIHDR.bind(this), this._chunks[Re.TYPE_IEND] = this._handleIEND.bind(this), this._chunks[Re.TYPE_IDAT] = this._handleIDAT.bind(this), this._chunks[Re.TYPE_PLTE] = this._handlePLTE.bind(this), this._chunks[Re.TYPE_tRNS] = this._handleTRNS.bind(this), this._chunks[Re.TYPE_gAMA] = this._handleGAMA.bind(this), this.read = e.read, this.error = e.error, this.metadata = e.metadata, this.gamma = e.gamma, this.transColor = e.transColor, this.palette = e.palette, this.parsed = e.parsed, this.inflateData = e.inflateData, this.finished = e.finished, this.simpleTransparency = e.simpleTransparency, this.headersFinished = e.headersFinished || function() { + var Ae = fr(), Gd = Un(), Ne = jl.exports = function(t, e) { + this._options = t, t.checkCRC = t.checkCRC !== false, this._hasIHDR = false, this._hasIEND = false, this._emittedHeadersFinished = false, this._palette = [], this._colorType = 0, this._chunks = {}, this._chunks[Ae.TYPE_IHDR] = this._handleIHDR.bind(this), this._chunks[Ae.TYPE_IEND] = this._handleIEND.bind(this), this._chunks[Ae.TYPE_IDAT] = this._handleIDAT.bind(this), this._chunks[Ae.TYPE_PLTE] = this._handlePLTE.bind(this), this._chunks[Ae.TYPE_tRNS] = this._handleTRNS.bind(this), this._chunks[Ae.TYPE_gAMA] = this._handleGAMA.bind(this), this.read = e.read, this.error = e.error, this.metadata = e.metadata, this.gamma = e.gamma, this.transColor = e.transColor, this.palette = e.palette, this.parsed = e.parsed, this.inflateData = e.inflateData, this.finished = e.finished, this.simpleTransparency = e.simpleTransparency, this.headersFinished = e.headersFinished || function() { }; }; - Pe.prototype.start = function() { - this.read(Re.PNG_SIGNATURE.length, this._parseSignature.bind(this)); + Ne.prototype.start = function() { + this.read(Ae.PNG_SIGNATURE.length, this._parseSignature.bind(this)); }; - Pe.prototype._parseSignature = function(t) { - let e = Re.PNG_SIGNATURE; + Ne.prototype._parseSignature = function(t) { + let e = Ae.PNG_SIGNATURE; for (let r = 0; r < e.length; r++) if (t[r] !== e[r]) { this.error(new Error("Invalid file signature")); @@ -3211,16 +3225,16 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } this.read(8, this._parseChunkBegin.bind(this)); }; - Pe.prototype._parseChunkBegin = function(t) { + Ne.prototype._parseChunkBegin = function(t) { let e = t.readUInt32BE(0), r = t.readUInt32BE(4), i = ""; for (let s = 4; s < 8; s++) i += String.fromCharCode(t[s]); let n = Boolean(t[4] & 32); - if (!this._hasIHDR && r !== Re.TYPE_IHDR) { + if (!this._hasIHDR && r !== Ae.TYPE_IHDR) { this.error(new Error("Expected IHDR on beggining")); return; } - if (this._crc = new $d(), this._crc.write(Buffer.from(i)), this._chunks[r]) + if (this._crc = new Gd(), this._crc.write(Buffer.from(i)), this._chunks[r]) return this._chunks[r](e); if (!n) { this.error(new Error("Unsupported critical chunk type " + i)); @@ -3228,13 +3242,13 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } this.read(e + 4, this._skipChunk.bind(this)); }; - Pe.prototype._skipChunk = function() { + Ne.prototype._skipChunk = function() { this.read(8, this._parseChunkBegin.bind(this)); }; - Pe.prototype._handleChunkEnd = function() { + Ne.prototype._handleChunkEnd = function() { this.read(4, this._parseChunkEnd.bind(this)); }; - Pe.prototype._parseChunkEnd = function(t) { + Ne.prototype._parseChunkEnd = function(t) { let e = t.readInt32BE(0), r = this._crc.crc32(); if (this._options.checkCRC && r !== e) { this.error(new Error("Crc error - " + e + " - " + r)); @@ -3242,17 +3256,17 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } this._hasIEND || this.read(8, this._parseChunkBegin.bind(this)); }; - Pe.prototype._handleIHDR = function(t) { + Ne.prototype._handleIHDR = function(t) { this.read(t, this._parseIHDR.bind(this)); }; - Pe.prototype._parseIHDR = function(t) { + Ne.prototype._parseIHDR = function(t) { this._crc.write(t); let e = t.readUInt32BE(0), r = t.readUInt32BE(4), i = t[8], n = t[9], s = t[10], o = t[11], a = t[12]; if (i !== 8 && i !== 4 && i !== 2 && i !== 1 && i !== 16) { this.error(new Error("Unsupported bit depth " + i)); return; } - if (!(n in Re.COLORTYPE_TO_BPP_MAP)) { + if (!(n in Ae.COLORTYPE_TO_BPP_MAP)) { this.error(new Error("Unsupported color type")); return; } @@ -3269,24 +3283,24 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return; } this._colorType = n; - let l = Re.COLORTYPE_TO_BPP_MAP[this._colorType]; - this._hasIHDR = true, this.metadata({ width: e, height: r, depth: i, interlace: Boolean(a), palette: Boolean(n & Re.COLORTYPE_PALETTE), color: Boolean(n & Re.COLORTYPE_COLOR), alpha: Boolean(n & Re.COLORTYPE_ALPHA), bpp: l, colorType: n }), this._handleChunkEnd(); + let l = Ae.COLORTYPE_TO_BPP_MAP[this._colorType]; + this._hasIHDR = true, this.metadata({ width: e, height: r, depth: i, interlace: Boolean(a), palette: Boolean(n & Ae.COLORTYPE_PALETTE), color: Boolean(n & Ae.COLORTYPE_COLOR), alpha: Boolean(n & Ae.COLORTYPE_ALPHA), bpp: l, colorType: n }), this._handleChunkEnd(); }; - Pe.prototype._handlePLTE = function(t) { + Ne.prototype._handlePLTE = function(t) { this.read(t, this._parsePLTE.bind(this)); }; - Pe.prototype._parsePLTE = function(t) { + Ne.prototype._parsePLTE = function(t) { this._crc.write(t); let e = Math.floor(t.length / 3); for (let r = 0; r < e; r++) this._palette.push([t[r * 3], t[r * 3 + 1], t[r * 3 + 2], 255]); this.palette(this._palette), this._handleChunkEnd(); }; - Pe.prototype._handleTRNS = function(t) { + Ne.prototype._handleTRNS = function(t) { this.simpleTransparency(), this.read(t, this._parseTRNS.bind(this)); }; - Pe.prototype._parseTRNS = function(t) { - if (this._crc.write(t), this._colorType === Re.COLORTYPE_PALETTE_COLOR) { + Ne.prototype._parseTRNS = function(t) { + if (this._crc.write(t), this._colorType === Ae.COLORTYPE_PALETTE_COLOR) { if (this._palette.length === 0) { this.error(new Error("Transparency chunk must be after palette")); return; @@ -3299,34 +3313,34 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) this._palette[e][3] = t[e]; this.palette(this._palette); } - this._colorType === Re.COLORTYPE_GRAYSCALE && this.transColor([t.readUInt16BE(0)]), this._colorType === Re.COLORTYPE_COLOR && this.transColor([t.readUInt16BE(0), t.readUInt16BE(2), t.readUInt16BE(4)]), this._handleChunkEnd(); + this._colorType === Ae.COLORTYPE_GRAYSCALE && this.transColor([t.readUInt16BE(0)]), this._colorType === Ae.COLORTYPE_COLOR && this.transColor([t.readUInt16BE(0), t.readUInt16BE(2), t.readUInt16BE(4)]), this._handleChunkEnd(); }; - Pe.prototype._handleGAMA = function(t) { + Ne.prototype._handleGAMA = function(t) { this.read(t, this._parseGAMA.bind(this)); }; - Pe.prototype._parseGAMA = function(t) { - this._crc.write(t), this.gamma(t.readUInt32BE(0) / Re.GAMMA_DIVISION), this._handleChunkEnd(); + Ne.prototype._parseGAMA = function(t) { + this._crc.write(t), this.gamma(t.readUInt32BE(0) / Ae.GAMMA_DIVISION), this._handleChunkEnd(); }; - Pe.prototype._handleIDAT = function(t) { + Ne.prototype._handleIDAT = function(t) { this._emittedHeadersFinished || (this._emittedHeadersFinished = true, this.headersFinished()), this.read(-t, this._parseIDAT.bind(this, t)); }; - Pe.prototype._parseIDAT = function(t, e) { - if (this._crc.write(e), this._colorType === Re.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) + Ne.prototype._parseIDAT = function(t, e) { + if (this._crc.write(e), this._colorType === Ae.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) throw new Error("Expected palette not found"); this.inflateData(e); let r = t - e.length; r > 0 ? this._handleIDAT(r) : this._handleChunkEnd(); }; - Pe.prototype._handleIEND = function(t) { + Ne.prototype._handleIEND = function(t) { this.read(t, this._parseIEND.bind(this)); }; - Pe.prototype._parseIEND = function(t) { + Ne.prototype._parseIEND = function(t) { this._crc.write(t), this._hasIEND = true, this._handleChunkEnd(), this.finished && this.finished(); }; }); - var jn = x((ql) => { + var jn = x((Hl) => { "use strict"; - var jl = Ln(), Gd = [function() { + var ql = Ln(), zd = [function() { }, function(t, e, r, i) { if (i === e.length) throw new Error("Ran out of data"); @@ -3345,7 +3359,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) if (i + 3 >= e.length) throw new Error("Ran out of data"); t[r] = e[i], t[r + 1] = e[i + 1], t[r + 2] = e[i + 2], t[r + 3] = e[i + 3]; - }], zd = [function() { + }], Wd = [function() { }, function(t, e, r, i) { let n = e[0]; t[r] = n, t[r + 1] = n, t[r + 2] = n, t[r + 3] = i; @@ -3357,7 +3371,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) }, function(t, e, r) { t[r] = e[0], t[r + 1] = e[1], t[r + 2] = e[2], t[r + 3] = e[3]; }]; - function Wd(t, e) { + function Yd(t, e) { let r = [], i = 0; function n() { if (i === t.length) @@ -3394,33 +3408,33 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) throw new Error("extra data found"); } }; } - function Yd(t, e, r, i, n, s) { + function Kd(t, e, r, i, n, s) { let o = t.width, a = t.height, l = t.index; for (let c = 0; c < a; c++) for (let u = 0; u < o; u++) { let f = r(u, c, l); - Gd[i](e, n, f, s), s += i; + zd[i](e, n, f, s), s += i; } return s; } - function Kd(t, e, r, i, n, s) { + function Zd(t, e, r, i, n, s) { let o = t.width, a = t.height, l = t.index; for (let c = 0; c < a; c++) { for (let u = 0; u < o; u++) { let f = n.get(i), h = r(u, c, l); - zd[i](e, f, h, s); + Wd[i](e, f, h, s); } n.resetAfterLine(); } } - ql.dataToBitMap = function(t, e) { + Hl.dataToBitMap = function(t, e) { let r = e.width, i = e.height, n = e.depth, s = e.bpp, o = e.interlace, a; - n !== 8 && (a = Wd(t, n)); + n !== 8 && (a = Yd(t, n)); let l; n <= 8 ? l = Buffer.alloc(r * i * 4) : l = new Uint16Array(r * i * 4); let c = Math.pow(2, n) - 1, u = 0, f, h; if (o) - f = jl.getImagePasses(r, i), h = jl.getInterlaceIterator(r, i); + f = ql.getImagePasses(r, i), h = ql.getInterlaceIterator(r, i); else { let p = 0; h = function() { @@ -3429,7 +3443,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) }, f = [{ width: r, height: i }]; } for (let p = 0; p < f.length; p++) - n === 8 ? u = Yd(f[p], l, h, s, t, u) : Kd(f[p], l, h, s, a, c); + n === 8 ? u = Kd(f[p], l, h, s, t, u) : Zd(f[p], l, h, s, a, c); if (n === 8) { if (u !== t.length) throw new Error("extra data found"); @@ -3438,9 +3452,9 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return l; }; }); - var qn = x((X_, Hl) => { + var qn = x((Q_, Vl) => { "use strict"; - function Zd(t, e, r, i, n) { + function Xd(t, e, r, i, n) { let s = 0; for (let o = 0; o < i; o++) for (let a = 0; a < r; a++) { @@ -3452,7 +3466,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) s += 4; } } - function Xd(t, e, r, i, n) { + function Qd(t, e, r, i, n) { let s = 0; for (let o = 0; o < i; o++) for (let a = 0; a < r; a++) { @@ -3463,7 +3477,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) s += 4; } } - function Qd(t, e, r, i, n) { + function Jd(t, e, r, i, n) { let s = 255, o = Math.pow(2, n) - 1, a = 0; for (let l = 0; l < i; l++) for (let c = 0; c < r; c++) { @@ -3472,22 +3486,22 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) a += 4; } } - Hl.exports = function(t, e, r = false) { + Vl.exports = function(t, e, r = false) { let i = e.depth, n = e.width, s = e.height, o = e.colorType, a = e.transColor, l = e.palette, c = t; - return o === 3 ? Zd(t, c, n, s, l) : (a && Xd(t, c, n, s, a), i !== 8 && !r && (i === 16 && (c = Buffer.alloc(n * s * 4)), Qd(t, c, n, s, i))), c; + return o === 3 ? Xd(t, c, n, s, l) : (a && Qd(t, c, n, s, a), i !== 8 && !r && (i === 16 && (c = Buffer.alloc(n * s * 4)), Jd(t, c, n, s, i))), c; }; }); - var Gl = x((Q_, $l) => { + var zl = x((J_, Gl) => { "use strict"; - var Jd = require("util"), Hn = require("zlib"), Vl = Rn(), em = Fl(), tm = Dn(), rm = jn(), im = qn(), at = $l.exports = function(t) { - Vl.call(this), this._parser = new tm(t, { read: this.read.bind(this), error: this._handleError.bind(this), metadata: this._handleMetaData.bind(this), gamma: this.emit.bind(this, "gamma"), palette: this._handlePalette.bind(this), transColor: this._handleTransColor.bind(this), finished: this._finished.bind(this), inflateData: this._inflateData.bind(this), simpleTransparency: this._simpleTransparency.bind(this), headersFinished: this._headersFinished.bind(this) }), this._options = t, this.writable = true, this._parser.start(); + var em = require("util"), Hn = require("zlib"), $l = Rn(), tm = Ml(), rm = Dn(), im = jn(), nm = qn(), lt = Gl.exports = function(t) { + $l.call(this), this._parser = new rm(t, { read: this.read.bind(this), error: this._handleError.bind(this), metadata: this._handleMetaData.bind(this), gamma: this.emit.bind(this, "gamma"), palette: this._handlePalette.bind(this), transColor: this._handleTransColor.bind(this), finished: this._finished.bind(this), inflateData: this._inflateData.bind(this), simpleTransparency: this._simpleTransparency.bind(this), headersFinished: this._headersFinished.bind(this) }), this._options = t, this.writable = true, this._parser.start(); }; - Jd.inherits(at, Vl); - at.prototype._handleError = function(t) { + em.inherits(lt, $l); + lt.prototype._handleError = function(t) { this.emit("error", t), this.writable = false, this.destroy(), this._inflate && this._inflate.destroy && this._inflate.destroy(), this._filter && (this._filter.destroy(), this._filter.on("error", function() { })), this.errord = true; }; - at.prototype._inflateData = function(t) { + lt.prototype._inflateData = function(t) { if (!this._inflate) if (this._bitmapInfo.interlace) this._inflate = Hn.createInflate(), this._inflate.on("error", this.emit.bind(this, "error")), this._filter.on("complete", this._complete.bind(this)), this._inflate.pipe(this._filter); @@ -3505,31 +3519,31 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } this._inflate.write(t); }; - at.prototype._handleMetaData = function(t) { - this._metaData = t, this._bitmapInfo = Object.create(t), this._filter = new em(this._bitmapInfo); + lt.prototype._handleMetaData = function(t) { + this._metaData = t, this._bitmapInfo = Object.create(t), this._filter = new tm(this._bitmapInfo); }; - at.prototype._handleTransColor = function(t) { + lt.prototype._handleTransColor = function(t) { this._bitmapInfo.transColor = t; }; - at.prototype._handlePalette = function(t) { + lt.prototype._handlePalette = function(t) { this._bitmapInfo.palette = t; }; - at.prototype._simpleTransparency = function() { + lt.prototype._simpleTransparency = function() { this._metaData.alpha = true; }; - at.prototype._headersFinished = function() { + lt.prototype._headersFinished = function() { this.emit("metadata", this._metaData); }; - at.prototype._finished = function() { + lt.prototype._finished = function() { this.errord || (this._inflate ? this._inflate.end() : this.emit("error", "No Inflate block")); }; - at.prototype._complete = function(t) { + lt.prototype._complete = function(t) { if (this.errord) return; let e; try { - let r = rm.dataToBitMap(t, this._bitmapInfo); - e = im(r, this._bitmapInfo, this._options.skipRescale), r = null; + let r = im.dataToBitMap(t, this._bitmapInfo); + e = nm(r, this._bitmapInfo, this._options.skipRescale), r = null; } catch (r) { this._handleError(r); return; @@ -3537,10 +3551,10 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) this.emit("parsed", e); }; }); - var Wl = x((J_, zl) => { + var Yl = x((ex, Wl) => { "use strict"; - var Je = ur(); - zl.exports = function(t, e, r, i) { + var Je = fr(); + Wl.exports = function(t, e, r, i) { let n = [Je.COLORTYPE_COLOR_ALPHA, Je.COLORTYPE_ALPHA].indexOf(i.colorType) !== -1; if (i.colorType === i.inputColorType) { let d = function() { @@ -3598,26 +3612,26 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return c; }; }); - var Zl = x((ex, Kl) => { + var Xl = x((tx, Zl) => { "use strict"; - var Yl = Nn(); - function nm(t, e, r, i, n) { + var Kl = Nn(); + function sm(t, e, r, i, n) { for (let s = 0; s < r; s++) i[n + s] = t[e + s]; } - function sm(t, e, r) { + function om(t, e, r) { let i = 0, n = e + r; for (let s = e; s < n; s++) i += Math.abs(t[s]); return i; } - function om(t, e, r, i, n, s) { + function am(t, e, r, i, n, s) { for (let o = 0; o < r; o++) { let a = o >= s ? t[e + o - s] : 0, l = t[e + o] - a; i[n + o] = l; } } - function am(t, e, r, i) { + function lm(t, e, r, i) { let n = 0; for (let s = 0; s < r; s++) { let o = s >= i ? t[e + s - i] : 0, a = t[e + s] - o; @@ -3625,13 +3639,13 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } return n; } - function lm(t, e, r, i, n) { + function cm(t, e, r, i, n) { for (let s = 0; s < r; s++) { let o = e > 0 ? t[e + s - r] : 0, a = t[e + s] - o; i[n + s] = a; } } - function cm(t, e, r) { + function um(t, e, r) { let i = 0, n = e + r; for (let s = e; s < n; s++) { let o = e > 0 ? t[s - r] : 0, a = t[s] - o; @@ -3639,13 +3653,13 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } return i; } - function um(t, e, r, i, n, s) { + function fm(t, e, r, i, n, s) { for (let o = 0; o < r; o++) { let a = o >= s ? t[e + o - s] : 0, l = e > 0 ? t[e + o - r] : 0, c = t[e + o] - (a + l >> 1); i[n + o] = c; } } - function fm(t, e, r, i) { + function hm(t, e, r, i) { let n = 0; for (let s = 0; s < r; s++) { let o = s >= i ? t[e + s - i] : 0, a = e > 0 ? t[e + s - r] : 0, l = t[e + s] - (o + a >> 1); @@ -3653,22 +3667,22 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } return n; } - function hm(t, e, r, i, n, s) { + function pm(t, e, r, i, n, s) { for (let o = 0; o < r; o++) { - let a = o >= s ? t[e + o - s] : 0, l = e > 0 ? t[e + o - r] : 0, c = e > 0 && o >= s ? t[e + o - (r + s)] : 0, u = t[e + o] - Yl(a, l, c); + let a = o >= s ? t[e + o - s] : 0, l = e > 0 ? t[e + o - r] : 0, c = e > 0 && o >= s ? t[e + o - (r + s)] : 0, u = t[e + o] - Kl(a, l, c); i[n + o] = u; } } - function pm(t, e, r, i) { + function dm(t, e, r, i) { let n = 0; for (let s = 0; s < r; s++) { - let o = s >= i ? t[e + s - i] : 0, a = e > 0 ? t[e + s - r] : 0, l = e > 0 && s >= i ? t[e + s - (r + i)] : 0, c = t[e + s] - Yl(o, a, l); + let o = s >= i ? t[e + s - i] : 0, a = e > 0 ? t[e + s - r] : 0, l = e > 0 && s >= i ? t[e + s - (r + i)] : 0, c = t[e + s] - Kl(o, a, l); n += Math.abs(c); } return n; } - var dm = { 0: nm, 1: om, 2: lm, 3: um, 4: hm }, mm = { 0: sm, 1: am, 2: cm, 3: fm, 4: pm }; - Kl.exports = function(t, e, r, i, n) { + var mm = { 0: sm, 1: am, 2: cm, 3: fm, 4: pm }, vm = { 0: om, 1: lm, 2: um, 3: hm, 4: dm }; + Zl.exports = function(t, e, r, i, n) { let s; if (!("filterType" in i) || i.filterType === -1) s = [0, 1, 2, 3, 4]; @@ -3682,64 +3696,64 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) if (s.length > 1) { let h = 1 / 0; for (let p = 0; p < s.length; p++) { - let d = mm[s[p]](t, l, o, n); + let d = vm[s[p]](t, l, o, n); d < h && (u = s[p], h = d); } } - c[a] = u, a++, dm[u](t, l, o, c, a, n), a += o, l += o; + c[a] = u, a++, mm[u](t, l, o, c, a, n), a += o, l += o; } return c; }; }); - var Vn = x((tx, Xl) => { + var Vn = x((rx, Ql) => { "use strict"; - var He = ur(), vm = Un(), gm = Wl(), _m = Zl(), xm = require("zlib"), xt = Xl.exports = function(t) { - if (this._options = t, t.deflateChunkSize = t.deflateChunkSize || 32 * 1024, t.deflateLevel = t.deflateLevel != null ? t.deflateLevel : 9, t.deflateStrategy = t.deflateStrategy != null ? t.deflateStrategy : 3, t.inputHasAlpha = t.inputHasAlpha != null ? t.inputHasAlpha : true, t.deflateFactory = t.deflateFactory || xm.createDeflate, t.bitDepth = t.bitDepth || 8, t.colorType = typeof t.colorType == "number" ? t.colorType : He.COLORTYPE_COLOR_ALPHA, t.inputColorType = typeof t.inputColorType == "number" ? t.inputColorType : He.COLORTYPE_COLOR_ALPHA, [He.COLORTYPE_GRAYSCALE, He.COLORTYPE_COLOR, He.COLORTYPE_COLOR_ALPHA, He.COLORTYPE_ALPHA].indexOf(t.colorType) === -1) + var qe = fr(), gm = Un(), _m = Yl(), xm = Xl(), ym = require("zlib"), yt = Ql.exports = function(t) { + if (this._options = t, t.deflateChunkSize = t.deflateChunkSize || 32 * 1024, t.deflateLevel = t.deflateLevel != null ? t.deflateLevel : 9, t.deflateStrategy = t.deflateStrategy != null ? t.deflateStrategy : 3, t.inputHasAlpha = t.inputHasAlpha != null ? t.inputHasAlpha : true, t.deflateFactory = t.deflateFactory || ym.createDeflate, t.bitDepth = t.bitDepth || 8, t.colorType = typeof t.colorType == "number" ? t.colorType : qe.COLORTYPE_COLOR_ALPHA, t.inputColorType = typeof t.inputColorType == "number" ? t.inputColorType : qe.COLORTYPE_COLOR_ALPHA, [qe.COLORTYPE_GRAYSCALE, qe.COLORTYPE_COLOR, qe.COLORTYPE_COLOR_ALPHA, qe.COLORTYPE_ALPHA].indexOf(t.colorType) === -1) throw new Error("option color type:" + t.colorType + " is not supported at present"); - if ([He.COLORTYPE_GRAYSCALE, He.COLORTYPE_COLOR, He.COLORTYPE_COLOR_ALPHA, He.COLORTYPE_ALPHA].indexOf(t.inputColorType) === -1) + if ([qe.COLORTYPE_GRAYSCALE, qe.COLORTYPE_COLOR, qe.COLORTYPE_COLOR_ALPHA, qe.COLORTYPE_ALPHA].indexOf(t.inputColorType) === -1) throw new Error("option input color type:" + t.inputColorType + " is not supported at present"); if (t.bitDepth !== 8 && t.bitDepth !== 16) throw new Error("option bit depth:" + t.bitDepth + " is not supported at present"); }; - xt.prototype.getDeflateOptions = function() { + yt.prototype.getDeflateOptions = function() { return { chunkSize: this._options.deflateChunkSize, level: this._options.deflateLevel, strategy: this._options.deflateStrategy }; }; - xt.prototype.createDeflate = function() { + yt.prototype.createDeflate = function() { return this._options.deflateFactory(this.getDeflateOptions()); }; - xt.prototype.filterData = function(t, e, r) { - let i = gm(t, e, r, this._options), n = He.COLORTYPE_TO_BPP_MAP[this._options.colorType]; - return _m(i, e, r, this._options, n); + yt.prototype.filterData = function(t, e, r) { + let i = _m(t, e, r, this._options), n = qe.COLORTYPE_TO_BPP_MAP[this._options.colorType]; + return xm(i, e, r, this._options, n); }; - xt.prototype._packChunk = function(t, e) { + yt.prototype._packChunk = function(t, e) { let r = e ? e.length : 0, i = Buffer.alloc(r + 12); - return i.writeUInt32BE(r, 0), i.writeUInt32BE(t, 4), e && e.copy(i, 8), i.writeInt32BE(vm.crc32(i.slice(4, i.length - 4)), i.length - 4), i; + return i.writeUInt32BE(r, 0), i.writeUInt32BE(t, 4), e && e.copy(i, 8), i.writeInt32BE(gm.crc32(i.slice(4, i.length - 4)), i.length - 4), i; }; - xt.prototype.packGAMA = function(t) { + yt.prototype.packGAMA = function(t) { let e = Buffer.alloc(4); - return e.writeUInt32BE(Math.floor(t * He.GAMMA_DIVISION), 0), this._packChunk(He.TYPE_gAMA, e); + return e.writeUInt32BE(Math.floor(t * qe.GAMMA_DIVISION), 0), this._packChunk(qe.TYPE_gAMA, e); }; - xt.prototype.packIHDR = function(t, e) { + yt.prototype.packIHDR = function(t, e) { let r = Buffer.alloc(13); - return r.writeUInt32BE(t, 0), r.writeUInt32BE(e, 4), r[8] = this._options.bitDepth, r[9] = this._options.colorType, r[10] = 0, r[11] = 0, r[12] = 0, this._packChunk(He.TYPE_IHDR, r); + return r.writeUInt32BE(t, 0), r.writeUInt32BE(e, 4), r[8] = this._options.bitDepth, r[9] = this._options.colorType, r[10] = 0, r[11] = 0, r[12] = 0, this._packChunk(qe.TYPE_IHDR, r); }; - xt.prototype.packIDAT = function(t) { - return this._packChunk(He.TYPE_IDAT, t); + yt.prototype.packIDAT = function(t) { + return this._packChunk(qe.TYPE_IDAT, t); }; - xt.prototype.packIEND = function() { - return this._packChunk(He.TYPE_IEND, null); + yt.prototype.packIEND = function() { + return this._packChunk(qe.TYPE_IEND, null); }; }); - var tc = x((rx, ec) => { + var rc = x((ix, tc) => { "use strict"; - var ym = require("util"), Ql = require("stream"), bm = ur(), wm = Vn(), Jl = ec.exports = function(t) { - Ql.call(this); + var bm = require("util"), Jl = require("stream"), wm = fr(), Em = Vn(), ec = tc.exports = function(t) { + Jl.call(this); let e = t || {}; - this._packer = new wm(e), this._deflate = this._packer.createDeflate(), this.readable = true; + this._packer = new Em(e), this._deflate = this._packer.createDeflate(), this.readable = true; }; - ym.inherits(Jl, Ql); - Jl.prototype.pack = function(t, e, r, i) { - this.emit("data", Buffer.from(bm.PNG_SIGNATURE)), this.emit("data", this._packer.packIHDR(e, r)), i && this.emit("data", this._packer.packGAMA(i)); + bm.inherits(ec, Jl); + ec.prototype.pack = function(t, e, r, i) { + this.emit("data", Buffer.from(wm.PNG_SIGNATURE)), this.emit("data", this._packer.packIHDR(e, r)), i && this.emit("data", this._packer.packGAMA(i)); let n = this._packer.filterData(t, e, r); this._deflate.on("error", this.emit.bind(this, "error")), this._deflate.on("data", function(s) { this.emit("data", this._packer.packIDAT(s)); @@ -3748,23 +3762,23 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) }.bind(this)), this._deflate.end(n); }; }); - var ac = x((jr, oc) => { + var lc = x((qr, ac) => { "use strict"; - var rc = require("assert").ok, fr = require("zlib"), Em = require("util"), ic = require("buffer").kMaxLength; + var ic = require("assert").ok, hr = require("zlib"), Sm = require("util"), nc = require("buffer").kMaxLength; function Ut(t) { if (!(this instanceof Ut)) return new Ut(t); - t && t.chunkSize < fr.Z_MIN_CHUNK && (t.chunkSize = fr.Z_MIN_CHUNK), fr.Inflate.call(this, t), this._offset = this._offset === void 0 ? this._outOffset : this._offset, this._buffer = this._buffer || this._outBuffer, t && t.maxLength != null && (this._maxLength = t.maxLength); + t && t.chunkSize < hr.Z_MIN_CHUNK && (t.chunkSize = hr.Z_MIN_CHUNK), hr.Inflate.call(this, t), this._offset = this._offset === void 0 ? this._outOffset : this._offset, this._buffer = this._buffer || this._outBuffer, t && t.maxLength != null && (this._maxLength = t.maxLength); } - function Sm(t) { + function km(t) { return new Ut(t); } - function nc(t, e) { + function sc(t, e) { e && process.nextTick(e), t._handle && (t._handle.close(), t._handle = null); } Ut.prototype._processChunk = function(t, e, r) { if (typeof r == "function") - return fr.Inflate._processChunk.call(this, t, e, r); + return hr.Inflate._processChunk.call(this, t, e, r); let i = this, n = t && t.length, s = this._chunkSize - this._offset, o = this._maxLength, a = 0, l = [], c = 0, u; this.on("error", function(d) { u = d; @@ -3773,49 +3787,49 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) if (i._hadError) return; let v = s - m; - if (rc(v >= 0, "have should not go down"), v > 0) { + if (ic(v >= 0, "have should not go down"), v > 0) { let y = i._buffer.slice(i._offset, i._offset + v); if (i._offset += v, y.length > o && (y = y.slice(0, o)), l.push(y), c += y.length, o -= y.length, o === 0) return false; } return (m === 0 || i._offset >= i._chunkSize) && (s = i._chunkSize, i._offset = 0, i._buffer = Buffer.allocUnsafe(i._chunkSize)), m === 0 ? (a += n - d, n = d, true) : false; } - rc(this._handle, "zlib binding closed"); + ic(this._handle, "zlib binding closed"); let h; do h = this._handle.writeSync(e, t, a, n, this._buffer, this._offset, s), h = h || this._writeState; while (!this._hadError && f(h[0], h[1])); if (this._hadError) throw u; - if (c >= ic) - throw nc(this), new RangeError("Cannot create final Buffer. It would be larger than 0x" + ic.toString(16) + " bytes"); + if (c >= nc) + throw sc(this), new RangeError("Cannot create final Buffer. It would be larger than 0x" + nc.toString(16) + " bytes"); let p = Buffer.concat(l, c); - return nc(this), p; + return sc(this), p; }; - Em.inherits(Ut, fr.Inflate); - function km(t, e) { + Sm.inherits(Ut, hr.Inflate); + function Cm(t, e) { if (typeof e == "string" && (e = Buffer.from(e)), !(e instanceof Buffer)) throw new TypeError("Not a string or buffer"); let r = t._finishFlushFlag; - return r == null && (r = fr.Z_FINISH), t._processChunk(e, r); + return r == null && (r = hr.Z_FINISH), t._processChunk(e, r); } - function sc(t, e) { - return km(new Ut(e), t); + function oc(t, e) { + return Cm(new Ut(e), t); } - oc.exports = jr = sc; - jr.Inflate = Ut; - jr.createInflate = Sm; - jr.inflateSync = sc; + ac.exports = qr = oc; + qr.Inflate = Ut; + qr.createInflate = km; + qr.inflateSync = oc; }); - var $n = x((ix, cc) => { + var $n = x((nx, uc) => { "use strict"; - var lc = cc.exports = function(t) { + var cc = uc.exports = function(t) { this._buffer = t, this._reads = []; }; - lc.prototype.read = function(t, e) { + cc.prototype.read = function(t, e) { this._reads.push({ length: Math.abs(t), allowLess: t < 0, func: e }); }; - lc.prototype.process = function() { + cc.prototype.process = function() { for (; this._reads.length > 0 && this._buffer.length; ) { let t = this._reads[0]; if (this._buffer.length && (this._buffer.length >= t.length || t.allowLess)) { @@ -3831,24 +3845,24 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) throw new Error("unrecognised content at end of stream"); }; }); - var fc = x((uc) => { + var hc = x((fc) => { "use strict"; - var Cm = $n(), Om = Pn(); - uc.process = function(t, e) { - let r = [], i = new Cm(t); - return new Om(e, { read: i.read.bind(i), write: function(s) { + var Om = $n(), Im = Pn(); + fc.process = function(t, e) { + let r = [], i = new Om(t); + return new Im(e, { read: i.read.bind(i), write: function(s) { r.push(s); }, complete: function() { } }).start(), i.process(), Buffer.concat(r); }; }); - var mc = x((sx, dc) => { + var vc = x((ox, mc) => { "use strict"; - var hc = true, pc = require("zlib"), Im = ac(); - pc.deflateSync || (hc = false); - var Tm = $n(), Am = fc(), Rm = Dn(), Bm = jn(), Lm = qn(); - dc.exports = function(t, e) { - if (!hc) + var pc = true, dc = require("zlib"), Tm = lc(); + dc.deflateSync || (pc = false); + var Am = $n(), Rm = hc(), Bm = Dn(), Lm = jn(), Nm = qn(); + mc.exports = function(t, e) { + if (!pc) throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"); let r; function i(S) { @@ -3875,69 +3889,69 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) function h(S) { f.push(S); } - let p = new Tm(t); - if (new Rm(e, { read: p.read.bind(p), error: i, metadata: s, gamma: u, palette: a, transColor: o, inflateData: h, simpleTransparency: l }).start(), p.process(), r) + let p = new Am(t); + if (new Bm(e, { read: p.read.bind(p), error: i, metadata: s, gamma: u, palette: a, transColor: o, inflateData: h, simpleTransparency: l }).start(), p.process(), r) throw r; let m = Buffer.concat(f); f.length = 0; let v; if (n.interlace) - v = pc.inflateSync(m); + v = dc.inflateSync(m); else { let b = ((n.width * n.bpp * n.depth + 7 >> 3) + 1) * n.height; - v = Im(m, { chunkSize: b, maxLength: b }); + v = Tm(m, { chunkSize: b, maxLength: b }); } if (m = null, !v || !v.length) throw new Error("bad png - invalid inflate data response"); - let y = Am.process(v, n); + let y = Rm.process(v, n); m = null; - let O = Bm.dataToBitMap(y, n); + let I = Lm.dataToBitMap(y, n); y = null; - let w = Lm(O, n, e.skipRescale); + let w = Nm(I, n, e.skipRescale); return n.data = w, n.gamma = c || 0, n; }; }); - var xc = x((ox, _c) => { + var yc = x((ax, xc) => { "use strict"; - var vc = true, gc = require("zlib"); - gc.deflateSync || (vc = false); - var Nm = ur(), Pm = Vn(); - _c.exports = function(t, e) { - if (!vc) + var gc = true, _c = require("zlib"); + _c.deflateSync || (gc = false); + var Pm = fr(), Fm = Vn(); + xc.exports = function(t, e) { + if (!gc) throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"); - let r = e || {}, i = new Pm(r), n = []; - n.push(Buffer.from(Nm.PNG_SIGNATURE)), n.push(i.packIHDR(t.width, t.height)), t.gamma && n.push(i.packGAMA(t.gamma)); - let s = i.filterData(t.data, t.width, t.height), o = gc.deflateSync(s, i.getDeflateOptions()); + let r = e || {}, i = new Fm(r), n = []; + n.push(Buffer.from(Pm.PNG_SIGNATURE)), n.push(i.packIHDR(t.width, t.height)), t.gamma && n.push(i.packGAMA(t.gamma)); + let s = i.filterData(t.data, t.width, t.height), o = _c.deflateSync(s, i.getDeflateOptions()); if (s = null, !o || !o.length) throw new Error("bad png - invalid compressed data response"); return n.push(i.packIDAT(o)), n.push(i.packIEND()), Buffer.concat(n); }; }); - var yc = x((Gn) => { + var bc = x((Gn) => { "use strict"; - var Fm = mc(), Mm = xc(); + var Mm = vc(), Um = yc(); Gn.read = function(t, e) { - return Fm(t, e || {}); + return Mm(t, e || {}); }; Gn.write = function(t, e) { - return Mm(t, e); + return Um(t, e); }; }); - var Ec = x((wc) => { + var Sc = x((Ec) => { "use strict"; - var Um = require("util"), bc = require("stream"), Dm = Gl(), jm = tc(), qm = yc(), Ge = wc.PNG = function(t) { - bc.call(this), t = t || {}, this.width = t.width | 0, this.height = t.height | 0, this.data = this.width > 0 && this.height > 0 ? Buffer.alloc(4 * this.width * this.height) : null, t.fill && this.data && this.data.fill(0), this.gamma = 0, this.readable = this.writable = true, this._parser = new Dm(t), this._parser.on("error", this.emit.bind(this, "error")), this._parser.on("close", this._handleClose.bind(this)), this._parser.on("metadata", this._metadata.bind(this)), this._parser.on("gamma", this._gamma.bind(this)), this._parser.on("parsed", function(e) { + var Dm = require("util"), wc = require("stream"), jm = zl(), qm = rc(), Hm = bc(), $e = Ec.PNG = function(t) { + wc.call(this), t = t || {}, this.width = t.width | 0, this.height = t.height | 0, this.data = this.width > 0 && this.height > 0 ? Buffer.alloc(4 * this.width * this.height) : null, t.fill && this.data && this.data.fill(0), this.gamma = 0, this.readable = this.writable = true, this._parser = new jm(t), this._parser.on("error", this.emit.bind(this, "error")), this._parser.on("close", this._handleClose.bind(this)), this._parser.on("metadata", this._metadata.bind(this)), this._parser.on("gamma", this._gamma.bind(this)), this._parser.on("parsed", function(e) { this.data = e, this.emit("parsed", e); - }.bind(this)), this._packer = new jm(t), this._packer.on("data", this.emit.bind(this, "data")), this._packer.on("end", this.emit.bind(this, "end")), this._parser.on("close", this._handleClose.bind(this)), this._packer.on("error", this.emit.bind(this, "error")); + }.bind(this)), this._packer = new qm(t), this._packer.on("data", this.emit.bind(this, "data")), this._packer.on("end", this.emit.bind(this, "end")), this._parser.on("close", this._handleClose.bind(this)), this._packer.on("error", this.emit.bind(this, "error")); }; - Um.inherits(Ge, bc); - Ge.sync = qm; - Ge.prototype.pack = function() { + Dm.inherits($e, wc); + $e.sync = Hm; + $e.prototype.pack = function() { return !this.data || !this.data.length ? (this.emit("error", "No data provided"), this) : (process.nextTick(function() { this._packer.pack(this.data, this.width, this.height, this.gamma); }.bind(this)), this); }; - Ge.prototype.parse = function(t, e) { + $e.prototype.parse = function(t, e) { if (e) { let r, i; r = function(n) { @@ -3948,22 +3962,22 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } return this.end(t), this; }; - Ge.prototype.write = function(t) { + $e.prototype.write = function(t) { return this._parser.write(t), true; }; - Ge.prototype.end = function(t) { + $e.prototype.end = function(t) { this._parser.end(t); }; - Ge.prototype._metadata = function(t) { + $e.prototype._metadata = function(t) { this.width = t.width, this.height = t.height, this.emit("metadata", t); }; - Ge.prototype._gamma = function(t) { + $e.prototype._gamma = function(t) { this.gamma = t; }; - Ge.prototype._handleClose = function() { + $e.prototype._handleClose = function() { !this._parser.writable && !this._packer.readable && this.emit("close"); }; - Ge.bitblt = function(t, e, r, i, n, s, o, a) { + $e.bitblt = function(t, e, r, i, n, s, o, a) { if (r |= 0, i |= 0, n |= 0, s |= 0, o |= 0, a |= 0, r > t.width || i > t.height || r + n > t.width || i + s > t.height) throw new Error("bitblt reading outside image"); if (o > e.width || a > e.height || o + n > e.width || a + s > e.height) @@ -3971,10 +3985,10 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) for (let l = 0; l < s; l++) t.data.copy(e.data, (a + l) * e.width + o << 2, (i + l) * t.width + r << 2, (i + l) * t.width + r + n << 2); }; - Ge.prototype.bitblt = function(t, e, r, i, n, s, o) { - return Ge.bitblt(this, t, e, r, i, n, s, o), this; + $e.prototype.bitblt = function(t, e, r, i, n, s, o) { + return $e.bitblt(this, t, e, r, i, n, s, o), this; }; - Ge.adjustGamma = function(t) { + $e.adjustGamma = function(t) { if (t.gamma) { for (let e = 0; e < t.height; e++) for (let r = 0; r < t.width; r++) { @@ -3987,27 +4001,27 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) t.gamma = 0; } }; - Ge.prototype.adjustGamma = function() { - Ge.adjustGamma(this); + $e.prototype.adjustGamma = function() { + $e.adjustGamma(this); }; }); - var qr = x((Wn) => { + var Hr = x((Wn) => { var zn = class extends Error { constructor(e, r, i) { super(i); Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = r, this.exitCode = e, this.nestedError = void 0; } - }, Sc = class extends zn { + }, kc = class extends zn { constructor(e) { super(1, "commander.invalidArgument", e); Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name; } }; Wn.CommanderError = zn; - Wn.InvalidArgumentError = Sc; + Wn.InvalidArgumentError = kc; }); var Ti = x((Yn) => { - var { InvalidArgumentError: Hm } = qr(), kc = class { + var { InvalidArgumentError: Vm } = Hr(), Cc = class { constructor(e, r) { switch (this.description = r || "", this.variadic = false, this.parseArg = void 0, this.defaultValue = void 0, this.defaultValueDescription = void 0, this.argChoices = void 0, e[0]) { case "<": @@ -4037,7 +4051,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) choices(e) { return this.argChoices = e, this.parseArg = (r, i) => { if (!e.includes(r)) - throw new Hm(`Allowed choices are ${e.join(", ")}.`); + throw new Vm(`Allowed choices are ${e.join(", ")}.`); return this.variadic ? this._concatValue(r, i) : r; }, this; } @@ -4048,15 +4062,15 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return this.required = false, this; } }; - function Vm(t) { + function $m(t) { let e = t.name() + (t.variadic === true ? "..." : ""); return t.required ? "<" + e + ">" : "[" + e + "]"; } - Yn.Argument = kc; - Yn.humanReadableArgName = Vm; + Yn.Argument = Cc; + Yn.humanReadableArgName = $m; }); - var Kn = x((Oc) => { - var { humanReadableArgName: $m } = Ti(), Cc = class { + var Kn = x((Ic) => { + var { humanReadableArgName: Gm } = Ti(), Oc = class { constructor() { this.helpWidth = void 0, this.sortSubcommands = false, this.sortOptions = false; } @@ -4086,7 +4100,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) }), e._args.find((r) => r.description) ? e._args : []; } subcommandTerm(e) { - let r = e._args.map((i) => $m(i)).join(" "); + let r = e._args.map((i) => Gm(i)).join(" "); return e._name + (e._aliases[0] ? "|" + e._aliases[0] : "") + (e.options.length ? " [options]" : "") + (r ? " " + r : ""); } optionTerm(e) { @@ -4168,13 +4182,13 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) `); } }; - Oc.Help = Cc; + Ic.Help = Oc; }); var Xn = x((Zn) => { - var { InvalidArgumentError: Gm } = qr(), Ic = class { + var { InvalidArgumentError: zm } = Hr(), Tc = class { constructor(e, r) { this.flags = e, this.description = r || "", this.required = e.includes("<"), this.optional = e.includes("["), this.variadic = /\w\.\.\.[>\]]$/.test(e), this.mandatory = false; - let i = Tc(e); + let i = Ac(e); this.short = i.shortFlag, this.long = i.longFlag, this.negate = false, this.long && (this.negate = this.long.startsWith("--no-")), this.defaultValue = void 0, this.defaultValueDescription = void 0, this.envVar = void 0, this.parseArg = void 0, this.hidden = false, this.argChoices = void 0; } default(e, r) { @@ -4198,7 +4212,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) choices(e) { return this.argChoices = e, this.parseArg = (r, i) => { if (!e.includes(r)) - throw new Gm(`Allowed choices are ${e.join(", ")}.`); + throw new zm(`Allowed choices are ${e.join(", ")}.`); return this.variadic ? this._concatValue(r, i) : r; }, this; } @@ -4206,24 +4220,24 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return this.long ? this.long.replace(/^--/, "") : this.short.replace(/^-/, ""); } attributeName() { - return zm(this.name().replace(/^no-/, "")); + return Wm(this.name().replace(/^no-/, "")); } is(e) { return this.short === e || this.long === e; } }; - function zm(t) { + function Wm(t) { return t.split("-").reduce((e, r) => e + r[0].toUpperCase() + r.slice(1)); } - function Tc(t) { + function Ac(t) { let e, r, i = t.split(/[ |,]+/); return i.length > 1 && !/^[[<]/.test(i[1]) && (e = i.shift()), r = i.shift(), !e && /^-[^-]$/.test(r) && (e = r, r = void 0), { shortFlag: e, longFlag: r }; } - Zn.Option = Ic; - Zn.splitOptionFlags = Tc; + Zn.Option = Tc; + Zn.splitOptionFlags = Ac; }); - var Rc = x((Ac) => { - function Wm(t, e) { + var Bc = x((Rc) => { + function Ym(t, e) { if (Math.abs(t.length - e.length) > 3) return Math.max(t.length, e.length); let r = []; @@ -4238,7 +4252,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) } return r[t.length][e.length]; } - function Ym(t, e) { + function Km(t, e) { if (!e || e.length === 0) return ""; e = Array.from(new Set(e)); @@ -4248,16 +4262,16 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return e.forEach((o) => { if (o.length <= 1) return; - let a = Wm(t, o), l = Math.max(t.length, o.length); + let a = Ym(t, o), l = Math.max(t.length, o.length); (l - a) / l > s && (a < n ? (n = a, i = [o]) : a === n && i.push(o)); }), i.sort((o, a) => o.localeCompare(a)), r && (i = i.map((o) => `--${o}`)), i.length > 1 ? ` (Did you mean one of ${i.join(", ")}?)` : i.length === 1 ? ` (Did you mean ${i[0]}?)` : ""; } - Ac.suggestSimilar = Ym; + Rc.suggestSimilar = Km; }); - var Fc = x((Pc) => { - var Km = require("events").EventEmitter, Qn = require("child_process"), Dt = require("path"), Jn = require("fs"), { Argument: Zm, humanReadableArgName: Xm } = Ti(), { CommanderError: es } = qr(), { Help: Qm } = Kn(), { Option: Jm, splitOptionFlags: e0 } = Xn(), { suggestSimilar: Bc } = Rc(), Ai = class extends Km { + var Mc = x((Fc) => { + var Zm = require("events").EventEmitter, Qn = require("child_process"), Dt = require("path"), Jn = require("fs"), { Argument: Xm, humanReadableArgName: Qm } = Ti(), { CommanderError: es } = Hr(), { Help: Jm } = Kn(), { Option: e0, splitOptionFlags: t0 } = Xn(), { suggestSimilar: Lc } = Bc(), Ai = class extends Zm { constructor(e) { super(); this.commands = [], this.options = [], this.parent = null, this._allowUnknownOption = false, this._allowExcessArguments = true, this._args = [], this.args = [], this.rawArgs = [], this.processedArgs = [], this._scriptPath = null, this._name = e || "", this._optionValues = {}, this._optionValueSources = {}, this._storeOptionsAsProperties = false, this._actionHandler = null, this._executableHandler = false, this._executableFile = null, this._defaultCommandName = null, this._exitCallback = null, this._aliases = [], this._combineFlagAndOptionalValue = true, this._description = "", this._argsDescription = void 0, this._enablePositionalOptions = false, this._passThroughOptions = false, this._lifeCycleHooks = {}, this._showHelpAfterError = false, this._showSuggestionAfterError = false, this._outputConfiguration = { writeOut: (r) => process.stdout.write(r), writeErr: (r) => process.stderr.write(r), getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : void 0, getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : void 0, outputError: (r, i) => i(r) }, this._hidden = false, this._hasHelpOption = true, this._helpFlags = "-h, --help", this._helpDescription = "display help for command", this._helpShortFlag = "-h", this._helpLongFlag = "--help", this._addImplicitHelpCommand = void 0, this._helpCommandName = "help", this._helpCommandnameAndArgs = "help [command]", this._helpCommandDescription = "display help for command", this._helpConfiguration = {}; @@ -4275,7 +4289,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return new Ai(e); } createHelp() { - return Object.assign(new Qm(), this.configureHelp()); + return Object.assign(new Jm(), this.configureHelp()); } configureHelp(e) { return e === void 0 ? this._helpConfiguration : (this._helpConfiguration = e, this); @@ -4302,7 +4316,7 @@ globstar while`, t, u, e, f, h), this.matchOne(t.slice(u), e.slice(f), r)) return i(e.commands), r = r || {}, r.isDefault && (this._defaultCommandName = e._name), (r.noHelp || r.hidden) && (e._hidden = true), this.commands.push(e), e.parent = this, this; } createArgument(e, r) { - return new Zm(e, r); + return new Xm(e, r); } argument(e, r, i, n) { let s = this.createArgument(e, r); @@ -4351,7 +4365,7 @@ Expecting one of '${i.join("', '")}'`); return this._actionHandler = r, this; } createOption(e, r) { - return new Jm(e, r); + return new e0(e, r); } addOption(e) { let r = e.name(), i = e.attributeName(), n = e.defaultValue; @@ -4492,7 +4506,7 @@ Expecting one of '${i.join("', '")}'`); Jn.existsSync(`${l}${h}`) && (a = `${l}${h}`); }), i = n.includes(Dt.extname(a)); let c; - process.platform !== "win32" ? i ? (r.unshift(a), r = Nc(process.execArgv).concat(r), c = Qn.spawn(process.argv[0], r, { stdio: "inherit" })) : c = Qn.spawn(a, r, { stdio: "inherit" }) : (r.unshift(a), r = Nc(process.execArgv).concat(r), c = Qn.spawn(process.execPath, r, { stdio: "inherit" })), ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((h) => { + process.platform !== "win32" ? i ? (r.unshift(a), r = Pc(process.execArgv).concat(r), c = Qn.spawn(process.argv[0], r, { stdio: "inherit" })) : c = Qn.spawn(a, r, { stdio: "inherit" }) : (r.unshift(a), r = Pc(process.execArgv).concat(r), c = Qn.spawn(process.execPath, r, { stdio: "inherit" })), ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((h) => { process.on(h, () => { c.killed === false && c.exitCode === null && c.kill(h); }); @@ -4570,8 +4584,8 @@ Expecting one of '${i.join("', '")}'`); if (this._hasImplicitHelpCommand() && e[0] === this._helpCommandName) return e.length === 1 && this.help(), this._dispatchSubcommand(e[1], [], [this._helpLongFlag]); if (this._defaultCommandName) - return Lc(this, r), this._dispatchSubcommand(this._defaultCommandName, e, r); - this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: true }), Lc(this, i.unknown), this._checkForMissingMandatoryOptions(); + return Nc(this, r), this._dispatchSubcommand(this._defaultCommandName, e, r); + this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: true }), Nc(this, i.unknown), this._checkForMissingMandatoryOptions(); let n = () => { i.unknown.length > 0 && this.unknownOption(i.unknown[0]); }, s = `command:${this.name()}`; @@ -4714,7 +4728,7 @@ Expecting one of '${i.join("', '")}'`); let o = s.createHelp().visibleOptions(s).filter((a) => a.long).map((a) => a.long); n = n.concat(o), s = s.parent; } while (s && !s._enablePositionalOptions); - r = Bc(e, n); + r = Lc(e, n); } let i = `error: unknown option '${e}'${r}`; this._displayError(1, "commander.unknownOption", i); @@ -4731,7 +4745,7 @@ Expecting one of '${i.join("', '")}'`); let n = []; this.createHelp().visibleCommands(this).forEach((s) => { n.push(s.name()), s.alias() && n.push(s.alias()); - }), r = Bc(e, n); + }), r = Lc(e, n); } let i = `error: unknown command '${e}'${r}`; this._displayError(1, "commander.unknownCommand", i); @@ -4764,7 +4778,7 @@ Expecting one of '${i.join("', '")}'`); if (e === void 0) { if (this._usage) return this._usage; - let r = this._args.map((i) => Xm(i)); + let r = this._args.map((i) => Qm(i)); return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this._args.length ? r : []).join(" "); } return this._usage = e, this; @@ -4795,7 +4809,7 @@ Expecting one of '${i.join("', '")}'`); if (typeof e == "boolean") return this._hasHelpOption = e, this; this._helpFlags = e || this._helpFlags, this._helpDescription = r || this._helpDescription; - let i = e0(this._helpFlags); + let i = t0(this._helpFlags); return this._helpShortFlag = i.shortFlag, this._helpLongFlag = i.longFlag, this; } help(e) { @@ -4816,10 +4830,10 @@ Expecting one of '${i.join("', '")}'`); }), this; } }; - function Lc(t, e) { + function Nc(t, e) { t._hasHelpOption && e.find((i) => i === t._helpLongFlag || i === t._helpShortFlag) && (t.outputHelp(), t._exit(0, "commander.helpDisplayed", "(outputHelp)")); } - function Nc(t) { + function Pc(t) { return t.map((e) => { if (!e.startsWith("--inspect")) return e; @@ -4833,23 +4847,23 @@ Expecting one of '${i.join("', '")}'`); e.push(r); return e; } - Pc.Command = Ai; + Fc.Command = Ai; }); - var jc = x((st, Dc) => { - var { Argument: t0 } = Ti(), { Command: Mc } = Fc(), { CommanderError: r0, InvalidArgumentError: Uc } = qr(), { Help: i0 } = Kn(), { Option: n0 } = Xn(); - st = Dc.exports = new Mc(); + var qc = x((st, jc) => { + var { Argument: r0 } = Ti(), { Command: Uc } = Mc(), { CommanderError: i0, InvalidArgumentError: Dc } = Hr(), { Help: n0 } = Kn(), { Option: s0 } = Xn(); + st = jc.exports = new Uc(); st.program = st; - st.Argument = t0; - st.Command = Mc; - st.CommanderError = r0; - st.Help = i0; - st.InvalidArgumentError = Uc; - st.InvalidOptionArgumentError = Uc; - st.Option = n0; - }); - var Vc = x((qc, Hc) => { - qc = Hc.exports = hr; - function hr(t, e) { + st.Argument = r0; + st.Command = Uc; + st.CommanderError = i0; + st.Help = n0; + st.InvalidArgumentError = Dc; + st.InvalidOptionArgumentError = Dc; + st.Option = s0; + }); + var $c = x((Hc, Vc) => { + Hc = Vc.exports = pr; + function pr(t, e) { if (this.stream = e.stream || process.stderr, typeof e == "number") { var r = e; e = {}, e.total = r; @@ -4862,13 +4876,13 @@ Expecting one of '${i.join("', '")}'`); this.fmt = t, this.curr = e.curr || 0, this.total = e.total, this.width = e.width || this.total, this.clear = e.clear, this.chars = { complete: e.complete || "=", incomplete: e.incomplete || "-", head: e.head || e.complete || "=" }, this.renderThrottle = e.renderThrottle !== 0 ? e.renderThrottle || 16 : 0, this.lastRender = -1 / 0, this.callback = e.callback || function() { }, this.tokens = {}, this.lastDraw = ""; } - hr.prototype.tick = function(t, e) { + pr.prototype.tick = function(t, e) { if (t !== 0 && (t = t || 1), typeof t == "object" && (e = t, t = 1), e && (this.tokens = e), this.curr == 0 && (this.start = new Date()), this.curr += t, this.render(), this.curr >= this.total) { this.render(void 0, true), this.complete = true, this.terminate(), this.callback(this); return; } }; - hr.prototype.render = function(t, e) { + pr.prototype.render = function(t, e) { if (e = e !== void 0 ? e : false, t && (this.tokens = t), !!this.stream.isTTY) { var r = Date.now(), i = r - this.lastRender; if (!(!e && i < this.renderThrottle)) { @@ -4885,27 +4899,27 @@ Expecting one of '${i.join("', '")}'`); } } }; - hr.prototype.update = function(t, e) { + pr.prototype.update = function(t, e) { var r = Math.floor(t * this.total), i = r - this.curr; this.tick(i, e); }; - hr.prototype.interrupt = function(t) { + pr.prototype.interrupt = function(t) { this.stream.clearLine(), this.stream.cursorTo(0), this.stream.write(t), this.stream.write(` `), this.stream.write(this.lastDraw); }; - hr.prototype.terminate = function() { + pr.prototype.terminate = function() { this.clear ? this.stream.clearLine && (this.stream.clearLine(), this.stream.cursorTo(0)) : this.stream.write(` `); }; }); - var Gc = x((mx, $c) => { - $c.exports = Vc(); + var zc = x((vx, Gc) => { + Gc.exports = $c(); }); - var zc = x((rs) => { - var jt = require("path"), bt = process.platform === "win32", yt = require("fs"), s0 = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - function o0() { + var Wc = x((rs) => { + var jt = require("path"), wt = process.platform === "win32", bt = require("fs"), o0 = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + function a0() { var t; - if (s0) { + if (o0) { var e = new Error(); t = r; } else @@ -4925,42 +4939,42 @@ Expecting one of '${i.join("', '")}'`); } } } - function a0(t) { - return typeof t == "function" ? t : o0(); + function l0(t) { + return typeof t == "function" ? t : a0(); } - var vx = jt.normalize; - bt ? ut = /(.*?)(?:[\/\\]+|$)/g : ut = /(.*?)(?:[\/]+|$)/g; - var ut; - bt ? Hr = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/ : Hr = /^[\/]*/; - var Hr; + var gx = jt.normalize; + wt ? ft = /(.*?)(?:[\/\\]+|$)/g : ft = /(.*?)(?:[\/]+|$)/g; + var ft; + wt ? Vr = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/ : Vr = /^[\/]*/; + var Vr; rs.realpathSync = function(e, r) { if (e = jt.resolve(e), r && Object.prototype.hasOwnProperty.call(r, e)) return r[e]; var i = e, n = {}, s = {}, o, a, l, c; u(); function u() { - var v = Hr.exec(e); - o = v[0].length, a = v[0], l = v[0], c = "", bt && !s[l] && (yt.lstatSync(l), s[l] = true); + var v = Vr.exec(e); + o = v[0].length, a = v[0], l = v[0], c = "", wt && !s[l] && (bt.lstatSync(l), s[l] = true); } for (; o < e.length; ) { - ut.lastIndex = o; - var f = ut.exec(e); - if (c = a, a += f[0], l = c + f[1], o = ut.lastIndex, !(s[l] || r && r[l] === l)) { + ft.lastIndex = o; + var f = ft.exec(e); + if (c = a, a += f[0], l = c + f[1], o = ft.lastIndex, !(s[l] || r && r[l] === l)) { var h; if (r && Object.prototype.hasOwnProperty.call(r, l)) h = r[l]; else { - var p = yt.lstatSync(l); + var p = bt.lstatSync(l); if (!p.isSymbolicLink()) { s[l] = true, r && (r[l] = l); continue; } var d = null; - if (!bt) { + if (!wt) { var m = p.dev.toString(32) + ":" + p.ino.toString(32); n.hasOwnProperty(m) && (d = n[m]); } - d === null && (yt.statSync(l), d = yt.readlinkSync(l)), h = jt.resolve(c, d), r && (r[l] = h), bt || (n[m] = d); + d === null && (bt.statSync(l), d = bt.readlinkSync(l)), h = jt.resolve(c, d), r && (r[l] = h), wt || (n[m] = d); } e = jt.resolve(h, e.slice(o)), u(); } @@ -4968,13 +4982,13 @@ Expecting one of '${i.join("', '")}'`); return r && (r[i] = e), e; }; rs.realpath = function(e, r, i) { - if (typeof i != "function" && (i = a0(r), r = null), e = jt.resolve(e), r && Object.prototype.hasOwnProperty.call(r, e)) + if (typeof i != "function" && (i = l0(r), r = null), e = jt.resolve(e), r && Object.prototype.hasOwnProperty.call(r, e)) return process.nextTick(i.bind(null, null, r[e])); var n = e, s = {}, o = {}, a, l, c, u; f(); function f() { - var v = Hr.exec(e); - a = v[0].length, l = v[0], c = v[0], u = "", bt && !o[c] ? yt.lstat(c, function(y) { + var v = Vr.exec(e); + a = v[0].length, l = v[0], c = v[0], u = "", wt && !o[c] ? bt.lstat(c, function(y) { if (y) return i(y); o[c] = true, h(); @@ -4983,76 +4997,76 @@ Expecting one of '${i.join("', '")}'`); function h() { if (a >= e.length) return r && (r[n] = e), i(null, e); - ut.lastIndex = a; - var v = ut.exec(e); - return u = l, l += v[0], c = u + v[1], a = ut.lastIndex, o[c] || r && r[c] === c ? process.nextTick(h) : r && Object.prototype.hasOwnProperty.call(r, c) ? m(r[c]) : yt.lstat(c, p); + ft.lastIndex = a; + var v = ft.exec(e); + return u = l, l += v[0], c = u + v[1], a = ft.lastIndex, o[c] || r && r[c] === c ? process.nextTick(h) : r && Object.prototype.hasOwnProperty.call(r, c) ? m(r[c]) : bt.lstat(c, p); } function p(v, y) { if (v) return i(v); if (!y.isSymbolicLink()) return o[c] = true, r && (r[c] = c), process.nextTick(h); - if (!bt) { - var O = y.dev.toString(32) + ":" + y.ino.toString(32); - if (s.hasOwnProperty(O)) - return d(null, s[O], c); + if (!wt) { + var I = y.dev.toString(32) + ":" + y.ino.toString(32); + if (s.hasOwnProperty(I)) + return d(null, s[I], c); } - yt.stat(c, function(w) { + bt.stat(c, function(w) { if (w) return i(w); - yt.readlink(c, function(S, b) { - bt || (s[O] = b), d(S, b); + bt.readlink(c, function(S, b) { + wt || (s[I] = b), d(S, b); }); }); } - function d(v, y, O) { + function d(v, y, I) { if (v) return i(v); var w = jt.resolve(u, y); - r && (r[O] = w), m(w); + r && (r[I] = w), m(w); } function m(v) { e = jt.resolve(v, e.slice(a)), f(); } }; }); - var os = x((_x, Zc) => { - Zc.exports = wt; - wt.realpath = wt; - wt.sync = ss; - wt.realpathSync = ss; - wt.monkeypatch = c0; - wt.unmonkeypatch = u0; - var pr = require("fs"), is = pr.realpath, ns = pr.realpathSync, l0 = process.version, Wc = /^v[0-5]\./.test(l0), Yc = zc(); - function Kc(t) { + var os = x((xx, Xc) => { + Xc.exports = Et; + Et.realpath = Et; + Et.sync = ss; + Et.realpathSync = ss; + Et.monkeypatch = u0; + Et.unmonkeypatch = f0; + var dr = require("fs"), is = dr.realpath, ns = dr.realpathSync, c0 = process.version, Yc = /^v[0-5]\./.test(c0), Kc = Wc(); + function Zc(t) { return t && t.syscall === "realpath" && (t.code === "ELOOP" || t.code === "ENOMEM" || t.code === "ENAMETOOLONG"); } - function wt(t, e, r) { - if (Wc) + function Et(t, e, r) { + if (Yc) return is(t, e, r); typeof e == "function" && (r = e, e = null), is(t, e, function(i, n) { - Kc(i) ? Yc.realpath(t, e, r) : r(i, n); + Zc(i) ? Kc.realpath(t, e, r) : r(i, n); }); } function ss(t, e) { - if (Wc) + if (Yc) return ns(t, e); try { return ns(t, e); } catch (r) { - if (Kc(r)) - return Yc.realpathSync(t, e); + if (Zc(r)) + return Kc.realpathSync(t, e); throw r; } } - function c0() { - pr.realpath = wt, pr.realpathSync = ss; - } function u0() { - pr.realpath = is, pr.realpathSync = ns; + dr.realpath = Et, dr.realpathSync = ss; + } + function f0() { + dr.realpath = is, dr.realpathSync = ns; } }); - var Xc = x((xx, as) => { + var Qc = x((yx, as) => { typeof Object.create == "function" ? as.exports = function(e, r) { r && (e.super_ = r, e.prototype = Object.create(r.prototype, { constructor: { value: e, enumerable: false, writable: true, configurable: true } })); } : as.exports = function(e, r) { @@ -5064,48 +5078,48 @@ Expecting one of '${i.join("', '")}'`); } }; }); - var Qc = x((yx, cs) => { + var Jc = x((bx, cs) => { try { if (ls = require("util"), typeof ls.inherits != "function") throw ""; cs.exports = ls.inherits; } catch (e) { - cs.exports = Xc(); + cs.exports = Qc(); } var ls; }); - var Bi = x((bx, Ri) => { + var Bi = x((wx, Ri) => { "use strict"; - function Jc(t) { + function eu(t) { return t.charAt(0) === "/"; } - function eu(t) { + function tu(t) { var e = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/, r = e.exec(t), i = r[1] || "", n = Boolean(i && i.charAt(1) !== ":"); return Boolean(r[2] || n); } - Ri.exports = process.platform === "win32" ? eu : Jc; - Ri.exports.posix = Jc; - Ri.exports.win32 = eu; - }); - var fs = x((Et) => { - Et.setopts = v0; - Et.ownProp = tu; - Et.makeAbs = Vr; - Et.finish = g0; - Et.mark = _0; - Et.isIgnored = iu; - Et.childrenIgnored = x0; - function tu(t, e) { + Ri.exports = process.platform === "win32" ? tu : eu; + Ri.exports.posix = eu; + Ri.exports.win32 = tu; + }); + var fs = x((St) => { + St.setopts = g0; + St.ownProp = ru; + St.makeAbs = $r; + St.finish = _0; + St.mark = x0; + St.isIgnored = nu; + St.childrenIgnored = y0; + function ru(t, e) { return Object.prototype.hasOwnProperty.call(t, e); } - var f0 = require("fs"), dr = require("path"), h0 = Dr(), ru = Bi(), us = h0.Minimatch; - function p0(t, e) { + var h0 = require("fs"), mr = require("path"), p0 = jr(), iu = Bi(), us = p0.Minimatch; + function d0(t, e) { return t.localeCompare(e, "en"); } - function d0(t, e) { - t.ignore = e.ignore || [], Array.isArray(t.ignore) || (t.ignore = [t.ignore]), t.ignore.length && (t.ignore = t.ignore.map(m0)); + function m0(t, e) { + t.ignore = e.ignore || [], Array.isArray(t.ignore) || (t.ignore = [t.ignore]), t.ignore.length && (t.ignore = t.ignore.map(v0)); } - function m0(t) { + function v0(t) { var e = null; if (t.slice(-3) === "/**") { var r = t.replace(/(\/\*\*)+$/, ""); @@ -5113,17 +5127,17 @@ Expecting one of '${i.join("', '")}'`); } return { matcher: new us(t, { dot: true }), gmatcher: e }; } - function v0(t, e, r) { + function g0(t, e, r) { if (r || (r = {}), r.matchBase && e.indexOf("/") === -1) { if (r.noglobstar) throw new Error("base matching requires globstar"); e = "**/" + e; } - t.silent = !!r.silent, t.pattern = e, t.strict = r.strict !== false, t.realpath = !!r.realpath, t.realpathCache = r.realpathCache || Object.create(null), t.follow = !!r.follow, t.dot = !!r.dot, t.mark = !!r.mark, t.nodir = !!r.nodir, t.nodir && (t.mark = true), t.sync = !!r.sync, t.nounique = !!r.nounique, t.nonull = !!r.nonull, t.nosort = !!r.nosort, t.nocase = !!r.nocase, t.stat = !!r.stat, t.noprocess = !!r.noprocess, t.absolute = !!r.absolute, t.fs = r.fs || f0, t.maxLength = r.maxLength || 1 / 0, t.cache = r.cache || Object.create(null), t.statCache = r.statCache || Object.create(null), t.symlinks = r.symlinks || Object.create(null), d0(t, r), t.changedCwd = false; + t.silent = !!r.silent, t.pattern = e, t.strict = r.strict !== false, t.realpath = !!r.realpath, t.realpathCache = r.realpathCache || Object.create(null), t.follow = !!r.follow, t.dot = !!r.dot, t.mark = !!r.mark, t.nodir = !!r.nodir, t.nodir && (t.mark = true), t.sync = !!r.sync, t.nounique = !!r.nounique, t.nonull = !!r.nonull, t.nosort = !!r.nosort, t.nocase = !!r.nocase, t.stat = !!r.stat, t.noprocess = !!r.noprocess, t.absolute = !!r.absolute, t.fs = r.fs || h0, t.maxLength = r.maxLength || 1 / 0, t.cache = r.cache || Object.create(null), t.statCache = r.statCache || Object.create(null), t.symlinks = r.symlinks || Object.create(null), m0(t, r), t.changedCwd = false; var i = process.cwd(); - tu(r, "cwd") ? (t.cwd = dr.resolve(r.cwd), t.changedCwd = t.cwd !== i) : t.cwd = i, t.root = r.root || dr.resolve(t.cwd, "/"), t.root = dr.resolve(t.root), process.platform === "win32" && (t.root = t.root.replace(/\\/g, "/")), t.cwdAbs = ru(t.cwd) ? t.cwd : Vr(t, t.cwd), process.platform === "win32" && (t.cwdAbs = t.cwdAbs.replace(/\\/g, "/")), t.nomount = !!r.nomount, r.nonegate = true, r.nocomment = true, t.minimatch = new us(e, r), t.options = t.minimatch.options; + ru(r, "cwd") ? (t.cwd = mr.resolve(r.cwd), t.changedCwd = t.cwd !== i) : t.cwd = i, t.root = r.root || mr.resolve(t.cwd, "/"), t.root = mr.resolve(t.root), process.platform === "win32" && (t.root = t.root.replace(/\\/g, "/")), t.cwdAbs = iu(t.cwd) ? t.cwd : $r(t, t.cwd), process.platform === "win32" && (t.cwdAbs = t.cwdAbs.replace(/\\/g, "/")), t.nomount = !!r.nomount, r.nonegate = true, r.nocomment = true, t.minimatch = new us(e, r), t.options = t.minimatch.options; } - function g0(t) { + function _0(t) { for (var e = t.nounique, r = e ? [] : Object.create(null), i = 0, n = t.matches.length; i < n; i++) { var s = t.matches[i]; if (!s || Object.keys(s).length === 0) { @@ -5138,63 +5152,63 @@ Expecting one of '${i.join("', '")}'`); }); } } - if (e || (r = Object.keys(r)), t.nosort || (r = r.sort(p0)), t.mark) { + if (e || (r = Object.keys(r)), t.nosort || (r = r.sort(d0)), t.mark) { for (var i = 0; i < r.length; i++) r[i] = t._mark(r[i]); t.nodir && (r = r.filter(function(l) { - var c = !/\/$/.test(l), u = t.cache[l] || t.cache[Vr(t, l)]; + var c = !/\/$/.test(l), u = t.cache[l] || t.cache[$r(t, l)]; return c && u && (c = u !== "DIR" && !Array.isArray(u)), c; })); } t.ignore.length && (r = r.filter(function(l) { - return !iu(t, l); + return !nu(t, l); })), t.found = r; } - function _0(t, e) { - var r = Vr(t, e), i = t.cache[r], n = e; + function x0(t, e) { + var r = $r(t, e), i = t.cache[r], n = e; if (i) { var s = i === "DIR" || Array.isArray(i), o = e.slice(-1) === "/"; if (s && !o ? n += "/" : !s && o && (n = n.slice(0, -1)), n !== e) { - var a = Vr(t, n); + var a = $r(t, n); t.statCache[a] = t.statCache[r], t.cache[a] = t.cache[r]; } } return n; } - function Vr(t, e) { + function $r(t, e) { var r = e; - return e.charAt(0) === "/" ? r = dr.join(t.root, e) : ru(e) || e === "" ? r = e : t.changedCwd ? r = dr.resolve(t.cwd, e) : r = dr.resolve(e), process.platform === "win32" && (r = r.replace(/\\/g, "/")), r; + return e.charAt(0) === "/" ? r = mr.join(t.root, e) : iu(e) || e === "" ? r = e : t.changedCwd ? r = mr.resolve(t.cwd, e) : r = mr.resolve(e), process.platform === "win32" && (r = r.replace(/\\/g, "/")), r; } - function iu(t, e) { + function nu(t, e) { return t.ignore.length ? t.ignore.some(function(r) { return r.matcher.match(e) || !!(r.gmatcher && r.gmatcher.match(e)); }) : false; } - function x0(t, e) { + function y0(t, e) { return t.ignore.length ? t.ignore.some(function(r) { return !!(r.gmatcher && r.gmatcher.match(e)); }) : false; } }); - var lu = x((Cx, au) => { - au.exports = ou; - ou.GlobSync = Be; - var y0 = os(), nu = Dr(), Ex = nu.Minimatch, Sx = ds().Glob, kx = require("util"), hs = require("path"), su = require("assert"), Li = Bi(), qt = fs(), b0 = qt.setopts, ps = qt.ownProp, w0 = qt.childrenIgnored, E0 = qt.isIgnored; - function ou(t, e) { + var cu = x((Ox, lu) => { + lu.exports = au; + au.GlobSync = Re; + var b0 = os(), su = jr(), Sx = su.Minimatch, kx = ds().Glob, Cx = require("util"), hs = require("path"), ou = require("assert"), Li = Bi(), qt = fs(), w0 = qt.setopts, ps = qt.ownProp, E0 = qt.childrenIgnored, S0 = qt.isIgnored; + function au(t, e) { if (typeof e == "function" || arguments.length === 3) throw new TypeError(`callback provided to sync glob See: https://github.com/isaacs/node-glob/issues/167`); - return new Be(t, e).found; + return new Re(t, e).found; } - function Be(t, e) { + function Re(t, e) { if (!t) throw new Error("must provide pattern"); if (typeof e == "function" || arguments.length === 3) throw new TypeError(`callback provided to sync glob See: https://github.com/isaacs/node-glob/issues/167`); - if (!(this instanceof Be)) - return new Be(t, e); - if (b0(this, t, e), this.noprocess) + if (!(this instanceof Re)) + return new Re(t, e); + if (w0(this, t, e), this.noprocess) return this; var r = this.minimatch.set.length; this.matches = new Array(r); @@ -5202,15 +5216,15 @@ See: https://github.com/isaacs/node-glob/issues/167`); this._process(this.minimatch.set[i], i, false); this._finish(); } - Be.prototype._finish = function() { - if (su(this instanceof Be), this.realpath) { + Re.prototype._finish = function() { + if (ou(this instanceof Re), this.realpath) { var t = this; this.matches.forEach(function(e, r) { var i = t.matches[r] = Object.create(null); for (var n in e) try { n = t._makeAbs(n); - var s = y0.realpathSync(n, t.realpathCache); + var s = b0.realpathSync(n, t.realpathCache); i[s] = true; } catch (o) { if (o.syscall === "stat") @@ -5222,8 +5236,8 @@ See: https://github.com/isaacs/node-glob/issues/167`); } qt.finish(this); }; - Be.prototype._process = function(t, e, r) { - su(this instanceof Be); + Re.prototype._process = function(t, e, r) { + ou(this instanceof Re); for (var i = 0; typeof t[i] == "string"; ) i++; var n; @@ -5241,12 +5255,12 @@ See: https://github.com/isaacs/node-glob/issues/167`); var s = t.slice(i), o; n === null ? o = "." : ((Li(n) || Li(t.join("/"))) && (!n || !Li(n)) && (n = "/" + n), o = n); var a = this._makeAbs(o); - if (!w0(this, o)) { - var l = s[0] === nu.GLOBSTAR; + if (!E0(this, o)) { + var l = s[0] === su.GLOBSTAR; l ? this._processGlobStar(n, o, a, s, e, r) : this._processReaddir(n, o, a, s, e, r); } }; - Be.prototype._processReaddir = function(t, e, r, i, n, s) { + Re.prototype._processReaddir = function(t, e, r, i, n, s) { var o = this._readdir(r, s); if (!!o) { for (var a = i[0], l = !!this.minimatch.negate, c = a._glob, u = this.dot || c.charAt(0) === ".", f = [], h = 0; h < o.length; h++) { @@ -5274,8 +5288,8 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } }; - Be.prototype._emitMatch = function(t, e) { - if (!E0(this, e)) { + Re.prototype._emitMatch = function(t, e) { + if (!S0(this, e)) { var r = this._makeAbs(e); if (this.mark && (e = this._mark(e)), this.absolute && (e = r), !this.matches[t][e]) { if (this.nodir) { @@ -5287,7 +5301,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } }; - Be.prototype._readdirInGlobStar = function(t) { + Re.prototype._readdirInGlobStar = function(t) { if (this.follow) return this._readdir(t, false); var e, r, i; @@ -5300,7 +5314,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); var n = r && r.isSymbolicLink(); return this.symlinks[t] = n, !n && r && !r.isDirectory() ? this.cache[t] = "FILE" : e = this._readdir(t, false), e; }; - Be.prototype._readdir = function(t, e) { + Re.prototype._readdir = function(t, e) { var r; if (e && !ps(this.symlinks, t)) return this._readdirInGlobStar(t); @@ -5317,7 +5331,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._readdirError(t, n), null; } }; - Be.prototype._readdirEntries = function(t, e) { + Re.prototype._readdirEntries = function(t, e) { if (!this.mark && !this.stat) for (var r = 0; r < e.length; r++) { var i = e[r]; @@ -5325,7 +5339,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } return this.cache[t] = e, e; }; - Be.prototype._readdirError = function(t, e) { + Re.prototype._readdirError = function(t, e) { switch (e.code) { case "ENOTSUP": case "ENOTDIR": @@ -5348,7 +5362,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); break; } }; - Be.prototype._processGlobStar = function(t, e, r, i, n, s) { + Re.prototype._processGlobStar = function(t, e, r, i, n, s) { var o = this._readdir(r, s); if (!!o) { var a = i.slice(1), l = t ? [t] : [], c = l.concat(a); @@ -5366,7 +5380,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } }; - Be.prototype._processSimple = function(t, e) { + Re.prototype._processSimple = function(t, e) { var r = this._stat(t); if (this.matches[e] || (this.matches[e] = Object.create(null)), !!r) { if (t && Li(t) && !this.nomount) { @@ -5376,7 +5390,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); process.platform === "win32" && (t = t.replace(/\\/g, "/")), this._emitMatch(e, t); } }; - Be.prototype._stat = function(t) { + Re.prototype._stat = function(t) { var e = this._makeAbs(t), r = t.slice(-1) === "/"; if (t.length > this.maxLength) return false; @@ -5409,18 +5423,18 @@ See: https://github.com/isaacs/node-glob/issues/167`); var o = true; return n && (o = n.isDirectory() ? "DIR" : "FILE"), this.cache[e] = this.cache[e] || o, r && o === "FILE" ? false : o; }; - Be.prototype._mark = function(t) { + Re.prototype._mark = function(t) { return qt.mark(this, t); }; - Be.prototype._makeAbs = function(t) { + Re.prototype._makeAbs = function(t) { return qt.makeAbs(this, t); }; }); - var ms = x((Ox, uu) => { - uu.exports = cu; - function cu(t, e) { + var ms = x((Ix, fu) => { + fu.exports = uu; + function uu(t, e) { if (t && e) - return cu(t)(e); + return uu(t)(e); if (typeof t != "function") throw new TypeError("need wrapper function"); return Object.keys(t).forEach(function(i) { @@ -5436,15 +5450,15 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } }); - var gs = x((Ix, vs) => { - var fu = ms(); - vs.exports = fu(Ni); - vs.exports.strict = fu(hu); + var gs = x((Tx, vs) => { + var hu = ms(); + vs.exports = hu(Ni); + vs.exports.strict = hu(pu); Ni.proto = Ni(function() { Object.defineProperty(Function.prototype, "once", { value: function() { return Ni(this); }, configurable: true }), Object.defineProperty(Function.prototype, "onceStrict", { value: function() { - return hu(this); + return pu(this); }, configurable: true }); }); function Ni(t) { @@ -5453,7 +5467,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); }; return e.called = false, e; } - function hu(t) { + function pu(t) { var e = function() { if (e.called) throw new Error(e.onceError); @@ -5462,46 +5476,46 @@ See: https://github.com/isaacs/node-glob/issues/167`); return e.onceError = r + " shouldn't be called more than once", e.called = false, e; } }); - var du = x((Tx, pu) => { - var S0 = ms(), $r = Object.create(null), k0 = gs(); - pu.exports = S0(C0); - function C0(t, e) { - return $r[t] ? ($r[t].push(e), null) : ($r[t] = [e], O0(t)); + var mu = x((Ax, du) => { + var k0 = ms(), Gr = Object.create(null), C0 = gs(); + du.exports = k0(O0); + function O0(t, e) { + return Gr[t] ? (Gr[t].push(e), null) : (Gr[t] = [e], I0(t)); } - function O0(t) { - return k0(function e() { - var r = $r[t], i = r.length, n = I0(arguments); + function I0(t) { + return C0(function e() { + var r = Gr[t], i = r.length, n = T0(arguments); try { for (var s = 0; s < i; s++) r[s].apply(null, n); } finally { r.length > i ? (r.splice(0, i), process.nextTick(function() { e.apply(null, n); - })) : delete $r[t]; + })) : delete Gr[t]; } }); } - function I0(t) { + function T0(t) { for (var e = t.length, r = [], i = 0; i < e; i++) r[i] = t[i]; return r; } }); - var ds = x((Bx, vu) => { - vu.exports = Ht; - var T0 = os(), mu = Dr(), Ax = mu.Minimatch, A0 = Qc(), R0 = require("events").EventEmitter, _s = require("path"), xs = require("assert"), Gr = Bi(), bs = lu(), Vt = fs(), B0 = Vt.setopts, ys = Vt.ownProp, ws2 = du(), Rx = require("util"), L0 = Vt.childrenIgnored, N0 = Vt.isIgnored, P0 = gs(); + var ds = x((Lx, gu) => { + gu.exports = Ht; + var A0 = os(), vu = jr(), Rx = vu.Minimatch, R0 = Jc(), B0 = require("events").EventEmitter, _s = require("path"), xs = require("assert"), zr = Bi(), bs = cu(), Vt = fs(), L0 = Vt.setopts, ys = Vt.ownProp, ws2 = mu(), Bx = require("util"), N0 = Vt.childrenIgnored, P0 = Vt.isIgnored, F0 = gs(); function Ht(t, e, r) { if (typeof e == "function" && (r = e, e = {}), e || (e = {}), e.sync) { if (r) throw new TypeError("callback provided to sync glob"); return bs(t, e); } - return new ve(t, e, r); + return new me(t, e, r); } Ht.sync = bs; - var F0 = Ht.GlobSync = bs.GlobSync; + var M0 = Ht.GlobSync = bs.GlobSync; Ht.glob = Ht; - function M0(t, e) { + function U0(t, e) { if (e === null || typeof e != "object") return t; for (var r = Object.keys(e), i = r.length; i--; ) @@ -5509,9 +5523,9 @@ See: https://github.com/isaacs/node-glob/issues/167`); return t; } Ht.hasMagic = function(t, e) { - var r = M0({}, e); + var r = U0({}, e); r.noprocess = true; - var i = new ve(t, r), n = i.minimatch.set; + var i = new me(t, r), n = i.minimatch.set; if (!t) return false; if (n.length > 1) @@ -5521,19 +5535,19 @@ See: https://github.com/isaacs/node-glob/issues/167`); return true; return false; }; - Ht.Glob = ve; - A0(ve, R0); - function ve(t, e, r) { + Ht.Glob = me; + R0(me, B0); + function me(t, e, r) { if (typeof e == "function" && (r = e, e = null), e && e.sync) { if (r) throw new TypeError("callback provided to sync glob"); - return new F0(t, e); + return new M0(t, e); } - if (!(this instanceof ve)) - return new ve(t, e, r); - B0(this, t, e), this._didRealPath = false; + if (!(this instanceof me)) + return new me(t, e, r); + L0(this, t, e), this._didRealPath = false; var i = this.minimatch.set.length; - this.matches = new Array(i), typeof r == "function" && (r = P0(r), this.on("error", r), this.on("end", function(l) { + this.matches = new Array(i), typeof r == "function" && (r = F0(r), this.on("error", r), this.on("end", function(l) { r(null, l); })); var n = this; @@ -5550,14 +5564,14 @@ See: https://github.com/isaacs/node-glob/issues/167`); }) : n._finish()); } } - ve.prototype._finish = function() { - if (xs(this instanceof ve), !this.aborted) { + me.prototype._finish = function() { + if (xs(this instanceof me), !this.aborted) { if (this.realpath && !this._didRealpath) return this._realpath(); Vt.finish(this), this.emit("end", this.found); } }; - ve.prototype._realpath = function() { + me.prototype._realpath = function() { if (this._didRealpath) return; this._didRealpath = true; @@ -5570,7 +5584,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); --t === 0 && e._finish(); } }; - ve.prototype._realpathSet = function(t, e) { + me.prototype._realpathSet = function(t, e) { var r = this.matches[t]; if (!r) return e(); @@ -5579,24 +5593,24 @@ See: https://github.com/isaacs/node-glob/issues/167`); return e(); var o = this.matches[t] = Object.create(null); i.forEach(function(a, l) { - a = n._makeAbs(a), T0.realpath(a, n.realpathCache, function(c, u) { + a = n._makeAbs(a), A0.realpath(a, n.realpathCache, function(c, u) { c ? c.syscall === "stat" ? o[a] = true : n.emit("error", c) : o[u] = true, --s === 0 && (n.matches[t] = o, e()); }); }); }; - ve.prototype._mark = function(t) { + me.prototype._mark = function(t) { return Vt.mark(this, t); }; - ve.prototype._makeAbs = function(t) { + me.prototype._makeAbs = function(t) { return Vt.makeAbs(this, t); }; - ve.prototype.abort = function() { + me.prototype.abort = function() { this.aborted = true, this.emit("abort"); }; - ve.prototype.pause = function() { + me.prototype.pause = function() { this.paused || (this.paused = true, this.emit("pause")); }; - ve.prototype.resume = function() { + me.prototype.resume = function() { if (this.paused) { if (this.emit("resume"), this.paused = false, this._emitQueue.length) { var t = this._emitQueue.slice(0); @@ -5616,8 +5630,8 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } }; - ve.prototype._process = function(t, e, r, i) { - if (xs(this instanceof ve), xs(typeof i == "function"), !this.aborted) { + me.prototype._process = function(t, e, r, i) { + if (xs(this instanceof me), xs(typeof i == "function"), !this.aborted) { if (this._processing++, this.paused) { this._processQueue.push([t, e, r, i]); return; @@ -5637,21 +5651,21 @@ See: https://github.com/isaacs/node-glob/issues/167`); break; } var o = t.slice(n), a; - s === null ? a = "." : ((Gr(s) || Gr(t.join("/"))) && (!s || !Gr(s)) && (s = "/" + s), a = s); + s === null ? a = "." : ((zr(s) || zr(t.join("/"))) && (!s || !zr(s)) && (s = "/" + s), a = s); var l = this._makeAbs(a); - if (L0(this, a)) + if (N0(this, a)) return i(); - var c = o[0] === mu.GLOBSTAR; + var c = o[0] === vu.GLOBSTAR; c ? this._processGlobStar(s, a, l, o, e, r, i) : this._processReaddir(s, a, l, o, e, r, i); } }; - ve.prototype._processReaddir = function(t, e, r, i, n, s, o) { + me.prototype._processReaddir = function(t, e, r, i, n, s, o) { var a = this; this._readdir(r, s, function(l, c) { return a._processReaddir2(t, e, r, i, n, s, c, o); }); }; - ve.prototype._processReaddir2 = function(t, e, r, i, n, s, o, a) { + me.prototype._processReaddir2 = function(t, e, r, i, n, s, o, a) { if (!o) return a(); for (var l = i[0], c = !!this.minimatch.negate, u = l._glob, f = this.dot || u.charAt(0) === ".", h = [], p = 0; p < o.length; p++) { @@ -5679,13 +5693,13 @@ See: https://github.com/isaacs/node-glob/issues/167`); } a(); }; - ve.prototype._emitMatch = function(t, e) { - if (!this.aborted && !N0(this, e)) { + me.prototype._emitMatch = function(t, e) { + if (!this.aborted && !P0(this, e)) { if (this.paused) { this._emitQueue.push([t, e]); return; } - var r = Gr(e) ? e : this._makeAbs(e); + var r = zr(e) ? e : this._makeAbs(e); if (this.mark && (e = this._mark(e)), this.absolute && (e = r), !this.matches[t][e]) { if (this.nodir) { var i = this.cache[r]; @@ -5698,7 +5712,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } }; - ve.prototype._readdirInGlobStar = function(t, e) { + me.prototype._readdirInGlobStar = function(t, e) { if (this.aborted) return; if (this.follow) @@ -5712,7 +5726,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); i.symlinks[t] = l, !l && a && !a.isDirectory() ? (i.cache[t] = "FILE", e()) : i._readdir(t, false, e); } }; - ve.prototype._readdir = function(t, e, r) { + me.prototype._readdir = function(t, e, r) { if (!this.aborted && (r = ws2("readdir\0" + t + "\0" + e, r), !!r)) { if (e && !ys(this.symlinks, t)) return this._readdirInGlobStar(t, r); @@ -5724,15 +5738,15 @@ See: https://github.com/isaacs/node-glob/issues/167`); return r(null, i); } var n = this; - n.fs.readdir(t, U0(this, t, r)); + n.fs.readdir(t, D0(this, t, r)); } }; - function U0(t, e, r) { + function D0(t, e, r) { return function(i, n) { i ? t._readdirError(e, i, r) : t._readdirEntries(e, n, r); }; } - ve.prototype._readdirEntries = function(t, e, r) { + me.prototype._readdirEntries = function(t, e, r) { if (!this.aborted) { if (!this.mark && !this.stat) for (var i = 0; i < e.length; i++) { @@ -5742,7 +5756,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this.cache[t] = e, r(null, e); } }; - ve.prototype._readdirError = function(t, e, r) { + me.prototype._readdirError = function(t, e, r) { if (!this.aborted) { switch (e.code) { case "ENOTSUP": @@ -5766,13 +5780,13 @@ See: https://github.com/isaacs/node-glob/issues/167`); return r(); } }; - ve.prototype._processGlobStar = function(t, e, r, i, n, s, o) { + me.prototype._processGlobStar = function(t, e, r, i, n, s, o) { var a = this; this._readdir(r, s, function(l, c) { a._processGlobStar2(t, e, r, i, n, s, c, o); }); }; - ve.prototype._processGlobStar2 = function(t, e, r, i, n, s, o, a) { + me.prototype._processGlobStar2 = function(t, e, r, i, n, s, o, a) { if (!o) return a(); var l = i.slice(1), c = t ? [t] : [], u = c.concat(l); @@ -5791,22 +5805,22 @@ See: https://github.com/isaacs/node-glob/issues/167`); } a(); }; - ve.prototype._processSimple = function(t, e, r) { + me.prototype._processSimple = function(t, e, r) { var i = this; this._stat(t, function(n, s) { i._processSimple2(t, e, n, s, r); }); }; - ve.prototype._processSimple2 = function(t, e, r, i, n) { + me.prototype._processSimple2 = function(t, e, r, i, n) { if (this.matches[e] || (this.matches[e] = Object.create(null)), !i) return n(); - if (t && Gr(t) && !this.nomount) { + if (t && zr(t) && !this.nomount) { var s = /[\/\\]$/.test(t); t.charAt(0) === "/" ? t = _s.join(this.root, t) : (t = _s.resolve(this.root, t), s && (t += "/")); } process.platform === "win32" && (t = t.replace(/\\/g, "/")), this._emitMatch(e, t), n(); }; - ve.prototype._stat = function(t, e) { + me.prototype._stat = function(t, e) { var r = this._makeAbs(t), i = t.slice(-1) === "/"; if (t.length > this.maxLength) return e(); @@ -5834,7 +5848,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); l._stat2(t, r, f, h, e); } }; - ve.prototype._stat2 = function(t, e, r, i, n) { + me.prototype._stat2 = function(t, e, r, i, n) { if (r && (r.code === "ENOENT" || r.code === "ENOTDIR")) return this.statCache[e] = false, n(); var s = t.slice(-1) === "/"; @@ -5844,20 +5858,20 @@ See: https://github.com/isaacs/node-glob/issues/167`); return i && (o = i.isDirectory() ? "DIR" : "FILE"), this.cache[e] = this.cache[e] || o, s && o === "FILE" ? n() : n(null, o, i); }; }); - var Su = x((Lx, Eu) => { - var we = require("assert"), yu = require("path"), gu = require("fs"), mr; + var ku = x((Nx, Su) => { + var xe = require("assert"), bu = require("path"), _u = require("fs"), vr; try { - mr = ds(); + vr = ds(); } catch (e) { } - var D0 = { nosort: true, silent: true }, Es = 0, zr = process.platform === "win32", bu = (t) => { + var j0 = { nosort: true, silent: true }, Es = 0, Wr = process.platform === "win32", wu = (t) => { if (["unlink", "chmod", "stat", "lstat", "rmdir", "readdir"].forEach((r) => { - t[r] = t[r] || gu[r], r = r + "Sync", t[r] = t[r] || gu[r]; - }), t.maxBusyTries = t.maxBusyTries || 3, t.emfileWait = t.emfileWait || 1e3, t.glob === false && (t.disableGlob = true), t.disableGlob !== true && mr === void 0) + t[r] = t[r] || _u[r], r = r + "Sync", t[r] = t[r] || _u[r]; + }), t.maxBusyTries = t.maxBusyTries || 3, t.emfileWait = t.emfileWait || 1e3, t.glob === false && (t.disableGlob = true), t.disableGlob !== true && vr === void 0) throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); - t.disableGlob = t.disableGlob || false, t.glob = t.glob || D0; + t.disableGlob = t.disableGlob || false, t.glob = t.glob || j0; }, ks = (t, e, r) => { - typeof e == "function" && (r = e, e = {}), we(t, "rimraf: missing path"), we.equal(typeof t, "string", "rimraf: path should be a string"), we.equal(typeof r, "function", "rimraf: callback function required"), we(e, "rimraf: invalid options argument provided"), we.equal(typeof e, "object", "rimraf: options should be object"), bu(e); + typeof e == "function" && (r = e, e = {}), xe(t, "rimraf: missing path"), xe.equal(typeof t, "string", "rimraf: path should be a string"), xe.equal(typeof r, "function", "rimraf: callback function required"), xe(e, "rimraf: invalid options argument provided"), xe.equal(typeof e, "object", "rimraf: options should be object"), wu(e); let i = 0, n = null, s = 0, o = (l) => { n = n || l, --s === 0 && r(n); }, a = (l, c) => { @@ -5879,39 +5893,39 @@ See: https://github.com/isaacs/node-glob/issues/167`); Ss(u, e, f); }); }; - if (e.disableGlob || !mr.hasMagic(t)) + if (e.disableGlob || !vr.hasMagic(t)) return a(null, [t]); e.lstat(t, (l, c) => { if (!l) return a(null, [t]); - mr(t, e.glob, a); + vr(t, e.glob, a); }); }, Ss = (t, e, r) => { - we(t), we(e), we(typeof r == "function"), e.lstat(t, (i, n) => { + xe(t), xe(e), xe(typeof r == "function"), e.lstat(t, (i, n) => { if (i && i.code === "ENOENT") return r(null); - if (i && i.code === "EPERM" && zr && _u(t, e, i, r), n && n.isDirectory()) + if (i && i.code === "EPERM" && Wr && xu(t, e, i, r), n && n.isDirectory()) return Pi(t, e, i, r); e.unlink(t, (s) => { if (s) { if (s.code === "ENOENT") return r(null); if (s.code === "EPERM") - return zr ? _u(t, e, s, r) : Pi(t, e, s, r); + return Wr ? xu(t, e, s, r) : Pi(t, e, s, r); if (s.code === "EISDIR") return Pi(t, e, s, r); } return r(s); }); }); - }, _u = (t, e, r, i) => { - we(t), we(e), we(typeof i == "function"), e.chmod(t, 438, (n) => { + }, xu = (t, e, r, i) => { + xe(t), xe(e), xe(typeof i == "function"), e.chmod(t, 438, (n) => { n ? i(n.code === "ENOENT" ? null : r) : e.stat(t, (s, o) => { s ? i(s.code === "ENOENT" ? null : r) : o.isDirectory() ? Pi(t, e, r, i) : e.unlink(t, i); }); }); - }, xu = (t, e, r) => { - we(t), we(e); + }, yu = (t, e, r) => { + xe(t), xe(e); try { e.chmodSync(t, 438); } catch (n) { @@ -5929,11 +5943,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); } i.isDirectory() ? Fi(t, e, r) : e.unlinkSync(t); }, Pi = (t, e, r, i) => { - we(t), we(e), we(typeof i == "function"), e.rmdir(t, (n) => { - n && (n.code === "ENOTEMPTY" || n.code === "EEXIST" || n.code === "EPERM") ? j0(t, e, i) : n && n.code === "ENOTDIR" ? i(r) : i(n); + xe(t), xe(e), xe(typeof i == "function"), e.rmdir(t, (n) => { + n && (n.code === "ENOTEMPTY" || n.code === "EEXIST" || n.code === "EPERM") ? q0(t, e, i) : n && n.code === "ENOTDIR" ? i(r) : i(n); }); - }, j0 = (t, e, r) => { - we(t), we(e), we(typeof r == "function"), e.readdir(t, (i, n) => { + }, q0 = (t, e, r) => { + xe(t), xe(e), xe(typeof r == "function"), e.readdir(t, (i, n) => { if (i) return r(i); let s = n.length; @@ -5941,7 +5955,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); return e.rmdir(t, r); let o; n.forEach((a) => { - ks(yu.join(t, a), e, (l) => { + ks(bu.join(t, a), e, (l) => { if (!o) { if (l) return r(o = l); @@ -5950,16 +5964,16 @@ See: https://github.com/isaacs/node-glob/issues/167`); }); }); }); - }, wu = (t, e) => { - e = e || {}, bu(e), we(t, "rimraf: missing path"), we.equal(typeof t, "string", "rimraf: path should be a string"), we(e, "rimraf: missing options"), we.equal(typeof e, "object", "rimraf: options should be object"); + }, Eu = (t, e) => { + e = e || {}, wu(e), xe(t, "rimraf: missing path"), xe.equal(typeof t, "string", "rimraf: path should be a string"), xe(e, "rimraf: missing options"), xe.equal(typeof e, "object", "rimraf: options should be object"); let r; - if (e.disableGlob || !mr.hasMagic(t)) + if (e.disableGlob || !vr.hasMagic(t)) r = [t]; else try { e.lstatSync(t), r = [t]; } catch (e2) { - r = mr.sync(t, e.glob); + r = vr.sync(t, e.glob); } if (!!r.length) for (let i = 0; i < r.length; i++) { @@ -5969,7 +5983,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } catch (o) { if (o.code === "ENOENT") return; - o.code === "EPERM" && zr && xu(n, e, o); + o.code === "EPERM" && Wr && yu(n, e, o); } try { s && s.isDirectory() ? Fi(n, e, null) : e.unlinkSync(n); @@ -5977,14 +5991,14 @@ See: https://github.com/isaacs/node-glob/issues/167`); if (o.code === "ENOENT") return; if (o.code === "EPERM") - return zr ? xu(n, e, o) : Fi(n, e, o); + return Wr ? yu(n, e, o) : Fi(n, e, o); if (o.code !== "EISDIR") throw o; Fi(n, e, o); } } }, Fi = (t, e, r) => { - we(t), we(e); + xe(t), xe(e); try { e.rmdirSync(t); } catch (i) { @@ -5992,11 +6006,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); return; if (i.code === "ENOTDIR") throw r; - (i.code === "ENOTEMPTY" || i.code === "EEXIST" || i.code === "EPERM") && q0(t, e); + (i.code === "ENOTEMPTY" || i.code === "EEXIST" || i.code === "EPERM") && H0(t, e); } - }, q0 = (t, e) => { - we(t), we(e), e.readdirSync(t).forEach((n) => wu(yu.join(t, n), e)); - let r = zr ? 100 : 1, i = 0; + }, H0 = (t, e) => { + xe(t), xe(e), e.readdirSync(t).forEach((n) => Eu(bu.join(t, n), e)); + let r = Wr ? 100 : 1, i = 0; do { let n = true; try { @@ -6008,17 +6022,17 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } while (true); }; - Eu.exports = ks; - ks.sync = wu; + Su.exports = ks; + ks.sync = Eu; }); - var Cu = x((ku) => { + var Ou = x((Cu) => { "use strict"; - var q = ku, Mi = require("buffer").Buffer, H0 = require("os"); - q.toBuffer = function(t, e, r) { + var H = Cu, Mi = require("buffer").Buffer, V0 = require("os"); + H.toBuffer = function(t, e, r) { r = ~~r; var i; if (this.isV4Format(t)) - i = e || new Mi(r + 4), t.split(/\./g).map(function(u) { + i = e || Mi.alloc(r + 4), t.split(/\./g).map(function(u) { i[r++] = parseInt(u, 10) & 255; }); else if (this.isV6Format(t)) { @@ -6041,7 +6055,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); l.push("0"); n.splice.apply(n, l); } - for (i = e || new Mi(r + 16), s = 0; s < n.length; s++) { + for (i = e || Mi.alloc(r + 16), s = 0; s < n.length; s++) { var c = parseInt(n[s], 16); i[r++] = c >> 8 & 255, i[r++] = c & 255; } @@ -6050,7 +6064,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); throw Error("Invalid ip address: " + t); return i; }; - q.toString = function(t, e, r) { + H.toString = function(t, e, r) { e = ~~e, r = r || t.length - e; var i = []; if (r === 4) { @@ -6064,29 +6078,29 @@ See: https://github.com/isaacs/node-glob/issues/167`); } return i; }; - var V0 = /^(\d{1,3}\.){3,3}\d{1,3}$/, $0 = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; - q.isV4Format = function(t) { - return V0.test(t); - }; - q.isV6Format = function(t) { + var $0 = /^(\d{1,3}\.){3,3}\d{1,3}$/, G0 = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; + H.isV4Format = function(t) { return $0.test(t); }; + H.isV6Format = function(t) { + return G0.test(t); + }; function Cs(t) { return t ? t.toLowerCase() : "ipv4"; } - q.fromPrefixLen = function(t, e) { + H.fromPrefixLen = function(t, e) { t > 32 ? e = "ipv6" : e = Cs(e); var r = 4; e === "ipv6" && (r = 16); - for (var i = new Mi(r), n = 0, s = i.length; n < s; ++n) { + for (var i = Mi.alloc(r), n = 0, s = i.length; n < s; ++n) { var o = 8; t < 8 && (o = t), t -= o, i[n] = ~(255 >> o) & 255; } - return q.toString(i); + return H.toString(i); }; - q.mask = function(t, e) { - t = q.toBuffer(t), e = q.toBuffer(e); - var r = new Mi(Math.max(t.length, e.length)), i = 0; + H.mask = function(t, e) { + t = H.toBuffer(t), e = H.toBuffer(e); + var r = Mi.alloc(Math.max(t.length, e.length)), i = 0; if (t.length === e.length) for (i = 0; i < t.length; i++) r[i] = t[i] & e[i]; @@ -6102,54 +6116,54 @@ See: https://github.com/isaacs/node-glob/issues/167`); } for (; i < r.length; i++) r[i] = 0; - return q.toString(r); + return H.toString(r); }; - q.cidr = function(t) { + H.cidr = function(t) { var e = t.split("/"), r = e[0]; if (e.length !== 2) throw new Error("invalid CIDR subnet: " + r); - var i = q.fromPrefixLen(parseInt(e[1], 10)); - return q.mask(r, i); + var i = H.fromPrefixLen(parseInt(e[1], 10)); + return H.mask(r, i); }; - q.subnet = function(t, e) { - for (var r = q.toLong(q.mask(t, e)), i = q.toBuffer(e), n = 0, s = 0; s < i.length; s++) + H.subnet = function(t, e) { + for (var r = H.toLong(H.mask(t, e)), i = H.toBuffer(e), n = 0, s = 0; s < i.length; s++) if (i[s] === 255) n += 8; else for (var o = i[s] & 255; o; ) o = o << 1 & 255, n++; var a = Math.pow(2, 32 - n); - return { networkAddress: q.fromLong(r), firstAddress: a <= 2 ? q.fromLong(r) : q.fromLong(r + 1), lastAddress: a <= 2 ? q.fromLong(r + a - 1) : q.fromLong(r + a - 2), broadcastAddress: q.fromLong(r + a - 1), subnetMask: e, subnetMaskLength: n, numHosts: a <= 2 ? a : a - 2, length: a, contains: function(l) { - return r === q.toLong(q.mask(l, e)); + return { networkAddress: H.fromLong(r), firstAddress: a <= 2 ? H.fromLong(r) : H.fromLong(r + 1), lastAddress: a <= 2 ? H.fromLong(r + a - 1) : H.fromLong(r + a - 2), broadcastAddress: H.fromLong(r + a - 1), subnetMask: e, subnetMaskLength: n, numHosts: a <= 2 ? a : a - 2, length: a, contains: function(l) { + return r === H.toLong(H.mask(l, e)); } }; }; - q.cidrSubnet = function(t) { + H.cidrSubnet = function(t) { var e = t.split("/"), r = e[0]; if (e.length !== 2) throw new Error("invalid CIDR subnet: " + r); - var i = q.fromPrefixLen(parseInt(e[1], 10)); - return q.subnet(r, i); + var i = H.fromPrefixLen(parseInt(e[1], 10)); + return H.subnet(r, i); }; - q.not = function(t) { - for (var e = q.toBuffer(t), r = 0; r < e.length; r++) + H.not = function(t) { + for (var e = H.toBuffer(t), r = 0; r < e.length; r++) e[r] = 255 ^ e[r]; - return q.toString(e); + return H.toString(e); }; - q.or = function(t, e) { - if (t = q.toBuffer(t), e = q.toBuffer(e), t.length === e.length) { + H.or = function(t, e) { + if (t = H.toBuffer(t), e = H.toBuffer(e), t.length === e.length) { for (var r = 0; r < t.length; ++r) t[r] |= e[r]; - return q.toString(t); + return H.toString(t); } else { var i = t, n = e; e.length > t.length && (i = e, n = t); for (var s = i.length - n.length, r = s; r < i.length; ++r) i[r] |= n[r - s]; - return q.toString(i); + return H.toString(i); } }; - q.isEqual = function(t, e) { - if (t = q.toBuffer(t), e = q.toBuffer(e), t.length === e.length) { + H.isEqual = function(t, e) { + if (t = H.toBuffer(t), e = H.toBuffer(e), t.length === e.length) { for (var r = 0; r < t.length; r++) if (t[r] !== e[r]) return false; @@ -6170,22 +6184,22 @@ See: https://github.com/isaacs/node-glob/issues/167`); return false; return true; }; - q.isPrivate = function(t) { + H.isPrivate = function(t) { return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t) || /^f[cd][0-9a-f]{2}:/i.test(t) || /^fe80:/i.test(t) || /^::1$/.test(t) || /^::$/.test(t); }; - q.isPublic = function(t) { - return !q.isPrivate(t); + H.isPublic = function(t) { + return !H.isPrivate(t); }; - q.isLoopback = function(t) { + H.isLoopback = function(t) { return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(t) || /^fe80::1$/.test(t) || /^::1$/.test(t) || /^::$/.test(t); }; - q.loopback = function(t) { + H.loopback = function(t) { if (t = Cs(t), t !== "ipv4" && t !== "ipv6") throw new Error("family must be ipv4 or ipv6"); return t === "ipv4" ? "127.0.0.1" : "fe80::1"; }; - q.address = function(t, e) { - var r = H0.networkInterfaces(), n; + H.address = function(t, e) { + var r = V0.networkInterfaces(), n; if (e = Cs(e), t && t !== "private" && t !== "public") { var i = r[t].filter(function(s) { var o = s.family.toLowerCase(); @@ -6195,89 +6209,89 @@ See: https://github.com/isaacs/node-glob/issues/167`); } var n = Object.keys(r).map(function(s) { var o = r[s].filter(function(a) { - return a.family = a.family.toLowerCase(), a.family !== e || q.isLoopback(a.address) ? false : t ? t === "public" ? q.isPrivate(a.address) : q.isPublic(a.address) : true; + return a.family = a.family.toLowerCase(), a.family !== e || H.isLoopback(a.address) ? false : t ? t === "public" ? H.isPrivate(a.address) : H.isPublic(a.address) : true; }); return o.length ? o[0].address : void 0; }).filter(Boolean); - return n.length ? n[0] : q.loopback(e); + return n.length ? n[0] : H.loopback(e); }; - q.toLong = function(t) { + H.toLong = function(t) { var e = 0; return t.split(".").forEach(function(r) { e <<= 8, e += parseInt(r); }), e >>> 0; }; - q.fromLong = function(t) { + H.fromLong = function(t) { return (t >>> 24) + "." + (t >> 16 & 255) + "." + (t >> 8 & 255) + "." + (t & 255); }; }); - var Au = x((ft) => { + var Ru = x((ht) => { "use strict"; - Object.defineProperty(ft, "__esModule", { value: true }); - var Ou = require("buffer"), $t = { INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.", INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.", INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.", INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.", INVALID_OFFSET: "An invalid offset value was provided.", INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.", INVALID_LENGTH: "An invalid length value was provided.", INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.", INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.", INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.", INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.", INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data." }; - ft.ERRORS = $t; - function G0(t) { - if (!Ou.Buffer.isEncoding(t)) + Object.defineProperty(ht, "__esModule", { value: true }); + var Iu = require("buffer"), $t = { INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.", INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.", INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.", INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.", INVALID_OFFSET: "An invalid offset value was provided.", INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.", INVALID_LENGTH: "An invalid length value was provided.", INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.", INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.", INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.", INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.", INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data." }; + ht.ERRORS = $t; + function z0(t) { + if (!Iu.Buffer.isEncoding(t)) throw new Error($t.INVALID_ENCODING); } - ft.checkEncoding = G0; - function Iu(t) { - return typeof t == "number" && isFinite(t) && K0(t); + ht.checkEncoding = z0; + function Tu(t) { + return typeof t == "number" && isFinite(t) && Z0(t); } - ft.isFiniteInteger = Iu; - function Tu(t, e) { + ht.isFiniteInteger = Tu; + function Au(t, e) { if (typeof t == "number") { - if (!Iu(t) || t < 0) + if (!Tu(t) || t < 0) throw new Error(e ? $t.INVALID_OFFSET : $t.INVALID_LENGTH); } else throw new Error(e ? $t.INVALID_OFFSET_NON_NUMBER : $t.INVALID_LENGTH_NON_NUMBER); } - function z0(t) { - Tu(t, false); - } - ft.checkLengthValue = z0; function W0(t) { - Tu(t, true); + Au(t, false); + } + ht.checkLengthValue = W0; + function Y0(t) { + Au(t, true); } - ft.checkOffsetValue = W0; - function Y0(t, e) { + ht.checkOffsetValue = Y0; + function K0(t, e) { if (t < 0 || t > e.length) throw new Error($t.INVALID_TARGET_OFFSET); } - ft.checkTargetOffset = Y0; - function K0(t) { + ht.checkTargetOffset = K0; + function Z0(t) { return typeof t == "number" && isFinite(t) && Math.floor(t) === t; } - function Z0(t) { + function X0(t) { if (typeof BigInt == "undefined") throw new Error("Platform does not support JS BigInt type."); - if (typeof Ou.Buffer.prototype[t] == "undefined") + if (typeof Iu.Buffer.prototype[t] == "undefined") throw new Error(`Platform does not support Buffer.prototype.${t}.`); } - ft.bigIntAndBufferInt64Check = Z0; + ht.bigIntAndBufferInt64Check = X0; }); - var Bu = x((Os) => { + var Lu = x((Os) => { "use strict"; Object.defineProperty(Os, "__esModule", { value: true }); - var te = Au(), Ru = 4096, X0 = "utf8", Ui = class { + var re = Ru(), Bu = 4096, Q0 = "utf8", Ui = class { constructor(e) { - if (this.length = 0, this._encoding = X0, this._writeOffset = 0, this._readOffset = 0, Ui.isSmartBufferOptions(e)) - if (e.encoding && (te.checkEncoding(e.encoding), this._encoding = e.encoding), e.size) - if (te.isFiniteInteger(e.size) && e.size > 0) + if (this.length = 0, this._encoding = Q0, this._writeOffset = 0, this._readOffset = 0, Ui.isSmartBufferOptions(e)) + if (e.encoding && (re.checkEncoding(e.encoding), this._encoding = e.encoding), e.size) + if (re.isFiniteInteger(e.size) && e.size > 0) this._buff = Buffer.allocUnsafe(e.size); else - throw new Error(te.ERRORS.INVALID_SMARTBUFFER_SIZE); + throw new Error(re.ERRORS.INVALID_SMARTBUFFER_SIZE); else if (e.buff) if (Buffer.isBuffer(e.buff)) this._buff = e.buff, this.length = e.buff.length; else - throw new Error(te.ERRORS.INVALID_SMARTBUFFER_BUFFER); + throw new Error(re.ERRORS.INVALID_SMARTBUFFER_BUFFER); else - this._buff = Buffer.allocUnsafe(Ru); + this._buff = Buffer.allocUnsafe(Bu); else { if (typeof e != "undefined") - throw new Error(te.ERRORS.INVALID_SMARTBUFFER_OBJECT); - this._buff = Buffer.allocUnsafe(Ru); + throw new Error(re.ERRORS.INVALID_SMARTBUFFER_OBJECT); + this._buff = Buffer.allocUnsafe(Bu); } } static fromSize(e, r) { @@ -6309,10 +6323,10 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._readNumberValue(Buffer.prototype.readInt32LE, 4, e); } readBigInt64BE(e) { - return te.bigIntAndBufferInt64Check("readBigInt64BE"), this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, e); + return re.bigIntAndBufferInt64Check("readBigInt64BE"), this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, e); } readBigInt64LE(e) { - return te.bigIntAndBufferInt64Check("readBigInt64LE"), this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, e); + return re.bigIntAndBufferInt64Check("readBigInt64LE"), this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, e); } writeInt8(e, r) { return this._writeNumberValue(Buffer.prototype.writeInt8, 1, e, r), this; @@ -6345,16 +6359,16 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, e, r); } writeBigInt64BE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigInt64BE"), this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigInt64BE"), this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, e, r); } insertBigInt64BE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigInt64BE"), this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigInt64BE"), this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, e, r); } writeBigInt64LE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigInt64LE"), this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigInt64LE"), this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, e, r); } insertBigInt64LE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigInt64LE"), this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigInt64LE"), this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, e, r); } readUInt8(e) { return this._readNumberValue(Buffer.prototype.readUInt8, 1, e); @@ -6372,10 +6386,10 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, e); } readBigUInt64BE(e) { - return te.bigIntAndBufferInt64Check("readBigUInt64BE"), this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, e); + return re.bigIntAndBufferInt64Check("readBigUInt64BE"), this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, e); } readBigUInt64LE(e) { - return te.bigIntAndBufferInt64Check("readBigUInt64LE"), this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, e); + return re.bigIntAndBufferInt64Check("readBigUInt64LE"), this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, e); } writeUInt8(e, r) { return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, e, r); @@ -6408,16 +6422,16 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, e, r); } writeBigUInt64BE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigUInt64BE"), this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigUInt64BE"), this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, e, r); } insertBigUInt64BE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigUInt64BE"), this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigUInt64BE"), this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, e, r); } writeBigUInt64LE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigUInt64LE"), this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigUInt64LE"), this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, e, r); } insertBigUInt64LE(e, r) { - return te.bigIntAndBufferInt64Check("writeBigUInt64LE"), this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, e, r); + return re.bigIntAndBufferInt64Check("writeBigUInt64LE"), this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, e, r); } readFloatBE(e) { return this._readNumberValue(Buffer.prototype.readFloatBE, 4, e); @@ -6457,18 +6471,18 @@ See: https://github.com/isaacs/node-glob/issues/167`); } readString(e, r) { let i; - typeof e == "number" ? (te.checkLengthValue(e), i = Math.min(e, this.length - this._readOffset)) : (r = e, i = this.length - this._readOffset), typeof r != "undefined" && te.checkEncoding(r); + typeof e == "number" ? (re.checkLengthValue(e), i = Math.min(e, this.length - this._readOffset)) : (r = e, i = this.length - this._readOffset), typeof r != "undefined" && re.checkEncoding(r); let n = this._buff.slice(this._readOffset, this._readOffset + i).toString(r || this._encoding); return this._readOffset += i, n; } insertString(e, r, i) { - return te.checkOffsetValue(r), this._handleString(e, true, r, i); + return re.checkOffsetValue(r), this._handleString(e, true, r, i); } writeString(e, r, i) { return this._handleString(e, false, r, i); } readStringNT(e) { - typeof e != "undefined" && te.checkEncoding(e); + typeof e != "undefined" && re.checkEncoding(e); let r = this.length; for (let n = this._readOffset; n < this.length; n++) if (this._buff[n] === 0) { @@ -6479,18 +6493,18 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._readOffset = r + 1, i.toString(e || this._encoding); } insertStringNT(e, r, i) { - return te.checkOffsetValue(r), this.insertString(e, r, i), this.insertUInt8(0, r + e.length), this; + return re.checkOffsetValue(r), this.insertString(e, r, i), this.insertUInt8(0, r + e.length), this; } writeStringNT(e, r, i) { return this.writeString(e, r, i), this.writeUInt8(0, typeof r == "number" ? r + e.length : this.writeOffset), this; } readBuffer(e) { - typeof e != "undefined" && te.checkLengthValue(e); + typeof e != "undefined" && re.checkLengthValue(e); let r = typeof e == "number" ? e : this.length, i = Math.min(this.length, this._readOffset + r), n = this._buff.slice(this._readOffset, i); return this._readOffset = i, n; } insertBuffer(e, r) { - return te.checkOffsetValue(r), this._handleBuffer(e, true, r); + return re.checkOffsetValue(r), this._handleBuffer(e, true, r); } writeBuffer(e, r) { return this._handleBuffer(e, false, r); @@ -6506,10 +6520,10 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._readOffset = e + 1, r; } insertBufferNT(e, r) { - return te.checkOffsetValue(r), this.insertBuffer(e, r), this.insertUInt8(0, r + e.length), this; + return re.checkOffsetValue(r), this.insertBuffer(e, r), this.insertUInt8(0, r + e.length), this; } writeBufferNT(e, r) { - return typeof r != "undefined" && te.checkOffsetValue(r), this.writeBuffer(e, r), this.writeUInt8(0, typeof r == "number" ? r + e.length : this._writeOffset), this; + return typeof r != "undefined" && re.checkOffsetValue(r), this.writeBuffer(e, r), this.writeUInt8(0, typeof r == "number" ? r + e.length : this._writeOffset), this; } clear() { return this._writeOffset = 0, this._readOffset = 0, this.length = 0, this; @@ -6521,19 +6535,19 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._readOffset; } set readOffset(e) { - te.checkOffsetValue(e), te.checkTargetOffset(e, this), this._readOffset = e; + re.checkOffsetValue(e), re.checkTargetOffset(e, this), this._readOffset = e; } get writeOffset() { return this._writeOffset; } set writeOffset(e) { - te.checkOffsetValue(e), te.checkTargetOffset(e, this), this._writeOffset = e; + re.checkOffsetValue(e), re.checkTargetOffset(e, this), this._writeOffset = e; } get encoding() { return this._encoding; } set encoding(e) { - te.checkEncoding(e), this._encoding = e; + re.checkEncoding(e), this._encoding = e; } get internalBuffer() { return this._buff; @@ -6543,14 +6557,14 @@ See: https://github.com/isaacs/node-glob/issues/167`); } toString(e) { let r = typeof e == "string" ? e : this._encoding; - return te.checkEncoding(r), this._buff.toString(r, 0, this.length); + return re.checkEncoding(r), this._buff.toString(r, 0, this.length); } destroy() { return this.clear(), this; } _handleString(e, r, i, n) { let s = this._writeOffset, o = this._encoding; - typeof i == "number" ? s = i : typeof i == "string" && (te.checkEncoding(i), o = i), typeof n == "string" && (te.checkEncoding(n), o = n); + typeof i == "number" ? s = i : typeof i == "string" && (re.checkEncoding(i), o = i), typeof n == "string" && (re.checkEncoding(n), o = n); let a = Buffer.byteLength(e, o); return r ? this.ensureInsertable(a, s) : this._ensureWriteable(a, s), this._buff.write(e, s, a, o), r ? this._writeOffset += a : typeof i == "number" ? this._writeOffset = Math.max(this._writeOffset, s + a) : this._writeOffset += a, this; } @@ -6560,11 +6574,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); } ensureReadable(e, r) { let i = this._readOffset; - if (typeof r != "undefined" && (te.checkOffsetValue(r), i = r), i < 0 || i + e > this.length) - throw new Error(te.ERRORS.INVALID_READ_BEYOND_BOUNDS); + if (typeof r != "undefined" && (re.checkOffsetValue(r), i = r), i < 0 || i + e > this.length) + throw new Error(re.ERRORS.INVALID_READ_BEYOND_BOUNDS); } ensureInsertable(e, r) { - te.checkOffsetValue(r), this._ensureCapacity(this.length + e), r < this.length && this._buff.copy(this._buff, r + e, r, this._buff.length), r + e > this.length ? this.length = r + e : this.length += e; + re.checkOffsetValue(r), this._ensureCapacity(this.length + e), r < this.length && this._buff.copy(this._buff, r + e, r, this._buff.length), r + e > this.length ? this.length = r + e : this.length += e; } _ensureWriteable(e, r) { let i = typeof r == "number" ? r : this._writeOffset; @@ -6583,13 +6597,13 @@ See: https://github.com/isaacs/node-glob/issues/167`); return typeof i == "undefined" && (this._readOffset += r), n; } _insertNumberValue(e, r, i, n) { - return te.checkOffsetValue(n), this.ensureInsertable(r, n), e.call(this._buff, i, n), this._writeOffset += r, this; + return re.checkOffsetValue(n), this.ensureInsertable(r, n), e.call(this._buff, i, n), this._writeOffset += r, this; } _writeNumberValue(e, r, i, n) { if (typeof n == "number") { if (n < 0) - throw new Error(te.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); - te.checkOffsetValue(n); + throw new Error(re.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); + re.checkOffsetValue(n); } let s = typeof n == "number" ? n : this._writeOffset; return this._ensureWriteable(r, s), e.call(this._buff, i, s), typeof n == "number" ? this._writeOffset = Math.max(this._writeOffset, s + r) : this._writeOffset += r, this; @@ -6597,134 +6611,134 @@ See: https://github.com/isaacs/node-glob/issues/167`); }; Os.SmartBuffer = Ui; }); - var Ns = x((Se) => { + var Ns = x((we) => { "use strict"; - Object.defineProperty(Se, "__esModule", { value: true }); - Se.SOCKS5_NO_ACCEPTABLE_AUTH = Se.SOCKS5_CUSTOM_AUTH_END = Se.SOCKS5_CUSTOM_AUTH_START = Se.SOCKS_INCOMING_PACKET_SIZES = Se.SocksClientState = Se.Socks5Response = Se.Socks5HostType = Se.Socks5Auth = Se.Socks4Response = Se.SocksCommand = Se.ERRORS = Se.DEFAULT_TIMEOUT = void 0; - var Q0 = 3e4; - Se.DEFAULT_TIMEOUT = Q0; - var J0 = { InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.", InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.", InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.", InvalidSocksClientOptionsDestination: "An invalid destination host was provided.", InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.", InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.", InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).", InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.", InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.", InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.", NegotiationError: "Negotiation error", SocketClosed: "Socket closed", ProxyConnectionTimedOut: "Proxy connection timed out", InternalError: "SocksClient internal error (this should not happen)", InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response", Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection", InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response", Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection", InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response", InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)", InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)", InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)", Socks5AuthenticationFailed: "Socks5 Authentication failed", InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response", InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection", InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response", Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection" }; - Se.ERRORS = J0; - var ev = { Socks5InitialHandshakeResponse: 2, Socks5UserPassAuthenticationResponse: 2, Socks5ResponseHeader: 5, Socks5ResponseIPv4: 10, Socks5ResponseIPv6: 22, Socks5ResponseHostname: (t) => t + 7, Socks4Response: 8 }; - Se.SOCKS_INCOMING_PACKET_SIZES = ev; + Object.defineProperty(we, "__esModule", { value: true }); + we.SOCKS5_NO_ACCEPTABLE_AUTH = we.SOCKS5_CUSTOM_AUTH_END = we.SOCKS5_CUSTOM_AUTH_START = we.SOCKS_INCOMING_PACKET_SIZES = we.SocksClientState = we.Socks5Response = we.Socks5HostType = we.Socks5Auth = we.Socks4Response = we.SocksCommand = we.ERRORS = we.DEFAULT_TIMEOUT = void 0; + var J0 = 3e4; + we.DEFAULT_TIMEOUT = J0; + var ev = { InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.", InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.", InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.", InvalidSocksClientOptionsDestination: "An invalid destination host was provided.", InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.", InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.", InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).", InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.", InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.", InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.", NegotiationError: "Negotiation error", SocketClosed: "Socket closed", ProxyConnectionTimedOut: "Proxy connection timed out", InternalError: "SocksClient internal error (this should not happen)", InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response", Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection", InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response", Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection", InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response", InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)", InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)", InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)", Socks5AuthenticationFailed: "Socks5 Authentication failed", InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response", InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection", InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response", Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection" }; + we.ERRORS = ev; + var tv = { Socks5InitialHandshakeResponse: 2, Socks5UserPassAuthenticationResponse: 2, Socks5ResponseHeader: 5, Socks5ResponseIPv4: 10, Socks5ResponseIPv6: 22, Socks5ResponseHostname: (t) => t + 7, Socks4Response: 8 }; + we.SOCKS_INCOMING_PACKET_SIZES = tv; var Is; (function(t) { t[t.connect = 1] = "connect", t[t.bind = 2] = "bind", t[t.associate = 3] = "associate"; })(Is || (Is = {})); - Se.SocksCommand = Is; + we.SocksCommand = Is; var Ts; (function(t) { t[t.Granted = 90] = "Granted", t[t.Failed = 91] = "Failed", t[t.Rejected = 92] = "Rejected", t[t.RejectedIdent = 93] = "RejectedIdent"; })(Ts || (Ts = {})); - Se.Socks4Response = Ts; + we.Socks4Response = Ts; var As; (function(t) { t[t.NoAuth = 0] = "NoAuth", t[t.GSSApi = 1] = "GSSApi", t[t.UserPass = 2] = "UserPass"; })(As || (As = {})); - Se.Socks5Auth = As; - var tv = 128; - Se.SOCKS5_CUSTOM_AUTH_START = tv; - var rv = 254; - Se.SOCKS5_CUSTOM_AUTH_END = rv; - var iv = 255; - Se.SOCKS5_NO_ACCEPTABLE_AUTH = iv; + we.Socks5Auth = As; + var rv = 128; + we.SOCKS5_CUSTOM_AUTH_START = rv; + var iv = 254; + we.SOCKS5_CUSTOM_AUTH_END = iv; + var nv = 255; + we.SOCKS5_NO_ACCEPTABLE_AUTH = nv; var Rs; (function(t) { t[t.Granted = 0] = "Granted", t[t.Failure = 1] = "Failure", t[t.NotAllowed = 2] = "NotAllowed", t[t.NetworkUnreachable = 3] = "NetworkUnreachable", t[t.HostUnreachable = 4] = "HostUnreachable", t[t.ConnectionRefused = 5] = "ConnectionRefused", t[t.TTLExpired = 6] = "TTLExpired", t[t.CommandNotSupported = 7] = "CommandNotSupported", t[t.AddressNotSupported = 8] = "AddressNotSupported"; })(Rs || (Rs = {})); - Se.Socks5Response = Rs; + we.Socks5Response = Rs; var Bs; (function(t) { t[t.IPv4 = 1] = "IPv4", t[t.Hostname = 3] = "Hostname", t[t.IPv6 = 4] = "IPv6"; })(Bs || (Bs = {})); - Se.Socks5HostType = Bs; + we.Socks5HostType = Bs; var Ls; (function(t) { t[t.Created = 0] = "Created", t[t.Connecting = 1] = "Connecting", t[t.Connected = 2] = "Connected", t[t.SentInitialHandshake = 3] = "SentInitialHandshake", t[t.ReceivedInitialHandshakeResponse = 4] = "ReceivedInitialHandshakeResponse", t[t.SentAuthentication = 5] = "SentAuthentication", t[t.ReceivedAuthenticationResponse = 6] = "ReceivedAuthenticationResponse", t[t.SentFinalHandshake = 7] = "SentFinalHandshake", t[t.ReceivedFinalResponse = 8] = "ReceivedFinalResponse", t[t.BoundWaitingForConnection = 9] = "BoundWaitingForConnection", t[t.Established = 10] = "Established", t[t.Disconnected = 11] = "Disconnected", t[t.Error = 99] = "Error"; })(Ls || (Ls = {})); - Se.SocksClientState = Ls; + we.SocksClientState = Ls; }); - var Ps = x((vr) => { + var Ps = x((gr) => { "use strict"; - Object.defineProperty(vr, "__esModule", { value: true }); - vr.shuffleArray = vr.SocksClientError = void 0; - var Lu = class extends Error { + Object.defineProperty(gr, "__esModule", { value: true }); + gr.shuffleArray = gr.SocksClientError = void 0; + var Nu = class extends Error { constructor(e, r) { super(e); this.options = r; } }; - vr.SocksClientError = Lu; - function nv(t) { + gr.SocksClientError = Nu; + function sv(t) { for (let e = t.length - 1; e > 0; e--) { let r = Math.floor(Math.random() * (e + 1)); [t[e], t[r]] = [t[r], t[e]]; } } - vr.shuffleArray = nv; + gr.shuffleArray = sv; }); - var Uu = x((gr) => { + var Du = x((_r) => { "use strict"; - Object.defineProperty(gr, "__esModule", { value: true }); - gr.validateSocksClientChainOptions = gr.validateSocksClientOptions = void 0; - var ze = Ps(), Fe = Ns(), sv = require("stream"); - function ov(t, e = ["connect", "bind", "associate"]) { - if (!Fe.SocksCommand[t.command]) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksCommand, t); + Object.defineProperty(_r, "__esModule", { value: true }); + _r.validateSocksClientChainOptions = _r.validateSocksClientOptions = void 0; + var Ge = Ps(), Pe = Ns(), ov = require("stream"); + function av(t, e = ["connect", "bind", "associate"]) { + if (!Pe.SocksCommand[t.command]) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksCommand, t); if (e.indexOf(t.command) === -1) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksCommandForOperation, t); - if (!Pu(t.destination)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsDestination, t); - if (!Fu(t.proxy)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsProxy, t); - if (Nu(t.proxy, t), t.timeout && !Mu(t.timeout)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsTimeout, t); - if (t.existing_socket && !(t.existing_socket instanceof sv.Duplex)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsExistingSocket, t); - } - gr.validateSocksClientOptions = ov; - function av(t) { + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksCommandForOperation, t); + if (!Fu(t.destination)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsDestination, t); + if (!Mu(t.proxy)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsProxy, t); + if (Pu(t.proxy, t), t.timeout && !Uu(t.timeout)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsTimeout, t); + if (t.existing_socket && !(t.existing_socket instanceof ov.Duplex)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsExistingSocket, t); + } + _r.validateSocksClientOptions = av; + function lv(t) { if (t.command !== "connect") - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksCommandChain, t); - if (!Pu(t.destination)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsDestination, t); + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksCommandChain, t); + if (!Fu(t.destination)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsDestination, t); if (!(t.proxies && Array.isArray(t.proxies) && t.proxies.length >= 2)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsProxiesLength, t); + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsProxiesLength, t); if (t.proxies.forEach((e) => { - if (!Fu(e)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsProxy, t); - Nu(e, t); - }), t.timeout && !Mu(t.timeout)) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsTimeout, t); - } - gr.validateSocksClientChainOptions = av; - function Nu(t, e) { + if (!Mu(e)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsProxy, t); + Pu(e, t); + }), t.timeout && !Uu(t.timeout)) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsTimeout, t); + } + _r.validateSocksClientChainOptions = lv; + function Pu(t, e) { if (t.custom_auth_method !== void 0) { - if (t.custom_auth_method < Fe.SOCKS5_CUSTOM_AUTH_START || t.custom_auth_method > Fe.SOCKS5_CUSTOM_AUTH_END) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsCustomAuthRange, e); + if (t.custom_auth_method < Pe.SOCKS5_CUSTOM_AUTH_START || t.custom_auth_method > Pe.SOCKS5_CUSTOM_AUTH_END) + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthRange, e); if (t.custom_auth_request_handler === void 0 || typeof t.custom_auth_request_handler != "function") - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, e); + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, e); if (t.custom_auth_response_size === void 0) - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, e); + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, e); if (t.custom_auth_response_handler === void 0 || typeof t.custom_auth_response_handler != "function") - throw new ze.SocksClientError(Fe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, e); + throw new Ge.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, e); } } - function Pu(t) { + function Fu(t) { return t && typeof t.host == "string" && typeof t.port == "number" && t.port >= 0 && t.port <= 65535; } - function Fu(t) { + function Mu(t) { return t && (typeof t.host == "string" || typeof t.ipaddress == "string") && typeof t.port == "number" && t.port >= 0 && t.port <= 65535 && (t.type === 4 || t.type === 5); } - function Mu(t) { + function Uu(t) { return typeof t == "number" && t > 0; } }); - var ju = x((Di) => { + var qu = x((Di) => { "use strict"; Object.defineProperty(Di, "__esModule", { value: true }); Di.ReceiveBuffer = void 0; - var Du = class { + var ju = class { constructor(e = 4096) { this.buffer = Buffer.allocUnsafe(e), this.offset = 0, this.originalSize = e; } @@ -6752,11 +6766,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this.buffer.slice(0, e).copy(r), this.buffer.copyWithin(0, e, e + this.offset - e), this.offset -= e, r; } }; - Di.ReceiveBuffer = Du; + Di.ReceiveBuffer = ju; }); - var qu = x((St) => { + var Hu = x((kt) => { "use strict"; - var _r = St && St.__awaiter || function(t, e, r, i) { + var xr = kt && kt.__awaiter || function(t, e, r, i) { function n(s) { return s instanceof r ? s : new r(function(o) { o(s); @@ -6783,13 +6797,13 @@ See: https://github.com/isaacs/node-glob/issues/167`); c((i = i.apply(t, e || [])).next()); }); }; - Object.defineProperty(St, "__esModule", { value: true }); - St.SocksClientError = St.SocksClient = void 0; - var lv = require("events"), xr = require("net"), Xe = Cu(), Ye = Bu(), k = Ns(), Fs = Uu(), cv = ju(), Ms = Ps(); - Object.defineProperty(St, "SocksClientError", { enumerable: true, get: function() { + Object.defineProperty(kt, "__esModule", { value: true }); + kt.SocksClientError = kt.SocksClient = void 0; + var cv = require("events"), yr = require("net"), Ke = Ou(), ze = Lu(), k = Ns(), Fs = Du(), uv = qu(), Ms = Ps(); + Object.defineProperty(kt, "SocksClientError", { enumerable: true, get: function() { return Ms.SocksClientError; } }); - var Wr = class extends lv.EventEmitter { + var Yr = class extends cv.EventEmitter { constructor(e) { super(); this.options = Object.assign({}, e), (0, Fs.validateSocksClientOptions)(e), this.setState(k.SocksClientState.Created); @@ -6801,7 +6815,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } catch (o) { return typeof r == "function" ? (r(o), i(o)) : n(o); } - let s = new Wr(e); + let s = new Yr(e); s.connect(e.existing_socket), s.once("established", (o) => { s.removeAllListeners(), typeof r == "function" && r(null, o), i(o); }), s.once("error", (o) => { @@ -6810,7 +6824,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); }); } static createConnectionChain(e, r) { - return new Promise((i, n) => _r(this, void 0, void 0, function* () { + return new Promise((i, n) => xr(this, void 0, void 0, function* () { try { (0, Fs.validateSocksClientChainOptions)(e); } catch (o) { @@ -6820,7 +6834,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); e.randomizeChain && (0, Ms.shuffleArray)(e.proxies); try { for (let o = 0; o < e.proxies.length; o++) { - let a = e.proxies[o], l = o === e.proxies.length - 1 ? e.destination : { host: e.proxies[o + 1].host || e.proxies[o + 1].ipaddress, port: e.proxies[o + 1].port }, c = yield Wr.createConnection({ command: "connect", proxy: a, destination: l }); + let a = e.proxies[o], l = o === e.proxies.length - 1 ? e.destination : { host: e.proxies[o + 1].host || e.proxies[o + 1].ipaddress, port: e.proxies[o + 1].port }, c = yield Yr.createConnection({ command: "connect", proxy: a, destination: l }); s || (s = c.socket); } typeof r == "function" ? (r(null, { socket: s }), i({ socket: s })) : i({ socket: s }); @@ -6830,14 +6844,14 @@ See: https://github.com/isaacs/node-glob/issues/167`); })); } static createUDPFrame(e) { - let r = new Ye.SmartBuffer(); - return r.writeUInt16BE(0), r.writeUInt8(e.frameNumber || 0), xr.isIPv4(e.remoteHost.host) ? (r.writeUInt8(k.Socks5HostType.IPv4), r.writeUInt32BE(Xe.toLong(e.remoteHost.host))) : xr.isIPv6(e.remoteHost.host) ? (r.writeUInt8(k.Socks5HostType.IPv6), r.writeBuffer(Xe.toBuffer(e.remoteHost.host))) : (r.writeUInt8(k.Socks5HostType.Hostname), r.writeUInt8(Buffer.byteLength(e.remoteHost.host)), r.writeString(e.remoteHost.host)), r.writeUInt16BE(e.remoteHost.port), r.writeBuffer(e.data), r.toBuffer(); + let r = new ze.SmartBuffer(); + return r.writeUInt16BE(0), r.writeUInt8(e.frameNumber || 0), yr.isIPv4(e.remoteHost.host) ? (r.writeUInt8(k.Socks5HostType.IPv4), r.writeUInt32BE(Ke.toLong(e.remoteHost.host))) : yr.isIPv6(e.remoteHost.host) ? (r.writeUInt8(k.Socks5HostType.IPv6), r.writeBuffer(Ke.toBuffer(e.remoteHost.host))) : (r.writeUInt8(k.Socks5HostType.Hostname), r.writeUInt8(Buffer.byteLength(e.remoteHost.host)), r.writeString(e.remoteHost.host)), r.writeUInt16BE(e.remoteHost.port), r.writeBuffer(e.data), r.toBuffer(); } static parseUDPFrame(e) { - let r = Ye.SmartBuffer.fromBuffer(e); + let r = ze.SmartBuffer.fromBuffer(e); r.readOffset = 2; let i = r.readUInt8(), n = r.readUInt8(), s; - n === k.Socks5HostType.IPv4 ? s = Xe.fromLong(r.readUInt32BE()) : n === k.Socks5HostType.IPv6 ? s = Xe.toString(r.readBuffer(16)) : s = r.readString(r.readUInt8()); + n === k.Socks5HostType.IPv4 ? s = Ke.fromLong(r.readUInt32BE()) : n === k.Socks5HostType.IPv6 ? s = Ke.toString(r.readBuffer(16)) : s = r.readString(r.readUInt8()); let o = r.readUInt16BE(); return { frameNumber: i, remoteHost: { host: s, port: o }, data: r.readBuffer() }; } @@ -6847,7 +6861,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); connect(e) { this.onDataReceived = (i) => this.onDataReceivedHandler(i), this.onClose = () => this.onCloseHandler(), this.onError = (i) => this.onErrorHandler(i), this.onConnect = () => this.onConnectHandler(); let r = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || k.DEFAULT_TIMEOUT); - r.unref && typeof r.unref == "function" && r.unref(), e ? this.socket = e : this.socket = new xr.Socket(), this.socket.once("close", this.onClose), this.socket.once("error", this.onError), this.socket.once("connect", this.onConnect), this.socket.on("data", this.onDataReceived), this.setState(k.SocksClientState.Connecting), this.receiveBuffer = new cv.ReceiveBuffer(), e ? this.socket.emit("connect") : (this.socket.connect(this.getSocketOptions()), this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null && this.socket.setNoDelay(!!this.options.set_tcp_nodelay)), this.prependOnceListener("established", (i) => { + r.unref && typeof r.unref == "function" && r.unref(), e ? this.socket = e : this.socket = new yr.Socket(), this.socket.once("close", this.onClose), this.socket.once("error", this.onError), this.socket.once("connect", this.onConnect), this.socket.on("data", this.onDataReceived), this.setState(k.SocksClientState.Connecting), this.receiveBuffer = new uv.ReceiveBuffer(), e ? this.socket.emit("connect") : (this.socket.connect(this.getSocketOptions()), this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null && this.socket.setNoDelay(!!this.options.set_tcp_nodelay)), this.prependOnceListener("established", (i) => { setImmediate(() => { if (this.receiveBuffer.length > 0) { let n = this.receiveBuffer.get(this.receiveBuffer.length); @@ -6897,17 +6911,17 @@ See: https://github.com/isaacs/node-glob/issues/167`); this.state !== k.SocksClientState.Error && (this.setState(k.SocksClientState.Error), this.socket.destroy(), this.removeInternalSocketHandlers(), this.emit("error", new Ms.SocksClientError(e, this.options))); } sendSocks4InitialHandshake() { - let e = this.options.proxy.userId || "", r = new Ye.SmartBuffer(); - r.writeUInt8(4), r.writeUInt8(k.SocksCommand[this.options.command]), r.writeUInt16BE(this.options.destination.port), xr.isIPv4(this.options.destination.host) ? (r.writeBuffer(Xe.toBuffer(this.options.destination.host)), r.writeStringNT(e)) : (r.writeUInt8(0), r.writeUInt8(0), r.writeUInt8(0), r.writeUInt8(1), r.writeStringNT(e), r.writeStringNT(this.options.destination.host)), this.nextRequiredPacketBufferSize = k.SOCKS_INCOMING_PACKET_SIZES.Socks4Response, this.socket.write(r.toBuffer()); + let e = this.options.proxy.userId || "", r = new ze.SmartBuffer(); + r.writeUInt8(4), r.writeUInt8(k.SocksCommand[this.options.command]), r.writeUInt16BE(this.options.destination.port), yr.isIPv4(this.options.destination.host) ? (r.writeBuffer(Ke.toBuffer(this.options.destination.host)), r.writeStringNT(e)) : (r.writeUInt8(0), r.writeUInt8(0), r.writeUInt8(0), r.writeUInt8(1), r.writeStringNT(e), r.writeStringNT(this.options.destination.host)), this.nextRequiredPacketBufferSize = k.SOCKS_INCOMING_PACKET_SIZES.Socks4Response, this.socket.write(r.toBuffer()); } handleSocks4FinalHandshakeResponse() { let e = this.receiveBuffer.get(8); if (e[1] !== k.Socks4Response.Granted) this.closeSocket(`${k.ERRORS.Socks4ProxyRejectedConnection} - (${k.Socks4Response[e[1]]})`); else if (k.SocksCommand[this.options.command] === k.SocksCommand.bind) { - let r = Ye.SmartBuffer.fromBuffer(e); + let r = ze.SmartBuffer.fromBuffer(e); r.readOffset = 2; - let i = { port: r.readUInt16BE(), host: Xe.fromLong(r.readUInt32BE()) }; + let i = { port: r.readUInt16BE(), host: Ke.fromLong(r.readUInt32BE()) }; i.host === "0.0.0.0" && (i.host = this.options.proxy.ipaddress), this.setState(k.SocksClientState.BoundWaitingForConnection), this.emit("bound", { remoteHost: i, socket: this.socket }); } else this.setState(k.SocksClientState.Established), this.removeInternalSocketHandlers(), this.emit("established", { socket: this.socket }); @@ -6917,14 +6931,14 @@ See: https://github.com/isaacs/node-glob/issues/167`); if (e[1] !== k.Socks4Response.Granted) this.closeSocket(`${k.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${k.Socks4Response[e[1]]})`); else { - let r = Ye.SmartBuffer.fromBuffer(e); + let r = ze.SmartBuffer.fromBuffer(e); r.readOffset = 2; - let i = { port: r.readUInt16BE(), host: Xe.fromLong(r.readUInt32BE()) }; + let i = { port: r.readUInt16BE(), host: Ke.fromLong(r.readUInt32BE()) }; this.setState(k.SocksClientState.Established), this.removeInternalSocketHandlers(), this.emit("established", { remoteHost: i, socket: this.socket }); } } sendSocks5InitialHandshake() { - let e = new Ye.SmartBuffer(), r = [k.Socks5Auth.NoAuth]; + let e = new ze.SmartBuffer(), r = [k.Socks5Auth.NoAuth]; (this.options.proxy.userId || this.options.proxy.password) && r.push(k.Socks5Auth.UserPass), this.options.proxy.custom_auth_method !== void 0 && r.push(this.options.proxy.custom_auth_method), e.writeUInt8(5), e.writeUInt8(r.length); for (let i of r) e.writeUInt8(i); @@ -6935,39 +6949,39 @@ See: https://github.com/isaacs/node-glob/issues/167`); e[0] !== 5 ? this.closeSocket(k.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion) : e[1] === k.SOCKS5_NO_ACCEPTABLE_AUTH ? this.closeSocket(k.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType) : e[1] === k.Socks5Auth.NoAuth ? (this.socks5ChosenAuthType = k.Socks5Auth.NoAuth, this.sendSocks5CommandRequest()) : e[1] === k.Socks5Auth.UserPass ? (this.socks5ChosenAuthType = k.Socks5Auth.UserPass, this.sendSocks5UserPassAuthentication()) : e[1] === this.options.proxy.custom_auth_method ? (this.socks5ChosenAuthType = this.options.proxy.custom_auth_method, this.sendSocks5CustomAuthentication()) : this.closeSocket(k.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); } sendSocks5UserPassAuthentication() { - let e = this.options.proxy.userId || "", r = this.options.proxy.password || "", i = new Ye.SmartBuffer(); + let e = this.options.proxy.userId || "", r = this.options.proxy.password || "", i = new ze.SmartBuffer(); i.writeUInt8(1), i.writeUInt8(Buffer.byteLength(e)), i.writeString(e), i.writeUInt8(Buffer.byteLength(r)), i.writeString(r), this.nextRequiredPacketBufferSize = k.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse, this.socket.write(i.toBuffer()), this.setState(k.SocksClientState.SentAuthentication); } sendSocks5CustomAuthentication() { - return _r(this, void 0, void 0, function* () { + return xr(this, void 0, void 0, function* () { this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size, this.socket.write(yield this.options.proxy.custom_auth_request_handler()), this.setState(k.SocksClientState.SentAuthentication); }); } handleSocks5CustomAuthHandshakeResponse(e) { - return _r(this, void 0, void 0, function* () { + return xr(this, void 0, void 0, function* () { return yield this.options.proxy.custom_auth_response_handler(e); }); } handleSocks5AuthenticationNoAuthHandshakeResponse(e) { - return _r(this, void 0, void 0, function* () { + return xr(this, void 0, void 0, function* () { return e[1] === 0; }); } handleSocks5AuthenticationUserPassHandshakeResponse(e) { - return _r(this, void 0, void 0, function* () { + return xr(this, void 0, void 0, function* () { return e[1] === 0; }); } handleInitialSocks5AuthenticationHandshakeResponse() { - return _r(this, void 0, void 0, function* () { + return xr(this, void 0, void 0, function* () { this.setState(k.SocksClientState.ReceivedAuthenticationResponse); let e = false; this.socks5ChosenAuthType === k.Socks5Auth.NoAuth ? e = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)) : this.socks5ChosenAuthType === k.Socks5Auth.UserPass ? e = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)) : this.socks5ChosenAuthType === this.options.proxy.custom_auth_method && (e = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))), e ? this.sendSocks5CommandRequest() : this.closeSocket(k.ERRORS.Socks5AuthenticationFailed); }); } sendSocks5CommandRequest() { - let e = new Ye.SmartBuffer(); - e.writeUInt8(5), e.writeUInt8(k.SocksCommand[this.options.command]), e.writeUInt8(0), xr.isIPv4(this.options.destination.host) ? (e.writeUInt8(k.Socks5HostType.IPv4), e.writeBuffer(Xe.toBuffer(this.options.destination.host))) : xr.isIPv6(this.options.destination.host) ? (e.writeUInt8(k.Socks5HostType.IPv6), e.writeBuffer(Xe.toBuffer(this.options.destination.host))) : (e.writeUInt8(k.Socks5HostType.Hostname), e.writeUInt8(this.options.destination.host.length), e.writeString(this.options.destination.host)), e.writeUInt16BE(this.options.destination.port), this.nextRequiredPacketBufferSize = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader, this.socket.write(e.toBuffer()), this.setState(k.SocksClientState.SentFinalHandshake); + let e = new ze.SmartBuffer(); + e.writeUInt8(5), e.writeUInt8(k.SocksCommand[this.options.command]), e.writeUInt8(0), yr.isIPv4(this.options.destination.host) ? (e.writeUInt8(k.Socks5HostType.IPv4), e.writeBuffer(Ke.toBuffer(this.options.destination.host))) : yr.isIPv6(this.options.destination.host) ? (e.writeUInt8(k.Socks5HostType.IPv6), e.writeBuffer(Ke.toBuffer(this.options.destination.host))) : (e.writeUInt8(k.Socks5HostType.Hostname), e.writeUInt8(this.options.destination.host.length), e.writeString(this.options.destination.host)), e.writeUInt16BE(this.options.destination.port), this.nextRequiredPacketBufferSize = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader, this.socket.write(e.toBuffer()), this.setState(k.SocksClientState.SentFinalHandshake); } handleSocks5FinalHandshakeResponse() { let e = this.receiveBuffer.peek(5); @@ -6981,21 +6995,21 @@ See: https://github.com/isaacs/node-glob/issues/167`); this.nextRequiredPacketBufferSize = s; return; } - n = Ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Xe.fromLong(n.readUInt32BE()), port: n.readUInt16BE() }, i.host === "0.0.0.0" && (i.host = this.options.proxy.ipaddress); + n = ze.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Ke.fromLong(n.readUInt32BE()), port: n.readUInt16BE() }, i.host === "0.0.0.0" && (i.host = this.options.proxy.ipaddress); } else if (r === k.Socks5HostType.Hostname) { let s = e[4], o = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(s); if (this.receiveBuffer.length < o) { this.nextRequiredPacketBufferSize = o; return; } - n = Ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)), i = { host: n.readString(s), port: n.readUInt16BE() }; + n = ze.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)), i = { host: n.readString(s), port: n.readUInt16BE() }; } else if (r === k.Socks5HostType.IPv6) { let s = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < s) { this.nextRequiredPacketBufferSize = s; return; } - n = Ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Xe.toString(n.readBuffer(16)), port: n.readUInt16BE() }; + n = ze.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Ke.toString(n.readBuffer(16)), port: n.readUInt16BE() }; } this.setState(k.SocksClientState.ReceivedFinalResponse), k.SocksCommand[this.options.command] === k.SocksCommand.connect ? (this.setState(k.SocksClientState.Established), this.removeInternalSocketHandlers(), this.emit("established", { remoteHost: i, socket: this.socket })) : k.SocksCommand[this.options.command] === k.SocksCommand.bind ? (this.setState(k.SocksClientState.BoundWaitingForConnection), this.nextRequiredPacketBufferSize = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader, this.emit("bound", { remoteHost: i, socket: this.socket })) : k.SocksCommand[this.options.command] === k.SocksCommand.associate && (this.setState(k.SocksClientState.Established), this.removeInternalSocketHandlers(), this.emit("established", { remoteHost: i, socket: this.socket })); } @@ -7012,21 +7026,21 @@ See: https://github.com/isaacs/node-glob/issues/167`); this.nextRequiredPacketBufferSize = s; return; } - n = Ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Xe.fromLong(n.readUInt32BE()), port: n.readUInt16BE() }, i.host === "0.0.0.0" && (i.host = this.options.proxy.ipaddress); + n = ze.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Ke.fromLong(n.readUInt32BE()), port: n.readUInt16BE() }, i.host === "0.0.0.0" && (i.host = this.options.proxy.ipaddress); } else if (r === k.Socks5HostType.Hostname) { let s = e[4], o = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(s); if (this.receiveBuffer.length < o) { this.nextRequiredPacketBufferSize = o; return; } - n = Ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)), i = { host: n.readString(s), port: n.readUInt16BE() }; + n = ze.SmartBuffer.fromBuffer(this.receiveBuffer.get(o).slice(5)), i = { host: n.readString(s), port: n.readUInt16BE() }; } else if (r === k.Socks5HostType.IPv6) { let s = k.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < s) { this.nextRequiredPacketBufferSize = s; return; } - n = Ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Xe.toString(n.readBuffer(16)), port: n.readUInt16BE() }; + n = ze.SmartBuffer.fromBuffer(this.receiveBuffer.get(s).slice(4)), i = { host: Ke.toString(n.readBuffer(16)), port: n.readUInt16BE() }; } this.setState(k.SocksClientState.Established), this.removeInternalSocketHandlers(), this.emit("established", { remoteHost: i, socket: this.socket }); } @@ -7035,26 +7049,26 @@ See: https://github.com/isaacs/node-glob/issues/167`); return Object.assign({}, this.options); } }; - St.SocksClient = Wr; + kt.SocksClient = Yr; }); - var Hu = x((Gt) => { + var Vu = x((Gt) => { "use strict"; - var uv = Gt && Gt.__createBinding || (Object.create ? function(t, e, r, i) { + var fv = Gt && Gt.__createBinding || (Object.create ? function(t, e, r, i) { i === void 0 && (i = r), Object.defineProperty(t, i, { enumerable: true, get: function() { return e[r]; } }); } : function(t, e, r, i) { i === void 0 && (i = r), t[i] = e[r]; - }), fv = Gt && Gt.__exportStar || function(t, e) { + }), hv = Gt && Gt.__exportStar || function(t, e) { for (var r in t) - r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && uv(e, t, r); + r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && fv(e, t, r); }; Object.defineProperty(Gt, "__esModule", { value: true }); - fv(qu(), Gt); + hv(Hu(), Gt); }); - var $u = x((zt) => { + var Gu = x((zt) => { "use strict"; - var hv = zt && zt.__awaiter || function(t, e, r, i) { + var pv = zt && zt.__awaiter || function(t, e, r, i) { function n(s) { return s instanceof r ? s : new r(function(o) { o(s); @@ -7084,15 +7098,15 @@ See: https://github.com/isaacs/node-glob/issues/167`); return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(zt, "__esModule", { value: true }); - var pv = ji(require("dns")), dv = ji(require("tls")), mv = ji(require("url")), vv = ji(er()), gv = an(), _v = Hu(), Us = vv.default("socks-proxy-agent"); - function xv(t) { + var dv = ji(require("dns")), mv = ji(require("tls")), vv = ji(require("url")), gv = ji(tr()), _v = an(), xv = Vu(), Us = gv.default("socks-proxy-agent"); + function yv(t) { return new Promise((e, r) => { - pv.default.lookup(t, (i, n) => { + dv.default.lookup(t, (i, n) => { i ? r(i) : e(n); }); }); } - function yv(t) { + function bv(t) { let e = 0, r = false, i = 5, n = t.hostname || t.host; if (!n) throw new TypeError('No "host"'); @@ -7124,73 +7138,73 @@ See: https://github.com/isaacs/node-glob/issues/167`); } return o && Object.defineProperty(s, "userId", { value: o, enumerable: false }), a && Object.defineProperty(s, "password", { value: a, enumerable: false }), { lookup: r, proxy: s }; } - var Vu = class extends gv.Agent { + var $u = class extends _v.Agent { constructor(e) { let r; - if (typeof e == "string" ? r = mv.default.parse(e) : r = e, !r) + if (typeof e == "string" ? r = vv.default.parse(e) : r = e, !r) throw new TypeError("a SOCKS proxy server `host` and `port` must be specified!"); super(r); - let i = yv(r); + let i = bv(r); this.lookup = i.lookup, this.proxy = i.proxy, this.tlsConnectionOptions = r.tls || {}; } callback(e, r) { - return hv(this, void 0, void 0, function* () { + return pv(this, void 0, void 0, function* () { let { lookup: i, proxy: n } = this, { host: s, port: o, timeout: a } = r; if (!s) throw new Error("No `host` defined!"); - i && (s = yield xv(s)); + i && (s = yield yv(s)); let l = { proxy: n, destination: { host: s, port: o }, command: "connect", timeout: a }; Us("Creating socks proxy connection: %o", l); - let { socket: c } = yield _v.SocksClient.createConnection(l); + let { socket: c } = yield xv.SocksClient.createConnection(l); if (Us("Successfully created socks proxy connection"), r.secureEndpoint) { Us("Upgrading socket connection to TLS"); let u = r.servername || r.host; - return dv.default.connect(Object.assign(Object.assign(Object.assign({}, bv(r, "host", "hostname", "path", "port")), { socket: c, servername: u }), this.tlsConnectionOptions)); + return mv.default.connect(Object.assign(Object.assign(Object.assign({}, wv(r, "host", "hostname", "path", "port")), { socket: c, servername: u }), this.tlsConnectionOptions)); } return c; }); } }; - zt.default = Vu; - function bv(t, ...e) { + zt.default = $u; + function wv(t, ...e) { let r = {}, i; for (i in t) e.includes(i) || (r[i] = t[i]); return r; } }); - var zu = x((qs, Gu) => { + var Wu = x((qs, zu) => { "use strict"; - var wv = qs && qs.__importDefault || function(t) { + var Ev = qs && qs.__importDefault || function(t) { return t && t.__esModule ? t : { default: t }; - }, Ds = wv($u()); + }, Ds = Ev(Gu()); function js(t) { return new Ds.default(t); } (function(t) { t.SocksProxyAgent = Ds.default, t.prototype = Ds.default.prototype; })(js || (js = {})); - Gu.exports = js; + zu.exports = js; }); - var Yu = x(($x, Wu) => { + var Ku = x((Gx, Yu) => { "use strict"; - var Ev = /[|\\{}()[\]^$+*?.-]/g; - Wu.exports = (t) => { + var Sv = /[|\\{}()[\]^$+*?.-]/g; + Yu.exports = (t) => { if (typeof t != "string") throw new TypeError("Expected a string"); - return t.replace(Ev, "\\$&"); + return t.replace(Sv, "\\$&"); }; }); - var Qu = x((Gx, Xu) => { + var Ju = x((zx, Qu) => { "use strict"; - var Sv = Yu(), kv = typeof process == "object" && process && typeof process.cwd == "function" ? process.cwd() : ".", Zu = [].concat(require("module").builtinModules, "bootstrap_node", "node").map((t) => new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`)); - Zu.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/, /\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/, /\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/); + var kv = Ku(), Cv = typeof process == "object" && process && typeof process.cwd == "function" ? process.cwd() : ".", Xu = [].concat(require("module").builtinModules, "bootstrap_node", "node").map((t) => new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`)); + Xu.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/, /\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/, /\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/); var qi = class { constructor(e) { - e = __spreadValues({ ignoredPackages: [] }, e), "internals" in e || (e.internals = qi.nodeInternals()), "cwd" in e || (e.cwd = kv), this._cwd = e.cwd.replace(/\\/g, "/"), this._internals = [].concat(e.internals, Cv(e.ignoredPackages)), this._wrapCallSite = e.wrapCallSite || false; + e = __spreadValues({ ignoredPackages: [] }, e), "internals" in e || (e.internals = qi.nodeInternals()), "cwd" in e || (e.cwd = Cv), this._cwd = e.cwd.replace(/\\/g, "/"), this._internals = [].concat(e.internals, Ov(e.ignoredPackages)), this._wrapCallSite = e.wrapCallSite || false; } static nodeInternals() { - return [...Zu]; + return [...Xu]; } clean(e, r = 0) { r = " ".repeat(r), Array.isArray(e) || (e = e.split(` @@ -7227,7 +7241,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); if (!r) return {}; let i = { line: r.getLineNumber(), column: r.getColumnNumber() }; - Ku(i, r.getFileName(), this._cwd), r.isConstructor() && (i.constructor = true), r.isEval() && (i.evalOrigin = r.getEvalOrigin()), r.isNative() && (i.native = true); + Zu(i, r.getFileName(), this._cwd), r.isConstructor() && (i.constructor = true), r.isEval() && (i.evalOrigin = r.getEvalOrigin()), r.isNative() && (i.native = true); let n; try { n = r.getTypeName(); @@ -7240,7 +7254,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); return o && s !== o && (i.method = o), i; } parseLine(e) { - let r = e && e.match(Ov); + let r = e && e.match(Iv); if (!r) return null; let i = r[1] === "new", n = r[2], s = r[3], o = r[4], a = Number(r[5]), l = Number(r[6]), c = r[7], u = r[8], f = r[9], h = r[10] === "native", p = r[11] === ")", d, m = {}; @@ -7250,44 +7264,44 @@ See: https://github.com/isaacs/node-glob/issues/167`); if (c.charAt(y) === ")") v++; else if (c.charAt(y) === "(" && c.charAt(y - 1) === " " && (v--, v === -1 && c.charAt(y - 1) === " ")) { - let O = c.slice(0, y - 1); - c = c.slice(y + 1), n += ` (${O}`; + let I = c.slice(0, y - 1); + c = c.slice(y + 1), n += ` (${I}`; break; } } if (n) { - let v = n.match(Iv); + let v = n.match(Tv); v && (n = v[1], d = v[2]); } - return Ku(m, c, this._cwd), i && (m.constructor = true), s && (m.evalOrigin = s, m.evalLine = a, m.evalColumn = l, m.evalFile = o && o.replace(/\\/g, "/")), h && (m.native = true), n && (m.function = n), d && n !== d && (m.method = d), m; + return Zu(m, c, this._cwd), i && (m.constructor = true), s && (m.evalOrigin = s, m.evalLine = a, m.evalColumn = l, m.evalFile = o && o.replace(/\\/g, "/")), h && (m.native = true), n && (m.function = n), d && n !== d && (m.method = d), m; } }; - function Ku(t, e, r) { + function Zu(t, e, r) { e && (e = e.replace(/\\/g, "/"), e.startsWith(`${r}/`) && (e = e.slice(r.length + 1)), t.file = e); } - function Cv(t) { + function Ov(t) { if (t.length === 0) return []; - let e = t.map((r) => Sv(r)); + let e = t.map((r) => kv(r)); return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`); } - var Ov = new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"), Iv = /^(.*?) \[as (.*?)\]$/; - Xu.exports = qi; + var Iv = new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"), Tv = /^(.*?) \[as (.*?)\]$/; + Qu.exports = qi; }); - var rf = x((zx, tf) => { + var nf = x((Wx, rf) => { "use strict"; - var { Duplex: Tv } = require("stream"); - function Ju(t) { + var { Duplex: Av } = require("stream"); + function ef(t) { t.emit("close"); } - function Av() { + function Rv() { !this.destroyed && this._writableState.finished && this.destroy(); } - function ef(t) { - this.removeListener("error", ef), this.destroy(), this.listenerCount("error") === 0 && this.emit("error", t); + function tf(t) { + this.removeListener("error", tf), this.destroy(), this.listenerCount("error") === 0 && this.emit("error", t); } - function Rv(t, e) { - let r = true, i = new Tv(__spreadProps(__spreadValues({}, e), { autoDestroy: false, emitClose: false, objectMode: false, writableObjectMode: false })); + function Bv(t, e) { + let r = true, i = new Av(__spreadProps(__spreadValues({}, e), { autoDestroy: false, emitClose: false, objectMode: false, writableObjectMode: false })); return t.on("message", function(s, o) { let a = !o && i._readableState.objectMode ? s.toString() : s; i.push(a) || t.pause(); @@ -7297,14 +7311,14 @@ See: https://github.com/isaacs/node-glob/issues/167`); i.destroyed || i.push(null); }), i._destroy = function(n, s) { if (t.readyState === t.CLOSED) { - s(n), process.nextTick(Ju, i); + s(n), process.nextTick(ef, i); return; } let o = false; t.once("error", function(l) { o = true, s(l); }), t.once("close", function() { - o || s(n), process.nextTick(Ju, i); + o || s(n), process.nextTick(ef, i); }), r && t.terminate(); }, i._final = function(n) { if (t.readyState === t.CONNECTING) { @@ -7326,21 +7340,21 @@ See: https://github.com/isaacs/node-glob/issues/167`); return; } t.send(n, o); - }, i.on("end", Av), i.on("error", ef), i; + }, i.on("end", Rv), i.on("error", tf), i; } - tf.exports = Rv; + rf.exports = Bv; }); - var kt = x((Wx, nf) => { + var Ct = x((Yx, sf) => { "use strict"; - nf.exports = { BINARY_TYPES: ["nodebuffer", "arraybuffer", "fragments"], EMPTY_BUFFER: Buffer.alloc(0), GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", kForOnEventAttribute: Symbol("kIsForOnEventAttribute"), kListener: Symbol("kListener"), kStatusCode: Symbol("status-code"), kWebSocket: Symbol("websocket"), NOOP: () => { + sf.exports = { BINARY_TYPES: ["nodebuffer", "arraybuffer", "fragments"], EMPTY_BUFFER: Buffer.alloc(0), GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", kForOnEventAttribute: Symbol("kIsForOnEventAttribute"), kListener: Symbol("kListener"), kStatusCode: Symbol("status-code"), kWebSocket: Symbol("websocket"), NOOP: () => { } }; }); - var Yr = x((Yx, Hs) => { + var Kr = x((Kx, Hs) => { "use strict"; - var { EMPTY_BUFFER: Bv } = kt(); - function sf(t, e) { + var { EMPTY_BUFFER: Lv } = Ct(); + function of(t, e) { if (t.length === 0) - return Bv; + return Lv; if (t.length === 1) return t[0]; let r = Buffer.allocUnsafe(e), i = 0; @@ -7350,15 +7364,15 @@ See: https://github.com/isaacs/node-glob/issues/167`); } return i < e ? r.slice(0, i) : r; } - function of(t, e, r, i, n) { + function af(t, e, r, i, n) { for (let s = 0; s < n; s++) r[i + s] = t[s] ^ e[s & 3]; } - function af(t, e) { + function lf(t, e) { for (let r = 0; r < t.length; r++) t[r] ^= e[r & 3]; } - function lf(t) { + function cf(t) { return t.byteLength === t.buffer.byteLength ? t.buffer : t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength); } function Hi(t) { @@ -7369,20 +7383,20 @@ See: https://github.com/isaacs/node-glob/issues/167`); } try { let t = require("bufferutil"); - Hs.exports = { concat: sf, mask(e, r, i, n, s) { - s < 48 ? of(e, r, i, n, s) : t.mask(e, r, i, n, s); - }, toArrayBuffer: lf, toBuffer: Hi, unmask(e, r) { - e.length < 32 ? af(e, r) : t.unmask(e, r); + Hs.exports = { concat: of, mask(e, r, i, n, s) { + s < 48 ? af(e, r, i, n, s) : t.mask(e, r, i, n, s); + }, toArrayBuffer: cf, toBuffer: Hi, unmask(e, r) { + e.length < 32 ? lf(e, r) : t.unmask(e, r); } }; } catch (e) { - Hs.exports = { concat: sf, mask: of, toArrayBuffer: lf, toBuffer: Hi, unmask: af }; + Hs.exports = { concat: of, mask: af, toArrayBuffer: cf, toBuffer: Hi, unmask: lf }; } }); - var hf = x((Kx, ff) => { + var pf = x((Zx, hf) => { "use strict"; - var cf = Symbol("kDone"), Vs = Symbol("kRun"), uf = class { + var uf = Symbol("kDone"), Vs = Symbol("kRun"), ff = class { constructor(e) { - this[cf] = () => { + this[uf] = () => { this.pending--, this[Vs](); }, this.concurrency = e || 1 / 0, this.jobs = [], this.pending = 0; } @@ -7392,19 +7406,19 @@ See: https://github.com/isaacs/node-glob/issues/167`); [Vs]() { if (this.pending !== this.concurrency && this.jobs.length) { let e = this.jobs.shift(); - this.pending++, e(this[cf]); + this.pending++, e(this[uf]); } } }; - ff.exports = uf; + hf.exports = ff; }); - var Xr = x((Zx, gf) => { + var Qr = x((Xx, _f) => { "use strict"; - var Kr = require("zlib"), pf = Yr(), Lv = hf(), { kStatusCode: df } = kt(), Nv = Buffer.from([0, 0, 255, 255]), Gi = Symbol("permessage-deflate"), ht = Symbol("total-length"), Zr = Symbol("callback"), Ct = Symbol("buffers"), $i = Symbol("error"), Vi, mf = class { + var Zr = require("zlib"), df = Kr(), Nv = pf(), { kStatusCode: mf } = Ct(), Pv = Buffer.from([0, 0, 255, 255]), Gi = Symbol("permessage-deflate"), pt = Symbol("total-length"), Xr = Symbol("callback"), Ot = Symbol("buffers"), $i = Symbol("error"), Vi, vf = class { constructor(e, r, i) { if (this._maxPayload = i | 0, this._options = e || {}, this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024, this._isServer = !!r, this._deflate = null, this._inflate = null, this.params = null, !Vi) { let n = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10; - Vi = new Lv(n); + Vi = new Nv(n); } } static get extensionName() { @@ -7419,7 +7433,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } cleanup() { if (this._inflate && (this._inflate.close(), this._inflate = null), this._deflate) { - let e = this._deflate[Zr]; + let e = this._deflate[Xr]; this._deflate.close(), this._deflate = null, e && e(new Error("The deflate stream was closed while data was being processed")); } } @@ -7484,55 +7498,55 @@ See: https://github.com/isaacs/node-glob/issues/167`); _decompress(e, r, i) { let n = this._isServer ? "client" : "server"; if (!this._inflate) { - let s = `${n}_max_window_bits`, o = typeof this.params[s] != "number" ? Kr.Z_DEFAULT_WINDOWBITS : this.params[s]; - this._inflate = Kr.createInflateRaw(__spreadProps(__spreadValues({}, this._options.zlibInflateOptions), { windowBits: o })), this._inflate[Gi] = this, this._inflate[ht] = 0, this._inflate[Ct] = [], this._inflate.on("error", Fv), this._inflate.on("data", vf); + let s = `${n}_max_window_bits`, o = typeof this.params[s] != "number" ? Zr.Z_DEFAULT_WINDOWBITS : this.params[s]; + this._inflate = Zr.createInflateRaw(__spreadProps(__spreadValues({}, this._options.zlibInflateOptions), { windowBits: o })), this._inflate[Gi] = this, this._inflate[pt] = 0, this._inflate[Ot] = [], this._inflate.on("error", Mv), this._inflate.on("data", gf); } - this._inflate[Zr] = i, this._inflate.write(e), r && this._inflate.write(Nv), this._inflate.flush(() => { + this._inflate[Xr] = i, this._inflate.write(e), r && this._inflate.write(Pv), this._inflate.flush(() => { let s = this._inflate[$i]; if (s) { this._inflate.close(), this._inflate = null, i(s); return; } - let o = pf.concat(this._inflate[Ct], this._inflate[ht]); - this._inflate._readableState.endEmitted ? (this._inflate.close(), this._inflate = null) : (this._inflate[ht] = 0, this._inflate[Ct] = [], r && this.params[`${n}_no_context_takeover`] && this._inflate.reset()), i(null, o); + let o = df.concat(this._inflate[Ot], this._inflate[pt]); + this._inflate._readableState.endEmitted ? (this._inflate.close(), this._inflate = null) : (this._inflate[pt] = 0, this._inflate[Ot] = [], r && this.params[`${n}_no_context_takeover`] && this._inflate.reset()), i(null, o); }); } _compress(e, r, i) { let n = this._isServer ? "server" : "client"; if (!this._deflate) { - let s = `${n}_max_window_bits`, o = typeof this.params[s] != "number" ? Kr.Z_DEFAULT_WINDOWBITS : this.params[s]; - this._deflate = Kr.createDeflateRaw(__spreadProps(__spreadValues({}, this._options.zlibDeflateOptions), { windowBits: o })), this._deflate[ht] = 0, this._deflate[Ct] = [], this._deflate.on("data", Pv); + let s = `${n}_max_window_bits`, o = typeof this.params[s] != "number" ? Zr.Z_DEFAULT_WINDOWBITS : this.params[s]; + this._deflate = Zr.createDeflateRaw(__spreadProps(__spreadValues({}, this._options.zlibDeflateOptions), { windowBits: o })), this._deflate[pt] = 0, this._deflate[Ot] = [], this._deflate.on("data", Fv); } - this._deflate[Zr] = i, this._deflate.write(e), this._deflate.flush(Kr.Z_SYNC_FLUSH, () => { + this._deflate[Xr] = i, this._deflate.write(e), this._deflate.flush(Zr.Z_SYNC_FLUSH, () => { if (!this._deflate) return; - let s = pf.concat(this._deflate[Ct], this._deflate[ht]); - r && (s = s.slice(0, s.length - 4)), this._deflate[Zr] = null, this._deflate[ht] = 0, this._deflate[Ct] = [], r && this.params[`${n}_no_context_takeover`] && this._deflate.reset(), i(null, s); + let s = df.concat(this._deflate[Ot], this._deflate[pt]); + r && (s = s.slice(0, s.length - 4)), this._deflate[Xr] = null, this._deflate[pt] = 0, this._deflate[Ot] = [], r && this.params[`${n}_no_context_takeover`] && this._deflate.reset(), i(null, s); }); } }; - gf.exports = mf; - function Pv(t) { - this[Ct].push(t), this[ht] += t.length; + _f.exports = vf; + function Fv(t) { + this[Ot].push(t), this[pt] += t.length; } - function vf(t) { - if (this[ht] += t.length, this[Gi]._maxPayload < 1 || this[ht] <= this[Gi]._maxPayload) { - this[Ct].push(t); + function gf(t) { + if (this[pt] += t.length, this[Gi]._maxPayload < 1 || this[pt] <= this[Gi]._maxPayload) { + this[Ot].push(t); return; } - this[$i] = new RangeError("Max payload size exceeded"), this[$i].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH", this[$i][df] = 1009, this.removeListener("data", vf), this.reset(); + this[$i] = new RangeError("Max payload size exceeded"), this[$i].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH", this[$i][mf] = 1009, this.removeListener("data", gf), this.reset(); } - function Fv(t) { - this[Gi]._inflate = null, t[df] = 1007, this[Zr](t); + function Mv(t) { + this[Gi]._inflate = null, t[mf] = 1007, this[Xr](t); } }); - var Qr = x((Xx, $s) => { + var Jr = x((Qx, $s) => { "use strict"; - var _f = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0]; - function xf(t) { + var xf = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0]; + function yf(t) { return t >= 1e3 && t <= 1014 && t !== 1004 && t !== 1005 && t !== 1006 || t >= 3e3 && t <= 4999; } - function yf(t) { + function bf(t) { let e = t.length, r = 0; for (; r < e; ) if ((t[r] & 128) === 0) @@ -7555,22 +7569,22 @@ See: https://github.com/isaacs/node-glob/issues/167`); } try { let t = require("utf-8-validate"); - $s.exports = { isValidStatusCode: xf, isValidUTF8(e) { - return e.length < 150 ? yf(e) : t(e); - }, tokenChars: _f }; + $s.exports = { isValidStatusCode: yf, isValidUTF8(e) { + return e.length < 150 ? bf(e) : t(e); + }, tokenChars: xf }; } catch (e) { - $s.exports = { isValidStatusCode: xf, isValidUTF8: yf, tokenChars: _f }; + $s.exports = { isValidStatusCode: yf, isValidUTF8: bf, tokenChars: xf }; } }); - var Ws = x((Qx, If) => { + var Ws = x((Jx, Tf) => { "use strict"; - var { Writable: Mv } = require("stream"), bf = Xr(), { BINARY_TYPES: Uv, EMPTY_BUFFER: wf, kStatusCode: Dv, kWebSocket: jv } = kt(), { concat: Gs, toArrayBuffer: qv, unmask: Hv } = Yr(), { isValidStatusCode: Vv, isValidUTF8: Ef } = Qr(), Jr = 0, Sf = 1, kf = 2, Cf = 3, zs = 4, $v = 5, Of = class extends Mv { + var { Writable: Uv } = require("stream"), wf = Qr(), { BINARY_TYPES: Dv, EMPTY_BUFFER: Ef, kStatusCode: jv, kWebSocket: qv } = Ct(), { concat: Gs, toArrayBuffer: Hv, unmask: Vv } = Kr(), { isValidStatusCode: $v, isValidUTF8: Sf } = Jr(), ei = 0, kf = 1, Cf = 2, Of = 3, zs = 4, Gv = 5, If = class extends Uv { constructor(e = {}) { super(); - this._binaryType = e.binaryType || Uv[0], this._extensions = e.extensions || {}, this._isServer = !!e.isServer, this._maxPayload = e.maxPayload | 0, this._skipUTF8Validation = !!e.skipUTF8Validation, this[jv] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = false, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = false, this._fin = false, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._fragments = [], this._state = Jr, this._loop = false; + this._binaryType = e.binaryType || Dv[0], this._extensions = e.extensions || {}, this._isServer = !!e.isServer, this._maxPayload = e.maxPayload | 0, this._skipUTF8Validation = !!e.skipUTF8Validation, this[qv] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = false, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = false, this._fin = false, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._fragments = [], this._state = ei, this._loop = false; } _write(e, r, i) { - if (this._opcode === 8 && this._state == Jr) + if (this._opcode === 8 && this._state == ei) return i(); this._bufferedBytes += e.length, this._buffers.push(e), this.startLoop(i); } @@ -7593,16 +7607,16 @@ See: https://github.com/isaacs/node-glob/issues/167`); this._loop = true; do switch (this._state) { - case Jr: + case ei: r = this.getInfo(); break; - case Sf: + case kf: r = this.getPayloadLength16(); break; - case kf: + case Cf: r = this.getPayloadLength64(); break; - case Cf: + case Of: this.getMask(); break; case zs: @@ -7622,38 +7636,38 @@ See: https://github.com/isaacs/node-glob/issues/167`); } let e = this.consume(2); if ((e[0] & 48) !== 0) - return this._loop = false, Le(RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3"); + return this._loop = false, Be(RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3"); let r = (e[0] & 64) === 64; - if (r && !this._extensions[bf.extensionName]) - return this._loop = false, Le(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); + if (r && !this._extensions[wf.extensionName]) + return this._loop = false, Be(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); if (this._fin = (e[0] & 128) === 128, this._opcode = e[0] & 15, this._payloadLength = e[1] & 127, this._opcode === 0) { if (r) - return this._loop = false, Le(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); + return this._loop = false, Be(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); if (!this._fragmented) - return this._loop = false, Le(RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE"); + return this._loop = false, Be(RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE"); this._opcode = this._fragmented; } else if (this._opcode === 1 || this._opcode === 2) { if (this._fragmented) - return this._loop = false, Le(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); + return this._loop = false, Be(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); this._compressed = r; } else if (this._opcode > 7 && this._opcode < 11) { if (!this._fin) - return this._loop = false, Le(RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN"); + return this._loop = false, Be(RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN"); if (r) - return this._loop = false, Le(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); + return this._loop = false, Be(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); if (this._payloadLength > 125) - return this._loop = false, Le(RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); + return this._loop = false, Be(RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); } else - return this._loop = false, Le(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); + return this._loop = false, Be(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); if (!this._fin && !this._fragmented && (this._fragmented = this._opcode), this._masked = (e[1] & 128) === 128, this._isServer) { if (!this._masked) - return this._loop = false, Le(RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK"); + return this._loop = false, Be(RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK"); } else if (this._masked) - return this._loop = false, Le(RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK"); + return this._loop = false, Be(RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK"); if (this._payloadLength === 126) - this._state = Sf; - else if (this._payloadLength === 127) this._state = kf; + else if (this._payloadLength === 127) + this._state = Cf; else return this.haveLength(); } @@ -7670,12 +7684,12 @@ See: https://github.com/isaacs/node-glob/issues/167`); return; } let e = this.consume(8), r = e.readUInt32BE(0); - return r > Math.pow(2, 53 - 32) - 1 ? (this._loop = false, Le(RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")) : (this._payloadLength = r * Math.pow(2, 32) + e.readUInt32BE(4), this.haveLength()); + return r > Math.pow(2, 53 - 32) - 1 ? (this._loop = false, Be(RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")) : (this._payloadLength = r * Math.pow(2, 32) + e.readUInt32BE(4), this.haveLength()); } haveLength() { if (this._payloadLength && this._opcode < 8 && (this._totalPayloadLength += this._payloadLength, this._totalPayloadLength > this._maxPayload && this._maxPayload > 0)) - return this._loop = false, Le(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); - this._masked ? this._state = Cf : this._state = zs; + return this._loop = false, Be(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); + this._masked ? this._state = Of : this._state = zs; } getMask() { if (this._bufferedBytes < 4) { @@ -7685,29 +7699,29 @@ See: https://github.com/isaacs/node-glob/issues/167`); this._mask = this.consume(4), this._state = zs; } getData(e) { - let r = wf; + let r = Ef; if (this._payloadLength) { if (this._bufferedBytes < this._payloadLength) { this._loop = false; return; } - r = this.consume(this._payloadLength), this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0 && Hv(r, this._mask); + r = this.consume(this._payloadLength), this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0 && Vv(r, this._mask); } if (this._opcode > 7) return this.controlMessage(r); if (this._compressed) { - this._state = $v, this.decompress(r, e); + this._state = Gv, this.decompress(r, e); return; } return r.length && (this._messageLength = this._totalPayloadLength, this._fragments.push(r)), this.dataMessage(); } decompress(e, r) { - this._extensions[bf.extensionName].decompress(e, this._fin, (n, s) => { + this._extensions[wf.extensionName].decompress(e, this._fin, (n, s) => { if (n) return r(n); if (s.length) { if (this._messageLength += s.length, this._messageLength > this._maxPayload && this._maxPayload > 0) - return r(Le(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH")); + return r(Be(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH")); this._fragments.push(s); } let o = this.dataMessage(); @@ -7721,66 +7735,66 @@ See: https://github.com/isaacs/node-glob/issues/167`); let e = this._messageLength, r = this._fragments; if (this._totalPayloadLength = 0, this._messageLength = 0, this._fragmented = 0, this._fragments = [], this._opcode === 2) { let i; - this._binaryType === "nodebuffer" ? i = Gs(r, e) : this._binaryType === "arraybuffer" ? i = qv(Gs(r, e)) : i = r, this.emit("message", i, true); + this._binaryType === "nodebuffer" ? i = Gs(r, e) : this._binaryType === "arraybuffer" ? i = Hv(Gs(r, e)) : i = r, this.emit("message", i, true); } else { let i = Gs(r, e); - if (!this._skipUTF8Validation && !Ef(i)) - return this._loop = false, Le(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); + if (!this._skipUTF8Validation && !Sf(i)) + return this._loop = false, Be(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); this.emit("message", i, false); } } - this._state = Jr; + this._state = ei; } controlMessage(e) { if (this._opcode === 8) if (this._loop = false, e.length === 0) - this.emit("conclude", 1005, wf), this.end(); + this.emit("conclude", 1005, Ef), this.end(); else { if (e.length === 1) - return Le(RangeError, "invalid payload length 1", true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); + return Be(RangeError, "invalid payload length 1", true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); { let r = e.readUInt16BE(0); - if (!Vv(r)) - return Le(RangeError, `invalid status code ${r}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE"); + if (!$v(r)) + return Be(RangeError, `invalid status code ${r}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE"); let i = e.slice(2); - if (!this._skipUTF8Validation && !Ef(i)) - return Le(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); + if (!this._skipUTF8Validation && !Sf(i)) + return Be(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); this.emit("conclude", r, i), this.end(); } } else this._opcode === 9 ? this.emit("ping", e) : this.emit("pong", e); - this._state = Jr; + this._state = ei; } }; - If.exports = Of; - function Le(t, e, r, i, n) { + Tf.exports = If; + function Be(t, e, r, i, n) { let s = new t(r ? `Invalid WebSocket frame: ${e}` : e); - return Error.captureStackTrace(s, Le), s.code = n, s[Dv] = i, s; + return Error.captureStackTrace(s, Be), s.code = n, s[jv] = i, s; } }); - var Ys = x((ty, Rf) => { + var Ys = x((ry, Bf) => { "use strict"; - var Jx = require("net"), ey = require("tls"), { randomFillSync: Gv } = require("crypto"), Tf = Xr(), { EMPTY_BUFFER: zv } = kt(), { isValidStatusCode: Wv } = Qr(), { mask: Af, toBuffer: yr } = Yr(), ot = Symbol("kByteLength"), Yv = Buffer.alloc(4), pt = class { + var ey = require("net"), ty = require("tls"), { randomFillSync: zv } = require("crypto"), Af = Qr(), { EMPTY_BUFFER: Wv } = Ct(), { isValidStatusCode: Yv } = Jr(), { mask: Rf, toBuffer: br } = Kr(), ot = Symbol("kByteLength"), Kv = Buffer.alloc(4), dt = class { constructor(e, r, i) { this._extensions = r || {}, i && (this._generateMask = i, this._maskBuffer = Buffer.alloc(4)), this._socket = e, this._firstFragment = true, this._compress = false, this._bufferedBytes = 0, this._deflating = false, this._queue = []; } static frame(e, r) { let i, n = false, s = 2, o = false; - r.mask && (i = r.maskBuffer || Yv, r.generateMask ? r.generateMask(i) : Gv(i, 0, 4), o = (i[0] | i[1] | i[2] | i[3]) === 0, s = 6); + r.mask && (i = r.maskBuffer || Kv, r.generateMask ? r.generateMask(i) : zv(i, 0, 4), o = (i[0] | i[1] | i[2] | i[3]) === 0, s = 6); let a; typeof e == "string" ? (!r.mask || o) && r[ot] !== void 0 ? a = r[ot] : (e = Buffer.from(e), a = e.length) : (a = e.length, n = r.mask && r.readOnly && !o); let l = a; a >= 65536 ? (s += 8, l = 127) : a > 125 && (s += 2, l = 126); let c = Buffer.allocUnsafe(n ? a + s : s); - return c[0] = r.fin ? r.opcode | 128 : r.opcode, r.rsv1 && (c[0] |= 64), c[1] = l, l === 126 ? c.writeUInt16BE(a, 2) : l === 127 && (c[2] = c[3] = 0, c.writeUIntBE(a, 4, 6)), r.mask ? (c[1] |= 128, c[s - 4] = i[0], c[s - 3] = i[1], c[s - 2] = i[2], c[s - 1] = i[3], o ? [c, e] : n ? (Af(e, i, c, s, a), [c]) : (Af(e, i, e, 0, a), [c, e])) : [c, e]; + return c[0] = r.fin ? r.opcode | 128 : r.opcode, r.rsv1 && (c[0] |= 64), c[1] = l, l === 126 ? c.writeUInt16BE(a, 2) : l === 127 && (c[2] = c[3] = 0, c.writeUIntBE(a, 4, 6)), r.mask ? (c[1] |= 128, c[s - 4] = i[0], c[s - 3] = i[1], c[s - 2] = i[2], c[s - 1] = i[3], o ? [c, e] : n ? (Rf(e, i, c, s, a), [c]) : (Rf(e, i, e, 0, a), [c, e])) : [c, e]; } close(e, r, i, n) { let s; if (e === void 0) - s = zv; + s = Wv; else { - if (typeof e != "number" || !Wv(e)) + if (typeof e != "number" || !Yv(e)) throw new TypeError("First argument must be a valid error code number"); if (r === void 0 || !r.length) s = Buffer.allocUnsafe(2), s.writeUInt16BE(e, 0); @@ -7792,36 +7806,36 @@ See: https://github.com/isaacs/node-glob/issues/167`); } } let o = { [ot]: s.length, fin: true, generateMask: this._generateMask, mask: i, maskBuffer: this._maskBuffer, opcode: 8, readOnly: false, rsv1: false }; - this._deflating ? this.enqueue([this.dispatch, s, false, o, n]) : this.sendFrame(pt.frame(s, o), n); + this._deflating ? this.enqueue([this.dispatch, s, false, o, n]) : this.sendFrame(dt.frame(s, o), n); } ping(e, r, i) { let n, s; - if (typeof e == "string" ? (n = Buffer.byteLength(e), s = false) : (e = yr(e), n = e.length, s = yr.readOnly), n > 125) + if (typeof e == "string" ? (n = Buffer.byteLength(e), s = false) : (e = br(e), n = e.length, s = br.readOnly), n > 125) throw new RangeError("The data size must not be greater than 125 bytes"); let o = { [ot]: n, fin: true, generateMask: this._generateMask, mask: r, maskBuffer: this._maskBuffer, opcode: 9, readOnly: s, rsv1: false }; - this._deflating ? this.enqueue([this.dispatch, e, false, o, i]) : this.sendFrame(pt.frame(e, o), i); + this._deflating ? this.enqueue([this.dispatch, e, false, o, i]) : this.sendFrame(dt.frame(e, o), i); } pong(e, r, i) { let n, s; - if (typeof e == "string" ? (n = Buffer.byteLength(e), s = false) : (e = yr(e), n = e.length, s = yr.readOnly), n > 125) + if (typeof e == "string" ? (n = Buffer.byteLength(e), s = false) : (e = br(e), n = e.length, s = br.readOnly), n > 125) throw new RangeError("The data size must not be greater than 125 bytes"); let o = { [ot]: n, fin: true, generateMask: this._generateMask, mask: r, maskBuffer: this._maskBuffer, opcode: 10, readOnly: s, rsv1: false }; - this._deflating ? this.enqueue([this.dispatch, e, false, o, i]) : this.sendFrame(pt.frame(e, o), i); + this._deflating ? this.enqueue([this.dispatch, e, false, o, i]) : this.sendFrame(dt.frame(e, o), i); } send(e, r, i) { - let n = this._extensions[Tf.extensionName], s = r.binary ? 2 : 1, o = r.compress, a, l; - if (typeof e == "string" ? (a = Buffer.byteLength(e), l = false) : (e = yr(e), a = e.length, l = yr.readOnly), this._firstFragment ? (this._firstFragment = false, o && n && n.params[n._isServer ? "server_no_context_takeover" : "client_no_context_takeover"] && (o = a >= n._threshold), this._compress = o) : (o = false, s = 0), r.fin && (this._firstFragment = true), n) { + let n = this._extensions[Af.extensionName], s = r.binary ? 2 : 1, o = r.compress, a, l; + if (typeof e == "string" ? (a = Buffer.byteLength(e), l = false) : (e = br(e), a = e.length, l = br.readOnly), this._firstFragment ? (this._firstFragment = false, o && n && n.params[n._isServer ? "server_no_context_takeover" : "client_no_context_takeover"] && (o = a >= n._threshold), this._compress = o) : (o = false, s = 0), r.fin && (this._firstFragment = true), n) { let c = { [ot]: a, fin: r.fin, generateMask: this._generateMask, mask: r.mask, maskBuffer: this._maskBuffer, opcode: s, readOnly: l, rsv1: o }; this._deflating ? this.enqueue([this.dispatch, e, this._compress, c, i]) : this.dispatch(e, this._compress, c, i); } else - this.sendFrame(pt.frame(e, { [ot]: a, fin: r.fin, generateMask: this._generateMask, mask: r.mask, maskBuffer: this._maskBuffer, opcode: s, readOnly: l, rsv1: false }), i); + this.sendFrame(dt.frame(e, { [ot]: a, fin: r.fin, generateMask: this._generateMask, mask: r.mask, maskBuffer: this._maskBuffer, opcode: s, readOnly: l, rsv1: false }), i); } dispatch(e, r, i, n) { if (!r) { - this.sendFrame(pt.frame(e, i), n); + this.sendFrame(dt.frame(e, i), n); return; } - let s = this._extensions[Tf.extensionName]; + let s = this._extensions[Af.extensionName]; this._bufferedBytes += i[ot], this._deflating = true, s.compress(e, i.fin, (o, a) => { if (this._socket.destroyed) { let l = new Error("The socket was closed while data was being compressed"); @@ -7832,7 +7846,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); } return; } - this._bufferedBytes -= i[ot], this._deflating = false, i.readOnly = false, this.sendFrame(pt.frame(a, i), n), this.dequeue(); + this._bufferedBytes -= i[ot], this._deflating = false, i.readOnly = false, this.sendFrame(dt.frame(a, i), n), this.dequeue(); }); } dequeue() { @@ -7848,110 +7862,110 @@ See: https://github.com/isaacs/node-glob/issues/167`); e.length === 2 ? (this._socket.cork(), this._socket.write(e[0]), this._socket.write(e[1], r), this._socket.uncork()) : this._socket.write(e[0], r); } }; - Rf.exports = pt; + Bf.exports = dt; }); - var qf = x((ry, jf) => { + var Hf = x((iy, qf) => { "use strict"; - var { kForOnEventAttribute: Ks, kListener: Bf } = kt(), Lf = Symbol("kCode"), Nf = Symbol("kData"), Pf = Symbol("kError"), Ff = Symbol("kMessage"), Mf = Symbol("kReason"), br = Symbol("kTarget"), Uf = Symbol("kType"), Df = Symbol("kWasClean"), Ot = class { + var { kForOnEventAttribute: Ks, kListener: Lf } = Ct(), Nf = Symbol("kCode"), Pf = Symbol("kData"), Ff = Symbol("kError"), Mf = Symbol("kMessage"), Uf = Symbol("kReason"), wr = Symbol("kTarget"), Df = Symbol("kType"), jf = Symbol("kWasClean"), It = class { constructor(e) { - this[br] = null, this[Uf] = e; + this[wr] = null, this[Df] = e; } get target() { - return this[br]; + return this[wr]; } get type() { - return this[Uf]; + return this[Df]; } }; - Object.defineProperty(Ot.prototype, "target", { enumerable: true }); - Object.defineProperty(Ot.prototype, "type", { enumerable: true }); - var wr = class extends Ot { + Object.defineProperty(It.prototype, "target", { enumerable: true }); + Object.defineProperty(It.prototype, "type", { enumerable: true }); + var Er = class extends It { constructor(e, r = {}) { super(e); - this[Lf] = r.code === void 0 ? 0 : r.code, this[Mf] = r.reason === void 0 ? "" : r.reason, this[Df] = r.wasClean === void 0 ? false : r.wasClean; + this[Nf] = r.code === void 0 ? 0 : r.code, this[Uf] = r.reason === void 0 ? "" : r.reason, this[jf] = r.wasClean === void 0 ? false : r.wasClean; } get code() { - return this[Lf]; + return this[Nf]; } get reason() { - return this[Mf]; + return this[Uf]; } get wasClean() { - return this[Df]; + return this[jf]; } }; - Object.defineProperty(wr.prototype, "code", { enumerable: true }); - Object.defineProperty(wr.prototype, "reason", { enumerable: true }); - Object.defineProperty(wr.prototype, "wasClean", { enumerable: true }); - var ei = class extends Ot { + Object.defineProperty(Er.prototype, "code", { enumerable: true }); + Object.defineProperty(Er.prototype, "reason", { enumerable: true }); + Object.defineProperty(Er.prototype, "wasClean", { enumerable: true }); + var ti = class extends It { constructor(e, r = {}) { super(e); - this[Pf] = r.error === void 0 ? null : r.error, this[Ff] = r.message === void 0 ? "" : r.message; + this[Ff] = r.error === void 0 ? null : r.error, this[Mf] = r.message === void 0 ? "" : r.message; } get error() { - return this[Pf]; + return this[Ff]; } get message() { - return this[Ff]; + return this[Mf]; } }; - Object.defineProperty(ei.prototype, "error", { enumerable: true }); - Object.defineProperty(ei.prototype, "message", { enumerable: true }); - var zi = class extends Ot { + Object.defineProperty(ti.prototype, "error", { enumerable: true }); + Object.defineProperty(ti.prototype, "message", { enumerable: true }); + var zi = class extends It { constructor(e, r = {}) { super(e); - this[Nf] = r.data === void 0 ? null : r.data; + this[Pf] = r.data === void 0 ? null : r.data; } get data() { - return this[Nf]; + return this[Pf]; } }; Object.defineProperty(zi.prototype, "data", { enumerable: true }); - var Kv = { addEventListener(t, e, r = {}) { + var Zv = { addEventListener(t, e, r = {}) { let i; if (t === "message") i = function(s, o) { let a = new zi("message", { data: o ? s : s.toString() }); - a[br] = this, e.call(this, a); + a[wr] = this, e.call(this, a); }; else if (t === "close") i = function(s, o) { - let a = new wr("close", { code: s, reason: o.toString(), wasClean: this._closeFrameReceived && this._closeFrameSent }); - a[br] = this, e.call(this, a); + let a = new Er("close", { code: s, reason: o.toString(), wasClean: this._closeFrameReceived && this._closeFrameSent }); + a[wr] = this, e.call(this, a); }; else if (t === "error") i = function(s) { - let o = new ei("error", { error: s, message: s.message }); - o[br] = this, e.call(this, o); + let o = new ti("error", { error: s, message: s.message }); + o[wr] = this, e.call(this, o); }; else if (t === "open") i = function() { - let s = new Ot("open"); - s[br] = this, e.call(this, s); + let s = new It("open"); + s[wr] = this, e.call(this, s); }; else return; - i[Ks] = !!r[Ks], i[Bf] = e, r.once ? this.once(t, i) : this.on(t, i); + i[Ks] = !!r[Ks], i[Lf] = e, r.once ? this.once(t, i) : this.on(t, i); }, removeEventListener(t, e) { for (let r of this.listeners(t)) - if (r[Bf] === e && !r[Ks]) { + if (r[Lf] === e && !r[Ks]) { this.removeListener(t, r); break; } } }; - jf.exports = { CloseEvent: wr, ErrorEvent: ei, Event: Ot, EventTarget: Kv, MessageEvent: zi }; + qf.exports = { CloseEvent: Er, ErrorEvent: ti, Event: It, EventTarget: Zv, MessageEvent: zi }; }); - var Zs = x((iy, Hf) => { + var Zs = x((ny, Vf) => { "use strict"; - var { tokenChars: ti } = Qr(); - function lt(t, e, r) { + var { tokenChars: ri } = Jr(); + function ct(t, e, r) { t[e] === void 0 ? t[e] = [r] : t[e].push(r); } - function Zv(t) { + function Xv(t) { let e = Object.create(null), r = Object.create(null), i = false, n = false, s = false, o, a, l = -1, c = -1, u = -1, f = 0; for (; f < t.length; f++) if (c = t.charCodeAt(f), o === void 0) - if (u === -1 && ti[c] === 1) + if (u === -1 && ri[c] === 1) l === -1 && (l = f); else if (f !== 0 && (c === 32 || c === 9)) u === -1 && l !== -1 && (u = f); @@ -7960,28 +7974,28 @@ See: https://github.com/isaacs/node-glob/issues/167`); throw new SyntaxError(`Unexpected character at index ${f}`); u === -1 && (u = f); let p = t.slice(l, u); - c === 44 ? (lt(e, p, r), r = Object.create(null)) : o = p, l = u = -1; + c === 44 ? (ct(e, p, r), r = Object.create(null)) : o = p, l = u = -1; } else throw new SyntaxError(`Unexpected character at index ${f}`); else if (a === void 0) - if (u === -1 && ti[c] === 1) + if (u === -1 && ri[c] === 1) l === -1 && (l = f); else if (c === 32 || c === 9) u === -1 && l !== -1 && (u = f); else if (c === 59 || c === 44) { if (l === -1) throw new SyntaxError(`Unexpected character at index ${f}`); - u === -1 && (u = f), lt(r, t.slice(l, u), true), c === 44 && (lt(e, o, r), r = Object.create(null), o = void 0), l = u = -1; + u === -1 && (u = f), ct(r, t.slice(l, u), true), c === 44 && (ct(e, o, r), r = Object.create(null), o = void 0), l = u = -1; } else if (c === 61 && l !== -1 && u === -1) a = t.slice(l, f), l = u = -1; else throw new SyntaxError(`Unexpected character at index ${f}`); else if (n) { - if (ti[c] !== 1) + if (ri[c] !== 1) throw new SyntaxError(`Unexpected character at index ${f}`); l === -1 ? l = f : i || (i = true), n = false; } else if (s) - if (ti[c] === 1) + if (ri[c] === 1) l === -1 && (l = f); else if (c === 34 && l !== -1) s = false, u = f; @@ -7991,7 +8005,7 @@ See: https://github.com/isaacs/node-glob/issues/167`); throw new SyntaxError(`Unexpected character at index ${f}`); else if (c === 34 && t.charCodeAt(f - 1) === 61) s = true; - else if (u === -1 && ti[c] === 1) + else if (u === -1 && ri[c] === 1) l === -1 && (l = f); else if (l !== -1 && (c === 32 || c === 9)) u === -1 && (u = f); @@ -8000,16 +8014,16 @@ See: https://github.com/isaacs/node-glob/issues/167`); throw new SyntaxError(`Unexpected character at index ${f}`); u === -1 && (u = f); let p = t.slice(l, u); - i && (p = p.replace(/\\/g, ""), i = false), lt(r, a, p), c === 44 && (lt(e, o, r), r = Object.create(null), o = void 0), a = void 0, l = u = -1; + i && (p = p.replace(/\\/g, ""), i = false), ct(r, a, p), c === 44 && (ct(e, o, r), r = Object.create(null), o = void 0), a = void 0, l = u = -1; } else throw new SyntaxError(`Unexpected character at index ${f}`); if (l === -1 || s || c === 32 || c === 9) throw new SyntaxError("Unexpected end of input"); u === -1 && (u = f); let h = t.slice(l, u); - return o === void 0 ? lt(e, h, r) : (a === void 0 ? lt(r, h, true) : i ? lt(r, a, h.replace(/\\/g, "")) : lt(r, a, h), lt(e, o, r)), e; + return o === void 0 ? ct(e, h, r) : (a === void 0 ? ct(r, h, true) : i ? ct(r, a, h.replace(/\\/g, "")) : ct(r, a, h), ct(e, o, r)), e; } - function Xv(t) { + function Qv(t) { return Object.keys(t).map((e) => { let r = t[e]; return Array.isArray(r) || (r = [r]), r.map((i) => [e].concat(Object.keys(i).map((n) => { @@ -8018,20 +8032,20 @@ See: https://github.com/isaacs/node-glob/issues/167`); })).join("; ")).join(", "); }).join(", "); } - Hf.exports = { format: Xv, parse: Zv }; + Vf.exports = { format: Qv, parse: Xv }; }); - var ro = x((sy, Qf) => { + var ro = x((oy, Jf) => { "use strict"; - var Qv = require("events"), Jv = require("https"), eg = require("http"), Gf = require("net"), tg = require("tls"), { randomBytes: rg, createHash: ig } = require("crypto"), { Readable: ny } = require("stream"), { URL: Xs } = require("url"), It = Xr(), ng = Ws(), sg = Ys(), { BINARY_TYPES: Vf, EMPTY_BUFFER: Wi, GUID: og, kForOnEventAttribute: Qs, kListener: ag, kStatusCode: lg, kWebSocket: Ve, NOOP: zf } = kt(), { EventTarget: { addEventListener: cg, removeEventListener: ug } } = qf(), { format: fg, parse: hg } = Zs(), { toBuffer: pg } = Yr(), dt = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"], dg = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/, Js = [8, 13], mg = 30 * 1e3, J = class extends Qv { + var Jv = require("events"), eg = require("https"), tg = require("http"), zf = require("net"), rg = require("tls"), { randomBytes: ig, createHash: ng } = require("crypto"), { Readable: sy } = require("stream"), { URL: Xs } = require("url"), Tt = Qr(), sg = Ws(), og = Ys(), { BINARY_TYPES: $f, EMPTY_BUFFER: Wi, GUID: ag, kForOnEventAttribute: Qs, kListener: lg, kStatusCode: cg, kWebSocket: He, NOOP: Wf } = Ct(), { EventTarget: { addEventListener: ug, removeEventListener: fg } } = Hf(), { format: hg, parse: pg } = Zs(), { toBuffer: dg } = Kr(), mt = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"], mg = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/, Js = [8, 13], vg = 30 * 1e3, X = class extends Jv { constructor(e, r, i) { super(); - this._binaryType = Vf[0], this._closeCode = 1006, this._closeFrameReceived = false, this._closeFrameSent = false, this._closeMessage = Wi, this._closeTimer = null, this._extensions = {}, this._paused = false, this._protocol = "", this._readyState = J.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, e !== null ? (this._bufferedAmount = 0, this._isServer = false, this._redirects = 0, r === void 0 ? r = [] : Array.isArray(r) || (typeof r == "object" && r !== null ? (i = r, r = []) : r = [r]), Wf(this, e, r, i)) : this._isServer = true; + this._binaryType = $f[0], this._closeCode = 1006, this._closeFrameReceived = false, this._closeFrameSent = false, this._closeMessage = Wi, this._closeTimer = null, this._extensions = {}, this._paused = false, this._protocol = "", this._readyState = X.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, e !== null ? (this._bufferedAmount = 0, this._isServer = false, this._redirects = 0, r === void 0 ? r = [] : Array.isArray(r) || (typeof r == "object" && r !== null ? (i = r, r = []) : r = [r]), Yf(this, e, r, i)) : this._isServer = true; } get binaryType() { return this._binaryType; } set binaryType(e) { - !Vf.includes(e) || (this._binaryType = e, this._receiver && (this._receiver._binaryType = e)); + !$f.includes(e) || (this._binaryType = e, this._receiver && (this._receiver._binaryType = e)); } get bufferedAmount() { return this._socket ? this._socket._writableState.length + this._sender._bufferedBytes : this._bufferedAmount; @@ -8064,91 +8078,91 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._url; } setSocket(e, r, i) { - let n = new ng({ binaryType: this.binaryType, extensions: this._extensions, isServer: this._isServer, maxPayload: i.maxPayload, skipUTF8Validation: i.skipUTF8Validation }); - this._sender = new sg(e, this._extensions, i.generateMask), this._receiver = n, this._socket = e, n[Ve] = this, e[Ve] = this, n.on("conclude", _g), n.on("drain", xg), n.on("error", yg), n.on("message", bg), n.on("ping", wg), n.on("pong", Eg), e.setTimeout(0), e.setNoDelay(), r.length > 0 && e.unshift(r), e.on("close", Kf), e.on("data", Yi), e.on("end", Zf), e.on("error", Xf), this._readyState = J.OPEN, this.emit("open"); + let n = new sg({ binaryType: this.binaryType, extensions: this._extensions, isServer: this._isServer, maxPayload: i.maxPayload, skipUTF8Validation: i.skipUTF8Validation }); + this._sender = new og(e, this._extensions, i.generateMask), this._receiver = n, this._socket = e, n[He] = this, e[He] = this, n.on("conclude", xg), n.on("drain", yg), n.on("error", bg), n.on("message", wg), n.on("ping", Eg), n.on("pong", Sg), e.setTimeout(0), e.setNoDelay(), r.length > 0 && e.unshift(r), e.on("close", Zf), e.on("data", Yi), e.on("end", Xf), e.on("error", Qf), this._readyState = X.OPEN, this.emit("open"); } emitClose() { if (!this._socket) { - this._readyState = J.CLOSED, this.emit("close", this._closeCode, this._closeMessage); + this._readyState = X.CLOSED, this.emit("close", this._closeCode, this._closeMessage); return; } - this._extensions[It.extensionName] && this._extensions[It.extensionName].cleanup(), this._receiver.removeAllListeners(), this._readyState = J.CLOSED, this.emit("close", this._closeCode, this._closeMessage); + this._extensions[Tt.extensionName] && this._extensions[Tt.extensionName].cleanup(), this._receiver.removeAllListeners(), this._readyState = X.CLOSED, this.emit("close", this._closeCode, this._closeMessage); } close(e, r) { - if (this.readyState !== J.CLOSED) { - if (this.readyState === J.CONNECTING) { + if (this.readyState !== X.CLOSED) { + if (this.readyState === X.CONNECTING) { let i = "WebSocket was closed before the connection was established"; return et(this, this._req, i); } - if (this.readyState === J.CLOSING) { + if (this.readyState === X.CLOSING) { this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end(); return; } - this._readyState = J.CLOSING, this._sender.close(e, r, !this._isServer, (i) => { + this._readyState = X.CLOSING, this._sender.close(e, r, !this._isServer, (i) => { i || (this._closeFrameSent = true, (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end()); - }), this._closeTimer = setTimeout(this._socket.destroy.bind(this._socket), mg); + }), this._closeTimer = setTimeout(this._socket.destroy.bind(this._socket), vg); } } pause() { - this.readyState === J.CONNECTING || this.readyState === J.CLOSED || (this._paused = true, this._socket.pause()); + this.readyState === X.CONNECTING || this.readyState === X.CLOSED || (this._paused = true, this._socket.pause()); } ping(e, r, i) { - if (this.readyState === J.CONNECTING) + if (this.readyState === X.CONNECTING) throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - if (typeof e == "function" ? (i = e, e = r = void 0) : typeof r == "function" && (i = r, r = void 0), typeof e == "number" && (e = e.toString()), this.readyState !== J.OPEN) { + if (typeof e == "function" ? (i = e, e = r = void 0) : typeof r == "function" && (i = r, r = void 0), typeof e == "number" && (e = e.toString()), this.readyState !== X.OPEN) { to(this, e, i); return; } r === void 0 && (r = !this._isServer), this._sender.ping(e || Wi, r, i); } pong(e, r, i) { - if (this.readyState === J.CONNECTING) + if (this.readyState === X.CONNECTING) throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - if (typeof e == "function" ? (i = e, e = r = void 0) : typeof r == "function" && (i = r, r = void 0), typeof e == "number" && (e = e.toString()), this.readyState !== J.OPEN) { + if (typeof e == "function" ? (i = e, e = r = void 0) : typeof r == "function" && (i = r, r = void 0), typeof e == "number" && (e = e.toString()), this.readyState !== X.OPEN) { to(this, e, i); return; } r === void 0 && (r = !this._isServer), this._sender.pong(e || Wi, r, i); } resume() { - this.readyState === J.CONNECTING || this.readyState === J.CLOSED || (this._paused = false, this._receiver._writableState.needDrain || this._socket.resume()); + this.readyState === X.CONNECTING || this.readyState === X.CLOSED || (this._paused = false, this._receiver._writableState.needDrain || this._socket.resume()); } send(e, r, i) { - if (this.readyState === J.CONNECTING) + if (this.readyState === X.CONNECTING) throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - if (typeof r == "function" && (i = r, r = {}), typeof e == "number" && (e = e.toString()), this.readyState !== J.OPEN) { + if (typeof r == "function" && (i = r, r = {}), typeof e == "number" && (e = e.toString()), this.readyState !== X.OPEN) { to(this, e, i); return; } let n = __spreadValues({ binary: typeof e != "string", mask: !this._isServer, compress: true, fin: true }, r); - this._extensions[It.extensionName] || (n.compress = false), this._sender.send(e || Wi, n, i); + this._extensions[Tt.extensionName] || (n.compress = false), this._sender.send(e || Wi, n, i); } terminate() { - if (this.readyState !== J.CLOSED) { - if (this.readyState === J.CONNECTING) { + if (this.readyState !== X.CLOSED) { + if (this.readyState === X.CONNECTING) { let e = "WebSocket was closed before the connection was established"; return et(this, this._req, e); } - this._socket && (this._readyState = J.CLOSING, this._socket.destroy()); + this._socket && (this._readyState = X.CLOSING, this._socket.destroy()); } } }; - Object.defineProperty(J, "CONNECTING", { enumerable: true, value: dt.indexOf("CONNECTING") }); - Object.defineProperty(J.prototype, "CONNECTING", { enumerable: true, value: dt.indexOf("CONNECTING") }); - Object.defineProperty(J, "OPEN", { enumerable: true, value: dt.indexOf("OPEN") }); - Object.defineProperty(J.prototype, "OPEN", { enumerable: true, value: dt.indexOf("OPEN") }); - Object.defineProperty(J, "CLOSING", { enumerable: true, value: dt.indexOf("CLOSING") }); - Object.defineProperty(J.prototype, "CLOSING", { enumerable: true, value: dt.indexOf("CLOSING") }); - Object.defineProperty(J, "CLOSED", { enumerable: true, value: dt.indexOf("CLOSED") }); - Object.defineProperty(J.prototype, "CLOSED", { enumerable: true, value: dt.indexOf("CLOSED") }); + Object.defineProperty(X, "CONNECTING", { enumerable: true, value: mt.indexOf("CONNECTING") }); + Object.defineProperty(X.prototype, "CONNECTING", { enumerable: true, value: mt.indexOf("CONNECTING") }); + Object.defineProperty(X, "OPEN", { enumerable: true, value: mt.indexOf("OPEN") }); + Object.defineProperty(X.prototype, "OPEN", { enumerable: true, value: mt.indexOf("OPEN") }); + Object.defineProperty(X, "CLOSING", { enumerable: true, value: mt.indexOf("CLOSING") }); + Object.defineProperty(X.prototype, "CLOSING", { enumerable: true, value: mt.indexOf("CLOSING") }); + Object.defineProperty(X, "CLOSED", { enumerable: true, value: mt.indexOf("CLOSED") }); + Object.defineProperty(X.prototype, "CLOSED", { enumerable: true, value: mt.indexOf("CLOSED") }); ["binaryType", "bufferedAmount", "extensions", "isPaused", "protocol", "readyState", "url"].forEach((t) => { - Object.defineProperty(J.prototype, t, { enumerable: true }); + Object.defineProperty(X.prototype, t, { enumerable: true }); }); ["open", "error", "close", "message"].forEach((t) => { - Object.defineProperty(J.prototype, `on${t}`, { enumerable: true, get() { + Object.defineProperty(X.prototype, `on${t}`, { enumerable: true, get() { for (let e of this.listeners(t)) if (e[Qs]) - return e[ag]; + return e[lg]; return null; }, set(e) { for (let r of this.listeners(t)) @@ -8159,10 +8173,10 @@ See: https://github.com/isaacs/node-glob/issues/167`); typeof e == "function" && this.addEventListener(t, e, { [Qs]: true }); } }); }); - J.prototype.addEventListener = cg; - J.prototype.removeEventListener = ug; - Qf.exports = J; - function Wf(t, e, r, i) { + X.prototype.addEventListener = ug; + X.prototype.removeEventListener = fg; + Jf.exports = X; + function Yf(t, e, r, i) { let n = __spreadProps(__spreadValues({ protocolVersion: Js[1], maxPayload: 104857600, skipUTF8Validation: false, perMessageDeflate: true, followRedirects: false, maxRedirects: 10 }, i), { createConnection: void 0, socketPath: void 0, hostname: void 0, protocol: void 0, timeout: void 0, method: void 0, host: void 0, path: void 0, port: void 0 }); if (!Js.includes(n.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Js.join(", ")})`); @@ -8185,10 +8199,10 @@ See: https://github.com/isaacs/node-glob/issues/167`); eo(t, m); return; } - let c = o ? 443 : 80, u = rg(16).toString("base64"), f = o ? Jv.get : eg.get, h = /* @__PURE__ */ new Set(), p; - if (n.createConnection = o ? gg : vg, n.defaultPort = n.defaultPort || c, n.port = s.port || c, n.host = s.hostname.startsWith("[") ? s.hostname.slice(1, -1) : s.hostname, n.headers = __spreadValues({ "Sec-WebSocket-Version": n.protocolVersion, "Sec-WebSocket-Key": u, Connection: "Upgrade", Upgrade: "websocket" }, n.headers), n.path = s.pathname + s.search, n.timeout = n.handshakeTimeout, n.perMessageDeflate && (p = new It(n.perMessageDeflate !== true ? n.perMessageDeflate : {}, false, n.maxPayload), n.headers["Sec-WebSocket-Extensions"] = fg({ [It.extensionName]: p.offer() })), r.length) { + let c = o ? 443 : 80, u = ig(16).toString("base64"), f = o ? eg.get : tg.get, h = /* @__PURE__ */ new Set(), p; + if (n.createConnection = o ? _g : gg, n.defaultPort = n.defaultPort || c, n.port = s.port || c, n.host = s.hostname.startsWith("[") ? s.hostname.slice(1, -1) : s.hostname, n.headers = __spreadValues({ "Sec-WebSocket-Version": n.protocolVersion, "Sec-WebSocket-Key": u, Connection: "Upgrade", Upgrade: "websocket" }, n.headers), n.path = s.pathname + s.search, n.timeout = n.handshakeTimeout, n.perMessageDeflate && (p = new Tt(n.perMessageDeflate !== true ? n.perMessageDeflate : {}, false, n.maxPayload), n.headers["Sec-WebSocket-Extensions"] = hg({ [Tt.extensionName]: p.offer() })), r.length) { for (let m of r) { - if (typeof m != "string" || !dg.test(m) || h.has(m)) + if (typeof m != "string" || !mg.test(m) || h.has(m)) throw new SyntaxError("An invalid or duplicated subprotocol was specified"); h.add(m); } @@ -8211,23 +8225,23 @@ See: https://github.com/isaacs/node-glob/issues/167`); return; } d.abort(); - let O; + let I; try { - O = new Xs(v, e); + I = new Xs(v, e); } catch (e2) { let S = new SyntaxError(`Invalid URL: ${v}`); eo(t, S); return; } - Wf(t, O, r, i); + Yf(t, I, r, i); } else t.emit("unexpected-response", d, m) || et(t, d, `Unexpected server response: ${m.statusCode}`); }), d.on("upgrade", (m, v, y) => { - if (t.emit("upgrade", m), t.readyState !== J.CONNECTING) + if (t.emit("upgrade", m), t.readyState !== X.CONNECTING) return; d = t._req = null; - let O = ig("sha1").update(u + og).digest("base64"); - if (m.headers["sec-websocket-accept"] !== O) { + let I = ng("sha1").update(u + ag).digest("base64"); + if (m.headers["sec-websocket-accept"] !== I) { et(t, v, "Invalid Sec-WebSocket-Accept header"); return; } @@ -8243,107 +8257,107 @@ See: https://github.com/isaacs/node-glob/issues/167`); et(t, v, "Server sent a Sec-WebSocket-Extensions header but no extension was requested"); return; } - let V; + let $; try { - V = hg(b); + $ = pg(b); } catch (e2) { et(t, v, "Invalid Sec-WebSocket-Extensions header"); return; } - let C = Object.keys(V); - if (C.length !== 1 || C[0] !== It.extensionName) { + let C = Object.keys($); + if (C.length !== 1 || C[0] !== Tt.extensionName) { et(t, v, "Server indicated an extension that was not requested"); return; } try { - p.accept(V[It.extensionName]); + p.accept($[Tt.extensionName]); } catch (e2) { et(t, v, "Invalid Sec-WebSocket-Extensions header"); return; } - t._extensions[It.extensionName] = p; + t._extensions[Tt.extensionName] = p; } t.setSocket(v, y, { generateMask: n.generateMask, maxPayload: n.maxPayload, skipUTF8Validation: n.skipUTF8Validation }); }); } function eo(t, e) { - t._readyState = J.CLOSING, t.emit("error", e), t.emitClose(); - } - function vg(t) { - return t.path = t.socketPath, Gf.connect(t); + t._readyState = X.CLOSING, t.emit("error", e), t.emitClose(); } function gg(t) { - return t.path = void 0, !t.servername && t.servername !== "" && (t.servername = Gf.isIP(t.host) ? "" : t.host), tg.connect(t); + return t.path = t.socketPath, zf.connect(t); + } + function _g(t) { + return t.path = void 0, !t.servername && t.servername !== "" && (t.servername = zf.isIP(t.host) ? "" : t.host), rg.connect(t); } function et(t, e, r) { - t._readyState = J.CLOSING; + t._readyState = X.CLOSING; let i = new Error(r); Error.captureStackTrace(i, et), e.setHeader ? (e.abort(), e.socket && !e.socket.destroyed && e.socket.destroy(), e.once("abort", t.emitClose.bind(t)), t.emit("error", i)) : (e.destroy(i), e.once("error", t.emit.bind(t, "error")), e.once("close", t.emitClose.bind(t))); } function to(t, e, r) { if (e) { - let i = pg(e).length; + let i = dg(e).length; t._socket ? t._sender._bufferedBytes += i : t._bufferedAmount += i; } if (r) { - let i = new Error(`WebSocket is not open: readyState ${t.readyState} (${dt[t.readyState]})`); + let i = new Error(`WebSocket is not open: readyState ${t.readyState} (${mt[t.readyState]})`); r(i); } } - function _g(t, e) { - let r = this[Ve]; - r._closeFrameReceived = true, r._closeMessage = e, r._closeCode = t, r._socket[Ve] !== void 0 && (r._socket.removeListener("data", Yi), process.nextTick(Yf, r._socket), t === 1005 ? r.close() : r.close(t, e)); + function xg(t, e) { + let r = this[He]; + r._closeFrameReceived = true, r._closeMessage = e, r._closeCode = t, r._socket[He] !== void 0 && (r._socket.removeListener("data", Yi), process.nextTick(Kf, r._socket), t === 1005 ? r.close() : r.close(t, e)); } - function xg() { - let t = this[Ve]; + function yg() { + let t = this[He]; t.isPaused || t._socket.resume(); } - function yg(t) { - let e = this[Ve]; - e._socket[Ve] !== void 0 && (e._socket.removeListener("data", Yi), process.nextTick(Yf, e._socket), e.close(t[lg])), e.emit("error", t); + function bg(t) { + let e = this[He]; + e._socket[He] !== void 0 && (e._socket.removeListener("data", Yi), process.nextTick(Kf, e._socket), e.close(t[cg])), e.emit("error", t); } - function $f() { - this[Ve].emitClose(); + function Gf() { + this[He].emitClose(); } - function bg(t, e) { - this[Ve].emit("message", t, e); - } - function wg(t) { - let e = this[Ve]; - e.pong(t, !e._isServer, zf), e.emit("ping", t); + function wg(t, e) { + this[He].emit("message", t, e); } function Eg(t) { - this[Ve].emit("pong", t); + let e = this[He]; + e.pong(t, !e._isServer, Wf), e.emit("ping", t); + } + function Sg(t) { + this[He].emit("pong", t); } - function Yf(t) { + function Kf(t) { t.resume(); } - function Kf() { - let t = this[Ve]; - this.removeListener("close", Kf), this.removeListener("data", Yi), this.removeListener("end", Zf), t._readyState = J.CLOSING; + function Zf() { + let t = this[He]; + this.removeListener("close", Zf), this.removeListener("data", Yi), this.removeListener("end", Xf), t._readyState = X.CLOSING; let e; - !this._readableState.endEmitted && !t._closeFrameReceived && !t._receiver._writableState.errorEmitted && (e = t._socket.read()) !== null && t._receiver.write(e), t._receiver.end(), this[Ve] = void 0, clearTimeout(t._closeTimer), t._receiver._writableState.finished || t._receiver._writableState.errorEmitted ? t.emitClose() : (t._receiver.on("error", $f), t._receiver.on("finish", $f)); + !this._readableState.endEmitted && !t._closeFrameReceived && !t._receiver._writableState.errorEmitted && (e = t._socket.read()) !== null && t._receiver.write(e), t._receiver.end(), this[He] = void 0, clearTimeout(t._closeTimer), t._receiver._writableState.finished || t._receiver._writableState.errorEmitted ? t.emitClose() : (t._receiver.on("error", Gf), t._receiver.on("finish", Gf)); } function Yi(t) { - this[Ve]._receiver.write(t) || this.pause(); - } - function Zf() { - let t = this[Ve]; - t._readyState = J.CLOSING, t._receiver.end(), this.end(); + this[He]._receiver.write(t) || this.pause(); } function Xf() { - let t = this[Ve]; - this.removeListener("error", Xf), this.on("error", zf), t && (t._readyState = J.CLOSING, this.destroy()); + let t = this[He]; + t._readyState = X.CLOSING, t._receiver.end(), this.end(); + } + function Qf() { + let t = this[He]; + this.removeListener("error", Qf), this.on("error", Wf), t && (t._readyState = X.CLOSING, this.destroy()); } }); - var eh = x((oy, Jf) => { + var th = x((ay, eh) => { "use strict"; - var { tokenChars: Sg } = Qr(); - function kg(t) { + var { tokenChars: kg } = Jr(); + function Cg(t) { let e = /* @__PURE__ */ new Set(), r = -1, i = -1, n = 0; for (n; n < t.length; n++) { let o = t.charCodeAt(n); - if (i === -1 && Sg[o] === 1) + if (i === -1 && kg[o] === 1) r === -1 && (r = n); else if (n !== 0 && (o === 32 || o === 9)) i === -1 && r !== -1 && (i = n); @@ -8365,11 +8379,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); throw new SyntaxError(`The "${s}" subprotocol is duplicated`); return e.add(s), e; } - Jf.exports = { parse: kg }; + eh.exports = { parse: Cg }; }); - var ah = x((uy, oh) => { + var lh = x((fy, ah) => { "use strict"; - var Cg = require("events"), Ki = require("http"), ay = require("https"), ly = require("net"), cy = require("tls"), { createHash: Og } = require("crypto"), th = Zs(), Wt = Xr(), Ig = eh(), Tg = ro(), { GUID: Ag, kWebSocket: Rg } = kt(), Bg = /^[+/0-9A-Za-z]{22}==$/, rh = 0, ih = 1, nh = 2, sh = class extends Cg { + var Og = require("events"), Ki = require("http"), ly = require("https"), cy = require("net"), uy = require("tls"), { createHash: Ig } = require("crypto"), rh = Zs(), Wt = Qr(), Tg = th(), Ag = ro(), { GUID: Rg, kWebSocket: Bg } = Ct(), Lg = /^[+/0-9A-Za-z]{22}==$/, ih = 0, nh = 1, sh = 2, oh = class extends Og { constructor(e, r) { super(); if (e = __spreadValues({ maxPayload: 100 * 1024 * 1024, skipUTF8Validation: false, perMessageDeflate: false, handleProtocols: null, clientTracking: true, verifyClient: null, noServer: false, backlog: null, server: null, host: null, path: null, port: null }, e), e.port == null && !e.server && !e.noServer || e.port != null && (e.server || e.noServer) || e.server && e.noServer) @@ -8379,11 +8393,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); n.writeHead(426, { "Content-Length": s.length, "Content-Type": "text/plain" }), n.end(s); }), this._server.listen(e.port, e.host, e.backlog, r)) : e.server && (this._server = e.server), this._server) { let i = this.emit.bind(this, "connection"); - this._removeListeners = Lg(this._server, { listening: this.emit.bind(this, "listening"), error: this.emit.bind(this, "error"), upgrade: (n, s, o) => { + this._removeListeners = Ng(this._server, { listening: this.emit.bind(this, "listening"), error: this.emit.bind(this, "error"), upgrade: (n, s, o) => { this.handleUpgrade(n, s, o, i); } }); } - e.perMessageDeflate === true && (e.perMessageDeflate = {}), e.clientTracking && (this.clients = /* @__PURE__ */ new Set(), this._shouldEmitClose = false), this.options = e, this._state = rh; + e.perMessageDeflate === true && (e.perMessageDeflate = {}), e.clientTracking && (this.clients = /* @__PURE__ */ new Set(), this._shouldEmitClose = false), this.options = e, this._state = ih; } address() { if (this.options.noServer) @@ -8391,19 +8405,19 @@ See: https://github.com/isaacs/node-glob/issues/167`); return this._server ? this._server.address() : null; } close(e) { - if (this._state === nh) { + if (this._state === sh) { e && this.once("close", () => { e(new Error("The server is not running")); - }), process.nextTick(ri, this); + }), process.nextTick(ii, this); return; } - if (e && this.once("close", e), this._state !== ih) - if (this._state = ih, this.options.noServer || this.options.server) - this._server && (this._removeListeners(), this._removeListeners = this._server = null), this.clients ? this.clients.size ? this._shouldEmitClose = true : process.nextTick(ri, this) : process.nextTick(ri, this); + if (e && this.once("close", e), this._state !== nh) + if (this._state = nh, this.options.noServer || this.options.server) + this._server && (this._removeListeners(), this._removeListeners = this._server = null), this.clients ? this.clients.size ? this._shouldEmitClose = true : process.nextTick(ii, this) : process.nextTick(ii, this); else { let r = this._server; this._removeListeners(), this._removeListeners = this._server = null, r.close(() => { - ri(this); + ii(this); }); } } @@ -8418,23 +8432,23 @@ See: https://github.com/isaacs/node-glob/issues/167`); handleUpgrade(e, r, i, n) { r.on("error", io); let s = e.headers["sec-websocket-key"] !== void 0 ? e.headers["sec-websocket-key"] : false, o = +e.headers["sec-websocket-version"]; - if (e.method !== "GET" || e.headers.upgrade.toLowerCase() !== "websocket" || !s || !Bg.test(s) || o !== 8 && o !== 13 || !this.shouldHandle(e)) - return Er(r, 400); + if (e.method !== "GET" || e.headers.upgrade.toLowerCase() !== "websocket" || !s || !Lg.test(s) || o !== 8 && o !== 13 || !this.shouldHandle(e)) + return Sr(r, 400); let a = e.headers["sec-websocket-protocol"], l = /* @__PURE__ */ new Set(); if (a !== void 0) try { - l = Ig.parse(a); + l = Tg.parse(a); } catch (e2) { - return Er(r, 400); + return Sr(r, 400); } let c = e.headers["sec-websocket-extensions"], u = {}; if (this.options.perMessageDeflate && c !== void 0) { let f = new Wt(this.options.perMessageDeflate, true, this.options.maxPayload); try { - let h = th.parse(c); + let h = rh.parse(c); h[Wt.extensionName] && (f.accept(h[Wt.extensionName]), u[Wt.extensionName] = f); } catch (e2) { - return Er(r, 400); + return Sr(r, 400); } } if (this.options.verifyClient) { @@ -8442,41 +8456,41 @@ See: https://github.com/isaacs/node-glob/issues/167`); if (this.options.verifyClient.length === 2) { this.options.verifyClient(f, (h, p, d, m) => { if (!h) - return Er(r, p || 401, d, m); + return Sr(r, p || 401, d, m); this.completeUpgrade(u, s, l, e, r, i, n); }); return; } if (!this.options.verifyClient(f)) - return Er(r, 401); + return Sr(r, 401); } this.completeUpgrade(u, s, l, e, r, i, n); } completeUpgrade(e, r, i, n, s, o, a) { if (!s.readable || !s.writable) return s.destroy(); - if (s[Rg]) + if (s[Bg]) throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration"); - if (this._state > rh) - return Er(s, 503); - let l = Og("sha1").update(r + Ag).digest("base64"), c = ["HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", "Connection: Upgrade", `Sec-WebSocket-Accept: ${l}`], u = new Tg(null); + if (this._state > ih) + return Sr(s, 503); + let l = Ig("sha1").update(r + Rg).digest("base64"), c = ["HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", "Connection: Upgrade", `Sec-WebSocket-Accept: ${l}`], u = new Ag(null); if (i.size) { let f = this.options.handleProtocols ? this.options.handleProtocols(i, n) : i.values().next().value; f && (c.push(`Sec-WebSocket-Protocol: ${f}`), u._protocol = f); } if (e[Wt.extensionName]) { - let f = e[Wt.extensionName].params, h = th.format({ [Wt.extensionName]: [f] }); + let f = e[Wt.extensionName].params, h = rh.format({ [Wt.extensionName]: [f] }); c.push(`Sec-WebSocket-Extensions: ${h}`), u._extensions = e; } this.emit("headers", c, n), s.write(c.concat(`\r `).join(`\r `)), s.removeListener("error", io), u.setSocket(s, o, { maxPayload: this.options.maxPayload, skipUTF8Validation: this.options.skipUTF8Validation }), this.clients && (this.clients.add(u), u.on("close", () => { - this.clients.delete(u), this._shouldEmitClose && !this.clients.size && process.nextTick(ri, this); + this.clients.delete(u), this._shouldEmitClose && !this.clients.size && process.nextTick(ii, this); })), a(u, n); } }; - oh.exports = sh; - function Lg(t, e) { + ah.exports = oh; + function Ng(t, e) { for (let r of Object.keys(e)) t.on(r, e[r]); return function() { @@ -8484,13 +8498,13 @@ See: https://github.com/isaacs/node-glob/issues/167`); t.removeListener(i, e[i]); }; } - function ri(t) { - t._state = nh, t.emit("close"); + function ii(t) { + t._state = sh, t.emit("close"); } function io() { this.destroy(); } - function Er(t, e, r, i) { + function Sr(t, e, r, i) { t.writable && (r = r || Ki.STATUS_CODES[e], i = __spreadValues({ Connection: "close", "Content-Type": "text/html", "Content-Length": Buffer.byteLength(r) }, i), t.write(`HTTP/1.1 ${e} ${Ki.STATUS_CODES[e]}\r ` + Object.keys(i).map((n) => `${n}: ${i[n]}`).join(`\r `) + `\r @@ -8498,31 +8512,30 @@ See: https://github.com/isaacs/node-glob/issues/167`); ` + r)), t.removeListener("error", io), t.destroy(); } }); - var Kg = {}; - Rh(Kg, { HttpsProxyAgent: () => bh.HttpsProxyAgent, PNG: () => wh.PNG, SocksProxyAgent: () => Sh.SocksProxyAgent, StackUtils: () => $g, colors: () => Pg, debug: () => Fg, getProxyForUrl: () => yh.getProxyForUrl, jpegjs: () => Mg, lockfile: () => Ug, mime: () => Dg, minimatch: () => jg, ms: () => qg, program: () => Eh.program, progress: () => Hg, rimraf: () => Vg, ws: () => Gg, wsReceiver: () => Wg, wsSender: () => Yg, wsServer: () => zg }); - module2.exports = Bh(Kg); - var uh = Te(Yo()); - var fh = Te(er()); - var yh = Te(sa()); - var bh = Te(ma()); - var hh = Te(wa()); - var ph = Te(el()); - var dh = Te(ll()); - var mh = Te(Dr()); - var vh = Te(Ji()); - var wh = Te(Ec()); - var Eh = Te(jc()); - var gh = Te(Gc()); - var _h = Te(Su()); - var Sh = Te(zu()); - var xh = Te(Qu()); - var Ng = Te(rf(), 1); + var Zg = {}; + Bh(Zg, { HttpsProxyAgent: () => wh.HttpsProxyAgent, PNG: () => Eh.PNG, SocksProxyAgent: () => kh.SocksProxyAgent, StackUtils: () => Gg, colors: () => Fg, debug: () => Mg, getProxyForUrl: () => bh.getProxyForUrl, jpegjs: () => Ug, lockfile: () => Dg, mime: () => jg, minimatch: () => qg, ms: () => Hg, program: () => Sh.program, progress: () => Vg, rimraf: () => $g, ws: () => zg, wsReceiver: () => Yg, wsSender: () => Kg, wsServer: () => Wg }); + module2.exports = Lh(Zg); + var fh = Te(Ko()); + var hh = Te(tr()); + var bh = Te(oa()); + var wh = Te(va()); + var ph = Te(Ea()); + var dh = Te(tl()); + var mh = Te(cl()); + var vh = Te(jr()); + var gh = Te(Ji()); + var Eh = Te(Sc()); + var Sh = Te(qc()); + var _h = Te(zc()); + var xh = Te(ku()); + var kh = Te(Wu()); + var yh = Te(Ju()); + var Pg = Te(nf(), 1); var no = Te(Ws(), 1); var so = Te(Ys(), 1); - var lh = Te(ro(), 1); - var oo = Te(ah(), 1); - var ch = lh.default; - var Pg = uh.default; + var ch = Te(ro(), 1); + var oo = Te(lh(), 1); + var uh = ch.default; var Fg = fh.default; var Mg = hh.default; var Ug = ph.default; @@ -8532,10 +8545,11 @@ See: https://github.com/isaacs/node-glob/issues/167`); var Hg = gh.default; var Vg = _h.default; var $g = xh.default; - var Gg = ch; - var zg = oo.default; - var Wg = no.default; - var Yg = so.default; + var Gg = yh.default; + var zg = uh; + var Wg = oo.default; + var Yg = no.default; + var Kg = so.default; } }); @@ -8697,17 +8711,262 @@ var require_ubuntuVersion = __commonJS({ return fields; } function parseUbuntuVersion(osReleaseText) { - var _fields$get, _fields$get2; + var _fields$get, _fields$get2, _fields$get3; const fields = parseOSReleaseText(osReleaseText); if (fields.get("distrib_id") && ((_fields$get = fields.get("distrib_id")) === null || _fields$get === void 0 ? void 0 : _fields$get.toLowerCase()) === "ubuntu") return fields.get("distrib_release") || ""; - if (!fields.get("name") || ((_fields$get2 = fields.get("name")) === null || _fields$get2 === void 0 ? void 0 : _fields$get2.toLowerCase()) !== "ubuntu") + if (fields.get("id") && ((_fields$get2 = fields.get("id")) === null || _fields$get2 === void 0 ? void 0 : _fields$get2.toLowerCase()) === "pop") + return fields.get("version_id") || ""; + if (!fields.get("name") || ((_fields$get3 = fields.get("name")) === null || _fields$get3 === void 0 ? void 0 : _fields$get3.toLowerCase()) !== "ubuntu") return ""; return fields.get("version_id") || ""; } } }); +// node_modules/playwright-core/lib/utils/index.js +var require_utils = __commonJS({ + "node_modules/playwright-core/lib/utils/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.arrayToObject = arrayToObject; + exports2.assert = assert; + exports2.calculateSha1 = calculateSha1; + exports2.constructURLBasedOnBaseURL = constructURLBasedOnBaseURL; + exports2.createGuid = createGuid; + exports2.debugAssert = debugAssert; + exports2.debugMode = debugMode; + exports2.deepCopy = deepCopy; + exports2.getAsBooleanFromENV = getAsBooleanFromENV; + exports2.getFromENV = getFromENV; + exports2.headersArrayToObject = headersArrayToObject; + exports2.headersObjectToArray = headersObjectToArray; + exports2.isError = isError; + exports2.isFilePayload = isFilePayload; + exports2.isLikelyNpxGlobal = void 0; + exports2.isObject = isObject; + exports2.isRegExp = isRegExp; + exports2.isString = isString; + exports2.isUnderTest = isUnderTest; + exports2.makeWaitForNextTask = makeWaitForNextTask; + exports2.monotonicTime = monotonicTime; + exports2.objectToArray = objectToArray; + exports2.setUnderTest = setUnderTest; + exports2.streamToString = streamToString; + exports2.wrapInASCIIBox = wrapInASCIIBox; + var crypto = _interopRequireWildcard(require("crypto")); + var URL2 = _interopRequireWildcard(require("url")); + var _v = _interopRequireDefault(require("v8")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") + return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop2) { + return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { default: obj }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function makeWaitForNextTask() { + if (process.versions.electron) + return (callback) => setTimeout(callback, 0); + if (parseInt(process.versions.node, 10) >= 11) + return setImmediate; + let spinning = false; + const callbacks = []; + const loop = () => { + const callback = callbacks.shift(); + if (!callback) { + spinning = false; + return; + } + setImmediate(loop); + callback(); + }; + return (callback) => { + callbacks.push(callback); + if (!spinning) { + spinning = true; + setImmediate(loop); + } + }; + } + function assert(value, message) { + if (!value) + throw new Error(message || "Assertion error"); + } + function debugAssert(value, message) { + if (isUnderTest() && !value) + throw new Error(message); + } + function isString(obj) { + return typeof obj === "string" || obj instanceof String; + } + function isRegExp(obj) { + return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]"; + } + function isObject(obj) { + return typeof obj === "object" && obj !== null; + } + function isError(obj) { + return obj instanceof Error || obj && obj.__proto__ && obj.__proto__.name === "Error"; + } + var debugEnv = getFromENV("PWDEBUG") || ""; + function debugMode() { + if (debugEnv === "console") + return "console"; + if (debugEnv === "0" || debugEnv === "false") + return ""; + return debugEnv ? "inspector" : ""; + } + var _isUnderTest = false; + function setUnderTest() { + _isUnderTest = true; + } + function isUnderTest() { + return _isUnderTest; + } + function getFromENV(name) { + let value = process.env[name]; + value = value === void 0 ? process.env[`npm_config_${name.toLowerCase()}`] : value; + value = value === void 0 ? process.env[`npm_package_config_${name.toLowerCase()}`] : value; + return value; + } + function getAsBooleanFromENV(name) { + const value = getFromENV(name); + return !!value && value !== "false" && value !== "0"; + } + function headersObjectToArray(headers, separator, setCookieSeparator) { + if (!setCookieSeparator) + setCookieSeparator = separator; + const result = []; + for (const name in headers) { + const values = headers[name]; + if (values === void 0) + continue; + if (separator) { + const sep = name.toLowerCase() === "set-cookie" ? setCookieSeparator : separator; + for (const value of values.split(sep)) + result.push({ + name, + value: value.trim() + }); + } else { + result.push({ + name, + value: values + }); + } + } + return result; + } + function headersArrayToObject(headers, lowerCase) { + const result = {}; + for (const { + name, + value + } of headers) + result[lowerCase ? name.toLowerCase() : name] = value; + return result; + } + function monotonicTime() { + const [seconds, nanoseconds] = process.hrtime(); + return seconds * 1e3 + (nanoseconds / 1e3 | 0) / 1e3; + } + function objectToArray(map) { + if (!map) + return void 0; + const result = []; + for (const [name, value] of Object.entries(map)) + result.push({ + name, + value: String(value) + }); + return result; + } + function arrayToObject(array) { + if (!array) + return void 0; + const result = {}; + for (const { + name, + value + } of array) + result[name] = value; + return result; + } + function calculateSha1(buffer) { + const hash = crypto.createHash("sha1"); + hash.update(buffer); + return hash.digest("hex"); + } + function createGuid() { + return crypto.randomBytes(16).toString("hex"); + } + function constructURLBasedOnBaseURL(baseURL, givenURL) { + try { + return new URL2.URL(givenURL, baseURL).toString(); + } catch (e) { + return givenURL; + } + } + function wrapInASCIIBox(text, padding = 0) { + const lines = text.split("\n"); + const maxLength = Math.max(...lines.map((line) => line.length)); + return ["\u2554" + "\u2550".repeat(maxLength + padding * 2) + "\u2557", ...lines.map((line) => "\u2551" + " ".repeat(padding) + line + " ".repeat(maxLength - line.length + padding) + "\u2551"), "\u255A" + "\u2550".repeat(maxLength + padding * 2) + "\u255D"].join("\n"); + } + function isFilePayload(value) { + return typeof value === "object" && value["name"] && value["mimeType"] && value["buffer"]; + } + function streamToString(stream) { + return new Promise((resolve, reject) => { + const chunks = []; + stream.on("data", (chunk) => chunks.push(Buffer.from(chunk))); + stream.on("error", reject); + stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf8"))); + }); + } + var isLikelyNpxGlobal = () => process.argv.length >= 2 && process.argv[1].includes("_npx"); + exports2.isLikelyNpxGlobal = isLikelyNpxGlobal; + function deepCopy(obj) { + return _v.default.deserialize(_v.default.serialize(obj)); + } + } +}); + // node_modules/playwright-core/lib/common/netUtils.js var require_netUtils = __commonJS({ "node_modules/playwright-core/lib/common/netUtils.js"(exports2) { @@ -8717,12 +8976,15 @@ var require_netUtils = __commonJS({ }); exports2.createSocket = createSocket; exports2.fetchData = fetchData; + exports2.globToRegex = globToRegex; exports2.httpRequest = httpRequest; + exports2.urlMatches = urlMatches; var _http = _interopRequireDefault(require("http")); var _https = _interopRequireDefault(require("https")); var _net = _interopRequireDefault(require("net")); var _utilsBundle = require_utilsBundle(); var URL2 = _interopRequireWildcard(require("url")); + var _utils = require_utils(); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; @@ -8836,6 +9098,86 @@ var require_netUtils = __commonJS({ }), reject); }); } + function urlMatches(baseURL, urlString, match) { + if (match === void 0 || match === "") + return true; + if ((0, _utils.isString)(match) && !match.startsWith("*")) + match = (0, _utils.constructURLBasedOnBaseURL)(baseURL, match); + if ((0, _utils.isString)(match)) + match = globToRegex(match); + if ((0, _utils.isRegExp)(match)) + return match.test(urlString); + if (typeof match === "string" && match === urlString) + return true; + const url = parsedURL(urlString); + if (!url) + return false; + if (typeof match === "string") + return url.pathname === match; + if (typeof match !== "function") + throw new Error("url parameter should be string, RegExp or function"); + return match(url); + } + function parsedURL(url) { + try { + return new URL2.URL(url); + } catch (e) { + return null; + } + } + var escapeGlobChars = /* @__PURE__ */ new Set(["/", "$", "^", "+", ".", "(", ")", "=", "!", "|"]); + function globToRegex(glob) { + const tokens = ["^"]; + let inGroup; + for (let i = 0; i < glob.length; ++i) { + const c = glob[i]; + if (escapeGlobChars.has(c)) { + tokens.push("\\" + c); + continue; + } + if (c === "*") { + const beforeDeep = glob[i - 1]; + let starCount = 1; + while (glob[i + 1] === "*") { + starCount++; + i++; + } + const afterDeep = glob[i + 1]; + const isDeep = starCount > 1 && (beforeDeep === "/" || beforeDeep === void 0) && (afterDeep === "/" || afterDeep === void 0); + if (isDeep) { + tokens.push("((?:[^/]*(?:/|$))*)"); + i++; + } else { + tokens.push("([^/]*)"); + } + continue; + } + switch (c) { + case "?": + tokens.push("."); + break; + case "{": + inGroup = true; + tokens.push("("); + break; + case "}": + inGroup = false; + tokens.push(")"); + break; + case ",": + if (inGroup) { + tokens.push("|"); + break; + } + tokens.push("\\" + c); + break; + default: + tokens.push(c); + } + } + tokens.push("$"); + return new RegExp(tokens.join("")); + } } }); @@ -8844,7 +9186,7 @@ var require_package = __commonJS({ "node_modules/playwright-core/package.json"(exports2, module2) { module2.exports = { name: "playwright-core", - version: "1.22.0", + version: "1.23.0", description: "A high-level API to automate web browsers", repository: "github:Microsoft/playwright", homepage: "https://playwright.dev", @@ -8857,6 +9199,7 @@ var require_package = __commonJS({ license: "Apache-2.0", exports: { ".": { + types: "./index.d.ts", import: "./index.mjs", require: "./index.js" }, @@ -8972,253 +9315,6 @@ var require_userAgent = __commonJS({ } }); -// node_modules/playwright-core/lib/utils/index.js -var require_utils = __commonJS({ - "node_modules/playwright-core/lib/utils/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.arrayToObject = arrayToObject; - exports2.assert = assert; - exports2.calculateSha1 = calculateSha1; - exports2.constructURLBasedOnBaseURL = constructURLBasedOnBaseURL; - exports2.createGuid = createGuid; - exports2.debugAssert = debugAssert; - exports2.debugMode = debugMode; - exports2.deepCopy = deepCopy; - exports2.experimentalFeaturesEnabled = experimentalFeaturesEnabled; - exports2.getAsBooleanFromENV = getAsBooleanFromENV; - exports2.getFromENV = getFromENV; - exports2.headersArrayToObject = headersArrayToObject; - exports2.headersObjectToArray = headersObjectToArray; - exports2.isError = isError; - exports2.isFilePayload = isFilePayload; - exports2.isLikelyNpxGlobal = void 0; - exports2.isObject = isObject; - exports2.isRegExp = isRegExp; - exports2.isString = isString; - exports2.isUnderTest = isUnderTest; - exports2.makeWaitForNextTask = makeWaitForNextTask; - exports2.monotonicTime = monotonicTime; - exports2.objectToArray = objectToArray; - exports2.setUnderTest = setUnderTest; - exports2.streamToString = streamToString; - exports2.wrapInASCIIBox = wrapInASCIIBox; - var crypto = _interopRequireWildcard(require("crypto")); - var URL2 = _interopRequireWildcard(require("url")); - var _v = _interopRequireDefault(require("v8")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") - return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop2) { - return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); - } - function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { default: obj }; - } - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function makeWaitForNextTask() { - if (process.versions.electron) - return (callback) => setTimeout(callback, 0); - if (parseInt(process.versions.node, 10) >= 11) - return setImmediate; - let spinning = false; - const callbacks = []; - const loop = () => { - const callback = callbacks.shift(); - if (!callback) { - spinning = false; - return; - } - setImmediate(loop); - callback(); - }; - return (callback) => { - callbacks.push(callback); - if (!spinning) { - spinning = true; - setImmediate(loop); - } - }; - } - function assert(value, message) { - if (!value) - throw new Error(message || "Assertion error"); - } - function debugAssert(value, message) { - if (isUnderTest() && !value) - throw new Error(message); - } - function isString(obj) { - return typeof obj === "string" || obj instanceof String; - } - function isRegExp(obj) { - return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]"; - } - function isObject(obj) { - return typeof obj === "object" && obj !== null; - } - function isError(obj) { - return obj instanceof Error || obj && obj.__proto__ && obj.__proto__.name === "Error"; - } - var debugEnv = getFromENV("PWDEBUG") || ""; - function debugMode() { - if (debugEnv === "console") - return "console"; - if (debugEnv === "0" || debugEnv === "false") - return ""; - return debugEnv ? "inspector" : ""; - } - var _isUnderTest = false; - function setUnderTest() { - _isUnderTest = true; - } - function isUnderTest() { - return _isUnderTest; - } - function experimentalFeaturesEnabled() { - return isUnderTest() || !!process.env.PLAYWRIGHT_EXPERIMENTAL_FEATURES; - } - function getFromENV(name) { - let value = process.env[name]; - value = value === void 0 ? process.env[`npm_config_${name.toLowerCase()}`] : value; - value = value === void 0 ? process.env[`npm_package_config_${name.toLowerCase()}`] : value; - return value; - } - function getAsBooleanFromENV(name) { - const value = getFromENV(name); - return !!value && value !== "false" && value !== "0"; - } - function headersObjectToArray(headers, separator, setCookieSeparator) { - if (!setCookieSeparator) - setCookieSeparator = separator; - const result = []; - for (const name in headers) { - const values = headers[name]; - if (values === void 0) - continue; - if (separator) { - const sep = name.toLowerCase() === "set-cookie" ? setCookieSeparator : separator; - for (const value of values.split(sep)) - result.push({ - name, - value: value.trim() - }); - } else { - result.push({ - name, - value: values - }); - } - } - return result; - } - function headersArrayToObject(headers, lowerCase) { - const result = {}; - for (const { - name, - value - } of headers) - result[lowerCase ? name.toLowerCase() : name] = value; - return result; - } - function monotonicTime() { - const [seconds, nanoseconds] = process.hrtime(); - return seconds * 1e3 + (nanoseconds / 1e3 | 0) / 1e3; - } - function objectToArray(map) { - if (!map) - return void 0; - const result = []; - for (const [name, value] of Object.entries(map)) - result.push({ - name, - value: String(value) - }); - return result; - } - function arrayToObject(array) { - if (!array) - return void 0; - const result = {}; - for (const { - name, - value - } of array) - result[name] = value; - return result; - } - function calculateSha1(buffer) { - const hash = crypto.createHash("sha1"); - hash.update(buffer); - return hash.digest("hex"); - } - function createGuid() { - return crypto.randomBytes(16).toString("hex"); - } - function constructURLBasedOnBaseURL(baseURL, givenURL) { - try { - return new URL2.URL(givenURL, baseURL).toString(); - } catch (e) { - return givenURL; - } - } - function wrapInASCIIBox(text, padding = 0) { - const lines = text.split("\n"); - const maxLength = Math.max(...lines.map((line) => line.length)); - return ["\u2554" + "\u2550".repeat(maxLength + padding * 2) + "\u2557", ...lines.map((line) => "\u2551" + " ".repeat(padding) + line + " ".repeat(maxLength - line.length + padding) + "\u2551"), "\u255A" + "\u2550".repeat(maxLength + padding * 2) + "\u255D"].join("\n"); - } - function isFilePayload(value) { - return typeof value === "object" && value["name"] && value["mimeType"] && value["buffer"]; - } - function streamToString(stream) { - return new Promise((resolve, reject) => { - const chunks = []; - stream.on("data", (chunk) => chunks.push(Buffer.from(chunk))); - stream.on("error", reject); - stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf8"))); - }); - } - var isLikelyNpxGlobal = () => process.argv.length >= 2 && process.argv[1].includes("_npx"); - exports2.isLikelyNpxGlobal = isLikelyNpxGlobal; - function deepCopy(obj) { - return _v.default.deserialize(_v.default.serialize(obj)); - } - } -}); - // node_modules/playwright-core/lib/utils/fileUtils.js var require_fileUtils = __commonJS({ "node_modules/playwright-core/lib/utils/fileUtils.js"(exports2) { @@ -9311,7 +9407,9 @@ var require_hostPlatform = __commonJS({ return "generic-linux" + archSuffix; if (parseInt(ubuntuVersion, 10) <= 19) return "ubuntu18.04" + archSuffix; - return "ubuntu20.04" + archSuffix; + if (parseInt(ubuntuVersion, 10) <= 21) + return "ubuntu20.04" + archSuffix; + return "ubuntu22.04" + archSuffix; } if (platform === "win32") return "win64"; @@ -9552,11 +9650,11 @@ var require_nativeDeps = __commonJS({ "libxshmfence.so.1": "libxshmfence1" } }, - "ubuntu21.04": { - tools: ["xvfb", "fonts-noto-color-emoji", "ttf-unifont", "libfontconfig", "libfreetype6", "xfonts-cyrillic", "xfonts-scalable", "fonts-liberation", "fonts-ipafont-gothic", "fonts-wqy-zenhei", "fonts-tlwg-loma-otf", "ttf-ubuntu-font-family"], - chromium: ["libasound2", "libatk-bridge2.0-0", "libatk1.0-0", "libatspi2.0-0", "libcairo2", "libcups2", "libdbus-1-3", "libdrm2", "libgbm1", "libglib2.0-0", "libnspr4", "libnss3", "libpango-1.0-0", "libx11-6", "libxcb1", "libxcomposite1", "libxdamage1", "libxext6", "libxfixes3", "libxkbcommon0", "libxrandr2", "libxshmfence1"], - firefox: ["ffmpeg", "libatk1.0-0", "libcairo-gobject2", "libcairo2", "libdbus-1-3", "libdbus-glib-1-2", "libfontconfig1", "libfreetype6", "libgdk-pixbuf-2.0-0", "libglib2.0-0", "libgtk-3-0", "libgtk2.0-0", "libharfbuzz0b", "libpango-1.0-0", "libpangocairo-1.0-0", "libpangoft2-1.0-0", "libx11-6", "libx11-xcb1", "libxcb-shm0", "libxcb1", "libxcomposite1", "libxcursor1", "libxdamage1", "libxext6", "libxfixes3", "libxi6", "libxrender1", "libxt6"], - webkit: ["gstreamer1.0-libav", "gstreamer1.0-plugins-bad", "gstreamer1.0-plugins-base", "gstreamer1.0-plugins-good", "libatk-bridge2.0-0", "libatk1.0-0", "libcairo2", "libegl1", "libepoxy0", "libevdev2", "libfontconfig1", "libfreetype6", "libgdk-pixbuf-2.0-0", "libgl1", "libgles2", "libglib2.0-0", "libgstreamer-gl1.0-0", "libgstreamer-plugins-bad1.0-0", "libgstreamer-plugins-base1.0-0", "libgstreamer1.0-0", "libgtk-3-0", "libharfbuzz-icu0", "libharfbuzz0b", "libhyphen0", "libjavascriptcoregtk-4.0-18", "libjpeg-turbo8", "liblcms2-2", "libnotify4", "libopenjp2-7", "libopus0", "libpango-1.0-0", "libpng16-16", "libsecret-1-0", "libsoup2.4-1", "libvpx6", "libwayland-client0", "libwayland-egl1", "libwayland-server0", "libwebkit2gtk-4.0-37", "libwebp6", "libwebpdemux2", "libwoff1", "libwpe-1.0-1", "libwpebackend-fdo-1.0-1", "libwpewebkit-1.0-3", "libx11-6", "libxcomposite1", "libxdamage1", "libxkbcommon0", "libxml2", "libxslt1.1"], + "ubuntu22.04": { + tools: ["xvfb", "fonts-noto-color-emoji", "fonts-unifont", "libfontconfig1", "libfreetype6", "xfonts-cyrillic", "xfonts-scalable", "fonts-liberation", "fonts-ipafont-gothic", "fonts-wqy-zenhei", "fonts-tlwg-loma-otf", "fonts-freefont-ttf"], + chromium: ["libasound2", "libatk-bridge2.0-0", "libatk1.0-0", "libatspi2.0-0", "libcairo2", "libcups2", "libdbus-1-3", "libdrm2", "libgbm1", "libglib2.0-0", "libnspr4", "libnss3", "libpango-1.0-0", "libwayland-client0", "libx11-6", "libxcb1", "libxcomposite1", "libxdamage1", "libxext6", "libxfixes3", "libxkbcommon0", "libxrandr2"], + firefox: ["ffmpeg", "libasound2", "libatk1.0-0", "libcairo-gobject2", "libcairo2", "libdbus-1-3", "libdbus-glib-1-2", "libfontconfig1", "libfreetype6", "libgdk-pixbuf-2.0-0", "libglib2.0-0", "libgtk-3-0", "libpango-1.0-0", "libpangocairo-1.0-0", "libx11-6", "libx11-xcb1", "libxcb-shm0", "libxcb1", "libxcomposite1", "libxcursor1", "libxdamage1", "libxext6", "libxfixes3", "libxi6", "libxrandr2", "libxrender1", "libxtst6"], + webkit: ["libenchant-2-2", "gstreamer1.0-libav", "gstreamer1.0-plugins-bad", "gstreamer1.0-plugins-base", "gstreamer1.0-plugins-good", "libicu70", "libatk-bridge2.0-0", "libatk1.0-0", "libcairo2", "libdbus-1-3", "libdrm2", "libegl1", "libepoxy0", "libevdev2", "libffi7", "libfontconfig1", "libfreetype6", "libgbm1", "libgdk-pixbuf-2.0-0", "libgles2", "libglib2.0-0", "libglx0", "libgstreamer-gl1.0-0", "libgstreamer-plugins-base1.0-0", "libgstreamer1.0-0", "libgtk-3-0", "libgudev-1.0-0", "libharfbuzz-icu0", "libharfbuzz0b", "libhyphen0", "libjavascriptcoregtk-4.0-18", "libjpeg-turbo8", "liblcms2-2", "libmanette-0.2-0", "libnotify4", "libopengl0", "libopenjp2-7", "libopus0", "libpango-1.0-0", "libpng16-16", "libproxy1v5", "libsecret-1-0", "libsoup2.4-1", "libwayland-client0", "libwayland-egl1", "libwayland-server0", "libwebpdemux2", "libwoff1", "libx11-6", "libxcomposite1", "libxdamage1", "libxkbcommon0", "libxml2", "libxslt1.1", "libx264-163"], lib2package: { "libasound.so.2": "libasound2", "libatk-1.0.so.0": "libatk1.0-0", @@ -9570,61 +9668,57 @@ var require_nativeDeps = __commonJS({ "libdrm.so.2": "libdrm2", "libEGL.so.1": "libegl1", "libepoxy.so.0": "libepoxy0", + "libevdev.so.2": "libevdev2", + "libffi.so.7": "libffi7", "libfontconfig.so.1": "libfontconfig1", "libfreetype.so.6": "libfreetype6", "libgbm.so.1": "libgbm1", "libgdk_pixbuf-2.0.so.0": "libgdk-pixbuf-2.0-0", "libgdk-3.so.0": "libgtk-3-0", - "libgdk-x11-2.0.so.0": "libgtk2.0-0", "libgio-2.0.so.0": "libglib2.0-0", - "libGL.so.1": "libgl1", "libGLESv2.so.2": "libgles2", "libglib-2.0.so.0": "libglib2.0-0", + "libGLX.so.0": "libglx0", "libgmodule-2.0.so.0": "libglib2.0-0", "libgobject-2.0.so.0": "libglib2.0-0", + "libgstallocators-1.0.so.0": "libgstreamer-plugins-base1.0-0", "libgstapp-1.0.so.0": "libgstreamer-plugins-base1.0-0", "libgstaudio-1.0.so.0": "libgstreamer-plugins-base1.0-0", "libgstbase-1.0.so.0": "libgstreamer1.0-0", - "libgstcodecparsers-1.0.so.0": "libgstreamer-plugins-bad1.0-0", "libgstfft-1.0.so.0": "libgstreamer-plugins-base1.0-0", "libgstgl-1.0.so.0": "libgstreamer-gl1.0-0", "libgstpbutils-1.0.so.0": "libgstreamer-plugins-base1.0-0", "libgstreamer-1.0.so.0": "libgstreamer1.0-0", "libgsttag-1.0.so.0": "libgstreamer-plugins-base1.0-0", "libgstvideo-1.0.so.0": "libgstreamer-plugins-base1.0-0", - "libgthread-2.0.so.0": "libglib2.0-0", "libgtk-3.so.0": "libgtk-3-0", - "libgtk-x11-2.0.so.0": "libgtk2.0-0", + "libgudev-1.0.so.0": "libgudev-1.0-0", "libharfbuzz-icu.so.0": "libharfbuzz-icu0", "libharfbuzz.so.0": "libharfbuzz0b", "libhyphen.so.0": "libhyphen0", "libjavascriptcoregtk-4.0.so.18": "libjavascriptcoregtk-4.0-18", "libjpeg.so.8": "libjpeg-turbo8", "liblcms2.so.2": "liblcms2-2", + "libmanette-0.2.so.0": "libmanette-0.2-0", "libnotify.so.4": "libnotify4", "libnspr4.so": "libnspr4", "libnss3.so": "libnss3", "libnssutil3.so": "libnss3", + "libOpenGL.so.0": "libopengl0", "libopenjp2.so.7": "libopenjp2-7", "libopus.so.0": "libopus0", "libpango-1.0.so.0": "libpango-1.0-0", "libpangocairo-1.0.so.0": "libpangocairo-1.0-0", - "libpangoft2-1.0.so.0": "libpangoft2-1.0-0", "libpng16.so.16": "libpng16-16", + "libproxy.so.1": "libproxy1v5", "libsecret-1.so.0": "libsecret-1-0", "libsmime3.so": "libnss3", "libsoup-2.4.so.1": "libsoup2.4-1", - "libvpx.so.6": "libvpx6", "libwayland-client.so.0": "libwayland-client0", "libwayland-egl.so.1": "libwayland-egl1", "libwayland-server.so.0": "libwayland-server0", - "libwebkit2gtk-4.0.so.37": "libwebkit2gtk-4.0-37", - "libwebp.so.6": "libwebp6", "libwebpdemux.so.2": "libwebpdemux2", "libwoff2dec.so.1.0.2": "libwoff1", - "libwpe-1.0.so.1": "libwpe-1.0-1", - "libWPEBackend-fdo-1.0.so.1": "libwpebackend-fdo-1.0-1", - "libWPEWebKit-1.0.so.3": "libwpewebkit-1.0-3", "libX11-xcb.so.1": "libx11-xcb1", "libX11.so.6": "libx11-6", "libxcb-shm.so.0": "libxcb-shm0", @@ -9639,9 +9733,15 @@ var require_nativeDeps = __commonJS({ "libxml2.so.2": "libxml2", "libXrandr.so.2": "libxrandr2", "libXrender.so.1": "libxrender1", - "libxshmfence.so.1": "libxshmfence1", "libxslt.so.1": "libxslt1.1", - "libXt.so.6": "libxt6" + "libXtst.so.6": "libxtst6", + "libicui18n.so.60": "libicu70", + "libicuuc.so.66": "libicu70", + "libicui18n.so.66": "libicu70", + "libwebp.so.6": "libwebp6", + "libenchant-2.so.2": "libenchant-2-2", + "libx264.so": "libx264-163", + "libvpx.so.7": "libvpx7" } } }; @@ -9655,6 +9755,15 @@ var require_nativeDeps = __commonJS({ "libevent-2.1.so.7": "libevent-2.1.so.7" }) }; + deps["ubuntu22.04-arm64"] = { + tools: [...deps["ubuntu22.04"].tools], + chromium: [...deps["ubuntu22.04"].chromium], + firefox: [...deps["ubuntu22.04"].firefox], + webkit: [...deps["ubuntu22.04"].webkit, "libevent-2.1-7"], + lib2package: __spreadProps(__spreadValues({}, deps["ubuntu22.04"].lib2package), { + "libevent-2.1.so.7": "libevent-2.1.so.7" + }) + }; } }); @@ -9885,9 +9994,9 @@ ${details.join("\n")}`; if (dockerInfo && !dockerInfo.driverVersion.startsWith((0, _userAgent.getPlaywrightVersion)(true) + ".")) { const pwVersion = (0, _userAgent.getPlaywrightVersion)(); const requiredDockerImage = dockerInfo.dockerImageName.replace(dockerInfo.driverVersion, pwVersion); - errorLines.push(...[`This is most likely due to docker image version not matching Playwright version:`, `- Playwright: ${pwVersion}`, `- Docker: ${dockerInfo.driverVersion}`, ``, `Either:`, `- (recommended) use docker image "${requiredDockerImage}"`, `- (alternative 1) run the following command inside docker to install missing dependencies:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, "install-deps")}`, ``, `- (alternative 2) use Aptitude inside docker:`, ``, ` ${maybeSudo}apt-get install ${[...missingPackages].join("\\\n ")}`, ``, `<3 Playwright Team`]); + errorLines.push(...[`This is most likely due to docker image version not matching Playwright version:`, `- Playwright: ${pwVersion}`, `- Docker: ${dockerInfo.driverVersion}`, ``, `Either:`, `- (recommended) use docker image "${requiredDockerImage}"`, `- (alternative 1) run the following command inside docker to install missing dependencies:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, "install-deps")}`, ``, `- (alternative 2) use apt inside docker:`, ``, ` ${maybeSudo}apt-get install ${[...missingPackages].join("\\\n ")}`, ``, `<3 Playwright Team`]); } else if (missingPackages.size && !missingDeps.size) { - errorLines.push(...[`Please install them with the following command:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, "install-deps")}`, ``, `Alternatively, use Aptitude:`, ` ${maybeSudo}apt-get install ${[...missingPackages].join("\\\n ")}`, ``, `<3 Playwright Team`]); + errorLines.push(...[`Please install them with the following command:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, "install-deps")}`, ``, `Alternatively, use apt:`, ` ${maybeSudo}apt-get install ${[...missingPackages].join("\\\n ")}`, ``, `<3 Playwright Team`]); } else { errorLines.push(...[`Missing libraries:`, ...[...allMissingDeps].map((dep) => " " + dep)]); } @@ -10154,7 +10263,7 @@ var require_download = __commonJS({ } } function download(_0, _1) { - return __async(this, arguments, function* (url, destination, options = {}) { + return __async(this, arguments, function* (urls, destination, options = {}) { const { progressBarName = "file", retryCount = 3, @@ -10164,6 +10273,9 @@ var require_download = __commonJS({ } = options; for (let attempt = 1; attempt <= retryCount; ++attempt) { log(`downloading ${progressBarName} - attempt #${attempt}`); + if (!Array.isArray(urls)) + urls = [urls]; + const url = urls[(attempt - 1) % urls.length]; const { error } = yield downloadFile(url, destination, { @@ -10177,13 +10289,8 @@ var require_download = __commonJS({ } const errorMessage = (error === null || error === void 0 ? void 0 : error.message) || ""; log(`attempt #${attempt} - ERROR: ${errorMessage}`); - if (attempt < retryCount && (errorMessage.includes("ECONNRESET") || errorMessage.includes("ETIMEDOUT"))) { - const millis = Math.random() * 200 + 250 * Math.pow(1.5, attempt); - log(`sleeping ${millis}ms before retry...`); - yield new Promise((c) => setTimeout(c, millis)); - } else { + if (attempt >= retryCount) throw error; - } } }); } @@ -10701,7 +10808,7 @@ var require_zipBundleImpl = __commonJS({ r.context.pend.go(function(n) { if (r.destroyed) return n(); - var i = new Buffer(t); + var i = Buffer.alloc(t); ne.read(r.context.fd, i, 0, t, r.pos, function(o, s) { o ? r.destroy(o) : s === 0 ? (r.destroyed = true, r.push(null), r.context.unref()) : (r.pos += s, r.push(i.slice(0, s))), n(); }); @@ -11838,16 +11945,15 @@ var require_browserFetcher = __commonJS({ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function downloadBrowserWithProgressBar(title, browserDirectory, executablePath, downloadURL, downloadFileName) { + function downloadBrowserWithProgressBar(title, browserDirectory, executablePath, downloadURLs, downloadFileName) { return __async(this, null, function* () { if (yield (0, _fileUtils.existsAsync)(browserDirectory)) { _debugLogger.debugLogger.log("install", `${title} is already downloaded.`); return false; } - const url = downloadURL; const zipPath = _path.default.join(_os.default.tmpdir(), downloadFileName); try { - yield (0, _download.download)(url, zipPath, { + yield (0, _download.download)(downloadURLs, zipPath, { progressBarName: title, log: _debugLogger.debugLogger.log.bind(_debugLogger.debugLogger, "install"), userAgent: (0, _userAgent.getUserAgent)() @@ -11889,37 +11995,37 @@ var require_browsers = __commonJS({ browsers: [ { name: "chromium", - revision: "1005", + revision: "1012", installByDefault: true, - browserVersion: "102.0.5005.40" + browserVersion: "104.0.5112.20" }, { name: "chromium-with-symbols", - revision: "1005", + revision: "1012", installByDefault: false, - browserVersion: "102.0.5005.40" + browserVersion: "104.0.5112.20" }, { name: "chromium-tip-of-tree", - revision: "1005", + revision: "1016", installByDefault: false, - browserVersion: "103.0.5054.0" + browserVersion: "105.0.5123.0" }, { name: "firefox", - revision: "1323", + revision: "1327", installByDefault: true, - browserVersion: "99.0.1" + browserVersion: "100.0.2" }, { name: "firefox-beta", - revision: "1323", + revision: "1329", installByDefault: false, - browserVersion: "100.0b8" + browserVersion: "101.0b8" }, { name: "webkit", - revision: "1641", + revision: "1668", installByDefault: true, revisionOverrides: { "mac10.14": "1446", @@ -12013,6 +12119,14 @@ var require_registry = __commonJS({ } var PACKAGE_PATH = _path.default.join(__dirname, "..", "..", ".."); var BIN_PATH = _path.default.join(__dirname, "..", "..", "..", "bin"); + var PLAYWRIGHT_CDN_MIRRORS = ["https://playwright.azureedge.net", "https://playwright-akamai.azureedge.net", "https://playwright-verizon.azureedge.net"]; + if (process.env.PW_TEST_CDN_THAT_SHOULD_WORK) { + for (let i = 0; i < PLAYWRIGHT_CDN_MIRRORS.length; i++) { + const cdn = PLAYWRIGHT_CDN_MIRRORS[i]; + if (cdn !== process.env.PW_TEST_CDN_THAT_SHOULD_WORK) + PLAYWRIGHT_CDN_MIRRORS[i] = cdn + ".does-not-resolve.playwright.dev"; + } + } var EXECUTABLE_PATHS = { "chromium": { "linux": ["chrome-linux", "chrome"], @@ -12042,8 +12156,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": "builds/chromium/%s/chromium-linux-arm64.zip", "ubuntu18.04": "builds/chromium/%s/chromium-linux.zip", "ubuntu20.04": "builds/chromium/%s/chromium-linux.zip", + "ubuntu22.04": "builds/chromium/%s/chromium-linux.zip", "ubuntu18.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip", "ubuntu20.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip", + "ubuntu22.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip", "mac10.13": "builds/chromium/%s/chromium-mac.zip", "mac10.14": "builds/chromium/%s/chromium-mac.zip", "mac10.15": "builds/chromium/%s/chromium-mac.zip", @@ -12059,8 +12175,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip", "ubuntu18.04": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip", "ubuntu20.04": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip", + "ubuntu22.04": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip", "ubuntu18.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip", "ubuntu20.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip", + "ubuntu22.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip", "mac10.13": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip", "mac10.14": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip", "mac10.15": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip", @@ -12076,8 +12194,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": "builds/chromium/%s/chromium-with-symbols-linux-arm64.zip", "ubuntu18.04": "builds/chromium/%s/chromium-with-symbols-linux.zip", "ubuntu20.04": "builds/chromium/%s/chromium-with-symbols-linux.zip", + "ubuntu22.04": "builds/chromium/%s/chromium-with-symbols-linux.zip", "ubuntu18.04-arm64": "builds/chromium/%s/chromium-with-symbols-linux-arm64.zip", "ubuntu20.04-arm64": "builds/chromium/%s/chromium-with-symbols-linux-arm64.zip", + "ubuntu22.04-arm64": "builds/chromium/%s/chromium-with-symbols-linux-arm64.zip", "mac10.13": "builds/chromium/%s/chromium-with-symbols-mac.zip", "mac10.14": "builds/chromium/%s/chromium-with-symbols-mac.zip", "mac10.15": "builds/chromium/%s/chromium-with-symbols-mac.zip", @@ -12093,8 +12213,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": "builds/firefox/%s/firefox-ubuntu-20.04-arm64.zip", "ubuntu18.04": "builds/firefox/%s/firefox-ubuntu-18.04.zip", "ubuntu20.04": "builds/firefox/%s/firefox-ubuntu-20.04.zip", + "ubuntu22.04": "builds/firefox/%s/firefox-ubuntu-22.04.zip", "ubuntu18.04-arm64": void 0, "ubuntu20.04-arm64": "builds/firefox/%s/firefox-ubuntu-20.04-arm64.zip", + "ubuntu22.04-arm64": "builds/firefox/%s/firefox-ubuntu-22.04-arm64.zip", "mac10.13": "builds/firefox/%s/firefox-mac-11.zip", "mac10.14": "builds/firefox/%s/firefox-mac-11.zip", "mac10.15": "builds/firefox/%s/firefox-mac-11.zip", @@ -12110,8 +12232,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": void 0, "ubuntu18.04": "builds/firefox-beta/%s/firefox-beta-ubuntu-18.04.zip", "ubuntu20.04": "builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip", + "ubuntu22.04": "builds/firefox-beta/%s/firefox-beta-ubuntu-22.04.zip", "ubuntu18.04-arm64": void 0, "ubuntu20.04-arm64": void 0, + "ubuntu22.04-arm64": "builds/firefox-beta/%s/firefox-beta-ubuntu-22.04-arm64.zip", "mac10.13": "builds/firefox-beta/%s/firefox-beta-mac-11.zip", "mac10.14": "builds/firefox-beta/%s/firefox-beta-mac-11.zip", "mac10.15": "builds/firefox-beta/%s/firefox-beta-mac-11.zip", @@ -12127,8 +12251,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": "builds/webkit/%s/webkit-ubuntu-20.04-arm64.zip", "ubuntu18.04": "builds/webkit/%s/webkit-ubuntu-18.04.zip", "ubuntu20.04": "builds/webkit/%s/webkit-ubuntu-20.04.zip", + "ubuntu22.04": "builds/webkit/%s/webkit-ubuntu-22.04.zip", "ubuntu18.04-arm64": void 0, "ubuntu20.04-arm64": "builds/webkit/%s/webkit-ubuntu-20.04-arm64.zip", + "ubuntu22.04-arm64": "builds/webkit/%s/webkit-ubuntu-22.04-arm64.zip", "mac10.13": void 0, "mac10.14": "builds/deprecated-webkit-mac-10.14/%s/deprecated-webkit-mac-10.14.zip", "mac10.15": "builds/webkit/%s/webkit-mac-10.15.zip", @@ -12144,8 +12270,10 @@ var require_registry = __commonJS({ "generic-linux-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip", "ubuntu18.04": "builds/ffmpeg/%s/ffmpeg-linux.zip", "ubuntu20.04": "builds/ffmpeg/%s/ffmpeg-linux.zip", + "ubuntu22.04": "builds/ffmpeg/%s/ffmpeg-linux.zip", "ubuntu18.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip", "ubuntu20.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip", + "ubuntu22.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip", "mac10.13": "builds/ffmpeg/%s/ffmpeg-mac.zip", "mac10.14": "builds/ffmpeg/%s/ffmpeg-mac.zip", "mac10.15": "builds/ffmpeg/%s/ffmpeg-mac.zip", @@ -12537,15 +12665,17 @@ Run "${buildPlaywrightCLICommand(sdkLanguage, "install " + name)}"` : ""; throw new Error(`ERROR: Playwright does not support ${descriptor.name} on ${_hostPlatform.hostPlatform}`); if (_hostPlatform.hostPlatform === "generic-linux" || _hostPlatform.hostPlatform === "generic-linux-arm64") (0, _browserFetcher.logPolitely)("BEWARE: your OS is not officially supported by Playwright; downloading Ubuntu build as a fallback."); - const downloadHost = downloadHostEnv && (0, _utils.getFromENV)(downloadHostEnv) || (0, _utils.getFromENV)("PLAYWRIGHT_DOWNLOAD_HOST") || "https://playwright.azureedge.net"; const downloadPath = util.format(downloadPathTemplate, descriptor.revision); - const downloadURL = `${downloadHost}/${downloadPath}`; + let downloadURLs = PLAYWRIGHT_CDN_MIRRORS.map((mirror) => `${mirror}/${downloadPath}`); + const customHostOverride = downloadHostEnv && (0, _utils.getFromENV)(downloadHostEnv) || (0, _utils.getFromENV)("PLAYWRIGHT_DOWNLOAD_HOST"); + if (customHostOverride) + downloadURLs = [`${customHostOverride}/${downloadPath}`]; const displayName = descriptor.name.split("-").map((word) => { return word === "ffmpeg" ? "FFMPEG" : word.charAt(0).toUpperCase() + word.slice(1); }).join(" "); const title = descriptor.browserVersion ? `${displayName} ${descriptor.browserVersion} (playwright build v${descriptor.revision})` : `${displayName} playwright build v${descriptor.revision}`; const downloadFileName = `playwright-download-${descriptor.name}-${_hostPlatform.hostPlatform}-${descriptor.revision}.zip`; - yield (0, _browserFetcher.downloadBrowserWithProgressBar)(title, descriptor.dir, executablePath, downloadURL, downloadFileName).catch((e) => { + yield (0, _browserFetcher.downloadBrowserWithProgressBar)(title, descriptor.dir, executablePath, downloadURLs, downloadFileName).catch((e) => { throw new Error(`Failed to download ${title}, caused by ${e.stack}`); }); @@ -13145,6 +13275,7 @@ var require_validator = __commonJS({ regexSource: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), regexFlags: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), matchSubstring: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), + ignoreCase: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), normalizeWhiteSpace: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean) }); scheme.AXNode = (0, _validatorPrimitives.tObject)({ @@ -13213,6 +13344,14 @@ var require_validator = __commonJS({ })), value: (0, _validatorPrimitives.tOptional)(tType("SerializedValue")) }); + scheme.RecordHarOptions = (0, _validatorPrimitives.tObject)({ + path: _validatorPrimitives.tString, + content: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tEnum)(["embed", "attach", "omit"])), + mode: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tEnum)(["full", "minimal"])), + urlGlob: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), + urlRegexSource: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), + urlRegexFlags: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString) + }); scheme.FormField = (0, _validatorPrimitives.tObject)({ name: _validatorPrimitives.tString, value: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), @@ -13258,6 +13397,20 @@ var require_validator = __commonJS({ zipFile: _validatorPrimitives.tString, entries: (0, _validatorPrimitives.tArray)(tType("NameValue")) }); + scheme.LocalUtilsHarOpenParams = (0, _validatorPrimitives.tObject)({ + file: _validatorPrimitives.tString + }); + scheme.LocalUtilsHarLookupParams = (0, _validatorPrimitives.tObject)({ + harId: _validatorPrimitives.tString, + url: _validatorPrimitives.tString, + method: _validatorPrimitives.tString, + headers: (0, _validatorPrimitives.tArray)(tType("NameValue")), + postData: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), + isNavigationRequest: _validatorPrimitives.tBoolean + }); + scheme.LocalUtilsHarCloseParams = (0, _validatorPrimitives.tObject)({ + harId: _validatorPrimitives.tString + }); scheme.RootInitializeParams = (0, _validatorPrimitives.tObject)({ sdkLanguage: _validatorPrimitives.tString }); @@ -13405,11 +13558,9 @@ var require_validator = __commonJS({ height: _validatorPrimitives.tNumber })) })), - recordHar: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ - omitContent: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), - path: _validatorPrimitives.tString - })), + recordHar: (0, _validatorPrimitives.tOptional)(tType("RecordHarOptions")), strictSelectors: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), + serviceWorkers: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tEnum)(["allow", "block"])), userDataDir: _validatorPrimitives.tString, slowMo: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tNumber) }); @@ -13464,11 +13615,9 @@ var require_validator = __commonJS({ height: _validatorPrimitives.tNumber })) })), - recordHar: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ - omitContent: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), - path: _validatorPrimitives.tString - })), + recordHar: (0, _validatorPrimitives.tOptional)(tType("RecordHarOptions")), strictSelectors: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), + serviceWorkers: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tEnum)(["allow", "block"])), proxy: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ server: _validatorPrimitives.tString, bypass: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), @@ -14224,6 +14373,9 @@ var require_validator = __commonJS({ }); scheme.RequestResponseParams = (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({})); scheme.RequestRawRequestHeadersParams = (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({})); + scheme.RouteRedirectNavigationRequestParams = (0, _validatorPrimitives.tObject)({ + url: _validatorPrimitives.tString + }); scheme.RouteAbortParams = (0, _validatorPrimitives.tObject)({ errorCode: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString) }); @@ -14339,10 +14491,7 @@ var require_validator = __commonJS({ ignoreHTTPSErrors: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), locale: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), offline: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), - recordHar: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ - omitContent: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), - path: _validatorPrimitives.tString - })), + recordHar: (0, _validatorPrimitives.tOptional)(tType("RecordHarOptions")), recordVideo: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ dir: _validatorPrimitives.tString, size: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ @@ -14501,11 +14650,9 @@ var require_validator = __commonJS({ height: _validatorPrimitives.tNumber })) })), - recordHar: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ - omitContent: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), - path: _validatorPrimitives.tString - })), + recordHar: (0, _validatorPrimitives.tOptional)(tType("RecordHarOptions")), strictSelectors: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tBoolean), + serviceWorkers: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tEnum)(["allow", "block"])), pkg: (0, _validatorPrimitives.tOptional)(_validatorPrimitives.tString), proxy: (0, _validatorPrimitives.tOptional)((0, _validatorPrimitives.tObject)({ server: _validatorPrimitives.tString, @@ -14851,7 +14998,7 @@ var require_dispatcher = __commonJS({ _dispatchEvent(method, params) { if (this._disposed) { if ((0, _utils.isUnderTest)()) - throw new Error(`${this._guid} is sending "${method}" event after being disposed`); + throw new Error(`${this._guid} is sending "${String(method)}" event after being disposed`); return; } const sdkObject = this._object instanceof _instrumentation.SdkObject ? this._object : void 0; @@ -15562,6 +15709,13 @@ var require_network = __commonJS({ yield this._delegate.abort(errorCode); }); } + redirectNavigationRequest(url) { + return __async(this, null, function* () { + this._startHandling(); + (0, _utils.assert)(this._request.isNavigationRequest()); + this._request.frame().redirectNavigation(url, this._request._documentId, this._request.headerValue("referer")); + }); + } fulfill(overrides) { return __async(this, null, function* () { this._startHandling(); @@ -15635,7 +15789,7 @@ var require_network = __commonJS({ }; exports2.Route = Route; var Response = class extends _instrumentation.SdkObject { - constructor(request, status, statusText, headers, timing, getResponseBodyCallback, httpVersion) { + constructor(request, status, statusText, headers, timing, getResponseBodyCallback, fromServiceWorker, httpVersion) { super(request.frame(), "response"); this._request = void 0; this._contentPromise = null; @@ -15651,6 +15805,7 @@ var require_network = __commonJS({ this._securityDetailsPromise = new _manualPromise.ManualPromise(); this._rawResponseHeadersPromise = void 0; this._httpVersion = void 0; + this._fromServiceWorker = void 0; this._request = request; this._timing = timing; this._status = status; @@ -15665,6 +15820,7 @@ var require_network = __commonJS({ this._getResponseBodyCallback = getResponseBodyCallback; this._request._setResponse(this); this._httpVersion = httpVersion; + this._fromServiceWorker = fromServiceWorker; } _serverAddrFinished(addr) { this._serverAddrPromise.resolve(addr); @@ -15746,6 +15902,9 @@ var require_network = __commonJS({ return "HTTP/2.0"; return this._httpVersion; } + fromServiceWorker() { + return this._fromServiceWorker; + } _responseHeadersSize() { return __async(this, null, function* () { if (this._request.responseSize.responseHeadersSize) @@ -15938,7 +16097,7 @@ var require_injectedScriptSource = __commonJS({ value: true }); exports2.source = void 0; - var source = 'var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// packages/playwright-core/src/server/isomorphic/cssTokenizer.js\nvar require_cssTokenizer = __commonJS({\n "packages/playwright-core/src/server/isomorphic/cssTokenizer.js"(exports) {\n (function(root, factory) {\n if (typeof define === "function" && define.amd) {\n define(["exports"], factory);\n } else if (typeof exports !== "undefined") {\n factory(exports);\n } else {\n factory(root);\n }\n })(exports, function(exports2) {\n var between = function(num, first, last) {\n return num >= first && num <= last;\n };\n function digit(code) {\n return between(code, 48, 57);\n }\n function hexdigit(code) {\n return digit(code) || between(code, 65, 70) || between(code, 97, 102);\n }\n function uppercaseletter(code) {\n return between(code, 65, 90);\n }\n function lowercaseletter(code) {\n return between(code, 97, 122);\n }\n function letter(code) {\n return uppercaseletter(code) || lowercaseletter(code);\n }\n function nonascii(code) {\n return code >= 128;\n }\n function namestartchar(code) {\n return letter(code) || nonascii(code) || code == 95;\n }\n function namechar(code) {\n return namestartchar(code) || digit(code) || code == 45;\n }\n function nonprintable(code) {\n return between(code, 0, 8) || code == 11 || between(code, 14, 31) || code == 127;\n }\n function newline(code) {\n return code == 10;\n }\n function whitespace(code) {\n return newline(code) || code == 9 || code == 32;\n }\n function badescape(code) {\n return newline(code) || isNaN(code);\n }\n var maximumallowedcodepoint = 1114111;\n var InvalidCharacterError = function(message) {\n this.message = message;\n };\n InvalidCharacterError.prototype = new Error();\n InvalidCharacterError.prototype.name = "InvalidCharacterError";\n function preprocess(str) {\n var codepoints = [];\n for (var i = 0; i < str.length; i++) {\n var code = str.charCodeAt(i);\n if (code == 13 && str.charCodeAt(i + 1) == 10) {\n code = 10;\n i++;\n }\n if (code == 13 || code == 12)\n code = 10;\n if (code == 0)\n code = 65533;\n if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {\n var lead = code - 55296;\n var trail = str.charCodeAt(i + 1) - 56320;\n code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;\n i++;\n }\n codepoints.push(code);\n }\n return codepoints;\n }\n function stringFromCode(code) {\n if (code <= 65535)\n return String.fromCharCode(code);\n code -= Math.pow(2, 16);\n var lead = Math.floor(code / Math.pow(2, 10)) + 55296;\n var trail = code % Math.pow(2, 10) + 56320;\n return String.fromCharCode(lead) + String.fromCharCode(trail);\n }\n function tokenize2(str) {\n str = preprocess(str);\n var i = -1;\n var tokens = [];\n var code;\n var line = 0;\n var column = 0;\n var lastLineLength = 0;\n var incrLineno = function() {\n line += 1;\n lastLineLength = column;\n column = 0;\n };\n var locStart = { line, column };\n var codepoint = function(i2) {\n if (i2 >= str.length) {\n return -1;\n }\n return str[i2];\n };\n var next = function(num) {\n if (num === void 0)\n num = 1;\n if (num > 3)\n throw "Spec Error: no more than three codepoints of lookahead.";\n return codepoint(i + num);\n };\n var consume = function(num) {\n if (num === void 0)\n num = 1;\n i += num;\n code = codepoint(i);\n if (newline(code))\n incrLineno();\n else\n column += num;\n return true;\n };\n var reconsume = function() {\n i -= 1;\n if (newline(code)) {\n line -= 1;\n column = lastLineLength;\n } else {\n column -= 1;\n }\n locStart.line = line;\n locStart.column = column;\n return true;\n };\n var eof = function(codepoint2) {\n if (codepoint2 === void 0)\n codepoint2 = code;\n return codepoint2 == -1;\n };\n var donothing = function() {\n };\n var parseerror = function() {\n console.log("Parse error at index " + i + ", processing codepoint 0x" + code.toString(16) + ".");\n return true;\n };\n var consumeAToken = function() {\n consumeComments();\n consume();\n if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n return new WhitespaceToken2();\n } else if (code == 34)\n return consumeAStringToken();\n else if (code == 35) {\n if (namechar(next()) || areAValidEscape(next(1), next(2))) {\n var token = new HashToken2();\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n token.type = "id";\n token.value = consumeAName();\n return token;\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 36) {\n if (next() == 61) {\n consume();\n return new SuffixMatchToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 39)\n return consumeAStringToken();\n else if (code == 40)\n return new OpenParenToken();\n else if (code == 41)\n return new CloseParenToken2();\n else if (code == 42) {\n if (next() == 61) {\n consume();\n return new SubstringMatchToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 43) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 44)\n return new CommaToken2();\n else if (code == 45) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else if (next(1) == 45 && next(2) == 62) {\n consume(2);\n return new CDCToken2();\n } else if (startsWithAnIdentifier()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 46) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 58)\n return new ColonToken2();\n else if (code == 59)\n return new SemicolonToken2();\n else if (code == 60) {\n if (next(1) == 33 && next(2) == 45 && next(3) == 45) {\n consume(3);\n return new CDOToken2();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 64) {\n if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n return new AtKeywordToken2(consumeAName());\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 91)\n return new OpenSquareToken2();\n else if (code == 92) {\n if (startsWithAValidEscape()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n parseerror();\n return new DelimToken2(code);\n }\n } else if (code == 93)\n return new CloseSquareToken2();\n else if (code == 94) {\n if (next() == 61) {\n consume();\n return new PrefixMatchToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 123)\n return new OpenCurlyToken2();\n else if (code == 124) {\n if (next() == 61) {\n consume();\n return new DashMatchToken();\n } else if (next() == 124) {\n consume();\n return new ColumnToken2();\n } else {\n return new DelimToken2(code);\n }\n } else if (code == 125)\n return new CloseCurlyToken2();\n else if (code == 126) {\n if (next() == 61) {\n consume();\n return new IncludeMatchToken();\n } else {\n return new DelimToken2(code);\n }\n } else if (digit(code)) {\n reconsume();\n return consumeANumericToken();\n } else if (namestartchar(code)) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else if (eof())\n return new EOFToken2();\n else\n return new DelimToken2(code);\n };\n var consumeComments = function() {\n while (next(1) == 47 && next(2) == 42) {\n consume(2);\n while (true) {\n consume();\n if (code == 42 && next() == 47) {\n consume();\n break;\n } else if (eof()) {\n parseerror();\n return;\n }\n }\n }\n };\n var consumeANumericToken = function() {\n var num = consumeANumber();\n if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n var token = new DimensionToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n token.unit = consumeAName();\n return token;\n } else if (next() == 37) {\n consume();\n var token = new PercentageToken2();\n token.value = num.value;\n token.repr = num.repr;\n return token;\n } else {\n var token = new NumberToken2();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n return token;\n }\n };\n var consumeAnIdentlikeToken = function() {\n var str2 = consumeAName();\n if (str2.toLowerCase() == "url" && next() == 40) {\n consume();\n while (whitespace(next(1)) && whitespace(next(2)))\n consume();\n if (next() == 34 || next() == 39) {\n return new FunctionToken2(str2);\n } else if (whitespace(next()) && (next(2) == 34 || next(2) == 39)) {\n return new FunctionToken2(str2);\n } else {\n return consumeAURLToken();\n }\n } else if (next() == 40) {\n consume();\n return new FunctionToken2(str2);\n } else {\n return new IdentToken2(str2);\n }\n };\n var consumeAStringToken = function(endingCodePoint) {\n if (endingCodePoint === void 0)\n endingCodePoint = code;\n var string = "";\n while (consume()) {\n if (code == endingCodePoint || eof()) {\n return new StringToken2(string);\n } else if (newline(code)) {\n parseerror();\n reconsume();\n return new BadStringToken2();\n } else if (code == 92) {\n if (eof(next())) {\n donothing();\n } else if (newline(next())) {\n consume();\n } else {\n string += stringFromCode(consumeEscape());\n }\n } else {\n string += stringFromCode(code);\n }\n }\n };\n var consumeAURLToken = function() {\n var token = new URLToken2("");\n while (whitespace(next()))\n consume();\n if (eof(next()))\n return token;\n while (consume()) {\n if (code == 41 || eof()) {\n return token;\n } else if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n if (next() == 41 || eof(next())) {\n consume();\n return token;\n } else {\n consumeTheRemnantsOfABadURL();\n return new BadURLToken2();\n }\n } else if (code == 34 || code == 39 || code == 40 || nonprintable(code)) {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken2();\n } else if (code == 92) {\n if (startsWithAValidEscape()) {\n token.value += stringFromCode(consumeEscape());\n } else {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken2();\n }\n } else {\n token.value += stringFromCode(code);\n }\n }\n };\n var consumeEscape = function() {\n consume();\n if (hexdigit(code)) {\n var digits = [code];\n for (var total = 0; total < 5; total++) {\n if (hexdigit(next())) {\n consume();\n digits.push(code);\n } else {\n break;\n }\n }\n if (whitespace(next()))\n consume();\n var value = parseInt(digits.map(function(x) {\n return String.fromCharCode(x);\n }).join(""), 16);\n if (value > maximumallowedcodepoint)\n value = 65533;\n return value;\n } else if (eof()) {\n return 65533;\n } else {\n return code;\n }\n };\n var areAValidEscape = function(c1, c2) {\n if (c1 != 92)\n return false;\n if (newline(c2))\n return false;\n return true;\n };\n var startsWithAValidEscape = function() {\n return areAValidEscape(code, next());\n };\n var wouldStartAnIdentifier = function(c1, c2, c3) {\n if (c1 == 45) {\n return namestartchar(c2) || c2 == 45 || areAValidEscape(c2, c3);\n } else if (namestartchar(c1)) {\n return true;\n } else if (c1 == 92) {\n return areAValidEscape(c1, c2);\n } else {\n return false;\n }\n };\n var startsWithAnIdentifier = function() {\n return wouldStartAnIdentifier(code, next(1), next(2));\n };\n var wouldStartANumber = function(c1, c2, c3) {\n if (c1 == 43 || c1 == 45) {\n if (digit(c2))\n return true;\n if (c2 == 46 && digit(c3))\n return true;\n return false;\n } else if (c1 == 46) {\n if (digit(c2))\n return true;\n return false;\n } else if (digit(c1)) {\n return true;\n } else {\n return false;\n }\n };\n var startsWithANumber = function() {\n return wouldStartANumber(code, next(1), next(2));\n };\n var consumeAName = function() {\n var result = "";\n while (consume()) {\n if (namechar(code)) {\n result += stringFromCode(code);\n } else if (startsWithAValidEscape()) {\n result += stringFromCode(consumeEscape());\n } else {\n reconsume();\n return result;\n }\n }\n };\n var consumeANumber = function() {\n var repr = [];\n var type = "integer";\n if (next() == 43 || next() == 45) {\n consume();\n repr += stringFromCode(code);\n }\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n if (next(1) == 46 && digit(next(2))) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = "number";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n var c1 = next(1), c2 = next(2), c3 = next(3);\n if ((c1 == 69 || c1 == 101) && digit(c2)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = "number";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n } else if ((c1 == 69 || c1 == 101) && (c2 == 43 || c2 == 45) && digit(c3)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = "number";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n var value = convertAStringToANumber(repr);\n return { type, value, repr };\n };\n var convertAStringToANumber = function(string) {\n return +string;\n };\n var consumeTheRemnantsOfABadURL = function() {\n while (consume()) {\n if (code == 41 || eof()) {\n return;\n } else if (startsWithAValidEscape()) {\n consumeEscape();\n donothing();\n } else {\n donothing();\n }\n }\n };\n var iterationCount = 0;\n while (!eof(next())) {\n tokens.push(consumeAToken());\n iterationCount++;\n if (iterationCount > str.length * 2)\n return "I\'m infinite-looping!";\n }\n return tokens;\n }\n function CSSParserToken() {\n throw "Abstract Base Class";\n }\n CSSParserToken.prototype.toJSON = function() {\n return { token: this.tokenType };\n };\n CSSParserToken.prototype.toString = function() {\n return this.tokenType;\n };\n CSSParserToken.prototype.toSource = function() {\n return "" + this;\n };\n function BadStringToken2() {\n return this;\n }\n BadStringToken2.prototype = Object.create(CSSParserToken.prototype);\n BadStringToken2.prototype.tokenType = "BADSTRING";\n function BadURLToken2() {\n return this;\n }\n BadURLToken2.prototype = Object.create(CSSParserToken.prototype);\n BadURLToken2.prototype.tokenType = "BADURL";\n function WhitespaceToken2() {\n return this;\n }\n WhitespaceToken2.prototype = Object.create(CSSParserToken.prototype);\n WhitespaceToken2.prototype.tokenType = "WHITESPACE";\n WhitespaceToken2.prototype.toString = function() {\n return "WS";\n };\n WhitespaceToken2.prototype.toSource = function() {\n return " ";\n };\n function CDOToken2() {\n return this;\n }\n CDOToken2.prototype = Object.create(CSSParserToken.prototype);\n CDOToken2.prototype.tokenType = "CDO";\n CDOToken2.prototype.toSource = function() {\n return "";\n };\n function ColonToken2() {\n return this;\n }\n ColonToken2.prototype = Object.create(CSSParserToken.prototype);\n ColonToken2.prototype.tokenType = ":";\n function SemicolonToken2() {\n return this;\n }\n SemicolonToken2.prototype = Object.create(CSSParserToken.prototype);\n SemicolonToken2.prototype.tokenType = ";";\n function CommaToken2() {\n return this;\n }\n CommaToken2.prototype = Object.create(CSSParserToken.prototype);\n CommaToken2.prototype.tokenType = ",";\n function GroupingToken() {\n throw "Abstract Base Class";\n }\n GroupingToken.prototype = Object.create(CSSParserToken.prototype);\n function OpenCurlyToken2() {\n this.value = "{";\n this.mirror = "}";\n return this;\n }\n OpenCurlyToken2.prototype = Object.create(GroupingToken.prototype);\n OpenCurlyToken2.prototype.tokenType = "{";\n function CloseCurlyToken2() {\n this.value = "}";\n this.mirror = "{";\n return this;\n }\n CloseCurlyToken2.prototype = Object.create(GroupingToken.prototype);\n CloseCurlyToken2.prototype.tokenType = "}";\n function OpenSquareToken2() {\n this.value = "[";\n this.mirror = "]";\n return this;\n }\n OpenSquareToken2.prototype = Object.create(GroupingToken.prototype);\n OpenSquareToken2.prototype.tokenType = "[";\n function CloseSquareToken2() {\n this.value = "]";\n this.mirror = "[";\n return this;\n }\n CloseSquareToken2.prototype = Object.create(GroupingToken.prototype);\n CloseSquareToken2.prototype.tokenType = "]";\n function OpenParenToken() {\n this.value = "(";\n this.mirror = ")";\n return this;\n }\n OpenParenToken.prototype = Object.create(GroupingToken.prototype);\n OpenParenToken.prototype.tokenType = "(";\n function CloseParenToken2() {\n this.value = ")";\n this.mirror = "(";\n return this;\n }\n CloseParenToken2.prototype = Object.create(GroupingToken.prototype);\n CloseParenToken2.prototype.tokenType = ")";\n function IncludeMatchToken() {\n return this;\n }\n IncludeMatchToken.prototype = Object.create(CSSParserToken.prototype);\n IncludeMatchToken.prototype.tokenType = "~=";\n function DashMatchToken() {\n return this;\n }\n DashMatchToken.prototype = Object.create(CSSParserToken.prototype);\n DashMatchToken.prototype.tokenType = "|=";\n function PrefixMatchToken() {\n return this;\n }\n PrefixMatchToken.prototype = Object.create(CSSParserToken.prototype);\n PrefixMatchToken.prototype.tokenType = "^=";\n function SuffixMatchToken() {\n return this;\n }\n SuffixMatchToken.prototype = Object.create(CSSParserToken.prototype);\n SuffixMatchToken.prototype.tokenType = "$=";\n function SubstringMatchToken() {\n return this;\n }\n SubstringMatchToken.prototype = Object.create(CSSParserToken.prototype);\n SubstringMatchToken.prototype.tokenType = "*=";\n function ColumnToken2() {\n return this;\n }\n ColumnToken2.prototype = Object.create(CSSParserToken.prototype);\n ColumnToken2.prototype.tokenType = "||";\n function EOFToken2() {\n return this;\n }\n EOFToken2.prototype = Object.create(CSSParserToken.prototype);\n EOFToken2.prototype.tokenType = "EOF";\n EOFToken2.prototype.toSource = function() {\n return "";\n };\n function DelimToken2(code) {\n this.value = stringFromCode(code);\n return this;\n }\n DelimToken2.prototype = Object.create(CSSParserToken.prototype);\n DelimToken2.prototype.tokenType = "DELIM";\n DelimToken2.prototype.toString = function() {\n return "DELIM(" + this.value + ")";\n };\n DelimToken2.prototype.toJSON = function() {\n var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n };\n DelimToken2.prototype.toSource = function() {\n if (this.value == "\\\\")\n return "\\\\\\n";\n else\n return this.value;\n };\n function StringValuedToken() {\n throw "Abstract Base Class";\n }\n StringValuedToken.prototype = Object.create(CSSParserToken.prototype);\n StringValuedToken.prototype.ASCIIMatch = function(str) {\n return this.value.toLowerCase() == str.toLowerCase();\n };\n StringValuedToken.prototype.toJSON = function() {\n var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n };\n function IdentToken2(val) {\n this.value = val;\n }\n IdentToken2.prototype = Object.create(StringValuedToken.prototype);\n IdentToken2.prototype.tokenType = "IDENT";\n IdentToken2.prototype.toString = function() {\n return "IDENT(" + this.value + ")";\n };\n IdentToken2.prototype.toSource = function() {\n return escapeIdent(this.value);\n };\n function FunctionToken2(val) {\n this.value = val;\n this.mirror = ")";\n }\n FunctionToken2.prototype = Object.create(StringValuedToken.prototype);\n FunctionToken2.prototype.tokenType = "FUNCTION";\n FunctionToken2.prototype.toString = function() {\n return "FUNCTION(" + this.value + ")";\n };\n FunctionToken2.prototype.toSource = function() {\n return escapeIdent(this.value) + "(";\n };\n function AtKeywordToken2(val) {\n this.value = val;\n }\n AtKeywordToken2.prototype = Object.create(StringValuedToken.prototype);\n AtKeywordToken2.prototype.tokenType = "AT-KEYWORD";\n AtKeywordToken2.prototype.toString = function() {\n return "AT(" + this.value + ")";\n };\n AtKeywordToken2.prototype.toSource = function() {\n return "@" + escapeIdent(this.value);\n };\n function HashToken2(val) {\n this.value = val;\n this.type = "unrestricted";\n }\n HashToken2.prototype = Object.create(StringValuedToken.prototype);\n HashToken2.prototype.tokenType = "HASH";\n HashToken2.prototype.toString = function() {\n return "HASH(" + this.value + ")";\n };\n HashToken2.prototype.toJSON = function() {\n var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n return json;\n };\n HashToken2.prototype.toSource = function() {\n if (this.type == "id") {\n return "#" + escapeIdent(this.value);\n } else {\n return "#" + escapeHash(this.value);\n }\n };\n function StringToken2(val) {\n this.value = val;\n }\n StringToken2.prototype = Object.create(StringValuedToken.prototype);\n StringToken2.prototype.tokenType = "STRING";\n StringToken2.prototype.toString = function() {\n return \'"\' + escapeString(this.value) + \'"\';\n };\n function URLToken2(val) {\n this.value = val;\n }\n URLToken2.prototype = Object.create(StringValuedToken.prototype);\n URLToken2.prototype.tokenType = "URL";\n URLToken2.prototype.toString = function() {\n return "URL(" + this.value + ")";\n };\n URLToken2.prototype.toSource = function() {\n return \'url("\' + escapeString(this.value) + \'")\';\n };\n function NumberToken2() {\n this.value = null;\n this.type = "integer";\n this.repr = "";\n }\n NumberToken2.prototype = Object.create(CSSParserToken.prototype);\n NumberToken2.prototype.tokenType = "NUMBER";\n NumberToken2.prototype.toString = function() {\n if (this.type == "integer")\n return "INT(" + this.value + ")";\n return "NUMBER(" + this.value + ")";\n };\n NumberToken2.prototype.toJSON = function() {\n var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n return json;\n };\n NumberToken2.prototype.toSource = function() {\n return this.repr;\n };\n function PercentageToken2() {\n this.value = null;\n this.repr = "";\n }\n PercentageToken2.prototype = Object.create(CSSParserToken.prototype);\n PercentageToken2.prototype.tokenType = "PERCENTAGE";\n PercentageToken2.prototype.toString = function() {\n return "PERCENTAGE(" + this.value + ")";\n };\n PercentageToken2.prototype.toJSON = function() {\n var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.repr = this.repr;\n return json;\n };\n PercentageToken2.prototype.toSource = function() {\n return this.repr + "%";\n };\n function DimensionToken() {\n this.value = null;\n this.type = "integer";\n this.repr = "";\n this.unit = "";\n }\n DimensionToken.prototype = Object.create(CSSParserToken.prototype);\n DimensionToken.prototype.tokenType = "DIMENSION";\n DimensionToken.prototype.toString = function() {\n return "DIM(" + this.value + "," + this.unit + ")";\n };\n DimensionToken.prototype.toJSON = function() {\n var json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n json.unit = this.unit;\n return json;\n };\n DimensionToken.prototype.toSource = function() {\n var source = this.repr;\n var unit = escapeIdent(this.unit);\n if (unit[0].toLowerCase() == "e" && (unit[1] == "-" || between(unit.charCodeAt(1), 48, 57))) {\n unit = "\\\\65 " + unit.slice(1, unit.length);\n }\n return source + unit;\n };\n function escapeIdent(string) {\n string = "" + string;\n var result = "";\n var firstcode = string.charCodeAt(0);\n for (var i = 0; i < string.length; i++) {\n var code = string.charCodeAt(i);\n if (code == 0) {\n throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n }\n if (between(code, 1, 31) || code == 127 || i == 0 && between(code, 48, 57) || i == 1 && between(code, 48, 57) && firstcode == 45) {\n result += "\\\\" + code.toString(16) + " ";\n } else if (code >= 128 || code == 45 || code == 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122)) {\n result += string[i];\n } else {\n result += "\\\\" + string[i];\n }\n }\n return result;\n }\n function escapeHash(string) {\n string = "" + string;\n var result = "";\n var firstcode = string.charCodeAt(0);\n for (var i = 0; i < string.length; i++) {\n var code = string.charCodeAt(i);\n if (code == 0) {\n throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n }\n if (code >= 128 || code == 45 || code == 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122)) {\n result += string[i];\n } else {\n result += "\\\\" + code.toString(16) + " ";\n }\n }\n return result;\n }\n function escapeString(string) {\n string = "" + string;\n var result = "";\n for (var i = 0; i < string.length; i++) {\n var code = string.charCodeAt(i);\n if (code == 0) {\n throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n }\n if (between(code, 1, 31) || code == 127) {\n result += "\\\\" + code.toString(16) + " ";\n } else if (code == 34 || code == 92) {\n result += "\\\\" + string[i];\n } else {\n result += string[i];\n }\n }\n return result;\n }\n exports2.tokenize = tokenize2;\n exports2.IdentToken = IdentToken2;\n exports2.FunctionToken = FunctionToken2;\n exports2.AtKeywordToken = AtKeywordToken2;\n exports2.HashToken = HashToken2;\n exports2.StringToken = StringToken2;\n exports2.BadStringToken = BadStringToken2;\n exports2.URLToken = URLToken2;\n exports2.BadURLToken = BadURLToken2;\n exports2.DelimToken = DelimToken2;\n exports2.NumberToken = NumberToken2;\n exports2.PercentageToken = PercentageToken2;\n exports2.DimensionToken = DimensionToken;\n exports2.IncludeMatchToken = IncludeMatchToken;\n exports2.DashMatchToken = DashMatchToken;\n exports2.PrefixMatchToken = PrefixMatchToken;\n exports2.SuffixMatchToken = SuffixMatchToken;\n exports2.SubstringMatchToken = SubstringMatchToken;\n exports2.ColumnToken = ColumnToken2;\n exports2.WhitespaceToken = WhitespaceToken2;\n exports2.CDOToken = CDOToken2;\n exports2.CDCToken = CDCToken2;\n exports2.ColonToken = ColonToken2;\n exports2.SemicolonToken = SemicolonToken2;\n exports2.CommaToken = CommaToken2;\n exports2.OpenParenToken = OpenParenToken;\n exports2.CloseParenToken = CloseParenToken2;\n exports2.OpenSquareToken = OpenSquareToken2;\n exports2.CloseSquareToken = CloseSquareToken2;\n exports2.OpenCurlyToken = OpenCurlyToken2;\n exports2.CloseCurlyToken = CloseCurlyToken2;\n exports2.EOFToken = EOFToken2;\n exports2.CSSParserToken = CSSParserToken;\n exports2.GroupingToken = GroupingToken;\n });\n }\n});\n\n// packages/playwright-core/src/server/injected/injectedScript.ts\nvar injectedScript_exports = {};\n__export(injectedScript_exports, {\n InjectedScript: () => InjectedScript\n});\nmodule.exports = __toCommonJS(injectedScript_exports);\n\n// packages/playwright-core/src/server/injected/xpathSelectorEngine.ts\nvar XPathEngine = {\n queryAll(root, selector) {\n if (selector.startsWith("/"))\n selector = "." + selector;\n const result = [];\n const document2 = root instanceof Document ? root : root.ownerDocument;\n if (!document2)\n return result;\n const it = document2.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);\n for (let node = it.iterateNext(); node; node = it.iterateNext()) {\n if (node.nodeType === Node.ELEMENT_NODE)\n result.push(node);\n }\n return result;\n }\n};\n\n// packages/playwright-core/src/server/injected/domUtils.ts\nfunction isInsideScope(scope, element) {\n while (element) {\n if (scope.contains(element))\n return true;\n element = enclosingShadowHost(element);\n }\n return false;\n}\nfunction parentElementOrShadowHost(element) {\n if (element.parentElement)\n return element.parentElement;\n if (!element.parentNode)\n return;\n if (element.parentNode.nodeType === 11 && element.parentNode.host)\n return element.parentNode.host;\n}\nfunction enclosingShadowRootOrDocument(element) {\n let node = element;\n while (node.parentNode)\n node = node.parentNode;\n if (node.nodeType === 11 || node.nodeType === 9)\n return node;\n}\nfunction enclosingShadowHost(element) {\n while (element.parentElement)\n element = element.parentElement;\n return parentElementOrShadowHost(element);\n}\nfunction closestCrossShadow(element, css2) {\n while (element) {\n const closest = element.closest(css2);\n if (closest)\n return closest;\n element = enclosingShadowHost(element);\n }\n}\nfunction isElementVisible(element) {\n if (!element.ownerDocument || !element.ownerDocument.defaultView)\n return true;\n const style = element.ownerDocument.defaultView.getComputedStyle(element);\n if (!style || style.visibility === "hidden")\n return false;\n if (style.display === "contents") {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 1 && isElementVisible(child))\n return true;\n if (child.nodeType === 3 && isVisibleTextNode(child))\n return true;\n }\n return false;\n }\n const rect = element.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\nfunction isVisibleTextNode(node) {\n const range = document.createRange();\n range.selectNode(node);\n const rect = range.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\n\n// packages/playwright-core/src/server/injected/selectorUtils.ts\nfunction matchesComponentAttribute(obj, attr) {\n for (const token of attr.jsonPath) {\n if (obj !== void 0 && obj !== null)\n obj = obj[token];\n }\n return matchesAttributePart(obj, attr);\n}\nfunction matchesAttributePart(value, attr) {\n const objValue = typeof value === "string" && !attr.caseSensitive ? value.toUpperCase() : value;\n const attrValue = typeof attr.value === "string" && !attr.caseSensitive ? attr.value.toUpperCase() : attr.value;\n if (attr.op === "")\n return !!objValue;\n if (attr.op === "=") {\n if (attrValue instanceof RegExp)\n return typeof objValue === "string" && !!objValue.match(attrValue);\n return objValue === attrValue;\n }\n if (typeof objValue !== "string" || typeof attrValue !== "string")\n return false;\n if (attr.op === "*=")\n return objValue.includes(attrValue);\n if (attr.op === "^=")\n return objValue.startsWith(attrValue);\n if (attr.op === "$=")\n return objValue.endsWith(attrValue);\n if (attr.op === "|=")\n return objValue === attrValue || objValue.startsWith(attrValue + "-");\n if (attr.op === "~=")\n return objValue.split(" ").includes(attrValue);\n return false;\n}\nfunction createLaxTextMatcher(text) {\n text = text.trim().replace(/\\s+/g, " ").toLowerCase();\n return (elementText2) => {\n const s = elementText2.full.trim().replace(/\\s+/g, " ").toLowerCase();\n return s.includes(text);\n };\n}\nfunction createStrictTextMatcher(text) {\n text = text.trim().replace(/\\s+/g, " ");\n return (elementText2) => {\n if (!text && !elementText2.immediate.length)\n return true;\n return elementText2.immediate.some((s) => s.trim().replace(/\\s+/g, " ") === text);\n };\n}\nfunction createRegexTextMatcher(source, flags) {\n const re = new RegExp(source, flags);\n return (elementText2) => {\n return re.test(elementText2.full);\n };\n}\nfunction shouldSkipForTextMatching(element) {\n return element.nodeName === "SCRIPT" || element.nodeName === "STYLE" || document.head && document.head.contains(element);\n}\nfunction elementText(cache, root) {\n let value = cache.get(root);\n if (value === void 0) {\n value = { full: "", immediate: [] };\n if (!shouldSkipForTextMatching(root)) {\n let currentImmediate = "";\n if (root instanceof HTMLInputElement && (root.type === "submit" || root.type === "button")) {\n value = { full: root.value, immediate: [root.value] };\n } else {\n for (let child = root.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === Node.TEXT_NODE) {\n value.full += child.nodeValue || "";\n currentImmediate += child.nodeValue || "";\n } else {\n if (currentImmediate)\n value.immediate.push(currentImmediate);\n currentImmediate = "";\n if (child.nodeType === Node.ELEMENT_NODE)\n value.full += elementText(cache, child).full;\n }\n }\n if (currentImmediate)\n value.immediate.push(currentImmediate);\n if (root.shadowRoot)\n value.full += elementText(cache, root.shadowRoot).full;\n }\n }\n cache.set(root, value);\n }\n return value;\n}\nfunction elementMatchesText(cache, element, matcher) {\n if (shouldSkipForTextMatching(element))\n return "none";\n if (!matcher(elementText(cache, element)))\n return "none";\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === Node.ELEMENT_NODE && matcher(elementText(cache, child)))\n return "selfAndChildren";\n }\n if (element.shadowRoot && matcher(elementText(cache, element.shadowRoot)))\n return "selfAndChildren";\n return "self";\n}\n\n// packages/playwright-core/src/server/isomorphic/cssParser.ts\nvar css = __toESM(require_cssTokenizer());\nvar InvalidSelectorError = class extends Error {\n};\nfunction parseCSS(selector, customNames) {\n let tokens;\n try {\n tokens = css.tokenize(selector);\n if (!(tokens[tokens.length - 1] instanceof css.EOFToken))\n tokens.push(new css.EOFToken());\n } catch (e) {\n const newMessage = e.message + ` while parsing selector "${selector}"`;\n const index = (e.stack || "").indexOf(e.message);\n if (index !== -1)\n e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);\n e.message = newMessage;\n throw e;\n }\n const unsupportedToken = tokens.find((token) => {\n return token instanceof css.AtKeywordToken || token instanceof css.BadStringToken || token instanceof css.BadURLToken || token instanceof css.ColumnToken || token instanceof css.CDOToken || token instanceof css.CDCToken || token instanceof css.SemicolonToken || token instanceof css.OpenCurlyToken || token instanceof css.CloseCurlyToken || token instanceof css.URLToken || token instanceof css.PercentageToken;\n });\n if (unsupportedToken)\n throw new InvalidSelectorError(`Unsupported token "${unsupportedToken.toSource()}" while parsing selector "${selector}"`);\n let pos = 0;\n const names = /* @__PURE__ */ new Set();\n function unexpected() {\n return new InvalidSelectorError(`Unexpected token "${tokens[pos].toSource()}" while parsing selector "${selector}"`);\n }\n function skipWhitespace() {\n while (tokens[pos] instanceof css.WhitespaceToken)\n pos++;\n }\n function isIdent(p = pos) {\n return tokens[p] instanceof css.IdentToken;\n }\n function isString(p = pos) {\n return tokens[p] instanceof css.StringToken;\n }\n function isNumber(p = pos) {\n return tokens[p] instanceof css.NumberToken;\n }\n function isComma(p = pos) {\n return tokens[p] instanceof css.CommaToken;\n }\n function isCloseParen(p = pos) {\n return tokens[p] instanceof css.CloseParenToken;\n }\n function isStar(p = pos) {\n return tokens[p] instanceof css.DelimToken && tokens[p].value === "*";\n }\n function isEOF(p = pos) {\n return tokens[p] instanceof css.EOFToken;\n }\n function isClauseCombinator(p = pos) {\n return tokens[p] instanceof css.DelimToken && [">", "+", "~"].includes(tokens[p].value);\n }\n function isSelectorClauseEnd(p = pos) {\n return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof css.WhitespaceToken;\n }\n function consumeFunctionArguments() {\n const result2 = [consumeArgument()];\n while (true) {\n skipWhitespace();\n if (!isComma())\n break;\n pos++;\n result2.push(consumeArgument());\n }\n return result2;\n }\n function consumeArgument() {\n skipWhitespace();\n if (isNumber())\n return tokens[pos++].value;\n if (isString())\n return tokens[pos++].value;\n return consumeComplexSelector();\n }\n function consumeComplexSelector() {\n const result2 = { simples: [] };\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples.push({ selector: { functions: [{ name: "scope", args: [] }] }, combinator: "" });\n } else {\n result2.simples.push({ selector: consumeSimpleSelector(), combinator: "" });\n }\n while (true) {\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples[result2.simples.length - 1].combinator = tokens[pos++].value;\n skipWhitespace();\n } else if (isSelectorClauseEnd()) {\n break;\n }\n result2.simples.push({ combinator: "", selector: consumeSimpleSelector() });\n }\n return result2;\n }\n function consumeSimpleSelector() {\n let rawCSSString = "";\n const functions = [];\n while (!isSelectorClauseEnd()) {\n if (isIdent() || isStar()) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof css.HashToken) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof css.DelimToken && tokens[pos].value === ".") {\n pos++;\n if (isIdent())\n rawCSSString += "." + tokens[pos++].toSource();\n else\n throw unexpected();\n } else if (tokens[pos] instanceof css.ColonToken) {\n pos++;\n if (isIdent()) {\n if (!customNames.has(tokens[pos].value.toLowerCase())) {\n rawCSSString += ":" + tokens[pos++].toSource();\n } else {\n const name = tokens[pos++].value.toLowerCase();\n functions.push({ name, args: [] });\n names.add(name);\n }\n } else if (tokens[pos] instanceof css.FunctionToken) {\n const name = tokens[pos++].value.toLowerCase();\n if (!customNames.has(name)) {\n rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;\n } else {\n functions.push({ name, args: consumeFunctionArguments() });\n names.add(name);\n }\n skipWhitespace();\n if (!isCloseParen())\n throw unexpected();\n pos++;\n } else {\n throw unexpected();\n }\n } else if (tokens[pos] instanceof css.OpenSquareToken) {\n rawCSSString += "[";\n pos++;\n while (!(tokens[pos] instanceof css.CloseSquareToken) && !isEOF())\n rawCSSString += tokens[pos++].toSource();\n if (!(tokens[pos] instanceof css.CloseSquareToken))\n throw unexpected();\n rawCSSString += "]";\n pos++;\n } else {\n throw unexpected();\n }\n }\n if (!rawCSSString && !functions.length)\n throw unexpected();\n return { css: rawCSSString || void 0, functions };\n }\n function consumeBuiltinFunctionArguments() {\n let s = "";\n while (!isCloseParen() && !isEOF())\n s += tokens[pos++].toSource();\n return s;\n }\n const result = consumeFunctionArguments();\n if (!isEOF())\n throw new InvalidSelectorError(`Error while parsing selector "${selector}"`);\n if (result.some((arg) => typeof arg !== "object" || !("simples" in arg)))\n throw new InvalidSelectorError(`Error while parsing selector "${selector}"`);\n return { selector: result, names: Array.from(names) };\n}\n\n// packages/playwright-core/src/server/isomorphic/selectorParser.ts\nvar kNestedSelectorNames = /* @__PURE__ */ new Set(["has", "left-of", "right-of", "above", "below", "near"]);\nvar kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set(["left-of", "right-of", "above", "below", "near"]);\nvar customCSSNames = /* @__PURE__ */ new Set(["not", "is", "where", "has", "scope", "light", "visible", "text", "text-matches", "text-is", "has-text", "above", "below", "right-of", "left-of", "near", "nth-match"]);\nfunction parseSelector(selector) {\n const result = parseSelectorString(selector);\n const parts = result.parts.map((part) => {\n if (part.name === "css" || part.name === "css:light") {\n if (part.name === "css:light")\n part.body = ":light(" + part.body + ")";\n const parsedCSS = parseCSS(part.body, customCSSNames);\n return {\n name: "css",\n body: parsedCSS.selector,\n source: part.body\n };\n }\n if (kNestedSelectorNames.has(part.name)) {\n let innerSelector;\n let distance;\n try {\n const unescaped = JSON.parse("[" + part.body + "]");\n if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== "string")\n throw new Error(`Malformed selector: ${part.name}=` + part.body);\n innerSelector = unescaped[0];\n if (unescaped.length === 2) {\n if (typeof unescaped[1] !== "number" || !kNestedSelectorNamesWithDistance.has(part.name))\n throw new Error(`Malformed selector: ${part.name}=` + part.body);\n distance = unescaped[1];\n }\n } catch (e) {\n throw new Error(`Malformed selector: ${part.name}=` + part.body);\n }\n const result2 = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };\n if (result2.body.parsed.parts.some((part2) => part2.name === "control" && part2.body === "enter-frame"))\n throw new Error(`Frames are not allowed inside "${part.name}" selectors`);\n return result2;\n }\n return { ...part, source: part.body };\n });\n if (kNestedSelectorNames.has(parts[0].name))\n throw new Error(`"${parts[0].name}" selector cannot be first`);\n return {\n capture: result.capture,\n parts\n };\n}\nfunction stringifySelector(selector) {\n if (typeof selector === "string")\n return selector;\n return selector.parts.map((p, i) => {\n const prefix = p.name === "css" ? "" : p.name + "=";\n return `${i === selector.capture ? "*" : ""}${prefix}${p.source}`;\n }).join(" >> ");\n}\nfunction allEngineNames(selector) {\n const result = /* @__PURE__ */ new Set();\n const visit = (selector2) => {\n for (const part of selector2.parts) {\n result.add(part.name);\n if (kNestedSelectorNames.has(part.name))\n visit(part.body.parsed);\n }\n };\n visit(selector);\n return result;\n}\nfunction parseSelectorString(selector) {\n let index = 0;\n let quote;\n let start = 0;\n const result = { parts: [] };\n const append = () => {\n const part = selector.substring(start, index).trim();\n const eqIndex = part.indexOf("=");\n let name;\n let body;\n if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {\n name = part.substring(0, eqIndex).trim();\n body = part.substring(eqIndex + 1);\n } else if (part.length > 1 && part[0] === \'"\' && part[part.length - 1] === \'"\') {\n name = "text";\n body = part;\n } else if (part.length > 1 && part[0] === "\'" && part[part.length - 1] === "\'") {\n name = "text";\n body = part;\n } else if (/^\\(*\\/\\//.test(part) || part.startsWith("..")) {\n name = "xpath";\n body = part;\n } else {\n name = "css";\n body = part;\n }\n let capture = false;\n if (name[0] === "*") {\n capture = true;\n name = name.substring(1);\n }\n result.parts.push({ name, body });\n if (capture) {\n if (result.capture !== void 0)\n throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);\n result.capture = result.parts.length - 1;\n }\n };\n if (!selector.includes(">>")) {\n index = selector.length;\n append();\n return result;\n }\n const shouldIgnoreTextSelectorQuote = () => {\n const prefix = selector.substring(start, index);\n const match = prefix.match(/^\\s*text\\s*=(.*)$/);\n return !!match && !!match[1];\n };\n while (index < selector.length) {\n const c = selector[index];\n if (c === "\\\\" && index + 1 < selector.length) {\n index += 2;\n } else if (c === quote) {\n quote = void 0;\n index++;\n } else if (!quote && (c === \'"\' || c === "\'" || c === "`") && !shouldIgnoreTextSelectorQuote()) {\n quote = c;\n index++;\n } else if (!quote && c === ">" && selector[index + 1] === ">") {\n append();\n index += 2;\n start = index;\n } else {\n index++;\n }\n }\n append();\n return result;\n}\nfunction parseAttributeSelector(selector, allowUnquotedStrings) {\n let wp = 0;\n let EOL = selector.length === 0;\n const next = () => selector[wp] || "";\n const eat1 = () => {\n const result2 = next();\n ++wp;\n EOL = wp >= selector.length;\n return result2;\n };\n const syntaxError = (stage) => {\n if (EOL)\n throw new Error(`Unexpected end of selector while parsing selector \\`${selector}\\``);\n throw new Error(`Error while parsing selector \\`${selector}\\` - unexpected symbol "${next()}" at position ${wp}` + (stage ? " during " + stage : ""));\n };\n function skipSpaces() {\n while (!EOL && /\\s/.test(next()))\n eat1();\n }\n function isCSSNameChar(char) {\n return char >= "\\x80" || char >= "0" && char <= "9" || char >= "A" && char <= "Z" || char >= "a" && char <= "z" || char >= "0" && char <= "9" || char === "_" || char === "-";\n }\n function readIdentifier() {\n let result2 = "";\n skipSpaces();\n while (!EOL && isCSSNameChar(next()))\n result2 += eat1();\n return result2;\n }\n function readQuotedString(quote) {\n let result2 = eat1();\n if (result2 !== quote)\n syntaxError("parsing quoted string");\n while (!EOL && next() !== quote) {\n if (next() === "\\\\")\n eat1();\n result2 += eat1();\n }\n if (next() !== quote)\n syntaxError("parsing quoted string");\n result2 += eat1();\n return result2;\n }\n function readRegularExpression() {\n if (eat1() !== "/")\n syntaxError("parsing regular expression");\n let source = "";\n let inClass = false;\n while (!EOL) {\n if (next() === "\\\\") {\n source += eat1();\n if (EOL)\n syntaxError("parsing regular expressiion");\n } else if (inClass && next() === "]") {\n inClass = false;\n } else if (!inClass && next() === "[") {\n inClass = true;\n } else if (!inClass && next() === "/") {\n break;\n }\n source += eat1();\n }\n if (eat1() !== "/")\n syntaxError("parsing regular expression");\n let flags = "";\n while (!EOL && next().match(/[dgimsuy]/))\n flags += eat1();\n try {\n return new RegExp(source, flags);\n } catch (e) {\n throw new Error(`Error while parsing selector \\`${selector}\\`: ${e.message}`);\n }\n }\n function readAttributeToken() {\n let token = "";\n skipSpaces();\n if (next() === `\'` || next() === `"`)\n token = readQuotedString(next()).slice(1, -1);\n else\n token = readIdentifier();\n if (!token)\n syntaxError("parsing property path");\n return token;\n }\n function readOperator() {\n skipSpaces();\n let op = "";\n if (!EOL)\n op += eat1();\n if (!EOL && op !== "=")\n op += eat1();\n if (!["=", "*=", "^=", "$=", "|=", "~="].includes(op))\n syntaxError("parsing operator");\n return op;\n }\n function readAttribute() {\n eat1();\n const jsonPath = [];\n jsonPath.push(readAttributeToken());\n skipSpaces();\n while (next() === ".") {\n eat1();\n jsonPath.push(readAttributeToken());\n skipSpaces();\n }\n if (next() === "]") {\n eat1();\n return { name: jsonPath.join("."), jsonPath, op: "", value: null, caseSensitive: false };\n }\n const operator = readOperator();\n let value = void 0;\n let caseSensitive = true;\n skipSpaces();\n if (next() === "/") {\n if (operator !== "=")\n throw new Error(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with regular expression`);\n value = readRegularExpression();\n } else if (next() === `\'` || next() === `"`) {\n value = readQuotedString(next()).slice(1, -1);\n skipSpaces();\n if (next() === "i" || next() === "I") {\n caseSensitive = false;\n eat1();\n } else if (next() === "s" || next() === "S") {\n caseSensitive = true;\n eat1();\n }\n } else {\n value = "";\n while (!EOL && (isCSSNameChar(next()) || next() === "+" || next() === "."))\n value += eat1();\n if (value === "true") {\n value = true;\n } else if (value === "false") {\n value = false;\n } else {\n if (!allowUnquotedStrings) {\n value = +value;\n if (Number.isNaN(value))\n syntaxError("parsing attribute value");\n }\n }\n }\n skipSpaces();\n if (next() !== "]")\n syntaxError("parsing attribute value");\n eat1();\n if (operator !== "=" && typeof value !== "string")\n throw new Error(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with non-string matching value - ${value}`);\n return { name: jsonPath.join("."), jsonPath, op: operator, value, caseSensitive };\n }\n const result = {\n name: "",\n attributes: []\n };\n result.name = readIdentifier();\n skipSpaces();\n while (next() === "[") {\n result.attributes.push(readAttribute());\n skipSpaces();\n }\n if (!EOL)\n syntaxError(void 0);\n if (!result.name && !result.attributes.length)\n throw new Error(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n return result;\n}\n\n// packages/playwright-core/src/server/injected/reactSelectorEngine.ts\nfunction getComponentName(reactElement) {\n if (typeof reactElement.type === "function")\n return reactElement.type.displayName || reactElement.type.name || "Anonymous";\n if (typeof reactElement.type === "string")\n return reactElement.type;\n if (reactElement._currentElement) {\n const elementType = reactElement._currentElement.type;\n if (typeof elementType === "string")\n return elementType;\n if (typeof elementType === "function")\n return elementType.displayName || elementType.name || "Anonymous";\n }\n return "";\n}\nfunction getComponentKey(reactElement) {\n var _a, _b;\n return (_b = reactElement.key) != null ? _b : (_a = reactElement._currentElement) == null ? void 0 : _a.key;\n}\nfunction getChildren(reactElement) {\n if (reactElement.child) {\n const children = [];\n for (let child = reactElement.child; child; child = child.sibling)\n children.push(child);\n return children;\n }\n if (!reactElement._currentElement)\n return [];\n const isKnownElement = (reactElement2) => {\n var _a;\n const elementType = (_a = reactElement2._currentElement) == null ? void 0 : _a.type;\n return typeof elementType === "function" || typeof elementType === "string";\n };\n if (reactElement._renderedComponent) {\n const child = reactElement._renderedComponent;\n return isKnownElement(child) ? [child] : [];\n }\n if (reactElement._renderedChildren)\n return [...Object.values(reactElement._renderedChildren)].filter(isKnownElement);\n return [];\n}\nfunction getProps(reactElement) {\n var _a;\n const props = reactElement.memoizedProps || ((_a = reactElement._currentElement) == null ? void 0 : _a.props);\n if (!props || typeof props === "string")\n return props;\n const result = { ...props };\n delete result.children;\n return result;\n}\nfunction buildComponentsTree(reactElement) {\n var _a;\n const treeNode = {\n key: getComponentKey(reactElement),\n name: getComponentName(reactElement),\n children: getChildren(reactElement).map(buildComponentsTree),\n rootElements: [],\n props: getProps(reactElement)\n };\n const rootElement = reactElement.stateNode || reactElement._hostNode || ((_a = reactElement._renderedComponent) == null ? void 0 : _a._hostNode);\n if (rootElement instanceof Element) {\n treeNode.rootElements.push(rootElement);\n } else {\n for (const child of treeNode.children)\n treeNode.rootElements.push(...child.rootElements);\n }\n return treeNode;\n}\nfunction filterComponentsTree(treeNode, searchFn, result = []) {\n if (searchFn(treeNode))\n result.push(treeNode);\n for (const child of treeNode.children)\n filterComponentsTree(child, searchFn, result);\n return result;\n}\nfunction findReactRoots(root, roots = []) {\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\n do {\n const node = walker.currentNode;\n if (node.hasOwnProperty("_reactRootContainer")) {\n roots.push(node._reactRootContainer._internalRoot.current);\n } else {\n const rootKey = Object.keys(node).find((key) => key.startsWith("__reactContainer"));\n if (rootKey)\n roots.push(node[rootKey].stateNode.current);\n }\n if (node instanceof Element && node.hasAttribute("data-reactroot")) {\n for (const key of Object.keys(node)) {\n if (key.startsWith("__reactInternalInstance") || key.startsWith("__reactFiber"))\n roots.push(node[key]);\n }\n }\n const shadowRoot = node instanceof Element ? node.shadowRoot : null;\n if (shadowRoot)\n findReactRoots(shadowRoot, roots);\n } while (walker.nextNode());\n return roots;\n}\nvar ReactEngine = {\n queryAll(scope, selector) {\n const { name, attributes } = parseAttributeSelector(selector, false);\n const reactRoots = findReactRoots(document);\n const trees = reactRoots.map((reactRoot) => buildComponentsTree(reactRoot));\n const treeNodes = trees.map((tree) => filterComponentsTree(tree, (treeNode) => {\n var _a;\n const props = (_a = treeNode.props) != null ? _a : {};\n if (treeNode.key !== void 0)\n props.key = treeNode.key;\n if (name && treeNode.name !== name)\n return false;\n if (treeNode.rootElements.some((domNode) => !isInsideScope(scope, domNode)))\n return false;\n for (const attr of attributes) {\n if (!matchesComponentAttribute(props, attr))\n return false;\n }\n return true;\n })).flat();\n const allRootElements = /* @__PURE__ */ new Set();\n for (const treeNode of treeNodes) {\n for (const domNode of treeNode.rootElements)\n allRootElements.add(domNode);\n }\n return [...allRootElements];\n }\n};\n\n// packages/playwright-core/src/server/injected/vueSelectorEngine.ts\nfunction basename(filename, ext) {\n const normalized = filename.replace(/^[a-zA-Z]:/, "").replace(/\\\\/g, "/");\n let result = normalized.substring(normalized.lastIndexOf("/") + 1);\n if (ext && result.endsWith(ext))\n result = result.substring(0, result.length - ext.length);\n return result;\n}\nfunction toUpper(_, c) {\n return c ? c.toUpperCase() : "";\n}\nvar classifyRE = /(?:^|[-_/])(\\w)/g;\nvar classify = (str) => {\n return str && str.replace(classifyRE, toUpper);\n};\nfunction buildComponentsTreeVue3(instance) {\n function getComponentTypeName(options) {\n const name = options.name || options._componentTag || options.__playwright_guessedName;\n if (name)\n return name;\n const file = options.__file;\n if (file)\n return classify(basename(file, ".vue"));\n }\n function saveComponentName(instance2, key) {\n instance2.type.__playwright_guessedName = key;\n return key;\n }\n function getInstanceName(instance2) {\n var _a, _b, _c, _d;\n const name = getComponentTypeName(instance2.type || {});\n if (name)\n return name;\n if (instance2.root === instance2)\n return "Root";\n for (const key in (_b = (_a = instance2.parent) == null ? void 0 : _a.type) == null ? void 0 : _b.components)\n if (((_c = instance2.parent) == null ? void 0 : _c.type.components[key]) === instance2.type)\n return saveComponentName(instance2, key);\n for (const key in (_d = instance2.appContext) == null ? void 0 : _d.components)\n if (instance2.appContext.components[key] === instance2.type)\n return saveComponentName(instance2, key);\n return "Anonymous Component";\n }\n function isBeingDestroyed(instance2) {\n return instance2._isBeingDestroyed || instance2.isUnmounted;\n }\n function isFragment(instance2) {\n return instance2.subTree.type.toString() === "Symbol(Fragment)";\n }\n function getInternalInstanceChildren(subTree) {\n const list = [];\n if (subTree.component)\n list.push(subTree.component);\n if (subTree.suspense)\n list.push(...getInternalInstanceChildren(subTree.suspense.activeBranch));\n if (Array.isArray(subTree.children)) {\n subTree.children.forEach((childSubTree) => {\n if (childSubTree.component)\n list.push(childSubTree.component);\n else\n list.push(...getInternalInstanceChildren(childSubTree));\n });\n }\n return list.filter((child) => {\n var _a;\n return !isBeingDestroyed(child) && !((_a = child.type.devtools) == null ? void 0 : _a.hide);\n });\n }\n function getRootElementsFromComponentInstance(instance2) {\n if (isFragment(instance2))\n return getFragmentRootElements(instance2.subTree);\n return [instance2.subTree.el];\n }\n function getFragmentRootElements(vnode) {\n if (!vnode.children)\n return [];\n const list = [];\n for (let i = 0, l = vnode.children.length; i < l; i++) {\n const childVnode = vnode.children[i];\n if (childVnode.component)\n list.push(...getRootElementsFromComponentInstance(childVnode.component));\n else if (childVnode.el)\n list.push(childVnode.el);\n }\n return list;\n }\n function buildComponentsTree2(instance2) {\n return {\n name: getInstanceName(instance2),\n children: getInternalInstanceChildren(instance2.subTree).map(buildComponentsTree2),\n rootElements: getRootElementsFromComponentInstance(instance2),\n props: instance2.props\n };\n }\n return buildComponentsTree2(instance);\n}\nfunction buildComponentsTreeVue2(instance) {\n function getComponentName2(options) {\n const name = options.displayName || options.name || options._componentTag;\n if (name)\n return name;\n const file = options.__file;\n if (file)\n return classify(basename(file, ".vue"));\n }\n function getInstanceName(instance2) {\n const name = getComponentName2(instance2.$options || instance2.fnOptions || {});\n if (name)\n return name;\n return instance2.$root === instance2 ? "Root" : "Anonymous Component";\n }\n function getInternalInstanceChildren(instance2) {\n if (instance2.$children)\n return instance2.$children;\n if (Array.isArray(instance2.subTree.children))\n return instance2.subTree.children.filter((vnode) => !!vnode.component).map((vnode) => vnode.component);\n return [];\n }\n function buildComponentsTree2(instance2) {\n return {\n name: getInstanceName(instance2),\n children: getInternalInstanceChildren(instance2).map(buildComponentsTree2),\n rootElements: [instance2.$el],\n props: instance2._props\n };\n }\n return buildComponentsTree2(instance);\n}\nfunction filterComponentsTree2(treeNode, searchFn, result = []) {\n if (searchFn(treeNode))\n result.push(treeNode);\n for (const child of treeNode.children)\n filterComponentsTree2(child, searchFn, result);\n return result;\n}\nfunction findVueRoots(root, roots = []) {\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\n const vue2Roots = /* @__PURE__ */ new Set();\n do {\n const node = walker.currentNode;\n if (node.__vue__)\n vue2Roots.add(node.__vue__.$root);\n if (node.__vue_app__ && node._vnode && node._vnode.component)\n roots.push({ root: node._vnode.component, version: 3 });\n const shadowRoot = node instanceof Element ? node.shadowRoot : null;\n if (shadowRoot)\n findVueRoots(shadowRoot, roots);\n } while (walker.nextNode());\n for (const vue2root of vue2Roots) {\n roots.push({\n version: 2,\n root: vue2root\n });\n }\n return roots;\n}\nvar VueEngine = {\n queryAll(scope, selector) {\n const { name, attributes } = parseAttributeSelector(selector, false);\n const vueRoots = findVueRoots(document);\n const trees = vueRoots.map((vueRoot) => vueRoot.version === 3 ? buildComponentsTreeVue3(vueRoot.root) : buildComponentsTreeVue2(vueRoot.root));\n const treeNodes = trees.map((tree) => filterComponentsTree2(tree, (treeNode) => {\n if (name && treeNode.name !== name)\n return false;\n if (treeNode.rootElements.some((rootElement) => !isInsideScope(scope, rootElement)))\n return false;\n for (const attr of attributes) {\n if (!matchesComponentAttribute(treeNode.props, attr))\n return false;\n }\n return true;\n })).flat();\n const allRootElements = /* @__PURE__ */ new Set();\n for (const treeNode of treeNodes) {\n for (const rootElement of treeNode.rootElements)\n allRootElements.add(rootElement);\n }\n return [...allRootElements];\n }\n};\n\n// packages/playwright-core/src/server/injected/roleUtils.ts\nfunction hasExplicitAccessibleName(e) {\n return e.hasAttribute("aria-label") || e.hasAttribute("aria-labelledby");\n}\nvar kAncestorPreventingLandmark = "article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]";\nvar kGlobalAriaAttributes = [\n "aria-atomic",\n "aria-busy",\n "aria-controls",\n "aria-current",\n "aria-describedby",\n "aria-details",\n "aria-disabled",\n "aria-dropeffect",\n "aria-errormessage",\n "aria-flowto",\n "aria-grabbed",\n "aria-haspopup",\n "aria-hidden",\n "aria-invalid",\n "aria-keyshortcuts",\n "aria-label",\n "aria-labelledby",\n "aria-live",\n "aria-owns",\n "aria-relevant",\n "aria-roledescription"\n];\nfunction hasGlobalAriaAttribute(e) {\n return kGlobalAriaAttributes.some((a) => e.hasAttribute(a));\n}\nvar kImplicitRoleByTagName = {\n "A": (e) => {\n return e.hasAttribute("href") ? "link" : null;\n },\n "AREA": (e) => {\n return e.hasAttribute("href") ? "link" : null;\n },\n "ARTICLE": () => "article",\n "ASIDE": () => "complementary",\n "BLOCKQUOTE": () => "blockquote",\n "BUTTON": () => "button",\n "CAPTION": () => "caption",\n "CODE": () => "code",\n "DATALIST": () => "listbox",\n "DD": () => "definition",\n "DEL": () => "deletion",\n "DETAILS": () => "group",\n "DFN": () => "term",\n "DIALOG": () => "dialog",\n "DT": () => "term",\n "EM": () => "emphasis",\n "FIELDSET": () => "group",\n "FIGURE": () => "figure",\n "FOOTER": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : "contentinfo",\n "FORM": (e) => hasExplicitAccessibleName(e) ? "form" : null,\n "H1": () => "heading",\n "H2": () => "heading",\n "H3": () => "heading",\n "H4": () => "heading",\n "H5": () => "heading",\n "H6": () => "heading",\n "HEADER": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : "banner",\n "HR": () => "separator",\n "HTML": () => "document",\n "IMG": (e) => e.getAttribute("alt") === "" && !hasGlobalAriaAttribute(e) && Number.isNaN(Number(String(e.getAttribute("tabindex")))) ? "presentation" : "img",\n "INPUT": (e) => {\n const type = e.type.toLowerCase();\n if (type === "search")\n return e.hasAttribute("list") ? "combobox" : "searchbox";\n if (["email", "tel", "text", "url", ""].includes(type)) {\n const list = getIdRefs(e, e.getAttribute("list"))[0];\n return list && list.tagName === "DATALIST" ? "combobox" : "textbox";\n }\n if (type === "hidden")\n return "";\n return {\n "button": "button",\n "checkbox": "checkbox",\n "image": "button",\n "number": "spinbutton",\n "radio": "radio",\n "range": "slider",\n "reset": "button",\n "submit": "button"\n }[type] || "textbox";\n },\n "INS": () => "insertion",\n "LI": () => "listitem",\n "MAIN": () => "main",\n "MARK": () => "mark",\n "MATH": () => "math",\n "MENU": () => "list",\n "METER": () => "meter",\n "NAV": () => "navigation",\n "OL": () => "list",\n "OPTGROUP": () => "group",\n "OPTION": () => "option",\n "OUTPUT": () => "status",\n "P": () => "paragraph",\n "PROGRESS": () => "progressbar",\n "SECTION": (e) => hasExplicitAccessibleName(e) ? "region" : null,\n "SELECT": (e) => e.hasAttribute("multiple") || e.size > 1 ? "listbox" : "combobox",\n "STRONG": () => "strong",\n "SUB": () => "subscript",\n "SUP": () => "superscript",\n "TABLE": () => "table",\n "TBODY": () => "rowgroup",\n "TD": (e) => {\n const table = closestCrossShadow(e, "table");\n const role = table ? getExplicitAriaRole(table) : "";\n return role === "grid" || role === "treegrid" ? "gridcell" : "cell";\n },\n "TEXTAREA": () => "textbox",\n "TFOOT": () => "rowgroup",\n "TH": (e) => {\n if (e.getAttribute("scope") === "col")\n return "columnheader";\n if (e.getAttribute("scope") === "row")\n return "rowheader";\n const table = closestCrossShadow(e, "table");\n const role = table ? getExplicitAriaRole(table) : "";\n return role === "grid" || role === "treegrid" ? "gridcell" : "cell";\n },\n "THEAD": () => "rowgroup",\n "TIME": () => "time",\n "TR": () => "row",\n "UL": () => "list"\n};\nvar kPresentationInheritanceParents = {\n "DD": ["DL", "DIV"],\n "DIV": ["DL"],\n "DT": ["DL", "DIV"],\n "LI": ["OL", "UL"],\n "TBODY": ["TABLE"],\n "TD": ["TR"],\n "TFOOT": ["TABLE"],\n "TH": ["TR"],\n "THEAD": ["TABLE"],\n "TR": ["THEAD", "TBODY", "TFOOT", "TABLE"]\n};\nfunction getImplicitAriaRole(element) {\n var _a;\n const implicitRole = ((_a = kImplicitRoleByTagName[element.tagName]) == null ? void 0 : _a.call(kImplicitRoleByTagName, element)) || "";\n if (!implicitRole)\n return null;\n let ancestor = element;\n while (ancestor) {\n const parent = parentElementOrShadowHost(ancestor);\n const parents = kPresentationInheritanceParents[ancestor.tagName];\n if (!parents || !parent || !parents.includes(parent.tagName))\n break;\n const parentExplicitRole = getExplicitAriaRole(parent);\n if ((parentExplicitRole === "none" || parentExplicitRole === "presentation") && !hasPresentationConflictResolution(parent))\n return parentExplicitRole;\n ancestor = parent;\n }\n return implicitRole;\n}\nvar allRoles = [\n "alert",\n "alertdialog",\n "application",\n "article",\n "banner",\n "blockquote",\n "button",\n "caption",\n "cell",\n "checkbox",\n "code",\n "columnheader",\n "combobox",\n "command",\n "complementary",\n "composite",\n "contentinfo",\n "definition",\n "deletion",\n "dialog",\n "directory",\n "document",\n "emphasis",\n "feed",\n "figure",\n "form",\n "generic",\n "grid",\n "gridcell",\n "group",\n "heading",\n "img",\n "input",\n "insertion",\n "landmark",\n "link",\n "list",\n "listbox",\n "listitem",\n "log",\n "main",\n "marquee",\n "math",\n "meter",\n "menu",\n "menubar",\n "menuitem",\n "menuitemcheckbox",\n "menuitemradio",\n "navigation",\n "none",\n "note",\n "option",\n "paragraph",\n "presentation",\n "progressbar",\n "radio",\n "radiogroup",\n "range",\n "region",\n "roletype",\n "row",\n "rowgroup",\n "rowheader",\n "scrollbar",\n "search",\n "searchbox",\n "section",\n "sectionhead",\n "select",\n "separator",\n "slider",\n "spinbutton",\n "status",\n "strong",\n "structure",\n "subscript",\n "superscript",\n "switch",\n "tab",\n "table",\n "tablist",\n "tabpanel",\n "term",\n "textbox",\n "time",\n "timer",\n "toolbar",\n "tooltip",\n "tree",\n "treegrid",\n "treeitem",\n "widget",\n "window"\n];\nvar abstractRoles = ["command", "composite", "input", "landmark", "range", "roletype", "section", "sectionhead", "select", "structure", "widget", "window"];\nvar validRoles = allRoles.filter((role) => !abstractRoles.includes(role));\nfunction getExplicitAriaRole(element) {\n const roles = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());\n return roles.find((role) => validRoles.includes(role)) || null;\n}\nfunction hasPresentationConflictResolution(element) {\n return !hasGlobalAriaAttribute(element);\n}\nfunction getAriaRole(element) {\n const explicitRole = getExplicitAriaRole(element);\n if (!explicitRole)\n return getImplicitAriaRole(element);\n if ((explicitRole === "none" || explicitRole === "presentation") && hasPresentationConflictResolution(element))\n return getImplicitAriaRole(element);\n return explicitRole;\n}\nfunction getAriaBoolean(attr) {\n return attr === null ? void 0 : attr.toLowerCase() === "true";\n}\nfunction getComputedStyle(element, pseudo) {\n return element.ownerDocument && element.ownerDocument.defaultView ? element.ownerDocument.defaultView.getComputedStyle(element, pseudo) : void 0;\n}\nfunction isElementHiddenForAria(element, cache) {\n if (["STYLE", "SCRIPT", "NOSCRIPT", "TEMPLATE"].includes(element.tagName))\n return true;\n const style = getComputedStyle(element);\n if (!style || style.visibility === "hidden")\n return true;\n return belongsToDisplayNoneOrAriaHidden(element, cache);\n}\nfunction belongsToDisplayNoneOrAriaHidden(element, cache) {\n if (!cache.has(element)) {\n const style = getComputedStyle(element);\n let hidden = !style || style.display === "none" || getAriaBoolean(element.getAttribute("aria-hidden")) === true;\n if (!hidden) {\n const parent = parentElementOrShadowHost(element);\n if (parent)\n hidden = hidden || belongsToDisplayNoneOrAriaHidden(parent, cache);\n }\n cache.set(element, hidden);\n }\n return cache.get(element);\n}\nfunction getIdRefs(element, ref) {\n if (!ref)\n return [];\n const root = enclosingShadowRootOrDocument(element);\n if (!root)\n return [];\n try {\n const ids = ref.split(" ").filter((id) => !!id);\n const set = /* @__PURE__ */ new Set();\n for (const id of ids) {\n const firstElement = root.querySelector("#" + CSS.escape(id));\n if (firstElement)\n set.add(firstElement);\n }\n return [...set];\n } catch (e) {\n return [];\n }\n}\nfunction normalizeAccessbileName(s) {\n return s.replace(/\\r\\n/g, "\\n").replace(/\\u00A0/g, " ").replace(/\\s\\s+/g, " ").trim();\n}\nfunction queryInAriaOwned(element, selector) {\n const result = [...element.querySelectorAll(selector)];\n for (const owned of getIdRefs(element, element.getAttribute("aria-owns"))) {\n if (owned.matches(selector))\n result.push(owned);\n result.push(...owned.querySelectorAll(selector));\n }\n return result;\n}\nfunction getPseudoContent(pseudoStyle) {\n if (!pseudoStyle)\n return "";\n const content = pseudoStyle.getPropertyValue("content");\n if (content[0] === "\'" && content[content.length - 1] === "\'" || content[0] === \'"\' && content[content.length - 1] === \'"\') {\n const unquoted = content.substring(1, content.length - 1);\n const display = pseudoStyle.getPropertyValue("display") || "inline";\n if (display !== "inline")\n return " " + unquoted + " ";\n return unquoted;\n }\n return "";\n}\nfunction getElementAccessibleName(element, includeHidden, hiddenCache) {\n const elementProhibitsNaming = ["caption", "code", "definition", "deletion", "emphasis", "generic", "insertion", "mark", "paragraph", "presentation", "strong", "subscript", "suggestion", "superscript", "term", "time"].includes(getAriaRole(element) || "");\n if (elementProhibitsNaming)\n return "";\n const accessibleName = normalizeAccessbileName(getElementAccessibleNameInternal(element, {\n includeHidden,\n hiddenCache,\n visitedElements: /* @__PURE__ */ new Set(),\n embeddedInLabelledBy: "none",\n embeddedInLabel: "none",\n embeddedInTextAlternativeElement: false,\n embeddedInTargetElement: "self"\n }));\n return accessibleName;\n}\nfunction getElementAccessibleNameInternal(element, options) {\n if (options.visitedElements.has(element))\n return "";\n const childOptions = {\n ...options,\n embeddedInLabel: options.embeddedInLabel === "self" ? "descendant" : options.embeddedInLabel,\n embeddedInLabelledBy: options.embeddedInLabelledBy === "self" ? "descendant" : options.embeddedInLabelledBy,\n embeddedInTargetElement: options.embeddedInTargetElement === "self" ? "descendant" : options.embeddedInTargetElement\n };\n if (!options.includeHidden && options.embeddedInLabelledBy !== "self" && isElementHiddenForAria(element, options.hiddenCache)) {\n options.visitedElements.add(element);\n return "";\n }\n if (options.embeddedInLabelledBy === "none") {\n const refs = getIdRefs(element, element.getAttribute("aria-labelledby"));\n const accessibleName = refs.map((ref) => getElementAccessibleNameInternal(ref, {\n ...options,\n embeddedInLabelledBy: "self",\n embeddedInTargetElement: "none",\n embeddedInLabel: "none",\n embeddedInTextAlternativeElement: false\n })).join(" ");\n if (accessibleName)\n return accessibleName;\n }\n const role = getAriaRole(element) || "";\n if (options.embeddedInLabel !== "none" || options.embeddedInLabelledBy !== "none") {\n const isOwnLabel = [...element.labels || []].includes(element);\n const isOwnLabelledBy = getIdRefs(element, element.getAttribute("aria-labelledby")).includes(element);\n if (!isOwnLabel && !isOwnLabelledBy) {\n if (role === "textbox") {\n options.visitedElements.add(element);\n if (element.tagName === "INPUT" || element.tagName === "TEXTAREA")\n return element.value;\n return element.textContent || "";\n }\n if (["combobox", "listbox"].includes(role)) {\n options.visitedElements.add(element);\n let selectedOptions;\n if (element.tagName === "SELECT") {\n selectedOptions = [...element.selectedOptions];\n if (!selectedOptions.length && element.options.length)\n selectedOptions.push(element.options[0]);\n } else {\n const listbox = role === "combobox" ? queryInAriaOwned(element, "*").find((e) => getAriaRole(e) === "listbox") : element;\n selectedOptions = listbox ? queryInAriaOwned(listbox, \'[aria-selected="true"]\').filter((e) => getAriaRole(e) === "option") : [];\n }\n return selectedOptions.map((option) => getElementAccessibleNameInternal(option, childOptions)).join(" ");\n }\n if (["progressbar", "scrollbar", "slider", "spinbutton", "meter"].includes(role)) {\n options.visitedElements.add(element);\n if (element.hasAttribute("aria-valuetext"))\n return element.getAttribute("aria-valuetext") || "";\n if (element.hasAttribute("aria-valuenow"))\n return element.getAttribute("aria-valuenow") || "";\n return element.getAttribute("value") || "";\n }\n if (["menu"].includes(role)) {\n options.visitedElements.add(element);\n return "";\n }\n }\n }\n const ariaLabel = element.getAttribute("aria-label") || "";\n if (ariaLabel.trim()) {\n options.visitedElements.add(element);\n return ariaLabel;\n }\n if (!["presentation", "none"].includes(role)) {\n if (element.tagName === "INPUT" && ["button", "submit", "reset"].includes(element.type)) {\n options.visitedElements.add(element);\n const value = element.value || "";\n if (value.trim())\n return value;\n if (element.type === "submit")\n return "Submit";\n if (element.type === "reset")\n return "Reset";\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (element.tagName === "INPUT" && element.type === "image") {\n options.visitedElements.add(element);\n const alt = element.getAttribute("alt") || "";\n if (alt.trim())\n return alt;\n const labels = element.labels || [];\n if (labels.length) {\n return [...labels].map((label) => getElementAccessibleNameInternal(label, {\n ...options,\n embeddedInLabel: "self",\n embeddedInTextAlternativeElement: false,\n embeddedInLabelledBy: "none",\n embeddedInTargetElement: "none"\n })).filter((accessibleName) => !!accessibleName).join(" ");\n }\n const title = element.getAttribute("title") || "";\n if (title.trim())\n return title;\n return "Submit";\n }\n if (element.tagName === "TEXTAREA" || element.tagName === "SELECT" || element.tagName === "INPUT") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length) {\n return [...labels].map((label) => getElementAccessibleNameInternal(label, {\n ...options,\n embeddedInLabel: "self",\n embeddedInTextAlternativeElement: false,\n embeddedInLabelledBy: "none",\n embeddedInTargetElement: "none"\n })).filter((accessibleName) => !!accessibleName).join(" ");\n }\n const usePlaceholder = element.tagName === "INPUT" && ["text", "password", "search", "tel", "email", "url"].includes(element.type) || element.tagName === "TEXTAREA";\n const placeholder = element.getAttribute("placeholder") || "";\n const title = element.getAttribute("title") || "";\n if (!usePlaceholder || title)\n return title;\n return placeholder;\n }\n if (element.tagName === "FIELDSET") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (child.tagName === "LEGEND") {\n return getElementAccessibleNameInternal(child, {\n ...childOptions,\n embeddedInTextAlternativeElement: true\n });\n }\n }\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (element.tagName === "FIGURE") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (child.tagName === "FIGCAPTION") {\n return getElementAccessibleNameInternal(child, {\n ...childOptions,\n embeddedInTextAlternativeElement: true\n });\n }\n }\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (element.tagName === "IMG") {\n options.visitedElements.add(element);\n const alt = element.getAttribute("alt") || "";\n if (alt.trim())\n return alt;\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (element.tagName === "TABLE") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (child.tagName === "CAPTION") {\n return getElementAccessibleNameInternal(child, {\n ...childOptions,\n embeddedInTextAlternativeElement: true\n });\n }\n }\n const summary = element.getAttribute("summary") || "";\n if (summary)\n return summary;\n }\n if (element.tagName === "AREA") {\n options.visitedElements.add(element);\n const alt = element.getAttribute("alt") || "";\n if (alt.trim())\n return alt;\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (element.tagName === "SVG" && element.ownerSVGElement) {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (child.tagName === "TITLE" && element.ownerSVGElement) {\n return getElementAccessibleNameInternal(child, {\n ...childOptions,\n embeddedInTextAlternativeElement: true\n });\n }\n }\n }\n }\n const allowsNameFromContent = ["button", "cell", "checkbox", "columnheader", "gridcell", "heading", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "radio", "row", "rowheader", "switch", "tab", "tooltip", "treeitem"].includes(role);\n if (allowsNameFromContent || options.embeddedInLabelledBy !== "none" || options.embeddedInLabel !== "none" || options.embeddedInTextAlternativeElement || options.embeddedInTargetElement === "descendant") {\n options.visitedElements.add(element);\n const tokens = [];\n const visit = (node) => {\n var _a;\n if (node.nodeType === 1) {\n const display = ((_a = getComputedStyle(node)) == null ? void 0 : _a.getPropertyValue("display")) || "inline";\n let token = getElementAccessibleNameInternal(node, childOptions);\n if (display !== "inline" || node.nodeName === "BR")\n token = " " + token + " ";\n tokens.push(token);\n } else if (node.nodeType === 3) {\n tokens.push(node.textContent || "");\n }\n };\n tokens.push(getPseudoContent(getComputedStyle(element, "::before")));\n for (let child = element.firstChild; child; child = child.nextSibling)\n visit(child);\n if (element.shadowRoot) {\n for (let child = element.shadowRoot.firstChild; child; child = child.nextSibling)\n visit(child);\n }\n for (const owned of getIdRefs(element, element.getAttribute("aria-owns")))\n visit(owned);\n tokens.push(getPseudoContent(getComputedStyle(element, "::after")));\n const accessibleName = tokens.join("");\n if (accessibleName.trim())\n return accessibleName;\n }\n if (!["presentation", "none"].includes(role) || element.tagName === "IFRAME") {\n options.visitedElements.add(element);\n const title = element.getAttribute("title") || "";\n if (title.trim())\n return title;\n }\n options.visitedElements.add(element);\n return "";\n}\nvar kAriaSelectedRoles = ["gridcell", "option", "row", "tab", "rowheader", "columnheader", "treeitem"];\nfunction getAriaSelected(element) {\n if (element.tagName === "OPTION")\n return element.selected;\n if (kAriaSelectedRoles.includes(getAriaRole(element) || ""))\n return getAriaBoolean(element.getAttribute("aria-selected")) === true;\n return false;\n}\nvar kAriaCheckedRoles = ["checkbox", "menuitemcheckbox", "option", "radio", "switch", "menuitemradio", "treeitem"];\nfunction getAriaChecked(element) {\n if (element.tagName === "INPUT" && element.indeterminate)\n return "mixed";\n if (element.tagName === "INPUT" && ["checkbox", "radio"].includes(element.type))\n return element.checked;\n if (kAriaCheckedRoles.includes(getAriaRole(element) || "")) {\n const checked = element.getAttribute("aria-checked");\n if (checked === "true")\n return true;\n if (checked === "mixed")\n return "mixed";\n }\n return false;\n}\nvar kAriaPressedRoles = ["button"];\nfunction getAriaPressed(element) {\n if (kAriaPressedRoles.includes(getAriaRole(element) || "")) {\n const pressed = element.getAttribute("aria-pressed");\n if (pressed === "true")\n return true;\n if (pressed === "mixed")\n return "mixed";\n }\n return false;\n}\nvar kAriaExpandedRoles = ["application", "button", "checkbox", "combobox", "gridcell", "link", "listbox", "menuitem", "row", "rowheader", "tab", "treeitem", "columnheader", "menuitemcheckbox", "menuitemradio", "rowheader", "switch"];\nfunction getAriaExpanded(element) {\n if (element.tagName === "DETAILS")\n return element.open;\n if (kAriaExpandedRoles.includes(getAriaRole(element) || ""))\n return getAriaBoolean(element.getAttribute("aria-expanded")) === true;\n return false;\n}\nvar kAriaLevelRoles = ["heading", "listitem", "row", "treeitem"];\nfunction getAriaLevel(element) {\n const native = { "H1": 1, "H2": 2, "H3": 3, "H4": 4, "H5": 5, "H6": 6 }[element.tagName];\n if (native)\n return native;\n if (kAriaLevelRoles.includes(getAriaRole(element) || "")) {\n const attr = element.getAttribute("aria-level");\n const value = attr === null ? Number.NaN : Number(attr);\n if (Number.isInteger(value) && value >= 1)\n return value;\n }\n return 0;\n}\nvar kAriaDisabledRoles = ["application", "button", "composite", "gridcell", "group", "input", "link", "menuitem", "scrollbar", "separator", "tab", "checkbox", "columnheader", "combobox", "grid", "listbox", "menu", "menubar", "menuitemcheckbox", "menuitemradio", "option", "radio", "radiogroup", "row", "rowheader", "searchbox", "select", "slider", "spinbutton", "switch", "tablist", "textbox", "toolbar", "tree", "treegrid", "treeitem"];\nfunction getAriaDisabled(element) {\n const isNativeFormControl = ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "OPTION", "OPTGROUP"].includes(element.tagName);\n if (isNativeFormControl && (element.hasAttribute("disabled") || belongsToDisabledFieldSet(element)))\n return true;\n return hasExplicitAriaDisabled(element);\n}\nfunction belongsToDisabledFieldSet(element) {\n if (!element)\n return false;\n if (element.tagName === "FIELDSET" && element.hasAttribute("disabled"))\n return true;\n return belongsToDisabledFieldSet(element.parentElement);\n}\nfunction hasExplicitAriaDisabled(element) {\n if (!element)\n return false;\n if (kAriaDisabledRoles.includes(getAriaRole(element) || "")) {\n const attribute = (element.getAttribute("aria-disabled") || "").toLowerCase();\n if (attribute === "true")\n return true;\n if (attribute === "false")\n return false;\n }\n return hasExplicitAriaDisabled(parentElementOrShadowHost(element));\n}\n\n// packages/playwright-core/src/server/injected/roleSelectorEngine.ts\nvar kSupportedAttributes = ["selected", "checked", "pressed", "expanded", "level", "disabled", "name", "include-hidden"];\nkSupportedAttributes.sort();\nfunction validateSupportedRole(attr, roles, role) {\n if (!roles.includes(role))\n throw new Error(`"${attr}" attribute is only supported for roles: ${roles.slice().sort().map((role2) => `"${role2}"`).join(", ")}`);\n}\nfunction validateSupportedValues(attr, values) {\n if (attr.op !== "" && !values.includes(attr.value))\n throw new Error(`"${attr.name}" must be one of ${values.map((v) => JSON.stringify(v)).join(", ")}`);\n}\nfunction validateSupportedOp(attr, ops) {\n if (!ops.includes(attr.op))\n throw new Error(`"${attr.name}" does not support "${attr.op}" matcher`);\n}\nfunction validateAttributes(attrs, role) {\n for (const attr of attrs) {\n switch (attr.name) {\n case "checked": {\n validateSupportedRole(attr.name, kAriaCheckedRoles, role);\n validateSupportedValues(attr, [true, false, "mixed"]);\n validateSupportedOp(attr, ["", "="]);\n if (attr.op === "") {\n attr.op = "=";\n attr.value = true;\n }\n break;\n }\n case "pressed": {\n validateSupportedRole(attr.name, kAriaPressedRoles, role);\n validateSupportedValues(attr, [true, false, "mixed"]);\n validateSupportedOp(attr, ["", "="]);\n if (attr.op === "") {\n attr.op = "=";\n attr.value = true;\n }\n break;\n }\n case "selected": {\n validateSupportedRole(attr.name, kAriaSelectedRoles, role);\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n break;\n }\n case "expanded": {\n validateSupportedRole(attr.name, kAriaExpandedRoles, role);\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n break;\n }\n case "level": {\n validateSupportedRole(attr.name, kAriaLevelRoles, role);\n if (typeof attr.value === "string")\n attr.value = +attr.value;\n if (attr.op !== "=" || typeof attr.value !== "number" || Number.isNaN(attr.value))\n throw new Error(`"level" attribute must be compared to a number`);\n break;\n }\n case "disabled": {\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n break;\n }\n case "name": {\n if (attr.op === "")\n throw new Error(`"name" attribute must have a value`);\n if (typeof attr.value !== "string" && !(attr.value instanceof RegExp))\n throw new Error(`"name" attribute must be a string or a regular expression`);\n break;\n }\n case "include-hidden": {\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n break;\n }\n default: {\n throw new Error(`Unknown attribute "${attr.name}", must be one of ${kSupportedAttributes.map((a) => `"${a}"`).join(", ")}.`);\n }\n }\n }\n}\nvar RoleEngine = {\n queryAll(scope, selector) {\n const parsed = parseAttributeSelector(selector, true);\n const role = parsed.name.toLowerCase();\n if (!role)\n throw new Error(`Role must not be empty`);\n validateAttributes(parsed.attributes, role);\n const hiddenCache = /* @__PURE__ */ new Map();\n const result = [];\n const match = (element) => {\n if (getAriaRole(element) !== role)\n return;\n let includeHidden = false;\n let nameAttr;\n for (const attr of parsed.attributes) {\n if (attr.name === "include-hidden") {\n includeHidden = attr.op === "" || !!attr.value;\n continue;\n }\n if (attr.name === "name") {\n nameAttr = attr;\n continue;\n }\n let actual;\n switch (attr.name) {\n case "selected":\n actual = getAriaSelected(element);\n break;\n case "checked":\n actual = getAriaChecked(element);\n break;\n case "pressed":\n actual = getAriaPressed(element);\n break;\n case "expanded":\n actual = getAriaExpanded(element);\n break;\n case "level":\n actual = getAriaLevel(element);\n break;\n case "disabled":\n actual = getAriaDisabled(element);\n break;\n }\n if (!matchesAttributePart(actual, attr))\n return;\n }\n if (!includeHidden) {\n const isHidden = isElementHiddenForAria(element, hiddenCache);\n if (isHidden)\n return;\n }\n if (nameAttr !== void 0) {\n const accessibleName = getElementAccessibleName(element, includeHidden, hiddenCache);\n if (!matchesAttributePart(accessibleName, nameAttr))\n return;\n }\n result.push(element);\n };\n const query = (root) => {\n const shadows = [];\n if (root.shadowRoot)\n shadows.push(root.shadowRoot);\n for (const element of root.querySelectorAll("*")) {\n match(element);\n if (element.shadowRoot)\n shadows.push(element.shadowRoot);\n }\n shadows.forEach(query);\n };\n query(scope);\n return result;\n }\n};\n\n// packages/playwright-core/src/server/injected/layoutSelectorUtils.ts\nfunction boxRightOf(box1, box2, maxDistance) {\n const distance = box1.left - box2.right;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxLeftOf(box1, box2, maxDistance) {\n const distance = box2.left - box1.right;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxAbove(box1, box2, maxDistance) {\n const distance = box2.top - box1.bottom;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxBelow(box1, box2, maxDistance) {\n const distance = box1.top - box2.bottom;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxNear(box1, box2, maxDistance) {\n const kThreshold = maxDistance === void 0 ? 50 : maxDistance;\n let score = 0;\n if (box1.left - box2.right >= 0)\n score += box1.left - box2.right;\n if (box2.left - box1.right >= 0)\n score += box2.left - box1.right;\n if (box2.top - box1.bottom >= 0)\n score += box2.top - box1.bottom;\n if (box1.top - box2.bottom >= 0)\n score += box1.top - box2.bottom;\n return score > kThreshold ? void 0 : score;\n}\nvar kLayoutSelectorNames = ["left-of", "right-of", "above", "below", "near"];\nfunction layoutSelectorScore(name, element, inner, maxDistance) {\n const box = element.getBoundingClientRect();\n const scorer = { "left-of": boxLeftOf, "right-of": boxRightOf, "above": boxAbove, "below": boxBelow, "near": boxNear }[name];\n let bestScore;\n for (const e of inner) {\n if (e === element)\n continue;\n const score = scorer(box, e.getBoundingClientRect(), maxDistance);\n if (score === void 0)\n continue;\n if (bestScore === void 0 || score < bestScore)\n bestScore = score;\n }\n return bestScore;\n}\n\n// packages/playwright-core/src/server/injected/selectorEvaluator.ts\nvar SelectorEvaluatorImpl = class {\n constructor(extraEngines) {\n this._engines = /* @__PURE__ */ new Map();\n this._cacheQueryCSS = /* @__PURE__ */ new Map();\n this._cacheMatches = /* @__PURE__ */ new Map();\n this._cacheQuery = /* @__PURE__ */ new Map();\n this._cacheMatchesSimple = /* @__PURE__ */ new Map();\n this._cacheMatchesParents = /* @__PURE__ */ new Map();\n this._cacheCallMatches = /* @__PURE__ */ new Map();\n this._cacheCallQuery = /* @__PURE__ */ new Map();\n this._cacheQuerySimple = /* @__PURE__ */ new Map();\n this._cacheText = /* @__PURE__ */ new Map();\n this._retainCacheCounter = 0;\n for (const [name, engine] of extraEngines)\n this._engines.set(name, engine);\n this._engines.set("not", notEngine);\n this._engines.set("is", isEngine);\n this._engines.set("where", isEngine);\n this._engines.set("has", hasEngine);\n this._engines.set("scope", scopeEngine);\n this._engines.set("light", lightEngine);\n this._engines.set("visible", visibleEngine);\n this._engines.set("text", textEngine);\n this._engines.set("text-is", textIsEngine);\n this._engines.set("text-matches", textMatchesEngine);\n this._engines.set("has-text", hasTextEngine);\n this._engines.set("right-of", createLayoutEngine("right-of"));\n this._engines.set("left-of", createLayoutEngine("left-of"));\n this._engines.set("above", createLayoutEngine("above"));\n this._engines.set("below", createLayoutEngine("below"));\n this._engines.set("near", createLayoutEngine("near"));\n this._engines.set("nth-match", nthMatchEngine);\n const allNames = [...this._engines.keys()];\n allNames.sort();\n const parserNames = [...customCSSNames];\n parserNames.sort();\n if (allNames.join("|") !== parserNames.join("|"))\n throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${allNames.join("|")} vs ${parserNames.join("|")}`);\n }\n begin() {\n ++this._retainCacheCounter;\n }\n end() {\n --this._retainCacheCounter;\n if (!this._retainCacheCounter) {\n this._cacheQueryCSS.clear();\n this._cacheMatches.clear();\n this._cacheQuery.clear();\n this._cacheMatchesSimple.clear();\n this._cacheMatchesParents.clear();\n this._cacheCallMatches.clear();\n this._cacheCallQuery.clear();\n this._cacheQuerySimple.clear();\n this._cacheText.clear();\n }\n }\n _cached(cache, main, rest, cb) {\n if (!cache.has(main))\n cache.set(main, []);\n const entries = cache.get(main);\n const entry = entries.find((e) => rest.every((value, index) => e.rest[index] === value));\n if (entry)\n return entry.result;\n const result = cb();\n entries.push({ rest, result });\n return result;\n }\n _checkSelector(s) {\n const wellFormed = typeof s === "object" && s && (Array.isArray(s) || "simples" in s && s.simples.length);\n if (!wellFormed)\n throw new Error(`Malformed selector "${s}"`);\n return s;\n }\n matches(element, s, context) {\n const selector = this._checkSelector(s);\n this.begin();\n try {\n return this._cached(this._cacheMatches, element, [selector, context.scope, context.pierceShadow], () => {\n if (Array.isArray(selector))\n return this._matchesEngine(isEngine, element, selector, context);\n if (!this._matchesSimple(element, selector.simples[selector.simples.length - 1].selector, context))\n return false;\n return this._matchesParents(element, selector, selector.simples.length - 2, context);\n });\n } finally {\n this.end();\n }\n }\n query(context, s) {\n const selector = this._checkSelector(s);\n this.begin();\n try {\n return this._cached(this._cacheQuery, selector, [context.scope, context.pierceShadow], () => {\n if (Array.isArray(selector))\n return this._queryEngine(isEngine, context, selector);\n const previousScoreMap = this._scoreMap;\n this._scoreMap = /* @__PURE__ */ new Map();\n let elements = this._querySimple(context, selector.simples[selector.simples.length - 1].selector);\n elements = elements.filter((element) => this._matchesParents(element, selector, selector.simples.length - 2, context));\n if (this._scoreMap.size) {\n elements.sort((a, b) => {\n const aScore = this._scoreMap.get(a);\n const bScore = this._scoreMap.get(b);\n if (aScore === bScore)\n return 0;\n if (aScore === void 0)\n return 1;\n if (bScore === void 0)\n return -1;\n return aScore - bScore;\n });\n }\n this._scoreMap = previousScoreMap;\n return elements;\n });\n } finally {\n this.end();\n }\n }\n _markScore(element, score) {\n if (this._scoreMap)\n this._scoreMap.set(element, score);\n }\n _matchesSimple(element, simple, context) {\n return this._cached(this._cacheMatchesSimple, element, [simple, context.scope, context.pierceShadow], () => {\n const isPossiblyScopeClause = simple.functions.some((f) => f.name === "scope" || f.name === "is");\n if (!isPossiblyScopeClause && element === context.scope)\n return false;\n if (simple.css && !this._matchesCSS(element, simple.css))\n return false;\n for (const func of simple.functions) {\n if (!this._matchesEngine(this._getEngine(func.name), element, func.args, context))\n return false;\n }\n return true;\n });\n }\n _querySimple(context, simple) {\n if (!simple.functions.length)\n return this._queryCSS(context, simple.css || "*");\n return this._cached(this._cacheQuerySimple, simple, [context.scope, context.pierceShadow], () => {\n let css2 = simple.css;\n const funcs = simple.functions;\n if (css2 === "*" && funcs.length)\n css2 = void 0;\n let elements;\n let firstIndex = -1;\n if (css2 !== void 0) {\n elements = this._queryCSS(context, css2);\n const hasScopeClause = funcs.some((f) => f.name === "scope");\n if (hasScopeClause && context.scope.nodeType === 1)\n elements.unshift(context.scope);\n } else {\n firstIndex = funcs.findIndex((func) => this._getEngine(func.name).query !== void 0);\n if (firstIndex === -1)\n firstIndex = 0;\n elements = this._queryEngine(this._getEngine(funcs[firstIndex].name), context, funcs[firstIndex].args);\n }\n for (let i = 0; i < funcs.length; i++) {\n if (i === firstIndex)\n continue;\n const engine = this._getEngine(funcs[i].name);\n if (engine.matches !== void 0)\n elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n }\n for (let i = 0; i < funcs.length; i++) {\n if (i === firstIndex)\n continue;\n const engine = this._getEngine(funcs[i].name);\n if (engine.matches === void 0)\n elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n }\n return elements;\n });\n }\n _matchesParents(element, complex, index, context) {\n if (index < 0)\n return true;\n return this._cached(this._cacheMatchesParents, element, [complex, index, context.scope, context.pierceShadow], () => {\n const { selector: simple, combinator } = complex.simples[index];\n if (combinator === ">") {\n const parent = parentElementOrShadowHostInContext(element, context);\n if (!parent || !this._matchesSimple(parent, simple, context))\n return false;\n return this._matchesParents(parent, complex, index - 1, context);\n }\n if (combinator === "+") {\n const previousSibling = previousSiblingInContext(element, context);\n if (!previousSibling || !this._matchesSimple(previousSibling, simple, context))\n return false;\n return this._matchesParents(previousSibling, complex, index - 1, context);\n }\n if (combinator === "") {\n let parent = parentElementOrShadowHostInContext(element, context);\n while (parent) {\n if (this._matchesSimple(parent, simple, context)) {\n if (this._matchesParents(parent, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === "")\n break;\n }\n parent = parentElementOrShadowHostInContext(parent, context);\n }\n return false;\n }\n if (combinator === "~") {\n let previousSibling = previousSiblingInContext(element, context);\n while (previousSibling) {\n if (this._matchesSimple(previousSibling, simple, context)) {\n if (this._matchesParents(previousSibling, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === "~")\n break;\n }\n previousSibling = previousSiblingInContext(previousSibling, context);\n }\n return false;\n }\n if (combinator === ">=") {\n let parent = element;\n while (parent) {\n if (this._matchesSimple(parent, simple, context)) {\n if (this._matchesParents(parent, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === "")\n break;\n }\n parent = parentElementOrShadowHostInContext(parent, context);\n }\n return false;\n }\n throw new Error(`Unsupported combinator "${combinator}"`);\n });\n }\n _matchesEngine(engine, element, args, context) {\n if (engine.matches)\n return this._callMatches(engine, element, args, context);\n if (engine.query)\n return this._callQuery(engine, args, context).includes(element);\n throw new Error(`Selector engine should implement "matches" or "query"`);\n }\n _queryEngine(engine, context, args) {\n if (engine.query)\n return this._callQuery(engine, args, context);\n if (engine.matches)\n return this._queryCSS(context, "*").filter((element) => this._callMatches(engine, element, args, context));\n throw new Error(`Selector engine should implement "matches" or "query"`);\n }\n _callMatches(engine, element, args, context) {\n return this._cached(this._cacheCallMatches, element, [engine, context.scope, context.pierceShadow, ...args], () => {\n return engine.matches(element, args, context, this);\n });\n }\n _callQuery(engine, args, context) {\n return this._cached(this._cacheCallQuery, engine, [context.scope, context.pierceShadow, ...args], () => {\n return engine.query(context, args, this);\n });\n }\n _matchesCSS(element, css2) {\n return element.matches(css2);\n }\n _queryCSS(context, css2) {\n return this._cached(this._cacheQueryCSS, css2, [context.scope, context.pierceShadow], () => {\n let result = [];\n function query(root) {\n result = result.concat([...root.querySelectorAll(css2)]);\n if (!context.pierceShadow)\n return;\n if (root.shadowRoot)\n query(root.shadowRoot);\n for (const element of root.querySelectorAll("*")) {\n if (element.shadowRoot)\n query(element.shadowRoot);\n }\n }\n query(context.scope);\n return result;\n });\n }\n _getEngine(name) {\n const engine = this._engines.get(name);\n if (!engine)\n throw new Error(`Unknown selector engine "${name}"`);\n return engine;\n }\n};\nvar isEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`"is" engine expects non-empty selector list`);\n return args.some((selector) => evaluator.matches(element, selector, context));\n },\n query(context, args, evaluator) {\n if (args.length === 0)\n throw new Error(`"is" engine expects non-empty selector list`);\n let elements = [];\n for (const arg of args)\n elements = elements.concat(evaluator.query(context, arg));\n return args.length === 1 ? elements : sortInDOMOrder(elements);\n }\n};\nvar hasEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`"has" engine expects non-empty selector list`);\n return evaluator.query({ ...context, scope: element }, args).length > 0;\n }\n};\nvar scopeEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 0)\n throw new Error(`"scope" engine expects no arguments`);\n if (context.scope.nodeType === 9)\n return element === context.scope.documentElement;\n return element === context.scope;\n },\n query(context, args, evaluator) {\n if (args.length !== 0)\n throw new Error(`"scope" engine expects no arguments`);\n if (context.scope.nodeType === 9) {\n const root = context.scope.documentElement;\n return root ? [root] : [];\n }\n if (context.scope.nodeType === 1)\n return [context.scope];\n return [];\n }\n};\nvar notEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`"not" engine expects non-empty selector list`);\n return !evaluator.matches(element, args, context);\n }\n};\nvar lightEngine = {\n query(context, args, evaluator) {\n return evaluator.query({ ...context, pierceShadow: false }, args);\n },\n matches(element, args, context, evaluator) {\n return evaluator.matches(element, args, { ...context, pierceShadow: false });\n }\n};\nvar visibleEngine = {\n matches(element, args, context, evaluator) {\n if (args.length)\n throw new Error(`"visible" engine expects no arguments`);\n return isElementVisible(element);\n }\n};\nvar textEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== "string")\n throw new Error(`"text" engine expects a single string`);\n const matcher = createLaxTextMatcher(args[0]);\n return elementMatchesText(evaluator._cacheText, element, matcher) === "self";\n }\n};\nvar textIsEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== "string")\n throw new Error(`"text-is" engine expects a single string`);\n const matcher = createStrictTextMatcher(args[0]);\n return elementMatchesText(evaluator._cacheText, element, matcher) !== "none";\n }\n};\nvar textMatchesEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0 || typeof args[0] !== "string" || args.length > 2 || args.length === 2 && typeof args[1] !== "string")\n throw new Error(`"text-matches" engine expects a regexp body and optional regexp flags`);\n const matcher = createRegexTextMatcher(args[0], args.length === 2 ? args[1] : void 0);\n return elementMatchesText(evaluator._cacheText, element, matcher) === "self";\n }\n};\nvar hasTextEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== "string")\n throw new Error(`"has-text" engine expects a single string`);\n if (shouldSkipForTextMatching(element))\n return false;\n const matcher = createLaxTextMatcher(args[0]);\n return matcher(elementText(evaluator._cacheText, element));\n }\n};\nfunction createLayoutEngine(name) {\n return {\n matches(element, args, context, evaluator) {\n const maxDistance = args.length && typeof args[args.length - 1] === "number" ? args[args.length - 1] : void 0;\n const queryArgs = maxDistance === void 0 ? args : args.slice(0, args.length - 1);\n if (args.length < 1 + (maxDistance === void 0 ? 0 : 1))\n throw new Error(`"${name}" engine expects a selector list and optional maximum distance in pixels`);\n const inner = evaluator.query(context, queryArgs);\n const score = layoutSelectorScore(name, element, inner, maxDistance);\n if (score === void 0)\n return false;\n evaluator._markScore(element, score);\n return true;\n }\n };\n}\nvar nthMatchEngine = {\n query(context, args, evaluator) {\n let index = args[args.length - 1];\n if (args.length < 2)\n throw new Error(`"nth-match" engine expects non-empty selector list and an index argument`);\n if (typeof index !== "number" || index < 1)\n throw new Error(`"nth-match" engine expects a one-based index as the last argument`);\n const elements = isEngine.query(context, args.slice(0, args.length - 1), evaluator);\n index--;\n return index < elements.length ? [elements[index]] : [];\n }\n};\nfunction parentElementOrShadowHostInContext(element, context) {\n if (element === context.scope)\n return;\n if (!context.pierceShadow)\n return element.parentElement || void 0;\n return parentElementOrShadowHost(element);\n}\nfunction previousSiblingInContext(element, context) {\n if (element === context.scope)\n return;\n return element.previousElementSibling || void 0;\n}\nfunction sortInDOMOrder(elements) {\n const elementToEntry = /* @__PURE__ */ new Map();\n const roots = [];\n const result = [];\n function append(element) {\n let entry = elementToEntry.get(element);\n if (entry)\n return entry;\n const parent = parentElementOrShadowHost(element);\n if (parent) {\n const parentEntry = append(parent);\n parentEntry.children.push(element);\n } else {\n roots.push(element);\n }\n entry = { children: [], taken: false };\n elementToEntry.set(element, entry);\n return entry;\n }\n elements.forEach((e) => append(e).taken = true);\n function visit(element) {\n const entry = elementToEntry.get(element);\n if (entry.taken)\n result.push(element);\n if (entry.children.length > 1) {\n const set = new Set(entry.children);\n entry.children = [];\n let child = element.firstElementChild;\n while (child && entry.children.length < set.size) {\n if (set.has(child))\n entry.children.push(child);\n child = child.nextElementSibling;\n }\n child = element.shadowRoot ? element.shadowRoot.firstElementChild : null;\n while (child && entry.children.length < set.size) {\n if (set.has(child))\n entry.children.push(child);\n child = child.nextElementSibling;\n }\n }\n entry.children.forEach(visit);\n }\n roots.forEach(visit);\n return result;\n}\n\n// packages/playwright-core/src/server/injected/selectorGenerator.ts\nvar cacheAllowText = /* @__PURE__ */ new Map();\nvar cacheDisallowText = /* @__PURE__ */ new Map();\nvar kNthScore = 1e3;\nfunction generateSelector(injectedScript, targetElement, strict) {\n injectedScript._evaluator.begin();\n try {\n targetElement = targetElement.closest("button,select,input,[role=button],[role=checkbox],[role=radio]") || targetElement;\n const targetTokens = generateSelectorFor(injectedScript, targetElement, strict);\n const bestTokens = targetTokens || cssFallback(injectedScript, targetElement, strict);\n const selector = joinTokens(bestTokens);\n const parsedSelector = injectedScript.parseSelector(selector);\n return {\n selector,\n elements: injectedScript.querySelectorAll(parsedSelector, targetElement.ownerDocument)\n };\n } finally {\n cacheAllowText.clear();\n cacheDisallowText.clear();\n injectedScript._evaluator.end();\n }\n}\nfunction filterRegexTokens(textCandidates) {\n return textCandidates.filter((c) => c[0].selector[0] !== "/");\n}\nfunction generateSelectorFor(injectedScript, targetElement, strict) {\n if (targetElement.ownerDocument.documentElement === targetElement)\n return [{ engine: "css", selector: "html", score: 1 }];\n const calculate = (element, allowText) => {\n const allowNthMatch = element === targetElement;\n let textCandidates = allowText ? buildTextCandidates(injectedScript, element, element === targetElement).map((token) => [token]) : [];\n if (element !== targetElement) {\n textCandidates = filterRegexTokens(textCandidates);\n }\n const noTextCandidates = buildCandidates(injectedScript, element).map((token) => [token]);\n let result = chooseFirstSelector(injectedScript, targetElement.ownerDocument, element, [...textCandidates, ...noTextCandidates], allowNthMatch, strict);\n textCandidates = filterRegexTokens(textCandidates);\n const checkWithText = (textCandidatesToUse) => {\n const allowParentText = allowText && !textCandidatesToUse.length;\n const candidates = [...textCandidatesToUse, ...noTextCandidates].filter((c) => {\n if (!result)\n return true;\n return combineScores(c) < combineScores(result);\n });\n let bestPossibleInParent = candidates[0];\n if (!bestPossibleInParent)\n return;\n for (let parent = parentElementOrShadowHost2(element); parent; parent = parentElementOrShadowHost2(parent)) {\n const parentTokens = calculateCached(parent, allowParentText);\n if (!parentTokens)\n continue;\n if (result && combineScores([...parentTokens, ...bestPossibleInParent]) >= combineScores(result))\n continue;\n bestPossibleInParent = chooseFirstSelector(injectedScript, parent, element, candidates, allowNthMatch, strict);\n if (!bestPossibleInParent)\n return;\n const combined = [...parentTokens, ...bestPossibleInParent];\n if (!result || combineScores(combined) < combineScores(result))\n result = combined;\n }\n };\n checkWithText(textCandidates);\n if (element === targetElement && textCandidates.length)\n checkWithText([]);\n return result;\n };\n const calculateCached = (element, allowText) => {\n const cache = allowText ? cacheAllowText : cacheDisallowText;\n let value = cache.get(element);\n if (value === void 0) {\n value = calculate(element, allowText);\n cache.set(element, value);\n }\n return value;\n };\n return calculateCached(targetElement, true);\n}\nfunction buildCandidates(injectedScript, element) {\n const candidates = [];\n for (const attribute of ["data-testid", "data-test-id", "data-test"]) {\n if (element.getAttribute(attribute))\n candidates.push({ engine: "css", selector: `[${attribute}=${quoteAttributeValue(element.getAttribute(attribute))}]`, score: 1 });\n }\n if (element.nodeName === "INPUT") {\n const input = element;\n if (input.placeholder)\n candidates.push({ engine: "css", selector: `[placeholder=${quoteAttributeValue(input.placeholder)}]`, score: 10 });\n }\n if (element.getAttribute("aria-label"))\n candidates.push({ engine: "css", selector: `[aria-label=${quoteAttributeValue(element.getAttribute("aria-label"))}]`, score: 10 });\n if (element.getAttribute("alt") && ["APPLET", "AREA", "IMG", "INPUT"].includes(element.nodeName))\n candidates.push({ engine: "css", selector: `${cssEscape(element.nodeName.toLowerCase())}[alt=${quoteAttributeValue(element.getAttribute("alt"))}]`, score: 10 });\n if (element.getAttribute("role"))\n candidates.push({ engine: "css", selector: `${cssEscape(element.nodeName.toLowerCase())}[role=${quoteAttributeValue(element.getAttribute("role"))}]`, score: 50 });\n if (element.getAttribute("name") && ["BUTTON", "FORM", "FIELDSET", "IFRAME", "INPUT", "KEYGEN", "OBJECT", "OUTPUT", "SELECT", "TEXTAREA", "MAP", "META", "PARAM"].includes(element.nodeName))\n candidates.push({ engine: "css", selector: `${cssEscape(element.nodeName.toLowerCase())}[name=${quoteAttributeValue(element.getAttribute("name"))}]`, score: 50 });\n if (["INPUT", "TEXTAREA"].includes(element.nodeName) && element.getAttribute("type") !== "hidden") {\n if (element.getAttribute("type"))\n candidates.push({ engine: "css", selector: `${cssEscape(element.nodeName.toLowerCase())}[type=${quoteAttributeValue(element.getAttribute("type"))}]`, score: 50 });\n }\n if (["INPUT", "TEXTAREA", "SELECT"].includes(element.nodeName))\n candidates.push({ engine: "css", selector: cssEscape(element.nodeName.toLowerCase()), score: 50 });\n const idAttr = element.getAttribute("id");\n if (idAttr && !isGuidLike(idAttr))\n candidates.push({ engine: "css", selector: makeSelectorForId(idAttr), score: 100 });\n candidates.push({ engine: "css", selector: cssEscape(element.nodeName.toLowerCase()), score: 200 });\n return candidates;\n}\nfunction buildTextCandidates(injectedScript, element, allowHasText) {\n if (element.nodeName === "SELECT")\n return [];\n const text = elementText(injectedScript._evaluator._cacheText, element).full.trim().replace(/\\s+/g, " ").substring(0, 80);\n if (!text)\n return [];\n const candidates = [];\n let escaped = text;\n if (text.includes(\'"\') || text.includes(">>") || text[0] === "/")\n escaped = `/.*${escapeForRegex(text)}.*/`;\n candidates.push({ engine: "text", selector: escaped, score: 10 });\n if (allowHasText && escaped === text) {\n let prefix = element.nodeName.toLowerCase();\n if (element.hasAttribute("role"))\n prefix += `[role=${quoteAttributeValue(element.getAttribute("role"))}]`;\n candidates.push({ engine: "css", selector: `${prefix}:has-text("${text}")`, score: 30 });\n }\n return candidates;\n}\nfunction parentElementOrShadowHost2(element) {\n if (element.parentElement)\n return element.parentElement;\n if (!element.parentNode)\n return null;\n if (element.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE && element.parentNode.host)\n return element.parentNode.host;\n return null;\n}\nfunction makeSelectorForId(id) {\n return /^[a-zA-Z][a-zA-Z0-9\\-\\_]+$/.test(id) ? "#" + id : `[id="${cssEscape(id)}"]`;\n}\nfunction cssFallback(injectedScript, targetElement, strict) {\n const kFallbackScore = 1e7;\n const root = targetElement.ownerDocument;\n const tokens = [];\n function uniqueCSSSelector(prefix) {\n const path = tokens.slice();\n if (prefix)\n path.unshift(prefix);\n const selector = path.join(" > ");\n const parsedSelector = injectedScript.parseSelector(selector);\n const node = injectedScript.querySelector(parsedSelector, targetElement.ownerDocument, false);\n return node === targetElement ? selector : void 0;\n }\n function makeStrict(selector) {\n const token = { engine: "css", selector, score: kFallbackScore };\n if (!strict)\n return [token];\n const parsedSelector = injectedScript.parseSelector(selector);\n const elements = injectedScript.querySelectorAll(parsedSelector, targetElement.ownerDocument);\n if (elements.length === 1)\n return [token];\n const nth = { engine: "nth", selector: String(elements.indexOf(targetElement)), score: kNthScore };\n return [token, nth];\n }\n for (let element = targetElement; element && element !== root; element = parentElementOrShadowHost2(element)) {\n const nodeName = element.nodeName.toLowerCase();\n let bestTokenForLevel = "";\n if (element.id) {\n const token = makeSelectorForId(element.id);\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n bestTokenForLevel = token;\n }\n const parent = element.parentNode;\n const classes = [...element.classList];\n for (let i = 0; i < classes.length; ++i) {\n const token = "." + classes.slice(0, i + 1).join(".");\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n if (!bestTokenForLevel && parent) {\n const sameClassSiblings = parent.querySelectorAll(token);\n if (sameClassSiblings.length === 1)\n bestTokenForLevel = token;\n }\n }\n if (parent) {\n const siblings = [...parent.children];\n const sameTagSiblings = siblings.filter((sibling) => sibling.nodeName.toLowerCase() === nodeName);\n const token = sameTagSiblings.indexOf(element) === 0 ? cssEscape(nodeName) : `${cssEscape(nodeName)}:nth-child(${1 + siblings.indexOf(element)})`;\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n if (!bestTokenForLevel)\n bestTokenForLevel = token;\n } else if (!bestTokenForLevel) {\n bestTokenForLevel = nodeName;\n }\n tokens.unshift(bestTokenForLevel);\n }\n return makeStrict(uniqueCSSSelector());\n}\nfunction escapeForRegex(text) {\n return text.replace(/[.*+?^>${}()|[\\]\\\\]/g, "\\\\$&");\n}\nfunction quoteAttributeValue(text) {\n return `"${cssEscape(text).replace(/\\\\ /g, " ")}"`;\n}\nfunction joinTokens(tokens) {\n const parts = [];\n let lastEngine = "";\n for (const { engine, selector } of tokens) {\n if (parts.length && (lastEngine !== "css" || engine !== "css" || selector.startsWith(":nth-match(")))\n parts.push(">>");\n lastEngine = engine;\n if (engine === "css")\n parts.push(selector);\n else\n parts.push(`${engine}=${selector}`);\n }\n return parts.join(" ");\n}\nfunction combineScores(tokens) {\n let score = 0;\n for (let i = 0; i < tokens.length; i++)\n score += tokens[i].score * (tokens.length - i);\n return score;\n}\nfunction chooseFirstSelector(injectedScript, scope, targetElement, selectors, allowNthMatch, strict) {\n const joined = selectors.map((tokens) => ({ tokens, score: combineScores(tokens) }));\n joined.sort((a, b) => a.score - b.score);\n let bestWithIndex = null;\n for (const { tokens } of joined) {\n const parsedSelector = injectedScript.parseSelector(joinTokens(tokens));\n const result = injectedScript.querySelectorAll(parsedSelector, scope);\n const isStrictEnough = !strict || result.length === 1;\n const index = result.indexOf(targetElement);\n if (index === 0 && isStrictEnough) {\n return tokens;\n }\n if (!allowNthMatch || bestWithIndex || index === -1 || result.length > 5)\n continue;\n const nth = { engine: "nth", selector: String(index), score: kNthScore };\n bestWithIndex = [...tokens, nth];\n }\n return bestWithIndex;\n}\nfunction isGuidLike(id) {\n let lastCharacterType;\n let transitionCount = 0;\n for (let i = 0; i < id.length; ++i) {\n const c = id[i];\n let characterType;\n if (c === "-" || c === "_")\n continue;\n if (c >= "a" && c <= "z")\n characterType = "lower";\n else if (c >= "A" && c <= "Z")\n characterType = "upper";\n else if (c >= "0" && c <= "9")\n characterType = "digit";\n else\n characterType = "other";\n if (characterType === "lower" && lastCharacterType === "upper") {\n lastCharacterType = characterType;\n continue;\n }\n if (lastCharacterType && lastCharacterType !== characterType)\n ++transitionCount;\n lastCharacterType = characterType;\n }\n return transitionCount >= id.length / 4;\n}\nfunction cssEscape(s) {\n let result = "";\n for (let i = 0; i < s.length; i++)\n result += cssEscapeOne(s, i);\n return result;\n}\nfunction cssEscapeOne(s, i) {\n const c = s.charCodeAt(i);\n if (c === 0)\n return "\\uFFFD";\n if (c >= 1 && c <= 31 || c >= 48 && c <= 57 && (i === 0 || i === 1 && s.charCodeAt(0) === 45))\n return "\\\\" + c.toString(16) + " ";\n if (i === 0 && c === 45 && s.length === 1)\n return "\\\\" + s.charAt(i);\n if (c >= 128 || c === 45 || c === 95 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122)\n return s.charAt(i);\n return "\\\\" + s.charAt(i);\n}\n\n// packages/playwright-core/src/server/injected/highlight.ts\nvar Highlight = class {\n constructor(isUnderTest) {\n this._highlightElements = [];\n this._isUnderTest = isUnderTest;\n this._outerGlassPaneElement = document.createElement("x-pw-glass");\n this._outerGlassPaneElement.style.position = "fixed";\n this._outerGlassPaneElement.style.top = "0";\n this._outerGlassPaneElement.style.right = "0";\n this._outerGlassPaneElement.style.bottom = "0";\n this._outerGlassPaneElement.style.left = "0";\n this._outerGlassPaneElement.style.zIndex = "2147483647";\n this._outerGlassPaneElement.style.pointerEvents = "none";\n this._outerGlassPaneElement.style.display = "flex";\n this._tooltipElement = document.createElement("x-pw-tooltip");\n this._actionPointElement = document.createElement("x-pw-action-point");\n this._actionPointElement.setAttribute("hidden", "true");\n this._innerGlassPaneElement = document.createElement("x-pw-glass-inner");\n this._innerGlassPaneElement.style.flex = "auto";\n this._innerGlassPaneElement.appendChild(this._tooltipElement);\n this._glassPaneShadow = this._outerGlassPaneElement.attachShadow({ mode: isUnderTest ? "open" : "closed" });\n this._glassPaneShadow.appendChild(this._innerGlassPaneElement);\n this._glassPaneShadow.appendChild(this._actionPointElement);\n const styleElement = document.createElement("style");\n styleElement.textContent = `\n x-pw-tooltip {\n align-items: center;\n backdrop-filter: blur(5px);\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 2px;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 3.6px 3.7px,\n rgba(0, 0, 0, 0.15) 0px 12.1px 12.3px,\n rgba(0, 0, 0, 0.1) 0px -2px 4px,\n rgba(0, 0, 0, 0.15) 0px -12.1px 24px,\n rgba(0, 0, 0, 0.25) 0px 54px 55px;\n color: rgb(204, 204, 204);\n display: none;\n font-family: \'Dank Mono\', \'Operator Mono\', Inconsolata, \'Fira Mono\',\n \'SF Mono\', Monaco, \'Droid Sans Mono\', \'Source Code Pro\', monospace;\n font-size: 12.8px;\n font-weight: normal;\n left: 0;\n line-height: 1.5;\n max-width: 600px;\n padding: 3.2px 5.12px 3.2px;\n position: absolute;\n top: 0;\n }\n x-pw-action-point {\n position: absolute;\n width: 20px;\n height: 20px;\n background: red;\n border-radius: 10px;\n pointer-events: none;\n margin: -10px 0 0 -10px;\n z-index: 2;\n }\n *[hidden] {\n display: none !important;\n }\n `;\n this._glassPaneShadow.appendChild(styleElement);\n }\n install() {\n document.documentElement.appendChild(this._outerGlassPaneElement);\n }\n uninstall() {\n this._outerGlassPaneElement.remove();\n }\n isInstalled() {\n return this._outerGlassPaneElement.parentElement === document.documentElement && !this._outerGlassPaneElement.nextElementSibling;\n }\n showActionPoint(x, y) {\n this._actionPointElement.style.top = y + "px";\n this._actionPointElement.style.left = x + "px";\n this._actionPointElement.hidden = false;\n if (this._isUnderTest)\n console.error("Action point for test: " + JSON.stringify({ x, y }));\n }\n hideActionPoint() {\n this._actionPointElement.hidden = true;\n }\n updateHighlight(elements, selector, isRecording) {\n this._tooltipElement.textContent = selector;\n this._tooltipElement.style.top = "0";\n this._tooltipElement.style.left = "0";\n this._tooltipElement.style.display = "flex";\n const boxes = elements.map((e) => e.getBoundingClientRect());\n const tooltipWidth = this._tooltipElement.offsetWidth;\n const tooltipHeight = this._tooltipElement.offsetHeight;\n const totalWidth = this._innerGlassPaneElement.offsetWidth;\n const totalHeight = this._innerGlassPaneElement.offsetHeight;\n if (boxes.length) {\n const primaryBox = boxes[0];\n let anchorLeft = primaryBox.left;\n if (anchorLeft + tooltipWidth > totalWidth - 5)\n anchorLeft = totalWidth - tooltipWidth - 5;\n let anchorTop = primaryBox.bottom + 5;\n if (anchorTop + tooltipHeight > totalHeight - 5) {\n if (primaryBox.top > tooltipHeight + 5) {\n anchorTop = primaryBox.top - tooltipHeight - 5;\n } else {\n anchorTop = totalHeight - 5 - tooltipHeight;\n }\n }\n this._tooltipElement.style.top = anchorTop + "px";\n this._tooltipElement.style.left = anchorLeft + "px";\n } else {\n this._tooltipElement.style.display = "none";\n }\n const pool = this._highlightElements;\n this._highlightElements = [];\n for (const box of boxes) {\n const highlightElement = pool.length ? pool.shift() : this._createHighlightElement();\n const color = isRecording ? "#dc6f6f7f" : "#6fa8dc7f";\n highlightElement.style.backgroundColor = this._highlightElements.length ? "#f6b26b7f" : color;\n highlightElement.style.left = box.x + "px";\n highlightElement.style.top = box.y + "px";\n highlightElement.style.width = box.width + "px";\n highlightElement.style.height = box.height + "px";\n highlightElement.style.display = "block";\n this._highlightElements.push(highlightElement);\n if (this._isUnderTest)\n console.error("Highlight box for test: " + JSON.stringify({ x: box.x, y: box.y, width: box.width, height: box.height }));\n }\n for (const highlightElement of pool) {\n highlightElement.style.display = "none";\n this._highlightElements.push(highlightElement);\n }\n }\n maskElements(elements) {\n const boxes = elements.map((e) => e.getBoundingClientRect());\n const pool = this._highlightElements;\n this._highlightElements = [];\n for (const box of boxes) {\n const highlightElement = pool.length ? pool.shift() : this._createHighlightElement();\n highlightElement.style.backgroundColor = "#F0F";\n highlightElement.style.left = box.x + "px";\n highlightElement.style.top = box.y + "px";\n highlightElement.style.width = box.width + "px";\n highlightElement.style.height = box.height + "px";\n highlightElement.style.display = "block";\n this._highlightElements.push(highlightElement);\n }\n for (const highlightElement of pool) {\n highlightElement.style.display = "none";\n this._highlightElements.push(highlightElement);\n }\n }\n _createHighlightElement() {\n const highlightElement = document.createElement("x-pw-highlight");\n highlightElement.style.position = "absolute";\n highlightElement.style.top = "0";\n highlightElement.style.left = "0";\n highlightElement.style.width = "0";\n highlightElement.style.height = "0";\n highlightElement.style.boxSizing = "border-box";\n this._glassPaneShadow.appendChild(highlightElement);\n return highlightElement;\n }\n};\n\n// packages/playwright-core/src/server/injected/injectedScript.ts\nvar InjectedScript = class {\n constructor(isUnderTest, stableRafCount, browserName, experimentalFeaturesEnabled, customEngines) {\n this.onGlobalListenersRemoved = /* @__PURE__ */ new Set();\n this.isUnderTest = isUnderTest;\n this._evaluator = new SelectorEvaluatorImpl(/* @__PURE__ */ new Map());\n this._engines = /* @__PURE__ */ new Map();\n this._engines.set("xpath", XPathEngine);\n this._engines.set("xpath:light", XPathEngine);\n this._engines.set("_react", ReactEngine);\n this._engines.set("_vue", VueEngine);\n this._engines.set("role", RoleEngine);\n this._engines.set("text", this._createTextEngine(true));\n this._engines.set("text:light", this._createTextEngine(false));\n this._engines.set("id", this._createAttributeEngine("id", true));\n this._engines.set("id:light", this._createAttributeEngine("id", false));\n this._engines.set("data-testid", this._createAttributeEngine("data-testid", true));\n this._engines.set("data-testid:light", this._createAttributeEngine("data-testid", false));\n this._engines.set("data-test-id", this._createAttributeEngine("data-test-id", true));\n this._engines.set("data-test-id:light", this._createAttributeEngine("data-test-id", false));\n this._engines.set("data-test", this._createAttributeEngine("data-test", true));\n this._engines.set("data-test:light", this._createAttributeEngine("data-test", false));\n this._engines.set("css", this._createCSSEngine());\n this._engines.set("nth", { queryAll: () => [] });\n this._engines.set("visible", this._createVisibleEngine());\n this._engines.set("control", this._createControlEngine());\n this._engines.set("has", this._createHasEngine());\n for (const { name, engine } of customEngines)\n this._engines.set(name, engine);\n this._stableRafCount = stableRafCount;\n this._browserName = browserName;\n this._setupGlobalListenersRemovalDetection();\n this._setupHitTargetInterceptors();\n if (isUnderTest)\n window.__injectedScript = this;\n }\n eval(expression) {\n return globalThis.eval(expression);\n }\n parseSelector(selector) {\n const result = parseSelector(selector);\n for (const name of allEngineNames(result)) {\n if (!this._engines.has(name))\n throw this.createStacklessError(`Unknown engine "${name}" while parsing selector ${selector}`);\n }\n return result;\n }\n generateSelector(targetElement) {\n return generateSelector(this, targetElement, true).selector;\n }\n querySelector(selector, root, strict) {\n const result = this.querySelectorAll(selector, root);\n if (strict && result.length > 1)\n throw this.strictModeViolationError(selector, result);\n return result[0];\n }\n _queryNth(elements, part) {\n const list = [...elements];\n let nth = +part.body;\n if (nth === -1)\n nth = list.length - 1;\n return new Set(list.slice(nth, nth + 1));\n }\n _queryLayoutSelector(elements, part, originalRoot) {\n const name = part.name;\n const body = part.body;\n const result = [];\n const inner = this.querySelectorAll(body.parsed, originalRoot);\n for (const element of elements) {\n const score = layoutSelectorScore(name, element, inner, body.distance);\n if (score !== void 0)\n result.push({ element, score });\n }\n result.sort((a, b) => a.score - b.score);\n return new Set(result.map((r) => r.element));\n }\n querySelectorAll(selector, root) {\n if (selector.capture !== void 0) {\n if (selector.parts.some((part) => part.name === "nth"))\n throw this.createStacklessError(`Can\'t query n-th element in a request with the capture.`);\n const withHas = { parts: selector.parts.slice(0, selector.capture + 1) };\n if (selector.capture < selector.parts.length - 1) {\n const parsed = { parts: selector.parts.slice(selector.capture + 1) };\n const has = { name: "has", body: { parsed }, source: stringifySelector(parsed) };\n withHas.parts.push(has);\n }\n return this.querySelectorAll(withHas, root);\n }\n if (!root["querySelectorAll"])\n throw this.createStacklessError("Node is not queryable.");\n if (selector.capture !== void 0) {\n throw this.createStacklessError("Internal error: there should not be a capture in the selector.");\n }\n this._evaluator.begin();\n try {\n let roots = /* @__PURE__ */ new Set([root]);\n for (const part of selector.parts) {\n if (part.name === "nth") {\n roots = this._queryNth(roots, part);\n } else if (kLayoutSelectorNames.includes(part.name)) {\n roots = this._queryLayoutSelector(roots, part, root);\n } else {\n const next = /* @__PURE__ */ new Set();\n for (const root2 of roots) {\n const all = this._queryEngineAll(part, root2);\n for (const one of all)\n next.add(one);\n }\n roots = next;\n }\n }\n return [...roots];\n } finally {\n this._evaluator.end();\n }\n }\n _queryEngineAll(part, root) {\n const result = this._engines.get(part.name).queryAll(root, part.body);\n for (const element of result) {\n if (!("nodeName" in element))\n throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(element)}`);\n }\n return result;\n }\n _createAttributeEngine(attribute, shadow) {\n const toCSS = (selector) => {\n const css2 = `[${attribute}=${JSON.stringify(selector)}]`;\n return [{ simples: [{ selector: { css: css2, functions: [] }, combinator: "" }] }];\n };\n return {\n queryAll: (root, selector) => {\n return this._evaluator.query({ scope: root, pierceShadow: shadow }, toCSS(selector));\n }\n };\n }\n _createCSSEngine() {\n const evaluator = this._evaluator;\n return {\n queryAll(root, body) {\n return evaluator.query({ scope: root, pierceShadow: true }, body);\n }\n };\n }\n _createTextEngine(shadow) {\n const queryList = (root, selector) => {\n const { matcher, kind } = createTextMatcher(selector);\n const result = [];\n let lastDidNotMatchSelf = null;\n const appendElement = (element) => {\n if (kind === "lax" && lastDidNotMatchSelf && lastDidNotMatchSelf.contains(element))\n return false;\n const matches = elementMatchesText(this._evaluator._cacheText, element, matcher);\n if (matches === "none")\n lastDidNotMatchSelf = element;\n if (matches === "self" || matches === "selfAndChildren" && kind === "strict")\n result.push(element);\n };\n if (root.nodeType === Node.ELEMENT_NODE)\n appendElement(root);\n const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: shadow }, "*");\n for (const element of elements)\n appendElement(element);\n return result;\n };\n return {\n queryAll: (root, selector) => {\n return queryList(root, selector);\n }\n };\n }\n _createControlEngine() {\n return {\n queryAll(root, body) {\n if (body === "enter-frame")\n return [];\n if (body === "return-empty")\n return [];\n throw new Error(`Internal error, unknown control selector ${body}`);\n }\n };\n }\n _createHasEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const has = !!this.querySelector(body.parsed, root, false);\n return has ? [root] : [];\n };\n return { queryAll };\n }\n _createVisibleEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n return isElementVisible(root) === Boolean(body) ? [root] : [];\n };\n return { queryAll };\n }\n _createLayoutEngine(name) {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const has = !!this.querySelector(body, root, false);\n return has ? [root] : [];\n };\n return { queryAll };\n }\n extend(source, params) {\n const constrFunction = globalThis.eval(`\n (() => {\n const module = {};\n ${source}\n return module.exports;\n })()`);\n return new constrFunction(this, params);\n }\n isVisible(element) {\n return isElementVisible(element);\n }\n pollRaf(predicate) {\n return this.poll(predicate, (next) => requestAnimationFrame(next));\n }\n pollInterval(pollInterval, predicate) {\n return this.poll(predicate, (next) => setTimeout(next, pollInterval));\n }\n pollLogScale(predicate) {\n const pollIntervals = [100, 250, 500];\n let attempts = 0;\n return this.poll(predicate, (next) => setTimeout(next, pollIntervals[attempts++] || 1e3));\n }\n poll(predicate, scheduleNext) {\n return this._runAbortableTask((progress) => {\n let fulfill;\n let reject;\n const result = new Promise((f, r) => {\n fulfill = f;\n reject = r;\n });\n const next = () => {\n if (progress.aborted)\n return;\n try {\n const success = predicate(progress);\n if (success !== progress.continuePolling)\n fulfill(success);\n else\n scheduleNext(next);\n } catch (e) {\n progress.log(" " + e.message);\n reject(e);\n }\n };\n next();\n return result;\n });\n }\n _runAbortableTask(task) {\n let unsentLog = [];\n let takeNextLogsCallback;\n let taskFinished = false;\n const logReady = () => {\n if (!takeNextLogsCallback)\n return;\n takeNextLogsCallback(unsentLog);\n unsentLog = [];\n takeNextLogsCallback = void 0;\n };\n const takeNextLogs = () => new Promise((fulfill) => {\n takeNextLogsCallback = fulfill;\n if (unsentLog.length || taskFinished)\n logReady();\n });\n let lastMessage = "";\n let lastIntermediateResult = void 0;\n const progress = {\n injectedScript: this,\n aborted: false,\n continuePolling: Symbol("continuePolling"),\n log: (message) => {\n lastMessage = message;\n unsentLog.push({ message });\n logReady();\n },\n logRepeating: (message) => {\n if (message !== lastMessage)\n progress.log(message);\n },\n setIntermediateResult: (intermediateResult) => {\n if (lastIntermediateResult === intermediateResult)\n return;\n lastIntermediateResult = intermediateResult;\n unsentLog.push({ intermediateResult });\n logReady();\n }\n };\n const run = () => {\n const result = task(progress);\n result.finally(() => {\n taskFinished = true;\n logReady();\n });\n return result;\n };\n return {\n takeNextLogs,\n run,\n cancel: () => {\n progress.aborted = true;\n },\n takeLastLogs: () => unsentLog\n };\n }\n getElementBorderWidth(node) {\n if (node.nodeType !== Node.ELEMENT_NODE || !node.ownerDocument || !node.ownerDocument.defaultView)\n return { left: 0, top: 0 };\n const style = node.ownerDocument.defaultView.getComputedStyle(node);\n return { left: parseInt(style.borderLeftWidth || "", 10), top: parseInt(style.borderTopWidth || "", 10) };\n }\n retarget(node, behavior) {\n let element = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n if (!element)\n return null;\n if (!element.matches("input, textarea, select"))\n element = element.closest("button, [role=button], [role=checkbox], [role=radio]") || element;\n if (behavior === "follow-label") {\n if (!element.matches("input, textarea, button, select, [role=button], [role=checkbox], [role=radio]") && !element.isContentEditable) {\n element = element.closest("label") || element;\n }\n if (element.nodeName === "LABEL")\n element = element.control || element;\n }\n return element;\n }\n waitForElementStatesAndPerformAction(node, states, force, callback) {\n let lastRect;\n let counter = 0;\n let samePositionCounter = 0;\n let lastTime = 0;\n return this.pollRaf((progress) => {\n if (force) {\n progress.log(` forcing action`);\n return callback(node, progress);\n }\n for (const state of states) {\n if (state !== "stable") {\n const result = this.elementState(node, state);\n if (typeof result !== "boolean")\n return result;\n if (!result) {\n progress.logRepeating(` element is not ${state} - waiting...`);\n return progress.continuePolling;\n }\n continue;\n }\n const element = this.retarget(node, "no-follow-label");\n if (!element)\n return "error:notconnected";\n if (++counter === 1)\n return progress.continuePolling;\n const time = performance.now();\n if (this._stableRafCount > 1 && time - lastTime < 15)\n return progress.continuePolling;\n lastTime = time;\n const clientRect = element.getBoundingClientRect();\n const rect = { x: clientRect.top, y: clientRect.left, width: clientRect.width, height: clientRect.height };\n const samePosition = lastRect && rect.x === lastRect.x && rect.y === lastRect.y && rect.width === lastRect.width && rect.height === lastRect.height;\n if (samePosition)\n ++samePositionCounter;\n else\n samePositionCounter = 0;\n const isStable = samePositionCounter >= this._stableRafCount;\n const isStableForLogs = isStable || !lastRect;\n lastRect = rect;\n if (!isStableForLogs)\n progress.logRepeating(` element is not stable - waiting...`);\n if (!isStable)\n return progress.continuePolling;\n }\n return callback(node, progress);\n });\n }\n elementState(node, state) {\n const element = this.retarget(node, ["stable", "visible", "hidden"].includes(state) ? "no-follow-label" : "follow-label");\n if (!element || !element.isConnected) {\n if (state === "hidden")\n return true;\n return "error:notconnected";\n }\n if (state === "visible")\n return this.isVisible(element);\n if (state === "hidden")\n return !this.isVisible(element);\n const disabled = getAriaDisabled(element);\n if (state === "disabled")\n return disabled;\n if (state === "enabled")\n return !disabled;\n const editable = !(["INPUT", "TEXTAREA", "SELECT"].includes(element.nodeName) && element.hasAttribute("readonly"));\n if (state === "editable")\n return !disabled && editable;\n if (state === "checked" || state === "unchecked") {\n if (["checkbox", "radio"].includes(element.getAttribute("role") || "")) {\n const result2 = element.getAttribute("aria-checked") === "true";\n return state === "checked" ? result2 : !result2;\n }\n if (element.nodeName !== "INPUT")\n throw this.createStacklessError("Not a checkbox or radio button");\n if (!["radio", "checkbox"].includes(element.type.toLowerCase()))\n throw this.createStacklessError("Not a checkbox or radio button");\n const result = element.checked;\n return state === "checked" ? result : !result;\n }\n throw this.createStacklessError(`Unexpected element state "${state}"`);\n }\n selectOptions(optionsToSelect, node, progress) {\n const element = this.retarget(node, "follow-label");\n if (!element)\n return "error:notconnected";\n if (element.nodeName.toLowerCase() !== "select")\n throw this.createStacklessError("Element is not a ,