diff --git a/dist/comments.d.ts b/dist/comments.d.ts new file mode 100644 index 00000000..62ed5375 --- /dev/null +++ b/dist/comments.d.ts @@ -0,0 +1,2 @@ +export declare const commentDisclaimer: string; +export declare const commentPrefix = "@all-contributors please add"; diff --git a/dist/comments.d.ts.map b/dist/comments.d.ts.map new file mode 100644 index 00000000..a2544228 --- /dev/null +++ b/dist/comments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/comments.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,QAIlB,CAAC;AAEb,eAAO,MAAM,aAAa,iCAAiC,CAAC"} \ No newline at end of file diff --git a/dist/dataIsRepoFile.d.ts b/dist/dataIsRepoFile.d.ts new file mode 100644 index 00000000..ae5b951b --- /dev/null +++ b/dist/dataIsRepoFile.d.ts @@ -0,0 +1,7 @@ +interface RepoFile { + content: string; + encoding: "base64"; + type: "file"; +} +export declare function dataIsRepoFile(data: unknown): data is RepoFile; +export {}; diff --git a/dist/dataIsRepoFile.d.ts.map b/dist/dataIsRepoFile.d.ts.map new file mode 100644 index 00000000..db51f992 --- /dev/null +++ b/dist/dataIsRepoFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/dataIsRepoFile.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,QAAQ,CAQ9D"} \ No newline at end of file diff --git a/dist/dataIsRepoFile.test.d.ts b/dist/dataIsRepoFile.test.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/dist/dataIsRepoFile.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/dataIsRepoFile.test.d.ts.map b/dist/dataIsRepoFile.test.d.ts.map new file mode 100644 index 00000000..930275ce --- /dev/null +++ b/dist/dataIsRepoFile.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/dataIsRepoFile.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/doesPullAlreadyHaveComment.d.ts b/dist/doesPullAlreadyHaveComment.d.ts new file mode 100644 index 00000000..c4195d23 --- /dev/null +++ b/dist/doesPullAlreadyHaveComment.d.ts @@ -0,0 +1,118 @@ +import { Locator, Octokit } from "./types.js"; +export declare function doesPullAlreadyHaveComment( + octokit: Octokit, + locator: Locator, + id: number +): Promise< + | { + id: number; + node_id: string; + url: string; + body?: string | undefined; + body_text?: string | undefined; + body_html?: string | undefined; + html_url: string; + user: { + name?: string | null | undefined; + email?: string | null | undefined; + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + created_at: string; + updated_at: string; + issue_url: string; + author_association: + | "COLLABORATOR" + | "CONTRIBUTOR" + | "FIRST_TIMER" + | "FIRST_TIME_CONTRIBUTOR" + | "MANNEQUIN" + | "MEMBER" + | "NONE" + | "OWNER"; + performed_via_github_app?: + | { + id: number; + slug?: string | undefined; + node_id: string; + owner: { + name?: string | null | undefined; + email?: string | null | undefined; + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + name: string; + description: string | null; + external_url: string; + html_url: string; + created_at: string; + updated_at: string; + permissions: { + issues?: string | undefined; + checks?: string | undefined; + metadata?: string | undefined; + contents?: string | undefined; + deployments?: string | undefined; + } & { + [key: string]: string; + }; + events: string[]; + installations_count?: number | undefined; + client_id?: string | undefined; + client_secret?: string | undefined; + webhook_secret?: string | null | undefined; + pem?: string | undefined; + } + | null + | undefined; + reactions?: + | { + url: string; + total_count: number; + "+1": number; + "-1": number; + laugh: number; + confused: number; + heart: number; + hooray: number; + eyes: number; + rocket: number; + } + | undefined; + } + | undefined +>; diff --git a/dist/doesPullAlreadyHaveComment.d.ts.map b/dist/doesPullAlreadyHaveComment.d.ts.map new file mode 100644 index 00000000..232c8c9d --- /dev/null +++ b/dist/doesPullAlreadyHaveComment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/doesPullAlreadyHaveComment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAsB,0BAA0B,CAC/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgBV"} \ No newline at end of file diff --git a/dist/getExistingContributors.d.ts b/dist/getExistingContributors.d.ts new file mode 100644 index 00000000..130e36d9 --- /dev/null +++ b/dist/getExistingContributors.d.ts @@ -0,0 +1,6 @@ +import { Locator, Octokit } from "./types.js"; +export type ExistingContributions = Record | undefined>; +export declare function getExistingContributors( + octokit: Octokit, + locator: Locator +): Promise; diff --git a/dist/getExistingContributors.d.ts.map b/dist/getExistingContributors.d.ts.map new file mode 100644 index 00000000..25268c63 --- /dev/null +++ b/dist/getExistingContributors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/getExistingContributors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;AAI5E,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACd,OAAO,CAAC,qBAAqB,CAAC,CAkChC"} \ No newline at end of file diff --git a/dist/getMissingContributions.d.ts b/dist/getMissingContributions.d.ts new file mode 100644 index 00000000..d5e4a1d3 --- /dev/null +++ b/dist/getMissingContributions.d.ts @@ -0,0 +1,7 @@ +import { ContributorContributions } from "all-contributors-for-repository"; +import { ExistingContributions } from "./getExistingContributors.js"; +export declare function getMissingContributions( + contributor: string, + contributions: ContributorContributions, + existingContributors: ExistingContributions +): ContributorContributions; diff --git a/dist/getMissingContributions.d.ts.map b/dist/getMissingContributions.d.ts.map new file mode 100644 index 00000000..bc408298 --- /dev/null +++ b/dist/getMissingContributions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/getMissingContributions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,wBAAgB,uBAAuB,CACtC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,wBAAwB,EACvC,oBAAoB,EAAE,qBAAqB,GACzC,wBAAwB,CAW1B"} \ No newline at end of file diff --git a/dist/getMissingContributions.test.d.ts b/dist/getMissingContributions.test.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/dist/getMissingContributions.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/getMissingContributions.test.d.ts.map b/dist/getMissingContributions.test.d.ts.map new file mode 100644 index 00000000..f795353c --- /dev/null +++ b/dist/getMissingContributions.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/getMissingContributions.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 00b37923..26af6a18 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2512,7 +2512,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; Object.defineProperty(exports, "__esModule", { value: true }); var core = __nccwpck_require__(2472); - var authApp = __nccwpck_require__(6748); + var authApp = __nccwpck_require__(1733); var oauthApp = __nccwpck_require__(7960); var authUnauthenticated = __nccwpck_require__(1143); var webhooks$1 = __nccwpck_require__(1215); @@ -2833,7 +2833,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 6748: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + /***/ 1733: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", { value: true }); function _interopDefault(ex) { @@ -3189,10 +3189,10 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; '/orgs/(?:.+?)/invitations', '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)' ] */ - const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})[^/]*$`; + const regex = `^(?:${regexes.map((r) => `(?:${r})`).join("|")})$`; // 'regex' would contain: /* - ^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))[^\/]*$ + ^(?:(?:\/orgs\/(?:.+?)\/invitations)|(?:\/repos\/(?:.+?)\/(?:.+?)\/collaborators\/(?:.+?)))$ It may look scary, but paste it into https://www.debuggex.com/ and it will make a lot more sense! */ @@ -3200,7 +3200,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; } const REGEX = routeMatcher(PATHS); function requiresAppAuth(url) { - return !!url && REGEX.test(url); + return !!url && REGEX.test(url.split("?")[0]); } const FIVE_SECONDS_IN_MS = 5 * 1000; @@ -3319,7 +3319,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; } } - const VERSION = "4.0.9"; + const VERSION = "4.0.10"; function createAppAuth(options) { if (!options.appId) { @@ -12152,7 +12152,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 3865: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + /***/ 7681: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", { value: true }); function _interopDefault(ex) { @@ -12163,7 +12163,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; var BottleneckLight = _interopDefault(__nccwpck_require__(7324)); - const VERSION = "5.1.1"; + const VERSION = "5.2.0"; const noop = () => Promise.resolve(); // @ts-expect-error @@ -16017,340 +16017,532 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 9859: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const cp = __nccwpck_require__(2081); - const parse = __nccwpck_require__(3069); - const enoent = __nccwpck_require__(6775); + /***/ 5228: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const parser = __nccwpck_require__(1172); + const regex = __nccwpck_require__(8774); + const through = __nccwpck_require__(291); + const _ = __nccwpck_require__(3801); - function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); + function assignOpts(options) { + options = _.extend( + { + headerPattern: /^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$/, + headerCorrespondence: ["type", "scope", "subject"], + referenceActions: [ + "close", + "closes", + "closed", + "fix", + "fixes", + "fixed", + "resolve", + "resolves", + "resolved", + ], + issuePrefixes: ["#"], + noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"], + fieldPattern: /^-(.*?)-$/, + revertPattern: /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./, + revertCorrespondence: ["header", "hash"], + warn: function () {}, + mergePattern: null, + mergeCorrespondence: null, + }, + options + ); - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + if (typeof options.headerPattern === "string") { + options.headerPattern = new RegExp(options.headerPattern); + } - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); + if (typeof options.headerCorrespondence === "string") { + options.headerCorrespondence = options.headerCorrespondence.split(","); + } - return spawned; - } + if (typeof options.referenceActions === "string") { + options.referenceActions = options.referenceActions.split(","); + } - function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); + if (typeof options.issuePrefixes === "string") { + options.issuePrefixes = options.issuePrefixes.split(","); + } - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); + if (typeof options.noteKeywords === "string") { + options.noteKeywords = options.noteKeywords.split(","); + } - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = - result.error || enoent.verifyENOENTSync(result.status, parsed); + if (typeof options.fieldPattern === "string") { + options.fieldPattern = new RegExp(options.fieldPattern); + } - return result; - } + if (typeof options.revertPattern === "string") { + options.revertPattern = new RegExp(options.revertPattern); + } - module.exports = spawn; - module.exports.spawn = spawn; - module.exports.sync = spawnSync; + if (typeof options.revertCorrespondence === "string") { + options.revertCorrespondence = options.revertCorrespondence.split(","); + } - module.exports._parse = parse; - module.exports._enoent = enoent; + if (typeof options.mergePattern === "string") { + options.mergePattern = new RegExp(options.mergePattern); + } - /***/ - }, + return options; + } - /***/ 6775: /***/ (module) => { - const isWin = process.platform === "win32"; + function conventionalCommitsParser(options) { + options = assignOpts(options); + const reg = regex(options); - function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: "ENOENT", - errno: "ENOENT", - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, + return through.obj(function (data, enc, cb) { + let commit; + + try { + commit = parser(data.toString(), options, reg); + cb(null, commit); + } catch (err) { + if (options.warn === true) { + cb(err); + } else { + options.warn(err.toString()); + cb(null, ""); + } + } }); } - function hookChildProcess(cp, parsed) { - if (!isWin) { - return; - } + function sync(commit, options) { + options = assignOpts(options); + const reg = regex(options); - const originalEmit = cp.emit; + return parser(commit, options, reg); + } - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === "exit") { - const err = verifyENOENT(arg1, parsed, "spawn"); + module.exports = conventionalCommitsParser; + module.exports.sync = sync; - if (err) { - return originalEmit.call(cp, "error", err); - } - } + /***/ + }, - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params - }; + /***/ 1172: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const _ = __nccwpck_require__(3801); + + const CATCH_ALL = /()(.+)/gi; + const SCISSOR = "# ------------------------ >8 ------------------------"; + + function trimOffNewlines(input) { + const result = input.match(/[^\r\n]/); + if (!result) { + return ""; + } + const firstIndex = result.index; + let lastIndex = input.length - 1; + while (input[lastIndex] === "\r" || input[lastIndex] === "\n") { + lastIndex--; + } + return input.substring(firstIndex, lastIndex + 1); } - function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, "spawn"); + function append(src, line) { + if (src) { + src += "\n" + line; + } else { + src = line; } - return null; + return src; + } + + function getCommentFilter(char) { + return function (line) { + return line.charAt(0) !== char; + }; } - function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, "spawnSync"); + function truncateToScissor(lines) { + const scissorIndex = lines.indexOf(SCISSOR); + + if (scissorIndex === -1) { + return lines; } - return null; + return lines.slice(0, scissorIndex); } - module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, - }; - - /***/ - }, + function getReferences(input, regex) { + const references = []; + let referenceSentences; + let referenceMatch; - /***/ 3069: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const path = __nccwpck_require__(1017); - const resolveCommand = __nccwpck_require__(6841); - const escape = __nccwpck_require__(1445); - const readShebang = __nccwpck_require__(9574); + const reApplicable = + input.match(regex.references) !== null ? regex.references : CATCH_ALL; - const isWin = process.platform === "win32"; - const isExecutableRegExp = /\.(?:com|exe)$/i; - const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; + while ((referenceSentences = reApplicable.exec(input))) { + const action = referenceSentences[1] || null; + const sentence = referenceSentences[2]; - function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); + while ((referenceMatch = regex.referenceParts.exec(sentence))) { + let owner = null; + let repository = referenceMatch[1] || ""; + const ownerRepo = repository.split("/"); - const shebang = parsed.file && readShebang(parsed.file); + if (ownerRepo.length > 1) { + owner = ownerRepo.shift(); + repository = ownerRepo.join("/"); + } - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; + const reference = { + action: action, + owner: owner, + repository: repository || null, + issue: referenceMatch[3], + raw: referenceMatch[0], + prefix: referenceMatch[2], + }; - return resolveCommand(parsed); + references.push(reference); + } } - return parsed.file; + return references; } - function parseNonShell(parsed) { - if (!isWin) { - return parsed; + function passTrough() { + return true; + } + + function parser(raw, options, regex) { + if (!raw || !raw.trim()) { + throw new TypeError("Expected a raw commit"); } - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); + if (_.isEmpty(options)) { + throw new TypeError("Expected options"); + } - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); + if (_.isEmpty(regex)) { + throw new TypeError("Expected regex"); + } - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); + let currentProcessedField; + let mentionsMatch; + const otherFields = {}; + const commentFilter = + typeof options.commentChar === "string" + ? getCommentFilter(options.commentChar) + : passTrough; + const gpgFilter = (line) => !line.match(/^\s*gpg:/); - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); + const rawLines = trimOffNewlines(raw).split(/\r?\n/); + const lines = truncateToScissor(rawLines) + .filter(commentFilter) + .filter(gpgFilter); - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => - escape.argument(arg, needsDoubleEscapeMetaChars) - ); + let continueNote = false; + let isBody = true; + const headerCorrespondence = _.map( + options.headerCorrespondence, + function (part) { + return part.trim(); + } + ); + const revertCorrespondence = _.map( + options.revertCorrespondence, + function (field) { + return field.trim(); + } + ); + const mergeCorrespondence = _.map( + options.mergeCorrespondence, + function (field) { + return field.trim(); + } + ); - const shellCommand = [parsed.command].concat(parsed.args).join(" "); + let body = null; + let footer = null; + let header = null; + const mentions = []; + let merge = null; + const notes = []; + const references = []; + let revert = null; - parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`]; - parsed.command = process.env.comspec || "cmd.exe"; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + if (lines.length === 0) { + return { + body: body, + footer: footer, + header: header, + mentions: mentions, + merge: merge, + notes: notes, + references: references, + revert: revert, + scope: null, + subject: null, + type: null, + }; } - return parsed; - } + // msg parts + merge = lines.shift(); + const mergeParts = {}; + const headerParts = {}; + body = ""; + footer = ""; + + const mergeMatch = merge.match(options.mergePattern); + if (mergeMatch && options.mergePattern) { + merge = mergeMatch[0]; + + header = lines.shift(); + while (header !== undefined && !header.trim()) { + header = lines.shift(); + } + if (!header) { + header = ""; + } - function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; + _.forEach(mergeCorrespondence, function (partName, index) { + const partValue = mergeMatch[index + 1] || null; + mergeParts[partName] = partValue; + }); + } else { + header = merge; + merge = null; + + _.forEach(mergeCorrespondence, function (partName) { + mergeParts[partName] = null; + }); } - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original + const headerMatch = header.match(options.headerPattern); + if (headerMatch) { + _.forEach(headerCorrespondence, function (partName, index) { + const partValue = headerMatch[index + 1] || null; + headerParts[partName] = partValue; + }); + } else { + _.forEach(headerCorrespondence, function (partName) { + headerParts[partName] = null; + }); + } - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; + Array.prototype.push.apply( + references, + getReferences(header, { + references: regex.references, + referenceParts: regex.referenceParts, + }) + ); - // Delegate further parsing to shell or non-shell - return options.shell ? parsed : parseNonShell(parsed); - } + // body or footer + _.forEach(lines, function (line) { + if (options.fieldPattern) { + const fieldMatch = options.fieldPattern.exec(line); - module.exports = parse; + if (fieldMatch) { + currentProcessedField = fieldMatch[1]; - /***/ - }, + return; + } - /***/ 1445: /***/ (module) => { - // See http://www.robvanderwoude.com/escapechars.php - const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; + if (currentProcessedField) { + otherFields[currentProcessedField] = append( + otherFields[currentProcessedField], + line + ); - function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, "^$1"); + return; + } + } - return arg; - } + let referenceMatched; - function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; + // this is a new important note + const notesMatch = line.match(regex.notes); + if (notesMatch) { + continueNote = true; + isBody = false; + footer = append(footer, line); - // Algorithm below is based on https://qntm.org/cmd + const note = { + title: notesMatch[1], + text: notesMatch[2], + }; - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); + notes.push(note); - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, "$1$1"); + return; + } - // All other backslashes occur literally + const lineReferences = getReferences(line, { + references: regex.references, + referenceParts: regex.referenceParts, + }); - // Quote the whole thing: - arg = `"${arg}"`; + if (lineReferences.length > 0) { + isBody = false; + referenceMatched = true; + continueNote = false; + } - // Escape meta chars - arg = arg.replace(metaCharsRegExp, "^$1"); + Array.prototype.push.apply(references, lineReferences); - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, "^$1"); - } + if (referenceMatched) { + footer = append(footer, line); - return arg; - } + return; + } - module.exports.command = escapeCommand; - module.exports.argument = escapeArgument; + if (continueNote) { + notes[notes.length - 1].text = append( + notes[notes.length - 1].text, + line + ); + footer = append(footer, line); - /***/ - }, + return; + } - /***/ 9574: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const fs = __nccwpck_require__(7147); - const shebangCommand = __nccwpck_require__(5382); + if (isBody) { + body = append(body, line); + } else { + footer = append(footer, line); + } + }); - function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - const buffer = Buffer.alloc(size); + if (options.breakingHeaderPattern && notes.length === 0) { + const breakingHeader = header.match(options.breakingHeaderPattern); + if (breakingHeader) { + const noteText = breakingHeader[3]; // the description of the change. + notes.push({ + title: "BREAKING CHANGE", + text: noteText, + }); + } + } - let fd; + while ((mentionsMatch = regex.mentions.exec(raw))) { + mentions.push(mentionsMatch[1]); + } - try { - fd = fs.openSync(command, "r"); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { - /* Empty */ + // does this commit revert any other commit? + const revertMatch = raw.match(options.revertPattern); + if (revertMatch) { + revert = {}; + _.forEach(revertCorrespondence, function (partName, index) { + const partValue = revertMatch[index + 1] || null; + revert[partName] = partValue; + }); + } else { + revert = null; } - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); + _.map(notes, function (note) { + note.text = trimOffNewlines(note.text); + + return note; + }); + + const msg = _.merge( + headerParts, + mergeParts, + { + merge: merge, + header: header, + body: body ? trimOffNewlines(body) : null, + footer: footer ? trimOffNewlines(footer) : null, + notes: notes, + references: references, + mentions: mentions, + revert: revert, + }, + otherFields + ); + + return msg; } - module.exports = readShebang; + module.exports = parser; /***/ }, - /***/ 6841: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const path = __nccwpck_require__(1017); - const which = __nccwpck_require__(6189); - const getPathKey = __nccwpck_require__(851); - - function resolveCommandAttempt(parsed, withoutPathExt) { - const env = parsed.options.env || process.env; - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; - // Worker threads do not have process.chdir() - const shouldSwitchCwd = - hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; - - // If a custom `cwd` was specified, we need to change the process cwd - // because `which` will do stat calls but does not support a custom cwd - if (shouldSwitchCwd) { - try { - process.chdir(parsed.options.cwd); - } catch (err) { - /* Empty */ - } - } + /***/ 8774: /***/ (module) => { + const reNomatch = /(?!.*)/; - let resolved; + function join(array, joiner) { + return array + .map(function (val) { + return val.trim(); + }) + .filter(function (val) { + return val.length; + }) + .join(joiner); + } - try { - resolved = which.sync(parsed.command, { - path: env[getPathKey({ env })], - pathExt: withoutPathExt ? path.delimiter : undefined, - }); - } catch (e) { - /* Empty */ - } finally { - if (shouldSwitchCwd) { - process.chdir(cwd); - } + function getNotesRegex(noteKeywords, notesPattern) { + if (!noteKeywords) { + return reNomatch; } - // If we successfully resolved, ensure that an absolute path is returned - // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it - if (resolved) { - resolved = path.resolve( - hasCustomCwd ? parsed.options.cwd : "", - resolved + const noteKeywordsSelection = join(noteKeywords, "|"); + + if (!notesPattern) { + return new RegExp( + "^[\\s|*]*(" + noteKeywordsSelection + ")[:\\s]+(.*)", + "i" ); } - return resolved; + return notesPattern(noteKeywordsSelection); } - function resolveCommand(parsed) { - return ( - resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true) + function getReferencePartsRegex(issuePrefixes, issuePrefixesCaseSensitive) { + if (!issuePrefixes) { + return reNomatch; + } + + const flags = issuePrefixesCaseSensitive ? "g" : "gi"; + return new RegExp( + "(?:.*?)??\\s*([\\w-\\.\\/]*?)??(" + + join(issuePrefixes, "|") + + ")([\\w-]*\\d+)", + flags + ); + } + + function getReferencesRegex(referenceActions) { + if (!referenceActions) { + // matches everything + return /()(.+)/gi; + } + + const joinedKeywords = join(referenceActions, "|"); + return new RegExp( + "(" + joinedKeywords + ")(?:\\s+(.*?))(?=(?:" + joinedKeywords + ")|$)", + "gi" ); } - module.exports = resolveCommand; + module.exports = function (options) { + options = options || {}; + const reNotes = getNotesRegex(options.noteKeywords, options.notesPattern); + const reReferenceParts = getReferencePartsRegex( + options.issuePrefixes, + options.issuePrefixesCaseSensitive + ); + const reReferences = getReferencesRegex(options.referenceActions); + + return { + notes: reNotes, + referenceParts: reReferenceParts, + references: reReferences, + mentions: /@([\w-]+)/g, + }; + }; /***/ }, @@ -16656,132 +16848,6 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 5162: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const { PassThrough: PassThroughStream } = __nccwpck_require__(2781); - - module.exports = (options) => { - options = { ...options }; - - const { array } = options; - let { encoding } = options; - const isBuffer = encoding === "buffer"; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || "utf8"; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({ objectMode }); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on("data", (chunk) => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(""); - }; - - stream.getBufferedLength = () => length; - - return stream; - }; - - /***/ - }, - - /***/ 1049: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const { constants: BufferConstants } = __nccwpck_require__(4300); - const stream = __nccwpck_require__(2781); - const { promisify } = __nccwpck_require__(3837); - const bufferStream = __nccwpck_require__(5162); - - const streamPipelinePromisified = promisify(stream.pipeline); - - class MaxBufferError extends Error { - constructor() { - super("maxBuffer exceeded"); - this.name = "MaxBufferError"; - } - } - - async function getStream(inputStream, options) { - if (!inputStream) { - throw new Error("Expected a stream"); - } - - options = { - maxBuffer: Infinity, - ...options, - }; - - const { maxBuffer } = options; - const stream = bufferStream(options); - - await new Promise((resolve, reject) => { - const rejectPromise = (error) => { - // Don't retrieve an oversized buffer. - if ( - error && - stream.getBufferedLength() <= BufferConstants.MAX_LENGTH - ) { - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - (async () => { - try { - await streamPipelinePromisified(inputStream, stream); - resolve(); - } catch (error) { - rejectPromise(error); - } - })(); - - stream.on("data", () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); - } - - module.exports = getStream; - module.exports.buffer = (stream, options) => - getStream(stream, { ...options, encoding: "buffer" }); - module.exports.array = (stream, options) => - getStream(stream, { ...options, array: true }); - module.exports.MaxBufferError = MaxBufferError; - - /***/ - }, - /***/ 3132: /***/ (module) => { module.exports = (string, count = 1, options) => { options = { @@ -16820,6 +16886,52 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, + /***/ 4626: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + try { + var util = __nccwpck_require__(3837); + /* istanbul ignore next */ + if (typeof util.inherits !== "function") throw ""; + module.exports = util.inherits; + } catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(6034); + } + + /***/ + }, + + /***/ 6034: /***/ (module) => { + if (typeof Object.create === "function") { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true, + }, + }); + } + }; + } else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + + /***/ + }, + /***/ 366: /***/ (__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", { value: true }); @@ -16861,166 +16973,6 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 4555: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - var fs = __nccwpck_require__(7147); - var core; - if (process.platform === "win32" || global.TESTING_WINDOWS) { - core = __nccwpck_require__(9367); - } else { - core = __nccwpck_require__(2010); - } - - module.exports = isexe; - isexe.sync = sync; - - function isexe(path, options, cb) { - if (typeof options === "function") { - cb = options; - options = {}; - } - - if (!cb) { - if (typeof Promise !== "function") { - throw new TypeError("callback not provided"); - } - - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er); - } else { - resolve(is); - } - }); - }); - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === "EACCES" || (options && options.ignoreErrors)) { - er = null; - is = false; - } - } - cb(er, is); - }); - } - - function sync(path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}); - } catch (er) { - if ((options && options.ignoreErrors) || er.code === "EACCES") { - return false; - } else { - throw er; - } - } - } - - /***/ - }, - - /***/ 2010: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - module.exports = isexe; - isexe.sync = sync; - - var fs = __nccwpck_require__(7147); - - function isexe(path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)); - }); - } - - function sync(path, options) { - return checkStat(fs.statSync(path), options); - } - - function checkStat(stat, options) { - return stat.isFile() && checkMode(stat, options); - } - - function checkMode(stat, options) { - var mod = stat.mode; - var uid = stat.uid; - var gid = stat.gid; - - var myUid = - options.uid !== undefined - ? options.uid - : process.getuid && process.getuid(); - var myGid = - options.gid !== undefined - ? options.gid - : process.getgid && process.getgid(); - - var u = parseInt("100", 8); - var g = parseInt("010", 8); - var o = parseInt("001", 8); - var ug = u | g; - - var ret = - mod & o || - (mod & g && gid === myGid) || - (mod & u && uid === myUid) || - (mod & ug && myUid === 0); - - return ret; - } - - /***/ - }, - - /***/ 9367: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - module.exports = isexe; - isexe.sync = sync; - - var fs = __nccwpck_require__(7147); - - function checkPathExt(path, options) { - var pathext = - options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT; - - if (!pathext) { - return true; - } - - pathext = pathext.split(";"); - if (pathext.indexOf("") !== -1) { - return true; - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase(); - if (p && path.substr(-p.length).toLowerCase() === p) { - return true; - } - } - return false; - } - - function checkStat(stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false; - } - return checkPathExt(path, options); - } - - function isexe(path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)); - }); - } - - function sync(path, options) { - return checkStat(fs.statSync(path), path, options); - } - - /***/ - }, - /***/ 9804: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { var jws = __nccwpck_require__(323); @@ -17131,7 +17083,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; }, /***/ 3523: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const semver = __nccwpck_require__(9290); + const semver = __nccwpck_require__(815); module.exports = semver.satisfies(process.version, ">=15.7.0"); @@ -17139,7 +17091,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; }, /***/ 6673: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - var semver = __nccwpck_require__(9290); + var semver = __nccwpck_require__(815); module.exports = semver.satisfies(process.version, "^6.12.0 || >=8.0.0"); @@ -17147,7 +17099,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; }, /***/ 5752: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const semver = __nccwpck_require__(9290); + const semver = __nccwpck_require__(815); module.exports = semver.satisfies(process.version, ">=16.9.0"); @@ -37376,54 +37328,6 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 237: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const { PassThrough } = __nccwpck_require__(2781); - - module.exports = function (/*streams...*/) { - var sources = []; - var output = new PassThrough({ objectMode: true }); - - output.setMaxListeners(0); - - output.add = add; - output.isEmpty = isEmpty; - - output.on("unpipe", remove); - - Array.prototype.slice.call(arguments).forEach(add); - - return output; - - function add(source) { - if (Array.isArray(source)) { - source.forEach(add); - return this; - } - - sources.push(source); - source.once("end", remove.bind(null, source)); - source.once("error", output.emit.bind(output, "error")); - source.pipe(output, { end: false }); - return this; - } - - function isEmpty() { - return sources.length == 0; - } - - function remove(source) { - sources = sources.filter(function (it) { - return it !== source; - }); - if (!sources.length && output.readable) { - output.end(); - } - } - }; - - /***/ - }, - /***/ 5913: /***/ (module) => { /** * Helpers. @@ -39635,7 +39539,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; var pluginPaginateRest = __nccwpck_require__(7153); var pluginRestEndpointMethods = __nccwpck_require__(9673); var pluginRetry = __nccwpck_require__(5861); - var pluginThrottling = __nccwpck_require__(3865); + var pluginThrottling = __nccwpck_require__(7681); var app = __nccwpck_require__(2547); var oauthApp = __nccwpck_require__(7960); @@ -39743,8881 +39647,11104 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ }, - /***/ 851: /***/ (module) => { - const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; + /***/ 9859: /***/ (module) => { + const codes = {}; - if (platform !== "win32") { - return "PATH"; + function createErrorType(code, message, Base) { + if (!Base) { + Base = Error; } - return ( - Object.keys(environment) - .reverse() - .find((key) => key.toUpperCase() === "PATH") || "Path" - ); - }; + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } - module.exports = pathKey; - // TODO: Remove this for the next major release - module.exports["default"] = pathKey; + class NodeError extends Base { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } - /***/ - }, + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; - /***/ 6053: /***/ (module, exports, __nccwpck_require__) => { - /*! safe-buffer. MIT License. Feross Aboukhadijeh */ - /* eslint-disable node/no-deprecated-api */ - var buffer = __nccwpck_require__(4300); - var Buffer = buffer.Buffer; + codes[code] = NodeError; + } - // alternative to using Object.keys for old browsers - function copyProps(src, dst) { - for (var key in src) { - dst[key] = src[key]; + // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return ( + `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + + expected[len - 1] + ); + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; } } - if ( - Buffer.from && - Buffer.alloc && - Buffer.allocUnsafe && - Buffer.allocUnsafeSlow - ) { - module.exports = buffer; - } else { - // Copy properties from require('buffer') - copyProps(buffer, exports); - exports.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length); + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith + function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } - SafeBuffer.prototype = Object.create(Buffer.prototype); - - // Copy static methods from Buffer - copyProps(Buffer, SafeBuffer); + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith + function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; + } - SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes + function includes(str, search, start) { + if (typeof start !== "number") { + start = 0; } - return Buffer(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; } - var buf = Buffer(size); - if (fill !== undefined) { - if (typeof encoding === "string") { - buf.fill(fill, encoding); + } + + createErrorType( + "ERR_INVALID_OPT_VALUE", + function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; + }, + TypeError + ); + createErrorType( + "ERR_INVALID_ARG_TYPE", + function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + let determiner; + if (typeof expected === "string" && startsWith(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); } else { - buf.fill(fill); + determiner = "must be"; } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer(size); - }; + let msg; + if (endsWith(name, " argument")) { + // For cases like 'first argument' + msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type = includes(name, ".") ? "property" : "argument"; + msg = `The "${name}" ${type} ${determiner} ${oneOf( + expected, + "type" + )}`; + } - SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer.SlowBuffer(size); - }; + msg += `. Received type ${typeof actual}`; + return msg; + }, + TypeError + ); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function (name) { + return "The " + name + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function (name) { + return "Cannot call " + name + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType( + "ERR_STREAM_NULL_VALUES", + "May not write null values to stream", + TypeError + ); + createErrorType( + "ERR_UNKNOWN_ENCODING", + function (arg) { + return "Unknown encoding: " + arg; + }, + TypeError + ); + createErrorType( + "ERR_STREAM_UNSHIFT_AFTER_END_EVENT", + "stream.unshift() after end event" + ); + + module.exports.q = codes; /***/ }, - /***/ 2678: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const ANY = Symbol("SemVer ANY"); - // hoisted class for cyclic dependency - class Comparator { - static get ANY() { - return ANY; - } + /***/ 8349: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + // a duplex stream is just a stream that is both readable and writable. + // Since JS doesn't have multiple prototypal inheritance, this class + // prototypally inherits from Readable, and then parasitically from + // Writable. + + /**/ + + var objectKeys = + Object.keys || + function (obj) { + var keys = []; + + for (var key in obj) { + keys.push(key); + } + + return keys; + }; + /**/ - constructor(comp, options) { - options = parseOptions(options); + module.exports = Duplex; - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } + var Readable = __nccwpck_require__(3522); - debug("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); + var Writable = __nccwpck_require__(268); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; - } + __nccwpck_require__(4626)(Duplex, Readable); - debug("comp", this); - } + { + // Allow the keys array to be GC'ed. + var keys = objectKeys(Writable.prototype); - parse(comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - const m = comp.match(r); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; + } + } - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`); - } + function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; - this.operator = m[1] !== undefined ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; - } + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); } } + } - toString() { - return this.value; - } + Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + }, + }); + Object.defineProperty(Duplex.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + }, + }); + Object.defineProperty(Duplex.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + }, + }); // the no-half-open enforcer - test(version) { - debug("Comparator.test", version, this.options.loose); + function onend() { + // If the writable side ended, then we're ok. + if (this._writableState.ended) return; // no more data can be written. + // But allow more writes to happen in this tick. - if (this.semver === ANY || version === ANY) { - return true; - } + process.nextTick(onEndNT, this); + } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } + function onEndNT(self) { + self.end(); + } + + Object.defineProperty(Duplex.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if ( + this._readableState === undefined || + this._writableState === undefined + ) { + return false; } - return cmp(version, this.operator, this.semver, this.options); - } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if ( + this._readableState === undefined || + this._writableState === undefined + ) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed - intersects(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError("a Comparator is required"); - } + this._readableState.destroyed = value; + this._writableState.destroyed = value; + }, + }); - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false, - }; - } + /***/ + }, - if (this.operator === "") { - if (this.value === "") { - return true; - } - return new Range(comp.value, options).test(this.value); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; - } - return new Range(this.value, options).test(comp.semver); - } + /***/ 9165: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + // a passthrough stream. + // basically just the most minimal sort of Transform stream. + // Every written chunk gets output as-is. - const sameDirectionIncreasing = - (this.operator === ">=" || this.operator === ">") && - (comp.operator === ">=" || comp.operator === ">"); - const sameDirectionDecreasing = - (this.operator === "<=" || this.operator === "<") && - (comp.operator === "<=" || comp.operator === "<"); - const sameSemVer = this.semver.version === comp.semver.version; - const differentDirectionsInclusive = - (this.operator === ">=" || this.operator === "<=") && - (comp.operator === ">=" || comp.operator === "<="); - const oppositeDirectionsLessThan = - cmp(this.semver, "<", comp.semver, options) && - (this.operator === ">=" || this.operator === ">") && - (comp.operator === "<=" || comp.operator === "<"); - const oppositeDirectionsGreaterThan = - cmp(this.semver, ">", comp.semver, options) && - (this.operator === "<=" || this.operator === "<") && - (comp.operator === ">=" || comp.operator === ">"); + module.exports = PassThrough; - return ( - sameDirectionIncreasing || - sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || - oppositeDirectionsGreaterThan - ); - } - } + var Transform = __nccwpck_require__(5152); - module.exports = Comparator; + __nccwpck_require__(4626)(PassThrough, Transform); + + function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); + } - const parseOptions = __nccwpck_require__(6387); - const { re, t } = __nccwpck_require__(2471); - const cmp = __nccwpck_require__(2685); - const debug = __nccwpck_require__(8178); - const SemVer = __nccwpck_require__(6907); - const Range = __nccwpck_require__(229); + PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); + }; /***/ }, - /***/ 229: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - // hoisted class for cyclic dependency - class Range { - constructor(range, options) { - options = parseOptions(options); + /***/ 3522: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range; - } else { - return new Range(range.raw, options); - } - } + module.exports = Readable; + /**/ - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value; - this.set = [[range]]; - this.format(); - return this; - } + var Duplex; + /**/ - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; + Readable.ReadableState = ReadableState; + /**/ - // First, split based on boolean or || - this.raw = range; - this.set = range - .split("||") - // map the range to a 2d array of comparators - .map((r) => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter((c) => c.length); + var EE = __nccwpck_require__(2361).EventEmitter; - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${range}`); - } + var EElistenerCount = function EElistenerCount(emitter, type) { + return emitter.listeners(type).length; + }; + /**/ - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0]; - this.set = this.set.filter((c) => !isNullSet(c[0])); - if (this.set.length === 0) { - this.set = [first]; - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c]; - break; - } - } - } - } + /**/ - this.format(); - } + var Stream = __nccwpck_require__(4001); + /**/ - format() { - this.range = this.set - .map((comps) => { - return comps.join(" ").trim(); - }) - .join("||") - .trim(); - return this.range; - } + var Buffer = __nccwpck_require__(4300).Buffer; - toString() { - return this.range; - } + var OurUint8Array = global.Uint8Array || function () {}; - parseRange(range) { - range = range.trim(); + function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); + } - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = Object.keys(this.options).join(","); - const memoKey = `parseRange:${memoOpts}:${range}`; - const cached = cache.get(memoKey); - if (cached) { - return cached; - } + function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; + } + /**/ - const loose = this.options.loose; - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace( - hr, - hyphenReplace(this.options.includePrerelease) - ); - debug("hyphen replace", range); - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug("comparator trim", range); + var debugUtil = __nccwpck_require__(3837); - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + var debug; - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace); + if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog("stream"); + } else { + debug = function debug() {}; + } + /**/ - // normalize spaces - range = range.split(/\s+/).join(" "); + var BufferList = __nccwpck_require__(747); - // At this point, the range is completely trimmed and - // ready to be split into comparators. + var destroyImpl = __nccwpck_require__(4837); - let rangeList = range - .split(" ") - .map((comp) => parseComparator(comp, this.options)) - .join(" ") - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map((comp) => replaceGTE0(comp, this.options)); + var _require = __nccwpck_require__(5267), + getHighWaterMark = _require.getHighWaterMark; - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter((comp) => { - debug("loose invalid filter", comp, this.options); - return !!comp.match(re[t.COMPARATORLOOSE]); - }); - } - debug("range list", rangeList); + var _require$codes = __nccwpck_require__(9859) /* .codes */.q, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT = + _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map(); - const comparators = rangeList.map( - (comp) => new Comparator(comp, this.options) - ); - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp]; - } - rangeMap.set(comp.value, comp); - } - if (rangeMap.size > 1 && rangeMap.has("")) { - rangeMap.delete(""); - } + var StringDecoder; + var createReadableStreamAsyncIterator; + var from; - const result = [...rangeMap.values()]; - cache.set(memoKey, result); - return result; + __nccwpck_require__(4626)(Readable, Stream); + + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + + function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); + else if (Array.isArray(emitter._events[event])) + emitter._events[event].unshift(fn); + else emitter._events[event] = [fn, emitter._events[event]]; + } + + function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(8349); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + + this.highWaterMark = getHighWaterMark( + this, + options, + "readableHighWaterMark", + isDuplex + ); // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + + this.sync = true; // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; // Should close be emitted on destroy. Defaults to true. + + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') + + this.autoDestroy = !!options.autoDestroy; // has it been destroyed + + this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + + this.defaultEncoding = options.defaultEncoding || "utf8"; // the number of writers that are awaiting a drain event in .pipe()s + + this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled + + this.readingMore = false; + this.decoder = null; + this.encoding = null; + + if (options.encoding) { + if (!StringDecoder) + StringDecoder = __nccwpck_require__(515) /* .StringDecoder */.s; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } + } - intersects(range, options) { - if (!(range instanceof Range)) { - throw new TypeError("a Range is required"); - } + function Readable(options) { + Duplex = Duplex || __nccwpck_require__(8349); + if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside + // the ReadableState constructor, at least with V8 6.5 - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options); - }); - }) - ); - }) - ); - }); + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); // legacy + + this.readable = true; + + if (options) { + if (typeof options.read === "function") this._read = options.read; + if (typeof options.destroy === "function") + this._destroy = options.destroy; } - // if ANY of the sets match ALL of its comparators, then pass - test(version) { - if (!version) { + Stream.call(this); + } + + Object.defineProperty(Readable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined) { return false; } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + return this._readableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed + + this._readableState.destroyed = value; + }, + }); + Readable.prototype.destroy = destroyImpl.destroy; + Readable.prototype._undestroy = destroyImpl.undestroy; + + Readable.prototype._destroy = function (err, cb) { + cb(err); + }; // Manually shove something into the read() buffer. + // This returns true if the highWaterMark has not been hit yet, + // similar to how Writable.write() returns true if you should + // write() some more. + + Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === "string") { + encoding = encoding || state.defaultEncoding; + + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ""; } + + skipChunkCheck = true; } + } else { + skipChunkCheck = true; + } - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true; + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); + }; // Unshift should *always* be something directly out of read() + + Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); + }; + + function readableAddChunk( + stream, + chunk, + encoding, + addToFront, + skipChunkCheck + ) { + debug("readableAddChunk", chunk); + var state = stream._readableState; + + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || (chunk && chunk.length > 0)) { + if ( + typeof chunk !== "string" && + !state.objectMode && + Object.getPrototypeOf(chunk) !== Buffer.prototype + ) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) + errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) + addChunk(stream, state, chunk, false); + else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); } - return false; + } // We can push more data if we are below the highWaterMark. + // Also, if we have no data yet, we can stand some more bytes. + // This is to work around cases where hwm=0, such as the repl. + + return ( + !state.ended && + (state.length < state.highWaterMark || state.length === 0) + ); + } + + function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit("data", chunk); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk); + else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); } + + maybeReadMore(stream, state); } - module.exports = Range; - const LRU = __nccwpck_require__(4965); - const cache = new LRU({ max: 1000 }); + function chunkInvalid(state, chunk) { + var er; - const parseOptions = __nccwpck_require__(6387); - const Comparator = __nccwpck_require__(2678); - const debug = __nccwpck_require__(8178); - const SemVer = __nccwpck_require__(6907); - const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = - __nccwpck_require__(2471); + if ( + !_isUint8Array(chunk) && + typeof chunk !== "string" && + chunk !== undefined && + !state.objectMode + ) { + er = new ERR_INVALID_ARG_TYPE( + "chunk", + ["string", "Buffer", "Uint8Array"], + chunk + ); + } - const isNullSet = (c) => c.value === "<0.0.0-0"; - const isAny = (c) => c.value === ""; + return er; + } - // take a set of comparators and determine whether there - // exists a version which can satisfy it - const isSatisfiable = (comparators, options) => { - let result = true; - const remainingComparators = comparators.slice(); - let testComparator = remainingComparators.pop(); + Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; + }; // backwards compatibility. - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options); - }); + Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) + StringDecoder = __nccwpck_require__(515) /* .StringDecoder */.s; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - testComparator = remainingComparators.pop(); + this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: + + var p = this._readableState.buffer.head; + var content = ""; + + while (p !== null) { + content += decoder.write(p.data); + p = p.next; } - return result; - }; + this._readableState.buffer.clear(); - // comprised of xranges, tildes, stars, and gtlt's at this point. - // already replaced the hyphen ranges - // turn into a set of JUST comparators. - const parseComparator = (comp, options) => { - debug("comp", comp, options); - comp = replaceCarets(comp, options); - debug("caret", comp); - comp = replaceTildes(comp, options); - debug("tildes", comp); - comp = replaceXRanges(comp, options); - debug("xrange", comp); - comp = replaceStars(comp, options); - debug("stars", comp); - return comp; - }; + if (content !== "") this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; // Don't raise the hwm > 1GB - const isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var MAX_HWM = 0x40000000; - // ~, ~> --> * (any, kinda silly) - // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 - // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 - // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 - // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 - // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 - // ~0.0.1 --> >=0.0.1 <0.1.0-0 - const replaceTildes = (comp, options) => - comp - .trim() - .split(/\s+/) - .map((c) => { - return replaceTilde(c, options); - }) - .join(" "); + function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + + return n; + } // This function is designed to be inlinable, so please take care when making + // changes to the function body. + + function howMuchToRead(n, state) { + if (n <= 0 || (state.length === 0 && state.ended)) return 0; + if (state.objectMode) return 1; + + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length; + else return state.length; + } // If we're asking for more than the current hwm, then raise the hwm. + + if (n > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; // Don't have enough + + if (!state.ended) { + state.needReadable = true; + return 0; + } - const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - return comp.replace(r, (_, M, m, p, pr) => { - debug("tilde", comp, _, M, m, p, pr); - let ret; + return state.length; + } // you can override either this method, or the async _read(n) below. - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; - } else if (pr) { - debug("replaceTilde pr", pr); - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; - } + Readable.prototype.read = function (n) { + debug("read", n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. - debug("tilde return", ret); - return ret; - }); + if ( + n === 0 && + state.needReadable && + ((state.highWaterMark !== 0 + ? state.length >= state.highWaterMark + : state.length > 0) || + state.ended) + ) { + debug("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this); + else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. + + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + // if we need a readable event, then we need to do some reading. + + var doRead = state.needReadable; + debug("need readable", doRead); // if we currently have less than the highWaterMark, then also read some + + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug("length less than watermark", doRead); + } // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + + if (state.ended || state.reading) { + doRead = false; + debug("reading or ended", doRead); + } else if (doRead) { + debug("do read"); + state.reading = true; + state.sync = true; // if the length is currently zero, then we *need* a readable event. + + if (state.length === 0) state.needReadable = true; // call internal read method + + this._read(state.highWaterMark); + + state.sync = false; // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state); + else ret = null; + + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. + + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit("data", ret); + return ret; }; - // ^ --> * (any, kinda silly) - // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 - // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 - // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 - // ^1.2.3 --> >=1.2.3 <2.0.0-0 - // ^1.2.0 --> >=1.2.0 <2.0.0-0 - // ^0.0.1 --> >=0.0.1 <0.0.2-0 - // ^0.1.0 --> >=0.1.0 <0.2.0-0 - const replaceCarets = (comp, options) => - comp - .trim() - .split(/\s+/) - .map((c) => { - return replaceCaret(c, options); - }) - .join(" "); + function onEofChunk(stream, state) { + debug("onEofChunk"); + if (state.ended) return; - const replaceCaret = (comp, options) => { - debug("caret", comp, options); - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - const z = options.includePrerelease ? "-0" : ""; - return comp.replace(r, (_, M, m, p, pr) => { - debug("caret", comp, _, M, m, p, pr); - let ret; + if (state.decoder) { + var chunk = state.decoder.end(); - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; - } else if (isX(p)) { - if (M === "0") { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; - } - } else if (pr) { - debug("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; - } - } else { - debug("no pr"); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; - } + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; } + } - debug("caret return", ret); - return ret; - }); - }; + state.ended = true; - const replaceXRanges = (comp, options) => { - debug("replaceXRanges", comp, options); - return comp - .split(/\s+/) - .map((c) => { - return replaceXRange(c, options); - }) - .join(" "); + if (state.sync) { + // if we are sync, wait until next tick to emit the data. + // Otherwise we risk emitting data in the flow() + // the readable code triggers during a read() call + emitReadable(stream); + } else { + // emit 'readable' now to make sure it gets picked up. + state.needReadable = false; + + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } + } + } // Don't emit readable right away in sync mode, because this can trigger + // another read() call => stack overflow. This way, it might trigger + // a nextTick recursion warning, but that's not so bad. + + function emitReadable(stream) { + var state = stream._readableState; + debug("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + + if (!state.emittedReadable) { + debug("emitReadable", state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); + } + } + + function emitReadable_(stream) { + var state = stream._readableState; + debug("emitReadable_", state.destroyed, state.length, state.ended); + + if (!state.destroyed && (state.length || state.ended)) { + stream.emit("readable"); + state.emittedReadable = false; + } // The stream needs another readable event if + // 1. It is not flowing, as the flow mechanism will take + // care of it. + // 2. It is not ended. + // 3. It is below the highWaterMark, so we can schedule + // another readable later. + + state.needReadable = + !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); + } // at this point, the user has presumably seen the 'readable' event, + // and called read() to consume some data. that may have triggered + // in turn another _read(n) call, in which case reading = true if + // it's in progress. + // However, if we're not ended, or reading, and the length < hwm, + // then go ahead and try to read some more preemptively. + + function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); + } + } + + function maybeReadMore_(stream, state) { + // Attempt to read more data if we should. + // + // The conditions for reading more data are (one of): + // - Not enough data buffered (state.length < state.highWaterMark). The loop + // is responsible for filling the buffer with enough data if such data + // is available. If highWaterMark is 0 and we are not in the flowing mode + // we should _not_ attempt to buffer any extra data. We'll get more data + // when the stream consumer calls read() instead. + // - No data in the buffer, and the stream is in flowing mode. In this mode + // the loop below is responsible for ensuring read() is called. Failing to + // call read here would abort the flow and there's no other mechanism for + // continuing the flow if the stream consumer has just subscribed to the + // 'data' event. + // + // In addition to the above conditions to keep reading data, the following + // conditions prevent the data from being read: + // - The stream has ended (state.ended). + // - There is already a pending 'read' operation (state.reading). This is a + // case where the the stream has called the implementation defined _read() + // method, but they are processing the call asynchronously and have _not_ + // called push() with new data. In this case we skip performing more + // read()s. The execution ends in this method again after the _read() ends + // up calling push() with more data. + while ( + !state.reading && + !state.ended && + (state.length < state.highWaterMark || + (state.flowing && state.length === 0)) + ) { + var len = state.length; + debug("maybeReadMore read 0"); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + } + + state.readingMore = false; + } // abstract method. to be overridden in specific implementation classes. + // call cb(er, data) where data is <= n in length. + // for virtual (non-string, non-buffer) streams, "length" is somewhat + // arbitrary, and perhaps not very meaningful. + + Readable.prototype._read = function (n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); }; - const replaceXRange = (comp, options) => { - comp = comp.trim(); - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug("xRange", comp, ret, gtlt, M, m, p, pr); - const xM = isX(M); - const xm = xM || isX(m); - const xp = xm || isX(p); - const anyX = xp; + Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; - if (gtlt === "=" && anyX) { - gtlt = ""; - } + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? "-0" : ""; + case 1: + state.pipes = [state.pipes, dest]; + break; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - // nothing is allowed - ret = "<0.0.0-0"; - } else { - // nothing is forbidden - ret = "*"; - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0; - } - p = 0; + default: + state.pipes.push(dest); + break; + } - if (gtlt === ">") { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = "<"; - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } + state.pipesCount += 1; + debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = + (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn); + else src.once("end", endFn); + dest.on("unpipe", onunpipe); + + function onunpipe(readable, unpipeInfo) { + debug("onunpipe"); + + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); } + } + } - if (gtlt === "<") { - pr = "-0"; + function onend() { + debug("onend"); + dest.end(); + } // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + + function cleanup() { + debug("cleanup"); // cleanup event handlers once the pipe is broken + + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + + if ( + state.awaitDrain && + (!dest._writableState || dest._writableState.needDrain) + ) + ondrain(); + } + + src.on("data", ondata); + + function ondata(chunk) { + debug("ondata"); + var ret = dest.write(chunk); + debug("dest.write", ret); + + if (ret === false) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ( + ((state.pipesCount === 1 && state.pipes === dest) || + (state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1)) && + !cleanedUp + ) { + debug("false write response, pause", state.awaitDrain); + state.awaitDrain++; } - ret = `${gtlt + M}.${m}.${p}${pr}`; - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; - } else if (xp) { - ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + src.pause(); } + } // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. - debug("xRange return", ret); + function onerror(er) { + debug("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); + } // Make sure our error handler is attached before userland ones. - return ret; - }); - }; + prependListener(dest, "error", onerror); // Both close and finish should trigger unpipe, but only once. - // Because * is AND-ed with everything else in the comparator, - // and '' means "any version", just remove the *s entirely. - const replaceStars = (comp, options) => { - debug("replaceStars", comp, options); - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], ""); - }; + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } - const replaceGTE0 = (comp, options) => { - debug("replaceGTE0", comp, options); - return comp - .trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); + dest.once("close", onclose); + + function onfinish() { + debug("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + + dest.once("finish", onfinish); + + function unpipe() { + debug("unpipe"); + src.unpipe(dest); + } // tell the dest that it's being piped to + + dest.emit("pipe", src); // start the flow if it hasn't been started already. + + if (!state.flowing) { + debug("pipe resume"); + src.resume(); + } + + return dest; }; - // This function is passed to string.replace(re[t.HYPHENRANGE]) - // M, m, patch, prerelease, build - // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 - // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do - // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 - const hyphenReplace = - (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? "-0" : ""}`; - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; - } else if (fpr) { - from = `>=${from}`; - } else { - from = `>=${from}${incPr ? "-0" : ""}`; - } + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0`; - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0`; - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}`; - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0`; - } else { - to = `<=${to}`; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow(src); } - - return `${from} ${to}`.trim(); }; + } - const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false; + Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false, + }; // if we're not piping anywhere, then do nothing. + + if (state.pipesCount === 0) return this; // just one destination. most common case. + + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; // got a match. + + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit("unpipe", this, unpipeInfo); + return this; + } // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit("unpipe", this, { + hasUnpiped: false, + }); } - } - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === Comparator.ANY) { - continue; - } + return this; + } // try to find the right one. + + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; // set up data events if they are asked for + // Ensure readable listeners eventually get something - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver; - if ( - allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch - ) { - return true; - } + Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; + + if (ev === "data") { + // update readableListening so that resume() may be a no-op + // a few lines down. This is needed to support once('readable'). + state.readableListening = this.listenerCount("readable") > 0; // Try start flowing on next tick if stream isn't explicitly paused + + if (state.flowing !== false) this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug("on readable", state.length, state.reading); + + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); } } + } - // Version has a -pre, but it's not one of the ones we like. - return false; + return res; + }; + + Readable.prototype.addListener = Readable.prototype.on; + + Readable.prototype.removeListener = function (ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + + if (ev === "readable") { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); } - return true; + return res; }; - /***/ - }, + Readable.prototype.removeAllListeners = function (ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); - /***/ 6907: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const debug = __nccwpck_require__(8178); - const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(6243); - const { re, t } = __nccwpck_require__(2471); + if (ev === "readable" || ev === undefined) { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } - const parseOptions = __nccwpck_require__(6387); - const { compareIdentifiers } = __nccwpck_require__(7438); - class SemVer { - constructor(version, options) { - options = parseOptions(options); + return res; + }; - if (version instanceof SemVer) { - if ( - version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease - ) { - return version; - } else { - version = version.version; - } - } else if (typeof version !== "string") { - throw new TypeError(`Invalid Version: ${version}`); - } + function updateReadableListening(self) { + var state = self._readableState; + state.readableListening = self.listenerCount("readable") > 0; - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ); - } + if (state.resumeScheduled && !state.paused) { + // flowing needs to be set to true now, otherwise + // the upcoming resume will not flow. + state.flowing = true; // crude way to check if we should resume + } else if (self.listenerCount("data") > 0) { + self.resume(); + } + } - debug("SemVer", version, options); - this.options = options; - this.loose = !!options.loose; - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease; + function nReadingNextTick(self) { + debug("readable nexttick read 0"); + self.read(0); + } // pause() and resume() are remnants of the legacy readable stream API + // If the user uses them, then switch into old mode. - const m = version - .trim() - .match(options.loose ? re[t.LOOSE] : re[t.FULL]); + Readable.prototype.resume = function () { + var state = this._readableState; - if (!m) { - throw new TypeError(`Invalid Version: ${version}`); - } + if (!state.flowing) { + debug("resume"); // we flow only if there is no one listening + // for readable, but we still have to call + // resume() - this.raw = version; + state.flowing = !state.readableListening; + resume(this, state); + } - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; + state.paused = false; + return this; + }; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); - } + function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } + } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + function resume_(stream, state) { + debug("resume", state.reading); + + if (!state.reading) { + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit("resume"); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); + } + + Readable.prototype.pause = function () { + debug("call pause flowing=%j", this._readableState.flowing); + + if (this._readableState.flowing !== false) { + debug("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + + this._readableState.paused = true; + return this; + }; + + function flow(stream) { + var state = stream._readableState; + debug("flow", state.flowing); + + while (state.flowing && stream.read() !== null) {} + } // wrap an old-style stream as the async data source. + // This is *not* part of the readable stream interface. + // It is an ugly unfortunate mess of history. + + Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + stream.on("end", function () { + debug("wrapped end"); + + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _this.push(null); + }); + stream.on("data", function (chunk) { + debug("wrapped data"); + if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode + + if (state.objectMode && (chunk === null || chunk === undefined)) return; + else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + + if (!ret) { + paused = true; + stream.pause(); } + }); // proxy all the other methods. + // important when wrapping filters and duplexes. - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; - }); + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === "function") { + this[i] = (function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + })(i); } + } // proxy certain important events. - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } // when we try to consume some more bytes, simply unpause the + // underlying stream. - format() { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join(".")}`; + this._read = function (n) { + debug("wrapped _read", n); + + if (paused) { + paused = false; + stream.resume(); } - return this.version; - } + }; - toString() { - return this.version; - } + return this; + }; - compare(other) { - debug("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - if (typeof other === "string" && other === this.version) { - return 0; - } - other = new SemVer(other, this.options); + if (typeof Symbol === "function") { + Readable.prototype[Symbol.asyncIterator] = function () { + if (createReadableStreamAsyncIterator === undefined) { + createReadableStreamAsyncIterator = __nccwpck_require__(6852); } - if (other.version === this.version) { - return 0; + return createReadableStreamAsyncIterator(this); + }; + } + + Object.defineProperty(Readable.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + }, + }); + Object.defineProperty(Readable.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + }, + }); + Object.defineProperty(Readable.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; } + }, + }); // exposed for testing purposes only. - return this.compareMain(other) || this.comparePre(other); + Readable._fromList = fromList; + Object.defineProperty(Readable.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + }, + }); // Pluck off n bytes from an array of buffers. + // Length is the combined lengths of all the buffers in the list. + // This function is designed to be inlinable, so please take care when making + // changes to the function body. + + function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift(); + else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join(""); + else if (state.buffer.length === 1) ret = state.buffer.first(); + else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = state.buffer.consume(n, state.decoder); } + return ret; + } - compareMain(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } + function endReadable(stream) { + var state = stream._readableState; + debug("endReadable", state.endEmitted); - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ); + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); } + } - comparePre(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } + function endReadableNT(state, stream) { + debug("endReadableNT", state.endEmitted, state.length); // Check that we didn't get one last unshift. - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit("end"); - let i = 0; - do { - const a = this.prerelease[i]; - const b = other.prerelease[i]; - debug("prerelease compare", i, a, b); - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the writable side is ready for autoDestroy as well + var wState = stream._writableState; + + if (!wState || (wState.autoDestroy && wState.finished)) { + stream.destroy(); } - } while (++i); + } } + } - compareBuild(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + if (typeof Symbol === "function") { + Readable.from = function (iterable, opts) { + if (from === undefined) { + from = __nccwpck_require__(2290); } - let i = 0; - do { - const a = this.build[i]; - const b = other.build[i]; - debug("prerelease compare", i, a, b); - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); + return from(Readable, iterable, opts); + }; + } + + function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; } - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc(release, identifier) { - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier); - break; - case "prepatch": - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc("patch", identifier); - this.inc("pre", identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier); - } - this.inc("pre", identifier); - break; - - case "major": - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case "pre": - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - let i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === "number") { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0); - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break; - - default: - throw new Error(`invalid increment argument: ${release}`); - } - this.format(); - this.raw = this.version; - return this; - } + return -1; } - module.exports = SemVer; - /***/ }, - /***/ 3942: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const parse = __nccwpck_require__(8486); - const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - }; - module.exports = clean; + /***/ 5152: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + // a transform stream is a readable/writable stream where you do + // something with the data. Sometimes it's called a "filter", + // but that's not a great name for it, since that implies a thing where + // some bits pass through, and others are simply ignored. (That would + // be a valid example of a transform, of course.) + // + // While the output is causally related to the input, it's not a + // necessarily symmetric or synchronous transformation. For example, + // a zlib stream might take multiple plain-text writes(), and then + // emit a single compressed chunk some time in the future. + // + // Here's how this works: + // + // The Transform stream has all the aspects of the readable and writable + // stream classes. When you write(chunk), that calls _write(chunk,cb) + // internally, and returns false if there's a lot of pending writes + // buffered up. When you call read(), that calls _read(n) until + // there's enough pending readable data buffered up. + // + // In a transform stream, the written data is placed in a buffer. When + // _read(n) is called, it transforms the queued up data, calling the + // buffered _write cb's as it consumes chunks. If consuming a single + // written chunk would result in multiple output chunks, then the first + // outputted bit calls the readcb, and subsequent chunks just go into + // the read buffer, and will cause it to emit 'readable' if necessary. + // + // This way, back-pressure is actually determined by the reading side, + // since _read has to be called to start processing a new chunk. However, + // a pathological inflate type of transform can cause excessive buffering + // here. For example, imagine a stream where every byte of input is + // interpreted as an integer from 0-255, and then results in that many + // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in + // 1kb of data being output. In this case, you could write a very small + // amount of input, and end up with a very large amount of output. In + // such a pathological inflating mechanism, there'd be no way to tell + // the system to stop doing the transform. A single 4MB write could + // cause the system to run out of memory. + // + // However, even in such a pathological case, only a single written chunk + // would be consumed, and then the rest would wait (un-transformed) until + // the results of the previous transformed chunk were consumed. - /***/ - }, + module.exports = Transform; - /***/ 2685: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const eq = __nccwpck_require__(1816); - const neq = __nccwpck_require__(1628); - const gt = __nccwpck_require__(2848); - const gte = __nccwpck_require__(2120); - const lt = __nccwpck_require__(9192); - const lte = __nccwpck_require__(3003); + var _require$codes = __nccwpck_require__(9859) /* .codes */.q, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_TRANSFORM_ALREADY_TRANSFORMING = + _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, + ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - const cmp = (a, op, b, loose) => { - switch (op) { - case "===": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; - } - return a === b; + var Duplex = __nccwpck_require__(8349); - case "!==": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; - } - return a !== b; + __nccwpck_require__(4626)(Transform, Duplex); - case "": - case "=": - case "==": - return eq(a, b, loose); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; - case "!=": - return neq(a, b, loose); + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } - case ">": - return gt(a, b, loose); + ts.writechunk = null; + ts.writecb = null; + if (data != null) + // single equals check for both `null` and `undefined` + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; - case ">=": - return gte(a, b, loose); + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } - case "<": - return lt(a, b, loose); + function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null, + }; // start out asking for a readable event once data is transformed. - case "<=": - return lte(a, b, loose); + this._readableState.needReadable = true; // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. - default: - throw new TypeError(`Invalid operator: ${op}`); - } - }; - module.exports = cmp; + this._readableState.sync = false; - /***/ - }, + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") this._flush = options.flush; + } // When the writable side finishes, then flush out anything remaining. - /***/ 4519: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const parse = __nccwpck_require__(8486); - const { re, t } = __nccwpck_require__(2471); + this.on("prefinish", prefinish); + } - const coerce = (version, options) => { - if (version instanceof SemVer) { - return version; - } + function prefinish() { + var _this = this; - if (typeof version === "number") { - version = String(version); + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); } + } - if (typeof version !== "string") { - return null; - } + Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); + }; // This is the part where you do stuff! + // override this function in implementation classes. + // 'chunk' is an input chunk. + // + // Call `push(newChunk)` to pass along transformed output + // to the readable side. You may call 'push' zero or more times. + // + // Call `cb(err)` when you are done with this chunk. If you pass + // an error, then that'll put the hurt on the whole operation. If you + // never call cb(), then you'll never get another chunk. - options = options || {}; + Transform.prototype._transform = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; - let match = null; - if (!options.rtl) { - match = version.match(re[t.COERCE]); - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - let next; - while ( - (next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if ( - !match || - next.index + next[0].length !== match.index + match[0].length - ) { - match = next; - } - re[t.COERCERTL].lastIndex = - next.index + next[1].length + next[2].length; - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1; + Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); } + }; // Doesn't matter what the args are here. + // _transform does all the work. + // That we got here means that the readable side wants more data. - if (match === null) { - return null; + Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } + }; - return parse( - `${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, - options - ); + Transform.prototype._destroy = function (err, cb) { + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + }); }; - module.exports = coerce; - /***/ - }, + function done(stream, er, data) { + if (er) return stream.emit("error", er); + if (data != null) + // single equals check for both `null` and `undefined` + stream.push(data); // TODO(BridgeAR): Write a test for these two error cases + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided - /***/ 9216: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose); - const versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - }; - module.exports = compareBuild; + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) + throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); + } /***/ }, - /***/ 9233: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const compareLoose = (a, b) => compare(a, b, true); - module.exports = compareLoose; + /***/ 268: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + // A bit simpler than readable streams. + // Implement an async ._write(chunk, encoding, cb), and it'll handle all + // the drain event emission and buffering. + + module.exports = Writable; + /* */ + + function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; + } // It seems a linked list but it is not + // there will be only 2 of these for each stream + + function CorkedRequest(state) { + var _this = this; - /***/ - }, + this.next = null; + this.entry = null; - /***/ 6437: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)); + this.finish = function () { + onCorkedFinish(_this, state); + }; + } + /* */ - module.exports = compare; + /**/ - /***/ - }, + var Duplex; + /**/ - /***/ 2377: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const parse = __nccwpck_require__(8486); - const eq = __nccwpck_require__(1816); + Writable.WritableState = WritableState; + /**/ - const diff = (version1, version2) => { - if (eq(version1, version2)) { - return null; - } else { - const v1 = parse(version1); - const v2 = parse(version2); - const hasPre = v1.prerelease.length || v2.prerelease.length; - const prefix = hasPre ? "pre" : ""; - const defaultResult = hasPre ? "prerelease" : ""; - for (const key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } - } - return defaultResult; // may be undefined - } + var internalUtil = { + deprecate: __nccwpck_require__(1174), }; - module.exports = diff; + /**/ - /***/ - }, + /**/ - /***/ 1816: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const eq = (a, b, loose) => compare(a, b, loose) === 0; - module.exports = eq; + var Stream = __nccwpck_require__(4001); + /**/ - /***/ - }, + var Buffer = __nccwpck_require__(4300).Buffer; - /***/ 2848: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const gt = (a, b, loose) => compare(a, b, loose) > 0; - module.exports = gt; + var OurUint8Array = global.Uint8Array || function () {}; - /***/ - }, + function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); + } - /***/ 2120: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const gte = (a, b, loose) => compare(a, b, loose) >= 0; - module.exports = gte; + function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; + } - /***/ - }, + var destroyImpl = __nccwpck_require__(4837); - /***/ 1132: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); + var _require = __nccwpck_require__(5267), + getHighWaterMark = _require.getHighWaterMark; - const inc = (version, release, options, identifier) => { - if (typeof options === "string") { - identifier = options; - options = undefined; - } + var _require$codes = __nccwpck_require__(9859) /* .codes */.q, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, + ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier).version; - } catch (er) { - return null; - } - }; - module.exports = inc; + var errorOrDestroy = destroyImpl.errorOrDestroy; - /***/ - }, + __nccwpck_require__(4626)(Writable, Stream); - /***/ 9192: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const lt = (a, b, loose) => compare(a, b, loose) < 0; - module.exports = lt; + function nop() {} - /***/ - }, + function WritableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(8349); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream, + // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - /***/ 3003: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const lte = (a, b, loose) => compare(a, b, loose) <= 0; - module.exports = lte; + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream + // contains buffers or objects. - /***/ - }, + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() - /***/ 4011: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const major = (a, loose) => new SemVer(a, loose).major; - module.exports = major; + this.highWaterMark = getHighWaterMark( + this, + options, + "writableHighWaterMark", + isDuplex + ); // if _final has been called - /***/ - }, + this.finalCalled = false; // drain event flag. - /***/ 9575: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const minor = (a, loose) => new SemVer(a, loose).minor; - module.exports = minor; + this.needDrain = false; // at the start of calling end() - /***/ - }, + this.ending = false; // when end() has been called, and returned - /***/ 1628: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const neq = (a, b, loose) => compare(a, b, loose) !== 0; - module.exports = neq; + this.ended = false; // when 'finish' is emitted - /***/ - }, + this.finished = false; // has it been destroyed - /***/ 8486: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const { MAX_LENGTH } = __nccwpck_require__(6243); - const { re, t } = __nccwpck_require__(2471); - const SemVer = __nccwpck_require__(6907); + this.destroyed = false; // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. - const parseOptions = __nccwpck_require__(6387); - const parse = (version, options) => { - options = parseOptions(options); + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. - if (version instanceof SemVer) { - return version; - } + this.defaultEncoding = options.defaultEncoding || "utf8"; // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. - if (typeof version !== "string") { - return null; - } + this.length = 0; // a flag to see when we're in the middle of a write. - if (version.length > MAX_LENGTH) { - return null; - } + this.writing = false; // when true all writes will be buffered until .uncork() call - const r = options.loose ? re[t.LOOSE] : re[t.FULL]; - if (!r.test(version)) { - return null; - } + this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. - try { - return new SemVer(version, options); - } catch (er) { - return null; - } - }; + this.sync = true; // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. - module.exports = parse; + this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - /***/ - }, + this.onwrite = function (er) { + onwrite(stream, er); + }; // the callback that the user supplies to write(chunk,encoding,cb) - /***/ 268: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const patch = (a, loose) => new SemVer(a, loose).patch; - module.exports = patch; + this.writecb = null; // the amount that is being written when _write is called. - /***/ - }, + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted - /***/ 7795: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const parse = __nccwpck_require__(8486); - const prerelease = (version, options) => { - const parsed = parse(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - }; - module.exports = prerelease; + this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams - /***/ - }, + this.prefinished = false; // True if the error was already emitted and should not be thrown again - /***/ 7998: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compare = __nccwpck_require__(6437); - const rcompare = (a, b, loose) => compare(b, a, loose); - module.exports = rcompare; + this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - /***/ - }, + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - /***/ 4536: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compareBuild = __nccwpck_require__(9216); - const rsort = (list, loose) => - list.sort((a, b) => compareBuild(b, a, loose)); - module.exports = rsort; + this.autoDestroy = !!options.autoDestroy; // count buffered requests - /***/ - }, + this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two - /***/ 9693: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const Range = __nccwpck_require__(229); - const satisfies = (version, range, options) => { - try { - range = new Range(range, options); - } catch (er) { - return false; + this.corkedRequestsFree = new CorkedRequest(this); + } + + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + + while (current) { + out.push(current); + current = current.next; } - return range.test(version); + + return out; }; - module.exports = satisfies; - /***/ - }, + (function () { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate( + function writableStateBufferGetter() { + return this.getBuffer(); + }, + "_writableState.buffer is deprecated. Use _writableState.getBuffer " + + "instead.", + "DEP0003" + ), + }); + } catch (_) {} + })(); // Test _writableState for inheritance to account for Duplex streams, + // whose prototype chain only points to Readable. - /***/ 9742: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const compareBuild = __nccwpck_require__(9216); - const sort = (list, loose) => - list.sort((a, b) => compareBuild(a, b, loose)); - module.exports = sort; + var realHasInstance; - /***/ - }, + if ( + typeof Symbol === "function" && + Symbol.hasInstance && + typeof Function.prototype[Symbol.hasInstance] === "function" + ) { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + }, + }); + } else { + realHasInstance = function realHasInstance(object) { + return object instanceof this; + }; + } - /***/ 2355: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const parse = __nccwpck_require__(8486); - const valid = (version, options) => { - const v = parse(version, options); - return v ? v.version : null; - }; - module.exports = valid; + function Writable(options) { + Duplex = Duplex || __nccwpck_require__(8349); // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + // Checking for a Stream.Duplex instance is faster here instead of inside + // the WritableState constructor, at least with V8 6.5 - /***/ - }, + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) + return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); // legacy. - /***/ 9290: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - // just pre-load all the stuff that index.js lazily exports - const internalRe = __nccwpck_require__(2471); - const constants = __nccwpck_require__(6243); - const SemVer = __nccwpck_require__(6907); - const identifiers = __nccwpck_require__(7438); - const parse = __nccwpck_require__(8486); - const valid = __nccwpck_require__(2355); - const clean = __nccwpck_require__(3942); - const inc = __nccwpck_require__(1132); - const diff = __nccwpck_require__(2377); - const major = __nccwpck_require__(4011); - const minor = __nccwpck_require__(9575); - const patch = __nccwpck_require__(268); - const prerelease = __nccwpck_require__(7795); - const compare = __nccwpck_require__(6437); - const rcompare = __nccwpck_require__(7998); - const compareLoose = __nccwpck_require__(9233); - const compareBuild = __nccwpck_require__(9216); - const sort = __nccwpck_require__(9742); - const rsort = __nccwpck_require__(4536); - const gt = __nccwpck_require__(2848); - const lt = __nccwpck_require__(9192); - const eq = __nccwpck_require__(1816); - const neq = __nccwpck_require__(1628); - const gte = __nccwpck_require__(2120); - const lte = __nccwpck_require__(3003); - const cmp = __nccwpck_require__(2685); - const coerce = __nccwpck_require__(4519); - const Comparator = __nccwpck_require__(2678); - const Range = __nccwpck_require__(229); - const satisfies = __nccwpck_require__(9693); - const toComparators = __nccwpck_require__(1528); - const maxSatisfying = __nccwpck_require__(685); - const minSatisfying = __nccwpck_require__(8868); - const minVersion = __nccwpck_require__(2729); - const validRange = __nccwpck_require__(9273); - const outside = __nccwpck_require__(2566); - const gtr = __nccwpck_require__(9853); - const ltr = __nccwpck_require__(2583); - const intersects = __nccwpck_require__(4029); - const simplifyRange = __nccwpck_require__(8559); - const subset = __nccwpck_require__(4450); - module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, + this.writable = true; + + if (options) { + if (typeof options.write === "function") this._write = options.write; + if (typeof options.writev === "function") this._writev = options.writev; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + if (typeof options.final === "function") this._final = options.final; + } + + Stream.call(this); + } // Otherwise people can pipe Writable streams, which is just wrong. + + Writable.prototype.pipe = function () { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; - /***/ - }, + function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - /***/ 6243: /***/ (module) => { - // Note: this is the semver.org version of the spec that it implements - // Not necessarily the package version of this code. - const SEMVER_SPEC_VERSION = "2.0.0"; + errorOrDestroy(stream, er); + process.nextTick(cb, er); + } // Checks that a user-supplied chunk is valid, especially for the particular + // mode the stream is in. Currently this means that `null` is never accepted + // and undefined/non-string values are only allowed in object mode. - const MAX_LENGTH = 256; - const MAX_SAFE_INTEGER = - Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991; + function validChunk(stream, state, chunk, cb) { + var er; - // Max safe segment length for coercion. - const MAX_SAFE_COMPONENT_LENGTH = 16; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== "string" && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); + } - module.exports = { - SEMVER_SPEC_VERSION, - MAX_LENGTH, - MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH, - }; + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } - /***/ - }, + return true; + } - /***/ 8178: /***/ (module) => { - const debug = - typeof process === "object" && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) - ? (...args) => console.error("SEMVER", ...args) - : () => {}; + Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; - module.exports = debug; + var isBuf = !state.objectMode && _isUint8Array(chunk); - /***/ - }, + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } - /***/ 7438: /***/ (module) => { - const numeric = /^[0-9]+$/; - const compareIdentifiers = (a, b) => { - const anum = numeric.test(a); - const bnum = numeric.test(b); + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } - if (anum && bnum) { - a = +a; - b = +b; + if (isBuf) encoding = "buffer"; + else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== "function") cb = nop; + if (state.ending) writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } + return ret; + }; - return a === b - ? 0 - : anum && !bnum - ? -1 - : bnum && !anum - ? 1 - : a < b - ? -1 - : 1; + Writable.prototype.cork = function () { + this._writableState.corked++; }; - const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + Writable.prototype.uncork = function () { + var state = this._writableState; - module.exports = { - compareIdentifiers, - rcompareIdentifiers, + if (state.corked) { + state.corked--; + if ( + !state.writing && + !state.corked && + !state.bufferProcessing && + state.bufferedRequest + ) + clearBuffer(this, state); + } }; - /***/ - }, + Writable.prototype.setDefaultEncoding = function setDefaultEncoding( + encoding + ) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === "string") encoding = encoding.toLowerCase(); + if ( + !( + [ + "hex", + "utf8", + "utf-8", + "ascii", + "binary", + "base64", + "ucs2", + "ucs-2", + "utf16le", + "utf-16le", + "raw", + ].indexOf((encoding + "").toLowerCase()) > -1 + ) + ) + throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; - /***/ 6387: /***/ (module) => { - // parse out just the options we care about so we always get a consistent - // obj with keys in a consistent order. - const opts = ["includePrerelease", "loose", "rtl"]; - const parseOptions = (options) => - !options - ? {} - : typeof options !== "object" - ? { loose: true } - : opts - .filter((k) => options[k]) - .reduce((o, k) => { - o[k] = true; - return o; - }, {}); - module.exports = parseOptions; + Object.defineProperty(Writable.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + }, + }); - /***/ - }, + function decodeChunk(state, chunk, encoding) { + if ( + !state.objectMode && + state.decodeStrings !== false && + typeof chunk === "string" + ) { + chunk = Buffer.from(chunk, encoding); + } - /***/ 2471: /***/ (module, exports, __nccwpck_require__) => { - const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(6243); - const debug = __nccwpck_require__(8178); - exports = module.exports = {}; + return chunk; + } - // The actual regexps go on exports.re - const re = (exports.re = []); - const src = (exports.src = []); - const t = (exports.t = {}); - let R = 0; + Object.defineProperty(Writable.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + }, + }); // if we're already writing something, then just put this + // in the queue, and wait our turn. Otherwise, call _write + // If we return false, then we need a drain event, so set that flag. - const createToken = (name, value, isGlobal) => { - const index = R++; - debug(name, index, value); - t[name] = index; - src[index] = value; - re[index] = new RegExp(value, isGlobal ? "g" : undefined); - }; + function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); - // The following Regular Expressions can be used for tokenizing, - // validating, and parsing SemVer version strings. + if (chunk !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk = newChunk; + } + } - // ## Numeric Identifier - // A single `0`, or a non-zero digit followed by zero or more digits. + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); - createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+"); + if (!ret) state.needDrain = true; - // ## Non-numeric Identifier - // Zero or more digits, followed by a letter or hyphen, and then zero or - // more letters, digits, or hyphens. + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null, + }; - createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*"); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } - // ## Main Version - // Three dot-separated numeric identifiers. + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - createToken( - "MAINVERSION", - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})` - ); + return ret; + } - createToken( - "MAINVERSIONLOOSE", - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})` - ); + function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) stream._writev(chunk, state.onwrite); + else stream._write(chunk, encoding, state.onwrite); + state.sync = false; + } - // ## Pre-release Version Identifier - // A numeric identifier, or a non-numeric identifier. + function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; - createToken( - "PRERELEASEIDENTIFIER", - `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})` - ); + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + process.nextTick(cb, er); // this can emit finish, and it will always happen + // after error - createToken( - "PRERELEASEIDENTIFIERLOOSE", - `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})` - ); + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); // this can emit finish, but finish must + // always follow error - // ## Pre-release Version - // Hyphen, followed by one or more dot-separated pre-release version - // identifiers. + finishMaybe(stream, state); + } + } - createToken( - "PRERELEASE", - `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${ - src[t.PRERELEASEIDENTIFIER] - })*))` - ); + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } - createToken( - "PRERELEASELOOSE", - `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ - src[t.PRERELEASEIDENTIFIERLOOSE] - })*))` - ); + function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state) || stream.destroyed; - // ## Build Metadata Identifier - // Any combination of digits, letters, or hyphens. + if ( + !finished && + !state.corked && + !state.bufferProcessing && + state.bufferedRequest + ) { + clearBuffer(stream, state); + } - createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+"); + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } + } - // ## Build Metadata - // Plus sign, followed by one or more period-separated build metadata - // identifiers. + function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); + } // Must force callback to be called on nextTick, so that we don't + // emit 'drain' before the write() consumer gets the 'false' return + // value, and has a chance to attach a 'drain' listener. - createToken( - "BUILD", - `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))` - ); + function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit("drain"); + } + } // if there's something in the buffer waiting, then process it - // ## Full Version String - // A main version, followed optionally by a pre-release version and - // build metadata. + function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - // Note that the only major, minor, patch, and pre-release sections of - // the version string are capturing groups. The build metadata is not a - // capturing group, because it should not ever be used in version - // comparison. + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; - createToken( - "FULLPLAIN", - `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?` - ); + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } - createToken("FULL", `^${src[t.FULLPLAIN]}$`); + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, "", holder.finish); // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite - // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. - // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty - // common in the npm registry. - createToken( - "LOOSEPLAIN", - `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD] - }?` - ); + state.pendingcb++; + state.lastBufferedRequest = null; - createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } - createToken("GTLT", "((?:<|>)?=?)"); + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + + if (state.writing) { + break; + } + } - // Something like "2.*" or "1.2.x". - // Note that "x.x" is a valid xRange identifer, meaning "any version" - // Only the first item is strictly required. - createToken( - "XRANGEIDENTIFIERLOOSE", - `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*` - ); - createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + if (entry === null) state.lastBufferedRequest = null; + } - createToken( - "XRANGEPLAIN", - `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + - `)?)?` - ); + state.bufferedRequest = entry; + state.bufferProcessing = false; + } - createToken( - "XRANGEPLAINLOOSE", - `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + - `)?)?` - ); + Writable.prototype._write = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; - createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); - createToken( - "XRANGELOOSE", - `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$` - ); + Writable.prototype._writev = null; - // Coercion. - // Extract anything that could conceivably be a part of a valid semver - createToken( - "COERCE", - `${"(^|[^\\d])" + "(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:$|[^\\d])` - ); - createToken("COERCERTL", src[t.COERCE], true); + Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - // Tilde ranges. - // Meaning is "reasonably at or greater than" - createToken("LONETILDE", "(?:~>?)"); + if (typeof chunk === "function") { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } - createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); - exports.tildeTrimReplace = "$1~"; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); - createToken( - "TILDELOOSE", - `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$` - ); + if (state.corked) { + state.corked = 1; + this.uncork(); + } // ignore unnecessary end() calls. - // Caret ranges. - // Meaning is "at least and backwards compatible with" - createToken("LONECARET", "(?:\\^)"); + if (!state.ending) endWritable(this, state, cb); + return this; + }; - createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); - exports.caretTrimReplace = "$1^"; + Object.defineProperty(Writable.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + }, + }); - createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); - createToken( - "CARETLOOSE", - `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$` - ); + function needFinish(state) { + return ( + state.ending && + state.length === 0 && + state.bufferedRequest === null && + !state.finished && + !state.writing + ); + } - // A simple gt/lt/eq thing, or just "" to indicate "any version" - createToken( - "COMPARATORLOOSE", - `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$` - ); - createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; - // An expression to strip any whitespace between the gtlt and the thing - // it modifies, so that `> 1.2.3` ==> `>1.2.3` - createToken( - "COMPARATORTRIM", - `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, - true - ); - exports.comparatorTrimReplace = "$1$2$3"; + if (err) { + errorOrDestroy(stream, err); + } - // Something like `1.2.3 - 1.2.4` - // Note that these all use the loose form, because they'll be - // checked against either the strict or loose comparator form - // later. - createToken( - "HYPHENRANGE", - `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$` - ); + state.prefinished = true; + stream.emit("prefinish"); + finishMaybe(stream, state); + }); + } - createToken( - "HYPHENRANGELOOSE", - `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$` - ); + function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === "function" && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit("prefinish"); + } + } + } - // Star ranges basically just allow anything at all. - createToken("STAR", "(<|>)?=?\\s*\\*"); - // >=0.0.0 is like a star - createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); - createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + function finishMaybe(stream, state) { + var need = needFinish(state); - /***/ - }, + if (need) { + prefinish(stream, state); - /***/ 9853: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - // Determine if version is greater than all the versions possible in the range. - const outside = __nccwpck_require__(2566); - const gtr = (version, range, options) => - outside(version, range, ">", options); - module.exports = gtr; + if (state.pendingcb === 0) { + state.finished = true; + stream.emit("finish"); - /***/ - }, + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well + var rState = stream._readableState; - /***/ 4029: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const Range = __nccwpck_require__(229); - const intersects = (r1, r2, options) => { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); - }; - module.exports = intersects; + if (!rState || (rState.autoDestroy && rState.endEmitted)) { + stream.destroy(); + } + } + } + } - /***/ - }, + return need; + } - /***/ 2583: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const outside = __nccwpck_require__(2566); - // Determine if version is less than all the versions possible in the range - const ltr = (version, range, options) => - outside(version, range, "<", options); - module.exports = ltr; + function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); - /***/ - }, + if (cb) { + if (state.finished) process.nextTick(cb); + else stream.once("finish", cb); + } - /***/ 685: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const Range = __nccwpck_require__(229); + state.ended = true; + stream.writable = false; + } - const maxSatisfying = (versions, range, options) => { - let max = null; - let maxSV = null; - let rangeObj = null; - try { - rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v; - maxSV = new SemVer(max, options); - } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } // reuse the free corkReq. + + state.corkedRequestsFree.next = corkReq; + } + + Object.defineProperty(Writable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === undefined) { + return false; } - }); - return max; + + return this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed + + this._writableState.destroyed = value; + }, + }); + Writable.prototype.destroy = destroyImpl.destroy; + Writable.prototype._undestroy = destroyImpl.undestroy; + + Writable.prototype._destroy = function (err, cb) { + cb(err); }; - module.exports = maxSatisfying; /***/ }, - /***/ 8868: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const Range = __nccwpck_require__(229); - const minSatisfying = (versions, range, options) => { - let min = null; - let minSV = null; - let rangeObj = null; - try { - rangeObj = new Range(range, options); - } catch (er) { - return null; + /***/ 6852: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + var _Object$setPrototypeO; + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true, + }); + } else { + obj[key] = value; } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; - }; - module.exports = minSatisfying; + return obj; + } - /***/ - }, + var finished = __nccwpck_require__(5535); - /***/ 2729: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const Range = __nccwpck_require__(229); - const gt = __nccwpck_require__(2848); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); - const minVersion = (range, loose) => { - range = new Range(range, loose); + function createIterResult(value, done) { + return { + value: value, + done: done, + }; + } - let minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; - } + function readAndResolve(iter) { + var resolve = iter[kLastResolve]; - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + if (resolve !== null) { + var data = iter[kStream].read(); // we defer if data is null + // we can be expecting either 'end' or + // 'error' + + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } } + } - minver = null; - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i]; + function onReadable(iter) { + // we wait for the next tick, because it might + // emit an error with process.nextTick + process.nextTick(readAndResolve, iter); + } - let setMin = null; - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - /* fallthrough */ - case "": - case ">=": - if (!setMin || gt(compver, setMin)) { - setMin = compver; - } - break; - case "<": - case "<=": - /* Ignore maximum versions */ - break; - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`); + function wrapForNext(lastPromise, iter) { + return function (resolve, reject) { + lastPromise.then(function () { + if (iter[kEnded]) { + resolve(createIterResult(undefined, true)); + return; } - }); - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin; - } - } - if (minver && range.test(minver)) { - return minver; - } + iter[kHandlePromise](resolve, reject); + }, reject); + }; + } - return null; - }; - module.exports = minVersion; + var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf( + ((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, - /***/ - }, + next: function next() { + var _this = this; - /***/ 2566: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const SemVer = __nccwpck_require__(6907); - const Comparator = __nccwpck_require__(2678); - const { ANY } = Comparator; - const Range = __nccwpck_require__(229); - const satisfies = __nccwpck_require__(9693); - const gt = __nccwpck_require__(2848); - const lt = __nccwpck_require__(9192); - const lte = __nccwpck_require__(3003); - const gte = __nccwpck_require__(2120); + // if we have detected an error in the meanwhile + // reject straight away + var error = this[kError]; - const outside = (version, range, hilo, options) => { - version = new SemVer(version, options); - range = new Range(range, options); + if (error !== null) { + return Promise.reject(error); + } - let gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } + if (this[kEnded]) { + return Promise.resolve(createIterResult(undefined, true)); + } - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false; - } + if (this[kStream].destroyed) { + // We need to defer via nextTick because if .destroy(err) is + // called, the error will be emitted via nextTick, and + // we cannot guarantee that there is no error lingering around + // waiting to be emitted. + return new Promise(function (resolve, reject) { + process.nextTick(function () { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(undefined, true)); + } + }); + }); + } // if we have multiple next() calls + // we will wait for the previous Promise to finish + // this logic is optimized to support for await loops, + // where next() is only called once at a time - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. + var lastPromise = this[kLastPromise]; + var promise; - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i]; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + // fast path needed to support multiple this.push() + // without triggering the next() queue + var data = this[kStream].read(); - let high = null; - let low = null; + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; + promise = new Promise(this[kHandlePromise]); } + + this[kLastPromise] = promise; + return promise; + }, + }), + _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { + return this; + }), + _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + + // destroy(err, cb) is a private API + // we can guarantee we have that here, because we control the + // Readable class this is attached to + return new Promise(function (resolve, reject) { + _this2[kStream].destroy(null, function (err) { + if (err) { + reject(err); + return; + } + + resolve(createIterResult(undefined, true)); + }); }); + }), + _Object$setPrototypeO), + AsyncIteratorPrototype + ); - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } + var createReadableStreamAsyncIterator = + function createReadableStreamAsyncIterator(stream) { + var _Object$create; - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ( - (!low.operator || low.operator === comp) && - ltefn(version, low.semver) - ) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; - }; + var iterator = Object.create( + ReadableStreamAsyncIteratorPrototype, + ((_Object$create = {}), + _defineProperty(_Object$create, kStream, { + value: stream, + writable: true, + }), + _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true, + }), + _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true, + }), + _defineProperty(_Object$create, kError, { + value: null, + writable: true, + }), + _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true, + }), + _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true, + }), + _Object$create) + ); + iterator[kLastPromise] = null; + finished(stream, function (err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise + // returned by next() and store the error - module.exports = outside; + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + + iterator[kError] = err; + return; + } + + var resolve = iterator[kLastResolve]; + + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(undefined, true)); + } + + iterator[kEnded] = true; + }); + stream.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + + module.exports = createReadableStreamAsyncIterator; /***/ }, - /***/ 8559: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - // given a set of versions and a range, create a "simplified" range - // that includes the same versions that the original range does - // If the original range is shorter than the simplified one, return that. - const satisfies = __nccwpck_require__(9693); - const compare = __nccwpck_require__(6437); - module.exports = (versions, range, options) => { - const set = []; - let first = null; - let prev = null; - const v = versions.sort((a, b) => compare(a, b, options)); - for (const version of v) { - const included = satisfies(version, range, options); - if (included) { - prev = version; - if (!first) { - first = version; - } - } else { - if (prev) { - set.push([first, prev]); - } - prev = null; - first = null; - } - } - if (first) { - set.push([first, null]); + /***/ 747: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); } + return keys; + } - const ranges = []; - for (const [min, max] of set) { - if (min === max) { - ranges.push(min); - } else if (!max && min === v[0]) { - ranges.push("*"); - } else if (!max) { - ranges.push(`>=${min}`); - } else if (min === v[0]) { - ranges.push(`<=${max}`); + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties( + target, + Object.getOwnPropertyDescriptors(source) + ); } else { - ranges.push(`${min} - ${max}`); + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty( + target, + key, + Object.getOwnPropertyDescriptor(source, key) + ); + }); } } - const simplified = ranges.join(" || "); - const original = - typeof range.raw === "string" ? range.raw : String(range); - return simplified.length < original.length ? simplified : range; - }; - - /***/ - }, - - /***/ 4450: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const Range = __nccwpck_require__(229); - const Comparator = __nccwpck_require__(2678); - const { ANY } = Comparator; - const satisfies = __nccwpck_require__(9693); - const compare = __nccwpck_require__(6437); - - // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: - // - Every simple range `r1, r2, ...` is a null set, OR - // - Every simple range `r1, r2, ...` which is not a null set is a subset of - // some `R1, R2, ...` - // - // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: - // - If c is only the ANY comparator - // - If C is only the ANY comparator, return true - // - Else if in prerelease mode, return false - // - else replace c with `[>=0.0.0]` - // - If C is only the ANY comparator - // - if in prerelease mode, return true - // - else replace C with `[>=0.0.0]` - // - Let EQ be the set of = comparators in c - // - If EQ is more than one, return true (null set) - // - Let GT be the highest > or >= comparator in c - // - Let LT be the lowest < or <= comparator in c - // - If GT and LT, and GT.semver > LT.semver, return true (null set) - // - If any C is a = range, and GT or LT are set, return false - // - If EQ - // - If GT, and EQ does not satisfy GT, return true (null set) - // - If LT, and EQ does not satisfy LT, return true (null set) - // - If EQ satisfies every C, return true - // - Else return false - // - If GT - // - If GT.semver is lower than any > or >= comp in C, return false - // - If GT is >=, and GT.semver does not satisfy every C, return false - // - If GT.semver has a prerelease, and not in prerelease mode - // - If no C has a prerelease and the GT.semver tuple, return false - // - If LT - // - If LT.semver is greater than any < or <= comp in C, return false - // - If LT is <=, and LT.semver does not satisfy every C, return false - // - If GT.semver has a prerelease, and not in prerelease mode - // - If no C has a prerelease and the LT.semver tuple, return false - // - Else return true + return target; + } - const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true; + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true, + }); + } else { + obj[key] = value; } + return obj; + } - sub = new Range(sub, options); - dom = new Range(dom, options); - let sawNonNull = false; - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options); - sawNonNull = sawNonNull || isSub !== null; - if (isSub) { - continue OUTER; - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false; - } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); } - return true; - }; + } - const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true; + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); } + } - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true; - } else if (options.includePrerelease) { - sub = [new Comparator(">=0.0.0-0")]; - } else { - sub = [new Comparator(">=0.0.0")]; - } - } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true; - } else { - dom = [new Comparator(">=0.0.0")]; - } - } + var _require = __nccwpck_require__(4300), + Buffer = _require.Buffer; - const eqSet = new Set(); - let gt, lt; - for (const c of sub) { - if (c.operator === ">" || c.operator === ">=") { - gt = higherGT(gt, c, options); - } else if (c.operator === "<" || c.operator === "<=") { - lt = lowerLT(lt, c, options); - } else { - eqSet.add(c.semver); - } - } + var _require2 = __nccwpck_require__(3837), + inspect = _require2.inspect; - if (eqSet.size > 1) { - return null; - } + var custom = (inspect && inspect.custom) || "inspect"; - let gtltComp; - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options); - if (gtltComp > 0) { - return null; - } else if ( - gtltComp === 0 && - (gt.operator !== ">=" || lt.operator !== "<=") - ) { - return null; - } - } + function copyBuffer(src, target, offset) { + Buffer.prototype.copy.call(src, target, offset); + } - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null; - } + module.exports = + /*#__PURE__*/ + (function () { + function BufferList() { + _classCallCheck(this, BufferList); - if (lt && !satisfies(eq, String(lt), options)) { - return null; + this.head = null; + this.tail = null; + this.length = 0; } - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false; - } - } + _createClass(BufferList, [ + { + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null, + }; + if (this.length > 0) this.tail.next = entry; + else this.head = entry; + this.tail = entry; + ++this.length; + }, + }, + { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head, + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }, + }, + { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null; + else this.head = this.head.next; + --this.length; + return ret; + }, + }, + { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + }, + }, + { + key: "join", + value: function join(s) { + if (this.length === 0) return ""; + var p = this.head; + var ret = "" + p.data; + + while ((p = p.next)) { + ret += s + p.data; + } - return true; - } + return ret; + }, + }, + { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } - let higher, lower; - let hasDomLT, hasDomGT; - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = - lt && !options.includePrerelease && lt.semver.prerelease.length - ? lt.semver - : false; - let needDomGTPre = - gt && !options.includePrerelease && gt.semver.prerelease.length - ? gt.semver - : false; - // exception: <1.2.3-0 is the same as <1.2.3 - if ( - needDomLTPre && - needDomLTPre.prerelease.length === 1 && - lt.operator === "<" && - needDomLTPre.prerelease[0] === 0 - ) { - needDomLTPre = false; - } + return ret; + }, // Consumes a specified amount of bytes or characters from the buffered data. + }, + { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + + if (n < this.head.data.length) { + // `slice` is the same for buffers and strings. + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + // First chunk is a perfect match. + ret = this.shift(); + } else { + // Result spans more than one buffer. + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; - hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; - if (gt) { - if (needDomGTPre) { - if ( - c.semver.prerelease && - c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch - ) { - needDomGTPre = false; - } - } - if (c.operator === ">" || c.operator === ">=") { - higher = higherGT(gt, c, options); - if (higher === c && higher !== gt) { - return false; - } - } else if ( - gt.operator === ">=" && - !satisfies(gt.semver, String(c), options) - ) { - return false; - } - } - if (lt) { - if (needDomLTPre) { - if ( - c.semver.prerelease && - c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch - ) { - needDomLTPre = false; - } - } - if (c.operator === "<" || c.operator === "<=") { - lower = lowerLT(lt, c, options); - if (lower === c && lower !== lt) { - return false; - } - } else if ( - lt.operator === "<=" && - !satisfies(lt.semver, String(c), options) - ) { - return false; - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false; - } - } + return ret; + }, + }, + { + key: "first", + value: function first() { + return this.head.data; + }, // Consumes a specified amount of characters from the buffered data. + }, + { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + + while ((p = p.next)) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str; + else ret += str.slice(0, n); + n -= nb; + + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next; + else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false; - } + break; + } - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false; - } + ++c; + } - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false; - } + this.length -= c; + return ret; + }, // Consumes a specified amount of bytes from the buffered data. + }, + { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + + while ((p = p.next)) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next; + else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } - return true; - }; + break; + } - // >=1.2.3 is lower than >1.2.3 - const higherGT = (a, b, options) => { - if (!a) { - return b; - } - const comp = compare(a.semver, b.semver, options); - return comp > 0 - ? a - : comp < 0 - ? b - : b.operator === ">" && a.operator === ">=" - ? b - : a; - }; + ++c; + } - // <=1.2.3 is higher than <1.2.3 - const lowerLT = (a, b, options) => { - if (!a) { - return b; - } - const comp = compare(a.semver, b.semver, options); - return comp < 0 - ? a - : comp > 0 - ? b - : b.operator === "<" && a.operator === "<=" - ? b - : a; - }; + this.length -= c; + return ret; + }, // Make sure the linked list only shows the minimal necessary information. + }, + { + key: custom, + value: function value(_, options) { + return inspect( + this, + _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false, + }) + ); + }, + }, + ]); - module.exports = subset; + return BufferList; + })(); /***/ }, - /***/ 1528: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const Range = __nccwpck_require__(229); + /***/ 4837: /***/ (module) => { + // undocumented cb() API, needed for core, not for public API - // Mostly just for testing and legacy API reasons - const toComparators = (range, options) => - new Range(range, options).set.map((comp) => - comp - .map((c) => c.value) - .join(" ") - .trim() - .split(" ") - ); + function destroy(err, cb) { + var _this = this; - module.exports = toComparators; + var readableDestroyed = + this._readableState && this._readableState.destroyed; + var writableDestroyed = + this._writableState && this._writableState.destroyed; - /***/ - }, + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } - /***/ 9273: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const Range = __nccwpck_require__(229); - const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || "*"; - } catch (er) { - return null; + return this; + } // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } // if this is a duplex stream mark the writable part as destroyed as well + + if (this._writableState) { + this._writableState.destroyed = true; } - }; - module.exports = validRange; - /***/ - }, + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + + return this; + } - /***/ 5382: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const shebangRegex = __nccwpck_require__(11); + function emitErrorAndCloseNT(self, err) { + emitErrorNT(self, err); + emitCloseNT(self); + } - module.exports = (string = "") => { - const match = string.match(shebangRegex); + function emitCloseNT(self) { + if (self._writableState && !self._writableState.emitClose) return; + if (self._readableState && !self._readableState.emitClose) return; + self.emit("close"); + } - if (!match) { - return null; + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; } - const [path, argument] = match[0].replace(/#! ?/, "").split(" "); - const binary = path.split("/").pop(); - - if (binary === "env") { - return argument; + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; } + } - return argument ? `${binary} ${argument}` : binary; - }; + function emitErrorNT(self, err) { + self.emit("error", err); + } - /***/ - }, + function errorOrDestroy(stream, err) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + var rState = stream._readableState; + var wState = stream._writableState; + if ((rState && rState.autoDestroy) || (wState && wState.autoDestroy)) + stream.destroy(err); + else stream.emit("error", err); + } - /***/ 11: /***/ (module) => { - module.exports = /^#!(.*)/; + module.exports = { + destroy: destroy, + undestroy: undestroy, + errorOrDestroy: errorOrDestroy, + }; /***/ }, - /***/ 3289: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - // Note: since nyc uses this module to output coverage, any lines - // that are in the direct sync flow of nyc's outputCoverage are - // ignored, since we can never get coverage for them. - // grab a reference to node's real process object right away - var process = global.process; - - const processOk = function (process) { - return ( - process && - typeof process === "object" && - typeof process.removeListener === "function" && - typeof process.emit === "function" && - typeof process.reallyExit === "function" && - typeof process.listeners === "function" && - typeof process.kill === "function" && - typeof process.pid === "number" && - typeof process.on === "function" - ); - }; - - // some kind of non-node environment, just no-op - /* istanbul ignore if */ - if (!processOk(process)) { - module.exports = function () { - return function () {}; - }; - } else { - var assert = __nccwpck_require__(9491); - var signals = __nccwpck_require__(3789); - var isWin = /^win/i.test(process.platform); - - var EE = __nccwpck_require__(2361); - /* istanbul ignore if */ - if (typeof EE !== "function") { - EE = EE.EventEmitter; - } + /***/ 5535: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Ported from https://github.com/mafintosh/end-of-stream with + // permission from the author, Mathias Buus (@mafintosh). - var emitter; - if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__; - } else { - emitter = process.__signal_exit_emitter__ = new EE(); - emitter.count = 0; - emitter.emitted = {}; - } + var ERR_STREAM_PREMATURE_CLOSE = + __nccwpck_require__(9859) /* .codes.ERR_STREAM_PREMATURE_CLOSE */.q + .ERR_STREAM_PREMATURE_CLOSE; - // Because this emitter is a global, we have to check to see if a - // previous version of this library failed to enable infinite listeners. - // I know what you're about to say. But literally everything about - // signal-exit is a compromise with evil. Get used to it. - if (!emitter.infinite) { - emitter.setMaxListeners(Infinity); - emitter.infinite = true; - } + function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; - module.exports = function (cb, opts) { - /* istanbul ignore if */ - if (!processOk(global.process)) { - return function () {}; + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; } - assert.equal( - typeof cb, - "function", - "a callback must be provided for exit handler" - ); - if (loaded === false) { - load(); - } + callback.apply(this, args); + }; + } - var ev = "exit"; - if (opts && opts.alwaysLast) { - ev = "afterexit"; - } + function noop() {} - var remove = function () { - emitter.removeListener(ev, cb); - if ( - emitter.listeners("exit").length === 0 && - emitter.listeners("afterexit").length === 0 - ) { - unload(); - } - }; - emitter.on(ev, cb); + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } - return remove; + function eos(stream, opts, callback) { + if (typeof opts === "function") return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = + opts.readable || (opts.readable !== false && stream.readable); + var writable = + opts.writable || (opts.writable !== false && stream.writable); + + var onlegacyfinish = function onlegacyfinish() { + if (!stream.writable) onfinish(); }; - var unload = function unload() { - if (!loaded || !processOk(global.process)) { - return; - } - loaded = false; + var writableEnded = + stream._writableState && stream._writableState.finished; - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]); - } catch (er) {} - }); - process.emit = originalProcessEmit; - process.reallyExit = originalProcessReallyExit; - emitter.count -= 1; + var onfinish = function onfinish() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); }; - module.exports.unload = unload; - var emit = function emit(event, code, signal) { - /* istanbul ignore if */ - if (emitter.emitted[event]) { - return; - } - emitter.emitted[event] = true; - emitter.emit(event, code, signal); - }; + var readableEnded = + stream._readableState && stream._readableState.endEmitted; - // { : , ... } - var sigListeners = {}; - signals.forEach(function (sig) { - sigListeners[sig] = function listener() { - /* istanbul ignore if */ - if (!processOk(global.process)) { - return; - } - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig); - if (listeners.length === emitter.count) { - unload(); - emit("exit", null, sig); - /* istanbul ignore next */ - emit("afterexit", null, sig); - /* istanbul ignore next */ - if (isWin && sig === "SIGHUP") { - // "SIGHUP" throws an `ENOSYS` error on Windows, - // so use a supported signal instead - sig = "SIGINT"; - } - /* istanbul ignore next */ - process.kill(process.pid, sig); - } - }; - }); + var onend = function onend() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; - module.exports.signals = function () { - return signals; + var onerror = function onerror(err) { + callback.call(stream, err); }; - var loaded = false; + var onclose = function onclose() { + var err; - var load = function load() { - if (loaded || !processOk(global.process)) { - return; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); } - loaded = true; - - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1; - - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]); - return true; - } catch (er) { - return false; - } - }); - process.emit = processEmit; - process.reallyExit = processReallyExit; + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } }; - module.exports.load = load; - var originalProcessReallyExit = process.reallyExit; - var processReallyExit = function processReallyExit(code) { - /* istanbul ignore if */ - if (!processOk(global.process)) { - return; - } - process.exitCode = code || /* istanbul ignore next */ 0; - emit("exit", process.exitCode, null); - /* istanbul ignore next */ - emit("afterexit", process.exitCode, null); - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode); + var onrequest = function onrequest() { + stream.req.on("finish", onfinish); }; - var originalProcessEmit = process.emit; - var processEmit = function processEmit(ev, arg) { - if (ev === "exit" && processOk(global.process)) { - /* istanbul ignore else */ - if (arg !== undefined) { - process.exitCode = arg; - } - var ret = originalProcessEmit.apply(this, arguments); - /* istanbul ignore next */ - emit("exit", process.exitCode, null); - /* istanbul ignore next */ - emit("afterexit", process.exitCode, null); - /* istanbul ignore next */ - return ret; - } else { - return originalProcessEmit.apply(this, arguments); - } + if (isRequest(stream)) { + stream.on("complete", onfinish); + stream.on("abort", onclose); + if (stream.req) onrequest(); + else stream.on("request", onrequest); + } else if (writable && !stream._writableState) { + // legacy streams + stream.on("end", onlegacyfinish); + stream.on("close", onlegacyfinish); + } + + stream.on("end", onend); + stream.on("finish", onfinish); + if (opts.error !== false) stream.on("error", onerror); + stream.on("close", onclose); + return function () { + stream.removeListener("complete", onfinish); + stream.removeListener("abort", onclose); + stream.removeListener("request", onrequest); + if (stream.req) stream.req.removeListener("finish", onfinish); + stream.removeListener("end", onlegacyfinish); + stream.removeListener("close", onlegacyfinish); + stream.removeListener("finish", onfinish); + stream.removeListener("end", onend); + stream.removeListener("error", onerror); + stream.removeListener("close", onclose); }; } + module.exports = eos; + /***/ }, - /***/ 3789: /***/ (module) => { - // This is not the set of all possible signals. - // - // It IS, however, the set of all signals that trigger - // an exit on either Linux or BSD systems. Linux is a - // superset of the signal names supported on BSD, and - // the unknown signals just fail to register, so we can - // catch that easily enough. - // - // Don't bother with SIGKILL. It's uncatchable, which - // means that we can't fire any callbacks anyway. - // - // If a user does happen to register a handler on a non- - // fatal signal like SIGWINCH or something, and then - // exit, it'll end up firing `process.emit('exit')`, so - // the handler will be fired anyway. - // - // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - // artificially, inherently leave the process in a - // state from which it is not safe to try and enter JS - // listeners. - module.exports = ["SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM"]; - - if (process.platform !== "win32") { - module.exports.push( - "SIGVTALRM", - "SIGXCPU", - "SIGXFSZ", - "SIGUSR2", - "SIGTRAP", - "SIGSYS", - "SIGQUIT", - "SIGIOT" - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); + /***/ 2290: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } } - if (process.platform === "linux") { - module.exports.push( - "SIGIO", - "SIGPOLL", - "SIGPWR", - "SIGSTKFLT", - "SIGUNUSED" - ); + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep( + gen, + resolve, + reject, + _next, + _throw, + "next", + value + ); + } + function _throw(err) { + asyncGeneratorStep( + gen, + resolve, + reject, + _next, + _throw, + "throw", + err + ); + } + _next(undefined); + }); + }; } - /***/ - }, - - /***/ 8684: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - var punycode = __nccwpck_require__(5477); - var mappingTable = __nccwpck_require__(1229); + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } - var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1, - }; + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties( + target, + Object.getOwnPropertyDescriptors(source) + ); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty( + target, + key, + Object.getOwnPropertyDescriptor(source, key) + ); + }); + } + } + return target; + } - function normalize(str) { - // fix bug in v8 - return str - .split("\u0000") - .map(function (s) { - return s.normalize("NFC"); - }) - .join("\u0000"); + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true, + }); + } else { + obj[key] = value; + } + return obj; } - function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; + var ERR_INVALID_ARG_TYPE = + __nccwpck_require__(9859) /* .codes.ERR_INVALID_ARG_TYPE */.q + .ERR_INVALID_ARG_TYPE; - while (start <= end) { - var mid = Math.floor((start + end) / 2); + function from(Readable, iterable, opts) { + var iterator; - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; + if (iterable && typeof iterable.next === "function") { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) + iterator = iterable[Symbol.asyncIterator](); + else if (iterable && iterable[Symbol.iterator]) + iterator = iterable[Symbol.iterator](); + else throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); + + var readable = new Readable( + _objectSpread( + { + objectMode: true, + }, + opts + ) + ); // Reading boolean to protect against _read + // being called before last iteration completion. + + var reading = false; + + readable._read = function () { + if (!reading) { + reading = true; + next(); } + }; + + function next() { + return _next2.apply(this, arguments); } - return null; + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _ref = yield iterator.next(), + value = _ref.value, + done = _ref.done; + + if (done) { + readable.push(null); + } else if (readable.push(yield value)) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); + } + + return readable; } - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + module.exports = from; - function countSymbols(string) { - return ( - // then get the length - string - // replace every surrogate pair with a BMP symbol - .replace(regexAstralSymbols, "_").length - ); + /***/ + }, + + /***/ 3444: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Ported from https://github.com/mafintosh/pump with + // permission from the author, Mathias Buus (@mafintosh). + + var eos; + + function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; } - function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; + var _require$codes = __nccwpck_require__(9859) /* .codes */.q, + ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - var len = countSymbols(domain_name); - for (var i = 0; i < len; ++i) { - var codePoint = domain_name.codePointAt(i); - var status = findStatus(codePoint); + function noop(err) { + // Rethrow the error if it exists to avoid swallowing it + if (err) throw err; + } - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); - } else { - processed += String.fromCodePoint.apply(String, status[2]); - } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; - } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } - processed += String.fromCodePoint(codePoint); - break; + function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on("close", function () { + closed = true; + }); + if (eos === undefined) eos = __nccwpck_require__(5535); + eos( + stream, + { + readable: reading, + writable: writing, + }, + function (err) { + if (err) return callback(err); + closed = true; + callback(); } - } - - return { - string: processed, - error: hasError, + ); + var destroyed = false; + return function (err) { + if (closed) return; + if (destroyed) return; + destroyed = true; // request.destroy just do .end - .abort is what we want + + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === "function") return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); }; } - var combiningMarksRegex = - /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; + function call(fn) { + fn(); + } - function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; - } + function pipe(from, to) { + return from.pipe(to); + } - var error = false; + function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== "function") return noop; + return streams.pop(); + } - if ( - normalize(label) !== label || - (label[3] === "-" && label[4] === "-") || - label[0] === "-" || - label[label.length - 1] === "-" || - label.indexOf(".") !== -1 || - label.search(combiningMarksRegex) === 0 + function pipeline() { + for ( + var _len = arguments.length, streams = new Array(_len), _key = 0; + _key < _len; + _key++ ) { - error = true; + streams[_key] = arguments[_key]; } - var len = countSymbols(label); - for (var i = 0; i < len; ++i) { - var status = findStatus(label.codePointAt(i)); - if ( - (processing === PROCESSING_OPTIONS.TRANSITIONAL && - status[1] !== "valid") || - (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && - status[1] !== "valid" && - status[1] !== "deviation") - ) { - error = true; - break; - } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); } - return { - label: label, - error: error, - }; + var error; + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); } - function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); + module.exports = pipeline; - var labels = result.string.split("."); - for (var i = 0; i < labels.length; ++i) { - try { - var validation = validateLabel(labels[i]); - labels[i] = validation.label; - result.error = result.error || validation.error; - } catch (e) { - result.error = true; - } - } + /***/ + }, - return { - string: labels.join("."), - error: result.error, - }; - } + /***/ 5267: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + var ERR_INVALID_OPT_VALUE = + __nccwpck_require__(9859) /* .codes.ERR_INVALID_OPT_VALUE */.q + .ERR_INVALID_OPT_VALUE; - module.exports.toASCII = function ( - domain_name, - useSTD3, - processing_option, - verifyDnsLength - ) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function (l) { - try { - return punycode.toASCII(l); - } catch (e) { - result.error = true; - return l; - } - }); + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null + ? options.highWaterMark + : isDuplex + ? options[duplexKey] + : null; + } - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - for (var i = 0; i < labels.length; ++i) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name, hwm); } - } - if (result.error) return null; - return labels.join("."); - }; + return Math.floor(hwm); + } // Default value - module.exports.toUnicode = function (domain_name, useSTD3) { - var result = processing( - domain_name, - useSTD3, - PROCESSING_OPTIONS.NONTRANSITIONAL - ); + return state.objectMode ? 16 : 16 * 1024; + } - return { - domain: result.string, - error: result.error, - }; + module.exports = { + getHighWaterMark: getHighWaterMark, }; - module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; - /***/ }, - /***/ 4249: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - module.exports = __nccwpck_require__(709); + /***/ 4001: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + module.exports = __nccwpck_require__(2781); /***/ }, - /***/ 709: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - var net = __nccwpck_require__(1808); - var tls = __nccwpck_require__(4404); - var http = __nccwpck_require__(3685); - var https = __nccwpck_require__(5687); - var events = __nccwpck_require__(2361); - var assert = __nccwpck_require__(9491); - var util = __nccwpck_require__(3837); + /***/ 5709: /***/ (module, exports, __nccwpck_require__) => { + var Stream = __nccwpck_require__(2781); + if (process.env.READABLE_STREAM === "disable" && Stream) { + module.exports = Stream.Readable; + Object.assign(module.exports, Stream); + module.exports.Stream = Stream; + } else { + exports = module.exports = __nccwpck_require__(3522); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(268); + exports.Duplex = __nccwpck_require__(8349); + exports.Transform = __nccwpck_require__(5152); + exports.PassThrough = __nccwpck_require__(9165); + exports.finished = __nccwpck_require__(5535); + exports.pipeline = __nccwpck_require__(3444); + } - exports.httpOverHttp = httpOverHttp; - exports.httpsOverHttp = httpsOverHttp; - exports.httpOverHttps = httpOverHttps; - exports.httpsOverHttps = httpsOverHttps; + /***/ + }, - function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; - } + /***/ 6053: /***/ (module, exports, __nccwpck_require__) => { + /*! safe-buffer. MIT License. Feross Aboukhadijeh */ + /* eslint-disable node/no-deprecated-api */ + var buffer = __nccwpck_require__(4300); + var Buffer = buffer.Buffer; - function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; + // alternative to using Object.keys for old browsers + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } } - - function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; + if ( + Buffer.from && + Buffer.alloc && + Buffer.allocUnsafe && + Buffer.allocUnsafeSlow + ) { + module.exports = buffer; + } else { + // Copy properties from require('buffer') + copyProps(buffer, exports); + exports.Buffer = SafeBuffer; } - function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length); } - function TunnelingAgent(options) { - var self = this; - self.options = options || {}; - self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; - self.requests = []; - self.sockets = []; + SafeBuffer.prototype = Object.create(Buffer.prototype); - self.on("free", function onFree(socket, host, port, localAddress) { - var options = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options.host && pending.port === options.port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } + // Copy static methods from Buffer + copyProps(Buffer, SafeBuffer); + + SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer(arg, encodingOrOffset, length); + }; + + SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer(size); + if (fill !== undefined) { + if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); } - socket.destroy(); - self.removeSocket(socket); - }); - } - util.inherits(TunnelingAgent, events.EventEmitter); + } else { + buf.fill(0); + } + return buf; + }; - TunnelingAgent.prototype.addRequest = function addRequest( - req, - host, - port, - localAddress - ) { - var self = this; - var options = mergeOptions( - { request: req }, - self.options, - toOptions(host, port, localAddress) - ); + SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer(size); + }; - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push(options); - return; + SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); } + return buffer.SlowBuffer(size); + }; - // If we are under maxSockets create a new one. - self.createSocket(options, function (socket) { - socket.on("free", onFree); - socket.on("close", onCloseOrRemove); - socket.on("agentRemove", onCloseOrRemove); - req.onSocket(socket); + /***/ + }, - function onFree() { - self.emit("free", socket, options); - } + /***/ 5955: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const ANY = Symbol("SemVer ANY"); + // hoisted class for cyclic dependency + class Comparator { + static get ANY() { + return ANY; + } - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener("free", onFree); - socket.removeListener("close", onCloseOrRemove); - socket.removeListener("agentRemove", onCloseOrRemove); + constructor(comp, options) { + options = parseOptions(options); + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } } - }); - }; - TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); + debug("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); - var connectOptions = mergeOptions({}, self.proxyOptions, { - method: "CONNECT", - path: options.host + ":" + options.port, - agent: false, - headers: { - host: options.host + ":" + options.port, - }, - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers["Proxy-Authorization"] = - "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + + debug("comp", this); } - debug("making CONNECT request"); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; // for v0.6 - connectReq.once("response", onResponse); // for v0.6 - connectReq.once("upgrade", onUpgrade); // for v0.6 - connectReq.once("connect", onConnect); // for v0.7 or later - connectReq.once("error", onError); - connectReq.end(); + parse(comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + const m = comp.match(r); - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true; + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + + this.operator = m[1] !== undefined ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m[2], this.options.loose); + } } - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function () { - onConnect(res, socket, head); - }); + toString() { + return this.value; } - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); + test(version) { + debug("Comparator.test", version, this.options.loose); - if (res.statusCode !== 200) { - debug( - "tunneling socket could not be established, statusCode=%d", - res.statusCode - ); - socket.destroy(); - var error = new Error( - "tunneling socket could not be established, " + - "statusCode=" + - res.statusCode - ); - error.code = "ECONNRESET"; - options.request.emit("error", error); - self.removeSocket(placeholder); - return; - } - if (head.length > 0) { - debug("got illegal response body from proxy"); - socket.destroy(); - var error = new Error("got illegal response body from proxy"); - error.code = "ECONNRESET"; - options.request.emit("error", error); - self.removeSocket(placeholder); - return; + if (this.semver === ANY || version === ANY) { + return true; } - debug("tunneling connection has established"); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } - function onError(cause) { - connectReq.removeAllListeners(); + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } - debug( - "tunneling socket could not be established, cause=%s\n", - cause.message, - cause.stack - ); - var error = new Error( - "tunneling socket could not be established, " + - "cause=" + - cause.message - ); - error.code = "ECONNRESET"; - options.request.emit("error", error); - self.removeSocket(placeholder); + return cmp(version, this.operator, this.semver, this.options); } - }; - TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket); - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); + intersects(comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError("a Comparator is required"); + } - var pending = this.requests.shift(); - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function (socket) { - pending.request.onSocket(socket); - }); - } - }; + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; + } + return new Range(this.value, options).test(comp.semver); + } - function createSecureSocket(options, cb) { - var self = this; - TunnelingAgent.prototype.createSocket.call( - self, - options, - function (socket) { - var hostHeader = options.request.getHeader("host"); - var tlsOptions = mergeOptions({}, self.options, { - socket: socket, - servername: hostHeader - ? hostHeader.replace(/:.*$/, "") - : options.host, - }); + options = parseOptions(options); - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); + // Special cases where nothing can possibly be lower + if ( + options.includePrerelease && + (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0") + ) { + return false; + } + if ( + !options.includePrerelease && + (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0")) + ) { + return false; } - ); - } - - function toOptions(host, port, localAddress) { - if (typeof host === "string") { - // since v0.10 - return { - host: host, - port: port, - localAddress: localAddress, - }; - } - return host; // for v0.11 or later - } - function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === "object") { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== undefined) { - target[k] = overrides[k]; - } - } + // Same direction increasing (> or >=) + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + this.semver.version === comp.semver.version && + this.operator.includes("=") && + comp.operator.includes("=") + ) { + return true; + } + // opposite directions less than + if ( + cmp(this.semver, "<", comp.semver, options) && + this.operator.startsWith(">") && + comp.operator.startsWith("<") + ) { + return true; + } + // opposite directions greater than + if ( + cmp(this.semver, ">", comp.semver, options) && + this.operator.startsWith("<") && + comp.operator.startsWith(">") + ) { + return true; } + return false; } - return target; } - var debug; - if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === "string") { - args[0] = "TUNNEL: " + args[0]; - } else { - args.unshift("TUNNEL:"); - } - console.error.apply(console, args); - }; - } else { - debug = function () {}; - } - exports.debug = debug; // for test + module.exports = Comparator; + + const parseOptions = __nccwpck_require__(9723); + const { re, t } = __nccwpck_require__(5041); + const cmp = __nccwpck_require__(9401); + const debug = __nccwpck_require__(5566); + const SemVer = __nccwpck_require__(3215); + const Range = __nccwpck_require__(8023); /***/ }, - /***/ 494: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { value: true }); - - function _interopDefault(ex) { - return ex && typeof ex === "object" && "default" in ex - ? ex["default"] - : ex; - } + /***/ 8023: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // hoisted class for cyclic dependency + class Range { + constructor(range, options) { + options = parseOptions(options); - var jsonwebtoken = _interopDefault(__nccwpck_require__(245)); + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range; + } else { + return new Range(range.raw, options); + } + } - async function getToken({ privateKey, payload }) { - return jsonwebtoken.sign(payload, privateKey, { - algorithm: "RS256", - }); - } + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value; + this.set = [[range]]; + this.format(); + return this; + } - async function githubAppJwt({ - id, - privateKey, - now = Math.floor(Date.now() / 1000), - }) { - // When creating a JSON Web Token, it sets the "issued at time" (iat) to 30s - // in the past as we have seen people running situations where the GitHub API - // claimed the iat would be in future. It turned out the clocks on the - // different machine were not in sync. - const nowWithSafetyMargin = now - 30; - const expiration = nowWithSafetyMargin + 60 * 10; // JWT expiration time (10 minute maximum) - const payload = { - iat: nowWithSafetyMargin, - exp: expiration, - iss: id, - }; - const token = await getToken({ - privateKey, - payload, - }); - return { - appId: id, - expiration, - token, - }; - } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; - exports.githubAppJwt = githubAppJwt; - //# sourceMappingURL=index.js.map + // First, split based on boolean or || + this.raw = range; + this.set = range + .split("||") + // map the range to a 2d array of comparators + .map((r) => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter((c) => c.length); - /***/ - }, + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${range}`); + } - /***/ 4930: /***/ (__unused_webpack_module, exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0]; + this.set = this.set.filter((c) => !isNullSet(c[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c]; + break; + } + } + } + } - function getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; + this.format(); } - if (typeof process === "object" && "version" in process) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${ - process.arch - })`; + format() { + this.range = this.set + .map((comps) => { + return comps.join(" ").trim(); + }) + .join("||") + .trim(); + return this.range; } - return ""; - } - - exports.getUserAgent = getUserAgent; - //# sourceMappingURL=index.js.map - - /***/ - }, + toString() { + return this.range; + } - /***/ 2033: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - Object.defineProperty(exports, "v1", { - enumerable: true, - get: function () { - return _v.default; - }, - }); - Object.defineProperty(exports, "v3", { - enumerable: true, - get: function () { - return _v2.default; - }, - }); - Object.defineProperty(exports, "v4", { - enumerable: true, - get: function () { - return _v3.default; - }, - }); - Object.defineProperty(exports, "v5", { - enumerable: true, - get: function () { - return _v4.default; - }, - }); - Object.defineProperty(exports, "NIL", { - enumerable: true, - get: function () { - return _nil.default; - }, - }); - Object.defineProperty(exports, "version", { - enumerable: true, - get: function () { - return _version.default; - }, - }); - Object.defineProperty(exports, "validate", { - enumerable: true, - get: function () { - return _validate.default; - }, - }); - Object.defineProperty(exports, "stringify", { - enumerable: true, - get: function () { - return _stringify.default; - }, - }); - Object.defineProperty(exports, "parse", { - enumerable: true, - get: function () { - return _parse.default; - }, - }); + parseRange(range) { + range = range.trim(); - var _v = _interopRequireDefault(__nccwpck_require__(9370)); + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache.get(memoKey); + if (cached) { + return cached; + } - var _v2 = _interopRequireDefault(__nccwpck_require__(8638)); + const loose = this.options.loose; + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace( + hr, + hyphenReplace(this.options.includePrerelease) + ); + debug("hyphen replace", range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug("comparator trim", range); - var _v3 = _interopRequireDefault(__nccwpck_require__(3519)); + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); - var _v4 = _interopRequireDefault(__nccwpck_require__(8239)); + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace); - var _nil = _interopRequireDefault(__nccwpck_require__(680)); + // normalize spaces + range = range.split(/\s+/).join(" "); - var _version = _interopRequireDefault(__nccwpck_require__(3609)); + // At this point, the range is completely trimmed and + // ready to be split into comparators. - var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + let rangeList = range + .split(" ") + .map((comp) => parseComparator(comp, this.options)) + .join(" ") + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map((comp) => replaceGTE0(comp, this.options)); - var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter((comp) => { + debug("loose invalid filter", comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + }); + } + debug("range list", rangeList); - var _parse = _interopRequireDefault(__nccwpck_require__(8951)); + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map(); + const comparators = rangeList.map( + (comp) => new Comparator(comp, this.options) + ); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; + } + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + const result = [...rangeMap.values()]; + cache.set(memoKey, result); + return result; + } - /***/ - }, + intersects(range, options) { + if (!(range instanceof Range)) { + throw new TypeError("a Range is required"); + } - /***/ 7276: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }) + ); + }) + ); + }); + } - var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + // if ANY of the sets match ALL of its comparators, then pass + test(version) { + if (!version) { + return false; + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } - function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true; + } + } + return false; } - - return _crypto.default.createHash("md5").update(bytes).digest(); } - var _default = md5; - exports["default"] = _default; - - /***/ - }, + module.exports = Range; - /***/ 680: /***/ (__unused_webpack_module, exports) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; - var _default = "00000000-0000-0000-0000-000000000000"; - exports["default"] = _default; + const LRU = __nccwpck_require__(4965); + const cache = new LRU({ max: 1000 }); - /***/ - }, + const parseOptions = __nccwpck_require__(9723); + const Comparator = __nccwpck_require__(5955); + const debug = __nccwpck_require__(5566); + const SemVer = __nccwpck_require__(3215); + const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = + __nccwpck_require__(5041); + const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(886); - /***/ 8951: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + const isNullSet = (c) => c.value === "<0.0.0-0"; + const isAny = (c) => c.value === ""; - var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + // take a set of comparators and determine whether there + // exists a version which can satisfy it + const isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); - function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError("Invalid UUID"); + testComparator = remainingComparators.pop(); } - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = (v >>> 16) & 0xff; - arr[2] = (v >>> 8) & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ + return result; + }; - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + // comprised of xranges, tildes, stars, and gtlt's at this point. + // already replaced the hyphen ranges + // turn into a set of JUST comparators. + const parseComparator = (comp, options) => { + debug("comp", comp, options); + comp = replaceCarets(comp, options); + debug("caret", comp); + comp = replaceTildes(comp, options); + debug("tildes", comp); + comp = replaceXRanges(comp, options); + debug("xrange", comp); + comp = replaceStars(comp, options); + debug("stars", comp); + return comp; + }; - arr[10] = ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff; - arr[11] = (v / 0x100000000) & 0xff; - arr[12] = (v >>> 24) & 0xff; - arr[13] = (v >>> 16) & 0xff; - arr[14] = (v >>> 8) & 0xff; - arr[15] = v & 0xff; - return arr; - } + const isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; - var _default = parse; - exports["default"] = _default; + // ~, ~> --> * (any, kinda silly) + // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 + // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 + // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 + // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 + // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 + // ~0.0.1 --> >=0.0.1 <0.1.0-0 + const replaceTildes = (comp, options) => + comp + .trim() + .split(/\s+/) + .map((c) => { + return replaceTilde(c, options); + }) + .join(" "); - /***/ - }, + const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + return comp.replace(r, (_, M, m, p, pr) => { + debug("tilde", comp, _, M, m, p, pr); + let ret; - /***/ 646: /***/ (__unused_webpack_module, exports) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; - var _default = - /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - exports["default"] = _default; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug("replaceTilde pr", pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } - /***/ - }, + debug("tilde return", ret); + return ret; + }); + }; - /***/ 7548: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = rng; + // ^ --> * (any, kinda silly) + // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 + // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 + // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 + // ^1.2.3 --> >=1.2.3 <2.0.0-0 + // ^1.2.0 --> >=1.2.0 <2.0.0-0 + // ^0.0.1 --> >=0.0.1 <0.0.2-0 + // ^0.1.0 --> >=0.1.0 <0.2.0-0 + const replaceCarets = (comp, options) => + comp + .trim() + .split(/\s+/) + .map((c) => { + return replaceCaret(c, options); + }) + .join(" "); - var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + const replaceCaret = (comp, options) => { + debug("caret", comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug("caret", comp, _, M, m, p, pr); + let ret; - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + if (M === "0") { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug("replaceCaret pr", pr); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug("no pr"); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } - const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + debug("caret return", ret); + return ret; + }); + }; - let poolPtr = rnds8Pool.length; + const replaceXRanges = (comp, options) => { + debug("replaceXRanges", comp, options); + return comp + .split(/\s+/) + .map((c) => { + return replaceXRange(c, options); + }) + .join(" "); + }; - function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); + const replaceXRange = (comp, options) => { + comp = comp.trim(); + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug("xRange", comp, ret, gtlt, M, m, p, pr); + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; - poolPtr = 0; - } + if (gtlt === "=" && anyX) { + gtlt = ""; + } - return rnds8Pool.slice(poolPtr, (poolPtr += 16)); - } + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? "-0" : ""; - /***/ - }, + if (xM) { + if (gtlt === ">" || gtlt === "<") { + // nothing is allowed + ret = "<0.0.0-0"; + } else { + // nothing is forbidden + ret = "*"; + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0; + } + p = 0; - /***/ 3557: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + if (gtlt === ">") { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = ">="; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === "<=") { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; + } + } - var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + if (gtlt === "<") { + pr = "-0"; + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + ret = `${gtlt + M}.${m}.${p}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + } - function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } + debug("xRange return", ret); - return _crypto.default.createHash("sha1").update(bytes).digest(); - } + return ret; + }); + }; - var _default = sha1; - exports["default"] = _default; + // Because * is AND-ed with everything else in the comparator, + // and '' means "any version", just remove the *s entirely. + const replaceStars = (comp, options) => { + debug("replaceStars", comp, options); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], ""); + }; - /***/ - }, + const replaceGTE0 = (comp, options) => { + debug("replaceGTE0", comp, options); + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); + }; - /***/ 9729: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + // This function is passed to string.replace(re[t.HYPHENRANGE]) + // M, m, patch, prerelease, build + // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 + // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do + // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 + const hyphenReplace = + (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } - var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + return `${from} ${to}`.trim(); + }; - /** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - const byteToHex = []; + const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false; + } + } - for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); - } + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === Comparator.ANY) { + continue; + } - function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = ( - byteToHex[arr[offset + 0]] + - byteToHex[arr[offset + 1]] + - byteToHex[arr[offset + 2]] + - byteToHex[arr[offset + 3]] + - "-" + - byteToHex[arr[offset + 4]] + - byteToHex[arr[offset + 5]] + - "-" + - byteToHex[arr[offset + 6]] + - byteToHex[arr[offset + 7]] + - "-" + - byteToHex[arr[offset + 8]] + - byteToHex[arr[offset + 9]] + - "-" + - byteToHex[arr[offset + 10]] + - byteToHex[arr[offset + 11]] + - byteToHex[arr[offset + 12]] + - byteToHex[arr[offset + 13]] + - byteToHex[arr[offset + 14]] + - byteToHex[arr[offset + 15]] - ).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver; + if ( + allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch + ) { + return true; + } + } + } - if (!(0, _validate.default)(uuid)) { - throw TypeError("Stringified UUID is invalid"); + // Version has a -pre, but it's not one of the ones we like. + return false; } - return uuid; - } - - var _default = stringify; - exports["default"] = _default; + return true; + }; /***/ }, - /***/ 9370: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + /***/ 3215: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const debug = __nccwpck_require__(5566); + const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(886); + const { re, t } = __nccwpck_require__(5041); - var _rng = _interopRequireDefault(__nccwpck_require__(7548)); + const parseOptions = __nccwpck_require__(9723); + const { compareIdentifiers } = __nccwpck_require__(2741); + class SemVer { + constructor(version, options) { + options = parseOptions(options); - var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + if (version instanceof SemVer) { + if ( + version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease + ) { + return version; + } else { + version = version.version; + } + } else if (typeof version !== "string") { + throw new TypeError( + `Invalid Version: ${__nccwpck_require__(3837).inspect(version)}` + ); + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } - // **`v1()` - Generate time-based UUID** - // - // Inspired by https://github.com/LiosK/UUID.js - // and http://docs.python.org/library/uuid.html - let _nodeId; + debug("SemVer", version, options); + this.options = options; + this.loose = !!options.loose; + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease; - let _clockseq; // Previous uuid creation time + const m = version + .trim() + .match(options.loose ? re[t.LOOSE] : re[t.FULL]); - let _lastMSecs = 0; - let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + if (!m) { + throw new TypeError(`Invalid Version: ${version}`); + } - function v1(options, buf, offset) { - let i = (buf && offset) || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = - options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 + this.raw = version; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [ - seedBytes[0] | 0x01, - seedBytes[1], - seedBytes[2], - seedBytes[3], - seedBytes[4], - seedBytes[5], - ]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); } - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = ((seedBytes[6] << 8) | seedBytes[7]) & 0x3fff; + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } - if (dt < 0 && options.clockseq === undefined) { - clockseq = (clockseq + 1) & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested + this.build = m[5] ? m[5].split(".") : []; + this.format(); + } - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + toString() { + return this.version; + } - msecs += 12219292800000; // `time_low` + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new SemVer(other, this.options); + } - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = (tl >>> 24) & 0xff; - b[i++] = (tl >>> 16) & 0xff; - b[i++] = (tl >>> 8) & 0xff; - b[i++] = tl & 0xff; // `time_mid` + if (other.version === this.version) { + return 0; + } - const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; - b[i++] = (tmh >>> 8) & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` + return this.compareMain(other) || this.comparePre(other); + } - b[i++] = ((tmh >>> 24) & 0xf) | 0x10; // include version + compareMain(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } - b[i++] = (tmh >>> 16) & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ); + } - b[i++] = (clockseq >>> 8) | 0x80; // `clock_seq_low` + comparePre(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } - b[i++] = clockseq & 0xff; // `node` + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug("prerelease compare", i, a, b); + if (a === undefined && b === undefined) { + return 0; + } else if (b === undefined) { + return 1; + } else if (a === undefined) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); } - return buf || (0, _stringify.default)(b); - } - - var _default = v1; - exports["default"] = _default; + compareBuild(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } - /***/ - }, + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug("prerelease compare", i, a, b); + if (a === undefined && b === undefined) { + return 0; + } else if (b === undefined) { + return 1; + } else if (a === undefined) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } - /***/ 8638: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; - var _v = _interopRequireDefault(__nccwpck_require__(6694)); + case "major": + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; - var _md = _interopRequireDefault(__nccwpck_require__(7276)); + if (!identifier && identifierBase === false) { + throw new Error( + "invalid increment argument: identifier is empty" + ); + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + // didn't increment anything + if ( + identifier === this.prerelease.join(".") && + identifierBase === false + ) { + throw new Error( + "invalid increment argument: identifier already exists" + ); + } + this.prerelease.push(base); + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.format(); + this.raw = this.version; + return this; + } } - const v3 = (0, _v.default)("v3", 0x30, _md.default); - var _default = v3; - exports["default"] = _default; + module.exports = SemVer; /***/ }, - /***/ 6694: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = _default; - exports.URL = exports.DNS = void 0; + /***/ 8773: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const parse = __nccwpck_require__(3818); + const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; + }; + module.exports = clean; - var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + /***/ + }, - var _parse = _interopRequireDefault(__nccwpck_require__(8951)); + /***/ 9401: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const eq = __nccwpck_require__(3315); + const neq = __nccwpck_require__(1831); + const gt = __nccwpck_require__(562); + const gte = __nccwpck_require__(6650); + const lt = __nccwpck_require__(1417); + const lte = __nccwpck_require__(7545); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + const cmp = (a, op, b, loose) => { + switch (op) { + case "===": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a === b; - function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape + case "!==": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a !== b; - const bytes = []; + case "": + case "=": + case "==": + return eq(a, b, loose); - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } + case "!=": + return neq(a, b, loose); - return bytes; - } + case ">": + return gt(a, b, loose); - const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - exports.DNS = DNS; - const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - exports.URL = URL; + case ">=": + return gte(a, b, loose); - function _default(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === "string") { - value = stringToBytes(value); - } + case "<": + return lt(a, b, loose); - if (typeof namespace === "string") { - namespace = (0, _parse.default)(namespace); - } + case "<=": + return lte(a, b, loose); - if (namespace.length !== 16) { - throw TypeError( - "Namespace must be array-like (16 iterable integer values, 0-255)" - ); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` + default: + throw new TypeError(`Invalid operator: ${op}`); + } + }; + module.exports = cmp; - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = (bytes[6] & 0x0f) | version; - bytes[8] = (bytes[8] & 0x3f) | 0x80; + /***/ + }, - if (buf) { - offset = offset || 0; + /***/ 2431: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const parse = __nccwpck_require__(3818); + const { re, t } = __nccwpck_require__(5041); - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } + const coerce = (version, options) => { + if (version instanceof SemVer) { + return version; + } - return buf; + if (typeof version === "number") { + version = String(version); + } + + if (typeof version !== "string") { + return null; + } + + options = options || {}; + + let match = null; + if (!options.rtl) { + match = version.match(re[t.COERCE]); + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next; + while ( + (next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if ( + !match || + next.index + next[0].length !== match.index + match[0].length + ) { + match = next; + } + re[t.COERCERTL].lastIndex = + next.index + next[1].length + next[2].length; } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1; + } - return (0, _stringify.default)(bytes); - } // Function#name is not settable on some platforms (#270) + if (match === null) { + return null; + } - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support + return parse( + `${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, + options + ); + }; + module.exports = coerce; - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; - } + /***/ + }, + + /***/ 4562: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose); + const versionB = new SemVer(b, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); + }; + module.exports = compareBuild; /***/ }, - /***/ 3519: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + /***/ 1213: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const compareLoose = (a, b) => compare(a, b, true); + module.exports = compareLoose; - var _rng = _interopRequireDefault(__nccwpck_require__(7548)); + /***/ + }, - var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); + /***/ 2812: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + module.exports = compare; - function v4(options, buf, offset) { - options = options || {}; + /***/ + }, - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + /***/ 9385: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const parse = __nccwpck_require__(3818); - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided + const diff = (version1, version2) => { + const v1 = parse(version1, null, true); + const v2 = parse(version2, null, true); + const comparison = v1.compare(v2); - if (buf) { - offset = offset || 0; + if (comparison === 0) { + return null; + } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v1 : v2; + const lowVersion = v1Higher ? v2 : v1; + const highHasPre = !!highVersion.prerelease.length; - return buf; + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? "pre" : ""; + + if (v1.major !== v2.major) { + return prefix + "major"; } - return (0, _stringify.default)(rnds); - } + if (v1.minor !== v2.minor) { + return prefix + "minor"; + } - var _default = v4; - exports["default"] = _default; + if (v1.patch !== v2.patch) { + return prefix + "patch"; + } - /***/ - }, + // at this point we know stable versions match but overall versions are not equal, + // so either they are both prereleases, or the lower version is a prerelease - /***/ 8239: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + if (highHasPre) { + // high and low are preleases + return "prerelease"; + } - var _v = _interopRequireDefault(__nccwpck_require__(6694)); + if (lowVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return "patch"; + } - var _sha = _interopRequireDefault(__nccwpck_require__(3557)); + if (lowVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return "minor"; + } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + // bumping major/minor/patch all have same result + return "major"; + }; - const v5 = (0, _v.default)("v5", 0x50, _sha.default); - var _default = v5; - exports["default"] = _default; + module.exports = diff; /***/ }, - /***/ 6009: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; + /***/ 3315: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const eq = (a, b, loose) => compare(a, b, loose) === 0; + module.exports = eq; - var _regex = _interopRequireDefault(__nccwpck_require__(646)); + /***/ + }, - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + /***/ 562: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const gt = (a, b, loose) => compare(a, b, loose) > 0; + module.exports = gt; - function validate(uuid) { - return typeof uuid === "string" && _regex.default.test(uuid); - } + /***/ + }, - var _default = validate; - exports["default"] = _default; + /***/ 6650: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const gte = (a, b, loose) => compare(a, b, loose) >= 0; + module.exports = gte; /***/ }, - /***/ 3609: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports["default"] = void 0; - - var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + /***/ 2344: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } + const inc = (version, release, options, identifier, identifierBase) => { + if (typeof options === "string") { + identifierBase = identifier; + identifier = options; + options = undefined; + } - function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError("Invalid UUID"); + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version; + } catch (er) { + return null; } - - return parseInt(uuid.substr(14, 1), 16); - } - - var _default = version; - exports["default"] = _default; + }; + module.exports = inc; /***/ }, - /***/ 7027: /***/ (module) => { - var conversions = {}; - module.exports = conversions; - - function sign(x) { - return x < 0 ? -1 : 1; - } - - function evenRound(x) { - // Round x to the nearest integer, choosing the even integer if it lies halfway between two. - if (x % 1 === 0.5 && (x & 1) === 0) { - // [even number].5; round down (i.e. floor) - return Math.floor(x); - } else { - return Math.round(x); - } - } + /***/ 1417: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const lt = (a, b, loose) => compare(a, b, loose) < 0; + module.exports = lt; - function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; + /***/ + }, - const moduloVal = typeOpts.moduloBitLength - ? Math.pow(2, typeOpts.moduloBitLength) - : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength - ? Math.pow(2, typeOpts.moduloBitLength - 1) - : Math.pow(2, bitLength - 1); + /***/ 7545: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const lte = (a, b, loose) => compare(a, b, loose) <= 0; + module.exports = lte; - return function (V, opts) { - if (!opts) opts = {}; + /***/ + }, - let x = +V; + /***/ 7867: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const major = (a, loose) => new SemVer(a, loose).major; + module.exports = major; - if (opts.enforceRange) { - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite number"); - } + /***/ + }, - x = sign(x) * Math.floor(Math.abs(x)); - if (x < lowerBound || x > upperBound) { - throw new TypeError("Argument is not in byte range"); - } + /***/ 6670: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const minor = (a, loose) => new SemVer(a, loose).minor; + module.exports = minor; - return x; - } + /***/ + }, - if (!isNaN(x) && opts.clamp) { - x = evenRound(x); + /***/ 1831: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const neq = (a, b, loose) => compare(a, b, loose) !== 0; + module.exports = neq; - if (x < lowerBound) x = lowerBound; - if (x > upperBound) x = upperBound; - return x; - } + /***/ + }, - if (!Number.isFinite(x) || x === 0) { - return 0; + /***/ 3818: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version; + } + try { + return new SemVer(version, options); + } catch (er) { + if (!throwErrors) { + return null; } + throw er; + } + }; - x = sign(x) * Math.floor(Math.abs(x)); - x = x % moduloVal; + module.exports = parse; - if (!typeOpts.unsigned && x >= moduloBound) { - return x - moduloVal; - } else if (typeOpts.unsigned) { - if (x < 0) { - x += moduloVal; - } else if (x === -0) { - // don't return negative zero - return 0; - } - } + /***/ + }, - return x; - }; - } + /***/ 4030: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const patch = (a, loose) => new SemVer(a, loose).patch; + module.exports = patch; - conversions["void"] = function () { - return undefined; - }; + /***/ + }, - conversions["boolean"] = function (val) { - return !!val; + /***/ 7281: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const parse = __nccwpck_require__(3818); + const prerelease = (version, options) => { + const parsed = parse(version, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; + module.exports = prerelease; - conversions["byte"] = createNumberConversion(8, { unsigned: false }); - conversions["octet"] = createNumberConversion(8, { unsigned: true }); - - conversions["short"] = createNumberConversion(16, { unsigned: false }); - conversions["unsigned short"] = createNumberConversion(16, { - unsigned: true, - }); - - conversions["long"] = createNumberConversion(32, { unsigned: false }); - conversions["unsigned long"] = createNumberConversion(32, { - unsigned: true, - }); - - conversions["long long"] = createNumberConversion(32, { - unsigned: false, - moduloBitLength: 64, - }); - conversions["unsigned long long"] = createNumberConversion(32, { - unsigned: true, - moduloBitLength: 64, - }); + /***/ + }, - conversions["double"] = function (V) { - const x = +V; + /***/ 3302: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compare = __nccwpck_require__(2812); + const rcompare = (a, b, loose) => compare(b, a, loose); + module.exports = rcompare; - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite floating-point value"); - } + /***/ + }, - return x; - }; + /***/ 7280: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compareBuild = __nccwpck_require__(4562); + const rsort = (list, loose) => + list.sort((a, b) => compareBuild(b, a, loose)); + module.exports = rsort; - conversions["unrestricted double"] = function (V) { - const x = +V; + /***/ + }, - if (isNaN(x)) { - throw new TypeError("Argument is NaN"); + /***/ 6495: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const Range = __nccwpck_require__(8023); + const satisfies = (version, range, options) => { + try { + range = new Range(range, options); + } catch (er) { + return false; } - - return x; + return range.test(version); }; + module.exports = satisfies; - // not quite valid, but good enough for JS - conversions["float"] = conversions["double"]; - conversions["unrestricted float"] = conversions["unrestricted double"]; + /***/ + }, - conversions["DOMString"] = function (V, opts) { - if (!opts) opts = {}; + /***/ 1429: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const compareBuild = __nccwpck_require__(4562); + const sort = (list, loose) => + list.sort((a, b) => compareBuild(a, b, loose)); + module.exports = sort; - if (opts.treatNullAsEmptyString && V === null) { - return ""; - } + /***/ + }, - return String(V); + /***/ 7185: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const parse = __nccwpck_require__(3818); + const valid = (version, options) => { + const v = parse(version, options); + return v ? v.version : null; }; + module.exports = valid; - conversions["ByteString"] = function (V, opts) { - const x = String(V); - let c = undefined; - for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { - if (c > 255) { - throw new TypeError("Argument is not a valid bytestring"); - } - } + /***/ + }, - return x; + /***/ 815: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // just pre-load all the stuff that index.js lazily exports + const internalRe = __nccwpck_require__(5041); + const constants = __nccwpck_require__(886); + const SemVer = __nccwpck_require__(3215); + const identifiers = __nccwpck_require__(2741); + const parse = __nccwpck_require__(3818); + const valid = __nccwpck_require__(7185); + const clean = __nccwpck_require__(8773); + const inc = __nccwpck_require__(2344); + const diff = __nccwpck_require__(9385); + const major = __nccwpck_require__(7867); + const minor = __nccwpck_require__(6670); + const patch = __nccwpck_require__(4030); + const prerelease = __nccwpck_require__(7281); + const compare = __nccwpck_require__(2812); + const rcompare = __nccwpck_require__(3302); + const compareLoose = __nccwpck_require__(1213); + const compareBuild = __nccwpck_require__(4562); + const sort = __nccwpck_require__(1429); + const rsort = __nccwpck_require__(7280); + const gt = __nccwpck_require__(562); + const lt = __nccwpck_require__(1417); + const eq = __nccwpck_require__(3315); + const neq = __nccwpck_require__(1831); + const gte = __nccwpck_require__(6650); + const lte = __nccwpck_require__(7545); + const cmp = __nccwpck_require__(9401); + const coerce = __nccwpck_require__(2431); + const Comparator = __nccwpck_require__(5955); + const Range = __nccwpck_require__(8023); + const satisfies = __nccwpck_require__(6495); + const toComparators = __nccwpck_require__(6479); + const maxSatisfying = __nccwpck_require__(7024); + const minSatisfying = __nccwpck_require__(8252); + const minVersion = __nccwpck_require__(7234); + const validRange = __nccwpck_require__(4226); + const outside = __nccwpck_require__(1581); + const gtr = __nccwpck_require__(5774); + const ltr = __nccwpck_require__(4955); + const intersects = __nccwpck_require__(7916); + const simplifyRange = __nccwpck_require__(1144); + const subset = __nccwpck_require__(7464); + module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, }; - conversions["USVString"] = function (V) { - const S = String(V); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 0xd800 || c > 0xdfff) { - U.push(String.fromCodePoint(c)); - } else if (0xdc00 <= c && c <= 0xdfff) { - U.push(String.fromCodePoint(0xfffd)); - } else { - if (i === n - 1) { - U.push(String.fromCodePoint(0xfffd)); - } else { - const d = S.charCodeAt(i + 1); - if (0xdc00 <= d && d <= 0xdfff) { - const a = c & 0x3ff; - const b = d & 0x3ff; - U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); - ++i; - } else { - U.push(String.fromCodePoint(0xfffd)); - } - } - } - } + /***/ + }, - return U.join(""); - }; + /***/ 886: /***/ (module) => { + // Note: this is the semver.org version of the spec that it implements + // Not necessarily the package version of this code. + const SEMVER_SPEC_VERSION = "2.0.0"; - conversions["Date"] = function (V, opts) { - if (!(V instanceof Date)) { - throw new TypeError("Argument is not a Date object"); - } - if (isNaN(V)) { - return undefined; - } + const MAX_LENGTH = 256; + const MAX_SAFE_INTEGER = + Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991; - return V; - }; + // Max safe segment length for coercion. + const MAX_SAFE_COMPONENT_LENGTH = 16; - conversions["RegExp"] = function (V, opts) { - if (!(V instanceof RegExp)) { - V = new RegExp(V); - } + const RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease", + ]; - return V; + module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, }; /***/ }, - /***/ 7516: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - const usm = __nccwpck_require__(4422); - - exports.implementation = class URLImpl { - constructor(constructorArgs) { - const url = constructorArgs[0]; - const base = constructorArgs[1]; + /***/ 5566: /***/ (module) => { + const debug = + typeof process === "object" && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) + ? (...args) => console.error("SEMVER", ...args) + : () => {}; - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } - } + module.exports = debug; - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } + /***/ + }, - this._url = parsedURL; + /***/ 2741: /***/ (module) => { + const numeric = /^[0-9]+$/; + const compareIdentifiers = (a, b) => { + const anum = numeric.test(a); + const bnum = numeric.test(b); - // TODO: query stuff + if (anum && bnum) { + a = +a; + b = +b; } - get href() { - return usm.serializeURL(this._url); - } + return a === b + ? 0 + : anum && !bnum + ? -1 + : bnum && !anum + ? 1 + : a < b + ? -1 + : 1; + }; - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } + const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); - this._url = parsedURL; - } + module.exports = { + compareIdentifiers, + rcompareIdentifiers, + }; - get origin() { - return usm.serializeURLOrigin(this._url); - } + /***/ + }, - get protocol() { - return this._url.scheme + ":"; + /***/ 9723: /***/ (module) => { + // parse out just the options we care about + const looseOption = Object.freeze({ loose: true }); + const emptyOpts = Object.freeze({}); + const parseOptions = (options) => { + if (!options) { + return emptyOpts; } - set protocol(v) { - usm.basicURLParse(v + ":", { - url: this._url, - stateOverride: "scheme start", - }); + if (typeof options !== "object") { + return looseOption; } - get username() { - return this._url.username; - } + return options; + }; + module.exports = parseOptions; - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } + /***/ + }, - usm.setTheUsername(this._url, v); - } + /***/ 5041: /***/ (module, exports, __nccwpck_require__) => { + const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(886); + const debug = __nccwpck_require__(5566); + exports = module.exports = {}; - get password() { - return this._url.password; - } + // The actual regexps go on exports.re + const re = (exports.re = []); + const src = (exports.src = []); + const t = (exports.t = {}); + let R = 0; - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } + const createToken = (name, value, isGlobal) => { + const index = R++; + debug(name, index, value); + t[name] = index; + src[index] = value; + re[index] = new RegExp(value, isGlobal ? "g" : undefined); + }; - usm.setThePassword(this._url, v); - } + // The following Regular Expressions can be used for tokenizing, + // validating, and parsing SemVer version strings. - get host() { - const url = this._url; + // ## Numeric Identifier + // A single `0`, or a non-zero digit followed by zero or more digits. - if (url.host === null) { - return ""; - } + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+"); - if (url.port === null) { - return usm.serializeHost(url.host); - } + // ## Non-numeric Identifier + // Zero or more digits, followed by a letter or hyphen, and then zero or + // more letters, digits, or hyphens. - return ( - usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port) - ); - } + createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*"); - set host(v) { - if (this._url.cannotBeABaseURL) { - return; - } + // ## Main Version + // Three dot-separated numeric identifiers. - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } + createToken( + "MAINVERSION", + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})` + ); - get hostname() { - if (this._url.host === null) { - return ""; - } + createToken( + "MAINVERSIONLOOSE", + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})` + ); - return usm.serializeHost(this._url.host); - } + // ## Pre-release Version Identifier + // A numeric identifier, or a non-numeric identifier. - set hostname(v) { - if (this._url.cannotBeABaseURL) { - return; - } + createToken( + "PRERELEASEIDENTIFIER", + `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})` + ); - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } + createToken( + "PRERELEASEIDENTIFIERLOOSE", + `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})` + ); - get port() { - if (this._url.port === null) { - return ""; - } + // ## Pre-release Version + // Hyphen, followed by one or more dot-separated pre-release version + // identifiers. - return usm.serializeInteger(this._url.port); - } + createToken( + "PRERELEASE", + `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${ + src[t.PRERELEASEIDENTIFIER] + })*))` + ); - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } + createToken( + "PRERELEASELOOSE", + `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ + src[t.PRERELEASEIDENTIFIERLOOSE] + })*))` + ); - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; - } - - if (this._url.path.length === 0) { - return ""; - } - - return "/" + this._url.path.join("/"); - } - - set pathname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } + // ## Build Metadata Identifier + // Any combination of digits, letters, or hyphens. - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } + createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+"); - return "?" + this._url.query; - } + // ## Build Metadata + // Plus sign, followed by one or more period-separated build metadata + // identifiers. - set search(v) { - // TODO: query stuff + createToken( + "BUILD", + `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))` + ); - const url = this._url; + // ## Full Version String + // A main version, followed optionally by a pre-release version and + // build metadata. - if (v === "") { - url.query = null; - return; - } + // Note that the only major, minor, patch, and pre-release sections of + // the version string are capturing groups. The build metadata is not a + // capturing group, because it should not ever be used in version + // comparison. - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - } + createToken( + "FULLPLAIN", + `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?` + ); - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } + createToken("FULL", `^${src[t.FULLPLAIN]}$`); - return "#" + this._url.fragment; - } + // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. + // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty + // common in the npm registry. + createToken( + "LOOSEPLAIN", + `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD] + }?` + ); - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } + createToken("GTLT", "((?:<|>)?=?)"); - toJSON() { - return this.href; - } - }; + // Something like "2.*" or "1.2.x". + // Note that "x.x" is a valid xRange identifer, meaning "any version" + // Only the first item is strictly required. + createToken( + "XRANGEIDENTIFIERLOOSE", + `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*` + ); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); - /***/ - }, + createToken( + "XRANGEPLAIN", + `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + + `)?)?` + ); - /***/ 2932: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const conversions = __nccwpck_require__(7027); - const utils = __nccwpck_require__(8494); - const Impl = __nccwpck_require__(7516); + createToken( + "XRANGEPLAINLOOSE", + `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + + `)?)?` + ); - const impl = utils.implSymbol; + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken( + "XRANGELOOSE", + `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$` + ); - function URL(url) { - if (!this || this[impl] || !(this instanceof URL)) { - throw new TypeError( - "Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function." - ); - } - if (arguments.length < 1) { - throw new TypeError( - "Failed to construct 'URL': 1 argument required, but only " + - arguments.length + - " present." - ); - } - const args = []; - for (let i = 0; i < arguments.length && i < 2; ++i) { - args[i] = arguments[i]; - } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== undefined) { - args[1] = conversions["USVString"](args[1]); - } + // Coercion. + // Extract anything that could conceivably be a part of a valid semver + createToken( + "COERCE", + `${"(^|[^\\d])" + "(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])` + ); + createToken("COERCERTL", src[t.COERCE], true); - module.exports.setup(this, args); - } + // Tilde ranges. + // Meaning is "reasonably at or greater than" + createToken("LONETILDE", "(?:~>?)"); - URL.prototype.toJSON = function toJSON() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i = 0; i < arguments.length && i < 0; ++i) { - args[i] = arguments[i]; - } - return this[impl].toJSON.apply(this[impl], args); - }; - Object.defineProperty(URL.prototype, "href", { - get() { - return this[impl].href; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].href = V; - }, - enumerable: true, - configurable: true, - }); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports.tildeTrimReplace = "$1~"; - URL.prototype.toString = function () { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; - }; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken( + "TILDELOOSE", + `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$` + ); - Object.defineProperty(URL.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true, - }); + // Caret ranges. + // Meaning is "at least and backwards compatible with" + createToken("LONECARET", "(?:\\^)"); - Object.defineProperty(URL.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].protocol = V; - }, - enumerable: true, - configurable: true, - }); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports.caretTrimReplace = "$1^"; - Object.defineProperty(URL.prototype, "username", { - get() { - return this[impl].username; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].username = V; - }, - enumerable: true, - configurable: true, - }); + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken( + "CARETLOOSE", + `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$` + ); - Object.defineProperty(URL.prototype, "password", { - get() { - return this[impl].password; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].password = V; - }, - enumerable: true, - configurable: true, - }); + // A simple gt/lt/eq thing, or just "" to indicate "any version" + createToken( + "COMPARATORLOOSE", + `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$` + ); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); - Object.defineProperty(URL.prototype, "host", { - get() { - return this[impl].host; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].host = V; - }, - enumerable: true, - configurable: true, - }); + // An expression to strip any whitespace between the gtlt and the thing + // it modifies, so that `> 1.2.3` ==> `>1.2.3` + createToken( + "COMPARATORTRIM", + `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, + true + ); + exports.comparatorTrimReplace = "$1$2$3"; - Object.defineProperty(URL.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hostname = V; - }, - enumerable: true, - configurable: true, - }); + // Something like `1.2.3 - 1.2.4` + // Note that these all use the loose form, because they'll be + // checked against either the strict or loose comparator form + // later. + createToken( + "HYPHENRANGE", + `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$` + ); - Object.defineProperty(URL.prototype, "port", { - get() { - return this[impl].port; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].port = V; - }, - enumerable: true, - configurable: true, - }); + createToken( + "HYPHENRANGELOOSE", + `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$` + ); - Object.defineProperty(URL.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].pathname = V; - }, - enumerable: true, - configurable: true, - }); + // Star ranges basically just allow anything at all. + createToken("STAR", "(<|>)?=?\\s*\\*"); + // >=0.0.0 is like a star + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); - Object.defineProperty(URL.prototype, "search", { - get() { - return this[impl].search; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].search = V; - }, - enumerable: true, - configurable: true, - }); + /***/ + }, - Object.defineProperty(URL.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hash = V; - }, - enumerable: true, - configurable: true, - }); + /***/ 5774: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // Determine if version is greater than all the versions possible in the range. + const outside = __nccwpck_require__(1581); + const gtr = (version, range, options) => + outside(version, range, ">", options); + module.exports = gtr; - module.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL.prototype); - this.setup(obj, constructorArgs, privateData); - return obj; - }, - setup(obj, constructorArgs, privateData) { - if (!privateData) privateData = {}; - privateData.wrapper = obj; + /***/ + }, - obj[impl] = new Impl.implementation(constructorArgs, privateData); - obj[impl][utils.wrapperSymbol] = obj; - }, - interface: URL, - expose: { - Window: { URL: URL }, - Worker: { URL: URL }, - }, + /***/ 7916: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const Range = __nccwpck_require__(8023); + const intersects = (r1, r2, options) => { + r1 = new Range(r1, options); + r2 = new Range(r2, options); + return r1.intersects(r2, options); }; + module.exports = intersects; /***/ }, - /***/ 9501: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { - exports.URL = __nccwpck_require__(2932)["interface"]; - exports.serializeURL = __nccwpck_require__(4422).serializeURL; - exports.serializeURLOrigin = __nccwpck_require__(4422).serializeURLOrigin; - exports.basicURLParse = __nccwpck_require__(4422).basicURLParse; - exports.setTheUsername = __nccwpck_require__(4422).setTheUsername; - exports.setThePassword = __nccwpck_require__(4422).setThePassword; - exports.serializeHost = __nccwpck_require__(4422).serializeHost; - exports.serializeInteger = __nccwpck_require__(4422).serializeInteger; - exports.parseURL = __nccwpck_require__(4422).parseURL; + /***/ 4955: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const outside = __nccwpck_require__(1581); + // Determine if version is less than all the versions possible in the range + const ltr = (version, range, options) => + outside(version, range, "<", options); + module.exports = ltr; /***/ }, - /***/ 4422: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const punycode = __nccwpck_require__(5477); - const tr46 = __nccwpck_require__(8684); + /***/ 7024: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const Range = __nccwpck_require__(8023); - const specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443, + const maxSatisfying = (versions, range, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v; + maxSV = new SemVer(max, options); + } + } + }); + return max; }; + module.exports = maxSatisfying; - const failure = Symbol("failure"); - - function countSymbols(str) { - return punycode.ucs2.decode(str).length; - } - - function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); - } + /***/ + }, - function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; - } + /***/ 8252: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const Range = __nccwpck_require__(8023); + const minSatisfying = (versions, range, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v; + minSV = new SemVer(min, options); + } + } + }); + return min; + }; + module.exports = minSatisfying; - function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a); - } + /***/ + }, - function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); - } + /***/ 7234: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const Range = __nccwpck_require__(8023); + const gt = __nccwpck_require__(562); - function isASCIIHex(c) { - return ( - isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66) - ); - } + const minVersion = (range, loose) => { + range = new Range(range, loose); - function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; - } + let minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; + } - function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return ( - buffer === ".." || - buffer === "%2e." || - buffer === ".%2e" || - buffer === "%2e%2e" - ); - } + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } - function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); - } + minver = null; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; - function isWindowsDriveLetterString(string) { - return ( - string.length === 2 && - isASCIIAlpha(string.codePointAt(0)) && - (string[1] === ":" || string[1] === "|") - ); - } + let setMin = null; + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!setMin || gt(compver, setMin)) { + setMin = compver; + } + break; + case "<": + case "<=": + /* Ignore maximum versions */ + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); + } + }); + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin; + } + } - function isNormalizedWindowsDriveLetterString(string) { - return ( - string.length === 2 && - isASCIIAlpha(string.codePointAt(0)) && - string[1] === ":" - ); - } + if (minver && range.test(minver)) { + return minver; + } - function containsForbiddenHostCodePoint(string) { - return ( - string.search( - /\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/ - ) !== -1 - ); - } + return null; + }; + module.exports = minVersion; - function containsForbiddenHostCodePointExcludingPercent(string) { - return ( - string.search( - /\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/ - ) !== -1 - ); - } + /***/ + }, - function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; - } + /***/ 1581: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const SemVer = __nccwpck_require__(3215); + const Comparator = __nccwpck_require__(5955); + const { ANY } = Comparator; + const Range = __nccwpck_require__(8023); + const satisfies = __nccwpck_require__(6495); + const gt = __nccwpck_require__(562); + const lt = __nccwpck_require__(1417); + const lte = __nccwpck_require__(7545); + const gte = __nccwpck_require__(6650); - function isSpecial(url) { - return isSpecialScheme(url.scheme); - } + const outside = (version, range, hilo, options) => { + version = new SemVer(version, options); + range = new Range(range, options); - function defaultPort(scheme) { - return specialSchemes[scheme]; - } + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } - function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false; } - return "%" + hex; - } + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. - function utf8PercentEncode(c) { - const buf = new Buffer(c); + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; - let str = ""; + let high = null; + let low = null; - for (let i = 0; i < buf.length; ++i) { - str += percentEncode(buf[i]); - } + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); - return str; - } + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } - function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i = 0; i < input.length; ++i) { - if (input[i] !== 37) { - output.push(input[i]); - } else if ( - input[i] === 37 && - isASCIIHex(input[i + 1]) && - isASCIIHex(input[i + 2]) + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ( + (!low.operator || low.operator === comp) && + ltefn(version, low.semver) ) { - output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); - i += 2; - } else { - output.push(input[i]); + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; } } - return new Buffer(output).toString(); - } - - function isC0ControlPercentEncode(c) { - return c <= 0x1f || c > 0x7e; - } - - const extraPathPercentEncodeSet = new Set([ - 32, 34, 35, 60, 62, 63, 96, 123, 125, - ]); - function isPathPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); - } + return true; + }; - const extraUserinfoPercentEncodeSet = new Set([ - 47, 58, 59, 61, 64, 91, 92, 93, 94, 124, - ]); - function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); - } + module.exports = outside; - function percentEncodeChar(c, encodeSetPredicate) { - const cStr = String.fromCodePoint(c); + /***/ + }, - if (encodeSetPredicate(c)) { - return utf8PercentEncode(cStr); + /***/ 1144: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + // given a set of versions and a range, create a "simplified" range + // that includes the same versions that the original range does + // If the original range is shorter than the simplified one, return that. + const satisfies = __nccwpck_require__(6495); + const compare = __nccwpck_require__(2812); + module.exports = (versions, range, options) => { + const set = []; + let first = null; + let prev = null; + const v = versions.sort((a, b) => compare(a, b, options)); + for (const version of v) { + const included = satisfies(version, range, options); + if (included) { + prev = version; + if (!first) { + first = version; + } + } else { + if (prev) { + set.push([first, prev]); + } + prev = null; + first = null; + } } - - return cStr; - } - - function parseIPv4Number(input) { - let R = 10; - - if ( - input.length >= 2 && - input.charAt(0) === "0" && - input.charAt(1).toLowerCase() === "x" - ) { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; + if (first) { + set.push([first, null]); } - if (input === "") { - return 0; + const ranges = []; + for (const [min, max] of set) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v[0]) { + ranges.push("*"); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } } + const simplified = ranges.join(" || "); + const original = + typeof range.raw === "string" ? range.raw : String(range); + return simplified.length < original.length ? simplified : range; + }; - const regex = R === 10 ? /[^0-9]/ : R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; - if (regex.test(input)) { - return failure; - } + /***/ + }, - return parseInt(input, R); - } + /***/ 7464: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const Range = __nccwpck_require__(8023); + const Comparator = __nccwpck_require__(5955); + const { ANY } = Comparator; + const satisfies = __nccwpck_require__(6495); + const compare = __nccwpck_require__(2812); - function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } + // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: + // - Every simple range `r1, r2, ...` is a null set, OR + // - Every simple range `r1, r2, ...` which is not a null set is a subset of + // some `R1, R2, ...` + // + // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: + // - If c is only the ANY comparator + // - If C is only the ANY comparator, return true + // - Else if in prerelease mode, return false + // - else replace c with `[>=0.0.0]` + // - If C is only the ANY comparator + // - if in prerelease mode, return true + // - else replace C with `[>=0.0.0]` + // - Let EQ be the set of = comparators in c + // - If EQ is more than one, return true (null set) + // - Let GT be the highest > or >= comparator in c + // - Let LT be the lowest < or <= comparator in c + // - If GT and LT, and GT.semver > LT.semver, return true (null set) + // - If any C is a = range, and GT or LT are set, return false + // - If EQ + // - If GT, and EQ does not satisfy GT, return true (null set) + // - If LT, and EQ does not satisfy LT, return true (null set) + // - If EQ satisfies every C, return true + // - Else return false + // - If GT + // - If GT.semver is lower than any > or >= comp in C, return false + // - If GT is >=, and GT.semver does not satisfy every C, return false + // - If GT.semver has a prerelease, and not in prerelease mode + // - If no C has a prerelease and the GT.semver tuple, return false + // - If LT + // - If LT.semver is greater than any < or <= comp in C, return false + // - If LT is <=, and LT.semver does not satisfy every C, return false + // - If GT.semver has a prerelease, and not in prerelease mode + // - If no C has a prerelease and the LT.semver tuple, return false + // - Else return true - if (parts.length > 4) { - return input; + const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; } - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n = parseIPv4Number(part); - if (n === failure) { - return input; - } - - numbers.push(n); - } + sub = new Range(sub, options); + dom = new Range(dom, options); + let sawNonNull = false; - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false; } } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } + return true; + }; - let ipv4 = numbers.pop(); - let counter = 0; + const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + const minimumVersion = [new Comparator(">=0.0.0")]; - for (const n of numbers) { - ipv4 += n * Math.pow(256, 3 - counter); - ++counter; + const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; } - return ipv4; - } - - function serializeIPv4(address) { - let output = ""; - let n = address; - - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = "." + output; + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; + } else { + sub = minimumVersion; } - n = Math.floor(n / 256); } - return output; - } - - function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = punycode.ucs2.decode(input); + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; + const eqSet = new Set(); + let gt, lt; + for (const c of sub) { + if (c.operator === ">" || c.operator === ">=") { + gt = higherGT(gt, c, options); + } else if (c.operator === "<" || c.operator === "<=") { + lt = lowerLT(lt, c, options); + } else { + eqSet.add(c.semver); } + } - pointer += 2; - ++pieceIndex; - compress = pieceIndex; + if (eqSet.size > 1) { + return null; } - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; + let gtltComp; + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if ( + gtltComp === 0 && + (gt.operator !== ">=" || lt.operator !== "<=") + ) { + return null; } + } - if (input[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null; } - let value = 0; - let length = 0; - - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; + if (lt && !satisfies(eq, String(lt), options)) { + return null; } - if (input[pointer] === 46) { - if (length === 0) { - return failure; - } - - pointer -= length; - - if (pieceIndex > 6) { - return failure; + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false; } + } - let numbersSeen = 0; + return true; + } - while (input[pointer] !== undefined) { - let ipv4Piece = null; + let higher, lower; + let hasDomLT, hasDomGT; + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = + lt && !options.includePrerelease && lt.semver.prerelease.length + ? lt.semver + : false; + let needDomGTPre = + gt && !options.includePrerelease && gt.semver.prerelease.length + ? gt.semver + : false; + // exception: <1.2.3-0 is the same as <1.2.3 + if ( + needDomLTPre && + needDomLTPre.prerelease.length === 1 && + lt.operator === "<" && + needDomLTPre.prerelease[0] === 0 + ) { + needDomLTPre = false; + } - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; + hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; + if (gt) { + if (needDomGTPre) { + if ( + c.semver.prerelease && + c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch + ) { + needDomGTPre = false; } - - if (!isASCIIDigit(input[pointer])) { - return failure; + } + if (c.operator === ">" || c.operator === ">=") { + higher = higherGT(gt, c, options); + if (higher === c && higher !== gt) { + return false; } - - while (isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; + } else if ( + gt.operator === ">=" && + !satisfies(gt.semver, String(c), options) + ) { + return false; + } + } + if (lt) { + if (needDomLTPre) { + if ( + c.semver.prerelease && + c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch + ) { + needDomLTPre = false; } - - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; - - ++numbersSeen; - - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; + } + if (c.operator === "<" || c.operator === "<=") { + lower = lowerLT(lt, c, options); + if (lower === c && lower !== lt) { + return false; } + } else if ( + lt.operator === "<=" && + !satisfies(lt.semver, String(c), options) + ) { + return false; } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false; + } + } - if (numbersSeen !== 4) { - return failure; - } + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false; + } - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false; + } - address[pieceIndex] = value; - ++pieceIndex; + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false; } - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; + return true; + }; + + // >=1.2.3 is lower than >1.2.3 + const higherGT = (a, b, options) => { + if (!a) { + return b; } + const comp = compare(a.semver, b.semver, options); + return comp > 0 + ? a + : comp < 0 + ? b + : b.operator === ">" && a.operator === ">=" + ? b + : a; + }; - return address; - } + // <=1.2.3 is higher than <1.2.3 + const lowerLT = (a, b, options) => { + if (!a) { + return b; + } + const comp = compare(a.semver, b.semver, options); + return comp < 0 + ? a + : comp > 0 + ? b + : b.operator === "<" && a.operator === "<=" + ? b + : a; + }; - function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; + module.exports = subset; - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } + /***/ + }, - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } + /***/ 6479: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const Range = __nccwpck_require__(8023); - output += address[pieceIndex].toString(16); + // Mostly just for testing and legacy API reasons + const toComparators = (range, options) => + new Range(range, options).set.map((comp) => + comp + .map((c) => c.value) + .join(" ") + .trim() + .split(" ") + ); - if (pieceIndex !== 7) { - output += ":"; - } + module.exports = toComparators; + + /***/ + }, + + /***/ 4226: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const Range = __nccwpck_require__(8023); + const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || "*"; + } catch (er) { + return null; } + }; + module.exports = validRange; - return output; - } + /***/ + }, - function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; + /***/ 515: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + /**/ + + var Buffer = __nccwpck_require__(6053).Buffer; + /**/ + + var isEncoding = + Buffer.isEncoding || + function (encoding) { + encoding = "" + encoding; + switch (encoding && encoding.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; } + }; - return parseIPv6(input.substring(1, input.length - 1)); + function _normalizeEncoding(enc) { + if (!enc) return "utf8"; + var retried; + while (true) { + switch (enc) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return enc; + default: + if (retried) return; // undefined + enc = ("" + enc).toLowerCase(); + retried = true; + } } + } - if (!isSpecialArg) { - return parseOpaqueHost(input); + // Do not cache `Buffer.isEncoding` when checking encoding names as some + // modules monkey-patch it to support additional encodings + function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if ( + typeof nenc !== "string" && + (Buffer.isEncoding === isEncoding || !isEncoding(enc)) + ) + throw new Error("Unknown encoding: " + enc); + return nenc || enc; + } + + // StringDecoder provides an interface for efficiently splitting a series of + // buffers into a series of JS strings without breaking apart multi-byte + // characters. + exports.s = StringDecoder; + function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case "utf16le": + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case "utf8": + this.fillLast = utf8FillLast; + nb = 4; + break; + case "base64": + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); + } - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII( - domain, - false, - tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, - false - ); - if (asciiDomain === null) { - return failure; + StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ""; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ""; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ""; + }; - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; + StringDecoder.prototype.end = utf8End; + + // Returns only complete characters in a Buffer + StringDecoder.prototype.text = utf8Text; + + // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer + StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy( + this.lastChar, + this.lastTotal - this.lastNeed, + 0, + this.lastNeed + ); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; + }; - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; + // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a + // continuation byte. If an invalid byte is detected, -2 is returned. + function utf8CheckByte(byte) { + if (byte <= 0x7f) return 0; + else if (byte >> 5 === 0x06) return 2; + else if (byte >> 4 === 0x0e) return 3; + else if (byte >> 3 === 0x1e) return 4; + return byte >> 6 === 0x02 ? -1 : -2; + } + + // Checks at most 3 bytes at the end of a Buffer in order to detect an + // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) + // needed to complete the UTF-8 character (if applicable) are returned. + function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0; + else self.lastNeed = nb - 3; + } + return nb; + } + return 0; + } + + // Validates as many continuation bytes for a multi-byte UTF-8 character as + // needed or are available. If we see a non-continuation byte where we expect + // one, we "replace" the validated continuation bytes we've seen so far with + // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding + // behavior. The continuation byte check is included three times in the case + // where all of the continuation bytes for a character exist in the same buffer. + // It is also done this way as a slight performance increase instead of using a + // loop. + function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xc0) !== 0x80) { + self.lastNeed = 0; + return "\ufffd"; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xc0) !== 0x80) { + self.lastNeed = 1; + return "\ufffd"; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xc0) !== 0x80) { + self.lastNeed = 2; + return "\ufffd"; + } + } + } + } + + // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. + function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; + } + + // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a + // partial character, the character's bytes are buffered until the required + // number of bytes are available. + function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString("utf8", i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString("utf8", i, end); + } + + // For UTF-8, a replacement character is added when ending on a partial + // character. + function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r + "\ufffd"; + return r; + } + + // UTF-16LE typically needs two bytes per character, but even if we have an even + // number of bytes available, we need to check if we end on a leading/high + // surrogate. In that case, we need to wait for the next two bytes in order to + // decode the last character properly. + function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString("utf16le", i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xd800 && c <= 0xdbff) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString("utf16le", i, buf.length - 1); + } + + // For UTF-16LE we do not explicitly append special replacement characters if we + // end on a partial character, we simply let v8 handle that. + function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString("utf16le", 0, end); + } + return r; + } + + function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString("base64", i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; } + return buf.toString("base64", i, buf.length - n); + } - return asciiDomain; + function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) + return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); + return r; } - function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; - } + // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) + function simpleWrite(buf) { + return buf.toString(this.encoding); + } - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i = 0; i < decoded.length; ++i) { - output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); - } - return output; + function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ""; } - function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; // only find elements > 1 - let currStart = null; - let currLen = 0; + /***/ + }, - for (let i = 0; i < arr.length; ++i) { - if (arr[i] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } + /***/ 291: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const { Transform } = __nccwpck_require__(5709); - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i; - } - ++currLen; + function inherits(fn, sup) { + fn.super_ = sup; + fn.prototype = Object.create(sup.prototype, { + constructor: { + value: fn, + enumerable: false, + writable: true, + configurable: true, + }, + }); + } + + // create a new export function, used by both the main export and + // the .ctor export, contains common logic for dealing with arguments + function through2(construct) { + return (options, transform, flush) => { + if (typeof options === "function") { + flush = transform; + transform = options; + options = {}; } - } - // if trailing zeros - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } + if (typeof transform !== "function") { + // noop + transform = (chunk, enc, cb) => cb(null, chunk); + } - return { - idx: maxIdx, - len: maxLen, + if (typeof flush !== "function") { + flush = null; + } + + return construct(options, transform, flush); }; } - function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); + // main export, just make me a transform stream! + const make = through2((options, transform, flush) => { + const t2 = new Transform(options); + + t2._transform = transform; + + if (flush) { + t2._flush = flush; } - // IPv6 serializer - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; + return t2; + }); + + // make me a reusable prototype that I can `new`, or implicitly `new` + // with a constructor call + const ctor = through2((options, transform, flush) => { + function Through2(override) { + if (!(this instanceof Through2)) { + return new Through2(override); + } + + this.options = Object.assign({}, options, override); + + Transform.call(this, this.options); + + this._transform = transform; + if (flush) { + this._flush = flush; + } } - return host; - } + inherits(Through2, Transform); - function trimControlChars(url) { - return url.replace( - /^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, - "" + return Through2; + }); + + const obj = through2(function (options, transform, flush) { + const t2 = new Transform( + Object.assign({ objectMode: true, highWaterMark: 16 }, options) ); - } - function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/g, ""); - } + t2._transform = transform; - function shortenPath(url) { - const path = url.path; - if (path.length === 0) { - return; - } - if ( - url.scheme === "file" && - path.length === 1 && - isNormalizedWindowsDriveLetter(path[0]) - ) { - return; + if (flush) { + t2._flush = flush; } - path.pop(); + return t2; + }); + + module.exports = make; + module.exports.ctor = ctor; + module.exports.obj = obj; + + /***/ + }, + + /***/ 8684: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + var punycode = __nccwpck_require__(5477); + var mappingTable = __nccwpck_require__(1229); + + var PROCESSING_OPTIONS = { + TRANSITIONAL: 0, + NONTRANSITIONAL: 1, + }; + + function normalize(str) { + // fix bug in v8 + return str + .split("\u0000") + .map(function (s) { + return s.normalize("NFC"); + }) + .join("\u0000"); } - function includesCredentials(url) { - return url.username !== "" || url.password !== ""; + function findStatus(val) { + var start = 0; + var end = mappingTable.length - 1; + + while (start <= end) { + var mid = Math.floor((start + end) / 2); + + var target = mappingTable[mid]; + if (target[0][0] <= val && target[0][1] >= val) { + return target; + } else if (target[0][0] > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + + return null; } - function cannotHaveAUsernamePasswordPort(url) { + var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + + function countSymbols(string) { return ( - url.host === null || - url.host === "" || - url.cannotBeABaseURL || - url.scheme === "file" + // then get the length + string + // replace every surrogate pair with a BMP symbol + .replace(regexAstralSymbols, "_").length ); } - function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/.test(string); - } - - function URLStateMachine( - input, - base, - encodingOverride, - url, - stateOverride - ) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; + function mapChars(domain_name, useSTD3, processing_option) { + var hasError = false; + var processed = ""; - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, + var len = countSymbols(domain_name); + for (var i = 0; i < len; ++i) { + var codePoint = domain_name.codePointAt(i); + var status = findStatus(codePoint); - cannotBeABaseURL: false, - }; + switch (status[1]) { + case "disallowed": + hasError = true; + processed += String.fromCodePoint(codePoint); + break; + case "ignored": + break; + case "mapped": + processed += String.fromCodePoint.apply(String, status[2]); + break; + case "deviation": + if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { + processed += String.fromCodePoint.apply(String, status[2]); + } else { + processed += String.fromCodePoint(codePoint); + } + break; + case "valid": + processed += String.fromCodePoint(codePoint); + break; + case "disallowed_STD3_mapped": + if (useSTD3) { + hasError = true; + processed += String.fromCodePoint(codePoint); + } else { + processed += String.fromCodePoint.apply(String, status[2]); + } + break; + case "disallowed_STD3_valid": + if (useSTD3) { + hasError = true; + } - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; + processed += String.fromCodePoint(codePoint); + break; } - this.input = res; } - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; + return { + string: processed, + error: hasError, + }; + } - this.state = stateOverride || "scheme start"; + var combiningMarksRegex = + /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; + function validateLabel(label, processing_option) { + if (label.substr(0, 4) === "xn--") { + label = punycode.toUnicode(label); + processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; + } - this.input = punycode.ucs2.decode(this.input); + var error = false; - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + if ( + normalize(label) !== label || + (label[3] === "-" && label[4] === "-") || + label[0] === "-" || + label[label.length - 1] === "-" || + label.indexOf(".") !== -1 || + label.search(combiningMarksRegex) === 0 + ) { + error = true; + } - // exec state machine - const ret = this["parse " + this.state](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; + var len = countSymbols(label); + for (var i = 0; i < len; ++i) { + var status = findStatus(label.codePointAt(i)); + if ( + (processing === PROCESSING_OPTIONS.TRANSITIONAL && + status[1] !== "valid") || + (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && + status[1] !== "valid" && + status[1] !== "deviation") + ) { + error = true; break; } } + + return { + label: label, + error: error, + }; } - URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart( - c, - cStr - ) { - if (isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } + function processing(domain_name, useSTD3, processing_option) { + var result = mapChars(domain_name, useSTD3, processing_option); + result.string = normalize(result.string); - return true; - }; - - URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } + var labels = result.string.split("."); + for (var i = 0; i < labels.length; ++i) { + try { + var validation = validateLabel(labels[i]); + labels[i] = validation.label; + result.error = result.error || validation.error; + } catch (e) { + result.error = true; + } + } - if ( - (includesCredentials(this.url) || this.url.port !== null) && - this.buffer === "file" - ) { - return false; - } + return { + string: labels.join("."), + error: result.error, + }; + } - if ( - this.url.scheme === "file" && - (this.url.host === "" || this.url.host === null) - ) { - return false; - } + module.exports.toASCII = function ( + domain_name, + useSTD3, + processing_option, + verifyDnsLength + ) { + var result = processing(domain_name, useSTD3, processing_option); + var labels = result.string.split("."); + labels = labels.map(function (l) { + try { + return punycode.toASCII(l); + } catch (e) { + result.error = true; + return l; } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; + }); + + if (verifyDnsLength) { + var total = labels.slice(0, labels.length - 1).join(".").length; + if (total.length > 253 || total.length === 0) { + result.error = true; } - if (this.url.scheme === "file") { - if ( - this.input[this.pointer + 1] !== 47 || - this.input[this.pointer + 2] !== 47 - ) { - this.parseError = true; + + for (var i = 0; i < labels.length; ++i) { + if (labels.length > 63 || labels.length === 0) { + result.error = true; + break; } - this.state = "file"; - } else if ( - isSpecial(this.url) && - this.base !== null && - this.base.scheme === this.url.scheme - ) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; } - return true; + if (result.error) return null; + return labels.join("."); }; - URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { - return failure; - } else if (this.base.cannotBeABaseURL && c === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } + module.exports.toUnicode = function (domain_name, useSTD3) { + var result = processing( + domain_name, + useSTD3, + PROCESSING_OPTIONS.NONTRANSITIONAL + ); - return true; + return { + domain: result.string, + error: result.error, + }; }; - URLStateMachine.prototype["parse special relative or authority"] = - function parseSpecialRelativeOrAuthority(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } + module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; - return true; - }; + /***/ + }, - URLStateMachine.prototype["parse path or authority"] = - function parsePathOrAuthority(c) { - if (c === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } + /***/ 4249: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + module.exports = __nccwpck_require__(709); - return true; - }; + /***/ + }, - URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (isNaN(c)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 47) { - this.state = "relative slash"; - } else if (c === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); + /***/ 709: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + var net = __nccwpck_require__(1808); + var tls = __nccwpck_require__(4404); + var http = __nccwpck_require__(3685); + var https = __nccwpck_require__(5687); + var events = __nccwpck_require__(2361); + var assert = __nccwpck_require__(9491); + var util = __nccwpck_require__(3837); - this.state = "path"; - --this.pointer; - } + exports.httpOverHttp = httpOverHttp; + exports.httpsOverHttp = httpsOverHttp; + exports.httpOverHttps = httpOverHttps; + exports.httpsOverHttps = httpsOverHttps; - return true; - }; + function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; + } - URLStateMachine.prototype["parse relative slash"] = - function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === 47 || c === 92)) { - if (c === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } + function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } - return true; - }; + function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; + } - URLStateMachine.prototype["parse special authority slashes"] = - function parseSpecialAuthoritySlashes(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } + function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } - return true; - }; + function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; - URLStateMachine.prototype["parse special authority ignore slashes"] = - function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== 47 && c !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; + self.on("free", function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options.host && pending.port === options.port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } } + socket.destroy(); + self.removeSocket(socket); + }); + } + util.inherits(TunnelingAgent, events.EventEmitter); - return true; - }; - - URLStateMachine.prototype["parse authority"] = function parseAuthority( - c, - cStr + TunnelingAgent.prototype.addRequest = function addRequest( + req, + host, + port, + localAddress ) { - if (c === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; - - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); + var self = this; + var options = mergeOptions( + { request: req }, + self.options, + toOptions(host, port, localAddress) + ); - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar( - codePoint, - isUserinfoPercentEncode - ); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if ( - isNaN(c) || - c === 47 || - c === 63 || - c === 35 || - (isSpecial(this.url) && c === 92) - ) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; } - return true; - }; - - URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype[ - "parse host" - ] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } + // If we are under maxSockets create a new one. + self.createSocket(options, function (socket) { + socket.on("free", onFree); + socket.on("close", onCloseOrRemove); + socket.on("agentRemove", onCloseOrRemove); + req.onSocket(socket); - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; + function onFree() { + self.emit("free", socket, options); } - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if ( - isNaN(c) || - c === 47 || - c === 63 || - c === 35 || - (isSpecial(this.url) && c === 92) - ) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if ( - this.stateOverride && - this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null) - ) { - this.parseError = true; - return false; + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener("free", onFree); + socket.removeListener("close", onCloseOrRemove); + socket.removeListener("agentRemove", onCloseOrRemove); } + }); + }; - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } + TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === 91) { - this.arrFlag = true; - } else if (c === 93) { - this.arrFlag = false; - } - this.buffer += cStr; + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: "CONNECT", + path: options.host + ":" + options.port, + agent: false, + headers: { + host: options.host + ":" + options.port, + }, + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers["Proxy-Authorization"] = + "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } - return true; - }; + debug("making CONNECT request"); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once("response", onResponse); // for v0.6 + connectReq.once("upgrade", onUpgrade); // for v0.6 + connectReq.once("connect", onConnect); // for v0.7 or later + connectReq.once("error", onError); + connectReq.end(); - URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (isASCIIDigit(c)) { - this.buffer += cStr; - } else if ( - isNaN(c) || - c === 47 || - c === 63 || - c === 35 || - (isSpecial(this.url) && c === 92) || - this.stateOverride - ) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; } - return true; - }; - - const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function () { + onConnect(res, socket, head); + }); + } - URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; + if (res.statusCode !== 200) { + debug( + "tunneling socket could not be established, statusCode=%d", + res.statusCode + ); + socket.destroy(); + var error = new Error( + "tunneling socket could not be established, " + + "statusCode=" + + res.statusCode + ); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + return; } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if ( - this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || - (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) - ) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } - - this.state = "path"; - --this.pointer; + if (head.length > 0) { + debug("got illegal response body from proxy"); + socket.destroy(); + var error = new Error("got illegal response body from proxy"); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); + return; } - } else { - this.state = "path"; - --this.pointer; + debug("tunneling connection has established"); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); } - return true; - }; + function onError(cause) { + connectReq.removeAllListeners(); - URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } - } - this.state = "path"; - --this.pointer; + debug( + "tunneling socket could not be established, cause=%s\n", + cause.message, + cause.stack + ); + var error = new Error( + "tunneling socket could not be established, " + + "cause=" + + cause.message + ); + error.code = "ECONNRESET"; + options.request.emit("error", error); + self.removeSocket(placeholder); } - - return true; }; - URLStateMachine.prototype["parse file host"] = function parseFileHost( - c, - cStr - ) { - if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - - if (this.stateOverride) { - return false; - } - - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; + TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket); + if (pos === -1) { + return; } + this.sockets.splice(pos, 1); - return true; + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function (socket) { + pending.request.onSocket(socket); + }); + } }; - URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === 92) { - this.parseError = true; - } - this.state = "path"; + function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call( + self, + options, + function (socket) { + var hostHeader = options.request.getHeader("host"); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader + ? hostHeader.replace(/:.*$/, "") + : options.host, + }); - if (c !== 47 && c !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== 47) { - --this.pointer; + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); } - } - - return true; - }; + ); + } - URLStateMachine.prototype["parse path"] = function parsePath(c) { - if ( - isNaN(c) || - c === 47 || - (isSpecial(this.url) && c === 92) || - (!this.stateOverride && (c === 63 || c === 35)) - ) { - if (isSpecial(this.url) && c === 92) { - this.parseError = true; - } + function toOptions(host, port, localAddress) { + if (typeof host === "string") { + // since v0.10 + return { + host: host, + port: port, + localAddress: localAddress, + }; + } + return host; // for v0.11 or later + } - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } - } else if ( - isSingleDot(this.buffer) && - c !== 47 && - !(isSpecial(this.url) && c === 92) - ) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if ( - this.url.scheme === "file" && - this.url.path.length === 0 && - isWindowsDriveLetterString(this.buffer) - ) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; + function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === "object") { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; } - this.buffer = this.buffer[0] + ":"; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if ( - this.url.scheme === "file" && - (c === undefined || c === 63 || c === 35) - ) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); } } - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - - if ( - c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2])) - ) { - this.parseError = true; - } - - this.buffer += percentEncodeChar(c, isPathPercentEncode); } + return target; + } - return true; - }; - - URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = - function parseCannotBeABaseURLPath(c) { - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; + var debug; + if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === "string") { + args[0] = "TUNNEL: " + args[0]; } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== 37) { - this.parseError = true; - } - - if ( - c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2])) - ) { - this.parseError = true; - } - - if (!isNaN(c)) { - this.url.path[0] = - this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); - } + args.unshift("TUNNEL:"); } - - return true; + console.error.apply(console, args); }; + } else { + debug = function () {}; + } + exports.debug = debug; // for test - URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (isNaN(c) || (!this.stateOverride && c === 35)) { - if ( - !isSpecial(this.url) || - this.url.scheme === "ws" || - this.url.scheme === "wss" - ) { - this.encodingOverride = "utf-8"; - } - - const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead - for (let i = 0; i < buffer.length; ++i) { - if ( - buffer[i] < 0x21 || - buffer[i] > 0x7e || - buffer[i] === 0x22 || - buffer[i] === 0x23 || - buffer[i] === 0x3c || - buffer[i] === 0x3e - ) { - this.url.query += percentEncode(buffer[i]); - } else { - this.url.query += String.fromCodePoint(buffer[i]); - } - } - - this.buffer = ""; - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if ( - c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2])) - ) { - this.parseError = true; - } - - this.buffer += cStr; - } - - return true; - }; + /***/ + }, - URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (isNaN(c)) { - // do nothing - } else if (c === 0x0) { - this.parseError = true; - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if ( - c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2])) - ) { - this.parseError = true; - } + /***/ 494: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { value: true }); - this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); - } + function _interopDefault(ex) { + return ex && typeof ex === "object" && "default" in ex + ? ex["default"] + : ex; + } - return true; - }; + var jsonwebtoken = _interopDefault(__nccwpck_require__(245)); - function serializeURL(url, excludeFragment) { - let output = url.scheme + ":"; - if (url.host !== null) { - output += "//"; + async function getToken({ privateKey, payload }) { + return jsonwebtoken.sign(payload, privateKey, { + algorithm: "RS256", + }); + } - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += ":" + url.password; - } - output += "@"; - } + async function githubAppJwt({ + id, + privateKey, + now = Math.floor(Date.now() / 1000), + }) { + // When creating a JSON Web Token, it sets the "issued at time" (iat) to 30s + // in the past as we have seen people running situations where the GitHub API + // claimed the iat would be in future. It turned out the clocks on the + // different machine were not in sync. + const nowWithSafetyMargin = now - 30; + const expiration = nowWithSafetyMargin + 60 * 10; // JWT expiration time (10 minute maximum) + const payload = { + iat: nowWithSafetyMargin, + exp: expiration, + iss: id, + }; + const token = await getToken({ + privateKey, + payload, + }); + return { + appId: id, + expiration, + token, + }; + } - output += serializeHost(url.host); + exports.githubAppJwt = githubAppJwt; + //# sourceMappingURL=index.js.map - if (url.port !== null) { - output += ":" + url.port; - } - } else if (url.host === null && url.scheme === "file") { - output += "//"; - } + /***/ + }, - if (url.cannotBeABaseURL) { - output += url.path[0]; - } else { - for (const string of url.path) { - output += "/" + string; - } - } + /***/ 4930: /***/ (__unused_webpack_module, exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); - if (url.query !== null) { - output += "?" + url.query; + function getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; } - if (!excludeFragment && url.fragment !== null) { - output += "#" + url.fragment; + if (typeof process === "object" && "version" in process) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${ + process.arch + })`; } - return output; + return ""; } - function serializeOrigin(tuple) { - let result = tuple.scheme + "://"; - result += serializeHost(tuple.host); + exports.getUserAgent = getUserAgent; + //# sourceMappingURL=index.js.map - if (tuple.port !== null) { - result += ":" + tuple.port; - } + /***/ + }, - return result; - } + /***/ 1174: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * For Node.js, simply re-export the core `util.deprecate` function. + */ - module.exports.serializeURL = serializeURL; + module.exports = __nccwpck_require__(3837).deprecate; - module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": - try { - return module.exports.serializeURLOrigin( - module.exports.parseURL(url.path[0]) - ); - } catch (e) { - // serializing an opaque origin returns "null" - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port, - }); - case "file": - // spec says "exercise to the reader", chrome says "file://" - return "file://"; - default: - // serializing an opaque origin returns "null" - return "null"; - } - }; + /***/ + }, - module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } + /***/ 2033: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + Object.defineProperty(exports, "v1", { + enumerable: true, + get: function () { + return _v.default; + }, + }); + Object.defineProperty(exports, "v3", { + enumerable: true, + get: function () { + return _v2.default; + }, + }); + Object.defineProperty(exports, "v4", { + enumerable: true, + get: function () { + return _v3.default; + }, + }); + Object.defineProperty(exports, "v5", { + enumerable: true, + get: function () { + return _v4.default; + }, + }); + Object.defineProperty(exports, "NIL", { + enumerable: true, + get: function () { + return _nil.default; + }, + }); + Object.defineProperty(exports, "version", { + enumerable: true, + get: function () { + return _version.default; + }, + }); + Object.defineProperty(exports, "validate", { + enumerable: true, + get: function () { + return _validate.default; + }, + }); + Object.defineProperty(exports, "stringify", { + enumerable: true, + get: function () { + return _stringify.default; + }, + }); + Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.default; + }, + }); - const usm = new URLStateMachine( - input, - options.baseURL, - options.encodingOverride, - options.url, - options.stateOverride - ); - if (usm.failure) { - return "failure"; - } + var _v = _interopRequireDefault(__nccwpck_require__(9370)); - return usm.url; - }; + var _v2 = _interopRequireDefault(__nccwpck_require__(8638)); - module.exports.setTheUsername = function (url, username) { - url.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i = 0; i < decoded.length; ++i) { - url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } - }; + var _v3 = _interopRequireDefault(__nccwpck_require__(3519)); - module.exports.setThePassword = function (url, password) { - url.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i = 0; i < decoded.length; ++i) { - url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } - }; + var _v4 = _interopRequireDefault(__nccwpck_require__(8239)); - module.exports.serializeHost = serializeHost; + var _nil = _interopRequireDefault(__nccwpck_require__(680)); - module.exports.cannotHaveAUsernamePasswordPort = - cannotHaveAUsernamePasswordPort; + var _version = _interopRequireDefault(__nccwpck_require__(3609)); - module.exports.serializeInteger = function (integer) { - return String(integer); - }; + var _validate = _interopRequireDefault(__nccwpck_require__(6009)); - module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } + var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { - baseURL: options.baseURL, - encodingOverride: options.encodingOverride, - }); - }; + var _parse = _interopRequireDefault(__nccwpck_require__(8951)); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } /***/ }, - /***/ 8494: /***/ (module) => { - module.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty( - target, - keys[i], - Object.getOwnPropertyDescriptor(source, keys[i]) - ); + /***/ 7276: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; + + var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + + function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === "string") { + bytes = Buffer.from(bytes, "utf8"); } - }; - module.exports.wrapperSymbol = Symbol("wrapper"); - module.exports.implSymbol = Symbol("impl"); + return _crypto.default.createHash("md5").update(bytes).digest(); + } - module.exports.wrapperForImpl = function (impl) { - return impl[module.exports.wrapperSymbol]; - }; + var _default = md5; + exports["default"] = _default; - module.exports.implForWrapper = function (wrapper) { - return wrapper[module.exports.implSymbol]; - }; + /***/ + }, + + /***/ 680: /***/ (__unused_webpack_module, exports) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; + var _default = "00000000-0000-0000-0000-000000000000"; + exports["default"] = _default; /***/ }, - /***/ 6189: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - const isWindows = - process.platform === "win32" || - process.env.OSTYPE === "cygwin" || - process.env.OSTYPE === "msys"; - - const path = __nccwpck_require__(1017); - const COLON = isWindows ? ";" : ":"; - const isexe = __nccwpck_require__(4555); - - const getNotFoundError = (cmd) => - Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); - - const getPathInfo = (cmd, opt) => { - const colon = opt.colon || COLON; - - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - const pathEnv = - cmd.match(/\//) || (isWindows && cmd.match(/\\/)) - ? [""] - : [ - // windows always checks the cwd first - ...(isWindows ? [process.cwd()] : []), - ...( - opt.path || - process.env.PATH || - /* istanbul ignore next: very unusual */ "" - ).split(colon), - ]; - const pathExtExe = isWindows - ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" - : ""; - const pathExt = isWindows ? pathExtExe.split(colon) : [""]; - - if (isWindows) { - if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift(""); - } + /***/ 8951: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - return { - pathEnv, - pathExt, - pathExtExe, - }; - }; + var _validate = _interopRequireDefault(__nccwpck_require__(6009)); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - const which = (cmd, opt, cb) => { - if (typeof opt === "function") { - cb = opt; - opt = {}; + function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError("Invalid UUID"); } - if (!opt) opt = {}; - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); - const found = []; + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = (v >>> 16) & 0xff; + arr[2] = (v >>> 8) & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ - const step = (i) => - new Promise((resolve, reject) => { - if (i === pathEnv.length) - return opt.all && found.length - ? resolve(found) - : reject(getNotFoundError(cmd)); + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ - const ppRaw = pathEnv[i]; - const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - const pCmd = path.join(pathPart, cmd); - const p = - !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; + arr[10] = ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff; + arr[11] = (v / 0x100000000) & 0xff; + arr[12] = (v >>> 24) & 0xff; + arr[13] = (v >>> 16) & 0xff; + arr[14] = (v >>> 8) & 0xff; + arr[15] = v & 0xff; + return arr; + } - resolve(subStep(p, i, 0)); - }); + var _default = parse; + exports["default"] = _default; - const subStep = (p, i, ii) => - new Promise((resolve, reject) => { - if (ii === pathExt.length) return resolve(step(i + 1)); - const ext = pathExt[ii]; - isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { - if (!er && is) { - if (opt.all) found.push(p + ext); - else return resolve(p + ext); - } - return resolve(subStep(p, i, ii + 1)); - }); - }); + /***/ + }, - return cb ? step(0).then((res) => cb(null, res), cb) : step(0); - }; + /***/ 646: /***/ (__unused_webpack_module, exports) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; + var _default = + /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; + exports["default"] = _default; - const whichSync = (cmd, opt) => { - opt = opt || {}; + /***/ + }, - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); - const found = []; + /***/ 7548: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = rng; - for (let i = 0; i < pathEnv.length; i++) { - const ppRaw = pathEnv[i]; - const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; + var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - const pCmd = path.join(pathPart, cmd); - const p = - !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - for (let j = 0; j < pathExt.length; j++) { - const cur = p + pathExt[j]; - try { - const is = isexe.sync(cur, { pathExt: pathExtExe }); - if (is) { - if (opt.all) found.push(cur); - else return cur; - } - } catch (ex) {} - } - } + const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - if (opt.all && found.length) return found; + let poolPtr = rnds8Pool.length; - if (opt.nothrow) return null; + function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); - throw getNotFoundError(cmd); - }; + poolPtr = 0; + } - module.exports = which; - which.sync = whichSync; + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); + } /***/ }, - /***/ 2509: /***/ (module) => { - // Returns a wrapper function that returns a wrapped callback - // The wrapper function should do some stuff, and return a - // presumably different callback function. - // This makes sure that own properties are retained, so that - // decorations and such are not lost along the way. - module.exports = wrappy; - function wrappy(fn, cb) { - if (fn && cb) return wrappy(fn)(cb); - - if (typeof fn !== "function") - throw new TypeError("need wrapper function"); + /***/ 3557: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k]; - }); + var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - return wrapper; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - function wrapper() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var ret = fn.apply(this, args); - var cb = args[args.length - 1]; - if (typeof ret === "function" && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k]; - }); - } - return ret; + function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === "string") { + bytes = Buffer.from(bytes, "utf8"); } + + return _crypto.default.createHash("sha1").update(bytes).digest(); } + var _default = sha1; + exports["default"] = _default; + /***/ }, - /***/ 2224: /***/ (module) => { - module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value; - } - }; - }; + /***/ 9729: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - /***/ - }, + var _validate = _interopRequireDefault(__nccwpck_require__(6009)); - /***/ 1590: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { - module.exports = Yallist; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - Yallist.Node = Node; - Yallist.create = Yallist; + /** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + const byteToHex = []; - function Yallist(list) { - var self = this; - if (!(self instanceof Yallist)) { - self = new Yallist(); - } + for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); + } - self.tail = null; - self.head = null; - self.length = 0; + function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = ( + byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + "-" + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + "-" + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + "-" + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + "-" + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]] + ).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields - if (list && typeof list.forEach === "function") { - list.forEach(function (item) { - self.push(item); - }); - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]); - } + if (!(0, _validate.default)(uuid)) { + throw TypeError("Stringified UUID is invalid"); } - return self; + return uuid; } - Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error("removing node which does not belong to this list"); - } + var _default = stringify; + exports["default"] = _default; - var next = node.next; - var prev = node.prev; + /***/ + }, - if (next) { - next.prev = prev; - } + /***/ 9370: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - if (prev) { - prev.next = next; - } + var _rng = _interopRequireDefault(__nccwpck_require__(7548)); - if (node === this.head) { - this.head = next; - } - if (node === this.tail) { - this.tail = prev; - } + var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); - node.list.length--; - node.next = null; - node.prev = null; - node.list = null; + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - return next; - }; + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + let _nodeId; - Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return; - } + let _clockseq; // Previous uuid creation time - if (node.list) { - node.list.removeNode(node); - } + let _lastMSecs = 0; + let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - var head = this.head; - node.list = this; - node.next = head; - if (head) { - head.prev = node; - } + function v1(options, buf, offset) { + let i = (buf && offset) || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = + options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 - this.head = node; - if (!this.tail) { - this.tail = node; - } - this.length++; - }; + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); - Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return; - } + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [ + seedBytes[0] | 0x01, + seedBytes[1], + seedBytes[2], + seedBytes[3], + seedBytes[4], + seedBytes[5], + ]; + } - if (node.list) { - node.list.removeNode(node); - } + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = ((seedBytes[6] << 8) | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var tail = this.tail; - node.list = this; - node.prev = tail; - if (tail) { - tail.next = node; - } + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock - this.tail = node; - if (!this.head) { - this.head = node; - } - this.length++; - }; + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]); - } - return this.length; - }; + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]); - } - return this.length; - }; + if (dt < 0 && options.clockseq === undefined) { + clockseq = (clockseq + 1) & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval - Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined; - } - - var res = this.tail.value; - this.tail = this.tail.prev; - if (this.tail) { - this.tail.next = null; - } else { - this.head = null; - } - this.length--; - return res; - }; - - Yallist.prototype.shift = function () { - if (!this.head) { - return undefined; - } - - var res = this.head.value; - this.head = this.head.next; - if (this.head) { - this.head.prev = null; - } else { - this.tail = null; - } - this.length--; - return res; - }; - - Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this; - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this); - walker = walker.next; - } - }; + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested - Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this; - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this); - walker = walker.prev; + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); } - }; - Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next; - } - if (i === n && walker !== null) { - return walker.value; - } - }; + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev; - } - if (i === n && walker !== null) { - return walker.value; - } - }; + msecs += 12219292800000; // `time_low` - Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this; - var res = new Yallist(); - for (var walker = this.head; walker !== null; ) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.next; - } - return res; - }; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = (tl >>> 24) & 0xff; + b[i++] = (tl >>> 16) & 0xff; + b[i++] = (tl >>> 8) & 0xff; + b[i++] = tl & 0xff; // `time_mid` - Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this; - var res = new Yallist(); - for (var walker = this.tail; walker !== null; ) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.prev; - } - return res; - }; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + b[i++] = (tmh >>> 8) & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` - Yallist.prototype.reduce = function (fn, initial) { - var acc; - var walker = this.head; - if (arguments.length > 1) { - acc = initial; - } else if (this.head) { - walker = this.head.next; - acc = this.head.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); - } + b[i++] = ((tmh >>> 24) & 0xf) | 0x10; // include version - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i); - walker = walker.next; - } + b[i++] = (tmh >>> 16) & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - return acc; - }; + b[i++] = (clockseq >>> 8) | 0x80; // `clock_seq_low` - Yallist.prototype.reduceReverse = function (fn, initial) { - var acc; - var walker = this.tail; - if (arguments.length > 1) { - acc = initial; - } else if (this.tail) { - walker = this.tail.prev; - acc = this.tail.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); - } + b[i++] = clockseq & 0xff; // `node` - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i); - walker = walker.prev; + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; } - return acc; - }; + return buf || (0, _stringify.default)(b); + } - Yallist.prototype.toArray = function () { - var arr = new Array(this.length); - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value; - walker = walker.next; - } - return arr; - }; + var _default = v1; + exports["default"] = _default; - Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length); - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value; - walker = walker.prev; - } - return arr; - }; + /***/ + }, - Yallist.prototype.slice = function (from, to) { - to = to || this.length; - if (to < 0) { - to += this.length; - } - from = from || 0; - if (from < 0) { - from += this.length; - } - var ret = new Yallist(); - if (to < from || to < 0) { - return ret; - } - if (from < 0) { - from = 0; - } - if (to > this.length) { - to = this.length; - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next; - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value); - } - return ret; - }; + /***/ 8638: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length; - if (to < 0) { - to += this.length; - } - from = from || 0; - if (from < 0) { - from += this.length; - } - var ret = new Yallist(); - if (to < from || to < 0) { - return ret; - } - if (from < 0) { - from = 0; - } - if (to > this.length) { - to = this.length; - } - for ( - var i = this.length, walker = this.tail; - walker !== null && i > to; - i-- - ) { - walker = walker.prev; - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value); - } - return ret; - }; + var _v = _interopRequireDefault(__nccwpck_require__(6694)); - Yallist.prototype.splice = function (start, deleteCount, ...nodes) { - if (start > this.length) { - start = this.length - 1; - } - if (start < 0) { - start = this.length + start; - } + var _md = _interopRequireDefault(__nccwpck_require__(7276)); - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next; - } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - var ret = []; - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value); - walker = this.removeNode(walker); - } - if (walker === null) { - walker = this.tail; - } + const v3 = (0, _v.default)("v3", 0x30, _md.default); + var _default = v3; + exports["default"] = _default; - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev; - } + /***/ + }, - for (var i = 0; i < nodes.length; i++) { - walker = insert(this, walker, nodes[i]); - } - return ret; - }; + /***/ 6694: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = _default; + exports.URL = exports.DNS = void 0; - Yallist.prototype.reverse = function () { - var head = this.head; - var tail = this.tail; - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev; - walker.prev = walker.next; - walker.next = p; - } - this.head = tail; - this.tail = head; - return this; - }; + var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); - function insert(self, node, value) { - var inserted = - node === self.head - ? new Node(value, null, node, self) - : new Node(value, node, node.next, self); + var _parse = _interopRequireDefault(__nccwpck_require__(8951)); - if (inserted.next === null) { - self.tail = inserted; - } - if (inserted.prev === null) { - self.head = inserted; - } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - self.length++; + function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape - return inserted; - } + const bytes = []; - function push(self, item) { - self.tail = new Node(item, self.tail, null, self); - if (!self.head) { - self.head = self.tail; + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); } - self.length++; - } - function unshift(self, item) { - self.head = new Node(item, null, self.head, self); - if (!self.tail) { - self.tail = self.head; - } - self.length++; + return bytes; } - function Node(value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list); - } - - this.list = list; - this.value = value; + const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; + exports.DNS = DNS; + const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; + exports.URL = URL; - if (prev) { - prev.next = this; - this.prev = prev; - } else { - this.prev = null; - } + function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === "string") { + value = stringToBytes(value); + } - if (next) { - next.prev = this; - this.next = next; - } else { - this.next = null; - } - } + if (typeof namespace === "string") { + namespace = (0, _parse.default)(namespace); + } - try { - // add if support for Symbol.iterator is present - __nccwpck_require__(2224)(Yallist); - } catch (er) {} + if (namespace.length !== 16) { + throw TypeError( + "Namespace must be array-like (16 iterable integer values, 0-255)" + ); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` - /***/ - }, + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; - /***/ 474: /***/ ( - module, - __unused_webpack___webpack_exports__, - __nccwpck_require__ - ) => { - __nccwpck_require__.a( - module, - async ( - __webpack_handle_async_dependencies__, - __webpack_async_result__ - ) => { - try { - /* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = - __nccwpck_require__(7733); - /* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0___default = - /*#__PURE__*/ __nccwpck_require__.n( - _actions_core__WEBPACK_IMPORTED_MODULE_0__ - ); - /* harmony import */ var _actions_github__WEBPACK_IMPORTED_MODULE_1__ = - __nccwpck_require__(3695); - /* harmony import */ var _actions_github__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __nccwpck_require__.n( - _actions_github__WEBPACK_IMPORTED_MODULE_1__ - ); - /* harmony import */ var all_contributors_for_repository__WEBPACK_IMPORTED_MODULE_2__ = - __nccwpck_require__(6219); - /* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3__ = - __nccwpck_require__(5601); + if (buf) { + offset = offset || 0; - _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( - "About to retrieve contributors..." - ); - const githubToken = process.env.GITHUB_TOKEN; - const contributors = await (0, - all_contributors_for_repository__WEBPACK_IMPORTED_MODULE_2__ /* .createAllContributorsForRepository */.J)( - { - auth: githubToken, - owner: - _actions_github__WEBPACK_IMPORTED_MODULE_1__.context.repo.owner, - repo: _actions_github__WEBPACK_IMPORTED_MODULE_1__.context.repo - .repo, - } - ); - _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( - `Retrieved contributors: ${JSON.stringify(contributors, null, 4)}` - ); - for (const [contributor, contributions] of Object.entries( - contributors - )) { - _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( - `Adding contributor: ${contributor} (${contributions.join(",")})` - ); - await (0, execa__WEBPACK_IMPORTED_MODULE_3__.$)({ - env: { GITHUB_TOKEN: githubToken }, - })`npx -y all-contributors add ${contributor} ${contributions.join( - "," - )}`; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; } - __webpack_async_result__(); - } catch (e) { - __webpack_async_result__(e); + return buf; } - }, - 1 - ); - - /***/ - }, - /***/ 326: /***/ (module) => { - module.exports = eval("require")("encoding"); + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) - /***/ - }, + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support - /***/ 9491: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "assert" - ); + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; + } /***/ }, - /***/ 4300: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "buffer" - ); + /***/ 3519: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - /***/ - }, + var _rng = _interopRequireDefault(__nccwpck_require__(7548)); - /***/ 2081: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "child_process" - ); + var _stringify = _interopRequireDefault(__nccwpck_require__(9729)); - /***/ - }, + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - /***/ 6113: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "crypto" - ); + function v4(options, buf, offset) { + options = options || {}; - /***/ - }, + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - /***/ 2361: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "events" - ); + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided - /***/ - }, + if (buf) { + offset = offset || 0; - /***/ 7147: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } - /***/ - }, + return buf; + } - /***/ 3685: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); + return (0, _stringify.default)(rnds); + } + + var _default = v4; + exports["default"] = _default; /***/ }, - /***/ 5687: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); + /***/ 8239: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - /***/ - }, + var _v = _interopRequireDefault(__nccwpck_require__(6694)); - /***/ 1808: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); + var _sha = _interopRequireDefault(__nccwpck_require__(3557)); - /***/ - }, + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - /***/ 2037: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); + const v5 = (0, _v.default)("v5", 0x50, _sha.default); + var _default = v5; + exports["default"] = _default; /***/ }, - /***/ 1017: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); + /***/ 6009: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - /***/ - }, + var _regex = _interopRequireDefault(__nccwpck_require__(646)); - /***/ 5477: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "punycode" - ); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - /***/ - }, + function validate(uuid) { + return typeof uuid === "string" && _regex.default.test(uuid); + } - /***/ 2781: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( - "stream" - ); + var _default = validate; + exports["default"] = _default; /***/ }, - /***/ 4404: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); + /***/ 3609: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports["default"] = void 0; - /***/ - }, + var _validate = _interopRequireDefault(__nccwpck_require__(6009)); - /***/ 7310: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } - /***/ - }, + function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError("Invalid UUID"); + } - /***/ 3837: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); + return parseInt(uuid.substr(14, 1), 16); + } + + var _default = version; + exports["default"] = _default; /***/ }, - /***/ 9796: /***/ (module) => { - module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); + /***/ 7027: /***/ (module) => { + var conversions = {}; + module.exports = conversions; + + function sign(x) { + return x < 0 ? -1 : 1; + } + + function evenRound(x) { + // Round x to the nearest integer, choosing the even integer if it lies halfway between two. + if (x % 1 === 0.5 && (x & 1) === 0) { + // [even number].5; round down (i.e. floor) + return Math.floor(x); + } else { + return Math.round(x); + } + } + + function createNumberConversion(bitLength, typeOpts) { + if (!typeOpts.unsigned) { + --bitLength; + } + const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); + const upperBound = Math.pow(2, bitLength) - 1; + + const moduloVal = typeOpts.moduloBitLength + ? Math.pow(2, typeOpts.moduloBitLength) + : Math.pow(2, bitLength); + const moduloBound = typeOpts.moduloBitLength + ? Math.pow(2, typeOpts.moduloBitLength - 1) + : Math.pow(2, bitLength - 1); + + return function (V, opts) { + if (!opts) opts = {}; + + let x = +V; + + if (opts.enforceRange) { + if (!Number.isFinite(x)) { + throw new TypeError("Argument is not a finite number"); + } + + x = sign(x) * Math.floor(Math.abs(x)); + if (x < lowerBound || x > upperBound) { + throw new TypeError("Argument is not in byte range"); + } + + return x; + } + + if (!isNaN(x) && opts.clamp) { + x = evenRound(x); + + if (x < lowerBound) x = lowerBound; + if (x > upperBound) x = upperBound; + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + x = sign(x) * Math.floor(Math.abs(x)); + x = x % moduloVal; + + if (!typeOpts.unsigned && x >= moduloBound) { + return x - moduloVal; + } else if (typeOpts.unsigned) { + if (x < 0) { + x += moduloVal; + } else if (x === -0) { + // don't return negative zero + return 0; + } + } + + return x; + }; + } + + conversions["void"] = function () { + return undefined; + }; + + conversions["boolean"] = function (val) { + return !!val; + }; + + conversions["byte"] = createNumberConversion(8, { unsigned: false }); + conversions["octet"] = createNumberConversion(8, { unsigned: true }); + + conversions["short"] = createNumberConversion(16, { unsigned: false }); + conversions["unsigned short"] = createNumberConversion(16, { + unsigned: true, + }); + + conversions["long"] = createNumberConversion(32, { unsigned: false }); + conversions["unsigned long"] = createNumberConversion(32, { + unsigned: true, + }); + + conversions["long long"] = createNumberConversion(32, { + unsigned: false, + moduloBitLength: 64, + }); + conversions["unsigned long long"] = createNumberConversion(32, { + unsigned: true, + moduloBitLength: 64, + }); + + conversions["double"] = function (V) { + const x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError("Argument is not a finite floating-point value"); + } + + return x; + }; + + conversions["unrestricted double"] = function (V) { + const x = +V; + + if (isNaN(x)) { + throw new TypeError("Argument is NaN"); + } + + return x; + }; + + // not quite valid, but good enough for JS + conversions["float"] = conversions["double"]; + conversions["unrestricted float"] = conversions["unrestricted double"]; + + conversions["DOMString"] = function (V, opts) { + if (!opts) opts = {}; + + if (opts.treatNullAsEmptyString && V === null) { + return ""; + } + + return String(V); + }; + + conversions["ByteString"] = function (V, opts) { + const x = String(V); + let c = undefined; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw new TypeError("Argument is not a valid bytestring"); + } + } + + return x; + }; + + conversions["USVString"] = function (V) { + const S = String(V); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xd800 || c > 0xdfff) { + U.push(String.fromCodePoint(c)); + } else if (0xdc00 <= c && c <= 0xdfff) { + U.push(String.fromCodePoint(0xfffd)); + } else { + if (i === n - 1) { + U.push(String.fromCodePoint(0xfffd)); + } else { + const d = S.charCodeAt(i + 1); + if (0xdc00 <= d && d <= 0xdfff) { + const a = c & 0x3ff; + const b = d & 0x3ff; + U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xfffd)); + } + } + } + } + + return U.join(""); + }; + + conversions["Date"] = function (V, opts) { + if (!(V instanceof Date)) { + throw new TypeError("Argument is not a Date object"); + } + if (isNaN(V)) { + return undefined; + } + + return V; + }; + + conversions["RegExp"] = function (V, opts) { + if (!(V instanceof RegExp)) { + V = new RegExp(V); + } + + return V; + }; /***/ }, - /***/ 6219: /***/ ( - __unused_webpack___webpack_module__, - __webpack_exports__, - __nccwpck_require__ - ) => { - // EXPORTS - __nccwpck_require__.d(__webpack_exports__, { - J: () => /* binding */ createAllContributorsForRepository, - }); // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/ContributorsCollection.js + /***/ 7516: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + const usm = __nccwpck_require__(4422); - var __classPrivateFieldSet = - (undefined && undefined.__classPrivateFieldSet) || - function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if ( - typeof state === "function" - ? receiver !== state || !f - : !state.has(receiver) - ) - throw new TypeError( - "Cannot write private member to an object whose class did not declare it" - ); - return ( - kind === "a" - ? f.call(receiver, value) - : f - ? (f.value = value) - : state.set(receiver, value), - value - ); - }; - var __classPrivateFieldGet = - (undefined && undefined.__classPrivateFieldGet) || - function (receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if ( - typeof state === "function" - ? receiver !== state || !f - : !state.has(receiver) - ) - throw new TypeError( - "Cannot read private member from an object whose class did not declare it" - ); - return kind === "m" - ? f - : kind === "a" - ? f.call(receiver) - : f - ? f.value - : state.get(receiver); - }; - var _ContributorsCollection_contributors, - _ContributorsCollection_ignoredLogins; - class ContributorsCollection { - constructor(ignoredLogins) { - _ContributorsCollection_contributors.set(this, {}); - _ContributorsCollection_ignoredLogins.set(this, void 0); - __classPrivateFieldSet( - this, - _ContributorsCollection_ignoredLogins, - ignoredLogins, - "f" - ); + exports.implementation = class URLImpl { + constructor(constructorArgs) { + const url = constructorArgs[0]; + const base = constructorArgs[1]; + + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === "failure") { + throw new TypeError("Invalid base URL"); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); + } + + this._url = parsedURL; + + // TODO: query stuff } - add(login, type) { - if ( - login && - !__classPrivateFieldGet( - this, - _ContributorsCollection_ignoredLogins, - "f" - ).has(login) - ) { - (__classPrivateFieldGet( - this, - _ContributorsCollection_contributors, - "f" - )[login.toLowerCase()] ??= new Set()).add(type); + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); } + + this._url = parsedURL; } - collect() { - return Object.fromEntries( - Object.entries( - __classPrivateFieldGet( - this, - _ContributorsCollection_contributors, - "f" - ) - ) - .map(([contributor, types]) => [ - contributor, - Array.from(types).sort(), - ]) - .sort(([a], [b]) => a.localeCompare(b)) - ); + + get origin() { + return usm.serializeURLOrigin(this._url); } - } - (_ContributorsCollection_contributors = new WeakMap()), - (_ContributorsCollection_ignoredLogins = new WeakMap()); - //# sourceMappingURL=ContributorsCollection.js.map - // EXTERNAL MODULE: ./node_modules/.pnpm/octokit@2.0.14/node_modules/octokit/dist-node/index.js - var dist_node = __nccwpck_require__(5953); // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/collect/api.js - const perPage = 100; - function createOctokit(auth) { - return new (dist_node /* Octokit.defaults */.vd - .defaults({ - headers: { - "X-GitHub-Api-Version": "2022-11-28", - }, - per_page: perPage, - }))({ auth }); - } - async function paginate(defaults, request) { - const items = []; - for (let i = 0; i < 10; i += 1) { - const response = await request({ - page: i, - per_page: perPage, - ...defaults, + + get protocol() { + return this._url.scheme + ":"; + } + + set protocol(v) { + usm.basicURLParse(v + ":", { + url: this._url, + stateOverride: "scheme start", }); - items.push(...response); - if (response.length < 100) { - break; + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; } + + usm.setTheUsername(this._url, v); } - return items; - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/collect/collectAcceptedIssues.js - //# sourceMappingURL=api.js.map - async function collectAcceptedIssues(defaults, octokit, labelAcceptingPrs) { - const issues = await paginate(defaults, async (options) => { - const response = await octokit.request( - "GET /repos/{owner}/{repo}/issues", - { - ...options, - labels: labelAcceptingPrs, - state: "all", - } - ); - return response.data; - }); - return Object.fromEntries(issues.map((issue) => [issue.number, issue])); - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/collect/collectEvents.js - //# sourceMappingURL=collectAcceptedIssues.js.map - async function collectEvents(defaults, octokit) { - const events = await paginate(defaults, async (options) => { - const eventsResponse = await octokit.request( - "GET /repos/{owner}/{repo}/events", - { - ...options, - state: "all", - } - ); - return eventsResponse.data; - }); - return events; - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/collect/collectIssueEvents.js - //# sourceMappingURL=collectEvents.js.map - const relevantIssueEvents = new Set([ - "assigned", - "locked", - "merged", - "pinned", - "unlocked", - ]); - async function collectIssueEvents(defaults, octokit) { - const issueEvents = await paginate(defaults, async (options) => { - const response = await octokit.request( - "GET /repos/{owner}/{repo}/issues/events", - { - ...options, - state: "all", - } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return ( + usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port) ); - return response.data; - }); - return issueEvents.filter((issueEvent) => - relevantIssueEvents.has(issueEvent.event) - ); - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/collect/collectMergedPulls.js - //# sourceMappingURL=collectIssueEvents.js.map - async function collectMergedPulls(defaults, octokit) { - return await paginate(defaults, async (options) => { - const response = await octokit.request("GET /search/issues", { - ...options, - q: "repo:JoshuaKGoldberg/template-typescript-node-package+is:pr+is:merged", - }); - return response.data.items; - }); - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/collect/index.js - //# sourceMappingURL=collectMergedPulls.js.map - async function collect(options) { - const contributors = new ContributorsCollection(options.ignoredLogins); - const defaults = { owner: options.owner, repo: options.repo }; - const octokit = createOctokit(options.auth); - const [acceptedIssues, events, issueEvents, mergedPulls] = - await Promise.all([ - collectAcceptedIssues(defaults, octokit, options.labelAcceptingPrs), - collectEvents(defaults, octokit), - collectIssueEvents(defaults, octokit), - collectMergedPulls(defaults, octokit), - ]); - for (const acceptedIssue of Object.values(acceptedIssues)) { - const labels = acceptedIssue.labels.map((label) => - typeof label === "string" ? label : label.name + } + + set host(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + if (this._url.cannotBeABaseURL) { + return this._url.path[0]; + } + + if (this._url.path.length === 0) { + return ""; + } + + return "/" + this._url.path.join("/"); + } + + set pathname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return "?" + this._url.query; + } + + set search(v) { + // TODO: query stuff + + const url = this._url; + + if (v === "") { + url.query = null; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return "#" + this._url.fragment; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } + }; + + /***/ + }, + + /***/ 2932: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const conversions = __nccwpck_require__(7027); + const utils = __nccwpck_require__(8494); + const Impl = __nccwpck_require__(7516); + + const impl = utils.implSymbol; + + function URL(url) { + if (!this || this[impl] || !(this instanceof URL)) { + throw new TypeError( + "Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function." ); - for (const [labelType, contribution] of [ - // 🐛 `bug`: anybody who filed an issue labeled as accepting PRs and a bug - [options.labelTypeBug, "bug"], - // - 📖 `doc`: authors of merged PRs that address issues labeled as docs - [options.labelTypeDocs, "docs"], - // - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling - [options.labelTypeTool, "tool"], - ]) { - if (labels.some((label) => label === labelType)) { - contributors.add(acceptedIssue.user?.login, contribution); + } + if (arguments.length < 1) { + throw new TypeError( + "Failed to construct 'URL': 1 argument required, but only " + + arguments.length + + " present." + ); + } + const args = []; + for (let i = 0; i < arguments.length && i < 2; ++i) { + args[i] = arguments[i]; + } + args[0] = conversions["USVString"](args[0]); + if (args[1] !== undefined) { + args[1] = conversions["USVString"](args[1]); + } + + module.exports.setup(this, args); + } + + URL.prototype.toJSON = function toJSON() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + const args = []; + for (let i = 0; i < arguments.length && i < 0; ++i) { + args[i] = arguments[i]; + } + return this[impl].toJSON.apply(this[impl], args); + }; + Object.defineProperty(URL.prototype, "href", { + get() { + return this[impl].href; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].href = V; + }, + enumerable: true, + configurable: true, + }); + + URL.prototype.toString = function () { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return this.href; + }; + + Object.defineProperty(URL.prototype, "origin", { + get() { + return this[impl].origin; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "protocol", { + get() { + return this[impl].protocol; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].protocol = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "username", { + get() { + return this[impl].username; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].username = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "password", { + get() { + return this[impl].password; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].password = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "host", { + get() { + return this[impl].host; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].host = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "hostname", { + get() { + return this[impl].hostname; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].hostname = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "port", { + get() { + return this[impl].port; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].port = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "pathname", { + get() { + return this[impl].pathname; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].pathname = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "search", { + get() { + return this[impl].search; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].search = V; + }, + enumerable: true, + configurable: true, + }); + + Object.defineProperty(URL.prototype, "hash", { + get() { + return this[impl].hash; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].hash = V; + }, + enumerable: true, + configurable: true, + }); + + module.exports = { + is(obj) { + return !!obj && obj[impl] instanceof Impl.implementation; + }, + create(constructorArgs, privateData) { + let obj = Object.create(URL.prototype); + this.setup(obj, constructorArgs, privateData); + return obj; + }, + setup(obj, constructorArgs, privateData) { + if (!privateData) privateData = {}; + privateData.wrapper = obj; + + obj[impl] = new Impl.implementation(constructorArgs, privateData); + obj[impl][utils.wrapperSymbol] = obj; + }, + interface: URL, + expose: { + Window: { URL: URL }, + Worker: { URL: URL }, + }, + }; + + /***/ + }, + + /***/ 9501: /***/ (__unused_webpack_module, exports, __nccwpck_require__) => { + exports.URL = __nccwpck_require__(2932)["interface"]; + exports.serializeURL = __nccwpck_require__(4422).serializeURL; + exports.serializeURLOrigin = __nccwpck_require__(4422).serializeURLOrigin; + exports.basicURLParse = __nccwpck_require__(4422).basicURLParse; + exports.setTheUsername = __nccwpck_require__(4422).setTheUsername; + exports.setThePassword = __nccwpck_require__(4422).setThePassword; + exports.serializeHost = __nccwpck_require__(4422).serializeHost; + exports.serializeInteger = __nccwpck_require__(4422).serializeInteger; + exports.parseURL = __nccwpck_require__(4422).parseURL; + + /***/ + }, + + /***/ 4422: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + const punycode = __nccwpck_require__(5477); + const tr46 = __nccwpck_require__(8684); + + const specialSchemes = { + ftp: 21, + file: null, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443, + }; + + const failure = Symbol("failure"); + + function countSymbols(str) { + return punycode.ucs2.decode(str).length; + } + + function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); + } + + function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; + } + + function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a); + } + + function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); + } + + function isASCIIHex(c) { + return ( + isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66) + ); + } + + function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; + } + + function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return ( + buffer === ".." || + buffer === "%2e." || + buffer === ".%2e" || + buffer === "%2e%2e" + ); + } + + function isWindowsDriveLetterCodePoints(cp1, cp2) { + return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); + } + + function isWindowsDriveLetterString(string) { + return ( + string.length === 2 && + isASCIIAlpha(string.codePointAt(0)) && + (string[1] === ":" || string[1] === "|") + ); + } + + function isNormalizedWindowsDriveLetterString(string) { + return ( + string.length === 2 && + isASCIIAlpha(string.codePointAt(0)) && + string[1] === ":" + ); + } + + function containsForbiddenHostCodePoint(string) { + return ( + string.search( + /\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/ + ) !== -1 + ); + } + + function containsForbiddenHostCodePointExcludingPercent(string) { + return ( + string.search( + /\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/ + ) !== -1 + ); + } + + function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; + } + + function isSpecial(url) { + return isSpecialScheme(url.scheme); + } + + function defaultPort(scheme) { + return specialSchemes[scheme]; + } + + function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = "0" + hex; + } + + return "%" + hex; + } + + function utf8PercentEncode(c) { + const buf = new Buffer(c); + + let str = ""; + + for (let i = 0; i < buf.length; ++i) { + str += percentEncode(buf[i]); + } + + return str; + } + + function utf8PercentDecode(str) { + const input = new Buffer(str); + const output = []; + for (let i = 0; i < input.length; ++i) { + if (input[i] !== 37) { + output.push(input[i]); + } else if ( + input[i] === 37 && + isASCIIHex(input[i + 1]) && + isASCIIHex(input[i + 2]) + ) { + output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); + i += 2; + } else { + output.push(input[i]); + } + } + return new Buffer(output).toString(); + } + + function isC0ControlPercentEncode(c) { + return c <= 0x1f || c > 0x7e; + } + + const extraPathPercentEncodeSet = new Set([ + 32, 34, 35, 60, 62, 63, 96, 123, 125, + ]); + function isPathPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); + } + + const extraUserinfoPercentEncodeSet = new Set([ + 47, 58, 59, 61, 64, 91, 92, 93, 94, 124, + ]); + function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); + } + + function percentEncodeChar(c, encodeSetPredicate) { + const cStr = String.fromCodePoint(c); + + if (encodeSetPredicate(c)) { + return utf8PercentEncode(cStr); + } + + return cStr; + } + + function parseIPv4Number(input) { + let R = 10; + + if ( + input.length >= 2 && + input.charAt(0) === "0" && + input.charAt(1).toLowerCase() === "x" + ) { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + const regex = R === 10 ? /[^0-9]/ : R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); + } + + function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return input; + } + + const numbers = []; + for (const part of parts) { + if (part === "") { + return input; + } + const n = parseIPv4Number(part); + if (n === failure) { + return input; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * Math.pow(256, 3 - counter); + ++counter; + } + + return ipv4; + } + + function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = "." + output; + } + n = Math.floor(n / 256); + } + + return output; + } + + function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = punycode.ucs2.decode(input); + + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === 58) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === 46) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!isASCIIDigit(input[pointer])) { + return failure; + } + + while (isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === 58) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; + } + + function serializeIPv6(address) { + let output = ""; + const seqResult = findLongestZeroSequence(address); + const compress = seqResult.idx; + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; + } + + function parseHost(input, isSpecialArg) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (!isSpecialArg) { + return parseOpaqueHost(input); + } + + const domain = utf8PercentDecode(input); + const asciiDomain = tr46.toASCII( + domain, + false, + tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, + false + ); + if (asciiDomain === null) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + const ipv4Host = parseIPv4(asciiDomain); + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; + } + + return asciiDomain; + } + + function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + let output = ""; + const decoded = punycode.ucs2.decode(input); + for (let i = 0; i < decoded.length; ++i) { + output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); + } + return output; + } + + function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; // only find elements > 1 + let currStart = null; + let currLen = 0; + + for (let i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + ++currLen; + } + } + + // if trailing zeros + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + return { + idx: maxIdx, + len: maxLen, + }; + } + + function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; + } + + return host; + } + + function trimControlChars(url) { + return url.replace( + /^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, + "" + ); + } + + function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/g, ""); + } + + function shortenPath(url) { + const path = url.path; + if (path.length === 0) { + return; + } + if ( + url.scheme === "file" && + path.length === 1 && + isNormalizedWindowsDriveLetter(path[0]) + ) { + return; + } + + path.pop(); + } + + function includesCredentials(url) { + return url.username !== "" || url.password !== ""; + } + + function cannotHaveAUsernamePasswordPort(url) { + return ( + url.host === null || + url.host === "" || + url.cannotBeABaseURL || + url.scheme === "file" + ); + } + + function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); + } + + function URLStateMachine( + input, + base, + encodingOverride, + url, + stateOverride + ) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + + cannotBeABaseURL: false, + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = punycode.ucs2.decode(this.input); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this["parse " + this.state](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } + } + + URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart( + c, + cStr + ) { + if (isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; + }; + + URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ( + (includesCredentials(this.url) || this.url.port !== null) && + this.buffer === "file" + ) { + return false; + } + + if ( + this.url.scheme === "file" && + (this.url.host === "" || this.url.host === null) + ) { + return false; + } + } + this.url.scheme = this.buffer; + this.buffer = ""; + if (this.stateOverride) { + return false; + } + if (this.url.scheme === "file") { + if ( + this.input[this.pointer + 1] !== 47 || + this.input[this.pointer + 2] !== 47 + ) { + this.parseError = true; + } + this.state = "file"; + } else if ( + isSpecial(this.url) && + this.base !== null && + this.base.scheme === this.url.scheme + ) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; + }; + + URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { + return failure; + } else if (this.base.cannotBeABaseURL && c === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse special relative or authority"] = + function parseSpecialRelativeOrAuthority(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse path or authority"] = + function parsePathOrAuthority(c) { + if (c === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (isNaN(c)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 47) { + this.state = "relative slash"; + } else if (c === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse relative slash"] = + function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === 47 || c === 92)) { + if (c === 92) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse special authority slashes"] = + function parseSpecialAuthoritySlashes(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse special authority ignore slashes"] = + function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== 47 && c !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; + }; + + URLStateMachine.prototype["parse authority"] = function parseAuthority( + c, + cStr + ) { + if (c === 64) { + this.parseError = true; + if (this.atFlag) { + this.buffer = "%40" + this.buffer; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = percentEncodeChar( + codePoint, + isUserinfoPercentEncode + ); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if ( + isNaN(c) || + c === 47 || + c === 63 || + c === 35 || + (isSpecial(this.url) && c === 92) + ) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; + }; + + URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype[ + "parse host" + ] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + if (this.stateOverride === "hostname") { + return false; + } + } else if ( + isNaN(c) || + c === 47 || + c === 63 || + c === 35 || + (isSpecial(this.url) && c === 92) + ) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if ( + this.stateOverride && + this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null) + ) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === 91) { + this.arrFlag = true; + } else if (c === 93) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; + }; + + URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (isASCIIDigit(c)) { + this.buffer += cStr; + } else if ( + isNaN(c) || + c === 47 || + c === 63 || + c === 35 || + (isSpecial(this.url) && c === 92) || + this.stateOverride + ) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; + }; + + const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + + URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if ( + this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points + !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || + (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points + !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) + ) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } + } + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse file host"] = function parseFileHost( + c, + cStr + ) { + if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; } + + this.buffer = ""; + this.state = "path start"; } + } else { + this.buffer += cStr; } - // 💻 `code`: all PR authors and co-authors - for (const mergedPull of mergedPulls) { - contributors.add(mergedPull.user?.login, "code"); - for (const coAuthor of mergedPull.body - ?.match(/co-authored-by:.+/gi) - ?.map((text) => text.match(/@(\S+)/)) ?? []) { - contributors.add(coAuthor?.[1], "code"); + + return true; + }; + + URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === 92) { + this.parseError = true; } - } - // 🚧 `maintenance`: adding labels to issues and PRs, and merging PRs - const maintainers = new Set(); - for (const event of issueEvents) { - if (event.actor) { - contributors.add(event.actor.login, "maintenance"); - maintainers.add(event.actor.login); + this.state = "path"; + + if (c !== 47 && c !== 92) { + --this.pointer; + } + } else if (!this.stateOverride && c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== 47) { + --this.pointer; } } - // 👀 `review`: submitting a review for a PR - // (restricted just to users marked as maintainers) - for (const event of events) { + + return true; + }; + + URLStateMachine.prototype["parse path"] = function parsePath(c) { + if ( + isNaN(c) || + c === 47 || + (isSpecial(this.url) && c === 92) || + (!this.stateOverride && (c === 63 || c === 35)) + ) { + if (isSpecial(this.url) && c === 92) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } + } else if ( + isSingleDot(this.buffer) && + c !== 47 && + !(isSpecial(this.url) && c === 92) + ) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if ( + this.url.scheme === "file" && + this.url.path.length === 0 && + isWindowsDriveLetterString(this.buffer) + ) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; + } + this.buffer = this.buffer[0] + ":"; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; if ( - event.type === "PullRequestReviewEvent" && - maintainers.has(event.actor.login) + this.url.scheme === "file" && + (c === undefined || c === 63 || c === 35) + ) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if ( + c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2])) ) { - contributors.add(event.actor.login, "review"); + this.parseError = true; } + + this.buffer += percentEncodeChar(c, isPathPercentEncode); } - return contributors.collect(); - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/options.js - //# sourceMappingURL=index.js.map - const defaultOptions = { - ignoredLogins: [ - "allcontributors", - "allcontributors[bot]", - "dependabot", - "dependabot[bot]", - "renovate", - "renovate[bot]", - ], - labelAcceptingPrs: "status: accepting prs", - labelTypeBug: "type: bug", - labelTypeDocs: "type: documentation", - labelTypeTool: "area: tooling", - }; - function fillInOptions(rawOptions) { - return { - auth: rawOptions.auth, - ignoredLogins: new Set( - rawOptions.ignoredLogins ?? defaultOptions.ignoredLogins - ), - labelAcceptingPrs: - rawOptions.labelAcceptingPrs ?? defaultOptions.labelAcceptingPrs, - labelTypeBug: rawOptions.labelTypeBug ?? defaultOptions.labelTypeBug, - labelTypeDocs: rawOptions.labelTypeDocs ?? defaultOptions.labelTypeDocs, - labelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool, - owner: rawOptions.owner, - repo: rawOptions.repo, - }; - } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.5/node_modules/all-contributors-for-repository/lib/index.js - //# sourceMappingURL=options.js.map - async function createAllContributorsForRepository(rawOptions) { - const options = fillInOptions(rawOptions); - return await collect(options); - } - //# sourceMappingURL=index.js.map - /***/ - }, + return true; + }; - /***/ 5601: /***/ ( - __unused_webpack___webpack_module__, - __webpack_exports__, - __nccwpck_require__ - ) => { - // EXPORTS - __nccwpck_require__.d(__webpack_exports__, { - $: () => /* binding */ $, - }); // CONCATENATED MODULE: external "node:buffer" + URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = + function parseCannotBeABaseURLPath(c) { + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== 37) { + this.parseError = true; + } - // UNUSED EXPORTS: execa, execaCommand, execaCommandSync, execaNode, execaSync + if ( + c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2])) + ) { + this.parseError = true; + } - const external_node_buffer_namespaceObject = - __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer"); // CONCATENATED MODULE: external "node:path" - const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire( - import.meta.url - )("node:path"); // CONCATENATED MODULE: external "node:child_process" - const external_node_child_process_namespaceObject = - __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); // CONCATENATED MODULE: external "node:process" - const external_node_process_namespaceObject = - __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process"); - // EXTERNAL MODULE: ./node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js - var cross_spawn = __nccwpck_require__(9859); // CONCATENATED MODULE: ./node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js - function stripFinalNewline(input) { - const LF = typeof input === "string" ? "\n" : "\n".charCodeAt(); - const CR = typeof input === "string" ? "\r" : "\r".charCodeAt(); + if (!isNaN(c)) { + this.url.path[0] = + this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); + } + } - if (input[input.length - 1] === LF) { - input = input.slice(0, -1); - } + return true; + }; - if (input[input.length - 1] === CR) { - input = input.slice(0, -1); - } + URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (isNaN(c) || (!this.stateOverride && c === 35)) { + if ( + !isSpecial(this.url) || + this.url.scheme === "ws" || + this.url.scheme === "wss" + ) { + this.encodingOverride = "utf-8"; + } - return input; - } // CONCATENATED MODULE: external "node:url" + const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead + for (let i = 0; i < buffer.length; ++i) { + if ( + buffer[i] < 0x21 || + buffer[i] > 0x7e || + buffer[i] === 0x22 || + buffer[i] === 0x23 || + buffer[i] === 0x3c || + buffer[i] === 0x3e + ) { + this.url.query += percentEncode(buffer[i]); + } else { + this.url.query += String.fromCodePoint(buffer[i]); + } + } - const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire( - import.meta.url - )("node:url"); // CONCATENATED MODULE: ./node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js - function pathKey(options = {}) { - const { env = process.env, platform = process.platform } = options; + this.buffer = ""; + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if ( + c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2])) + ) { + this.parseError = true; + } - if (platform !== "win32") { - return "PATH"; + this.buffer += cStr; } - return ( - Object.keys(env) - .reverse() - .find((key) => key.toUpperCase() === "PATH") || "Path" - ); - } // CONCATENATED MODULE: ./node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js + return true; + }; - function npmRunPath(options = {}) { - const { - cwd = external_node_process_namespaceObject.cwd(), - path: path_ = external_node_process_namespaceObject.env[pathKey()], - execPath = external_node_process_namespaceObject.execPath, - } = options; + URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (isNaN(c)) { + // do nothing + } else if (c === 0x0) { + this.parseError = true; + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if ( + c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2])) + ) { + this.parseError = true; + } - let previous; - const cwdString = - cwd instanceof URL - ? external_node_url_namespaceObject.fileURLToPath(cwd) - : cwd; - let cwdPath = external_node_path_namespaceObject.resolve(cwdString); - const result = []; - - while (previous !== cwdPath) { - result.push( - external_node_path_namespaceObject.join(cwdPath, "node_modules/.bin") - ); - previous = cwdPath; - cwdPath = external_node_path_namespaceObject.resolve(cwdPath, ".."); + this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); } - // Ensure the running `node` binary is used. - result.push( - external_node_path_namespaceObject.resolve(cwdString, execPath, "..") - ); - - return [...result, path_].join( - external_node_path_namespaceObject.delimiter - ); - } + return true; + }; - function npmRunPathEnv({ - env = external_node_process_namespaceObject.env, - ...options - } = {}) { - env = { ...env }; + function serializeURL(url, excludeFragment) { + let output = url.scheme + ":"; + if (url.host !== null) { + output += "//"; - const path = pathKey({ env }); - options.path = env[path]; - env[path] = npmRunPath(options); + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += ":" + url.password; + } + output += "@"; + } - return env; - } // CONCATENATED MODULE: ./node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js + output += serializeHost(url.host); - const copyProperty = (to, from, property, ignoreNonConfigurable) => { - // `Function#length` should reflect the parameters of `to` not `from` since we keep its body. - // `Function#prototype` is non-writable and non-configurable so can never be modified. - if (property === "length" || property === "prototype") { - return; + if (url.port !== null) { + output += ":" + url.port; + } + } else if (url.host === null && url.scheme === "file") { + output += "//"; } - // `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here. - if (property === "arguments" || property === "caller") { - return; + if (url.cannotBeABaseURL) { + output += url.path[0]; + } else { + for (const string of url.path) { + output += "/" + string; + } } - const toDescriptor = Object.getOwnPropertyDescriptor(to, property); - const fromDescriptor = Object.getOwnPropertyDescriptor(from, property); + if (url.query !== null) { + output += "?" + url.query; + } - if ( - !canCopyProperty(toDescriptor, fromDescriptor) && - ignoreNonConfigurable - ) { - return; + if (!excludeFragment && url.fragment !== null) { + output += "#" + url.fragment; } - Object.defineProperty(to, property, fromDescriptor); - }; + return output; + } - // `Object.defineProperty()` throws if the property exists, is not configurable and either: - // - one its descriptors is changed - // - it is non-writable and its value is changed - const canCopyProperty = function (toDescriptor, fromDescriptor) { - return ( - toDescriptor === undefined || - toDescriptor.configurable || - (toDescriptor.writable === fromDescriptor.writable && - toDescriptor.enumerable === fromDescriptor.enumerable && - toDescriptor.configurable === fromDescriptor.configurable && - (toDescriptor.writable || - toDescriptor.value === fromDescriptor.value)) - ); - }; + function serializeOrigin(tuple) { + let result = tuple.scheme + "://"; + result += serializeHost(tuple.host); - const changePrototype = (to, from) => { - const fromPrototype = Object.getPrototypeOf(from); - if (fromPrototype === Object.getPrototypeOf(to)) { - return; + if (tuple.port !== null) { + result += ":" + tuple.port; } - Object.setPrototypeOf(to, fromPrototype); - }; - - const wrappedToString = (withName, fromBody) => - `/* Wrapped ${withName}*/\n${fromBody}`; + return result; + } - const toStringDescriptor = Object.getOwnPropertyDescriptor( - Function.prototype, - "toString" - ); - const toStringName = Object.getOwnPropertyDescriptor( - Function.prototype.toString, - "name" - ); + module.exports.serializeURL = serializeURL; - // We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected. - // We use `bind()` instead of a closure for the same reason. - // Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times. - const changeToString = (to, from, name) => { - const withName = name === "" ? "" : `with ${name.trim()}() `; - const newToString = wrappedToString.bind(null, withName, from.toString()); - // Ensure `to.toString.toString` is non-enumerable and has the same `same` - Object.defineProperty(newToString, "name", toStringName); - Object.defineProperty(to, "toString", { - ...toStringDescriptor, - value: newToString, - }); + module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin( + module.exports.parseURL(url.path[0]) + ); + } catch (e) { + // serializing an opaque origin returns "null" + return "null"; + } + case "ftp": + case "gopher": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port, + }); + case "file": + // spec says "exercise to the reader", chrome says "file://" + return "file://"; + default: + // serializing an opaque origin returns "null" + return "null"; + } }; - function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) { - const { name } = to; - - for (const property of Reflect.ownKeys(from)) { - copyProperty(to, from, property, ignoreNonConfigurable); + module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; } - changePrototype(to, from); - changeToString(to, from, name); - - return to; - } // CONCATENATED MODULE: ./node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js - - const calledFunctions = new WeakMap(); - - const onetime = (function_, options = {}) => { - if (typeof function_ !== "function") { - throw new TypeError("Expected a function"); + const usm = new URLStateMachine( + input, + options.baseURL, + options.encodingOverride, + options.url, + options.stateOverride + ); + if (usm.failure) { + return "failure"; } - let returnValue; - let callCount = 0; - const functionName = - function_.displayName || function_.name || ""; + return usm.url; + }; - const onetime = function (...arguments_) { - calledFunctions.set(onetime, ++callCount); + module.exports.setTheUsername = function (url, username) { + url.username = ""; + const decoded = punycode.ucs2.decode(username); + for (let i = 0; i < decoded.length; ++i) { + url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } + }; - if (callCount === 1) { - returnValue = function_.apply(this, arguments_); - function_ = null; - } else if (options.throw === true) { - throw new Error( - `Function \`${functionName}\` can only be called once` - ); - } + module.exports.setThePassword = function (url, password) { + url.password = ""; + const decoded = punycode.ucs2.decode(password); + for (let i = 0; i < decoded.length; ++i) { + url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } + }; - return returnValue; - }; + module.exports.serializeHost = serializeHost; - mimicFunction(onetime, function_); - calledFunctions.set(onetime, callCount); + module.exports.cannotHaveAUsernamePasswordPort = + cannotHaveAUsernamePasswordPort; - return onetime; + module.exports.serializeInteger = function (integer) { + return String(integer); }; - onetime.callCount = (function_) => { - if (!calledFunctions.has(function_)) { - throw new Error( - `The given function \`${function_.name}\` is not wrapped by the \`onetime\` package` - ); + module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; } - return calledFunctions.get(function_); + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { + baseURL: options.baseURL, + encodingOverride: options.encodingOverride, + }); }; - /* harmony default export */ const node_modules_onetime = onetime; // CONCATENATED MODULE: external "node:os" + /***/ + }, - const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire( - import.meta.url - )("node:os"); // CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/realtime.js - const getRealtimeSignals = () => { - const length = SIGRTMAX - SIGRTMIN + 1; - return Array.from({ length }, getRealtimeSignal); + /***/ 8494: /***/ (module) => { + module.exports.mixin = function mixin(target, source) { + const keys = Object.getOwnPropertyNames(source); + for (let i = 0; i < keys.length; ++i) { + Object.defineProperty( + target, + keys[i], + Object.getOwnPropertyDescriptor(source, keys[i]) + ); + } }; - const getRealtimeSignal = (value, index) => ({ - name: `SIGRT${index + 1}`, - number: SIGRTMIN + index, - action: "terminate", - description: "Application-specific signal (realtime)", - standard: "posix", - }); + module.exports.wrapperSymbol = Symbol("wrapper"); + module.exports.implSymbol = Symbol("impl"); - const SIGRTMIN = 34; - const SIGRTMAX = 64; // CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/core.js - const SIGNALS = [ - { - name: "SIGHUP", - number: 1, - action: "terminate", - description: "Terminal closed", - standard: "posix", - }, - { - name: "SIGINT", - number: 2, - action: "terminate", - description: "User interruption with CTRL-C", - standard: "ansi", - }, - { - name: "SIGQUIT", - number: 3, - action: "core", - description: "User interruption with CTRL-\\", - standard: "posix", - }, - { - name: "SIGILL", - number: 4, - action: "core", - description: "Invalid machine instruction", - standard: "ansi", - }, - { - name: "SIGTRAP", - number: 5, - action: "core", - description: "Debugger breakpoint", - standard: "posix", - }, - { - name: "SIGABRT", - number: 6, - action: "core", - description: "Aborted", - standard: "ansi", - }, - { - name: "SIGIOT", - number: 6, - action: "core", - description: "Aborted", - standard: "bsd", - }, - { - name: "SIGBUS", - number: 7, - action: "core", - description: - "Bus error due to misaligned, non-existing address or paging error", - standard: "bsd", - }, - { - name: "SIGEMT", - number: 7, - action: "terminate", - description: "Command should be emulated but is not implemented", - standard: "other", - }, - { - name: "SIGFPE", - number: 8, - action: "core", - description: "Floating point arithmetic error", - standard: "ansi", - }, - { - name: "SIGKILL", - number: 9, - action: "terminate", - description: "Forced termination", - standard: "posix", - forced: true, - }, - { - name: "SIGUSR1", - number: 10, - action: "terminate", - description: "Application-specific signal", - standard: "posix", - }, - { - name: "SIGSEGV", - number: 11, - action: "core", - description: "Segmentation fault", - standard: "ansi", - }, - { - name: "SIGUSR2", - number: 12, - action: "terminate", - description: "Application-specific signal", - standard: "posix", - }, - { - name: "SIGPIPE", - number: 13, - action: "terminate", - description: "Broken pipe or socket", - standard: "posix", - }, - { - name: "SIGALRM", - number: 14, - action: "terminate", - description: "Timeout or timer", - standard: "posix", - }, - { - name: "SIGTERM", - number: 15, - action: "terminate", - description: "Termination", - standard: "ansi", - }, - { - name: "SIGSTKFLT", - number: 16, - action: "terminate", - description: "Stack is empty or overflowed", - standard: "other", - }, - { - name: "SIGCHLD", - number: 17, - action: "ignore", - description: "Child process terminated, paused or unpaused", - standard: "posix", - }, - { - name: "SIGCLD", - number: 17, - action: "ignore", - description: "Child process terminated, paused or unpaused", - standard: "other", - }, - { - name: "SIGCONT", - number: 18, - action: "unpause", - description: "Unpaused", - standard: "posix", - forced: true, - }, - { - name: "SIGSTOP", - number: 19, - action: "pause", - description: "Paused", - standard: "posix", - forced: true, - }, - { - name: "SIGTSTP", - number: 20, - action: "pause", - description: 'Paused using CTRL-Z or "suspend"', - standard: "posix", - }, - { - name: "SIGTTIN", - number: 21, - action: "pause", - description: "Background process cannot read terminal input", - standard: "posix", - }, - { - name: "SIGBREAK", - number: 21, - action: "terminate", - description: "User interruption with CTRL-BREAK", - standard: "other", - }, - { - name: "SIGTTOU", - number: 22, - action: "pause", - description: "Background process cannot write to terminal output", - standard: "posix", - }, - { - name: "SIGURG", - number: 23, - action: "ignore", - description: "Socket received out-of-band data", - standard: "bsd", - }, - { - name: "SIGXCPU", - number: 24, - action: "core", - description: "Process timed out", - standard: "bsd", - }, - { - name: "SIGXFSZ", - number: 25, - action: "core", - description: "File too big", - standard: "bsd", - }, - { - name: "SIGVTALRM", - number: 26, - action: "terminate", - description: "Timeout or timer", - standard: "bsd", - }, - { - name: "SIGPROF", - number: 27, - action: "terminate", - description: "Timeout or timer", - standard: "bsd", - }, - { - name: "SIGWINCH", - number: 28, - action: "ignore", - description: "Terminal window size changed", - standard: "bsd", - }, - { - name: "SIGIO", - number: 29, - action: "terminate", - description: "I/O is available", - standard: "other", - }, - { - name: "SIGPOLL", - number: 29, - action: "terminate", - description: "Watched event", - standard: "other", - }, - { - name: "SIGINFO", - number: 29, - action: "ignore", - description: "Request for process information", - standard: "other", - }, - { - name: "SIGPWR", - number: 30, - action: "terminate", - description: "Device running out of power", - standard: "systemv", - }, - { - name: "SIGSYS", - number: 31, - action: "core", - description: "Invalid system call", - standard: "other", - }, - { - name: "SIGUNUSED", - number: 31, - action: "terminate", - description: "Invalid system call", - standard: "other", - }, - ]; // CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/signals.js - const getSignals = () => { - const realtimeSignals = getRealtimeSignals(); - const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal); - return signals; + module.exports.wrapperForImpl = function (impl) { + return impl[module.exports.wrapperSymbol]; }; - const normalizeSignal = ({ - name, - number: defaultNumber, - description, - action, - forced = false, - standard, - }) => { - const { - signals: { [name]: constantSignal }, - } = external_node_os_namespaceObject.constants; - const supported = constantSignal !== undefined; - const number = supported ? constantSignal : defaultNumber; - return { name, number, description, supported, action, forced, standard }; - }; // CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@4.3.1/node_modules/human-signals/build/src/main.js - const getSignalsByName = () => { - const signals = getSignals(); - return Object.fromEntries(signals.map(getSignalByName)); + module.exports.implForWrapper = function (wrapper) { + return wrapper[module.exports.implSymbol]; }; - const getSignalByName = ({ - name, - number, - description, - supported, - action, - forced, - standard, - }) => [ - name, - { name, number, description, supported, action, forced, standard }, - ]; + /***/ + }, - const signalsByName = getSignalsByName(); + /***/ 2509: /***/ (module) => { + // Returns a wrapper function that returns a wrapped callback + // The wrapper function should do some stuff, and return a + // presumably different callback function. + // This makes sure that own properties are retained, so that + // decorations and such are not lost along the way. + module.exports = wrappy; + function wrappy(fn, cb) { + if (fn && cb) return wrappy(fn)(cb); - const getSignalsByNumber = () => { - const signals = getSignals(); - const length = SIGRTMAX + 1; - const signalsA = Array.from({ length }, (value, number) => - getSignalByNumber(number, signals) - ); + if (typeof fn !== "function") + throw new TypeError("need wrapper function"); - return Object.assign({}, ...signalsA); - }; + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k]; + }); - const getSignalByNumber = (number, signals) => { - const signal = findSignalByNumber(number, signals); + return wrapper; - if (signal === undefined) { - return {}; + function wrapper() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var ret = fn.apply(this, args); + var cb = args[args.length - 1]; + if (typeof ret === "function" && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k]; + }); + } + return ret; } + } - const { name, description, supported, action, forced, standard } = signal; - return { - [number]: { - name, - number, - description, - supported, - action, - forced, - standard, - }, + /***/ + }, + + /***/ 2224: /***/ (module) => { + module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } }; }; - const findSignalByNumber = (number, signals) => { - const signal = signals.find( - ({ name }) => - external_node_os_namespaceObject.constants.signals[name] === number - ); + /***/ + }, - if (signal !== undefined) { - return signal; - } + /***/ 1590: /***/ (module, __unused_webpack_exports, __nccwpck_require__) => { + module.exports = Yallist; - return signals.find((signalA) => signalA.number === number); - }; + Yallist.Node = Node; + Yallist.create = Yallist; - const signalsByNumber = getSignalsByNumber(); // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/error.js - const getErrorPrefix = ({ - timedOut, - timeout, - errorCode, - signal, - signalDescription, - exitCode, - isCanceled, - }) => { - if (timedOut) { - return `timed out after ${timeout} milliseconds`; + function Yallist(list) { + var self = this; + if (!(self instanceof Yallist)) { + self = new Yallist(); } - if (isCanceled) { - return "was canceled"; - } + self.tail = null; + self.head = null; + self.length = 0; - if (errorCode !== undefined) { - return `failed with ${errorCode}`; + if (list && typeof list.forEach === "function") { + list.forEach(function (item) { + self.push(item); + }); + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]); + } } - if (signal !== undefined) { - return `was killed with ${signal} (${signalDescription})`; - } + return self; + } - if (exitCode !== undefined) { - return `failed with exit code ${exitCode}`; + Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); } - return "failed"; - }; + var next = node.next; + var prev = node.prev; - const makeError = ({ - stdout, - stderr, - all, - error, - signal, - exitCode, - command, - escapedCommand, - timedOut, - isCanceled, - killed, - parsed: { - options: { timeout }, - }, - }) => { - // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. - // We normalize them to `undefined` - exitCode = exitCode === null ? undefined : exitCode; - signal = signal === null ? undefined : signal; - const signalDescription = - signal === undefined ? undefined : signalsByName[signal].description; - - const errorCode = error && error.code; - - const prefix = getErrorPrefix({ - timedOut, - timeout, - errorCode, - signal, - signalDescription, - exitCode, - isCanceled, - }); - const execaMessage = `Command ${prefix}: ${command}`; - const isError = - Object.prototype.toString.call(error) === "[object Error]"; - const shortMessage = isError - ? `${execaMessage}\n${error.message}` - : execaMessage; - const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n"); - - if (isError) { - error.originalMessage = error.message; - error.message = message; - } else { - error = new Error(message); + if (next) { + next.prev = prev; } - error.shortMessage = shortMessage; - error.command = command; - error.escapedCommand = escapedCommand; - error.exitCode = exitCode; - error.signal = signal; - error.signalDescription = signalDescription; - error.stdout = stdout; - error.stderr = stderr; - - if (all !== undefined) { - error.all = all; + if (prev) { + prev.next = next; } - if ("bufferedData" in error) { - delete error.bufferedData; + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; } - error.failed = true; - error.timedOut = Boolean(timedOut); - error.isCanceled = isCanceled; - error.killed = killed && !timedOut; - - return error; - }; // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/stdio.js - - const aliases = ["stdin", "stdout", "stderr"]; + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; - const hasAlias = (options) => - aliases.some((alias) => options[alias] !== undefined); + return next; + }; - const normalizeStdio = (options) => { - if (!options) { + Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { return; } - const { stdio } = options; - - if (stdio === undefined) { - return aliases.map((alias) => options[alias]); - } - - if (hasAlias(options)) { - throw new Error( - `It's not possible to provide \`stdio\` in combination with one of ${aliases - .map((alias) => `\`${alias}\``) - .join(", ")}` - ); + if (node.list) { + node.list.removeNode(node); } - if (typeof stdio === "string") { - return stdio; + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; } - if (!Array.isArray(stdio)) { - throw new TypeError( - `Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\`` - ); + this.head = node; + if (!this.tail) { + this.tail = node; } - - const length = Math.max(stdio.length, aliases.length); - return Array.from({ length }, (value, index) => stdio[index]); + this.length++; }; - // `ipc` is pushed unless it is already present - const stdio_normalizeStdioNode = (options) => { - const stdio = normalizeStdio(options); - - if (stdio === "ipc") { - return "ipc"; + Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return; } - if (stdio === undefined || typeof stdio === "string") { - return [stdio, stdio, stdio, "ipc"]; + if (node.list) { + node.list.removeNode(node); } - if (stdio.includes("ipc")) { - return stdio; + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; } - return [...stdio, "ipc"]; - }; - - // EXTERNAL MODULE: ./node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js - var signal_exit = __nccwpck_require__(3289); // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/kill.js - const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - - // Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior - const spawnedKill = (kill, signal = "SIGTERM", options = {}) => { - const killResult = kill(signal); - setKillTimeout(kill, signal, options, killResult); - return killResult; + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; }; - const setKillTimeout = (kill, signal, options, killResult) => { - if (!shouldForceKill(signal, options, killResult)) { - return; + Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]); } + return this.length; + }; - const timeout = getForceKillAfterTimeout(options); - const t = setTimeout(() => { - kill("SIGKILL"); - }, timeout); - - // Guarded because there's no `.unref()` when `execa` is used in the renderer - // process in Electron. This cannot be tested since we don't run tests in - // Electron. - // istanbul ignore else - if (t.unref) { - t.unref(); + Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]); } + return this.length; }; - const shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => - isSigterm(signal) && forceKillAfterTimeout !== false && killResult; - - const isSigterm = (signal) => - signal === external_node_os_namespaceObject.constants.signals.SIGTERM || - (typeof signal === "string" && signal.toUpperCase() === "SIGTERM"); - - const getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => { - if (forceKillAfterTimeout === true) { - return DEFAULT_FORCE_KILL_TIMEOUT; + Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined; } - if ( - !Number.isFinite(forceKillAfterTimeout) || - forceKillAfterTimeout < 0 - ) { - throw new TypeError( - `Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})` - ); + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; } - - return forceKillAfterTimeout; + this.length--; + return res; }; - // `childProcess.cancel()` - const spawnedCancel = (spawned, context) => { - const killResult = spawned.kill(); - - if (killResult) { - context.isCanceled = true; + Yallist.prototype.shift = function () { + if (!this.head) { + return undefined; } - }; - const timeoutKill = (spawned, signal, reject) => { - spawned.kill(signal); - reject(Object.assign(new Error("Timed out"), { timedOut: true, signal })); + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; }; - // `timeout` option handling - const setupTimeout = ( - spawned, - { timeout, killSignal = "SIGTERM" }, - spawnedPromise - ) => { - if (timeout === 0 || timeout === undefined) { - return spawnedPromise; - } - - let timeoutId; - const timeoutPromise = new Promise((resolve, reject) => { - timeoutId = setTimeout(() => { - timeoutKill(spawned, killSignal, reject); - }, timeout); - }); - - const safeSpawnedPromise = spawnedPromise.finally(() => { - clearTimeout(timeoutId); - }); - - return Promise.race([timeoutPromise, safeSpawnedPromise]); + Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this; + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } }; - const validateTimeout = ({ timeout }) => { - if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) { - throw new TypeError( - `Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})` - ); + Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; } }; - // `cleanup` option handling - const setExitHandler = async ( - spawned, - { cleanup, detached }, - timedPromise - ) => { - if (!cleanup || detached) { - return timedPromise; + Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next; } - - const removeExitHandler = signal_exit(() => { - spawned.kill(); - }); - - return timedPromise.finally(() => { - removeExitHandler(); - }); - }; // CONCATENATED MODULE: external "node:fs" - - const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire( - import.meta.url - )("node:fs"); // CONCATENATED MODULE: ./node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js - function isStream(stream) { - return ( - stream !== null && - typeof stream === "object" && - typeof stream.pipe === "function" - ); - } - - function isWritableStream(stream) { - return ( - isStream(stream) && - stream.writable !== false && - typeof stream._write === "function" && - typeof stream._writableState === "object" - ); - } - - function isReadableStream(stream) { - return ( - isStream(stream) && - stream.readable !== false && - typeof stream._read === "function" && - typeof stream._readableState === "object" - ); - } - - function isDuplexStream(stream) { - return isWritableStream(stream) && isReadableStream(stream); - } - - function isTransformStream(stream) { - return isDuplexStream(stream) && typeof stream._transform === "function"; - } // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/pipe.js - - const isExecaChildProcess = (target) => - target instanceof - external_node_child_process_namespaceObject.ChildProcess && - typeof target.then === "function"; - - const pipeToTarget = (spawned, streamName, target) => { - if (typeof target === "string") { - spawned[streamName].pipe( - (0, external_node_fs_namespaceObject.createWriteStream)(target) - ); - return spawned; + if (i === n && walker !== null) { + return walker.value; } + }; - if (isWritableStream(target)) { - spawned[streamName].pipe(target); - return spawned; + Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev; } - - if (!isExecaChildProcess(target)) { - throw new TypeError( - "The second argument must be a string, a stream or an Execa child process." - ); + if (i === n && walker !== null) { + return walker.value; } + }; - if (!isWritableStream(target.stdin)) { - throw new TypeError( - "The target child process's stdin must be available." - ); + Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; } - - spawned[streamName].pipe(target.stdin); - return target; + return res; }; - const addPipeMethods = (spawned) => { - if (spawned.stdout !== null) { - spawned.pipeStdout = pipeToTarget.bind(undefined, spawned, "stdout"); + Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.tail; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; } + return res; + }; - if (spawned.stderr !== null) { - spawned.pipeStderr = pipeToTarget.bind(undefined, spawned, "stderr"); + Yallist.prototype.reduce = function (fn, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); } - if (spawned.all !== undefined) { - spawned.pipeAll = pipeToTarget.bind(undefined, spawned, "all"); + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; } + + return acc; }; - // EXTERNAL MODULE: ./node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js - var get_stream = __nccwpck_require__(1049); - // EXTERNAL MODULE: ./node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js - var merge_stream = __nccwpck_require__(237); // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/stream.js - const validateInputOptions = (input) => { - if (input !== undefined) { - throw new TypeError( - "The `input` and `inputFile` options cannot be both set." - ); + Yallist.prototype.reduceReverse = function (fn, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); } - }; - const getInputSync = ({ input, inputFile }) => { - if (typeof inputFile !== "string") { - return input; + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; } - validateInputOptions(input); - return (0, external_node_fs_namespaceObject.readFileSync)(inputFile); + return acc; }; - // `input` and `inputFile` option in sync mode - const handleInputSync = (options) => { - const input = getInputSync(options); - - if (isStream(input)) { - throw new TypeError( - "The `input` option cannot be a stream in sync mode" - ); + Yallist.prototype.toArray = function () { + var arr = new Array(this.length); + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.next; } - - return input; + return arr; }; - const getInput = ({ input, inputFile }) => { - if (typeof inputFile !== "string") { - return input; + Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length); + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.prev; } - - validateInputOptions(input); - return (0, external_node_fs_namespaceObject.createReadStream)(inputFile); + return arr; }; - // `input` and `inputFile` option in async mode - const handleInput = (spawned, options) => { - const input = getInput(options); - - if (input === undefined) { - return; + Yallist.prototype.slice = function (from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next; + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value); } + return ret; }; - // `all` interleaves `stdout` and `stderr` - const makeAllStream = (spawned, { all }) => { - if (!all || (!spawned.stdout && !spawned.stderr)) { - return; + Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; } - - const mixed = merge_stream(); - - if (spawned.stdout) { - mixed.add(spawned.stdout); + from = from || 0; + if (from < 0) { + from += this.length; } - - if (spawned.stderr) { - mixed.add(spawned.stderr); + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; } - - return mixed; + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for ( + var i = this.length, walker = this.tail; + walker !== null && i > to; + i-- + ) { + walker = walker.prev; + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; }; - // On failure, `result.stdout|stderr|all` should contain the currently buffered stream - const getBufferedData = async (stream, streamPromise) => { - // When `buffer` is `false`, `streamPromise` is `undefined` and there is no buffered data to retrieve - if (!stream || streamPromise === undefined) { - return; + Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; } - stream.destroy(); - - try { - return await streamPromise; - } catch (error) { - return error.bufferedData; + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next; } - }; - const getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => { - if (!stream || !buffer) { - return; + var ret = []; + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (walker === null) { + walker = this.tail; } - if (encoding) { - return get_stream(stream, { encoding, maxBuffer }); + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev; } - return get_stream.buffer(stream, { maxBuffer }); + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]); + } + return ret; }; - // Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) - const getSpawnedResult = async ( - { stdout, stderr, all }, - { encoding, buffer, maxBuffer }, - processDone - ) => { - const stdoutPromise = getStreamPromise(stdout, { - encoding, - buffer, - maxBuffer, - }); - const stderrPromise = getStreamPromise(stderr, { - encoding, - buffer, - maxBuffer, - }); - const allPromise = getStreamPromise(all, { - encoding, - buffer, - maxBuffer: maxBuffer * 2, - }); - - try { - return await Promise.all([ - processDone, - stdoutPromise, - stderrPromise, - allPromise, - ]); - } catch (error) { - return Promise.all([ - { error, signal: error.signal, timedOut: error.timedOut }, - getBufferedData(stdout, stdoutPromise), - getBufferedData(stderr, stderrPromise), - getBufferedData(all, allPromise), - ]); + Yallist.prototype.reverse = function () { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev; + walker.prev = walker.next; + walker.next = p; } - }; // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/promise.js - - // eslint-disable-next-line unicorn/prefer-top-level-await - const nativePromisePrototype = (async () => {})().constructor.prototype; - - const descriptors = ["then", "catch", "finally"].map((property) => [ - property, - Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property), - ]); + this.head = tail; + this.tail = head; + return this; + }; - // The return value is a mixin of `childProcess` and `Promise` - const mergePromise = (spawned, promise) => { - for (const [property, descriptor] of descriptors) { - // Starting the main `promise` is deferred to avoid consuming streams - const value = - typeof promise === "function" - ? (...args) => Reflect.apply(descriptor.value, promise(), args) - : descriptor.value.bind(promise); + function insert(self, node, value) { + var inserted = + node === self.head + ? new Node(value, null, node, self) + : new Node(value, node, node.next, self); - Reflect.defineProperty(spawned, property, { ...descriptor, value }); + if (inserted.next === null) { + self.tail = inserted; + } + if (inserted.prev === null) { + self.head = inserted; } - }; - // Use promises instead of `child_process` events - const getSpawnedPromise = (spawned) => - new Promise((resolve, reject) => { - spawned.on("exit", (exitCode, signal) => { - resolve({ exitCode, signal }); - }); + self.length++; - spawned.on("error", (error) => { - reject(error); - }); + return inserted; + } - if (spawned.stdin) { - spawned.stdin.on("error", (error) => { - reject(error); - }); - } - }); // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/command.js + function push(self, item) { + self.tail = new Node(item, self.tail, null, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; + } - const normalizeArgs = (file, args = []) => { - if (!Array.isArray(args)) { - return [file]; + function unshift(self, item) { + self.head = new Node(item, null, self.head, self); + if (!self.tail) { + self.tail = self.head; } + self.length++; + } - return [file, ...args]; - }; + function Node(value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list); + } - const NO_ESCAPE_REGEXP = /^[\w.-]+$/; - const DOUBLE_QUOTES_REGEXP = /"/g; + this.list = list; + this.value = value; - const escapeArg = (arg) => { - if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) { - return arg; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; } - return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; - }; + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } + } - const joinCommand = (file, args) => normalizeArgs(file, args).join(" "); + try { + // add if support for Symbol.iterator is present + __nccwpck_require__(2224)(Yallist); + } catch (er) {} - const getEscapedCommand = (file, args) => - normalizeArgs(file, args) - .map((arg) => escapeArg(arg)) - .join(" "); + /***/ + }, - const SPACES_REGEXP = / +/g; - - // Handle `execaCommand()` - const command_parseCommand = (command) => { - const tokens = []; - for (const token of command.trim().split(SPACES_REGEXP)) { - // Allow spaces to be escaped by a backslash if not meant as a delimiter - const previousToken = tokens[tokens.length - 1]; - if (previousToken && previousToken.endsWith("\\")) { - // Merge previous token with current one - tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; - } else { - tokens.push(token); - } - } + /***/ 4034: /***/ ( + __unused_webpack_module, + __webpack_exports__, + __nccwpck_require__ + ) => { + /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { + /* harmony export */ F: () => /* binding */ commentDisclaimer, + /* harmony export */ v: () => /* binding */ commentPrefix, + /* harmony export */ + }); + const commentDisclaimer = [ + `> 🤖 Beep boop! This comment was added automatically by [all-contributors-auto-action](https://github.com/marketplace/actions/all-contributors-auto-action).`, + `> Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.`, + `> ...and of course, thank you for contributing! 💙`, + ].join("\n"); + const commentPrefix = "@all-contributors please add"; - return tokens; - }; + /***/ + }, - const parseExpression = (expression) => { - const typeOfExpression = typeof expression; + /***/ 9187: /***/ ( + __unused_webpack_module, + __webpack_exports__, + __nccwpck_require__ + ) => { + /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { + /* harmony export */ l: () => /* binding */ doesPullAlreadyHaveComment, + /* harmony export */ + }); + /* harmony import */ var _comments_js__WEBPACK_IMPORTED_MODULE_0__ = + __nccwpck_require__(4034); - if (typeOfExpression === "string") { - return expression; - } + async function doesPullAlreadyHaveComment(octokit, locator, id) { + const existingComments = await octokit.request( + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", + { + ...locator, + issue_number: id, + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + } + ); + return existingComments.data.find(({ body }) => + body?.includes( + _comments_js__WEBPACK_IMPORTED_MODULE_0__ /* .commentPrefix */.v + ) + ); + } - if (typeOfExpression === "number") { - return String(expression); - } + /***/ + }, - if ( - typeOfExpression === "object" && - expression !== null && - !( - expression instanceof - external_node_child_process_namespaceObject.ChildProcess - ) && - "stdout" in expression - ) { - const typeOfStdout = typeof expression.stdout; + /***/ 4336: /***/ ( + __unused_webpack_module, + __webpack_exports__, + __nccwpck_require__ + ) => { + // EXPORTS + __nccwpck_require__.d(__webpack_exports__, { + F: () => /* binding */ getExistingContributors, + }); - if (typeOfStdout === "string") { - return expression.stdout; - } + // EXTERNAL MODULE: ./node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/core.js + var core = __nccwpck_require__(7733); // CONCATENATED MODULE: ./src/dataIsRepoFile.ts + function dataIsRepoFile(data) { + return ( + typeof data === "object" && + !!data && + "type" in data && + data.type === "file" && + "content" in data + ); + } // CONCATENATED MODULE: ./src/getExistingContributors.ts - if ( - external_node_buffer_namespaceObject.Buffer.isBuffer( - expression.stdout - ) - ) { - return expression.stdout.toString(); + const contributorsConfigFile = ".all-contributorsrc"; + async function getExistingContributors(octokit, locator) { + const { data } = await octokit.request( + "GET /repos/{owner}/{repo}/contents/{path}", + { + ...locator, + path: contributorsConfigFile, + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, } - - throw new TypeError( - `Unexpected "${typeOfStdout}" stdout in template expression` + ); + if (!dataIsRepoFile(data)) { + throw new Error( + `${contributorsConfigFile} does not seem to exist as a file in this repository?` ); } - - throw new TypeError( - `Unexpected "${typeOfExpression}" in template expression` + const contents = Buffer.from(data.content, data.encoding).toString(); + const allContributorsConfig = JSON.parse(contents); + core.debug( + `Retrieved allcontributors config: ${JSON.stringify( + allContributorsConfig + )}` ); - }; - - const concatTokens = (tokens, nextTokens, isNew) => - isNew || tokens.length === 0 || nextTokens.length === 0 - ? [...tokens, ...nextTokens] - : [ - ...tokens.slice(0, -1), - `${tokens[tokens.length - 1]}${nextTokens[0]}`, - ...nextTokens.slice(1), - ]; - - const parseTemplate = ({ - templates, - expressions, - tokens, - index, - template, - }) => { - const templateString = template ?? templates.raw[index]; - const templateTokens = templateString - .split(SPACES_REGEXP) - .filter(Boolean); - const newTokens = concatTokens( - tokens, - templateTokens, - templateString.startsWith(" ") + return Object.fromEntries( + allContributorsConfig.contributors?.map((contributor) => [ + contributor.login.toLowerCase(), + new Set(contributor.contributions), + ]) ?? [] ); + } - if (index === expressions.length) { - return newTokens; - } + /***/ + }, - const expression = expressions[index]; - const expressionTokens = Array.isArray(expression) - ? expression.map((expression) => parseExpression(expression)) - : [parseExpression(expression)]; - return concatTokens( - newTokens, - expressionTokens, - templateString.endsWith(" ") + /***/ 5050: /***/ ( + __unused_webpack_module, + __webpack_exports__, + __nccwpck_require__ + ) => { + /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { + /* harmony export */ D: () => /* binding */ getMissingContributions, + /* harmony export */ + }); + function getMissingContributions( + contributor, + contributions, + existingContributors + ) { + const existingContributions = existingContributors[contributor]; + if (!existingContributions) { + return contributions; + } + return Object.fromEntries( + Object.entries(contributions) + .filter(([type]) => !existingContributions.has(type)) + .map(([type, ids]) => [type, Array.from(ids).sort()]) ); - }; - - const parseTemplates = (templates, expressions) => { - let tokens = []; - - for (const [index, template] of templates.entries()) { - tokens = parseTemplate({ - templates, - expressions, - tokens, - index, - template, - }); - } + } - return tokens; - }; // CONCATENATED MODULE: external "node:util" + /***/ + }, - const external_node_util_namespaceObject = __WEBPACK_EXTERNAL_createRequire( - import.meta.url - )("node:util"); // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/verbose.js - const verboseDefault = (0, external_node_util_namespaceObject.debuglog)( - "execa" - ).enabled; + /***/ 474: /***/ ( + module, + __unused_webpack___webpack_exports__, + __nccwpck_require__ + ) => { + __nccwpck_require__.a( + module, + async ( + __webpack_handle_async_dependencies__, + __webpack_async_result__ + ) => { + try { + /* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = + __nccwpck_require__(7733); + /* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0___default = + /*#__PURE__*/ __nccwpck_require__.n( + _actions_core__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var _actions_github__WEBPACK_IMPORTED_MODULE_1__ = + __nccwpck_require__(3695); + /* harmony import */ var _actions_github__WEBPACK_IMPORTED_MODULE_1___default = + /*#__PURE__*/ __nccwpck_require__.n( + _actions_github__WEBPACK_IMPORTED_MODULE_1__ + ); + /* harmony import */ var all_contributors_for_repository__WEBPACK_IMPORTED_MODULE_2__ = + __nccwpck_require__(6105); + /* harmony import */ var _comments_js__WEBPACK_IMPORTED_MODULE_3__ = + __nccwpck_require__(4034); + /* harmony import */ var _doesPullAlreadyHaveComment_js__WEBPACK_IMPORTED_MODULE_4__ = + __nccwpck_require__(9187); + /* harmony import */ var _getExistingContributors_js__WEBPACK_IMPORTED_MODULE_5__ = + __nccwpck_require__(4336); + /* harmony import */ var _getMissingContributions_js__WEBPACK_IMPORTED_MODULE_6__ = + __nccwpck_require__(5050); - const padField = (field, padding) => String(field).padStart(padding, "0"); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + "About to retrieve contributors..." + ); + const githubToken = process.env.GITHUB_TOKEN; + if (!githubToken) { + throw new Error("Missing process.env.GITHUB_TOKEN :("); + } + const { repo: locator } = + _actions_github__WEBPACK_IMPORTED_MODULE_1__.context; + const octokit = + _actions_github__WEBPACK_IMPORTED_MODULE_1__.getOctokit( + githubToken + ); + const contributors = await (0, + all_contributors_for_repository__WEBPACK_IMPORTED_MODULE_2__ /* .createAllContributorsForRepository */.J)( + { + auth: githubToken, + ...locator, + } + ); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `Retrieved contributors: ${JSON.stringify(contributors)}` + ); + const existingContributors = await (0, + _getExistingContributors_js__WEBPACK_IMPORTED_MODULE_5__ /* .getExistingContributors */.F)( + octokit, + locator + ); + for (const [contributor, contributions] of Object.entries( + contributors + )) { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `Retrieving missing contributions for contributor: ${contributor}` + ); + const missingContributions = (0, + _getMissingContributions_js__WEBPACK_IMPORTED_MODULE_6__ /* .getMissingContributions */.D)( + contributor, + contributions, + existingContributors + ); + if (!Object.keys(missingContributions).length) { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `${contributor} is not missing any contributions.` + ); + continue; + } + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `${contributor} is missing: ${JSON.stringify( + missingContributions + )}` + ); + for (const [type, ids] of Object.entries(missingContributions)) { + const latestId = ids[ids.length - 1]; + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `Checking for existing ${contributor} comment: ${latestId}` + ); + const existingComment = await (0, + _doesPullAlreadyHaveComment_js__WEBPACK_IMPORTED_MODULE_4__ /* .doesPullAlreadyHaveComment */.l)( + octokit, + locator, + latestId + ); + if (existingComment) { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `${latestId} already has a comment: ${existingComment.id}` + ); + continue; + } + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `${latestId} doesn't already have a comment; posting a new one.` + ); + const commentRequestArgs = [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/comments", + { + ...locator, + issue_number: latestId, + body: [ + `${ + _comments_js__WEBPACK_IMPORTED_MODULE_3__ /* .commentPrefix */.v + } @${contributor} for ${type}.`, + _comments_js__WEBPACK_IMPORTED_MODULE_3__ /* .commentDisclaimer */.F, + ].join("\n\n"), + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + }, + ]; + if (process.env.LOCAL_TESTING === "true") { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `LOCAL_TESTING: ${JSON.stringify(commentRequestArgs)}` + ); + } else { + // TODO: It'd be nice to deduplicate these comments. + // PRs that include multiple types will cause multiple comments... + const newComment = await octokit.request(...commentRequestArgs); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.debug( + `Posted comment ${newComment.data.id} for ${latestId}.` + ); + } + console.log( + "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" + ); + } + } - const getTimestamp = () => { - const date = new Date(); - return `${padField(date.getHours(), 2)}:${padField( - date.getMinutes(), - 2 - )}:${padField(date.getSeconds(), 2)}.${padField( - date.getMilliseconds(), - 3 - )}`; - }; + __webpack_async_result__(); + } catch (e) { + __webpack_async_result__(e); + } + }, + 1 + ); - const logCommand = (escapedCommand, { verbose }) => { - if (!verbose) { - return; - } + /***/ + }, - external_node_process_namespaceObject.stderr.write( - `[${getTimestamp()}] ${escapedCommand}\n` - ); - }; // CONCATENATED MODULE: ./node_modules/.pnpm/execa@7.1.1/node_modules/execa/index.js + /***/ 326: /***/ (module) => { + module.exports = eval("require")("encoding"); - const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; + /***/ + }, - const getEnv = ({ - env: envOption, - extendEnv, - preferLocal, - localDir, - execPath, - }) => { - const env = extendEnv - ? { ...external_node_process_namespaceObject.env, ...envOption } - : envOption; + /***/ 9491: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( + "assert" + ); - if (preferLocal) { - return npmRunPathEnv({ env, cwd: localDir, execPath }); - } + /***/ + }, - return env; - }; + /***/ 4300: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( + "buffer" + ); - const handleArguments = (file, args, options = {}) => { - const parsed = cross_spawn._parse(file, args, options); - file = parsed.command; - args = parsed.args; - options = parsed.options; + /***/ + }, - options = { - maxBuffer: DEFAULT_MAX_BUFFER, - buffer: true, - stripFinalNewline: true, - extendEnv: true, - preferLocal: false, - localDir: options.cwd || external_node_process_namespaceObject.cwd(), - execPath: external_node_process_namespaceObject.execPath, - encoding: "utf8", - reject: true, - cleanup: true, - all: false, - windowsHide: true, - verbose: verboseDefault, - ...options, - }; + /***/ 6113: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( + "crypto" + ); - options.env = getEnv(options); + /***/ + }, - options.stdio = normalizeStdio(options); + /***/ 2361: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( + "events" + ); - if ( - external_node_process_namespaceObject.platform === "win32" && - external_node_path_namespaceObject.basename(file, ".exe") === "cmd" - ) { - // #116 - args.unshift("/q"); - } + /***/ + }, - return { file, args, options, parsed }; - }; + /***/ 7147: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); - const handleOutput = (options, value, error) => { - if ( - typeof value !== "string" && - !external_node_buffer_namespaceObject.Buffer.isBuffer(value) - ) { - // When `execaSync()` errors, we normalize it to '' to mimic `execa()` - return error === undefined ? undefined : ""; - } + /***/ + }, - if (options.stripFinalNewline) { - return stripFinalNewline(value); - } + /***/ 3685: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); - return value; - }; + /***/ + }, - function execa(file, args, options) { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - const escapedCommand = getEscapedCommand(file, args); - logCommand(escapedCommand, parsed.options); + /***/ 5687: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); - validateTimeout(parsed.options); + /***/ + }, - let spawned; - try { - spawned = external_node_child_process_namespaceObject.spawn( - parsed.file, - parsed.args, - parsed.options - ); - } catch (error) { - // Ensure the returned error is always both a promise and a child process - const dummySpawned = - new external_node_child_process_namespaceObject.ChildProcess(); - const errorPromise = Promise.reject( - makeError({ - error, - stdout: "", - stderr: "", - all: "", - command, - escapedCommand, - parsed, - timedOut: false, - isCanceled: false, - killed: false, - }) - ); - mergePromise(dummySpawned, errorPromise); - return dummySpawned; - } + /***/ 1808: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); - const spawnedPromise = getSpawnedPromise(spawned); - const timedPromise = setupTimeout( - spawned, - parsed.options, - spawnedPromise - ); - const processDone = setExitHandler(spawned, parsed.options, timedPromise); - - const context = { isCanceled: false }; - - spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); - spawned.cancel = spawnedCancel.bind(null, spawned, context); - - const handlePromise = async () => { - const [ - { error, exitCode, signal, timedOut }, - stdoutResult, - stderrResult, - allResult, - ] = await getSpawnedResult(spawned, parsed.options, processDone); - const stdout = handleOutput(parsed.options, stdoutResult); - const stderr = handleOutput(parsed.options, stderrResult); - const all = handleOutput(parsed.options, allResult); - - if (error || exitCode !== 0 || signal !== null) { - const returnedError = makeError({ - error, - exitCode, - signal, - stdout, - stderr, - all, - command, - escapedCommand, - parsed, - timedOut, - isCanceled: - context.isCanceled || - (parsed.options.signal ? parsed.options.signal.aborted : false), - killed: spawned.killed, - }); + /***/ + }, - if (!parsed.options.reject) { - return returnedError; - } + /***/ 2037: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); - throw returnedError; - } + /***/ + }, - return { - command, - escapedCommand, - exitCode: 0, - stdout, - stderr, - all, - failed: false, - timedOut: false, - isCanceled: false, - killed: false, - }; - }; + /***/ 1017: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); - const handlePromiseOnce = node_modules_onetime(handlePromise); + /***/ + }, - handleInput(spawned, parsed.options); + /***/ 5477: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( + "punycode" + ); - spawned.all = makeAllStream(spawned, parsed.options); + /***/ + }, - addPipeMethods(spawned); - mergePromise(spawned, handlePromiseOnce); - return spawned; - } + /***/ 2781: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)( + "stream" + ); - function execaSync(file, args, options) { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - const escapedCommand = getEscapedCommand(file, args); - logCommand(escapedCommand, parsed.options); + /***/ + }, - const input = handleInputSync(parsed.options); + /***/ 4404: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); - let result; - try { - result = external_node_child_process_namespaceObject.spawnSync( - parsed.file, - parsed.args, - { ...parsed.options, input } - ); - } catch (error) { - throw makeError({ - error, - stdout: "", - stderr: "", - all: "", - command, - escapedCommand, - parsed, - timedOut: false, - isCanceled: false, - killed: false, - }); - } + /***/ + }, - const stdout = handleOutput(parsed.options, result.stdout, result.error); - const stderr = handleOutput(parsed.options, result.stderr, result.error); - - if (result.error || result.status !== 0 || result.signal !== null) { - const error = makeError({ - stdout, - stderr, - error: result.error, - signal: result.signal, - exitCode: result.status, - command, - escapedCommand, - parsed, - timedOut: result.error && result.error.code === "ETIMEDOUT", - isCanceled: false, - killed: result.signal !== null, - }); + /***/ 7310: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); - if (!parsed.options.reject) { - return error; - } + /***/ + }, - throw error; - } + /***/ 3837: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); - return { - command, - escapedCommand, - exitCode: 0, - stdout, - stderr, - failed: false, - timedOut: false, - isCanceled: false, - killed: false, - }; - } + /***/ + }, - const normalizeScriptStdin = ({ input, inputFile, stdio }) => - input === undefined && inputFile === undefined && stdio === undefined - ? { stdin: "inherit" } - : {}; + /***/ 9796: /***/ (module) => { + module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); - const normalizeScriptOptions = (options = {}) => ({ - preferLocal: true, - ...normalizeScriptStdin(options), - ...options, - }); + /***/ + }, - function create$(options) { - function $(templatesOrOptions, ...expressions) { - if (!Array.isArray(templatesOrOptions)) { - return create$({ ...options, ...templatesOrOptions }); - } + /***/ 6105: /***/ ( + __unused_webpack___webpack_module__, + __webpack_exports__, + __nccwpck_require__ + ) => { + // EXPORTS + __nccwpck_require__.d(__webpack_exports__, { + J: () => /* reexport */ createAllContributorsForRepository, + }); // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/Contributor.js - const [file, ...args] = parseTemplates(templatesOrOptions, expressions); - return execa(file, args, normalizeScriptOptions(options)); + class Contributor { + constructor() { + this.contributions = {}; } - - $.sync = (templates, ...expressions) => { - if (!Array.isArray(templates)) { + add(number, type) { + (this.contributions[type] ??= new Set()).add(number); + } + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/ContributorsCollection.js + //# sourceMappingURL=Contributor.js.map + var __classPrivateFieldSet = + (undefined && undefined.__classPrivateFieldSet) || + function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a setter"); + if ( + typeof state === "function" + ? receiver !== state || !f + : !state.has(receiver) + ) throw new TypeError( - "Please use $(options).sync`command` instead of $.sync(options)`command`." + "Cannot write private member to an object whose class did not declare it" ); - } - - const [file, ...args] = parseTemplates(templates, expressions); - return execaSync(file, args, normalizeScriptOptions(options)); + return ( + kind === "a" + ? f.call(receiver, value) + : f + ? (f.value = value) + : state.set(receiver, value), + value + ); }; + var __classPrivateFieldGet = + (undefined && undefined.__classPrivateFieldGet) || + function (receiver, state, kind, f) { + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a getter"); + if ( + typeof state === "function" + ? receiver !== state || !f + : !state.has(receiver) + ) + throw new TypeError( + "Cannot read private member from an object whose class did not declare it" + ); + return kind === "m" + ? f + : kind === "a" + ? f.call(receiver) + : f + ? f.value + : state.get(receiver); + }; + var _ContributorsCollection_contributors, + _ContributorsCollection_ignoredLogins; - return $; - } - - const $ = create$(); - - function execaCommand(command, options) { - const [file, ...args] = parseCommand(command); - return execa(file, args, options); + class ContributorsCollection { + constructor(ignoredLogins) { + _ContributorsCollection_contributors.set(this, {}); + _ContributorsCollection_ignoredLogins.set(this, void 0); + __classPrivateFieldSet( + this, + _ContributorsCollection_ignoredLogins, + ignoredLogins, + "f" + ); + } + add(login, number, type) { + if ( + login && + !__classPrivateFieldGet( + this, + _ContributorsCollection_ignoredLogins, + "f" + ).has(login) + ) { + (__classPrivateFieldGet( + this, + _ContributorsCollection_contributors, + "f" + )[login.toLowerCase()] ??= new Contributor()).add(number, type); + } + } + collect() { + return Object.fromEntries( + Object.entries( + __classPrivateFieldGet( + this, + _ContributorsCollection_contributors, + "f" + ) + ) + .map(([login, contributor]) => [ + login, + Object.fromEntries( + Object.entries(contributor.contributions).map( + ([type, numbers]) => [ + type, + Array.from(numbers).sort((a, b) => a - b), + ] + ) + ), + ]) + .sort(([a], [b]) => a.localeCompare(b)) + ); + } } - - function execaCommandSync(command, options) { - const [file, ...args] = parseCommand(command); - return execaSync(file, args, options); + (_ContributorsCollection_contributors = new WeakMap()), + (_ContributorsCollection_ignoredLogins = new WeakMap()); + //# sourceMappingURL=ContributorsCollection.js.map + // EXTERNAL MODULE: ./node_modules/.pnpm/octokit@2.0.14/node_modules/octokit/dist-node/index.js + var dist_node = __nccwpck_require__(5953); // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/api.js + const perPage = 100; + function createOctokit(auth) { + return new (dist_node /* Octokit.defaults */.vd + .defaults({ + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + per_page: perPage, + }))({ auth }); } - - function execaNode(scriptPath, args, options = {}) { - if (args && !Array.isArray(args) && typeof args === "object") { - options = args; - args = []; + async function paginate(defaults, request) { + const items = []; + for (let i = 0; i < 10; i += 1) { + const response = await request({ + page: i, + per_page: perPage, + ...defaults, + }); + items.push(...response); + if (response.length < 100) { + break; + } } - - const stdio = normalizeStdioNode(options); - const defaultExecArgv = process.execArgv.filter( - (arg) => !arg.startsWith("--inspect") + return items; + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/collectAcceptedIssues.js + //# sourceMappingURL=api.js.map + async function collectAcceptedIssues(defaults, octokit, labelAcceptingPrs) { + const issues = await paginate(defaults, async (options) => { + const response = await octokit.request( + "GET /repos/{owner}/{repo}/issues", + { + ...options, + labels: labelAcceptingPrs, + state: "all", + } + ); + return response.data; + }); + return Object.fromEntries(issues.map((issue) => [issue.number, issue])); + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/collectEvents.js + //# sourceMappingURL=collectAcceptedIssues.js.map + async function collectEvents(defaults, octokit) { + const events = await paginate(defaults, async (options) => { + const eventsResponse = await octokit.request( + "GET /repos/{owner}/{repo}/events", + { + ...options, + state: "all", + } + ); + return eventsResponse.data; + }); + return events; + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/collectIssueEvents.js + //# sourceMappingURL=collectEvents.js.map + const relevantIssueEvents = new Set([ + "assigned", + "locked", + "merged", + "pinned", + "unlocked", + ]); + async function collectIssueEvents(defaults, octokit) { + const issueEvents = await paginate(defaults, async (options) => { + const response = await octokit.request( + "GET /repos/{owner}/{repo}/issues/events", + { + ...options, + state: "all", + } + ); + return response.data; + }); + return issueEvents.filter((issueEvent) => + relevantIssueEvents.has(issueEvent.event) ); - - const { nodePath = process.execPath, nodeOptions = defaultExecArgv } = - options; - - return execa( - nodePath, - [...nodeOptions, scriptPath, ...(Array.isArray(args) ? args : [])], - { + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/collectMergedPulls.js + //# sourceMappingURL=collectIssueEvents.js.map + async function collectMergedPulls(defaults, octokit) { + return await paginate(defaults, async (options) => { + const response = await octokit.request("GET /search/issues", { ...options, - stdin: undefined, - stdout: undefined, - stderr: undefined, - stdio, - shell: false, + q: "repo:JoshuaKGoldberg/template-typescript-node-package+is:pr+is:merged", + }); + return response.data.items; + }); + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/eventIsPullRequestReviewEvent.js + //# sourceMappingURL=collectMergedPulls.js.map + function eventIsPullRequestReviewEvent(event) { + return event.type === "PullRequestReviewEvent" && !!event.issue?.number; + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/parsing/parseMergedPullAuthors.js + //# sourceMappingURL=eventIsPullRequestReviewEvent.js.map + function parseMergedPullAuthors(mergedPull) { + const authors = []; + authors.push(mergedPull.user?.login); + for (const coAuthor of mergedPull.body + ?.match(/co-authored-by:.+/gi) + ?.map((text) => text.match(/@(\S+)/)) ?? []) { + authors.push(coAuthor?.[1]); + } + return authors.filter((author) => !!author); + } + //# sourceMappingURL=parseMergedPullAuthors.js.map + // EXTERNAL MODULE: ./node_modules/.pnpm/conventional-commits-parser@3.2.4/node_modules/conventional-commits-parser/index.js + var conventional_commits_parser = __nccwpck_require__(5228); // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/parsing/parseMergedPullType.js + const allContributorsTypes = new Map([ + ["build", "infra"], + ["ci", "infra"], + ["docs", "doc"], + ["test", "test"], + ]); + function parseMergedPullType(title) { + const { type } = conventional_commits_parser.sync(title); + return (type && allContributorsTypes.get(type)) || "code"; + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/collect/index.js + //# sourceMappingURL=parseMergedPullType.js.map + async function collect(options) { + const contributors = new ContributorsCollection(options.ignoredLogins); + const defaults = { owner: options.owner, repo: options.repo }; + const octokit = createOctokit(options.auth); + const [acceptedIssues, events, issueEvents, mergedPulls] = + await Promise.all([ + collectAcceptedIssues(defaults, octokit, options.labelAcceptingPrs), + collectEvents(defaults, octokit), + collectIssueEvents(defaults, octokit), + collectMergedPulls(defaults, octokit), + ]); + for (const acceptedIssue of Object.values(acceptedIssues)) { + const labels = acceptedIssue.labels.map((label) => + typeof label === "string" ? label : label.name + ); + for (const [labelType, contribution] of [ + // 🐛 `bug`: anybody who filed an issue labeled as accepting PRs and a bug + [options.labelTypeBug, "bug"], + // - 📖 `doc`: authors of merged PRs that address issues labeled as docs + [options.labelTypeDocs, "docs"], + // - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling + [options.labelTypeTool, "tool"], + ]) { + if (labels.some((label) => label === labelType)) { + contributors.add( + acceptedIssue.user?.login, + acceptedIssue.number, + contribution + ); + } } - ); + } + // 💻 `code` & others: all PR authors and co-authors + for (const mergedPull of mergedPulls) { + const authors = parseMergedPullAuthors(mergedPull); + const type = parseMergedPullType(mergedPull.title); + for (const author of authors) { + contributors.add(author, mergedPull.number, type); + } + } + // 🚧 `maintenance`: adding labels to issues and PRs, and merging PRs + const maintainers = new Set(); + for (const event of issueEvents) { + if (event.actor && event.issue) { + contributors.add( + event.actor.login, + event.issue.number, + "maintenance" + ); + maintainers.add(event.actor.login); + } + } + // 👀 `review`: submitting a review for a PR + // (restricted just to users marked as maintainers) + for (const event of events) { + if ( + eventIsPullRequestReviewEvent(event) && + maintainers.has(event.actor.login) + ) { + contributors.add(event.actor.login, event.issue.number, "review"); + } + } + return contributors.collect(); + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/options.js + //# sourceMappingURL=index.js.map + const defaultOptions = { + ignoredLogins: [ + "allcontributors", + "allcontributors[bot]", + "dependabot", + "dependabot[bot]", + "renovate", + "renovate[bot]", + ], + labelAcceptingPrs: "status: accepting prs", + labelTypeBug: "type: bug", + labelTypeDocs: "type: documentation", + labelTypeTool: "area: tooling", + }; + function fillInOptions(rawOptions) { + return { + auth: rawOptions.auth, + ignoredLogins: new Set( + rawOptions.ignoredLogins ?? defaultOptions.ignoredLogins + ), + labelAcceptingPrs: + rawOptions.labelAcceptingPrs ?? defaultOptions.labelAcceptingPrs, + labelTypeBug: rawOptions.labelTypeBug ?? defaultOptions.labelTypeBug, + labelTypeDocs: rawOptions.labelTypeDocs ?? defaultOptions.labelTypeDocs, + labelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool, + owner: rawOptions.owner, + repo: rawOptions.repo, + }; + } // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/createAllContributorsForRepository.js + //# sourceMappingURL=options.js.map + async function createAllContributorsForRepository(rawOptions) { + const options = fillInOptions(rawOptions); + return await collect(options); } + //# sourceMappingURL=createAllContributorsForRepository.js.map // CONCATENATED MODULE: ./node_modules/.pnpm/all-contributors-for-repository@0.0.8/node_modules/all-contributors-for-repository/lib/index.js + + //# sourceMappingURL=index.js.map /***/ }, diff --git a/dist/types.d.ts b/dist/types.d.ts new file mode 100644 index 00000000..ab41737c --- /dev/null +++ b/dist/types.d.ts @@ -0,0 +1,17 @@ +import type * as github from "@actions/github"; +/** + * Note: this is only a partial description of config data. + */ +export interface AllContributorsConfig { + contributors?: Contributor[]; +} +interface Contributor { + contributions: string[]; + login: string; +} +export interface Locator { + owner: string; + repo: string; +} +export type Octokit = ReturnType; +export {}; diff --git a/dist/types.d.ts.map b/dist/types.d.ts.map new file mode 100644 index 00000000..9467702a --- /dev/null +++ b/dist/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/josh/repos/all-contributors-auto-action/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,UAAU,WAAW;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 2bfb7842..50f1fa0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "all-contributors-auto-action", - "version": "0.1.0", + "version": "0.1.1", "description": "Fills in missing allcontributors entries for a repository. 👪", "repository": { "type": "git",