From 330981f89963589aadd5b9860d8cd6c5031672bc Mon Sep 17 00:00:00 2001 From: Alexandros Dorodoulis Date: Thu, 14 Apr 2022 10:33:55 +0200 Subject: [PATCH 1/4] feat: make install command configurable --- action.yml | 3 +++ src/index.js | 6 +++++- src/lib/build-ref.js | 3 ++- src/lib/generate-size-report.js | 2 ++ src/lib/npm-ci.js | 37 +++++++++++++++++++-------------- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/action.yml b/action.yml index c519cab..1d3428c 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,9 @@ inputs: description: 'Sort order: desc, asc' hide-files: description: 'Glob pattern to hide files with' + install-command: + description: 'Command to install the package with, if empty the action will try to autodetect it' + runs: using: 'node12' main: 'dist/index.js' diff --git a/src/index.js b/src/index.js index 9385495..7d1212a 100644 --- a/src/index.js +++ b/src/index.js @@ -11,7 +11,10 @@ const COMMENT_SIGNATURE = sub('🤖 This report was automatically generated by [ (async () => { const { GITHUB_TOKEN } = process.env; - assert(GITHUB_TOKEN, 'Environment variable "GITHUB_TOKEN" not set. Required for accessing and reporting on the PR.'); + assert( + GITHUB_TOKEN, + 'Environment variable 'GITHUB_TOKEN' not set. Required for accessing and reporting on the PR.' + ); const { pull_request: pr } = context.payload; @@ -25,6 +28,7 @@ const COMMENT_SIGNATURE = sub('🤖 This report was automatically generated by [ sortBy: getInput('sort-by') || 'delta', sortOrder: getInput('sort-order') || 'desc', displaySize: getInput('display-size') || 'uncompressed', + installCommand: getInput('install-command'), }); await exec(`git checkout -f ${context.sha}`); diff --git a/src/lib/build-ref.js b/src/lib/build-ref.js index 847ef0d..715aafa 100644 --- a/src/lib/build-ref.js +++ b/src/lib/build-ref.js @@ -11,6 +11,7 @@ async function buildRef({ checkoutRef, refData, buildCommand, + installCommand, }) { const cwd = process.cwd(); @@ -46,7 +47,7 @@ async function buildRef({ } if (buildCommand) { - await npmCi({ cwd }).catch((error) => { + await npmCi({ installCommand, cwd }).catch((error) => { throw new Error(`Failed to install dependencies:\n${error.message}`); }); diff --git a/src/lib/generate-size-report.js b/src/lib/generate-size-report.js index f9cb7a5..bffb671 100644 --- a/src/lib/generate-size-report.js +++ b/src/lib/generate-size-report.js @@ -14,11 +14,13 @@ async function generateSizeReport({ sortBy, sortOrder, displaySize, + installCommand, }) { log.startGroup('Build HEAD'); const headPkgData = await buildRef({ refData: pr.head, buildCommand, + installCommand, }); setOutput('headPkgData', headPkgData); log.endGroup(); diff --git a/src/lib/npm-ci.js b/src/lib/npm-ci.js index 705eb34..63645b0 100644 --- a/src/lib/npm-ci.js +++ b/src/lib/npm-ci.js @@ -4,7 +4,10 @@ import { rmRF } from '@actions/io'; import * as log from './log.js'; import exec from './exec.js'; -async function npmCi({ cwd } = {}) { +async function npmCi({ + cwd, + installCommand = autoDetectInstallCommand(), +} = {}) { if (fs.existsSync('node_modules')) { log.info('Cleaning node_modules'); await rmRF(path.join(cwd, 'node_modules')); @@ -15,30 +18,32 @@ async function npmCi({ cwd } = {}) { ignoreReturnCode: true, }; - let installCommand = ''; + const { exitCode, stdout, stderr } = await exec(installCommand, options); + if (exitCode > 0) { + throw new Error(`${stderr}\n${stdout}`); + } +} +function autoDetectInstallCommand() { if (fs.existsSync('package-lock.json')) { log.info('Installing dependencies with npm'); - installCommand = 'npm ci'; - } else if (fs.existsSync('yarn.lock')) { - log.info('Installing dependencies with yarn'); + return 'npm ci'; + } + if (fs.existsSync('yarn.lock')) { + log.info('Installing dependencies with yarn'); // yarn is installed on GitHub Actions by default - installCommand = 'yarn install --frozen-lockfile'; - } else if (fs.existsSync('pnpm-lock.yaml')) { - log.info('Installing dependencies with pnpm'); + return 'yarn install --frozen-lockfile'; + } + if (fs.existsSync('pnpm-lock.yaml')) { + log.info('Installing dependencies with pnpm'); // pnpm is not installed on GitHub Actions by default - installCommand = 'npx pnpm i --frozen-lockfile'; - } else { - log.info('No lock file detected. Installing dependencies with npm'); - installCommand = 'npm i'; + return 'npx pnpm i --frozen-lockfile'; } - const { exitCode, stdout, stderr } = await exec(installCommand, options); - if (exitCode > 0) { - throw new Error(`${stderr}\n${stdout}`); - } + log.info('No lock file detected. Installing dependencies with npm'); + return 'npm i'; } export default npmCi; From 9ae204cf3c95ae5e0d045626d10525e755f4fa1e Mon Sep 17 00:00:00 2001 From: Alexandros Dorodoulis Date: Thu, 14 Apr 2022 11:48:26 +0200 Subject: [PATCH 2/4] feat!: update to node16 and update deps --- action.yml | 2 +- dist/index.js | 6396 ++++++++++++---------- package.json | 26 +- pnpm-lock.yaml | 595 +- src/index.js | 6 +- src/lib/npm-ci.js | 10 +- src/report-templates/head-only.js | 2 +- src/report-templates/regression/index.js | 2 +- 8 files changed, 3822 insertions(+), 3217 deletions(-) diff --git a/action.yml b/action.yml index 1d3428c..792fefa 100644 --- a/action.yml +++ b/action.yml @@ -25,5 +25,5 @@ inputs: description: 'Command to install the package with, if empty the action will try to autodetect it' runs: - using: 'node12' + using: 'node16' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 8429d23..35b8639 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,394 +1,205 @@ "use strict"; -var H = Object.getOwnPropertySymbols; -var J = Object.prototype.hasOwnProperty, Y = Object.prototype.propertyIsEnumerable; -var W = (e, t) => { - var n = {}; - for (var s in e) - J.call(e, s) && t.indexOf(s) < 0 && (n[s] = e[s]); - if (e != null && H) - for (var s of H(e)) - t.indexOf(s) < 0 && Y.call(e, s) && (n[s] = e[s]); - return n; -}; -var assert_1 = require("assert"), require$$0 = require("os"), fs = require("fs"), require$$1 = require("path"), http = require("http"), https = require("https"); +var io = require("assert"), ao = require("os"), co = require("fs"), lo = require("path"), uo = require("http"), po = require("https"); require("net"); -var tls = require("tls"), events = require("events"), util_1 = require("util"), Stream = require("stream"), Url = require("url"), zlib = require("zlib"), string_decoder_1 = require("string_decoder"), require$$0$1 = require("child_process"), timers_1 = require("timers"); -function _interopDefaultLegacy(e) { +var fo = require("tls"), ho = require("events"), mo = require("util"), go = require("stream"), wo = require("url"), bo = require("zlib"), yo = require("string_decoder"), To = require("child_process"), _o = require("timers"); +function L(e) { return e && typeof e == "object" && "default" in e ? e : { default: e }; } -var assert_1__default = /* @__PURE__ */ _interopDefaultLegacy(assert_1), require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0), fs__default = /* @__PURE__ */ _interopDefaultLegacy(fs), require$$1__default = /* @__PURE__ */ _interopDefaultLegacy(require$$1), http__default = /* @__PURE__ */ _interopDefaultLegacy(http), https__default = /* @__PURE__ */ _interopDefaultLegacy(https), tls__default = /* @__PURE__ */ _interopDefaultLegacy(tls), events__default = /* @__PURE__ */ _interopDefaultLegacy(events), util_1__default = /* @__PURE__ */ _interopDefaultLegacy(util_1), Stream__default = /* @__PURE__ */ _interopDefaultLegacy(Stream), Url__default = /* @__PURE__ */ _interopDefaultLegacy(Url), zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib), string_decoder_1__default = /* @__PURE__ */ _interopDefaultLegacy(string_decoder_1), require$$0__default$1 = /* @__PURE__ */ _interopDefaultLegacy(require$$0$1), timers_1__default = /* @__PURE__ */ _interopDefaultLegacy(timers_1), commonjsGlobal = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}; -function getAugmentedNamespace(e) { +var Tr = /* @__PURE__ */ L(io), Le = /* @__PURE__ */ L(ao), ce = /* @__PURE__ */ L(co), qe = /* @__PURE__ */ L(lo), Me = /* @__PURE__ */ L(uo), it = /* @__PURE__ */ L(po), Eo = /* @__PURE__ */ L(fo), _r = /* @__PURE__ */ L(ho), Er = /* @__PURE__ */ L(mo), W = /* @__PURE__ */ L(go), Ct = /* @__PURE__ */ L(wo), _e = /* @__PURE__ */ L(bo), vo = /* @__PURE__ */ L(yo), vr = /* @__PURE__ */ L(To), Oo = /* @__PURE__ */ L(_o), O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; +function kt(e) { if (e.__esModule) return e; var t = Object.defineProperty({}, "__esModule", { value: !0 }); - return Object.keys(e).forEach(function(n) { - var s = Object.getOwnPropertyDescriptor(e, n); - Object.defineProperty(t, n, s.get ? s : { + return Object.keys(e).forEach(function(r) { + var n = Object.getOwnPropertyDescriptor(e, r); + Object.defineProperty(t, r, n.get ? n : { enumerable: !0, get: function() { - return e[n]; + return e[r]; } }); }), t; } -function createCommonjsModule(e) { - var t = { exports: {} }; - return e(t, t.exports), t.exports; -} -var utils$2 = createCommonjsModule(function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.toCommandValue = void 0; - function n(s) { - return s == null ? "" : typeof s == "string" || s instanceof String ? s : JSON.stringify(s); - } - t.toCommandValue = n; -}), command = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(_, E, P, G) { - G === void 0 && (G = P), Object.defineProperty(_, G, { enumerable: !0, get: function() { - return E[P]; - } }); - } : function(_, E, P, G) { - G === void 0 && (G = P), _[G] = E[P]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(_, E) { - Object.defineProperty(_, "default", { enumerable: !0, value: E }); - } : function(_, E) { - _.default = E; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(_) { - if (_ && _.__esModule) - return _; - var E = {}; - if (_ != null) - for (var P in _) - P !== "default" && Object.hasOwnProperty.call(_, P) && n(E, _, P); - return s(E, _), E; - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.issue = t.issueCommand = void 0; - const i = o(require$$0__default.default); - function p(_, E, P) { - const G = new h(_, E, P); - process.stdout.write(G.toString() + i.EOL); - } - t.issueCommand = p; - function a(_, E = "") { - p(_, {}, E); - } - t.issue = a; - const u = "::"; - class h { - constructor(E, P, G) { - E || (E = "missing.command"), this.command = E, this.properties = P, this.message = G; - } - toString() { - let E = u + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - E += " "; - let P = !0; - for (const G in this.properties) - if (this.properties.hasOwnProperty(G)) { - const d = this.properties[G]; - d && (P ? P = !1 : E += ",", E += `${G}=${y(d)}`); - } - } - return E += `${u}${b(this.message)}`, E; - } - } - function b(_) { - return utils$2.toCommandValue(_).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); - } - function y(_) { - return utils$2.toCommandValue(_).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); - } -}), fileCommand = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(u, h, b, y) { - y === void 0 && (y = b), Object.defineProperty(u, y, { enumerable: !0, get: function() { - return h[b]; - } }); - } : function(u, h, b, y) { - y === void 0 && (y = b), u[y] = h[b]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(u, h) { - Object.defineProperty(u, "default", { enumerable: !0, value: h }); - } : function(u, h) { - u.default = h; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(u) { - if (u && u.__esModule) - return u; - var h = {}; - if (u != null) - for (var b in u) - b !== "default" && Object.hasOwnProperty.call(u, b) && n(h, u, b); - return s(h, u), h; - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.issueCommand = void 0; - const i = o(fs__default.default), p = o(require$$0__default.default); - function a(u, h) { - const b = process.env[`GITHUB_${u}`]; - if (!b) - throw new Error(`Unable to find environment variable for file command ${u}`); - if (!i.existsSync(b)) - throw new Error(`Missing file at path: ${b}`); - i.appendFileSync(b, `${utils$2.toCommandValue(h)}${p.EOL}`, { - encoding: "utf8" - }); - } - t.issueCommand = a; -}), core = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(S, j, U, F) { - F === void 0 && (F = U), Object.defineProperty(S, F, { enumerable: !0, get: function() { - return j[U]; - } }); - } : function(S, j, U, F) { - F === void 0 && (F = U), S[F] = j[U]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(S, j) { - Object.defineProperty(S, "default", { enumerable: !0, value: j }); - } : function(S, j) { - S.default = j; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(S) { - if (S && S.__esModule) - return S; - var j = {}; - if (S != null) - for (var U in S) - U !== "default" && Object.hasOwnProperty.call(S, U) && n(j, S, U); - return s(j, S), j; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(S, j, U, F) { - function I(B) { - return B instanceof U ? B : new U(function(N) { - N(B); - }); - } - return new (U || (U = Promise))(function(B, N) { - function V(M) { - try { - q(F.next(M)); - } catch (z) { - N(z); - } - } - function K(M) { - try { - q(F.throw(M)); - } catch (z) { - N(z); - } - } - function q(M) { - M.done ? B(M.value) : I(M.value).then(V, K); - } - q((F = F.apply(S, j || [])).next()); - }); - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.getState = t.saveState = t.group = t.endGroup = t.startGroup = t.info = t.warning = t.error = t.debug = t.isDebug = t.setFailed = t.setCommandEcho = t.setOutput = t.getBooleanInput = t.getMultilineInput = t.getInput = t.addPath = t.setSecret = t.exportVariable = t.ExitCode = void 0; - const p = o(require$$0__default.default), a = o(require$$1__default.default); - var u; - (function(S) { - S[S.Success = 0] = "Success", S[S.Failure = 1] = "Failure"; - })(u = t.ExitCode || (t.ExitCode = {})); - function h(S, j) { - const U = utils$2.toCommandValue(j); - if (process.env[S] = U, process.env.GITHUB_ENV || "") { - const I = "_GitHubActionsFileCommandDelimeter_", B = `${S}<<${I}${p.EOL}${U}${p.EOL}${I}`; - fileCommand.issueCommand("ENV", B); - } else - command.issueCommand("set-env", { name: S }, U); - } - t.exportVariable = h; - function b(S) { - command.issueCommand("add-mask", {}, S); - } - t.setSecret = b; - function y(S) { - process.env.GITHUB_PATH || "" ? fileCommand.issueCommand("PATH", S) : command.issueCommand("add-path", {}, S), process.env.PATH = `${S}${a.delimiter}${process.env.PATH}`; - } - t.addPath = y; - function _(S, j) { - const U = process.env[`INPUT_${S.replace(/ /g, "_").toUpperCase()}`] || ""; - if (j && j.required && !U) - throw new Error(`Input required and not supplied: ${S}`); - return j && j.trimWhitespace === !1 ? U : U.trim(); - } - t.getInput = _; - function E(S, j) { - return _(S, j).split(` -`).filter((F) => F !== ""); - } - t.getMultilineInput = E; - function P(S, j) { - const U = ["true", "True", "TRUE"], F = ["false", "False", "FALSE"], I = _(S, j); - if (U.includes(I)) - return !0; - if (F.includes(I)) - return !1; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${S} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); - } - t.getBooleanInput = P; - function G(S, j) { - process.stdout.write(p.EOL), command.issueCommand("set-output", { name: S }, j); - } - t.setOutput = G; - function d(S) { - command.issue("echo", S ? "on" : "off"); - } - t.setCommandEcho = d; - function f(S) { - process.exitCode = u.Failure, g(S); - } - t.setFailed = f; - function w() { - return process.env.RUNNER_DEBUG === "1"; - } - t.isDebug = w; - function m(S) { - command.issueCommand("debug", {}, S); - } - t.debug = m; - function g(S) { - command.issue("error", S instanceof Error ? S.toString() : S); - } - t.error = g; - function T(S) { - command.issue("warning", S instanceof Error ? S.toString() : S); - } - t.warning = T; - function v(S) { - process.stdout.write(S + p.EOL); - } - t.info = v; - function O(S) { - command.issue("group", S); - } - t.startGroup = O; - function $() { - command.issue("endgroup"); - } - t.endGroup = $; - function A(S, j) { - return i(this, void 0, void 0, function* () { - O(S); - let U; - try { - U = yield j(); - } finally { - $(); - } - return U; - }); +var G = {}, Se = {}, le = {}; +Object.defineProperty(le, "__esModule", { value: !0 }), le.toCommandProperties = le.toCommandValue = void 0; +function Po(e) { + return e == null ? "" : typeof e == "string" || e instanceof String ? e : JSON.stringify(e); +} +le.toCommandValue = Po; +function So(e) { + return Object.keys(e).length ? { + title: e.title, + file: e.file, + line: e.startLine, + endLine: e.endLine, + col: e.startColumn, + endColumn: e.endColumn + } : {}; +} +le.toCommandProperties = So; +var Ao = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), Ro = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), $o = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + r !== "default" && Object.hasOwnProperty.call(e, r) && Ao(t, e, r); + return Ro(t, e), t; +}; +Object.defineProperty(Se, "__esModule", { value: !0 }), Se.issue = Se.issueCommand = void 0; +const Go = $o(Le.default), Or = le; +function Pr(e, t, r) { + const n = new ko(e, t, r); + process.stdout.write(n.toString() + Go.EOL); +} +Se.issueCommand = Pr; +function Co(e, t = "") { + Pr(e, {}, t); +} +Se.issue = Co; +const Sr = "::"; +class ko { + constructor(t, r, n) { + t || (t = "missing.command"), this.command = t, this.properties = r, this.message = n; } - t.group = A; - function k(S, j) { - command.issueCommand("save-state", { name: S }, j); - } - t.saveState = k; - function D(S) { - return process.env[`STATE_${S}`] || ""; - } - t.getState = D; -}), context = createCommonjsModule(function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.Context = void 0; - class n { - constructor() { - if (this.payload = {}, process.env.GITHUB_EVENT_PATH) - if (fs__default.default.existsSync(process.env.GITHUB_EVENT_PATH)) - this.payload = JSON.parse(fs__default.default.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); - else { - const o = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${o} does not exist${require$$0__default.default.EOL}`); + toString() { + let t = Sr + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + t += " "; + let r = !0; + for (const n in this.properties) + if (this.properties.hasOwnProperty(n)) { + const s = this.properties[n]; + s && (r ? r = !1 : t += ",", t += `${n}=${Uo(s)}`); } - this.eventName = process.env.GITHUB_EVENT_NAME, this.sha = process.env.GITHUB_SHA, this.ref = process.env.GITHUB_REF, this.workflow = process.env.GITHUB_WORKFLOW, this.action = process.env.GITHUB_ACTION, this.actor = process.env.GITHUB_ACTOR, this.job = process.env.GITHUB_JOB, this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10), this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - } - get issue() { - const o = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (o.issue || o.pull_request || o).number }); - } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [o, i] = process.env.GITHUB_REPOSITORY.split("/"); - return { owner: o, repo: i }; - } - if (this.payload.repository) - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); } - } - t.Context = n; -}); -function getProxyUrl(e) { - let t = e.protocol === "https:", n; - if (checkBypass(e)) - return n; - let s; - return t ? s = process.env.https_proxy || process.env.HTTPS_PROXY : s = process.env.http_proxy || process.env.HTTP_PROXY, s && (n = new URL(s)), n; + return t += `${Sr}${Do(this.message)}`, t; + } +} +function Do(e) { + return Or.toCommandValue(e).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +} +function Uo(e) { + return Or.toCommandValue(e).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +} +var at = {}, jo = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), Fo = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), Ar = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + r !== "default" && Object.hasOwnProperty.call(e, r) && jo(t, e, r); + return Fo(t, e), t; +}; +Object.defineProperty(at, "__esModule", { value: !0 }), at.issueCommand = void 0; +const Rr = Ar(ce.default), xo = Ar(Le.default), Io = le; +function Bo(e, t) { + const r = process.env[`GITHUB_${e}`]; + if (!r) + throw new Error(`Unable to find environment variable for file command ${e}`); + if (!Rr.existsSync(r)) + throw new Error(`Missing file at path: ${r}`); + Rr.appendFileSync(r, `${Io.toCommandValue(t)}${xo.EOL}`, { + encoding: "utf8" + }); +} +at.issueCommand = Bo; +var ct = {}, $r = {}, lt = {}; +Object.defineProperty(lt, "__esModule", { value: !0 }); +function Lo(e) { + let t = e.protocol === "https:", r; + if (Gr(e)) + return r; + let n; + return t ? n = process.env.https_proxy || process.env.HTTPS_PROXY : n = process.env.http_proxy || process.env.HTTP_PROXY, n && (r = new URL(n)), r; } -var getProxyUrl_1 = getProxyUrl; -function checkBypass(e) { +lt.getProxyUrl = Lo; +function Gr(e) { if (!e.hostname) return !1; let t = process.env.no_proxy || process.env.NO_PROXY || ""; if (!t) return !1; - let n; - e.port ? n = Number(e.port) : e.protocol === "http:" ? n = 80 : e.protocol === "https:" && (n = 443); - let s = [e.hostname.toUpperCase()]; - typeof n == "number" && s.push(`${s[0]}:${n}`); - for (let o of t.split(",").map((i) => i.trim().toUpperCase()).filter((i) => i)) - if (s.some((i) => i === o)) + let r; + e.port ? r = Number(e.port) : e.protocol === "http:" ? r = 80 : e.protocol === "https:" && (r = 443); + let n = [e.hostname.toUpperCase()]; + typeof r == "number" && n.push(`${n[0]}:${r}`); + for (let s of t.split(",").map((o) => o.trim().toUpperCase()).filter((o) => o)) + if (n.some((o) => o === s)) return !0; return !1; } -var checkBypass_1 = checkBypass, proxy = /* @__PURE__ */ Object.defineProperty({ - getProxyUrl: getProxyUrl_1, - checkBypass: checkBypass_1 -}, "__esModule", { value: !0 }), httpOverHttp_1 = httpOverHttp, httpsOverHttp_1 = httpsOverHttp, httpOverHttps_1 = httpOverHttps, httpsOverHttps_1 = httpsOverHttps; -function httpOverHttp(e) { - var t = new TunnelingAgent(e); - return t.request = http__default.default.request, t; +lt.checkBypass = Gr; +var Ae = {}, qo = Eo.default, Dt = Me.default, Cr = it.default, Mo = _r.default, No = Er.default; +Ae.httpOverHttp = zo, Ae.httpsOverHttp = Ho, Ae.httpOverHttps = Wo, Ae.httpsOverHttps = Ko; +function zo(e) { + var t = new ee(e); + return t.request = Dt.request, t; } -function httpsOverHttp(e) { - var t = new TunnelingAgent(e); - return t.request = http__default.default.request, t.createSocket = createSecureSocket, t.defaultPort = 443, t; +function Ho(e) { + var t = new ee(e); + return t.request = Dt.request, t.createSocket = kr, t.defaultPort = 443, t; } -function httpOverHttps(e) { - var t = new TunnelingAgent(e); - return t.request = https__default.default.request, t; +function Wo(e) { + var t = new ee(e); + return t.request = Cr.request, t; } -function httpsOverHttps(e) { - var t = new TunnelingAgent(e); - return t.request = https__default.default.request, t.createSocket = createSecureSocket, t.defaultPort = 443, t; +function Ko(e) { + var t = new ee(e); + return t.request = Cr.request, t.createSocket = kr, t.defaultPort = 443, t; } -function TunnelingAgent(e) { +function ee(e) { var t = this; - t.options = e || {}, t.proxyOptions = t.options.proxy || {}, t.maxSockets = t.options.maxSockets || http__default.default.Agent.defaultMaxSockets, t.requests = [], t.sockets = [], t.on("free", function(s, o, i, p) { - for (var a = toOptions(o, i, p), u = 0, h = t.requests.length; u < h; ++u) { - var b = t.requests[u]; - if (b.host === a.host && b.port === a.port) { - t.requests.splice(u, 1), b.request.onSocket(s); + t.options = e || {}, t.proxyOptions = t.options.proxy || {}, t.maxSockets = t.options.maxSockets || Dt.Agent.defaultMaxSockets, t.requests = [], t.sockets = [], t.on("free", function(n, s, o, i) { + for (var a = Dr(s, o, i), l = 0, p = t.requests.length; l < p; ++l) { + var h = t.requests[l]; + if (h.host === a.host && h.port === a.port) { + t.requests.splice(l, 1), h.request.onSocket(n); return; } } - s.destroy(), t.removeSocket(s); + n.destroy(), t.removeSocket(n); }); } -util_1__default.default.inherits(TunnelingAgent, events__default.default.EventEmitter), TunnelingAgent.prototype.addRequest = function(t, n, s, o) { - var i = this, p = mergeOptions({ request: t }, i.options, toOptions(n, s, o)); - if (i.sockets.length >= this.maxSockets) { - i.requests.push(p); +No.inherits(ee, Mo.EventEmitter), ee.prototype.addRequest = function(t, r, n, s) { + var o = this, i = Ut({ request: t }, o.options, Dr(r, n, s)); + if (o.sockets.length >= this.maxSockets) { + o.requests.push(i); return; } - i.createSocket(p, function(a) { - a.on("free", u), a.on("close", h), a.on("agentRemove", h), t.onSocket(a); - function u() { - i.emit("free", a, p); + o.createSocket(i, function(a) { + a.on("free", l), a.on("close", p), a.on("agentRemove", p), t.onSocket(a); + function l() { + o.emit("free", a, i); } - function h(b) { - i.removeSocket(a), a.removeListener("free", u), a.removeListener("close", h), a.removeListener("agentRemove", h); + function p(h) { + o.removeSocket(a), a.removeListener("free", l), a.removeListener("close", p), a.removeListener("agentRemove", p); } }); -}, TunnelingAgent.prototype.createSocket = function(t, n) { - var s = this, o = {}; - s.sockets.push(o); - var i = mergeOptions({}, s.proxyOptions, { +}, ee.prototype.createSocket = function(t, r) { + var n = this, s = {}; + n.sockets.push(s); + var o = Ut({}, n.proxyOptions, { method: "CONNECT", path: t.host + ":" + t.port, agent: !1, @@ -396,579 +207,1178 @@ util_1__default.default.inherits(TunnelingAgent, events__default.default.EventEm host: t.host + ":" + t.port } }); - t.localAddress && (i.localAddress = t.localAddress), i.proxyAuth && (i.headers = i.headers || {}, i.headers["Proxy-Authorization"] = "Basic " + new Buffer(i.proxyAuth).toString("base64")), debug("making CONNECT request"); - var p = s.request(i); - p.useChunkedEncodingByDefault = !1, p.once("response", a), p.once("upgrade", u), p.once("connect", h), p.once("error", b), p.end(); - function a(y) { - y.upgrade = !0; + t.localAddress && (o.localAddress = t.localAddress), o.proxyAuth && (o.headers = o.headers || {}, o.headers["Proxy-Authorization"] = "Basic " + new Buffer(o.proxyAuth).toString("base64")), ue("making CONNECT request"); + var i = n.request(o); + i.useChunkedEncodingByDefault = !1, i.once("response", a), i.once("upgrade", l), i.once("connect", p), i.once("error", h), i.end(); + function a(w) { + w.upgrade = !0; } - function u(y, _, E) { + function l(w, _, $) { process.nextTick(function() { - h(y, _, E); + p(w, _, $); }); } - function h(y, _, E) { - if (p.removeAllListeners(), _.removeAllListeners(), y.statusCode !== 200) { - debug("tunneling socket could not be established, statusCode=%d", y.statusCode), _.destroy(); - var P = new Error("tunneling socket could not be established, statusCode=" + y.statusCode); - P.code = "ECONNRESET", t.request.emit("error", P), s.removeSocket(o); + function p(w, _, $) { + if (i.removeAllListeners(), _.removeAllListeners(), w.statusCode !== 200) { + ue("tunneling socket could not be established, statusCode=%d", w.statusCode), _.destroy(); + var E = new Error("tunneling socket could not be established, statusCode=" + w.statusCode); + E.code = "ECONNRESET", t.request.emit("error", E), n.removeSocket(s); return; } - if (E.length > 0) { - debug("got illegal response body from proxy"), _.destroy(); - var P = new Error("got illegal response body from proxy"); - P.code = "ECONNRESET", t.request.emit("error", P), s.removeSocket(o); + if ($.length > 0) { + ue("got illegal response body from proxy"), _.destroy(); + var E = new Error("got illegal response body from proxy"); + E.code = "ECONNRESET", t.request.emit("error", E), n.removeSocket(s); return; } - return debug("tunneling connection has established"), s.sockets[s.sockets.indexOf(o)] = _, n(_); - } - function b(y) { - p.removeAllListeners(), debug(`tunneling socket could not be established, cause=%s -`, y.message, y.stack); - var _ = new Error("tunneling socket could not be established, cause=" + y.message); - _.code = "ECONNRESET", t.request.emit("error", _), s.removeSocket(o); - } -}, TunnelingAgent.prototype.removeSocket = function(t) { - var n = this.sockets.indexOf(t); - if (n !== -1) { - this.sockets.splice(n, 1); - var s = this.requests.shift(); - s && this.createSocket(s, function(o) { - s.request.onSocket(o); + return ue("tunneling connection has established"), n.sockets[n.sockets.indexOf(s)] = _, r(_); + } + function h(w) { + i.removeAllListeners(), ue(`tunneling socket could not be established, cause=%s +`, w.message, w.stack); + var _ = new Error("tunneling socket could not be established, cause=" + w.message); + _.code = "ECONNRESET", t.request.emit("error", _), n.removeSocket(s); + } +}, ee.prototype.removeSocket = function(t) { + var r = this.sockets.indexOf(t); + if (r !== -1) { + this.sockets.splice(r, 1); + var n = this.requests.shift(); + n && this.createSocket(n, function(s) { + n.request.onSocket(s); }); } }; -function createSecureSocket(e, t) { - var n = this; - TunnelingAgent.prototype.createSocket.call(n, e, function(s) { - var o = e.request.getHeader("host"), i = mergeOptions({}, n.options, { - socket: s, - servername: o ? o.replace(/:.*$/, "") : e.host - }), p = tls__default.default.connect(0, i); - n.sockets[n.sockets.indexOf(s)] = p, t(p); +function kr(e, t) { + var r = this; + ee.prototype.createSocket.call(r, e, function(n) { + var s = e.request.getHeader("host"), o = Ut({}, r.options, { + socket: n, + servername: s ? s.replace(/:.*$/, "") : e.host + }), i = qo.connect(0, o); + r.sockets[r.sockets.indexOf(n)] = i, t(i); }); } -function toOptions(e, t, n) { +function Dr(e, t, r) { return typeof e == "string" ? { host: e, port: t, - localAddress: n + localAddress: r } : e; } -function mergeOptions(e) { - for (var t = 1, n = arguments.length; t < n; ++t) { - var s = arguments[t]; - if (typeof s == "object") - for (var o = Object.keys(s), i = 0, p = o.length; i < p; ++i) { - var a = o[i]; - s[a] !== void 0 && (e[a] = s[a]); +function Ut(e) { + for (var t = 1, r = arguments.length; t < r; ++t) { + var n = arguments[t]; + if (typeof n == "object") + for (var s = Object.keys(n), o = 0, i = s.length; o < i; ++o) { + var a = s[o]; + n[a] !== void 0 && (e[a] = n[a]); } } return e; } -var debug; -process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG) ? debug = function() { +var ue; +process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG) ? ue = function() { var e = Array.prototype.slice.call(arguments); typeof e[0] == "string" ? e[0] = "TUNNEL: " + e[0] : e.unshift("TUNNEL:"), console.error.apply(console, e); -} : debug = function() { -}; -var debug_1 = debug, tunnel$1 = { - httpOverHttp: httpOverHttp_1, - httpsOverHttp: httpsOverHttp_1, - httpOverHttps: httpOverHttps_1, - httpsOverHttps: httpsOverHttps_1, - debug: debug_1 -}, tunnel = tunnel$1, httpClient = createCommonjsModule(function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }); - let n; - var s; +} : ue = function() { +}, Ae.debug = ue; +var Ur = Ae; +(function(e) { + Object.defineProperty(e, "__esModule", { value: !0 }); + const t = Me.default, r = it.default, n = lt; + let s; + var o; (function(d) { d[d.OK = 200] = "OK", d[d.MultipleChoices = 300] = "MultipleChoices", d[d.MovedPermanently = 301] = "MovedPermanently", d[d.ResourceMoved = 302] = "ResourceMoved", d[d.SeeOther = 303] = "SeeOther", d[d.NotModified = 304] = "NotModified", d[d.UseProxy = 305] = "UseProxy", d[d.SwitchProxy = 306] = "SwitchProxy", d[d.TemporaryRedirect = 307] = "TemporaryRedirect", d[d.PermanentRedirect = 308] = "PermanentRedirect", d[d.BadRequest = 400] = "BadRequest", d[d.Unauthorized = 401] = "Unauthorized", d[d.PaymentRequired = 402] = "PaymentRequired", d[d.Forbidden = 403] = "Forbidden", d[d.NotFound = 404] = "NotFound", d[d.MethodNotAllowed = 405] = "MethodNotAllowed", d[d.NotAcceptable = 406] = "NotAcceptable", d[d.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", d[d.RequestTimeout = 408] = "RequestTimeout", d[d.Conflict = 409] = "Conflict", d[d.Gone = 410] = "Gone", d[d.TooManyRequests = 429] = "TooManyRequests", d[d.InternalServerError = 500] = "InternalServerError", d[d.NotImplemented = 501] = "NotImplemented", d[d.BadGateway = 502] = "BadGateway", d[d.ServiceUnavailable = 503] = "ServiceUnavailable", d[d.GatewayTimeout = 504] = "GatewayTimeout"; - })(s = t.HttpCodes || (t.HttpCodes = {})); - var o; + })(o = e.HttpCodes || (e.HttpCodes = {})); + var i; (function(d) { d.Accept = "accept", d.ContentType = "content-type"; - })(o = t.Headers || (t.Headers = {})); - var i; + })(i = e.Headers || (e.Headers = {})); + var a; (function(d) { d.ApplicationJson = "application/json"; - })(i = t.MediaTypes || (t.MediaTypes = {})); - function p(d) { - let f = proxy.getProxyUrl(new URL(d)); + })(a = e.MediaTypes || (e.MediaTypes = {})); + function l(d) { + let f = n.getProxyUrl(new URL(d)); return f ? f.href : ""; } - t.getProxyUrl = p; - const a = [ - s.MovedPermanently, - s.ResourceMoved, - s.SeeOther, - s.TemporaryRedirect, - s.PermanentRedirect - ], u = [ - s.BadGateway, - s.ServiceUnavailable, - s.GatewayTimeout - ], h = ["OPTIONS", "GET", "DELETE", "HEAD"], b = 10, y = 5; - class _ extends Error { - constructor(f, w) { - super(f); - this.name = "HttpClientError", this.statusCode = w, Object.setPrototypeOf(this, _.prototype); - } - } - t.HttpClientError = _; - class E { + e.getProxyUrl = l; + const p = [ + o.MovedPermanently, + o.ResourceMoved, + o.SeeOther, + o.TemporaryRedirect, + o.PermanentRedirect + ], h = [ + o.BadGateway, + o.ServiceUnavailable, + o.GatewayTimeout + ], w = ["OPTIONS", "GET", "DELETE", "HEAD"], _ = 10, $ = 5; + class E extends Error { + constructor(f, c) { + super(f), this.name = "HttpClientError", this.statusCode = c, Object.setPrototypeOf(this, E.prototype); + } + } + e.HttpClientError = E; + class m { constructor(f) { this.message = f; } readBody() { - return new Promise(async (f, w) => { - let m = Buffer.alloc(0); + return new Promise(async (f, c) => { + let u = Buffer.alloc(0); this.message.on("data", (g) => { - m = Buffer.concat([m, g]); + u = Buffer.concat([u, g]); }), this.message.on("end", () => { - f(m.toString()); + f(u.toString()); }); }); } } - t.HttpClientResponse = E; - function P(d) { + e.HttpClientResponse = m; + function b(d) { return new URL(d).protocol === "https:"; } - t.isHttps = P; - class G { - constructor(f, w, m) { - this._ignoreSslError = !1, this._allowRedirects = !0, this._allowRedirectDowngrade = !1, this._maxRedirects = 50, this._allowRetries = !1, this._maxRetries = 1, this._keepAlive = !1, this._disposed = !1, this.userAgent = f, this.handlers = w || [], this.requestOptions = m, m && (m.ignoreSslError != null && (this._ignoreSslError = m.ignoreSslError), this._socketTimeout = m.socketTimeout, m.allowRedirects != null && (this._allowRedirects = m.allowRedirects), m.allowRedirectDowngrade != null && (this._allowRedirectDowngrade = m.allowRedirectDowngrade), m.maxRedirects != null && (this._maxRedirects = Math.max(m.maxRedirects, 0)), m.keepAlive != null && (this._keepAlive = m.keepAlive), m.allowRetries != null && (this._allowRetries = m.allowRetries), m.maxRetries != null && (this._maxRetries = m.maxRetries)); + e.isHttps = b; + class T { + constructor(f, c, u) { + this._ignoreSslError = !1, this._allowRedirects = !0, this._allowRedirectDowngrade = !1, this._maxRedirects = 50, this._allowRetries = !1, this._maxRetries = 1, this._keepAlive = !1, this._disposed = !1, this.userAgent = f, this.handlers = c || [], this.requestOptions = u, u && (u.ignoreSslError != null && (this._ignoreSslError = u.ignoreSslError), this._socketTimeout = u.socketTimeout, u.allowRedirects != null && (this._allowRedirects = u.allowRedirects), u.allowRedirectDowngrade != null && (this._allowRedirectDowngrade = u.allowRedirectDowngrade), u.maxRedirects != null && (this._maxRedirects = Math.max(u.maxRedirects, 0)), u.keepAlive != null && (this._keepAlive = u.keepAlive), u.allowRetries != null && (this._allowRetries = u.allowRetries), u.maxRetries != null && (this._maxRetries = u.maxRetries)); } - options(f, w) { - return this.request("OPTIONS", f, null, w || {}); + options(f, c) { + return this.request("OPTIONS", f, null, c || {}); } - get(f, w) { - return this.request("GET", f, null, w || {}); + get(f, c) { + return this.request("GET", f, null, c || {}); } - del(f, w) { - return this.request("DELETE", f, null, w || {}); + del(f, c) { + return this.request("DELETE", f, null, c || {}); } - post(f, w, m) { - return this.request("POST", f, w, m || {}); + post(f, c, u) { + return this.request("POST", f, c, u || {}); } - patch(f, w, m) { - return this.request("PATCH", f, w, m || {}); + patch(f, c, u) { + return this.request("PATCH", f, c, u || {}); } - put(f, w, m) { - return this.request("PUT", f, w, m || {}); + put(f, c, u) { + return this.request("PUT", f, c, u || {}); } - head(f, w) { - return this.request("HEAD", f, null, w || {}); + head(f, c) { + return this.request("HEAD", f, null, c || {}); } - sendStream(f, w, m, g) { - return this.request(f, w, m, g); + sendStream(f, c, u, g) { + return this.request(f, c, u, g); } - async getJson(f, w = {}) { - w[o.Accept] = this._getExistingOrDefaultHeader(w, o.Accept, i.ApplicationJson); - let m = await this.get(f, w); - return this._processResponse(m, this.requestOptions); + async getJson(f, c = {}) { + c[i.Accept] = this._getExistingOrDefaultHeader(c, i.Accept, a.ApplicationJson); + let u = await this.get(f, c); + return this._processResponse(u, this.requestOptions); } - async postJson(f, w, m = {}) { - let g = JSON.stringify(w, null, 2); - m[o.Accept] = this._getExistingOrDefaultHeader(m, o.Accept, i.ApplicationJson), m[o.ContentType] = this._getExistingOrDefaultHeader(m, o.ContentType, i.ApplicationJson); - let T = await this.post(f, g, m); - return this._processResponse(T, this.requestOptions); + async postJson(f, c, u = {}) { + let g = JSON.stringify(c, null, 2); + u[i.Accept] = this._getExistingOrDefaultHeader(u, i.Accept, a.ApplicationJson), u[i.ContentType] = this._getExistingOrDefaultHeader(u, i.ContentType, a.ApplicationJson); + let y = await this.post(f, g, u); + return this._processResponse(y, this.requestOptions); } - async putJson(f, w, m = {}) { - let g = JSON.stringify(w, null, 2); - m[o.Accept] = this._getExistingOrDefaultHeader(m, o.Accept, i.ApplicationJson), m[o.ContentType] = this._getExistingOrDefaultHeader(m, o.ContentType, i.ApplicationJson); - let T = await this.put(f, g, m); - return this._processResponse(T, this.requestOptions); + async putJson(f, c, u = {}) { + let g = JSON.stringify(c, null, 2); + u[i.Accept] = this._getExistingOrDefaultHeader(u, i.Accept, a.ApplicationJson), u[i.ContentType] = this._getExistingOrDefaultHeader(u, i.ContentType, a.ApplicationJson); + let y = await this.put(f, g, u); + return this._processResponse(y, this.requestOptions); } - async patchJson(f, w, m = {}) { - let g = JSON.stringify(w, null, 2); - m[o.Accept] = this._getExistingOrDefaultHeader(m, o.Accept, i.ApplicationJson), m[o.ContentType] = this._getExistingOrDefaultHeader(m, o.ContentType, i.ApplicationJson); - let T = await this.patch(f, g, m); - return this._processResponse(T, this.requestOptions); + async patchJson(f, c, u = {}) { + let g = JSON.stringify(c, null, 2); + u[i.Accept] = this._getExistingOrDefaultHeader(u, i.Accept, a.ApplicationJson), u[i.ContentType] = this._getExistingOrDefaultHeader(u, i.ContentType, a.ApplicationJson); + let y = await this.patch(f, g, u); + return this._processResponse(y, this.requestOptions); } - async request(f, w, m, g) { + async request(f, c, u, g) { if (this._disposed) throw new Error("Client has already been disposed."); - let T = new URL(w), v = this._prepareRequest(f, T, g), O = this._allowRetries && h.indexOf(f) != -1 ? this._maxRetries + 1 : 1, $ = 0, A; - for (; $ < O; ) { - if (A = await this.requestRaw(v, m), A && A.message && A.message.statusCode === s.Unauthorized) { - let D; - for (let S = 0; S < this.handlers.length; S++) - if (this.handlers[S].canHandleAuthentication(A)) { - D = this.handlers[S]; + let y = new URL(c), A = this._prepareRequest(f, y, g), P = this._allowRetries && w.indexOf(f) != -1 ? this._maxRetries + 1 : 1, S = 0, R; + for (; S < P; ) { + if (R = await this.requestRaw(A, u), R && R.message && R.message.statusCode === o.Unauthorized) { + let B; + for (let F = 0; F < this.handlers.length; F++) + if (this.handlers[F].canHandleAuthentication(R)) { + B = this.handlers[F]; break; } - return D ? D.handleAuthentication(this, v, m) : A; + return B ? B.handleAuthentication(this, A, u) : R; } - let k = this._maxRedirects; - for (; a.indexOf(A.message.statusCode) != -1 && this._allowRedirects && k > 0; ) { - const D = A.message.headers.location; - if (!D) + let N = this._maxRedirects; + for (; p.indexOf(R.message.statusCode) != -1 && this._allowRedirects && N > 0; ) { + const B = R.message.headers.location; + if (!B) break; - let S = new URL(D); - if (T.protocol == "https:" && T.protocol != S.protocol && !this._allowRedirectDowngrade) + let F = new URL(B); + if (y.protocol == "https:" && y.protocol != F.protocol && !this._allowRedirectDowngrade) throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - if (await A.readBody(), S.hostname !== T.hostname) - for (let j in g) - j.toLowerCase() === "authorization" && delete g[j]; - v = this._prepareRequest(f, S, g), A = await this.requestRaw(v, m), k--; + if (await R.readBody(), F.hostname !== y.hostname) + for (let we in g) + we.toLowerCase() === "authorization" && delete g[we]; + A = this._prepareRequest(f, F, g), R = await this.requestRaw(A, u), N--; } - if (u.indexOf(A.message.statusCode) == -1) - return A; - $ += 1, $ < O && (await A.readBody(), await this._performExponentialBackoff($)); + if (h.indexOf(R.message.statusCode) == -1) + return R; + S += 1, S < P && (await R.readBody(), await this._performExponentialBackoff(S)); } - return A; + return R; } dispose() { this._agent && this._agent.destroy(), this._disposed = !0; } - requestRaw(f, w) { - return new Promise((m, g) => { - let T = function(v, O) { - v && g(v), m(O); + requestRaw(f, c) { + return new Promise((u, g) => { + let y = function(A, P) { + A && g(A), u(P); }; - this.requestRawWithCallback(f, w, T); + this.requestRawWithCallback(f, c, y); }); } - requestRawWithCallback(f, w, m) { + requestRawWithCallback(f, c, u) { let g; - typeof w == "string" && (f.options.headers["Content-Length"] = Buffer.byteLength(w, "utf8")); - let T = !1, v = ($, A) => { - T || (T = !0, m($, A)); - }, O = f.httpModule.request(f.options, ($) => { - let A = new E($); - v(null, A); + typeof c == "string" && (f.options.headers["Content-Length"] = Buffer.byteLength(c, "utf8")); + let y = !1, A = (S, R) => { + y || (y = !0, u(S, R)); + }, P = f.httpModule.request(f.options, (S) => { + let R = new m(S); + A(null, R); }); - O.on("socket", ($) => { - g = $; - }), O.setTimeout(this._socketTimeout || 3 * 6e4, () => { - g && g.end(), v(new Error("Request timeout: " + f.options.path), null); - }), O.on("error", function($) { - v($, null); - }), w && typeof w == "string" && O.write(w, "utf8"), w && typeof w != "string" ? (w.on("close", function() { - O.end(); - }), w.pipe(O)) : O.end(); + P.on("socket", (S) => { + g = S; + }), P.setTimeout(this._socketTimeout || 3 * 6e4, () => { + g && g.end(), A(new Error("Request timeout: " + f.options.path), null); + }), P.on("error", function(S) { + A(S, null); + }), c && typeof c == "string" && P.write(c, "utf8"), c && typeof c != "string" ? (c.on("close", function() { + P.end(); + }), c.pipe(P)) : P.end(); } getAgent(f) { - let w = new URL(f); - return this._getAgent(w); + let c = new URL(f); + return this._getAgent(c); } - _prepareRequest(f, w, m) { + _prepareRequest(f, c, u) { const g = {}; - g.parsedUrl = w; - const T = g.parsedUrl.protocol === "https:"; - g.httpModule = T ? https__default.default : http__default.default; - const v = T ? 443 : 80; - return g.options = {}, g.options.host = g.parsedUrl.hostname, g.options.port = g.parsedUrl.port ? parseInt(g.parsedUrl.port) : v, g.options.path = (g.parsedUrl.pathname || "") + (g.parsedUrl.search || ""), g.options.method = f, g.options.headers = this._mergeHeaders(m), this.userAgent != null && (g.options.headers["user-agent"] = this.userAgent), g.options.agent = this._getAgent(g.parsedUrl), this.handlers && this.handlers.forEach((O) => { - O.prepareRequest(g.options); + g.parsedUrl = c; + const y = g.parsedUrl.protocol === "https:"; + g.httpModule = y ? r : t; + const A = y ? 443 : 80; + return g.options = {}, g.options.host = g.parsedUrl.hostname, g.options.port = g.parsedUrl.port ? parseInt(g.parsedUrl.port) : A, g.options.path = (g.parsedUrl.pathname || "") + (g.parsedUrl.search || ""), g.options.method = f, g.options.headers = this._mergeHeaders(u), this.userAgent != null && (g.options.headers["user-agent"] = this.userAgent), g.options.agent = this._getAgent(g.parsedUrl), this.handlers && this.handlers.forEach((P) => { + P.prepareRequest(g.options); }), g; } _mergeHeaders(f) { - const w = (m) => Object.keys(m).reduce((g, T) => (g[T.toLowerCase()] = m[T], g), {}); - return this.requestOptions && this.requestOptions.headers ? Object.assign({}, w(this.requestOptions.headers), w(f)) : w(f || {}); + const c = (u) => Object.keys(u).reduce((g, y) => (g[y.toLowerCase()] = u[y], g), {}); + return this.requestOptions && this.requestOptions.headers ? Object.assign({}, c(this.requestOptions.headers), c(f)) : c(f || {}); } - _getExistingOrDefaultHeader(f, w, m) { - const g = (v) => Object.keys(v).reduce((O, $) => (O[$.toLowerCase()] = v[$], O), {}); - let T; - return this.requestOptions && this.requestOptions.headers && (T = g(this.requestOptions.headers)[w]), f[w] || T || m; + _getExistingOrDefaultHeader(f, c, u) { + const g = (A) => Object.keys(A).reduce((P, S) => (P[S.toLowerCase()] = A[S], P), {}); + let y; + return this.requestOptions && this.requestOptions.headers && (y = g(this.requestOptions.headers)[c]), f[c] || y || u; } _getAgent(f) { - let w, m = proxy.getProxyUrl(f), g = m && m.hostname; - if (this._keepAlive && g && (w = this._proxyAgent), this._keepAlive && !g && (w = this._agent), w) - return w; - const T = f.protocol === "https:"; - let v = 100; - if (this.requestOptions && (v = this.requestOptions.maxSockets || http__default.default.globalAgent.maxSockets), g) { - n || (n = tunnel); - const O = { - maxSockets: v, + let c, u = n.getProxyUrl(f), g = u && u.hostname; + if (this._keepAlive && g && (c = this._proxyAgent), this._keepAlive && !g && (c = this._agent), c) + return c; + const y = f.protocol === "https:"; + let A = 100; + if (this.requestOptions && (A = this.requestOptions.maxSockets || t.globalAgent.maxSockets), g) { + s || (s = Ur); + const P = { + maxSockets: A, keepAlive: this._keepAlive, proxy: { - proxyAuth: `${m.username}:${m.password}`, - host: m.hostname, - port: m.port + ...(u.username || u.password) && { + proxyAuth: `${u.username}:${u.password}` + }, + host: u.hostname, + port: u.port } }; - let $; - const A = m.protocol === "https:"; - T ? $ = A ? n.httpsOverHttps : n.httpsOverHttp : $ = A ? n.httpOverHttps : n.httpOverHttp, w = $(O), this._proxyAgent = w; + let S; + const R = u.protocol === "https:"; + y ? S = R ? s.httpsOverHttps : s.httpsOverHttp : S = R ? s.httpOverHttps : s.httpOverHttp, c = S(P), this._proxyAgent = c; } - if (this._keepAlive && !w) { - const O = { keepAlive: this._keepAlive, maxSockets: v }; - w = T ? new https__default.default.Agent(O) : new http__default.default.Agent(O), this._agent = w; + if (this._keepAlive && !c) { + const P = { keepAlive: this._keepAlive, maxSockets: A }; + c = y ? new r.Agent(P) : new t.Agent(P), this._agent = c; } - return w || (w = T ? https__default.default.globalAgent : http__default.default.globalAgent), T && this._ignoreSslError && (w.options = Object.assign(w.options || {}, { + return c || (c = y ? r.globalAgent : t.globalAgent), y && this._ignoreSslError && (c.options = Object.assign(c.options || {}, { rejectUnauthorized: !1 - })), w; + })), c; } _performExponentialBackoff(f) { - f = Math.min(b, f); - const w = y * Math.pow(2, f); - return new Promise((m) => setTimeout(() => m(), w)); - } - static dateTimeDeserializer(f, w) { - if (typeof w == "string") { - let m = new Date(w); - if (!isNaN(m.valueOf())) - return m; + f = Math.min(_, f); + const c = $ * Math.pow(2, f); + return new Promise((u) => setTimeout(() => u(), c)); + } + static dateTimeDeserializer(f, c) { + if (typeof c == "string") { + let u = new Date(c); + if (!isNaN(u.valueOf())) + return u; } - return w; + return c; } - async _processResponse(f, w) { - return new Promise(async (m, g) => { - const T = f.message.statusCode, v = { - statusCode: T, + async _processResponse(f, c) { + return new Promise(async (u, g) => { + const y = f.message.statusCode, A = { + statusCode: y, result: null, headers: {} }; - T == s.NotFound && m(v); - let O, $; + y == o.NotFound && u(A); + let P, S; try { - $ = await f.readBody(), $ && $.length > 0 && (w && w.deserializeDates ? O = JSON.parse($, G.dateTimeDeserializer) : O = JSON.parse($), v.result = O), v.headers = f.message.headers; - } catch (A) { + S = await f.readBody(), S && S.length > 0 && (c && c.deserializeDates ? P = JSON.parse(S, T.dateTimeDeserializer) : P = JSON.parse(S), A.result = P), A.headers = f.message.headers; + } catch { } - if (T > 299) { - let A; - O && O.message ? A = O.message : $ && $.length > 0 ? A = $ : A = "Failed request: (" + T + ")"; - let k = new _(A, T); - k.result = v.result, g(k); + if (y > 299) { + let R; + P && P.message ? R = P.message : S && S.length > 0 ? R = S : R = "Failed request: (" + y + ")"; + let N = new E(R, y); + N.result = A.result, g(N); } else - m(v); + u(A); }); } } - t.HttpClient = G; -}), utils$1 = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(h, b, y, _) { - _ === void 0 && (_ = y), Object.defineProperty(h, _, { enumerable: !0, get: function() { - return b[y]; + e.HttpClient = T; +})($r); +var Ne = {}; +Object.defineProperty(Ne, "__esModule", { value: !0 }); +class Vo { + constructor(t, r) { + this.username = t, this.password = r; + } + prepareRequest(t) { + t.headers.Authorization = "Basic " + Buffer.from(this.username + ":" + this.password).toString("base64"); + } + canHandleAuthentication(t) { + return !1; + } + handleAuthentication(t, r, n) { + return null; + } +} +Ne.BasicCredentialHandler = Vo; +class Jo { + constructor(t) { + this.token = t; + } + prepareRequest(t) { + t.headers.Authorization = "Bearer " + this.token; + } + canHandleAuthentication(t) { + return !1; + } + handleAuthentication(t, r, n) { + return null; + } +} +Ne.BearerCredentialHandler = Jo; +class Yo { + constructor(t) { + this.token = t; + } + prepareRequest(t) { + t.headers.Authorization = "Basic " + Buffer.from("PAT:" + this.token).toString("base64"); + } + canHandleAuthentication(t) { + return !1; + } + handleAuthentication(t, r, n) { + return null; + } +} +Ne.PersonalAccessTokenCredentialHandler = Yo; +var jr = O && O.__awaiter || function(e, t, r, n) { + function s(o) { + return o instanceof r ? o : new r(function(i) { + i(o); + }); + } + return new (r || (r = Promise))(function(o, i) { + function a(h) { + try { + p(n.next(h)); + } catch (w) { + i(w); + } + } + function l(h) { + try { + p(n.throw(h)); + } catch (w) { + i(w); + } + } + function p(h) { + h.done ? o(h.value) : s(h.value).then(a, l); + } + p((n = n.apply(e, t || [])).next()); + }); +}; +Object.defineProperty(ct, "__esModule", { value: !0 }), ct.OidcClient = void 0; +const Zo = $r, Xo = Ne, Fr = G; +class Ie { + static createHttpClient(t = !0, r = 10) { + const n = { + allowRetries: t, + maxRetries: r + }; + return new Zo.HttpClient("actions/oidc-client", [new Xo.BearerCredentialHandler(Ie.getRequestToken())], n); + } + static getRequestToken() { + const t = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN; + if (!t) + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); + return t; + } + static getIDTokenUrl() { + const t = process.env.ACTIONS_ID_TOKEN_REQUEST_URL; + if (!t) + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); + return t; + } + static getCall(t) { + var r; + return jr(this, void 0, void 0, function* () { + const o = (r = (yield Ie.createHttpClient().getJson(t).catch((i) => { + throw new Error(`Failed to get ID Token. + + Error Code : ${i.statusCode} + + Error Message: ${i.result.message}`); + })).result) === null || r === void 0 ? void 0 : r.value; + if (!o) + throw new Error("Response json body do not have ID Token field"); + return o; + }); + } + static getIDToken(t) { + return jr(this, void 0, void 0, function* () { + try { + let r = Ie.getIDTokenUrl(); + if (t) { + const s = encodeURIComponent(t); + r = `${r}&audience=${s}`; + } + Fr.debug(`ID token url is ${r}`); + const n = yield Ie.getCall(r); + return Fr.setSecret(n), n; + } catch (r) { + throw new Error(`Error message: ${r.message}`); + } + }); + } +} +ct.OidcClient = Ie, function(e) { + var t = O && O.__createBinding || (Object.create ? function(v, C, D, I) { + I === void 0 && (I = D), Object.defineProperty(v, I, { enumerable: !0, get: function() { + return C[D]; } }); - } : function(h, b, y, _) { - _ === void 0 && (_ = y), h[_] = b[y]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(h, b) { - Object.defineProperty(h, "default", { enumerable: !0, value: b }); - } : function(h, b) { - h.default = b; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(h) { - if (h && h.__esModule) - return h; - var b = {}; - if (h != null) - for (var y in h) - Object.hasOwnProperty.call(h, y) && n(b, h, y); - return s(b, h), b; + } : function(v, C, D, I) { + I === void 0 && (I = D), v[I] = C[D]; + }), r = O && O.__setModuleDefault || (Object.create ? function(v, C) { + Object.defineProperty(v, "default", { enumerable: !0, value: C }); + } : function(v, C) { + v.default = C; + }), n = O && O.__importStar || function(v) { + if (v && v.__esModule) + return v; + var C = {}; + if (v != null) + for (var D in v) + D !== "default" && Object.hasOwnProperty.call(v, D) && t(C, v, D); + return r(C, v), C; + }, s = O && O.__awaiter || function(v, C, D, I) { + function be(ye) { + return ye instanceof D ? ye : new D(function(ot) { + ot(ye); + }); + } + return new (D || (D = Promise))(function(ye, ot) { + function so(Te) { + try { + $t(I.next(Te)); + } catch (Gt) { + ot(Gt); + } + } + function oo(Te) { + try { + $t(I.throw(Te)); + } catch (Gt) { + ot(Gt); + } + } + function $t(Te) { + Te.done ? ye(Te.value) : be(Te.value).then(so, oo); + } + $t((I = I.apply(v, C || [])).next()); + }); }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.getApiBaseUrl = t.getProxyAgent = t.getAuthString = void 0; - const i = o(httpClient); - function p(h, b) { - if (!h && !b.auth) - throw new Error("Parameter token or opts.auth is required"); - if (h && b.auth) - throw new Error("Parameters token and opts.auth may not both be specified"); - return typeof b.auth == "string" ? b.auth : `token ${h}`; - } - t.getAuthString = p; - function a(h) { - return new i.HttpClient().getAgent(h); - } - t.getProxyAgent = a; + Object.defineProperty(e, "__esModule", { value: !0 }), e.getIDToken = e.getState = e.saveState = e.group = e.endGroup = e.startGroup = e.info = e.notice = e.warning = e.error = e.debug = e.isDebug = e.setFailed = e.setCommandEcho = e.setOutput = e.getBooleanInput = e.getMultilineInput = e.getInput = e.addPath = e.setSecret = e.exportVariable = e.ExitCode = void 0; + const o = Se, i = at, a = le, l = n(Le.default), p = n(qe.default), h = ct; + var w; + (function(v) { + v[v.Success = 0] = "Success", v[v.Failure = 1] = "Failure"; + })(w = e.ExitCode || (e.ExitCode = {})); + function _(v, C) { + const D = a.toCommandValue(C); + if (process.env[v] = D, process.env.GITHUB_ENV || "") { + const be = "_GitHubActionsFileCommandDelimeter_", ye = `${v}<<${be}${l.EOL}${D}${l.EOL}${be}`; + i.issueCommand("ENV", ye); + } else + o.issueCommand("set-env", { name: v }, D); + } + e.exportVariable = _; + function $(v) { + o.issueCommand("add-mask", {}, v); + } + e.setSecret = $; + function E(v) { + process.env.GITHUB_PATH || "" ? i.issueCommand("PATH", v) : o.issueCommand("add-path", {}, v), process.env.PATH = `${v}${p.delimiter}${process.env.PATH}`; + } + e.addPath = E; + function m(v, C) { + const D = process.env[`INPUT_${v.replace(/ /g, "_").toUpperCase()}`] || ""; + if (C && C.required && !D) + throw new Error(`Input required and not supplied: ${v}`); + return C && C.trimWhitespace === !1 ? D : D.trim(); + } + e.getInput = m; + function b(v, C) { + return m(v, C).split(` +`).filter((I) => I !== ""); + } + e.getMultilineInput = b; + function T(v, C) { + const D = ["true", "True", "TRUE"], I = ["false", "False", "FALSE"], be = m(v, C); + if (D.includes(be)) + return !0; + if (I.includes(be)) + return !1; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${v} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + e.getBooleanInput = T; + function d(v, C) { + process.stdout.write(l.EOL), o.issueCommand("set-output", { name: v }, C); + } + e.setOutput = d; + function f(v) { + o.issue("echo", v ? "on" : "off"); + } + e.setCommandEcho = f; + function c(v) { + process.exitCode = w.Failure, y(v); + } + e.setFailed = c; function u() { - return process.env.GITHUB_API_URL || "https://api.github.com"; + return process.env.RUNNER_DEBUG === "1"; } - t.getApiBaseUrl = u; -}); -function getUserAgent() { + e.isDebug = u; + function g(v) { + o.issueCommand("debug", {}, v); + } + e.debug = g; + function y(v, C = {}) { + o.issueCommand("error", a.toCommandProperties(C), v instanceof Error ? v.toString() : v); + } + e.error = y; + function A(v, C = {}) { + o.issueCommand("warning", a.toCommandProperties(C), v instanceof Error ? v.toString() : v); + } + e.warning = A; + function P(v, C = {}) { + o.issueCommand("notice", a.toCommandProperties(C), v instanceof Error ? v.toString() : v); + } + e.notice = P; + function S(v) { + process.stdout.write(v + l.EOL); + } + e.info = S; + function R(v) { + o.issue("group", v); + } + e.startGroup = R; + function N() { + o.issue("endgroup"); + } + e.endGroup = N; + function B(v, C) { + return s(this, void 0, void 0, function* () { + R(v); + let D; + try { + D = yield C(); + } finally { + N(); + } + return D; + }); + } + e.group = B; + function F(v, C) { + o.issueCommand("save-state", { name: v }, C); + } + e.saveState = F; + function we(v) { + return process.env[`STATE_${v}`] || ""; + } + e.getState = we; + function no(v) { + return s(this, void 0, void 0, function* () { + return yield h.OidcClient.getIDToken(v); + }); + } + e.getIDToken = no; +}(G); +var ze = {}, He = {}; +Object.defineProperty(He, "__esModule", { value: !0 }), He.Context = void 0; +const xr = ce.default, Qo = Le.default; +class ei { + constructor() { + if (this.payload = {}, process.env.GITHUB_EVENT_PATH) + if (xr.existsSync(process.env.GITHUB_EVENT_PATH)) + this.payload = JSON.parse(xr.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); + else { + const t = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${t} does not exist${Qo.EOL}`); + } + this.eventName = process.env.GITHUB_EVENT_NAME, this.sha = process.env.GITHUB_SHA, this.ref = process.env.GITHUB_REF, this.workflow = process.env.GITHUB_WORKFLOW, this.action = process.env.GITHUB_ACTION, this.actor = process.env.GITHUB_ACTOR, this.job = process.env.GITHUB_JOB, this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10), this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + } + get issue() { + const t = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (t.issue || t.pull_request || t).number }); + } + get repo() { + if (process.env.GITHUB_REPOSITORY) { + const [t, r] = process.env.GITHUB_REPOSITORY.split("/"); + return { owner: t, repo: r }; + } + if (this.payload.repository) + return { + owner: this.payload.repository.owner.login, + repo: this.payload.repository.name + }; + throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); + } +} +He.Context = ei; +var pe = {}, de = {}, Ir = {}, ut = {}; +Object.defineProperty(ut, "__esModule", { value: !0 }); +function ti(e) { + let t = e.protocol === "https:", r; + if (Br(e)) + return r; + let n; + return t ? n = process.env.https_proxy || process.env.HTTPS_PROXY : n = process.env.http_proxy || process.env.HTTP_PROXY, n && (r = new URL(n)), r; +} +ut.getProxyUrl = ti; +function Br(e) { + if (!e.hostname) + return !1; + let t = process.env.no_proxy || process.env.NO_PROXY || ""; + if (!t) + return !1; + let r; + e.port ? r = Number(e.port) : e.protocol === "http:" ? r = 80 : e.protocol === "https:" && (r = 443); + let n = [e.hostname.toUpperCase()]; + typeof r == "number" && n.push(`${n[0]}:${r}`); + for (let s of t.split(",").map((o) => o.trim().toUpperCase()).filter((o) => o)) + if (n.some((o) => o === s)) + return !0; + return !1; +} +ut.checkBypass = Br, function(e) { + Object.defineProperty(e, "__esModule", { value: !0 }); + const t = Me.default, r = it.default, n = ut; + let s; + var o; + (function(d) { + d[d.OK = 200] = "OK", d[d.MultipleChoices = 300] = "MultipleChoices", d[d.MovedPermanently = 301] = "MovedPermanently", d[d.ResourceMoved = 302] = "ResourceMoved", d[d.SeeOther = 303] = "SeeOther", d[d.NotModified = 304] = "NotModified", d[d.UseProxy = 305] = "UseProxy", d[d.SwitchProxy = 306] = "SwitchProxy", d[d.TemporaryRedirect = 307] = "TemporaryRedirect", d[d.PermanentRedirect = 308] = "PermanentRedirect", d[d.BadRequest = 400] = "BadRequest", d[d.Unauthorized = 401] = "Unauthorized", d[d.PaymentRequired = 402] = "PaymentRequired", d[d.Forbidden = 403] = "Forbidden", d[d.NotFound = 404] = "NotFound", d[d.MethodNotAllowed = 405] = "MethodNotAllowed", d[d.NotAcceptable = 406] = "NotAcceptable", d[d.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", d[d.RequestTimeout = 408] = "RequestTimeout", d[d.Conflict = 409] = "Conflict", d[d.Gone = 410] = "Gone", d[d.TooManyRequests = 429] = "TooManyRequests", d[d.InternalServerError = 500] = "InternalServerError", d[d.NotImplemented = 501] = "NotImplemented", d[d.BadGateway = 502] = "BadGateway", d[d.ServiceUnavailable = 503] = "ServiceUnavailable", d[d.GatewayTimeout = 504] = "GatewayTimeout"; + })(o = e.HttpCodes || (e.HttpCodes = {})); + var i; + (function(d) { + d.Accept = "accept", d.ContentType = "content-type"; + })(i = e.Headers || (e.Headers = {})); + var a; + (function(d) { + d.ApplicationJson = "application/json"; + })(a = e.MediaTypes || (e.MediaTypes = {})); + function l(d) { + let f = n.getProxyUrl(new URL(d)); + return f ? f.href : ""; + } + e.getProxyUrl = l; + const p = [ + o.MovedPermanently, + o.ResourceMoved, + o.SeeOther, + o.TemporaryRedirect, + o.PermanentRedirect + ], h = [ + o.BadGateway, + o.ServiceUnavailable, + o.GatewayTimeout + ], w = ["OPTIONS", "GET", "DELETE", "HEAD"], _ = 10, $ = 5; + class E extends Error { + constructor(f, c) { + super(f), this.name = "HttpClientError", this.statusCode = c, Object.setPrototypeOf(this, E.prototype); + } + } + e.HttpClientError = E; + class m { + constructor(f) { + this.message = f; + } + readBody() { + return new Promise(async (f, c) => { + let u = Buffer.alloc(0); + this.message.on("data", (g) => { + u = Buffer.concat([u, g]); + }), this.message.on("end", () => { + f(u.toString()); + }); + }); + } + } + e.HttpClientResponse = m; + function b(d) { + return new URL(d).protocol === "https:"; + } + e.isHttps = b; + class T { + constructor(f, c, u) { + this._ignoreSslError = !1, this._allowRedirects = !0, this._allowRedirectDowngrade = !1, this._maxRedirects = 50, this._allowRetries = !1, this._maxRetries = 1, this._keepAlive = !1, this._disposed = !1, this.userAgent = f, this.handlers = c || [], this.requestOptions = u, u && (u.ignoreSslError != null && (this._ignoreSslError = u.ignoreSslError), this._socketTimeout = u.socketTimeout, u.allowRedirects != null && (this._allowRedirects = u.allowRedirects), u.allowRedirectDowngrade != null && (this._allowRedirectDowngrade = u.allowRedirectDowngrade), u.maxRedirects != null && (this._maxRedirects = Math.max(u.maxRedirects, 0)), u.keepAlive != null && (this._keepAlive = u.keepAlive), u.allowRetries != null && (this._allowRetries = u.allowRetries), u.maxRetries != null && (this._maxRetries = u.maxRetries)); + } + options(f, c) { + return this.request("OPTIONS", f, null, c || {}); + } + get(f, c) { + return this.request("GET", f, null, c || {}); + } + del(f, c) { + return this.request("DELETE", f, null, c || {}); + } + post(f, c, u) { + return this.request("POST", f, c, u || {}); + } + patch(f, c, u) { + return this.request("PATCH", f, c, u || {}); + } + put(f, c, u) { + return this.request("PUT", f, c, u || {}); + } + head(f, c) { + return this.request("HEAD", f, null, c || {}); + } + sendStream(f, c, u, g) { + return this.request(f, c, u, g); + } + async getJson(f, c = {}) { + c[i.Accept] = this._getExistingOrDefaultHeader(c, i.Accept, a.ApplicationJson); + let u = await this.get(f, c); + return this._processResponse(u, this.requestOptions); + } + async postJson(f, c, u = {}) { + let g = JSON.stringify(c, null, 2); + u[i.Accept] = this._getExistingOrDefaultHeader(u, i.Accept, a.ApplicationJson), u[i.ContentType] = this._getExistingOrDefaultHeader(u, i.ContentType, a.ApplicationJson); + let y = await this.post(f, g, u); + return this._processResponse(y, this.requestOptions); + } + async putJson(f, c, u = {}) { + let g = JSON.stringify(c, null, 2); + u[i.Accept] = this._getExistingOrDefaultHeader(u, i.Accept, a.ApplicationJson), u[i.ContentType] = this._getExistingOrDefaultHeader(u, i.ContentType, a.ApplicationJson); + let y = await this.put(f, g, u); + return this._processResponse(y, this.requestOptions); + } + async patchJson(f, c, u = {}) { + let g = JSON.stringify(c, null, 2); + u[i.Accept] = this._getExistingOrDefaultHeader(u, i.Accept, a.ApplicationJson), u[i.ContentType] = this._getExistingOrDefaultHeader(u, i.ContentType, a.ApplicationJson); + let y = await this.patch(f, g, u); + return this._processResponse(y, this.requestOptions); + } + async request(f, c, u, g) { + if (this._disposed) + throw new Error("Client has already been disposed."); + let y = new URL(c), A = this._prepareRequest(f, y, g), P = this._allowRetries && w.indexOf(f) != -1 ? this._maxRetries + 1 : 1, S = 0, R; + for (; S < P; ) { + if (R = await this.requestRaw(A, u), R && R.message && R.message.statusCode === o.Unauthorized) { + let B; + for (let F = 0; F < this.handlers.length; F++) + if (this.handlers[F].canHandleAuthentication(R)) { + B = this.handlers[F]; + break; + } + return B ? B.handleAuthentication(this, A, u) : R; + } + let N = this._maxRedirects; + for (; p.indexOf(R.message.statusCode) != -1 && this._allowRedirects && N > 0; ) { + const B = R.message.headers.location; + if (!B) + break; + let F = new URL(B); + if (y.protocol == "https:" && y.protocol != F.protocol && !this._allowRedirectDowngrade) + throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); + if (await R.readBody(), F.hostname !== y.hostname) + for (let we in g) + we.toLowerCase() === "authorization" && delete g[we]; + A = this._prepareRequest(f, F, g), R = await this.requestRaw(A, u), N--; + } + if (h.indexOf(R.message.statusCode) == -1) + return R; + S += 1, S < P && (await R.readBody(), await this._performExponentialBackoff(S)); + } + return R; + } + dispose() { + this._agent && this._agent.destroy(), this._disposed = !0; + } + requestRaw(f, c) { + return new Promise((u, g) => { + let y = function(A, P) { + A && g(A), u(P); + }; + this.requestRawWithCallback(f, c, y); + }); + } + requestRawWithCallback(f, c, u) { + let g; + typeof c == "string" && (f.options.headers["Content-Length"] = Buffer.byteLength(c, "utf8")); + let y = !1, A = (S, R) => { + y || (y = !0, u(S, R)); + }, P = f.httpModule.request(f.options, (S) => { + let R = new m(S); + A(null, R); + }); + P.on("socket", (S) => { + g = S; + }), P.setTimeout(this._socketTimeout || 3 * 6e4, () => { + g && g.end(), A(new Error("Request timeout: " + f.options.path), null); + }), P.on("error", function(S) { + A(S, null); + }), c && typeof c == "string" && P.write(c, "utf8"), c && typeof c != "string" ? (c.on("close", function() { + P.end(); + }), c.pipe(P)) : P.end(); + } + getAgent(f) { + let c = new URL(f); + return this._getAgent(c); + } + _prepareRequest(f, c, u) { + const g = {}; + g.parsedUrl = c; + const y = g.parsedUrl.protocol === "https:"; + g.httpModule = y ? r : t; + const A = y ? 443 : 80; + return g.options = {}, g.options.host = g.parsedUrl.hostname, g.options.port = g.parsedUrl.port ? parseInt(g.parsedUrl.port) : A, g.options.path = (g.parsedUrl.pathname || "") + (g.parsedUrl.search || ""), g.options.method = f, g.options.headers = this._mergeHeaders(u), this.userAgent != null && (g.options.headers["user-agent"] = this.userAgent), g.options.agent = this._getAgent(g.parsedUrl), this.handlers && this.handlers.forEach((P) => { + P.prepareRequest(g.options); + }), g; + } + _mergeHeaders(f) { + const c = (u) => Object.keys(u).reduce((g, y) => (g[y.toLowerCase()] = u[y], g), {}); + return this.requestOptions && this.requestOptions.headers ? Object.assign({}, c(this.requestOptions.headers), c(f)) : c(f || {}); + } + _getExistingOrDefaultHeader(f, c, u) { + const g = (A) => Object.keys(A).reduce((P, S) => (P[S.toLowerCase()] = A[S], P), {}); + let y; + return this.requestOptions && this.requestOptions.headers && (y = g(this.requestOptions.headers)[c]), f[c] || y || u; + } + _getAgent(f) { + let c, u = n.getProxyUrl(f), g = u && u.hostname; + if (this._keepAlive && g && (c = this._proxyAgent), this._keepAlive && !g && (c = this._agent), c) + return c; + const y = f.protocol === "https:"; + let A = 100; + if (this.requestOptions && (A = this.requestOptions.maxSockets || t.globalAgent.maxSockets), g) { + s || (s = Ur); + const P = { + maxSockets: A, + keepAlive: this._keepAlive, + proxy: { + proxyAuth: `${u.username}:${u.password}`, + host: u.hostname, + port: u.port + } + }; + let S; + const R = u.protocol === "https:"; + y ? S = R ? s.httpsOverHttps : s.httpsOverHttp : S = R ? s.httpOverHttps : s.httpOverHttp, c = S(P), this._proxyAgent = c; + } + if (this._keepAlive && !c) { + const P = { keepAlive: this._keepAlive, maxSockets: A }; + c = y ? new r.Agent(P) : new t.Agent(P), this._agent = c; + } + return c || (c = y ? r.globalAgent : t.globalAgent), y && this._ignoreSslError && (c.options = Object.assign(c.options || {}, { + rejectUnauthorized: !1 + })), c; + } + _performExponentialBackoff(f) { + f = Math.min(_, f); + const c = $ * Math.pow(2, f); + return new Promise((u) => setTimeout(() => u(), c)); + } + static dateTimeDeserializer(f, c) { + if (typeof c == "string") { + let u = new Date(c); + if (!isNaN(u.valueOf())) + return u; + } + return c; + } + async _processResponse(f, c) { + return new Promise(async (u, g) => { + const y = f.message.statusCode, A = { + statusCode: y, + result: null, + headers: {} + }; + y == o.NotFound && u(A); + let P, S; + try { + S = await f.readBody(), S && S.length > 0 && (c && c.deserializeDates ? P = JSON.parse(S, T.dateTimeDeserializer) : P = JSON.parse(S), A.result = P), A.headers = f.message.headers; + } catch { + } + if (y > 299) { + let R; + P && P.message ? R = P.message : S && S.length > 0 ? R = S : R = "Failed request: (" + y + ")"; + let N = new E(R, y); + N.result = A.result, g(N); + } else + u(A); + }); + } + } + e.HttpClient = T; +}(Ir); +var ri = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), ni = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), si = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + Object.hasOwnProperty.call(e, r) && ri(t, e, r); + return ni(t, e), t; +}; +Object.defineProperty(de, "__esModule", { value: !0 }), de.getApiBaseUrl = de.getProxyAgent = de.getAuthString = void 0; +const oi = si(Ir); +function ii(e, t) { + if (!e && !t.auth) + throw new Error("Parameter token or opts.auth is required"); + if (e && t.auth) + throw new Error("Parameters token and opts.auth may not both be specified"); + return typeof t.auth == "string" ? t.auth : `token ${e}`; +} +de.getAuthString = ii; +function ai(e) { + return new oi.HttpClient().getAgent(e); +} +de.getProxyAgent = ai; +function ci() { + return process.env.GITHUB_API_URL || "https://api.github.com"; +} +de.getApiBaseUrl = ci; +function pt() { return typeof navigator == "object" && "userAgent" in navigator ? navigator.userAgent : typeof process == "object" && "version" in process ? `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})` : ""; } -var register_1 = register; -function register(e, t, n, s) { - if (typeof n != "function") +var dt = { exports: {} }, li = Lr; +function Lr(e, t, r, n) { + if (typeof r != "function") throw new Error("method for before hook must be a function"); - return s || (s = {}), Array.isArray(t) ? t.reverse().reduce(function(o, i) { - return register.bind(null, e, i, o, s); - }, n)() : Promise.resolve().then(function() { - return e.registry[t] ? e.registry[t].reduce(function(o, i) { - return i.hook.bind(null, o, s); - }, n)() : n(s); + return n || (n = {}), Array.isArray(t) ? t.reverse().reduce(function(s, o) { + return Lr.bind(null, e, o, s, n); + }, r)() : Promise.resolve().then(function() { + return e.registry[t] ? e.registry[t].reduce(function(s, o) { + return o.hook.bind(null, s, n); + }, r)() : r(n); }); } -var add = addHook; -function addHook(e, t, n, s) { - var o = s; - e.registry[n] || (e.registry[n] = []), t === "before" && (s = function(i, p) { - return Promise.resolve().then(o.bind(null, p)).then(i.bind(null, p)); - }), t === "after" && (s = function(i, p) { +var ui = pi; +function pi(e, t, r, n) { + var s = n; + e.registry[r] || (e.registry[r] = []), t === "before" && (n = function(o, i) { + return Promise.resolve().then(s.bind(null, i)).then(o.bind(null, i)); + }), t === "after" && (n = function(o, i) { var a; - return Promise.resolve().then(i.bind(null, p)).then(function(u) { - return a = u, o(a, p); + return Promise.resolve().then(o.bind(null, i)).then(function(l) { + return a = l, s(a, i); }).then(function() { return a; }); - }), t === "error" && (s = function(i, p) { - return Promise.resolve().then(i.bind(null, p)).catch(function(a) { - return o(a, p); + }), t === "error" && (n = function(o, i) { + return Promise.resolve().then(o.bind(null, i)).catch(function(a) { + return s(a, i); }); - }), e.registry[n].push({ - hook: s, - orig: o + }), e.registry[r].push({ + hook: n, + orig: s }); } -var remove = removeHook; -function removeHook(e, t, n) { +var di = fi; +function fi(e, t, r) { if (!!e.registry[t]) { - var s = e.registry[t].map(function(o) { - return o.orig; - }).indexOf(n); - s !== -1 && e.registry[t].splice(s, 1); - } -} -var bind = Function.bind, bindable = bind.bind(bind); -function bindApi(e, t, n) { - var s = bindable(remove, null).apply(null, n ? [t, n] : [t]); - e.api = { remove: s }, e.remove = s, ["before", "error", "after", "wrap"].forEach(function(o) { - var i = n ? [t, o, n] : [t, o]; - e[o] = e.api[o] = bindable(add, null).apply(null, i); + var n = e.registry[t].map(function(s) { + return s.orig; + }).indexOf(r); + n !== -1 && e.registry[t].splice(n, 1); + } +} +var qr = li, hi = ui, mi = di, Mr = Function.bind, Nr = Mr.bind(Mr); +function zr(e, t, r) { + var n = Nr(mi, null).apply(null, r ? [t, r] : [t]); + e.api = { remove: n }, e.remove = n, ["before", "error", "after", "wrap"].forEach(function(s) { + var o = r ? [t, s, r] : [t, s]; + e[s] = e.api[s] = Nr(hi, null).apply(null, o); }); } -function HookSingular() { +function gi() { var e = "h", t = { registry: {} - }, n = register_1.bind(null, t, e); - return bindApi(n, t, e), n; + }, r = qr.bind(null, t, e); + return zr(r, t, e), r; } -function HookCollection() { +function Hr() { var e = { registry: {} - }, t = register_1.bind(null, e); - return bindApi(t, e), t; -} -var collectionHookDeprecationMessageDisplayed = !1; -function Hook() { - return collectionHookDeprecationMessageDisplayed || (console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'), collectionHookDeprecationMessageDisplayed = !0), HookCollection(); -} -Hook.Singular = HookSingular.bind(), Hook.Collection = HookCollection.bind(); -var beforeAfterHook = Hook, Hook_1 = Hook, Singular = Hook.Singular, Collection = Hook.Collection; -beforeAfterHook.Hook = Hook_1, beforeAfterHook.Singular = Singular, beforeAfterHook.Collection = Collection; -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ -function isObject$1(e) { + }, t = qr.bind(null, e); + return zr(t, e), t; +} +var Wr = !1; +function Re() { + return Wr || (console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'), Wr = !0), Hr(); +} +Re.Singular = gi.bind(), Re.Collection = Hr.bind(), dt.exports = Re, dt.exports.Hook = Re, dt.exports.Singular = Re.Singular; +var wi = dt.exports.Collection = Re.Collection; +function Kr(e) { return Object.prototype.toString.call(e) === "[object Object]"; } -function isPlainObject(e) { - var t, n; - return isObject$1(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (n = t.prototype, !(isObject$1(n) === !1 || n.hasOwnProperty("isPrototypeOf") === !1))); +function Vr(e) { + var t, r; + return Kr(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (r = t.prototype, !(Kr(r) === !1 || r.hasOwnProperty("isPrototypeOf") === !1))); } -function lowercaseKeys(e) { - return e ? Object.keys(e).reduce((t, n) => (t[n.toLowerCase()] = e[n], t), {}) : {}; +function bi(e) { + return e ? Object.keys(e).reduce((t, r) => (t[r.toLowerCase()] = e[r], t), {}) : {}; } -function mergeDeep(e, t) { - const n = Object.assign({}, e); - return Object.keys(t).forEach((s) => { - isPlainObject(t[s]) ? s in e ? n[s] = mergeDeep(e[s], t[s]) : Object.assign(n, { [s]: t[s] }) : Object.assign(n, { [s]: t[s] }); - }), n; +function Jr(e, t) { + const r = Object.assign({}, e); + return Object.keys(t).forEach((n) => { + Vr(t[n]) ? n in e ? r[n] = Jr(e[n], t[n]) : Object.assign(r, { [n]: t[n] }) : Object.assign(r, { [n]: t[n] }); + }), r; } -function removeUndefinedProperties(e) { +function Yr(e) { for (const t in e) e[t] === void 0 && delete e[t]; return e; } -function merge(e, t, n) { +function jt(e, t, r) { if (typeof t == "string") { - let [o, i] = t.split(" "); - n = Object.assign(i ? { method: o, url: i } : { url: o }, n); + let [s, o] = t.split(" "); + r = Object.assign(o ? { method: s, url: o } : { url: s }, r); } else - n = Object.assign({}, t); - n.headers = lowercaseKeys(n.headers), removeUndefinedProperties(n), removeUndefinedProperties(n.headers); - const s = mergeDeep(e || {}, n); - return e && e.mediaType.previews.length && (s.mediaType.previews = e.mediaType.previews.filter((o) => !s.mediaType.previews.includes(o)).concat(s.mediaType.previews)), s.mediaType.previews = s.mediaType.previews.map((o) => o.replace(/-preview/, "")), s; + r = Object.assign({}, t); + r.headers = bi(r.headers), Yr(r), Yr(r.headers); + const n = Jr(e || {}, r); + return e && e.mediaType.previews.length && (n.mediaType.previews = e.mediaType.previews.filter((s) => !n.mediaType.previews.includes(s)).concat(n.mediaType.previews)), n.mediaType.previews = n.mediaType.previews.map((s) => s.replace(/-preview/, "")), n; } -function addQueryParameters(e, t) { - const n = /\?/.test(e) ? "&" : "?", s = Object.keys(t); - return s.length === 0 ? e : e + n + s.map((o) => o === "q" ? "q=" + t.q.split("+").map(encodeURIComponent).join("+") : `${o}=${encodeURIComponent(t[o])}`).join("&"); +function yi(e, t) { + const r = /\?/.test(e) ? "&" : "?", n = Object.keys(t); + return n.length === 0 ? e : e + r + n.map((s) => s === "q" ? "q=" + t.q.split("+").map(encodeURIComponent).join("+") : `${s}=${encodeURIComponent(t[s])}`).join("&"); } -const urlVariableRegex = /\{[^}]+\}/g; -function removeNonChars(e) { +const Ti = /\{[^}]+\}/g; +function _i(e) { return e.replace(/^\W+|\W+$/g, "").split(/,/); } -function extractUrlVariableNames(e) { - const t = e.match(urlVariableRegex); - return t ? t.map(removeNonChars).reduce((n, s) => n.concat(s), []) : []; +function Ei(e) { + const t = e.match(Ti); + return t ? t.map(_i).reduce((r, n) => r.concat(n), []) : []; } -function omit(e, t) { - return Object.keys(e).filter((n) => !t.includes(n)).reduce((n, s) => (n[s] = e[s], n), {}); +function Zr(e, t) { + return Object.keys(e).filter((r) => !t.includes(r)).reduce((r, n) => (r[n] = e[n], r), {}); } -function encodeReserved(e) { +function Xr(e) { return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t) { return /%[0-9A-Fa-f]/.test(t) || (t = encodeURI(t).replace(/%5B/g, "[").replace(/%5D/g, "]")), t; }).join(""); } -function encodeUnreserved(e) { +function $e(e) { return encodeURIComponent(e).replace(/[!'()*]/g, function(t) { return "%" + t.charCodeAt(0).toString(16).toUpperCase(); }); } -function encodeValue(e, t, n) { - return t = e === "+" || e === "#" ? encodeReserved(t) : encodeUnreserved(t), n ? encodeUnreserved(n) + "=" + t : t; +function We(e, t, r) { + return t = e === "+" || e === "#" ? Xr(t) : $e(t), r ? $e(r) + "=" + t : t; } -function isDefined(e) { +function Ge(e) { return e != null; } -function isKeyOperator(e) { +function Ft(e) { return e === ";" || e === "&" || e === "?"; } -function getValues(e, t, n, s) { - var o = e[n], i = []; - if (isDefined(o) && o !== "") - if (typeof o == "string" || typeof o == "number" || typeof o == "boolean") - o = o.toString(), s && s !== "*" && (o = o.substring(0, parseInt(s, 10))), i.push(encodeValue(t, o, isKeyOperator(t) ? n : "")); - else if (s === "*") - Array.isArray(o) ? o.filter(isDefined).forEach(function(p) { - i.push(encodeValue(t, p, isKeyOperator(t) ? n : "")); - }) : Object.keys(o).forEach(function(p) { - isDefined(o[p]) && i.push(encodeValue(t, o[p], p)); +function vi(e, t, r, n) { + var s = e[r], o = []; + if (Ge(s) && s !== "") + if (typeof s == "string" || typeof s == "number" || typeof s == "boolean") + s = s.toString(), n && n !== "*" && (s = s.substring(0, parseInt(n, 10))), o.push(We(t, s, Ft(t) ? r : "")); + else if (n === "*") + Array.isArray(s) ? s.filter(Ge).forEach(function(i) { + o.push(We(t, i, Ft(t) ? r : "")); + }) : Object.keys(s).forEach(function(i) { + Ge(s[i]) && o.push(We(t, s[i], i)); }); else { - const p = []; - Array.isArray(o) ? o.filter(isDefined).forEach(function(a) { - p.push(encodeValue(t, a)); - }) : Object.keys(o).forEach(function(a) { - isDefined(o[a]) && (p.push(encodeUnreserved(a)), p.push(encodeValue(t, o[a].toString()))); - }), isKeyOperator(t) ? i.push(encodeUnreserved(n) + "=" + p.join(",")) : p.length !== 0 && i.push(p.join(",")); + const i = []; + Array.isArray(s) ? s.filter(Ge).forEach(function(a) { + i.push(We(t, a)); + }) : Object.keys(s).forEach(function(a) { + Ge(s[a]) && (i.push($e(a)), i.push(We(t, s[a].toString()))); + }), Ft(t) ? o.push($e(r) + "=" + i.join(",")) : i.length !== 0 && o.push(i.join(",")); } else - t === ";" ? isDefined(o) && i.push(encodeUnreserved(n)) : o === "" && (t === "&" || t === "?") ? i.push(encodeUnreserved(n) + "=") : o === "" && i.push(""); - return i; + t === ";" ? Ge(s) && o.push($e(r)) : s === "" && (t === "&" || t === "?") ? o.push($e(r) + "=") : s === "" && o.push(""); + return o; } -function parseUrl(e) { +function Oi(e) { return { - expand: expand.bind(null, e) + expand: Pi.bind(null, e) }; } -function expand(e, t) { - var n = ["+", "#", ".", "/", ";", "?", "&"]; - return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(s, o, i) { - if (o) { +function Pi(e, t) { + var r = ["+", "#", ".", "/", ";", "?", "&"]; + return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(n, s, o) { + if (s) { let a = ""; - const u = []; - if (n.indexOf(o.charAt(0)) !== -1 && (a = o.charAt(0), o = o.substr(1)), o.split(/,/g).forEach(function(h) { - var b = /([^:\*]*)(?::(\d+)|(\*))?/.exec(h); - u.push(getValues(t, a, b[1], b[2] || b[3])); + const l = []; + if (r.indexOf(s.charAt(0)) !== -1 && (a = s.charAt(0), s = s.substr(1)), s.split(/,/g).forEach(function(p) { + var h = /([^:\*]*)(?::(\d+)|(\*))?/.exec(p); + l.push(vi(t, a, h[1], h[2] || h[3])); }), a && a !== "+") { - var p = ","; - return a === "?" ? p = "&" : a !== "#" && (p = a), (u.length !== 0 ? a : "") + u.join(p); + var i = ","; + return a === "?" ? i = "&" : a !== "#" && (i = a), (l.length !== 0 ? a : "") + l.join(i); } else - return u.join(","); + return l.join(","); } else - return encodeReserved(i); + return Xr(o); }); } -function parse(e) { - let t = e.method.toUpperCase(), n = (e.url || "/").replace(/:([a-z]\w+)/g, "{$1}"), s = Object.assign({}, e.headers), o, i = omit(e, [ +function Qr(e) { + let t = e.method.toUpperCase(), r = (e.url || "/").replace(/:([a-z]\w+)/g, "{$1}"), n = Object.assign({}, e.headers), s, o = Zr(e, [ "method", "baseUrl", "url", @@ -976,354 +1386,354 @@ function parse(e) { "request", "mediaType" ]); - const p = extractUrlVariableNames(n); - n = parseUrl(n).expand(i), /^http/.test(n) || (n = e.baseUrl + n); - const a = Object.keys(e).filter((b) => p.includes(b)).concat("baseUrl"), u = omit(i, a); - if (!/application\/octet-stream/i.test(s.accept) && (e.mediaType.format && (s.accept = s.accept.split(/,/).map((b) => b.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${e.mediaType.format}`)).join(",")), e.mediaType.previews.length)) { - const b = s.accept.match(/[\w-]+(?=-preview)/g) || []; - s.accept = b.concat(e.mediaType.previews).map((y) => { + const i = Ei(r); + r = Oi(r).expand(o), /^http/.test(r) || (r = e.baseUrl + r); + const a = Object.keys(e).filter((h) => i.includes(h)).concat("baseUrl"), l = Zr(o, a); + if (!/application\/octet-stream/i.test(n.accept) && (e.mediaType.format && (n.accept = n.accept.split(/,/).map((h) => h.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${e.mediaType.format}`)).join(",")), e.mediaType.previews.length)) { + const h = n.accept.match(/[\w-]+(?=-preview)/g) || []; + n.accept = h.concat(e.mediaType.previews).map((w) => { const _ = e.mediaType.format ? `.${e.mediaType.format}` : "+json"; - return `application/vnd.github.${y}-preview${_}`; + return `application/vnd.github.${w}-preview${_}`; }).join(","); } - return ["GET", "HEAD"].includes(t) ? n = addQueryParameters(n, u) : "data" in u ? o = u.data : Object.keys(u).length ? o = u : s["content-length"] = 0, !s["content-type"] && typeof o != "undefined" && (s["content-type"] = "application/json; charset=utf-8"), ["PATCH", "PUT"].includes(t) && typeof o == "undefined" && (o = ""), Object.assign({ method: t, url: n, headers: s }, typeof o != "undefined" ? { body: o } : null, e.request ? { request: e.request } : null); + return ["GET", "HEAD"].includes(t) ? r = yi(r, l) : "data" in l ? s = l.data : Object.keys(l).length ? s = l : n["content-length"] = 0, !n["content-type"] && typeof s < "u" && (n["content-type"] = "application/json; charset=utf-8"), ["PATCH", "PUT"].includes(t) && typeof s > "u" && (s = ""), Object.assign({ method: t, url: r, headers: n }, typeof s < "u" ? { body: s } : null, e.request ? { request: e.request } : null); } -function endpointWithDefaults(e, t, n) { - return parse(merge(e, t, n)); +function Si(e, t, r) { + return Qr(jt(e, t, r)); } -function withDefaults$2(e, t) { - const n = merge(e, t), s = endpointWithDefaults.bind(null, n); - return Object.assign(s, { - DEFAULTS: n, - defaults: withDefaults$2.bind(null, n), - merge: merge.bind(null, n), - parse +function en(e, t) { + const r = jt(e, t), n = Si.bind(null, r); + return Object.assign(n, { + DEFAULTS: r, + defaults: en.bind(null, r), + merge: jt.bind(null, r), + parse: Qr }); } -const VERSION$5 = "6.0.10", userAgent = `octokit-endpoint.js/${VERSION$5} ${getUserAgent()}`, DEFAULTS = { +const Ai = "6.0.10", Ri = `octokit-endpoint.js/${Ai} ${pt()}`, $i = { method: "GET", baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json", - "user-agent": userAgent + "user-agent": Ri }, mediaType: { format: "", previews: [] } -}, endpoint = withDefaults$2(null, DEFAULTS), Readable = Stream__default.default.Readable, BUFFER = Symbol("buffer"), TYPE = Symbol("type"); -class Blob { +}, Gi = en(null, $i), Ci = W.default.Readable, te = Symbol("buffer"), xt = Symbol("type"); +class Be { constructor() { - this[TYPE] = ""; - const t = arguments[0], n = arguments[1], s = []; - let o = 0; + this[xt] = ""; + const t = arguments[0], r = arguments[1], n = []; + let s = 0; if (t) { - const p = t, a = Number(p.length); - for (let u = 0; u < a; u++) { - const h = p[u]; - let b; - h instanceof Buffer ? b = h : ArrayBuffer.isView(h) ? b = Buffer.from(h.buffer, h.byteOffset, h.byteLength) : h instanceof ArrayBuffer ? b = Buffer.from(h) : h instanceof Blob ? b = h[BUFFER] : b = Buffer.from(typeof h == "string" ? h : String(h)), o += b.length, s.push(b); + const i = t, a = Number(i.length); + for (let l = 0; l < a; l++) { + const p = i[l]; + let h; + p instanceof Buffer ? h = p : ArrayBuffer.isView(p) ? h = Buffer.from(p.buffer, p.byteOffset, p.byteLength) : p instanceof ArrayBuffer ? h = Buffer.from(p) : p instanceof Be ? h = p[te] : h = Buffer.from(typeof p == "string" ? p : String(p)), s += h.length, n.push(h); } } - this[BUFFER] = Buffer.concat(s); - let i = n && n.type !== void 0 && String(n.type).toLowerCase(); - i && !/[^\u0020-\u007E]/.test(i) && (this[TYPE] = i); + this[te] = Buffer.concat(n); + let o = r && r.type !== void 0 && String(r.type).toLowerCase(); + o && !/[^\u0020-\u007E]/.test(o) && (this[xt] = o); } get size() { - return this[BUFFER].length; + return this[te].length; } get type() { - return this[TYPE]; + return this[xt]; } text() { - return Promise.resolve(this[BUFFER].toString()); + return Promise.resolve(this[te].toString()); } arrayBuffer() { - const t = this[BUFFER], n = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength); - return Promise.resolve(n); + const t = this[te], r = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength); + return Promise.resolve(r); } stream() { - const t = new Readable(); + const t = new Ci(); return t._read = function() { - }, t.push(this[BUFFER]), t.push(null), t; + }, t.push(this[te]), t.push(null), t; } toString() { return "[object Blob]"; } slice() { - const t = this.size, n = arguments[0], s = arguments[1]; - let o, i; - n === void 0 ? o = 0 : n < 0 ? o = Math.max(t + n, 0) : o = Math.min(n, t), s === void 0 ? i = t : s < 0 ? i = Math.max(t + s, 0) : i = Math.min(s, t); - const p = Math.max(i - o, 0), u = this[BUFFER].slice(o, o + p), h = new Blob([], { type: arguments[2] }); - return h[BUFFER] = u, h; + const t = this.size, r = arguments[0], n = arguments[1]; + let s, o; + r === void 0 ? s = 0 : r < 0 ? s = Math.max(t + r, 0) : s = Math.min(r, t), n === void 0 ? o = t : n < 0 ? o = Math.max(t + n, 0) : o = Math.min(n, t); + const i = Math.max(o - s, 0), l = this[te].slice(s, s + i), p = new Be([], { type: arguments[2] }); + return p[te] = l, p; } } -Object.defineProperties(Blob.prototype, { +Object.defineProperties(Be.prototype, { size: { enumerable: !0 }, type: { enumerable: !0 }, slice: { enumerable: !0 } -}), Object.defineProperty(Blob.prototype, Symbol.toStringTag, { +}), Object.defineProperty(Be.prototype, Symbol.toStringTag, { value: "Blob", writable: !1, enumerable: !1, configurable: !0 }); -function FetchError(e, t, n) { - Error.call(this, e), this.message = e, this.type = t, n && (this.code = this.errno = n.code), Error.captureStackTrace(this, this.constructor); +function q(e, t, r) { + Error.call(this, e), this.message = e, this.type = t, r && (this.code = this.errno = r.code), Error.captureStackTrace(this, this.constructor); } -FetchError.prototype = Object.create(Error.prototype), FetchError.prototype.constructor = FetchError, FetchError.prototype.name = "FetchError"; -let convert; +q.prototype = Object.create(Error.prototype), q.prototype.constructor = q, q.prototype.name = "FetchError"; +let It; try { - convert = require("encoding").convert; -} catch (e) { -} -const INTERNALS = Symbol("Body internals"), PassThrough = Stream__default.default.PassThrough; -function Body(e) { - var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = n.size; - let o = s === void 0 ? 0 : s; - var i = n.timeout; - let p = i === void 0 ? 0 : i; - e == null ? e = null : isURLSearchParams(e) ? e = Buffer.from(e.toString()) : isBlob(e) || Buffer.isBuffer(e) || (Object.prototype.toString.call(e) === "[object ArrayBuffer]" ? e = Buffer.from(e) : ArrayBuffer.isView(e) ? e = Buffer.from(e.buffer, e.byteOffset, e.byteLength) : e instanceof Stream__default.default || (e = Buffer.from(String(e)))), this[INTERNALS] = { + It = require("encoding").convert; +} catch { +} +const re = Symbol("Body internals"), tn = W.default.PassThrough; +function x(e) { + var t = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = r.size; + let s = n === void 0 ? 0 : n; + var o = r.timeout; + let i = o === void 0 ? 0 : o; + e == null ? e = null : rn(e) ? e = Buffer.from(e.toString()) : Ke(e) || Buffer.isBuffer(e) || (Object.prototype.toString.call(e) === "[object ArrayBuffer]" ? e = Buffer.from(e) : ArrayBuffer.isView(e) ? e = Buffer.from(e.buffer, e.byteOffset, e.byteLength) : e instanceof W.default || (e = Buffer.from(String(e)))), this[re] = { body: e, disturbed: !1, error: null - }, this.size = o, this.timeout = p, e instanceof Stream__default.default && e.on("error", function(a) { - const u = a.name === "AbortError" ? a : new FetchError(`Invalid response body while trying to fetch ${t.url}: ${a.message}`, "system", a); - t[INTERNALS].error = u; + }, this.size = s, this.timeout = i, e instanceof W.default && e.on("error", function(a) { + const l = a.name === "AbortError" ? a : new q(`Invalid response body while trying to fetch ${t.url}: ${a.message}`, "system", a); + t[re].error = l; }); } -Body.prototype = { +x.prototype = { get body() { - return this[INTERNALS].body; + return this[re].body; }, get bodyUsed() { - return this[INTERNALS].disturbed; + return this[re].disturbed; }, arrayBuffer() { - return consumeBody.call(this).then(function(e) { + return Ce.call(this).then(function(e) { return e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength); }); }, blob() { let e = this.headers && this.headers.get("content-type") || ""; - return consumeBody.call(this).then(function(t) { - return Object.assign(new Blob([], { + return Ce.call(this).then(function(t) { + return Object.assign(new Be([], { type: e.toLowerCase() }), { - [BUFFER]: t + [te]: t }); }); }, json() { var e = this; - return consumeBody.call(this).then(function(t) { + return Ce.call(this).then(function(t) { try { return JSON.parse(t.toString()); - } catch (n) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${n.message}`, "invalid-json")); + } catch (r) { + return x.Promise.reject(new q(`invalid json response body at ${e.url} reason: ${r.message}`, "invalid-json")); } }); }, text() { - return consumeBody.call(this).then(function(e) { + return Ce.call(this).then(function(e) { return e.toString(); }); }, buffer() { - return consumeBody.call(this); + return Ce.call(this); }, textConverted() { var e = this; - return consumeBody.call(this).then(function(t) { - return convertBody(t, e.headers); + return Ce.call(this).then(function(t) { + return ki(t, e.headers); }); } -}, Object.defineProperties(Body.prototype, { +}, Object.defineProperties(x.prototype, { body: { enumerable: !0 }, bodyUsed: { enumerable: !0 }, arrayBuffer: { enumerable: !0 }, blob: { enumerable: !0 }, json: { enumerable: !0 }, text: { enumerable: !0 } -}), Body.mixIn = function(e) { - for (const t of Object.getOwnPropertyNames(Body.prototype)) +}), x.mixIn = function(e) { + for (const t of Object.getOwnPropertyNames(x.prototype)) if (!(t in e)) { - const n = Object.getOwnPropertyDescriptor(Body.prototype, t); - Object.defineProperty(e, t, n); + const r = Object.getOwnPropertyDescriptor(x.prototype, t); + Object.defineProperty(e, t, r); } }; -function consumeBody() { +function Ce() { var e = this; - if (this[INTERNALS].disturbed) - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - if (this[INTERNALS].disturbed = !0, this[INTERNALS].error) - return Body.Promise.reject(this[INTERNALS].error); + if (this[re].disturbed) + return x.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + if (this[re].disturbed = !0, this[re].error) + return x.Promise.reject(this[re].error); let t = this.body; if (t === null) - return Body.Promise.resolve(Buffer.alloc(0)); - if (isBlob(t) && (t = t.stream()), Buffer.isBuffer(t)) - return Body.Promise.resolve(t); - if (!(t instanceof Stream__default.default)) - return Body.Promise.resolve(Buffer.alloc(0)); - let n = [], s = 0, o = !1; - return new Body.Promise(function(i, p) { + return x.Promise.resolve(Buffer.alloc(0)); + if (Ke(t) && (t = t.stream()), Buffer.isBuffer(t)) + return x.Promise.resolve(t); + if (!(t instanceof W.default)) + return x.Promise.resolve(Buffer.alloc(0)); + let r = [], n = 0, s = !1; + return new x.Promise(function(o, i) { let a; e.timeout && (a = setTimeout(function() { - o = !0, p(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`, "body-timeout")); - }, e.timeout)), t.on("error", function(u) { - u.name === "AbortError" ? (o = !0, p(u)) : p(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${u.message}`, "system", u)); - }), t.on("data", function(u) { - if (!(o || u === null)) { - if (e.size && s + u.length > e.size) { - o = !0, p(new FetchError(`content size at ${e.url} over limit: ${e.size}`, "max-size")); + s = !0, i(new q(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`, "body-timeout")); + }, e.timeout)), t.on("error", function(l) { + l.name === "AbortError" ? (s = !0, i(l)) : i(new q(`Invalid response body while trying to fetch ${e.url}: ${l.message}`, "system", l)); + }), t.on("data", function(l) { + if (!(s || l === null)) { + if (e.size && n + l.length > e.size) { + s = !0, i(new q(`content size at ${e.url} over limit: ${e.size}`, "max-size")); return; } - s += u.length, n.push(u); + n += l.length, r.push(l); } }), t.on("end", function() { - if (!o) { + if (!s) { clearTimeout(a); try { - i(Buffer.concat(n, s)); - } catch (u) { - p(new FetchError(`Could not create Buffer from response body for ${e.url}: ${u.message}`, "system", u)); + o(Buffer.concat(r, n)); + } catch (l) { + i(new q(`Could not create Buffer from response body for ${e.url}: ${l.message}`, "system", l)); } } }); }); } -function convertBody(e, t) { - if (typeof convert != "function") +function ki(e, t) { + if (typeof It != "function") throw new Error("The package `encoding` must be installed to use the textConverted() function"); - const n = t.get("content-type"); - let s = "utf-8", o, i; - return n && (o = /charset=([^;]*)/i.exec(n)), i = e.slice(0, 1024).toString(), !o && i && (o = / 0 && arguments[0] !== void 0 ? arguments[0] : void 0; - if (this[MAP] = Object.create(null), t instanceof Headers) { - const n = t.raw(), s = Object.keys(n); - for (const o of s) - for (const i of n[o]) - this.append(o, i); + if (this[j] = /* @__PURE__ */ Object.create(null), t instanceof V) { + const r = t.raw(), n = Object.keys(r); + for (const s of n) + for (const o of r[s]) + this.append(s, o); return; } if (t != null) if (typeof t == "object") { - const n = t[Symbol.iterator]; - if (n != null) { - if (typeof n != "function") + const r = t[Symbol.iterator]; + if (r != null) { + if (typeof r != "function") throw new TypeError("Header pairs must be iterable"); - const s = []; - for (const o of t) { - if (typeof o != "object" || typeof o[Symbol.iterator] != "function") + const n = []; + for (const s of t) { + if (typeof s != "object" || typeof s[Symbol.iterator] != "function") throw new TypeError("Each header pair must be iterable"); - s.push(Array.from(o)); + n.push(Array.from(s)); } - for (const o of s) { - if (o.length !== 2) + for (const s of n) { + if (s.length !== 2) throw new TypeError("Each header pair must be a name/value tuple"); - this.append(o[0], o[1]); + this.append(s[0], s[1]); } } else - for (const s of Object.keys(t)) { - const o = t[s]; - this.append(s, o); + for (const n of Object.keys(t)) { + const s = t[n]; + this.append(n, s); } } else throw new TypeError("Provided initializer must be an object"); } get(t) { - t = `${t}`, validateName(t); - const n = find(this[MAP], t); - return n === void 0 ? null : this[MAP][n].join(", "); + t = `${t}`, Ve(t); + const r = ke(this[j], t); + return r === void 0 ? null : this[j][r].join(", "); } forEach(t) { - let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0, s = getHeaders(this), o = 0; - for (; o < s.length; ) { - var i = s[o]; - const p = i[0], a = i[1]; - t.call(n, a, p, this), s = getHeaders(this), o++; + let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0, n = Lt(this), s = 0; + for (; s < n.length; ) { + var o = n[s]; + const i = o[0], a = o[1]; + t.call(r, a, i, this), n = Lt(this), s++; } } - set(t, n) { - t = `${t}`, n = `${n}`, validateName(t), validateValue(n); - const s = find(this[MAP], t); - this[MAP][s !== void 0 ? s : t] = [n]; + set(t, r) { + t = `${t}`, r = `${r}`, Ve(t), cn(r); + const n = ke(this[j], t); + this[j][n !== void 0 ? n : t] = [r]; } - append(t, n) { - t = `${t}`, n = `${n}`, validateName(t), validateValue(n); - const s = find(this[MAP], t); - s !== void 0 ? this[MAP][s].push(n) : this[MAP][t] = [n]; + append(t, r) { + t = `${t}`, r = `${r}`, Ve(t), cn(r); + const n = ke(this[j], t); + n !== void 0 ? this[j][n].push(r) : this[j][t] = [r]; } has(t) { - return t = `${t}`, validateName(t), find(this[MAP], t) !== void 0; + return t = `${t}`, Ve(t), ke(this[j], t) !== void 0; } delete(t) { - t = `${t}`, validateName(t); - const n = find(this[MAP], t); - n !== void 0 && delete this[MAP][n]; + t = `${t}`, Ve(t); + const r = ke(this[j], t); + r !== void 0 && delete this[j][r]; } raw() { - return this[MAP]; + return this[j]; } keys() { - return createHeadersIterator(this, "key"); + return Mt(this, "key"); } values() { - return createHeadersIterator(this, "value"); + return Mt(this, "value"); } [Symbol.iterator]() { - return createHeadersIterator(this, "key+value"); + return Mt(this, "key+value"); } } -Headers.prototype.entries = Headers.prototype[Symbol.iterator], Object.defineProperty(Headers.prototype, Symbol.toStringTag, { +V.prototype.entries = V.prototype[Symbol.iterator], Object.defineProperty(V.prototype, Symbol.toStringTag, { value: "Headers", writable: !1, enumerable: !1, configurable: !0 -}), Object.defineProperties(Headers.prototype, { +}), Object.defineProperties(V.prototype, { get: { enumerable: !0 }, forEach: { enumerable: !0 }, set: { enumerable: !0 }, @@ -1334,99 +1744,99 @@ Headers.prototype.entries = Headers.prototype[Symbol.iterator], Object.definePro values: { enumerable: !0 }, entries: { enumerable: !0 } }); -function getHeaders(e) { +function Lt(e) { let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - return Object.keys(e[MAP]).sort().map(t === "key" ? function(s) { - return s.toLowerCase(); - } : t === "value" ? function(s) { - return e[MAP][s].join(", "); - } : function(s) { - return [s.toLowerCase(), e[MAP][s].join(", ")]; + return Object.keys(e[j]).sort().map(t === "key" ? function(n) { + return n.toLowerCase(); + } : t === "value" ? function(n) { + return e[j][n].join(", "); + } : function(n) { + return [n.toLowerCase(), e[j][n].join(", ")]; }); } -const INTERNAL = Symbol("internal"); -function createHeadersIterator(e, t) { - const n = Object.create(HeadersIteratorPrototype); - return n[INTERNAL] = { +const qt = Symbol("internal"); +function Mt(e, t) { + const r = Object.create(Nt); + return r[qt] = { target: e, kind: t, index: 0 - }, n; + }, r; } -const HeadersIteratorPrototype = Object.setPrototypeOf({ +const Nt = Object.setPrototypeOf({ next() { - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) + if (!this || Object.getPrototypeOf(this) !== Nt) throw new TypeError("Value of `this` is not a HeadersIterator"); - var e = this[INTERNAL]; - const t = e.target, n = e.kind, s = e.index, o = getHeaders(t, n), i = o.length; - return s >= i ? { + var e = this[qt]; + const t = e.target, r = e.kind, n = e.index, s = Lt(t, r), o = s.length; + return n >= o ? { value: void 0, done: !0 - } : (this[INTERNAL].index = s + 1, { - value: o[s], + } : (this[qt].index = n + 1, { + value: s[n], done: !1 }); } }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { +Object.defineProperty(Nt, Symbol.toStringTag, { value: "HeadersIterator", writable: !1, enumerable: !1, configurable: !0 }); -function exportNodeCompatibleHeaders(e) { - const t = Object.assign({ __proto__: null }, e[MAP]), n = find(e[MAP], "Host"); - return n !== void 0 && (t[n] = t[n][0]), t; -} -function createHeadersLenient(e) { - const t = new Headers(); - for (const n of Object.keys(e)) - if (!invalidTokenRegex.test(n)) - if (Array.isArray(e[n])) - for (const s of e[n]) - invalidHeaderCharRegex.test(s) || (t[MAP][n] === void 0 ? t[MAP][n] = [s] : t[MAP][n].push(s)); +function Ui(e) { + const t = Object.assign({ __proto__: null }, e[j]), r = ke(e[j], "Host"); + return r !== void 0 && (t[r] = t[r][0]), t; +} +function ji(e) { + const t = new V(); + for (const r of Object.keys(e)) + if (!an.test(r)) + if (Array.isArray(e[r])) + for (const n of e[r]) + Bt.test(n) || (t[j][r] === void 0 ? t[j][r] = [n] : t[j][r].push(n)); else - invalidHeaderCharRegex.test(e[n]) || (t[MAP][n] = [e[n]]); + Bt.test(e[r]) || (t[j][r] = [e[r]]); return t; } -const INTERNALS$1 = Symbol("Response internals"), STATUS_CODES = http__default.default.STATUS_CODES; -class Response { +const fe = Symbol("Response internals"), Fi = Me.default.STATUS_CODES; +class Q { constructor() { - let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - Body.call(this, t, n); - const s = n.status || 200, o = new Headers(n.headers); - if (t != null && !o.has("Content-Type")) { - const i = extractContentType(t); - i && o.append("Content-Type", i); - } - this[INTERNALS$1] = { - url: n.url, - status: s, - statusText: n.statusText || STATUS_CODES[s], - headers: o, - counter: n.counter + let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + x.call(this, t, r); + const n = r.status || 200, s = new V(r.headers); + if (t != null && !s.has("Content-Type")) { + const o = sn(t); + o && s.append("Content-Type", o); + } + this[fe] = { + url: r.url, + status: n, + statusText: r.statusText || Fi[n], + headers: s, + counter: r.counter }; } get url() { - return this[INTERNALS$1].url || ""; + return this[fe].url || ""; } get status() { - return this[INTERNALS$1].status; + return this[fe].status; } get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + return this[fe].status >= 200 && this[fe].status < 300; } get redirected() { - return this[INTERNALS$1].counter > 0; + return this[fe].counter > 0; } get statusText() { - return this[INTERNALS$1].statusText; + return this[fe].statusText; } get headers() { - return this[INTERNALS$1].headers; + return this[fe].headers; } clone() { - return new Response(clone(this), { + return new Q(nn(this), { url: this.url, status: this.status, statusText: this.statusText, @@ -1436,7 +1846,7 @@ class Response { }); } } -Body.mixIn(Response.prototype), Object.defineProperties(Response.prototype, { +x.mixIn(Q.prototype), Object.defineProperties(Q.prototype, { url: { enumerable: !0 }, status: { enumerable: !0 }, ok: { enumerable: !0 }, @@ -1444,73 +1854,73 @@ Body.mixIn(Response.prototype), Object.defineProperties(Response.prototype, { statusText: { enumerable: !0 }, headers: { enumerable: !0 }, clone: { enumerable: !0 } -}), Object.defineProperty(Response.prototype, Symbol.toStringTag, { +}), Object.defineProperty(Q.prototype, Symbol.toStringTag, { value: "Response", writable: !1, enumerable: !1, configurable: !0 }); -const INTERNALS$2 = Symbol("Request internals"), parse_url = Url__default.default.parse, format_url = Url__default.default.format, streamDestructionSupported = "destroy" in Stream__default.default.Readable.prototype; -function isRequest(e) { - return typeof e == "object" && typeof e[INTERNALS$2] == "object"; +const ne = Symbol("Request internals"), zt = Ct.default.parse, xi = Ct.default.format, Ii = "destroy" in W.default.Readable.prototype; +function ft(e) { + return typeof e == "object" && typeof e[ne] == "object"; } -function isAbortSignal(e) { +function Bi(e) { const t = e && typeof e == "object" && Object.getPrototypeOf(e); return !!(t && t.constructor.name === "AbortSignal"); } -class Request { +class Pe { constructor(t) { - let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s; - isRequest(t) ? s = parse_url(t.url) : (t && t.href ? s = parse_url(t.href) : s = parse_url(`${t}`), t = {}); - let o = n.method || t.method || "GET"; - if (o = o.toUpperCase(), (n.body != null || isRequest(t) && t.body !== null) && (o === "GET" || o === "HEAD")) + let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n; + ft(t) ? n = zt(t.url) : (t && t.href ? n = zt(t.href) : n = zt(`${t}`), t = {}); + let s = r.method || t.method || "GET"; + if (s = s.toUpperCase(), (r.body != null || ft(t) && t.body !== null) && (s === "GET" || s === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body"); - let i = n.body != null ? n.body : isRequest(t) && t.body !== null ? clone(t) : null; - Body.call(this, i, { - timeout: n.timeout || t.timeout || 0, - size: n.size || t.size || 0 + let o = r.body != null ? r.body : ft(t) && t.body !== null ? nn(t) : null; + x.call(this, o, { + timeout: r.timeout || t.timeout || 0, + size: r.size || t.size || 0 }); - const p = new Headers(n.headers || t.headers || {}); - if (i != null && !p.has("Content-Type")) { - const u = extractContentType(i); - u && p.append("Content-Type", u); + const i = new V(r.headers || t.headers || {}); + if (o != null && !i.has("Content-Type")) { + const l = sn(o); + l && i.append("Content-Type", l); } - let a = isRequest(t) ? t.signal : null; - if ("signal" in n && (a = n.signal), a != null && !isAbortSignal(a)) + let a = ft(t) ? t.signal : null; + if ("signal" in r && (a = r.signal), a != null && !Bi(a)) throw new TypeError("Expected signal to be an instanceof AbortSignal"); - this[INTERNALS$2] = { - method: o, - redirect: n.redirect || t.redirect || "follow", - headers: p, - parsedURL: s, + this[ne] = { + method: s, + redirect: r.redirect || t.redirect || "follow", + headers: i, + parsedURL: n, signal: a - }, this.follow = n.follow !== void 0 ? n.follow : t.follow !== void 0 ? t.follow : 20, this.compress = n.compress !== void 0 ? n.compress : t.compress !== void 0 ? t.compress : !0, this.counter = n.counter || t.counter || 0, this.agent = n.agent || t.agent; + }, this.follow = r.follow !== void 0 ? r.follow : t.follow !== void 0 ? t.follow : 20, this.compress = r.compress !== void 0 ? r.compress : t.compress !== void 0 ? t.compress : !0, this.counter = r.counter || t.counter || 0, this.agent = r.agent || t.agent; } get method() { - return this[INTERNALS$2].method; + return this[ne].method; } get url() { - return format_url(this[INTERNALS$2].parsedURL); + return xi(this[ne].parsedURL); } get headers() { - return this[INTERNALS$2].headers; + return this[ne].headers; } get redirect() { - return this[INTERNALS$2].redirect; + return this[ne].redirect; } get signal() { - return this[INTERNALS$2].signal; + return this[ne].signal; } clone() { - return new Request(this); + return new Pe(this); } } -Body.mixIn(Request.prototype), Object.defineProperty(Request.prototype, Symbol.toStringTag, { +x.mixIn(Pe.prototype), Object.defineProperty(Pe.prototype, Symbol.toStringTag, { value: "Request", writable: !1, enumerable: !1, configurable: !0 -}), Object.defineProperties(Request.prototype, { +}), Object.defineProperties(Pe.prototype, { method: { enumerable: !0 }, url: { enumerable: !0 }, headers: { enumerable: !0 }, @@ -1518,303 +1928,300 @@ Body.mixIn(Request.prototype), Object.defineProperty(Request.prototype, Symbol.t clone: { enumerable: !0 }, signal: { enumerable: !0 } }); -function getNodeRequestOptions(e) { - const t = e[INTERNALS$2].parsedURL, n = new Headers(e[INTERNALS$2].headers); - if (n.has("Accept") || n.set("Accept", "*/*"), !t.protocol || !t.hostname) +function Li(e) { + const t = e[ne].parsedURL, r = new V(e[ne].headers); + if (r.has("Accept") || r.set("Accept", "*/*"), !t.protocol || !t.hostname) throw new TypeError("Only absolute URLs are supported"); if (!/^https?:$/.test(t.protocol)) throw new TypeError("Only HTTP(S) protocols are supported"); - if (e.signal && e.body instanceof Stream__default.default.Readable && !streamDestructionSupported) + if (e.signal && e.body instanceof W.default.Readable && !Ii) throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); - let s = null; - if (e.body == null && /^(POST|PUT)$/i.test(e.method) && (s = "0"), e.body != null) { - const i = getTotalBytes(e); - typeof i == "number" && (s = String(i)); - } - s && n.set("Content-Length", s), n.has("User-Agent") || n.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"), e.compress && !n.has("Accept-Encoding") && n.set("Accept-Encoding", "gzip,deflate"); - let o = e.agent; - return typeof o == "function" && (o = o(t)), !n.has("Connection") && !o && n.set("Connection", "close"), Object.assign({}, t, { + let n = null; + if (e.body == null && /^(POST|PUT)$/i.test(e.method) && (n = "0"), e.body != null) { + const o = on(e); + typeof o == "number" && (n = String(o)); + } + n && r.set("Content-Length", n), r.has("User-Agent") || r.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"), e.compress && !r.has("Accept-Encoding") && r.set("Accept-Encoding", "gzip,deflate"); + let s = e.agent; + return typeof s == "function" && (s = s(t)), !r.has("Connection") && !s && r.set("Connection", "close"), Object.assign({}, t, { method: e.method, - headers: exportNodeCompatibleHeaders(n), - agent: o + headers: Ui(r), + agent: s }); } -function AbortError(e) { +function Je(e) { Error.call(this, e), this.type = "aborted", this.message = e, Error.captureStackTrace(this, this.constructor); } -AbortError.prototype = Object.create(Error.prototype), AbortError.prototype.constructor = AbortError, AbortError.prototype.name = "AbortError"; -const PassThrough$1 = Stream__default.default.PassThrough, resolve_url = Url__default.default.resolve; -function fetch(e, t) { - if (!fetch.Promise) +Je.prototype = Object.create(Error.prototype), Je.prototype.constructor = Je, Je.prototype.name = "AbortError"; +const ln = W.default.PassThrough, qi = Ct.default.resolve; +function he(e, t) { + if (!he.Promise) throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); - return Body.Promise = fetch.Promise, new fetch.Promise(function(n, s) { - const o = new Request(e, t), i = getNodeRequestOptions(o), p = (i.protocol === "https:" ? https__default.default : http__default.default).request, a = o.signal; - let u = null; - const h = function() { - let G = new AbortError("The user aborted a request."); - s(G), o.body && o.body instanceof Stream__default.default.Readable && o.body.destroy(G), !(!u || !u.body) && u.body.emit("error", G); + return x.Promise = he.Promise, new he.Promise(function(r, n) { + const s = new Pe(e, t), o = Li(s), i = (o.protocol === "https:" ? it.default : Me.default).request, a = s.signal; + let l = null; + const p = function() { + let m = new Je("The user aborted a request."); + n(m), s.body && s.body instanceof W.default.Readable && s.body.destroy(m), !(!l || !l.body) && l.body.emit("error", m); }; if (a && a.aborted) { - h(); + p(); return; } - const b = function() { - h(), E(); - }, y = p(i); + const h = function() { + p(), $(); + }, w = i(o); let _; - a && a.addEventListener("abort", b); - function E() { - y.abort(), a && a.removeEventListener("abort", b), clearTimeout(_); + a && a.addEventListener("abort", h); + function $() { + w.abort(), a && a.removeEventListener("abort", h), clearTimeout(_); } - o.timeout && y.once("socket", function(P) { + s.timeout && w.once("socket", function(E) { _ = setTimeout(function() { - s(new FetchError(`network timeout at: ${o.url}`, "request-timeout")), E(); - }, o.timeout); - }), y.on("error", function(P) { - s(new FetchError(`request to ${o.url} failed, reason: ${P.message}`, "system", P)), E(); - }), y.on("response", function(P) { + n(new q(`network timeout at: ${s.url}`, "request-timeout")), $(); + }, s.timeout); + }), w.on("error", function(E) { + n(new q(`request to ${s.url} failed, reason: ${E.message}`, "system", E)), $(); + }), w.on("response", function(E) { clearTimeout(_); - const G = createHeadersLenient(P.headers); - if (fetch.isRedirect(P.statusCode)) { - const g = G.get("Location"), T = g === null ? null : resolve_url(o.url, g); - switch (o.redirect) { + const m = ji(E.headers); + if (he.isRedirect(E.statusCode)) { + const c = m.get("Location"), u = c === null ? null : qi(s.url, c); + switch (s.redirect) { case "error": - s(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`, "no-redirect")), E(); + n(new q(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`, "no-redirect")), $(); return; case "manual": - if (T !== null) + if (u !== null) try { - G.set("Location", T); - } catch (O) { - s(O); + m.set("Location", u); + } catch (y) { + n(y); } break; case "follow": - if (T === null) + if (u === null) break; - if (o.counter >= o.follow) { - s(new FetchError(`maximum redirect reached at: ${o.url}`, "max-redirect")), E(); + if (s.counter >= s.follow) { + n(new q(`maximum redirect reached at: ${s.url}`, "max-redirect")), $(); return; } - const v = { - headers: new Headers(o.headers), - follow: o.follow, - counter: o.counter + 1, - agent: o.agent, - compress: o.compress, - method: o.method, - body: o.body, - signal: o.signal, - timeout: o.timeout, - size: o.size + const g = { + headers: new V(s.headers), + follow: s.follow, + counter: s.counter + 1, + agent: s.agent, + compress: s.compress, + method: s.method, + body: s.body, + signal: s.signal, + timeout: s.timeout, + size: s.size }; - if (P.statusCode !== 303 && o.body && getTotalBytes(o) === null) { - s(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), E(); + if (E.statusCode !== 303 && s.body && on(s) === null) { + n(new q("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), $(); return; } - (P.statusCode === 303 || (P.statusCode === 301 || P.statusCode === 302) && o.method === "POST") && (v.method = "GET", v.body = void 0, v.headers.delete("content-length")), n(fetch(new Request(T, v))), E(); + (E.statusCode === 303 || (E.statusCode === 301 || E.statusCode === 302) && s.method === "POST") && (g.method = "GET", g.body = void 0, g.headers.delete("content-length")), r(he(new Pe(u, g))), $(); return; } } - P.once("end", function() { - a && a.removeEventListener("abort", b); + E.once("end", function() { + a && a.removeEventListener("abort", h); }); - let d = P.pipe(new PassThrough$1()); - const f = { - url: o.url, - status: P.statusCode, - statusText: P.statusMessage, - headers: G, - size: o.size, - timeout: o.timeout, - counter: o.counter - }, w = G.get("Content-Encoding"); - if (!o.compress || o.method === "HEAD" || w === null || P.statusCode === 204 || P.statusCode === 304) { - u = new Response(d, f), n(u); + let b = E.pipe(new ln()); + const T = { + url: s.url, + status: E.statusCode, + statusText: E.statusMessage, + headers: m, + size: s.size, + timeout: s.timeout, + counter: s.counter + }, d = m.get("Content-Encoding"); + if (!s.compress || s.method === "HEAD" || d === null || E.statusCode === 204 || E.statusCode === 304) { + l = new Q(b, T), r(l); return; } - const m = { - flush: zlib__default.default.Z_SYNC_FLUSH, - finishFlush: zlib__default.default.Z_SYNC_FLUSH + const f = { + flush: _e.default.Z_SYNC_FLUSH, + finishFlush: _e.default.Z_SYNC_FLUSH }; - if (w == "gzip" || w == "x-gzip") { - d = d.pipe(zlib__default.default.createGunzip(m)), u = new Response(d, f), n(u); + if (d == "gzip" || d == "x-gzip") { + b = b.pipe(_e.default.createGunzip(f)), l = new Q(b, T), r(l); return; } - if (w == "deflate" || w == "x-deflate") { - P.pipe(new PassThrough$1()).once("data", function(T) { - (T[0] & 15) == 8 ? d = d.pipe(zlib__default.default.createInflate()) : d = d.pipe(zlib__default.default.createInflateRaw()), u = new Response(d, f), n(u); + if (d == "deflate" || d == "x-deflate") { + E.pipe(new ln()).once("data", function(u) { + (u[0] & 15) === 8 ? b = b.pipe(_e.default.createInflate()) : b = b.pipe(_e.default.createInflateRaw()), l = new Q(b, T), r(l); }); return; } - if (w == "br" && typeof zlib__default.default.createBrotliDecompress == "function") { - d = d.pipe(zlib__default.default.createBrotliDecompress()), u = new Response(d, f), n(u); + if (d == "br" && typeof _e.default.createBrotliDecompress == "function") { + b = b.pipe(_e.default.createBrotliDecompress()), l = new Q(b, T), r(l); return; } - u = new Response(d, f), n(u); - }), writeToStream(y, o); + l = new Q(b, T), r(l); + }), Di(w, s); }); } -fetch.isRedirect = function(e) { +he.isRedirect = function(e) { return e === 301 || e === 302 || e === 303 || e === 307 || e === 308; -}, fetch.Promise = global.Promise; -class Deprecation extends Error { +}, he.Promise = global.Promise; +class Mi extends Error { constructor(t) { - super(t); - Error.captureStackTrace && Error.captureStackTrace(this, this.constructor), this.name = "Deprecation"; + super(t), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor), this.name = "Deprecation"; } } -var wrappy_1 = wrappy; -function wrappy(e, t) { +var Ht = { exports: {} }, Ni = un; +function un(e, t) { if (e && t) - return wrappy(e)(t); + return un(e)(t); if (typeof e != "function") throw new TypeError("need wrapper function"); - return Object.keys(e).forEach(function(s) { - n[s] = e[s]; - }), n; - function n() { - for (var s = new Array(arguments.length), o = 0; o < s.length; o++) - s[o] = arguments[o]; - var i = e.apply(this, s), p = s[s.length - 1]; - return typeof i == "function" && i !== p && Object.keys(p).forEach(function(a) { - i[a] = p[a]; - }), i; - } -} -var once_1 = wrappy_1(once), strict = wrappy_1(onceStrict); -once.proto = once(function() { + return Object.keys(e).forEach(function(n) { + r[n] = e[n]; + }), r; + function r() { + for (var n = new Array(arguments.length), s = 0; s < n.length; s++) + n[s] = arguments[s]; + var o = e.apply(this, n), i = n[n.length - 1]; + return typeof o == "function" && o !== i && Object.keys(i).forEach(function(a) { + o[a] = i[a]; + }), o; + } +} +var pn = Ni; +Ht.exports = pn(ht), Ht.exports.strict = pn(dn), ht.proto = ht(function() { Object.defineProperty(Function.prototype, "once", { value: function() { - return once(this); + return ht(this); }, configurable: !0 }), Object.defineProperty(Function.prototype, "onceStrict", { value: function() { - return onceStrict(this); + return dn(this); }, configurable: !0 }); }); -function once(e) { +function ht(e) { var t = function() { return t.called ? t.value : (t.called = !0, t.value = e.apply(this, arguments)); }; return t.called = !1, t; } -function onceStrict(e) { +function dn(e) { var t = function() { if (t.called) throw new Error(t.onceError); return t.called = !0, t.value = e.apply(this, arguments); - }, n = e.name || "Function wrapped with `once`"; - return t.onceError = n + " shouldn't be called more than once", t.called = !1, t; -} -once_1.strict = strict; -const logOnce = once_1((e) => console.warn(e)); -class RequestError extends Error { - constructor(t, n, s) { - super(t); - Error.captureStackTrace && Error.captureStackTrace(this, this.constructor), this.name = "HttpError", this.status = n, Object.defineProperty(this, "code", { + }, r = e.name || "Function wrapped with `once`"; + return t.onceError = r + " shouldn't be called more than once", t.called = !1, t; +} +var zi = Ht.exports; +const Hi = zi((e) => console.warn(e)); +class Ye extends Error { + constructor(t, r, n) { + super(t), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor), this.name = "HttpError", this.status = r, Object.defineProperty(this, "code", { get() { - return logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")), n; + return Hi(new Mi("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")), r; } - }), this.headers = s.headers || {}; - const o = Object.assign({}, s.request); - s.request.headers.authorization && (o.headers = Object.assign({}, s.request.headers, { - authorization: s.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - })), o.url = o.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"), this.request = o; + }), this.headers = n.headers || {}; + const s = Object.assign({}, n.request); + n.request.headers.authorization && (s.headers = Object.assign({}, n.request.headers, { + authorization: n.request.headers.authorization.replace(/ .*$/, " [REDACTED]") + })), s.url = s.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"), this.request = s; } } -const VERSION$4 = "5.4.12"; -function getBufferResponse(e) { +const Wi = "5.4.12"; +function Ki(e) { return e.arrayBuffer(); } -function fetchWrapper(e) { - (isPlainObject(e.body) || Array.isArray(e.body)) && (e.body = JSON.stringify(e.body)); - let t = {}, n, s; - return (e.request && e.request.fetch || fetch)(e.url, Object.assign({ +function fn(e) { + (Vr(e.body) || Array.isArray(e.body)) && (e.body = JSON.stringify(e.body)); + let t = {}, r, n; + return (e.request && e.request.fetch || he)(e.url, Object.assign({ method: e.method, body: e.body, headers: e.headers, redirect: e.redirect - }, e.request)).then((i) => { - s = i.url, n = i.status; - for (const a of i.headers) + }, e.request)).then((o) => { + n = o.url, r = o.status; + for (const a of o.headers) t[a[0]] = a[1]; - if (n === 204 || n === 205) + if (r === 204 || r === 205) return; if (e.method === "HEAD") { - if (n < 400) + if (r < 400) return; - throw new RequestError(i.statusText, n, { + throw new Ye(o.statusText, r, { headers: t, request: e }); } - if (n === 304) - throw new RequestError("Not modified", n, { + if (r === 304) + throw new Ye("Not modified", r, { headers: t, request: e }); - if (n >= 400) - return i.text().then((a) => { - const u = new RequestError(a, n, { + if (r >= 400) + return o.text().then((a) => { + const l = new Ye(a, r, { headers: t, request: e }); try { - let h = JSON.parse(u.message); - Object.assign(u, h); - let b = h.errors; - u.message = u.message + ": " + b.map(JSON.stringify).join(", "); - } catch (h) { + let p = JSON.parse(l.message); + Object.assign(l, p); + let h = p.errors; + l.message = l.message + ": " + h.map(JSON.stringify).join(", "); + } catch { } - throw u; + throw l; }); - const p = i.headers.get("content-type"); - return /application\/json/.test(p) ? i.json() : !p || /^text\/|charset=utf-8$/.test(p) ? i.text() : getBufferResponse(i); - }).then((i) => ({ - status: n, - url: s, + const i = o.headers.get("content-type"); + return /application\/json/.test(i) ? o.json() : !i || /^text\/|charset=utf-8$/.test(i) ? o.text() : Ki(o); + }).then((o) => ({ + status: r, + url: n, headers: t, - data: i - })).catch((i) => { - throw i instanceof RequestError ? i : new RequestError(i.message, 500, { + data: o + })).catch((o) => { + throw o instanceof Ye ? o : new Ye(o.message, 500, { headers: t, request: e }); }); } -function withDefaults$1(e, t) { - const n = e.defaults(t); - return Object.assign(function(o, i) { - const p = n.merge(o, i); - if (!p.request || !p.request.hook) - return fetchWrapper(n.parse(p)); - const a = (u, h) => fetchWrapper(n.parse(n.merge(u, h))); +function Wt(e, t) { + const r = e.defaults(t); + return Object.assign(function(s, o) { + const i = r.merge(s, o); + if (!i.request || !i.request.hook) + return fn(r.parse(i)); + const a = (l, p) => fn(r.parse(r.merge(l, p))); return Object.assign(a, { - endpoint: n, - defaults: withDefaults$1.bind(null, n) - }), p.request.hook(a, p); + endpoint: r, + defaults: Wt.bind(null, r) + }), i.request.hook(a, i); }, { - endpoint: n, - defaults: withDefaults$1.bind(null, n) + endpoint: r, + defaults: Wt.bind(null, r) }); } -const request = withDefaults$1(endpoint, { +const mt = Wt(Gi, { headers: { - "user-agent": `octokit-request.js/${VERSION$4} ${getUserAgent()}` + "user-agent": `octokit-request.js/${Wi} ${pt()}` } -}), VERSION$3 = "4.5.8"; -class GraphqlError extends Error { - constructor(t, n) { - const s = n.data.errors[0].message; - super(s); - Object.assign(this, n.data), Object.assign(this, { headers: n.headers }), this.name = "GraphqlError", this.request = t, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); +}), Vi = "4.5.8"; +class Ji extends Error { + constructor(t, r) { + const n = r.data.errors[0].message; + super(n), Object.assign(this, r.data), Object.assign(this, { headers: r.headers }), this.name = "GraphqlError", this.request = t, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); } } -const NON_VARIABLE_OPTIONS = [ +const Yi = [ "method", "baseUrl", "url", @@ -1822,45 +2229,45 @@ const NON_VARIABLE_OPTIONS = [ "request", "query", "mediaType" -], GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(e, t, n) { - if (typeof t == "string" && n && "query" in n) +], hn = /\/api\/v3\/?$/; +function Zi(e, t, r) { + if (typeof t == "string" && r && "query" in r) return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name')); - const s = typeof t == "string" ? Object.assign({ query: t }, n) : t, o = Object.keys(s).reduce((p, a) => NON_VARIABLE_OPTIONS.includes(a) ? (p[a] = s[a], p) : (p.variables || (p.variables = {}), p.variables[a] = s[a], p), {}), i = s.baseUrl || e.endpoint.DEFAULTS.baseUrl; - return GHES_V3_SUFFIX_REGEX.test(i) && (o.url = i.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql")), e(o).then((p) => { - if (p.data.errors) { + const n = typeof t == "string" ? Object.assign({ query: t }, r) : t, s = Object.keys(n).reduce((i, a) => Yi.includes(a) ? (i[a] = n[a], i) : (i.variables || (i.variables = {}), i.variables[a] = n[a], i), {}), o = n.baseUrl || e.endpoint.DEFAULTS.baseUrl; + return hn.test(o) && (s.url = o.replace(hn, "/api/graphql")), e(s).then((i) => { + if (i.data.errors) { const a = {}; - for (const u of Object.keys(p.headers)) - a[u] = p.headers[u]; - throw new GraphqlError(o, { + for (const l of Object.keys(i.headers)) + a[l] = i.headers[l]; + throw new Ji(s, { headers: a, - data: p.data + data: i.data }); } - return p.data.data; + return i.data.data; }); } -function withDefaults(e, t) { - const n = e.defaults(t); - return Object.assign((o, i) => graphql(n, o, i), { - defaults: withDefaults.bind(null, n), - endpoint: request.endpoint +function Kt(e, t) { + const r = e.defaults(t); + return Object.assign((s, o) => Zi(r, s, o), { + defaults: Kt.bind(null, r), + endpoint: mt.endpoint }); } -withDefaults(request, { +Kt(mt, { headers: { - "user-agent": `octokit-graphql.js/${VERSION$3} ${getUserAgent()}` + "user-agent": `octokit-graphql.js/${Vi} ${pt()}` }, method: "POST", url: "/graphql" }); -function withCustomRequest(e) { - return withDefaults(e, { +function Xi(e) { + return Kt(e, { method: "POST", url: "/graphql" }); } -async function auth(e) { +async function Qi(e) { const t = e.split(/\./).length === 3 ? "app" : /^v\d+\./.test(e) ? "installation" : "oauth"; return { type: "token", @@ -1868,92 +2275,92 @@ async function auth(e) { tokenType: t }; } -function withAuthorizationPrefix(e) { +function ea(e) { return e.split(/\./).length === 3 ? `bearer ${e}` : `token ${e}`; } -async function hook(e, t, n, s) { - const o = t.endpoint.merge(n, s); - return o.headers.authorization = withAuthorizationPrefix(e), t(o); +async function ta(e, t, r, n) { + const s = t.endpoint.merge(r, n); + return s.headers.authorization = ea(e), t(s); } -const createTokenAuth = function(t) { +const ra = function(t) { if (!t) throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); if (typeof t != "string") throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); - return t = t.replace(/^(token|bearer) +/i, ""), Object.assign(auth.bind(null, t), { - hook: hook.bind(null, t) + return t = t.replace(/^(token|bearer) +/i, ""), Object.assign(Qi.bind(null, t), { + hook: ta.bind(null, t) }); -}, VERSION$2 = "3.2.4"; -class Octokit { +}, mn = "3.2.4"; +class Vt { constructor(t = {}) { - const n = new Collection(), s = { - baseUrl: request.endpoint.DEFAULTS.baseUrl, + const r = new wi(), n = { + baseUrl: mt.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, t.request, { - hook: n.bind(null, "request") + hook: r.bind(null, "request") }), mediaType: { previews: [], format: "" } }; - if (s.headers["user-agent"] = [ + if (n.headers["user-agent"] = [ t.userAgent, - `octokit-core.js/${VERSION$2} ${getUserAgent()}` - ].filter(Boolean).join(" "), t.baseUrl && (s.baseUrl = t.baseUrl), t.previews && (s.mediaType.previews = t.previews), t.timeZone && (s.headers["time-zone"] = t.timeZone), this.request = request.defaults(s), this.graphql = withCustomRequest(this.request).defaults(s), this.log = Object.assign({ + `octokit-core.js/${mn} ${pt()}` + ].filter(Boolean).join(" "), t.baseUrl && (n.baseUrl = t.baseUrl), t.previews && (n.mediaType.previews = t.previews), t.timeZone && (n.headers["time-zone"] = t.timeZone), this.request = mt.defaults(n), this.graphql = Xi(this.request).defaults(n), this.log = Object.assign({ debug: () => { }, info: () => { }, warn: console.warn.bind(console), error: console.error.bind(console) - }, t.log), this.hook = n, t.authStrategy) { - const i = t, { authStrategy: p } = i, a = W(i, ["authStrategy"]), u = p(Object.assign({ + }, t.log), this.hook = r, t.authStrategy) { + const { authStrategy: o, ...i } = t, a = o(Object.assign({ request: this.request, log: this.log, octokit: this, - octokitOptions: a + octokitOptions: i }, t.auth)); - n.wrap("request", u.hook), this.auth = u; + r.wrap("request", a.hook), this.auth = a; } else if (!t.auth) this.auth = async () => ({ type: "unauthenticated" }); else { - const p = createTokenAuth(t.auth); - n.wrap("request", p.hook), this.auth = p; + const o = ra(t.auth); + r.wrap("request", o.hook), this.auth = o; } - this.constructor.plugins.forEach((p) => { - Object.assign(this, p(this, t)); + this.constructor.plugins.forEach((o) => { + Object.assign(this, o(this, t)); }); } static defaults(t) { return class extends this { - constructor(...s) { - const o = s[0] || {}; + constructor(...n) { + const s = n[0] || {}; if (typeof t == "function") { - super(t(o)); + super(t(s)); return; } - super(Object.assign({}, t, o, o.userAgent && t.userAgent ? { - userAgent: `${o.userAgent} ${t.userAgent}` + super(Object.assign({}, t, s, s.userAgent && t.userAgent ? { + userAgent: `${s.userAgent} ${t.userAgent}` } : null)); } }; } static plugin(...t) { - var n; - const s = this.plugins; - return n = class extends this { - }, n.plugins = s.concat(t.filter((i) => !s.includes(i))), n; + var r; + const n = this.plugins; + return r = class extends this { + }, r.plugins = n.concat(t.filter((o) => !n.includes(o))), r; } } -Octokit.VERSION = VERSION$2, Octokit.plugins = []; -var distWeb$2 = /* @__PURE__ */ Object.freeze({ +Vt.VERSION = mn, Vt.plugins = []; +var na = /* @__PURE__ */ Object.freeze({ __proto__: null, - Octokit -}); -const Endpoints = { + Octokit: Vt +}), sa = /* @__PURE__ */ kt(na); +const oa = { actions: { addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" @@ -3224,1176 +3631,1180 @@ const Endpoints = { unfollow: ["DELETE /user/following/{username}"], updateAuthenticated: ["PATCH /user"] } -}, VERSION$1 = "4.4.1"; -function endpointsToMethods(e, t) { - const n = {}; - for (const [s, o] of Object.entries(t)) - for (const [i, p] of Object.entries(o)) { - const [a, u, h] = p, [b, y] = a.split(/ /), _ = Object.assign({ method: b, url: y }, u); - n[s] || (n[s] = {}); - const E = n[s]; - if (h) { - E[i] = decorate(e, s, i, _, h); +}, ia = "4.4.1"; +function aa(e, t) { + const r = {}; + for (const [n, s] of Object.entries(t)) + for (const [o, i] of Object.entries(s)) { + const [a, l, p] = i, [h, w] = a.split(/ /), _ = Object.assign({ method: h, url: w }, l); + r[n] || (r[n] = {}); + const $ = r[n]; + if (p) { + $[o] = ca(e, n, o, _, p); continue; } - E[i] = e.request.defaults(_); + $[o] = e.request.defaults(_); } - return n; + return r; +} +function ca(e, t, r, n, s) { + const o = e.request.defaults(n); + function i(...a) { + let l = o.endpoint.merge(...a); + if (s.mapToData) + return l = Object.assign({}, l, { + data: l[s.mapToData], + [s.mapToData]: void 0 + }), o(l); + if (s.renamed) { + const [p, h] = s.renamed; + e.log.warn(`octokit.${t}.${r}() has been renamed to octokit.${p}.${h}()`); + } + if (s.deprecated && e.log.warn(s.deprecated), s.renamedParameters) { + const p = o.endpoint.merge(...a); + for (const [h, w] of Object.entries(s.renamedParameters)) + h in p && (e.log.warn(`"${h}" parameter is deprecated for "octokit.${t}.${r}()". Use "${w}" instead`), w in p || (p[w] = p[h]), delete p[h]); + return o(p); + } + return o(...a); + } + return Object.assign(i, o); +} +function gn(e) { + return aa(e, oa); } -function decorate(e, t, n, s, o) { - const i = e.request.defaults(s); - function p(...a) { - let u = i.endpoint.merge(...a); - if (o.mapToData) - return u = Object.assign({}, u, { - data: u[o.mapToData], - [o.mapToData]: void 0 - }), i(u); - if (o.renamed) { - const [h, b] = o.renamed; - e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${h}.${b}()`); - } - if (o.deprecated && e.log.warn(o.deprecated), o.renamedParameters) { - const h = i.endpoint.merge(...a); - for (const [b, y] of Object.entries(o.renamedParameters)) - b in h && (e.log.warn(`"${b}" parameter is deprecated for "octokit.${t}.${n}()". Use "${y}" instead`), y in h || (h[y] = h[b]), delete h[b]); - return i(h); - } - return i(...a); - } - return Object.assign(p, i); -} -function restEndpointMethods(e) { - return endpointsToMethods(e, Endpoints); -} -restEndpointMethods.VERSION = VERSION$1; -var distWeb$1 = /* @__PURE__ */ Object.freeze({ +gn.VERSION = ia; +var la = /* @__PURE__ */ Object.freeze({ __proto__: null, - restEndpointMethods -}); -const VERSION = "2.6.2"; -function normalizePaginatedListResponse(e) { + restEndpointMethods: gn +}), ua = /* @__PURE__ */ kt(la); +const pa = "2.6.2"; +function da(e) { if (!("total_count" in e.data && !("url" in e.data))) return e; - const n = e.data.incomplete_results, s = e.data.repository_selection, o = e.data.total_count; + const r = e.data.incomplete_results, n = e.data.repository_selection, s = e.data.total_count; delete e.data.incomplete_results, delete e.data.repository_selection, delete e.data.total_count; - const i = Object.keys(e.data)[0], p = e.data[i]; - return e.data = p, typeof n != "undefined" && (e.data.incomplete_results = n), typeof s != "undefined" && (e.data.repository_selection = s), e.data.total_count = o, e; + const o = Object.keys(e.data)[0], i = e.data[o]; + return e.data = i, typeof r < "u" && (e.data.incomplete_results = r), typeof n < "u" && (e.data.repository_selection = n), e.data.total_count = s, e; } -function iterator(e, t, n) { - const s = typeof t == "function" ? t.endpoint(n) : e.request.endpoint(t, n), o = typeof t == "function" ? t : e.request, i = s.method, p = s.headers; - let a = s.url; +function Jt(e, t, r) { + const n = typeof t == "function" ? t.endpoint(r) : e.request.endpoint(t, r), s = typeof t == "function" ? t : e.request, o = n.method, i = n.headers; + let a = n.url; return { [Symbol.asyncIterator]: () => ({ async next() { if (!a) return { done: !0 }; - const u = await o({ method: i, url: a, headers: p }), h = normalizePaginatedListResponse(u); - return a = ((h.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1], { value: h }; + const l = await s({ method: o, url: a, headers: i }), p = da(l); + return a = ((p.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1], { value: p }; } }) }; } -function paginate(e, t, n, s) { - return typeof n == "function" && (s = n, n = void 0), gather(e, [], iterator(e, t, n)[Symbol.asyncIterator](), s); +function wn(e, t, r, n) { + return typeof r == "function" && (n = r, r = void 0), bn(e, [], Jt(e, t, r)[Symbol.asyncIterator](), n); } -function gather(e, t, n, s) { - return n.next().then((o) => { - if (o.done) +function bn(e, t, r, n) { + return r.next().then((s) => { + if (s.done) return t; - let i = !1; - function p() { - i = !0; + let o = !1; + function i() { + o = !0; } - return t = t.concat(s ? s(o.value, p) : o.value.data), i ? t : gather(e, t, n, s); + return t = t.concat(n ? n(s.value, i) : s.value.data), o ? t : bn(e, t, r, n); }); -} -const composePaginateRest = Object.assign(paginate, { - iterator -}); -function paginateRest(e) { - return { - paginate: Object.assign(paginate.bind(null, e), { - iterator: iterator.bind(null, e) - }) - }; -} -paginateRest.VERSION = VERSION; -var distWeb = /* @__PURE__ */ Object.freeze({ - __proto__: null, - composePaginateRest, - paginateRest -}), core_1 = /* @__PURE__ */ getAugmentedNamespace(distWeb$2), plugin_rest_endpoint_methods_1 = /* @__PURE__ */ getAugmentedNamespace(distWeb$1), plugin_paginate_rest_1 = /* @__PURE__ */ getAugmentedNamespace(distWeb), utils = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(b, y, _, E) { - E === void 0 && (E = _), Object.defineProperty(b, E, { enumerable: !0, get: function() { - return y[_]; - } }); - } : function(b, y, _, E) { - E === void 0 && (E = _), b[E] = y[_]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(b, y) { - Object.defineProperty(b, "default", { enumerable: !0, value: y }); - } : function(b, y) { - b.default = y; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(b) { - if (b && b.__esModule) - return b; - var y = {}; - if (b != null) - for (var _ in b) - Object.hasOwnProperty.call(b, _) && n(y, b, _); - return s(y, b), y; - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.getOctokitOptions = t.GitHub = t.context = void 0; - const i = o(context), p = o(utils$1); - t.context = new i.Context(); - const a = p.getApiBaseUrl(), u = { - baseUrl: a, - request: { - agent: p.getProxyAgent(a) - } - }; - t.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(u); - function h(b, y) { - const _ = Object.assign({}, y || {}), E = p.getAuthString(b, _); - return E && (_.auth = E), _; - } - t.getOctokitOptions = h; -}), github = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(a, u, h, b) { - b === void 0 && (b = h), Object.defineProperty(a, b, { enumerable: !0, get: function() { - return u[h]; - } }); - } : function(a, u, h, b) { - b === void 0 && (b = h), a[b] = u[h]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(a, u) { - Object.defineProperty(a, "default", { enumerable: !0, value: u }); - } : function(a, u) { - a.default = u; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(a) { - if (a && a.__esModule) - return a; - var u = {}; - if (a != null) - for (var h in a) - Object.hasOwnProperty.call(a, h) && n(u, a, h); - return s(u, a), u; +} +const fa = Object.assign(wn, { + iterator: Jt +}); +function yn(e) { + return { + paginate: Object.assign(wn.bind(null, e), { + iterator: Jt.bind(null, e) + }) }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.getOctokit = t.context = void 0; - const i = o(context); - t.context = new i.Context(); - function p(a, u) { - return new utils.GitHub(utils.getOctokitOptions(a, u)); +} +yn.VERSION = pa; +var ha = /* @__PURE__ */ Object.freeze({ + __proto__: null, + composePaginateRest: fa, + paginateRest: yn +}), ma = /* @__PURE__ */ kt(ha), ga = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), wa = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), Tn = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + Object.hasOwnProperty.call(e, r) && ga(t, e, r); + return wa(t, e), t; +}; +Object.defineProperty(pe, "__esModule", { value: !0 }), pe.getOctokitOptions = pe.GitHub = pe.context = void 0; +const ba = Tn(He), Yt = Tn(de), ya = sa, Ta = ua, _a = ma; +pe.context = new ba.Context(); +const _n = Yt.getApiBaseUrl(), Ea = { + baseUrl: _n, + request: { + agent: Yt.getProxyAgent(_n) } - t.getOctokit = p; -}); -const c$1 = (e) => `\`${e}\``, link = (e, t) => `[${e}](${t})`, sub = (e) => `${e}`, sup = (e) => `${e}`, strong = (e) => `**${e}**`; -var __defProp$4 = Object.defineProperty, __defProps$4 = Object.defineProperties, __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$4 = Object.getOwnPropertySymbols, __hasOwnProp$4 = Object.prototype.hasOwnProperty, __propIsEnum$4 = Object.prototype.propertyIsEnumerable, __defNormalProp$4 = (e, t, n) => t in e ? __defProp$4(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$4 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$4.call(t, n) && __defNormalProp$4(e, n, t[n]); - if (__getOwnPropSymbols$4) - for (var n of __getOwnPropSymbols$4(t)) - __propIsEnum$4.call(t, n) && __defNormalProp$4(e, n, t[n]); +}; +pe.GitHub = ya.Octokit.plugin(Ta.restEndpointMethods, _a.paginateRest).defaults(Ea); +function va(e, t) { + const r = Object.assign({}, t || {}), n = Yt.getAuthString(e, r); + return n && (r.auth = n), r; +} +pe.getOctokitOptions = va; +var Oa = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), Pa = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), Sa = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + Object.hasOwnProperty.call(e, r) && Oa(t, e, r); + return Pa(t, e), t; +}; +Object.defineProperty(ze, "__esModule", { value: !0 }); +var En = ze.getOctokit = gt = ze.context = void 0; +const Aa = Sa(He), vn = pe; +var gt = ze.context = new Aa.Context(); +function Ra(e, t) { + return new vn.GitHub(vn.getOctokitOptions(e, t)); +} +En = ze.getOctokit = Ra; +const M = (e) => `\`${e}\``, $a = (e, t) => `[${e}](${t})`, On = (e) => `${e}`, wt = (e) => `${e}`, bt = (e) => `**${e}**`; +var Ga = Object.defineProperty, Ca = Object.defineProperties, ka = Object.getOwnPropertyDescriptors, Pn = Object.getOwnPropertySymbols, Da = Object.prototype.hasOwnProperty, Ua = Object.prototype.propertyIsEnumerable, Sn = (e, t, r) => t in e ? Ga(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Zt = (e, t) => { + for (var r in t || (t = {})) + Da.call(t, r) && Sn(e, r, t[r]); + if (Pn) + for (var r of Pn(t)) + Ua.call(t, r) && Sn(e, r, t[r]); return e; -}, __spreadProps$4 = (e, t) => __defProps$4(e, __getOwnPropDescs$4(t)); -async function upsertComment({ +}, Xt = (e, t) => Ca(e, ka(t)); +async function ja({ token: e, commentSignature: t, - repo: n, - prNumber: s, - body: o + repo: r, + prNumber: n, + body: s }) { - core.startGroup("Comment on PR"), o += ` + G.startGroup("Comment on PR"), s += ` ${t}`; - const i = github.getOctokit(e); - core.info("Getting list of comments"); - const { data: p } = await i.issues.listComments(__spreadProps$4(__spreadValues$4({}, n), { - issue_number: s - })), a = p.find((u) => u.body.endsWith(t)); - a ? (core.info(`Updating previous comment ID ${a.id}`), await i.issues.updateComment(__spreadProps$4(__spreadValues$4({}, n), { + const o = En(e); + G.info("Getting list of comments"); + const { data: i } = await o.issues.listComments(Xt(Zt({}, r), { + issue_number: n + })), a = i.find((l) => l.body.endsWith(t)); + a ? (G.info(`Updating previous comment ID ${a.id}`), await o.issues.updateComment(Xt(Zt({}, r), { comment_id: a.id, - body: o - }))) : (core.info("Posting new comment"), await i.issues.createComment(__spreadProps$4(__spreadValues$4({}, n), { - issue_number: s, - body: o - }))), core.endGroup(); -} -var dist = createCommonjsModule(function(e, t) { - (function(n, s) { - e.exports = s(); - })(commonjsGlobal, function() { - let n = {}; - const s = new WeakMap(); - class o { - constructor(a, u) { - u = Object.assign({ - units: "metric", - precision: 1 - }, n, u), s.set(this, u); - const h = { - metric: [ - { from: 0, to: 1e3, unit: "B", long: "bytes" }, - { from: 1e3, to: 1e6, unit: "kB", long: "kilobytes" }, - { from: 1e6, to: 1e9, unit: "MB", long: "megabytes" }, - { from: 1e9, to: 1e12, unit: "GB", long: "gigabytes" }, - { from: 1e12, to: 1e15, unit: "TB", long: "terabytes" }, - { from: 1e15, to: 1e18, unit: "PB", long: "petabytes" }, - { from: 1e18, to: 1e21, unit: "EB", long: "exabytes" }, - { from: 1e21, to: 1e24, unit: "ZB", long: "zettabytes" }, - { from: 1e24, to: 1e27, unit: "YB", long: "yottabytes" } - ], - metric_octet: [ - { from: 0, to: 1e3, unit: "o", long: "octets" }, - { from: 1e3, to: 1e6, unit: "ko", long: "kilooctets" }, - { from: 1e6, to: 1e9, unit: "Mo", long: "megaoctets" }, - { from: 1e9, to: 1e12, unit: "Go", long: "gigaoctets" }, - { from: 1e12, to: 1e15, unit: "To", long: "teraoctets" }, - { from: 1e15, to: 1e18, unit: "Po", long: "petaoctets" }, - { from: 1e18, to: 1e21, unit: "Eo", long: "exaoctets" }, - { from: 1e21, to: 1e24, unit: "Zo", long: "zettaoctets" }, - { from: 1e24, to: 1e27, unit: "Yo", long: "yottaoctets" } - ], - iec: [ - { from: 0, to: Math.pow(1024, 1), unit: "B", long: "bytes" }, - { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: "KiB", long: "kibibytes" }, - { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: "MiB", long: "mebibytes" }, - { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: "GiB", long: "gibibytes" }, - { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: "TiB", long: "tebibytes" }, - { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: "PiB", long: "pebibytes" }, - { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: "EiB", long: "exbibytes" }, - { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: "ZiB", long: "zebibytes" }, - { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: "YiB", long: "yobibytes" } - ], - iec_octet: [ - { from: 0, to: Math.pow(1024, 1), unit: "o", long: "octets" }, - { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: "Kio", long: "kibioctets" }, - { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: "Mio", long: "mebioctets" }, - { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: "Gio", long: "gibioctets" }, - { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: "Tio", long: "tebioctets" }, - { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: "Pio", long: "pebioctets" }, - { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: "Eio", long: "exbioctets" }, - { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: "Zio", long: "zebioctets" }, - { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: "Yio", long: "yobioctets" } - ] - }; - Object.assign(h, u.customUnits); - const b = a < 0 ? "-" : ""; - a = Math.abs(a); - const y = h[u.units]; - if (y) { - const _ = y.find((E) => a >= E.from && a < E.to); - if (_) { - const E = _.from === 0 ? b + a : b + (a / _.from).toFixed(u.precision); - this.value = E, this.unit = _.unit, this.long = _.long; - } else - this.value = b + a, this.unit = "", this.long = ""; - } else - throw new Error(`Invalid units specified: ${u.units}`); - } - toString() { - const a = s.get(this); - return a.toStringFn ? a.toStringFn.bind(this)() : `${this.value} ${this.unit}`; + body: s + }))) : (G.info("Posting new comment"), await o.issues.createComment(Xt(Zt({}, r), { + issue_number: n, + body: s + }))), G.endGroup(); +} +let An = {}; +const Rn = /* @__PURE__ */ new WeakMap(), $n = { + metric: [ + { from: 0, to: 1e3, unit: "B", long: "bytes" }, + { from: 1e3, to: 1e6, unit: "kB", long: "kilobytes" }, + { from: 1e6, to: 1e9, unit: "MB", long: "megabytes" }, + { from: 1e9, to: 1e12, unit: "GB", long: "gigabytes" }, + { from: 1e12, to: 1e15, unit: "TB", long: "terabytes" }, + { from: 1e15, to: 1e18, unit: "PB", long: "petabytes" }, + { from: 1e18, to: 1e21, unit: "EB", long: "exabytes" }, + { from: 1e21, to: 1e24, unit: "ZB", long: "zettabytes" }, + { from: 1e24, to: 1e27, unit: "YB", long: "yottabytes" } + ], + metric_octet: [ + { from: 0, to: 1e3, unit: "o", long: "octets" }, + { from: 1e3, to: 1e6, unit: "ko", long: "kilooctets" }, + { from: 1e6, to: 1e9, unit: "Mo", long: "megaoctets" }, + { from: 1e9, to: 1e12, unit: "Go", long: "gigaoctets" }, + { from: 1e12, to: 1e15, unit: "To", long: "teraoctets" }, + { from: 1e15, to: 1e18, unit: "Po", long: "petaoctets" }, + { from: 1e18, to: 1e21, unit: "Eo", long: "exaoctets" }, + { from: 1e21, to: 1e24, unit: "Zo", long: "zettaoctets" }, + { from: 1e24, to: 1e27, unit: "Yo", long: "yottaoctets" } + ], + iec: [ + { from: 0, to: Math.pow(1024, 1), unit: "B", long: "bytes" }, + { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: "KiB", long: "kibibytes" }, + { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: "MiB", long: "mebibytes" }, + { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: "GiB", long: "gibibytes" }, + { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: "TiB", long: "tebibytes" }, + { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: "PiB", long: "pebibytes" }, + { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: "EiB", long: "exbibytes" }, + { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: "ZiB", long: "zebibytes" }, + { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: "YiB", long: "yobibytes" } + ], + iec_octet: [ + { from: 0, to: Math.pow(1024, 1), unit: "o", long: "octets" }, + { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: "Kio", long: "kibioctets" }, + { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: "Mio", long: "mebioctets" }, + { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: "Gio", long: "gibioctets" }, + { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: "Tio", long: "tebioctets" }, + { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: "Pio", long: "pebioctets" }, + { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: "Eio", long: "exbioctets" }, + { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: "Zio", long: "zebioctets" }, + { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: "Yio", long: "yobioctets" } + ] +}; +class Fa { + constructor(t, r) { + r = Object.assign({ + units: "metric", + precision: 1, + locale: void 0 + }, An, r), Rn.set(this, r), Object.assign($n, r.customUnits); + const n = t < 0 ? "-" : ""; + t = Math.abs(t); + const s = $n[r.units]; + if (s) { + const o = s.find((i) => t >= i.from && t < i.to); + if (o) { + const i = new Intl.NumberFormat(r.locale, { + style: "decimal", + minimumFractionDigits: r.precision, + maximumFractionDigits: r.precision + }), a = o.from === 0 ? n + t : n + i.format(t / o.from); + this.value = a, this.unit = o.unit, this.long = o.long; + } else + this.value = n + t, this.unit = "", this.long = ""; + } else + throw new Error(`Invalid units specified: ${r.units}`); + } + toString() { + const t = Rn.get(this); + return t.toStringFn ? t.toStringFn.bind(this)() : `${this.value} ${this.unit}`; + } +} +function z(e, t) { + return new Fa(e, t); +} +z.defaultOptions = function(e) { + An = e; +}; +function Ze(e, t = {}) { + const r = (t.align || []).concat(), n = t.stringLength || Ia, s = [], o = [], i = [], a = []; + let l = 0, p = -1; + for (; ++p < e.length; ) { + const E = [], m = []; + let b = -1; + for (e[p].length > l && (l = e[p].length); ++b < e[p].length; ) { + const T = xa(e[p][b]); + if (t.alignDelimiters !== !1) { + const d = n(T); + m[b] = d, (a[b] === void 0 || d > a[b]) && (a[b] = d); } + E.push(T); } - function i(p, a) { - return new o(p, a); + o[p] = E, i[p] = m; + } + let h = -1; + if (typeof r == "object" && "length" in r) + for (; ++h < l; ) + s[h] = Gn(r[h]); + else { + const E = Gn(r); + for (; ++h < l; ) + s[h] = E; + } + h = -1; + const w = [], _ = []; + for (; ++h < l; ) { + const E = s[h]; + let m = "", b = ""; + E === 99 ? (m = ":", b = ":") : E === 108 ? m = ":" : E === 114 && (b = ":"); + let T = t.alignDelimiters === !1 ? 1 : Math.max(1, a[h] - m.length - b.length); + const d = m + "-".repeat(T) + b; + t.alignDelimiters !== !1 && (T = m.length + T + b.length, T > a[h] && (a[h] = T), _[h] = T), w[h] = d; + } + o.splice(1, 0, w), i.splice(1, 0, _), p = -1; + const $ = []; + for (; ++p < o.length; ) { + const E = o[p], m = i[p]; + h = -1; + const b = []; + for (; ++h < l; ) { + const T = E[h] || ""; + let d = "", f = ""; + if (t.alignDelimiters !== !1) { + const c = a[h] - (m[h] || 0), u = s[h]; + u === 114 ? d = " ".repeat(c) : u === 99 ? c % 2 ? (d = " ".repeat(c / 2 + 0.5), f = " ".repeat(c / 2 - 0.5)) : (d = " ".repeat(c / 2), f = d) : f = " ".repeat(c); + } + t.delimiterStart !== !1 && !h && b.push("|"), t.padding !== !1 && !(t.alignDelimiters === !1 && T === "") && (t.delimiterStart !== !1 || h) && b.push(" "), t.alignDelimiters !== !1 && b.push(d), b.push(T), t.alignDelimiters !== !1 && b.push(f), t.padding !== !1 && b.push(" "), (t.delimiterEnd !== !1 || h !== l - 1) && b.push("|"); } - return i.defaultOptions = function(p) { - n = p; - }, i; - }); -}); -/*! - * repeat-string - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ -var res = "", cache, repeatString = repeat; -function repeat(e, t) { - if (typeof e != "string") - throw new TypeError("expected a string"); - if (t === 1) - return e; - if (t === 2) - return e + e; - var n = e.length * t; - if (cache !== e || typeof cache == "undefined") - cache = e, res = ""; - else if (res.length >= n) - return res.substr(0, n); - for (; n > res.length && t > 1; ) - t & 1 && (res += e), t >>= 1, e += e; - return res += e, res = res.substr(0, n), res; -} -var markdownTable_1 = markdownTable, trailingWhitespace = / +$/, space = " ", lineFeed = ` -`, dash = "-", colon = ":", verticalBar = "|", x = 0, C = 67, L = 76, R = 82, c = 99, l = 108, r = 114; -function markdownTable(e, t) { - for (var n = t || {}, s = n.padding !== !1, o = n.delimiterStart !== !1, i = n.delimiterEnd !== !1, p = (n.align || []).concat(), a = n.alignDelimiters !== !1, u = [], h = n.stringLength || defaultStringLength, b = -1, y = e.length, _ = [], E = [], P = [], G = [], d = [], f = 0, w, m, g, T, v, O, $, A, k, D, S; ++b < y; ) { - for (w = e[b], m = -1, g = w.length, P = [], G = [], g > f && (f = g); ++m < g; ) - O = serialize(w[m]), a === !0 && (v = h(O), G[m] = v, T = d[m], (T === void 0 || v > T) && (d[m] = v)), P.push(O); - _[b] = P, E[b] = G; - } - if (m = -1, g = f, typeof p == "object" && "length" in p) - for (; ++m < g; ) - u[m] = toAlignment(p[m]); - else - for (S = toAlignment(p); ++m < g; ) - u[m] = S; - for (m = -1, g = f, P = [], G = []; ++m < g; ) - S = u[m], k = "", D = "", S === l ? k = colon : S === r ? D = colon : S === c && (k = colon, D = colon), v = a ? Math.max(1, d[m] - k.length - D.length) : 1, O = k + repeatString(dash, v) + D, a === !0 && (v = k.length + v + D.length, v > d[m] && (d[m] = v), G[m] = v), P[m] = O; - for (_.splice(1, 0, P), E.splice(1, 0, G), b = -1, y = _.length, $ = []; ++b < y; ) { - for (P = _[b], G = E[b], m = -1, g = f, A = []; ++m < g; ) - O = P[m] || "", k = "", D = "", a === !0 && (v = d[m] - (G[m] || 0), S = u[m], S === r ? k = repeatString(space, v) : S === c ? v % 2 == 0 ? (k = repeatString(space, v / 2), D = k) : (k = repeatString(space, v / 2 + 0.5), D = repeatString(space, v / 2 - 0.5)) : D = repeatString(space, v)), o === !0 && m === 0 && A.push(verticalBar), s === !0 && !(a === !1 && O === "") && (o === !0 || m !== 0) && A.push(space), a === !0 && A.push(k), A.push(O), a === !0 && A.push(D), s === !0 && A.push(space), (i === !0 || m !== g - 1) && A.push(verticalBar); - A = A.join(""), i === !1 && (A = A.replace(trailingWhitespace, "")), $.push(A); - } - return $.join(lineFeed); -} -function serialize(e) { + $.push(t.delimiterEnd === !1 ? b.join("").replace(/ +$/, "") : b.join("")); + } + return $.join(` +`); +} +function xa(e) { return e == null ? "" : String(e); } -function defaultStringLength(e) { +function Ia(e) { return e.length; } -function toAlignment(e) { - var t = typeof e == "string" ? e.charCodeAt(0) : x; - return t === L || t === l ? l : t === R || t === r ? r : t === C || t === c ? c : x; +function Gn(e) { + const t = typeof e == "string" ? e.codePointAt(0) : 0; + return t === 67 || t === 99 ? 99 : t === 76 || t === 108 ? 108 : t === 82 || t === 114 ? 114 : 0; } -function noop() { +function yt() { for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t]; } -function createWeakMap() { - return typeof WeakMap != "undefined" ? new WeakMap() : fakeSetOrMap(); +function Cn() { + return typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : Ba(); } -function fakeSetOrMap() { +function Ba() { return { - add: noop, - delete: noop, - get: noop, - set: noop, + add: yt, + delete: yt, + get: yt, + set: yt, has: function(e) { return !1; } }; } -var hop = Object.prototype.hasOwnProperty, has = function(e, t) { - return hop.call(e, t); +var La = Object.prototype.hasOwnProperty, Qt = function(e, t) { + return La.call(e, t); }; -function extend(e, t) { - for (var n in t) - has(t, n) && (e[n] = t[n]); +function er(e, t) { + for (var r in t) + Qt(t, r) && (e[r] = t[r]); return e; } -var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/, reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/, reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/, reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/, reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/; -function _outdentArray(e, t, n) { - var s = 0, o = e[0].match(reDetectIndentation); - o && (s = o[1].length); - var i = "(\\r\\n|\\r|\\n).{0," + s + "}", p = new RegExp(i, "g"); +var qa = /^[ \t]*(?:\r\n|\r|\n)/, Ma = /(?:\r\n|\r|\n)[ \t]*$/, Na = /^(?:[\r\n]|$)/, za = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/, Ha = /^[ \t]*[\r\n][ \t\r\n]*$/; +function kn(e, t, r) { + var n = 0, s = e[0].match(za); + s && (n = s[1].length); + var o = "(\\r\\n|\\r|\\n).{0," + n + "}", i = new RegExp(o, "g"); t && (e = e.slice(1)); - var a = n.newline, u = n.trimLeadingNewline, h = n.trimTrailingNewline, b = typeof a == "string", y = e.length, _ = e.map(function(E, P) { - return E = E.replace(p, "$1"), P === 0 && u && (E = E.replace(reLeadingNewline, "")), P === y - 1 && h && (E = E.replace(reTrailingNewline, "")), b && (E = E.replace(/\r\n|\n|\r/g, function(G) { + var a = r.newline, l = r.trimLeadingNewline, p = r.trimTrailingNewline, h = typeof a == "string", w = e.length, _ = e.map(function($, E) { + return $ = $.replace(i, "$1"), E === 0 && l && ($ = $.replace(qa, "")), E === w - 1 && p && ($ = $.replace(Ma, "")), h && ($ = $.replace(/\r\n|\n|\r/g, function(m) { return a; - })), E; + })), $; }); return _; } -function concatStringsAndValues(e, t) { - for (var n = "", s = 0, o = e.length; s < o; s++) - n += e[s], s < o - 1 && (n += t[s]); - return n; -} -function isTemplateStringsArray(e) { - return has(e, "raw") && has(e, "length"); -} -function createInstance(e) { - var t = createWeakMap(), n = createWeakMap(); - function s(i) { - for (var p = [], a = 1; a < arguments.length; a++) - p[a - 1] = arguments[a]; - if (isTemplateStringsArray(i)) { - var u = i, h = (p[0] === s || p[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(u[0]) && reStartsWithNewlineOrIsEmpty.test(u[1]), b = h ? n : t, y = b.get(u); - if (y || (y = _outdentArray(u, h, e), b.set(u, y)), p.length === 0) - return y[0]; - var _ = concatStringsAndValues(y, h ? p.slice(1) : p); +function Wa(e, t) { + for (var r = "", n = 0, s = e.length; n < s; n++) + r += e[n], n < s - 1 && (r += t[n]); + return r; +} +function Ka(e) { + return Qt(e, "raw") && Qt(e, "length"); +} +function Dn(e) { + var t = Cn(), r = Cn(); + function n(o) { + for (var i = [], a = 1; a < arguments.length; a++) + i[a - 1] = arguments[a]; + if (Ka(o)) { + var l = o, p = (i[0] === n || i[0] === se) && Ha.test(l[0]) && Na.test(l[1]), h = p ? r : t, w = h.get(l); + if (w || (w = kn(l, p, e), h.set(l, w)), i.length === 0) + return w[0]; + var _ = Wa(w, p ? i.slice(1) : i); return _; } else - return createInstance(extend(extend({}, e), i || {})); + return Dn(er(er({}, e), o || {})); } - var o = extend(s, { - string: function(i) { - return _outdentArray([i], !1, e)[0]; + var s = er(n, { + string: function(o) { + return kn([o], !1, e)[0]; } }); - return o; + return s; } -var defaultOutdent = createInstance({ +var se = Dn({ trimLeadingNewline: !0, trimTrailingNewline: !0 }); -if (typeof module != "undefined") +if (typeof module < "u") try { - module.exports = defaultOutdent, Object.defineProperty(defaultOutdent, "__esModule", { value: !0 }), defaultOutdent.default = defaultOutdent, defaultOutdent.outdent = defaultOutdent; - } catch (e) { + module.exports = se, Object.defineProperty(se, "__esModule", { value: !0 }), se.default = se, se.outdent = se; + } catch { } -var freeGlobal = typeof global == "object" && global && global.Object === Object && global, freeGlobal$1 = freeGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal$1 || freeSelf || Function("return this")(), root$1 = root, Symbol$1 = root$1.Symbol, Symbol$2 = Symbol$1, objectProto$b = Object.prototype, hasOwnProperty$8 = objectProto$b.hasOwnProperty, nativeObjectToString$1 = objectProto$b.toString, symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; -function getRawTag(e) { - var t = hasOwnProperty$8.call(e, symToStringTag$1), n = e[symToStringTag$1]; +var Va = typeof global == "object" && global && global.Object === Object && global, Un = Va, Ja = typeof self == "object" && self && self.Object === Object && self, Ya = Un || Ja || Function("return this")(), J = Ya, Za = J.Symbol, me = Za, jn = Object.prototype, Xa = jn.hasOwnProperty, Qa = jn.toString, Xe = me ? me.toStringTag : void 0; +function ec(e) { + var t = Xa.call(e, Xe), r = e[Xe]; try { - e[symToStringTag$1] = void 0; - var s = !0; - } catch (i) { + e[Xe] = void 0; + var n = !0; + } catch { } - var o = nativeObjectToString$1.call(e); - return s && (t ? e[symToStringTag$1] = n : delete e[symToStringTag$1]), o; + var s = Qa.call(e); + return n && (t ? e[Xe] = r : delete e[Xe]), s; } -var objectProto$a = Object.prototype, nativeObjectToString = objectProto$a.toString; -function objectToString(e) { - return nativeObjectToString.call(e); +var tc = Object.prototype, rc = tc.toString; +function nc(e) { + return rc.call(e); } -var nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0; -function baseGetTag(e) { - return e == null ? e === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(e) ? getRawTag(e) : objectToString(e); +var sc = "[object Null]", oc = "[object Undefined]", Fn = me ? me.toStringTag : void 0; +function De(e) { + return e == null ? e === void 0 ? oc : sc : Fn && Fn in Object(e) ? ec(e) : nc(e); } -function isObjectLike(e) { +function Ue(e) { return e != null && typeof e == "object"; } -var symbolTag$1 = "[object Symbol]"; -function isSymbol(e) { - return typeof e == "symbol" || isObjectLike(e) && baseGetTag(e) == symbolTag$1; +var ic = "[object Symbol]"; +function Tt(e) { + return typeof e == "symbol" || Ue(e) && De(e) == ic; } -function arrayMap(e, t) { - for (var n = -1, s = e == null ? 0 : e.length, o = Array(s); ++n < s; ) - o[n] = t(e[n], n, e); - return o; +function ac(e, t) { + for (var r = -1, n = e == null ? 0 : e.length, s = Array(n); ++r < n; ) + s[r] = t(e[r], r, e); + return s; } -var isArray = Array.isArray, isArray$1 = isArray, INFINITY$2 = 1 / 0, symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0; -function baseToString(e) { +var cc = Array.isArray, Y = cc, lc = 1 / 0, xn = me ? me.prototype : void 0, In = xn ? xn.toString : void 0; +function Bn(e) { if (typeof e == "string") return e; - if (isArray$1(e)) - return arrayMap(e, baseToString) + ""; - if (isSymbol(e)) - return symbolToString ? symbolToString.call(e) : ""; + if (Y(e)) + return ac(e, Bn) + ""; + if (Tt(e)) + return In ? In.call(e) : ""; var t = e + ""; - return t == "0" && 1 / e == -INFINITY$2 ? "-0" : t; + return t == "0" && 1 / e == -lc ? "-0" : t; } -var reWhitespace = /\s/; -function trimmedEndIndex(e) { - for (var t = e.length; t-- && reWhitespace.test(e.charAt(t)); ) +var uc = /\s/; +function pc(e) { + for (var t = e.length; t-- && uc.test(e.charAt(t)); ) ; return t; } -var reTrimStart = /^\s+/; -function baseTrim(e) { - return e && e.slice(0, trimmedEndIndex(e) + 1).replace(reTrimStart, ""); +var dc = /^\s+/; +function fc(e) { + return e && e.slice(0, pc(e) + 1).replace(dc, ""); } -function isObject(e) { +function Qe(e) { var t = typeof e; return e != null && (t == "object" || t == "function"); } -var NAN = 0 / 0, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsOctal = /^0o[0-7]+$/i, freeParseInt = parseInt; -function toNumber(e) { +var Ln = 0 / 0, hc = /^[-+]0x[0-9a-f]+$/i, mc = /^0b[01]+$/i, gc = /^0o[0-7]+$/i, wc = parseInt; +function qn(e) { if (typeof e == "number") return e; - if (isSymbol(e)) - return NAN; - if (isObject(e)) { + if (Tt(e)) + return Ln; + if (Qe(e)) { var t = typeof e.valueOf == "function" ? e.valueOf() : e; - e = isObject(t) ? t + "" : t; + e = Qe(t) ? t + "" : t; } if (typeof e != "string") return e === 0 ? e : +e; - e = baseTrim(e); - var n = reIsBinary.test(e); - return n || reIsOctal.test(e) ? freeParseInt(e.slice(2), n ? 2 : 8) : reIsBadHex.test(e) ? NAN : +e; + e = fc(e); + var r = mc.test(e); + return r || gc.test(e) ? wc(e.slice(2), r ? 2 : 8) : hc.test(e) ? Ln : +e; } -var INFINITY$1 = 1 / 0, MAX_INTEGER = 17976931348623157e292; -function toFinite(e) { +var Mn = 1 / 0, bc = 17976931348623157e292; +function yc(e) { if (!e) return e === 0 ? e : 0; - if (e = toNumber(e), e === INFINITY$1 || e === -INFINITY$1) { + if (e = qn(e), e === Mn || e === -Mn) { var t = e < 0 ? -1 : 1; - return t * MAX_INTEGER; + return t * bc; } return e === e ? e : 0; } -function toInteger(e) { - var t = toFinite(e), n = t % 1; - return t === t ? n ? t - n : t : 0; +function Tc(e) { + var t = yc(e), r = t % 1; + return t === t ? r ? t - r : t : 0; } -function identity(e) { +function _c(e) { return e; } -var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; -function isFunction(e) { - if (!isObject(e)) +var Ec = "[object AsyncFunction]", vc = "[object Function]", Oc = "[object GeneratorFunction]", Pc = "[object Proxy]"; +function Nn(e) { + if (!Qe(e)) return !1; - var t = baseGetTag(e); - return t == funcTag$1 || t == genTag || t == asyncTag || t == proxyTag; + var t = De(e); + return t == vc || t == Oc || t == Ec || t == Pc; } -var coreJsData = root$1["__core-js_shared__"], coreJsData$1 = coreJsData, maskSrcKey = function() { - var e = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || ""); +var Sc = J["__core-js_shared__"], tr = Sc, zn = function() { + var e = /[^.]+$/.exec(tr && tr.keys && tr.keys.IE_PROTO || ""); return e ? "Symbol(src)_1." + e : ""; }(); -function isMasked(e) { - return !!maskSrcKey && maskSrcKey in e; +function Ac(e) { + return !!zn && zn in e; } -var funcProto$1 = Function.prototype, funcToString$1 = funcProto$1.toString; -function toSource(e) { +var Rc = Function.prototype, $c = Rc.toString; +function Ee(e) { if (e != null) { try { - return funcToString$1.call(e); - } catch (t) { + return $c.call(e); + } catch { } try { return e + ""; - } catch (t) { + } catch { } } return ""; } -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto = Function.prototype, objectProto$9 = Object.prototype, funcToString = funcProto.toString, hasOwnProperty$7 = objectProto$9.hasOwnProperty, reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); -function baseIsNative(e) { - if (!isObject(e) || isMasked(e)) +var Gc = /[\\^$.*+?()[\]{}|]/g, Cc = /^\[object .+?Constructor\]$/, kc = Function.prototype, Dc = Object.prototype, Uc = kc.toString, jc = Dc.hasOwnProperty, Fc = RegExp("^" + Uc.call(jc).replace(Gc, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); +function xc(e) { + if (!Qe(e) || Ac(e)) return !1; - var t = isFunction(e) ? reIsNative : reIsHostCtor; - return t.test(toSource(e)); + var t = Nn(e) ? Fc : Cc; + return t.test(Ee(e)); } -function getValue(e, t) { - return e == null ? void 0 : e[t]; +function Ic(e, t) { + return e?.[t]; } -function getNative(e, t) { - var n = getValue(e, t); - return baseIsNative(n) ? n : void 0; +function je(e, t) { + var r = Ic(e, t); + return xc(r) ? r : void 0; } -var WeakMap$1 = getNative(root$1, "WeakMap"), WeakMap$2 = WeakMap$1, MAX_SAFE_INTEGER$1 = 9007199254740991, reIsUint = /^(?:0|[1-9]\d*)$/; -function isIndex(e, t) { - var n = typeof e; - return t = t == null ? MAX_SAFE_INTEGER$1 : t, !!t && (n == "number" || n != "symbol" && reIsUint.test(e)) && e > -1 && e % 1 == 0 && e < t; +var Bc = je(J, "WeakMap"), rr = Bc, Lc = 9007199254740991, qc = /^(?:0|[1-9]\d*)$/; +function Hn(e, t) { + var r = typeof e; + return t = t ?? Lc, !!t && (r == "number" || r != "symbol" && qc.test(e)) && e > -1 && e % 1 == 0 && e < t; } -function eq(e, t) { +function Wn(e, t) { return e === t || e !== e && t !== t; } -var MAX_SAFE_INTEGER = 9007199254740991; -function isLength(e) { - return typeof e == "number" && e > -1 && e % 1 == 0 && e <= MAX_SAFE_INTEGER; +var Mc = 9007199254740991; +function nr(e) { + return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Mc; } -function isArrayLike(e) { - return e != null && isLength(e.length) && !isFunction(e); +function Kn(e) { + return e != null && nr(e.length) && !Nn(e); } -var objectProto$8 = Object.prototype; -function isPrototype(e) { - var t = e && e.constructor, n = typeof t == "function" && t.prototype || objectProto$8; - return e === n; +var Nc = Object.prototype; +function zc(e) { + var t = e && e.constructor, r = typeof t == "function" && t.prototype || Nc; + return e === r; } -function baseTimes(e, t) { - for (var n = -1, s = Array(e); ++n < e; ) - s[n] = t(n); - return s; +function Hc(e, t) { + for (var r = -1, n = Array(e); ++r < e; ) + n[r] = t(r); + return n; } -var argsTag$2 = "[object Arguments]"; -function baseIsArguments(e) { - return isObjectLike(e) && baseGetTag(e) == argsTag$2; +var Wc = "[object Arguments]"; +function Vn(e) { + return Ue(e) && De(e) == Wc; } -var objectProto$7 = Object.prototype, hasOwnProperty$6 = objectProto$7.hasOwnProperty, propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable, isArguments = baseIsArguments(function() { +var Jn = Object.prototype, Kc = Jn.hasOwnProperty, Vc = Jn.propertyIsEnumerable, Jc = Vn(function() { return arguments; -}()) ? baseIsArguments : function(e) { - return isObjectLike(e) && hasOwnProperty$6.call(e, "callee") && !propertyIsEnumerable$1.call(e, "callee"); -}, isArguments$1 = isArguments; -function stubFalse() { +}()) ? Vn : function(e) { + return Ue(e) && Kc.call(e, "callee") && !Vc.call(e, "callee"); +}, Yn = Jc; +function Yc() { return !1; } -var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports, freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module, moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1, Buffer$1 = moduleExports$1 ? root$1.Buffer : void 0, nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0, isBuffer = nativeIsBuffer || stubFalse, isBuffer$1 = isBuffer, argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]", arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = !0, typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = !1; -function baseIsTypedArray(e) { - return isObjectLike(e) && isLength(e.length) && !!typedArrayTags[baseGetTag(e)]; +var Zn = typeof exports == "object" && exports && !exports.nodeType && exports, Xn = Zn && typeof module == "object" && module && !module.nodeType && module, Zc = Xn && Xn.exports === Zn, Qn = Zc ? J.Buffer : void 0, Xc = Qn ? Qn.isBuffer : void 0, Qc = Xc || Yc, sr = Qc, el = "[object Arguments]", tl = "[object Array]", rl = "[object Boolean]", nl = "[object Date]", sl = "[object Error]", ol = "[object Function]", il = "[object Map]", al = "[object Number]", cl = "[object Object]", ll = "[object RegExp]", ul = "[object Set]", pl = "[object String]", dl = "[object WeakMap]", fl = "[object ArrayBuffer]", hl = "[object DataView]", ml = "[object Float32Array]", gl = "[object Float64Array]", wl = "[object Int8Array]", bl = "[object Int16Array]", yl = "[object Int32Array]", Tl = "[object Uint8Array]", _l = "[object Uint8ClampedArray]", El = "[object Uint16Array]", vl = "[object Uint32Array]", U = {}; +U[ml] = U[gl] = U[wl] = U[bl] = U[yl] = U[Tl] = U[_l] = U[El] = U[vl] = !0, U[el] = U[tl] = U[fl] = U[rl] = U[hl] = U[nl] = U[sl] = U[ol] = U[il] = U[al] = U[cl] = U[ll] = U[ul] = U[pl] = U[dl] = !1; +function Ol(e) { + return Ue(e) && nr(e.length) && !!U[De(e)]; } -function baseUnary(e) { +function Pl(e) { return function(t) { return e(t); }; } -var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports, freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal$1.process, nodeUtil = function() { +var es = typeof exports == "object" && exports && !exports.nodeType && exports, et = es && typeof module == "object" && module && !module.nodeType && module, Sl = et && et.exports === es, or = Sl && Un.process, Al = function() { try { - var e = freeModule && freeModule.require && freeModule.require("util").types; - return e || freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (t) { - } -}(), nodeUtil$1 = nodeUtil, nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray, isTypedArray$1 = isTypedArray, objectProto$6 = Object.prototype, hasOwnProperty$5 = objectProto$6.hasOwnProperty; -function arrayLikeKeys(e, t) { - var n = isArray$1(e), s = !n && isArguments$1(e), o = !n && !s && isBuffer$1(e), i = !n && !s && !o && isTypedArray$1(e), p = n || s || o || i, a = p ? baseTimes(e.length, String) : [], u = a.length; - for (var h in e) - (t || hasOwnProperty$5.call(e, h)) && !(p && (h == "length" || o && (h == "offset" || h == "parent") || i && (h == "buffer" || h == "byteLength" || h == "byteOffset") || isIndex(h, u))) && a.push(h); + var e = et && et.require && et.require("util").types; + return e || or && or.binding && or.binding("util"); + } catch { + } +}(), ts = Al, rs = ts && ts.isTypedArray, Rl = rs ? Pl(rs) : Ol, ns = Rl, $l = Object.prototype, Gl = $l.hasOwnProperty; +function Cl(e, t) { + var r = Y(e), n = !r && Yn(e), s = !r && !n && sr(e), o = !r && !n && !s && ns(e), i = r || n || s || o, a = i ? Hc(e.length, String) : [], l = a.length; + for (var p in e) + (t || Gl.call(e, p)) && !(i && (p == "length" || s && (p == "offset" || p == "parent") || o && (p == "buffer" || p == "byteLength" || p == "byteOffset") || Hn(p, l))) && a.push(p); return a; } -function overArg(e, t) { - return function(n) { - return e(t(n)); +function kl(e, t) { + return function(r) { + return e(t(r)); }; } -var nativeKeys = overArg(Object.keys, Object), nativeKeys$1 = nativeKeys, objectProto$5 = Object.prototype, hasOwnProperty$4 = objectProto$5.hasOwnProperty; -function baseKeys(e) { - if (!isPrototype(e)) - return nativeKeys$1(e); +var Dl = kl(Object.keys, Object), Ul = Dl, jl = Object.prototype, Fl = jl.hasOwnProperty; +function xl(e) { + if (!zc(e)) + return Ul(e); var t = []; - for (var n in Object(e)) - hasOwnProperty$4.call(e, n) && n != "constructor" && t.push(n); + for (var r in Object(e)) + Fl.call(e, r) && r != "constructor" && t.push(r); return t; } -function keys(e) { - return isArrayLike(e) ? arrayLikeKeys(e) : baseKeys(e); +function ir(e) { + return Kn(e) ? Cl(e) : xl(e); } -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; -function isKey(e, t) { - if (isArray$1(e)) +var Il = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Bl = /^\w*$/; +function ar(e, t) { + if (Y(e)) return !1; - var n = typeof e; - return n == "number" || n == "symbol" || n == "boolean" || e == null || isSymbol(e) ? !0 : reIsPlainProp.test(e) || !reIsDeepProp.test(e) || t != null && e in Object(t); + var r = typeof e; + return r == "number" || r == "symbol" || r == "boolean" || e == null || Tt(e) ? !0 : Bl.test(e) || !Il.test(e) || t != null && e in Object(t); } -var nativeCreate = getNative(Object, "create"), nativeCreate$1 = nativeCreate; -function hashClear() { - this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {}, this.size = 0; +var Ll = je(Object, "create"), tt = Ll; +function ql() { + this.__data__ = tt ? tt(null) : {}, this.size = 0; } -function hashDelete(e) { +function Ml(e) { var t = this.has(e) && delete this.__data__[e]; return this.size -= t ? 1 : 0, t; } -var HASH_UNDEFINED$2 = "__lodash_hash_undefined__", objectProto$4 = Object.prototype, hasOwnProperty$3 = objectProto$4.hasOwnProperty; -function hashGet(e) { +var Nl = "__lodash_hash_undefined__", zl = Object.prototype, Hl = zl.hasOwnProperty; +function Wl(e) { var t = this.__data__; - if (nativeCreate$1) { - var n = t[e]; - return n === HASH_UNDEFINED$2 ? void 0 : n; + if (tt) { + var r = t[e]; + return r === Nl ? void 0 : r; } - return hasOwnProperty$3.call(t, e) ? t[e] : void 0; + return Hl.call(t, e) ? t[e] : void 0; } -var objectProto$3 = Object.prototype, hasOwnProperty$2 = objectProto$3.hasOwnProperty; -function hashHas(e) { +var Kl = Object.prototype, Vl = Kl.hasOwnProperty; +function Jl(e) { var t = this.__data__; - return nativeCreate$1 ? t[e] !== void 0 : hasOwnProperty$2.call(t, e); + return tt ? t[e] !== void 0 : Vl.call(t, e); } -var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; -function hashSet(e, t) { - var n = this.__data__; - return this.size += this.has(e) ? 0 : 1, n[e] = nativeCreate$1 && t === void 0 ? HASH_UNDEFINED$1 : t, this; +var Yl = "__lodash_hash_undefined__"; +function Zl(e, t) { + var r = this.__data__; + return this.size += this.has(e) ? 0 : 1, r[e] = tt && t === void 0 ? Yl : t, this; } -function Hash(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var s = e[t]; - this.set(s[0], s[1]); +function ve(e) { + var t = -1, r = e == null ? 0 : e.length; + for (this.clear(); ++t < r; ) { + var n = e[t]; + this.set(n[0], n[1]); } } -Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet; -function listCacheClear() { +ve.prototype.clear = ql, ve.prototype.delete = Ml, ve.prototype.get = Wl, ve.prototype.has = Jl, ve.prototype.set = Zl; +function Xl() { this.__data__ = [], this.size = 0; } -function assocIndexOf(e, t) { - for (var n = e.length; n--; ) - if (eq(e[n][0], t)) - return n; +function _t(e, t) { + for (var r = e.length; r--; ) + if (Wn(e[r][0], t)) + return r; return -1; } -var arrayProto = Array.prototype, splice = arrayProto.splice; -function listCacheDelete(e) { - var t = this.__data__, n = assocIndexOf(t, e); - if (n < 0) +var Ql = Array.prototype, eu = Ql.splice; +function tu(e) { + var t = this.__data__, r = _t(t, e); + if (r < 0) return !1; - var s = t.length - 1; - return n == s ? t.pop() : splice.call(t, n, 1), --this.size, !0; + var n = t.length - 1; + return r == n ? t.pop() : eu.call(t, r, 1), --this.size, !0; } -function listCacheGet(e) { - var t = this.__data__, n = assocIndexOf(t, e); - return n < 0 ? void 0 : t[n][1]; +function ru(e) { + var t = this.__data__, r = _t(t, e); + return r < 0 ? void 0 : t[r][1]; } -function listCacheHas(e) { - return assocIndexOf(this.__data__, e) > -1; +function nu(e) { + return _t(this.__data__, e) > -1; } -function listCacheSet(e, t) { - var n = this.__data__, s = assocIndexOf(n, e); - return s < 0 ? (++this.size, n.push([e, t])) : n[s][1] = t, this; +function su(e, t) { + var r = this.__data__, n = _t(r, e); + return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this; } -function ListCache(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var s = e[t]; - this.set(s[0], s[1]); +function oe(e) { + var t = -1, r = e == null ? 0 : e.length; + for (this.clear(); ++t < r; ) { + var n = e[t]; + this.set(n[0], n[1]); } } -ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet; -var Map = getNative(root$1, "Map"), Map$1 = Map; -function mapCacheClear() { +oe.prototype.clear = Xl, oe.prototype.delete = tu, oe.prototype.get = ru, oe.prototype.has = nu, oe.prototype.set = su; +var ou = je(J, "Map"), rt = ou; +function iu() { this.size = 0, this.__data__ = { - hash: new Hash(), - map: new (Map$1 || ListCache)(), - string: new Hash() + hash: new ve(), + map: new (rt || oe)(), + string: new ve() }; } -function isKeyable(e) { +function au(e) { var t = typeof e; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null; } -function getMapData(e, t) { - var n = e.__data__; - return isKeyable(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map; +function Et(e, t) { + var r = e.__data__; + return au(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map; } -function mapCacheDelete(e) { - var t = getMapData(this, e).delete(e); +function cu(e) { + var t = Et(this, e).delete(e); return this.size -= t ? 1 : 0, t; } -function mapCacheGet(e) { - return getMapData(this, e).get(e); +function lu(e) { + return Et(this, e).get(e); } -function mapCacheHas(e) { - return getMapData(this, e).has(e); +function uu(e) { + return Et(this, e).has(e); } -function mapCacheSet(e, t) { - var n = getMapData(this, e), s = n.size; - return n.set(e, t), this.size += n.size == s ? 0 : 1, this; +function pu(e, t) { + var r = Et(this, e), n = r.size; + return r.set(e, t), this.size += r.size == n ? 0 : 1, this; } -function MapCache(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.clear(); ++t < n; ) { - var s = e[t]; - this.set(s[0], s[1]); +function ie(e) { + var t = -1, r = e == null ? 0 : e.length; + for (this.clear(); ++t < r; ) { + var n = e[t]; + this.set(n[0], n[1]); } } -MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet; -var FUNC_ERROR_TEXT = "Expected a function"; -function memoize(e, t) { +ie.prototype.clear = iu, ie.prototype.delete = cu, ie.prototype.get = lu, ie.prototype.has = uu, ie.prototype.set = pu; +var du = "Expected a function"; +function cr(e, t) { if (typeof e != "function" || t != null && typeof t != "function") - throw new TypeError(FUNC_ERROR_TEXT); - var n = function() { - var s = arguments, o = t ? t.apply(this, s) : s[0], i = n.cache; - if (i.has(o)) - return i.get(o); - var p = e.apply(this, s); - return n.cache = i.set(o, p) || i, p; + throw new TypeError(du); + var r = function() { + var n = arguments, s = t ? t.apply(this, n) : n[0], o = r.cache; + if (o.has(s)) + return o.get(s); + var i = e.apply(this, n); + return r.cache = o.set(s, i) || o, i; }; - return n.cache = new (memoize.Cache || MapCache)(), n; -} -memoize.Cache = MapCache; -var MAX_MEMOIZE_SIZE = 500; -function memoizeCapped(e) { - var t = memoize(e, function(s) { - return n.size === MAX_MEMOIZE_SIZE && n.clear(), s; - }), n = t.cache; + return r.cache = new (cr.Cache || ie)(), r; +} +cr.Cache = ie; +var fu = 500; +function hu(e) { + var t = cr(e, function(n) { + return r.size === fu && r.clear(), n; + }), r = t.cache; return t; } -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = memoizeCapped(function(e) { +var mu = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, gu = /\\(\\)?/g, wu = hu(function(e) { var t = []; - return e.charCodeAt(0) === 46 && t.push(""), e.replace(rePropName, function(n, s, o, i) { - t.push(o ? i.replace(reEscapeChar, "$1") : s || n); + return e.charCodeAt(0) === 46 && t.push(""), e.replace(mu, function(r, n, s, o) { + t.push(s ? o.replace(gu, "$1") : n || r); }), t; -}), stringToPath$1 = stringToPath; -function toString(e) { - return e == null ? "" : baseToString(e); +}), bu = wu; +function lr(e) { + return e == null ? "" : Bn(e); } -function castPath(e, t) { - return isArray$1(e) ? e : isKey(e, t) ? [e] : stringToPath$1(toString(e)); +function ss(e, t) { + return Y(e) ? e : ar(e, t) ? [e] : bu(lr(e)); } -var INFINITY = 1 / 0; -function toKey(e) { - if (typeof e == "string" || isSymbol(e)) +var yu = 1 / 0; +function vt(e) { + if (typeof e == "string" || Tt(e)) return e; var t = e + ""; - return t == "0" && 1 / e == -INFINITY ? "-0" : t; + return t == "0" && 1 / e == -yu ? "-0" : t; } -function baseGet(e, t) { - t = castPath(t, e); - for (var n = 0, s = t.length; e != null && n < s; ) - e = e[toKey(t[n++])]; - return n && n == s ? e : void 0; +function os(e, t) { + t = ss(t, e); + for (var r = 0, n = t.length; e != null && r < n; ) + e = e[vt(t[r++])]; + return r && r == n ? e : void 0; } -function get(e, t, n) { - var s = e == null ? void 0 : baseGet(e, t); - return s === void 0 ? n : s; +function Tu(e, t, r) { + var n = e == null ? void 0 : os(e, t); + return n === void 0 ? r : n; } -function arrayPush(e, t) { - for (var n = -1, s = t.length, o = e.length; ++n < s; ) - e[o + n] = t[n]; +function _u(e, t) { + for (var r = -1, n = t.length, s = e.length; ++r < n; ) + e[s + r] = t[r]; return e; } -var nativeIsFinite = root$1.isFinite, nativeMin = Math.min; -function createRound(e) { +var Eu = J.isFinite, vu = Math.min; +function Ou(e) { var t = Math[e]; - return function(n, s) { - if (n = toNumber(n), s = s == null ? 0 : nativeMin(toInteger(s), 292), s && nativeIsFinite(n)) { - var o = (toString(n) + "e").split("e"), i = t(o[0] + "e" + (+o[1] + s)); - return o = (toString(i) + "e").split("e"), +(o[0] + "e" + (+o[1] - s)); + return function(r, n) { + if (r = qn(r), n = n == null ? 0 : vu(Tc(n), 292), n && Eu(r)) { + var s = (lr(r) + "e").split("e"), o = t(s[0] + "e" + (+s[1] + n)); + return s = (lr(o) + "e").split("e"), +(s[0] + "e" + (+s[1] - n)); } - return t(n); + return t(r); }; } -function stackClear() { - this.__data__ = new ListCache(), this.size = 0; +function Pu() { + this.__data__ = new oe(), this.size = 0; } -function stackDelete(e) { - var t = this.__data__, n = t.delete(e); - return this.size = t.size, n; +function Su(e) { + var t = this.__data__, r = t.delete(e); + return this.size = t.size, r; } -function stackGet(e) { +function Au(e) { return this.__data__.get(e); } -function stackHas(e) { +function Ru(e) { return this.__data__.has(e); } -var LARGE_ARRAY_SIZE = 200; -function stackSet(e, t) { - var n = this.__data__; - if (n instanceof ListCache) { - var s = n.__data__; - if (!Map$1 || s.length < LARGE_ARRAY_SIZE - 1) - return s.push([e, t]), this.size = ++n.size, this; - n = this.__data__ = new MapCache(s); +var $u = 200; +function Gu(e, t) { + var r = this.__data__; + if (r instanceof oe) { + var n = r.__data__; + if (!rt || n.length < $u - 1) + return n.push([e, t]), this.size = ++r.size, this; + r = this.__data__ = new ie(n); } - return n.set(e, t), this.size = n.size, this; + return r.set(e, t), this.size = r.size, this; } -function Stack(e) { - var t = this.__data__ = new ListCache(e); +function ae(e) { + var t = this.__data__ = new oe(e); this.size = t.size; } -Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet; -function arrayFilter(e, t) { - for (var n = -1, s = e == null ? 0 : e.length, o = 0, i = []; ++n < s; ) { - var p = e[n]; - t(p, n, e) && (i[o++] = p); +ae.prototype.clear = Pu, ae.prototype.delete = Su, ae.prototype.get = Au, ae.prototype.has = Ru, ae.prototype.set = Gu; +function Cu(e, t) { + for (var r = -1, n = e == null ? 0 : e.length, s = 0, o = []; ++r < n; ) { + var i = e[r]; + t(i, r, e) && (o[s++] = i); } - return i; + return o; } -function stubArray() { +function ku() { return []; } -var objectProto$2 = Object.prototype, propertyIsEnumerable = objectProto$2.propertyIsEnumerable, nativeGetSymbols = Object.getOwnPropertySymbols, getSymbols = nativeGetSymbols ? function(e) { - return e == null ? [] : (e = Object(e), arrayFilter(nativeGetSymbols(e), function(t) { - return propertyIsEnumerable.call(e, t); +var Du = Object.prototype, Uu = Du.propertyIsEnumerable, is = Object.getOwnPropertySymbols, ju = is ? function(e) { + return e == null ? [] : (e = Object(e), Cu(is(e), function(t) { + return Uu.call(e, t); })); -} : stubArray, getSymbols$1 = getSymbols; -function baseGetAllKeys(e, t, n) { - var s = t(e); - return isArray$1(e) ? s : arrayPush(s, n(e)); -} -function getAllKeys(e) { - return baseGetAllKeys(e, keys, getSymbols$1); -} -var DataView = getNative(root$1, "DataView"), DataView$1 = DataView, Promise$1 = getNative(root$1, "Promise"), Promise$2 = Promise$1, Set = getNative(root$1, "Set"), Set$1 = Set, mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]", dataViewTag$1 = "[object DataView]", dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$2), getTag = baseGetTag; -(DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$1 || Map$1 && getTag(new Map$1()) != mapTag$1 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$1 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag) && (getTag = function(e) { - var t = baseGetTag(e), n = t == objectTag$1 ? e.constructor : void 0, s = n ? toSource(n) : ""; - if (s) - switch (s) { - case dataViewCtorString: - return dataViewTag$1; - case mapCtorString: - return mapTag$1; - case promiseCtorString: - return promiseTag; - case setCtorString: - return setTag$1; - case weakMapCtorString: - return weakMapTag; +} : ku, Fu = ju; +function xu(e, t, r) { + var n = t(e); + return Y(e) ? n : _u(n, r(e)); +} +function as(e) { + return xu(e, ir, Fu); +} +var Iu = je(J, "DataView"), ur = Iu, Bu = je(J, "Promise"), pr = Bu, Lu = je(J, "Set"), dr = Lu, cs = "[object Map]", qu = "[object Object]", ls = "[object Promise]", us = "[object Set]", ps = "[object WeakMap]", ds = "[object DataView]", Mu = Ee(ur), Nu = Ee(rt), zu = Ee(pr), Hu = Ee(dr), Wu = Ee(rr), Oe = De; +(ur && Oe(new ur(new ArrayBuffer(1))) != ds || rt && Oe(new rt()) != cs || pr && Oe(pr.resolve()) != ls || dr && Oe(new dr()) != us || rr && Oe(new rr()) != ps) && (Oe = function(e) { + var t = De(e), r = t == qu ? e.constructor : void 0, n = r ? Ee(r) : ""; + if (n) + switch (n) { + case Mu: + return ds; + case Nu: + return cs; + case zu: + return ls; + case Hu: + return us; + case Wu: + return ps; } return t; }); -var getTag$1 = getTag, Uint8Array = root$1.Uint8Array, Uint8Array$1 = Uint8Array, HASH_UNDEFINED = "__lodash_hash_undefined__"; -function setCacheAdd(e) { - return this.__data__.set(e, HASH_UNDEFINED), this; +var fs = Oe, Ku = J.Uint8Array, hs = Ku, Vu = "__lodash_hash_undefined__"; +function Ju(e) { + return this.__data__.set(e, Vu), this; } -function setCacheHas(e) { +function Yu(e) { return this.__data__.has(e); } -function SetCache(e) { - var t = -1, n = e == null ? 0 : e.length; - for (this.__data__ = new MapCache(); ++t < n; ) +function Ot(e) { + var t = -1, r = e == null ? 0 : e.length; + for (this.__data__ = new ie(); ++t < r; ) this.add(e[t]); } -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd, SetCache.prototype.has = setCacheHas; -function arraySome(e, t) { - for (var n = -1, s = e == null ? 0 : e.length; ++n < s; ) - if (t(e[n], n, e)) +Ot.prototype.add = Ot.prototype.push = Ju, Ot.prototype.has = Yu; +function Zu(e, t) { + for (var r = -1, n = e == null ? 0 : e.length; ++r < n; ) + if (t(e[r], r, e)) return !0; return !1; } -function cacheHas(e, t) { +function Xu(e, t) { return e.has(t); } -var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; -function equalArrays(e, t, n, s, o, i) { - var p = n & COMPARE_PARTIAL_FLAG$5, a = e.length, u = t.length; - if (a != u && !(p && u > a)) +var Qu = 1, ep = 2; +function ms(e, t, r, n, s, o) { + var i = r & Qu, a = e.length, l = t.length; + if (a != l && !(i && l > a)) return !1; - var h = i.get(e), b = i.get(t); - if (h && b) - return h == t && b == e; - var y = -1, _ = !0, E = n & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; - for (i.set(e, t), i.set(t, e); ++y < a; ) { - var P = e[y], G = t[y]; - if (s) - var d = p ? s(G, P, y, t, e, i) : s(P, G, y, e, t, i); - if (d !== void 0) { - if (d) + var p = o.get(e), h = o.get(t); + if (p && h) + return p == t && h == e; + var w = -1, _ = !0, $ = r & ep ? new Ot() : void 0; + for (o.set(e, t), o.set(t, e); ++w < a; ) { + var E = e[w], m = t[w]; + if (n) + var b = i ? n(m, E, w, t, e, o) : n(E, m, w, e, t, o); + if (b !== void 0) { + if (b) continue; _ = !1; break; } - if (E) { - if (!arraySome(t, function(f, w) { - if (!cacheHas(E, w) && (P === f || o(P, f, n, s, i))) - return E.push(w); + if ($) { + if (!Zu(t, function(T, d) { + if (!Xu($, d) && (E === T || s(E, T, r, n, o))) + return $.push(d); })) { _ = !1; break; } - } else if (!(P === G || o(P, G, n, s, i))) { + } else if (!(E === m || s(E, m, r, n, o))) { _ = !1; break; } } - return i.delete(e), i.delete(t), _; + return o.delete(e), o.delete(t), _; } -function mapToArray(e) { - var t = -1, n = Array(e.size); - return e.forEach(function(s, o) { - n[++t] = [o, s]; - }), n; +function tp(e) { + var t = -1, r = Array(e.size); + return e.forEach(function(n, s) { + r[++t] = [s, n]; + }), r; } -function setToArray(e) { - var t = -1, n = Array(e.size); - return e.forEach(function(s) { - n[++t] = s; - }), n; +function rp(e) { + var t = -1, r = Array(e.size); + return e.forEach(function(n) { + r[++t] = n; + }), r; } -var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2, boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; -function equalByTag(e, t, n, s, o, i, p) { - switch (n) { - case dataViewTag: +var np = 1, sp = 2, op = "[object Boolean]", ip = "[object Date]", ap = "[object Error]", cp = "[object Map]", lp = "[object Number]", up = "[object RegExp]", pp = "[object Set]", dp = "[object String]", fp = "[object Symbol]", hp = "[object ArrayBuffer]", mp = "[object DataView]", gs = me ? me.prototype : void 0, fr = gs ? gs.valueOf : void 0; +function gp(e, t, r, n, s, o, i) { + switch (r) { + case mp: if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1; e = e.buffer, t = t.buffer; - case arrayBufferTag: - return !(e.byteLength != t.byteLength || !i(new Uint8Array$1(e), new Uint8Array$1(t))); - case boolTag: - case dateTag: - case numberTag: - return eq(+e, +t); - case errorTag: + case hp: + return !(e.byteLength != t.byteLength || !o(new hs(e), new hs(t))); + case op: + case ip: + case lp: + return Wn(+e, +t); + case ap: return e.name == t.name && e.message == t.message; - case regexpTag: - case stringTag: + case up: + case dp: return e == t + ""; - case mapTag: - var a = mapToArray; - case setTag: - var u = s & COMPARE_PARTIAL_FLAG$4; - if (a || (a = setToArray), e.size != t.size && !u) + case cp: + var a = tp; + case pp: + var l = n & np; + if (a || (a = rp), e.size != t.size && !l) return !1; - var h = p.get(e); - if (h) - return h == t; - s |= COMPARE_UNORDERED_FLAG$2, p.set(e, t); - var b = equalArrays(a(e), a(t), s, o, i, p); - return p.delete(e), b; - case symbolTag: - if (symbolValueOf) - return symbolValueOf.call(e) == symbolValueOf.call(t); + var p = i.get(e); + if (p) + return p == t; + n |= sp, i.set(e, t); + var h = ms(a(e), a(t), n, s, o, i); + return i.delete(e), h; + case fp: + if (fr) + return fr.call(e) == fr.call(t); } return !1; } -var COMPARE_PARTIAL_FLAG$3 = 1, objectProto$1 = Object.prototype, hasOwnProperty$1 = objectProto$1.hasOwnProperty; -function equalObjects(e, t, n, s, o, i) { - var p = n & COMPARE_PARTIAL_FLAG$3, a = getAllKeys(e), u = a.length, h = getAllKeys(t), b = h.length; - if (u != b && !p) +var wp = 1, bp = Object.prototype, yp = bp.hasOwnProperty; +function Tp(e, t, r, n, s, o) { + var i = r & wp, a = as(e), l = a.length, p = as(t), h = p.length; + if (l != h && !i) return !1; - for (var y = u; y--; ) { - var _ = a[y]; - if (!(p ? _ in t : hasOwnProperty$1.call(t, _))) + for (var w = l; w--; ) { + var _ = a[w]; + if (!(i ? _ in t : yp.call(t, _))) return !1; } - var E = i.get(e), P = i.get(t); - if (E && P) - return E == t && P == e; - var G = !0; - i.set(e, t), i.set(t, e); - for (var d = p; ++y < u; ) { - _ = a[y]; - var f = e[_], w = t[_]; - if (s) - var m = p ? s(w, f, _, t, e, i) : s(f, w, _, e, t, i); - if (!(m === void 0 ? f === w || o(f, w, n, s, i) : m)) { - G = !1; + var $ = o.get(e), E = o.get(t); + if ($ && E) + return $ == t && E == e; + var m = !0; + o.set(e, t), o.set(t, e); + for (var b = i; ++w < l; ) { + _ = a[w]; + var T = e[_], d = t[_]; + if (n) + var f = i ? n(d, T, _, t, e, o) : n(T, d, _, e, t, o); + if (!(f === void 0 ? T === d || s(T, d, r, n, o) : f)) { + m = !1; break; } - d || (d = _ == "constructor"); + b || (b = _ == "constructor"); } - if (G && !d) { - var g = e.constructor, T = t.constructor; - g != T && "constructor" in e && "constructor" in t && !(typeof g == "function" && g instanceof g && typeof T == "function" && T instanceof T) && (G = !1); + if (m && !b) { + var c = e.constructor, u = t.constructor; + c != u && "constructor" in e && "constructor" in t && !(typeof c == "function" && c instanceof c && typeof u == "function" && u instanceof u) && (m = !1); } - return i.delete(e), i.delete(t), G; + return o.delete(e), o.delete(t), m; } -var COMPARE_PARTIAL_FLAG$2 = 1, argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; -function baseIsEqualDeep(e, t, n, s, o, i) { - var p = isArray$1(e), a = isArray$1(t), u = p ? arrayTag : getTag$1(e), h = a ? arrayTag : getTag$1(t); - u = u == argsTag ? objectTag : u, h = h == argsTag ? objectTag : h; - var b = u == objectTag, y = h == objectTag, _ = u == h; - if (_ && isBuffer$1(e)) { - if (!isBuffer$1(t)) +var _p = 1, ws = "[object Arguments]", bs = "[object Array]", Pt = "[object Object]", Ep = Object.prototype, ys = Ep.hasOwnProperty; +function vp(e, t, r, n, s, o) { + var i = Y(e), a = Y(t), l = i ? bs : fs(e), p = a ? bs : fs(t); + l = l == ws ? Pt : l, p = p == ws ? Pt : p; + var h = l == Pt, w = p == Pt, _ = l == p; + if (_ && sr(e)) { + if (!sr(t)) return !1; - p = !0, b = !1; - } - if (_ && !b) - return i || (i = new Stack()), p || isTypedArray$1(e) ? equalArrays(e, t, n, s, o, i) : equalByTag(e, t, u, n, s, o, i); - if (!(n & COMPARE_PARTIAL_FLAG$2)) { - var E = b && hasOwnProperty.call(e, "__wrapped__"), P = y && hasOwnProperty.call(t, "__wrapped__"); - if (E || P) { - var G = E ? e.value() : e, d = P ? t.value() : t; - return i || (i = new Stack()), o(G, d, n, s, i); + i = !0, h = !1; + } + if (_ && !h) + return o || (o = new ae()), i || ns(e) ? ms(e, t, r, n, s, o) : gp(e, t, l, r, n, s, o); + if (!(r & _p)) { + var $ = h && ys.call(e, "__wrapped__"), E = w && ys.call(t, "__wrapped__"); + if ($ || E) { + var m = $ ? e.value() : e, b = E ? t.value() : t; + return o || (o = new ae()), s(m, b, r, n, o); } } - return _ ? (i || (i = new Stack()), equalObjects(e, t, n, s, o, i)) : !1; + return _ ? (o || (o = new ae()), Tp(e, t, r, n, s, o)) : !1; } -function baseIsEqual(e, t, n, s, o) { - return e === t ? !0 : e == null || t == null || !isObjectLike(e) && !isObjectLike(t) ? e !== e && t !== t : baseIsEqualDeep(e, t, n, s, baseIsEqual, o); +function hr(e, t, r, n, s) { + return e === t ? !0 : e == null || t == null || !Ue(e) && !Ue(t) ? e !== e && t !== t : vp(e, t, r, n, hr, s); } -var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; -function baseIsMatch(e, t, n, s) { - var o = n.length, i = o, p = !s; +var Op = 1, Pp = 2; +function Sp(e, t, r, n) { + var s = r.length, o = s, i = !n; if (e == null) - return !i; - for (e = Object(e); o--; ) { - var a = n[o]; - if (p && a[2] ? a[1] !== e[a[0]] : !(a[0] in e)) + return !o; + for (e = Object(e); s--; ) { + var a = r[s]; + if (i && a[2] ? a[1] !== e[a[0]] : !(a[0] in e)) return !1; } - for (; ++o < i; ) { - a = n[o]; - var u = a[0], h = e[u], b = a[1]; - if (p && a[2]) { - if (h === void 0 && !(u in e)) + for (; ++s < o; ) { + a = r[s]; + var l = a[0], p = e[l], h = a[1]; + if (i && a[2]) { + if (p === void 0 && !(l in e)) return !1; } else { - var y = new Stack(); - if (s) - var _ = s(h, b, u, e, t, y); - if (!(_ === void 0 ? baseIsEqual(b, h, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, s, y) : _)) + var w = new ae(); + if (n) + var _ = n(p, h, l, e, t, w); + if (!(_ === void 0 ? hr(h, p, Op | Pp, n, w) : _)) return !1; } } return !0; } -function isStrictComparable(e) { - return e === e && !isObject(e); +function Ts(e) { + return e === e && !Qe(e); } -function getMatchData(e) { - for (var t = keys(e), n = t.length; n--; ) { - var s = t[n], o = e[s]; - t[n] = [s, o, isStrictComparable(o)]; +function Ap(e) { + for (var t = ir(e), r = t.length; r--; ) { + var n = t[r], s = e[n]; + t[r] = [n, s, Ts(s)]; } return t; } -function matchesStrictComparable(e, t) { - return function(n) { - return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n)); +function _s(e, t) { + return function(r) { + return r == null ? !1 : r[e] === t && (t !== void 0 || e in Object(r)); }; } -function baseMatches(e) { - var t = getMatchData(e); - return t.length == 1 && t[0][2] ? matchesStrictComparable(t[0][0], t[0][1]) : function(n) { - return n === e || baseIsMatch(n, e, t); +function Rp(e) { + var t = Ap(e); + return t.length == 1 && t[0][2] ? _s(t[0][0], t[0][1]) : function(r) { + return r === e || Sp(r, e, t); }; } -function baseHasIn(e, t) { +function $p(e, t) { return e != null && t in Object(e); } -function hasPath(e, t, n) { - t = castPath(t, e); - for (var s = -1, o = t.length, i = !1; ++s < o; ) { - var p = toKey(t[s]); - if (!(i = e != null && n(e, p))) +function Gp(e, t, r) { + t = ss(t, e); + for (var n = -1, s = t.length, o = !1; ++n < s; ) { + var i = vt(t[n]); + if (!(o = e != null && r(e, i))) break; - e = e[p]; + e = e[i]; } - return i || ++s != o ? i : (o = e == null ? 0 : e.length, !!o && isLength(o) && isIndex(p, o) && (isArray$1(e) || isArguments$1(e))); + return o || ++n != s ? o : (s = e == null ? 0 : e.length, !!s && nr(s) && Hn(i, s) && (Y(e) || Yn(e))); } -function hasIn(e, t) { - return e != null && hasPath(e, t, baseHasIn); +function Cp(e, t) { + return e != null && Gp(e, t, $p); } -var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; -function baseMatchesProperty(e, t) { - return isKey(e) && isStrictComparable(t) ? matchesStrictComparable(toKey(e), t) : function(n) { - var s = get(n, e); - return s === void 0 && s === t ? hasIn(n, e) : baseIsEqual(t, s, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); +var kp = 1, Dp = 2; +function Up(e, t) { + return ar(e) && Ts(t) ? _s(vt(e), t) : function(r) { + var n = Tu(r, e); + return n === void 0 && n === t ? Cp(r, e) : hr(t, n, kp | Dp); }; } -function baseProperty(e) { +function jp(e) { return function(t) { - return t == null ? void 0 : t[e]; + return t?.[e]; }; } -function basePropertyDeep(e) { +function Fp(e) { return function(t) { - return baseGet(t, e); + return os(t, e); }; } -function property(e) { - return isKey(e) ? baseProperty(toKey(e)) : basePropertyDeep(e); +function xp(e) { + return ar(e) ? jp(vt(e)) : Fp(e); } -function baseIteratee(e) { - return typeof e == "function" ? e : e == null ? identity : typeof e == "object" ? isArray$1(e) ? baseMatchesProperty(e[0], e[1]) : baseMatches(e) : property(e); +function Ip(e) { + return typeof e == "function" ? e : e == null ? _c : typeof e == "object" ? Y(e) ? Up(e[0], e[1]) : Rp(e) : xp(e); } -function arrayAggregator(e, t, n, s) { - for (var o = -1, i = e == null ? 0 : e.length; ++o < i; ) { - var p = e[o]; - t(s, p, n(p), e); +function Bp(e, t, r, n) { + for (var s = -1, o = e == null ? 0 : e.length; ++s < o; ) { + var i = e[s]; + t(n, i, r(i), e); } - return s; + return n; } -function createBaseFor(e) { - return function(t, n, s) { - for (var o = -1, i = Object(t), p = s(t), a = p.length; a--; ) { - var u = p[e ? a : ++o]; - if (n(i[u], u, i) === !1) +function Lp(e) { + return function(t, r, n) { + for (var s = -1, o = Object(t), i = n(t), a = i.length; a--; ) { + var l = i[e ? a : ++s]; + if (r(o[l], l, o) === !1) break; } return t; }; } -var baseFor = createBaseFor(), baseFor$1 = baseFor; -function baseForOwn(e, t) { - return e && baseFor$1(e, t, keys); -} -function createBaseEach(e, t) { - return function(n, s) { - if (n == null) - return n; - if (!isArrayLike(n)) - return e(n, s); - for (var o = n.length, i = t ? o : -1, p = Object(n); (t ? i-- : ++i < o) && s(p[i], i, p) !== !1; ) +var qp = Lp(), Mp = qp; +function Np(e, t) { + return e && Mp(e, t, ir); +} +function zp(e, t) { + return function(r, n) { + if (r == null) + return r; + if (!Kn(r)) + return e(r, n); + for (var s = r.length, o = t ? s : -1, i = Object(r); (t ? o-- : ++o < s) && n(i[o], o, i) !== !1; ) ; - return n; + return r; }; } -var baseEach = createBaseEach(baseForOwn), baseEach$1 = baseEach; -function baseAggregator(e, t, n, s) { - return baseEach$1(e, function(o, i, p) { - t(s, o, n(o), p); - }), s; +var Hp = zp(Np), Wp = Hp; +function Kp(e, t, r, n) { + return Wp(e, function(s, o, i) { + t(n, s, r(s), i); + }), n; } -function createAggregator(e, t) { - return function(n, s) { - var o = isArray$1(n) ? arrayAggregator : baseAggregator, i = t ? t() : {}; - return o(n, e, baseIteratee(s), i); +function Vp(e, t) { + return function(r, n) { + var s = Y(r) ? Bp : Kp, o = t ? t() : {}; + return s(r, e, Ip(n), o); }; } -var partition = createAggregator(function(e, t, n) { - e[n ? 0 : 1].push(t); +var Jp = Vp(function(e, t, r) { + e[r ? 0 : 1].push(t); }, function() { return [[], []]; -}), partition$1 = partition, round = createRound("round"), round$1 = round, globToRegexp = function(e, t) { +}), Es = Jp, Yp = Ou("round"), mr = Yp, Zp = function(e, t) { if (typeof e != "string") throw new TypeError("Expected a string"); - for (var n = String(e), s = "", o = t ? !!t.extended : !1, i = t ? !!t.globstar : !1, p = !1, a = t && typeof t.flags == "string" ? t.flags : "", u, h = 0, b = n.length; h < b; h++) - switch (u = n[h], u) { + for (var r = String(e), n = "", s = t ? !!t.extended : !1, o = t ? !!t.globstar : !1, i = !1, a = t && typeof t.flags == "string" ? t.flags : "", l, p = 0, h = r.length; p < h; p++) + switch (l = r[p], l) { case "/": case "$": case "^": @@ -4404,62 +4815,62 @@ var partition = createAggregator(function(e, t, n) { case "=": case "!": case "|": - s += "\\" + u; + n += "\\" + l; break; case "?": - if (o) { - s += "."; + if (s) { + n += "."; break; } case "[": case "]": - if (o) { - s += u; + if (s) { + n += l; break; } case "{": - if (o) { - p = !0, s += "("; + if (s) { + i = !0, n += "("; break; } case "}": - if (o) { - p = !1, s += ")"; + if (s) { + i = !1, n += ")"; break; } case ",": - if (p) { - s += "|"; + if (i) { + n += "|"; break; } - s += "\\" + u; + n += "\\" + l; break; case "*": - for (var y = n[h - 1], _ = 1; n[h + 1] === "*"; ) - _++, h++; - var E = n[h + 1]; - if (!i) - s += ".*"; + for (var w = r[p - 1], _ = 1; r[p + 1] === "*"; ) + _++, p++; + var $ = r[p + 1]; + if (!o) + n += ".*"; else { - var P = _ > 1 && (y === "/" || y === void 0) && (E === "/" || E === void 0); - P ? (s += "((?:[^/]*(?:/|$))*)", h++) : s += "([^/]*)"; + var E = _ > 1 && (w === "/" || w === void 0) && ($ === "/" || $ === void 0); + E ? (n += "((?:[^/]*(?:/|$))*)", p++) : n += "([^/]*)"; } break; default: - s += u; + n += l; } - return (!a || !~a.indexOf("g")) && (s = "^" + s + "$"), new RegExp(s, a); + return (!a || !~a.indexOf("g")) && (n = "^" + n + "$"), new RegExp(n, a); }; -function partionHidden(e, t) { +function vs(e, t) { if (!e) return [[], t]; - const n = globToRegexp(e, { extended: !0 }); - return partition$1(t, (s) => n.test(s.path)); + const r = Zp(e, { extended: !0 }); + return Es(t, (n) => r.test(n.path)); } -function getSizeLabels(e) { +function Os(e) { return e.length === 1 && e[0].property === "size" ? "" : ` (${e.map((t) => t.label).join(" / ")})`; } -const supportedSizes = { +const Ps = { uncompressed: { label: "Size", property: "size" @@ -4473,1062 +4884,1063 @@ const supportedSizes = { property: "sizeBrotli" } }; -function parseDisplaySize(e) { - return e.split(",").map((t) => t.trim()).filter((t) => supportedSizes.hasOwnProperty(t)).map((t) => supportedSizes[t]); -} -const listSizes = (e, t) => e.map(({ property: n }) => t(n)).join(" / "); -function sortFiles(e, t, n) { - e.sort((s, o) => o[t] - s[t] || s.path.localeCompare(o.path)), n === "asc" && e.reverse(); -} -var __defProp$3 = Object.defineProperty, __defProps$3 = Object.defineProperties, __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$3 = Object.getOwnPropertySymbols, __hasOwnProp$3 = Object.prototype.hasOwnProperty, __propIsEnum$3 = Object.prototype.propertyIsEnumerable, __defNormalProp$3 = (e, t, n) => t in e ? __defProp$3(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$3 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$3.call(t, n) && __defNormalProp$3(e, n, t[n]); - if (__getOwnPropSymbols$3) - for (var n of __getOwnPropSymbols$3(t)) - __propIsEnum$3.call(t, n) && __defNormalProp$3(e, n, t[n]); +function Ss(e) { + return e.split(",").map((t) => t.trim()).filter((t) => Ps.hasOwnProperty(t)).map((t) => Ps[t]); +} +const Z = (e, t) => e.map(({ property: r }) => t(r)).join(" / "); +function As(e, t, r) { + e.sort((n, s) => s[t] - n[t] || n.path.localeCompare(s.path)), r === "asc" && e.reverse(); +} +var Xp = Object.defineProperty, Qp = Object.defineProperties, ed = Object.getOwnPropertyDescriptors, Rs = Object.getOwnPropertySymbols, td = Object.prototype.hasOwnProperty, rd = Object.prototype.propertyIsEnumerable, $s = (e, t, r) => t in e ? Xp(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, nd = (e, t) => { + for (var r in t || (t = {})) + td.call(t, r) && $s(e, r, t[r]); + if (Rs) + for (var r of Rs(t)) + rd.call(t, r) && $s(e, r, t[r]); return e; -}, __spreadProps$3 = (e, t) => __defProps$3(e, __getOwnPropDescs$3(t)); -const percent = (e) => (e < 1e-3 ? e = round$1(e, 4) : e < 0.01 ? e = round$1(e, 3) : e = round$1(e, 2), e.toLocaleString(void 0, { +}, sd = (e, t) => Qp(e, ed(t)); +const od = (e) => (e < 1e-3 ? e = mr(e, 4) : e < 0.01 ? e = mr(e, 3) : e = mr(e, 2), e.toLocaleString(void 0, { style: "percent", maximumSignificantDigits: 3 })); -function calculateDiffBy(e, t, n) { - const s = e[n] - t[n]; +function St(e, t, r) { + const n = e[r] - t[r]; return { - delta: s, - percent: percent(s / t[n]) + delta: n, + percent: od(n / t[r]) }; } -function calculateDiff(e, t) { +function Gs(e, t) { return { - size: calculateDiffBy(e, t, "size"), - sizeGzip: calculateDiffBy(e, t, "sizeGzip"), - sizeBrotli: calculateDiffBy(e, t, "sizeBrotli") + size: St(e, t, "size"), + sizeGzip: St(e, t, "sizeGzip"), + sizeBrotli: St(e, t, "sizeBrotli") }; } -function processPkgFiles(e, t, n) { - for (const s of n.files) { - e[s.path] || (e[s.path] = { - path: s.path, - label: s.label +function Cs(e, t, r) { + for (const n of r.files) { + e[n.path] || (e[n.path] = { + path: n.path, + label: n.label }); - const o = e[s.path]; - o[t] = s, o.head && o.base && (o.diff = calculateDiff(o.head, o.base)); + const s = e[n.path]; + s[t] = n, s.head && s.base && (s.diff = Gs(s.head, s.base)); } } -function comparePackages(e, t, { - sortBy: n, - sortOrder: s, - hideFiles: o +function id(e, t, { + sortBy: r, + sortOrder: n, + hideFiles: s } = {}) { - const i = {}; - processPkgFiles(i, "head", e), processPkgFiles(i, "base", t); - const p = Object.values(i); - sortFiles(p, n, s); - const [a, u] = partionHidden(o, p), [h, b] = partition$1(u, (y) => y.diff && y.diff.size.delta === 0); + const o = {}; + Cs(o, "head", e), Cs(o, "base", t); + const i = Object.values(o); + As(i, r, n); + const [a, l] = vs(s, i), [p, h] = Es(l, (w) => w.diff && w.diff.size.delta === 0); return { head: e, base: t, - diff: __spreadProps$3(__spreadValues$3({}, calculateDiff(e, t)), { - tarballSize: calculateDiffBy(e, t, "tarballSize") + diff: sd(nd({}, Gs(e, t)), { + tarballSize: St(e, t, "tarballSize") }), files: { - changed: b, - unchanged: h, + changed: h, + unchanged: p, hidden: a } }; } -const directionSymbol = (e) => e < 0 ? "\u2193" : e > 0 ? "\u2191" : "", formatDelta = ({ delta: e, percent: t }) => e ? t + directionSymbol(e) : ""; -function generateComment({ +const ad = (e) => e < 0 ? "\u2193" : e > 0 ? "\u2191" : "", nt = ({ delta: e, percent: t }) => e ? t + ad(e) : ""; +function cd({ headPkgData: e, basePkgData: t, - sortBy: n, - sortOrder: s, - hideFiles: o, - unchangedFiles: i, - displaySize: p + sortBy: r, + sortOrder: n, + hideFiles: s, + unchangedFiles: o, + displaySize: i }) { - const a = comparePackages(e, t, { - sortBy: n, - sortOrder: s, - hideFiles: o + const a = id(e, t, { + sortBy: r, + sortOrder: n, + hideFiles: s }); - core.setOutput("regressionData", a); - const { changed: u, unchanged: h, hidden: b } = a.files, y = parseDisplaySize(p), _ = getSizeLabels(y), E = markdownTable_1([ + G.setOutput("regressionData", a); + const { changed: l, unchanged: p, hidden: h } = a.files, w = Ss(i), _ = Os(w), $ = Ze([ ["File", `Before${_}`, `After${_}`], ...[ - ...u, - ...i === "show" ? h : [] - ].map((d) => [ - d.label, - d.base && d.base.size ? listSizes(y, (f) => c$1(dist(d.base[f]))) : "\u2014", - d.head && d.head.size ? listSizes(y, (f) => (d.base && d.base[f] ? sup(formatDelta(d.diff[f])) : "") + c$1(dist(d.head[f]))) : "\u2014" + ...l, + ...o === "show" ? p : [] + ].map((b) => [ + b.label, + b.base && b.base.size ? Z(w, (T) => M(z(b.base[T]))) : "\u2014", + b.head && b.head.size ? Z(w, (T) => (b.base && b.base[T] ? wt(nt(b.diff[T])) : "") + M(z(b.head[T]))) : "\u2014" ]), [ - `${strong("Total")} ${i === "show" ? "" : sub("_(Includes all files)_")}`, - listSizes(y, (d) => c$1(dist(a.base[d]))), - listSizes(y, (d) => sup(formatDelta(a.diff[d])) + c$1(dist(a.head[d]))) + `${bt("Total")} ${o === "show" ? "" : On("_(Includes all files)_")}`, + Z(w, (b) => M(z(a.base[b]))), + Z(w, (b) => wt(nt(a.diff[b])) + M(z(a.head[b]))) ], [ - strong("Tarball size"), - c$1(dist(a.base.tarballSize)), - sup(formatDelta(a.diff.tarballSize)) + c$1(dist(a.head.tarballSize)) + bt("Tarball size"), + M(z(a.base.tarballSize)), + wt(nt(a.diff.tarballSize)) + M(z(a.head.tarballSize)) ] ], { align: ["", "r", "r"] }); - let P = ""; - i === "collapse" && h.length > 0 && (P = markdownTable_1([ + let E = ""; + o === "collapse" && p.length > 0 && (E = Ze([ ["File", `Size${_}`], - ...h.map((d) => [ - d.label, - listSizes(y, (f) => c$1(dist(d.base[f]))) + ...p.map((b) => [ + b.label, + Z(w, (T) => M(z(b.base[T]))) ]) ], { align: ["", "r"] - }), P = `
Unchanged files + }), E = `
Unchanged files -${P} +${E}
`); - let G = ""; - return b.length > 0 && (G = markdownTable_1([ + let m = ""; + return h.length > 0 && (m = Ze([ ["File", `Before${_}`, `After${_}`], - ...b.map((d) => [ - d.label, - d.base && d.base.size ? listSizes(y, (f) => c$1(dist(d.base[f]))) : "\u2014", - d.head && d.head.size ? listSizes(y, (f) => (d.base && d.base[f] ? sup(formatDelta(d.diff[f])) : "") + c$1(dist(d.head[f]))) : "\u2014" + ...h.map((b) => [ + b.label, + b.base && b.base.size ? Z(w, (T) => M(z(b.base[T]))) : "\u2014", + b.head && b.head.size ? Z(w, (T) => (b.base && b.base[T] ? wt(nt(b.diff[T])) : "") + M(z(b.head[T]))) : "\u2014" ]) ], { align: ["", "r", "r"] - }), G = `
Hidden files + }), m = `
Hidden files -${G} -
`), defaultOutdent` - ### 📊 Package size report   ${formatDelta(a.diff.size) || "No changes"} +${m} +
`), se` + ### 📊 Package size report   ${nt(a.diff.size) || "No changes"} - ${E} + ${$} - ${P} + ${E} - ${G} + ${m} `; } -function headOnly({ +function ld({ headPkgData: e, hideFiles: t, - displaySize: n, - sortBy: s, - sortOrder: o + displaySize: r, + sortBy: n, + sortOrder: s }) { - const i = parseDisplaySize(n), p = getSizeLabels(i); - sortFiles(e.files, s, o); - const [a, u] = partionHidden(t, e.files), h = markdownTable_1([ - ["File", `Size${p}`], - ...u.map((y) => [ - y.label, - listSizes(i, (_) => c$1(dist(y[_]))) + const o = Ss(r), i = Os(o); + As(e.files, n, s); + const [a, l] = vs(t, e.files), p = Ze([ + ["File", `Size${i}`], + ...l.map((w) => [ + w.label, + Z(o, (_) => M(z(w[_]))) ]), [ - strong("Total"), - listSizes(i, (y) => c$1(dist(e[y]))) + bt("Total"), + Z(o, (w) => M(z(e[w]))) ], [ - strong("Tarball size"), - c$1(dist(e.tarballSize)) + bt("Tarball size"), + M(z(e.tarballSize)) ] ], { align: ["", "r"] }); - let b = ""; - return a.length > 0 && (b = markdownTable_1([ - ["File", `Size${p}`], - ...a.map((y) => [ - y.label, - listSizes(i, (_) => c$1(dist(y[_]))) + let h = ""; + return a.length > 0 && (h = Ze([ + ["File", `Size${i}`], + ...a.map((w) => [ + w.label, + Z(o, (_) => M(z(w[_]))) ]) ], { align: ["", "r"] - }), b = `
Hidden files + }), h = `
Hidden files -${b} -
`), defaultOutdent` +${h} +
`), se` ### 📊 Package size report - ${h} + ${p} - ${b} + ${h} `; } -var ioUtil = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(d, f, w, m) { - m === void 0 && (m = w), Object.defineProperty(d, m, { enumerable: !0, get: function() { - return f[w]; +var st = {}, Fe = {}, H = {}, gr = {}; +(function(e) { + var t = O && O.__createBinding || (Object.create ? function(m, b, T, d) { + d === void 0 && (d = T), Object.defineProperty(m, d, { enumerable: !0, get: function() { + return b[T]; } }); - } : function(d, f, w, m) { - m === void 0 && (m = w), d[m] = f[w]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(d, f) { - Object.defineProperty(d, "default", { enumerable: !0, value: f }); - } : function(d, f) { - d.default = f; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(d) { - if (d && d.__esModule) - return d; - var f = {}; - if (d != null) - for (var w in d) - w !== "default" && Object.hasOwnProperty.call(d, w) && n(f, d, w); - return s(f, d), f; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(d, f, w, m) { - function g(T) { - return T instanceof w ? T : new w(function(v) { - v(T); + } : function(m, b, T, d) { + d === void 0 && (d = T), m[d] = b[T]; + }), r = O && O.__setModuleDefault || (Object.create ? function(m, b) { + Object.defineProperty(m, "default", { enumerable: !0, value: b }); + } : function(m, b) { + m.default = b; + }), n = O && O.__importStar || function(m) { + if (m && m.__esModule) + return m; + var b = {}; + if (m != null) + for (var T in m) + T !== "default" && Object.hasOwnProperty.call(m, T) && t(b, m, T); + return r(b, m), b; + }, s = O && O.__awaiter || function(m, b, T, d) { + function f(c) { + return c instanceof T ? c : new T(function(u) { + u(c); }); } - return new (w || (w = Promise))(function(T, v) { - function O(k) { + return new (T || (T = Promise))(function(c, u) { + function g(P) { try { - A(m.next(k)); - } catch (D) { - v(D); + A(d.next(P)); + } catch (S) { + u(S); } } - function $(k) { + function y(P) { try { - A(m.throw(k)); - } catch (D) { - v(D); + A(d.throw(P)); + } catch (S) { + u(S); } } - function A(k) { - k.done ? T(k.value) : g(k.value).then(O, $); + function A(P) { + P.done ? c(P.value) : f(P.value).then(g, y); } - A((m = m.apply(d, f || [])).next()); + A((d = d.apply(m, b || [])).next()); }); - }, p; - Object.defineProperty(t, "__esModule", { value: !0 }), t.getCmdPath = t.tryGetExecutablePath = t.isRooted = t.isDirectory = t.exists = t.IS_WINDOWS = t.unlink = t.symlink = t.stat = t.rmdir = t.rename = t.readlink = t.readdir = t.mkdir = t.lstat = t.copyFile = t.chmod = void 0; - const a = o(fs__default.default), u = o(require$$1__default.default); - p = a.promises, t.chmod = p.chmod, t.copyFile = p.copyFile, t.lstat = p.lstat, t.mkdir = p.mkdir, t.readdir = p.readdir, t.readlink = p.readlink, t.rename = p.rename, t.rmdir = p.rmdir, t.stat = p.stat, t.symlink = p.symlink, t.unlink = p.unlink, t.IS_WINDOWS = process.platform === "win32"; - function h(d) { - return i(this, void 0, void 0, function* () { + }, o; + Object.defineProperty(e, "__esModule", { value: !0 }), e.getCmdPath = e.tryGetExecutablePath = e.isRooted = e.isDirectory = e.exists = e.IS_WINDOWS = e.unlink = e.symlink = e.stat = e.rmdir = e.rename = e.readlink = e.readdir = e.mkdir = e.lstat = e.copyFile = e.chmod = void 0; + const i = n(ce.default), a = n(qe.default); + o = i.promises, e.chmod = o.chmod, e.copyFile = o.copyFile, e.lstat = o.lstat, e.mkdir = o.mkdir, e.readdir = o.readdir, e.readlink = o.readlink, e.rename = o.rename, e.rmdir = o.rmdir, e.stat = o.stat, e.symlink = o.symlink, e.unlink = o.unlink, e.IS_WINDOWS = process.platform === "win32"; + function l(m) { + return s(this, void 0, void 0, function* () { try { - yield t.stat(d); - } catch (f) { - if (f.code === "ENOENT") + yield e.stat(m); + } catch (b) { + if (b.code === "ENOENT") return !1; - throw f; + throw b; } return !0; }); } - t.exists = h; - function b(d, f = !1) { - return i(this, void 0, void 0, function* () { - return (f ? yield t.stat(d) : yield t.lstat(d)).isDirectory(); + e.exists = l; + function p(m, b = !1) { + return s(this, void 0, void 0, function* () { + return (b ? yield e.stat(m) : yield e.lstat(m)).isDirectory(); }); } - t.isDirectory = b; - function y(d) { - if (d = E(d), !d) + e.isDirectory = p; + function h(m) { + if (m = _(m), !m) throw new Error('isRooted() parameter "p" cannot be empty'); - return t.IS_WINDOWS ? d.startsWith("\\") || /^[A-Z]:/i.test(d) : d.startsWith("/"); + return e.IS_WINDOWS ? m.startsWith("\\") || /^[A-Z]:/i.test(m) : m.startsWith("/"); } - t.isRooted = y; - function _(d, f) { - return i(this, void 0, void 0, function* () { - let w; + e.isRooted = h; + function w(m, b) { + return s(this, void 0, void 0, function* () { + let T; try { - w = yield t.stat(d); - } catch (g) { - g.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${g}`); + T = yield e.stat(m); + } catch (f) { + f.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${m}': ${f}`); } - if (w && w.isFile()) { - if (t.IS_WINDOWS) { - const g = u.extname(d).toUpperCase(); - if (f.some((T) => T.toUpperCase() === g)) - return d; - } else if (P(w)) - return d; + if (T && T.isFile()) { + if (e.IS_WINDOWS) { + const f = a.extname(m).toUpperCase(); + if (b.some((c) => c.toUpperCase() === f)) + return m; + } else if ($(T)) + return m; } - const m = d; - for (const g of f) { - d = m + g, w = void 0; + const d = m; + for (const f of b) { + m = d + f, T = void 0; try { - w = yield t.stat(d); - } catch (T) { - T.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${T}`); + T = yield e.stat(m); + } catch (c) { + c.code !== "ENOENT" && console.log(`Unexpected error attempting to determine if executable file exists '${m}': ${c}`); } - if (w && w.isFile()) { - if (t.IS_WINDOWS) { + if (T && T.isFile()) { + if (e.IS_WINDOWS) { try { - const T = u.dirname(d), v = u.basename(d).toUpperCase(); - for (const O of yield t.readdir(T)) - if (v === O.toUpperCase()) { - d = u.join(T, O); + const c = a.dirname(m), u = a.basename(m).toUpperCase(); + for (const g of yield e.readdir(c)) + if (u === g.toUpperCase()) { + m = a.join(c, g); break; } - } catch (T) { - console.log(`Unexpected error attempting to determine the actual case of the file '${d}': ${T}`); + } catch (c) { + console.log(`Unexpected error attempting to determine the actual case of the file '${m}': ${c}`); } - return d; - } else if (P(w)) - return d; + return m; + } else if ($(T)) + return m; } } return ""; }); } - t.tryGetExecutablePath = _; - function E(d) { - return d = d || "", t.IS_WINDOWS ? (d = d.replace(/\//g, "\\"), d.replace(/\\\\+/g, "\\")) : d.replace(/\/\/+/g, "/"); - } - function P(d) { - return (d.mode & 1) > 0 || (d.mode & 8) > 0 && d.gid === process.getgid() || (d.mode & 64) > 0 && d.uid === process.getuid(); - } - function G() { - var d; - return (d = process.env.COMSPEC) !== null && d !== void 0 ? d : "cmd.exe"; - } - t.getCmdPath = G; -}), io = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(g, T, v, O) { - O === void 0 && (O = v), Object.defineProperty(g, O, { enumerable: !0, get: function() { - return T[v]; - } }); - } : function(g, T, v, O) { - O === void 0 && (O = v), g[O] = T[v]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(g, T) { - Object.defineProperty(g, "default", { enumerable: !0, value: T }); - } : function(g, T) { - g.default = T; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(g) { - if (g && g.__esModule) - return g; - var T = {}; - if (g != null) - for (var v in g) - v !== "default" && Object.hasOwnProperty.call(g, v) && n(T, g, v); - return s(T, g), T; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(g, T, v, O) { - function $(A) { - return A instanceof v ? A : new v(function(k) { - k(A); - }); - } - return new (v || (v = Promise))(function(A, k) { - function D(U) { - try { - j(O.next(U)); - } catch (F) { - k(F); - } - } - function S(U) { - try { - j(O.throw(U)); - } catch (F) { - k(F); - } - } - function j(U) { - U.done ? A(U.value) : $(U.value).then(D, S); - } - j((O = O.apply(g, T || [])).next()); - }); - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.findInPath = t.which = t.mkdirP = t.rmRF = t.mv = t.cp = void 0; - const p = o(require$$0__default$1.default), a = o(require$$1__default.default), u = o(ioUtil), h = util_1__default.default.promisify(p.exec), b = util_1__default.default.promisify(p.execFile); - function y(g, T, v = {}) { - return i(this, void 0, void 0, function* () { - const { force: O, recursive: $, copySourceDirectory: A } = f(v), k = (yield u.exists(T)) ? yield u.stat(T) : null; - if (k && k.isFile() && !O) - return; - const D = k && k.isDirectory() && A ? a.join(T, a.basename(g)) : T; - if (!(yield u.exists(g))) - throw new Error(`no such file or directory: ${g}`); - if ((yield u.stat(g)).isDirectory()) - if ($) - yield w(g, D, 0, O); - else - throw new Error(`Failed to copy. ${g} is a directory, but tried to copy without recursive flag.`); - else { - if (a.relative(g, D) === "") - throw new Error(`'${D}' and '${g}' are the same file`); - yield m(g, D, O); - } - }); - } - t.cp = y; - function _(g, T, v = {}) { - return i(this, void 0, void 0, function* () { - if (yield u.exists(T)) { - let O = !0; - if ((yield u.isDirectory(T)) && (T = a.join(T, a.basename(g)), O = yield u.exists(T)), O) - if (v.force == null || v.force) - yield E(T); - else - throw new Error("Destination already exists"); - } - yield P(a.dirname(T)), yield u.rename(g, T); + e.tryGetExecutablePath = w; + function _(m) { + return m = m || "", e.IS_WINDOWS ? (m = m.replace(/\//g, "\\"), m.replace(/\\\\+/g, "\\")) : m.replace(/\/\/+/g, "/"); + } + function $(m) { + return (m.mode & 1) > 0 || (m.mode & 8) > 0 && m.gid === process.getgid() || (m.mode & 64) > 0 && m.uid === process.getuid(); + } + function E() { + var m; + return (m = process.env.COMSPEC) !== null && m !== void 0 ? m : "cmd.exe"; + } + e.getCmdPath = E; +})(gr); +var ud = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), pd = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), wr = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + r !== "default" && Object.hasOwnProperty.call(e, r) && ud(t, e, r); + return pd(t, e), t; +}, ge = O && O.__awaiter || function(e, t, r, n) { + function s(o) { + return o instanceof r ? o : new r(function(i) { + i(o); }); } - t.mv = _; - function E(g) { - return i(this, void 0, void 0, function* () { - if (u.IS_WINDOWS) { - if (/[*"<>|]/.test(g)) - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); - try { - const T = u.getCmdPath(); - (yield u.isDirectory(g, !0)) ? yield h(`${T} /s /c "rd /s /q "%inputPath%""`, { - env: { inputPath: g } - }) : yield h(`${T} /s /c "del /f /a "%inputPath%""`, { - env: { inputPath: g } - }); - } catch (T) { - if (T.code !== "ENOENT") - throw T; - } - try { - yield u.unlink(g); - } catch (T) { - if (T.code !== "ENOENT") - throw T; - } - } else { - let T = !1; - try { - T = yield u.isDirectory(g); - } catch (v) { - if (v.code !== "ENOENT") - throw v; - return; - } - T ? yield b("rm", ["-rf", `${g}`]) : yield u.unlink(g); + return new (r || (r = Promise))(function(o, i) { + function a(h) { + try { + p(n.next(h)); + } catch (w) { + i(w); } - }); - } - t.rmRF = E; - function P(g) { - return i(this, void 0, void 0, function* () { - assert_1__default.default.ok(g, "a path argument must be provided"), yield u.mkdir(g, { recursive: !0 }); - }); - } - t.mkdirP = P; - function G(g, T) { - return i(this, void 0, void 0, function* () { - if (!g) - throw new Error("parameter 'tool' is required"); - if (T) { - const O = yield G(g, !1); - if (!O) - throw u.IS_WINDOWS ? new Error(`Unable to locate executable file: ${g}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`) : new Error(`Unable to locate executable file: ${g}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - return O; + } + function l(h) { + try { + p(n.throw(h)); + } catch (w) { + i(w); } - const v = yield d(g); - return v && v.length > 0 ? v[0] : ""; - }); - } - t.which = G; - function d(g) { - return i(this, void 0, void 0, function* () { - if (!g) - throw new Error("parameter 'tool' is required"); - const T = []; - if (u.IS_WINDOWS && process.env.PATHEXT) - for (const $ of process.env.PATHEXT.split(a.delimiter)) - $ && T.push($); - if (u.isRooted(g)) { - const $ = yield u.tryGetExecutablePath(g, T); - return $ ? [$] : []; + } + function p(h) { + h.done ? o(h.value) : s(h.value).then(a, l); + } + p((n = n.apply(e, t || [])).next()); + }); +}; +Object.defineProperty(H, "__esModule", { value: !0 }), H.findInPath = H.which = H.mkdirP = Fs = H.rmRF = H.mv = H.cp = void 0; +const dd = Tr.default, ks = wr(vr.default), X = wr(qe.default), Ds = Er.default, k = wr(gr), Us = Ds.promisify(ks.exec), fd = Ds.promisify(ks.execFile); +function hd(e, t, r = {}) { + return ge(this, void 0, void 0, function* () { + const { force: n, recursive: s, copySourceDirectory: o } = gd(r), i = (yield k.exists(t)) ? yield k.stat(t) : null; + if (i && i.isFile() && !n) + return; + const a = i && i.isDirectory() && o ? X.join(t, X.basename(e)) : t; + if (!(yield k.exists(e))) + throw new Error(`no such file or directory: ${e}`); + if ((yield k.stat(e)).isDirectory()) + if (s) + yield Bs(e, a, 0, n); + else + throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`); + else { + if (X.relative(e, a) === "") + throw new Error(`'${a}' and '${e}' are the same file`); + yield Ls(e, a, n); + } + }); +} +H.cp = hd; +function md(e, t, r = {}) { + return ge(this, void 0, void 0, function* () { + if (yield k.exists(t)) { + let n = !0; + if ((yield k.isDirectory(t)) && (t = X.join(t, X.basename(e)), n = yield k.exists(t)), n) + if (r.force == null || r.force) + yield js(t); + else + throw new Error("Destination already exists"); + } + yield br(X.dirname(t)), yield k.rename(e, t); + }); +} +H.mv = md; +function js(e) { + return ge(this, void 0, void 0, function* () { + if (k.IS_WINDOWS) { + if (/[*"<>|]/.test(e)) + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + try { + const t = k.getCmdPath(); + (yield k.isDirectory(e, !0)) ? yield Us(`${t} /s /c "rd /s /q "%inputPath%""`, { + env: { inputPath: e } + }) : yield Us(`${t} /s /c "del /f /a "%inputPath%""`, { + env: { inputPath: e } + }); + } catch (t) { + if (t.code !== "ENOENT") + throw t; } - if (g.includes(a.sep)) - return []; - const v = []; - if (process.env.PATH) - for (const $ of process.env.PATH.split(a.delimiter)) - $ && v.push($); - const O = []; - for (const $ of v) { - const A = yield u.tryGetExecutablePath(a.join($, g), T); - A && O.push(A); + try { + yield k.unlink(e); + } catch (t) { + if (t.code !== "ENOENT") + throw t; } - return O; - }); - } - t.findInPath = d; - function f(g) { - const T = g.force == null ? !0 : g.force, v = Boolean(g.recursive), O = g.copySourceDirectory == null ? !0 : Boolean(g.copySourceDirectory); - return { force: T, recursive: v, copySourceDirectory: O }; - } - function w(g, T, v, O) { - return i(this, void 0, void 0, function* () { - if (v >= 255) + } else { + let t = !1; + try { + t = yield k.isDirectory(e); + } catch (r) { + if (r.code !== "ENOENT") + throw r; return; - v++, yield P(T); - const $ = yield u.readdir(g); - for (const A of $) { - const k = `${g}/${A}`, D = `${T}/${A}`; - (yield u.lstat(k)).isDirectory() ? yield w(k, D, v, O) : yield m(k, D, O); } - yield u.chmod(T, (yield u.stat(g)).mode); - }); - } - function m(g, T, v) { - return i(this, void 0, void 0, function* () { - if ((yield u.lstat(g)).isSymbolicLink()) { - try { - yield u.lstat(T), yield u.unlink(T); - } catch ($) { - $.code === "EPERM" && (yield u.chmod(T, "0666"), yield u.unlink(T)); - } - const O = yield u.readlink(g); - yield u.symlink(O, T, u.IS_WINDOWS ? "junction" : null); - } else - (!(yield u.exists(T)) || v) && (yield u.copyFile(g, T)); - }); - } -}), toolrunner = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(d, f, w, m) { - m === void 0 && (m = w), Object.defineProperty(d, m, { enumerable: !0, get: function() { - return f[w]; - } }); - } : function(d, f, w, m) { - m === void 0 && (m = w), d[m] = f[w]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(d, f) { - Object.defineProperty(d, "default", { enumerable: !0, value: f }); - } : function(d, f) { - d.default = f; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(d) { - if (d && d.__esModule) - return d; - var f = {}; - if (d != null) - for (var w in d) - w !== "default" && Object.hasOwnProperty.call(d, w) && n(f, d, w); - return s(f, d), f; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(d, f, w, m) { - function g(T) { - return T instanceof w ? T : new w(function(v) { - v(T); - }); + t ? yield fd("rm", ["-rf", `${e}`]) : yield k.unlink(e); } - return new (w || (w = Promise))(function(T, v) { - function O(k) { - try { - A(m.next(k)); - } catch (D) { - v(D); - } - } - function $(k) { - try { - A(m.throw(k)); - } catch (D) { - v(D); - } - } - function A(k) { - k.done ? T(k.value) : g(k.value).then(O, $); + }); +} +var Fs = H.rmRF = js; +function br(e) { + return ge(this, void 0, void 0, function* () { + dd.ok(e, "a path argument must be provided"), yield k.mkdir(e, { recursive: !0 }); + }); +} +H.mkdirP = br; +function xs(e, t) { + return ge(this, void 0, void 0, function* () { + if (!e) + throw new Error("parameter 'tool' is required"); + if (t) { + const n = yield xs(e, !1); + if (!n) + throw k.IS_WINDOWS ? new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`) : new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + return n; + } + const r = yield Is(e); + return r && r.length > 0 ? r[0] : ""; + }); +} +H.which = xs; +function Is(e) { + return ge(this, void 0, void 0, function* () { + if (!e) + throw new Error("parameter 'tool' is required"); + const t = []; + if (k.IS_WINDOWS && process.env.PATHEXT) + for (const s of process.env.PATHEXT.split(X.delimiter)) + s && t.push(s); + if (k.isRooted(e)) { + const s = yield k.tryGetExecutablePath(e, t); + return s ? [s] : []; + } + if (e.includes(X.sep)) + return []; + const r = []; + if (process.env.PATH) + for (const s of process.env.PATH.split(X.delimiter)) + s && r.push(s); + const n = []; + for (const s of r) { + const o = yield k.tryGetExecutablePath(X.join(s, e), t); + o && n.push(o); + } + return n; + }); +} +H.findInPath = Is; +function gd(e) { + const t = e.force == null ? !0 : e.force, r = Boolean(e.recursive), n = e.copySourceDirectory == null ? !0 : Boolean(e.copySourceDirectory); + return { force: t, recursive: r, copySourceDirectory: n }; +} +function Bs(e, t, r, n) { + return ge(this, void 0, void 0, function* () { + if (r >= 255) + return; + r++, yield br(t); + const s = yield k.readdir(e); + for (const o of s) { + const i = `${e}/${o}`, a = `${t}/${o}`; + (yield k.lstat(i)).isDirectory() ? yield Bs(i, a, r, n) : yield Ls(i, a, n); + } + yield k.chmod(t, (yield k.stat(e)).mode); + }); +} +function Ls(e, t, r) { + return ge(this, void 0, void 0, function* () { + if ((yield k.lstat(e)).isSymbolicLink()) { + try { + yield k.lstat(t), yield k.unlink(t); + } catch (s) { + s.code === "EPERM" && (yield k.chmod(t, "0666"), yield k.unlink(t)); } - A((m = m.apply(d, f || [])).next()); + const n = yield k.readlink(e); + yield k.symlink(n, t, k.IS_WINDOWS ? "junction" : null); + } else + (!(yield k.exists(t)) || r) && (yield k.copyFile(e, t)); + }); +} +var wd = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), bd = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), xe = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + r !== "default" && Object.hasOwnProperty.call(e, r) && wd(t, e, r); + return bd(t, e), t; +}, qs = O && O.__awaiter || function(e, t, r, n) { + function s(o) { + return o instanceof r ? o : new r(function(i) { + i(o); }); - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.argStringToArray = t.ToolRunner = void 0; - const p = o(require$$0__default.default), a = o(events__default.default), u = o(require$$0__default$1.default), h = o(require$$1__default.default), b = o(io), y = o(ioUtil), _ = process.platform === "win32"; - class E extends a.EventEmitter { - constructor(f, w, m) { - super(); - if (!f) - throw new Error("Parameter 'toolPath' cannot be null or empty."); - this.toolPath = f, this.args = w || [], this.options = m || {}; - } - _debug(f) { - this.options.listeners && this.options.listeners.debug && this.options.listeners.debug(f); - } - _getCommandString(f, w) { - const m = this._getSpawnFileName(), g = this._getSpawnArgs(f); - let T = w ? "" : "[command]"; - if (_) - if (this._isCmdFile()) { - T += m; - for (const v of g) - T += ` ${v}`; - } else if (f.windowsVerbatimArguments) { - T += `"${m}"`; - for (const v of g) - T += ` ${v}`; - } else { - T += this._windowsQuoteCmdArg(m); - for (const v of g) - T += ` ${this._windowsQuoteCmdArg(v)}`; - } - else { - T += m; - for (const v of g) - T += ` ${v}`; + } + return new (r || (r = Promise))(function(o, i) { + function a(h) { + try { + p(n.next(h)); + } catch (w) { + i(w); } - return T; } - _processLineBuffer(f, w, m) { + function l(h) { try { - let g = w + f.toString(), T = g.indexOf(p.EOL); - for (; T > -1; ) { - const v = g.substring(0, T); - m(v), g = g.substring(T + p.EOL.length), T = g.indexOf(p.EOL); - } - return g; - } catch (g) { - return this._debug(`error processing line. Failed with error ${g}`), ""; + p(n.throw(h)); + } catch (w) { + i(w); } } - _getSpawnFileName() { - return _ && this._isCmdFile() ? process.env.COMSPEC || "cmd.exe" : this.toolPath; + function p(h) { + h.done ? o(h.value) : s(h.value).then(a, l); } - _getSpawnArgs(f) { - if (_ && this._isCmdFile()) { - let w = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const m of this.args) - w += " ", w += f.windowsVerbatimArguments ? m : this._windowsQuoteCmdArg(m); - return w += '"', [w]; + p((n = n.apply(e, t || [])).next()); + }); +}; +Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.argStringToArray = Fe.ToolRunner = void 0; +const At = xe(Le.default), Ms = xe(_r.default), yd = xe(vr.default), Td = xe(qe.default), _d = xe(H), Ns = xe(gr), Ed = Oo.default, Rt = process.platform === "win32"; +class vd extends Ms.EventEmitter { + constructor(t, r, n) { + if (super(), !t) + throw new Error("Parameter 'toolPath' cannot be null or empty."); + this.toolPath = t, this.args = r || [], this.options = n || {}; + } + _debug(t) { + this.options.listeners && this.options.listeners.debug && this.options.listeners.debug(t); + } + _getCommandString(t, r) { + const n = this._getSpawnFileName(), s = this._getSpawnArgs(t); + let o = r ? "" : "[command]"; + if (Rt) + if (this._isCmdFile()) { + o += n; + for (const i of s) + o += ` ${i}`; + } else if (t.windowsVerbatimArguments) { + o += `"${n}"`; + for (const i of s) + o += ` ${i}`; + } else { + o += this._windowsQuoteCmdArg(n); + for (const i of s) + o += ` ${this._windowsQuoteCmdArg(i)}`; } - return this.args; - } - _endsWith(f, w) { - return f.endsWith(w); - } - _isCmdFile() { - const f = this.toolPath.toUpperCase(); - return this._endsWith(f, ".CMD") || this._endsWith(f, ".BAT"); - } - _windowsQuoteCmdArg(f) { - if (!this._isCmdFile()) - return this._uvQuoteCmdArg(f); - if (!f) - return '""'; - const w = [ - " ", - " ", - "&", - "(", - ")", - "[", - "]", - "{", - "}", - "^", - "=", - ";", - "!", - "'", - "+", - ",", - "`", - "~", - "|", - "<", - ">", - '"' - ]; - let m = !1; - for (const v of f) - if (w.some((O) => O === v)) { - m = !0; - break; - } - if (!m) - return f; - let g = '"', T = !0; - for (let v = f.length; v > 0; v--) - g += f[v - 1], T && f[v - 1] === "\\" ? g += "\\" : f[v - 1] === '"' ? (T = !0, g += '"') : T = !1; - return g += '"', g.split("").reverse().join(""); - } - _uvQuoteCmdArg(f) { - if (!f) - return '""'; - if (!f.includes(" ") && !f.includes(" ") && !f.includes('"')) - return f; - if (!f.includes('"') && !f.includes("\\")) - return `"${f}"`; - let w = '"', m = !0; - for (let g = f.length; g > 0; g--) - w += f[g - 1], m && f[g - 1] === "\\" ? w += "\\" : f[g - 1] === '"' ? (m = !0, w += "\\") : m = !1; - return w += '"', w.split("").reverse().join(""); - } - _cloneExecOptions(f) { - f = f || {}; - const w = { - cwd: f.cwd || process.cwd(), - env: f.env || process.env, - silent: f.silent || !1, - windowsVerbatimArguments: f.windowsVerbatimArguments || !1, - failOnStdErr: f.failOnStdErr || !1, - ignoreReturnCode: f.ignoreReturnCode || !1, - delay: f.delay || 1e4 - }; - return w.outStream = f.outStream || process.stdout, w.errStream = f.errStream || process.stderr, w; - } - _getSpawnOptions(f, w) { - f = f || {}; - const m = {}; - return m.cwd = f.cwd, m.env = f.env, m.windowsVerbatimArguments = f.windowsVerbatimArguments || this._isCmdFile(), f.windowsVerbatimArguments && (m.argv0 = `"${w}"`), m; - } - exec() { - return i(this, void 0, void 0, function* () { - return !y.isRooted(this.toolPath) && (this.toolPath.includes("/") || _ && this.toolPath.includes("\\")) && (this.toolPath = h.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath)), this.toolPath = yield b.which(this.toolPath, !0), new Promise((f, w) => i(this, void 0, void 0, function* () { - this._debug(`exec tool: ${this.toolPath}`), this._debug("arguments:"); - for (const A of this.args) - this._debug(` ${A}`); - const m = this._cloneExecOptions(this.options); - !m.silent && m.outStream && m.outStream.write(this._getCommandString(m) + p.EOL); - const g = new G(m, this.toolPath); - if (g.on("debug", (A) => { - this._debug(A); - }), this.options.cwd && !(yield y.exists(this.options.cwd))) - return w(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - const T = this._getSpawnFileName(), v = u.spawn(T, this._getSpawnArgs(m), this._getSpawnOptions(this.options, T)); - let O = ""; - v.stdout && v.stdout.on("data", (A) => { - this.options.listeners && this.options.listeners.stdout && this.options.listeners.stdout(A), !m.silent && m.outStream && m.outStream.write(A), O = this._processLineBuffer(A, O, (k) => { - this.options.listeners && this.options.listeners.stdline && this.options.listeners.stdline(k); - }); - }); - let $ = ""; - if (v.stderr && v.stderr.on("data", (A) => { - g.processStderr = !0, this.options.listeners && this.options.listeners.stderr && this.options.listeners.stderr(A), !m.silent && m.errStream && m.outStream && (m.failOnStdErr ? m.errStream : m.outStream).write(A), $ = this._processLineBuffer(A, $, (k) => { - this.options.listeners && this.options.listeners.errline && this.options.listeners.errline(k); - }); - }), v.on("error", (A) => { - g.processError = A.message, g.processExited = !0, g.processClosed = !0, g.CheckComplete(); - }), v.on("exit", (A) => { - g.processExitCode = A, g.processExited = !0, this._debug(`Exit code ${A} received from tool '${this.toolPath}'`), g.CheckComplete(); - }), v.on("close", (A) => { - g.processExitCode = A, g.processExited = !0, g.processClosed = !0, this._debug(`STDIO streams have closed for tool '${this.toolPath}'`), g.CheckComplete(); - }), g.on("done", (A, k) => { - O.length > 0 && this.emit("stdline", O), $.length > 0 && this.emit("errline", $), v.removeAllListeners(), A ? w(A) : f(k); - }), this.options.input) { - if (!v.stdin) - throw new Error("child process missing stdin"); - v.stdin.end(this.options.input); - } - })); - }); + else { + o += n; + for (const i of s) + o += ` ${i}`; } + return o; } - t.ToolRunner = E; - function P(d) { - const f = []; - let w = !1, m = !1, g = ""; - function T(v) { - m && v !== '"' && (g += "\\"), g += v, m = !1; - } - for (let v = 0; v < d.length; v++) { - const O = d.charAt(v); - if (O === '"') { - m ? T(O) : w = !w; - continue; - } - if (O === "\\" && m) { - T(O); - continue; - } - if (O === "\\" && w) { - m = !0; - continue; - } - if (O === " " && !w) { - g.length > 0 && (f.push(g), g = ""); - continue; + _processLineBuffer(t, r, n) { + try { + let s = r + t.toString(), o = s.indexOf(At.EOL); + for (; o > -1; ) { + const i = s.substring(0, o); + n(i), s = s.substring(o + At.EOL.length), o = s.indexOf(At.EOL); } - T(O); + return s; + } catch (s) { + return this._debug(`error processing line. Failed with error ${s}`), ""; } - return g.length > 0 && f.push(g.trim()), f; } - t.argStringToArray = P; - class G extends a.EventEmitter { - constructor(f, w) { - super(); - if (this.processClosed = !1, this.processError = "", this.processExitCode = 0, this.processExited = !1, this.processStderr = !1, this.delay = 1e4, this.done = !1, this.timeout = null, !w) - throw new Error("toolPath must not be empty"); - this.options = f, this.toolPath = w, f.delay && (this.delay = f.delay); + _getSpawnFileName() { + return Rt && this._isCmdFile() ? process.env.COMSPEC || "cmd.exe" : this.toolPath; + } + _getSpawnArgs(t) { + if (Rt && this._isCmdFile()) { + let r = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const n of this.args) + r += " ", r += t.windowsVerbatimArguments ? n : this._windowsQuoteCmdArg(n); + return r += '"', [r]; } - CheckComplete() { - this.done || (this.processClosed ? this._setResult() : this.processExited && (this.timeout = timers_1__default.default.setTimeout(G.HandleTimeout, this.delay, this))); + return this.args; + } + _endsWith(t, r) { + return t.endsWith(r); + } + _isCmdFile() { + const t = this.toolPath.toUpperCase(); + return this._endsWith(t, ".CMD") || this._endsWith(t, ".BAT"); + } + _windowsQuoteCmdArg(t) { + if (!this._isCmdFile()) + return this._uvQuoteCmdArg(t); + if (!t) + return '""'; + const r = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let n = !1; + for (const i of t) + if (r.some((a) => a === i)) { + n = !0; + break; + } + if (!n) + return t; + let s = '"', o = !0; + for (let i = t.length; i > 0; i--) + s += t[i - 1], o && t[i - 1] === "\\" ? s += "\\" : t[i - 1] === '"' ? (o = !0, s += '"') : o = !1; + return s += '"', s.split("").reverse().join(""); + } + _uvQuoteCmdArg(t) { + if (!t) + return '""'; + if (!t.includes(" ") && !t.includes(" ") && !t.includes('"')) + return t; + if (!t.includes('"') && !t.includes("\\")) + return `"${t}"`; + let r = '"', n = !0; + for (let s = t.length; s > 0; s--) + r += t[s - 1], n && t[s - 1] === "\\" ? r += "\\" : t[s - 1] === '"' ? (n = !0, r += "\\") : n = !1; + return r += '"', r.split("").reverse().join(""); + } + _cloneExecOptions(t) { + t = t || {}; + const r = { + cwd: t.cwd || process.cwd(), + env: t.env || process.env, + silent: t.silent || !1, + windowsVerbatimArguments: t.windowsVerbatimArguments || !1, + failOnStdErr: t.failOnStdErr || !1, + ignoreReturnCode: t.ignoreReturnCode || !1, + delay: t.delay || 1e4 + }; + return r.outStream = t.outStream || process.stdout, r.errStream = t.errStream || process.stderr, r; + } + _getSpawnOptions(t, r) { + t = t || {}; + const n = {}; + return n.cwd = t.cwd, n.env = t.env, n.windowsVerbatimArguments = t.windowsVerbatimArguments || this._isCmdFile(), t.windowsVerbatimArguments && (n.argv0 = `"${r}"`), n; + } + exec() { + return qs(this, void 0, void 0, function* () { + return !Ns.isRooted(this.toolPath) && (this.toolPath.includes("/") || Rt && this.toolPath.includes("\\")) && (this.toolPath = Td.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath)), this.toolPath = yield _d.which(this.toolPath, !0), new Promise((t, r) => qs(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`), this._debug("arguments:"); + for (const p of this.args) + this._debug(` ${p}`); + const n = this._cloneExecOptions(this.options); + !n.silent && n.outStream && n.outStream.write(this._getCommandString(n) + At.EOL); + const s = new yr(n, this.toolPath); + if (s.on("debug", (p) => { + this._debug(p); + }), this.options.cwd && !(yield Ns.exists(this.options.cwd))) + return r(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + const o = this._getSpawnFileName(), i = yd.spawn(o, this._getSpawnArgs(n), this._getSpawnOptions(this.options, o)); + let a = ""; + i.stdout && i.stdout.on("data", (p) => { + this.options.listeners && this.options.listeners.stdout && this.options.listeners.stdout(p), !n.silent && n.outStream && n.outStream.write(p), a = this._processLineBuffer(p, a, (h) => { + this.options.listeners && this.options.listeners.stdline && this.options.listeners.stdline(h); + }); + }); + let l = ""; + if (i.stderr && i.stderr.on("data", (p) => { + s.processStderr = !0, this.options.listeners && this.options.listeners.stderr && this.options.listeners.stderr(p), !n.silent && n.errStream && n.outStream && (n.failOnStdErr ? n.errStream : n.outStream).write(p), l = this._processLineBuffer(p, l, (h) => { + this.options.listeners && this.options.listeners.errline && this.options.listeners.errline(h); + }); + }), i.on("error", (p) => { + s.processError = p.message, s.processExited = !0, s.processClosed = !0, s.CheckComplete(); + }), i.on("exit", (p) => { + s.processExitCode = p, s.processExited = !0, this._debug(`Exit code ${p} received from tool '${this.toolPath}'`), s.CheckComplete(); + }), i.on("close", (p) => { + s.processExitCode = p, s.processExited = !0, s.processClosed = !0, this._debug(`STDIO streams have closed for tool '${this.toolPath}'`), s.CheckComplete(); + }), s.on("done", (p, h) => { + a.length > 0 && this.emit("stdline", a), l.length > 0 && this.emit("errline", l), i.removeAllListeners(), p ? r(p) : t(h); + }), this.options.input) { + if (!i.stdin) + throw new Error("child process missing stdin"); + i.stdin.end(this.options.input); + } + })); + }); + } +} +Fe.ToolRunner = vd; +function Od(e) { + const t = []; + let r = !1, n = !1, s = ""; + function o(i) { + n && i !== '"' && (s += "\\"), s += i, n = !1; + } + for (let i = 0; i < e.length; i++) { + const a = e.charAt(i); + if (a === '"') { + n ? o(a) : r = !r; + continue; } - _debug(f) { - this.emit("debug", f); + if (a === "\\" && n) { + o(a); + continue; } - _setResult() { - let f; - this.processExited && (this.processError ? f = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`) : this.processExitCode !== 0 && !this.options.ignoreReturnCode ? f = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`) : this.processStderr && this.options.failOnStdErr && (f = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))), this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.done = !0, this.emit("done", f, this.processExitCode); + if (a === "\\" && r) { + n = !0; + continue; } - static HandleTimeout(f) { - if (!f.done) { - if (!f.processClosed && f.processExited) { - const w = `The STDIO streams did not close within ${f.delay / 1e3} seconds of the exit event from process '${f.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - f._debug(w); - } - f._setResult(); - } + if (a === " " && !r) { + s.length > 0 && (t.push(s), s = ""); + continue; } + o(a); } -}), exec_1 = createCommonjsModule(function(e, t) { - var n = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(h, b, y, _) { - _ === void 0 && (_ = y), Object.defineProperty(h, _, { enumerable: !0, get: function() { - return b[y]; - } }); - } : function(h, b, y, _) { - _ === void 0 && (_ = y), h[_] = b[y]; - }), s = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(h, b) { - Object.defineProperty(h, "default", { enumerable: !0, value: b }); - } : function(h, b) { - h.default = b; - }), o = commonjsGlobal && commonjsGlobal.__importStar || function(h) { - if (h && h.__esModule) - return h; - var b = {}; - if (h != null) - for (var y in h) - y !== "default" && Object.hasOwnProperty.call(h, y) && n(b, h, y); - return s(b, h), b; - }, i = commonjsGlobal && commonjsGlobal.__awaiter || function(h, b, y, _) { - function E(P) { - return P instanceof y ? P : new y(function(G) { - G(P); - }); - } - return new (y || (y = Promise))(function(P, G) { - function d(m) { - try { - w(_.next(m)); - } catch (g) { - G(g); - } - } - function f(m) { - try { - w(_.throw(m)); - } catch (g) { - G(g); - } - } - function w(m) { - m.done ? P(m.value) : E(m.value).then(d, f); + return s.length > 0 && t.push(s.trim()), t; +} +Fe.argStringToArray = Od; +class yr extends Ms.EventEmitter { + constructor(t, r) { + if (super(), this.processClosed = !1, this.processError = "", this.processExitCode = 0, this.processExited = !1, this.processStderr = !1, this.delay = 1e4, this.done = !1, this.timeout = null, !r) + throw new Error("toolPath must not be empty"); + this.options = t, this.toolPath = r, t.delay && (this.delay = t.delay); + } + CheckComplete() { + this.done || (this.processClosed ? this._setResult() : this.processExited && (this.timeout = Ed.setTimeout(yr.HandleTimeout, this.delay, this))); + } + _debug(t) { + this.emit("debug", t); + } + _setResult() { + let t; + this.processExited && (this.processError ? t = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`) : this.processExitCode !== 0 && !this.options.ignoreReturnCode ? t = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`) : this.processStderr && this.options.failOnStdErr && (t = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))), this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.done = !0, this.emit("done", t, this.processExitCode); + } + static HandleTimeout(t) { + if (!t.done) { + if (!t.processClosed && t.processExited) { + const r = `The STDIO streams did not close within ${t.delay / 1e3} seconds of the exit event from process '${t.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + t._debug(r); } - w((_ = _.apply(h, b || [])).next()); - }); - }; - Object.defineProperty(t, "__esModule", { value: !0 }), t.getExecOutput = t.exec = void 0; - const p = o(toolrunner); - function a(h, b, y) { - return i(this, void 0, void 0, function* () { - const _ = p.argStringToArray(h); - if (_.length === 0) - throw new Error("Parameter 'commandLine' cannot be null or empty."); - const E = _[0]; - return b = _.slice(1).concat(b || []), new p.ToolRunner(E, b, y).exec(); - }); + t._setResult(); + } } - t.exec = a; - function u(h, b, y) { - var _, E; - return i(this, void 0, void 0, function* () { - let P = "", G = ""; - const d = new string_decoder_1__default.default.StringDecoder("utf8"), f = new string_decoder_1__default.default.StringDecoder("utf8"), w = (_ = y == null ? void 0 : y.listeners) === null || _ === void 0 ? void 0 : _.stdout, m = (E = y == null ? void 0 : y.listeners) === null || E === void 0 ? void 0 : E.stderr, g = ($) => { - G += f.write($), m && m($); - }, T = ($) => { - P += d.write($), w && w($); - }, v = Object.assign(Object.assign({}, y == null ? void 0 : y.listeners), { stdout: T, stderr: g }), O = yield a(h, b, Object.assign(Object.assign({}, y), { listeners: v })); - return P += d.end(), G += f.end(), { - exitCode: O, - stdout: P, - stderr: G - }; +} +var Pd = O && O.__createBinding || (Object.create ? function(e, t, r, n) { + n === void 0 && (n = r), Object.defineProperty(e, n, { enumerable: !0, get: function() { + return t[r]; + } }); +} : function(e, t, r, n) { + n === void 0 && (n = r), e[n] = t[r]; +}), Sd = O && O.__setModuleDefault || (Object.create ? function(e, t) { + Object.defineProperty(e, "default", { enumerable: !0, value: t }); +} : function(e, t) { + e.default = t; +}), Ad = O && O.__importStar || function(e) { + if (e && e.__esModule) + return e; + var t = {}; + if (e != null) + for (var r in e) + r !== "default" && Object.hasOwnProperty.call(e, r) && Pd(t, e, r); + return Sd(t, e), t; +}, zs = O && O.__awaiter || function(e, t, r, n) { + function s(o) { + return o instanceof r ? o : new r(function(i) { + i(o); }); } - t.getExecOutput = u; -}), __defProp$2 = Object.defineProperty, __defProps$2 = Object.defineProperties, __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$2 = Object.getOwnPropertySymbols, __hasOwnProp$2 = Object.prototype.hasOwnProperty, __propIsEnum$2 = Object.prototype.propertyIsEnumerable, __defNormalProp$2 = (e, t, n) => t in e ? __defProp$2(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$2 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$2.call(t, n) && __defNormalProp$2(e, n, t[n]); - if (__getOwnPropSymbols$2) - for (var n of __getOwnPropSymbols$2(t)) - __propIsEnum$2.call(t, n) && __defNormalProp$2(e, n, t[n]); + return new (r || (r = Promise))(function(o, i) { + function a(h) { + try { + p(n.next(h)); + } catch (w) { + i(w); + } + } + function l(h) { + try { + p(n.throw(h)); + } catch (w) { + i(w); + } + } + function p(h) { + h.done ? o(h.value) : s(h.value).then(a, l); + } + p((n = n.apply(e, t || [])).next()); + }); +}; +Object.defineProperty(st, "__esModule", { value: !0 }), st.getExecOutput = Vs = st.exec = void 0; +const Hs = vo.default, Ws = Ad(Fe); +function Ks(e, t, r) { + return zs(this, void 0, void 0, function* () { + const n = Ws.argStringToArray(e); + if (n.length === 0) + throw new Error("Parameter 'commandLine' cannot be null or empty."); + const s = n[0]; + return t = n.slice(1).concat(t || []), new Ws.ToolRunner(s, t, r).exec(); + }); +} +var Vs = st.exec = Ks; +function Rd(e, t, r) { + var n, s; + return zs(this, void 0, void 0, function* () { + let o = "", i = ""; + const a = new Hs.StringDecoder("utf8"), l = new Hs.StringDecoder("utf8"), p = (n = r?.listeners) === null || n === void 0 ? void 0 : n.stdout, h = (s = r?.listeners) === null || s === void 0 ? void 0 : s.stderr, w = (m) => { + i += l.write(m), h && h(m); + }, _ = (m) => { + o += a.write(m), p && p(m); + }, $ = Object.assign(Object.assign({}, r?.listeners), { stdout: _, stderr: w }), E = yield Ks(e, t, Object.assign(Object.assign({}, r), { listeners: $ })); + return o += a.end(), i += l.end(), { + exitCode: E, + stdout: o, + stderr: i + }; + }); +} +st.getExecOutput = Rd; +var $d = Object.defineProperty, Gd = Object.defineProperties, Cd = Object.getOwnPropertyDescriptors, Js = Object.getOwnPropertySymbols, kd = Object.prototype.hasOwnProperty, Dd = Object.prototype.propertyIsEnumerable, Ys = (e, t, r) => t in e ? $d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ud = (e, t) => { + for (var r in t || (t = {})) + kd.call(t, r) && Ys(e, r, t[r]); + if (Js) + for (var r of Js(t)) + Dd.call(t, r) && Ys(e, r, t[r]); return e; -}, __spreadProps$2 = (e, t) => __defProps$2(e, __getOwnPropDescs$2(t)); -async function exec(e, t) { - let n = "", s = ""; - const o = Date.now(), i = await exec_1.exec(e, null, __spreadProps$2(__spreadValues$2({}, t), { +}, jd = (e, t) => Gd(e, Cd(t)); +async function K(e, t) { + let r = "", n = ""; + const s = Date.now(), o = await Vs(e, null, jd(Ud({}, t), { silent: !0, listeners: { stdout(a) { - n += a.toString(); + r += a.toString(); }, stderr(a) { - s += a.toString(); + n += a.toString(); } } - })), p = Date.now() - o; + })), i = Date.now() - s; return { - exitCode: i, - duration: p, - stdout: n, - stderr: s + exitCode: o, + duration: i, + stdout: r, + stderr: n }; } -async function isBaseDiffFromHead(e) { +async function Fd(e) { try { - await exec(`git fetch origin ${e} --depth=1`); - } catch (n) { - throw new Error(`Failed to git fetch ${e} ${n.message}`); + await K(`git fetch origin ${e} --depth=1`); + } catch (r) { + throw new Error(`Failed to git fetch ${e} ${r.message}`); } - const { exitCode: t } = await exec(`git diff --quiet origin/${e}`, { ignoreReturnCode: !0 }); + const { exitCode: t } = await K(`git diff --quiet origin/${e}`, { ignoreReturnCode: !0 }); return t !== 0; } -async function npmCi({ cwd: e } = {}) { - fs__default.default.existsSync("node_modules") && (core.info("Cleaning node_modules"), await io.rmRF(require$$1__default.default.join(e, "node_modules"))); - const t = { +async function xd({ cwd: e, installCommand: t } = {}) { + t ? G.info(`Custom install command providing. Installing dependencies with ${t}`) : t = Id(), ce.default.existsSync("node_modules") && (G.info("Cleaning node_modules"), await Fs(qe.default.join(e, "node_modules"))); + const r = { cwd: e, ignoreReturnCode: !0 - }; - let n = ""; - fs__default.default.existsSync("package-lock.json") ? (core.info("Installing dependencies with npm"), n = "npm ci") : fs__default.default.existsSync("yarn.lock") ? (core.info("Installing dependencies with yarn"), n = "yarn install --frozen-lockfile") : fs__default.default.existsSync("pnpm-lock.yaml") ? (core.info("Installing dependencies with pnpm"), n = "npx pnpm i --frozen-lockfile") : (core.info("No lock file detected. Installing dependencies with npm"), n = "npm i"); - const { exitCode: s, stdout: o, stderr: i } = await exec(n, t); - if (s > 0) - throw new Error(`${i} -${o}`); -} -async function isFileTracked(e) { - const { exitCode: t } = await exec(`git ls-files --error-unmatch ${e}`, { ignoreReturnCode: !0 }); + }, { exitCode: n, stdout: s, stderr: o } = await K(t, r); + if (n > 0) + throw new Error(`${o} +${s}`); +} +function Id() { + return ce.default.existsSync("package-lock.json") ? (G.info("Installing dependencies with npm"), "npm ci") : ce.default.existsSync("yarn.lock") ? (G.info("Installing dependencies with yarn"), "yarn install --frozen-lockfile") : ce.default.existsSync("pnpm-lock.yaml") ? (G.info("Installing dependencies with pnpm"), "npx pnpm i --frozen-lockfile") : (G.info("No lock file detected. Installing dependencies with npm"), "npm i"); +} +async function Bd(e) { + const { exitCode: t } = await K(`git ls-files --error-unmatch ${e}`, { ignoreReturnCode: !0 }); return t === 0; } -var __defProp$1 = Object.defineProperty, __defProps$1 = Object.defineProperties, __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$1 = Object.getOwnPropertySymbols, __hasOwnProp$1 = Object.prototype.hasOwnProperty, __propIsEnum$1 = Object.prototype.propertyIsEnumerable, __defNormalProp$1 = (e, t, n) => t in e ? __defProp$1(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues$1 = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp$1.call(t, n) && __defNormalProp$1(e, n, t[n]); - if (__getOwnPropSymbols$1) - for (var n of __getOwnPropSymbols$1(t)) - __propIsEnum$1.call(t, n) && __defNormalProp$1(e, n, t[n]); +var Ld = Object.defineProperty, qd = Object.defineProperties, Md = Object.getOwnPropertyDescriptors, Zs = Object.getOwnPropertySymbols, Nd = Object.prototype.hasOwnProperty, zd = Object.prototype.propertyIsEnumerable, Xs = (e, t, r) => t in e ? Ld(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Hd = (e, t) => { + for (var r in t || (t = {})) + Nd.call(t, r) && Xs(e, r, t[r]); + if (Zs) + for (var r of Zs(t)) + zd.call(t, r) && Xs(e, r, t[r]); return e; -}, __spreadProps$1 = (e, t) => __defProps$1(e, __getOwnPropDescs$1(t)); -let pkgSizeInstalled = !1; -async function buildRef({ +}, Wd = (e, t) => qd(e, Md(t)); +let Qs = !1; +async function eo({ checkoutRef: e, refData: t, - buildCommand: n + buildCommand: r, + installCommand: n }) { const s = process.cwd(); - if (core.info(`Current working directory: ${s}`), e && (core.info(`Checking out ref '${e}'`), await exec(`git checkout -f ${e}`)), n !== "false") { - if (!n) { - let a; + if (G.info(`Current working directory: ${s}`), e && (G.info(`Checking out ref '${e}'`), await K(`git checkout -f ${e}`)), r !== "false") { + if (!r) { + let l; try { - a = JSON.parse(fs__default.default.readFileSync("./package.json")); - } catch (u) { - core.warning("Error reading package.json", u); + l = JSON.parse(ce.default.readFileSync("./package.json")); + } catch (p) { + G.warning("Error reading package.json", p); } - a && a.scripts && a.scripts.build && (core.info("Build script found in package.json"), n = "npm run build"); + l && l.scripts && l.scripts.build && (G.info("Build script found in package.json"), r = "npm run build"); } - if (n) { - await npmCi({ cwd: s }).catch((u) => { + if (r) { + await xd({ installCommand: n, cwd: s }).catch((p) => { throw new Error(`Failed to install dependencies: -${u.message}`); - }), core.info(`Running build command: ${n}`); - const a = Date.now(); - await exec(n, { cwd: s }).catch((u) => { - throw new Error(`Failed to run build command: ${n} -${u.message}`); - }), core.info(`Build completed in ${(Date.now() - a) / 1e3}s`); - } - } - pkgSizeInstalled || (core.info("Installing pkg-size globally"), await exec("npm i -g pkg-size"), pkgSizeInstalled = !0), core.info("Getting package size"); - const o = await exec("pkg-size --json", { cwd: s }).catch((a) => { - throw new Error(`Failed to determine package size: ${a.message}`); +${p.message}`); + }), G.info(`Running build command: ${r}`); + const l = Date.now(); + await K(r, { cwd: s }).catch((p) => { + throw new Error(`Failed to run build command: ${r} +${p.message}`); + }), G.info(`Build completed in ${(Date.now() - l) / 1e3}s`); + } + } + Qs || (G.info("Installing pkg-size globally"), await K("npm i -g pkg-size"), Qs = !0), G.info("Getting package size"); + const o = await K("pkg-size --json", { cwd: s }).catch((l) => { + throw new Error(`Failed to determine package size: ${l.message}`); }); - core.debug(JSON.stringify(o, null, 4)); - const i = __spreadProps$1(__spreadValues$1({}, JSON.parse(o.stdout)), { + G.debug(JSON.stringify(o, null, 4)); + const i = Wd(Hd({}, JSON.parse(o.stdout)), { ref: t, size: 0, sizeGzip: 0, sizeBrotli: 0 }); - await Promise.all(i.files.map(async (a) => { - i.size += a.size, i.sizeGzip += a.sizeGzip, i.sizeBrotli += a.sizeBrotli; - const u = await isFileTracked(a.path); - a.isTracked = u, a.label = u ? link(c$1(a.path), `${t.repo.html_url}/blob/${t.ref}/${a.path}`) : c$1(a.path); - })), core.info("Cleaning up"), await exec("git reset --hard"); - const { stdout: p } = await exec("git clean -dfx"); - return core.debug(p), i; -} -var __defProp = Object.defineProperty, __defProps = Object.defineProperties, __getOwnPropDescs = Object.getOwnPropertyDescriptors, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (e, t, n) => t in e ? __defProp(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, __spreadValues = (e, t) => { - for (var n in t || (t = {})) - __hasOwnProp.call(t, n) && __defNormalProp(e, n, t[n]); - if (__getOwnPropSymbols) - for (var n of __getOwnPropSymbols(t)) - __propIsEnum.call(t, n) && __defNormalProp(e, n, t[n]); + await Promise.all(i.files.map(async (l) => { + i.size += l.size, i.sizeGzip += l.sizeGzip, i.sizeBrotli += l.sizeBrotli; + const p = await Bd(l.path); + l.isTracked = p, l.label = p ? $a(M(l.path), `${t.repo.html_url}/blob/${t.ref}/${l.path}`) : M(l.path); + })), G.info("Cleaning up"), await K("git reset --hard"); + const { stdout: a } = await K("git clean -dfx"); + return G.debug(a), i; +} +var Kd = Object.defineProperty, Vd = Object.defineProperties, Jd = Object.getOwnPropertyDescriptors, to = Object.getOwnPropertySymbols, Yd = Object.prototype.hasOwnProperty, Zd = Object.prototype.propertyIsEnumerable, ro = (e, t, r) => t in e ? Kd(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Xd = (e, t) => { + for (var r in t || (t = {})) + Yd.call(t, r) && ro(e, r, t[r]); + if (to) + for (var r of to(t)) + Zd.call(t, r) && ro(e, r, t[r]); return e; -}, __spreadProps = (e, t) => __defProps(e, __getOwnPropDescs(t)); -async function generateSizeReport({ +}, Qd = (e, t) => Vd(e, Jd(t)); +async function ef({ pr: e, buildCommand: t, - commentReport: n, - mode: s, - unchangedFiles: o, - hideFiles: i, - sortBy: p, + commentReport: r, + mode: n, + unchangedFiles: s, + hideFiles: o, + sortBy: i, sortOrder: a, - displaySize: u + displaySize: l, + installCommand: p }) { - core.startGroup("Build HEAD"); - const h = await buildRef({ + G.startGroup("Build HEAD"); + const h = await eo({ refData: e.head, - buildCommand: t + buildCommand: t, + installCommand: p }); - if (core.setOutput("headPkgData", h), core.endGroup(), s === "head-only") - return n !== "false" ? headOnly({ + if (G.setOutput("headPkgData", h), G.endGroup(), n === "head-only") + return r !== "false" ? ld({ headPkgData: h, - displaySize: u, - sortBy: p, + displaySize: l, + sortBy: i, sortOrder: a, - hideFiles: i + hideFiles: o }) : !1; - const { ref: b } = e.base; - let y; - return await isBaseDiffFromHead(b) ? (core.info("HEAD is different from BASE. Triggering build."), core.startGroup("Build BASE"), y = await buildRef({ - checkoutRef: b, + const { ref: w } = e.base; + let _; + return await Fd(w) ? (G.info("HEAD is different from BASE. Triggering build."), G.startGroup("Build BASE"), _ = await eo({ + checkoutRef: w, refData: e.base, buildCommand: t - }), core.endGroup()) : (core.info("HEAD is identical to BASE. Skipping base build."), y = __spreadProps(__spreadValues({}, h), { + }), G.endGroup()) : (G.info("HEAD is identical to BASE. Skipping base build."), _ = Qd(Xd({}, h), { ref: e.base - })), core.setOutput("basePkgData", y), n !== "false" ? generateComment({ + })), G.setOutput("basePkgData", _), r !== "false" ? cd({ headPkgData: h, - basePkgData: y, - displaySize: u, - sortBy: p, + basePkgData: _, + displaySize: l, + sortBy: i, sortOrder: a, - hideFiles: i, - unchangedFiles: o + hideFiles: o, + unchangedFiles: s }) : !1; } -const COMMENT_SIGNATURE = sub("\u{1F916} This report was automatically generated by [pkg-size-action](https://github.com/pkg-size/action/)"); +const tf = On("\u{1F916} This report was automatically generated by [pkg-size-action](https://github.com/pkg-size/action/)"); (async () => { const { GITHUB_TOKEN: e } = process.env; - assert_1__default.default(e, 'Environment variable "GITHUB_TOKEN" not set. Required for accessing and reporting on the PR.'); - const { pull_request: t } = github.context.payload, n = await generateSizeReport({ + Tr.default(e, "Environment variable 'GITHUB_TOKEN' not set. Required for accessing and reporting on the PR."); + const { pull_request: t } = gt.payload, r = await ef({ pr: t, - buildCommand: core.getInput("build-command"), - commentReport: core.getInput("comment-report"), - mode: core.getInput("mode") || "regression", - unchangedFiles: core.getInput("unchanged-files") || "collapse", - hideFiles: core.getInput("hide-files"), - sortBy: core.getInput("sort-by") || "delta", - sortOrder: core.getInput("sort-order") || "desc", - displaySize: core.getInput("display-size") || "uncompressed" + buildCommand: G.getInput("build-command"), + commentReport: G.getInput("comment-report"), + mode: G.getInput("mode") || "regression", + unchangedFiles: G.getInput("unchanged-files") || "collapse", + hideFiles: G.getInput("hide-files"), + sortBy: G.getInput("sort-by") || "delta", + sortOrder: G.getInput("sort-order") || "desc", + displaySize: G.getInput("display-size") || "uncompressed", + installCommand: G.getInput("install-command") }); - await exec(`git checkout -f ${github.context.sha}`), n && await upsertComment({ + await K(`git checkout -f ${gt.sha}`), r && await ja({ token: e, - commentSignature: COMMENT_SIGNATURE, - repo: github.context.repo, + commentSignature: tf, + repo: gt.repo, prNumber: t.number, - body: n + body: r }); })().catch((e) => { - core.setFailed(e.message), core.warning(e.stack); + G.setFailed(e.message), G.warning(e.stack); }); diff --git a/package.json b/package.json index c660b08..b6a2ac5 100644 --- a/package.json +++ b/package.json @@ -38,27 +38,27 @@ ] }, "devDependencies": { - "@actions/cache": "^1.0.7", - "@actions/core": "^1.4.0", - "@actions/exec": "^1.1.0", + "@actions/cache": "2.0.2", + "@actions/core": "1.6.0", + "@actions/exec": "1.1.1", "@actions/github": "^4.0.0", - "@actions/io": "^1.1.1", + "@actions/io": "1.1.2", "@pvtnbr/eslint-config-base": "^0.1.19", - "@rollup/plugin-commonjs": "^17.1.0", - "@rollup/plugin-node-resolve": "^11.2.1", + "@rollup/plugin-commonjs": "21.0.3", + "@rollup/plugin-node-resolve": "13.2.0", "builtin-modules": "^3.1.0", - "byte-size": "^7.0.1", - "conventional-changelog-conventionalcommits": "^4.6.0", - "esbuild": "^0.12.20", + "byte-size": "8.1.0", + "conventional-changelog-conventionalcommits": "4.6.3", + "esbuild": "0.14.36", "eslint": "^7.32.0", "glob-to-regexp": "^0.4.1", "husky": "^4.3.8", "lint-staged": "^10.5.4", "lodash-es": "^4.17.21", - "markdown-table": "^2.0.0", - "outdent": "^0.7.1", - "rollup": "^2.55.1", - "rollup-plugin-esbuild": "^4.5.0", + "markdown-table": "3.0.2", + "outdent": "0.8.0", + "rollup": "2.70.1", + "rollup-plugin-esbuild": "4.9.1", "rollup-plugin-terser": "^7.0.2" }, "eslintConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6fe08c..999b451 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,77 +1,81 @@ lockfileVersion: 5.3 specifiers: - '@actions/cache': ^1.0.7 - '@actions/core': ^1.4.0 - '@actions/exec': ^1.1.0 + '@actions/cache': 2.0.2 + '@actions/core': 1.6.0 + '@actions/exec': 1.1.1 '@actions/github': ^4.0.0 - '@actions/io': ^1.1.1 + '@actions/io': 1.1.2 '@pvtnbr/eslint-config-base': ^0.1.19 - '@rollup/plugin-commonjs': ^17.1.0 - '@rollup/plugin-node-resolve': ^11.2.1 + '@rollup/plugin-commonjs': 21.0.3 + '@rollup/plugin-node-resolve': 13.2.0 builtin-modules: ^3.1.0 - byte-size: ^7.0.1 - conventional-changelog-conventionalcommits: ^4.6.0 - esbuild: ^0.12.20 + byte-size: 8.1.0 + conventional-changelog-conventionalcommits: 4.6.3 + esbuild: 0.14.36 eslint: ^7.32.0 glob-to-regexp: ^0.4.1 husky: ^4.3.8 lint-staged: ^10.5.4 lodash-es: ^4.17.21 - markdown-table: ^2.0.0 - outdent: ^0.7.1 - rollup: ^2.55.1 - rollup-plugin-esbuild: ^4.5.0 + markdown-table: 3.0.2 + outdent: 0.8.0 + rollup: 2.70.1 + rollup-plugin-esbuild: 4.9.1 rollup-plugin-terser: ^7.0.2 devDependencies: - '@actions/cache': 1.0.7 - '@actions/core': 1.4.0 - '@actions/exec': 1.1.0 + '@actions/cache': 2.0.2 + '@actions/core': 1.6.0 + '@actions/exec': 1.1.1 '@actions/github': 4.0.0 - '@actions/io': 1.1.1 + '@actions/io': 1.1.2 '@pvtnbr/eslint-config-base': 0.1.19_eslint@7.32.0 - '@rollup/plugin-commonjs': 17.1.0_rollup@2.55.1 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.55.1 + '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 + '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 builtin-modules: 3.2.0 - byte-size: 7.0.1 - conventional-changelog-conventionalcommits: 4.6.0 - esbuild: 0.12.20 + byte-size: 8.1.0 + conventional-changelog-conventionalcommits: 4.6.3 + esbuild: 0.14.36 eslint: 7.32.0 glob-to-regexp: 0.4.1 husky: 4.3.8 lint-staged: 10.5.4 lodash-es: 4.17.21 - markdown-table: 2.0.0 - outdent: 0.7.1 - rollup: 2.55.1 - rollup-plugin-esbuild: 4.5.0_esbuild@0.12.20+rollup@2.55.1 - rollup-plugin-terser: 7.0.2_rollup@2.55.1 + markdown-table: 3.0.2 + outdent: 0.8.0 + rollup: 2.70.1 + rollup-plugin-esbuild: 4.9.1_esbuild@0.14.36+rollup@2.70.1 + rollup-plugin-terser: 7.0.2_rollup@2.70.1 packages: - /@actions/cache/1.0.7: - resolution: {integrity: sha512-MY69kxuubqUFq84pFlu8m6Poxl5sR/xyhpC4JEvno7Yg9ASYdGizEmKgt0m8ovewpYKf15UAOcSC0hzS+DuosA==} + /@actions/cache/2.0.2: + resolution: {integrity: sha512-K1DCaW/OtHj5mV7hI7HEXiceX3rM4Nc0iG2hfYsrkEy6GiOeqlCC/LyICrBZIRDM6+vSrS12tg1ORl4hghomBA==} dependencies: - '@actions/core': 1.4.0 - '@actions/exec': 1.1.0 + '@actions/core': 1.6.0 + '@actions/exec': 1.1.1 '@actions/glob': 0.1.1 '@actions/http-client': 1.0.9 - '@actions/io': 1.1.1 - '@azure/ms-rest-js': 2.1.0 - '@azure/storage-blob': 12.3.0 + '@actions/io': 1.1.2 + '@azure/ms-rest-js': 2.6.1 + '@azure/storage-blob': 12.9.0 semver: 6.3.0 uuid: 3.4.0 + transitivePeerDependencies: + - encoding dev: true - /@actions/core/1.4.0: - resolution: {integrity: sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg==} + /@actions/core/1.6.0: + resolution: {integrity: sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==} + dependencies: + '@actions/http-client': 1.0.11 dev: true - /@actions/exec/1.1.0: - resolution: {integrity: sha512-LImpN9AY0J1R1mEYJjVJfSZWU4zYOlEcwSTgPve1rFQqK5AwrEs6uWW5Rv70gbDIQIAUwI86z6B+9mPK4w9Sbg==} + /@actions/exec/1.1.1: + resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} dependencies: - '@actions/io': 1.1.1 + '@actions/io': 1.1.2 dev: true /@actions/github/4.0.0: @@ -86,18 +90,24 @@ packages: /@actions/glob/0.1.1: resolution: {integrity: sha512-ikM4GVZOgSGDNTjv0ECJ8AOqmDqQwtO4K1M4P465C9iikRq34+FwCjUVSwzgOYDP85qtddyWpzBw5lTub/9Xmg==} dependencies: - '@actions/core': 1.4.0 + '@actions/core': 1.6.0 minimatch: 3.0.4 dev: true + /@actions/http-client/1.0.11: + resolution: {integrity: sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==} + dependencies: + tunnel: 0.0.6 + dev: true + /@actions/http-client/1.0.9: resolution: {integrity: sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==} dependencies: tunnel: 0.0.6 dev: true - /@actions/io/1.1.1: - resolution: {integrity: sha512-Qi4JoKXjmE0O67wAOH6y0n26QXhMKMFo7GD/4IXNVcrtLjUlGjGuVys6pQgwF3ArfGTQu0XpqaNr0YhED2RaRA==} + /@actions/io/1.1.2: + resolution: {integrity: sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw==} dev: true /@azure/abort-controller/1.0.1: @@ -110,44 +120,45 @@ packages: resolution: {integrity: sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==} dev: true - /@azure/core-auth/1.1.3: - resolution: {integrity: sha512-A4xigW0YZZpkj1zK7dKuzbBpGwnhEcRk6WWuIshdHC32raR3EQ1j6VA9XZqE+RFsUgH6OAmIK5BWIz+mZjnd6Q==} - engines: {node: '>=8.0.0'} + /@azure/core-auth/1.3.2: + resolution: {integrity: sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==} + engines: {node: '>=12.0.0'} dependencies: '@azure/abort-controller': 1.0.1 - '@azure/core-tracing': 1.0.0-preview.8 - '@opentelemetry/api': 0.6.1 - tslib: 2.0.3 + tslib: 2.3.1 dev: true - /@azure/core-http/1.2.1: - resolution: {integrity: sha512-vPHIQXjLVs4iin2BUaj7/sqIAfGq3MW1TLEc3yYKFNpi/sBQn2KI0g+Ow0EQYvAkkHhTHGArA7JKhcjsnJMGLw==} - engines: {node: '>=8.0.0'} + /@azure/core-http/2.2.4: + resolution: {integrity: sha512-QmmJmexXKtPyc3/rsZR/YTLDvMatzbzAypJmLzvlfxgz/SkgnqV/D4f6F2LsK6tBj1qhyp8BoXiOebiej0zz3A==} + engines: {node: '>=12.0.0'} dependencies: '@azure/abort-controller': 1.0.1 - '@azure/core-auth': 1.1.3 - '@azure/core-tracing': 1.0.0-preview.9 + '@azure/core-asynciterator-polyfill': 1.0.0 + '@azure/core-auth': 1.3.2 + '@azure/core-tracing': 1.0.0-preview.13 '@azure/logger': 1.0.0 - '@opentelemetry/api': 0.10.2 '@types/node-fetch': 2.5.7 - '@types/tunnel': 0.0.1 - form-data: 3.0.0 - node-fetch: 2.6.1 + '@types/tunnel': 0.0.3 + form-data: 4.0.0 + node-fetch: 2.6.7 process: 0.11.10 tough-cookie: 4.0.0 - tslib: 2.0.3 + tslib: 2.3.1 tunnel: 0.0.6 uuid: 8.3.2 xml2js: 0.4.23 + transitivePeerDependencies: + - encoding dev: true - /@azure/core-lro/1.0.2: - resolution: {integrity: sha512-Yr0JD7GKryOmbcb5wHCQoQ4KCcH5QJWRNorofid+UvudLaxnbCfvKh/cUfQsGUqRjO9L/Bw4X7FP824DcHdMxw==} + /@azure/core-lro/2.2.4: + resolution: {integrity: sha512-e1I2v2CZM0mQo8+RSix0x091Av493e4bnT22ds2fcQGslTHzM2oTbswkB65nP4iEpCxBrFxOSDPKExmTmjCVtQ==} + engines: {node: '>=12.0.0'} dependencies: '@azure/abort-controller': 1.0.1 - '@azure/core-http': 1.2.1 - events: 3.2.0 - tslib: 1.14.1 + '@azure/core-tracing': 1.0.0-preview.13 + '@azure/logger': 1.0.0 + tslib: 2.3.1 dev: true /@azure/core-paging/1.1.3: @@ -157,21 +168,12 @@ packages: '@azure/core-asynciterator-polyfill': 1.0.0 dev: true - /@azure/core-tracing/1.0.0-preview.8: - resolution: {integrity: sha512-ZKUpCd7Dlyfn7bdc+/zC/sf0aRIaNQMDuSj2RhYRFe3p70hVAnYGp3TX4cnG2yoEALp/LTj/XnZGQ8Xzf6Ja/Q==} - dependencies: - '@opencensus/web-types': 0.0.7 - '@opentelemetry/api': 0.6.1 - tslib: 1.14.1 - dev: true - - /@azure/core-tracing/1.0.0-preview.9: - resolution: {integrity: sha512-zczolCLJ5QG42AEPQ+Qg9SRYNUyB+yZ5dzof4YEc+dyWczO9G2sBqbAjLB7IqrsdHN2apkiB2oXeDKCsq48jug==} - engines: {node: '>=8.0.0'} + /@azure/core-tracing/1.0.0-preview.13: + resolution: {integrity: sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==} + engines: {node: '>=12.0.0'} dependencies: - '@opencensus/web-types': 0.0.7 - '@opentelemetry/api': 0.10.2 - tslib: 2.0.3 + '@opentelemetry/api': 1.0.4 + tslib: 2.3.1 dev: true /@azure/logger/1.0.0: @@ -180,33 +182,36 @@ packages: tslib: 1.14.1 dev: true - /@azure/ms-rest-js/2.1.0: - resolution: {integrity: sha512-4BXLVImYRt+jcUmEJ5LUWglI8RBNVQndY6IcyvQ4U8O4kIXdmlRz3cJdA/RpXf5rKT38KOoTO2T6Z1f6Z1HDBg==} + /@azure/ms-rest-js/2.6.1: + resolution: {integrity: sha512-LLi4jRe/qy5IM8U2CkoDgSZp2OH+MgDe2wePmhz8uY84Svc53EhHaamVyoU6BjjHBxvCRh1vcD1urJDccrxqIw==} dependencies: - '@types/node-fetch': 2.5.7 - '@types/tunnel': 0.0.1 + '@azure/core-auth': 1.3.2 abort-controller: 3.0.0 form-data: 2.5.1 - node-fetch: 2.6.1 + node-fetch: 2.6.7 tough-cookie: 3.0.1 tslib: 1.14.1 tunnel: 0.0.6 - uuid: 3.4.0 + uuid: 8.3.2 xml2js: 0.4.23 + transitivePeerDependencies: + - encoding dev: true - /@azure/storage-blob/12.3.0: - resolution: {integrity: sha512-nCySzNfm782pEW3sg9GHj1zE4gBeVVMeEBdWb4MefifrCwQQOoz5cXZTNFiUJAJqAO+/72r2UjZcUwHk/QmzkA==} + /@azure/storage-blob/12.9.0: + resolution: {integrity: sha512-ank38FdCLfJ+EoeMzCz3hkYJuZAd63ARvDKkxZYRDb+beBYf+/+gx8jNTqkq/hfyUl4dJQ/a7tECU0Y0F98CHg==} + engines: {node: '>=12.0.0'} dependencies: '@azure/abort-controller': 1.0.1 - '@azure/core-http': 1.2.1 - '@azure/core-lro': 1.0.2 + '@azure/core-http': 2.2.4 + '@azure/core-lro': 2.2.4 '@azure/core-paging': 1.1.3 - '@azure/core-tracing': 1.0.0-preview.9 + '@azure/core-tracing': 1.0.0-preview.13 '@azure/logger': 1.0.0 - '@opentelemetry/api': 0.10.2 events: 3.2.0 - tslib: 2.0.3 + tslib: 2.3.1 + transitivePeerDependencies: + - encoding dev: true /@babel/code-frame/7.12.11: @@ -241,7 +246,7 @@ packages: '@babel/traverse': 7.14.9 '@babel/types': 7.14.9 convert-source-map: 1.8.0 - debug: 4.3.2 + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.0 semver: 6.3.0 @@ -440,7 +445,7 @@ packages: '@babel/helper-split-export-declaration': 7.14.5 '@babel/parser': 7.14.9 '@babel/types': 7.14.9 - debug: 4.3.2 + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -459,7 +464,7 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.1 + debug: 4.3.4 espree: 7.3.1 globals: 13.10.0 ignore: 4.0.6 @@ -476,7 +481,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.0 - debug: 4.3.1 + debug: 4.3.4 minimatch: 3.0.4 transitivePeerDependencies: - supports-color @@ -570,32 +575,8 @@ packages: '@types/node': 14.14.20 dev: true - /@opencensus/web-types/0.0.7: - resolution: {integrity: sha512-xB+w7ZDAu3YBzqH44rCmG9/RlrOmFuDPt/bpf17eJr8eZSrLt7nc7LnWdxM9Mmoj/YKMHpxRg28txu3TcpiL+g==} - engines: {node: '>=6.0'} - dev: true - - /@opentelemetry/api/0.10.2: - resolution: {integrity: sha512-GtpMGd6vkzDMYcpu2t9LlhEgMy/SzBwRnz48EejlRArYqZzqSzAsKmegUK7zHgl+EOIaK9mKHhnRaQu3qw20cA==} - engines: {node: '>=8.0.0'} - dependencies: - '@opentelemetry/context-base': 0.10.2 - dev: true - - /@opentelemetry/api/0.6.1: - resolution: {integrity: sha512-wpufGZa7tTxw7eAsjXJtiyIQ42IWQdX9iUQp7ACJcKo1hCtuhLU+K2Nv1U6oRwT1oAlZTE6m4CgWKZBhOiau3Q==} - engines: {node: '>=8.0.0'} - dependencies: - '@opentelemetry/context-base': 0.6.1 - dev: true - - /@opentelemetry/context-base/0.10.2: - resolution: {integrity: sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==} - engines: {node: '>=8.0.0'} - dev: true - - /@opentelemetry/context-base/0.6.1: - resolution: {integrity: sha512-5bHhlTBBq82ti3qPT15TRxkYTFPPQWbnkkQkmHPtqiS1XcTB69cEKd3Jm7Cfi/vkPoyxapmePE9tyA7EzLt8SQ==} + /@opentelemetry/api/1.0.4: + resolution: {integrity: sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==} engines: {node: '>=8.0.0'} dev: true @@ -618,38 +599,38 @@ packages: - supports-color dev: true - /@rollup/plugin-commonjs/17.1.0_rollup@2.55.1: - resolution: {integrity: sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew==} + /@rollup/plugin-commonjs/21.0.3_rollup@2.70.1: + resolution: {integrity: sha512-ThGfwyvcLc6cfP/MWxA5ACF+LZCvsuhUq7V5134Az1oQWsiC7lNpLT4mJI86WQunK7BYmpUiHmMk2Op6OAHs0g==} engines: {node: '>= 8.0.0'} peerDependencies: - rollup: ^2.30.0 + rollup: ^2.38.3 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.55.1 + '@rollup/pluginutils': 3.1.0_rollup@2.70.1 commondir: 1.0.1 estree-walker: 2.0.2 - glob: 7.1.6 + glob: 7.1.7 is-reference: 1.2.1 magic-string: 0.25.7 - resolve: 1.19.0 - rollup: 2.55.1 + resolve: 1.20.0 + rollup: 2.70.1 dev: true - /@rollup/plugin-node-resolve/11.2.1_rollup@2.55.1: - resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} + /@rollup/plugin-node-resolve/13.2.0_rollup@2.70.1: + resolution: {integrity: sha512-GuUIUyIKq7EjQxB51XSn6zPHYo+cILQQBYOGYvFFNxws2OVOqCBShAoof2hFrV8bAZzZGDBDQ8m2iUt8SLOUkg==} engines: {node: '>= 10.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0 + rollup: ^2.42.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.55.1 + '@rollup/pluginutils': 3.1.0_rollup@2.70.1 '@types/resolve': 1.17.1 builtin-modules: 3.2.0 deepmerge: 4.2.2 is-module: 1.0.0 - resolve: 1.19.0 - rollup: 2.55.1 + resolve: 1.20.0 + rollup: 2.70.1 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.55.1: + /@rollup/pluginutils/3.1.0_rollup@2.70.1: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -658,7 +639,7 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.2.2 - rollup: 2.55.1 + rollup: 2.70.1 dev: true /@rollup/pluginutils/4.1.1: @@ -706,8 +687,8 @@ packages: '@types/node': 14.14.20 dev: true - /@types/tunnel/0.0.1: - resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==} + /@types/tunnel/0.0.3: + resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: '@types/node': 14.14.20 dev: true @@ -872,9 +853,9 @@ packages: engines: {node: '>=6'} dev: true - /byte-size/7.0.1: - resolution: {integrity: sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A==} - engines: {node: '>=10'} + /byte-size/8.1.0: + resolution: {integrity: sha512-FkgMTAg44I0JtEaUAvuZTtU2a2YDmBRbQxdsQNSMtLCjhG0hMcF5b1IMN9UjSCJaU4nvlj/GER7B9sI4nKdCgA==} + engines: {node: '>=12.17'} dev: true /call-bind/1.0.0: @@ -1015,12 +996,12 @@ packages: engines: {node: '>=0.10.0'} dev: true - /conventional-changelog-conventionalcommits/4.6.0: - resolution: {integrity: sha512-sj9tj3z5cnHaSJCYObA9nISf7eq/YjscLPoq6nmew4SiOjxqL2KRpK20fjnjVbpNDjJ2HR3MoVcWKXwbVvzS0A==} + /conventional-changelog-conventionalcommits/4.6.3: + resolution: {integrity: sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==} engines: {node: '>=10'} dependencies: compare-func: 2.0.0 - lodash: 4.17.20 + lodash: 4.17.21 q: 1.5.1 dev: true @@ -1068,8 +1049,8 @@ packages: ms: 2.1.2 dev: true - /debug/4.3.2: - resolution: {integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==} + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -1176,6 +1157,10 @@ packages: string.prototype.trimstart: 1.0.3 dev: true + /es-module-lexer/0.9.3: + resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==} + dev: true + /es-to-primitive/1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} @@ -1185,10 +1170,212 @@ packages: is-symbol: 1.0.3 dev: true - /esbuild/0.12.20: - resolution: {integrity: sha512-u7+0qTo9Z64MD9PhooEngCmzyEYJ6ovFhPp8PLNh3UasR5Ihjv6HWVXqm8uHmasdQlpsAf0IsY4U0YVUfCpt4Q==} + /esbuild-android-64/0.14.36: + resolution: {integrity: sha512-jwpBhF1jmo0tVCYC/ORzVN+hyVcNZUWuozGcLHfod0RJCedTDTvR4nwlTXdx1gtncDqjk33itjO+27OZHbiavw==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64/0.14.36: + resolution: {integrity: sha512-/hYkyFe7x7Yapmfv4X/tBmyKnggUmdQmlvZ8ZlBnV4+PjisrEhAvC3yWpURuD9XoB8Wa1d5dGkTsF53pIvpjsg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.14.36: + resolution: {integrity: sha512-kkl6qmV0dTpyIMKagluzYqlc1vO0ecgpviK/7jwPbRDEv5fejRTaBBEE2KxEQbTHcLhiiDbhG7d5UybZWo/1zQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.14.36: + resolution: {integrity: sha512-q8fY4r2Sx6P0Pr3VUm//eFYKVk07C5MHcEinU1BjyFnuYz4IxR/03uBbDwluR6ILIHnZTE7AkTUWIdidRi1Jjw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.14.36: + resolution: {integrity: sha512-Hn8AYuxXXRptybPqoMkga4HRFE7/XmhtlQjXFHoAIhKUPPMeJH35GYEUWGbjteai9FLFvBAjEAlwEtSGxnqWww==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.14.36: + resolution: {integrity: sha512-S3C0attylLLRiCcHiJd036eDEMOY32+h8P+jJ3kTcfhJANNjP0TNBNL30TZmEdOSx/820HJFgRrqpNAvTbjnDA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.14.36: + resolution: {integrity: sha512-Eh9OkyTrEZn9WGO4xkI3OPPpUX7p/3QYvdG0lL4rfr73Ap2HAr6D9lP59VMF64Ex01LhHSXwIsFG/8AQjh6eNw==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.14.36: + resolution: {integrity: sha512-vFVFS5ve7PuwlfgoWNyRccGDi2QTNkQo/2k5U5ttVD0jRFaMlc8UQee708fOZA6zTCDy5RWsT5MJw3sl2X6KDg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm/0.14.36: + resolution: {integrity: sha512-NhgU4n+NCsYgt7Hy61PCquEz5aevI6VjQvxwBxtxrooXsxt5b2xtOUXYZe04JxqQo+XZk3d1gcr7pbV9MAQ/Lg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64/0.14.36: + resolution: {integrity: sha512-24Vq1M7FdpSmaTYuu1w0Hdhiqkbto1I5Pjyi+4Cdw5fJKGlwQuw+hWynTcRI/cOZxBcBpP21gND7W27gHAiftw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.14.36: + resolution: {integrity: sha512-hZUeTXvppJN+5rEz2EjsOFM9F1bZt7/d2FUM1lmQo//rXh1RTFYzhC0txn7WV0/jCC7SvrGRaRz0NMsRPf8SIA==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.14.36: + resolution: {integrity: sha512-1Bg3QgzZjO+QtPhP9VeIBhAduHEc2kzU43MzBnMwpLSZ890azr4/A9Dganun8nsqD/1TBcqhId0z4mFDO8FAvg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64/0.14.36: + resolution: {integrity: sha512-dOE5pt3cOdqEhaufDRzNCHf5BSwxgygVak9UR7PH7KPVHwSTDAZHDoEjblxLqjJYpc5XaU9+gKJ9F8mp9r5I4A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x/0.14.36: + resolution: {integrity: sha512-g4FMdh//BBGTfVHjF6MO7Cz8gqRoDPzXWxRvWkJoGroKA18G9m0wddvPbEqcQf5Tbt2vSc1CIgag7cXwTmoTXg==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.14.36: + resolution: {integrity: sha512-UB2bVImxkWk4vjnP62ehFNZ73lQY1xcnL5ZNYF3x0AG+j8HgdkNF05v67YJdCIuUJpBuTyCK8LORCYo9onSW+A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64/0.14.36: + resolution: {integrity: sha512-NvGB2Chf8GxuleXRGk8e9zD3aSdRO5kLt9coTQbCg7WMGXeX471sBgh4kSg8pjx0yTXRt0MlrUDnjVYnetyivg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.14.36: + resolution: {integrity: sha512-VkUZS5ftTSjhRjuRLp+v78auMO3PZBXu6xl4ajomGenEm2/rGuWlhFSjB7YbBNErOchj51Jb2OK8lKAo8qdmsQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.14.36: + resolution: {integrity: sha512-bIar+A6hdytJjZrDxfMBUSEHHLfx3ynoEZXx/39nxy86pX/w249WZm8Bm0dtOAByAf4Z6qV0LsnTIJHiIqbw0w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.14.36: + resolution: {integrity: sha512-+p4MuRZekVChAeueT1Y9LGkxrT5x7YYJxYE8ZOTcEfeUUN43vktSn6hUNsvxzzATrSgq5QqRdllkVBxWZg7KqQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.14.36: + resolution: {integrity: sha512-fBB4WlDqV1m18EF/aheGYQkQZHfPHiHJSBYzXIo8yKehek+0BtBwo/4PNwKGJ5T0YK0oc8pBKjgwPbzSrPLb+Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild/0.14.36: + resolution: {integrity: sha512-HhFHPiRXGYOCRlrhpiVDYKcFJRdO0sBElZ668M4lh2ER0YgnkLxECuFe7uWCf23FrcLc59Pqr7dHkTqmRPDHmw==} + engines: {node: '>=12'} hasBin: true requiresBuild: true + optionalDependencies: + esbuild-android-64: 0.14.36 + esbuild-android-arm64: 0.14.36 + esbuild-darwin-64: 0.14.36 + esbuild-darwin-arm64: 0.14.36 + esbuild-freebsd-64: 0.14.36 + esbuild-freebsd-arm64: 0.14.36 + esbuild-linux-32: 0.14.36 + esbuild-linux-64: 0.14.36 + esbuild-linux-arm: 0.14.36 + esbuild-linux-arm64: 0.14.36 + esbuild-linux-mips64le: 0.14.36 + esbuild-linux-ppc64le: 0.14.36 + esbuild-linux-riscv64: 0.14.36 + esbuild-linux-s390x: 0.14.36 + esbuild-netbsd-64: 0.14.36 + esbuild-openbsd-64: 0.14.36 + esbuild-sunos-64: 0.14.36 + esbuild-windows-32: 0.14.36 + esbuild-windows-64: 0.14.36 + esbuild-windows-arm64: 0.14.36 dev: true /escalade/3.1.1: @@ -1210,7 +1397,7 @@ packages: resolution: {integrity: sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==} dependencies: debug: 2.6.9 - resolve: 1.19.0 + resolve: 1.20.0 dev: true /eslint-module-utils/2.6.0: @@ -1261,7 +1448,7 @@ packages: minimatch: 3.0.4 object.values: 1.1.2 read-pkg-up: 2.0.0 - resolve: 1.19.0 + resolve: 1.20.0 tsconfig-paths: 3.9.0 dev: true @@ -1297,7 +1484,7 @@ packages: eslint-utils: 2.1.0 ignore: 5.1.8 minimatch: 3.0.4 - resolve: 1.19.0 + resolve: 1.20.0 semver: 6.3.0 dev: true @@ -1621,6 +1808,15 @@ packages: mime-types: 2.1.28 dev: true + /form-data/4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.28 + dev: true + /fs.realpath/1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} dev: true @@ -1680,17 +1876,6 @@ packages: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} dev: true - /glob/7.1.6: - resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.0.4 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - /glob/7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} dependencies: @@ -1825,12 +2010,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-core-module/2.2.0: - resolution: {integrity: sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==} - dependencies: - has: 1.0.3 - dev: true - /is-core-module/2.5.0: resolution: {integrity: sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==} dependencies: @@ -2147,10 +2326,6 @@ packages: resolution: {integrity: sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=} dev: true - /lodash/4.17.20: - resolution: {integrity: sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==} - dev: true - /lodash/4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true @@ -2190,10 +2365,8 @@ packages: sourcemap-codec: 1.4.8 dev: true - /markdown-table/2.0.0: - resolution: {integrity: sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==} - dependencies: - repeat-string: 1.6.1 + /markdown-table/3.0.2: + resolution: {integrity: sha512-y8j3a5/DkJCmS5x4dMCQL+OR0+2EAq3DOtio1COSHsmW2BGXnNCK3v12hJt1LrUz5iZH5g0LmuYOjDdI+czghA==} dev: true /merge-stream/2.0.0: @@ -2256,6 +2429,18 @@ packages: engines: {node: 4.x || >=6.0.0} dev: true + /node-fetch/2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + /node-releases/1.1.73: resolution: {integrity: sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==} dev: true @@ -2345,8 +2530,8 @@ packages: word-wrap: 1.2.3 dev: true - /outdent/0.7.1: - resolution: {integrity: sha512-VjIzdUHunL74DdhcwMDt5FhNDQ8NYmTkuW0B+usIV2afS9aWT/1c9z1TsnFW349TP3nxmYeUl7Z++XpJRByvgg==} + /outdent/0.8.0: + resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} dev: true /p-limit/1.3.0: @@ -2462,10 +2647,6 @@ packages: engines: {node: '>=8'} dev: true - /path-parse/1.0.6: - resolution: {integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==} - dev: true - /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true @@ -2615,11 +2796,6 @@ packages: engines: {node: '>=8'} dev: true - /repeat-string/1.6.1: - resolution: {integrity: sha1-jcrkcOHIirwtYA//Sndihtp15jc=} - engines: {node: '>=0.10'} - dev: true - /require-from-string/2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} @@ -2634,13 +2810,6 @@ packages: engines: {node: '>=4'} dev: true - /resolve/1.19.0: - resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} - dependencies: - is-core-module: 2.2.0 - path-parse: 1.0.6 - dev: true - /resolve/1.20.0: resolution: {integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==} dependencies: @@ -2663,34 +2832,38 @@ packages: glob: 7.1.7 dev: true - /rollup-plugin-esbuild/4.5.0_esbuild@0.12.20+rollup@2.55.1: - resolution: {integrity: sha512-ieUd3AoYWsN6Tfp0LBNnC+QpdhKjDEaH4NK3ghuEXOH56/7TAtD+hMbD9vSWZgsGSbaqCkrn4j6PaUj1vOSt1g==} + /rollup-plugin-esbuild/4.9.1_esbuild@0.14.36+rollup@2.70.1: + resolution: {integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==} engines: {node: '>=12'} peerDependencies: esbuild: '>=0.10.1' rollup: ^1.20.0 || ^2.0.0 dependencies: '@rollup/pluginutils': 4.1.1 - esbuild: 0.12.20 + debug: 4.3.4 + es-module-lexer: 0.9.3 + esbuild: 0.14.36 joycon: 3.0.1 jsonc-parser: 3.0.0 - rollup: 2.55.1 + rollup: 2.70.1 + transitivePeerDependencies: + - supports-color dev: true - /rollup-plugin-terser/7.0.2_rollup@2.55.1: + /rollup-plugin-terser/7.0.2_rollup@2.70.1: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} peerDependencies: rollup: ^2.0.0 dependencies: '@babel/code-frame': 7.12.11 jest-worker: 26.6.2 - rollup: 2.55.1 + rollup: 2.70.1 serialize-javascript: 4.0.0 terser: 5.5.1 dev: true - /rollup/2.55.1: - resolution: {integrity: sha512-1P9w5fpb6b4qroePh8vHKGIvPNxwoCQhjJpIqfZGHLKpZ0xcU2/XBmFxFbc9697/6bmHpmFTLk5R1dAQhFSo0g==} + /rollup/2.70.1: + resolution: {integrity: sha512-CRYsI5EuzLbXdxC6RnYhOuRdtz4bhejPMSWjsFLfVM/7w/85n2szZv6yExqUXsBdz5KT8eoubeyDUDjhLHEslA==} engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: @@ -2996,6 +3169,10 @@ packages: universalify: 0.1.2 dev: true + /tr46/0.0.3: + resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=} + dev: true + /tsconfig-paths/3.9.0: resolution: {integrity: sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==} dependencies: @@ -3009,8 +3186,8 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib/2.0.3: - resolution: {integrity: sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==} + /tslib/2.3.1: + resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} dev: true /tunnel/0.0.6: @@ -3068,6 +3245,7 @@ packages: /uuid/3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} + deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. hasBin: true dev: true @@ -3087,6 +3265,17 @@ packages: spdx-expression-parse: 3.0.1 dev: true + /webidl-conversions/3.0.1: + resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=} + dev: true + + /whatwg-url/5.0.0: + resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + /which-pm-runs/1.0.0: resolution: {integrity: sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=} dev: true diff --git a/src/index.js b/src/index.js index 7d1212a..a50a550 100644 --- a/src/index.js +++ b/src/index.js @@ -7,13 +7,15 @@ import generateSizeReport from './lib/generate-size-report.js'; import * as log from './lib/log.js'; import exec from './lib/exec.js'; -const COMMENT_SIGNATURE = sub('🤖 This report was automatically generated by [pkg-size-action](https://github.com/pkg-size/action/)'); +const COMMENT_SIGNATURE = sub( + '🤖 This report was automatically generated by [pkg-size-action](https://github.com/pkg-size/action/)', +); (async () => { const { GITHUB_TOKEN } = process.env; assert( GITHUB_TOKEN, - 'Environment variable 'GITHUB_TOKEN' not set. Required for accessing and reporting on the PR.' + "Environment variable 'GITHUB_TOKEN' not set. Required for accessing and reporting on the PR.", ); const { pull_request: pr } = context.payload; diff --git a/src/lib/npm-ci.js b/src/lib/npm-ci.js index 63645b0..c68cbda 100644 --- a/src/lib/npm-ci.js +++ b/src/lib/npm-ci.js @@ -4,10 +4,12 @@ import { rmRF } from '@actions/io'; import * as log from './log.js'; import exec from './exec.js'; -async function npmCi({ - cwd, - installCommand = autoDetectInstallCommand(), -} = {}) { +async function npmCi({ cwd, installCommand } = {}) { + if (!installCommand) { + installCommand = autoDetectInstallCommand(); + } else { + log.info(`Custom install command providing. Installing dependencies with ${installCommand}`); + } if (fs.existsSync('node_modules')) { log.info('Cleaning node_modules'); await rmRF(path.join(cwd, 'node_modules')); diff --git a/src/report-templates/head-only.js b/src/report-templates/head-only.js index d3c61d4..9bc9651 100644 --- a/src/report-templates/head-only.js +++ b/src/report-templates/head-only.js @@ -1,5 +1,5 @@ import byteSize from 'byte-size'; -import markdownTable from 'markdown-table'; +import { markdownTable } from 'markdown-table'; import outdent from 'outdent'; import { c, strong } from '../lib/markdown.js'; import { diff --git a/src/report-templates/regression/index.js b/src/report-templates/regression/index.js index 7ace4a4..886800b 100644 --- a/src/report-templates/regression/index.js +++ b/src/report-templates/regression/index.js @@ -1,6 +1,6 @@ import { setOutput } from '@actions/core'; import byteSize from 'byte-size'; -import markdownTable from 'markdown-table'; +import { markdownTable } from 'markdown-table'; import outdent from 'outdent'; import { c, sub, sup, strong, From 05ab2d2df212f9a427408a2a40189be250c355d3 Mon Sep 17 00:00:00 2001 From: Alexandros Dorodoulis Date: Thu, 14 Apr 2022 13:32:33 +0200 Subject: [PATCH 3/4] fix: don't silent exec commands --- dist/index.js | 1 - src/lib/exec.js | 1 - 2 files changed, 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 35b8639..962a456 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5766,7 +5766,6 @@ var $d = Object.defineProperty, Gd = Object.defineProperties, Cd = Object.getOwn async function K(e, t) { let r = "", n = ""; const s = Date.now(), o = await Vs(e, null, jd(Ud({}, t), { - silent: !0, listeners: { stdout(a) { r += a.toString(); diff --git a/src/lib/exec.js b/src/lib/exec.js index 58a0a7c..95488c8 100644 --- a/src/lib/exec.js +++ b/src/lib/exec.js @@ -7,7 +7,6 @@ async function exec(command, options) { const startTime = Date.now(); const exitCode = await _exec(command, null, { ...options, - silent: true, listeners: { stdout(data) { stdout += data.toString(); From dcae24170655e9fec5c513bd71d1e9fb3a2ba615 Mon Sep 17 00:00:00 2001 From: Alexandros Dorodoulis Date: Thu, 14 Apr 2022 20:23:45 +0200 Subject: [PATCH 4/4] fix: drop node version to 14 instead of 16 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 792fefa..24176a3 100644 --- a/action.yml +++ b/action.yml @@ -25,5 +25,5 @@ inputs: description: 'Command to install the package with, if empty the action will try to autodetect it' runs: - using: 'node16' + using: 'node14' main: 'dist/index.js'